@openremote/or-scheduler 1.27.0 → 1.28.0-snapshot.20260722075650

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.
@@ -2811,7 +2811,7 @@
2811
2811
  >
2812
2812
  <slot name="overlay"></slot>
2813
2813
  </vaadin-multi-select-combo-box-overlay>
2814
- `}}oq(dW);let d$=class extends dW{};d$=function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}([nB("or-vaadin-multi-select-combo-box")],d$);let dV=class extends sk{};function dq(e,t,n){return e?t(e):n?.(e)}dV=function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}([nB("or-vaadin-time-picker")],dV),n(4532);var dG=n(8183),dK=n.n(dG),dJ=n(4867),dX=n.n(dJ);n(3472);class dQ{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 dZ(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){let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>dZ(e[n],t[n]))}return!1}class d0{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=>d0._evalValuePredicate(e.name,t)))&&(!this.attributes||d0._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!d0._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?d0._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||d0._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=>d0._evalPredicate(e,t)),...(null!=(r=t.groups)?r:[]).map(t=>d0._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=>d0._collectNames(e))]}}d0._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var d1=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 d2=n(4461);class d4{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=d4._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=md.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 d1(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 d1(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 d1(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 d1(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 d1(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 dQ,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(()=>d1(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 d1(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield md.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&&d4._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 d1(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:d2.name,version:d2.version,platform:d2.os.toString(),apps:[],model:((d2.manufacturer?d2.manufacturer+" ":"")+(d2.product?d2.product:"")).trim()}}_initialiseProvider(e){return d1(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 d3(e,t){return function(){return e.apply(t,arguments)}}let{toString:d5}=Object.prototype,{getPrototypeOf:d6}=Object,{iterator:d8,toStringTag:d7}=Symbol,d9=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),le=(e,t)=>{let n=e,o=[];for(;null!=n&&n!==Object.prototype&&-1===o.indexOf(n);){if(o.push(n),d9(n,t))return!0;n=d6(n)}return!1},lt=(i=Object.create(null),e=>{let t=d5.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())}),ln=e=>(e=e.toLowerCase(),t=>lt(t)===e),lo=e=>t=>typeof t===e,{isArray:lr}=Array,li=lo("undefined");function la(e){return null!==e&&!li(e)&&null!==e.constructor&&!li(e.constructor)&&ll(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let ls=ln("ArrayBuffer"),ld=lo("string"),ll=lo("function"),lc=lo("number"),lu=e=>null!==e&&"object"==typeof e,lm=e=>{if(!lu(e))return!1;let t=d6(e);return(null===t||t===Object.prototype||null===d6(t))&&!le(e,d7)&&!le(e,d8)},lf=ln("Date"),lh=ln("File"),lb=ln("Blob"),lp=ln("FileList"),l_="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lg=void 0!==l_.FormData?l_.FormData:void 0,lF=ln("URLSearchParams"),[ly,lv,lw,lk]=["ReadableStream","Request","Response","Headers"].map(ln);function lE(e,t,{allOwnKeys:n=!1}={}){let o,r;if(null!=e)if("object"!=typeof e&&(e=[e]),lr(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{let r;if(la(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 lD(e,t){let n;if(la(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 lM="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lL=e=>!li(e)&&e!==lM,lC=(a="u">typeof Uint8Array&&d6(Uint8Array),e=>a&&e instanceof a),lA=ln("HTMLFormElement"),{propertyIsEnumerable:lT}=Object.prototype,lx=ln("RegExp"),lS=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),o={};lE(n,(n,r)=>{let i;!1!==(i=t(n,r,e))&&(o[r]=i||n)}),Object.defineProperties(e,o)},lY=ln("AsyncFunction"),lO=(l="function"==typeof setImmediate,c=ll(lM.postMessage),l?setImmediate:c?(u=`axios@${Math.random()}`,m=[],lM.addEventListener("message",({source:e,data:t})=>{e===lM&&t===u&&m.length&&m.shift()()},!1),e=>{m.push(e),lM.postMessage(u,"*")}):e=>setTimeout(e)),lI="u">typeof queueMicrotask?queueMicrotask.bind(lM):"u">typeof process&&process.nextTick||lO,lP=e=>null!=e&&ll(e[d8]),lB={isArray:lr,isArrayBuffer:ls,isBuffer:la,isFormData:e=>{if(!e)return!1;if(lg&&e instanceof lg)return!0;let t=d6(e);if(!t||t===Object.prototype||!ll(e.append))return!1;let n=lt(e);return"formdata"===n||"object"===n&&ll(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ls(e.buffer)},isString:ld,isNumber:lc,isBoolean:e=>!0===e||!1===e,isObject:lu,isPlainObject:lm,isEmptyObject:e=>{if(!lu(e)||la(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ly,isRequest:lv,isResponse:lw,isHeaders:lk,isUndefined:li,isDate:lf,isFile:lh,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lb,isRegExp:lx,isFunction:ll,isStream:e=>lu(e)&&ll(e.pipe),isURLSearchParams:lF,isTypedArray:lC,isFileList:lp,forEach:lE,merge:function e(...t){let{caseless:n,skipUndefined:o}=lL(this)&&this||{},r={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;let a=n&&"string"==typeof i&&lD(r,i)||i,s=d9(r,a)?r[a]:void 0;lm(s)&&lm(t)?r[a]=e(s,t):lm(t)?r[a]=e({},t):lr(t)?r[a]=t.slice():o&&li(t)||(r[a]=t)};for(let e=0,n=t.length;e<n;e++){let n=t[e];if(!n||la(n)||(lE(n,i),"object"!=typeof n||lr(n)))continue;let o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){let t=o[e];lT.call(n,t)&&i(n[t],t)}}return r},extend:(e,t,n,{allOwnKeys:o}={})=>(lE(t,(t,o)=>{n&&ll(t)?Object.defineProperty(e,o,{__proto__:null,value:d3(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&&d6(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:lt,kindOfTest:ln,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(lr(e))return e;let t=e.length;if(!lc(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,o=(e&&e[d8]).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:lA,hasOwnProperty:d9,hasOwnProp:d9,hasOwnInPrototypeChain:le,getSafeProp:(e,t)=>null!=e&&le(e,t)?e[t]:void 0,reduceDescriptors:lS,freezeMethods:e=>{lS(e,(t,n)=>{if(ll(e)&&["arguments","caller","callee"].includes(n))return!1;if(ll(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(lr(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:lD,global:lM,isContextDefined:lL,isSpecCompliantForm:function(e){return!!(e&&ll(e.append)&&"FormData"===e[d7]&&e[d8])},toJSONObject:e=>{let t=new WeakSet,n=e=>{if(lu(e)){if(t.has(e))return;if(la(e))return e;if(!("toJSON"in e)){t.add(e);let o=lr(e)?[]:{};return lE(e,(e,t)=>{let r=n(e);li(r)||(o[t]=r)}),t.delete(e),o}}return e};return n(e)},isAsyncFn:lY,isThenable:e=>e&&(lu(e)||ll(e))&&ll(e.then)&&ll(e.catch),setImmediate:lO,asap:lI,isIterable:lP,isSafeIterable:e=>null!=e&&le(e,d8)&&lP(e)},lR=lB.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"]),lN=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lj=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function lH(e,t){return lB.isArray(e)?e.map(e=>lH(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 lU(e){let t=Object.create(null);return lB.forEach(e.toJSON(),(e,n)=>{t[n]=lH(e,lj)}),t}let lz=Symbol("internals");function lW(e){return e&&String(e).trim().toLowerCase()}function l$(e){return!1===e||null==e?e:lB.isArray(e)?e.map(l$):lH(String(e),lN)}function lV(e,t,n,o,r){if(lB.isFunction(o))return o.call(this,t,n);if(r&&(t=n),lB.isString(t)){if(lB.isString(o))return -1!==t.indexOf(o);if(lB.isRegExp(o))return o.test(t)}}class lq{constructor(e){e&&this.set(e)}set(e,t,n){let o=this;function r(e,t,n){let r=lW(t);if(!r)return;let i=lB.findKey(o,r);i&&void 0!==o[i]&&!0!==n&&(void 0!==n||!1===o[i])||(o[i||t]=l$(e))}let i=(e,t)=>lB.forEach(e,(e,n)=>r(e,n,t));if(lB.isPlainObject(e)||e instanceof this.constructor)i(e,t);else{let o;if(lB.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]&&lR[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(lB.isObject(e)&&lB.isSafeIterable(e)){let n=Object.create(null),o,r;for(let t of e){if(!lB.isArray(t))throw TypeError("Object iterator must return a key-value pair");r=t[0],lB.hasOwnProp(n,r)?(o=n[r],n[r]=lB.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=lW(e)){let n=lB.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(lB.isFunction(t))return t.call(this,e,n);if(lB.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=lW(e)){let n=lB.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||lV(this,this[n],n,t)))}return!1}delete(e,t){let n=this,o=!1;function r(e){if(e=lW(e)){let r=lB.findKey(n,e);r&&(!t||lV(n,n[r],r,t))&&(delete n[r],o=!0)}}return lB.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||lV(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){let t=this,n={};return lB.forEach(this,(o,r)=>{let i=lB.findKey(n,r);if(i){t[i]=l$(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]=l$(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return lB.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&lB.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[lz]=this[lz]={accessors:{}}).accessors,n=this.prototype;function o(e){let o=lW(e);if(!t[o]){let r;r=lB.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 lB.isArray(e)?e.forEach(o):o(e),this}}lq.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lB.reduceDescriptors(lq.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),lB.freezeMethods(lq);class lG extends Error{static from(e,t,n,o,r,i){let a=new lG(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&&lB.hasOwnProp(o,"redact")?o.redact:void 0,i=lB.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||lB.isBuffer(o))return o;if(-1===t.indexOf(o)){if(o instanceof lq&&(o=o.toJSON()),t.push(o),lB.isArray(o))r=[],o.forEach((e,t)=>{let o=n(e);lB.isUndefined(o)||(r[t]=o)});else{if(!lB.isPlainObject(o)&&function(e){if(lB.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lB.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);lB.isUndefined(o)||(r[t]=o)}}return t.pop(),r}})(o)):lB.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}}}lG.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",lG.ERR_BAD_OPTION="ERR_BAD_OPTION",lG.ECONNABORTED="ECONNABORTED",lG.ETIMEDOUT="ETIMEDOUT",lG.ECONNREFUSED="ECONNREFUSED",lG.ERR_NETWORK="ERR_NETWORK",lG.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",lG.ERR_DEPRECATED="ERR_DEPRECATED",lG.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",lG.ERR_BAD_REQUEST="ERR_BAD_REQUEST",lG.ERR_CANCELED="ERR_CANCELED",lG.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",lG.ERR_INVALID_URL="ERR_INVALID_URL",lG.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let lK=lG;function lJ(e){return lB.isPlainObject(e)||lB.isArray(e)}function lX(e){return lB.endsWith(e,"[]")?e.slice(0,-2):e}function lQ(e,t,n){return e?e.concat(t).map(function(e,t){return e=lX(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let lZ=lB.toFlatObject(lB,{},null,function(e){return/^is[A-Z]/.test(e)}),l0=function(e,t,n){if(!lB.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let o=(n=lB.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!lB.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&&lB.isSpecCompliantForm(t),c=[];if(!lB.isFunction(r))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(lB.isDate(e))return e.toISOString();if(lB.isBoolean(e))return e.toString();if(!l&&lB.isBlob(e))throw new lK("Blob is not supported. Use a Buffer instead.");if(lB.isArrayBuffer(e)||lB.isTypedArray(e)){if(l&&"function"==typeof s)return new s([e]);if("u">typeof Buffer)return Buffer.from(e);throw new lK("Blob is not supported. Use a Buffer instead.",lK.ERR_NOT_SUPPORT)}return e}function m(e){if(e>d)throw new lK("Object is too deeply nested ("+e+" levels). Max depth: "+d,lK.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(e,n,r){let s=e;if(lB.isReactNative(t)&&lB.isReactNativeBlob(e))return t.append(lQ(r,n,i),u(e)),!1;if(e&&!r&&"object"==typeof e)if(lB.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(!lB.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(lB.isArray(e)&&(l=e,lB.isArray(l)&&!l.some(lJ))||(lB.isFileList(e)||lB.endsWith(n,"[]"))&&(s=lB.toArray(e)))return n=lX(n),s.forEach(function(e,o){lB.isUndefined(e)||null===e||t.append(!0===a?lQ([n],o,i):null===a?n:n+"[]",u(e))}),!1}return!!lJ(e)||(t.append(lQ(r,n,i),u(e)),!1)}let h=Object.assign(lZ,{defaultVisitor:f,convertValue:u,isVisitable:lJ});if(!lB.isObject(e))throw TypeError("data must be an object");return!function e(n,o,i=0){if(!lB.isUndefined(n)){if(m(i),-1!==c.indexOf(n))throw Error("Circular reference detected in "+o.join("."));c.push(n),lB.forEach(n,function(n,a){!0===(!(lB.isUndefined(n)||null===n)&&r.call(t,n,lB.isString(a)?a.trim():a,o,h))&&e(n,o?o.concat(a):[a],i+1)}),c.pop()}}(e),t};function l1(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function l2(e,t){this._pairs=[],e&&l0(e,this,t)}let l4=l2.prototype;function l3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l5(e,t,n){let o;if(!t)return e;e=e||"";let r=lB.isFunction(n)?{serialize:n}:n,i=lB.getSafeProp(r,"encode")||l3,a=lB.getSafeProp(r,"serialize");if(o=a?a(t,r):lB.isURLSearchParams(t)?t.toString():new l2(t,r).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}l4.append=function(e,t){this._pairs.push([e,t])},l4.toString=function(e){let t=e?t=>e.call(this,t,l1):l1;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let l6=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){lB.forEach(this.handlers,function(t){null!==t&&e(t)})}},l8={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},l7="u">typeof URLSearchParams?URLSearchParams:l2,l9="u">typeof FormData?FormData:null,ce="u">typeof Blob?Blob:null,ct="u">typeof window&&"u">typeof document,cn="object"==typeof navigator&&navigator||void 0,co=ct&&(!cn||0>["ReactNative","NativeScript","NS"].indexOf(cn.product)),cr="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ci=ct&&window.location.href||"http://localhost",ca={...tT,isBrowser:!0,classes:{URLSearchParams:l7,FormData:l9,Blob:ce},protocols:["http","https","file","blob","url","data"]};function cs(e){if(e>100)throw new lK("FormData field is too deeply nested ("+e+" levels). Max depth: 100",lK.ERR_FORM_DATA_DEPTH_EXCEEDED)}let cd=function(e){if(lB.isFormData(e)&&lB.isFunction(e.entries)){let t={};return lB.forEachEntry(e,(e,n)=>{!function e(t,n,o,r){cs(r);let i=t[r++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),s=r>=t.length;return(i=!i&&lB.isArray(o)?o.length:i,s)?lB.hasOwnProp(o,i)?o[i]=lB.isArray(o[i])?o[i].concat(n):[o[i],n]:o[i]=n:(lB.hasOwnProp(o,i)&&lB.isObject(o[i])||(o[i]=[]),e(t,n,o[i],r)&&lB.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));)cs(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),n,t,0)}),t}return null},cl=(e,t)=>null!=e&&lB.hasOwnProp(e,t)?e[t]:void 0,cc={transitional:l8,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,o=t.getContentType()||"",r=o.indexOf("application/json")>-1,i=lB.isObject(e);if(i&&lB.isHTMLForm(e)&&(e=new FormData(e)),lB.isFormData(e))return r?JSON.stringify(cd(e)):e;if(lB.isArrayBuffer(e)||lB.isBuffer(e)||lB.isStream(e)||lB.isFile(e)||lB.isBlob(e)||lB.isReadableStream(e))return e;if(lB.isArrayBufferView(e))return e.buffer;if(lB.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){let t=cl(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return l0(e,new ca.classes.URLSearchParams,{visitor:function(e,t,n,o){return ca.isNode&&lB.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t}).toString();if((n=lB.isFileList(e))||o.indexOf("multipart/form-data")>-1){let o=cl(this,"env"),r=o&&o.FormData;return l0(n?{"files[]":e}:e,r&&new r,t)}}if(i||r){t.setContentType("application/json",!1);var a=e;if(lB.isString(a))try{return(0,JSON.parse)(a),lB.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=cl(this,"transitional")||cc.transitional,n=t&&t.forcedJSONParsing,o=cl(this,"responseType"),r="json"===o;if(lB.isResponse(e)||lB.isReadableStream(e))return e;if(e&&lB.isString(e)&&(n&&!o||r)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,cl(this,"parseReviver"))}catch(e){if(!n&&r){if("SyntaxError"===e.name)throw lK.from(e,lK.ERR_BAD_RESPONSE,this,null,cl(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ca.classes.FormData,Blob:ca.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function cu(e,t){let n=this||cc,o=t||n,r=lq.from(o.headers),i=o.data;return lB.forEach(e,function(e){i=e.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function cm(e){return!!(e&&e.__CANCEL__)}lB.forEach(["delete","get","head","post","put","patch","query"],e=>{cc.headers[e]={}});let cf=class extends lK{constructor(e,t,n){super(null==e?"canceled":e,lK.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function ch(e,t,n){let o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new lK("Request failed with status code "+n.status,n.status>=400&&n.status<500?lK.ERR_BAD_REQUEST:lK.ERR_BAD_RESPONSE,n.config,n.request,n))}let cb=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}},cp=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)]},c_=(e,t,n=3)=>{let o=0,r=cb(50,250);return cp(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)},cg=(e,t)=>{let n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},cF=e=>(...t)=>lB.asap(()=>e(...t)),cy=ca.hasStandardBrowserEnv?(s=new URL(ca.origin),d=ca.navigator&&/(msie|trident)/i.test(ca.navigator.userAgent),e=>(e=new URL(e,ca.origin),s.protocol===e.protocol&&s.host===e.host&&(d||s.port===e.port))):()=>!0,cv=ca.hasStandardBrowserEnv?{write(e,t,n,o,r,i,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];lB.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),lB.isString(o)&&s.push(`path=${o}`),lB.isString(r)&&s.push(`domain=${r}`),!0===i&&s.push("secure"),lB.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(){}},cw=/^https?:(?!\/\/)/i,ck=/[\t\n\r]/g;function cE(e,t){if("string"==typeof e&&cw.test((function(e){let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t)})(e).replace(ck,"")))throw new lK('Invalid URL: missing "//" after protocol',lK.ERR_INVALID_URL,t)}function cD(e,t,n,o){cE(t,o);let r=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(r||!1===n)?(cE(e,o),t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e):t}let cM=e=>e instanceof lq?{...e}:e;function cL(e,t){e=e||{},t=t||{};let n=Object.create(null);function o(e,t,n,o){return lB.isPlainObject(e)&&lB.isPlainObject(t)?lB.merge.call({caseless:o},e,t):lB.isPlainObject(t)?lB.merge({},t):lB.isArray(t)?t.slice():t}function r(e,t,n,r){return lB.isUndefined(t)?lB.isUndefined(e)?void 0:o(void 0,e,n,r):o(e,t,n,r)}function i(e,t){if(!lB.isUndefined(t))return o(void 0,t)}function a(e,t){return lB.isUndefined(t)?lB.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function s(n,r,i){return lB.hasOwnProp(t,i)?o(n,r):lB.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(cM(e),cM(t),n,!0)};return lB.forEach(Object.keys({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;let i=lB.hasOwnProp(d,o)?d[o]:r,a=i(lB.hasOwnProp(e,o)?e[o]:void 0,lB.hasOwnProp(t,o)?t[o]:void 0,o);lB.isUndefined(a)&&i!==s||(n[o]=a)}),lB.hasOwnProp(t,"validateStatus")&&lB.isUndefined(t.validateStatus)&&!1===function(n){let o=lB.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!lB.isUndefined(o)){if(!lB.isPlainObject(o))return;else if(lB.hasOwnProp(o,n))return o[n]}let r=lB.hasOwnProp(e,"transitional")?e.transitional:void 0;if(lB.isPlainObject(r)&&lB.hasOwnProp(r,n))return r[n]}("validateStatusUndefinedResolves")&&(lB.hasOwnProp(e,"validateStatus")?n.validateStatus=o(void 0,e.validateStatus):delete n.validateStatus),n}let cC=["content-type","content-length"],cA=function(e){let t=cL({},e),n=e=>lB.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=lq.from(s),t.url=l5(cD(l,u,c,t),n("params"),n("paramsSerializer")),d){let t=lB.getSafeProp(d,"username")||"",n=lB.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 lK.from(t,lK.ERR_BAD_OPTION_VALUE,e)}}if(lB.isFormData(o))if(ca.hasStandardBrowserEnv||ca.hasStandardBrowserWebWorkerEnv||lB.isReactNative(o))s.setContentType(void 0);else{var m,f;lB.isFunction(o.getHeaders)&&(m=s,f=o.getHeaders(),"content-only"!==n("formDataHeaderPolicy")?m.set(f):Object.entries(f||{}).forEach(([e,t])=>{cC.includes(e.toLowerCase())&&m.set(e,t)}))}if(ca.hasStandardBrowserEnv&&(lB.isFunction(r)&&(r=r(t)),!0===r||null==r&&cy(t.url))){let e=i&&a&&cv.read(a);e&&s.set(i,e)}return t},cT="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var o;let r,i,a,s,d,l,c=cA(e),u=c.data,m=lq.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=lq.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());ch(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 lK("Request aborted",lK.ECONNABORTED,e,_)),p(),_=null)},_.onerror=function(t){let o=new lK(t&&t.message?t.message:"Network Error",lK.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||l8;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new lK(t,o.clarifyTimeoutError?lK.ETIMEDOUT:lK.ECONNABORTED,e,_)),p(),_=null},void 0===u&&m.setContentType(null),"setRequestHeader"in _&&lB.forEach(lU(m),function(e,t){_.setRequestHeader(t,e)}),lB.isUndefined(c.withCredentials)||(_.withCredentials=!!c.withCredentials),f&&"json"!==f&&(_.responseType=c.responseType),b&&([a,d]=c_(b,!0),_.addEventListener("progress",a)),h&&_.upload&&([i,s]=c_(h),_.upload.addEventListener("progress",i),_.upload.addEventListener("loadend",s)),(c.cancelToken||c.signal)&&(r=t=>{_&&(n(!t||t.type?new cf(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&&!ca.protocols.includes(F)){n(new lK("Unsupported protocol "+F+":",lK.ERR_BAD_REQUEST,e)),p();return}_.send(u||null)})},cx=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},cS=async function*(e,t){for await(let n of cY(e))yield*cx(n,t)},cY=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()}},cO=(e,t,n,o)=>{let r,i=cS(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})},cI=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cP=(e,t,n)=>t+2<n&&cI(e.charCodeAt(t+1))&&cI(e.charCodeAt(t+2)),{isFunction:cB}=lB,cR=e=>{if(!lB.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},cN=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cj=e=>{let t,n=void 0!==lB.global&&null!==lB.global?lB.global:globalThis,{ReadableStream:o,TextEncoder:r}=n,{fetch:i,Request:a,Response:s}=e=lB.merge.call({skipUndefined:!0},{Request:n.Request,Response:n.Response},e),d=i?cB(i):"function"==typeof fetch,l=cB(a),c=cB(s);if(!d)return!1;let u=d&&cB(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&&cN(()=>{let e=!1,t=new a(ca.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&&cN(()=>lB.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 lK(`Response type '${e}' is not supported`,lK.ERR_NOT_SUPPORT,n)})});let p=async e=>{if(null==e)return 0;if(lB.isBlob(e))return e.size;if(lB.isSpecCompliantForm(e)){let t=new a(ca.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return lB.isArrayBufferView(e)||lB.isArrayBuffer(e)?e.byteLength:(lB.isURLSearchParams(e)&&(e+=""),lB.isString(e))?(await m(e)).byteLength:void 0},_=async(e,t)=>{let n=lB.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}=cA(e),L=lB.isNumber(D)&&D>-1,C=lB.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 lK?t:new cf(t instanceof Error?t.message:t))}},i=t&&setTimeout(()=>{i=null,r(new lK(`timeout of ${t}ms exceeded`,lK.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=()=>lB.asap(a),s})([c,m&&m.toAbortSignal()],g),x=null,S=T&&T.unsubscribe&&(()=>{T.unsubscribe()}),Y=null,O=()=>new lK("Request body larger than maxBodyLength limit",lK.ERR_BAD_REQUEST,e,x);try{var I;let i,c,m,g,P=(c="auth",lB.hasOwnProp(e,c)?e[c]:void 0);if(P){let e=lB.getSafeProp(P,"username")||"",t=lB.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,ca.origin);if(!i&&(e.username||e.password)){let t=cR(e.username),n=cR(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);cI(t)&&cI(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&&cP(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 lK("maxContentLength size of "+D+" exceeded",lK.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&&(lB.isReadableStream(d)||lB.isStream(d)),R=(e,t,n)=>cO(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(lB.isFormData(d)&&(e=o.headers.get("content-type"))&&w.setContentType(e),o.body){let[e,n]=y&&cg(t,c_(cF(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 lK("Stream request bodies are not supported by the current fetch implementation",lK.ERR_NOT_SUPPORT,e,x);lB.isString(k)||(k=k?"include":"omit");let N=l&&"credentials"in a.prototype;if(lB.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:lU(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=lq.from(H.headers);if(L){let t=lB.toFiniteNumber(U.getContentLength());if(null!=t&&t>D)throw new lK("maxContentLength size of "+D+" exceeded",lK.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=lB.toFiniteNumber(U.getContentLength()),[o,r]=F&&cg(n,c_(cF(F),!0))||[];H=new s(cO(H.body,65536,t=>{if(L&&t>D)throw new lK("maxContentLength size of "+D+" exceeded",lK.ERR_BAD_RESPONSE,e,x);o&&o(t)},()=>{r&&r(),S&&S()}),t)}v=v||"text";let W=await b[lB.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 lK("maxContentLength size of "+D+" exceeded",lK.ERR_BAD_RESPONSE,e,x)}return!z&&S&&S(),await new Promise((t,n)=>{ch(t,n,{data:W,headers:lq.from(H.headers),status:H.status,statusText:H.statusText,config:e,request:x})})}catch(t){if(S&&S(),T&&T.aborted&&T.reason instanceof lK){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 lK)throw x&&!t.request&&(t.request=x),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let n=new lK("Network Error",lK.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 lK.from(t,t&&t.code,e,x,t&&t.response)}}},cH=new Map,cU=e=>{let t=e&&e.env||{},{fetch:n,Request:o,Response:r}=t,i=[o,r,n],a=i.length,s,d,l=cH;for(;a--;)s=i[a],void 0===(d=l.get(s))&&l.set(s,d=a?new Map:cj(t)),l=d;return d};cU();let cz={http:null,xhr:cT,fetch:{get:cU}};lB.forEach(cz,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let cW=e=>`- ${e}`,c$=e=>lB.isFunction(e)||null===e||!1===e,cV=function(e,t){let n,o,{length:r}=e=lB.isArray(e)?e:[e],i={};for(let a=0;a<r;a++){let r;if(o=n=e[a],!c$(n)&&void 0===(o=cz[(r=String(n)).toLowerCase()]))throw new lK(`Unknown adapter '${r}'`);if(o&&(lB.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 lK("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(cW).join("\n"):" "+cW(e[0]):"as no adapter specified"),lK.ERR_NOT_SUPPORT)}return o};function cq(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cf(null,e)}function cG(e){return cq(e),e.headers=lq.from(e.headers),e.data=cu.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cV(e.adapter||cc.adapter,e)(e).then(function(t){cq(e),e.response=t;try{t.data=cu.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lq.from(t.headers),t},function(t){if(!cm(t)&&(cq(e),t&&t.response)){e.response=t.response;try{t.response.data=cu.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lq.from(t.response.headers)}return Promise.reject(t)})}let cK={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cK[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let cJ={};cK.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 lK(o(r," has been removed"+(t?" in "+t:"")),lK.ERR_DEPRECATED);return t&&!cJ[r]&&(cJ[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)}},cK.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let cX=function(e,t,n){if("object"!=typeof e||null===e)throw new lK("options must be an object",lK.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 lK("option "+i+" must be "+n,lK.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new lK("Unknown option "+i,lK.ERR_BAD_OPTION)}};class cQ{constructor(e){this.defaults=e||{},this.interceptors={request:new l6,response:new l6}}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=cL(this.defaults,t);void 0!==r&&cX(r,{silentJSONParsing:cK.transitional(cK.boolean),forcedJSONParsing:cK.transitional(cK.boolean),clarifyTimeoutError:cK.transitional(cK.boolean),legacyInterceptorReqResOrdering:cK.transitional(cK.boolean),advertiseZstdAcceptEncoding:cK.transitional(cK.boolean),validateStatusUndefinedResolves:cK.transitional(cK.boolean)},!1),null!=i&&(lB.isFunction(i)?t.paramsSerializer={serialize:i}:cX(i,{encode:cK.function,serialize:cK.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cX(t,{baseUrl:cK.spelling("baseURL"),withXsrfToken:cK.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&lB.merge(a.common,a[t.method]);a&&lB.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete a[e]}),t.headers=lq.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||l8;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=[cG.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=cG.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 l5(cD((e=cL(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}lB.forEach(["delete","get","head","options"],function(e){cQ.prototype[e]=function(t,n){return this.request(cL(n||{},{method:e,url:t,data:n&&lB.hasOwnProp(n,"data")?n.data:void 0}))}}),lB.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,r){return this.request(cL(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}cQ.prototype[e]=t(),"query"!==e&&(cQ.prototype[e+"Form"]=t(!0))});class cZ{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 cf(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 cZ(function(t){e=t}),cancel:e}}}let c0={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(c0).forEach(([e,t])=>{c0[t]=e});let c1=function e(t){let n=new cQ(t),o=d3(cQ.prototype.request,n);return lB.extend(o,cQ.prototype,n,{allOwnKeys:!0}),lB.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(cL(t,n))},o}(cc);c1.Axios=cQ,c1.CanceledError=cf,c1.CancelToken=cZ,c1.isCancel=cm,c1.VERSION="1.18.1",c1.toFormData=l0,c1.AxiosError=lK,c1.Cancel=c1.CanceledError,c1.all=function(e){return Promise.all(e)},c1.spread=function(e){return function(t){return e.apply(null,t)}},c1.isAxiosError=function(e){return lB.isObject(e)&&!0===e.isAxiosError},c1.mergeConfig=cL,c1.AxiosHeaders=lq,c1.formToJSON=e=>cd(lB.isHTMLForm(e)?new FormData(e):e),c1.getAdapter=cV,c1.HttpStatusCode=c0,c1.default=c1;class c2{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:uh`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`asset/predicted/${e}/${t}`,data:n,options:o})}}class c4{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:uh`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:uh`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:uh`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:uh`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:uh`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:uh`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:uh`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:uh`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:uh`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:uh`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:uh`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:uh`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:uh`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:uh`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:uh`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:uh`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:uh`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`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:uh`asset/${e}/attribute/${t}/${n}`,data:o,options:r})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:uh`asset/${e}/child`,queryParams:t,options:n})}}class c3{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:uh`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:uh`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:uh`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:uh`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:uh`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:uh`dashboard/${e}/${t}`,options:n})}}class c5{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:uh`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:uh`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:uh`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:uh`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:uh`notification/${e}/delivered`,queryParams:t,options:n})}}class c6{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:uh`console/register`,data:e,options:t})}}class c8{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:uh`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:uh`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:uh`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:uh`syslog/event`,queryParams:e,options:t})}}class c7{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:uh`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:uh`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:uh`apps/info`,options:e})}}class c9{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:uh`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:uh`info`,options:e})}}class ue{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:uh`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:uh`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:uh`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:uh`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:uh`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:uh`model/valueDescriptors`,queryParams:e,options:t})}}class ut{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:uh`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:uh`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:uh`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:uh`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:uh`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:uh`realm/${e}`,data:t,options:n})}}class un{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:uh`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:uh`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:uh`flow/${e}`,options:t})}}class uo{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:uh`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:uh`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:uh`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class ur{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:uh`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:uh`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:uh`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:uh`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:uh`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:uh`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:uh`service/${e}/${t}`,options:n})}}class ui{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:uh`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:uh`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:uh`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:uh`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:uh`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:uh`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:uh`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:uh`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:uh`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:uh`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:uh`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:uh`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:uh`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:uh`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:uh`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:uh`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:uh`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:uh`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:uh`rules/${e}`,data:t,options:n})}}class ua{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:uh`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:uh`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:uh`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:uh`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,r){return this.httpClient.request({method:"GET",url:uh`gateway/tunnel/${e}/${t}/${n}/${o}`,options:r})}}class us{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:uh`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:uh`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:uh`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:uh`configuration/manager/image/${e}`,options:t})}}class ud{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:uh`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:uh`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:uh`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:uh`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:uh`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:uh`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:uh`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:uh`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:uh`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:uh`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:uh`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:uh`user/${e}/userRoles/${t}/${n}`,data:o,options:r})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:uh`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:uh`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:uh`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/${t}`,options:n})}}class ul{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:uh`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:uh`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:uh`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:uh`provisioning/${e}`,data:t,options:n})}}class uc{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:uh`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:uh`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:uh`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:uh`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:uh`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:uh`gateway/status/${e}`,options:t})}}class uu{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:uh`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:uh`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:uh`asset/datapoint/${e}/${t}`,data:n,options:o})}}class um{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:uh`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:uh`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:uh`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:uh`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:uh`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:uh`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:uh`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:uh`alarm/${e}/assets`,queryParams:t,options:n})}}class uf{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:uh`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:uh`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:uh`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:uh`map/getCustomMapInfo`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:uh`map/tile/${e}/${t}/${n}`,options:o})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:uh`map/upload`,queryParams:e,options:t})}}function uh(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 ub{constructor(e,t=c1.create()){this._assetPredictedDatapointResource=new u_(e,t),this._assetResource=new ug(e,t),this._dashboardResource=new uF(e,t),this._notificationResource=new uy(e,t),this._consoleResource=new uv(e,t),this._syslogResource=new uw(e,t),this._appResource=new uk(e,t),this._statusResource=new uE(e,t),this._assetModelResource=new uD(e,t),this._realmResource=new uM(e,t),this._flowResource=new uL(e,t),this._agentResource=new uC(e,t),this._externalServiceResource=new uA(e,t),this._rulesResource=new uT(e,t),this._gatewayServiceResource=new ux(e,t),this._configurationResource=new uS(e,t),this._userResource=new uY(e,t),this._provisioningResource=new uO(e,t),this._gatewayClientResource=new uI(e,t),this._assetDatapointResource=new uP(e,t),this._alarmResource=new uB(e,t),this._mapResource=new uR(e,t),this._assetResource=new ug(e,t)}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AssetResource(){return this._assetResource}get DashboardResource(){return this._dashboardResource}get NotificationResource(){return this._notificationResource}get ConsoleResource(){return this._consoleResource}get SyslogResource(){return this._syslogResource}get AppResource(){return this._appResource}get StatusResource(){return this._statusResource}get AssetModelResource(){return this._assetModelResource}get RealmResource(){return this._realmResource}get FlowResource(){return this._flowResource}get AgentResource(){return this._agentResource}get ExternalServiceResource(){return this._externalServiceResource}get RulesResource(){return this._rulesResource}get GatewayServiceResource(){return this._gatewayServiceResource}get ConfigurationResource(){return this._configurationResource}get UserResource(){return this._userResource}get ProvisioningResource(){return this._provisioningResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetDatapointResource(){return this._assetDatapointResource}get AlarmResource(){return this._alarmResource}get MapResource(){return this._mapResource}}class up{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 u_ extends c2{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class ug extends c4{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uF extends c3{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uy extends c5{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uv extends c6{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uw extends c8{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uk extends c7{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uE extends c9{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uD extends ue{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uM extends ut{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uL extends un{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uC extends uo{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uA extends ur{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uT extends ui{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class ux extends ua{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uS extends us{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uY extends ud{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uO extends ul{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uI extends uc{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uP extends uu{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uB extends um{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uR extends uf{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}c1.isAxiosError;let uN=new class{get api(){return this._client}constructor(){this._axiosInstance=c1.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>dK().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 ub(e,this._axiosInstance)}};var uj=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())})};(ey=tE||(tE={})).DISCONNECTED="DISCONNECTED",ey.CONNECTED="CONNECTED",ey.CONNECTING="CONNECTING";let uH="SUBSCRIBED:",uU="UNAUTHORIZED:",uz="TRIGGERED:",uW="EVENT:";class u${constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=uV.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tE.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===tE.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(tE.CONNECTING),this._connectingDeferred=new dQ,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=uV.MIN_RECONNECT_DELAY,this._onStatusChanged(tE.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!==tE.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new dQ};return null!=this._pendingSubscription||this._status!==tE.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 uj(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===tE.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tE.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return uj(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,r="AssetEvent"+u$._subscriptionCounter++;if(!this._assetEventPromise){let e;md.authenticated||(e={filterType:"asset",realm:md.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===md.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 uj(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"+u$._subscriptionCounter++;if(!this._attributeEventPromise){let e;md.authenticated||(e={filterType:"asset",realm:md.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===md.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===tE.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===tE.CONNECTED&&this._onStatusChanged(tE.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tE.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<uV.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(uV.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}u$.MIN_RECONNECT_DELAY=0,u$.MAX_RECONNECT_DELAY=3e4,u$._subscriptionCounter=0;class uV extends u${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="+md.config.realm;return this._connectDeferred=new dQ,(md.authenticated?md.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(uH)){let e=JSON.parse(t.substring(uH.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(uU)){let e=JSON.parse(t.substring(uU.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(uz)){let e=JSON.parse(t.substring(uz.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(uW)){let e=JSON.parse(t.substring(uW.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 dQ,e.subscriptionId||(e.subscriptionId=uV._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=uW+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 dQ;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(uW+JSON.stringify(e)),t.promise}}uV._subscriptionCounter=1;let uq=["__proto__","constructor","prototype"];function uG(e){return!("string"!=typeof e||0===e.length||e.length>128||uq.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function uK(e){return!(!uG(e)||e.indexOf("/")>-1)}let uJ={lng:uK,ns:function(e){return uG(e)}};function uX(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function uQ(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let uZ=/\{\{(.+?)\}\}/g;function u0(e,t){let n=!1,o=e.replace(uZ,(e,o)=>{let r=o.trim();if(uq.indexOf(r)>-1)return e;let i=t[r];if(null==i)return e;let a=uJ[r]||uK,s=String(i).split("+");for(let t of s)if(!a(t))return n=!0,e;return s.join("+")});return n?null:o}let u1="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?r=fetch:u1&&"function"==typeof u1.fetch&&(r=u1.fetch);let u2=uQ()&&u1?u1.XMLHttpRequest:void 0,u4="function"==typeof ActiveXObject&&u1?u1.ActiveXObject:void 0,u3=["__proto__","constructor","prototype"],u5=(e,t)=>{if(t&&"object"==typeof t){let n="";for(let e of Object.keys(t))u3.indexOf(e)>-1||(n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},u6=(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)},u8=(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=u5(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{u6(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]}),u6(i,l,s,c),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(uQ()||"function"==typeof ActiveXObject){var d=t,l=n,c=o;l&&"object"==typeof l&&(l=u5("",l).slice(1)),e.queryStringParams&&(d=u5(d,e.queryStringParams));try{let t=u2?new u2:new u4("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))u3.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 u7=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:u8,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=u0(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(uX).join(", ")+"] namespaces=["+n.map(uX).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=uX(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+": "+uX(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=u0(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)})})})}};u7.type="backend";var u9=n(4954);class me extends Error{}function mt(e,t){let n;if("string"!=typeof e)throw new me("Invalid token specified: must be a string");t||(t={});let o=+(!0!==t.header),r=e.split(".")[o];if("string"!=typeof r)throw new me(`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 me(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new me(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}if(me.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function mn(e){if(!(this instanceof mn))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=mt(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=mt(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=mt(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(u9.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 mo=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 mr="openremote";(ev=tD||(tD={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ev.AUTH_FAILED="AUTH_FAILED",ev.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ev.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ev.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ev.TRANSLATION_ERROR="TRANSLATION_ERROR",(ew=tM||(tM={})).ERROR="ERROR",ew.READY="READY",ew.ONLINE="ONLINE",ew.OFFLINE="OFFLINE",ew.CONNECTING="CONNECTING",ew.CONSOLE_INIT="CONSOLE_INIT",ew.CONSOLE_READY="CONSOLE_READY",ew.TRANSLATE_INIT="TRANSLATE_INIT",ew.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",ew.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",ew.LOGIN="LOGIN";let mi={cn:"zh-cn"};class ma{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 uN}get language(){return oz.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(oz.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(tM.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||mr}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 mo(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=mr),t);let n=yield this.loadManagerInfo(),o=new d4(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tM.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(tM.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return mo(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(tD.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return mo(this,void 0,void 0,function*(){if(oz.isInitialized)return!0;oz.on("initialized",e=>{this._emitEvent(tM.TRANSLATE_INIT)}),oz.on("languageChanged",e=>{var t;dX().locale(null!=(t=mi[e])?t:e),this._emitEvent(tM.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?dX()(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 oz.use(u7).init(e)}catch(e){return console.error(e),this._setError(tD.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return mo(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield uN.api.AssetModelResource.getAssetInfos(),t=yield uN.api.AssetModelResource.getMetaItemDescriptors(),n=yield uN.api.AssetModelResource.getValueDescriptors();nH._assetTypeInfos=e.data,nH._metaItemDescriptors=Object.values(t.data),nH._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return mo(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(tD.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(uN.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return uN.setTimeout(2e4),uN.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return mo(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new uV(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tD.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tE.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 tE.DISCONNECTED:this._onDisconnect();break;case tE.CONNECTED:break;case tE.CONNECTING:this._emitEvent(tM.CONNECTING)}}doConsoleInit(){return mo(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tM.CONSOLE_INIT),!0}catch(e){return this._setError(tD.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(n$.addIconSet("mdi",(e=ms.managerUrl,{getIconTemplate:e=>nu`<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)}})),n$.addIconSet("or",{getIconTemplate:e=>{let t=nU[e];return t?nu`
2814
+ `}}oq(dW);let d$=class extends dW{};d$=function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}([nB("or-vaadin-multi-select-combo-box")],d$);let dV=class extends sk{};function dq(e,t,n){return e?t(e):n?.(e)}dV=function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}([nB("or-vaadin-time-picker")],dV),n(4532);var dG=n(8183),dK=n.n(dG),dJ=n(4867),dX=n.n(dJ);n(3472);class dQ{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 dZ(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){let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>dZ(e[n],t[n]))}return!1}class d0{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=>d0._evalValuePredicate(e.name,t)))&&(!this.attributes||d0._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!d0._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?d0._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||d0._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=>d0._evalPredicate(e,t)),...(null!=(r=t.groups)?r:[]).map(t=>d0._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=>d0._collectNames(e))]}}d0._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var d1=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 d2=n(4461);class d4{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=d4._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=md.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 d1(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 d1(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 d1(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 d1(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 d1(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 dQ,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(()=>d1(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 d1(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield md.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&&d4._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 d1(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:d2.name,version:d2.version,platform:d2.os.toString(),apps:[],model:((d2.manufacturer?d2.manufacturer+" ":"")+(d2.product?d2.product:"")).trim()}}_initialiseProvider(e){return d1(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 d3(e,t){return function(){return e.apply(t,arguments)}}let{toString:d5}=Object.prototype,{getPrototypeOf:d6}=Object,{iterator:d8,toStringTag:d7}=Symbol,d9=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),le=(e,t)=>{let n=e,o=[];for(;null!=n&&n!==Object.prototype&&-1===o.indexOf(n);){if(o.push(n),d9(n,t))return!0;n=d6(n)}return!1},lt=(i=Object.create(null),e=>{let t=d5.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())}),ln=e=>(e=e.toLowerCase(),t=>lt(t)===e),lo=e=>t=>typeof t===e,{isArray:lr}=Array,li=lo("undefined");function la(e){return null!==e&&!li(e)&&null!==e.constructor&&!li(e.constructor)&&ll(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let ls=ln("ArrayBuffer"),ld=lo("string"),ll=lo("function"),lc=lo("number"),lu=e=>null!==e&&"object"==typeof e,lm=e=>{if(!lu(e))return!1;let t=d6(e);return(null===t||t===Object.prototype||null===d6(t))&&!le(e,d7)&&!le(e,d8)},lf=ln("Date"),lh=ln("File"),lb=ln("Blob"),lp=ln("FileList"),l_="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lg=void 0!==l_.FormData?l_.FormData:void 0,lF=ln("URLSearchParams"),[ly,lv,lw,lk]=["ReadableStream","Request","Response","Headers"].map(ln);function lE(e,t,{allOwnKeys:n=!1}={}){let o,r;if(null!=e)if("object"!=typeof e&&(e=[e]),lr(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{let r;if(la(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 lD(e,t){let n;if(la(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 lM="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lL=e=>!li(e)&&e!==lM,lC=(a="u">typeof Uint8Array&&d6(Uint8Array),e=>a&&e instanceof a),lA=ln("HTMLFormElement"),{propertyIsEnumerable:lT}=Object.prototype,lx=ln("RegExp"),lS=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),o={};lE(n,(n,r)=>{let i;!1!==(i=t(n,r,e))&&(o[r]=i||n)}),Object.defineProperties(e,o)},lY=ln("AsyncFunction"),lO=(l="function"==typeof setImmediate,c=ll(lM.postMessage),l?setImmediate:c?(u=`axios@${Math.random()}`,m=[],lM.addEventListener("message",({source:e,data:t})=>{e===lM&&t===u&&m.length&&m.shift()()},!1),e=>{m.push(e),lM.postMessage(u,"*")}):e=>setTimeout(e)),lI="u">typeof queueMicrotask?queueMicrotask.bind(lM):"u">typeof process&&process.nextTick||lO,lP=e=>null!=e&&ll(e[d8]),lB={isArray:lr,isArrayBuffer:ls,isBuffer:la,isFormData:e=>{if(!e)return!1;if(lg&&e instanceof lg)return!0;let t=d6(e);if(!t||t===Object.prototype||!ll(e.append))return!1;let n=lt(e);return"formdata"===n||"object"===n&&ll(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ls(e.buffer)},isString:ld,isNumber:lc,isBoolean:e=>!0===e||!1===e,isObject:lu,isPlainObject:lm,isEmptyObject:e=>{if(!lu(e)||la(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ly,isRequest:lv,isResponse:lw,isHeaders:lk,isUndefined:li,isDate:lf,isFile:lh,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lb,isRegExp:lx,isFunction:ll,isStream:e=>lu(e)&&ll(e.pipe),isURLSearchParams:lF,isTypedArray:lC,isFileList:lp,forEach:lE,merge:function e(...t){let{caseless:n,skipUndefined:o}=lL(this)&&this||{},r={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;let a=n&&"string"==typeof i&&lD(r,i)||i,s=d9(r,a)?r[a]:void 0;lm(s)&&lm(t)?r[a]=e(s,t):lm(t)?r[a]=e({},t):lr(t)?r[a]=t.slice():o&&li(t)||(r[a]=t)};for(let e=0,n=t.length;e<n;e++){let n=t[e];if(!n||la(n)||(lE(n,i),"object"!=typeof n||lr(n)))continue;let o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){let t=o[e];lT.call(n,t)&&i(n[t],t)}}return r},extend:(e,t,n,{allOwnKeys:o}={})=>(lE(t,(t,o)=>{n&&ll(t)?Object.defineProperty(e,o,{__proto__:null,value:d3(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&&d6(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:lt,kindOfTest:ln,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(lr(e))return e;let t=e.length;if(!lc(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,o=(e&&e[d8]).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:lA,hasOwnProperty:d9,hasOwnProp:d9,hasOwnInPrototypeChain:le,getSafeProp:(e,t)=>null!=e&&le(e,t)?e[t]:void 0,reduceDescriptors:lS,freezeMethods:e=>{lS(e,(t,n)=>{if(ll(e)&&["arguments","caller","callee"].includes(n))return!1;if(ll(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(lr(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:lD,global:lM,isContextDefined:lL,isSpecCompliantForm:function(e){return!!(e&&ll(e.append)&&"FormData"===e[d7]&&e[d8])},toJSONObject:e=>{let t=new WeakSet,n=e=>{if(lu(e)){if(t.has(e))return;if(la(e))return e;if(!("toJSON"in e)){t.add(e);let o=lr(e)?[]:{};return lE(e,(e,t)=>{let r=n(e);li(r)||(o[t]=r)}),t.delete(e),o}}return e};return n(e)},isAsyncFn:lY,isThenable:e=>e&&(lu(e)||ll(e))&&ll(e.then)&&ll(e.catch),setImmediate:lO,asap:lI,isIterable:lP,isSafeIterable:e=>null!=e&&le(e,d8)&&lP(e)},lR=lB.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"]),lN=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lj=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function lH(e,t){return lB.isArray(e)?e.map(e=>lH(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 lU(e){let t=Object.create(null);return lB.forEach(e.toJSON(),(e,n)=>{t[n]=lH(e,lj)}),t}let lz=Symbol("internals");function lW(e){return e&&String(e).trim().toLowerCase()}function l$(e){return!1===e||null==e?e:lB.isArray(e)?e.map(l$):lH(String(e),lN)}function lV(e,t,n,o,r){if(lB.isFunction(o))return o.call(this,t,n);if(r&&(t=n),lB.isString(t)){if(lB.isString(o))return -1!==t.indexOf(o);if(lB.isRegExp(o))return o.test(t)}}class lq{constructor(e){e&&this.set(e)}set(e,t,n){let o=this;function r(e,t,n){let r=lW(t);if(!r)return;let i=lB.findKey(o,r);i&&void 0!==o[i]&&!0!==n&&(void 0!==n||!1===o[i])||(o[i||t]=l$(e))}let i=(e,t)=>lB.forEach(e,(e,n)=>r(e,n,t));if(lB.isPlainObject(e)||e instanceof this.constructor)i(e,t);else{let o;if(lB.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]&&lR[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(lB.isObject(e)&&lB.isSafeIterable(e)){let n=Object.create(null),o,r;for(let t of e){if(!lB.isArray(t))throw TypeError("Object iterator must return a key-value pair");r=t[0],lB.hasOwnProp(n,r)?(o=n[r],n[r]=lB.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=lW(e)){let n=lB.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(lB.isFunction(t))return t.call(this,e,n);if(lB.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=lW(e)){let n=lB.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||lV(this,this[n],n,t)))}return!1}delete(e,t){let n=this,o=!1;function r(e){if(e=lW(e)){let r=lB.findKey(n,e);r&&(!t||lV(n,n[r],r,t))&&(delete n[r],o=!0)}}return lB.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||lV(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){let t=this,n={};return lB.forEach(this,(o,r)=>{let i=lB.findKey(n,r);if(i){t[i]=l$(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]=l$(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return lB.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&lB.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[lz]=this[lz]={accessors:{}}).accessors,n=this.prototype;function o(e){let o=lW(e);if(!t[o]){let r;r=lB.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 lB.isArray(e)?e.forEach(o):o(e),this}}lq.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lB.reduceDescriptors(lq.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),lB.freezeMethods(lq);class lG extends Error{static from(e,t,n,o,r,i){let a=new lG(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&&lB.hasOwnProp(o,"redact")?o.redact:void 0,i=lB.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||lB.isBuffer(o))return o;if(-1===t.indexOf(o)){if(o instanceof lq&&(o=o.toJSON()),t.push(o),lB.isArray(o))r=[],o.forEach((e,t)=>{let o=n(e);lB.isUndefined(o)||(r[t]=o)});else{if(!lB.isPlainObject(o)&&function(e){if(lB.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lB.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);lB.isUndefined(o)||(r[t]=o)}}return t.pop(),r}})(o)):lB.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}}}lG.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",lG.ERR_BAD_OPTION="ERR_BAD_OPTION",lG.ECONNABORTED="ECONNABORTED",lG.ETIMEDOUT="ETIMEDOUT",lG.ECONNREFUSED="ECONNREFUSED",lG.ERR_NETWORK="ERR_NETWORK",lG.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",lG.ERR_DEPRECATED="ERR_DEPRECATED",lG.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",lG.ERR_BAD_REQUEST="ERR_BAD_REQUEST",lG.ERR_CANCELED="ERR_CANCELED",lG.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",lG.ERR_INVALID_URL="ERR_INVALID_URL",lG.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let lK=lG;function lJ(e){return lB.isPlainObject(e)||lB.isArray(e)}function lX(e){return lB.endsWith(e,"[]")?e.slice(0,-2):e}function lQ(e,t,n){return e?e.concat(t).map(function(e,t){return e=lX(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let lZ=lB.toFlatObject(lB,{},null,function(e){return/^is[A-Z]/.test(e)}),l0=function(e,t,n){if(!lB.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let o=(n=lB.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!lB.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&&lB.isSpecCompliantForm(t),c=[];if(!lB.isFunction(r))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(lB.isDate(e))return e.toISOString();if(lB.isBoolean(e))return e.toString();if(!l&&lB.isBlob(e))throw new lK("Blob is not supported. Use a Buffer instead.");if(lB.isArrayBuffer(e)||lB.isTypedArray(e)){if(l&&"function"==typeof s)return new s([e]);if("u">typeof Buffer)return Buffer.from(e);throw new lK("Blob is not supported. Use a Buffer instead.",lK.ERR_NOT_SUPPORT)}return e}function m(e){if(e>d)throw new lK("Object is too deeply nested ("+e+" levels). Max depth: "+d,lK.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(e,n,r){let s=e;if(lB.isReactNative(t)&&lB.isReactNativeBlob(e))return t.append(lQ(r,n,i),u(e)),!1;if(e&&!r&&"object"==typeof e)if(lB.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(!lB.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(lB.isArray(e)&&(l=e,lB.isArray(l)&&!l.some(lJ))||(lB.isFileList(e)||lB.endsWith(n,"[]"))&&(s=lB.toArray(e)))return n=lX(n),s.forEach(function(e,o){lB.isUndefined(e)||null===e||t.append(!0===a?lQ([n],o,i):null===a?n:n+"[]",u(e))}),!1}return!!lJ(e)||(t.append(lQ(r,n,i),u(e)),!1)}let h=Object.assign(lZ,{defaultVisitor:f,convertValue:u,isVisitable:lJ});if(!lB.isObject(e))throw TypeError("data must be an object");return!function e(n,o,i=0){if(!lB.isUndefined(n)){if(m(i),-1!==c.indexOf(n))throw Error("Circular reference detected in "+o.join("."));c.push(n),lB.forEach(n,function(n,a){!0===(!(lB.isUndefined(n)||null===n)&&r.call(t,n,lB.isString(a)?a.trim():a,o,h))&&e(n,o?o.concat(a):[a],i+1)}),c.pop()}}(e),t};function l1(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function l2(e,t){this._pairs=[],e&&l0(e,this,t)}let l4=l2.prototype;function l3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l5(e,t,n){let o;if(!t)return e;e=e||"";let r=lB.isFunction(n)?{serialize:n}:n,i=lB.getSafeProp(r,"encode")||l3,a=lB.getSafeProp(r,"serialize");if(o=a?a(t,r):lB.isURLSearchParams(t)?t.toString():new l2(t,r).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}l4.append=function(e,t){this._pairs.push([e,t])},l4.toString=function(e){let t=e?t=>e.call(this,t,l1):l1;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let l6=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){lB.forEach(this.handlers,function(t){null!==t&&e(t)})}},l8={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},l7="u">typeof URLSearchParams?URLSearchParams:l2,l9="u">typeof FormData?FormData:null,ce="u">typeof Blob?Blob:null,ct="u">typeof window&&"u">typeof document,cn="object"==typeof navigator&&navigator||void 0,co=ct&&(!cn||0>["ReactNative","NativeScript","NS"].indexOf(cn.product)),cr="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ci=ct&&window.location.href||"http://localhost",ca={...tT,isBrowser:!0,classes:{URLSearchParams:l7,FormData:l9,Blob:ce},protocols:["http","https","file","blob","url","data"]};function cs(e){if(e>100)throw new lK("FormData field is too deeply nested ("+e+" levels). Max depth: 100",lK.ERR_FORM_DATA_DEPTH_EXCEEDED)}let cd=function(e){if(lB.isFormData(e)&&lB.isFunction(e.entries)){let t={};return lB.forEachEntry(e,(e,n)=>{!function e(t,n,o,r){cs(r);let i=t[r++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),s=r>=t.length;return(i=!i&&lB.isArray(o)?o.length:i,s)?lB.hasOwnProp(o,i)?o[i]=lB.isArray(o[i])?o[i].concat(n):[o[i],n]:o[i]=n:(lB.hasOwnProp(o,i)&&lB.isObject(o[i])||(o[i]=[]),e(t,n,o[i],r)&&lB.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));)cs(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),n,t,0)}),t}return null},cl=(e,t)=>null!=e&&lB.hasOwnProp(e,t)?e[t]:void 0,cc={transitional:l8,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,o=t.getContentType()||"",r=o.indexOf("application/json")>-1,i=lB.isObject(e);if(i&&lB.isHTMLForm(e)&&(e=new FormData(e)),lB.isFormData(e))return r?JSON.stringify(cd(e)):e;if(lB.isArrayBuffer(e)||lB.isBuffer(e)||lB.isStream(e)||lB.isFile(e)||lB.isBlob(e)||lB.isReadableStream(e))return e;if(lB.isArrayBufferView(e))return e.buffer;if(lB.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){let t=cl(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return l0(e,new ca.classes.URLSearchParams,{visitor:function(e,t,n,o){return ca.isNode&&lB.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t}).toString();if((n=lB.isFileList(e))||o.indexOf("multipart/form-data")>-1){let o=cl(this,"env"),r=o&&o.FormData;return l0(n?{"files[]":e}:e,r&&new r,t)}}if(i||r){t.setContentType("application/json",!1);var a=e;if(lB.isString(a))try{return(0,JSON.parse)(a),lB.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=cl(this,"transitional")||cc.transitional,n=t&&t.forcedJSONParsing,o=cl(this,"responseType"),r="json"===o;if(lB.isResponse(e)||lB.isReadableStream(e))return e;if(e&&lB.isString(e)&&(n&&!o||r)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,cl(this,"parseReviver"))}catch(e){if(!n&&r){if("SyntaxError"===e.name)throw lK.from(e,lK.ERR_BAD_RESPONSE,this,null,cl(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ca.classes.FormData,Blob:ca.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function cu(e,t){let n=this||cc,o=t||n,r=lq.from(o.headers),i=o.data;return lB.forEach(e,function(e){i=e.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function cm(e){return!!(e&&e.__CANCEL__)}lB.forEach(["delete","get","head","post","put","patch","query"],e=>{cc.headers[e]={}});let cf=class extends lK{constructor(e,t,n){super(null==e?"canceled":e,lK.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function ch(e,t,n){let o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new lK("Request failed with status code "+n.status,n.status>=400&&n.status<500?lK.ERR_BAD_REQUEST:lK.ERR_BAD_RESPONSE,n.config,n.request,n))}let cb=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}},cp=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)]},c_=(e,t,n=3)=>{let o=0,r=cb(50,250);return cp(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)},cg=(e,t)=>{let n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},cF=e=>(...t)=>lB.asap(()=>e(...t)),cy=ca.hasStandardBrowserEnv?(s=new URL(ca.origin),d=ca.navigator&&/(msie|trident)/i.test(ca.navigator.userAgent),e=>(e=new URL(e,ca.origin),s.protocol===e.protocol&&s.host===e.host&&(d||s.port===e.port))):()=>!0,cv=ca.hasStandardBrowserEnv?{write(e,t,n,o,r,i,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];lB.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),lB.isString(o)&&s.push(`path=${o}`),lB.isString(r)&&s.push(`domain=${r}`),!0===i&&s.push("secure"),lB.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(){}},cw=/^https?:(?!\/\/)/i,ck=/[\t\n\r]/g;function cE(e,t){if("string"==typeof e&&cw.test((function(e){let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t)})(e).replace(ck,"")))throw new lK('Invalid URL: missing "//" after protocol',lK.ERR_INVALID_URL,t)}function cD(e,t,n,o){cE(t,o);let r=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(r||!1===n)?(cE(e,o),t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e):t}let cM=e=>e instanceof lq?{...e}:e;function cL(e,t){e=e||{},t=t||{};let n=Object.create(null);function o(e,t,n,o){return lB.isPlainObject(e)&&lB.isPlainObject(t)?lB.merge.call({caseless:o},e,t):lB.isPlainObject(t)?lB.merge({},t):lB.isArray(t)?t.slice():t}function r(e,t,n,r){return lB.isUndefined(t)?lB.isUndefined(e)?void 0:o(void 0,e,n,r):o(e,t,n,r)}function i(e,t){if(!lB.isUndefined(t))return o(void 0,t)}function a(e,t){return lB.isUndefined(t)?lB.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function s(n,r,i){return lB.hasOwnProp(t,i)?o(n,r):lB.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(cM(e),cM(t),n,!0)};return lB.forEach(Object.keys({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;let i=lB.hasOwnProp(d,o)?d[o]:r,a=i(lB.hasOwnProp(e,o)?e[o]:void 0,lB.hasOwnProp(t,o)?t[o]:void 0,o);lB.isUndefined(a)&&i!==s||(n[o]=a)}),lB.hasOwnProp(t,"validateStatus")&&lB.isUndefined(t.validateStatus)&&!1===function(n){let o=lB.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!lB.isUndefined(o)){if(!lB.isPlainObject(o))return;else if(lB.hasOwnProp(o,n))return o[n]}let r=lB.hasOwnProp(e,"transitional")?e.transitional:void 0;if(lB.isPlainObject(r)&&lB.hasOwnProp(r,n))return r[n]}("validateStatusUndefinedResolves")&&(lB.hasOwnProp(e,"validateStatus")?n.validateStatus=o(void 0,e.validateStatus):delete n.validateStatus),n}let cC=["content-type","content-length"],cA=function(e){let t=cL({},e),n=e=>lB.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=lq.from(s),t.url=l5(cD(l,u,c,t),n("params"),n("paramsSerializer")),d){let t=lB.getSafeProp(d,"username")||"",n=lB.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 lK.from(t,lK.ERR_BAD_OPTION_VALUE,e)}}if(lB.isFormData(o))if(ca.hasStandardBrowserEnv||ca.hasStandardBrowserWebWorkerEnv||lB.isReactNative(o))s.setContentType(void 0);else{var m,f;lB.isFunction(o.getHeaders)&&(m=s,f=o.getHeaders(),"content-only"!==n("formDataHeaderPolicy")?m.set(f):Object.entries(f||{}).forEach(([e,t])=>{cC.includes(e.toLowerCase())&&m.set(e,t)}))}if(ca.hasStandardBrowserEnv&&(lB.isFunction(r)&&(r=r(t)),!0===r||null==r&&cy(t.url))){let e=i&&a&&cv.read(a);e&&s.set(i,e)}return t},cT="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var o;let r,i,a,s,d,l,c=cA(e),u=c.data,m=lq.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=lq.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());ch(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 lK("Request aborted",lK.ECONNABORTED,e,_)),p(),_=null)},_.onerror=function(t){let o=new lK(t&&t.message?t.message:"Network Error",lK.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||l8;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new lK(t,o.clarifyTimeoutError?lK.ETIMEDOUT:lK.ECONNABORTED,e,_)),p(),_=null},void 0===u&&m.setContentType(null),"setRequestHeader"in _&&lB.forEach(lU(m),function(e,t){_.setRequestHeader(t,e)}),lB.isUndefined(c.withCredentials)||(_.withCredentials=!!c.withCredentials),f&&"json"!==f&&(_.responseType=c.responseType),b&&([a,d]=c_(b,!0),_.addEventListener("progress",a)),h&&_.upload&&([i,s]=c_(h),_.upload.addEventListener("progress",i),_.upload.addEventListener("loadend",s)),(c.cancelToken||c.signal)&&(r=t=>{_&&(n(!t||t.type?new cf(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&&!ca.protocols.includes(F)){n(new lK("Unsupported protocol "+F+":",lK.ERR_BAD_REQUEST,e)),p();return}_.send(u||null)})},cx=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},cS=async function*(e,t){for await(let n of cY(e))yield*cx(n,t)},cY=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()}},cO=(e,t,n,o)=>{let r,i=cS(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})},cI=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cP=(e,t,n)=>t+2<n&&cI(e.charCodeAt(t+1))&&cI(e.charCodeAt(t+2)),{isFunction:cB}=lB,cR=e=>{if(!lB.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},cN=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cj=e=>{let t,n=void 0!==lB.global&&null!==lB.global?lB.global:globalThis,{ReadableStream:o,TextEncoder:r}=n,{fetch:i,Request:a,Response:s}=e=lB.merge.call({skipUndefined:!0},{Request:n.Request,Response:n.Response},e),d=i?cB(i):"function"==typeof fetch,l=cB(a),c=cB(s);if(!d)return!1;let u=d&&cB(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&&cN(()=>{let e=!1,t=new a(ca.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&&cN(()=>lB.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 lK(`Response type '${e}' is not supported`,lK.ERR_NOT_SUPPORT,n)})});let p=async e=>{if(null==e)return 0;if(lB.isBlob(e))return e.size;if(lB.isSpecCompliantForm(e)){let t=new a(ca.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return lB.isArrayBufferView(e)||lB.isArrayBuffer(e)?e.byteLength:(lB.isURLSearchParams(e)&&(e+=""),lB.isString(e))?(await m(e)).byteLength:void 0},_=async(e,t)=>{let n=lB.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}=cA(e),L=lB.isNumber(D)&&D>-1,C=lB.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 lK?t:new cf(t instanceof Error?t.message:t))}},i=t&&setTimeout(()=>{i=null,r(new lK(`timeout of ${t}ms exceeded`,lK.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=()=>lB.asap(a),s})([c,m&&m.toAbortSignal()],g),x=null,S=T&&T.unsubscribe&&(()=>{T.unsubscribe()}),Y=null,O=()=>new lK("Request body larger than maxBodyLength limit",lK.ERR_BAD_REQUEST,e,x);try{var I;let i,c,m,g,P=(c="auth",lB.hasOwnProp(e,c)?e[c]:void 0);if(P){let e=lB.getSafeProp(P,"username")||"",t=lB.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,ca.origin);if(!i&&(e.username||e.password)){let t=cR(e.username),n=cR(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);cI(t)&&cI(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&&cP(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 lK("maxContentLength size of "+D+" exceeded",lK.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&&(lB.isReadableStream(d)||lB.isStream(d)),R=(e,t,n)=>cO(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(lB.isFormData(d)&&(e=o.headers.get("content-type"))&&w.setContentType(e),o.body){let[e,n]=y&&cg(t,c_(cF(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 lK("Stream request bodies are not supported by the current fetch implementation",lK.ERR_NOT_SUPPORT,e,x);lB.isString(k)||(k=k?"include":"omit");let N=l&&"credentials"in a.prototype;if(lB.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:lU(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=lq.from(H.headers);if(L){let t=lB.toFiniteNumber(U.getContentLength());if(null!=t&&t>D)throw new lK("maxContentLength size of "+D+" exceeded",lK.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=lB.toFiniteNumber(U.getContentLength()),[o,r]=F&&cg(n,c_(cF(F),!0))||[];H=new s(cO(H.body,65536,t=>{if(L&&t>D)throw new lK("maxContentLength size of "+D+" exceeded",lK.ERR_BAD_RESPONSE,e,x);o&&o(t)},()=>{r&&r(),S&&S()}),t)}v=v||"text";let W=await b[lB.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 lK("maxContentLength size of "+D+" exceeded",lK.ERR_BAD_RESPONSE,e,x)}return!z&&S&&S(),await new Promise((t,n)=>{ch(t,n,{data:W,headers:lq.from(H.headers),status:H.status,statusText:H.statusText,config:e,request:x})})}catch(t){if(S&&S(),T&&T.aborted&&T.reason instanceof lK){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 lK)throw x&&!t.request&&(t.request=x),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let n=new lK("Network Error",lK.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 lK.from(t,t&&t.code,e,x,t&&t.response)}}},cH=new Map,cU=e=>{let t=e&&e.env||{},{fetch:n,Request:o,Response:r}=t,i=[o,r,n],a=i.length,s,d,l=cH;for(;a--;)s=i[a],void 0===(d=l.get(s))&&l.set(s,d=a?new Map:cj(t)),l=d;return d};cU();let cz={http:null,xhr:cT,fetch:{get:cU}};lB.forEach(cz,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let cW=e=>`- ${e}`,c$=e=>lB.isFunction(e)||null===e||!1===e,cV=function(e,t){let n,o,{length:r}=e=lB.isArray(e)?e:[e],i={};for(let a=0;a<r;a++){let r;if(o=n=e[a],!c$(n)&&void 0===(o=cz[(r=String(n)).toLowerCase()]))throw new lK(`Unknown adapter '${r}'`);if(o&&(lB.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 lK("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(cW).join("\n"):" "+cW(e[0]):"as no adapter specified"),lK.ERR_NOT_SUPPORT)}return o};function cq(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cf(null,e)}function cG(e){return cq(e),e.headers=lq.from(e.headers),e.data=cu.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cV(e.adapter||cc.adapter,e)(e).then(function(t){cq(e),e.response=t;try{t.data=cu.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lq.from(t.headers),t},function(t){if(!cm(t)&&(cq(e),t&&t.response)){e.response=t.response;try{t.response.data=cu.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lq.from(t.response.headers)}return Promise.reject(t)})}let cK={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cK[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let cJ={};cK.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 lK(o(r," has been removed"+(t?" in "+t:"")),lK.ERR_DEPRECATED);return t&&!cJ[r]&&(cJ[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)}},cK.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let cX=function(e,t,n){if("object"!=typeof e||null===e)throw new lK("options must be an object",lK.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 lK("option "+i+" must be "+n,lK.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new lK("Unknown option "+i,lK.ERR_BAD_OPTION)}};class cQ{constructor(e){this.defaults=e||{},this.interceptors={request:new l6,response:new l6}}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=cL(this.defaults,t);void 0!==r&&cX(r,{silentJSONParsing:cK.transitional(cK.boolean),forcedJSONParsing:cK.transitional(cK.boolean),clarifyTimeoutError:cK.transitional(cK.boolean),legacyInterceptorReqResOrdering:cK.transitional(cK.boolean),advertiseZstdAcceptEncoding:cK.transitional(cK.boolean),validateStatusUndefinedResolves:cK.transitional(cK.boolean)},!1),null!=i&&(lB.isFunction(i)?t.paramsSerializer={serialize:i}:cX(i,{encode:cK.function,serialize:cK.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cX(t,{baseUrl:cK.spelling("baseURL"),withXsrfToken:cK.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&lB.merge(a.common,a[t.method]);a&&lB.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete a[e]}),t.headers=lq.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||l8;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=[cG.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=cG.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 l5(cD((e=cL(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}lB.forEach(["delete","get","head","options"],function(e){cQ.prototype[e]=function(t,n){return this.request(cL(n||{},{method:e,url:t,data:n&&lB.hasOwnProp(n,"data")?n.data:void 0}))}}),lB.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,r){return this.request(cL(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}cQ.prototype[e]=t(),"query"!==e&&(cQ.prototype[e+"Form"]=t(!0))});class cZ{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 cf(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 cZ(function(t){e=t}),cancel:e}}}let c0={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(c0).forEach(([e,t])=>{c0[t]=e});let c1=function e(t){let n=new cQ(t),o=d3(cQ.prototype.request,n);return lB.extend(o,cQ.prototype,n,{allOwnKeys:!0}),lB.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(cL(t,n))},o}(cc);c1.Axios=cQ,c1.CanceledError=cf,c1.CancelToken=cZ,c1.isCancel=cm,c1.VERSION="1.18.1",c1.toFormData=l0,c1.AxiosError=lK,c1.Cancel=c1.CanceledError,c1.all=function(e){return Promise.all(e)},c1.spread=function(e){return function(t){return e.apply(null,t)}},c1.isAxiosError=function(e){return lB.isObject(e)&&!0===e.isAxiosError},c1.mergeConfig=cL,c1.AxiosHeaders=lq,c1.formToJSON=e=>cd(lB.isHTMLForm(e)?new FormData(e):e),c1.getAdapter=cV,c1.HttpStatusCode=c0,c1.default=c1;class c2{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:uh`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`asset/predicted/${e}/${t}`,data:n,options:o})}}class c4{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:uh`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:uh`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:uh`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:uh`configuration/manager/image/${e}`,options:t})}}class c3{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:uh`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:uh`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:uh`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:uh`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,r){return this.httpClient.request({method:"GET",url:uh`gateway/tunnel/${e}/${t}/${n}/${o}`,options:r})}}class c5{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:uh`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:uh`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:uh`asset/datapoint/${e}/${t}`,data:n,options:o})}}class c6{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:uh`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:uh`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:uh`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:uh`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:uh`notification/${e}/delivered`,queryParams:t,options:n})}}class c8{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:uh`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:uh`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:uh`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:uh`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:uh`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:uh`gateway/status/${e}`,options:t})}}class c7{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:uh`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:uh`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:uh`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:uh`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:uh`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:uh`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:uh`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:uh`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:uh`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:uh`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:uh`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:uh`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:uh`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:uh`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:uh`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:uh`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:uh`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`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:uh`asset/${e}/attribute/${t}/${n}`,data:o,options:r})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:uh`asset/${e}/child`,queryParams:t,options:n})}}class c9{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:uh`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:uh`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:uh`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:uh`map/getCustomMapInfo`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:uh`map/tile/${e}/${t}/${n}`,options:o})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:uh`map/upload`,queryParams:e,options:t})}}class ue{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:uh`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:uh`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:uh`apps/info`,options:e})}}class ut{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:uh`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:uh`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:uh`flow/${e}`,options:t})}}class un{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:uh`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:uh`info`,options:e})}}class uo{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:uh`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:uh`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:uh`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:uh`provisioning/${e}`,data:t,options:n})}}class ur{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:uh`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:uh`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:uh`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:uh`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:uh`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:uh`realm/${e}`,data:t,options:n})}}class ui{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:uh`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:uh`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:uh`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:uh`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:uh`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:uh`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:uh`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:uh`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:uh`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:uh`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:uh`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:uh`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:uh`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:uh`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:uh`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:uh`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:uh`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:uh`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:uh`rules/${e}`,data:t,options:n})}}class ua{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:uh`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:uh`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:uh`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:uh`syslog/event`,queryParams:e,options:t})}}class us{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:uh`console/register`,data:e,options:t})}}class ud{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:uh`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:uh`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:uh`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:uh`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:uh`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:uh`model/valueDescriptors`,queryParams:e,options:t})}}class ul{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:uh`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:uh`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:uh`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:uh`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:uh`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:uh`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:uh`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:uh`alarm/${e}/assets`,queryParams:t,options:n})}}class uc{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:uh`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:uh`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:uh`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:uh`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:uh`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:uh`dashboard/${e}/${t}`,options:n})}}class uu{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:uh`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:uh`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:uh`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class um{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:uh`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:uh`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:uh`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:uh`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:uh`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:uh`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:uh`service/${e}/${t}`,options:n})}}class uf{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:uh`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:uh`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:uh`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:uh`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:uh`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:uh`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:uh`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:uh`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:uh`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:uh`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:uh`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:uh`user/${e}/userRoles/${t}/${n}`,data:o,options:r})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:uh`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:uh`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:uh`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:uh`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:uh`user/${e}/${t}`,options:n})}}function uh(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 ub{constructor(e,t=c1.create()){this._assetPredictedDatapointResource=new u_(e,t),this._configurationResource=new ug(e,t),this._gatewayServiceResource=new uF(e,t),this._assetDatapointResource=new uy(e,t),this._notificationResource=new uv(e,t),this._gatewayClientResource=new uw(e,t),this._assetResource=new uk(e,t),this._mapResource=new uE(e,t),this._appResource=new uD(e,t),this._flowResource=new uM(e,t),this._statusResource=new uL(e,t),this._provisioningResource=new uC(e,t),this._realmResource=new uA(e,t),this._rulesResource=new uT(e,t),this._syslogResource=new ux(e,t),this._consoleResource=new uS(e,t),this._assetModelResource=new uY(e,t),this._alarmResource=new uO(e,t),this._dashboardResource=new uI(e,t),this._agentResource=new uP(e,t),this._externalServiceResource=new uB(e,t),this._userResource=new uR(e,t),this._assetResource=new uk(e,t)}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get ConfigurationResource(){return this._configurationResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AssetDatapointResource(){return this._assetDatapointResource}get NotificationResource(){return this._notificationResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetResource(){return this._assetResource}get MapResource(){return this._mapResource}get AppResource(){return this._appResource}get FlowResource(){return this._flowResource}get StatusResource(){return this._statusResource}get ProvisioningResource(){return this._provisioningResource}get RealmResource(){return this._realmResource}get RulesResource(){return this._rulesResource}get SyslogResource(){return this._syslogResource}get ConsoleResource(){return this._consoleResource}get AssetModelResource(){return this._assetModelResource}get AlarmResource(){return this._alarmResource}get DashboardResource(){return this._dashboardResource}get AgentResource(){return this._agentResource}get ExternalServiceResource(){return this._externalServiceResource}get UserResource(){return this._userResource}}class up{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 u_ extends c2{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class ug extends c4{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uF extends c3{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uy extends c5{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uv extends c6{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uw extends c8{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uk extends c7{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uE extends c9{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uD extends ue{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uM extends ut{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uL extends un{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uC extends uo{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uA extends ur{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uT extends ui{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class ux extends ua{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uS extends us{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uY extends ud{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uO extends ul{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uI extends uc{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uP extends uu{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uB extends um{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}class uR extends uf{constructor(e,t=c1.create()){t.defaults.baseURL=e,super(new up(t))}}c1.isAxiosError;let uN=new class{get api(){return this._client}constructor(){this._axiosInstance=c1.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>dK().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 ub(e,this._axiosInstance)}};var uj=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())})};(ey=tE||(tE={})).DISCONNECTED="DISCONNECTED",ey.CONNECTED="CONNECTED",ey.CONNECTING="CONNECTING";let uH="SUBSCRIBED:",uU="UNAUTHORIZED:",uz="TRIGGERED:",uW="EVENT:";class u${constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=uV.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tE.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===tE.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(tE.CONNECTING),this._connectingDeferred=new dQ,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=uV.MIN_RECONNECT_DELAY,this._onStatusChanged(tE.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!==tE.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new dQ};return null!=this._pendingSubscription||this._status!==tE.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 uj(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===tE.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tE.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return uj(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,r="AssetEvent"+u$._subscriptionCounter++;if(!this._assetEventPromise){let e;md.authenticated||(e={filterType:"asset",realm:md.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===md.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 uj(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"+u$._subscriptionCounter++;if(!this._attributeEventPromise){let e;md.authenticated||(e={filterType:"asset",realm:md.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===md.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===tE.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===tE.CONNECTED&&this._onStatusChanged(tE.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tE.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<uV.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(uV.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}u$.MIN_RECONNECT_DELAY=0,u$.MAX_RECONNECT_DELAY=3e4,u$._subscriptionCounter=0;class uV extends u${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="+md.config.realm;return this._connectDeferred=new dQ,(md.authenticated?md.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(uH)){let e=JSON.parse(t.substring(uH.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(uU)){let e=JSON.parse(t.substring(uU.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(uz)){let e=JSON.parse(t.substring(uz.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(uW)){let e=JSON.parse(t.substring(uW.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 dQ,e.subscriptionId||(e.subscriptionId=uV._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=uW+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 dQ;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(uW+JSON.stringify(e)),t.promise}}uV._subscriptionCounter=1;let uq=["__proto__","constructor","prototype"];function uG(e){return!("string"!=typeof e||0===e.length||e.length>128||uq.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function uK(e){return!(!uG(e)||e.indexOf("/")>-1)}let uJ={lng:uK,ns:function(e){return uG(e)}};function uX(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function uQ(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let uZ=/\{\{(.+?)\}\}/g;function u0(e,t){let n=!1,o=e.replace(uZ,(e,o)=>{let r=o.trim();if(uq.indexOf(r)>-1)return e;let i=t[r];if(null==i)return e;let a=uJ[r]||uK,s=String(i).split("+");for(let t of s)if(!a(t))return n=!0,e;return s.join("+")});return n?null:o}let u1="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?r=fetch:u1&&"function"==typeof u1.fetch&&(r=u1.fetch);let u2=uQ()&&u1?u1.XMLHttpRequest:void 0,u4="function"==typeof ActiveXObject&&u1?u1.ActiveXObject:void 0,u3=["__proto__","constructor","prototype"],u5=(e,t)=>{if(t&&"object"==typeof t){let n="";for(let e of Object.keys(t))u3.indexOf(e)>-1||(n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},u6=(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)},u8=(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=u5(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{u6(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]}),u6(i,l,s,c),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(uQ()||"function"==typeof ActiveXObject){var d=t,l=n,c=o;l&&"object"==typeof l&&(l=u5("",l).slice(1)),e.queryStringParams&&(d=u5(d,e.queryStringParams));try{let t=u2?new u2:new u4("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))u3.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 u7=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:u8,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=u0(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(uX).join(", ")+"] namespaces=["+n.map(uX).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=uX(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+": "+uX(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=u0(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)})})})}};u7.type="backend";var u9=n(4954);class me extends Error{}function mt(e,t){let n;if("string"!=typeof e)throw new me("Invalid token specified: must be a string");t||(t={});let o=+(!0!==t.header),r=e.split(".")[o];if("string"!=typeof r)throw new me(`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 me(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new me(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}if(me.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function mn(e){if(!(this instanceof mn))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=mt(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=mt(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=mt(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(u9.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 mo=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 mr="openremote";(ev=tD||(tD={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ev.AUTH_FAILED="AUTH_FAILED",ev.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ev.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ev.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ev.TRANSLATION_ERROR="TRANSLATION_ERROR",(ew=tM||(tM={})).ERROR="ERROR",ew.READY="READY",ew.ONLINE="ONLINE",ew.OFFLINE="OFFLINE",ew.CONNECTING="CONNECTING",ew.CONSOLE_INIT="CONSOLE_INIT",ew.CONSOLE_READY="CONSOLE_READY",ew.TRANSLATE_INIT="TRANSLATE_INIT",ew.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",ew.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",ew.LOGIN="LOGIN";let mi={cn:"zh-cn"};class ma{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 uN}get language(){return oz.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(oz.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(tM.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||mr}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 mo(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=mr),t);let n=yield this.loadManagerInfo(),o=new d4(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tM.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(tM.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return mo(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(tD.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return mo(this,void 0,void 0,function*(){if(oz.isInitialized)return!0;oz.on("initialized",e=>{this._emitEvent(tM.TRANSLATE_INIT)}),oz.on("languageChanged",e=>{var t;dX().locale(null!=(t=mi[e])?t:e),this._emitEvent(tM.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?dX()(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 oz.use(u7).init(e)}catch(e){return console.error(e),this._setError(tD.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return mo(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield uN.api.AssetModelResource.getAssetInfos(),t=yield uN.api.AssetModelResource.getMetaItemDescriptors(),n=yield uN.api.AssetModelResource.getValueDescriptors();nH._assetTypeInfos=e.data,nH._metaItemDescriptors=Object.values(t.data),nH._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return mo(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(tD.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(uN.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return uN.setTimeout(2e4),uN.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return mo(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new uV(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tD.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tE.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 tE.DISCONNECTED:this._onDisconnect();break;case tE.CONNECTED:break;case tE.CONNECTING:this._emitEvent(tM.CONNECTING)}}doConsoleInit(){return mo(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tM.CONSOLE_INIT),!0}catch(e){return this._setError(tD.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(n$.addIconSet("mdi",(e=ms.managerUrl,{getIconTemplate:e=>nu`<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)}})),n$.addIconSet("or",{getIconTemplate:e=>{let t=nU[e];return t?nu`
2815
2815
  <svg xmlns="http://www.w3.org/2000/svg"
2816
2816
  viewBox="0 0 ${24} ${24}" preserveAspectRatio="xMidYMid meet" focusable="false">
2817
2817
  ${nP(t.startsWith("<")?t:'<path xmlns="http://www.w3.org/2000/svg" d="'+t+'" />')}