@openremote/or-scheduler 1.28.0-snapshot.20260729134655 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2823,7 +2823,7 @@
2823
2823
  font-weight: 600;
2824
2824
  line-height: 125.303%;
2825
2825
  }
2826
- `;class dJ extends nS{static finalizeStyles(e){return[dK,...super.finalizeStyles(e)]}}function dX(e,t,n){return e?t(e):n?.(e)}n(4532);var dQ=n(8183),dZ=n.n(dQ),d0=n(4867),d1=n.n(d0);n(3472);class d2{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}}function d4(e,t,n=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function||e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length||e instanceof Date||!(e instanceof Object)||!(t instanceof Object))return!1;if(n){if(Array.isArray(e))return e.every((e,n)=>d4(e,t[n]));let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>d4(e[n],t[n]))}return!1}class d3{constructor(e){e&&Object.assign(this,e)}matches(e){var t,n,o,r,i,a,s;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(n=this.types)?void 0:n.length)&&(!e.type||!this.types.includes(e.type))||(null==(o=this.realm)?void 0:o.name)&&e.realm!==this.realm.name||(null==(r=this.parents)?void 0:r.length)&&!this.parents.some(t=>!t.id||e.parentId===t.id))return!1;if(null==(i=this.paths)?void 0:i.length){let t=null!=(a=e.path)?a:[];if(!this.paths.some(e=>{var n;return(null!=(n=e.path)?n:[]).every((e,n)=>t[n]===e)}))return!1}return(null==(s=this.names)||!s.length||!!this.names.every(t=>d3._evalValuePredicate(e.name,t)))&&(!this.attributes||d3._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!d3._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?d3._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var n;switch(t.predicateType){case"string":{let o;if(null==e)return!1;let r=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),i=!1!==t.caseSensitive?t.value:null==(n=t.value)?void 0:n.toLowerCase();switch(t.match){case"BEGIN":o=r.startsWith(i);break;case"END":o=r.endsWith(i);break;case"CONTAINS":o=r.includes(i);break;default:o=r===i}return t.negate?!o:o}case"boolean":return e===t.value;case"number":{let n;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":n=e>t.value;break;case"GREATER_EQUALS":n=e>=t.value;break;case"LESS_THAN":n=e<t.value;break;case"LESS_EQUALS":n=e<=t.value;break;case"BETWEEN":n=e>=t.value&&e<=t.rangeValue;break;default:n=e===t.value}return t.negate?!n:n}}return!1}static _evalPredicate(e,t){var n,o;let r=null==(n=t.name)?void 0:n.value;if(!r)return!0;let i=null==(o=e.attributes)?void 0:o[r];if(!i)return!!t.negated;let a=!t.value||d3._evalValuePredicate(i.value,t.value);return t.negated?!a:a}static _evalGroup(e,t){var n,o,r;let i=null!=(n=t.operator)?n:"AND",a=[...(null!=(o=t.items)?o:[]).map(t=>d3._evalPredicate(e,t)),...(null!=(r=t.groups)?r:[]).map(t=>d3._evalGroup(e,t))];return!a.length||("OR"===i?a.some(Boolean):a.every(Boolean))}static _collectNames(e){var t,n;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(n=e.groups)?n:[]).flatMap(e=>d3._collectNames(e))]}}d3._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var d5=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function s(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let d6=n(4461);class d8{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let o=new URLSearchParams(window.location.search),r=o.get("consoleName"),i=o.get("consoleVersion"),a=o.get("consolePlatform"),s=o.get("consoleProviders"),d=o.get("consoleAutoEnable"),l=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=l;let c=d8._createConsoleRegistration(),u=window.localStorage.getItem(this._storageKey);if(u)try{let e=JSON.parse(u);e.id&&(c.id=e.id),e.name&&(c.name=e.name),e.providers&&(c.providers=e.providers),e.apps&&(c.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let m=c.providers;for(let e of(c.providers={},l)){let t=m&&m.hasOwnProperty(e)?m[e]:{enabled:!1,disabled:!1};c.providers[e]=t}let f=mm.getAppName();f.length>0&&0>c.apps.indexOf(f)&&c.apps.push(f),this._registration=c,r&&(c.name=r),i&&(c.version=i),a&&(c.platform=a),d&&(this._autoEnable="TRUE"===d||"true"===d)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return d5(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return d5(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}})}enableProvider(e,t){return d5(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},o=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=o.hasPermission,this._registration.providers[e].success=o.success,this._registration.providers[e].enabled=o.success,this._registration.providers[e].data=o.data;let r=this._pendingProviderEnables.indexOf(e);return r>=0&&(this._pendingProviderEnables.splice(r,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),o})}disableProvider(e){return d5(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t})}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return d5(this,void 0,void 0,function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let o=new d2,r=()=>{delete this._pendingProviderPromises[n],o.reject("No response from provider")};return this._pendingProviderPromises[n]=[o,window.setTimeout(r,5e3)],this._doSendProviderMessage(e),o.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>d5(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),e()}catch(e){console.error("Failed to register console",e),t(e)}}))})}_sendRegistration(e){return d5(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield mm.rest.api.ConsoleResource.register(this._registration);if(200!==e.status)throw Error("Failed to register console");this._registration=e.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(n){if(e&&t&&d8._isStaleRegistrationResponse(n)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw n}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(e){let t=e&&e.response?e.response.status:void 0;return 403===t||409===t}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return d5(this,void 0,void 0,function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{let e=yield Promise.race([t,new Promise((e,t)=>setTimeout(t,2e3))]);if(e&&e.value){let t=e.value;return"null"===t?void 0:t}}catch(e){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(e));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(e)}catch(e){console.error("Failed to send shell message towards console",e)}}_doSendGenericMessage(e,t){let n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'retrieve' action requires a `key`");let n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,o=t.action,r=this._pendingProviderPromises[n+o];r&&(window.clearTimeout(r[1]),delete this._pendingProviderPromises[n+o],r[0].resolve(t));let i=this._providerMessageListeners[n+o];i&&i(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:d6.name,version:d6.version,platform:d6.os.toString(),apps:[],model:((d6.manufacturer?d6.manufacturer+" ":"")+(d6.product?d6.product:"")).trim()}}_initialiseProvider(e){return d5(this,void 0,void 0,function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}})}}function d7(e,t){return function(){return e.apply(t,arguments)}}let{toString:d9}=Object.prototype,{getPrototypeOf:le}=Object,{iterator:lt,toStringTag:ln}=Symbol,lo=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lr=(e,t)=>{let n=e,o=[];for(;null!=n&&n!==Object.prototype&&-1===o.indexOf(n);){if(o.push(n),lo(n,t))return!0;n=le(n)}return!1},li=(i=Object.create(null),e=>{let t=d9.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())}),la=e=>(e=e.toLowerCase(),t=>li(t)===e),ls=e=>t=>typeof t===e,{isArray:ld}=Array,ll=ls("undefined");function lc(e){return null!==e&&!ll(e)&&null!==e.constructor&&!ll(e.constructor)&&lf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let lu=la("ArrayBuffer"),lm=ls("string"),lf=ls("function"),lh=ls("number"),lb=e=>null!==e&&"object"==typeof e,lp=e=>{if(!lb(e))return!1;let t=le(e);return(null===t||t===Object.prototype||null===le(t))&&!lr(e,ln)&&!lr(e,lt)},l_=la("Date"),lg=la("File"),lF=la("Blob"),ly=la("FileList"),lv="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lw=void 0!==lv.FormData?lv.FormData:void 0,lk=la("URLSearchParams"),[lE,lD,lM,lL]=["ReadableStream","Request","Response","Headers"].map(la);function lC(e,t,{allOwnKeys:n=!1}={}){let o,r;if(null!=e)if("object"!=typeof e&&(e=[e]),ld(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{let r;if(lc(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;for(o=0;o<a;o++)r=i[o],t.call(null,e[r],r,e)}}function lA(e,t){let n;if(lc(e))return null;t=t.toLowerCase();let o=Object.keys(e),r=o.length;for(;r-- >0;)if(t===(n=o[r]).toLowerCase())return n;return null}let lT="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lx=e=>!ll(e)&&e!==lT,lS=(a="u">typeof Uint8Array&&le(Uint8Array),e=>a&&e instanceof a),lY=la("HTMLFormElement"),{propertyIsEnumerable:lO}=Object.prototype,lI=la("RegExp"),lP=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),o={};lC(n,(n,r)=>{let i;!1!==(i=t(n,r,e))&&(o[r]=i||n)}),Object.defineProperties(e,o)},lB=la("AsyncFunction"),lR=(l="function"==typeof setImmediate,c=lf(lT.postMessage),l?setImmediate:c?(u=`axios@${Math.random()}`,m=[],lT.addEventListener("message",({source:e,data:t})=>{e===lT&&t===u&&m.length&&m.shift()()},!1),e=>{m.push(e),lT.postMessage(u,"*")}):e=>setTimeout(e)),lN="u">typeof queueMicrotask?queueMicrotask.bind(lT):"u">typeof process&&process.nextTick||lR,lj=e=>null!=e&&lf(e[lt]),lH={isArray:ld,isArrayBuffer:lu,isBuffer:lc,isFormData:e=>{if(!e)return!1;if(lw&&e instanceof lw)return!0;let t=le(e);if(!t||t===Object.prototype||!lf(e.append))return!1;let n=li(e);return"formdata"===n||"object"===n&&lf(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&lu(e.buffer)},isString:lm,isNumber:lh,isBoolean:e=>!0===e||!1===e,isObject:lb,isPlainObject:lp,isEmptyObject:e=>{if(!lb(e)||lc(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lE,isRequest:lD,isResponse:lM,isHeaders:lL,isUndefined:ll,isDate:l_,isFile:lg,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lF,isRegExp:lI,isFunction:lf,isStream:e=>lb(e)&&lf(e.pipe),isURLSearchParams:lk,isTypedArray:lS,isFileList:ly,forEach:lC,merge:function e(...t){let{caseless:n,skipUndefined:o}=lx(this)&&this||{},r={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;let a=n&&"string"==typeof i&&lA(r,i)||i,s=lo(r,a)?r[a]:void 0;lp(s)&&lp(t)?r[a]=e(s,t):lp(t)?r[a]=e({},t):ld(t)?r[a]=t.slice():o&&ll(t)||(r[a]=t)};for(let e=0,n=t.length;e<n;e++){let n=t[e];if(!n||lc(n)||(lC(n,i),"object"!=typeof n||ld(n)))continue;let o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){let t=o[e];lO.call(n,t)&&i(n[t],t)}}return r},extend:(e,t,n,{allOwnKeys:o}={})=>(lC(t,(t,o)=>{n&&lf(t)?Object.defineProperty(e,o,{__proto__:null,value:d7(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let r,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(r=Object.getOwnPropertyNames(e)).length;i-- >0;)a=r[i],(!o||o(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==n&&le(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:li,kindOfTest:la,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let o=e.indexOf(t,n);return -1!==o&&o===n},toArray:e=>{if(!e)return null;if(ld(e))return e;let t=e.length;if(!lh(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,o=(e&&e[lt]).call(e);for(;(n=o.next())&&!n.done;){let o=n.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let n,o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:lY,hasOwnProperty:lo,hasOwnProp:lo,hasOwnInPrototypeChain:lr,getSafeProp:(e,t)=>null!=e&&lr(e,t)?e[t]:void 0,reduceDescriptors:lP,freezeMethods:e=>{lP(e,(t,n)=>{if(lf(e)&&["arguments","caller","callee"].includes(n))return!1;if(lf(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(ld(e)?e:String(e).split(t)).forEach(e=>{n[e]=!0}),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:lA,global:lT,isContextDefined:lx,isSpecCompliantForm:function(e){return!!(e&&lf(e.append)&&"FormData"===e[ln]&&e[lt])},toJSONObject:e=>{let t=new WeakSet,n=e=>{if(lb(e)){if(t.has(e))return;if(lc(e))return e;if(!("toJSON"in e)){t.add(e);let o=ld(e)?[]:{};return lC(e,(e,t)=>{let r=n(e);ll(r)||(o[t]=r)}),t.delete(e),o}}return e};return n(e)},isAsyncFn:lB,isThenable:e=>e&&(lb(e)||lf(e))&&lf(e.then)&&lf(e.catch),setImmediate:lR,asap:lN,isIterable:lj,isSafeIterable:e=>null!=e&&lr(e,lt)&&lj(e)},lU=lH.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),lz=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lW=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function l$(e,t){return lH.isArray(e)?e.map(e=>l$(e,t)):function(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function lV(e){let t=Object.create(null);return lH.forEach(e.toJSON(),(e,n)=>{t[n]=l$(e,lW)}),t}let lq=Symbol("internals");function lG(e){return e&&String(e).trim().toLowerCase()}function lK(e){return!1===e||null==e?e:lH.isArray(e)?e.map(lK):l$(String(e),lz)}function lJ(e,t,n,o,r){if(lH.isFunction(o))return o.call(this,t,n);if(r&&(t=n),lH.isString(t)){if(lH.isString(o))return -1!==t.indexOf(o);if(lH.isRegExp(o))return o.test(t)}}class lX{constructor(e){e&&this.set(e)}set(e,t,n){let o=this;function r(e,t,n){let r=lG(t);if(!r)return;let i=lH.findKey(o,r);i&&void 0!==o[i]&&!0!==n&&(void 0!==n||!1===o[i])||(o[i||t]=lK(e))}let i=(e,t)=>lH.forEach(e,(e,n)=>r(e,n,t));if(lH.isPlainObject(e)||e instanceof this.constructor)i(e,t);else{let o;if(lH.isString(e)&&(e=e.trim())&&(o=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim()))){var a;let n,o,r,s;i((s={},(a=e)&&a.split("\n").forEach(function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),o=e.substring(r+1).trim(),!n||s[n]&&lU[n]||("set-cookie"===n?s[n]?s[n].push(o):s[n]=[o]:s[n]=s[n]?s[n]+", "+o:o)}),s),t)}else if(lH.isObject(e)&&lH.isSafeIterable(e)){let n=Object.create(null),o,r;for(let t of e){if(!lH.isArray(t))throw TypeError("Object iterator must return a key-value pair");r=t[0],lH.hasOwnProp(n,r)?(o=n[r],n[r]=lH.isArray(o)?[...o,t[1]]:[o,t[1]]):n[r]=t[1]}i(n,t)}else null!=e&&r(t,e,n)}return this}get(e,t){if(e=lG(e)){let n=lH.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t){let t,n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=o.exec(e);)n[t[1]]=t[2];return n}if(lH.isFunction(t))return t.call(this,e,n);if(lH.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=lG(e)){let n=lH.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||lJ(this,this[n],n,t)))}return!1}delete(e,t){let n=this,o=!1;function r(e){if(e=lG(e)){let r=lH.findKey(n,e);r&&(!t||lJ(n,n[r],r,t))&&(delete n[r],o=!0)}}return lH.isArray(e)?e.forEach(r):r(e),o}clear(e){let t=Object.keys(this),n=t.length,o=!1;for(;n--;){let r=t[n];(!e||lJ(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){let t=this,n={};return lH.forEach(this,(o,r)=>{let i=lH.findKey(n,r);if(i){t[i]=lK(o),delete t[r];return}let a=e?r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(r).trim();a!==r&&delete t[r],t[a]=lK(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return lH.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&lH.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[lq]=this[lq]={accessors:{}}).accessors,n=this.prototype;function o(e){let o=lG(e);if(!t[o]){let r;r=lH.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(n,t+r,{__proto__:null,value:function(n,o,r){return this[t].call(this,e,n,o,r)},configurable:!0})}),t[o]=!0}}return lH.isArray(e)?e.forEach(o):o(e),this}}lX.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lH.reduceDescriptors(lX.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),lH.freezeMethods(lX);class lQ extends Error{static from(e,t,n,o,r,i){let a=new lQ(e.message,t||e.code,n,o,r);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,o,r){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r,this.status=r.status)}toJSON(){let e,t,n,o=this.config,r=o&&lH.hasOwnProp(o,"redact")?o.redact:void 0,i=lH.isArray(r)&&r.length>0?(e=new Set(r.map(e=>String(e).toLowerCase())),t=[],(n=o=>{let r;if(null===o||"object"!=typeof o||lH.isBuffer(o))return o;if(-1===t.indexOf(o)){if(o instanceof lX&&(o=o.toJSON()),t.push(o),lH.isArray(o))r=[],o.forEach((e,t)=>{let o=n(e);lH.isUndefined(o)||(r[t]=o)});else{if(!lH.isPlainObject(o)&&function(e){if(lH.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lH.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(o))return t.pop(),o;for(let[t,i]of(r=Object.create(null),Object.entries(o))){let o=e.has(t.toLowerCase())?"[REDACTED ****]":n(i);lH.isUndefined(o)||(r[t]=o)}}return t.pop(),r}})(o)):lH.toJSONObject(o);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i,code:this.code,status:this.status}}}lQ.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",lQ.ERR_BAD_OPTION="ERR_BAD_OPTION",lQ.ECONNABORTED="ECONNABORTED",lQ.ETIMEDOUT="ETIMEDOUT",lQ.ECONNREFUSED="ECONNREFUSED",lQ.ERR_NETWORK="ERR_NETWORK",lQ.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",lQ.ERR_DEPRECATED="ERR_DEPRECATED",lQ.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",lQ.ERR_BAD_REQUEST="ERR_BAD_REQUEST",lQ.ERR_CANCELED="ERR_CANCELED",lQ.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",lQ.ERR_INVALID_URL="ERR_INVALID_URL",lQ.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let lZ=lQ;function l0(e){return lH.isPlainObject(e)||lH.isArray(e)}function l1(e){return lH.endsWith(e,"[]")?e.slice(0,-2):e}function l2(e,t,n){return e?e.concat(t).map(function(e,t){return e=l1(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let l4=lH.toFlatObject(lH,{},null,function(e){return/^is[A-Z]/.test(e)}),l3=function(e,t,n){if(!lH.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let o=(n=lH.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!lH.isUndefined(t[e])})).metaTokens,r=n.visitor||f,i=n.dots,a=n.indexes,s=n.Blob||"u">typeof Blob&&Blob,d=void 0===n.maxDepth?100:n.maxDepth,l=s&&lH.isSpecCompliantForm(t),c=[];if(!lH.isFunction(r))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(lH.isDate(e))return e.toISOString();if(lH.isBoolean(e))return e.toString();if(!l&&lH.isBlob(e))throw new lZ("Blob is not supported. Use a Buffer instead.");if(lH.isArrayBuffer(e)||lH.isTypedArray(e)){if(l&&"function"==typeof s)return new s([e]);if("u">typeof Buffer)return Buffer.from(e);throw new lZ("Blob is not supported. Use a Buffer instead.",lZ.ERR_NOT_SUPPORT)}return e}function m(e){if(e>d)throw new lZ("Object is too deeply nested ("+e+" levels). Max depth: "+d,lZ.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(e,n,r){let s=e;if(lH.isReactNative(t)&&lH.isReactNativeBlob(e))return t.append(l2(r,n,i),u(e)),!1;if(e&&!r&&"object"==typeof e)if(lH.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e){if(d===1/0)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,n){if(!lH.isObject(n))return n;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(n),m(1+t.length-1),n})}(e);else{var l;if(lH.isArray(e)&&(l=e,lH.isArray(l)&&!l.some(l0))||(lH.isFileList(e)||lH.endsWith(n,"[]"))&&(s=lH.toArray(e)))return n=l1(n),s.forEach(function(e,o){lH.isUndefined(e)||null===e||t.append(!0===a?l2([n],o,i):null===a?n:n+"[]",u(e))}),!1}return!!l0(e)||(t.append(l2(r,n,i),u(e)),!1)}let h=Object.assign(l4,{defaultVisitor:f,convertValue:u,isVisitable:l0});if(!lH.isObject(e))throw TypeError("data must be an object");return!function e(n,o,i=0){if(!lH.isUndefined(n)){if(m(i),-1!==c.indexOf(n))throw Error("Circular reference detected in "+o.join("."));c.push(n),lH.forEach(n,function(n,a){!0===(!(lH.isUndefined(n)||null===n)&&r.call(t,n,lH.isString(a)?a.trim():a,o,h))&&e(n,o?o.concat(a):[a],i+1)}),c.pop()}}(e),t};function l5(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function l6(e,t){this._pairs=[],e&&l3(e,this,t)}let l8=l6.prototype;function l7(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l9(e,t,n){let o;if(!t)return e;e=e||"";let r=lH.isFunction(n)?{serialize:n}:n,i=lH.getSafeProp(r,"encode")||l7,a=lH.getSafeProp(r,"serialize");if(o=a?a(t,r):lH.isURLSearchParams(t)?t.toString():new l6(t,r).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}l8.append=function(e,t){this._pairs.push([e,t])},l8.toString=function(e){let t=e?t=>e.call(this,t,l5):l5;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let ce=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){lH.forEach(this.handlers,function(t){null!==t&&e(t)})}},ct={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},cn="u">typeof URLSearchParams?URLSearchParams:l6,co="u">typeof FormData?FormData:null,cr="u">typeof Blob?Blob:null,ci="u">typeof window&&"u">typeof document,ca="object"==typeof navigator&&navigator||void 0,cs=ci&&(!ca||0>["ReactNative","NativeScript","NS"].indexOf(ca.product)),cd="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,cl=ci&&window.location.href||"http://localhost",cc={...tS,isBrowser:!0,classes:{URLSearchParams:cn,FormData:co,Blob:cr},protocols:["http","https","file","blob","url","data"]};function cu(e){if(e>100)throw new lZ("FormData field is too deeply nested ("+e+" levels). Max depth: 100",lZ.ERR_FORM_DATA_DEPTH_EXCEEDED)}let cm=function(e){if(lH.isFormData(e)&&lH.isFunction(e.entries)){let t={};return lH.forEachEntry(e,(e,n)=>{!function e(t,n,o,r){cu(r);let i=t[r++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),s=r>=t.length;return(i=!i&&lH.isArray(o)?o.length:i,s)?lH.hasOwnProp(o,i)?o[i]=lH.isArray(o[i])?o[i].concat(n):[o[i],n]:o[i]=n:(lH.hasOwnProp(o,i)&&lH.isObject(o[i])||(o[i]=[]),e(t,n,o[i],r)&&lH.isArray(o[i])&&(o[i]=function(e){let t,n,o={},r=Object.keys(e),i=r.length;for(t=0;t<i;t++)o[n=r[t]]=e[n];return o}(o[i]))),!a}(function(e){let t,n=[],o=/\w+|\[(\w*)]/g;for(;null!==(t=o.exec(e));)cu(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),n,t,0)}),t}return null},cf=(e,t)=>null!=e&&lH.hasOwnProp(e,t)?e[t]:void 0,ch={transitional:ct,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,o=t.getContentType()||"",r=o.indexOf("application/json")>-1,i=lH.isObject(e);if(i&&lH.isHTMLForm(e)&&(e=new FormData(e)),lH.isFormData(e))return r?JSON.stringify(cm(e)):e;if(lH.isArrayBuffer(e)||lH.isBuffer(e)||lH.isStream(e)||lH.isFile(e)||lH.isBlob(e)||lH.isReadableStream(e))return e;if(lH.isArrayBufferView(e))return e.buffer;if(lH.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){let t=cf(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return l3(e,new cc.classes.URLSearchParams,{visitor:function(e,t,n,o){return cc.isNode&&lH.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t}).toString();if((n=lH.isFileList(e))||o.indexOf("multipart/form-data")>-1){let o=cf(this,"env"),r=o&&o.FormData;return l3(n?{"files[]":e}:e,r&&new r,t)}}if(i||r){t.setContentType("application/json",!1);var a=e;if(lH.isString(a))try{return(0,JSON.parse)(a),lH.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=cf(this,"transitional")||ch.transitional,n=t&&t.forcedJSONParsing,o=cf(this,"responseType"),r="json"===o;if(lH.isResponse(e)||lH.isReadableStream(e))return e;if(e&&lH.isString(e)&&(n&&!o||r)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,cf(this,"parseReviver"))}catch(e){if(!n&&r){if("SyntaxError"===e.name)throw lZ.from(e,lZ.ERR_BAD_RESPONSE,this,null,cf(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cc.classes.FormData,Blob:cc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function cb(e,t){let n=this||ch,o=t||n,r=lX.from(o.headers),i=o.data;return lH.forEach(e,function(e){i=e.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function cp(e){return!!(e&&e.__CANCEL__)}lH.forEach(["delete","get","head","post","put","patch","query"],e=>{ch.headers[e]={}});let c_=class extends lZ{constructor(e,t,n){super(null==e?"canceled":e,lZ.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function cg(e,t,n){let o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new lZ("Request failed with status code "+n.status,n.status>=400&&n.status<500?lZ.ERR_BAD_REQUEST:lZ.ERR_BAD_RESPONSE,n.config,n.request,n))}let cF=function(e,t){let n,o=Array(e=e||10),r=Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){let d=Date.now(),l=r[a];n||(n=d),o[i]=s,r[i]=d;let c=a,u=0;for(;c!==i;)u+=o[c++],c%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),d-n<t)return;let m=l&&d-l;return m?Math.round(1e3*u/m):void 0}},cy=function(e,t){let n,o,r=0,i=1e3/t,a=(t,i=Date.now())=>{r=i,n=null,o&&(clearTimeout(o),o=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-r;s>=i?a(e,t):(n=e,o||(o=setTimeout(()=>{o=null,a(n)},i-s)))},()=>n&&a(n)]},cv=(e,t,n=3)=>{let o=0,r=cF(50,250);return cy(n=>{if(!n||"number"!=typeof n.loaded)return;let i=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(i,a):i,d=Math.max(0,s-o),l=r(d);o=Math.max(o,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:d,rate:l||void 0,estimated:l&&a?(a-s)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},cw=(e,t)=>{let n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},ck=e=>(...t)=>lH.asap(()=>e(...t)),cE=cc.hasStandardBrowserEnv?(s=new URL(cc.origin),d=cc.navigator&&/(msie|trident)/i.test(cc.navigator.userAgent),e=>(e=new URL(e,cc.origin),s.protocol===e.protocol&&s.host===e.host&&(d||s.port===e.port))):()=>!0,cD=cc.hasStandardBrowserEnv?{write(e,t,n,o,r,i,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];lH.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),lH.isString(o)&&s.push(`path=${o}`),lH.isString(r)&&s.push(`domain=${r}`),!0===i&&s.push("secure"),lH.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.split(";");for(let n=0;n<t.length;n++){let o=t[n].replace(/^\s+/,""),r=o.indexOf("=");if(-1!==r&&o.slice(0,r)===e)try{return decodeURIComponent(o.slice(r+1))}catch(e){return o.slice(r+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},cM=/^https?:(?!\/\/)/i,cL=/[\t\n\r]/g;function cC(e,t){if("string"==typeof e&&cM.test((function(e){let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t)})(e).replace(cL,"")))throw new lZ('Invalid URL: missing "//" after protocol',lZ.ERR_INVALID_URL,t)}function cA(e,t,n,o){cC(t,o);let r=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(r||!1===n)?(cC(e,o),t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e):t}let cT=e=>e instanceof lX?{...e}:e;function cx(e,t){e=e||{},t=t||{};let n=Object.create(null);function o(e,t,n,o){return lH.isPlainObject(e)&&lH.isPlainObject(t)?lH.merge.call({caseless:o},e,t):lH.isPlainObject(t)?lH.merge({},t):lH.isArray(t)?t.slice():t}function r(e,t,n,r){return lH.isUndefined(t)?lH.isUndefined(e)?void 0:o(void 0,e,n,r):o(e,t,n,r)}function i(e,t){if(!lH.isUndefined(t))return o(void 0,t)}function a(e,t){return lH.isUndefined(t)?lH.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function s(n,r,i){return lH.hasOwnProp(t,i)?o(n,r):lH.hasOwnProp(e,i)?o(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let d={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>r(cT(e),cT(t),n,!0)};return lH.forEach(Object.keys({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;let i=lH.hasOwnProp(d,o)?d[o]:r,a=i(lH.hasOwnProp(e,o)?e[o]:void 0,lH.hasOwnProp(t,o)?t[o]:void 0,o);lH.isUndefined(a)&&i!==s||(n[o]=a)}),lH.hasOwnProp(t,"validateStatus")&&lH.isUndefined(t.validateStatus)&&!1===function(n){let o=lH.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!lH.isUndefined(o)){if(!lH.isPlainObject(o))return;else if(lH.hasOwnProp(o,n))return o[n]}let r=lH.hasOwnProp(e,"transitional")?e.transitional:void 0;if(lH.isPlainObject(r)&&lH.hasOwnProp(r,n))return r[n]}("validateStatusUndefinedResolves")&&(lH.hasOwnProp(e,"validateStatus")?n.validateStatus=o(void 0,e.validateStatus):delete n.validateStatus),n}let cS=["content-type","content-length"],cY=function(e){let t=cx({},e),n=e=>lH.hasOwnProp(t,e)?t[e]:void 0,o=n("data"),r=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),d=n("auth"),l=n("baseURL"),c=n("allowAbsoluteUrls"),u=n("url");if(t.headers=s=lX.from(s),t.url=l9(cA(l,u,c,t),n("params"),n("paramsSerializer")),d){let t=lH.getSafeProp(d,"username")||"",n=lH.getSafeProp(d,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw lZ.from(t,lZ.ERR_BAD_OPTION_VALUE,e)}}if(lH.isFormData(o))if(cc.hasStandardBrowserEnv||cc.hasStandardBrowserWebWorkerEnv||lH.isReactNative(o))s.setContentType(void 0);else{var m,f;lH.isFunction(o.getHeaders)&&(m=s,f=o.getHeaders(),"content-only"!==n("formDataHeaderPolicy")?m.set(f):Object.entries(f||{}).forEach(([e,t])=>{cS.includes(e.toLowerCase())&&m.set(e,t)}))}if(cc.hasStandardBrowserEnv&&(lH.isFunction(r)&&(r=r(t)),!0===r||null==r&&cE(t.url))){let e=i&&a&&cD.read(a);e&&s.set(i,e)}return t},cO="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var o;let r,i,a,s,d,l,c=cY(e),u=c.data,m=lX.from(c.headers).normalize(),{responseType:f,onUploadProgress:h,onDownloadProgress:b}=c;function p(){s&&s(),d&&d(),c.cancelToken&&c.cancelToken.unsubscribe(r),c.signal&&c.signal.removeEventListener("abort",r)}let _=new XMLHttpRequest;function g(){if(!_)return;let o=lX.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());cg(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:o,config:e,request:_}),_=null}_.open(c.method.toUpperCase(),c.url,!0),_.timeout=c.timeout,"onloadend"in _?_.onloadend=g:_.onreadystatechange=function(){!_||4!==_.readyState||(0!==_.status||_.responseURL&&_.responseURL.startsWith("file:"))&&setTimeout(g)},_.onabort=function(){_&&(n(new lZ("Request aborted",lZ.ECONNABORTED,e,_)),p(),_=null)},_.onerror=function(t){let o=new lZ(t&&t.message?t.message:"Network Error",lZ.ERR_NETWORK,e,_);o.event=t||null,n(o),p(),_=null},_.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",o=c.transitional||ct;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new lZ(t,o.clarifyTimeoutError?lZ.ETIMEDOUT:lZ.ECONNABORTED,e,_)),p(),_=null},void 0===u&&m.setContentType(null),"setRequestHeader"in _&&lH.forEach(lV(m),function(e,t){_.setRequestHeader(t,e)}),lH.isUndefined(c.withCredentials)||(_.withCredentials=!!c.withCredentials),f&&"json"!==f&&(_.responseType=c.responseType),b&&([a,d]=cv(b,!0),_.addEventListener("progress",a)),h&&_.upload&&([i,s]=cv(h),_.upload.addEventListener("progress",i),_.upload.addEventListener("loadend",s)),(c.cancelToken||c.signal)&&(r=t=>{_&&(n(!t||t.type?new c_(null,e,_):t),_.abort(),p(),_=null)},c.cancelToken&&c.cancelToken.subscribe(r),c.signal&&(c.signal.aborted?r():c.signal.addEventListener("abort",r)));let F=(o=c.url,(l=/^([-+\w]{1,25}):(?:\/\/)?/.exec(o))&&l[1]||"");if(F&&!cc.protocols.includes(F)){n(new lZ("Unsupported protocol "+F+":",lZ.ERR_BAD_REQUEST,e)),p();return}_.send(u||null)})},cI=function*(e,t){let n,o=e.byteLength;if(!t||o<t)return void(yield e);let r=0;for(;r<o;)n=r+t,yield e.slice(r,n),r=n},cP=async function*(e,t){for await(let n of cB(e))yield*cI(n,t)},cB=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},cR=(e,t,n,o)=>{let r,i=cP(e,t),a=0,s=e=>{!r&&(r=!0,o&&o(e))};return new ReadableStream({async pull(e){try{let{done:t,value:o}=await i.next();if(t){s(),e.close();return}let r=o.byteLength;if(n){let e=a+=r;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},cN=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cj=(e,t,n)=>t+2<n&&cN(e.charCodeAt(t+1))&&cN(e.charCodeAt(t+2)),{isFunction:cH}=lH,cU=e=>{if(!lH.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},cz=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cW=e=>{let t,n=void 0!==lH.global&&null!==lH.global?lH.global:globalThis,{ReadableStream:o,TextEncoder:r}=n,{fetch:i,Request:a,Response:s}=e=lH.merge.call({skipUndefined:!0},{Request:n.Request,Response:n.Response},e),d=i?cH(i):"function"==typeof fetch,l=cH(a),c=cH(s);if(!d)return!1;let u=d&&cH(o),m=d&&("function"==typeof r?(t=new r,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=l&&u&&cz(()=>{let e=!1,t=new a(cc.origin,{body:new o,method:"POST",get duplex(){return e=!0,"half"}}),n=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!n}),h=c&&u&&cz(()=>lH.isReadableStream(new s("").body)),b={stream:h&&(e=>e.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{b[e]||(b[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new lZ(`Response type '${e}' is not supported`,lZ.ERR_NOT_SUPPORT,n)})});let p=async e=>{if(null==e)return 0;if(lH.isBlob(e))return e.size;if(lH.isSpecCompliantForm(e)){let t=new a(cc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return lH.isArrayBufferView(e)||lH.isArrayBuffer(e)?e.byteLength:(lH.isURLSearchParams(e)&&(e+=""),lH.isString(e))?(await m(e)).byteLength:void 0},_=async(e,t)=>{let n=lH.toFiniteNumber(e.getContentLength());return null==n?p(t):n};return async e=>{let t,{url:n,method:o,data:d,signal:c,cancelToken:m,timeout:g,onDownloadProgress:F,onUploadProgress:y,responseType:v,headers:w,withCredentials:k="same-origin",fetchOptions:E,maxContentLength:D,maxBodyLength:M}=cY(e),L=lH.isNumber(D)&&D>-1,C=lH.isNumber(M)&&M>-1,A=i||fetch;v=v?(v+"").toLowerCase():"text";let T=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,o=!1,r=function(e){if(!o){o=!0,a();let t=e instanceof Error?e:this.reason;n.abort(t instanceof lZ?t:new c_(t instanceof Error?t.message:t))}},i=t&&setTimeout(()=>{i=null,r(new lZ(`timeout of ${t}ms exceeded`,lZ.ETIMEDOUT))},t),a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)}),e=null)};e.forEach(e=>e.addEventListener("abort",r,{once:!0}));let{signal:s}=n;return s.unsubscribe=()=>lH.asap(a),s})([c,m&&m.toAbortSignal()],g),x=null,S=T&&T.unsubscribe&&(()=>{T.unsubscribe()}),Y=null,O=()=>new lZ("Request body larger than maxBodyLength limit",lZ.ERR_BAD_REQUEST,e,x);try{var I;let i,c,m,g,P=(c="auth",lH.hasOwnProp(e,c)?e[c]:void 0);if(P){let e=lH.getSafeProp(P,"username")||"",t=lH.getSafeProp(P,"password")||"";i={username:e,password:t}}if(m=(I=n).indexOf("://"),g=I,-1!==m&&(g=g.slice(m+3)),g.includes("@")||g.includes(":")){let e=new URL(n,cc.origin);if(!i&&(e.username||e.password)){let t=cU(e.username),n=cU(e.password);i={username:t,password:n}}(e.username||e.password)&&(e.username="",e.password="",n=e.href)}if(i){let e;w.delete("authorization"),w.set("Authorization","Basic "+btoa((e=(i.username||"")+":"+(i.password||""),encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}if(L&&"string"==typeof n&&n.startsWith("data:")&&function(e){if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let n=e.slice(5,t),o=e.slice(t+1);if(/;base64/i.test(n)){let e=o.length,t=o.length;for(let n=0;n<t;n++)if(37===o.charCodeAt(n)&&n+2<t){let t=o.charCodeAt(n+1),r=o.charCodeAt(n+2);cN(t)&&cN(r)&&(e-=2,n+=2)}let n=0,r=t-1,i=e=>e>=2&&37===o.charCodeAt(e-2)&&51===o.charCodeAt(e-1)&&(68===o.charCodeAt(e)||100===o.charCodeAt(e));r>=0&&(61===o.charCodeAt(r)?(n++,r--):i(r)&&(n++,r-=3)),1===n&&r>=0&&(61===o.charCodeAt(r)?n++:i(r)&&n++);let a=3*Math.floor(e/4)-(n||0);return a>0?a:0}let r=0;for(let e=0,t=o.length;e<t;e++){let n=o.charCodeAt(e);if(37===n&&cj(o,e,t))r+=1,e+=2;else if(n<128)r+=1;else if(n<2048)r+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=o.charCodeAt(e+1);t>=56320&&t<=57343?(r+=4,e++):r+=3}else r+=3}return r}(n)>D)throw new lZ("maxContentLength size of "+D+" exceeded",lZ.ERR_BAD_RESPONSE,e,x);if(C&&"get"!==o&&"head"!==o){let e=await p(d);if("number"==typeof e&&isFinite(e)&&(t=e,e>M))throw O()}let B=C&&(lH.isReadableStream(d)||lH.isStream(d)),R=(e,t,n)=>cR(e,65536,e=>{if(C&&e>M)throw Y=O();t&&t(e)},n);if(f&&"get"!==o&&"head"!==o&&(y||B)){if(t=null==t?await _(w,d):t,0!==t||B){let e,o=new a(n,{method:"POST",body:d,duplex:"half"});if(lH.isFormData(d)&&(e=o.headers.get("content-type"))&&w.setContentType(e),o.body){let[e,n]=y&&cw(t,cv(ck(y)))||[];d=R(o.body,e,n)}}}else if(B&&!l&&u&&"get"!==o&&"head"!==o)d=R(d);else if(B&&l&&!f&&"get"!==o&&"head"!==o)throw new lZ("Stream request bodies are not supported by the current fetch implementation",lZ.ERR_NOT_SUPPORT,e,x);lH.isString(k)||(k=k?"include":"omit");let N=l&&"credentials"in a.prototype;if(lH.isFormData(d)){let e=w.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&w.delete("content-type")}w.set("User-Agent","axios/1.18.1",!1);let j={...E,signal:T,method:o.toUpperCase(),headers:lV(w.normalize()),body:d,duplex:"half",credentials:N?k:void 0};x=l&&new a(n,j);let H=await (l?A(x,E):A(n,j)),U=lX.from(H.headers);if(L){let t=lH.toFiniteNumber(U.getContentLength());if(null!=t&&t>D)throw new lZ("maxContentLength size of "+D+" exceeded",lZ.ERR_BAD_RESPONSE,e,x)}let z=h&&("stream"===v||"response"===v);if(h&&H.body&&(F||L||z&&S)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=H[e]});let n=lH.toFiniteNumber(U.getContentLength()),[o,r]=F&&cw(n,cv(ck(F),!0))||[];H=new s(cR(H.body,65536,t=>{if(L&&t>D)throw new lZ("maxContentLength size of "+D+" exceeded",lZ.ERR_BAD_RESPONSE,e,x);o&&o(t)},()=>{r&&r(),S&&S()}),t)}v=v||"text";let W=await b[lH.findKey(b,v)||"text"](H,e);if(L&&!h&&!z){let t;if(null!=W&&("number"==typeof W.byteLength?t=W.byteLength:"number"==typeof W.size?t=W.size:"string"==typeof W&&(t="function"==typeof r?new r().encode(W).byteLength:W.length)),"number"==typeof t&&t>D)throw new lZ("maxContentLength size of "+D+" exceeded",lZ.ERR_BAD_RESPONSE,e,x)}return!z&&S&&S(),await new Promise((t,n)=>{cg(t,n,{data:W,headers:lX.from(H.headers),status:H.status,statusText:H.statusText,config:e,request:x})})}catch(t){if(S&&S(),T&&T.aborted&&T.reason instanceof lZ){let n=T.reason;throw n.config=e,x&&(n.request=x),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(Y)throw x&&!Y.request&&(Y.request=x),Y;if(t instanceof lZ)throw x&&!t.request&&(t.request=x),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let n=new lZ("Network Error",lZ.ERR_NETWORK,e,x,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw lZ.from(t,t&&t.code,e,x,t&&t.response)}}},c$=new Map,cV=e=>{let t=e&&e.env||{},{fetch:n,Request:o,Response:r}=t,i=[o,r,n],a=i.length,s,d,l=c$;for(;a--;)s=i[a],void 0===(d=l.get(s))&&l.set(s,d=a?new Map:cW(t)),l=d;return d};cV();let cq={http:null,xhr:cO,fetch:{get:cV}};lH.forEach(cq,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let cG=e=>`- ${e}`,cK=e=>lH.isFunction(e)||null===e||!1===e,cJ=function(e,t){let n,o,{length:r}=e=lH.isArray(e)?e:[e],i={};for(let a=0;a<r;a++){let r;if(o=n=e[a],!cK(n)&&void 0===(o=cq[(r=String(n)).toLowerCase()]))throw new lZ(`Unknown adapter '${r}'`);if(o&&(lH.isFunction(o)||(o=o.get(t))))break;i[r||"#"+a]=o}if(!o){let e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new lZ("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(cG).join("\n"):" "+cG(e[0]):"as no adapter specified"),lZ.ERR_NOT_SUPPORT)}return o};function cX(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new c_(null,e)}function cQ(e){return cX(e),e.headers=lX.from(e.headers),e.data=cb.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cJ(e.adapter||ch.adapter,e)(e).then(function(t){cX(e),e.response=t;try{t.data=cb.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lX.from(t.headers),t},function(t){if(!cp(t)&&(cX(e),t&&t.response)){e.response=t.response;try{t.response.data=cb.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lX.from(t.response.headers)}return Promise.reject(t)})}let cZ={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cZ[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let c0={};cZ.transitional=function(e,t,n){function o(e,t){return"[Axios v1.18.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,i)=>{if(!1===e)throw new lZ(o(r," has been removed"+(t?" in "+t:"")),lZ.ERR_DEPRECATED);return t&&!c0[r]&&(c0[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}},cZ.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let c1=function(e,t,n){if("object"!=typeof e||null===e)throw new lZ("options must be an object",lZ.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),r=o.length;for(;r-- >0;){let i=o[r],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){let t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new lZ("option "+i+" must be "+n,lZ.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new lZ("Unknown option "+i,lZ.ERR_BAD_OPTION)}};class c2{constructor(e){this.defaults=e||{},this.interceptors={request:new ce,response:new ce}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return"";let e=t.stack.indexOf("\n");return -1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){let t=n.indexOf("\n"),o=-1===t?-1:n.indexOf("\n",t+1),r=-1===o?"":n.slice(o+1);String(e.stack).endsWith(r)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){let n,o;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:r,paramsSerializer:i,headers:a}=t=cx(this.defaults,t);void 0!==r&&c1(r,{silentJSONParsing:cZ.transitional(cZ.boolean),forcedJSONParsing:cZ.transitional(cZ.boolean),clarifyTimeoutError:cZ.transitional(cZ.boolean),legacyInterceptorReqResOrdering:cZ.transitional(cZ.boolean),advertiseZstdAcceptEncoding:cZ.transitional(cZ.boolean),validateStatusUndefinedResolves:cZ.transitional(cZ.boolean)},!1),null!=i&&(lH.isFunction(i)?t.paramsSerializer={serialize:i}:c1(i,{encode:cZ.function,serialize:cZ.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),c1(t,{baseUrl:cZ.spelling("baseURL"),withXsrfToken:cZ.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&lH.merge(a.common,a[t.method]);a&&lH.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete a[e]}),t.headers=lX.concat(s,a);let d=[],l=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;l=l&&e.synchronous;let n=t.transitional||ct;n&&n.legacyInterceptorReqResOrdering?d.unshift(e.fulfilled,e.rejected):d.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u=0;if(!l){let e=[cQ.bind(this),void 0];for(e.unshift(...d),e.push(...c),o=e.length,n=Promise.resolve(t);u<o;)n=n.then(e[u++],e[u++]);return n}o=d.length;let m=t;for(;u<o;){let e=d[u++],t=d[u++];try{m=e(m)}catch(e){t.call(this,e);break}}try{n=cQ.call(this,m)}catch(e){return Promise.reject(e)}for(u=0,o=c.length;u<o;)n=n.then(c[u++],c[u++]);return n}getUri(e){return l9(cA((e=cx(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}lH.forEach(["delete","get","head","options"],function(e){c2.prototype[e]=function(t,n){return this.request(cx(n||{},{method:e,url:t,data:n&&lH.hasOwnProp(n,"data")?n.data:void 0}))}}),lH.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,r){return this.request(cx(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}c2.prototype[e]=t(),"query"!==e&&(c2.prototype[e+"Form"]=t(!0))});class c4{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,r){n.reason||(n.reason=new c_(e,o,r),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new c4(function(t){e=t}),cancel:e}}}let c3={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(c3).forEach(([e,t])=>{c3[t]=e});let c5=function e(t){let n=new c2(t),o=d7(c2.prototype.request,n);return lH.extend(o,c2.prototype,n,{allOwnKeys:!0}),lH.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(cx(t,n))},o}(ch);c5.Axios=c2,c5.CanceledError=c_,c5.CancelToken=c4,c5.isCancel=cp,c5.VERSION="1.18.1",c5.toFormData=l3,c5.AxiosError=lZ,c5.Cancel=c5.CanceledError,c5.all=function(e){return Promise.all(e)},c5.spread=function(e){return function(t){return e.apply(null,t)}},c5.isAxiosError=function(e){return lH.isObject(e)&&!0===e.isAxiosError},c5.mergeConfig=cx,c5.AxiosHeaders=lX,c5.formToJSON=e=>cm(lH.isHTMLForm(e)?new FormData(e):e),c5.getAdapter=cJ,c5.HttpStatusCode=c3,c5.default=c5;class c6{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:ug`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`asset/predicted/${e}/${t}`,data:n,options:o})}}class c8{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:ug`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:ug`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:ug`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:ug`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:ug`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:ug`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:ug`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:ug`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:ug`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:ug`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:ug`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:ug`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:ug`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:ug`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:ug`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:ug`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:ug`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`asset/${e}/attribute/${t}`,data:n,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:ug`asset/${e}/attribute/${t}/${n}`,data:o,options:r})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:ug`asset/${e}/child`,queryParams:t,options:n})}}class c7{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:ug`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:ug`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:ug`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:ug`provisioning/${e}`,data:t,options:n})}}class c9{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:ug`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:ug`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:ug`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:ug`configuration/manager/image/${e}`,options:t})}}class ue{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:ug`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:ug`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:ug`asset/datapoint/${e}/${t}`,data:n,options:o})}}class ut{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:ug`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:ug`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:ug`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:ug`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:ug`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:ug`dashboard/${e}/${t}`,options:n})}}class un{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:ug`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:ug`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:ug`flow/${e}`,options:t})}}class uo{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:ug`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:ug`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:ug`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:ug`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:ug`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:ug`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:ug`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:ug`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:ug`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:ug`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:ug`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:ug`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:ug`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:ug`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:ug`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:ug`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:ug`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:ug`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:ug`rules/${e}`,data:t,options:n})}}class ur{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:ug`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:ug`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:ug`notification/alert`,data:e,options:t})}getNotificationsCount(e,t){return this.httpClient.request({method:"GET",url:ug`notification/count`,queryParams:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:ug`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:ug`notification/${e}/delivered`,queryParams:t,options:n})}}class ui{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:ug`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:ug`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:ug`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:ug`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:ug`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:ug`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:ug`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:ug`alarm/${e}/assets`,queryParams:t,options:n})}}class ua{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:ug`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:ug`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:ug`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:ug`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:ug`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:ug`realm/${e}`,data:t,options:n})}}class us{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:ug`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:ug`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:ug`apps/info`,options:e})}}class ud{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:ug`console/register`,data:e,options:t})}}class ul{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:ug`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:ug`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:ug`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:ug`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:ug`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:ug`model/valueDescriptors`,queryParams:e,options:t})}}class uc{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:ug`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:ug`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:ug`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:ug`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,r){return this.httpClient.request({method:"GET",url:ug`gateway/tunnel/${e}/${t}/${n}/${o}`,options:r})}}class uu{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:ug`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:ug`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:ug`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:ug`syslog/event`,queryParams:e,options:t})}}class um{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:ug`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:ug`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:ug`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:ug`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:ug`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:ug`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:ug`service/${e}/${t}`,options:n})}}class uf{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:ug`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:ug`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:ug`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class uh{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:ug`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:ug`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:ug`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:ug`map/getCustomMapInfo`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:ug`map/tile/${e}/${t}/${n}`,options:o})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:ug`map/upload`,queryParams:e,options:t})}}class ub{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:ug`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:ug`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:ug`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:ug`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:ug`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:ug`gateway/status/${e}`,options:t})}}class up{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:ug`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:ug`info`,options:e})}}class u_{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:ug`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:ug`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:ug`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:ug`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:ug`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:ug`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:ug`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:ug`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:ug`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:ug`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:ug`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:ug`user/${e}/userRoles/${t}/${n}`,data:o,options:r})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:ug`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:ug`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:ug`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/${t}`,options:n})}}function ug(e,...t){let n="";for(let o=0;o<t.length;o++)n+=e[o],n+=encodeURIComponent(t[o]);return n+e[e.length-1]}class uF{constructor(e,t=c5.create()){this._assetPredictedDatapointResource=new uv(e,t),this._assetResource=new uw(e,t),this._provisioningResource=new uk(e,t),this._configurationResource=new uE(e,t),this._assetDatapointResource=new uD(e,t),this._dashboardResource=new uM(e,t),this._flowResource=new uL(e,t),this._rulesResource=new uC(e,t),this._notificationResource=new uA(e,t),this._alarmResource=new uT(e,t),this._realmResource=new ux(e,t),this._appResource=new uS(e,t),this._consoleResource=new uY(e,t),this._assetModelResource=new uO(e,t),this._gatewayServiceResource=new uI(e,t),this._syslogResource=new uP(e,t),this._externalServiceResource=new uB(e,t),this._agentResource=new uR(e,t),this._mapResource=new uN(e,t),this._gatewayClientResource=new uj(e,t),this._statusResource=new uH(e,t),this._userResource=new uU(e,t),this._assetResource=new uw(e,t)}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AssetResource(){return this._assetResource}get ProvisioningResource(){return this._provisioningResource}get ConfigurationResource(){return this._configurationResource}get AssetDatapointResource(){return this._assetDatapointResource}get DashboardResource(){return this._dashboardResource}get FlowResource(){return this._flowResource}get RulesResource(){return this._rulesResource}get NotificationResource(){return this._notificationResource}get AlarmResource(){return this._alarmResource}get RealmResource(){return this._realmResource}get AppResource(){return this._appResource}get ConsoleResource(){return this._consoleResource}get AssetModelResource(){return this._assetModelResource}get GatewayServiceResource(){return this._gatewayServiceResource}get SyslogResource(){return this._syslogResource}get ExternalServiceResource(){return this._externalServiceResource}get AgentResource(){return this._agentResource}get MapResource(){return this._mapResource}get GatewayClientResource(){return this._gatewayClientResource}get StatusResource(){return this._statusResource}get UserResource(){return this._userResource}}class uy{constructor(e){this.axios=e}request(e){let t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(void 0!=t)for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);let n=e.copyFn;return this.axios.request(t).then(e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e))}}class uv extends c6{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uw extends c8{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uk extends c7{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uE extends c9{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uD extends ue{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uM extends ut{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uL extends un{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uC extends uo{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uA extends ur{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uT extends ui{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class ux extends ua{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uS extends us{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uY extends ud{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uO extends ul{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uI extends uc{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uP extends uu{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uB extends um{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uR extends uf{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uN extends uh{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uj extends ub{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uH extends up{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uU extends u_{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}c5.isAxiosError;let uz=new class{get api(){return this._client}constructor(){this._axiosInstance=c5.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>dZ().stringify(e,{arrayFormat:"repeat"}),e))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(e){this._axiosInstance.defaults.timeout=e}addRequestInterceptor(e){this._axiosInstance.interceptors.request.use(e)}initialise(e){this._baseUrl=e,this._client=new uF(e,this._axiosInstance)}};var uW=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function s(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};(ev=tM||(tM={})).DISCONNECTED="DISCONNECTED",ev.CONNECTED="CONNECTED",ev.CONNECTING="CONNECTING";let u$="SUBSCRIBED:",uV="UNAUTHORIZED:",uq="TRIGGERED:",uG="EVENT:";class uK{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=uJ.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tM.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){!function(e,t){if(0===e.length)return;let n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tM.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tM.CONNECTING),this._connectingDeferred=new d2,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=uJ.MIN_RECONNECT_DELAY,this._onStatusChanged(tM.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),t.resolve(e)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tM.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new d2};return null!=this._pendingSubscription||this._status!==tM.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return uW(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}return}if(this._attributeEventCallbackMap.delete(e)){if(this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}return}})}sendEvent(e){this._status===tM.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return uW(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,r="AssetEvent"+uK._subscriptionCounter++;if(!this._assetEventPromise){let e;mm.authenticated||(e={filterType:"asset",realm:mm.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(r,e=>{let t=e.asset.id;o?o.find(e=>t===e)&&n(e):e.asset.realm===mm.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(o&&t){let e={messageID:"read-assets:"+o.join(",")+":"+r,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(r)&&e.assets.forEach(e=>{n({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),r&&this.unsubscribe(r),t}return r})})}subscribeAttributeEvents(e,t,n){return uW(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0],r=o?e.map(e=>e.id):e,i=o?e:void 0,a="AttributeEvent"+uK._subscriptionCounter++;if(!this._attributeEventPromise){let e;mm.authenticated||(e={filterType:"asset",realm:mm.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let s=t=>{let i=t.ref;o?e.forEach(e=>{i.id===e.id&&i.name===e.name&&n(t)}):r?r.find(e=>i.id===e)&&n(t):t.realm===mm.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then(()=>{try{if(t&&r){let e={messageID:"read-assets:"+r.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(a)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,n])=>{(!i||i.find(n=>n.id===e.id&&n.name===t))&&s({eventType:"attribute",timestamp:n.timestamp,value:n.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a})})}_processNextSubscription(){this._status===tM.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{let n=e.deferred;e.deferred=null,n&&n.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){let n=this._subscriptionMap.get(e);n&&n.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tM.CONNECTED&&this._onStatusChanged(tM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tM.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<uJ.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(uJ.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}uK.MIN_RECONNECT_DELAY=0,uK.MAX_RECONNECT_DELAY=3e4,uK._subscriptionCounter=0;class uJ extends uK{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let e=this._endpointUrl+"?Realm="+mm.config.realm;return this._connectDeferred=new d2,(mm.authenticated?mm.retrieveAuthorizationHeader().then(t=>{e+="&Authorization="+t}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(e),this._webSocket.onopen=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(console.error("Event provider error:",e),this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{let t=e.data;if(t&&t.startsWith(u$)){let e=JSON.parse(t.substring(u$.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(uV)){let e=JSON.parse(t.substring(uV.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),n.reject("Unauthorized"))}else if(t.startsWith(uq)){let e=JSON.parse(t.substring(uq.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(uG)){let e=JSON.parse(t.substring(uG.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null==(e=this._webSocket)||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new d2,e.subscriptionId||(e.subscriptionId=uJ._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:e}))}_doSend(e){let t=uG+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageID||(e.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageID))return Promise.reject("There's already a pending send and reply with this ID");let t=new d2;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(uG+JSON.stringify(e)),t.promise}}uJ._subscriptionCounter=1;let uX=["__proto__","constructor","prototype"];function uQ(e){return!("string"!=typeof e||0===e.length||e.length>128||uX.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function uZ(e){return!(!uQ(e)||e.indexOf("/")>-1)}let u0={lng:uZ,ns:function(e){return uQ(e)}};function u1(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function u2(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let u4=/\{\{(.+?)\}\}/g;function u3(e,t){let n=!1,o=e.replace(u4,(e,o)=>{let r=o.trim();if(uX.indexOf(r)>-1)return e;let i=t[r];if(null==i)return e;let a=u0[r]||uZ,s=String(i).split("+");for(let t of s)if(!a(t))return n=!0,e;return s.join("+")});return n?null:o}let u5="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?r=fetch:u5&&"function"==typeof u5.fetch&&(r=u5.fetch);let u6=u2()&&u5?u5.XMLHttpRequest:void 0,u8="function"==typeof ActiveXObject&&u5?u5.ActiveXObject:void 0,u7=["__proto__","constructor","prototype"],u9=(e,t)=>{if(t&&"object"==typeof t){let n="";for(let e of Object.keys(t))u7.indexOf(e)>-1||(n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},me=(e,t,n,o)=>{let i=e=>{if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(o){let r=o(e,t);if(r instanceof Promise)return void r.then(i).catch(n)}"function"==typeof fetch?fetch(e,t).then(i).catch(n):r(e,t).then(i).catch(n)},mt=(e,t,n,o)=>{if("function"==typeof n&&(o=n,n=void 0),o=o||(()=>{}),r&&0!==t.indexOf("file:")){var i=t,a=n,s=o;e.queryStringParams&&(i=u9(i,e.queryStringParams));let r={..."function"==typeof e.customHeaders?e.customHeaders():e.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(r["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),a&&(r["Content-Type"]="application/json");let d="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,l={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:r,...e._omitFetchOptions?{}:d},c="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{me(i,l,s,c)}catch(t){if(!d||0===Object.keys(d).length||!t.message||0>t.message.indexOf("not implemented"))return s(t);try{Object.keys(d).forEach(e=>{delete l[e]}),me(i,l,s,c),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(u2()||"function"==typeof ActiveXObject){var d=t,l=n,c=o;l&&"object"==typeof l&&(l=u9("",l).slice(1)),e.queryStringParams&&(d=u9(d,e.queryStringParams));try{let t=u6?new u6:new u8("MSXML2.XMLHTTP.3.0");t.open(l?"POST":"GET",d,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,l&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let n=e.customHeaders;if(n="function"==typeof n?n():n)for(let e of Object.keys(n))u7.indexOf(e)>-1||t.setRequestHeader(e,n[e]);t.onreadystatechange=()=>{t.readyState>3&&c(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(l)}catch(e){console&&console.log(e)}return}o(Error("No fetch and no xhr implementation found!"))};var mn=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||""}),parseLoadPayload:(e,t)=>void 0,request:mt,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,o,r){var i,a;let s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=(a=i=s)&&"function"==typeof a.then?i:Promise.resolve(i)).then(i=>{if(!i)return r(null,{});let a=u3(i,{lng:e.join("+"),ns:n.join("+")});if(null==a)return r(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(u1).join(", ")+"] namespaces=["+n.map(u1).join(", ")+"]"),!1);this.loadUrl(a,r,t,o)})}loadUrl(e,t,n,o){let r=this.options.parseLoadPayload("string"==typeof n?[n]:n,"string"==typeof o?[o]:o),i=u1(function(e){if("string"!=typeof e||0===e.length)return e;try{let t=new URL(e);if(t.username||t.password)return t.username="",t.password="",t.toString();return e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,r,(e,r)=>{let a,s;if(r&&(r.status>=500&&r.status<600||!r.status))return t("failed loading "+i+"; status code: "+r.status,!0);if(r&&r.status>=400&&r.status<500)return t("failed loading "+i+"; status code: "+r.status,!1);if(!r&&e&&e.message){let n=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>n.indexOf(e)>-1))return t("failed loading "+i+": "+u1(e.message),!0)}if(e)return t(e,!1);try{a="string"==typeof r.data?this.options.parse(r.data,n,o):r.data}catch(e){s="failed parsing "+i+" to json"}if(s)return t(s,!1);t(null,a)})}create(e,t,n,o,r){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let i=this.options.parsePayload(t,n,o),a=0,s=[],d=[];e.forEach(n=>{let o=this.options.addPath;"function"==typeof this.options.addPath&&(o=this.options.addPath(n,t));let l=u3(o,{lng:n,ns:t});if(null==l){a+=1,r&&a===e.length&&r(s,d);return}this.options.request(this.options,l,i,(t,n)=>{a+=1,s.push(t),d.push(n),a===e.length&&"function"==typeof r&&r(s,d)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,o=e.language;if(o&&"cimode"===o.toLowerCase())return;let r=[],i=e=>{t.toResolveHierarchy(e).forEach(e=>{0>r.indexOf(e)&&r.push(e)})};i(o),this.allOptions.preload&&this.allOptions.preload.forEach(e=>i(e)),r.forEach(t=>{this.allOptions.ns.forEach(o=>{e.read(t,o,"read",null,null,(r,i)=>{r&&n.warn(`loading namespace ${o} for language ${t} failed`,r),!r&&i&&n.log(`loaded namespace ${o} for language ${t}`,i),e.loaded(`${t}|${o}`,r,i)})})})}};mn.type="backend";var mo=n(4954);class mr extends Error{}function mi(e,t){let n;if("string"!=typeof e)throw new mr("Invalid token specified: must be a string");t||(t={});let o=+(!0!==t.header),r=e.split(".")[o];if("string"!=typeof r)throw new mr(`Invalid token specified: missing part #${o+1}`);try{n=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(r)}catch(e){throw new mr(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new mr(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}if(mr.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function ma(e){if(!(this instanceof ma))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=this,r=[],i={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)(-1!==a[s].src.indexOf("keycloak.js")||-1!==a[s].src.indexOf("keycloak.min.js"))&&-1!==a[s].src.indexOf("version=")&&(o.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var d=!0,l=L(console.info),c=L(console.warn);function u(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=Array(e);for(var o=0;o<t.length;o++)t[o]=Math.floor(256*Math.random());return t}(e),o=Array(e),r=0;r<e;r++)o[r]=t.charCodeAt(n[r]%t.length);return String.fromCharCode.apply(null,o)}function m(){return void 0===o.authServerUrl?void 0:"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function f(e,t){var n=e.code,r=e.error,i=e.prompt,a=new Date().getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),r){if("none"!=i)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:r,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=o.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var c="code="+n+"&grant_type=authorization_code",u=o.endpoints.token(),m=new XMLHttpRequest;m.open("POST",u,!0),m.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c+="&client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(c+="&code_verifier="+e.pkceCodeVerifier),m.withCredentials=!0,m.onreadystatechange=function(){if(4==m.readyState)if(200==m.status){var e=JSON.parse(m.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),v()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},m.send(c)}function f(n,r,i,s){b(n,r,i,a=(a+new Date().getTime())/2),d&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(l("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function h(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function b(e,t,n,r){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=mi(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=mi(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=mi(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,r&&(o.timeSkew=Math.floor(r/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(l("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var i=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;l("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,i)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function p(){var e="0123456789abcdef",t=u(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function _(e){var t=function(e){switch(o.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var t,n,r,i=e.indexOf("?"),a=e.indexOf("#");if("query"===o.responseMode&&-1!==i?(n=e.substring(0,i),""!==(r=g(e.substring(i+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+r.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(r=g(e.substring(a+1),t)).paramsString&&(n+="#"+r.paramsString)),r&&r.oauthParams){if("standard"===o.flow||"hybrid"===o.flow){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}else if("implicit"===o.flow&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}}(e);if(t){var r=n.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier,t.loginOptions=r.loginOptions),t}}function g(e,t){for(var n=e.split("&"),o={paramsString:"",oauthParams:{}},r=0;r<n.length;r++){var i=n[r].indexOf("="),a=n[r].slice(0,i);-1!==t.indexOf(a)?o.oauthParams[a]=n[r].slice(i+1):(""!==o.paramsString&&(o.paramsString+="&"),o.paramsString+=n[r])}return o}function F(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}function y(){var e=F();if(!i.enable||i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?i.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):i.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",function(e){if(e.origin===i.iframeOrigin&&i.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),n=t.length-1;n>=0;--n){var r=t[n];"error"==e.data?r.setError():r.setSuccess("unchanged"==e.data)}}},!1),e.promise}function v(){i.enable&&o.token&&setTimeout(function(){w().then(function(e){e&&v()})},1e3*i.interval)}function w(){var e=F();if(i.iframe&&i.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");i.callbackList.push(e);var n=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function k(){var e,t,n,r=F();if(i.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var s=function(e){a.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(c("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),i.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",s),r.setSuccess())};window.addEventListener("message",s,!1)}else r.setSuccess();return e=r.promise,t=o.messageReceiveTimeout,n=null,Promise.race([e,new Promise(function(e,o){n=setTimeout(function(){o({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(n)})}function E(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),F().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));let n=o.createLogoutUrl(e),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(r.redirected){window.location.href=r.url;return}if(r.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(o.createRegisterUrl(e)),F().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return F().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},r=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,n){return e.push(n+"="+t[n]),e},[]).join(",")},a=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=F(),i=r(e),s=n(o.createLoginUrl(e),"_blank",i),d=!1,l=!1,c=function(){l=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(f(_(e.url),t),c(),d=!0)}),s.addEventListener("loaderror",function(e){d||(0==e.url.indexOf(a())?(f(_(e.url),t),c(),d=!0):(t.setError(),c()))}),s.addEventListener("exit",function(e){l||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,r=F(),i=n(o.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return i.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&i.close()}),i.addEventListener("loaderror",function(e){0==e.url.indexOf(a())||(t=!0),i.close()}),i.addEventListener("exit",function(e){t?r.setError():(o.clearToken(),r.setSuccess())}),r.promise},register:function(e){var t=F(),i=n(o.createRegisterUrl(),"_blank",r(e));return i.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(i.close(),f(_(e.url),t))}),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e){var t=n(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return a()}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=F(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(_(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=F(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=F(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(_(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw"Not supported by the OIDC server"},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(r){if(o.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new D}catch(e){}return new M}(),t=r&&["default","cordova","cordova-native"].indexOf(r.adapter)>-1?E(r.adapter):r&&"object"==typeof r.adapter?r.adapter:window.Cordova||window.cordova?E("cordova"):E(),r){if(void 0!==r.useNonce&&(d=r.useNonce),void 0!==r.checkLoginIframe&&(i.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(i.interval=r.checkLoginIframeInterval),"login-required"===r.onLoad&&(o.loginRequired=!0),r.responseMode)if("query"===r.responseMode||"fragment"===r.responseMode)o.responseMode=r.responseMode;else throw"Invalid value for responseMode";if(r.flow){switch(r.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=r.flow}if(null!=r.timeSkew&&(o.timeSkew=r.timeSkew),r.redirectUri&&(o.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),"boolean"==typeof r.silentCheckSsoFallback?o.silentCheckSsoFallback=r.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,void 0!==r.pkceMethod){if("S256"!==r.pkceMethod&&!1!==r.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);o.pkceMethod=r.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof r.enableLogging?o.enableLogging=r.enableLogging:o.enableLogging=!1,"POST"===r.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof r.scope&&(o.scope=r.scope),"string"==typeof r.acrValues&&(o.acrValues=r.acrValues),"number"==typeof r.messageReceiveTimeout&&r.messageReceiveTimeout>0?o.messageReceiveTimeout=r.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var a=F(),s=F();s.promise.then(function(){o.onReady&&o.onReady(o.authenticated),a.setSuccess(o.authenticated)}).catch(function(e){a.setError(e)});var l=function(){var t=F();function n(e){e?o.endpoints={authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:o.endpoints={authorize:function(){return m()+"/protocol/openid-connect/auth"},token:function(){return m()+"/protocol/openid-connect/token"},logout:function(){return m()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=m()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=m()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return m()+"/protocol/openid-connect/registrations"},userinfo:function(){return m()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(a=e):a="keycloak.json",a){var r=new XMLHttpRequest;r.open("GET",a,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status||h(r)){var e=JSON.parse(r.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,n(null),t.setSuccess()}else t.setError()},r.send()}else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var i=e.oidcProvider;if(i)if("string"==typeof i){var a,s="/"==i.charAt(i.length-1)?i+".well-known/openid-configuration":i+"/.well-known/openid-configuration",r=new XMLHttpRequest;r.open("GET",s,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||h(r)?(n(JSON.parse(r.responseText)),t.setSuccess()):t.setError())},r.send()}else n(i),t.setSuccess();else{if(!e.url){for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++)if(d[l].src.match(/.*keycloak\.js/)){e.url=d[l].src.substr(0,d[l].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";o.authServerUrl=e.url,o.realm=e.realm,n(null),t.setSuccess()}}return t.promise}();function c(){var e=function(e){e||(n.prompt="none"),r&&r.locale&&(n.locale=r.locale),o.login(n).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(f(_(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(r.onLoad){case"check-sso":i.enable?y().then(function(){w().then(function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=_(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return y().then(function(){f(e,s)}).catch(function(e){s.setError(e)});r?r.token&&r.refreshToken?(b(r.token,r.refreshToken,r.idToken),i.enable?y().then(function(){w().then(function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),v()):s.setSuccess()}).catch(function(e){s.setError(e)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()}).catch(function(e){o.onAuthError&&o.onAuthError(),r.onLoad?c():s.setError(e)})):r.onLoad?c():s.setSuccess():s.setSuccess()}return l.then(function(){var e,t;(e=F(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(k).then(u).catch(function(e){a.setError(e)})}),l.catch(function(e){a.setError(e)}),a.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var r,i=p(),a=p(),s=t.redirectUri(e),l={state:i,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(l.prompt=e.prompt),r=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var c=e&&e.scope||o.scope;c?-1===c.indexOf("openid")&&(c="openid "+c):c="openid";var m=r+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(c);if(d&&(m=m+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(m+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(m+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(m+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(m+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(m+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(m+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(m+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||o.acrValues)&&(m+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var f=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");l.pkceCodeVerifier=f,m+="&code_challenge="+function(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return btoa(String.fromCodePoint(...new Uint8Array(mo.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,f)+"&code_challenge_method="+o.pkceMethod}return n.add(l),m},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=m(),r=void 0;return void 0!==n&&(r=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),r},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=m()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=F();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=F();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return l("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=F();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,l("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(e))&&(n=!0,l("[KEYCLOAK] Refreshing token: token expired")),n){var i="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.endpoints.token();if(r.push(t),1==r.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,i+="&client_id="+encodeURIComponent(o.clientId);var d=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){l("[KEYCLOAK] Token refreshed"),d=(d+new Date().getTime())/2;var e=JSON.parse(s.responseText);b(e.access_token,e.refresh_token,e.id_token,d),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=r.pop();null!=t;t=r.pop())t.setSuccess(!0)}else{c("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var t=r.pop();null!=t;t=r.pop())t.setError(!0)}},s.send(i)}}else t.setSuccess(!1)};return i.enable?w().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},o.clearToken=function(){o.token&&(b(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var D=function(){if(!(this instanceof D))return new D;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var o=localStorage.getItem(n);if(o)try{var r=JSON.parse(o).expires;(!r||r<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,o=localStorage.getItem(n);return o&&(localStorage.removeItem(n),o=JSON.parse(o)),e(),o}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},M=function(){if(!(this instanceof M))return new M;this.get=function(o){if(o){var r=t("kc-callback-"+o);if(n("kc-callback-"+o,"",e(-100)),r)return JSON.parse(r)}},this.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){n(t,"",e(-100))};var e=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},t=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return""},n=function(e,t,n){var o=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=o}};function L(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var ms=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function s(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let md="openremote";(ew=tL||(tL={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ew.AUTH_FAILED="AUTH_FAILED",ew.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ew.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ew.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ew.TRANSLATION_ERROR="TRANSLATION_ERROR",(ek=tC||(tC={})).ERROR="ERROR",ek.READY="READY",ek.ONLINE="ONLINE",ek.OFFLINE="OFFLINE",ek.CONNECTING="CONNECTING",ek.CONSOLE_INIT="CONSOLE_INIT",ek.CONSOLE_READY="CONSOLE_READY",ek.TRANSLATE_INIT="TRANSLATE_INIT",ek.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",ek.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",ek.LOGIN="LOGIN";let ml={cn:"zh-cn"};class mc{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._disconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){let e=new Map;return this._keycloak?this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,n])=>{let o=n.roles;e.set(t,o)}):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){var e;return null==(e=this._config)?void 0:e.managerUrl}get keycloakUrl(){var e;return null==(e=this._config)?void 0:e.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return uz}get language(){return o$.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(o$.changeLanguage(e),this.console.storeData("LANGUAGE",e),this.authenticated&&this.updateKeycloakUserLanguage(e).catch(e=>console.error(e)))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(tC.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||md}getEventProvider(){return this.events}isManagerSameOrigin(){if(!this.ready)return!1;let e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){0>this._listeners.indexOf(e)&&this._listeners.push(e)}removeListener(e){let t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return ms(this,void 0,void 0,function*(){let t;this._config&&console.debug("Already initialised"),this._config=((t=e?Object.assign({},e):{}).managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+window.location.pathname.replace(/\/[^/]+\/?$/,""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),void 0===t.applyConfigToAdmin&&(t.applyConfigToAdmin=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId=md),t);let n=yield this.loadManagerInfo(),o=new d8(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tC.CONSOLE_READY)});if(this._console=o,"BASIC"===this._config.auth)n=(yield this.doTranslateInit())&&n,n=yield this.doAuthInit();else if("KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){let e,t=new URL(this._config.managerUrl);this._authServerUrl.startsWith("//")&&(this._authServerUrl=t.protocol+this._authServerUrl);try{e=new URL(this._authServerUrl)}catch(n){(e=new URL(t)).pathname=this._authServerUrl}e.protocol||(e.protocol=t.protocol),e.hostname||(e.hostname=t.hostname),e.port||(e.port=t.port),this._config.keycloakUrl=e.toString()}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),(n=yield this.doAuthInit())||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",n=yield this.doAuthInit())}return!!n&&(n&&(n=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(n=(yield this.doTranslateInit())&&n)&&(n=yield this.doDescriptorsInit(),n=yield this.getConsoleAppConfig()),this.doIconInit(),n?(n=yield this.doEventsSubscriptionInit(),this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(tC.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return ms(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()});return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(tL.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return ms(this,void 0,void 0,function*(){if(o$.isInitialized)return!0;o$.on("initialized",e=>{this._emitEvent(tC.TRANSLATE_INIT)}),o$.on("languageChanged",e=>{var t;d1().locale(null!=(t=ml[e])?t:e),this._emitEvent(tC.TRANSLATE_LANGUAGE_CHANGED)});let e={lng:(yield this.getConsolePreferredLanguage())||(yield this.getUserPreferredLanguage())||this.config.defaultLanguage||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,interpolation:{format:(e,t,n)=>"uppercase"===t?e.toUpperCase():e instanceof Date?d1()(e).format(t):e},backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield o$.use(mn).init(e)}catch(e){return console.error(e),this._setError(tL.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return ms(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield uz.api.AssetModelResource.getAssetInfos(),t=yield uz.api.AssetModelResource.getMetaItemDescriptors(),n=yield uz.api.AssetModelResource.getValueDescriptors();nz._assetTypeInfos=e.data,nz._metaItemDescriptors=Object.values(t.data),nz._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return ms(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(tL.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(uz.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return uz.setTimeout(2e4),uz.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return ms(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new uJ(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tL.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tM.DISCONNECTED?this.events.connect().catch(e=>{console.error("Failed to connect EventProvider."),console.error(e)}):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case tM.DISCONNECTED:this._onDisconnect();break;case tM.CONNECTED:break;case tM.CONNECTING:this._emitEvent(tC.CONNECTING)}}doConsoleInit(){return ms(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tC.CONSOLE_INIT),!0}catch(e){return this._setError(tL.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(nq.addIconSet("mdi",(e=mu.managerUrl,{getIconTemplate:e=>nf`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){let t=document.createElement("style");t.id="mdiFontStyle",t.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot");\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+e+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),nq.addIconSet("or",{getIconTemplate:e=>{let t=nW[e];return t?nf`
2826
+ `;class dJ extends nS{static finalizeStyles(e){return[dK,...super.finalizeStyles(e)]}}function dX(e,t,n){return e?t(e):n?.(e)}n(4532);var dQ=n(8183),dZ=n.n(dQ),d0=n(4867),d1=n.n(d0);n(3472);class d2{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}}function d4(e,t,n=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function||e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length||e instanceof Date||!(e instanceof Object)||!(t instanceof Object))return!1;if(n){if(Array.isArray(e))return e.every((e,n)=>d4(e,t[n]));let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>d4(e[n],t[n]))}return!1}class d3{constructor(e){e&&Object.assign(this,e)}matches(e){var t,n,o,r,i,a,s;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(n=this.types)?void 0:n.length)&&(!e.type||!this.types.includes(e.type))||(null==(o=this.realm)?void 0:o.name)&&e.realm!==this.realm.name||(null==(r=this.parents)?void 0:r.length)&&!this.parents.some(t=>!t.id||e.parentId===t.id))return!1;if(null==(i=this.paths)?void 0:i.length){let t=null!=(a=e.path)?a:[];if(!this.paths.some(e=>{var n;return(null!=(n=e.path)?n:[]).every((e,n)=>t[n]===e)}))return!1}return(null==(s=this.names)||!s.length||!!this.names.every(t=>d3._evalValuePredicate(e.name,t)))&&(!this.attributes||d3._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!d3._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?d3._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var n;switch(t.predicateType){case"string":{let o;if(null==e)return!1;let r=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),i=!1!==t.caseSensitive?t.value:null==(n=t.value)?void 0:n.toLowerCase();switch(t.match){case"BEGIN":o=r.startsWith(i);break;case"END":o=r.endsWith(i);break;case"CONTAINS":o=r.includes(i);break;default:o=r===i}return t.negate?!o:o}case"boolean":return e===t.value;case"number":{let n;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":n=e>t.value;break;case"GREATER_EQUALS":n=e>=t.value;break;case"LESS_THAN":n=e<t.value;break;case"LESS_EQUALS":n=e<=t.value;break;case"BETWEEN":n=e>=t.value&&e<=t.rangeValue;break;default:n=e===t.value}return t.negate?!n:n}}return!1}static _evalPredicate(e,t){var n,o;let r=null==(n=t.name)?void 0:n.value;if(!r)return!0;let i=null==(o=e.attributes)?void 0:o[r];if(!i)return!!t.negated;let a=!t.value||d3._evalValuePredicate(i.value,t.value);return t.negated?!a:a}static _evalGroup(e,t){var n,o,r;let i=null!=(n=t.operator)?n:"AND",a=[...(null!=(o=t.items)?o:[]).map(t=>d3._evalPredicate(e,t)),...(null!=(r=t.groups)?r:[]).map(t=>d3._evalGroup(e,t))];return!a.length||("OR"===i?a.some(Boolean):a.every(Boolean))}static _collectNames(e){var t,n;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(n=e.groups)?n:[]).flatMap(e=>d3._collectNames(e))]}}d3._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var d5=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function s(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let d6=n(4461);class d8{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let o=new URLSearchParams(window.location.search),r=o.get("consoleName"),i=o.get("consoleVersion"),a=o.get("consolePlatform"),s=o.get("consoleProviders"),d=o.get("consoleAutoEnable"),l=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=l;let c=d8._createConsoleRegistration(),u=window.localStorage.getItem(this._storageKey);if(u)try{let e=JSON.parse(u);e.id&&(c.id=e.id),e.name&&(c.name=e.name),e.providers&&(c.providers=e.providers),e.apps&&(c.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let m=c.providers;for(let e of(c.providers={},l)){let t=m&&m.hasOwnProperty(e)?m[e]:{enabled:!1,disabled:!1};c.providers[e]=t}let f=mm.getAppName();f.length>0&&0>c.apps.indexOf(f)&&c.apps.push(f),this._registration=c,r&&(c.name=r),i&&(c.version=i),a&&(c.platform=a),d&&(this._autoEnable="TRUE"===d||"true"===d)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return d5(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return d5(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}})}enableProvider(e,t){return d5(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},o=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=o.hasPermission,this._registration.providers[e].success=o.success,this._registration.providers[e].enabled=o.success,this._registration.providers[e].data=o.data;let r=this._pendingProviderEnables.indexOf(e);return r>=0&&(this._pendingProviderEnables.splice(r,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),o})}disableProvider(e){return d5(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t})}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return d5(this,void 0,void 0,function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let o=new d2,r=()=>{delete this._pendingProviderPromises[n],o.reject("No response from provider")};return this._pendingProviderPromises[n]=[o,window.setTimeout(r,5e3)],this._doSendProviderMessage(e),o.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>d5(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),e()}catch(e){console.error("Failed to register console",e),t(e)}}))})}_sendRegistration(e){return d5(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield mm.rest.api.ConsoleResource.register(this._registration);if(200!==e.status)throw Error("Failed to register console");this._registration=e.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(n){if(e&&t&&d8._isStaleRegistrationResponse(n)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw n}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(e){let t=e&&e.response?e.response.status:void 0;return 403===t||409===t}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return d5(this,void 0,void 0,function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{let e=yield Promise.race([t,new Promise((e,t)=>setTimeout(t,2e3))]);if(e&&e.value){let t=e.value;return"null"===t?void 0:t}}catch(e){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(e));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(e)}catch(e){console.error("Failed to send shell message towards console",e)}}_doSendGenericMessage(e,t){let n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'retrieve' action requires a `key`");let n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,o=t.action,r=this._pendingProviderPromises[n+o];r&&(window.clearTimeout(r[1]),delete this._pendingProviderPromises[n+o],r[0].resolve(t));let i=this._providerMessageListeners[n+o];i&&i(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:d6.name,version:d6.version,platform:d6.os.toString(),apps:[],model:((d6.manufacturer?d6.manufacturer+" ":"")+(d6.product?d6.product:"")).trim()}}_initialiseProvider(e){return d5(this,void 0,void 0,function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}})}}function d7(e,t){return function(){return e.apply(t,arguments)}}let{toString:d9}=Object.prototype,{getPrototypeOf:le}=Object,{iterator:lt,toStringTag:ln}=Symbol,lo=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lr=(e,t)=>{let n=e,o=[];for(;null!=n&&n!==Object.prototype&&-1===o.indexOf(n);){if(o.push(n),lo(n,t))return!0;n=le(n)}return!1},li=(i=Object.create(null),e=>{let t=d9.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())}),la=e=>(e=e.toLowerCase(),t=>li(t)===e),ls=e=>t=>typeof t===e,{isArray:ld}=Array,ll=ls("undefined");function lc(e){return null!==e&&!ll(e)&&null!==e.constructor&&!ll(e.constructor)&&lf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let lu=la("ArrayBuffer"),lm=ls("string"),lf=ls("function"),lh=ls("number"),lb=e=>null!==e&&"object"==typeof e,lp=e=>{if(!lb(e))return!1;let t=le(e);return(null===t||t===Object.prototype||null===le(t))&&!lr(e,ln)&&!lr(e,lt)},l_=la("Date"),lg=la("File"),lF=la("Blob"),ly=la("FileList"),lv="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lw=void 0!==lv.FormData?lv.FormData:void 0,lk=la("URLSearchParams"),[lE,lD,lM,lL]=["ReadableStream","Request","Response","Headers"].map(la);function lC(e,t,{allOwnKeys:n=!1}={}){let o,r;if(null!=e)if("object"!=typeof e&&(e=[e]),ld(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{let r;if(lc(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;for(o=0;o<a;o++)r=i[o],t.call(null,e[r],r,e)}}function lA(e,t){let n;if(lc(e))return null;t=t.toLowerCase();let o=Object.keys(e),r=o.length;for(;r-- >0;)if(t===(n=o[r]).toLowerCase())return n;return null}let lT="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lx=e=>!ll(e)&&e!==lT,lS=(a="u">typeof Uint8Array&&le(Uint8Array),e=>a&&e instanceof a),lY=la("HTMLFormElement"),{propertyIsEnumerable:lO}=Object.prototype,lI=la("RegExp"),lP=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),o={};lC(n,(n,r)=>{let i;!1!==(i=t(n,r,e))&&(o[r]=i||n)}),Object.defineProperties(e,o)},lB=la("AsyncFunction"),lR=(l="function"==typeof setImmediate,c=lf(lT.postMessage),l?setImmediate:c?(u=`axios@${Math.random()}`,m=[],lT.addEventListener("message",({source:e,data:t})=>{e===lT&&t===u&&m.length&&m.shift()()},!1),e=>{m.push(e),lT.postMessage(u,"*")}):e=>setTimeout(e)),lN="u">typeof queueMicrotask?queueMicrotask.bind(lT):"u">typeof process&&process.nextTick||lR,lj=e=>null!=e&&lf(e[lt]),lH={isArray:ld,isArrayBuffer:lu,isBuffer:lc,isFormData:e=>{if(!e)return!1;if(lw&&e instanceof lw)return!0;let t=le(e);if(!t||t===Object.prototype||!lf(e.append))return!1;let n=li(e);return"formdata"===n||"object"===n&&lf(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&lu(e.buffer)},isString:lm,isNumber:lh,isBoolean:e=>!0===e||!1===e,isObject:lb,isPlainObject:lp,isEmptyObject:e=>{if(!lb(e)||lc(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lE,isRequest:lD,isResponse:lM,isHeaders:lL,isUndefined:ll,isDate:l_,isFile:lg,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lF,isRegExp:lI,isFunction:lf,isStream:e=>lb(e)&&lf(e.pipe),isURLSearchParams:lk,isTypedArray:lS,isFileList:ly,forEach:lC,merge:function e(...t){let{caseless:n,skipUndefined:o}=lx(this)&&this||{},r={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;let a=n&&"string"==typeof i&&lA(r,i)||i,s=lo(r,a)?r[a]:void 0;lp(s)&&lp(t)?r[a]=e(s,t):lp(t)?r[a]=e({},t):ld(t)?r[a]=t.slice():o&&ll(t)||(r[a]=t)};for(let e=0,n=t.length;e<n;e++){let n=t[e];if(!n||lc(n)||(lC(n,i),"object"!=typeof n||ld(n)))continue;let o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){let t=o[e];lO.call(n,t)&&i(n[t],t)}}return r},extend:(e,t,n,{allOwnKeys:o}={})=>(lC(t,(t,o)=>{n&&lf(t)?Object.defineProperty(e,o,{__proto__:null,value:d7(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let r,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(r=Object.getOwnPropertyNames(e)).length;i-- >0;)a=r[i],(!o||o(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==n&&le(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:li,kindOfTest:la,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let o=e.indexOf(t,n);return -1!==o&&o===n},toArray:e=>{if(!e)return null;if(ld(e))return e;let t=e.length;if(!lh(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,o=(e&&e[lt]).call(e);for(;(n=o.next())&&!n.done;){let o=n.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let n,o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:lY,hasOwnProperty:lo,hasOwnProp:lo,hasOwnInPrototypeChain:lr,getSafeProp:(e,t)=>null!=e&&lr(e,t)?e[t]:void 0,reduceDescriptors:lP,freezeMethods:e=>{lP(e,(t,n)=>{if(lf(e)&&["arguments","caller","callee"].includes(n))return!1;if(lf(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(ld(e)?e:String(e).split(t)).forEach(e=>{n[e]=!0}),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:lA,global:lT,isContextDefined:lx,isSpecCompliantForm:function(e){return!!(e&&lf(e.append)&&"FormData"===e[ln]&&e[lt])},toJSONObject:e=>{let t=new WeakSet,n=e=>{if(lb(e)){if(t.has(e))return;if(lc(e))return e;if(!("toJSON"in e)){t.add(e);let o=ld(e)?[]:{};return lC(e,(e,t)=>{let r=n(e);ll(r)||(o[t]=r)}),t.delete(e),o}}return e};return n(e)},isAsyncFn:lB,isThenable:e=>e&&(lb(e)||lf(e))&&lf(e.then)&&lf(e.catch),setImmediate:lR,asap:lN,isIterable:lj,isSafeIterable:e=>null!=e&&lr(e,lt)&&lj(e)},lU=lH.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),lz=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lW=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function l$(e,t){return lH.isArray(e)?e.map(e=>l$(e,t)):function(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function lV(e){let t=Object.create(null);return lH.forEach(e.toJSON(),(e,n)=>{t[n]=l$(e,lW)}),t}let lq=Symbol("internals");function lG(e){return e&&String(e).trim().toLowerCase()}function lK(e){return!1===e||null==e?e:lH.isArray(e)?e.map(lK):l$(String(e),lz)}function lJ(e,t,n,o,r){if(lH.isFunction(o))return o.call(this,t,n);if(r&&(t=n),lH.isString(t)){if(lH.isString(o))return -1!==t.indexOf(o);if(lH.isRegExp(o))return o.test(t)}}class lX{constructor(e){e&&this.set(e)}set(e,t,n){let o=this;function r(e,t,n){let r=lG(t);if(!r)return;let i=lH.findKey(o,r);i&&void 0!==o[i]&&!0!==n&&(void 0!==n||!1===o[i])||(o[i||t]=lK(e))}let i=(e,t)=>lH.forEach(e,(e,n)=>r(e,n,t));if(lH.isPlainObject(e)||e instanceof this.constructor)i(e,t);else{let o;if(lH.isString(e)&&(e=e.trim())&&(o=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim()))){var a;let n,o,r,s;i((s={},(a=e)&&a.split("\n").forEach(function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),o=e.substring(r+1).trim(),!n||s[n]&&lU[n]||("set-cookie"===n?s[n]?s[n].push(o):s[n]=[o]:s[n]=s[n]?s[n]+", "+o:o)}),s),t)}else if(lH.isObject(e)&&lH.isSafeIterable(e)){let n=Object.create(null),o,r;for(let t of e){if(!lH.isArray(t))throw TypeError("Object iterator must return a key-value pair");r=t[0],lH.hasOwnProp(n,r)?(o=n[r],n[r]=lH.isArray(o)?[...o,t[1]]:[o,t[1]]):n[r]=t[1]}i(n,t)}else null!=e&&r(t,e,n)}return this}get(e,t){if(e=lG(e)){let n=lH.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t){let t,n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=o.exec(e);)n[t[1]]=t[2];return n}if(lH.isFunction(t))return t.call(this,e,n);if(lH.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=lG(e)){let n=lH.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||lJ(this,this[n],n,t)))}return!1}delete(e,t){let n=this,o=!1;function r(e){if(e=lG(e)){let r=lH.findKey(n,e);r&&(!t||lJ(n,n[r],r,t))&&(delete n[r],o=!0)}}return lH.isArray(e)?e.forEach(r):r(e),o}clear(e){let t=Object.keys(this),n=t.length,o=!1;for(;n--;){let r=t[n];(!e||lJ(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){let t=this,n={};return lH.forEach(this,(o,r)=>{let i=lH.findKey(n,r);if(i){t[i]=lK(o),delete t[r];return}let a=e?r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(r).trim();a!==r&&delete t[r],t[a]=lK(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return lH.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&lH.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[lq]=this[lq]={accessors:{}}).accessors,n=this.prototype;function o(e){let o=lG(e);if(!t[o]){let r;r=lH.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(n,t+r,{__proto__:null,value:function(n,o,r){return this[t].call(this,e,n,o,r)},configurable:!0})}),t[o]=!0}}return lH.isArray(e)?e.forEach(o):o(e),this}}lX.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lH.reduceDescriptors(lX.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),lH.freezeMethods(lX);class lQ extends Error{static from(e,t,n,o,r,i){let a=new lQ(e.message,t||e.code,n,o,r);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,o,r){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r,this.status=r.status)}toJSON(){let e,t,n,o=this.config,r=o&&lH.hasOwnProp(o,"redact")?o.redact:void 0,i=lH.isArray(r)&&r.length>0?(e=new Set(r.map(e=>String(e).toLowerCase())),t=[],(n=o=>{let r;if(null===o||"object"!=typeof o||lH.isBuffer(o))return o;if(-1===t.indexOf(o)){if(o instanceof lX&&(o=o.toJSON()),t.push(o),lH.isArray(o))r=[],o.forEach((e,t)=>{let o=n(e);lH.isUndefined(o)||(r[t]=o)});else{if(!lH.isPlainObject(o)&&function(e){if(lH.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lH.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(o))return t.pop(),o;for(let[t,i]of(r=Object.create(null),Object.entries(o))){let o=e.has(t.toLowerCase())?"[REDACTED ****]":n(i);lH.isUndefined(o)||(r[t]=o)}}return t.pop(),r}})(o)):lH.toJSONObject(o);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i,code:this.code,status:this.status}}}lQ.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",lQ.ERR_BAD_OPTION="ERR_BAD_OPTION",lQ.ECONNABORTED="ECONNABORTED",lQ.ETIMEDOUT="ETIMEDOUT",lQ.ECONNREFUSED="ECONNREFUSED",lQ.ERR_NETWORK="ERR_NETWORK",lQ.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",lQ.ERR_DEPRECATED="ERR_DEPRECATED",lQ.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",lQ.ERR_BAD_REQUEST="ERR_BAD_REQUEST",lQ.ERR_CANCELED="ERR_CANCELED",lQ.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",lQ.ERR_INVALID_URL="ERR_INVALID_URL",lQ.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let lZ=lQ;function l0(e){return lH.isPlainObject(e)||lH.isArray(e)}function l1(e){return lH.endsWith(e,"[]")?e.slice(0,-2):e}function l2(e,t,n){return e?e.concat(t).map(function(e,t){return e=l1(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let l4=lH.toFlatObject(lH,{},null,function(e){return/^is[A-Z]/.test(e)}),l3=function(e,t,n){if(!lH.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let o=(n=lH.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!lH.isUndefined(t[e])})).metaTokens,r=n.visitor||f,i=n.dots,a=n.indexes,s=n.Blob||"u">typeof Blob&&Blob,d=void 0===n.maxDepth?100:n.maxDepth,l=s&&lH.isSpecCompliantForm(t),c=[];if(!lH.isFunction(r))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(lH.isDate(e))return e.toISOString();if(lH.isBoolean(e))return e.toString();if(!l&&lH.isBlob(e))throw new lZ("Blob is not supported. Use a Buffer instead.");if(lH.isArrayBuffer(e)||lH.isTypedArray(e)){if(l&&"function"==typeof s)return new s([e]);if("u">typeof Buffer)return Buffer.from(e);throw new lZ("Blob is not supported. Use a Buffer instead.",lZ.ERR_NOT_SUPPORT)}return e}function m(e){if(e>d)throw new lZ("Object is too deeply nested ("+e+" levels). Max depth: "+d,lZ.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(e,n,r){let s=e;if(lH.isReactNative(t)&&lH.isReactNativeBlob(e))return t.append(l2(r,n,i),u(e)),!1;if(e&&!r&&"object"==typeof e)if(lH.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e){if(d===1/0)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,n){if(!lH.isObject(n))return n;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(n),m(1+t.length-1),n})}(e);else{var l;if(lH.isArray(e)&&(l=e,lH.isArray(l)&&!l.some(l0))||(lH.isFileList(e)||lH.endsWith(n,"[]"))&&(s=lH.toArray(e)))return n=l1(n),s.forEach(function(e,o){lH.isUndefined(e)||null===e||t.append(!0===a?l2([n],o,i):null===a?n:n+"[]",u(e))}),!1}return!!l0(e)||(t.append(l2(r,n,i),u(e)),!1)}let h=Object.assign(l4,{defaultVisitor:f,convertValue:u,isVisitable:l0});if(!lH.isObject(e))throw TypeError("data must be an object");return!function e(n,o,i=0){if(!lH.isUndefined(n)){if(m(i),-1!==c.indexOf(n))throw Error("Circular reference detected in "+o.join("."));c.push(n),lH.forEach(n,function(n,a){!0===(!(lH.isUndefined(n)||null===n)&&r.call(t,n,lH.isString(a)?a.trim():a,o,h))&&e(n,o?o.concat(a):[a],i+1)}),c.pop()}}(e),t};function l5(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function l6(e,t){this._pairs=[],e&&l3(e,this,t)}let l8=l6.prototype;function l7(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l9(e,t,n){let o;if(!t)return e;e=e||"";let r=lH.isFunction(n)?{serialize:n}:n,i=lH.getSafeProp(r,"encode")||l7,a=lH.getSafeProp(r,"serialize");if(o=a?a(t,r):lH.isURLSearchParams(t)?t.toString():new l6(t,r).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}l8.append=function(e,t){this._pairs.push([e,t])},l8.toString=function(e){let t=e?t=>e.call(this,t,l5):l5;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let ce=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){lH.forEach(this.handlers,function(t){null!==t&&e(t)})}},ct={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},cn="u">typeof URLSearchParams?URLSearchParams:l6,co="u">typeof FormData?FormData:null,cr="u">typeof Blob?Blob:null,ci="u">typeof window&&"u">typeof document,ca="object"==typeof navigator&&navigator||void 0,cs=ci&&(!ca||0>["ReactNative","NativeScript","NS"].indexOf(ca.product)),cd="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,cl=ci&&window.location.href||"http://localhost",cc={...tS,isBrowser:!0,classes:{URLSearchParams:cn,FormData:co,Blob:cr},protocols:["http","https","file","blob","url","data"]};function cu(e){if(e>100)throw new lZ("FormData field is too deeply nested ("+e+" levels). Max depth: 100",lZ.ERR_FORM_DATA_DEPTH_EXCEEDED)}let cm=function(e){if(lH.isFormData(e)&&lH.isFunction(e.entries)){let t={};return lH.forEachEntry(e,(e,n)=>{!function e(t,n,o,r){cu(r);let i=t[r++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),s=r>=t.length;return(i=!i&&lH.isArray(o)?o.length:i,s)?lH.hasOwnProp(o,i)?o[i]=lH.isArray(o[i])?o[i].concat(n):[o[i],n]:o[i]=n:(lH.hasOwnProp(o,i)&&lH.isObject(o[i])||(o[i]=[]),e(t,n,o[i],r)&&lH.isArray(o[i])&&(o[i]=function(e){let t,n,o={},r=Object.keys(e),i=r.length;for(t=0;t<i;t++)o[n=r[t]]=e[n];return o}(o[i]))),!a}(function(e){let t,n=[],o=/\w+|\[(\w*)]/g;for(;null!==(t=o.exec(e));)cu(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),n,t,0)}),t}return null},cf=(e,t)=>null!=e&&lH.hasOwnProp(e,t)?e[t]:void 0,ch={transitional:ct,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,o=t.getContentType()||"",r=o.indexOf("application/json")>-1,i=lH.isObject(e);if(i&&lH.isHTMLForm(e)&&(e=new FormData(e)),lH.isFormData(e))return r?JSON.stringify(cm(e)):e;if(lH.isArrayBuffer(e)||lH.isBuffer(e)||lH.isStream(e)||lH.isFile(e)||lH.isBlob(e)||lH.isReadableStream(e))return e;if(lH.isArrayBufferView(e))return e.buffer;if(lH.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){let t=cf(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return l3(e,new cc.classes.URLSearchParams,{visitor:function(e,t,n,o){return cc.isNode&&lH.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t}).toString();if((n=lH.isFileList(e))||o.indexOf("multipart/form-data")>-1){let o=cf(this,"env"),r=o&&o.FormData;return l3(n?{"files[]":e}:e,r&&new r,t)}}if(i||r){t.setContentType("application/json",!1);var a=e;if(lH.isString(a))try{return(0,JSON.parse)(a),lH.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=cf(this,"transitional")||ch.transitional,n=t&&t.forcedJSONParsing,o=cf(this,"responseType"),r="json"===o;if(lH.isResponse(e)||lH.isReadableStream(e))return e;if(e&&lH.isString(e)&&(n&&!o||r)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,cf(this,"parseReviver"))}catch(e){if(!n&&r){if("SyntaxError"===e.name)throw lZ.from(e,lZ.ERR_BAD_RESPONSE,this,null,cf(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cc.classes.FormData,Blob:cc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function cb(e,t){let n=this||ch,o=t||n,r=lX.from(o.headers),i=o.data;return lH.forEach(e,function(e){i=e.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function cp(e){return!!(e&&e.__CANCEL__)}lH.forEach(["delete","get","head","post","put","patch","query"],e=>{ch.headers[e]={}});let c_=class extends lZ{constructor(e,t,n){super(null==e?"canceled":e,lZ.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function cg(e,t,n){let o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new lZ("Request failed with status code "+n.status,n.status>=400&&n.status<500?lZ.ERR_BAD_REQUEST:lZ.ERR_BAD_RESPONSE,n.config,n.request,n))}let cF=function(e,t){let n,o=Array(e=e||10),r=Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){let d=Date.now(),l=r[a];n||(n=d),o[i]=s,r[i]=d;let c=a,u=0;for(;c!==i;)u+=o[c++],c%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),d-n<t)return;let m=l&&d-l;return m?Math.round(1e3*u/m):void 0}},cy=function(e,t){let n,o,r=0,i=1e3/t,a=(t,i=Date.now())=>{r=i,n=null,o&&(clearTimeout(o),o=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-r;s>=i?a(e,t):(n=e,o||(o=setTimeout(()=>{o=null,a(n)},i-s)))},()=>n&&a(n)]},cv=(e,t,n=3)=>{let o=0,r=cF(50,250);return cy(n=>{if(!n||"number"!=typeof n.loaded)return;let i=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(i,a):i,d=Math.max(0,s-o),l=r(d);o=Math.max(o,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:d,rate:l||void 0,estimated:l&&a?(a-s)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},cw=(e,t)=>{let n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},ck=e=>(...t)=>lH.asap(()=>e(...t)),cE=cc.hasStandardBrowserEnv?(s=new URL(cc.origin),d=cc.navigator&&/(msie|trident)/i.test(cc.navigator.userAgent),e=>(e=new URL(e,cc.origin),s.protocol===e.protocol&&s.host===e.host&&(d||s.port===e.port))):()=>!0,cD=cc.hasStandardBrowserEnv?{write(e,t,n,o,r,i,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];lH.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),lH.isString(o)&&s.push(`path=${o}`),lH.isString(r)&&s.push(`domain=${r}`),!0===i&&s.push("secure"),lH.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.split(";");for(let n=0;n<t.length;n++){let o=t[n].replace(/^\s+/,""),r=o.indexOf("=");if(-1!==r&&o.slice(0,r)===e)try{return decodeURIComponent(o.slice(r+1))}catch(e){return o.slice(r+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},cM=/^https?:(?!\/\/)/i,cL=/[\t\n\r]/g;function cC(e,t){if("string"==typeof e&&cM.test((function(e){let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t)})(e).replace(cL,"")))throw new lZ('Invalid URL: missing "//" after protocol',lZ.ERR_INVALID_URL,t)}function cA(e,t,n,o){cC(t,o);let r=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(r||!1===n)?(cC(e,o),t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e):t}let cT=e=>e instanceof lX?{...e}:e;function cx(e,t){e=e||{},t=t||{};let n=Object.create(null);function o(e,t,n,o){return lH.isPlainObject(e)&&lH.isPlainObject(t)?lH.merge.call({caseless:o},e,t):lH.isPlainObject(t)?lH.merge({},t):lH.isArray(t)?t.slice():t}function r(e,t,n,r){return lH.isUndefined(t)?lH.isUndefined(e)?void 0:o(void 0,e,n,r):o(e,t,n,r)}function i(e,t){if(!lH.isUndefined(t))return o(void 0,t)}function a(e,t){return lH.isUndefined(t)?lH.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function s(n,r,i){return lH.hasOwnProp(t,i)?o(n,r):lH.hasOwnProp(e,i)?o(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let d={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>r(cT(e),cT(t),n,!0)};return lH.forEach(Object.keys({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;let i=lH.hasOwnProp(d,o)?d[o]:r,a=i(lH.hasOwnProp(e,o)?e[o]:void 0,lH.hasOwnProp(t,o)?t[o]:void 0,o);lH.isUndefined(a)&&i!==s||(n[o]=a)}),lH.hasOwnProp(t,"validateStatus")&&lH.isUndefined(t.validateStatus)&&!1===function(n){let o=lH.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!lH.isUndefined(o)){if(!lH.isPlainObject(o))return;else if(lH.hasOwnProp(o,n))return o[n]}let r=lH.hasOwnProp(e,"transitional")?e.transitional:void 0;if(lH.isPlainObject(r)&&lH.hasOwnProp(r,n))return r[n]}("validateStatusUndefinedResolves")&&(lH.hasOwnProp(e,"validateStatus")?n.validateStatus=o(void 0,e.validateStatus):delete n.validateStatus),n}let cS=["content-type","content-length"],cY=function(e){let t=cx({},e),n=e=>lH.hasOwnProp(t,e)?t[e]:void 0,o=n("data"),r=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),d=n("auth"),l=n("baseURL"),c=n("allowAbsoluteUrls"),u=n("url");if(t.headers=s=lX.from(s),t.url=l9(cA(l,u,c,t),n("params"),n("paramsSerializer")),d){let t=lH.getSafeProp(d,"username")||"",n=lH.getSafeProp(d,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw lZ.from(t,lZ.ERR_BAD_OPTION_VALUE,e)}}if(lH.isFormData(o))if(cc.hasStandardBrowserEnv||cc.hasStandardBrowserWebWorkerEnv||lH.isReactNative(o))s.setContentType(void 0);else{var m,f;lH.isFunction(o.getHeaders)&&(m=s,f=o.getHeaders(),"content-only"!==n("formDataHeaderPolicy")?m.set(f):Object.entries(f||{}).forEach(([e,t])=>{cS.includes(e.toLowerCase())&&m.set(e,t)}))}if(cc.hasStandardBrowserEnv&&(lH.isFunction(r)&&(r=r(t)),!0===r||null==r&&cE(t.url))){let e=i&&a&&cD.read(a);e&&s.set(i,e)}return t},cO="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var o;let r,i,a,s,d,l,c=cY(e),u=c.data,m=lX.from(c.headers).normalize(),{responseType:f,onUploadProgress:h,onDownloadProgress:b}=c;function p(){s&&s(),d&&d(),c.cancelToken&&c.cancelToken.unsubscribe(r),c.signal&&c.signal.removeEventListener("abort",r)}let _=new XMLHttpRequest;function g(){if(!_)return;let o=lX.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());cg(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:o,config:e,request:_}),_=null}_.open(c.method.toUpperCase(),c.url,!0),_.timeout=c.timeout,"onloadend"in _?_.onloadend=g:_.onreadystatechange=function(){!_||4!==_.readyState||(0!==_.status||_.responseURL&&_.responseURL.startsWith("file:"))&&setTimeout(g)},_.onabort=function(){_&&(n(new lZ("Request aborted",lZ.ECONNABORTED,e,_)),p(),_=null)},_.onerror=function(t){let o=new lZ(t&&t.message?t.message:"Network Error",lZ.ERR_NETWORK,e,_);o.event=t||null,n(o),p(),_=null},_.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",o=c.transitional||ct;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new lZ(t,o.clarifyTimeoutError?lZ.ETIMEDOUT:lZ.ECONNABORTED,e,_)),p(),_=null},void 0===u&&m.setContentType(null),"setRequestHeader"in _&&lH.forEach(lV(m),function(e,t){_.setRequestHeader(t,e)}),lH.isUndefined(c.withCredentials)||(_.withCredentials=!!c.withCredentials),f&&"json"!==f&&(_.responseType=c.responseType),b&&([a,d]=cv(b,!0),_.addEventListener("progress",a)),h&&_.upload&&([i,s]=cv(h),_.upload.addEventListener("progress",i),_.upload.addEventListener("loadend",s)),(c.cancelToken||c.signal)&&(r=t=>{_&&(n(!t||t.type?new c_(null,e,_):t),_.abort(),p(),_=null)},c.cancelToken&&c.cancelToken.subscribe(r),c.signal&&(c.signal.aborted?r():c.signal.addEventListener("abort",r)));let F=(o=c.url,(l=/^([-+\w]{1,25}):(?:\/\/)?/.exec(o))&&l[1]||"");if(F&&!cc.protocols.includes(F)){n(new lZ("Unsupported protocol "+F+":",lZ.ERR_BAD_REQUEST,e)),p();return}_.send(u||null)})},cI=function*(e,t){let n,o=e.byteLength;if(!t||o<t)return void(yield e);let r=0;for(;r<o;)n=r+t,yield e.slice(r,n),r=n},cP=async function*(e,t){for await(let n of cB(e))yield*cI(n,t)},cB=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},cR=(e,t,n,o)=>{let r,i=cP(e,t),a=0,s=e=>{!r&&(r=!0,o&&o(e))};return new ReadableStream({async pull(e){try{let{done:t,value:o}=await i.next();if(t){s(),e.close();return}let r=o.byteLength;if(n){let e=a+=r;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},cN=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cj=(e,t,n)=>t+2<n&&cN(e.charCodeAt(t+1))&&cN(e.charCodeAt(t+2)),{isFunction:cH}=lH,cU=e=>{if(!lH.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},cz=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cW=e=>{let t,n=void 0!==lH.global&&null!==lH.global?lH.global:globalThis,{ReadableStream:o,TextEncoder:r}=n,{fetch:i,Request:a,Response:s}=e=lH.merge.call({skipUndefined:!0},{Request:n.Request,Response:n.Response},e),d=i?cH(i):"function"==typeof fetch,l=cH(a),c=cH(s);if(!d)return!1;let u=d&&cH(o),m=d&&("function"==typeof r?(t=new r,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=l&&u&&cz(()=>{let e=!1,t=new a(cc.origin,{body:new o,method:"POST",get duplex(){return e=!0,"half"}}),n=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!n}),h=c&&u&&cz(()=>lH.isReadableStream(new s("").body)),b={stream:h&&(e=>e.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{b[e]||(b[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new lZ(`Response type '${e}' is not supported`,lZ.ERR_NOT_SUPPORT,n)})});let p=async e=>{if(null==e)return 0;if(lH.isBlob(e))return e.size;if(lH.isSpecCompliantForm(e)){let t=new a(cc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return lH.isArrayBufferView(e)||lH.isArrayBuffer(e)?e.byteLength:(lH.isURLSearchParams(e)&&(e+=""),lH.isString(e))?(await m(e)).byteLength:void 0},_=async(e,t)=>{let n=lH.toFiniteNumber(e.getContentLength());return null==n?p(t):n};return async e=>{let t,{url:n,method:o,data:d,signal:c,cancelToken:m,timeout:g,onDownloadProgress:F,onUploadProgress:y,responseType:v,headers:w,withCredentials:k="same-origin",fetchOptions:E,maxContentLength:D,maxBodyLength:M}=cY(e),L=lH.isNumber(D)&&D>-1,C=lH.isNumber(M)&&M>-1,A=i||fetch;v=v?(v+"").toLowerCase():"text";let T=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,o=!1,r=function(e){if(!o){o=!0,a();let t=e instanceof Error?e:this.reason;n.abort(t instanceof lZ?t:new c_(t instanceof Error?t.message:t))}},i=t&&setTimeout(()=>{i=null,r(new lZ(`timeout of ${t}ms exceeded`,lZ.ETIMEDOUT))},t),a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)}),e=null)};e.forEach(e=>e.addEventListener("abort",r,{once:!0}));let{signal:s}=n;return s.unsubscribe=()=>lH.asap(a),s})([c,m&&m.toAbortSignal()],g),x=null,S=T&&T.unsubscribe&&(()=>{T.unsubscribe()}),Y=null,O=()=>new lZ("Request body larger than maxBodyLength limit",lZ.ERR_BAD_REQUEST,e,x);try{var I;let i,c,m,g,P=(c="auth",lH.hasOwnProp(e,c)?e[c]:void 0);if(P){let e=lH.getSafeProp(P,"username")||"",t=lH.getSafeProp(P,"password")||"";i={username:e,password:t}}if(m=(I=n).indexOf("://"),g=I,-1!==m&&(g=g.slice(m+3)),g.includes("@")||g.includes(":")){let e=new URL(n,cc.origin);if(!i&&(e.username||e.password)){let t=cU(e.username),n=cU(e.password);i={username:t,password:n}}(e.username||e.password)&&(e.username="",e.password="",n=e.href)}if(i){let e;w.delete("authorization"),w.set("Authorization","Basic "+btoa((e=(i.username||"")+":"+(i.password||""),encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}if(L&&"string"==typeof n&&n.startsWith("data:")&&function(e){if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let n=e.slice(5,t),o=e.slice(t+1);if(/;base64/i.test(n)){let e=o.length,t=o.length;for(let n=0;n<t;n++)if(37===o.charCodeAt(n)&&n+2<t){let t=o.charCodeAt(n+1),r=o.charCodeAt(n+2);cN(t)&&cN(r)&&(e-=2,n+=2)}let n=0,r=t-1,i=e=>e>=2&&37===o.charCodeAt(e-2)&&51===o.charCodeAt(e-1)&&(68===o.charCodeAt(e)||100===o.charCodeAt(e));r>=0&&(61===o.charCodeAt(r)?(n++,r--):i(r)&&(n++,r-=3)),1===n&&r>=0&&(61===o.charCodeAt(r)?n++:i(r)&&n++);let a=3*Math.floor(e/4)-(n||0);return a>0?a:0}let r=0;for(let e=0,t=o.length;e<t;e++){let n=o.charCodeAt(e);if(37===n&&cj(o,e,t))r+=1,e+=2;else if(n<128)r+=1;else if(n<2048)r+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=o.charCodeAt(e+1);t>=56320&&t<=57343?(r+=4,e++):r+=3}else r+=3}return r}(n)>D)throw new lZ("maxContentLength size of "+D+" exceeded",lZ.ERR_BAD_RESPONSE,e,x);if(C&&"get"!==o&&"head"!==o){let e=await p(d);if("number"==typeof e&&isFinite(e)&&(t=e,e>M))throw O()}let B=C&&(lH.isReadableStream(d)||lH.isStream(d)),R=(e,t,n)=>cR(e,65536,e=>{if(C&&e>M)throw Y=O();t&&t(e)},n);if(f&&"get"!==o&&"head"!==o&&(y||B)){if(t=null==t?await _(w,d):t,0!==t||B){let e,o=new a(n,{method:"POST",body:d,duplex:"half"});if(lH.isFormData(d)&&(e=o.headers.get("content-type"))&&w.setContentType(e),o.body){let[e,n]=y&&cw(t,cv(ck(y)))||[];d=R(o.body,e,n)}}}else if(B&&!l&&u&&"get"!==o&&"head"!==o)d=R(d);else if(B&&l&&!f&&"get"!==o&&"head"!==o)throw new lZ("Stream request bodies are not supported by the current fetch implementation",lZ.ERR_NOT_SUPPORT,e,x);lH.isString(k)||(k=k?"include":"omit");let N=l&&"credentials"in a.prototype;if(lH.isFormData(d)){let e=w.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&w.delete("content-type")}w.set("User-Agent","axios/1.18.1",!1);let j={...E,signal:T,method:o.toUpperCase(),headers:lV(w.normalize()),body:d,duplex:"half",credentials:N?k:void 0};x=l&&new a(n,j);let H=await (l?A(x,E):A(n,j)),U=lX.from(H.headers);if(L){let t=lH.toFiniteNumber(U.getContentLength());if(null!=t&&t>D)throw new lZ("maxContentLength size of "+D+" exceeded",lZ.ERR_BAD_RESPONSE,e,x)}let z=h&&("stream"===v||"response"===v);if(h&&H.body&&(F||L||z&&S)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=H[e]});let n=lH.toFiniteNumber(U.getContentLength()),[o,r]=F&&cw(n,cv(ck(F),!0))||[];H=new s(cR(H.body,65536,t=>{if(L&&t>D)throw new lZ("maxContentLength size of "+D+" exceeded",lZ.ERR_BAD_RESPONSE,e,x);o&&o(t)},()=>{r&&r(),S&&S()}),t)}v=v||"text";let W=await b[lH.findKey(b,v)||"text"](H,e);if(L&&!h&&!z){let t;if(null!=W&&("number"==typeof W.byteLength?t=W.byteLength:"number"==typeof W.size?t=W.size:"string"==typeof W&&(t="function"==typeof r?new r().encode(W).byteLength:W.length)),"number"==typeof t&&t>D)throw new lZ("maxContentLength size of "+D+" exceeded",lZ.ERR_BAD_RESPONSE,e,x)}return!z&&S&&S(),await new Promise((t,n)=>{cg(t,n,{data:W,headers:lX.from(H.headers),status:H.status,statusText:H.statusText,config:e,request:x})})}catch(t){if(S&&S(),T&&T.aborted&&T.reason instanceof lZ){let n=T.reason;throw n.config=e,x&&(n.request=x),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(Y)throw x&&!Y.request&&(Y.request=x),Y;if(t instanceof lZ)throw x&&!t.request&&(t.request=x),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let n=new lZ("Network Error",lZ.ERR_NETWORK,e,x,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw lZ.from(t,t&&t.code,e,x,t&&t.response)}}},c$=new Map,cV=e=>{let t=e&&e.env||{},{fetch:n,Request:o,Response:r}=t,i=[o,r,n],a=i.length,s,d,l=c$;for(;a--;)s=i[a],void 0===(d=l.get(s))&&l.set(s,d=a?new Map:cW(t)),l=d;return d};cV();let cq={http:null,xhr:cO,fetch:{get:cV}};lH.forEach(cq,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let cG=e=>`- ${e}`,cK=e=>lH.isFunction(e)||null===e||!1===e,cJ=function(e,t){let n,o,{length:r}=e=lH.isArray(e)?e:[e],i={};for(let a=0;a<r;a++){let r;if(o=n=e[a],!cK(n)&&void 0===(o=cq[(r=String(n)).toLowerCase()]))throw new lZ(`Unknown adapter '${r}'`);if(o&&(lH.isFunction(o)||(o=o.get(t))))break;i[r||"#"+a]=o}if(!o){let e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new lZ("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(cG).join("\n"):" "+cG(e[0]):"as no adapter specified"),lZ.ERR_NOT_SUPPORT)}return o};function cX(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new c_(null,e)}function cQ(e){return cX(e),e.headers=lX.from(e.headers),e.data=cb.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cJ(e.adapter||ch.adapter,e)(e).then(function(t){cX(e),e.response=t;try{t.data=cb.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lX.from(t.headers),t},function(t){if(!cp(t)&&(cX(e),t&&t.response)){e.response=t.response;try{t.response.data=cb.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lX.from(t.response.headers)}return Promise.reject(t)})}let cZ={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cZ[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let c0={};cZ.transitional=function(e,t,n){function o(e,t){return"[Axios v1.18.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,i)=>{if(!1===e)throw new lZ(o(r," has been removed"+(t?" in "+t:"")),lZ.ERR_DEPRECATED);return t&&!c0[r]&&(c0[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}},cZ.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let c1=function(e,t,n){if("object"!=typeof e||null===e)throw new lZ("options must be an object",lZ.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),r=o.length;for(;r-- >0;){let i=o[r],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){let t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new lZ("option "+i+" must be "+n,lZ.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new lZ("Unknown option "+i,lZ.ERR_BAD_OPTION)}};class c2{constructor(e){this.defaults=e||{},this.interceptors={request:new ce,response:new ce}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return"";let e=t.stack.indexOf("\n");return -1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){let t=n.indexOf("\n"),o=-1===t?-1:n.indexOf("\n",t+1),r=-1===o?"":n.slice(o+1);String(e.stack).endsWith(r)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){let n,o;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:r,paramsSerializer:i,headers:a}=t=cx(this.defaults,t);void 0!==r&&c1(r,{silentJSONParsing:cZ.transitional(cZ.boolean),forcedJSONParsing:cZ.transitional(cZ.boolean),clarifyTimeoutError:cZ.transitional(cZ.boolean),legacyInterceptorReqResOrdering:cZ.transitional(cZ.boolean),advertiseZstdAcceptEncoding:cZ.transitional(cZ.boolean),validateStatusUndefinedResolves:cZ.transitional(cZ.boolean)},!1),null!=i&&(lH.isFunction(i)?t.paramsSerializer={serialize:i}:c1(i,{encode:cZ.function,serialize:cZ.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),c1(t,{baseUrl:cZ.spelling("baseURL"),withXsrfToken:cZ.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&lH.merge(a.common,a[t.method]);a&&lH.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete a[e]}),t.headers=lX.concat(s,a);let d=[],l=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;l=l&&e.synchronous;let n=t.transitional||ct;n&&n.legacyInterceptorReqResOrdering?d.unshift(e.fulfilled,e.rejected):d.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u=0;if(!l){let e=[cQ.bind(this),void 0];for(e.unshift(...d),e.push(...c),o=e.length,n=Promise.resolve(t);u<o;)n=n.then(e[u++],e[u++]);return n}o=d.length;let m=t;for(;u<o;){let e=d[u++],t=d[u++];try{m=e(m)}catch(e){t.call(this,e);break}}try{n=cQ.call(this,m)}catch(e){return Promise.reject(e)}for(u=0,o=c.length;u<o;)n=n.then(c[u++],c[u++]);return n}getUri(e){return l9(cA((e=cx(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}lH.forEach(["delete","get","head","options"],function(e){c2.prototype[e]=function(t,n){return this.request(cx(n||{},{method:e,url:t,data:n&&lH.hasOwnProp(n,"data")?n.data:void 0}))}}),lH.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,r){return this.request(cx(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}c2.prototype[e]=t(),"query"!==e&&(c2.prototype[e+"Form"]=t(!0))});class c4{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,r){n.reason||(n.reason=new c_(e,o,r),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new c4(function(t){e=t}),cancel:e}}}let c3={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(c3).forEach(([e,t])=>{c3[t]=e});let c5=function e(t){let n=new c2(t),o=d7(c2.prototype.request,n);return lH.extend(o,c2.prototype,n,{allOwnKeys:!0}),lH.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(cx(t,n))},o}(ch);c5.Axios=c2,c5.CanceledError=c_,c5.CancelToken=c4,c5.isCancel=cp,c5.VERSION="1.18.1",c5.toFormData=l3,c5.AxiosError=lZ,c5.Cancel=c5.CanceledError,c5.all=function(e){return Promise.all(e)},c5.spread=function(e){return function(t){return e.apply(null,t)}},c5.isAxiosError=function(e){return lH.isObject(e)&&!0===e.isAxiosError},c5.mergeConfig=cx,c5.AxiosHeaders=lX,c5.formToJSON=e=>cm(lH.isHTMLForm(e)?new FormData(e):e),c5.getAdapter=cJ,c5.HttpStatusCode=c3,c5.default=c5;class c6{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:ug`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:ug`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:ug`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:ug`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:ug`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:ug`model/valueDescriptors`,queryParams:e,options:t})}}class c8{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:ug`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:ug`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:ug`apps/info`,options:e})}}class c7{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:ug`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:ug`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:ug`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:ug`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:ug`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:ug`realm/${e}`,data:t,options:n})}}class c9{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:ug`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:ug`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:ug`flow/${e}`,options:t})}}class ue{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:ug`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:ug`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:ug`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:ug`provisioning/${e}`,data:t,options:n})}}class ut{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:ug`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:ug`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:ug`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:ug`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:ug`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:ug`gateway/status/${e}`,options:t})}}class un{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:ug`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:ug`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:ug`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:ug`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,r){return this.httpClient.request({method:"GET",url:ug`gateway/tunnel/${e}/${t}/${n}/${o}`,options:r})}}class uo{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:ug`console/register`,data:e,options:t})}}class ur{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:ug`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:ug`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:ug`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:ug`configuration/manager/image/${e}`,options:t})}}class ui{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:ug`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:ug`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:ug`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:ug`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:ug`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:ug`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:ug`service/${e}/${t}`,options:n})}}class ua{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:ug`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:ug`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:ug`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:ug`syslog/event`,queryParams:e,options:t})}}class us{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:ug`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:ug`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:ug`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:ug`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:ug`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:ug`dashboard/${e}/${t}`,options:n})}}class ud{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:ug`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:ug`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:ug`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:ug`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:ug`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:ug`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:ug`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:ug`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:ug`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:ug`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:ug`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:ug`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:ug`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:ug`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:ug`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:ug`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:ug`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`asset/${e}/attribute/${t}`,data:n,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:ug`asset/${e}/attribute/${t}/${n}`,data:o,options:r})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:ug`asset/${e}/child`,queryParams:t,options:n})}}class ul{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:ug`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:ug`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:ug`notification/alert`,data:e,options:t})}getNotificationsCount(e,t){return this.httpClient.request({method:"GET",url:ug`notification/count`,queryParams:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:ug`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:ug`notification/${e}/delivered`,queryParams:t,options:n})}}class uc{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:ug`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:ug`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:ug`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:ug`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:ug`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:ug`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:ug`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:ug`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:ug`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:ug`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:ug`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:ug`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:ug`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:ug`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:ug`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:ug`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:ug`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:ug`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:ug`rules/${e}`,data:t,options:n})}}class uu{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:ug`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`asset/predicted/${e}/${t}`,data:n,options:o})}}class um{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:ug`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:ug`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:ug`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:ug`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:ug`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:ug`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:ug`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:ug`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:ug`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:ug`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:ug`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:ug`user/${e}/userRoles/${t}/${n}`,data:o,options:r})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:ug`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:ug`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:ug`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:ug`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:ug`user/${e}/${t}`,options:n})}}class uf{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:ug`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:ug`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:ug`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:ug`map/getCustomMapInfo`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:ug`map/tile/${e}/${t}/${n}`,options:o})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:ug`map/upload`,queryParams:e,options:t})}}class uh{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:ug`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:ug`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:ug`asset/datapoint/${e}/${t}`,data:n,options:o})}}class ub{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:ug`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:ug`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:ug`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class up{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:ug`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:ug`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:ug`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:ug`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:ug`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:ug`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:ug`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:ug`alarm/${e}/assets`,queryParams:t,options:n})}}class u_{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:ug`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:ug`info`,options:e})}}function ug(e,...t){let n="";for(let o=0;o<t.length;o++)n+=e[o],n+=encodeURIComponent(t[o]);return n+e[e.length-1]}class uF{constructor(e,t=c5.create()){this._assetModelResource=new uv(e,t),this._appResource=new uw(e,t),this._realmResource=new uk(e,t),this._flowResource=new uE(e,t),this._provisioningResource=new uD(e,t),this._gatewayClientResource=new uM(e,t),this._gatewayServiceResource=new uL(e,t),this._consoleResource=new uC(e,t),this._configurationResource=new uA(e,t),this._externalServiceResource=new uT(e,t),this._syslogResource=new ux(e,t),this._dashboardResource=new uS(e,t),this._assetResource=new uY(e,t),this._notificationResource=new uO(e,t),this._rulesResource=new uI(e,t),this._assetPredictedDatapointResource=new uP(e,t),this._userResource=new uB(e,t),this._mapResource=new uR(e,t),this._assetDatapointResource=new uN(e,t),this._agentResource=new uj(e,t),this._alarmResource=new uH(e,t),this._statusResource=new uU(e,t),this._assetResource=new uY(e,t)}get AssetModelResource(){return this._assetModelResource}get AppResource(){return this._appResource}get RealmResource(){return this._realmResource}get FlowResource(){return this._flowResource}get ProvisioningResource(){return this._provisioningResource}get GatewayClientResource(){return this._gatewayClientResource}get GatewayServiceResource(){return this._gatewayServiceResource}get ConsoleResource(){return this._consoleResource}get ConfigurationResource(){return this._configurationResource}get ExternalServiceResource(){return this._externalServiceResource}get SyslogResource(){return this._syslogResource}get DashboardResource(){return this._dashboardResource}get AssetResource(){return this._assetResource}get NotificationResource(){return this._notificationResource}get RulesResource(){return this._rulesResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get UserResource(){return this._userResource}get MapResource(){return this._mapResource}get AssetDatapointResource(){return this._assetDatapointResource}get AgentResource(){return this._agentResource}get AlarmResource(){return this._alarmResource}get StatusResource(){return this._statusResource}}class uy{constructor(e){this.axios=e}request(e){let t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(void 0!=t)for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);let n=e.copyFn;return this.axios.request(t).then(e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e))}}class uv extends c6{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uw extends c8{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uk extends c7{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uE extends c9{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uD extends ue{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uM extends ut{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uL extends un{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uC extends uo{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uA extends ur{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uT extends ui{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class ux extends ua{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uS extends us{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uY extends ud{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uO extends ul{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uI extends uc{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uP extends uu{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uB extends um{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uR extends uf{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uN extends uh{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uj extends ub{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uH extends up{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}class uU extends u_{constructor(e,t=c5.create()){t.defaults.baseURL=e,super(new uy(t))}}c5.isAxiosError;let uz=new class{get api(){return this._client}constructor(){this._axiosInstance=c5.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>dZ().stringify(e,{arrayFormat:"repeat"}),e))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(e){this._axiosInstance.defaults.timeout=e}addRequestInterceptor(e){this._axiosInstance.interceptors.request.use(e)}initialise(e){this._baseUrl=e,this._client=new uF(e,this._axiosInstance)}};var uW=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function s(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};(ev=tM||(tM={})).DISCONNECTED="DISCONNECTED",ev.CONNECTED="CONNECTED",ev.CONNECTING="CONNECTING";let u$="SUBSCRIBED:",uV="UNAUTHORIZED:",uq="TRIGGERED:",uG="EVENT:";class uK{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=uJ.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tM.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){!function(e,t){if(0===e.length)return;let n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tM.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tM.CONNECTING),this._connectingDeferred=new d2,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=uJ.MIN_RECONNECT_DELAY,this._onStatusChanged(tM.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),t.resolve(e)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tM.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new d2};return null!=this._pendingSubscription||this._status!==tM.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return uW(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}return}if(this._attributeEventCallbackMap.delete(e)){if(this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}return}})}sendEvent(e){this._status===tM.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return uW(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,r="AssetEvent"+uK._subscriptionCounter++;if(!this._assetEventPromise){let e;mm.authenticated||(e={filterType:"asset",realm:mm.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(r,e=>{let t=e.asset.id;o?o.find(e=>t===e)&&n(e):e.asset.realm===mm.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(o&&t){let e={messageID:"read-assets:"+o.join(",")+":"+r,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(r)&&e.assets.forEach(e=>{n({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),r&&this.unsubscribe(r),t}return r})})}subscribeAttributeEvents(e,t,n){return uW(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0],r=o?e.map(e=>e.id):e,i=o?e:void 0,a="AttributeEvent"+uK._subscriptionCounter++;if(!this._attributeEventPromise){let e;mm.authenticated||(e={filterType:"asset",realm:mm.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let s=t=>{let i=t.ref;o?e.forEach(e=>{i.id===e.id&&i.name===e.name&&n(t)}):r?r.find(e=>i.id===e)&&n(t):t.realm===mm.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then(()=>{try{if(t&&r){let e={messageID:"read-assets:"+r.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(a)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,n])=>{(!i||i.find(n=>n.id===e.id&&n.name===t))&&s({eventType:"attribute",timestamp:n.timestamp,value:n.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a})})}_processNextSubscription(){this._status===tM.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{let n=e.deferred;e.deferred=null,n&&n.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){let n=this._subscriptionMap.get(e);n&&n.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tM.CONNECTED&&this._onStatusChanged(tM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tM.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<uJ.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(uJ.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}uK.MIN_RECONNECT_DELAY=0,uK.MAX_RECONNECT_DELAY=3e4,uK._subscriptionCounter=0;class uJ extends uK{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let e=this._endpointUrl+"?Realm="+mm.config.realm;return this._connectDeferred=new d2,(mm.authenticated?mm.retrieveAuthorizationHeader().then(t=>{e+="&Authorization="+t}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(e),this._webSocket.onopen=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(console.error("Event provider error:",e),this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{let t=e.data;if(t&&t.startsWith(u$)){let e=JSON.parse(t.substring(u$.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(uV)){let e=JSON.parse(t.substring(uV.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),n.reject("Unauthorized"))}else if(t.startsWith(uq)){let e=JSON.parse(t.substring(uq.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(uG)){let e=JSON.parse(t.substring(uG.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null==(e=this._webSocket)||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new d2,e.subscriptionId||(e.subscriptionId=uJ._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:e}))}_doSend(e){let t=uG+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageID||(e.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageID))return Promise.reject("There's already a pending send and reply with this ID");let t=new d2;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(uG+JSON.stringify(e)),t.promise}}uJ._subscriptionCounter=1;let uX=["__proto__","constructor","prototype"];function uQ(e){return!("string"!=typeof e||0===e.length||e.length>128||uX.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function uZ(e){return!(!uQ(e)||e.indexOf("/")>-1)}let u0={lng:uZ,ns:function(e){return uQ(e)}};function u1(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function u2(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let u4=/\{\{(.+?)\}\}/g;function u3(e,t){let n=!1,o=e.replace(u4,(e,o)=>{let r=o.trim();if(uX.indexOf(r)>-1)return e;let i=t[r];if(null==i)return e;let a=u0[r]||uZ,s=String(i).split("+");for(let t of s)if(!a(t))return n=!0,e;return s.join("+")});return n?null:o}let u5="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?r=fetch:u5&&"function"==typeof u5.fetch&&(r=u5.fetch);let u6=u2()&&u5?u5.XMLHttpRequest:void 0,u8="function"==typeof ActiveXObject&&u5?u5.ActiveXObject:void 0,u7=["__proto__","constructor","prototype"],u9=(e,t)=>{if(t&&"object"==typeof t){let n="";for(let e of Object.keys(t))u7.indexOf(e)>-1||(n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},me=(e,t,n,o)=>{let i=e=>{if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(o){let r=o(e,t);if(r instanceof Promise)return void r.then(i).catch(n)}"function"==typeof fetch?fetch(e,t).then(i).catch(n):r(e,t).then(i).catch(n)},mt=(e,t,n,o)=>{if("function"==typeof n&&(o=n,n=void 0),o=o||(()=>{}),r&&0!==t.indexOf("file:")){var i=t,a=n,s=o;e.queryStringParams&&(i=u9(i,e.queryStringParams));let r={..."function"==typeof e.customHeaders?e.customHeaders():e.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(r["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),a&&(r["Content-Type"]="application/json");let d="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,l={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:r,...e._omitFetchOptions?{}:d},c="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{me(i,l,s,c)}catch(t){if(!d||0===Object.keys(d).length||!t.message||0>t.message.indexOf("not implemented"))return s(t);try{Object.keys(d).forEach(e=>{delete l[e]}),me(i,l,s,c),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(u2()||"function"==typeof ActiveXObject){var d=t,l=n,c=o;l&&"object"==typeof l&&(l=u9("",l).slice(1)),e.queryStringParams&&(d=u9(d,e.queryStringParams));try{let t=u6?new u6:new u8("MSXML2.XMLHTTP.3.0");t.open(l?"POST":"GET",d,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,l&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let n=e.customHeaders;if(n="function"==typeof n?n():n)for(let e of Object.keys(n))u7.indexOf(e)>-1||t.setRequestHeader(e,n[e]);t.onreadystatechange=()=>{t.readyState>3&&c(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(l)}catch(e){console&&console.log(e)}return}o(Error("No fetch and no xhr implementation found!"))};var mn=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||""}),parseLoadPayload:(e,t)=>void 0,request:mt,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,o,r){var i,a;let s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=(a=i=s)&&"function"==typeof a.then?i:Promise.resolve(i)).then(i=>{if(!i)return r(null,{});let a=u3(i,{lng:e.join("+"),ns:n.join("+")});if(null==a)return r(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(u1).join(", ")+"] namespaces=["+n.map(u1).join(", ")+"]"),!1);this.loadUrl(a,r,t,o)})}loadUrl(e,t,n,o){let r=this.options.parseLoadPayload("string"==typeof n?[n]:n,"string"==typeof o?[o]:o),i=u1(function(e){if("string"!=typeof e||0===e.length)return e;try{let t=new URL(e);if(t.username||t.password)return t.username="",t.password="",t.toString();return e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,r,(e,r)=>{let a,s;if(r&&(r.status>=500&&r.status<600||!r.status))return t("failed loading "+i+"; status code: "+r.status,!0);if(r&&r.status>=400&&r.status<500)return t("failed loading "+i+"; status code: "+r.status,!1);if(!r&&e&&e.message){let n=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>n.indexOf(e)>-1))return t("failed loading "+i+": "+u1(e.message),!0)}if(e)return t(e,!1);try{a="string"==typeof r.data?this.options.parse(r.data,n,o):r.data}catch(e){s="failed parsing "+i+" to json"}if(s)return t(s,!1);t(null,a)})}create(e,t,n,o,r){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let i=this.options.parsePayload(t,n,o),a=0,s=[],d=[];e.forEach(n=>{let o=this.options.addPath;"function"==typeof this.options.addPath&&(o=this.options.addPath(n,t));let l=u3(o,{lng:n,ns:t});if(null==l){a+=1,r&&a===e.length&&r(s,d);return}this.options.request(this.options,l,i,(t,n)=>{a+=1,s.push(t),d.push(n),a===e.length&&"function"==typeof r&&r(s,d)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,o=e.language;if(o&&"cimode"===o.toLowerCase())return;let r=[],i=e=>{t.toResolveHierarchy(e).forEach(e=>{0>r.indexOf(e)&&r.push(e)})};i(o),this.allOptions.preload&&this.allOptions.preload.forEach(e=>i(e)),r.forEach(t=>{this.allOptions.ns.forEach(o=>{e.read(t,o,"read",null,null,(r,i)=>{r&&n.warn(`loading namespace ${o} for language ${t} failed`,r),!r&&i&&n.log(`loaded namespace ${o} for language ${t}`,i),e.loaded(`${t}|${o}`,r,i)})})})}};mn.type="backend";var mo=n(4954);class mr extends Error{}function mi(e,t){let n;if("string"!=typeof e)throw new mr("Invalid token specified: must be a string");t||(t={});let o=+(!0!==t.header),r=e.split(".")[o];if("string"!=typeof r)throw new mr(`Invalid token specified: missing part #${o+1}`);try{n=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(r)}catch(e){throw new mr(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new mr(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}if(mr.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function ma(e){if(!(this instanceof ma))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=this,r=[],i={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)(-1!==a[s].src.indexOf("keycloak.js")||-1!==a[s].src.indexOf("keycloak.min.js"))&&-1!==a[s].src.indexOf("version=")&&(o.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var d=!0,l=L(console.info),c=L(console.warn);function u(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=Array(e);for(var o=0;o<t.length;o++)t[o]=Math.floor(256*Math.random());return t}(e),o=Array(e),r=0;r<e;r++)o[r]=t.charCodeAt(n[r]%t.length);return String.fromCharCode.apply(null,o)}function m(){return void 0===o.authServerUrl?void 0:"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function f(e,t){var n=e.code,r=e.error,i=e.prompt,a=new Date().getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),r){if("none"!=i)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:r,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=o.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var c="code="+n+"&grant_type=authorization_code",u=o.endpoints.token(),m=new XMLHttpRequest;m.open("POST",u,!0),m.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c+="&client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(c+="&code_verifier="+e.pkceCodeVerifier),m.withCredentials=!0,m.onreadystatechange=function(){if(4==m.readyState)if(200==m.status){var e=JSON.parse(m.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),v()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},m.send(c)}function f(n,r,i,s){b(n,r,i,a=(a+new Date().getTime())/2),d&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(l("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function h(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function b(e,t,n,r){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=mi(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=mi(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=mi(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,r&&(o.timeSkew=Math.floor(r/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(l("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var i=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;l("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,i)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function p(){var e="0123456789abcdef",t=u(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function _(e){var t=function(e){switch(o.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var t,n,r,i=e.indexOf("?"),a=e.indexOf("#");if("query"===o.responseMode&&-1!==i?(n=e.substring(0,i),""!==(r=g(e.substring(i+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+r.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(r=g(e.substring(a+1),t)).paramsString&&(n+="#"+r.paramsString)),r&&r.oauthParams){if("standard"===o.flow||"hybrid"===o.flow){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}else if("implicit"===o.flow&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}}(e);if(t){var r=n.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier,t.loginOptions=r.loginOptions),t}}function g(e,t){for(var n=e.split("&"),o={paramsString:"",oauthParams:{}},r=0;r<n.length;r++){var i=n[r].indexOf("="),a=n[r].slice(0,i);-1!==t.indexOf(a)?o.oauthParams[a]=n[r].slice(i+1):(""!==o.paramsString&&(o.paramsString+="&"),o.paramsString+=n[r])}return o}function F(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}function y(){var e=F();if(!i.enable||i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?i.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):i.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",function(e){if(e.origin===i.iframeOrigin&&i.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),n=t.length-1;n>=0;--n){var r=t[n];"error"==e.data?r.setError():r.setSuccess("unchanged"==e.data)}}},!1),e.promise}function v(){i.enable&&o.token&&setTimeout(function(){w().then(function(e){e&&v()})},1e3*i.interval)}function w(){var e=F();if(i.iframe&&i.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");i.callbackList.push(e);var n=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function k(){var e,t,n,r=F();if(i.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var s=function(e){a.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(c("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),i.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",s),r.setSuccess())};window.addEventListener("message",s,!1)}else r.setSuccess();return e=r.promise,t=o.messageReceiveTimeout,n=null,Promise.race([e,new Promise(function(e,o){n=setTimeout(function(){o({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(n)})}function E(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),F().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));let n=o.createLogoutUrl(e),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(r.redirected){window.location.href=r.url;return}if(r.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(o.createRegisterUrl(e)),F().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return F().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},r=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,n){return e.push(n+"="+t[n]),e},[]).join(",")},a=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=F(),i=r(e),s=n(o.createLoginUrl(e),"_blank",i),d=!1,l=!1,c=function(){l=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(f(_(e.url),t),c(),d=!0)}),s.addEventListener("loaderror",function(e){d||(0==e.url.indexOf(a())?(f(_(e.url),t),c(),d=!0):(t.setError(),c()))}),s.addEventListener("exit",function(e){l||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,r=F(),i=n(o.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return i.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&i.close()}),i.addEventListener("loaderror",function(e){0==e.url.indexOf(a())||(t=!0),i.close()}),i.addEventListener("exit",function(e){t?r.setError():(o.clearToken(),r.setSuccess())}),r.promise},register:function(e){var t=F(),i=n(o.createRegisterUrl(),"_blank",r(e));return i.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(i.close(),f(_(e.url),t))}),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e){var t=n(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return a()}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=F(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(_(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=F(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=F(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(_(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw"Not supported by the OIDC server"},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(r){if(o.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new D}catch(e){}return new M}(),t=r&&["default","cordova","cordova-native"].indexOf(r.adapter)>-1?E(r.adapter):r&&"object"==typeof r.adapter?r.adapter:window.Cordova||window.cordova?E("cordova"):E(),r){if(void 0!==r.useNonce&&(d=r.useNonce),void 0!==r.checkLoginIframe&&(i.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(i.interval=r.checkLoginIframeInterval),"login-required"===r.onLoad&&(o.loginRequired=!0),r.responseMode)if("query"===r.responseMode||"fragment"===r.responseMode)o.responseMode=r.responseMode;else throw"Invalid value for responseMode";if(r.flow){switch(r.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=r.flow}if(null!=r.timeSkew&&(o.timeSkew=r.timeSkew),r.redirectUri&&(o.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),"boolean"==typeof r.silentCheckSsoFallback?o.silentCheckSsoFallback=r.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,void 0!==r.pkceMethod){if("S256"!==r.pkceMethod&&!1!==r.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);o.pkceMethod=r.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof r.enableLogging?o.enableLogging=r.enableLogging:o.enableLogging=!1,"POST"===r.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof r.scope&&(o.scope=r.scope),"string"==typeof r.acrValues&&(o.acrValues=r.acrValues),"number"==typeof r.messageReceiveTimeout&&r.messageReceiveTimeout>0?o.messageReceiveTimeout=r.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var a=F(),s=F();s.promise.then(function(){o.onReady&&o.onReady(o.authenticated),a.setSuccess(o.authenticated)}).catch(function(e){a.setError(e)});var l=function(){var t=F();function n(e){e?o.endpoints={authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:o.endpoints={authorize:function(){return m()+"/protocol/openid-connect/auth"},token:function(){return m()+"/protocol/openid-connect/token"},logout:function(){return m()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=m()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=m()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return m()+"/protocol/openid-connect/registrations"},userinfo:function(){return m()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(a=e):a="keycloak.json",a){var r=new XMLHttpRequest;r.open("GET",a,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status||h(r)){var e=JSON.parse(r.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,n(null),t.setSuccess()}else t.setError()},r.send()}else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var i=e.oidcProvider;if(i)if("string"==typeof i){var a,s="/"==i.charAt(i.length-1)?i+".well-known/openid-configuration":i+"/.well-known/openid-configuration",r=new XMLHttpRequest;r.open("GET",s,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||h(r)?(n(JSON.parse(r.responseText)),t.setSuccess()):t.setError())},r.send()}else n(i),t.setSuccess();else{if(!e.url){for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++)if(d[l].src.match(/.*keycloak\.js/)){e.url=d[l].src.substr(0,d[l].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";o.authServerUrl=e.url,o.realm=e.realm,n(null),t.setSuccess()}}return t.promise}();function c(){var e=function(e){e||(n.prompt="none"),r&&r.locale&&(n.locale=r.locale),o.login(n).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(f(_(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(r.onLoad){case"check-sso":i.enable?y().then(function(){w().then(function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=_(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return y().then(function(){f(e,s)}).catch(function(e){s.setError(e)});r?r.token&&r.refreshToken?(b(r.token,r.refreshToken,r.idToken),i.enable?y().then(function(){w().then(function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),v()):s.setSuccess()}).catch(function(e){s.setError(e)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()}).catch(function(e){o.onAuthError&&o.onAuthError(),r.onLoad?c():s.setError(e)})):r.onLoad?c():s.setSuccess():s.setSuccess()}return l.then(function(){var e,t;(e=F(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(k).then(u).catch(function(e){a.setError(e)})}),l.catch(function(e){a.setError(e)}),a.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var r,i=p(),a=p(),s=t.redirectUri(e),l={state:i,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(l.prompt=e.prompt),r=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var c=e&&e.scope||o.scope;c?-1===c.indexOf("openid")&&(c="openid "+c):c="openid";var m=r+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(c);if(d&&(m=m+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(m+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(m+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(m+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(m+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(m+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(m+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(m+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||o.acrValues)&&(m+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var f=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");l.pkceCodeVerifier=f,m+="&code_challenge="+function(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return btoa(String.fromCodePoint(...new Uint8Array(mo.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,f)+"&code_challenge_method="+o.pkceMethod}return n.add(l),m},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=m(),r=void 0;return void 0!==n&&(r=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),r},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=m()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=F();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=F();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return l("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=F();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,l("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(e))&&(n=!0,l("[KEYCLOAK] Refreshing token: token expired")),n){var i="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.endpoints.token();if(r.push(t),1==r.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,i+="&client_id="+encodeURIComponent(o.clientId);var d=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){l("[KEYCLOAK] Token refreshed"),d=(d+new Date().getTime())/2;var e=JSON.parse(s.responseText);b(e.access_token,e.refresh_token,e.id_token,d),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=r.pop();null!=t;t=r.pop())t.setSuccess(!0)}else{c("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var t=r.pop();null!=t;t=r.pop())t.setError(!0)}},s.send(i)}}else t.setSuccess(!1)};return i.enable?w().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},o.clearToken=function(){o.token&&(b(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var D=function(){if(!(this instanceof D))return new D;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var o=localStorage.getItem(n);if(o)try{var r=JSON.parse(o).expires;(!r||r<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,o=localStorage.getItem(n);return o&&(localStorage.removeItem(n),o=JSON.parse(o)),e(),o}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},M=function(){if(!(this instanceof M))return new M;this.get=function(o){if(o){var r=t("kc-callback-"+o);if(n("kc-callback-"+o,"",e(-100)),r)return JSON.parse(r)}},this.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){n(t,"",e(-100))};var e=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},t=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return""},n=function(e,t,n){var o=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=o}};function L(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var ms=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function s(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let md="openremote";(ew=tL||(tL={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ew.AUTH_FAILED="AUTH_FAILED",ew.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ew.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ew.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ew.TRANSLATION_ERROR="TRANSLATION_ERROR",(ek=tC||(tC={})).ERROR="ERROR",ek.READY="READY",ek.ONLINE="ONLINE",ek.OFFLINE="OFFLINE",ek.CONNECTING="CONNECTING",ek.CONSOLE_INIT="CONSOLE_INIT",ek.CONSOLE_READY="CONSOLE_READY",ek.TRANSLATE_INIT="TRANSLATE_INIT",ek.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",ek.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",ek.LOGIN="LOGIN";let ml={cn:"zh-cn"};class mc{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._disconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){let e=new Map;return this._keycloak?this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,n])=>{let o=n.roles;e.set(t,o)}):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){var e;return null==(e=this._config)?void 0:e.managerUrl}get keycloakUrl(){var e;return null==(e=this._config)?void 0:e.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return uz}get language(){return o$.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(o$.changeLanguage(e),this.console.storeData("LANGUAGE",e),this.authenticated&&this.updateKeycloakUserLanguage(e).catch(e=>console.error(e)))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(tC.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||md}getEventProvider(){return this.events}isManagerSameOrigin(){if(!this.ready)return!1;let e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){0>this._listeners.indexOf(e)&&this._listeners.push(e)}removeListener(e){let t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return ms(this,void 0,void 0,function*(){let t;this._config&&console.debug("Already initialised"),this._config=((t=e?Object.assign({},e):{}).managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+window.location.pathname.replace(/\/[^/]+\/?$/,""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),void 0===t.applyConfigToAdmin&&(t.applyConfigToAdmin=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId=md),t);let n=yield this.loadManagerInfo(),o=new d8(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tC.CONSOLE_READY)});if(this._console=o,"BASIC"===this._config.auth)n=(yield this.doTranslateInit())&&n,n=yield this.doAuthInit();else if("KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){let e,t=new URL(this._config.managerUrl);this._authServerUrl.startsWith("//")&&(this._authServerUrl=t.protocol+this._authServerUrl);try{e=new URL(this._authServerUrl)}catch(n){(e=new URL(t)).pathname=this._authServerUrl}e.protocol||(e.protocol=t.protocol),e.hostname||(e.hostname=t.hostname),e.port||(e.port=t.port),this._config.keycloakUrl=e.toString()}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),(n=yield this.doAuthInit())||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",n=yield this.doAuthInit())}return!!n&&(n&&(n=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(n=(yield this.doTranslateInit())&&n)&&(n=yield this.doDescriptorsInit(),n=yield this.getConsoleAppConfig()),this.doIconInit(),n?(n=yield this.doEventsSubscriptionInit(),this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(tC.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return ms(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()});return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(tL.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return ms(this,void 0,void 0,function*(){if(o$.isInitialized)return!0;o$.on("initialized",e=>{this._emitEvent(tC.TRANSLATE_INIT)}),o$.on("languageChanged",e=>{var t;d1().locale(null!=(t=ml[e])?t:e),this._emitEvent(tC.TRANSLATE_LANGUAGE_CHANGED)});let e={lng:(yield this.getConsolePreferredLanguage())||(yield this.getUserPreferredLanguage())||this.config.defaultLanguage||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,interpolation:{format:(e,t,n)=>"uppercase"===t?e.toUpperCase():e instanceof Date?d1()(e).format(t):e},backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield o$.use(mn).init(e)}catch(e){return console.error(e),this._setError(tL.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return ms(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield uz.api.AssetModelResource.getAssetInfos(),t=yield uz.api.AssetModelResource.getMetaItemDescriptors(),n=yield uz.api.AssetModelResource.getValueDescriptors();nz._assetTypeInfos=e.data,nz._metaItemDescriptors=Object.values(t.data),nz._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return ms(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(tL.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(uz.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return uz.setTimeout(2e4),uz.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return ms(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new uJ(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tL.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tM.DISCONNECTED?this.events.connect().catch(e=>{console.error("Failed to connect EventProvider."),console.error(e)}):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case tM.DISCONNECTED:this._onDisconnect();break;case tM.CONNECTED:break;case tM.CONNECTING:this._emitEvent(tC.CONNECTING)}}doConsoleInit(){return ms(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tC.CONSOLE_INIT),!0}catch(e){return this._setError(tL.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(nq.addIconSet("mdi",(e=mu.managerUrl,{getIconTemplate:e=>nf`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){let t=document.createElement("style");t.id="mdiFontStyle",t.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot");\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+e+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),nq.addIconSet("or",{getIconTemplate:e=>{let t=nW[e];return t?nf`
2827
2827
  <svg xmlns="http://www.w3.org/2000/svg"
2828
2828
  viewBox="0 0 ${24} ${24}" preserveAspectRatio="xMidYMid meet" focusable="false">
2829
2829
  ${nR(t.startsWith("<")?t:'<path xmlns="http://www.w3.org/2000/svg" d="'+t+'" />')}