text: /*!
   * OpenUI5
   * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["sap/ui/thirdparty/URI","../Element","sap/base/util/UriParameters","sap/base/Log","sap/base/util/extend","sap/ui/core/ThemeCheck","sap/base/util/LoaderExtensions","sap/ui/thirdparty/jquery","./ThemeHelper"],function(e,r,t,a,n,i,s,o,u){"use strict";var c=window["sap-ui-config"]||{};var l=0;if(c["xx-nosync"]==="warn"||/(?:\?|&)sap-ui-xx-nosync=(?:warn)/.exec(window.location.search)){l=1}if(c["xx-nosync"]===true||c["xx-nosync"]==="true"||/(?:\?|&)sap-ui-xx-nosync=(?:x|X|true)/.exec(window.location.search)){l=2}var f={};var d=null;var m=null;var p=[];var h=[];var g=new e(sap.ui.require.toUrl(""),document.baseURI).origin();var v={};var y=/url[\s]*\('?"?([^\'")]*)'?"?\)/;var b=t.fromQuery(window.location.search).get("sap-ui-xx-no-inline-theming-parameters")!=="true";var w,P;function C(r,t){var a=y.exec(r);if(a){var n=new e(a[1]);if(n.is("relative")){var i=n.absoluteTo(t).normalize().toString();r="url('"+i+"')"}}return r}function x(e,r){var t=y.exec(e);if(t&&t[1]){var n=window.getComputedStyle(document.body||document.documentElement);e=n.getPropertyValue("--"+r+"__asResolvedUrl").trim();if(e){e=JSON.parse(e);var i=s.resolveUI5Url(e);e="url("+JSON.stringify(i)+")"}else{a.error("The parameter '"+r+"' contains a url, but no matching resolved-url CSS variable could be found.")}}return e}function S(e,r,t){for(var a in r){if(typeof e[a]==="undefined"){e[a]=C(r[a],t)}}return e}function U(e,r){if(typeof e["default"]!=="object"){e={default:e,scopes:{}}}d=d||{};d["default"]=d["default"]||{};d["scopes"]=d["scopes"]||{};S(d["default"],e["default"],r);if(typeof e["scopes"]==="object"){for(var t in e["scopes"]){d["scopes"][t]=d["scopes"][t]||{};S(d["scopes"][t],e["scopes"][t],r)}}var n=Object.keys(d["scopes"]);if(n.length){if(n.length>1){a.error("There are multiple theming parameter scopes available but only a single scope is supported. Only the first scope '"+n[0]+"' is used for retrieval of parameters.")}if(!w){P=document.createElement("span");P.classList.add(n[0]);document.documentElement.appendChild(P);w=window.getComputedStyle(P)}}}function j(e){o("link[id^=sap-ui-theme-]").each(function(){e(this.getAttribute("id"))})}function L(e){if(I(e)){return false}var r=T(e);var t=i.checkStyle(e);if(!t){a.warning("Parameters have been requested but theme is not applied, yet.","sap.ui.core.theming.Parameters")}if(t&&b){var n=o(document.getElementById(e));var s=n.css("background-image");var u=/\(["']?data:text\/plain;utf-8,(.*?)['"]?\)$/i.exec(s);if(u&&u.length>=2){var c=u[1];if(c.charAt(0)!=="{"&&c.charAt(c.length-1)!=="}"){try{c=decodeURIComponent(c)}catch(e){a.warning("Could not decode theme parameters URI from "+r.styleSheetUrl)}}try{var l=JSON.parse(c);U(l,r.themeBaseUrl);return true}catch(e){a.warning("Could not parse theme parameters from "+r.styleSheetUrl+". Loading library-parameters.json as fallback solution.")}}}return false}function I(e){var r=e.replace("sap-ui-theme-","").replace(/\./g,"-");var t=!!window.getComputedStyle(document.body||document.documentElement).getPropertyValue("--sapUiTheme-"+r).trim();if(t){var a=u.getMetadata(e);if(a&&a.Scopes&&a.Scopes.length>0){var n={};a.Scopes.forEach(function(e){n[e]={}});U({default:{},scopes:n})}}return t}function N(r,t){var n=T(r);if(I(r)&&!t){return}if(!L(r)){var i=n.styleSheetUrl.replace(/\/(?:css_variables|library)([^\/.]*)\.(?:css|less)($|[?#])/,function(e,r,t){return"/library-parameters.json"+(t?t:"")});if(l===2){a.error("[nosync] Loading library-parameters.json ignored",i,"sap.ui.core.theming.Parameters");return}else if(l===1){a.error("[nosync] Loading library-parameters.json with sync XHR",i,"sap.ui.core.theming.Parameters")}var s=new e(n.themeBaseUrl).origin();var o=v[s];var u=[];if(o===undefined){if(i.startsWith(g)){u=[false,true]}else{u=[true,false]}}else{u=[o]}A(i,n.themeBaseUrl,u)}}function T(r){var t=document.getElementById(r);if(!t){a.warning("Could not find stylesheet element with ID",r,"sap.ui.core.theming.Parameters");return undefined}var n=t.href;return{themeBaseUrl:new e(n).filename("").query("").toString(),styleSheetUrl:n}}function A(r,t,n){var i=n.shift();var s=i?{"X-Requested-With":"XMLHttpRequest"}:{};o.ajax({url:r,dataType:"json",async:false,xhrFields:{withCredentials:i},headers:s,success:function(r,a,n){var s=new e(t).origin();v[s]=i;if(Array.isArray(r)){for(var o=0;o<r.length;o++){var u=r[o];U(u,t)}}else{U(r,t)}},error:function(e,s,o){a.error("Could not load theme parameters from: "+r,o);if(n.length>0){a.warning("Initial library-parameters.json request failed ('withCredentials="+i+"'; sUrl: '"+r+"').\n"+"Retrying with 'withCredentials="+!i+"'.","sap.ui.core.theming.Parameters");A(r,t,n)}}})}function E(e,r){if(!d){U({},"");m=sap.ui.getCore().getConfiguration().getTheme();j(function(t){if(e){if(i.checkStyle(t)){L(t)}else{p.push(t)}}else{N(t,r)}})}return d}function O(){var e=[];p.forEach(function(r){if(i.checkStyle(r)){L(r)}else{e.push(r)}});p=e}function k(e){p.forEach(function(r){N(r,e)});p=[]}f._addLibraryTheme=function(e){if(d){p.push("sap-ui-theme-"+e)}};function R(e,r,t){var a=e[r];if(!a){var n=t?w:window.getComputedStyle(document.body||document.documentElement);a=n.getPropertyValue("--"+r).trim();a=a!=""?a:undefined;if(a){a=x(a,r);e[r]=a}}return a}function q(e){var r=e.async,t=false,a=E(r);if(e.scopeName){a=a["scopes"][e.scopeName];t=true}else{a=a["default"]}var n=R(a,e.parameterName,t);if(!n){var i=e.parameterName.indexOf(":");if(i!=-1){var s=e.parameterName.substr(i+1);n=R(a,s,t)}}if(e.loadPendingParameters&&typeof n==="undefined"&&!r){k();n=q({parameterName:e.parameterName,scopeName:e.scopeName,loadPendingParameters:false})}return n}function _(e,r,t){var a=f.getActiveScopesFor(r,t);var n=a.flat().reduce(function(e,r){if(e.indexOf(r)===-1){e.push(r)}return e},[]);for(var i=0;i<n.length;i++){var s=n[i];var o=q({parameterName:e,scopeName:s,async:t});if(o){return o}}return q({parameterName:e,async:t})}f._getScopes=function(e,r){if(e&&!d){return}var t=E(r);var a=Object.keys(t["scopes"]);return a};f.getActiveScopesFor=function(e,t){var a=[];if(e instanceof r){var n=e.getDomRef();if(t){O()}else{k()}var i=this._getScopes(undefined,t);if(i.length){if(n){var s=function(e){var r=n.classList;return r&&r.contains(e)};while(n){var o=i.filter(s);if(o.length>0){a.push(o)}n=n.parentNode}}else{var u=function(r){return typeof e.hasStyleClass==="function"&&e.hasStyleClass(r)};while(e){var o=i.filter(u);if(o.length>0){a.push(o)}e=typeof e.getParent==="function"&&e.getParent()}}}}return a};f.get=function(e,t){var n,i,s,o,u;var c=function(e){return e.callback===i};if(!sap.ui.getCore().isInitialized()){a.warning("Called sap.ui.core.theming.Parameters.get() before core has been initialized. "+"Consider using the API only when required, e.g. onBeforeRendering.")}if(arguments.length===0){a.warning("Legacy variant usage of sap.ui.core.theming.Parameters.get API detected. Do not use the Parameters.get() API to retrieve ALL theming parameters, "+"as this will lead to unwanted synchronous requests. "+"Use the asynchronous API variant instead and retrieve a fixed set of parameters.","LegacyParametersGet","sap.ui.support",function(){return{type:"LegacyParametersGet"}});k(true);var l=E(false,true);return Object.assign({},l["default"])}if(!e){return undefined}if(e instanceof Object&&!Array.isArray(e)){if(!e.name){a.warning("sap.ui.core.theming.Parameters.get was called with an object argument without one or more parameter names.");return undefined}t=e.scopeElement;i=e.callback;o=typeof e.name==="string"?[e.name]:e.name;s=true}else{if(typeof e==="string"){o=[e]}else{o=e}a.warning("Legacy variant usage of sap.ui.core.theming.Parameters.get API detected for parameter(s): '"+o.join(", ")+"'. This could lead to bad performance and additional synchronous XHRs, as parameters might not be available yet. Use asynchronous variant instead.","LegacyParametersGet","sap.ui.support",function(){return{type:"LegacyParametersGet"}})}var f,d;var m=function(e){if(t instanceof r){return _(e,t,s)}else{if(s){O()}return q({parameterName:e,loadPendingParameters:!s,async:s})}};d={};for(var p=0;p<o.length;p++){n=o[p];var g=m(n);if(!s||g){d[n]=g}}if(s&&i&&Object.keys(d).length!==o.length){if(!sap.ui.getCore().isThemeApplied()){f=function(){var r=this.get({name:e.name,scopeElement:e.scopeElement});if(!r||typeof r==="object"&&Object.keys(r).length!==o.length){a.error("One or more parameters could not be found.","sap.ui.core.theming.Parameters")}i(r);h.splice(h.findIndex(c),1);sap.ui.getCore().detachThemeChanged(f)}.bind(this);u=h.findIndex(c);if(u>=0){sap.ui.getCore().detachThemeChanged(h[u].eventHandler);h[u].eventHandler=f}else{h.push({callback:i,eventHandler:f})}sap.ui.getCore().attachThemeChanged(f);return undefined}else{a.error("One or more parameters could not be found.","sap.ui.core.theming.Parameters")}}return o.length===1?d[o[0]]:d};f._setOrLoadParameters=function(e){d={default:{},scopes:{}};m=sap.ui.getCore().getConfiguration().getTheme();j(function(r){var t=r.substr(13);if(e[t]){n(d["default"],e[t])}else{N(r)}})};f.reset=function(){var e=arguments[0]===true;if(!e||sap.ui.getCore().getConfiguration().getTheme()!==m){d=null;if(P){document.documentElement.removeChild(P);P=w=undefined}u.reset()}};f._getThemeImage=function(e,r){e=e||"sapUiGlobalLogo";var t=f.get(e);if(t){var a=y.exec(t);if(a){t=a[1]}else if(t==="''"||t==="none"){t=null}}if(r&&!t){return sap.ui.resource("sap.ui.core","themes/base/img/1x1.gif")}return t};return f},true);