@openremote/or-scheduler 1.26.0 → 1.27.0-snapshot.20260630125512

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