@openremote/or-scheduler 1.25.0-snapshot.20260618120211 → 1.25.0

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