@openremote/core 1.34.0-snapshot.20261104153615 → 1.34.1
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.
- package/build/dist/umd/index.bundle.js +1 -1
- package/build/dist/umd/index.js +1 -1
- package/build/dist/umd/index.orbundle.js +8 -8
- package/build/lib/event.d.ts +19 -0
- package/build/lib/event.d.ts.map +1 -1
- package/build/lib/event.js +1 -1
- package/build/lib/event.js.map +1 -1
- package/build/lib/index.d.ts +11 -0
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +1 -1
- package/build/lib/index.js.map +1 -1
- package/build/lib/util.d.ts +14 -0
- package/build/lib/util.d.ts.map +1 -1
- package/build/lib/util.js +1 -1
- package/build/lib/util.js.map +1 -1
- package/package.json +7 -7
package/build/dist/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ORCore;(()=>{var e={3260(e){"use strict";let t=(async function(){}).constructor;e.exports=()=>t},7052(e){"use strict";let t=(async function*(){}).constructor;e.exports=()=>t},9630(e,t,r){"use strict";var n=r(469),o=r(24),i=r(1530);e.exports=r(7009)||n.call(i,o)},24(e){"use strict";e.exports=Function.prototype.apply},1530(e){"use strict";e.exports=Function.prototype.call},7196(e,t,r){"use strict";var n=r(469),o=r(6757),i=r(1530),s=r(9630);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return s(n,i,e)}},7009(e){"use strict";e.exports="u">typeof Reflect&&Reflect&&Reflect.apply},8682(e,t,r){"use strict";var n=r(4295),o=r(7196),i=o([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o([r]):r}},714(e,t,r){"use strict";var n,o=r(7196),i=r(1233);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&i&&i(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?o([s.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},9997(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},155(e){"use strict";e.exports=EvalError},593(e){"use strict";e.exports=Error},7180(e){"use strict";e.exports=RangeError},9304(e){"use strict";e.exports=ReferenceError},1742(e){"use strict";e.exports=SyntaxError},6757(e){"use strict";e.exports=TypeError},4923(e){"use strict";e.exports=URIError},802(e){"use strict";e.exports=Object},9691(e){"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r},o=function(e,t){for(var r=[],n=t||0,o=0;n<e.length;n+=1,o+=1)r[o]=e[n];return r},i=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};e.exports=function(e){var s,a=this;if("function"!=typeof a||"[object Function]"!==t.apply(a))throw TypeError("Function.prototype.bind called on incompatible "+a);for(var l=o(arguments,1),c=r(0,a.length-l.length),u=[],p=0;p<c;p++)u[p]="$"+p;if(s=Function("binder","return function ("+i(u,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof s){var t=a.apply(this,n(l,arguments));return Object(t)===t?t:this}return a.apply(e,n(l,arguments))}),a.prototype){var d=function(){};d.prototype=a.prototype,s.prototype=new d,d.prototype=null}return s}},469(e,t,r){"use strict";var n=r(9691);e.exports=Function.prototype.bind||n},5175(e){"use strict";let t=(function*(){}).constructor;e.exports=()=>t},4295(e,t,r){"use strict";var n,o=r(802),i=r(593),s=r(155),a=r(7180),l=r(9304),c=r(1742),u=r(6757),p=r(4923),d=r(7256),h=r(5414),f=r(7954),g=r(3452),y=r(1358),m=r(5720),b=r(3515),v=r(1233),_=r(9997),S=function(){throw new u},w=v?function(){try{return arguments.callee,S}catch(e){try{return v(arguments,"callee").get}catch(e){return S}}}():S,k=r(8573)(),E=r(7582),O=r(2170),x=r(9090),A=r(24),R=r(1530),C={},P="u">typeof Uint8Array&&E?E(Uint8Array):n,I={__proto__:null,"%AggregateError%":"u"<typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"u"<typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":k&&E?E([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":"u"<typeof Atomics?n:Atomics,"%BigInt%":"u"<typeof BigInt?n:BigInt,"%BigInt64Array%":"u"<typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"u"<typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"u"<typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"u"<typeof Float16Array?n:Float16Array,"%Float32Array%":"u"<typeof Float32Array?n:Float32Array,"%Float64Array%":"u"<typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"u"<typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":C,"%Int8Array%":"u"<typeof Int8Array?n:Int8Array,"%Int16Array%":"u"<typeof Int16Array?n:Int16Array,"%Int32Array%":"u"<typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&E?E(E([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"u"<typeof Map?n:Map,"%MapIteratorPrototype%":"u">typeof Map&&k&&E?E(new Map()[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"u"<typeof Promise?n:Promise,"%Proxy%":"u"<typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"u"<typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"u"<typeof Set?n:Set,"%SetIteratorPrototype%":"u">typeof Set&&k&&E?E(new Set()[Symbol.iterator]()):n,"%SharedArrayBuffer%":"u"<typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&E?E(""[Symbol.iterator]()):n,"%Symbol%":k?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":w,"%TypedArray%":P,"%TypeError%":u,"%Uint8Array%":"u"<typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"u"<typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"u"<typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"u"<typeof Uint32Array?n:Uint32Array,"%URIError%":p,"%WeakMap%":"u"<typeof WeakMap?n:WeakMap,"%WeakRef%":"u"<typeof WeakRef?n:WeakRef,"%WeakSet%":"u"<typeof WeakSet?n:WeakSet,"%Function.prototype.call%":R,"%Function.prototype.apply%":A,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":O,"%Math.abs%":d,"%Math.floor%":h,"%Math.max%":f,"%Math.min%":g,"%Math.pow%":y,"%Math.round%":m,"%Math.sign%":b,"%Reflect.getPrototypeOf%":x};if(E)try{null.error}catch(e){var T=E(E(e));I["%Error.prototype%"]=T}var N=r(3260),L=r(5175),j=r(7052),U=function e(t){var r;if("%AsyncFunction%"===t)r=N()||void 0;else if("%GeneratorFunction%"===t)r=L()||void 0;else if("%AsyncGeneratorFunction%"===t)r=j()||void 0;else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&E&&(r=E(o.prototype))}return I[t]=r,r},D={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=r(469),F=r(9731),$=M.call(R,Array.prototype.concat),B=M.call(A,Array.prototype.splice),V=M.call(R,String.prototype.replace),K=M.call(R,String.prototype.slice),H=M.call(R,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,q=function(e){var t=K(e,0,1),r=K(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return V(e,W,function(e,t,r,o){n[n.length]=r?V(o,G,"$1"):t||e}),n},z=function(e,t){var r,n=e;if(F(D,n)&&(n="%"+(r=D[n])[0]+"%"),F(I,n)){var o=I[n];if(o===C&&(o=U(n)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=q(e),n=r.length>0?r[0]:"",o=z("%"+n+"%",t),i=o.name,s=o.value,a=!1,l=o.alias;l&&(n=l[0],B(r,$([0,1],l)));for(var p=1,d=!0;p<r.length;p+=1){var h=r[p],f=K(h,0,1),g=K(h,-1);if(('"'===f||"'"===f||"`"===f||'"'===g||"'"===g||"`"===g)&&f!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==h&&d||(a=!0),n+="."+h,F(I,i="%"+n+"%"))s=I[i];else if(null!=s){if(!(h in s)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(v&&p+1>=r.length){var y=v(s,h);s=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:s[h]}else d=F(s,h),s=s[h];d&&!a&&(I[i]=s)}}return s}},2170(e,t,r){"use strict";e.exports=r(802).getPrototypeOf||null},9090(e){"use strict";e.exports="u">typeof Reflect&&Reflect.getPrototypeOf||null},7582(e,t,r){"use strict";var n=r(9090),o=r(2170),i=r(714);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},1067(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},1233(e,t,r){"use strict";var n=r(1067);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8573(e,t,r){"use strict";var n="u">typeof Symbol&&Symbol,o=r(9535);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9535(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9731(e,t,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty;e.exports=r(469).call(n,o)},4954(e,t,r){!function(){"use strict";var t="input is invalid type",n="object"==typeof window,o=n?window:{};o.JS_SHA256_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self,s=!o.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;s?o=r.g:i&&(o=self);var a=!o.JS_SHA256_NO_COMMON_JS&&e.exports,l="function"==typeof define&&define.amd,c=!o.JS_SHA256_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,u="0123456789abcdef".split(""),p=[-0x80000000,8388608,32768,128],d=[24,16,8,0],h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],f=["hex","array","digest","arrayBuffer"],g=[];(o.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),c&&(o.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(r){return new S(t,!0).update(r)[e]()}},m=function(e){var t=y("hex",e);s&&(t=b(t,e)),t.create=function(){return new S(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=y(n,e)}return t},b=function(e,n){var i,s=r(7791),a=r(5610).Buffer,l=n?"sha224":"sha256";return i=a.from&&!o.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(r){if("string"==typeof r)return s.createHash(l).update(r,"utf8").digest("hex");if(null==r)throw Error(t);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?s.createHash(l).update(i(r)).digest("hex"):e(r)}},v=function(e,t){return function(r,n){return new w(r,t,!0).update(n)[e]()}},_=function(e){var t=v("hex",e);t.create=function(t){return new w(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=v(n,e)}return t};function S(e,t){t?(g[0]=g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0,this.blocks=g):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=0xc1059ed8,this.h1=0x367cd507,this.h2=0x3070dd17,this.h3=0xf70e5939,this.h4=0xffc00b31,this.h5=0x68581511,this.h6=0x64f98fa7,this.h7=0xbefa4fa4):(this.h0=0x6a09e667,this.h1=0xbb67ae85,this.h2=0x3c6ef372,this.h3=0xa54ff53a,this.h4=0x510e527f,this.h5=0x9b05688c,this.h6=0x1f83d9ab,this.h7=0x5be0cd19),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function w(e,r,n){var o,i=typeof e;if("string"===i){var s,a=[],l=e.length,u=0;for(o=0;o<l;++o)(s=e.charCodeAt(o))<128?a[u++]=s:(s<2048?a[u++]=192|s>>>6:(s<55296||s>=57344?a[u++]=224|s>>>12:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),a[u++]=240|s>>>18,a[u++]=128|s>>>12&63),a[u++]=128|s>>>6&63),a[u++]=128|63&s);e=a}else if("object"===i){if(null===e)throw Error(t);else if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!c||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);e.length>64&&(e=new S(r,!0).update(e).array());var p=[],d=[];for(o=0;o<64;++o){var h=e[o]||0;p[o]=92^h,d[o]=54^h}S.call(this,r,n),this.update(d),this.oKeyPad=p,this.inner=!0,this.sharedMemory=n}S.prototype.update=function(e){if(!this.finalized){var r,n=typeof e;if("string"!==n){if("object"===n){if(null===e)throw Error(t);else if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!c||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var o,i,s=0,a=e.length,l=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,this.block=l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),r)for(i=this.start;s<a&&i<64;++s)l[i>>>2]|=e[s]<<d[3&i++];else for(i=this.start;s<a&&i<64;++s)(o=e.charCodeAt(s))<128?l[i>>>2]|=o<<d[3&i++]:(o<2048?l[i>>>2]|=(192|o>>>6)<<d[3&i++]:(o<55296||o>=57344?l[i>>>2]|=(224|o>>>12)<<d[3&i++]:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++s)),l[i>>>2]|=(240|o>>>18)<<d[3&i++],l[i>>>2]|=(128|o>>>12&63)<<d[3&i++]),l[i>>>2]|=(128|o>>>6&63)<<d[3&i++]),l[i>>>2]|=(128|63&o)<<d[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=l[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000|0,this.bytes=this.bytes%0x100000000),this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=p[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var e,t,r,n,o,i,s,a,l,c,u=this.h0,p=this.h1,d=this.h2,f=this.h3,g=this.h4,y=this.h5,m=this.h6,b=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((o=v[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=v[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,v[e]=v[e-16]+t+v[e-7]+r|0;for(c=p&d,e=0;e<64;e+=4)this.first?(this.is224?(s=300032,b=(o=v[0]-0x543c9a5b)-0x8f1a6c7|0,f=o+0x170e9b5|0):(s=0x2a01a605,b=(o=v[0]-0xc881298)-0x5ab00ac6|0,f=o+0x8909ae5|0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),n=(s=u&p)^u&d^c,o=b+r+(g&y^~g&m)+h[e]+v[e],i=t+n,b=f+o|0,f=o+i|0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),n=(a=f&u)^f&p^s,o=m+r+(b&g^~b&y)+h[e+1]+v[e+1],i=t+n,m=d+o|0,t=((d=o+i|0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),n=(l=d&f)^d&u^a,o=y+r+(m&b^~m&g)+h[e+2]+v[e+2],i=t+n,y=p+o|0,t=((p=o+i|0)>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),n=(c=p&d)^p&f^l,o=g+r+(y&m^~y&b)+h[e+3]+v[e+3],i=t+n,g=u+o|0,u=o+i|0,this.chromeBugWorkAround=!0;this.h0=this.h0+u|0,this.h1=this.h1+p|0,this.h2=this.h2+d|0,this.h3=this.h3+f|0,this.h4=this.h4+g|0,this.h5=this.h5+y|0,this.h6=this.h6+m|0,this.h7=this.h7+b|0},S.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,l=u[e>>>28&15]+u[e>>>24&15]+u[e>>>20&15]+u[e>>>16&15]+u[e>>>12&15]+u[e>>>8&15]+u[e>>>4&15]+u[15&e]+u[t>>>28&15]+u[t>>>24&15]+u[t>>>20&15]+u[t>>>16&15]+u[t>>>12&15]+u[t>>>8&15]+u[t>>>4&15]+u[15&t]+u[r>>>28&15]+u[r>>>24&15]+u[r>>>20&15]+u[r>>>16&15]+u[r>>>12&15]+u[r>>>8&15]+u[r>>>4&15]+u[15&r]+u[n>>>28&15]+u[n>>>24&15]+u[n>>>20&15]+u[n>>>16&15]+u[n>>>12&15]+u[n>>>8&15]+u[n>>>4&15]+u[15&n]+u[o>>>28&15]+u[o>>>24&15]+u[o>>>20&15]+u[o>>>16&15]+u[o>>>12&15]+u[o>>>8&15]+u[o>>>4&15]+u[15&o]+u[i>>>28&15]+u[i>>>24&15]+u[i>>>20&15]+u[i>>>16&15]+u[i>>>12&15]+u[i>>>8&15]+u[i>>>4&15]+u[15&i]+u[s>>>28&15]+u[s>>>24&15]+u[s>>>20&15]+u[s>>>16&15]+u[s>>>12&15]+u[s>>>8&15]+u[s>>>4&15]+u[15&s];return this.is224||(l+=u[a>>>28&15]+u[a>>>24&15]+u[a>>>20&15]+u[a>>>16&15]+u[a>>>12&15]+u[a>>>8&15]+u[a>>>4&15]+u[15&a]),l},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,l=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o,i>>>24&255,i>>>16&255,i>>>8&255,255&i,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||l.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),l},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},w.prototype=new S,w.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}};var k=m();k.sha256=k,k.sha224=m(!0),k.sha256.hmac=_(),k.sha224.hmac=_(!0),a?e.exports=k:(o.sha256=k.sha256,o.sha224=k.sha224,l&&define(function(){return k}))}()},3472(e,t,r){e=r.nmd(e);var n,o="__lodash_hash_undefined__",i="[object Arguments]",s="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",p="[object Map]",d="[object Number]",h="[object Object]",f="[object Promise]",g="[object RegExp]",y="[object Set]",m="[object String]",b="[object Symbol]",v="[object WeakMap]",_="[object ArrayBuffer]",S="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/,E=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,x=/\\(\\)?/g,A=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[i]=C[s]=C[_]=C[a]=C[S]=C[l]=C[c]=C[u]=C[p]=C[d]=C[h]=C[g]=C[y]=C[m]=C[v]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,I="object"==typeof self&&self&&self.Object===Object&&self,T=P||I||Function("return this")(),N=t&&!t.nodeType&&t,L=N&&e&&!e.nodeType&&e,j=L&&L.exports===N&&P.process,U=function(){try{return j&&j.binding("util")}catch(e){}}(),D=U&&U.isTypedArray;function M(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function F(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function $(e,t){return function(r){return e(t(r))}}function B(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var V=Array.prototype,K=Function.prototype,H=Object.prototype,W=T["__core-js_shared__"],G=(n=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",q=K.toString,z=H.hasOwnProperty,J=H.toString,Y=RegExp("^"+q.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),X=T.Symbol,Q=T.Uint8Array,Z=$(Object.getPrototypeOf,Object),ee=Object.create,et=H.propertyIsEnumerable,er=V.splice,en=$(Object.keys,Object),eo=eP(T,"DataView"),ei=eP(T,"Map"),es=eP(T,"Promise"),ea=eP(T,"Set"),el=eP(T,"WeakMap"),ec=eP(Object,"create"),eu=eD(eo),ep=eD(ei),ed=eD(es),eh=eD(ea),ef=eD(el),eg=X?X.prototype:void 0,ey=eg?eg.valueOf:void 0,em=eg?eg.toString:void 0;function eb(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ev(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function e_(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function eS(e){var t=-1,r=e?e.length:0;for(this.__data__=new e_;++t<r;)this.add(e[t])}function ew(e){this.__data__=new ev(e)}function ek(e,t){for(var r=e.length;r--;)if(eF(e[r][0],t))return r;return -1}eb.prototype.clear=function(){this.__data__=ec?ec(null):{}},eb.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},eb.prototype.get=function(e){var t=this.__data__;if(ec){var r=t[e];return r===o?void 0:r}return z.call(t,e)?t[e]:void 0},eb.prototype.has=function(e){var t=this.__data__;return ec?void 0!==t[e]:z.call(t,e)},eb.prototype.set=function(e,t){return this.__data__[e]=ec&&void 0===t?o:t,this},ev.prototype.clear=function(){this.__data__=[]},ev.prototype.delete=function(e){var t=this.__data__,r=ek(t,e);return!(r<0)&&(r==t.length-1?t.pop():er.call(t,r,1),!0)},ev.prototype.get=function(e){var t=this.__data__,r=ek(t,e);return r<0?void 0:t[r][1]},ev.prototype.has=function(e){return ek(this.__data__,e)>-1},ev.prototype.set=function(e,t){var r=this.__data__,n=ek(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},e_.prototype.clear=function(){this.__data__={hash:new eb,map:new(ei||ev),string:new eb}},e_.prototype.delete=function(e){return eC(this,e).delete(e)},e_.prototype.get=function(e){return eC(this,e).get(e)},e_.prototype.has=function(e){return eC(this,e).has(e)},e_.prototype.set=function(e,t){return eC(this,e).set(e,t),this},eS.prototype.add=eS.prototype.push=function(e){return this.__data__.set(e,o),this},eS.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ev},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ev){var n=r.__data__;if(!ei||n.length<199)return n.push([e,t]),this;r=this.__data__=new e_(n)}return r.set(e,t),this};var eE=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),s=i.length;s--;){var a=i[++n];if(!1===t(o[a],a,o))break}return e};function eO(e,t){var r;t=eN(t,e)?[t]:eB(r=t)?r:ej(r);for(var n=0,o=t.length;null!=e&&n<o;)e=e[eU(t[n++])];return n&&n==o?e:void 0}function ex(e,t){return null!=e&&t in Object(e)}function eA(e,t,r,n,o){return e===t||(null!=e&&null!=t&&(eW(e)||eG(t))?function(e,t,r,n,o,u){var f=eB(e),v=eB(t),w=s,k=s;f||(w=(w=eI(e))==i?h:w),v||(k=(k=eI(t))==i?h:k);var E=w==h&&!M(e),O=k==h&&!M(t),x=w==k;if(x&&!E)return u||(u=new ew),f||ez(e)?eR(e,t,r,n,o,u):function(e,t,r,n,o,i,s){switch(r){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case _:if(e.byteLength!=t.byteLength||!n(new Q(e),new Q(t)))break;return!0;case a:case l:case d:return eF(+e,+t);case c:return e.name==t.name&&e.message==t.message;case g:case m:return e==t+"";case p:var u=F;case y:var h=2&i;if(u||(u=B),e.size!=t.size&&!h)break;var f=s.get(e);if(f)return f==t;i|=1,s.set(e,t);var v=eR(u(e),u(t),n,o,i,s);return s.delete(e),v;case b:if(ey)return ey.call(e)==ey.call(t)}return!1}(e,t,w,r,n,o,u);if(!(2&o)){var A=E&&z.call(e,"__wrapped__"),R=O&&z.call(t,"__wrapped__");if(A||R){var C=A?e.value():e,P=R?t.value():t;return u||(u=new ew),r(C,P,n,o,u)}}return!!x&&(u||(u=new ew),function(e,t,r,n,o,i){var s=2&o,a=eJ(e),l=a.length;if(l!=eJ(t).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in t:z.call(t,u)))return!1}var p=i.get(e);if(p&&i.get(t))return p==t;var d=!0;i.set(e,t),i.set(t,e);for(var h=s;++c<l;){var f=e[u=a[c]],g=t[u];if(n)var y=s?n(g,f,u,t,e,i):n(f,g,u,e,t,i);if(!(void 0===y?f===g||r(f,g,n,o,i):y)){d=!1;break}h||(h="constructor"==u)}if(d&&!h){var m=e.constructor,b=t.constructor;m!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(e),i.delete(t),d}(e,t,r,n,o,u))}(e,t,eA,r,n,o):e!=e&&t!=t)}function eR(e,t,r,n,o,i){var s=2&o,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=i.get(e);if(c&&i.get(t))return c==t;var u=-1,p=!0,d=1&o?new eS:void 0;for(i.set(e,t),i.set(t,e);++u<a;){var h=e[u],f=t[u];if(n)var g=s?n(f,h,u,t,e,i):n(h,f,u,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(d){if(!function(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}(t,function(e,t){if(!d.has(t)&&(h===e||r(h,e,n,o,i)))return d.add(t)})){p=!1;break}}else if(!(h===f||r(h,f,n,o,i))){p=!1;break}}return i.delete(e),i.delete(t),p}function eC(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function eP(e,t){var r,n=null==e?void 0:e[t];return!(!eW(n)||(r=n,G&&G in r))&&(eK(n)||M(n)?Y:A).test(eD(n))?n:void 0}var eI=function(e){return J.call(e)};function eT(e,t){return!!(t=null==t?0x1fffffffffffff:t)&&("number"==typeof e||R.test(e))&&e>-1&&e%1==0&&e<t}function eN(e,t){if(eB(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||eq(e))||k.test(e)||!w.test(e)||null!=t&&e in Object(t)}(eo&&eI(new eo(new ArrayBuffer(1)))!=S||ei&&eI(new ei)!=p||es&&eI(es.resolve())!=f||ea&&eI(new ea)!=y||el&&eI(new el)!=v)&&(eI=function(e){var t=J.call(e),r=t==h?e.constructor:void 0,n=r?eD(r):void 0;if(n)switch(n){case eu:return S;case ep:return p;case ed:return f;case eh:return y;case ef:return v}return t});function eL(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}var ej=eM(function(e){e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(eq(e))return em?em.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var t,r=[];return E.test(e)&&r.push(""),e.replace(O,function(e,t,n,o){r.push(n?o.replace(x,"$1"):t||e)}),r});function eU(e){if("string"==typeof e||eq(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function eD(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eM(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=e.apply(this,n);return r.cache=i.set(o,s),s};return r.cache=new(eM.Cache||e_),r}function eF(e,t){return e===t||e!=e&&t!=t}function e$(e){var t;return eG(t=e)&&eV(t)&&z.call(e,"callee")&&(!et.call(e,"callee")||J.call(e)==i)}eM.Cache=e_;var eB=Array.isArray;function eV(e){return null!=e&&eH(e.length)&&!eK(e)}function eK(e){var t=eW(e)?J.call(e):"";return t==u||"[object GeneratorFunction]"==t}function eH(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function eW(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eG(e){return!!e&&"object"==typeof e}function eq(e){return"symbol"==typeof e||eG(e)&&J.call(e)==b}var ez=D?function(e){return D(e)}:function(e){return eG(e)&&eH(e.length)&&!!C[J.call(e)]};function eJ(e){return eV(e)?function(e){var t=eB(e)||e$(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],r=t.length,n=!!r;for(var o in e)z.call(e,o)&&!(n&&("length"==o||eT(o,r)))&&t.push(o);return t}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||H))return en(e);var t,r,n=[];for(var o in Object(e))z.call(e,o)&&"constructor"!=o&&n.push(o);return n}(e)}function eY(e){return e}e.exports=function(e,t,r){var n=eB(e)||ez(e);if(t="function"==typeof(c=t)?c:null==c?eY:"object"==typeof c?eB(c)?(o=c[0],i=c[1],eN(o)&&(s=i)==s&&!eW(s)?eL(eU(o),i):function(e){var t,r,n,s,a,l=(t=e,r=o,void 0===(n=null==t?void 0:eO(t,r))?void 0:n);return void 0===l&&l===i?(s=e,a=o,null!=s&&function(e,t,r){t=eN(t,e)?[t]:eB(n=t)?n:ej(n);for(var n,o,i=-1,s=t.length;++i<s;){var a=eU(t[i]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}if(o)return o;var s=e?e.length:0;return!!s&&eH(s)&&eT(a,s)&&(eB(e)||e$(e))}(s,a,ex)):eA(i,l,void 0,3)}):1==(l=function(e){for(var t=eJ(e),r=t.length;r--;){var n,o=t[r],i=e[o];t[r]=[o,i,(n=i)==n&&!eW(n)]}return t}(a=c)).length&&l[0][2]?eL(l[0][0],l[0][1]):function(e){return e===a||function(e,t){var r=t.length,n=r;if(null==e)return!n;for(e=Object(e);r--;){var o=t[r];if((0,o[2])?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<n;){var i=(o=t[r])[0],s=e[i],a=o[1];if(0,o[2]){if(void 0===s&&!(i in e))return!1}else{var l,c=new ew;if(!(void 0===l?eA(a,s,void 0,3,c):l))return!1}}return!0}(e,l)}:function(e){var t;return eN(e)?(t=eU(e),function(e){return null==e?void 0:e[t]}):function(t){return eO(t,e)}}(c),null==r)if(n||eW(e)){var o,i,s,a,l,c,u,p=e.constructor;r=n?eB(e)?new p:[]:eK(p)&&eW(u=Z(e))?ee(u):{}}else r={};return(n?function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r,e););return e}:function(e,t){return e&&eE(e,t,eJ)})(e,function(e,n,o){return t(r,e,n,o)}),r}},7256(e){"use strict";e.exports=Math.abs},5414(e){"use strict";e.exports=Math.floor},981(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},7954(e){"use strict";e.exports=Math.max},3452(e){"use strict";e.exports=Math.min},1358(e){"use strict";e.exports=Math.pow},5720(e){"use strict";e.exports=Math.round},3515(e,t,r){"use strict";var n=r(981);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3109(e,t,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&l&&"function"==typeof l.get?l.get:null,u=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,_=String.prototype.toUpperCase,S=String.prototype.toLowerCase,w=RegExp.prototype.test,k=Array.prototype.concat,E=Array.prototype.join,O=Array.prototype.slice,x=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===P?"object":"symbol")?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function L(e,t){if(1/0===e||-1/0===e||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-x(-e):x(e);if(n!==e){var o=String(n),i=b.call(t,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,r,"$&_")}var j=r(6550),U=j.custom,D=H(U)?U:null,M={__proto__:null,double:'"',single:"'"},F={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function $(e,t,r){var n=M[r.quoteStyle||t];return n+e+n}function B(e){return!I||!("object"==typeof e&&(I in e||void 0!==e[I]))}function V(e){return"[object Array]"===q(e)&&B(e)}function K(e){return"[object RegExp]"===q(e)&&B(e)}function H(e){if(P)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,a){var l,g,_,w,x,R=n||{};if(G(R,"quoteStyle")&&!G(M,R.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if(G(R,"maxStringLength")&&("number"==typeof R.maxStringLength?R.maxStringLength<0&&1/0!==R.maxStringLength:null!==R.maxStringLength))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var U=!G(R,"customInspect")||R.customInspect;if("boolean"!=typeof U&&"symbol"!==U)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(R,"indent")&&null!==R.indent&&" "!==R.indent&&!(parseInt(R.indent,10)===R.indent&&R.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(R,"numericSeparator")&&"boolean"!=typeof R.numericSeparator)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var W=R.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,r){if(t.length>r.maxStringLength){var n=t.length-r.maxStringLength;return e(b.call(t,0,r.maxStringLength),r)+("... "+n)+" more character"+(n>1?"s":"")}var o=F[r.quoteStyle||"single"];return o.lastIndex=0,$(v.call(v.call(t,o,"\\$1"),/[\x00-\x1f]/g,J),"single",r)}(t,R);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var et=String(t);return W?L(t,et):et}if("bigint"==typeof t){var er=String(t)+"n";return W?L(t,er):er}var en=void 0===R.depth?5:R.depth;if(void 0===o&&(o=0),o>=en&&en>0&&"object"==typeof t)return V(t)?"[Array]":"[Object]";var eo=function(e,t){var r;if(" "===e.indent)r=" ";else{if("number"!=typeof e.indent||!(e.indent>0))return null;r=E.call(Array(e.indent+1)," ")}return{base:r,prev:E.call(Array(t+1),r)}}(R,o);if(void 0===a)a=[];else if(z(a,t)>=0)return"[Circular]";function ei(t,r,n){if(r&&(a=O.call(a)).push(r),n){var i={depth:R.depth};return G(R,"quoteStyle")&&(i.quoteStyle=R.quoteStyle),e(t,i,o+1,a)}return e(t,R,o+1,a)}if("function"==typeof t&&!K(t)){var es=function(e){if(e.name)return e.name;var t=m.call(y.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ea=ee(t,ei);return"[Function"+(es?": "+es:" (anonymous)")+"]"+(ea.length>0?" { "+E.call(ea,", ")+" }":"")}if(H(t)){var el=P?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(t);return"object"!=typeof t||P?el:Y(el)}if((ec=t)&&"object"==typeof ec&&("u">typeof HTMLElement&&ec instanceof HTMLElement||"string"==typeof ec.nodeName&&"function"==typeof ec.getAttribute)){for(var ec,eu,ep="<"+S.call(String(t.nodeName)),ed=t.attributes||[],eh=0;eh<ed.length;eh++){ep+=" "+ed[eh].name+"="+$((eu=ed[eh].value,v.call(String(eu),/"/g,""")),"double",R)}return ep+=">",t.childNodes&&t.childNodes.length&&(ep+="..."),ep+="</"+S.call(String(t.nodeName))+">"}if(V(t)){if(0===t.length)return"[]";var ef=ee(t,ei);return eo&&!function(e){for(var t=0;t<e.length;t++)if(z(e[t],"\n")>=0)return!1;return!0}(ef)?"["+Z(ef,eo)+"]":"[ "+E.call(ef,", ")+" ]"}if("[object Error]"===q(l=t)&&B(l)){var eg=ee(t,ei);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===eg.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(eg,", ")+" }":"{ ["+String(t)+"] "+E.call(k.call("[cause]: "+ei(t.cause),eg),", ")+" }"}if("object"==typeof t&&U){if(D&&"function"==typeof t[D]&&j)return j(t,{depth:en-o});else if("symbol"!==U&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ey=[];return s&&s.call(t,function(e,r){ey.push(ei(r,t,!0)+" => "+ei(e,t))}),Q("Map",i.call(t),ey,eo)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var em=[];return u&&u.call(t,function(e){em.push(ei(e,t))}),Q("Set",c.call(t),em,eo)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if("[object Number]"===q(g=t)&&B(g))return Y(ei(Number(t)));if(function(e){if(!e||"object"!=typeof e||!A)return!1;try{return A.call(e),!0}catch(e){}return!1}(t))return Y(ei(A.call(t)));if("[object Boolean]"===q(_=t)&&B(_))return Y(f.call(t));if("[object String]"===q(w=t)&&B(w))return Y(ei(String(t)));if("u">typeof window&&t===window)return"{ [object Window] }";if("u">typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!("[object Date]"===q(x=t)&&B(x))&&!K(t)){var eb=ee(t,ei),ev=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,e_=t instanceof Object?"":"null prototype",eS=!ev&&I&&Object(t)===t&&I in t?b.call(q(t),8,-1):e_?"Object":"",ew=(ev||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(eS||e_?"["+E.call(k.call([],eS||[],e_||[]),": ")+"] ":"");return 0===eb.length?ew+"{}":eo?ew+"{"+Z(eb,eo)+"}":ew+"{ "+E.call(eb,", ")+" }"}return String(t)};var W=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return W.call(e,t)}function q(e){return g.call(e)}function z(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+_.call(t.toString(16))}function Y(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Q(e,t,r,n){return e+" ("+t+") {"+(n?Z(r,n):E.call(r,", "))+"}"}function Z(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+E.call(e,","+r)+"\n"+t.prev}function ee(e,t){var r,n=V(e),o=[];if(n){o.length=e.length;for(var i=0;i<e.length;i++)o[i]=G(e,i)?t(e[i],e):""}var s="function"==typeof R?R(e):[];if(P){r={};for(var a=0;a<s.length;a++)r["$"+s[a]]=s[a]}for(var l in e)if(G(e,l)&&(!n||String(Number(l))!==l||!(l<e.length)))if(P&&r["$"+l]instanceof Symbol)continue;else w.call(/[^\w$]/,l)?o.push(t(l,e)+": "+t(e[l],e)):o.push(l+": "+t(e[l],e));if("function"==typeof R)for(var c=0;c<s.length;c++)T.call(e,s[c])&&o.push("["+t(s[c])+"]: "+t(e[s[c]],e));return o}},4461(e,t,r){e=r.nmd(e),(function(){"use strict";var n={function:!0,object:!0},o=n[typeof window]&&window||this,i=n[typeof t]&&t,s=n.object&&e&&!e.nodeType&&e,a=i&&s&&"object"==typeof r.g&&r.g;a&&(a.global===a||a.window===a||a.self===a)&&(o=a);var l=/\bOpera/,c=Object.prototype,u=c.hasOwnProperty,p=c.toString;function d(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function h(e){return e=b(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:d(e)}function f(e,t){for(var r in e)u.call(e,r)&&t(e[r],r,e)}function g(e){return null==e?d(e):p.call(e).slice(8,-1)}function y(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function m(e,t){var r=null,n=function(n,o){r=t(r,n,o,e)},o=-1,i=e?e.length:0;if("number"==typeof i&&i>-1&&i<=0x1fffffffffffff)for(;++o<i;)n(e[o],o);else f(e,n);return r}function b(e){return String(e).replace(/^ +| +$/g,"")}function v(e){var t,r,n,i,s,a=o,c=e&&"object"==typeof e&&"String"!=g(e);c&&(a=e,e=null);var u=a.navigator||{},d=u.userAgent||"";e||(e=d);var _=c?!!u.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(p.toString()),S="Object",w=c&&a.java?"JavaPackage":g(a.java),k=/\bJava/.test(w)&&a.java,E=k&&g(a.environment)==(c?S:"Environment"),O=k?"a":"α",x=k?"b":"β",A=a.document||{},R=a.operamini||a.opera,C=l.test(C=c&&R?R["[[Class]]"]:g(R))?C:R=null,P=e,I=[],T=null,N=e==d,L=N&&R&&"function"==typeof R.version&&R.version(),j=m([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],function(t,r){return t||RegExp("\\b"+(r.pattern||y(r))+"\\b","i").exec(e)&&(r.label||r)}),U=m(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"],function(t,r){return t||RegExp("\\b"+(r.pattern||y(r))+"\\b","i").exec(e)&&(r.label||r)}),D=$([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),M=m({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}},function(t,r,n){return t||(r[D]||r[/^[a-z]+(?: +[a-z]+\b)*/i.exec(D)]||RegExp("\\b"+y(n)+"(?:\\b|\\w*\\d)","i").exec(e))&&n}),F=m(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],function(t,r){var n,o,i,s=r.pattern||y(r);return!t&&(t=RegExp("\\b"+s+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(n=t,o=r.label||r,i={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"},s&&o&&/^Win/i.test(n)&&!/^Windows Phone /i.test(n)&&(i=i[/[\d.]+$/.exec(n)])&&(n="Windows "+i),n=String(n),s&&o&&(n=n.replace(RegExp(s,"i"),o)),t=n=h(n.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])),t});function $(t){return m(t,function(t,r){var n=r.pattern||y(r);return!t&&(t=RegExp("\\b"+n+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+n+" *\\w+-[\\w]*","i").exec(e)||RegExp("\\b"+n+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(r.label&&!RegExp(n,"i").test(r.label)?r.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),r=r.label||r,t=h(t[0].replace(RegExp(n,"i"),r).replace(RegExp("; *(?:"+r+"[_-])?","i")," ").replace(RegExp("("+r+")[-_.]?(\\w)","i"),"$1 $2"))),t})}function B(t){return m(t,function(t,r){return t||(RegExp(r+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null})}if(j&&(j=[j]),/\bAndroid\b/.test(F)&&!D&&(i=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(e))&&(D=b(i[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),M&&!D?D=$([M]):M&&D&&(D=D.replace(RegExp("^("+y(M)+")[-_.\\s]","i"),M+" ").replace(RegExp("^("+y(M)+")[-_.]?(\\w)","i"),M+" $2")),(i=/\bGoogle TV\b/.exec(D))&&(D=i[0]),/\bSimulator\b/i.test(e)&&(D=(D?D+" ":"")+"Simulator"),"Opera Mini"==U&&/\bOPiOS\b/.test(e)&&I.push("running in Turbo/Uncompressed mode"),"IE"==U&&/\blike iPhone OS\b/.test(e)?(M=(i=v(e.replace(/like iPhone OS/,""))).manufacturer,D=i.product):/^iP/.test(D)?(U||(U="Safari"),F="iOS"+((i=/ OS ([\d_]+)/i.exec(e))?" "+i[1].replace(/_/g,"."):"")):"Konqueror"==U&&/^Linux\b/i.test(F)?F="Kubuntu":M&&"Google"!=M&&(/Chrome/.test(U)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(D))||/\bAndroid\b/.test(F)&&/^Chrome/.test(U)&&/\bVersion\//i.test(e)?(U="Android Browser",F=/\bAndroid\b/.test(F)?F:"Android"):"Silk"==U?(/\bMobi/i.test(e)||(F="Android",I.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&I.unshift("accelerated")):"UC Browser"==U&&/\bUCWEB\b/.test(e)?I.push("speed mode"):"PaleMoon"==U&&(i=/\bFirefox\/([\d.]+)\b/.exec(e))?I.push("identifying as Firefox "+i[1]):"Firefox"==U&&(i=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(F||(F="Firefox OS"),D||(D=i[1])):!U||(i=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(U))?(U&&!D&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(i+"/")+8))&&(U=null),(i=D||M||F)&&(D||M||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(F))&&(U=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(F)?F:i)+" Browser")):"Electron"==U&&(i=(/\bChrome\/([\d.]+)\b/.exec(e)||0)[1])&&I.push("Chromium "+i),L||(L=B(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",y(U),"(?:Firefox|Minefield|NetFront)"])),(i="iCab"==j&&parseFloat(L)>3&&"WebKit"||/\bOpera\b/.test(U)&&(/\bOPR\b/.test(e)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(j)&&"WebKit"||!j&&/\bMSIE\b/i.test(e)&&("Mac OS"==F?"Tasman":"Trident")||"WebKit"==j&&/\bPlayStation\b(?! Vita\b)/i.test(U)&&"NetFront")&&(j=[i]),"IE"==U&&(i=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(U+=" Mobile",F="Windows Phone "+(/\+$/.test(i)?i:i+".x"),I.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(U="IE Mobile",F="Windows Phone 8.x",I.unshift("desktop mode"),L||(L=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=U&&"Trident"==j&&(i=/\brv:([\d.]+)/.exec(e))&&(U&&I.push("identifying as "+U+(L?" "+L:"")),U="IE",L=i[1]),N){if(r="global",n=null!=(t=a)?typeof t[r]:"number",/^(?:boolean|number|string|undefined)$/.test(n)||"object"==n&&!t[r])g(i=a.runtime)==(c?S:"ScriptBridgingProxyObject")?(U="Adobe AIR",F=i.flash.system.Capabilities.os):g(i=a.phantom)==(c?S:"RuntimeObject")?(U="PhantomJS",L=(i=i.version||null)&&i.major+"."+i.minor+"."+i.patch):"number"==typeof A.documentMode&&(i=/\bTrident\/(\d+)/i.exec(e))?(L=[L,A.documentMode],(i=+i[1]+4)!=L[1]&&(I.push("IE "+L[1]+" mode"),j&&(j[1]=""),L[1]=i),L="IE"==U?String(L[1].toFixed(1)):L[0]):"number"==typeof A.documentMode&&/^(?:Chrome|Firefox)\b/.test(U)&&(I.push("masking as "+U+" "+L),U="IE",L="11.0",j=["Trident"],F="Windows");else if(k&&(P=(i=k.lang.System).getProperty("os.arch"),F=F||i.getProperty("os.name")+" "+i.getProperty("os.version")),E){try{L=a.require("ringo/engine").version.join("."),U="RingoJS"}catch(e){(i=a.system)&&i.global.system==a.system&&(U="Narwhal",F||(F=i[0].os||null))}U||(U="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(i=a.process)&&("object"==typeof i.versions&&("string"==typeof i.versions.electron?(I.push("Node "+i.versions.node),U="Electron",L=i.versions.electron):"string"==typeof i.versions.nw&&(I.push("Chromium "+L,"Node "+i.versions.node),U="NW.js",L=i.versions.nw)),U||(U="Node.js",P=i.arch,F=i.platform,L=(L=/[\d.]+/.exec(i.version))?L[0]:null));F=F&&h(F)}if(L&&(i=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(L)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(N&&u.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&(T=/b/i.test(i)?"beta":"alpha",L=L.replace(RegExp(i+"\\+?$"),"")+("beta"==T?x:O)+(/\d+\+?/.exec(i)||"")),"Fennec"==U||"Firefox"==U&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(F))U="Firefox Mobile";else if("Maxthon"==U&&L)L=L.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(D))"Xbox 360"==D&&(F=null),"Xbox 360"==D&&/\bIEMobile\b/.test(e)&&I.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(U)||U&&!D&&!/Browser|Mobi/.test(U))&&("Windows CE"==F||/Mobi/i.test(e)))U+=" Mobile";else if("IE"==U&&N)try{null===a.external&&I.unshift("platform preview")}catch(e){I.unshift("embedded")}else(/\bBlackBerry\b/.test(D)||/\bBB10\b/.test(e))&&(i=(RegExp(D.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||L)?(F=((i=[i,/BB10/.test(e)])[1]?(D=null,M="BlackBerry"):"Device Software")+" "+i[0],L=null):this!=f&&"Wii"!=D&&(N&&R||/Opera/.test(U)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==U&&/\bOS X (?:\d+\.){2,}/.test(F)||"IE"==U&&(F&&!/^Win/.test(F)&&L>5.5||/\bWindows XP\b/.test(F)&&L>8||8==L&&!/\bTrident\b/.test(e)))&&!l.test(i=v.call(f,e.replace(l,"")+";"))&&i.name&&(i="ing as "+i.name+((i=i.version)?" "+i:""),l.test(U)?(/\bIE\b/.test(i)&&"Mac OS"==F&&(F=null),i="identify"+i):(i="mask"+i,U=C?h(C.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(i)&&(F=null),N||(L=null)),j=["Presto"],I.push(i));(i=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(i=[parseFloat(i.replace(/\.(\d)$/,".0$1")),i],"Safari"==U&&"+"==i[1].slice(-1)?(U="WebKit Nightly",T="alpha",L=i[1].slice(0,-1)):(L==i[1]||L==(i[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1]))&&(L=null),i[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(e)||0)[1],537.36==i[0]&&537.36==i[2]&&parseFloat(i[1])>=28&&"WebKit"==j&&(j=["Blink"]),N&&(_||i[1])?(j&&(j[1]="like Chrome"),i=i[1]||((i=i[0])<530?1:i<532?2:i<532.05?3:i<533?4:i<534.03?5:i<534.07?6:i<534.1?7:i<534.13?8:i<534.16?9:i<534.24?10:i<534.3?11:i<535.01?12:i<535.02?"13+":i<535.07?15:i<535.11?16:i<535.19?17:i<536.05?18:i<536.1?19:i<537.01?20:i<537.11?"21+":i<537.13?23:i<537.18?24:i<537.24?25:i<537.36?26:"Blink"!=j?"27":"28")):(j&&(j[1]="like Safari"),i=(i=i[0])<400?1:i<500?2:i<526?3:i<533?4:i<534?"4+":i<535?5:i<537?6:i<538?7:i<601?8:i<602?9:i<604?10:i<606?11:i<608?12:"12"),j&&(j[1]+=" "+(i+="number"==typeof i?".x":/[.+]/.test(i)?"":"+")),"Safari"==U&&(!L||parseInt(L)>45)?L=i:"Chrome"==U&&/\bHeadlessChrome/i.test(e)&&I.unshift("headless")),"Opera"==U&&(i=/\bzbov|zvav$/.exec(F))?(U+=" ",I.unshift("desktop mode"),"zvav"==i?(U+="Mini",L=null):U+="Mobile",F=F.replace(RegExp(" *"+i+"$"),"")):"Safari"==U&&/\bChrome\b/.exec(j&&j[1])?(I.unshift("desktop mode"),U="Chrome Mobile",L=null,/\bOS X\b/.test(F)?(M="Apple",F="iOS 4.3+"):F=null):/\bSRWare Iron\b/.test(U)&&!L&&(L=B("Chrome")),L&&0==L.indexOf(i=/[\d.]+$/.exec(F))&&e.indexOf("/"+i+"-")>-1&&(F=b(F.replace(i,""))),F&&-1!=F.indexOf(U)&&!RegExp(U+" OS").test(F)&&(F=F.replace(RegExp(" *"+y(U)+" *"),"")),j&&!/\b(?:Avant|Nook)\b/.test(U)&&(/Browser|Lunascape|Maxthon/.test(U)||"Safari"!=U&&/^iOS/.test(F)&&/\bSafari\b/.test(j[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(U)&&j[1])&&(i=j[j.length-1])&&I.push(i),I.length&&(I=["("+I.join("; ")+")"]),M&&D&&0>D.indexOf(M)&&I.push("on "+M),D&&I.push((/^on /.test(I[I.length-1])?"":"on ")+D),F&&(s=(i=/ ([\d.+]+)$/.exec(F))&&"/"==F.charAt(F.length-i[0].length-1),F={architecture:32,family:i&&!s?F.replace(i[0],""):F,version:i?i[1]:null,toString:function(){var e=this.version;return this.family+(e&&!s?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(i=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(P))&&!/\bi686\b/i.test(P)?(F&&(F.architecture=64,F.family=F.family.replace(RegExp(" *"+i),"")),U&&(/\bWOW64\b/i.test(e)||N&&/\w(?:86|32)$/.test(u.cpuClass||u.platform)&&!/\bWin64; x64\b/i.test(e))&&I.unshift("32-bit")):F&&/^OS X/.test(F.family)&&"Chrome"==U&&parseFloat(L)>=39&&(F.architecture=64),e||(e=null);var V={};return V.description=e,V.layout=j&&j[0],V.manufacturer=M,V.name=U,V.prerelease=T,V.product=D,V.ua=e,V.version=U&&L,V.os=F||{architecture:null,family:null,version:null,toString:function(){return"null"}},V.parse=v,V.toString=function(){return this.description||""},V.version&&I.unshift(L),V.name&&I.unshift(U),F&&U&&!(F==String(F).split(" ")[0]&&(F==U.split(" ")[0]||D))&&I.push(D?"("+F+")":"on "+F),I.length&&(V.description=I.join(" ")),V}var _=v();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(o.platform=_,define(function(){return _})):i&&s?f(_,function(e,t){i[t]=e}):o.platform=_}).call(this)},5539(e){"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},8183(e,t,r){"use strict";var n=r(6334),o=r(4816);e.exports={formats:r(5539),parse:o,stringify:n}},4816(e,t,r){"use strict";var n=r(6278),o=r(1954),i=Object.prototype.hasOwnProperty,s=Array.isArray,a=Object.getPrototypeOf,l=function(e){if(!e||"object"!=typeof e)return!1;if(s(e))return!0;var t=a(e);return t===Object.prototype||null===t},c=function(e){if(s(e)){var t=[];return t.length=e.length,t}return null===a(e)?{__proto__:null}:{}},u=function(e){for(var t=n(),r={},o=[{source:e,target:r}],i=0;i<o.length;++i)for(var s=o[i].source,a=o[i].target,u=Object.keys(s),p=0;p<u.length;++p){var d=s[u[p]];if(l(d)){if(!t.has(d)){var h=c(d);t.set(d,h),o[o.length]={source:d,target:h}}a[u[p]]=t.get(d)}else a[u[p]]=d}return r},p={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},d=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1){if(t.throwOnLimitExceeded)for(var n=0,o=e.indexOf(",");o>-1;){if((n+=1)>=t.arrayLimit)throw RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");o=e.indexOf(",",o+1)}return e.split(",")}if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},h=function(e,t){var r={__proto__:null},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=1/0===t.parameterLimit?void 0:t.parameterLimit,l=n.split(t.delimiter,t.throwOnLimitExceeded&&void 0!==a?a+1:a);if(t.throwOnLimitExceeded&&void 0!==a&&l.length>a)throw RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var c=-1,u=t.charset;if(t.charsetSentinel)for(h=0;h<l.length;++h)0===l[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[h]?u="utf-8":"utf8=%26%2310003%3B"===l[h]&&(u="iso-8859-1"),c=h,h=l.length);for(h=0;h<l.length;++h)if(h!==c){var h,f,g,y=l[h],m=y.indexOf("]="),b=-1===m?y.indexOf("="):m+1,v=b>1&&"[]"===y.slice(b-2,b);if(-1===b?(f=t.decoder(y,p.decoder,u,"key"),g=t.strictNullHandling?null:""):null!==(f=t.decoder(y.slice(0,b),p.decoder,u,"key"))&&(g=o.maybeMap(d(y.slice(b+1),t,s(r[f])?r[f].length:0),function(e){return t.decoder(e,p.decoder,u,"value")})),g&&t.interpretNumericEntities&&"iso-8859-1"===u&&(g=String(g).replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})),v&&(g=s(g)?[g]:g),t.comma&&s(g)&&g.length>t.arrayLimit&&(g=o.combine([],g,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded)),null!==f){var _=i.call(r,f);_&&("combine"===t.duplicates||v)?r[f]=o.combine(r[f],g,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded):_&&"last"!==t.duplicates||(r[f]=g)}}return r},f=function(e,t,r,n){var i=0;if(e.length>0&&"[]"===e[e.length-1]){var s=e.slice(0,-1).join("");i=Array.isArray(t)&&t[s]?t[s].length:0}for(var a=n?t:d(t,r,i),l=e.length-1;l>=0;--l){var c,u=e[l];if("[]"===u&&r.parseArrays)c=o.isOverflow(a)?a:r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:o.combine([],a,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{c=r.plainObjects?{__proto__:null}:{};var p="["===u.charAt(0)&&"]"===u.charAt(u.length-1)?u.slice(1,-1):u,h=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,f=parseInt(h,10),g=!isNaN(f)&&u!==h&&String(f)===h&&f>=0&&r.parseArrays;if(r.parseArrays||""!==h)if(g&&f<r.arrayLimit)(c=[])[f]=a;else if(g&&r.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");else g?(c[f]=a,o.markOverflow(c,f)):"__proto__"!==h&&(c[h]=a);else c={0:a}}a=c}return a},g=function(e){for(var t="",r=0,n=0;n<e.length;n+=1){var o=e.charCodeAt(n);if(91===o)r+=1,t+="[";else if(93===o)r>0&&(r-=1),t+="]";else if(46===o&&0===r&&n+1<e.length&&46!==e.charCodeAt(n+1)&&91!==e.charCodeAt(n+1)){for(var i=n+1,s=i;s<e.length&&46!==e.charCodeAt(s)&&91!==e.charCodeAt(s);)s+=1;t+="["+e.slice(i,s)+"]",n=s-1}else t+=e.charAt(n)}return t},y=function(e,t){var r=t.allowDots?g(e):e;if(t.depth<=0){if(!t.plainObjects&&i.call(Object.prototype,r)&&!t.allowPrototypes)return;return[r]}var n=[],o=r.indexOf("["),s=o>=0?r.slice(0,o):r;if(s){if(!t.plainObjects&&i.call(Object.prototype,s)&&!t.allowPrototypes)return;n[n.length]=s}for(var a=r.length,l=o,c=0;l>=0&&c<t.depth;){for(var u=1,p=l+1,d=-1;p<a&&d<0;){var h=r.charCodeAt(p);91===h?u+=1:93===h&&0==(u-=1)&&(d=p),p+=1}if(d<0)return n[n.length]="["+r.slice(l)+"]",n;var f=r.slice(l,d+1),y=f.slice(1,-1);if(!t.plainObjects&&i.call(Object.prototype,y)&&!t.allowPrototypes)return;n[n.length]=f,c+=1,l=r.indexOf("[",d+1)}if(l>=0){if(!0===t.strictDepth)throw RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");n[n.length]="["+r.slice(l)+"]"}return n},m=function(e,t,r,n){if(e){var o=y(e,r);if(o)return f(o,t,r,n)}},b=function(e){if(!e)return p;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?p.charset:e.charset,r=void 0===e.duplicates?p.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||p.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:p.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:p.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:p.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:p.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:p.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:p.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:p.decoder,delimiter:"string"==typeof e.delimiter||o.isRegExp(e.delimiter)?e.delimiter:p.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:p.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:p.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:p.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:p.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:p.strictDepth,strictMerge:"boolean"==typeof e.strictMerge?!!e.strictMerge:p.strictMerge,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}};e.exports=function(e,t){var r=b(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var n="string"==typeof e?h(e,r):u(e),i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),a=0;a<s.length;++a){var l=s[a],c=m(l,n[l],r,"string"==typeof e);i=o.merge(i,c,r)}return!0===r.allowSparse?i:o.compact(i)}},6334(e,t,r){"use strict";var n=r(6278),o=r(1954),i=r(5539),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},p=Date.prototype.toISOString,d=i.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",depth:1/0,encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return p.call(e)},skipNulls:!1,strictNullHandling:!1},f={},g=function e(t,r,i,s,a,c,p,d,g,y,m,b,v,_,S,w,k,E,O,x){var A,R,C=t;if(x>O)throw RangeError("Input depth exceeded depth option of "+O);for(var P=E,I=0,T=!1;void 0!==(P=P.get(f))&&!T;){var N=P.get(t);if(I+=1,void 0!==N)if(N===I)throw RangeError("Cyclic object value");else T=!0;void 0===P.get(f)&&(I=0)}if((C="function"==typeof y?y(r,C):C)instanceof Date?C=v(C):"comma"===i&&l(C)&&(C=o.maybeMap(C,function(e){return e instanceof Date?v(e):e})),null===C){if(c)return S(g&&!w?g(r,h.encoder,k,"key",_):r);C=""}if("string"==typeof(A=C)||"number"==typeof A||"boolean"==typeof A||"symbol"==typeof A||"bigint"==typeof A||o.isBuffer(C))return g?[S(w?r:g(r,h.encoder,k,"key",_))+"="+S(g(C,h.encoder,k,"value",_))]:[S(r)+"="+S(String(C))];var L=[];if(void 0===C)return L;if("comma"===i&&l(C))w&&g&&(C=o.maybeMap(C,function(e){return null==e?e:g(e,h.encoder,k,"value",_)})),R=[{value:C.length>0?o.toCoercible(C).join(",")||null:void 0}];else if(l(y))R=y;else{var j=Object.keys(C);R=m?j.sort(m):j}var U=String(r),D=s&&l(C)&&1===C.length?U+"[]":U;if(a&&l(C)&&0===C.length&&0===Object.keys(C).length)return D+"[]";for(var M=0;M<R.length;++M){var F=R[M],$="object"==typeof F&&F&&void 0!==F.value?F.value:C[F];if(!p||null!==$){var B=b&&d?String(F).replace(/\./g,"%2E"):String(F),V=l(C)?"function"==typeof i?i(D,B):D:D+(b?"."+B:"["+B+"]");E.set(t,I);var K=n();K.set(f,E),u(L,e($,V,i,s,a,c,p,d,"comma"===i&&w&&l(C)?null:g,y,m,b,v,_,S,w,k,K,O,x+1))}}return L},y=function(e){if(!e)return h;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");var t,r=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw TypeError("Unknown format option provided.");n=e.format}var o=i.formatters[n],c=h.filter;if(("function"==typeof e.filter||l(e.filter))&&(c=e.filter),t=s.call(a,e.arrayFormat)?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":h.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||h.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:t,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,depth:"number"==typeof e.depth?e.depth:h.depth,encode:"boolean"==typeof e.encode?e.encode:h.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:h.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:c,format:n,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}};e.exports=function(e,t){var r,o=e,i=y(t);"function"==typeof i.filter?o=(0,i.filter)("",o):l(i.filter)&&(r=i.filter);var s=[];if("object"!=typeof o||null===o)return"";var c=a[i.arrayFormat],p="comma"===c&&i.commaRoundTrip;r||(r=Object.keys(o)),i.sort&&r.sort(i.sort);for(var d=n(),h=0;h<r.length;++h){var f=r[h];if(null!=f){var m=o[f];i.skipNulls&&null===m||u(s,g(m,i.encodeDotInKeys?String(f).replace(/\./g,"%2E"):String(f),c,p,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,d,i.depth,0))}}var b=s.join(i.delimiter),v=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?v+="utf8=%26%2310003%3B"+i.delimiter:v+="utf8=%E2%9C%93"+i.delimiter),b.length>0?v+b:""}},1954(e,t,r){"use strict";var n=r(5539),o=r(6278),i=r(9997),s=Object.prototype.hasOwnProperty,a=Array.isArray,l=o(),c=function(e,t){return l.set(e,t),e},u=function(e){return l.has(e)},p=function(e){return l.get(e)},d=function(e,t){l.set(e,t)},h=o(),f=function(e,t){return h.set(e,t),e},g=function(e){return h.has(e)},y=function(e){return h.get(e)},m=function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e}(),b=function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(a(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&(n[n.length]=r[o]);t.obj[t.prop]=n}}},v=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},_=function(e,t,r){"__proto__"===t&&i?i(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},S=function(e,t){for(var r=t,n=Object.keys(e),o=0;o<n.length;++o){var i=parseInt(n[o],10);String(i)===n[o]&&i>r&&(r=i)}return r},w=function(e,t,r){var n=[e,t];if(r&&"number"==typeof r.arrayLimit&&n.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");return c(v(n,r),1)}return n},k="function"==typeof Symbol&&"symbol"==typeof Symbol.toPrimitive,E=Array.prototype.join,O=Array.prototype.toString,x=Object.prototype.toString,A=function e(t,r){if(!t||"object"!=typeof t&&"function"!=typeof t||k&&null!=t[Symbol.toPrimitive])return t;if(a(t)&&t.toString===O&&t.join===E){var n,i=r||o();if(i.has(t))return"";i.set(t,!0);for(var s=0;s<t.length;s+=1){var l=t[s],c=e(l,i);if(!n&&c!==l){n=[];for(var u=0;u<s;u+=1)n[u]=t[u]}n&&(n[s]=c)}return i.delete(t),n||t}if("function"==typeof t.toString)return t;var p=t.valueOf;if("function"==typeof p){var d=p.call(t);if(!d||"object"!=typeof d&&"function"!=typeof d)return String(d)}return x.call(t)};e.exports={arrayToObject:v,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return _(e,r,t[r]),e},e)},combine:function(e,t,r,n,o){if(u(e)){if(o)throw RangeError("Array limit exceeded. Only "+r+" element"+(1===r?"":"s")+" allowed in an array.");for(var i=a(t)?t:[t],s=p(e),l=0;l<i.length;++l)e[s+=1]=i[l];return d(e,s),e}var h=[].concat(e,t);if(h.length>r){if(o)throw RangeError("Array limit exceeded. Only "+r+" element"+(1===r?"":"s")+" allowed in an array.");return c(v(h,{plainObjects:n}),h.length-1)}return h},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=o(),n=0;n<t.length;++n)for(var i=t[n],s=i.obj[i.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];"object"!=typeof u||null===u||r.has(u)||(t[t.length]={obj:s,prop:c},r.set(u,!0))}return b(t),e},decode:function(e,t,r){if("string"==typeof e&&-1===e.indexOf("%"))return -1===e.indexOf("+")?e:e.replace(/\+/g," ");var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(A(e))),"iso-8859-1"===r)return escape(s).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}).replace(/\+/g,"%2B");for(var a="",l=0;l<s.length;l+=1024){var c=s.length>=1024?s.slice(l,l+1024):s;if(l+1024<s.length){var u=c.charCodeAt(c.length-1);u>=55296&&u<=56319&&(c=c.slice(0,-1),l-=1)}for(var p=[],d=0;d<c.length;++d){var h=c.charCodeAt(d);if(45===h||46===h||95===h||126===h||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||i===n.RFC1738&&(40===h||41===h)){p[p.length]=c.charAt(d);continue}if(h<128){p[p.length]=m[h];continue}if(h<2048){p[p.length]=m[192|h>>6]+m[128|63&h];continue}if(h<55296||h>=57344){p[p.length]=m[224|h>>12]+m[128|h>>6&63]+m[128|63&h];continue}d+=1,h=65536+((1023&h)<<10|1023&c.charCodeAt(d)),p[p.length]=m[240|h>>18]+m[128|h>>12&63]+m[128|h>>6&63]+m[128|63&h]}a+=p.join("")}return a},isBuffer:function(e){return!!e&&"object"==typeof e&&!!(e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:u,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},markOverflow:c,maybeMap:function(e,t){if(a(e)){for(var r=[],n=0;n<e.length;n+=1)r[r.length]=t(e[n]);return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(a(t)){var o=t.length;if(n&&"number"==typeof n.arrayLimit&&o>=n.arrayLimit){if(n.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");return c(v(t.concat(r),n),o)}t[o]=r}else if(!t||"object"!=typeof t)return w(t,r,n);else if(u(t)){var i=p(t)+1;t[i]=r,d(t,i)}else if(n&&n.strictMerge&&g(t)){var l=y(t)+1;if(n.throwOnLimitExceeded&&"number"==typeof n.arrayLimit&&l>=n.arrayLimit)throw RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");t[l]=r,f(t,l)}else if(n&&n.strictMerge){var h=w(t,r,n);return a(h)?f(h,1):h}else(n&&(n.plainObjects||n.allowPrototypes)||!s.call(Object.prototype,r))&&(t[r]=!0);return t}if(!t||"object"!=typeof t){if(u(r)){for(var m=Object.keys(r),b=n&&n.plainObjects?{__proto__:null,0:t}:{0:t},k=0;k<m.length;k++)b[parseInt(m[k],10)+1]=r[m[k]];return c(b,p(r)+1)}var E=[t].concat(r);if(n&&"number"==typeof n.arrayLimit&&E.length>n.arrayLimit){if(n.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");return c(v(E,n),E.length-1)}return E}var O=t;if(a(t)&&!a(r)&&(O=v(t,n),g(t)&&f(O,t.length-1)),a(t)&&a(r)){if(r.forEach(function(r,o){if(s.call(t,o)){var i=t[o];i&&"object"==typeof i&&r&&"object"==typeof r?t[o]=e(i,r,n):t[t.length]=r}else t[o]=r}),n&&"number"==typeof n.arrayLimit&&t.length>n.arrayLimit){if(n.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");return c(v(t,n),t.length-1)}return t}return Object.keys(r).reduce(function(t,o){var i=r[o];if(s.call(t,o)?_(t,o,e(t[o],i,n)):_(t,o,i),u(r)&&!u(t)&&c(t,S(t,p(r))),u(t)){var a=parseInt(o,10);String(a)===o&&a>=0&&a>p(t)&&d(t,a)}if(g(t)){var l=parseInt(o,10);String(l)===o&&l>y(t)&&f(t,l)}return t},O)},toCoercible:A}},6521(e,t,r){"use strict";var n=r(3109),o=r(6757),i=function(e,t,r){for(var n,o=e;null!=(n=o.next);o=n)if(n.key===t)return o.next=n.next,r||(n.next=e.next,e.next=n),n},s=function(e,t){if(e){var r=i(e,t);return r&&r.value}},a=function(e,t,r){var n=i(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},l=function(e,t){if(e)return i(e,t,!0)};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+n(e))},delete:function(t){var r=l(e,t);return r&&e&&!e.next&&(e=void 0),!!r},get:function(t){return s(e,t)},has:function(t){var r;return!!(r=e)&&!!i(r,t)},set:function(t,r){e||(e={next:void 0}),a(e,t,r)}};return t}},3977(e,t,r){"use strict";var n=r(4295),o=r(8682),i=r(3109),s=r(6757),a=n("%Map%",!0),l=o("Map.prototype.get",!0),c=o("Map.prototype.set",!0),u=o("Map.prototype.has",!0),p=o("Map.prototype.delete",!0),d=o("Map.prototype.size",!0);e.exports=!!a&&function(){var e,t={assert:function(e){if(!t.has(e))throw new s("Side channel does not contain "+i(e))},delete:function(t){if(e){var r=p(e,t);return 0===d(e)&&(e=void 0),r}return!1},get:function(t){if(e)return l(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,r){e||(e=new a),c(e,t,r)}};return t}},8965(e,t,r){"use strict";var n=r(4295),o=r(8682),i=r(3109),s=r(3977),a=r(6757),l=n("%WeakMap%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),d=o("WeakMap.prototype.delete",!0);e.exports=l?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+i(e))},delete:function(r){if(l&&r&&("object"==typeof r||"function"==typeof r)){if(e)return d(e,r)}else if(s&&t)return t.delete(r);return!1},get:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?c(e,r):t&&t.get(r)},has:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?p(e,r):!!t&&t.has(r)},set:function(r,n){l&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new l),u(e,r,n)):s&&(t||(t=s()),t.set(r,n))}};return r}:s},6278(e,t,r){"use strict";var n=r(6757),o=r(3109),i=r(6521),s=r(3977),a=r(8965)||s||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+(e&&Object(e)===e?"the given object key":o(e)))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=a()),e.set(t,r)}};return t}},4532(e,t,r){!function(e){"use strict";var t,r,n=function(){try{if(e.URLSearchParams&&"bar"===new e.URLSearchParams("foo=bar").get("foo"))return e.URLSearchParams}catch(e){}return null}(),o=n&&"a=1"===new n({a:1}).toString(),i=n&&"+"===new n("s=%2B").get("s"),s=n&&"size"in n.prototype,a="__URLSearchParams__",l=!n||((t=new n).append("s"," &"),"s=+%26"===t.toString()),c=h.prototype,u=!!(e.Symbol&&e.Symbol.iterator);if(!n||!o||!i||!l||!s){c.append=function(e,t){b(this[a],e,t)},c.delete=function(e){delete this[a][e]},c.get=function(e){var t=this[a];return this.has(e)?t[e][0]:null},c.getAll=function(e){var t=this[a];return this.has(e)?t[e].slice(0):[]},c.has=function(e){return _(this[a],e)},c.set=function(e,t){this[a][e]=[""+t]},c.toString=function(){var e,t,r,n,o=this[a],i=[];for(t in o)for(r=f(t),e=0,n=o[t];e<n.length;e++)i.push(r+"="+f(n[e]));return i.join("&")};var p=e.Proxy&&n&&(!i||!l||!o||!s);p?(r=new Proxy(n,{construct:function(e,t){return new e(new h(t[0]).toString())}})).toString=Function.prototype.toString.bind(h):r=h,Object.defineProperty(e,"URLSearchParams",{value:r});var d=e.URLSearchParams.prototype;d.polyfill=!0,!p&&e.Symbol&&(d[e.Symbol.toStringTag]="URLSearchParams"),"forEach"in d||(d.forEach=function(e,t){var r=m(this.toString());Object.getOwnPropertyNames(r).forEach(function(n){r[n].forEach(function(r){e.call(t,r,n,this)},this)},this)}),"sort"in d||(d.sort=function(){var e,t,r,n=m(this.toString()),o=[];for(e in n)o.push(e);for(o.sort(),t=0;t<o.length;t++)this.delete(o[t]);for(t=0;t<o.length;t++){var i=o[t],s=n[i];for(r=0;r<s.length;r++)this.append(i,s[r])}}),"keys"in d||(d.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),y(e)}),"values"in d||(d.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),y(e)}),"entries"in d||(d.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),y(e)}),u&&(d[e.Symbol.iterator]=d[e.Symbol.iterator]||d.entries),"size"in d||Object.defineProperty(d,"size",{get:function(){var e=m(this.toString());if(d===this)throw TypeError("Illegal invocation at URLSearchParams.invokeGetter");return Object.keys(e).reduce(function(t,r){return t+e[r].length},0)}})}function h(e){((e=e||"")instanceof URLSearchParams||e instanceof h)&&(e=e.toString()),this[a]=m(e)}function f(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,function(e){return t[e]})}function g(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/ig,function(e){return decodeURIComponent(e)})}function y(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return u&&(r[e.Symbol.iterator]=function(){return r}),r}function m(e){var t={};if("object"==typeof e)if(v(e))for(var r=0;r<e.length;r++){var n=e[r];if(v(n)&&2===n.length)b(t,n[0],n[1]);else throw TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements")}else for(var o in e)e.hasOwnProperty(o)&&b(t,o,e[o]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var i=e.split("&"),s=0;s<i.length;s++){var a=i[s],l=a.indexOf("=");-1<l?b(t,g(a.slice(0,l)),g(a.slice(l+1))):a&&b(t,g(a),"")}}return t}function b(e,t,r){var n="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);_(e,t)?e[t].push(n):e[t]=[n]}function v(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(void 0!==r.g?r.g:"u">typeof window?window:this)},9368(e){"use strict";e.exports=__rspack_external__9368},650(e){"use strict";e.exports=__rspack_external__650},9207(e){"use strict";e.exports=__rspack_external__9207},5610(){},7791(){},6550(){}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t,n)=>{var o=(t,n)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,[n]:t[o]})};o(t,"get"),o(n,"value")},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";let e;r.r(n),r.d(n,{Console:()=>e7,DEFAULT_ICONSET:()=>tq,DEFAULT_LANGUAGES:()=>tY,DefaultBoxShadow:()=>tW,DefaultBoxShadowBottom:()=>tH,DefaultColor1:()=>tj,DefaultColor10:()=>tV,DefaultColor11:()=>tK,DefaultColor2:()=>tU,DefaultColor3:()=>t$,DefaultColor4:()=>tN,DefaultColor5:()=>tD,DefaultColor6:()=>tM,DefaultColor7:()=>tL,DefaultColor8:()=>tF,DefaultColor9:()=>tB,DefaultDisabledOpacity:()=>"0.3",DefaultHeaderHeight:()=>"50px",EventProviderStatus:()=>s,I18NEXT_TO_MOMENT_LOCALE:()=>tX,Manager:()=>t0,OPENREMOTE_CLIENT_ID:()=>tz,ORError:()=>a,OREvent:()=>l,RESTRICTED_USER_REALM_ROLE:()=>tJ,Util:()=>c,WebSocketEventProvider:()=>tl,addTranslationFormats:()=>tQ,default:()=>t2,manager:()=>t1,normaliseConfig:()=>tZ,subscribe:()=>tT});var t,o,i,s,a,l,c={};r.r(c),r.d(c,{AssetQueryHelper:()=>e8,Deferred:()=>eo,arrayRemove:()=>ey,blobToBase64:()=>e3,camelCaseToSentenceCase:()=>eb,capitaliseFirstLetter:()=>e_,cronStringToISOString:()=>ex,dateToCronString:()=>eO,difference:()=>eg,dispatchCancellableEvent:()=>e5,formatCronString:()=>eE,generateUniqueUUID:()=>e6,getAllowedValueLabel:()=>ej,getAssetTypeLabel:()=>eN,getAttributeLabel:()=>eD,getAttributeUnits:()=>eq,getAttributeValueAsString:()=>e$,getAttributeValueConstraints:()=>eW,getAttributeValueFormat:()=>eJ,getBrowserLanguage:()=>ei,getComplexMetaItems:()=>eT,getEnumKeyAsString:()=>eS,getGeoNotificationsFromRulesSet:()=>el,getMetaItemNameValueHolder:()=>eU,getMetaLabel:()=>eM,getMetaUnits:()=>ez,getMetaValue:()=>eA,getMetaValueAsString:()=>eB,getMetaValueConstraints:()=>eG,getMetaValueFormat:()=>eY,getPrimitiveMetaItems:()=>eI,getQueryParameter:()=>ea,getQueryParameters:()=>es,getValueAsString:()=>eK,getValueDescriptorLabel:()=>eL,getWeekNumber:()=>ew,hasMetaItem:()=>eR,isComplexValueDescriptor:()=>eP,isObject:()=>eh,isPrimitiveValueDescriptor:()=>eC,isTimeDuration:()=>eu,isTimeDurationNegativeInfinity:()=>ed,isTimeDurationPositiveInfinity:()=>ep,loadJs:()=>e0,mergeObjects:()=>function e(t,r,n){if(t&&!r)return Object.assign({},t);if(r&&!t)return Object.assign({},r);let o=Object.assign({},t),i=[];return Object.entries(r).forEach(([t,r])=>{var s,a,l,c,u;let p;s=o,a=i,l=t,c=r,u=n,p=s,a.forEach(e=>{p.hasOwnProperty(e)||(p[e]={}),p=p[e]}),p&&(p.hasOwnProperty(l)?null==c?delete p[l]:Array.isArray(p[l])?u?p[l]=[...p[l],...c]:p[l]=[...c]:"object"==typeof c?p[l]=e(Object.assign({},p[l]),c,u):p[l]=c:null==c?delete p[l]:Array.isArray(c)?p[l]=[...c]:"object"==typeof c?p[l]=Object.assign({},c):p[l]=c)}),o},objectsEqual:()=>ef,resolveUnits:()=>eH,sentenceCaseToCamelCase:()=>em,sortByNumber:()=>e1,sortByString:()=>e2,stringMatch:()=>ev,updateAsset:()=>eZ}),r(4532);var u=r(650);let p=e=>"string"==typeof e,d=()=>{let e,t,r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},h=e=>null==e?"":String(e),f=/###/g,g=e=>e&&e.includes("###")?e.replace(f,"."):e,y=e=>!e||p(e),m=(e,t,r)=>{let n=p(t)?t.split("."):t,o=0;for(;o<n.length-1;){if(y(e))return{};let t=g(n[o]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return y(e)?{}:{obj:e,k:g(n[o])}},b=(e,t,r)=>{let{obj:n,k:o}=m(e,t,Object);if(void 0!==n||1===t.length){n[o]=r;return}let i=t[t.length-1],s=t.slice(0,t.length-1),a=m(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,a=m(e,s=s.slice(0,s.length-1),Object),a?.obj&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=r},v=(e,t)=>{let{obj:r,k:n}=m(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},_=(e,t,r)=>{for(let n in t)"__proto__"!==n&&"constructor"!==n&&(Object.prototype.hasOwnProperty.call(e,n)?p(e[n])||e[n]instanceof String||p(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):_(e[n],t[n],r):e[n]=t[n]);return e},S={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},w=e=>p(e)?e.replace(/[&<>"'\/]/g,e=>S[e]):e,k=[" ",",","?","!",";"],E=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),O=(e,t,r=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let n=t.split(r),o=e;for(let e=0;e<n.length;){let t;if(!o||"object"!=typeof o)return;let i="";for(let s=e;s<n.length;++s)if(s!==e&&(i+=r),i+=n[s],void 0!==(t=o[i])){if(["string","number","boolean"].includes(typeof t)&&s<n.length-1)continue;e+=s-e+1;break}o=t}return o},x=e=>e?.replace(/_/g,"-"),A={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};var R=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||A,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,r,n){return n&&!this.debug?null:(e=e.map(e=>p(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g," "):e),p(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{...{prefix:`${this.prefix}:${t}:`},...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}};class C{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let r=this.observers[e].get(t)||0;this.observers[e].set(t,r+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};return this.on(e,r),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,r])=>{for(let n=0;n<r;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let o=0;o<n;o++)r(e,...t)})}}class P extends C{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r,n={}){let o,i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;e.includes(".")?o=e.split("."):(o=[e,t],r&&(Array.isArray(r)?o.push(...r):p(r)&&i?o.push(...r.split(i)):o.push(r)));let a=v(this.data,o);return(!a&&!t&&!r&&e.includes(".")&&(e=o[0],t=o[1],r=o.slice(2).join(".")),!a&&s&&p(r))?O(this.data?.[e]?.[t],r,i):a}addResource(e,t,r,n,o={silent:!1}){let i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=[e,t];r&&(s=s.concat(i?r.split(i):r)),e.includes(".")&&(s=e.split("."),n=t,t=s[1]),this.addNamespaces(t),b(this.data,s,n),o.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(let n in r)(p(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,o,i={silent:!1,skipCopy:!1}){let s=[e,t];e.includes(".")&&(s=e.split("."),n=r,r=t,t=s[1]),this.addNamespaces(t);let a=v(this.data,s)||{};i.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?_(a,r,o):a={...a,...r},b(this.data,s,a),i.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var I={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,o){return e.forEach(e=>{t=this.processors[e]?.process(t,r,n,o)??t}),t}};let T=Symbol("i18next/PATH_KEY");function N(e,t){let r,n,o,{[T]:i}=e((n=[],(o=Object.create(null)).get=(e,t)=>(r?.revoke?.(),t===T)?n:(n.push(t),(r=Proxy.revocable(e,o)).proxy),Proxy.revocable(Object.create(null),o).proxy)),s=t?.keySeparator??".",a=t?.nsSeparator??":",l=t?.enableSelector==="strict";if(i.length>1&&a){let e=t?.ns,r=l?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(r&&(l?r:r.length>1?r.slice(1):[]).includes(i[0]))return`${i[0]}${a}${i.slice(1).join(s)}`}return i.join(s)}let L=e=>!p(e)&&"boolean"!=typeof e&&"number"!=typeof e;class j extends C{constructor(e,t={}){super(),((e,t,r)=>{e.forEach(e=>{t[e]&&(r[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=R.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let r={...t};if(null==e)return!1;let n=this.resolve(e,r);if(n?.res===void 0)return!1;let o=L(n.res);return!1!==r.returnObjects||!o}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=r&&e.includes(r),s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,r)=>{t=t||"",r=r||"";let n=k.filter(e=>!t.includes(e)&&!r.includes(e));if(0===n.length)return!0;let o=E.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(r);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,r,n);if(i&&!s){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:p(o)?[o]:o};let i=e.split(r);(r!==n||r===n&&this.options.ns.includes(i[0]))&&(o=i.shift()),e=i.join(n)}return{key:e,namespaces:p(o)?[o]:o}}translate(e,t,r){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=N(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?N(e,{...this.options,...n}):String(e));let o=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],n),l=a[a.length-1],c=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");let u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return d?o?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${c}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s;let h=this.resolve(e,n),f=h?.res,g=h?.usedKey||s,y=h?.exactUsedKey||s,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==n.count&&!p(n.count),_=j.hasDefaultValue(n),S=v?this.pluralResolver.getSuffix(u,n.count,n):"",w=n.ordinal&&v?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",k=v&&!n.ordinal&&0===n.count,E=k&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${S}`]||n[`defaultValue${w}`]||n.defaultValue,O=f;b&&!f&&_&&(O=E);let x=L(O),A=Object.prototype.toString.apply(O);if(b&&O&&x&&!["[object Number]","[object Function]","[object RegExp]"].includes(A)&&!(p(m)&&Array.isArray(O))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,O,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(h.res=e,h.usedParams=this.getUsedParamsDetails(n),h):e}if(i){let e=Array.isArray(O),t=e?[]:{},r=e?y:g;for(let e in O)if(Object.prototype.hasOwnProperty.call(O,e)){let o=`${r}${i}${e}`;_&&!f?t[e]=this.translate(o,{...n,defaultValue:L(E)?E[e]:void 0,...{joinArrays:!1,ns:a}}):t[e]=this.translate(o,{...n,joinArrays:!1,ns:a}),t[e]===o&&(t[e]=O[e])}f=t}}else if(b&&p(m)&&Array.isArray(f))(f=f.join(m))&&(f=this.extendTranslation(f,e,n,r));else{let t=!1,o=!1;!this.isValidLookup(f)&&_&&(t=!0,f=E),this.isValidLookup(f)||(o=!0,f=s);let a=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:f,p=_&&E!==f&&this.options.updateMissing;if(o||t||p){if(this.logger.log(p?"updateKey":"missingKey",u,l,v&&!p?`${s}${this.pluralResolver.getSuffix(u,n.count,n)}`:s,p?E:f),i){let e=this.resolve(s,{...n,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let o=_&&r!==f?r:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,p,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,o,p,n),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);k&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],s+t,n[`defaultValue${t}`]||E)})}):r(e,s,E))}f=this.extendTranslation(f,e,n,h,r),o&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}${c}${s}`),(o||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,t?f:void 0,n))}return o?(h.res=f,h.usedParams=this.getUsedParamsDetails(n),h):f}extendTranslation(e,t,r,n,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let i;r.interpolation&&this.interpolator.init({...r,...{interpolation:{...this.options.interpolation,...r.interpolation}}});let s=p(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){let t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let a=r.replace&&!p(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,r.lng||this.language||n.usedLng,r),s){let t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||r.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}let i=r.postProcess||this.options.postProcess,s=p(i)?[i]:i;return null!=e&&s?.length&&!1!==r.applyPostProcessor&&(e=I.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,n,o,i,s;return p(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?N(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(r))return;let a=this.extractFromKey(e,t),l=a.key;n=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let u=void 0!==t.count&&!p(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(p(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(r)||(s=e,!this.checkedLoadedFor[`${f[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(n=>{let s;if(this.isValidLookup(r))return;i=n;let a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,n,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(n,t.count,t));let r=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(o)&&a.push(l+e.replace(o,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+r)),h){let n=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(n),u&&(t.ordinal&&e.startsWith(o)&&a.push(n+e.replace(o,this.options.pluralSeparator)),a.push(n+e),d&&a.push(n+r))}}for(;s=a.pop();)this.isValidLookup(r)||(o=s,r=this.getResource(n,e,s,t))}))})}),{res:r,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(e={}){let t=e.replace&&!p(e.replace),r=t?e.replace:e;if(t&&void 0!==e.count&&(r={...r,count:e.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!t)for(let e of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[e];return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class U{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=R.create("languageUtils")}getScriptPartFromCode(e){if(!(e=x(e))||!e.includes("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=x(e))||!e.includes("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(p(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let r=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(r))&&(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let r=this.getScriptPartFromCode(e);if(this.isSupportedCode(r))return t=r;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n||(!!e.includes("-")||!!n.includes("-"))&&!!(e.includes("-")&&!n.includes("-")&&e.slice(0,e.indexOf("-"))===n||e.startsWith(n)&&n.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),p(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){let r=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],o=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return p(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):p(e)&&o(this.formatLanguageCode(e)),r.forEach(e=>{n.includes(e)||o(this.formatLanguageCode(e))}),n}}let D={zero:0,one:1,two:2,few:3,many:4,other:5},M={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class F{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=R.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let r,n=x("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];try{r=new Intl.PluralRules(n,{type:o})}catch(o){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),M;if(!e.match(/-|_/))return M;let n=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(n,t)}return this.pluralRulesCache[i]=r,r}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return(r||(r=this.getRule("dev",t)),r)?r.resolvedOptions().pluralCategories.sort((e,t)=>D[e]-D[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,r={}){let n=this.getRule(e,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}let $=(e,t,r,n=".",o=!0)=>{let i,s=void 0!==(i=v(e,r))?i:v(t,r);return!s&&o&&p(r)&&void 0===(s=O(e,r,n))&&(s=O(t,r,n)),s},B=e=>e.replace(/\$/g,"$$$$");class V{constructor(e={}){this.logger=R.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:r,useRawValueToEscape:n,prefix:o,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:h,nestingSuffixEscaped:f,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:w,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):i||"{{",this.suffix=s?s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u?u.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"-",this.unescapeSuffix=this.unescapePrefix?"":c?c.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"",this.nestingPrefix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):d||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=h?h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,r,n){let o,i,s,a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(!e.includes(this.formatSeparator)){let o=$(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,r,{...n,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format($(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,r,{...n,...t,interpolationkey:i})};this.resetRegExp(),!this.escapeValue&&"string"==typeof e&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");let c=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(s=0;o=t.regex.exec(e);){let r=o[1].trim();if(void 0===(i=l(r)))if("function"==typeof c){let t=c(e,o,n);i=p(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))i="";else if(u){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),i="";else p(i)||this.useRawValueToEscape||(i=h(i));let a=t.safeValue(i);if(e=e.replace(o[0],B(a)),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++s>=this.maxReplaces)break}}),e}nest(e,t,r={}){let n,o,i,s=(e,t)=>{let r=this.nestingOptionsSeparator;if(!e.includes(r))return e;let n=e.split(RegExp(`${r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),o=`{${n[1]}`;e=n[0];let s=(o=this.interpolate(o,i)).match(/'/g),a=o.match(/"/g);((s?.length??0)%2!=0||a)&&(a?.length??0)%2==0||(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${o}`}return i.defaultValue&&i.defaultValue.includes(this.prefix)&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let a=[];(i=(i={...r}).replace&&!p(i.replace)?i.replace:i).applyPostProcessor=!1,delete i.defaultValue;let l=/{.*}/s.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==l&&(a=n[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,l)),(o=t(s.call(this,n[1].trim(),i),i))&&n[0]===e&&!p(o))return o;p(o)||(o=h(o)),o||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),o=""),a.length&&(o=a.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}let K=e=>{let t={};return(r,n,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});let s=n+JSON.stringify(i),a=t[s];return a||(a=e(x(n),o),t[s]=a),a(r)}},H=e=>(t,r,n)=>e(x(r),n)(t);class W{constructor(e={}){this.logger=R.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let r=t.cacheInBuiltFormats?K:H;this.formats={number:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:r((e,t)=>{let r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:r((e,t)=>{let r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:r((e,t)=>{let r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=K(t)}format(e,t,r,n={}){if(!t||null==e)return e;let o=t.split(this.formatSeparator),i=[];for(let e=0;e<o.length;e++){let t=o[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<o.length;)t=`${t}${this.formatSeparator}${o[++e]}`;i.push(t)}return i.reduce((e,t)=>{let{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim(),r={};if(e.includes("(")){let n=e.split("(");t=n[0].toLowerCase().trim();let o=n[1].slice(0,-1);"currency"!==t||o.includes(":")?"relativetime"!==t||o.includes(":")?o.split(";").forEach(e=>{if(e){let[t,...n]=e.split(":"),o=n.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();r[i]||(r[i]=o),"false"===o&&(r[i]=!1),"true"===o&&(r[i]=!0),isNaN(o)||(r[i]=parseInt(o,10))}}):r.range||(r.range=o.trim()):r.currency||(r.currency=o.trim())}return{formatName:t,formatOptions:r}})(t);if(this.formats[o]){let t=e;try{let s=n?.formatParams?.[n.interpolationkey]||{},a=s.locale||s.lng||n.locale||n.lng||r;t=this.formats[o](e,a,{...i,...n,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class G extends C{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=R.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(e,t,r,n){let o={},i={},s={},a={};return e.forEach(e=>{let n=!0;t.forEach(t=>{let s=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,n=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[t]&&(a[t]=!0)))}),n||(s[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,r){let n=e.split("|"),o=n[0],i=n[1];t&&this.emit("failedLoading",o,i,t),!t&&r&&this.store.addResourceBundle(o,i,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);let s={};this.queue.forEach(r=>{((e,t,r)=>{let{obj:n,k:o}=m(e,t,Object);n[o]=n[o]||[],n[o].push(r)})(r.loaded,[o],i),void 0!==r.pending[e]&&(delete r.pending[e],r.pendingCount--),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{s[e]||(s[e]={});let t=r.loaded[e];t.length&&t.forEach(t=>{void 0===s[e][t]&&(s[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r,n=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:o,callback:i});this.readingCalls++;let s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&n<this.maxRetries?setTimeout(()=>{this.read(e,t,r,n+1,2*o,i)},o):i(s,a)},a=this.backend[r].bind(this.backend);if(2===a.length){try{let r=a(e,t);r&&"function"==typeof r.then?r.then(e=>s(null,e)).catch(s):s(null,r)}catch(e){s(e)}return}return a(e,t,s)}prepareLoading(e,t,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();p(e)&&(e=this.languageUtils.toResolveHierarchy(e)),p(t)&&(t=[t]);let o=this.queueLoad(e,t,r,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e,t=""){let r=e.split("|"),n=r[0],o=r[1];this.read(n,o,"read",void 0,void 0,(r,i)=>{r&&this.logger.warn(`${t}loading namespace ${o} for language ${n} failed`,r),!r&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${n}`,i),this.loaded(e,r,i)})}saveMissing(e,t,r,n,o,i={},s=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=r&&""!==r){if(this.backend?.create){let a={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;(o=5===l.length?l(e,t,r,n,a):l(e,t,r,n))&&"function"==typeof o.then?o.then(e=>s(null,e)).catch(s):s(null,o)}catch(e){s(e)}else l(e,t,r,n,s,a)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}let q=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),p(e[1])&&(t.defaultValue=e[1]),p(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),z=e=>(p(e.ns)&&(e.ns=[e.ns]),p(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),p(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),J=()=>{};class Y extends C{constructor(e={},t){if(super(),this.options=z(e),this.services={},this.logger=R,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(p(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));let r=q();this.options={...r,...this.options,...z(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);let n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?R.init(n(this.modules.logger),this.options):R.init(null,this.options),e=this.modules.formatter?this.modules.formatter:W;let t=new U(this.options);this.store=new P(this.options.resources,this.options);let r=this.services;r.logger=R,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new F(t,{prepend:this.options.pluralSeparator}),e&&(r.formatter=n(e),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new V(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new G(n(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(r.languageDetector=n(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=n(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new j(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=J),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=d(),i=()=>{let e=(e,r)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(r),t(e,r)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),o}loadResources(e,t=J){let r=t,n=p(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return r();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};n?t(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(e)})}else r(null)}reloadResources(e,t,r){let n=d();return"function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=J),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&I.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let r=d();this.emit("languageChanging",e);let n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(n(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);let r=p(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(p(t)?[t]:t);i&&(this.language||n(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}getFixedT(e,t,r,n){let o=n?.scopeNs,i=(e,t,...n)=>{let s,a;(s="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(n)):{...t}).lng=s.lng||i.lng,s.lngs=s.lngs||i.lngs;let l=void 0!==s.ns&&null!==s.ns;s.ns=s.ns||i.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||r||i.keyPrefix);let c={...this.options,...s};Array.isArray(o)&&!l&&(c.ns=o),"function"==typeof s.keyPrefix&&(s.keyPrefix=N(s.keyPrefix,c));let u=this.options.keySeparator||".";return s.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=N(e,c)),`${s.keyPrefix}${u}${e}`)):("function"==typeof e&&(e=N(e,c)),a=s.keyPrefix?`${s.keyPrefix}${u}${e}`:e),this.t(a,s)};return p(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=r,i}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let i=(e,t)=>{let r=this.services.backendConnector.state[`${e}|${t}`];return -1===r||0===r||2===r};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,e)&&(!n||i(o,e)))}loadNamespaces(e,t){let r=d();return this.options.ns?(p(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){let r=d();p(e)&&(e=[e]);let n=this.options.preload||[],o=e.filter(e=>!n.includes(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=n.concat(o),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new U(q());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){let r=new Y(e,t);return r.createInstance=Y.createInstance,r}cloneInstance(e={},t=J){let r=e.forkResourceStore;r&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},o=new Y(n);if((void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new P(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((r,n)=>(r[n]={...e[t][n]},r),e[t]),e),{}),n),o.services.resourceStore=o.store),e.interpolation){let t={...q().interpolation,...this.options.interpolation,...e.interpolation},r={...n,interpolation:t};o.services.interpolator=new V(r)}return o.translator=new j(o.services,n),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(n,t),o.translator.options=n,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let X=Y.createInstance();X.createInstance,X.dir,X.init,X.loadResources,X.reloadResources,X.use,X.changeLanguage,X.getFixedT,X.t,X.exists,X.setDefaultNamespace,X.hasLoadedNamespace,X.loadNamespaces,X.loadLanguages;var Q=r(8183),Z=r.n(Q);let ee=moment;var et=r.n(ee),er=r(3472),en=r.n(er);class eo{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 ei(){return navigator.language.split("-")[0]||"en"}function es(e){return Z().parse(e,{ignoreQueryPrefix:!0})}function ea(e){let t;if(location.search&&""!==location.search&&(t=es(location.search)),location.hash){let e=location.hash.indexOf("?");e>-1&&(t=es(location.hash.substring(e+1)))}return t?t[e]:void 0}function el(e){let t=[];return e.rules.forEach(e=>{if(e.when&&e.then&&e.then.length>0){let r=new Map;for(let n of(function(e,t){if(!e)return;let r=[];e.groups&&e.groups.forEach(e=>{e.items&&e.items.forEach(e=>{r.push(e)})}),e.items&&e.items.forEach(e=>{r.push(e)}),r&&r.forEach(e=>{if(e.assets&&e.assets.attributes){let r=[];if(function e(t,r){t&&(t.items.forEach(e=>{e.value&&("radial"===e.value.predicateType||"rect"===e.value.predicateType)&&r.push({predicate:e.value})}),t.groups&&t.groups.forEach(t=>e(t,r)))}(e.assets.attributes,r),r.length>0){let n=e.tag||"0";t.set(n,r)}}})}(e.when,r),r.size>0&&e.then.forEach(e=>(function(e,t){if(e&&"notification"===e.action&&e.notification&&e.notification.message&&"push"===e.notification.message.type){let r=e.target;if(r&&r.conditionAssets){let n=t.get(r.conditionAssets);n&&n.forEach(t=>{t.notification=e.notification.message})}else for(let r of t.values())r.forEach(t=>{t.notification=e.notification.message})}})(e,r)),r.values()))n.forEach(e=>{e.notification&&t.push(e)})}}),t}let ec=/([+-])?((\d+)[Dd])?\s*((\d+)[Hh])?\s*((\d+)[Mm]$)?\s*((\d+)[Ss])?\s*((\d+)([Mm][Ss]$))?\s*((\d+)[Ww])?\s*((\d+)[Mm][Nn])?\s*((\d+)[Yy])?/;function eu(e){return!!e&&(e=e.trim()).length>0&&(ec.test(e)||ep(e)||ed(e))}function ep(e){return"*"===(e=null!=e?e.trim():void 0)||"+*"===e}function ed(e){return"-*"===(e=null!=e?e.trim():void 0)}function eh(e){return!!e&&"object"==typeof e}function ef(e,t,r=!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(r){if(Array.isArray(e))return e.every((e,r)=>ef(e,t[r]));let r=Object.keys(e);return Object.keys(t).every(e=>-1!==r.indexOf(e))&&r.every(r=>ef(e[r],t[r]))}return!1}function eg(e,t){let r=(e,t)=>en()(e,function(e,n,o){ef(n,null==t?void 0:t[o])||(e[o]=eh(n)&&eh(null==t?void 0:t[o])?r(n,null==t?void 0:t[o]):n)});return r(e,t)}function ey(e,t){if(0===e.length)return;let r=e.indexOf(t);r>=0&&e.splice(r,1)}function em(e){return null==e?"":e.split(" ").map((e,t)=>0===t?e[0].toLowerCase()+e.substring(1):e[0].toUpperCase()+e.substring(1)).join("")}function eb(e){if(null==e)return"";let t=!1;return e.split(/([A-Z]|\d)/).map((e,r,n)=>{if(!e)return e;if(!t)return t=!0,e.charAt(0).toUpperCase()+e.slice(1);if("_"===e)return" ";if(1===e.length&&e===e.toUpperCase()){let t=!n[r-1]||"_"===n[r-1],o=r+1<n.length&&n[r+1]&&"_"!==n[r+1],i=r+3>n.length||!n[r+1]&&!n[r+3];(!t||o)&&(e=" "+e),!o&&(t||i)||(e=e.toLowerCase())}return e}).join("").trim()}function ev(e,t){if(t===e)return!0;let r=e.endsWith("*"),n=!r&&e.startsWith("*"),o=!r&&!n&&e.startsWith("^")&&e.endsWith("$");if(r&&t.startsWith(e.substr(0,e.length-1))||n&&t.endsWith(e.substr(1)))return!0;if(o)try{return new RegExp(e).test(t)}catch(e){console.error("Failed to compile needle as a RegExp: "+e)}return!1}function e_(e){if(e)return 1===e.length?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function eS(e,t){return Object.keys(e).find(r=>e[r]===t)}function ew(e){(e=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))).setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));let t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}let ek=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function eE(e,t,r,n,o,i,s){let a="";if(i?Array.isArray(i)?a+=i.toString().replace(" ",""):a+=i.toString():a+="0",a+=" ",o?Array.isArray(o)?a+=o.toString().replace(" ",""):a+=o.toString():a+="0",a+=" ",n?Array.isArray(n)?a+=n.toString().replace(" ",""):a+=n.toString():a+="0",a+=" ",r?Array.isArray(r)?a+=r.toString().replace(" ",""):a+=r.toString():a+="*",a+=" ",t)if(Array.isArray(t))if("number"==typeof t[0]){let e=[];t.forEach(t=>{e.push(ek[t].toString())}),a+=e.toString().replace(" ","")}else a+=t.toString().replace(" ","");else a+=t.toString();else a+="*";return a+=" ",s?a+=s.toString():a+="?",a+=" ",e?Array.isArray(e)?a+=e.toString().replace(" ",""):a+=e:a+="*",a}function eO(e){return eE(e.getFullYear(),ek[e.getMonth()],[e.getDate()],[e.getHours()],[e.getMinutes()])}function ex(e,t){let r=e.split(" ");if(!Number.isNaN(Number(r[0]))&&!Number.isNaN(Number(r[1]))&&!Number.isNaN(Number(r[2]))&&(!Number.isNaN(Number(r[3]))||"*"==r[3])){let e=(!Number.isNaN(Number(r[6]))?r[6]:new Date().getFullYear()).toString(),n="";n=1==(n="*"!=r[4]?ek.indexOf(r[4]).toString():new Date().getMonth().toString()).length?"0"+n:n;let o=1==r[3].length&&"*"!=r[3]?"0"+r[3]:r[3].replace("*","01"),i=1==r[2].length&&"*"!=r[2]?"0"+r[2]:r[2].replace("*","00"),s=1==r[1].length&&"*"!=r[1]?"0"+r[1]:r[1].replace("*","00"),a=1==r[0].length&&"*"!=r[0]?"0"+r[0]:r[0].replace("*","00");if(e.length>0&&n.length>0)if(t)return et().utc({year:Number(e),month:Number(n),date:Number(o),hour:Number(i),minute:Number(s),second:Number(a)}).toISOString();else return et()({year:Number(e),month:Number(n),date:Number(o),hour:Number(i),minute:Number(s),second:Number(a)}).toISOString()}}function eA(e,t,r){let n="string"==typeof e?e:e.name;return t&&t.meta&&t.meta.hasOwnProperty(n)?t.meta[n]:r&&r.meta?r.meta[n]:void 0}function eR(e,t,r){let n="string"==typeof e?e:e.name;return!!(t&&t.meta&&t.meta.hasOwnProperty(n)||r&&r.meta&&r.meta.hasOwnProperty(n))}function eC(e){return!eP(e)}function eP(e){return!!((null==e?void 0:e.jsonType)==="object"||(null==e?void 0:e.arrayDimensions)&&e.arrayDimensions>0)}function eI(){return u.AssetModelUtil.getMetaItemDescriptors().filter(e=>eC(u.AssetModelUtil.getValueDescriptor(e.type)))}function eT(){return u.AssetModelUtil.getMetaItemDescriptors().filter(e=>eP(u.AssetModelUtil.getValueDescriptor(e.type)))}function eN(e){return("string"==typeof e&&(e=u.AssetModelUtil.getAssetDescriptor(e)),e)?X.t("label.asset."+e.name,{defaultValue:eb(e.name)}):""}function eL(e){if(!e)return X.t("label.value.unknown",{defaultValue:"Unknown"});let t="string"==typeof e?e:e.name;return X.t("label.value."+t,{defaultValue:eb(t||"")})}function ej(e,t){if(e)return X.t("label.allowedValue."+e,{defaultValue:t||eb(e||""),nsSeparator:!1})}function eU(e,t){let r="string"==typeof e?u.AssetModelUtil.getMetaItemDescriptor(e):e;return r?{name:r.name,type:r.type,value:t}:{name:typeof e,type:u.AssetModelUtil.resolveValueTypeFromValue(t),value:t}}function eD(e,t,r,n,o){return eF(e,t,r,n,!0,o)}function eM(e,t,r,n,o){return eF(e||eU(t,null),t,r,n,!1,o)}function eF(e,t,r,n,o,i){let s=eQ("label",e,t,r,o),a="";if(s||(s=eA("label",e,t&&t.meta?t:void 0)),n&&(a=eH(eX("units",e,t,r,o))),!s){let r=e?e.name:t?"string"==typeof t?t:t.name:void 0;s=i||(r?eb(r):void 0)}return s?s+(a?" ("+a+")":""):a}function e$(e,t,r,n,o){return eV(e,t,r,n,!0,o)}function eB(e,t,r,n,o){return eV(e||eU(t,null),t,r,n,!1,o)}function eV(e,t,r,n,o,i){let s=eK(e?e.value:void 0,()=>eX("format",e,t,r,o),void 0,i),a=eq(e,t,r);return n&&a&&a.length&&(s=eH(eX("units",e,t,r,o),s)),s}function eK(e,t,r,n){let o="";if(null==e)o=n||"";else if("string"==typeof e)o=e;else if("number"==typeof e||"boolean"==typeof e||e instanceof Date){let n=t&&t();if(n&&0!==Object.keys(n).length)switch("number"==typeof e?n.asBoolean?e=!!e:n.asDate&&(e=new Date(e)):"boolean"==typeof e&&n.asNumber&&(e=+!!e),typeof e){case"number":o=new Intl.NumberFormat(r||X.language,n).format(e);break;case"boolean":n.asOnOff&&(o=e?X.t("on"):X.t("off")),n.asOpenClosed&&(o=e?X.t("open"):X.t("closed")),n.asPressedReleased&&(o=e?X.t("pressed"):X.t("released"));break;case"object":if(n.momentJsFormat)o=et()(e).format(n.momentJsFormat);else if(n.iso8601)o=e.toISOString();else if(n.week){let t=ew(e);o="2-digit"===n.week?String(t).padStart(2,"0"):Number(t).toString(10)}else o=new Intl.DateTimeFormat(r||X.language,n).format(e)}else o=Object(e).toString()}return o}function eH(e,t){if(!e)return"";t||(t="");let r=e.map((e,r)=>{if(3!==e.length||e.toUpperCase()!==e)return X.t(["units."+e,"or:units."+e]);{let n=new Intl.NumberFormat(X.language,{currency:e,style:"currency"}).formatToParts();if(0!==r||"currency"!==n[0].type)return"currency"===n[0].type?n[0].value:n[n.length-1].value;if(!t)return n[0].value;t=n[0].value+t}}).join("");return t.length>0?t+" "+r:r}function eW(e,t,r){return eX("constraints",e,t,r,!0)}function eG(e,t,r){return eX("constraints",e||eU(t,null),t,r,!1)}function eq(e,t,r){return eX("units",e,t,r,!0)}function ez(e,t,r){return eX("units",e||eU(t,null),t,r,!1)}function eJ(e,t,r){return eX("format",e,t,r,!0)}function eY(e,t,r){return eX("format",e||eU(t,null),t,r,!1)}function eX(e,t,r,n,o){let i,s=[],a=eQ(e,t&&"string"==typeof t?t:t?t.name:r?"string"==typeof r?r:r.name:void 0,r,n,o);if(a&&(i=JSON.parse(a)))if("format"!==e)return i;else s.push(i);if(t&&t.meta&&(i=eA(e,t,r)))if("format"!==e)return i;else s.push(i);if(r&&"string"!=typeof r&&r.hasOwnProperty(e)){if(i=r[e],"format"!==e)return i;s.push(i)}if(r&&r.type){if(i=u.AssetModelUtil.getValueDescriptor(r.type)[e],"format"!==e)return i;s.push(i)}if("format"!==e||0===s.length)return i;let l={};return s.reverse().forEach(e=>{l=Object.assign(Object.assign({},l),e)}),l}function eQ(e,t,r,n,o,i){let s;if(t?s="string"==typeof t?t:t.name:r&&(s="string"==typeof r?r:r.name),!s)return;let a=[],l=e+"."+(o?"attribute":"meta")+".";if(n&&a.push(l+n+"."+s),r&&"string"!=typeof r&&(a.push(l+r.type+"."+s),a.push(l+r.type)),a.push(l+s),a.length>0)return X.t(a,{defaultValue:i||""})}function eZ(e,t){let r=t.ref.name;if(e.attributes)if(t.deleted)delete e.attributes[r];else{let n=e.attributes[r];n&&(n.value=t.value,n.timestamp=t.timestamp)}return Object.assign({},e)}function e0(e){return new Promise((t,r)=>{let n=document.createElement("script");n.type="text/javascript",n.src=e,n.addEventListener("load",e=>t(e),!1),n.addEventListener("error",e=>r(e),!1),document.body.appendChild(n)})}function e1(e){return(t,r)=>{let n=e(t),o=e(r);return n||o?n&&!o?1:!n&&o?-1:n-o:0}}function e2(e){return(t,r)=>{let n=e(t),o=e(r);return n||o?n&&!o?1:!n&&o?-1:n.localeCompare(o):0}}function e5(e,t){let r=new eo;return e.dispatchEvent(t),window.setTimeout(()=>{r.resolve(t.detail)}),r.promise}function e3(e){return new Promise((t,r)=>{let n=new FileReader;n.readAsDataURL(e),n.onload=()=>{t(n.result)},n.onerror=e=>{r(e)}})}function e6(){return"function"==typeof crypto.randomUUID?crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}class e8{constructor(e){e&&Object.assign(this,e)}matches(e){var t,r,n,o,i,s,a;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(r=this.types)?void 0:r.length)&&(!e.type||!this.types.includes(e.type))||(null==(n=this.realm)?void 0:n.name)&&e.realm!==this.realm.name||(null==(o=this.parents)?void 0:o.length)&&!this.parents.some(t=>!t.id||e.parentId===t.id))return!1;if(null==(i=this.paths)?void 0:i.length){let t=null!=(s=e.path)?s:[];if(!this.paths.some(e=>{var r;return(null!=(r=e.path)?r:[]).every((e,r)=>t[r]===e)}))return!1}return(null==(a=this.names)||!a.length||!!this.names.every(t=>e8._evalValuePredicate(e.name,t)))&&(!this.attributes||e8._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!e8._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?e8._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var r;switch(t.predicateType){case"string":{let n;if(null==e)return!1;let o=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),i=!1!==t.caseSensitive?t.value:null==(r=t.value)?void 0:r.toLowerCase();switch(t.match){case"BEGIN":n=o.startsWith(i);break;case"END":n=o.endsWith(i);break;case"CONTAINS":n=o.includes(i);break;default:n=o===i}return t.negate?!n:n}case"boolean":return e===t.value;case"number":{let r;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":r=e>t.value;break;case"GREATER_EQUALS":r=e>=t.value;break;case"LESS_THAN":r=e<t.value;break;case"LESS_EQUALS":r=e<=t.value;break;case"BETWEEN":r=e>=t.value&&e<=t.rangeValue;break;default:r=e===t.value}return t.negate?!r:r}}return!1}static _evalPredicate(e,t){var r,n;let o=null==(r=t.name)?void 0:r.value;if(!o)return!0;let i=null==(n=e.attributes)?void 0:n[o];if(!i)return!!t.negated;let s=!t.value||e8._evalValuePredicate(i.value,t.value);return t.negated?!s:s}static _evalGroup(e,t){var r,n,o;let i=null!=(r=t.operator)?r:"AND",s=[...(null!=(n=t.items)?n:[]).map(t=>e8._evalPredicate(e,t)),...(null!=(o=t.groups)?o:[]).map(t=>e8._evalGroup(e,t))];return!s.length||("OR"===i?s.some(Boolean):s.every(Boolean))}static _collectNames(e){var t,r;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(r=e.groups)?r:[]).flatMap(e=>e8._collectNames(e))]}}e8._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var e4=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let e9=r(4461);class e7{constructor(e,t,r){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=r,window.OpenRemoteConsole=this;const n=new URLSearchParams(window.location.search),o=n.get("consoleName"),i=n.get("consoleVersion"),s=n.get("consolePlatform"),a=n.get("consoleProviders"),l=n.get("consoleAutoEnable"),c=a&&a.length>0?a.split(" "):["push"];this._pendingProviderEnables=c;const u=e7._createConsoleRegistration(),p=window.localStorage.getItem(this._storageKey);if(p)try{const e=JSON.parse(p);e.id&&(u.id=e.id),e.name&&(u.name=e.name),e.providers&&(u.providers=e.providers),e.apps&&(u.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}const d=u.providers;for(const e of(u.providers={},c)){const t=d&&d.hasOwnProperty(e)?d[e]:{enabled:!1,disabled:!1};u.providers[e]=t}const h=t2.getAppName();h.length>0&&0>u.apps.indexOf(h)&&u.apps.push(h),this._registration=u,o&&(u.name=o),i&&(u.version=i),s&&(u.platform=s),l&&(this._autoEnable="TRUE"===l||"true"===l)}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 e4(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return e4(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 e4(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 r={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},n=yield this.sendProviderMessage(r,!0);this._registration.providers[e].hasPermission=n.hasPermission,this._registration.providers[e].success=n.success,this._registration.providers[e].enabled=n.success,this._registration.providers[e].data=n.data;let o=this._pendingProviderEnables.indexOf(e);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),n})}disableProvider(e){return e4(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 e4(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 r=e.provider+e.action;if(this._pendingProviderPromises[r])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let n=new eo,o=()=>{delete this._pendingProviderPromises[r],n.reject("No response from provider")};return this._pendingProviderPromises[r]=[n,window.setTimeout(o,5e3)],this._doSendProviderMessage(e),n.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>e4(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),e()}catch(e){console.error("Failed to register console",e),t(e)}}))})}_sendRegistration(e){return e4(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield t2.rest.api.ConsoleResource.register(this._registration);if(200!==e.status)throw Error("Failed to register console");this._registration=e.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(r){if(e&&t&&e7._isStaleRegistrationResponse(r)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw r}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(e){let t=e&&e.response?e.response.status:void 0;return 403===t||409===t}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return e4(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 r={type:e,data:t};this.isMobile?this._postNativeShellMessage(r):console.warn("Failed to send generic message to console.",r)}_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 r=window.localStorage.getItem(t);if(null!==r)try{r=JSON.parse(r)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:r}))}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),r=t.provider,n=t.action,o=this._pendingProviderPromises[r+n];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[r+n],o[0].resolve(t));let i=this._providerMessageListeners[r+n];i&&i(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:e9.name,version:e9.version,platform:e9.os.toString(),apps:[],model:((e9.manufacturer?e9.manufacturer+" ":"")+(e9.product?e9.product:"")).trim()}}_initialiseProvider(e){return e4(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)}})}}var te=r(9207),tt=r.n(te),tr=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};(t=s||(s={})).DISCONNECTED="DISCONNECTED",t.CONNECTED="CONNECTED",t.CONNECTING="CONNECTING";let tn="SUBSCRIBED:",to="UNAUTHORIZED:",ti="TRIGGERED:",ts="EVENT:";class ta{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=tl.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=s.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){ey(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===s.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(s.CONNECTING),this._connectingDeferred=new eo,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=tl.MIN_RECONNECT_DELAY,this._onStatusChanged(s.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!==s.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let r={eventSubscription:e,callback:t,deferred:new eo};return null!=this._pendingSubscription||this._status!==s.CONNECTED?(this._queuedSubscriptions.push(r),r.deferred.promise):(this._pendingSubscription=r,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let r=t.deferred;t.deferred=null,r&&r.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let r=t.deferred;t.deferred=null,r&&r.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return tr(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)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}})}sendEvent(e){this._status===s.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==s.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,r){return tr(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,o="AssetEvent"+ta._subscriptionCounter++;if(!this._assetEventPromise){let e;t2.authenticated||(e={filterType:"asset",realm:t2.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(o,e=>{let t=e.asset.id;n?n.find(e=>t===e)&&r(e):e.asset.realm===t2.displayRealm&&r(e)}),this._assetEventPromise.then(()=>{try{if(n&&t){let e={messageID:"read-assets:"+n.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:n}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(o)&&e.assets.forEach(e=>{r({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),o&&this.unsubscribe(o),t}return o})})}subscribeAttributeEvents(e,t,r){return tr(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0],o=n?e.map(e=>e.id):e,i=n?e:void 0,s="AttributeEvent"+ta._subscriptionCounter++;if(!this._attributeEventPromise){let e;t2.authenticated||(e={filterType:"asset",realm:t2.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let a=t=>{let i=t.ref;n?e.forEach(e=>{i.id===e.id&&i.name===e.name&&r(t)}):o?o.find(e=>i.id===e)&&r(t):t.realm===t2.displayRealm&&r(t)};return this._attributeEventCallbackMap.set(s,a),this._attributeEventPromise.then(()=>{try{if(t&&o){let e={messageID:"read-assets:"+o.join(",")+":"+s,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(s)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,r])=>{(!i||i.find(r=>r.id===e.id&&r.name===t))&&a({eventType:"attribute",timestamp:r.timestamp,value:r.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),s&&this.unsubscribe(s),t}return s})})}_processNextSubscription(){this._status===s.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let r=e.deferred;e.deferred=null,r&&r.resolve(t)},t=>{let r=e.deferred;e.deferred=null,r&&r.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 r=this._subscriptionMap.get(e);r&&r.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===s.CONNECTED&&this._onStatusChanged(s.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(s.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<tl.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(tl.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}ta.MIN_RECONNECT_DELAY=0,ta.MAX_RECONNECT_DELAY=3e4,ta._subscriptionCounter=0;class tl extends ta{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="+t2.config.realm;return this._connectDeferred=new eo,(t2.authenticated?t2.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(tn)){let e=JSON.parse(t.substring(tn.length)),r=this._subscribeDeferred;this._subscribeDeferred=null,r&&r.resolve(e.subscriptionId)}else if(t.startsWith(to)){let e=JSON.parse(t.substring(to.length)),r=this._subscribeDeferred;this._subscribeDeferred=null,r&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),r.reject("Unauthorized"))}else if(t.startsWith(ti)){let e=JSON.parse(t.substring(ti.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(ts)){let e=JSON.parse(t.substring(ts.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 eo,e.subscriptionId||(e.subscriptionId=tl._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=ts+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 eo;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(ts+JSON.stringify(e)),t.promise}}tl._subscriptionCounter=1;let tc=["__proto__","constructor","prototype"];function tu(e){return!("string"!=typeof e||0===e.length||e.length>128||tc.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%:&=;\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function tp(e){return!(!tu(e)||e.indexOf("/")>-1||e.indexOf("@")>-1)}let td={lng:tp,ns:function(e){return!(!tu(e)||e.indexOf("//")>-1)}};function th(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function tf(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let tg=/\{\{(.+?)\}\}/g,ty=/^[/\\]{2}/;function tm(e,t){let r=!1,n=e.replace(tg,(e,n)=>{let o=n.trim();if(tc.indexOf(o)>-1)return e;let i=t[o];if(null==i)return e;let s=td[o]||tp,a=String(i).split("+");for(let t of a)if(!s(t))return r=!0,e;return a.join("+")});return r||ty.test(n)&&!ty.test(e)?null:n}let tb="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?e=fetch:tb&&"function"==typeof tb.fetch&&(e=tb.fetch);let tv=tf()&&tb?tb.XMLHttpRequest:void 0,t_="function"==typeof ActiveXObject&&tb?tb.ActiveXObject:void 0,tS=["__proto__","constructor","prototype"],tw=(e,t)=>{if(t&&"object"==typeof t){let r="";for(let e of Object.keys(t))tS.indexOf(e)>-1||(r+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!r)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+r.slice(1)}return e},tk=(t,r,n,o)=>{let i=e=>{if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(o){let e=o(t,r);if(e instanceof Promise)return void e.then(i).catch(n)}"function"==typeof fetch?fetch(t,r).then(i).catch(n):e(t,r).then(i).catch(n)},tE=(t,r,n,o)=>{if("function"==typeof n&&(o=n,n=void 0),o=o||(()=>{}),e&&0!==r.indexOf("file:")){var i=r,s=n,a=o;t.queryStringParams&&(i=tw(i,t.queryStringParams));let e={..."function"==typeof t.customHeaders?t.customHeaders():t.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(e["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),s&&(e["Content-Type"]="application/json");let l="function"==typeof t.requestOptions?t.requestOptions(s):t.requestOptions,c={method:s?"POST":"GET",body:s?t.stringify(s):void 0,headers:e,...t._omitFetchOptions?{}:l},u="function"==typeof t.alternateFetch&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{tk(i,c,a,u)}catch(e){if(!l||0===Object.keys(l).length||!e.message||0>e.message.indexOf("not implemented"))return a(e);try{Object.keys(l).forEach(e=>{delete c[e]}),tk(i,c,a,u),t._omitFetchOptions=!0}catch(e){a(e)}}return}if(tf()||"function"==typeof ActiveXObject){var l=r,c=n,u=o;c&&"object"==typeof c&&(c=tw("",c).slice(1)),t.queryStringParams&&(l=tw(l,t.queryStringParams));try{let e=tv?new tv:new t_("MSXML2.XMLHTTP.3.0");e.open(c?"POST":"GET",l,1),t.crossDomain||e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.withCredentials=!!t.withCredentials,c&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.overrideMimeType&&e.overrideMimeType("application/json");let r=t.customHeaders;if(r="function"==typeof r?r():r)for(let t of Object.keys(r))tS.indexOf(t)>-1||e.setRequestHeader(t,r[t]);e.onreadystatechange=()=>{e.readyState>3&&u(e.status>=400?e.statusText:null,{status:e.status,data:e.responseText})},e.send(c)}catch(e){console&&console.log(e)}return}o(Error("No fetch and no xhr implementation found!"))};var tO=class{constructor(e,t={},r={}){this.services=e,this.options=t,this.allOptions=r,this.type="backend",this.init(e,t,r)}init(e,t={},r={}){if(this.services=e,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,r)=>({[t]:r||""}),parseLoadPayload:(e,t)=>void 0,request:tE,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...t},this.allOptions=r,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,r){this._readAny(e,e,t,t,r)}read(e,t,r){this._readAny([e],e,[t],t,r)}_readAny(e,t,r,n,o){var i,s;let a=this.options.loadPath;"function"==typeof this.options.loadPath&&(a=this.options.loadPath(e,r)),(a=(s=i=a)&&"function"==typeof s.then?i:Promise.resolve(i)).then(i=>{if(!i)return o(null,{});let s=tm(i,{lng:e.join("+"),ns:r.join("+")});if(null==s)return o(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(th).join(", ")+"] namespaces=["+r.map(th).join(", ")+"]"),!1);this.loadUrl(s,o,t,n)})}loadUrl(e,t,r,n){let o=this.options.parseLoadPayload("string"==typeof r?[r]:r,"string"==typeof n?[n]:n),i=th(function(e){if("string"!=typeof e||0===e.length)return e;try{let t=new URL(e);if(t.username||t.password)return t.username="",t.password="",t.toString();return e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,o,(e,o)=>{let s,a;if(o&&(o.status>=500&&o.status<600||!o.status))return t("failed loading "+i+"; status code: "+o.status,!0);if(o&&o.status>=400&&o.status<500)return t("failed loading "+i+"; status code: "+o.status,!1);if(!o&&e&&e.message){let r=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>r.indexOf(e)>-1))return t("failed loading "+i+": "+th(e.message),!0)}if(e)return t(e,!1);try{s="string"==typeof o.data?this.options.parse(o.data,r,n):o.data}catch(e){a="failed parsing "+i+" to json"}if(a)return t(a,!1);t(null,s)})}create(e,t,r,n,o){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let i=this.options.parsePayload(t,r,n),s=0,a=[],l=[];e.forEach(r=>{let n=this.options.addPath;"function"==typeof this.options.addPath&&(n=this.options.addPath(r,t));let c=tm(n,{lng:r,ns:t});if(null==c){s+=1,o&&s===e.length&&o(a,l);return}this.options.request(this.options,c,i,(t,r)=>{s+=1,a.push(t),l.push(r),s===e.length&&"function"==typeof o&&o(a,l)})})}reload(){let{backendConnector:e,languageUtils:t,logger:r}=this.services,n=e.language;if(n&&"cimode"===n.toLowerCase())return;let o=[],i=e=>{t.toResolveHierarchy(e).forEach(e=>{0>o.indexOf(e)&&o.push(e)})};i(n),this.allOptions.preload&&this.allOptions.preload.forEach(e=>i(e)),o.forEach(t=>{this.allOptions.ns.forEach(n=>{e.read(t,n,"read",null,null,(o,i)=>{o&&r.warn(`loading namespace ${n} for language ${t} failed`,o),!o&&i&&r.log(`loaded namespace ${n} for language ${t}`,i),e.loaded(`${t}|${n}`,o,i)})})})}};tO.type="backend";var tx=r(9368),tA=r(4954);class tR extends Error{}function tC(e,t){let r;if("string"!=typeof e)throw new tR("Invalid token specified: must be a string");t||(t={});let n=+(!0!==t.header),o=e.split(".")[n];if("string"!=typeof o)throw new tR(`Invalid token specified: missing part #${n+1}`);try{r=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 r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(o)}catch(e){throw new tR(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new tR(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(tR.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function tP(e){if(!(this instanceof tP))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,r,n=this,o=[],i={enable:!0,callbackList:[],interval:5},s=document.getElementsByTagName("script"),a=0;a<s.length;a++)(-1!==s[a].src.indexOf("keycloak.js")||-1!==s[a].src.indexOf("keycloak.min.js"))&&-1!==s[a].src.indexOf("version=")&&(n.iframeVersion=s[a].src.substring(s[a].src.indexOf("version=")+8).split("&")[0]);var l=!0,c=A(console.info),u=A(console.warn);function p(e,t){for(var r=function(e){var t=null,r=window.crypto||window.msCrypto;if(r&&r.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),r.getRandomValues(t),t;t=Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=Array(e),o=0;o<e;o++)n[o]=t.charCodeAt(r[o]%t.length);return String.fromCharCode.apply(null,n)}function d(){return void 0===n.authServerUrl?void 0:"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm)}function h(e,t){var r=e.code,o=e.error,i=e.prompt,s=new Date().getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),o){if("none"!=i)if(e.error_description&&"authentication_expired"===e.error_description)n.login(e.loginOptions);else{var a={error:o,error_description:e.error_description};n.onAuthError&&n.onAuthError(a),t&&t.setError(a)}else t&&t.setSuccess();return}if("standard"!=n.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&r){var u="code="+r+"&grant_type=authorization_code",p=n.endpoints.token(),d=new XMLHttpRequest;d.open("POST",p,!0),d.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u+="&client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(u+="&code_verifier="+e.pkceCodeVerifier),d.withCredentials=!0,d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status){var e=JSON.parse(d.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),S()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},d.send(u)}function h(r,o,i,a){g(r,o,i,s=(s+new Date().getTime())/2),l&&n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce?(c("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):a&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function f(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function g(e,t,r,o){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=tC(t)):(delete n.refreshToken,delete n.refreshTokenParsed),r?(n.idToken=r,n.idTokenParsed=tC(r)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=tC(e),n.sessionId=n.tokenParsed.sid,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,o&&(n.timeSkew=Math.floor(o/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(c("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var i=(n.tokenParsed.exp-new Date().getTime()/1e3+n.timeSkew)*1e3;c("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,i)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.authenticated=!1}function y(){var e="0123456789abcdef",t=p(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 m(e){var t=function(e){switch(n.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,r,o,i=e.indexOf("?"),s=e.indexOf("#");if("query"===n.responseMode&&-1!==i?(r=e.substring(0,i),""!==(o=b(e.substring(i+1,-1!==s?s:e.length),t)).paramsString&&(r+="?"+o.paramsString),-1!==s&&(r+=e.substring(s))):"fragment"===n.responseMode&&-1!==s&&(r=e.substring(0,s),""!==(o=b(e.substring(s+1),t)).paramsString&&(r+="#"+o.paramsString)),o&&o.oauthParams){if("standard"===n.flow||"hybrid"===n.flow){if((o.oauthParams.code||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}else if("implicit"===n.flow&&(o.oauthParams.access_token||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}}(e);if(t){var o=r.get(t.state);return o&&(t.valid=!0,t.redirectUri=o.redirectUri,t.storedNonce=o.nonce,t.prompt=o.prompt,t.pkceCodeVerifier=o.pkceCodeVerifier,t.loginOptions=o.loginOptions),t}}function b(e,t){for(var r=e.split("&"),n={paramsString:"",oauthParams:{}},o=0;o<r.length;o++){var i=r[o].indexOf("="),s=r[o].slice(0,i);-1!==t.indexOf(s)?n.oauthParams[s]=r[o].slice(i+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=r[o])}return n}function v(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,r){e.resolve=t,e.reject=r}),e}function _(){var e=v();if(!i.enable||i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=n.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 r=n.endpoints.checkSessionIframe();return t.setAttribute("src",r),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&&n.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),r=t.length-1;r>=0;--r){var o=t[r];"error"==e.data?o.setError():o.setSuccess("unchanged"==e.data)}}},!1),e.promise}function S(){i.enable&&n.token&&setTimeout(function(){w().then(function(e){e&&S()})},1e3*i.interval)}function w(){var e=v();if(i.iframe&&i.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");i.callbackList.push(e);var r=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function k(){var e,t,r,o=v();if(i.enable||n.silentCheckSsoRedirectUri){var s=document.createElement("iframe");s.setAttribute("src",n.endpoints.thirdPartyCookiesIframe()),s.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),s.setAttribute("title","keycloak-3p-check-iframe"),s.style.display="none",document.body.appendChild(s);var a=function(e){s.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(u("[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,n.silentCheckSsoFallback&&(n.silentCheckSsoRedirectUri=!1)),document.body.removeChild(s),window.removeEventListener("message",a),o.setSuccess())};window.addEventListener("message",a,!1)}else o.setSuccess();return e=o.promise,t=n.messageReceiveTimeout,r=null,Promise.race([e,new Promise(function(e,n){r=setTimeout(function(){n({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(r)})}function E(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(n.createLoginUrl(e)),v().promise},logout:async function(e){if("GET"===(e?.logoutMethod??n.logoutMethod))return void window.location.replace(n.createLogoutUrl(e));let r=n.createLogoutUrl(e),o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:n.idToken,client_id:n.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(o.redirected){window.location.href=o.url;return}if(o.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(n.createRegisterUrl(e)),v().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return v().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var r=function(e,t,r){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r)},o=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,r){return t[r]=e.cordovaOptions[r],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,r){return e.push(r+"="+t[r]),e},[]).join(",")},s=function(){return n.redirectUri||"http://localhost"};return{login:function(e){var t=v(),i=o(e),a=r(n.createLoginUrl(e),"_blank",i),l=!1,c=!1,u=function(){c=!0,a.close()};return a.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&(h(m(e.url),t),u(),l=!0)}),a.addEventListener("loaderror",function(e){l||(0==e.url.indexOf(s())?(h(m(e.url),t),u(),l=!0):(t.setError(),u()))}),a.addEventListener("exit",function(e){c||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,o=v(),i=r(n.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return i.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&i.close()}),i.addEventListener("loaderror",function(e){0==e.url.indexOf(s())||(t=!0),i.close()}),i.addEventListener("exit",function(e){t?o.setError():(n.clearToken(),o.setSuccess())}),o.promise},register:function(e){var t=v(),i=r(n.createRegisterUrl(),"_blank",o(e));return i.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&(i.close(),h(m(e.url),t))}),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e){var t=r(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return s()}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=v(),r=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(m(e.url),t)}),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=v(),r=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(r),t.promise},register:function(e){var t=v(),r=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(m(e.url),t)}),window.cordova.plugins.browsertab.openUrl(r),t.promise},accountManagement:function(){var e=n.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:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(o){if(n.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(n.didInitialize=!0,n.authenticated=!1,r=function(){try{return new O}catch(e){}return new x}(),t=o&&["default","cordova","cordova-native"].indexOf(o.adapter)>-1?E(o.adapter):o&&"object"==typeof o.adapter?o.adapter:window.Cordova||window.cordova?E("cordova"):E(),o){if(void 0!==o.useNonce&&(l=o.useNonce),void 0!==o.checkLoginIframe&&(i.enable=o.checkLoginIframe),o.checkLoginIframeInterval&&(i.interval=o.checkLoginIframeInterval),"login-required"===o.onLoad&&(n.loginRequired=!0),o.responseMode)if("query"===o.responseMode||"fragment"===o.responseMode)n.responseMode=o.responseMode;else throw"Invalid value for responseMode";if(o.flow){switch(o.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=o.flow}if(null!=o.timeSkew&&(n.timeSkew=o.timeSkew),o.redirectUri&&(n.redirectUri=o.redirectUri),o.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=o.silentCheckSsoRedirectUri),"boolean"==typeof o.silentCheckSsoFallback?n.silentCheckSsoFallback=o.silentCheckSsoFallback:n.silentCheckSsoFallback=!0,void 0!==o.pkceMethod){if("S256"!==o.pkceMethod&&!1!==o.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${o.pkceMethod}.`);n.pkceMethod=o.pkceMethod}else n.pkceMethod="S256";"boolean"==typeof o.enableLogging?n.enableLogging=o.enableLogging:n.enableLogging=!1,"POST"===o.logoutMethod?n.logoutMethod="POST":n.logoutMethod="GET","string"==typeof o.scope&&(n.scope=o.scope),"string"==typeof o.acrValues&&(n.acrValues=o.acrValues),"number"==typeof o.messageReceiveTimeout&&o.messageReceiveTimeout>0?n.messageReceiveTimeout=o.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var s=v(),a=v();a.promise.then(function(){n.onReady&&n.onReady(n.authenticated),s.setSuccess(n.authenticated)}).catch(function(e){s.setError(e)});var c=function(){var t=v();function r(e){e?n.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}}:n.endpoints={authorize:function(){return d()+"/protocol/openid-connect/auth"},token:function(){return d()+"/protocol/openid-connect/token"},logout:function(){return d()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=d()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=d()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return d()+"/protocol/openid-connect/registrations"},userinfo:function(){return d()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(s=e):s="keycloak.json",s){var o=new XMLHttpRequest;o.open("GET",s,!0),o.setRequestHeader("Accept","application/json"),o.onreadystatechange=function(){if(4==o.readyState)if(200==o.status||f(o)){var e=JSON.parse(o.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,r(null),t.setSuccess()}else t.setError()},o.send()}else{if(!e.clientId)throw"clientId missing";n.clientId=e.clientId;var i=e.oidcProvider;if(i)if("string"==typeof i){var s,a="/"==i.charAt(i.length-1)?i+".well-known/openid-configuration":i+"/.well-known/openid-configuration",o=new XMLHttpRequest;o.open("GET",a,!0),o.setRequestHeader("Accept","application/json"),o.onreadystatechange=function(){4==o.readyState&&(200==o.status||f(o)?(r(JSON.parse(o.responseText)),t.setSuccess()):t.setError())},o.send()}else r(i),t.setSuccess();else{if(!e.url){for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++)if(l[c].src.match(/.*keycloak\.js/)){e.url=l[c].src.substr(0,l[c].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,r(null),t.setSuccess()}}return t.promise}();function u(){var e=function(e){e||(r.prompt="none"),o&&o.locale&&(r.locale=o.locale),n.login(r).then(function(){a.setSuccess()}).catch(function(e){a.setError(e)})},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.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 r=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(h(m(t.data),a),document.body.removeChild(e),window.removeEventListener("message",r))};window.addEventListener("message",r)},r={};switch(o.onLoad){case"check-sso":i.enable?_().then(function(){w().then(function(r){r?a.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){a.setError(e)})}):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function p(){var e=m(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return _().then(function(){h(e,a)}).catch(function(e){a.setError(e)});o?o.token&&o.refreshToken?(g(o.token,o.refreshToken,o.idToken),i.enable?_().then(function(){w().then(function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess(),S()):a.setSuccess()}).catch(function(e){a.setError(e)})}):n.updateToken(-1).then(function(){n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess()}).catch(function(e){n.onAuthError&&n.onAuthError(),o.onLoad?u():a.setError(e)})):o.onLoad?u():a.setSuccess():a.setSuccess()}return c.then(function(){var e,t;(e=v(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(k).then(p).catch(function(e){s.setError(e)})}),c.catch(function(e){s.setError(e)}),s.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var o,i=y(),s=y(),a=t.redirectUri(e),c={state:i,nonce:s,redirectUri:encodeURIComponent(a),loginOptions:e};e&&e.prompt&&(c.prompt=e.prompt),o=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var u=e&&e.scope||n.scope;u?-1===u.indexOf("openid")&&(u="openid "+u):u="openid";var d=o+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(a)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(u);if(l&&(d=d+"&nonce="+encodeURIComponent(s)),e&&e.prompt&&(d+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(d+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(d+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(d+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(d+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(d+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(d+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||n.acrValues)&&(d+="&acr_values="+encodeURIComponent(e.acrValues||n.acrValues)),n.pkceMethod){var h=p(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=h,d+="&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(tA.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(n.pkceMethod,h)+"&code_challenge_method="+n.pkceMethod}return r.add(c),d},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??n.logoutMethod))return n.endpoints.logout();var r=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(r+="&id_token_hint="+encodeURIComponent(n.idToken)),r},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var r=d(),o=void 0;return void 0!==r&&(o=r+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),o},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var r=n.resourceAccess[t||n.clientId];return!!r&&r.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=d()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),r.setSuccess(n.profile)):r.setError())},t.send(),r.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),r.setSuccess(n.userInfo)):r.setError())},t.send(),r.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return c("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=v();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,c("[KEYCLOAK] Refreshing token: forced refresh")):(!n.tokenParsed||n.isTokenExpired(e))&&(r=!0,c("[KEYCLOAK] Refreshing token: token expired")),r){var i="grant_type=refresh_token&refresh_token="+n.refreshToken,s=n.endpoints.token();if(o.push(t),1==o.length){var a=new XMLHttpRequest;a.open("POST",s,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.withCredentials=!0,i+="&client_id="+encodeURIComponent(n.clientId);var l=new Date().getTime();a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){c("[KEYCLOAK] Token refreshed"),l=(l+new Date().getTime())/2;var e=JSON.parse(a.responseText);g(e.access_token,e.refresh_token,e.id_token,l),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=o.pop();null!=t;t=o.pop())t.setSuccess(!0)}else{u("[KEYCLOAK] Failed to refresh token"),400==a.status&&n.clearToken(),n.onAuthRefreshError&&n.onAuthRefreshError();for(var t=o.pop();null!=t;t=o.pop())t.setError(!0)}},a.send(i)}}else t.setSuccess(!1)};return i.enable?w().then(function(){r()}).catch(function(e){t.setError(e)}):r(),t.promise},n.clearToken=function(){n.token&&(g(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var O=function(){if(!(this instanceof O))return new O;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var r=localStorage.key(t);if(r&&0==r.indexOf("kc-callback-")){var n=localStorage.getItem(r);if(n)try{var o=JSON.parse(n).expires;(!o||o<e)&&localStorage.removeItem(r)}catch(e){localStorage.removeItem(r)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var r="kc-callback-"+t,n=localStorage.getItem(r);return n&&(localStorage.removeItem(r),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var r="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(r,JSON.stringify(t))}},x=function(){if(!(this instanceof x))return new x;this.get=function(n){if(n){var o=t("kc-callback-"+n);if(r("kc-callback-"+n,"",e(-100)),o)return JSON.parse(o)}},this.add=function(t){r("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){r(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+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},r=function(e,t,r){var n=e+"="+t+"; expires="+r.toUTCString()+"; ";document.cookie=n}};function A(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var tI=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let tT=e=>t=>(t=>class extends t{constructor(){super(...arguments),this._connectRequested=!1,this._statusCallback=e=>this._onEventProviderStatusChanged(e)}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.connectEvents()}disconnectedCallback(){this.disconnectEvents(),super.disconnectedCallback&&super.disconnectedCallback()}connectEvents(){e.getEventProvider()?this._connectRequested||(this._connectRequested=!0,e.getEventProvider().subscribeStatusChange(this._statusCallback),this._doConnect()):console.log("No event provider available so cannot subscribe")}disconnectEvents(){this._connectRequested&&(this._connectRequested=!1,e.getEventProvider().unsubscribeStatusChange(this._statusCallback),this._onEventsDisconnect())}_doConnect(){return tI(this,void 0,void 0,function*(){this.eventsConnected&&this._onEventsConnect()})}get eventsConnected(){return this._connectRequested&&e.getEventProvider().status===s.CONNECTED}_onEventProviderStatusChanged(e){switch(e){case s.DISCONNECTED:this._onEventsDisconnect();break;case s.CONNECTED:this._doConnect()}}_onEventsConnect(){this._addEventSubscriptions(),this.onEventsConnect()}_onEventsDisconnect(){this._removeEventSubscriptions(),this.onEventsDisconnect()}_addEventSubscriptions(){return tI(this,void 0,void 0,function*(){let t=!!this._attributeRefs,r=!!this._assetIds,n=this._attributeRefs?this._attributeRefs:this._assetIds;if(n&&n.length>0){if(this._subscriptionIds=[],r){let t=yield e.getEventProvider().subscribeAssetEvents(n,!0,e=>this._onEvent(e)),r=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!ef(n,r))return void e.getEventProvider().unsubscribe(t);this._subscriptionIds.push(t)}let o=yield e.getEventProvider().subscribeAttributeEvents(n,t,e=>this._onEvent(e)),i=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!ef(n,i))return void e.getEventProvider().unsubscribe(o);this._subscriptionIds.push(o)}})}_removeEventSubscriptions(){this._subscriptionIds&&(this._subscriptionIds.forEach(t=>{e.getEventProvider().unsubscribe(t)}),this._subscriptionIds=void 0)}_refreshEventSubscriptions(){this._removeEventSubscriptions(),this._addEventSubscriptions()}set assetIds(e){ef(this._assetIds,e)||(this._assetIds=e,this._refreshEventSubscriptions(),this.requestUpdate("assetIds"))}get assetIds(){return this._assetIds}set attributeRefs(e){ef(this._attributeRefs,e)||(this._attributeRefs=e,this._refreshEventSubscriptions())}get attributeRefs(){return this._attributeRefs}_sendEvent(t){e.getEventProvider().sendEvent(t)}_sendEventWithReply(t){return e.getEventProvider().sendEventWithReply(t)}onEventsConnect(){}onEventsDisconnect(){}_onEvent(e){}})(t),tN="#4d9d2a",tL="#FFFFFF",tj="#FFFFFF",tU="#F9F9F9",tD="#CCCCCC",tM="#be0000",tF="#FFFFFF",t$="#4c4c4c",tB="#000000",tV="#000000",tK="#FFFFFF",tH="0 5px 5px -5px rgba(0,0,0,0.3)",tW="0 1px 3px 0 rgba(0,0,0,0.21)";var tG=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let tq="mdi",tz="openremote",tJ="restricted_user";(o=a||(a={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",o.AUTH_FAILED="AUTH_FAILED",o.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",o.CONSOLE_ERROR="CONSOLE_INIT_ERROR",o.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",o.TRANSLATION_ERROR="TRANSLATION_ERROR",(i=l||(l={})).ERROR="ERROR",i.READY="READY",i.ONLINE="ONLINE",i.OFFLINE="OFFLINE",i.CONNECTING="CONNECTING",i.CONSOLE_INIT="CONSOLE_INIT",i.CONSOLE_READY="CONSOLE_READY",i.TRANSLATE_INIT="TRANSLATE_INIT",i.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",i.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",i.LOGIN="LOGIN";let tY={en:"english",cn:"chinese",cs:"czech",nl:"dutch",fr:"french",de:"german",it:"italian",pl:"polish",pt:"portuguese",ro:"romanian",es:"spanish",uk:"ukrainian"},tX={cn:"zh-cn"};function tQ(e){e.services.formatter.add("uppercase",e=>"string"==typeof e?e.toUpperCase():String(e)),e.services.formatter.add("lll",(e,t)=>{var r;return et()(e).locale(null!=(r=tX[t])?r:t).format("lll")}),e.services.formatter.add("llll",(e,t,r)=>{var n;return et()(e).locale(null!=(n=tX[t])?n:t).format((null==r?void 0:r.weekday)==="long"?"LLLL":"llll")})}function tZ(e){let t=e?Object.assign({},e):{};return t.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=tz),t}class t0{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,r])=>{let n=r.roles;e.set(t,n)}),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 tt()}get language(){return X.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(X.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(l.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||tz}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 tG(this,void 0,void 0,function*(){this._config&&console.debug("Already initialised"),this._config=tZ(e);let t=yield this.loadManagerInfo(),r=new e7(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(l.CONSOLE_READY)});if(this._console=r,"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,this._config.keycloakUrl=this._authServerUrl):this._authServerUrl.startsWith("http")?this._config.keycloakUrl=this._authServerUrl:((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(/\/+$/,""),t=yield this.doAuthInit()}return!!t&&(t&&(t=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(t=(yield this.doTranslateInit())&&t)&&(t=yield this.doDescriptorsInit(),t=yield this.getConsoleAppConfig()),this.doIconInit(),t?(t=yield this.doEventsSubscriptionInit(),this._ready=!0,this._emitEvent(l.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",t)})}loadManagerInfo(){return tG(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let r=new XMLHttpRequest;r.addEventListener("load",()=>{e(JSON.parse(r.responseText))}),r.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),r.open("GET",this._config.managerUrl+"/api/master/info"),r.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(a.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return tG(this,void 0,void 0,function*(){if(X.isInitialized)return!0;X.on("initialized",e=>{this._emitEvent(l.TRANSLATE_INIT)}),X.on("languageChanged",e=>{var t;et().locale(null!=(t=tX[e])?t:e),this._emitEvent(l.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,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 X.use(tO).init(e),tQ(X)}catch(e){return console.error(e),this._setError(a.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return tG(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield tt().api.AssetModelResource.getAssetInfos(),t=yield tt().api.AssetModelResource.getMetaItemDescriptors(),r=yield tt().api.AssetModelResource.getValueDescriptors();u.AssetModelUtil._assetTypeInfos=e.data,u.AssetModelUtil._metaItemDescriptors=Object.values(t.data),u.AssetModelUtil._valueDescriptors=Object.values(r.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return tG(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(a.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(tt().addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return tt().setTimeout(2e4),tt().initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return tG(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new tl(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(a.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===s.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 s.DISCONNECTED:this._onDisconnect();break;case s.CONNECTED:break;case s.CONNECTING:this._emitEvent(l.CONNECTING)}}doConsoleInit(){return tG(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(l.CONSOLE_INIT),!0}catch(e){return this._setError(a.CONSOLE_ERROR),!1}})}doIconInit(){this._config.loadIcons&&(tx.IconSets.addIconSet("mdi",(0,tx.createMdiIconSet)(t1.managerUrl)),tx.IconSets.addIconSet("or",(0,tx.createSvgIconSet)(tx.OrIconSet.size,tx.OrIconSet.icons)))}getConsoleAppConfig(){return tG(this,void 0,void 0,function*(){var e;try{let t=yield fetch((null!=(e=t1.managerUrl)?e:"")+"/consoleappconfig/"+t1.displayRealm+".json");return this._consoleAppConfig=yield t.json(),!0}catch(e){return!0}})}getConsolePreferredLanguage(){return tG(this,arguments,void 0,function*(e=this.console){return e.retrieveData("LANGUAGE")})}getUserPreferredLanguage(){return tG(this,arguments,void 0,function*(e=this._keycloak){if(e&&e.authenticated){let t=(null==e?void 0:e.profile)||(yield null==e?void 0:e.loadUserProfile());if(null==t?void 0:t.attributes){let e=new Map(Object.entries(t.attributes));if(e.has("locale")){let t=e.get("locale");if("string"==typeof t[0])return t[0]}console.warn("Could not get user language from keycloak: no user attributes were found.")}else console.warn("Could not get user language from keycloak: no valid keycloak user profile was found.")}})}updateKeycloakUserLanguage(e){return tG(this,arguments,void 0,function*(e,t=this.rest){this.authenticated?t?yield t.api.UserResource.updateCurrentUserLocale(e,{headers:{"Content-Type":"application/json"}}):console.warn("Tried updating user language, but the REST API is not initialized yet."):console.warn("Tried updating user language, but the user is not authenticated.")})}logout(e){this._authenticated&&(this._authenticated=!0,this._keycloak&&(this.isMobile()&&this.console.storeData("REFRESH_TOKEN",null),this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._keycloak.logout(e&&""!==e?{redirectUri:e}:void 0)))}login(e){if("KEYCLOAK"===this._config.auth&&this._keycloak){let t={};e&&e.redirectUrl&&""!==e.redirectUrl&&(t.redirectUri=e.redirectUrl),(null==e?void 0:e.action)&&""!==e.action&&(t.action=e.action),this.isMobile()&&(t.scope="offline_access"),this._keycloak.login(t)}}isSuperUser(){return!!(this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole(tJ)}getApiBaseUrl(){let e=this._config.managerUrl;return e+("/api/"+this._config.realm+"/")}getAppName(){let e=location.pathname.split("/");return e.length>=1?e[1]:""}hasRealmRole(e){return this.isKeycloak()&&this._keycloak.hasRealmRole(e)}hasRole(e,t=this._config.clientId){let r=this.roles;return r&&r.has(t)&&r.get(t).indexOf(e)>=0}getAuthorizationHeader(){if(this.getKeycloakToken())return"Bearer "+this.getKeycloakToken()}retrieveAuthorizationHeader(){return tG(this,void 0,void 0,function*(){let e=yield this.retrieveKeycloakToken();if(e)return"Bearer "+e})}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}retrieveKeycloakToken(){return tG(this,void 0,void 0,function*(){if(this.isKeycloak())return yield this._updateKeycloakAccessToken(),this._keycloak.token})}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this._authenticated=!0}loadAndInitialiseKeycloak(){return tG(this,void 0,void 0,function*(){var e,t,r,n,o;try{this._keycloak=new tP({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl});let i=yield this._getNativeOfflineRefreshToken(),s=yield this._keycloak.init({checkLoginIframe:!1,onLoad:"check-sso"});if(!s&&i)try{console.error("SETTING OFFLINE TOKEN"),this._keycloak.refreshToken=i,s=yield this._updateKeycloakAccessToken()}catch(e){console.error("Failed to authenticate using offline token")}if(s){this._name=null==(e=this._keycloak.tokenParsed)?void 0:e.name,this._username=null==(t=this._keycloak.tokenParsed)?void 0:t.preferred_username,this.isMobile()&&(null==(n=null==(r=this._keycloak)?void 0:r.refreshTokenParsed)?void 0:n.typ)==="Offline"&&(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)),this._onAuthenticated(),this._createTokenUpdateInterval();let i=null==(o=this._keycloak.tokenParsed)?void 0:o.session_state;i&&sessionStorage.getItem("or-session")!==i&&(sessionStorage.setItem("or-session",i),this._emitEvent(l.LOGIN))}else if(this.config.autoLogin)return this.login(),!1;return!0}catch(e){return this._authenticated=!1,this._setError(a.AUTH_FAILED),console.error("Failed to initialise Keycloak: "+e),!1}})}_createTokenUpdateInterval(){this._authenticated?this._keycloakUpdateTokenInterval||(this._keycloakUpdateTokenInterval=window.setInterval(()=>tG(this,void 0,void 0,function*(){yield this._updateKeycloakAccessToken().catch(()=>{console.debug("Keycloak failed to refresh the access token"),this._onDisconnect()})}),1e4)):console.warn("User is not authenticated; skipping token update interval creation.")}_updateKeycloakAccessToken(){return tG(this,void 0,void 0,function*(){let e=yield this._keycloak.updateToken(20);return console.debug("Access token update success, refreshed from server: "+e),e&&this._onAuthenticated(),e})}_getNativeOfflineRefreshToken(){return tG(this,void 0,void 0,function*(){if(this.isMobile())return yield this.console.retrieveData("REFRESH_TOKEN")})}_emitEvent(e){window.setTimeout(()=>{for(let t of this._listeners)t(e)},0)}_setError(e){this._error=e,this._emitEvent(l.ERROR),console.warn("Error set: "+e)}_clearWebHistory(){var e;this.isMobile()&&(null==(e=this.console)||e._doSendGenericMessage("CLEAR_WEB_HISTORY",void 0))}_onDisconnect(){return tG(this,void 0,void 0,function*(){this._disconnected||(console.debug("Disconnected"),this._disconnected=!0,this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._emitEvent(l.OFFLINE),this.reconnect())})}_onReconnected(){console.debug("Reconnected to the Manager."),this._disconnected=!1,this._createTokenUpdateInterval(),this._emitEvent(l.ONLINE)}reconnect(){return tG(this,arguments,void 0,function*(e=3e3){if(console.debug("Checking connection to the Manager..."),!this._disconnected)return void console.debug("Manager is still connected. No action necessary.");console.debug("Manager is disconnected!"),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=void 0);let t=()=>tG(this,void 0,void 0,function*(){var e,t;if(console.debug("Reconnecting to the Manager..."),!this._authenticated){console.debug("User is not authenticated, skipping token refresh");let t=()=>{var e;return(null==(e=this.events)?void 0:e.status)===s.CONNECTED};return t()||(yield null==(e=this.events)?void 0:e.connect()),t()}if(!(yield this.isKeycloakReachable()))return console.error("Keycloak is not reachable. Reconnect attempt failed."),!1;try{yield this._updateKeycloakAccessToken()}catch(t){console.error("Could not update Keycloak access token, attempting again using offline token...",t);let e=yield this._getNativeOfflineRefreshToken();this._keycloak.refreshToken=e,e||console.warn("No offline token was found on this device.");try{yield this._updateKeycloakAccessToken()}catch(e){throw this.login(),Error("Cannot update access token so sending to login")}console.debug("Keycloak access token is valid")}let r=()=>{var e;return(null==(e=this.events)?void 0:e.status)===s.CONNECTED};return r()||(console.debug("Event provider offline, attempting to reconnect using latest auth token."),yield null==(t=this.events)?void 0:t.connect()),r()}),r=yield t();if(void 0!==r){if(!r){e=Math.min(t0.MAX_RECONNECT_DELAY,e+3e3),console.error(`Failed to reconnect to the Manager. Attempting again in ${e}...`),this._reconnectTimer=window.setTimeout(()=>this.reconnect(e),e);return}this._onReconnected()}})}isKeycloakReachable(){return tG(this,arguments,void 0,function*(e=2e3){let t=new AbortController,r=setTimeout(()=>t.abort(),e);try{let e=this._keycloak.endpoints.token(),r=yield fetch(e,{method:"OPTIONS",signal:t.signal});return 200===r.status}catch(e){return!1}finally{clearTimeout(r)}})}}t0.MAX_RECONNECT_DELAY=45e3;let t1=new t0,t2=t1})(),ORCore=n})();
|
|
1
|
+
var ORCore;(()=>{var e={3260(e){"use strict";let t=(async function(){}).constructor;e.exports=()=>t},7052(e){"use strict";let t=(async function*(){}).constructor;e.exports=()=>t},9630(e,t,r){"use strict";var n=r(469),i=r(24),o=r(1530);e.exports=r(7009)||n.call(o,i)},24(e){"use strict";e.exports=Function.prototype.apply},1530(e){"use strict";e.exports=Function.prototype.call},7196(e,t,r){"use strict";var n=r(469),i=r(6757),o=r(1530),s=r(9630);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return s(n,o,e)}},7009(e){"use strict";e.exports="u">typeof Reflect&&Reflect&&Reflect.apply},8682(e,t,r){"use strict";var n=r(4295),i=r(7196),o=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i([r]):r}},714(e,t,r){"use strict";var n,i=r(7196),o=r(1233);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&o&&o(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?i([s.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},9997(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},155(e){"use strict";e.exports=EvalError},593(e){"use strict";e.exports=Error},7180(e){"use strict";e.exports=RangeError},9304(e){"use strict";e.exports=ReferenceError},1742(e){"use strict";e.exports=SyntaxError},6757(e){"use strict";e.exports=TypeError},4923(e){"use strict";e.exports=URIError},802(e){"use strict";e.exports=Object},9691(e){"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r},i=function(e,t){for(var r=[],n=t||0,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r},o=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};e.exports=function(e){var s,a=this;if("function"!=typeof a||"[object Function]"!==t.apply(a))throw TypeError("Function.prototype.bind called on incompatible "+a);for(var l=i(arguments,1),c=r(0,a.length-l.length),u=[],d=0;d<c;d++)u[d]="$"+d;if(s=Function("binder","return function ("+o(u,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof s){var t=a.apply(this,n(l,arguments));return Object(t)===t?t:this}return a.apply(e,n(l,arguments))}),a.prototype){var p=function(){};p.prototype=a.prototype,s.prototype=new p,p.prototype=null}return s}},469(e,t,r){"use strict";var n=r(9691);e.exports=Function.prototype.bind||n},5175(e){"use strict";let t=(function*(){}).constructor;e.exports=()=>t},4295(e,t,r){"use strict";var n,i=r(802),o=r(593),s=r(155),a=r(7180),l=r(9304),c=r(1742),u=r(6757),d=r(4923),p=r(7256),h=r(5414),f=r(7954),g=r(3452),y=r(1358),b=r(5720),m=r(3515),v=r(1233),_=r(9997),S=function(){throw new u},w=v?function(){try{return arguments.callee,S}catch(e){try{return v(arguments,"callee").get}catch(e){return S}}}():S,k=r(8573)(),E=r(7582),O=r(2170),x=r(9090),A=r(24),R=r(1530),C={},P="u">typeof Uint8Array&&E?E(Uint8Array):n,I={__proto__:null,"%AggregateError%":"u"<typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"u"<typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":k&&E?E([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":"u"<typeof Atomics?n:Atomics,"%BigInt%":"u"<typeof BigInt?n:BigInt,"%BigInt64Array%":"u"<typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"u"<typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"u"<typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"u"<typeof Float16Array?n:Float16Array,"%Float32Array%":"u"<typeof Float32Array?n:Float32Array,"%Float64Array%":"u"<typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"u"<typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":C,"%Int8Array%":"u"<typeof Int8Array?n:Int8Array,"%Int16Array%":"u"<typeof Int16Array?n:Int16Array,"%Int32Array%":"u"<typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&E?E(E([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"u"<typeof Map?n:Map,"%MapIteratorPrototype%":"u">typeof Map&&k&&E?E(new Map()[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"u"<typeof Promise?n:Promise,"%Proxy%":"u"<typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"u"<typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"u"<typeof Set?n:Set,"%SetIteratorPrototype%":"u">typeof Set&&k&&E?E(new Set()[Symbol.iterator]()):n,"%SharedArrayBuffer%":"u"<typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&E?E(""[Symbol.iterator]()):n,"%Symbol%":k?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":w,"%TypedArray%":P,"%TypeError%":u,"%Uint8Array%":"u"<typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"u"<typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"u"<typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"u"<typeof Uint32Array?n:Uint32Array,"%URIError%":d,"%WeakMap%":"u"<typeof WeakMap?n:WeakMap,"%WeakRef%":"u"<typeof WeakRef?n:WeakRef,"%WeakSet%":"u"<typeof WeakSet?n:WeakSet,"%Function.prototype.call%":R,"%Function.prototype.apply%":A,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":O,"%Math.abs%":p,"%Math.floor%":h,"%Math.max%":f,"%Math.min%":g,"%Math.pow%":y,"%Math.round%":b,"%Math.sign%":m,"%Reflect.getPrototypeOf%":x};if(E)try{null.error}catch(e){var T=E(E(e));I["%Error.prototype%"]=T}var L=r(3260),N=r(5175),j=r(7052),D=function e(t){var r;if("%AsyncFunction%"===t)r=L()||void 0;else if("%GeneratorFunction%"===t)r=N()||void 0;else if("%AsyncGeneratorFunction%"===t)r=j()||void 0;else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&E&&(r=E(i.prototype))}return I[t]=r,r},U={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=r(469),F=r(9731),$=M.call(R,Array.prototype.concat),B=M.call(A,Array.prototype.splice),V=M.call(R,String.prototype.replace),K=M.call(R,String.prototype.slice),H=M.call(R,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,q=function(e){var t=K(e,0,1),r=K(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return V(e,W,function(e,t,r,i){n[n.length]=r?V(i,G,"$1"):t||e}),n},z=function(e,t){var r,n=e;if(F(U,n)&&(n="%"+(r=U[n])[0]+"%"),F(I,n)){var i=I[n];if(i===C&&(i=D(n)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=q(e),n=r.length>0?r[0]:"",i=z("%"+n+"%",t),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],B(r,$([0,1],l)));for(var d=1,p=!0;d<r.length;d+=1){var h=r[d],f=K(h,0,1),g=K(h,-1);if(('"'===f||"'"===f||"`"===f||'"'===g||"'"===g||"`"===g)&&f!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==h&&p||(a=!0),n+="."+h,F(I,o="%"+n+"%"))s=I[o];else if(null!=s){if(!(h in s)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(v&&d+1>=r.length){var y=v(s,h);s=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:s[h]}else p=F(s,h),s=s[h];p&&!a&&(I[o]=s)}}return s}},2170(e,t,r){"use strict";e.exports=r(802).getPrototypeOf||null},9090(e){"use strict";e.exports="u">typeof Reflect&&Reflect.getPrototypeOf||null},7582(e,t,r){"use strict";var n=r(9090),i=r(2170),o=r(714);e.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("getProto: not an object");return i(e)}:o?function(e){return o(e)}:null},1067(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},1233(e,t,r){"use strict";var n=r(1067);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8573(e,t,r){"use strict";var n="u">typeof Symbol&&Symbol,i=r(9535);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},9535(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},9731(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;e.exports=r(469).call(n,i)},4954(e,t,r){!function(){"use strict";var t="input is invalid type",n="object"==typeof window,i=n?window:{};i.JS_SHA256_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self,s=!i.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;s?i=r.g:o&&(i=self);var a=!i.JS_SHA256_NO_COMMON_JS&&e.exports,l="function"==typeof define&&define.amd,c=!i.JS_SHA256_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,u="0123456789abcdef".split(""),d=[-0x80000000,8388608,32768,128],p=[24,16,8,0],h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],f=["hex","array","digest","arrayBuffer"],g=[];(i.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),c&&(i.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(r){return new S(t,!0).update(r)[e]()}},b=function(e){var t=y("hex",e);s&&(t=m(t,e)),t.create=function(){return new S(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=y(n,e)}return t},m=function(e,n){var o,s=r(7791),a=r(5610).Buffer,l=n?"sha224":"sha256";return o=a.from&&!i.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(r){if("string"==typeof r)return s.createHash(l).update(r,"utf8").digest("hex");if(null==r)throw Error(t);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?s.createHash(l).update(o(r)).digest("hex"):e(r)}},v=function(e,t){return function(r,n){return new w(r,t,!0).update(n)[e]()}},_=function(e){var t=v("hex",e);t.create=function(t){return new w(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=v(n,e)}return t};function S(e,t){t?(g[0]=g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0,this.blocks=g):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=0xc1059ed8,this.h1=0x367cd507,this.h2=0x3070dd17,this.h3=0xf70e5939,this.h4=0xffc00b31,this.h5=0x68581511,this.h6=0x64f98fa7,this.h7=0xbefa4fa4):(this.h0=0x6a09e667,this.h1=0xbb67ae85,this.h2=0x3c6ef372,this.h3=0xa54ff53a,this.h4=0x510e527f,this.h5=0x9b05688c,this.h6=0x1f83d9ab,this.h7=0x5be0cd19),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function w(e,r,n){var i,o=typeof e;if("string"===o){var s,a=[],l=e.length,u=0;for(i=0;i<l;++i)(s=e.charCodeAt(i))<128?a[u++]=s:(s<2048?a[u++]=192|s>>>6:(s<55296||s>=57344?a[u++]=224|s>>>12:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++i)),a[u++]=240|s>>>18,a[u++]=128|s>>>12&63),a[u++]=128|s>>>6&63),a[u++]=128|63&s);e=a}else if("object"===o){if(null===e)throw Error(t);else if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!c||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);e.length>64&&(e=new S(r,!0).update(e).array());var d=[],p=[];for(i=0;i<64;++i){var h=e[i]||0;d[i]=92^h,p[i]=54^h}S.call(this,r,n),this.update(p),this.oKeyPad=d,this.inner=!0,this.sharedMemory=n}S.prototype.update=function(e){if(!this.finalized){var r,n=typeof e;if("string"!==n){if("object"===n){if(null===e)throw Error(t);else if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!c||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var i,o,s=0,a=e.length,l=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,this.block=l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),r)for(o=this.start;s<a&&o<64;++s)l[o>>>2]|=e[s]<<p[3&o++];else for(o=this.start;s<a&&o<64;++s)(i=e.charCodeAt(s))<128?l[o>>>2]|=i<<p[3&o++]:(i<2048?l[o>>>2]|=(192|i>>>6)<<p[3&o++]:(i<55296||i>=57344?l[o>>>2]|=(224|i>>>12)<<p[3&o++]:(i=65536+((1023&i)<<10|1023&e.charCodeAt(++s)),l[o>>>2]|=(240|i>>>18)<<p[3&o++],l[o>>>2]|=(128|i>>>12&63)<<p[3&o++]),l[o>>>2]|=(128|i>>>6&63)<<p[3&o++]),l[o>>>2]|=(128|63&i)<<p[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=l[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000|0,this.bytes=this.bytes%0x100000000),this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=d[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var e,t,r,n,i,o,s,a,l,c,u=this.h0,d=this.h1,p=this.h2,f=this.h3,g=this.h4,y=this.h5,b=this.h6,m=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((i=v[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=v[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,v[e]=v[e-16]+t+v[e-7]+r|0;for(c=d&p,e=0;e<64;e+=4)this.first?(this.is224?(s=300032,m=(i=v[0]-0x543c9a5b)-0x8f1a6c7|0,f=i+0x170e9b5|0):(s=0x2a01a605,m=(i=v[0]-0xc881298)-0x5ab00ac6|0,f=i+0x8909ae5|0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),n=(s=u&d)^u&p^c,i=m+r+(g&y^~g&b)+h[e]+v[e],o=t+n,m=f+i|0,f=i+o|0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),n=(a=f&u)^f&d^s,i=b+r+(m&g^~m&y)+h[e+1]+v[e+1],o=t+n,b=p+i|0,t=((p=i+o|0)>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),n=(l=p&f)^p&u^a,i=y+r+(b&m^~b&g)+h[e+2]+v[e+2],o=t+n,y=d+i|0,t=((d=i+o|0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),n=(c=d&p)^d&f^l,i=g+r+(y&b^~y&m)+h[e+3]+v[e+3],o=t+n,g=u+i|0,u=i+o|0,this.chromeBugWorkAround=!0;this.h0=this.h0+u|0,this.h1=this.h1+d|0,this.h2=this.h2+p|0,this.h3=this.h3+f|0,this.h4=this.h4+g|0,this.h5=this.h5+y|0,this.h6=this.h6+b|0,this.h7=this.h7+m|0},S.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,l=u[e>>>28&15]+u[e>>>24&15]+u[e>>>20&15]+u[e>>>16&15]+u[e>>>12&15]+u[e>>>8&15]+u[e>>>4&15]+u[15&e]+u[t>>>28&15]+u[t>>>24&15]+u[t>>>20&15]+u[t>>>16&15]+u[t>>>12&15]+u[t>>>8&15]+u[t>>>4&15]+u[15&t]+u[r>>>28&15]+u[r>>>24&15]+u[r>>>20&15]+u[r>>>16&15]+u[r>>>12&15]+u[r>>>8&15]+u[r>>>4&15]+u[15&r]+u[n>>>28&15]+u[n>>>24&15]+u[n>>>20&15]+u[n>>>16&15]+u[n>>>12&15]+u[n>>>8&15]+u[n>>>4&15]+u[15&n]+u[i>>>28&15]+u[i>>>24&15]+u[i>>>20&15]+u[i>>>16&15]+u[i>>>12&15]+u[i>>>8&15]+u[i>>>4&15]+u[15&i]+u[o>>>28&15]+u[o>>>24&15]+u[o>>>20&15]+u[o>>>16&15]+u[o>>>12&15]+u[o>>>8&15]+u[o>>>4&15]+u[15&o]+u[s>>>28&15]+u[s>>>24&15]+u[s>>>20&15]+u[s>>>16&15]+u[s>>>12&15]+u[s>>>8&15]+u[s>>>4&15]+u[15&s];return this.is224||(l+=u[a>>>28&15]+u[a>>>24&15]+u[a>>>20&15]+u[a>>>16&15]+u[a>>>12&15]+u[a>>>8&15]+u[a>>>4&15]+u[15&a]),l},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,l=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||l.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),l},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},w.prototype=new S,w.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}};var k=b();k.sha256=k,k.sha224=b(!0),k.sha256.hmac=_(),k.sha224.hmac=_(!0),a?e.exports=k:(i.sha256=k.sha256,i.sha224=k.sha224,l&&define(function(){return k}))}()},3472(e,t,r){e=r.nmd(e);var n,i="__lodash_hash_undefined__",o="[object Arguments]",s="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object Map]",p="[object Number]",h="[object Object]",f="[object Promise]",g="[object RegExp]",y="[object Set]",b="[object String]",m="[object Symbol]",v="[object WeakMap]",_="[object ArrayBuffer]",S="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/,E=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,x=/\\(\\)?/g,A=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[o]=C[s]=C[_]=C[a]=C[S]=C[l]=C[c]=C[u]=C[d]=C[p]=C[h]=C[g]=C[y]=C[b]=C[v]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,I="object"==typeof self&&self&&self.Object===Object&&self,T=P||I||Function("return this")(),L=t&&!t.nodeType&&t,N=L&&e&&!e.nodeType&&e,j=N&&N.exports===L&&P.process,D=function(){try{return j&&j.binding("util")}catch(e){}}(),U=D&&D.isTypedArray;function M(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function F(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function $(e,t){return function(r){return e(t(r))}}function B(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var V=Array.prototype,K=Function.prototype,H=Object.prototype,W=T["__core-js_shared__"],G=(n=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",q=K.toString,z=H.hasOwnProperty,J=H.toString,Y=RegExp("^"+q.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),X=T.Symbol,Q=T.Uint8Array,Z=$(Object.getPrototypeOf,Object),ee=Object.create,et=H.propertyIsEnumerable,er=V.splice,en=$(Object.keys,Object),ei=eP(T,"DataView"),eo=eP(T,"Map"),es=eP(T,"Promise"),ea=eP(T,"Set"),el=eP(T,"WeakMap"),ec=eP(Object,"create"),eu=eU(ei),ed=eU(eo),ep=eU(es),eh=eU(ea),ef=eU(el),eg=X?X.prototype:void 0,ey=eg?eg.valueOf:void 0,eb=eg?eg.toString:void 0;function em(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ev(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function e_(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function eS(e){var t=-1,r=e?e.length:0;for(this.__data__=new e_;++t<r;)this.add(e[t])}function ew(e){this.__data__=new ev(e)}function ek(e,t){for(var r=e.length;r--;)if(eF(e[r][0],t))return r;return -1}em.prototype.clear=function(){this.__data__=ec?ec(null):{}},em.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},em.prototype.get=function(e){var t=this.__data__;if(ec){var r=t[e];return r===i?void 0:r}return z.call(t,e)?t[e]:void 0},em.prototype.has=function(e){var t=this.__data__;return ec?void 0!==t[e]:z.call(t,e)},em.prototype.set=function(e,t){return this.__data__[e]=ec&&void 0===t?i:t,this},ev.prototype.clear=function(){this.__data__=[]},ev.prototype.delete=function(e){var t=this.__data__,r=ek(t,e);return!(r<0)&&(r==t.length-1?t.pop():er.call(t,r,1),!0)},ev.prototype.get=function(e){var t=this.__data__,r=ek(t,e);return r<0?void 0:t[r][1]},ev.prototype.has=function(e){return ek(this.__data__,e)>-1},ev.prototype.set=function(e,t){var r=this.__data__,n=ek(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},e_.prototype.clear=function(){this.__data__={hash:new em,map:new(eo||ev),string:new em}},e_.prototype.delete=function(e){return eC(this,e).delete(e)},e_.prototype.get=function(e){return eC(this,e).get(e)},e_.prototype.has=function(e){return eC(this,e).has(e)},e_.prototype.set=function(e,t){return eC(this,e).set(e,t),this},eS.prototype.add=eS.prototype.push=function(e){return this.__data__.set(e,i),this},eS.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ev},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ev){var n=r.__data__;if(!eo||n.length<199)return n.push([e,t]),this;r=this.__data__=new e_(n)}return r.set(e,t),this};var eE=function(e,t,r){for(var n=-1,i=Object(e),o=r(e),s=o.length;s--;){var a=o[++n];if(!1===t(i[a],a,i))break}return e};function eO(e,t){var r;t=eL(t,e)?[t]:eB(r=t)?r:ej(r);for(var n=0,i=t.length;null!=e&&n<i;)e=e[eD(t[n++])];return n&&n==i?e:void 0}function ex(e,t){return null!=e&&t in Object(e)}function eA(e,t,r,n,i){return e===t||(null!=e&&null!=t&&(eW(e)||eG(t))?function(e,t,r,n,i,u){var f=eB(e),v=eB(t),w=s,k=s;f||(w=(w=eI(e))==o?h:w),v||(k=(k=eI(t))==o?h:k);var E=w==h&&!M(e),O=k==h&&!M(t),x=w==k;if(x&&!E)return u||(u=new ew),f||ez(e)?eR(e,t,r,n,i,u):function(e,t,r,n,i,o,s){switch(r){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case _:if(e.byteLength!=t.byteLength||!n(new Q(e),new Q(t)))break;return!0;case a:case l:case p:return eF(+e,+t);case c:return e.name==t.name&&e.message==t.message;case g:case b:return e==t+"";case d:var u=F;case y:var h=2&o;if(u||(u=B),e.size!=t.size&&!h)break;var f=s.get(e);if(f)return f==t;o|=1,s.set(e,t);var v=eR(u(e),u(t),n,i,o,s);return s.delete(e),v;case m:if(ey)return ey.call(e)==ey.call(t)}return!1}(e,t,w,r,n,i,u);if(!(2&i)){var A=E&&z.call(e,"__wrapped__"),R=O&&z.call(t,"__wrapped__");if(A||R){var C=A?e.value():e,P=R?t.value():t;return u||(u=new ew),r(C,P,n,i,u)}}return!!x&&(u||(u=new ew),function(e,t,r,n,i,o){var s=2&i,a=eJ(e),l=a.length;if(l!=eJ(t).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in t:z.call(t,u)))return!1}var d=o.get(e);if(d&&o.get(t))return d==t;var p=!0;o.set(e,t),o.set(t,e);for(var h=s;++c<l;){var f=e[u=a[c]],g=t[u];if(n)var y=s?n(g,f,u,t,e,o):n(f,g,u,e,t,o);if(!(void 0===y?f===g||r(f,g,n,i,o):y)){p=!1;break}h||(h="constructor"==u)}if(p&&!h){var b=e.constructor,m=t.constructor;b!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof m&&m instanceof m)&&(p=!1)}return o.delete(e),o.delete(t),p}(e,t,r,n,i,u))}(e,t,eA,r,n,i):e!=e&&t!=t)}function eR(e,t,r,n,i,o){var s=2&i,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e);if(c&&o.get(t))return c==t;var u=-1,d=!0,p=1&i?new eS:void 0;for(o.set(e,t),o.set(t,e);++u<a;){var h=e[u],f=t[u];if(n)var g=s?n(f,h,u,t,e,o):n(h,f,u,e,t,o);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!function(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}(t,function(e,t){if(!p.has(t)&&(h===e||r(h,e,n,i,o)))return p.add(t)})){d=!1;break}}else if(!(h===f||r(h,f,n,i,o))){d=!1;break}}return o.delete(e),o.delete(t),d}function eC(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function eP(e,t){var r,n=null==e?void 0:e[t];return!(!eW(n)||(r=n,G&&G in r))&&(eK(n)||M(n)?Y:A).test(eU(n))?n:void 0}var eI=function(e){return J.call(e)};function eT(e,t){return!!(t=null==t?0x1fffffffffffff:t)&&("number"==typeof e||R.test(e))&&e>-1&&e%1==0&&e<t}function eL(e,t){if(eB(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||eq(e))||k.test(e)||!w.test(e)||null!=t&&e in Object(t)}(ei&&eI(new ei(new ArrayBuffer(1)))!=S||eo&&eI(new eo)!=d||es&&eI(es.resolve())!=f||ea&&eI(new ea)!=y||el&&eI(new el)!=v)&&(eI=function(e){var t=J.call(e),r=t==h?e.constructor:void 0,n=r?eU(r):void 0;if(n)switch(n){case eu:return S;case ed:return d;case ep:return f;case eh:return y;case ef:return v}return t});function eN(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}var ej=eM(function(e){e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(eq(e))return eb?eb.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var t,r=[];return E.test(e)&&r.push(""),e.replace(O,function(e,t,n,i){r.push(n?i.replace(x,"$1"):t||e)}),r});function eD(e){if("string"==typeof e||eq(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function eU(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eM(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(eM.Cache||e_),r}function eF(e,t){return e===t||e!=e&&t!=t}function e$(e){var t;return eG(t=e)&&eV(t)&&z.call(e,"callee")&&(!et.call(e,"callee")||J.call(e)==o)}eM.Cache=e_;var eB=Array.isArray;function eV(e){return null!=e&&eH(e.length)&&!eK(e)}function eK(e){var t=eW(e)?J.call(e):"";return t==u||"[object GeneratorFunction]"==t}function eH(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function eW(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eG(e){return!!e&&"object"==typeof e}function eq(e){return"symbol"==typeof e||eG(e)&&J.call(e)==m}var ez=U?function(e){return U(e)}:function(e){return eG(e)&&eH(e.length)&&!!C[J.call(e)]};function eJ(e){return eV(e)?function(e){var t=eB(e)||e$(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],r=t.length,n=!!r;for(var i in e)z.call(e,i)&&!(n&&("length"==i||eT(i,r)))&&t.push(i);return t}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||H))return en(e);var t,r,n=[];for(var i in Object(e))z.call(e,i)&&"constructor"!=i&&n.push(i);return n}(e)}function eY(e){return e}e.exports=function(e,t,r){var n=eB(e)||ez(e);if(t="function"==typeof(c=t)?c:null==c?eY:"object"==typeof c?eB(c)?(i=c[0],o=c[1],eL(i)&&(s=o)==s&&!eW(s)?eN(eD(i),o):function(e){var t,r,n,s,a,l=(t=e,r=i,void 0===(n=null==t?void 0:eO(t,r))?void 0:n);return void 0===l&&l===o?(s=e,a=i,null!=s&&function(e,t,r){t=eL(t,e)?[t]:eB(n=t)?n:ej(n);for(var n,i,o=-1,s=t.length;++o<s;){var a=eD(t[o]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}if(i)return i;var s=e?e.length:0;return!!s&&eH(s)&&eT(a,s)&&(eB(e)||e$(e))}(s,a,ex)):eA(o,l,void 0,3)}):1==(l=function(e){for(var t=eJ(e),r=t.length;r--;){var n,i=t[r],o=e[i];t[r]=[i,o,(n=o)==n&&!eW(n)]}return t}(a=c)).length&&l[0][2]?eN(l[0][0],l[0][1]):function(e){return e===a||function(e,t){var r=t.length,n=r;if(null==e)return!n;for(e=Object(e);r--;){var i=t[r];if((0,i[2])?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++r<n;){var o=(i=t[r])[0],s=e[o],a=i[1];if(0,i[2]){if(void 0===s&&!(o in e))return!1}else{var l,c=new ew;if(!(void 0===l?eA(a,s,void 0,3,c):l))return!1}}return!0}(e,l)}:function(e){var t;return eL(e)?(t=eD(e),function(e){return null==e?void 0:e[t]}):function(t){return eO(t,e)}}(c),null==r)if(n||eW(e)){var i,o,s,a,l,c,u,d=e.constructor;r=n?eB(e)?new d:[]:eK(d)&&eW(u=Z(e))?ee(u):{}}else r={};return(n?function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r,e););return e}:function(e,t){return e&&eE(e,t,eJ)})(e,function(e,n,i){return t(r,e,n,i)}),r}},7256(e){"use strict";e.exports=Math.abs},5414(e){"use strict";e.exports=Math.floor},981(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},7954(e){"use strict";e.exports=Math.max},3452(e){"use strict";e.exports=Math.min},1358(e){"use strict";e.exports=Math.pow},5720(e){"use strict";e.exports=Math.round},3515(e,t,r){"use strict";var n=r(981);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3109(e,t,r){var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&l&&"function"==typeof l.get?l.get:null,u=a&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,b=String.prototype.match,m=String.prototype.slice,v=String.prototype.replace,_=String.prototype.toUpperCase,S=String.prototype.toLowerCase,w=RegExp.prototype.test,k=Array.prototype.concat,E=Array.prototype.join,O=Array.prototype.slice,x=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===P?"object":"symbol")?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,L=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(1/0===e||-1/0===e||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-x(-e):x(e);if(n!==e){var i=String(n),o=m.call(t,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,r,"$&_")}var j=r(6550),D=j.custom,U=H(D)?D:null,M={__proto__:null,double:'"',single:"'"},F={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function $(e,t,r){var n=M[r.quoteStyle||t];return n+e+n}function B(e){return!I||!("object"==typeof e&&(I in e||void 0!==e[I]))}function V(e){return"[object Array]"===q(e)&&B(e)}function K(e){return"[object RegExp]"===q(e)&&B(e)}function H(e){if(P)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,i,a){var l,g,_,w,x,R=n||{};if(G(R,"quoteStyle")&&!G(M,R.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if(G(R,"maxStringLength")&&("number"==typeof R.maxStringLength?R.maxStringLength<0&&1/0!==R.maxStringLength:null!==R.maxStringLength))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var D=!G(R,"customInspect")||R.customInspect;if("boolean"!=typeof D&&"symbol"!==D)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(R,"indent")&&null!==R.indent&&" "!==R.indent&&!(parseInt(R.indent,10)===R.indent&&R.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(R,"numericSeparator")&&"boolean"!=typeof R.numericSeparator)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var W=R.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,r){if(t.length>r.maxStringLength){var n=t.length-r.maxStringLength;return e(m.call(t,0,r.maxStringLength),r)+("... "+n)+" more character"+(n>1?"s":"")}var i=F[r.quoteStyle||"single"];return i.lastIndex=0,$(v.call(v.call(t,i,"\\$1"),/[\x00-\x1f]/g,J),"single",r)}(t,R);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var et=String(t);return W?N(t,et):et}if("bigint"==typeof t){var er=String(t)+"n";return W?N(t,er):er}var en=void 0===R.depth?5:R.depth;if(void 0===i&&(i=0),i>=en&&en>0&&"object"==typeof t)return V(t)?"[Array]":"[Object]";var ei=function(e,t){var r;if(" "===e.indent)r=" ";else{if("number"!=typeof e.indent||!(e.indent>0))return null;r=E.call(Array(e.indent+1)," ")}return{base:r,prev:E.call(Array(t+1),r)}}(R,i);if(void 0===a)a=[];else if(z(a,t)>=0)return"[Circular]";function eo(t,r,n){if(r&&(a=O.call(a)).push(r),n){var o={depth:R.depth};return G(R,"quoteStyle")&&(o.quoteStyle=R.quoteStyle),e(t,o,i+1,a)}return e(t,R,i+1,a)}if("function"==typeof t&&!K(t)){var es=function(e){if(e.name)return e.name;var t=b.call(y.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ea=ee(t,eo);return"[Function"+(es?": "+es:" (anonymous)")+"]"+(ea.length>0?" { "+E.call(ea,", ")+" }":"")}if(H(t)){var el=P?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(t);return"object"!=typeof t||P?el:Y(el)}if((ec=t)&&"object"==typeof ec&&("u">typeof HTMLElement&&ec instanceof HTMLElement||"string"==typeof ec.nodeName&&"function"==typeof ec.getAttribute)){for(var ec,eu,ed="<"+S.call(String(t.nodeName)),ep=t.attributes||[],eh=0;eh<ep.length;eh++){ed+=" "+ep[eh].name+"="+$((eu=ep[eh].value,v.call(String(eu),/"/g,""")),"double",R)}return ed+=">",t.childNodes&&t.childNodes.length&&(ed+="..."),ed+="</"+S.call(String(t.nodeName))+">"}if(V(t)){if(0===t.length)return"[]";var ef=ee(t,eo);return ei&&!function(e){for(var t=0;t<e.length;t++)if(z(e[t],"\n")>=0)return!1;return!0}(ef)?"["+Z(ef,ei)+"]":"[ "+E.call(ef,", ")+" ]"}if("[object Error]"===q(l=t)&&B(l)){var eg=ee(t,eo);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===eg.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(eg,", ")+" }":"{ ["+String(t)+"] "+E.call(k.call("[cause]: "+eo(t.cause),eg),", ")+" }"}if("object"==typeof t&&D){if(U&&"function"==typeof t[U]&&j)return j(t,{depth:en-i});else if("symbol"!==D&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!=typeof e)return!1;try{o.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ey=[];return s&&s.call(t,function(e,r){ey.push(eo(r,t,!0)+" => "+eo(e,t))}),Q("Map",o.call(t),ey,ei)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{o.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var eb=[];return u&&u.call(t,function(e){eb.push(eo(e,t))}),Q("Set",c.call(t),eb,ei)}if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if("[object Number]"===q(g=t)&&B(g))return Y(eo(Number(t)));if(function(e){if(!e||"object"!=typeof e||!A)return!1;try{return A.call(e),!0}catch(e){}return!1}(t))return Y(eo(A.call(t)));if("[object Boolean]"===q(_=t)&&B(_))return Y(f.call(t));if("[object String]"===q(w=t)&&B(w))return Y(eo(String(t)));if("u">typeof window&&t===window)return"{ [object Window] }";if("u">typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!("[object Date]"===q(x=t)&&B(x))&&!K(t)){var em=ee(t,eo),ev=L?L(t)===Object.prototype:t instanceof Object||t.constructor===Object,e_=t instanceof Object?"":"null prototype",eS=!ev&&I&&Object(t)===t&&I in t?m.call(q(t),8,-1):e_?"Object":"",ew=(ev||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(eS||e_?"["+E.call(k.call([],eS||[],e_||[]),": ")+"] ":"");return 0===em.length?ew+"{}":ei?ew+"{"+Z(em,ei)+"}":ew+"{ "+E.call(em,", ")+" }"}return String(t)};var W=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return W.call(e,t)}function q(e){return g.call(e)}function z(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+_.call(t.toString(16))}function Y(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Q(e,t,r,n){return e+" ("+t+") {"+(n?Z(r,n):E.call(r,", "))+"}"}function Z(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+E.call(e,","+r)+"\n"+t.prev}function ee(e,t){var r,n=V(e),i=[];if(n){i.length=e.length;for(var o=0;o<e.length;o++)i[o]=G(e,o)?t(e[o],e):""}var s="function"==typeof R?R(e):[];if(P){r={};for(var a=0;a<s.length;a++)r["$"+s[a]]=s[a]}for(var l in e)if(G(e,l)&&(!n||String(Number(l))!==l||!(l<e.length)))if(P&&r["$"+l]instanceof Symbol)continue;else w.call(/[^\w$]/,l)?i.push(t(l,e)+": "+t(e[l],e)):i.push(l+": "+t(e[l],e));if("function"==typeof R)for(var c=0;c<s.length;c++)T.call(e,s[c])&&i.push("["+t(s[c])+"]: "+t(e[s[c]],e));return i}},4461(e,t,r){e=r.nmd(e),(function(){"use strict";var n={function:!0,object:!0},i=n[typeof window]&&window||this,o=n[typeof t]&&t,s=n.object&&e&&!e.nodeType&&e,a=o&&s&&"object"==typeof r.g&&r.g;a&&(a.global===a||a.window===a||a.self===a)&&(i=a);var l=/\bOpera/,c=Object.prototype,u=c.hasOwnProperty,d=c.toString;function p(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function h(e){return e=m(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:p(e)}function f(e,t){for(var r in e)u.call(e,r)&&t(e[r],r,e)}function g(e){return null==e?p(e):d.call(e).slice(8,-1)}function y(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function b(e,t){var r=null,n=function(n,i){r=t(r,n,i,e)},i=-1,o=e?e.length:0;if("number"==typeof o&&o>-1&&o<=0x1fffffffffffff)for(;++i<o;)n(e[i],i);else f(e,n);return r}function m(e){return String(e).replace(/^ +| +$/g,"")}function v(e){var t,r,n,o,s,a=i,c=e&&"object"==typeof e&&"String"!=g(e);c&&(a=e,e=null);var u=a.navigator||{},p=u.userAgent||"";e||(e=p);var _=c?!!u.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(d.toString()),S="Object",w=c&&a.java?"JavaPackage":g(a.java),k=/\bJava/.test(w)&&a.java,E=k&&g(a.environment)==(c?S:"Environment"),O=k?"a":"α",x=k?"b":"β",A=a.document||{},R=a.operamini||a.opera,C=l.test(C=c&&R?R["[[Class]]"]:g(R))?C:R=null,P=e,I=[],T=null,L=e==p,N=L&&R&&"function"==typeof R.version&&R.version(),j=b([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],function(t,r){return t||RegExp("\\b"+(r.pattern||y(r))+"\\b","i").exec(e)&&(r.label||r)}),D=b(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"],function(t,r){return t||RegExp("\\b"+(r.pattern||y(r))+"\\b","i").exec(e)&&(r.label||r)}),U=$([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),M=b({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}},function(t,r,n){return t||(r[U]||r[/^[a-z]+(?: +[a-z]+\b)*/i.exec(U)]||RegExp("\\b"+y(n)+"(?:\\b|\\w*\\d)","i").exec(e))&&n}),F=b(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],function(t,r){var n,i,o,s=r.pattern||y(r);return!t&&(t=RegExp("\\b"+s+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(n=t,i=r.label||r,o={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"},s&&i&&/^Win/i.test(n)&&!/^Windows Phone /i.test(n)&&(o=o[/[\d.]+$/.exec(n)])&&(n="Windows "+o),n=String(n),s&&i&&(n=n.replace(RegExp(s,"i"),i)),t=n=h(n.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])),t});function $(t){return b(t,function(t,r){var n=r.pattern||y(r);return!t&&(t=RegExp("\\b"+n+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+n+" *\\w+-[\\w]*","i").exec(e)||RegExp("\\b"+n+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(r.label&&!RegExp(n,"i").test(r.label)?r.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),r=r.label||r,t=h(t[0].replace(RegExp(n,"i"),r).replace(RegExp("; *(?:"+r+"[_-])?","i")," ").replace(RegExp("("+r+")[-_.]?(\\w)","i"),"$1 $2"))),t})}function B(t){return b(t,function(t,r){return t||(RegExp(r+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null})}if(j&&(j=[j]),/\bAndroid\b/.test(F)&&!U&&(o=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(e))&&(U=m(o[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),M&&!U?U=$([M]):M&&U&&(U=U.replace(RegExp("^("+y(M)+")[-_.\\s]","i"),M+" ").replace(RegExp("^("+y(M)+")[-_.]?(\\w)","i"),M+" $2")),(o=/\bGoogle TV\b/.exec(U))&&(U=o[0]),/\bSimulator\b/i.test(e)&&(U=(U?U+" ":"")+"Simulator"),"Opera Mini"==D&&/\bOPiOS\b/.test(e)&&I.push("running in Turbo/Uncompressed mode"),"IE"==D&&/\blike iPhone OS\b/.test(e)?(M=(o=v(e.replace(/like iPhone OS/,""))).manufacturer,U=o.product):/^iP/.test(U)?(D||(D="Safari"),F="iOS"+((o=/ OS ([\d_]+)/i.exec(e))?" "+o[1].replace(/_/g,"."):"")):"Konqueror"==D&&/^Linux\b/i.test(F)?F="Kubuntu":M&&"Google"!=M&&(/Chrome/.test(D)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(U))||/\bAndroid\b/.test(F)&&/^Chrome/.test(D)&&/\bVersion\//i.test(e)?(D="Android Browser",F=/\bAndroid\b/.test(F)?F:"Android"):"Silk"==D?(/\bMobi/i.test(e)||(F="Android",I.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&I.unshift("accelerated")):"UC Browser"==D&&/\bUCWEB\b/.test(e)?I.push("speed mode"):"PaleMoon"==D&&(o=/\bFirefox\/([\d.]+)\b/.exec(e))?I.push("identifying as Firefox "+o[1]):"Firefox"==D&&(o=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(F||(F="Firefox OS"),U||(U=o[1])):!D||(o=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(D))?(D&&!U&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(o+"/")+8))&&(D=null),(o=U||M||F)&&(U||M||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(F))&&(D=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(F)?F:o)+" Browser")):"Electron"==D&&(o=(/\bChrome\/([\d.]+)\b/.exec(e)||0)[1])&&I.push("Chromium "+o),N||(N=B(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",y(D),"(?:Firefox|Minefield|NetFront)"])),(o="iCab"==j&&parseFloat(N)>3&&"WebKit"||/\bOpera\b/.test(D)&&(/\bOPR\b/.test(e)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(j)&&"WebKit"||!j&&/\bMSIE\b/i.test(e)&&("Mac OS"==F?"Tasman":"Trident")||"WebKit"==j&&/\bPlayStation\b(?! Vita\b)/i.test(D)&&"NetFront")&&(j=[o]),"IE"==D&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(D+=" Mobile",F="Windows Phone "+(/\+$/.test(o)?o:o+".x"),I.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(D="IE Mobile",F="Windows Phone 8.x",I.unshift("desktop mode"),N||(N=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=D&&"Trident"==j&&(o=/\brv:([\d.]+)/.exec(e))&&(D&&I.push("identifying as "+D+(N?" "+N:"")),D="IE",N=o[1]),L){if(r="global",n=null!=(t=a)?typeof t[r]:"number",/^(?:boolean|number|string|undefined)$/.test(n)||"object"==n&&!t[r])g(o=a.runtime)==(c?S:"ScriptBridgingProxyObject")?(D="Adobe AIR",F=o.flash.system.Capabilities.os):g(o=a.phantom)==(c?S:"RuntimeObject")?(D="PhantomJS",N=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof A.documentMode&&(o=/\bTrident\/(\d+)/i.exec(e))?(N=[N,A.documentMode],(o=+o[1]+4)!=N[1]&&(I.push("IE "+N[1]+" mode"),j&&(j[1]=""),N[1]=o),N="IE"==D?String(N[1].toFixed(1)):N[0]):"number"==typeof A.documentMode&&/^(?:Chrome|Firefox)\b/.test(D)&&(I.push("masking as "+D+" "+N),D="IE",N="11.0",j=["Trident"],F="Windows");else if(k&&(P=(o=k.lang.System).getProperty("os.arch"),F=F||o.getProperty("os.name")+" "+o.getProperty("os.version")),E){try{N=a.require("ringo/engine").version.join("."),D="RingoJS"}catch(e){(o=a.system)&&o.global.system==a.system&&(D="Narwhal",F||(F=o[0].os||null))}D||(D="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(o=a.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(I.push("Node "+o.versions.node),D="Electron",N=o.versions.electron):"string"==typeof o.versions.nw&&(I.push("Chromium "+N,"Node "+o.versions.node),D="NW.js",N=o.versions.nw)),D||(D="Node.js",P=o.arch,F=o.platform,N=(N=/[\d.]+/.exec(o.version))?N[0]:null));F=F&&h(F)}if(N&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(N)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(L&&u.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&(T=/b/i.test(o)?"beta":"alpha",N=N.replace(RegExp(o+"\\+?$"),"")+("beta"==T?x:O)+(/\d+\+?/.exec(o)||"")),"Fennec"==D||"Firefox"==D&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(F))D="Firefox Mobile";else if("Maxthon"==D&&N)N=N.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(U))"Xbox 360"==U&&(F=null),"Xbox 360"==U&&/\bIEMobile\b/.test(e)&&I.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(D)||D&&!U&&!/Browser|Mobi/.test(D))&&("Windows CE"==F||/Mobi/i.test(e)))D+=" Mobile";else if("IE"==D&&L)try{null===a.external&&I.unshift("platform preview")}catch(e){I.unshift("embedded")}else(/\bBlackBerry\b/.test(U)||/\bBB10\b/.test(e))&&(o=(RegExp(U.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||N)?(F=((o=[o,/BB10/.test(e)])[1]?(U=null,M="BlackBerry"):"Device Software")+" "+o[0],N=null):this!=f&&"Wii"!=U&&(L&&R||/Opera/.test(D)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==D&&/\bOS X (?:\d+\.){2,}/.test(F)||"IE"==D&&(F&&!/^Win/.test(F)&&N>5.5||/\bWindows XP\b/.test(F)&&N>8||8==N&&!/\bTrident\b/.test(e)))&&!l.test(o=v.call(f,e.replace(l,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),l.test(D)?(/\bIE\b/.test(o)&&"Mac OS"==F&&(F=null),o="identify"+o):(o="mask"+o,D=C?h(C.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(F=null),L||(N=null)),j=["Presto"],I.push(o));(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==D&&"+"==o[1].slice(-1)?(D="WebKit Nightly",T="alpha",N=o[1].slice(0,-1)):(N==o[1]||N==(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1]))&&(N=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(e)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==j&&(j=["Blink"]),L&&(_||o[1])?(j&&(j[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=j?"27":"28")):(j&&(j[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),j&&(j[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==D&&(!N||parseInt(N)>45)?N=o:"Chrome"==D&&/\bHeadlessChrome/i.test(e)&&I.unshift("headless")),"Opera"==D&&(o=/\bzbov|zvav$/.exec(F))?(D+=" ",I.unshift("desktop mode"),"zvav"==o?(D+="Mini",N=null):D+="Mobile",F=F.replace(RegExp(" *"+o+"$"),"")):"Safari"==D&&/\bChrome\b/.exec(j&&j[1])?(I.unshift("desktop mode"),D="Chrome Mobile",N=null,/\bOS X\b/.test(F)?(M="Apple",F="iOS 4.3+"):F=null):/\bSRWare Iron\b/.test(D)&&!N&&(N=B("Chrome")),N&&0==N.indexOf(o=/[\d.]+$/.exec(F))&&e.indexOf("/"+o+"-")>-1&&(F=m(F.replace(o,""))),F&&-1!=F.indexOf(D)&&!RegExp(D+" OS").test(F)&&(F=F.replace(RegExp(" *"+y(D)+" *"),"")),j&&!/\b(?:Avant|Nook)\b/.test(D)&&(/Browser|Lunascape|Maxthon/.test(D)||"Safari"!=D&&/^iOS/.test(F)&&/\bSafari\b/.test(j[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(D)&&j[1])&&(o=j[j.length-1])&&I.push(o),I.length&&(I=["("+I.join("; ")+")"]),M&&U&&0>U.indexOf(M)&&I.push("on "+M),U&&I.push((/^on /.test(I[I.length-1])?"":"on ")+U),F&&(s=(o=/ ([\d.+]+)$/.exec(F))&&"/"==F.charAt(F.length-o[0].length-1),F={architecture:32,family:o&&!s?F.replace(o[0],""):F,version:o?o[1]:null,toString:function(){var e=this.version;return this.family+(e&&!s?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(P))&&!/\bi686\b/i.test(P)?(F&&(F.architecture=64,F.family=F.family.replace(RegExp(" *"+o),"")),D&&(/\bWOW64\b/i.test(e)||L&&/\w(?:86|32)$/.test(u.cpuClass||u.platform)&&!/\bWin64; x64\b/i.test(e))&&I.unshift("32-bit")):F&&/^OS X/.test(F.family)&&"Chrome"==D&&parseFloat(N)>=39&&(F.architecture=64),e||(e=null);var V={};return V.description=e,V.layout=j&&j[0],V.manufacturer=M,V.name=D,V.prerelease=T,V.product=U,V.ua=e,V.version=D&&N,V.os=F||{architecture:null,family:null,version:null,toString:function(){return"null"}},V.parse=v,V.toString=function(){return this.description||""},V.version&&I.unshift(N),V.name&&I.unshift(D),F&&D&&!(F==String(F).split(" ")[0]&&(F==D.split(" ")[0]||U))&&I.push(U?"("+F+")":"on "+F),I.length&&(V.description=I.join(" ")),V}var _=v();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(i.platform=_,define(function(){return _})):o&&s?f(_,function(e,t){o[t]=e}):i.platform=_}).call(this)},5539(e){"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},8183(e,t,r){"use strict";var n=r(6334),i=r(4816);e.exports={formats:r(5539),parse:i,stringify:n}},4816(e,t,r){"use strict";var n=r(6278),i=r(1954),o=Object.prototype.hasOwnProperty,s=Array.isArray,a=Object.getPrototypeOf,l=function(e){if(!e||"object"!=typeof e)return!1;if(s(e))return!0;var t=a(e);return t===Object.prototype||null===t},c=function(e){if(s(e)){var t=[];return t.length=e.length,t}return null===a(e)?{__proto__:null}:{}},u=function(e){for(var t=n(),r={},i=[{source:e,target:r}],o=0;o<i.length;++o)for(var s=i[o].source,a=i[o].target,u=Object.keys(s),d=0;d<u.length;++d){var p=s[u[d]];if(l(p)){if(!t.has(p)){var h=c(p);t.set(p,h),i[i.length]={source:p,target:h}}a[u[d]]=t.get(p)}else a[u[d]]=p}return r},d={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:i.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},p=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1){if(t.throwOnLimitExceeded)for(var n=0,i=e.indexOf(",");i>-1;){if((n+=1)>=t.arrayLimit)throw RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");i=e.indexOf(",",i+1)}return e.split(",")}if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},h=function(e,t){var r={__proto__:null},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=1/0===t.parameterLimit?void 0:t.parameterLimit,l=n.split(t.delimiter,t.throwOnLimitExceeded&&void 0!==a?a+1:a);if(t.throwOnLimitExceeded&&void 0!==a&&l.length>a)throw RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var c=-1,u=t.charset;if(t.charsetSentinel)for(h=0;h<l.length;++h)0===l[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[h]?u="utf-8":"utf8=%26%2310003%3B"===l[h]&&(u="iso-8859-1"),c=h,h=l.length);for(h=0;h<l.length;++h)if(h!==c){var h,f,g,y=l[h],b=y.indexOf("]="),m=-1===b?y.indexOf("="):b+1,v=m>1&&"[]"===y.slice(m-2,m);if(-1===m?(f=t.decoder(y,d.decoder,u,"key"),g=t.strictNullHandling?null:""):null!==(f=t.decoder(y.slice(0,m),d.decoder,u,"key"))&&(g=i.maybeMap(p(y.slice(m+1),t,s(r[f])?r[f].length:0),function(e){return t.decoder(e,d.decoder,u,"value")})),g&&t.interpretNumericEntities&&"iso-8859-1"===u&&(g=String(g).replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})),v&&(g=s(g)?[g]:g),t.comma&&s(g)&&g.length>t.arrayLimit&&(g=i.combine([],g,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded)),null!==f){var _=o.call(r,f);_&&("combine"===t.duplicates||v)?r[f]=i.combine(r[f],g,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded):_&&"last"!==t.duplicates||(r[f]=g)}}return r},f=function(e,t,r,n){var o=0;if(e.length>0&&"[]"===e[e.length-1]){var s=e.slice(0,-1).join("");o=Array.isArray(t)&&t[s]?t[s].length:0}for(var a=n?t:p(t,r,o),l=e.length-1;l>=0;--l){var c,u=e[l];if("[]"===u&&r.parseArrays)c=i.isOverflow(a)?a:r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:i.combine([],a,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{c=r.plainObjects?{__proto__:null}:{};var d="["===u.charAt(0)&&"]"===u.charAt(u.length-1)?u.slice(1,-1):u,h=r.decodeDotInKeys?d.replace(/%2E/g,"."):d,f=parseInt(h,10),g=!isNaN(f)&&u!==h&&String(f)===h&&f>=0&&r.parseArrays;if(r.parseArrays||""!==h)if(g&&f<r.arrayLimit)(c=[])[f]=a;else if(g&&r.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");else g?(c[f]=a,i.markOverflow(c,f)):"__proto__"!==h&&(c[h]=a);else c={0:a}}a=c}return a},g=function(e){for(var t="",r=0,n=0;n<e.length;n+=1){var i=e.charCodeAt(n);if(91===i)r+=1,t+="[";else if(93===i)r>0&&(r-=1),t+="]";else if(46===i&&0===r&&n+1<e.length&&46!==e.charCodeAt(n+1)&&91!==e.charCodeAt(n+1)){for(var o=n+1,s=o;s<e.length&&46!==e.charCodeAt(s)&&91!==e.charCodeAt(s);)s+=1;t+="["+e.slice(o,s)+"]",n=s-1}else t+=e.charAt(n)}return t},y=function(e,t){var r=t.allowDots?g(e):e;if(t.depth<=0){if(!t.plainObjects&&o.call(Object.prototype,r)&&!t.allowPrototypes)return;return[r]}var n=[],i=r.indexOf("["),s=i>=0?r.slice(0,i):r;if(s){if(!t.plainObjects&&o.call(Object.prototype,s)&&!t.allowPrototypes)return;n[n.length]=s}for(var a=r.length,l=i,c=0;l>=0&&c<t.depth;){for(var u=1,d=l+1,p=-1;d<a&&p<0;){var h=r.charCodeAt(d);91===h?u+=1:93===h&&0==(u-=1)&&(p=d),d+=1}if(p<0)return n[n.length]="["+r.slice(l)+"]",n;var f=r.slice(l,p+1),y=f.slice(1,-1);if(!t.plainObjects&&o.call(Object.prototype,y)&&!t.allowPrototypes)return;n[n.length]=f,c+=1,l=r.indexOf("[",p+1)}if(l>=0){if(!0===t.strictDepth)throw RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");n[n.length]="["+r.slice(l)+"]"}return n},b=function(e,t,r,n){if(e){var i=y(e,r);if(i)return f(i,t,r,n)}},m=function(e){if(!e)return d;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?d.charset:e.charset,r=void 0===e.duplicates?d.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||d.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:d.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:d.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:d.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:d.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:d.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:d.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:d.decoder,delimiter:"string"==typeof e.delimiter||i.isRegExp(e.delimiter)?e.delimiter:d.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:d.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:d.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:d.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:d.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:d.strictDepth,strictMerge:"boolean"==typeof e.strictMerge?!!e.strictMerge:d.strictMerge,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}};e.exports=function(e,t){var r=m(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var n="string"==typeof e?h(e,r):u(e),o=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),a=0;a<s.length;++a){var l=s[a],c=b(l,n[l],r,"string"==typeof e);o=i.merge(o,c,r)}return!0===r.allowSparse?o:i.compact(o)}},6334(e,t,r){"use strict";var n=r(6278),i=r(1954),o=r(5539),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},d=Date.prototype.toISOString,p=o.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",depth:1/0,encode:!0,encodeDotInKeys:!1,encoder:i.encode,encodeValuesOnly:!1,filter:void 0,format:p,formatter:o.formatters[p],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},f={},g=function e(t,r,o,s,a,c,d,p,g,y,b,m,v,_,S,w,k,E,O,x){var A,R,C=t;if(x>O)throw RangeError("Input depth exceeded depth option of "+O);for(var P=E,I=0,T=!1;void 0!==(P=P.get(f))&&!T;){var L=P.get(t);if(I+=1,void 0!==L)if(L===I)throw RangeError("Cyclic object value");else T=!0;void 0===P.get(f)&&(I=0)}if((C="function"==typeof y?y(r,C):C)instanceof Date?C=v(C):"comma"===o&&l(C)&&(C=i.maybeMap(C,function(e){return e instanceof Date?v(e):e})),null===C){if(c)return S(g&&!w?g(r,h.encoder,k,"key",_):r);C=""}if("string"==typeof(A=C)||"number"==typeof A||"boolean"==typeof A||"symbol"==typeof A||"bigint"==typeof A||i.isBuffer(C))return g?[S(w?r:g(r,h.encoder,k,"key",_))+"="+S(g(C,h.encoder,k,"value",_))]:[S(r)+"="+S(String(C))];var N=[];if(void 0===C)return N;if("comma"===o&&l(C))w&&g&&(C=i.maybeMap(C,function(e){return null==e?e:g(e,h.encoder,k,"value",_)})),R=[{value:C.length>0?i.toCoercible(C).join(",")||null:void 0}];else if(l(y))R=y;else{var j=Object.keys(C);R=b?j.sort(b):j}var D=String(r),U=s&&l(C)&&1===C.length?D+"[]":D;if(a&&l(C)&&0===C.length&&0===Object.keys(C).length)return U+"[]";for(var M=0;M<R.length;++M){var F=R[M],$="object"==typeof F&&F&&void 0!==F.value?F.value:C[F];if(!d||null!==$){var B=m&&p?String(F).replace(/\./g,"%2E"):String(F),V=l(C)?"function"==typeof o?o(U,B):U:U+(m?"."+B:"["+B+"]");E.set(t,I);var K=n();K.set(f,E),u(N,e($,V,o,s,a,c,d,p,"comma"===o&&w&&l(C)?null:g,y,b,m,v,_,S,w,k,K,O,x+1))}}return N},y=function(e){if(!e)return h;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");var t,r=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!s.call(o.formatters,e.format))throw TypeError("Unknown format option provided.");n=e.format}var i=o.formatters[n],c=h.filter;if(("function"==typeof e.filter||l(e.filter))&&(c=e.filter),t=s.call(a,e.arrayFormat)?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":h.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||h.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:t,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,depth:"number"==typeof e.depth?e.depth:h.depth,encode:"boolean"==typeof e.encode?e.encode:h.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:h.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:c,format:n,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}};e.exports=function(e,t){var r,i=e,o=y(t);"function"==typeof o.filter?i=(0,o.filter)("",i):l(o.filter)&&(r=o.filter);var s=[];if("object"!=typeof i||null===i)return"";var c=a[o.arrayFormat],d="comma"===c&&o.commaRoundTrip;r||(r=Object.keys(i)),o.sort&&r.sort(o.sort);for(var p=n(),h=0;h<r.length;++h){var f=r[h];if(null!=f){var b=i[f];o.skipNulls&&null===b||u(s,g(b,o.encodeDotInKeys?String(f).replace(/\./g,"%2E"):String(f),c,d,o.allowEmptyArrays,o.strictNullHandling,o.skipNulls,o.encodeDotInKeys,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,p,o.depth,0))}}var m=s.join(o.delimiter),v=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?v+="utf8=%26%2310003%3B"+o.delimiter:v+="utf8=%E2%9C%93"+o.delimiter),m.length>0?v+m:""}},1954(e,t,r){"use strict";var n=r(5539),i=r(6278),o=r(9997),s=Object.prototype.hasOwnProperty,a=Array.isArray,l=i(),c=function(e,t){return l.set(e,t),e},u=function(e){return l.has(e)},d=function(e){return l.get(e)},p=function(e,t){l.set(e,t)},h=i(),f=function(e,t){return h.set(e,t),e},g=function(e){return h.has(e)},y=function(e){return h.get(e)},b=function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e}(),m=function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(a(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&(n[n.length]=r[i]);t.obj[t.prop]=n}}},v=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},_=function(e,t,r){"__proto__"===t&&o?o(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},S=function(e,t){for(var r=t,n=Object.keys(e),i=0;i<n.length;++i){var o=parseInt(n[i],10);String(o)===n[i]&&o>r&&(r=o)}return r},w=function(e,t,r){var n=[e,t];if(r&&"number"==typeof r.arrayLimit&&n.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");return c(v(n,r),1)}return n},k="function"==typeof Symbol&&"symbol"==typeof Symbol.toPrimitive,E=Array.prototype.join,O=Array.prototype.toString,x=Object.prototype.toString,A=function e(t,r){if(!t||"object"!=typeof t&&"function"!=typeof t||k&&null!=t[Symbol.toPrimitive])return t;if(a(t)&&t.toString===O&&t.join===E){var n,o=r||i();if(o.has(t))return"";o.set(t,!0);for(var s=0;s<t.length;s+=1){var l=t[s],c=e(l,o);if(!n&&c!==l){n=[];for(var u=0;u<s;u+=1)n[u]=t[u]}n&&(n[s]=c)}return o.delete(t),n||t}if("function"==typeof t.toString)return t;var d=t.valueOf;if("function"==typeof d){var p=d.call(t);if(!p||"object"!=typeof p&&"function"!=typeof p)return String(p)}return x.call(t)};e.exports={arrayToObject:v,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return _(e,r,t[r]),e},e)},combine:function(e,t,r,n,i){if(u(e)){if(i)throw RangeError("Array limit exceeded. Only "+r+" element"+(1===r?"":"s")+" allowed in an array.");for(var o=a(t)?t:[t],s=d(e),l=0;l<o.length;++l)e[s+=1]=o[l];return p(e,s),e}var h=[].concat(e,t);if(h.length>r){if(i)throw RangeError("Array limit exceeded. Only "+r+" element"+(1===r?"":"s")+" allowed in an array.");return c(v(h,{plainObjects:n}),h.length-1)}return h},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=i(),n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];"object"!=typeof u||null===u||r.has(u)||(t[t.length]={obj:s,prop:c},r.set(u,!0))}return m(t),e},decode:function(e,t,r){if("string"==typeof e&&-1===e.indexOf("%"))return -1===e.indexOf("+")?e:e.replace(/\+/g," ");var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,i,o){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(A(e))),"iso-8859-1"===r)return escape(s).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}).replace(/\+/g,"%2B");for(var a="",l=0;l<s.length;l+=1024){var c=s.length>=1024?s.slice(l,l+1024):s;if(l+1024<s.length){var u=c.charCodeAt(c.length-1);u>=55296&&u<=56319&&(c=c.slice(0,-1),l-=1)}for(var d=[],p=0;p<c.length;++p){var h=c.charCodeAt(p);if(45===h||46===h||95===h||126===h||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===n.RFC1738&&(40===h||41===h)){d[d.length]=c.charAt(p);continue}if(h<128){d[d.length]=b[h];continue}if(h<2048){d[d.length]=b[192|h>>6]+b[128|63&h];continue}if(h<55296||h>=57344){d[d.length]=b[224|h>>12]+b[128|h>>6&63]+b[128|63&h];continue}p+=1,h=65536+((1023&h)<<10|1023&c.charCodeAt(p)),d[d.length]=b[240|h>>18]+b[128|h>>12&63]+b[128|h>>6&63]+b[128|63&h]}a+=d.join("")}return a},isBuffer:function(e){return!!e&&"object"==typeof e&&!!(e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:u,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},markOverflow:c,maybeMap:function(e,t){if(a(e)){for(var r=[],n=0;n<e.length;n+=1)r[r.length]=t(e[n]);return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(a(t)){var i=t.length;if(n&&"number"==typeof n.arrayLimit&&i>=n.arrayLimit){if(n.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");return c(v(t.concat(r),n),i)}t[i]=r}else if(!t||"object"!=typeof t)return w(t,r,n);else if(u(t)){var o=d(t)+1;t[o]=r,p(t,o)}else if(n&&n.strictMerge&&g(t)){var l=y(t)+1;if(n.throwOnLimitExceeded&&"number"==typeof n.arrayLimit&&l>=n.arrayLimit)throw RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");t[l]=r,f(t,l)}else if(n&&n.strictMerge){var h=w(t,r,n);return a(h)?f(h,1):h}else(n&&(n.plainObjects||n.allowPrototypes)||!s.call(Object.prototype,r))&&(t[r]=!0);return t}if(!t||"object"!=typeof t){if(u(r)){for(var b=Object.keys(r),m=n&&n.plainObjects?{__proto__:null,0:t}:{0:t},k=0;k<b.length;k++)m[parseInt(b[k],10)+1]=r[b[k]];return c(m,d(r)+1)}var E=[t].concat(r);if(n&&"number"==typeof n.arrayLimit&&E.length>n.arrayLimit){if(n.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");return c(v(E,n),E.length-1)}return E}var O=t;if(a(t)&&!a(r)&&(O=v(t,n),g(t)&&f(O,t.length-1)),a(t)&&a(r)){if(r.forEach(function(r,i){if(s.call(t,i)){var o=t[i];o&&"object"==typeof o&&r&&"object"==typeof r?t[i]=e(o,r,n):t[t.length]=r}else t[i]=r}),n&&"number"==typeof n.arrayLimit&&t.length>n.arrayLimit){if(n.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");return c(v(t,n),t.length-1)}return t}return Object.keys(r).reduce(function(t,i){var o=r[i];if(s.call(t,i)?_(t,i,e(t[i],o,n)):_(t,i,o),u(r)&&!u(t)&&c(t,S(t,d(r))),u(t)){var a=parseInt(i,10);String(a)===i&&a>=0&&a>d(t)&&p(t,a)}if(g(t)){var l=parseInt(i,10);String(l)===i&&l>y(t)&&f(t,l)}return t},O)},toCoercible:A}},6521(e,t,r){"use strict";var n=r(3109),i=r(6757),o=function(e,t,r){for(var n,i=e;null!=(n=i.next);i=n)if(n.key===t)return i.next=n.next,r||(n.next=e.next,e.next=n),n},s=function(e,t){if(e){var r=o(e,t);return r&&r.value}},a=function(e,t,r){var n=o(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},l=function(e,t){if(e)return o(e,t,!0)};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new i("Side channel does not contain "+n(e))},delete:function(t){var r=l(e,t);return r&&e&&!e.next&&(e=void 0),!!r},get:function(t){return s(e,t)},has:function(t){var r;return!!(r=e)&&!!o(r,t)},set:function(t,r){e||(e={next:void 0}),a(e,t,r)}};return t}},3977(e,t,r){"use strict";var n=r(4295),i=r(8682),o=r(3109),s=r(6757),a=n("%Map%",!0),l=i("Map.prototype.get",!0),c=i("Map.prototype.set",!0),u=i("Map.prototype.has",!0),d=i("Map.prototype.delete",!0),p=i("Map.prototype.size",!0);e.exports=!!a&&function(){var e,t={assert:function(e){if(!t.has(e))throw new s("Side channel does not contain "+o(e))},delete:function(t){if(e){var r=d(e,t);return 0===p(e)&&(e=void 0),r}return!1},get:function(t){if(e)return l(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,r){e||(e=new a),c(e,t,r)}};return t}},8965(e,t,r){"use strict";var n=r(4295),i=r(8682),o=r(3109),s=r(3977),a=r(6757),l=n("%WeakMap%",!0),c=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),d=i("WeakMap.prototype.has",!0),p=i("WeakMap.prototype.delete",!0);e.exports=l?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+o(e))},delete:function(r){if(l&&r&&("object"==typeof r||"function"==typeof r)){if(e)return p(e,r)}else if(s&&t)return t.delete(r);return!1},get:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?c(e,r):t&&t.get(r)},has:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?d(e,r):!!t&&t.has(r)},set:function(r,n){l&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new l),u(e,r,n)):s&&(t||(t=s()),t.set(r,n))}};return r}:s},6278(e,t,r){"use strict";var n=r(6757),i=r(3109),o=r(6521),s=r(3977),a=r(8965)||s||o;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+(e&&Object(e)===e?"the given object key":i(e)))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=a()),e.set(t,r)}};return t}},4532(e,t,r){!function(e){"use strict";var t,r,n=function(){try{if(e.URLSearchParams&&"bar"===new e.URLSearchParams("foo=bar").get("foo"))return e.URLSearchParams}catch(e){}return null}(),i=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),s=n&&"size"in n.prototype,a="__URLSearchParams__",l=!n||((t=new n).append("s"," &"),"s=+%26"===t.toString()),c=h.prototype,u=!!(e.Symbol&&e.Symbol.iterator);if(!n||!i||!o||!l||!s){c.append=function(e,t){m(this[a],e,t)},c.delete=function(e){delete this[a][e]},c.get=function(e){var t=this[a];return this.has(e)?t[e][0]:null},c.getAll=function(e){var t=this[a];return this.has(e)?t[e].slice(0):[]},c.has=function(e){return _(this[a],e)},c.set=function(e,t){this[a][e]=[""+t]},c.toString=function(){var e,t,r,n,i=this[a],o=[];for(t in i)for(r=f(t),e=0,n=i[t];e<n.length;e++)o.push(r+"="+f(n[e]));return o.join("&")};var d=e.Proxy&&n&&(!o||!l||!i||!s);d?(r=new Proxy(n,{construct:function(e,t){return new e(new h(t[0]).toString())}})).toString=Function.prototype.toString.bind(h):r=h,Object.defineProperty(e,"URLSearchParams",{value:r});var p=e.URLSearchParams.prototype;p.polyfill=!0,!d&&e.Symbol&&(p[e.Symbol.toStringTag]="URLSearchParams"),"forEach"in p||(p.forEach=function(e,t){var r=b(this.toString());Object.getOwnPropertyNames(r).forEach(function(n){r[n].forEach(function(r){e.call(t,r,n,this)},this)},this)}),"sort"in p||(p.sort=function(){var e,t,r,n=b(this.toString()),i=[];for(e in n)i.push(e);for(i.sort(),t=0;t<i.length;t++)this.delete(i[t]);for(t=0;t<i.length;t++){var o=i[t],s=n[o];for(r=0;r<s.length;r++)this.append(o,s[r])}}),"keys"in p||(p.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),y(e)}),"values"in p||(p.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),y(e)}),"entries"in p||(p.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),y(e)}),u&&(p[e.Symbol.iterator]=p[e.Symbol.iterator]||p.entries),"size"in p||Object.defineProperty(p,"size",{get:function(){var e=b(this.toString());if(p===this)throw TypeError("Illegal invocation at URLSearchParams.invokeGetter");return Object.keys(e).reduce(function(t,r){return t+e[r].length},0)}})}function h(e){((e=e||"")instanceof URLSearchParams||e instanceof h)&&(e=e.toString()),this[a]=b(e)}function f(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,function(e){return t[e]})}function g(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/ig,function(e){return decodeURIComponent(e)})}function y(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return u&&(r[e.Symbol.iterator]=function(){return r}),r}function b(e){var t={};if("object"==typeof e)if(v(e))for(var r=0;r<e.length;r++){var n=e[r];if(v(n)&&2===n.length)m(t,n[0],n[1]);else throw TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements")}else for(var i in e)e.hasOwnProperty(i)&&m(t,i,e[i]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var o=e.split("&"),s=0;s<o.length;s++){var a=o[s],l=a.indexOf("=");-1<l?m(t,g(a.slice(0,l)),g(a.slice(l+1))):a&&m(t,g(a),"")}}return t}function m(e,t,r){var n="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);_(e,t)?e[t].push(n):e[t]=[n]}function v(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(void 0!==r.g?r.g:"u">typeof window?window:this)},9368(e){"use strict";e.exports=__rspack_external__9368},650(e){"use strict";e.exports=__rspack_external__650},9207(e){"use strict";e.exports=__rspack_external__9207},5610(){},7791(){},6550(){}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t,n)=>{var i=(t,n)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,[n]:t[i]})};i(t,"get"),i(n,"value")},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";let e,t;r.r(n),r.d(n,{Console:()=>tr,DEFAULT_ICONSET:()=>tY,DEFAULT_LANGUAGES:()=>tZ,DefaultBoxShadow:()=>tz,DefaultBoxShadowBottom:()=>tq,DefaultColor1:()=>tM,DefaultColor10:()=>tW,DefaultColor11:()=>tG,DefaultColor2:()=>tF,DefaultColor3:()=>tK,DefaultColor4:()=>tD,DefaultColor5:()=>t$,DefaultColor6:()=>tB,DefaultColor7:()=>tU,DefaultColor8:()=>tV,DefaultColor9:()=>tH,DefaultDisabledOpacity:()=>"0.3",DefaultHeaderHeight:()=>"50px",EventProviderStatus:()=>a,I18NEXT_TO_MOMENT_LOCALE:()=>t0,Manager:()=>t5,OPENREMOTE_CLIENT_ID:()=>tX,ORError:()=>l,OREvent:()=>c,RESTRICTED_USER_REALM_ROLE:()=>tQ,Util:()=>u,WebSocketEventProvider:()=>td,addTranslationFormats:()=>t1,default:()=>t6,manager:()=>t3,normaliseConfig:()=>t2,subscribe:()=>tj});var i,o,s,a,l,c,u={};r.r(u),r.d(u,{AssetQueryHelper:()=>e7,Deferred:()=>es,arrayRemove:()=>ev,blobToBase64:()=>e4,camelCaseToSentenceCase:()=>eS,capitaliseFirstLetter:()=>ek,cronStringToISOString:()=>eC,dateToCronString:()=>eR,difference:()=>em,dispatchCancellableEvent:()=>e8,formatCronString:()=>eA,generateUniqueUUID:()=>e9,getAllowedValueLabel:()=>eM,getAssetTypeLabel:()=>eD,getAttributeLabel:()=>e$,getAttributeUnits:()=>eY,getAttributeValueAsString:()=>eK,getAttributeValueConstraints:()=>ez,getAttributeValueFormat:()=>eQ,getBrowserLanguage:()=>el,getComplexMetaItems:()=>ej,getEnumKeyAsString:()=>eE,getGeoNotificationsFromRulesSet:()=>ed,getMetaItemNameValueHolder:()=>eF,getMetaLabel:()=>eB,getMetaUnits:()=>eX,getMetaValue:()=>eP,getMetaValueAsString:()=>eH,getMetaValueConstraints:()=>eJ,getMetaValueFormat:()=>eZ,getPrimitiveMetaItems:()=>eN,getQueryParameter:()=>eu,getQueryParameters:()=>ec,getValueAsString:()=>eG,getValueDescriptorLabel:()=>eU,getWeekNumber:()=>eO,hasMetaItem:()=>eI,isComplexValueDescriptor:()=>eL,isObject:()=>ey,isPrimitiveValueDescriptor:()=>eT,isTimeDuration:()=>eh,isTimeDurationNegativeInfinity:()=>eg,isTimeDurationPositiveInfinity:()=>ef,loadJs:()=>e5,mergeObjects:()=>function e(t,r,n){if(t&&!r)return Object.assign({},t);if(r&&!t)return Object.assign({},r);let i=Object.assign({},t),o=[];return Object.entries(r).forEach(([t,r])=>{var s,a,l,c,u;let d;s=i,a=o,l=t,c=r,u=n,d=s,a.forEach(e=>{d.hasOwnProperty(e)||(d[e]={}),d=d[e]}),d&&(d.hasOwnProperty(l)?null==c?delete d[l]:Array.isArray(d[l])?u?d[l]=[...d[l],...c]:d[l]=[...c]:"object"==typeof c?d[l]=e(Object.assign({},d[l]),c,u):d[l]=c:null==c?delete d[l]:Array.isArray(c)?d[l]=[...c]:"object"==typeof c?d[l]=Object.assign({},c):d[l]=c)}),i},objectsEqual:()=>eb,resolveUnits:()=>eq,retryWithBackoff:()=>ea,sentenceCaseToCamelCase:()=>e_,sortByNumber:()=>e3,sortByString:()=>e6,stringMatch:()=>ew,updateAsset:()=>e2}),r(4532);var d=r(650);let p=e=>"string"==typeof e,h=()=>{let e,t,r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},f=e=>null==e?"":String(e),g=e=>e?.callbackApi??e?.constructor?.callbackApi,y=/###/g,b=e=>e&&e.includes("###")?e.replace(y,"."):e,m=e=>!e||p(e),v=(e,t,r)=>{let n=p(t)?t.split("."):t,i=0;for(;i<n.length-1;){if(m(e))return{};let t=b(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return m(e)?{}:{obj:e,k:b(n[i])}},_=(e,t,r)=>{let{obj:n,k:i}=v(e,t,Object);if(void 0!==n||1===t.length){n[i]=r;return}let o=t[t.length-1],s=t.slice(0,t.length-1),a=v(e,s,Object);for(;void 0===a.obj&&s.length;)o=`${s[s.length-1]}.${o}`,a=v(e,s=s.slice(0,s.length-1),Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=r},S=(e,t)=>{let{obj:r,k:n}=v(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},w=(e,t,r)=>{for(let n in t)"__proto__"!==n&&"constructor"!==n&&(Object.prototype.hasOwnProperty.call(e,n)?p(e[n])||e[n]instanceof String||p(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):w(e[n],t[n],r):e[n]=t[n]);return e},k={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},E=e=>p(e)?e.replace(/[&<>"'\/]/g,e=>k[e]):e,O=[" ",",","?","!",";"],x=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),A=(e,t,r=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let n=t.split(r),i=e;for(let e=0;e<n.length;){let t;if(!i||"object"!=typeof i)return;let o="";for(let s=e;s<n.length;++s)if(s!==e&&(o+=r),o+=n[s],"function"!=typeof(t=i[o])&&"__proto__"!==o||Object.prototype.hasOwnProperty.call(i,o)||(t=void 0),void 0!==t){if(["string","number","boolean"].includes(typeof t)&&s<n.length-1)continue;e+=s-e+1;break}i=t}return i},R=e=>e?.replace(/_/g,"-"),C={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};var P=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||C,this.options=t,this.debug=t.debug,this.seen=new Set}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}once(e,t,...r){return!this.debug||this.seen.has(e)||this.seen.size>=1e3?null:(this.seen.add(e),this[t](...r))}forward(e,t,r,n){return n&&!this.debug?null:(e=e.map(e=>p(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g," "):e),p(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{...{prefix:`${this.prefix}:${t}:`},...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}};class I{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let r=this.observers[e].get(t)||0;this.observers[e].set(t,r+1)}),this}off(e,t){("string"==typeof e?e.split(" "):[e]).forEach(e=>{if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};return this.on(e,r),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,r])=>{for(let n=0;n<r;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r(e,...t)})}}let T=new WeakSet;class L extends I{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.logger=P.create("resourceStore"),void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}deprecateDottedLng(e){this.logger.once(e,"deprecate",`${e}: a dotted language ('en.translation.key') that carries the namespace and key is removed in v27; pass language, namespace and key as separate arguments`)}getResource(e,t,r,n={}){let i,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;e.includes(".")?(this.deprecateDottedLng("getResource"),i=e.split(".")):(i=[e,t],r&&(Array.isArray(r)?i.push(...r):p(r)&&o?i.push(...r.split(o)):i.push(r)));let a=S(this.data,i);return(null==a&&!t&&!r&&e.includes(".")&&(e=i[0],t=i[1],r=i.slice(2).join(".")),null==a&&s&&p(r))?A(this.data?.[e]?.[t],r,o):a}addResource(e,t,r,n,i={silent:!1}){let o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=[e,t];r&&(s=s.concat(o?r.split(o):r)),e.includes(".")&&(this.deprecateDottedLng("addResource"),s=e.split("."),n=t,t=s[1]),this.addNamespaces(t),_(this.data,s,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(let n in r)(p(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,i,o={silent:!1,skipCopy:!1}){let s=[e,t];e.includes(".")&&(this.deprecateDottedLng("addResourceBundle"),s=e.split("."),n=r,r=t,t=s[1]),this.addNamespaces(t);let a=S(this.data,s)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?w(a,r,i):a={...a,...r},_(this.data,s,a),o.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>{let r=t[e];return!!T.has(r)||!!r&&0!==Object.keys(r).length&&("object"==typeof r&&T.add(r),!0)})}toJSON(){return this.data}}var N={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(e=>{t=this.processors[e]?.process(t,r,n,i)??t}),t}};let j=Symbol("i18next/PATH_KEY");function D(e,t){let r,n,i,{[j]:o}=e((n=[],(i=Object.create(null)).get=(e,t)=>(r?.revoke?.(),t===j)?n:(n.push(t),(r=Proxy.revocable(e,i)).proxy),Proxy.revocable(Object.create(null),i).proxy)),s=t?.keySeparator??".",a=t?.nsSeparator??":",l=t?.enableSelector==="strict";if(o.length>1&&a){let e=t?.ns,r=l?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(r&&(l?r:r.length>1?r.slice(1):[]).includes(o[0]))return`${o[0]}${a}${o.slice(1).join(s)}`}return o.join(s)}let U=e=>!p(e)&&"boolean"!=typeof e&&"number"!=typeof e;class M extends I{constructor(e,t={}){super(),((e,t,r)=>{e.forEach(e=>{t[e]&&(r[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils","ownPostProcessors"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=P.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let r={...t};if(null==e)return!1;let n=this.resolve(e,r);if(n?.res===void 0)return!1;let i=U(n.res);return!1!==r.returnObjects||!i}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=r&&e.includes(r),s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,r)=>{t=t||"",r=r||"";let n=O.filter(e=>!t.includes(e)&&!r.includes(e));if(0===n.length)return!0;let i=x.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`),o=!i.test(e);if(!o){let t=e.indexOf(r);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,r,n);if(o&&!s){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:p(i)?[i]:i};let o=e.split(r);(r!==n||r===n&&this.options.ns.includes(o[0]))&&(i=o.shift()),e=o.join(n)}return{key:e,namespaces:p(i)?[i]:i}}translate(e,t,r){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=D(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?D(e,{...this.options,...n}):String(e));let i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],n),l=a[a.length-1],c=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");let u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return d?i?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${c}${s}`:i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s;let h=this.resolve(e,n),f=h?.res,g=h?.usedKey||s,y=h?.exactUsedKey||s,b=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==n.count&&!p(n.count),_=M.hasDefaultValue(n),S=v?this.pluralResolver.getSuffix(u,n.count,n):"",w=n.ordinal&&v?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",k=v&&!n.ordinal&&0===n.count,E=k&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${S}`]||n[`defaultValue${w}`]||n.defaultValue,O=f;m&&!f&&_&&(O=E);let x=U(O),A=Object.prototype.toString.apply(O);if(m&&O&&x&&!["[object Number]","[object Function]","[object RegExp]"].includes(A)&&!(p(b)&&Array.isArray(O))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||(this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.logger.once("returnedObject","deprecate","accessing an object without returnObjects returns a sentence about it today; from v27 t() returns the key, as for a missing key (returnedObjectHandler can keep today's text)"));let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,O,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(h.res=e,h.usedParams=this.getUsedParamsDetails(n),h):e}if(o){let e=Array.isArray(O),t=e?[]:{},r=e?y:g;for(let e in O)if(Object.prototype.hasOwnProperty.call(O,e)){let i=`${r}${o}${e}`;_&&!f?t[e]=this.translate(i,{...n,defaultValue:U(E)?E[e]:void 0,...{joinArrays:!1,ns:a}}):t[e]=this.translate(i,{...n,joinArrays:!1,ns:a}),t[e]===i&&(t[e]=O[e])}f=t}}else if(m&&p(b)&&Array.isArray(f))(f=f.join(b))&&(f=this.extendTranslation(f,e,n,h,r));else{let t=!1,i=!1;!this.isValidLookup(f)&&_&&(t=!0,f=E),this.isValidLookup(f)||(i=!0,f=s);let a=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,d=_&&E!==f&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,v&&!d?`${s}${this.pluralResolver.getSuffix(u,n.count,n)}`:s,d?E:f),o){let e=this.resolve(s,{...n,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=_&&r!==f?r:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,n,void 0,this.utils?.hasLoadedNamespace),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);k&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],s+t,n[`defaultValue${t}`]||E)})}):r(e,s,E))}f=this.extendTranslation(f,e,n,h,r),i&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}${c}${s}`),(i||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,t?f:void 0,n))}return i?(h.res=f,h.usedParams=this.getUsedParamsDetails(n),h):f}extendTranslation(e,t,r,n,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let o;r.interpolation&&this.interpolator.init({...r,...{interpolation:{...this.options.interpolation,...r.interpolation}}});let s=p(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let a=r.replace&&!p(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,r.lng||this.language||n.usedLng,r),s){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||r.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}let o=r.postProcess||this.options.postProcess,s=p(o)?[o]:o;return null!=e&&s?.length&&!1!==r.applyPostProcessor&&(s.forEach(e=>{this.logger.debug&&N.processors[e]&&this.ownPostProcessors&&!this.ownPostProcessors.has(e)&&this.logger.once(e,"deprecate",`postProcess: '${e}' was registered with use() on another i18next instance; from v27 post-processors are per instance, so call use() with it on this instance too`)}),e=N.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,n,i,o,s;return p(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?D(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(r))return;let a=this.extractFromKey(e,t),l=a.key;n=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let u=void 0!==t.count&&!p(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(p(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(r)||(s=e,!this.checkedLoadedFor[`${f[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(n=>{let s;if(this.isValidLookup(r))return;o=n;let a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,n,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(n,t.count,t));let r=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&a.push(l+e.replace(i,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+r)),h){let n=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(n),u&&(t.ordinal&&e.startsWith(i)&&a.push(n+e.replace(i,this.options.pluralSeparator)),a.push(n+e),d&&a.push(n+r))}}for(;s=a.pop();)this.isValidLookup(r)||(i=s,r=this.getResource(n,e,s,t))}))})}),{res:r,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(e={}){let t=e.replace&&!p(e.replace),r=t?e.replace:e;if(t&&void 0!==e.count&&(r={...r,count:e.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!t)for(let e of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[e];return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class F{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(!(e=R(e))||!e.includes("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=R(e))||!e.includes("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(p(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}let t=this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e;return this.logger.debug&&p(e)&&this.deprecateBareCode(e,t),t}deprecateBareCode(e,t){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch(e){return}this.options.lowerCaseLng&&(r=r.toLowerCase()),r!==t&&this.logger.once(e,"deprecate",`language code '${e}' is used as '${t}'; i18next v27 canonicalizes it to '${r}', use '${r}' in lng, fallbackLng, supportedLngs and the resources`)}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let r=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(r))&&(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let r=this.getScriptPartFromCode(e);if(this.isSupportedCode(r))return t=r;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n||(!!e.includes("-")||!!n.includes("-"))&&!(!e.includes("-")||n.includes("-"))&&e.slice(0,e.indexOf("-"))===n)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),p(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){let r=this.options.fallbackLng,n=Array.isArray(r)?r.join("|"):r;n!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=n);let i=void 0===t||!1===t||p(t),o=void 0===t&&"function"==typeof this.options.fallbackLng,s=p(e)&&i&&!o,a=null;if(s){let r;r=void 0===t?"undefined":!1===t?"boolean:false":`string:${t}`,a=`${e.length}:${e}|${r}`}if(null!==a){let e=this.resolveHierarchyCache[a];if(void 0!==e)return e.slice()}let l=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),c=[],u=e=>{e&&(this.isSupportedCode(e)?c.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return(p(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&u(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&u(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&u(this.getLanguagePartFromCode(e))):p(e)&&u(this.formatLanguageCode(e)),l.forEach(e=>{let t=this.formatLanguageCode(e);c.includes(t)||u(t)}),null!==a)?(this.resolveHierarchyCache[a]=c,c.slice()):c}}let $={zero:0,one:1,two:2,few:3,many:4,other:5},B={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class V{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=P.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let r,n=R("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{r=new Intl.PluralRules(n,{type:i})}catch(i){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),B;if(!e.match(/-|_/))return B;let n=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(n,t)}return this.pluralRulesCache[o]=r,r}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return(r||(r=this.getRule("dev",t)),r)?r.resolvedOptions().pluralCategories.sort((e,t)=>$[e]-$[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,r={}){let n=this.getRule(e,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}let K=(e,t,r,n=".",i=!0)=>{let o,s=void 0!==(o=S(e,r))?o:S(t,r);return null==s&&i&&p(r)&&void 0===(s=A(e,r,n))&&(s=A(t,r,n)),s};class H{constructor(e={}){this.logger=P.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:r,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:f,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:b}=e.interpolation;if(o||a||p||f){let e=Object.entries({prefixEscaped:o,suffixEscaped:a,nestingPrefixEscaped:p,nestingSuffixEscaped:f}).filter(([,e])=>e).map(([e])=>e);this.logger.once(e.join(),"deprecate",`interpolation.${e.join(", interpolation.")}: the regex-escaped delimiter options are removed in v27; pass the literal delimiters as prefix, suffix, nestingPrefix and nestingSuffix`)}this.escape=void 0!==t?t:E,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):o||"{{",this.suffix=s?s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u?u.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"-",this.unescapeSuffix=this.unescapePrefix?"":c?c.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):p||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=h?h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,r,n){let i,o,s,a=e,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=K(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,r,{...n,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),o=i.shift().trim(),s=i.join(this.formatSeparator).trim();return this.format(K(t,l,o,this.options.keySeparator,this.options.ignoreJSONStructure),s,r,{...n,...t,interpolationkey:o})};this.resetRegExp(),!this.escapeValue&&"string"==typeof e&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");let u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,h=[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?(this.escape===E&&this.options?.interpolation?.escapeValue!==!1&&p(e)&&e.includes("/")&&this.logger.once("/","deprecate","escapeValue renders '/' in a value as '/' today; from v27 the default escape leaves '/' as it is"),this.escape(e)):e}],g=[],y=0;return h.forEach(t=>{for(s=0;i=t.regex.exec(e);){let r=i.index-y,l=g.find(([e,t])=>r>=e&&r<t);if(l){t.regex.lastIndex=l[1]+y;continue}let h=i[1].trim();if(void 0===(o=c(h)))if("function"==typeof u){let t=u(e,i,n);o=p(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,h))o="";else if(d){this.logger.debug&&this.logger.once(`${a}\u0000${i[0]}`,"warn",`missed to pass in variable ${h} for interpolating ${a}`),o=i[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${e}`),o="";else p(o)||this.useRawValueToEscape||(o=f(o));let b=f(t.safeValue(o));if(e=e.slice(0,i.index)+b+e.slice(i.index+i[0].length),d?(t.regex===this.regexpUnescape?g.push([i.index,i.index+b.length]):y+=b.length-i[0].length,t.regex.lastIndex+=b.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=this.maxReplaces)break}}),e}nest(e,t,r={}){let n,i,o,s=(e,t)=>{let r=this.nestingOptionsSeparator;if(!e.includes(r))return e;let n=e.split(RegExp(`${r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),i=`{${n[1]}`;e=n[0];let s=(i=this.interpolate(i,o)).match(/'/g),a=i.match(/"/g);((s?.length??0)%2!=0||a)&&(a?.length??0)%2==0||(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${i}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,e},a=new RegExp(this.nestingRegexp),l="",c=0;for(;n=a.exec(e);){let u=[];(o=(o={...r}).replace&&!p(o.replace)?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let d=/{.*}/s.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==d&&(u=n[1].slice(d).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,d)),(i=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&!p(i))return i;p(i)||(i=f(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),u.length&&(i=u.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()}),i.trim())),l+=e.slice(c,n.index)+f(i),c=a.lastIndex,this.regexp.lastIndex=0}return c?l+e.slice(c):e}}let W=e=>{let t={};return(r,n,i)=>{let o,s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});try{o=n+JSON.stringify(s)}catch(t){return e(R(n),i)(r)}let a=t[o];return a||(a=e(R(n),i),t[o]=a),a(r)}},G=e=>(t,r,n)=>e(R(r),n)(t);class q{constructor(e={}){this.logger=P.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let r=t.cacheInBuiltFormats?W:G;this.formats={number:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:r((e,t)=>{let r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:r((e,t)=>{let r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:r((e,t)=>{let r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=W(t)}format(e,t,r,n={}){if(!t||null==e)return e;let i=t.split(this.formatSeparator),o=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;o.push(t)}return o.reduce((e,t)=>{let{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim(),r={};if(e.includes("(")){let n=e.split("(");t=n[0].toLowerCase().trim();let i=n[1].slice(0,-1);"currency"!==t||i.includes(":")?"relativetime"!==t||i.includes(":")?i.split(";").forEach(e=>{if(e){let[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();r[o]||(r[o]=i),"false"===i&&(r[o]=!1),"true"===i&&(r[o]=!0),isNaN(i)||(r[o]=parseInt(i,10))}}):r.range||(r.range=i.trim()):r.currency||(r.currency=i.trim())}return{formatName:t,formatOptions:r}})(t);if(this.formats[i]){let t=e;try{let s=n?.formatParams?.[n.interpolationkey]||{},a=s.locale||s.lng||n.locale||n.lng||r;t=this.formats[i](e,a,{...o,...n,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}}class z extends I{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=P.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n),this.callbackApi=g(this.backend),this.backend&&void 0===this.callbackApi&&(this.backend.read||this.backend.create)&&this.logger.deprecate("backend: set callbackApi to declare the calling convention (true: read(language, namespace, callback) and create(languages, namespace, key, fallbackValue, callback, options); false: both return a promise or a value); guessing it from the number of parameters is deprecated")}queueLoad(e,t,r,n){let i={},o={},s={},a={};return e.forEach(e=>{let n=!0;t.forEach(t=>{let s=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:!r.reload&&this.state[s]<0||(1===this.state[s]?void 0===o[s]&&(o[s]=!0):(this.state[s]=1,n=!1,void 0===o[s]&&(o[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===a[t]&&(a[t]=!0)))}),n||(s[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,r){let n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);let s={};this.queue.forEach(r=>{((e,t,r)=>{let{obj:n,k:i}=v(e,t,Object);n[i]=n[i]||[],n[i].push(r)})(r.loaded,[i],o),void 0!==r.pending[e]&&(delete r.pending[e],r.pendingCount--),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{s[e]||(s[e]={});let t=r.loaded[e];t.length&&t.forEach(t=>{void 0===s[e][t]&&(s[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:i,callback:o});this.readingCalls++;let s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&n<this.maxRetries?setTimeout(()=>{this.read(e,t,r,n+1,2*i,o)},i):o(s,a)},a=this.backend[r].bind(this.backend);if(!1===this.callbackApi||void 0===this.callbackApi&&2===a.length){try{let r=a(e,t);r&&"function"==typeof r.then?r.then(e=>s(null,e)).catch(s):s(null,r)}catch(e){s(e)}return}return a(e,t,s)}prepareLoading(e,t,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();p(e)&&(e=this.languageUtils.toResolveHierarchy(e)),p(t)&&(t=[t]);let i=this.queueLoad(e,t,r,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}noticeDevFallback(e){"dev"===e&&this.devIsDefaultFallback&&this.logger.once("dev","warn","language 'dev' is requested because fallbackLng is not set (its default is ['dev']); i18next v27 defaults to fallbackLng: false and loads and saves missing keys in the requested language instead. Set fallbackLng to your source language, or to 'dev' to keep this behavior")}loadOne(e,t=""){let r=e.split("|"),n=r[0],i=r[1];this.noticeDevFallback(n),this.read(n,i,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,r),!r&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,r,o)})}saveMissing(e,t,r,n,i,o={},s=()=>{},a=this.newestCloneHasLoadedNamespace||this.services?.utils?.hasLoadedNamespace){if(a&&!a(t))return void this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=r&&""!==r){if(this.backend?.create){e?.forEach?.(e=>this.noticeDevFallback(e));let a={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(!1===this.callbackApi||void 0===this.callbackApi&&l.length<6)try{let i;(i=!1===this.callbackApi||5===l.length?l(e,t,r,n,a):l(e,t,r,n))&&"function"==typeof i.then?i.then(e=>s(null,e)).catch(s):s(null,i)}catch(e){s(e)}else l(e,t,r,n,s,a)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}let J=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),p(e[1])&&(t.defaultValue=e[1]),p(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Y=e=>(p(e.ns)&&(e.ns=[e.ns]),p(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),p(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),X=()=>{};class Q extends I{constructor(e={},t){if(super(),this.options=Y(e),this.services={ownPostProcessors:new Set},this.logger=P,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(t={},r){this.isInitializing=!0,"function"==typeof t&&(r=t,t={}),null==t.defaultNS&&t.ns&&(p(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));let n=void 0===t.fallbackLng&&void 0===this.options.fallbackLng,i=J();this.options={...i,...this.options,...Y(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);let o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;e&&e!==this&&e.modules.logger!==this.modules.logger&&P.deprecate("init: this init() replaces the logger another i18next instance set with use(), as the logger is shared in v26; from v27 each instance keeps its own logger"),e=this.modules.logger?this:void 0,this.modules.logger?P.init(o(this.modules.logger),this.options):P.init(null,this.options),this.pendingWarnings?.forEach(e=>this.logger.warn(e)),this.pendingWarnings=void 0,t=this.modules.formatter?this.modules.formatter:q;let r=new F(this.options);this.store=new L(this.options.resources,this.options);let i=this.services;i.logger=P,i.resourceStore=this.store,i.languageUtils=r,i.pluralResolver=new V(r,{prepend:this.options.pluralSeparator}),t&&(i.formatter=o(t),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new H(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this),reloadResources:this.reloadResources.bind(this)},i.backendConnector=new z(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.devIsDefaultFallback=n,i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options),i.languageDetector.async&&void 0===g(i.languageDetector)&&this.logger.deprecate("languageDetector: set callbackApi to declare how the async detect() answers (true: detect(callback); false: detect() returns a promise); guessing it from the number of parameters is deprecated")),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new M(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,r||(r=X),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let s=h(),a=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(t),r(e,t)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),s}loadResources(e,t=X){let r=t,n=p(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return r();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};n?t(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(e)})}else r(null)}reloadResources(e,t,r){let n=h();if("function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),!e){let t=Object.keys(this.services.backendConnector.state).map(e=>e.split("|")[0]);e=[...new Set([...this.languages||[],...t])].filter(e=>"cimode"!==e)}return t||(t=this.options.ns),r||(r=X),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");let t=t=>{if(this.modules[t]&&this.modules[t]!==e){let e=`use: this ${t} replaces the ${t} passed to an earlier use() call; only one ${t} is used per instance`;this.isInitializing||this.isInitialized?this.logger.warn(e):(this.pendingWarnings=this.pendingWarnings||[]).push(e)}this.modules[t]=e};return"backend"===e.type&&t("backend"),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&t("languageDetector"),"i18nFormat"===e.type&&t("i18nFormat"),"postProcessor"===e.type&&(N.addPostProcessor(e),this.services.ownPostProcessors?.add(e.name)),"formatter"===e.type&&t("formatter"),"3rdParty"===e.type&&this.modules.external.push(e),this}hydrate(e,t){return this.options.isClone||(this.services.resourceStore?(e&&!this.initializedStoreOnce&&(this.services.resourceStore.data=e,Object.values(e).forEach(e=>{Object.keys(e).forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)})}),this.initializedStoreOnce=!0,this.isInitialized=!0),t&&!this.initializedLanguageOnce&&(this.changeLanguage(t),this.initializedLanguageOnce=!0)):this.logger.warn("hydrate: call init() first, the instance has no resource store yet")),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let r=h();this.emit("languageChanging",e);let n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,r.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);let r=p(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(p(t)?[t]:t);o&&this.logger.debug&&!(p(o)&&/^[A-Za-z0-9_@.-]{1,128}$/.test(o)&&!o.includes("..")&&!["__proto__","constructor","prototype"].includes(o))&&([].concat(this.options.supportedLngs||[],this.services.languageUtils.getFallbackCodes(this.options.fallbackLng,o),this.options.preload||[]).includes(o)||Object.prototype.hasOwnProperty.call(this.store.data,o)||this.logger.once(`lng:${o}`,"deprecate",`changeLanguage: the language code '${o.slice(0,64)}' comes from lng, changeLanguage() or the language detector and is not configured; from v27 such a code is refused unless it has only letters, digits, '-', '_', '@' and '.' (no '..'), at most 128 characters. Set supportedLngs, or check the code before passing it on`)),o&&(this.language||n(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(e,o)})};if(e||!this.services.languageDetector||this.services.languageDetector.async)if(!e&&this.services.languageDetector&&this.services.languageDetector.async){let e=g(this.services.languageDetector);!1===e||void 0===e&&0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o)}else o(e);else o(this.services.languageDetector.detect());return r}getFixedT(e,t,r,n){let i=n?.scopeNs,o=(e,t,...n)=>{let s,a;(s="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(n)):{...t}).lng=s.lng||o.lng,s.lngs=s.lngs||o.lngs;let l=void 0!==s.ns&&null!==s.ns;s.ns=s.ns||o.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||r||o.keyPrefix);let c={...this.options,...s};Array.isArray(i)&&!l&&(c.ns=i),"function"==typeof s.keyPrefix&&(s.keyPrefix=D(s.keyPrefix,c));let u=this.options.keySeparator||".";return s.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=D(e,c)),`${s.keyPrefix}${u}${e}`)):("function"==typeof e&&(e=D(e,c)),a=s.keyPrefix?`${s.keyPrefix}${u}${e}`:e),this.t(a,s)};return p(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=r,o}t(...e){return this.translator?this.translator.translate(...e):(this.logger.warn("t: called before init(); returning an empty string"),"")}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let o=(e,t)=>{let r=this.services.backendConnector.state[`${e}|${t}`];return -1===r||0===r||2===r};if(t.precheck){let e=t.precheck(this,o);if(void 0!==e)return e}if(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;let{languageUtils:s}=this.services,a=t.lng?s.isSupportedCode(r)&&s.toResolveHierarchy(r,!1)[0]:r;return!!((!a||o(a,e))&&(!n||o(i,e)))}loadNamespaces(e,t){let r=h();return this.options.ns?(p(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){let r=h();p(e)&&(e=[e]);let n=this.options.preload||[],i=e.filter(e=>!n.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=n.concat(i),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"ltr";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new F(J());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){let r=new Q(e,t);return r.createInstance=Q.createInstance,r}cloneInstance(e={},t=X){let r=e.forkResourceStore;r&&(e={...e},delete e.forkResourceStore);let n={...this.options,preload:!1,...e,isClone:!0},i=new Q(n);if((void 0!==e.debug||void 0!==e.prefix)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={...i.services.utils,hasLoadedNamespace:i.hasLoadedNamespace.bind(i),reloadResources:i.reloadResources.bind(i)},r){let e=t=>{let r=Array.isArray(t)?[...t]:{...t};return Object.keys(r).forEach(t=>{r[t]&&"object"==typeof r[t]&&(r[t]=e(r[t]))}),r};i.store=new L(e(this.store.data),n),i.services.resourceStore=i.store}if(e.interpolation){let t={...J().interpolation,...this.options.interpolation,...e.interpolation},r={...n,interpolation:t};i.services.interpolator=new H(r)}return i.translator=new M(i.services,n),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.newestCloneHasLoadedNamespace=i.hasLoadedNamespace.bind(i),i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let Z=Q.createInstance();Z.createInstance,Z.dir,Z.init,Z.loadResources,Z.reloadResources,Z.use,Z.changeLanguage,Z.getFixedT,Z.t,Z.exists,Z.setDefaultNamespace,Z.hasLoadedNamespace,Z.loadNamespaces,Z.loadLanguages;var ee=r(8183),et=r.n(ee);let er=moment;var en=r.n(er),ei=r(3472),eo=r.n(ei);class es{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 ea(e){var t,r,n,i;return t=this,r=arguments,n=void 0,i=function*(e,{initialDelayMillis:t=1e3,maxDelayMillis:r=8e3,attemptTimeoutMillis:n=1e4,timeoutMillis:i=45e3}={}){let o=Date.now()+i,s=t;for(;;){let t,i=new Promise((e,r)=>{let i=Math.min(n,o-Date.now());t=window.setTimeout(()=>r(Error(`No response within ${i} ms`)),i)});try{return yield Promise.race([e(),i])}catch(e){if(Date.now()+s>=o)throw e;console.warn(`Request failed, trying again in ${s} ms`,e)}finally{window.clearTimeout(t)}yield new Promise(e=>window.setTimeout(e,s)),s=Math.min(2*s,r)}},new(n||(n=Promise))(function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(s,a)}l((i=i.apply(t,r||[])).next())})}function el(){return navigator.language.split("-")[0]||"en"}function ec(e){return et().parse(e,{ignoreQueryPrefix:!0})}function eu(e){let t;if(location.search&&""!==location.search&&(t=ec(location.search)),location.hash){let e=location.hash.indexOf("?");e>-1&&(t=ec(location.hash.substring(e+1)))}return t?t[e]:void 0}function ed(e){let t=[];return e.rules.forEach(e=>{if(e.when&&e.then&&e.then.length>0){let r=new Map;for(let n of(function(e,t){if(!e)return;let r=[];e.groups&&e.groups.forEach(e=>{e.items&&e.items.forEach(e=>{r.push(e)})}),e.items&&e.items.forEach(e=>{r.push(e)}),r&&r.forEach(e=>{if(e.assets&&e.assets.attributes){let r=[];if(function e(t,r){t&&(t.items.forEach(e=>{e.value&&("radial"===e.value.predicateType||"rect"===e.value.predicateType)&&r.push({predicate:e.value})}),t.groups&&t.groups.forEach(t=>e(t,r)))}(e.assets.attributes,r),r.length>0){let n=e.tag||"0";t.set(n,r)}}})}(e.when,r),r.size>0&&e.then.forEach(e=>(function(e,t){if(e&&"notification"===e.action&&e.notification&&e.notification.message&&"push"===e.notification.message.type){let r=e.target;if(r&&r.conditionAssets){let n=t.get(r.conditionAssets);n&&n.forEach(t=>{t.notification=e.notification.message})}else for(let r of t.values())r.forEach(t=>{t.notification=e.notification.message})}})(e,r)),r.values()))n.forEach(e=>{e.notification&&t.push(e)})}}),t}let ep=/([+-])?((\d+)[Dd])?\s*((\d+)[Hh])?\s*((\d+)[Mm]$)?\s*((\d+)[Ss])?\s*((\d+)([Mm][Ss]$))?\s*((\d+)[Ww])?\s*((\d+)[Mm][Nn])?\s*((\d+)[Yy])?/;function eh(e){return!!e&&(e=e.trim()).length>0&&(ep.test(e)||ef(e)||eg(e))}function ef(e){return"*"===(e=null!=e?e.trim():void 0)||"+*"===e}function eg(e){return"-*"===(e=null!=e?e.trim():void 0)}function ey(e){return!!e&&"object"==typeof e}function eb(e,t,r=!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(r){if(Array.isArray(e))return e.every((e,r)=>eb(e,t[r]));let r=Object.keys(e);return Object.keys(t).every(e=>-1!==r.indexOf(e))&&r.every(r=>eb(e[r],t[r]))}return!1}function em(e,t){let r=(e,t)=>eo()(e,function(e,n,i){eb(n,null==t?void 0:t[i])||(e[i]=ey(n)&&ey(null==t?void 0:t[i])?r(n,null==t?void 0:t[i]):n)});return r(e,t)}function ev(e,t){if(0===e.length)return;let r=e.indexOf(t);r>=0&&e.splice(r,1)}function e_(e){return null==e?"":e.split(" ").map((e,t)=>0===t?e[0].toLowerCase()+e.substring(1):e[0].toUpperCase()+e.substring(1)).join("")}function eS(e){if(null==e)return"";let t=!1;return e.split(/([A-Z]|\d)/).map((e,r,n)=>{if(!e)return e;if(!t)return t=!0,e.charAt(0).toUpperCase()+e.slice(1);if("_"===e)return" ";if(1===e.length&&e===e.toUpperCase()){let t=!n[r-1]||"_"===n[r-1],i=r+1<n.length&&n[r+1]&&"_"!==n[r+1],o=r+3>n.length||!n[r+1]&&!n[r+3];(!t||i)&&(e=" "+e),!i&&(t||o)||(e=e.toLowerCase())}return e}).join("").trim()}function ew(e,t){if(t===e)return!0;let r=e.endsWith("*"),n=!r&&e.startsWith("*"),i=!r&&!n&&e.startsWith("^")&&e.endsWith("$");if(r&&t.startsWith(e.substr(0,e.length-1))||n&&t.endsWith(e.substr(1)))return!0;if(i)try{return new RegExp(e).test(t)}catch(e){console.error("Failed to compile needle as a RegExp: "+e)}return!1}function ek(e){if(e)return 1===e.length?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function eE(e,t){return Object.keys(e).find(r=>e[r]===t)}function eO(e){(e=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))).setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));let t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}let ex=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function eA(e,t,r,n,i,o,s){let a="";if(o?Array.isArray(o)?a+=o.toString().replace(" ",""):a+=o.toString():a+="0",a+=" ",i?Array.isArray(i)?a+=i.toString().replace(" ",""):a+=i.toString():a+="0",a+=" ",n?Array.isArray(n)?a+=n.toString().replace(" ",""):a+=n.toString():a+="0",a+=" ",r?Array.isArray(r)?a+=r.toString().replace(" ",""):a+=r.toString():a+="*",a+=" ",t)if(Array.isArray(t))if("number"==typeof t[0]){let e=[];t.forEach(t=>{e.push(ex[t].toString())}),a+=e.toString().replace(" ","")}else a+=t.toString().replace(" ","");else a+=t.toString();else a+="*";return a+=" ",s?a+=s.toString():a+="?",a+=" ",e?Array.isArray(e)?a+=e.toString().replace(" ",""):a+=e:a+="*",a}function eR(e){return eA(e.getFullYear(),ex[e.getMonth()],[e.getDate()],[e.getHours()],[e.getMinutes()])}function eC(e,t){let r=e.split(" ");if(!Number.isNaN(Number(r[0]))&&!Number.isNaN(Number(r[1]))&&!Number.isNaN(Number(r[2]))&&(!Number.isNaN(Number(r[3]))||"*"==r[3])){let e=(!Number.isNaN(Number(r[6]))?r[6]:new Date().getFullYear()).toString(),n="";n=1==(n="*"!=r[4]?ex.indexOf(r[4]).toString():new Date().getMonth().toString()).length?"0"+n:n;let i=1==r[3].length&&"*"!=r[3]?"0"+r[3]:r[3].replace("*","01"),o=1==r[2].length&&"*"!=r[2]?"0"+r[2]:r[2].replace("*","00"),s=1==r[1].length&&"*"!=r[1]?"0"+r[1]:r[1].replace("*","00"),a=1==r[0].length&&"*"!=r[0]?"0"+r[0]:r[0].replace("*","00");if(e.length>0&&n.length>0)if(t)return en().utc({year:Number(e),month:Number(n),date:Number(i),hour:Number(o),minute:Number(s),second:Number(a)}).toISOString();else return en()({year:Number(e),month:Number(n),date:Number(i),hour:Number(o),minute:Number(s),second:Number(a)}).toISOString()}}function eP(e,t,r){let n="string"==typeof e?e:e.name;return t&&t.meta&&t.meta.hasOwnProperty(n)?t.meta[n]:r&&r.meta?r.meta[n]:void 0}function eI(e,t,r){let n="string"==typeof e?e:e.name;return!!(t&&t.meta&&t.meta.hasOwnProperty(n)||r&&r.meta&&r.meta.hasOwnProperty(n))}function eT(e){return!eL(e)}function eL(e){return!!((null==e?void 0:e.jsonType)==="object"||(null==e?void 0:e.arrayDimensions)&&e.arrayDimensions>0)}function eN(){return d.AssetModelUtil.getMetaItemDescriptors().filter(e=>eT(d.AssetModelUtil.getValueDescriptor(e.type)))}function ej(){return d.AssetModelUtil.getMetaItemDescriptors().filter(e=>eL(d.AssetModelUtil.getValueDescriptor(e.type)))}function eD(e){return("string"==typeof e&&(e=d.AssetModelUtil.getAssetDescriptor(e)),e)?Z.t("label.asset."+e.name,{defaultValue:eS(e.name)}):""}function eU(e){if(!e)return Z.t("label.value.unknown",{defaultValue:"Unknown"});let t="string"==typeof e?e:e.name;return Z.t("label.value."+t,{defaultValue:eS(t||"")})}function eM(e,t){if(e)return Z.t("label.allowedValue."+e,{defaultValue:t||eS(e||""),nsSeparator:!1})}function eF(e,t){let r="string"==typeof e?d.AssetModelUtil.getMetaItemDescriptor(e):e;return r?{name:r.name,type:r.type,value:t}:{name:typeof e,type:d.AssetModelUtil.resolveValueTypeFromValue(t),value:t}}function e$(e,t,r,n,i){return eV(e,t,r,n,!0,i)}function eB(e,t,r,n,i){return eV(e||eF(t,null),t,r,n,!1,i)}function eV(e,t,r,n,i,o){let s=e1("label",e,t,r,i),a="";if(s||(s=eP("label",e,t&&t.meta?t:void 0)),n&&(a=eq(e0("units",e,t,r,i))),!s){let r=e?e.name:t?"string"==typeof t?t:t.name:void 0;s=o||(r?eS(r):void 0)}return s?s+(a?" ("+a+")":""):a}function eK(e,t,r,n,i){return eW(e,t,r,n,!0,i)}function eH(e,t,r,n,i){return eW(e||eF(t,null),t,r,n,!1,i)}function eW(e,t,r,n,i,o){let s=eG(e?e.value:void 0,()=>e0("format",e,t,r,i),void 0,o),a=eY(e,t,r);return n&&a&&a.length&&(s=eq(e0("units",e,t,r,i),s)),s}function eG(e,t,r,n){let i="";if(null==e)i=n||"";else if("string"==typeof e)i=e;else if("number"==typeof e||"boolean"==typeof e||e instanceof Date){let n=t&&t();if(n&&0!==Object.keys(n).length)switch("number"==typeof e?n.asBoolean?e=!!e:n.asDate&&(e=new Date(e)):"boolean"==typeof e&&n.asNumber&&(e=+!!e),typeof e){case"number":i=new Intl.NumberFormat(r||Z.language,n).format(e);break;case"boolean":n.asOnOff&&(i=e?Z.t("on"):Z.t("off")),n.asOpenClosed&&(i=e?Z.t("open"):Z.t("closed")),n.asPressedReleased&&(i=e?Z.t("pressed"):Z.t("released"));break;case"object":if(n.momentJsFormat)i=en()(e).format(n.momentJsFormat);else if(n.iso8601)i=e.toISOString();else if(n.week){let t=eO(e);i="2-digit"===n.week?String(t).padStart(2,"0"):Number(t).toString(10)}else i=new Intl.DateTimeFormat(r||Z.language,n).format(e)}else i=Object(e).toString()}return i}function eq(e,t){if(!e)return"";t||(t="");let r=e.map((e,r)=>{if(3!==e.length||e.toUpperCase()!==e)return Z.t(["units."+e,"or:units."+e]);{let n=new Intl.NumberFormat(Z.language,{currency:e,style:"currency"}).formatToParts();if(0!==r||"currency"!==n[0].type)return"currency"===n[0].type?n[0].value:n[n.length-1].value;if(!t)return n[0].value;t=n[0].value+t}}).join("");return t.length>0?t+" "+r:r}function ez(e,t,r){return e0("constraints",e,t,r,!0)}function eJ(e,t,r){return e0("constraints",e||eF(t,null),t,r,!1)}function eY(e,t,r){return e0("units",e,t,r,!0)}function eX(e,t,r){return e0("units",e||eF(t,null),t,r,!1)}function eQ(e,t,r){return e0("format",e,t,r,!0)}function eZ(e,t,r){return e0("format",e||eF(t,null),t,r,!1)}function e0(e,t,r,n,i){let o,s=[],a=e1(e,t&&"string"==typeof t?t:t?t.name:r?"string"==typeof r?r:r.name:void 0,r,n,i);if(a&&(o=JSON.parse(a)))if("format"!==e)return o;else s.push(o);if(t&&t.meta&&(o=eP(e,t,r)))if("format"!==e)return o;else s.push(o);if(r&&"string"!=typeof r&&r.hasOwnProperty(e)){if(o=r[e],"format"!==e)return o;s.push(o)}if(r&&r.type){if(o=d.AssetModelUtil.getValueDescriptor(r.type)[e],"format"!==e)return o;s.push(o)}if("format"!==e||0===s.length)return o;let l={};return s.reverse().forEach(e=>{l=Object.assign(Object.assign({},l),e)}),l}function e1(e,t,r,n,i,o){let s;if(t?s="string"==typeof t?t:t.name:r&&(s="string"==typeof r?r:r.name),!s)return;let a=[],l=e+"."+(i?"attribute":"meta")+".";if(n&&a.push(l+n+"."+s),r&&"string"!=typeof r&&(a.push(l+r.type+"."+s),a.push(l+r.type)),a.push(l+s),a.length>0)return Z.t(a,{defaultValue:o||""})}function e2(e,t){let r=t.ref.name;if(e.attributes)if(t.deleted)delete e.attributes[r];else{let n=e.attributes[r];n&&(n.value=t.value,n.timestamp=t.timestamp)}return Object.assign({},e)}function e5(e){return new Promise((t,r)=>{let n=document.createElement("script");n.type="text/javascript",n.src=e,n.addEventListener("load",e=>t(e),!1),n.addEventListener("error",e=>r(e),!1),document.body.appendChild(n)})}function e3(e){return(t,r)=>{let n=e(t),i=e(r);return n||i?n&&!i?1:!n&&i?-1:n-i:0}}function e6(e){return(t,r)=>{let n=e(t),i=e(r);return n||i?n&&!i?1:!n&&i?-1:n.localeCompare(i):0}}function e8(e,t){let r=new es;return e.dispatchEvent(t),window.setTimeout(()=>{r.resolve(t.detail)}),r.promise}function e4(e){return new Promise((t,r)=>{let n=new FileReader;n.readAsDataURL(e),n.onload=()=>{t(n.result)},n.onerror=e=>{r(e)}})}function e9(){return"function"==typeof crypto.randomUUID?crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}class e7{constructor(e){e&&Object.assign(this,e)}matches(e){var t,r,n,i,o,s,a;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(r=this.types)?void 0:r.length)&&(!e.type||!this.types.includes(e.type))||(null==(n=this.realm)?void 0:n.name)&&e.realm!==this.realm.name||(null==(i=this.parents)?void 0:i.length)&&!this.parents.some(t=>!t.id||e.parentId===t.id))return!1;if(null==(o=this.paths)?void 0:o.length){let t=null!=(s=e.path)?s:[];if(!this.paths.some(e=>{var r;return(null!=(r=e.path)?r:[]).every((e,r)=>t[r]===e)}))return!1}return(null==(a=this.names)||!a.length||!!this.names.every(t=>e7._evalValuePredicate(e.name,t)))&&(!this.attributes||e7._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!e7._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?e7._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var r;switch(t.predicateType){case"string":{let n;if(null==e)return!1;let i=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),o=!1!==t.caseSensitive?t.value:null==(r=t.value)?void 0:r.toLowerCase();switch(t.match){case"BEGIN":n=i.startsWith(o);break;case"END":n=i.endsWith(o);break;case"CONTAINS":n=i.includes(o);break;default:n=i===o}return t.negate?!n:n}case"boolean":return e===t.value;case"number":{let r;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":r=e>t.value;break;case"GREATER_EQUALS":r=e>=t.value;break;case"LESS_THAN":r=e<t.value;break;case"LESS_EQUALS":r=e<=t.value;break;case"BETWEEN":r=e>=t.value&&e<=t.rangeValue;break;default:r=e===t.value}return t.negate?!r:r}}return!1}static _evalPredicate(e,t){var r,n;let i=null==(r=t.name)?void 0:r.value;if(!i)return!0;let o=null==(n=e.attributes)?void 0:n[i];if(!o)return!!t.negated;let s=!t.value||e7._evalValuePredicate(o.value,t.value);return t.negated?!s:s}static _evalGroup(e,t){var r,n,i;let o=null!=(r=t.operator)?r:"AND",s=[...(null!=(n=t.items)?n:[]).map(t=>e7._evalPredicate(e,t)),...(null!=(i=t.groups)?i:[]).map(t=>e7._evalGroup(e,t))];return!s.length||("OR"===o?s.some(Boolean):s.every(Boolean))}static _collectNames(e){var t,r;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(r=e.groups)?r:[]).flatMap(e=>e7._collectNames(e))]}}e7._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var te=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let tt=r(4461);class tr{constructor(e,t,r){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=r,window.OpenRemoteConsole=this;const n=new URLSearchParams(window.location.search),i=n.get("consoleName"),o=n.get("consoleVersion"),s=n.get("consolePlatform"),a=n.get("consoleProviders"),l=n.get("consoleAutoEnable"),c=a&&a.length>0?a.split(" "):["push"];this._pendingProviderEnables=c;const u=tr._createConsoleRegistration(),d=window.localStorage.getItem(this._storageKey);if(d)try{const e=JSON.parse(d);e.id&&(u.id=e.id),e.name&&(u.name=e.name),e.providers&&(u.providers=e.providers),e.apps&&(u.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}const p=u.providers;for(const e of(u.providers={},c)){const t=p&&p.hasOwnProperty(e)?p[e]:{enabled:!1,disabled:!1};u.providers[e]=t}const h=t6.getAppName();h.length>0&&0>u.apps.indexOf(h)&&u.apps.push(h),this._registration=u,i&&(u.name=i),o&&(u.version=o),s&&(u.platform=s),l&&(this._autoEnable="TRUE"===l||"true"===l)}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 te(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return te(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 te(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 r={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},n=yield this.sendProviderMessage(r,!0);this._registration.providers[e].hasPermission=n.hasPermission,this._registration.providers[e].success=n.success,this._registration.providers[e].enabled=n.success,this._registration.providers[e].data=n.data;let i=this._pendingProviderEnables.indexOf(e);return i>=0&&(this._pendingProviderEnables.splice(i,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),n})}disableProvider(e){return te(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 te(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 r=e.provider+e.action;if(this._pendingProviderPromises[r])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let n=new es,i=()=>{delete this._pendingProviderPromises[r],n.reject("No response from provider")};return this._pendingProviderPromises[r]=[n,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),n.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>te(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),e()}catch(e){console.error("Failed to register console",e),t(e)}}))})}_sendRegistration(e){return te(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield t6.rest.api.ConsoleResource.register(this._registration);if(200!==e.status)throw Error("Failed to register console");this._registration=e.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(r){if(e&&t&&tr._isStaleRegistrationResponse(r)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw r}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(e){let t=e&&e.response?e.response.status:void 0;return 403===t||409===t}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return te(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 r={type:e,data:t};this.isMobile?this._postNativeShellMessage(r):console.warn("Failed to send generic message to console.",r)}_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 r=window.localStorage.getItem(t);if(null!==r)try{r=JSON.parse(r)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:r}))}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),r=t.provider,n=t.action,i=this._pendingProviderPromises[r+n];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[r+n],i[0].resolve(t));let o=this._providerMessageListeners[r+n];o&&o(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:tt.name,version:tt.version,platform:tt.os.toString(),apps:[],model:((tt.manufacturer?tt.manufacturer+" ":"")+(tt.product?tt.product:"")).trim()}}_initialiseProvider(e){return te(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)}})}}var tn=r(9207),ti=r.n(tn),to=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};(i=a||(a={})).DISCONNECTED="DISCONNECTED",i.CONNECTED="CONNECTED",i.CONNECTING="CONNECTING";let ts="SUBSCRIBED:",ta="UNAUTHORIZED:",tl="TRIGGERED:",tc="EVENT:";class tu{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=td.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=a.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){ev(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===a.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(a.CONNECTING),this._connectingDeferred=new es,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=td.MIN_RECONNECT_DELAY,this._onStatusChanged(a.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!==a.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let r={eventSubscription:e,callback:t,deferred:new es};return null!=this._pendingSubscription||this._status!==a.CONNECTED?(this._queuedSubscriptions.push(r),r.deferred.promise):(this._pendingSubscription=r,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,t.cancelled?this._doUnsubscribe(e):this._subscriptionMap.set(e,t),this._processNextSubscription();let r=t.deferred;t.deferred=null,r&&r.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;if(this._pendingSubscription=null,this._processNextSubscription(),t.cancelled)return void this._resolveCancelledSubscription(t);let r=t.deferred;t.deferred=null,r&&r.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return to(this,void 0,void 0,function*(){var t;if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);let r=this._queuedSubscriptions.find(t=>t.eventSubscription.subscriptionId===e);if(r){ev(this._queuedSubscriptions,r),this._resolveCancelledSubscription(r);return}if((null==(t=this._pendingSubscription)?void 0:t.eventSubscription.subscriptionId)===e){this._pendingSubscription.cancelled=!0;return}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)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}})}sendEvent(e){this._status===a.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==a.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,r){return to(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+tu._subscriptionCounter++;if(!this._assetEventPromise){let e;t6.authenticated||(e={filterType:"asset",realm:t6.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))}).catch(e=>{throw this._assetEventPromise=void 0,e})}return this._assetEventCallbackMap.set(i,e=>{let t=e.asset.id;n?n.find(e=>t===e)&&r(e):e.asset.realm===t6.displayRealm&&r(e)}),this._assetEventPromise.catch(()=>this._assetEventCallbackMap.delete(i)),this._assetEventPromise.then(()=>{try{if(n&&t){let e={messageID:"read-assets:"+n.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:n}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{r({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),i&&this.unsubscribe(i),t}return i})})}subscribeAttributeEvents(e,t,r){return to(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0],i=n?e.map(e=>e.id):e,o=n?e:void 0,s="AttributeEvent"+tu._subscriptionCounter++;if(!this._attributeEventPromise){let e;t6.authenticated||(e={filterType:"asset",realm:t6.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))}).catch(e=>{throw this._attributeEventPromise=void 0,e})}let a=t=>{let o=t.ref;n?e.forEach(e=>{o.id===e.id&&o.name===e.name&&r(t)}):i?i.find(e=>o.id===e)&&r(t):t.realm===t6.displayRealm&&r(t)};return this._attributeEventCallbackMap.set(s,a),this._attributeEventPromise.catch(()=>this._attributeEventCallbackMap.delete(s)),this._attributeEventPromise.then(()=>{try{if(t&&i){let e={messageID:"read-assets:"+i.join(",")+":"+s,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(s)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,r])=>{(!o||o.find(r=>r.id===e.id&&r.name===t))&&a({eventType:"attribute",timestamp:r.timestamp,value:r.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),s&&this.unsubscribe(s),t}return s})})}_processNextSubscription(){this._status===a.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let r=e.deferred;e.deferred=null,r&&r.resolve(t)},t=>{let r=e.deferred;e.deferred=null,r&&r.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 r=this._subscriptionMap.get(e);r&&r.callback(t)}_onConnect(){this._subscriptionMap.forEach(e=>this._queuedSubscriptions.unshift(e)),this._subscriptionMap.clear(),this._processNextSubscription()}_onDisconnect(){if(this._status===a.CONNECTED&&this._onStatusChanged(a.DISCONNECTED),this._pendingSubscription){let e=this._pendingSubscription;this._pendingSubscription=null,e.cancelled?this._resolveCancelledSubscription(e):this._queuedSubscriptions.unshift(e)}this._onStatusChanged(a.CONNECTING),this._scheduleReconnect()}_resolveCancelledSubscription(e){var t;null==(t=e.deferred)||t.resolve(e.eventSubscription.subscriptionId),e.deferred=null}_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<td.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(td.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}tu.MIN_RECONNECT_DELAY=0,tu.MAX_RECONNECT_DELAY=3e4,tu._subscriptionCounter=0;class td extends tu{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(){this._discardWebSocket();let e=this._endpointUrl+"?Realm="+t6.config.realm;return this._connectDeferred=new es,(t6.authenticated?t6.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(ts)){let e=JSON.parse(t.substring(ts.length)),r=this._subscribeDeferred;this._subscribeDeferred=null,r&&r.resolve(e.subscriptionId)}else if(t.startsWith(ta)){let e=JSON.parse(t.substring(ta.length)),r=this._subscribeDeferred;this._subscribeDeferred=null,r&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),r.reject("Unauthorized"))}else if(t.startsWith(tl)){let e=JSON.parse(t.substring(tl.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(tc)){let e=JSON.parse(t.substring(tc.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}}}),this._connectDeferred.promise}_discardWebSocket(){this._webSocket&&(this._webSocket.onopen=null,this._webSocket.onerror=null,this._webSocket.onclose=null,this._webSocket.onmessage=null,this._webSocket.close(),this._webSocket=void 0)}_beforeDisconnect(){this._subscribeDeferred=null,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 es,e.subscriptionId||(e.subscriptionId=td._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=tc+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 es;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(tc+JSON.stringify(e)),t.promise}}td._subscriptionCounter=1;let tp=["__proto__","constructor","prototype"];function th(e){return!("string"!=typeof e||0===e.length||e.length>128||tp.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%:&=;\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function tf(e){return!(!th(e)||e.indexOf("/")>-1||e.indexOf("@")>-1)}let tg={lng:tf,ns:function(e){return!(!th(e)||e.indexOf("//")>-1)}};function ty(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function tb(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let tm=/\{\{(.+?)\}\}/g,tv=/^[/\\]{2}/;function t_(e,t){let r=!1,n=e.replace(tm,(e,n)=>{let i=n.trim();if(tp.indexOf(i)>-1)return e;let o=t[i];if(null==o)return e;let s=tg[i]||tf,a=String(o).split("+");for(let t of a)if(!s(t))return r=!0,e;return a.join("+")});return r||tv.test(n)&&!tv.test(e)?null:n}let tS="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?t=fetch:tS&&"function"==typeof tS.fetch&&(t=tS.fetch);let tw=tb()&&tS?tS.XMLHttpRequest:void 0,tk="function"==typeof ActiveXObject&&tS?tS.ActiveXObject:void 0,tE=["__proto__","constructor","prototype"],tO=(e,t)=>{if(t&&"object"==typeof t){let r="";for(let e of Object.keys(t))tE.indexOf(e)>-1||(r+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!r)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+r.slice(1)}return e},tx=(e,r,n,i)=>{let o=e=>{if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(i){let t=i(e,r);if(t instanceof Promise)return void t.then(o).catch(n)}"function"==typeof fetch?fetch(e,r).then(o).catch(n):t(e,r).then(o).catch(n)},tA=(e,r,n,i)=>{if("function"==typeof n&&(i=n,n=void 0),i=i||(()=>{}),t&&0!==r.indexOf("file:")){var o=r,s=n,a=i;e.queryStringParams&&(o=tO(o,e.queryStringParams));let t={..."function"==typeof e.customHeaders?e.customHeaders():e.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(t["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),s&&(t["Content-Type"]="application/json");let l="function"==typeof e.requestOptions?e.requestOptions(s):e.requestOptions,c={method:s?"POST":"GET",body:s?e.stringify(s):void 0,headers:t,...e._omitFetchOptions?{}:l},u="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{tx(o,c,a,u)}catch(t){if(!l||0===Object.keys(l).length||!t.message||0>t.message.indexOf("not implemented"))return a(t);try{Object.keys(l).forEach(e=>{delete c[e]}),tx(o,c,a,u),e._omitFetchOptions=!0}catch(e){a(e)}}return}if(tb()||"function"==typeof ActiveXObject){var l=r,c=n,u=i;c&&"object"==typeof c&&(c=tO("",c).slice(1)),e.queryStringParams&&(l=tO(l,e.queryStringParams));try{let t=tw?new tw:new tk("MSXML2.XMLHTTP.3.0");t.open(c?"POST":"GET",l,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,c&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let r=e.customHeaders;if(r="function"==typeof r?r():r)for(let e of Object.keys(r))tE.indexOf(e)>-1||t.setRequestHeader(e,r[e]);t.onreadystatechange=()=>{t.readyState>3&&u(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(c)}catch(e){console&&console.log(e)}return}i(Error("No fetch and no xhr implementation found!"))};var tR=class{constructor(e,t={},r={}){this.services=e,this.options=t,this.allOptions=r,this.type="backend",this.init(e,t,r)}init(e,t={},r={}){if(this.services=e,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,r)=>({[t]:r||""}),parseLoadPayload:(e,t)=>void 0,request:tA,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...t},this.allOptions=r,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,r){this._readAny(e,e,t,t,r)}read(e,t,r){this._readAny([e],e,[t],t,r)}_readAny(e,t,r,n,i){var o,s;let a=this.options.loadPath;"function"==typeof this.options.loadPath&&(a=this.options.loadPath(e,r)),(a=(s=o=a)&&"function"==typeof s.then?o:Promise.resolve(o)).then(o=>{if(!o)return i(null,{});let s=t_(o,{lng:e.join("+"),ns:r.join("+")});if(null==s)return i(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(ty).join(", ")+"] namespaces=["+r.map(ty).join(", ")+"]"),!1);this.loadUrl(s,i,t,n)})}loadUrl(e,t,r,n){let i=this.options.parseLoadPayload("string"==typeof r?[r]:r,"string"==typeof n?[n]:n),o=ty(function(e){if("string"!=typeof e||0===e.length)return e;try{let t=new URL(e);if(t.username||t.password)return t.username="",t.password="",t.toString();return e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,i,(e,i)=>{let s,a;if(i&&(i.status>=500&&i.status<600||!i.status))return t("failed loading "+o+"; status code: "+i.status,!0);if(i&&i.status>=400&&i.status<500)return t("failed loading "+o+"; status code: "+i.status,!1);if(!i&&e&&e.message){let r=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>r.indexOf(e)>-1))return t("failed loading "+o+": "+ty(e.message),!0)}if(e)return t(e,!1);try{s="string"==typeof i.data?this.options.parse(i.data,r,n):i.data}catch(e){a="failed parsing "+o+" to json"}if(a)return t(a,!1);t(null,s)})}create(e,t,r,n,i){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let o=this.options.parsePayload(t,r,n),s=0,a=[],l=[];e.forEach(r=>{let n=this.options.addPath;"function"==typeof this.options.addPath&&(n=this.options.addPath(r,t));let c=t_(n,{lng:r,ns:t});if(null==c){s+=1,i&&s===e.length&&i(a,l);return}this.options.request(this.options,c,o,(t,r)=>{s+=1,a.push(t),l.push(r),s===e.length&&"function"==typeof i&&i(a,l)})})}reload(){let{backendConnector:e,languageUtils:t,logger:r}=this.services,n=e.language;if(n&&"cimode"===n.toLowerCase())return;let i=[],o=e=>{t.toResolveHierarchy(e).forEach(e=>{0>i.indexOf(e)&&i.push(e)})};o(n),this.allOptions.preload&&this.allOptions.preload.forEach(e=>o(e)),i.forEach(t=>{this.allOptions.ns.forEach(n=>{e.read(t,n,"read",null,null,(i,o)=>{i&&r.warn(`loading namespace ${n} for language ${t} failed`,i),!i&&o&&r.log(`loaded namespace ${n} for language ${t}`,o),e.loaded(`${t}|${n}`,i,o)})})})}};tR.type="backend";var tC=r(9368),tP=r(4954);class tI extends Error{}function tT(e,t){let r;if("string"!=typeof e)throw new tI("Invalid token specified: must be a string");t||(t={});let n=+(!0!==t.header),i=e.split(".")[n];if("string"!=typeof i)throw new tI(`Invalid token specified: missing part #${n+1}`);try{r=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 r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(i)}catch(e){throw new tI(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new tI(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(tI.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function tL(e){if(!(this instanceof tL))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,r,n=this,i=[],o={enable:!0,callbackList:[],interval:5},s=document.getElementsByTagName("script"),a=0;a<s.length;a++)(-1!==s[a].src.indexOf("keycloak.js")||-1!==s[a].src.indexOf("keycloak.min.js"))&&-1!==s[a].src.indexOf("version=")&&(n.iframeVersion=s[a].src.substring(s[a].src.indexOf("version=")+8).split("&")[0]);var l=!0,c=A(console.info),u=A(console.warn);function d(e,t){for(var r=function(e){var t=null,r=window.crypto||window.msCrypto;if(r&&r.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),r.getRandomValues(t),t;t=Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=Array(e),i=0;i<e;i++)n[i]=t.charCodeAt(r[i]%t.length);return String.fromCharCode.apply(null,n)}function p(){return void 0===n.authServerUrl?void 0:"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm)}function h(e,t){var r=e.code,i=e.error,o=e.prompt,s=new Date().getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),i){if("none"!=o)if(e.error_description&&"authentication_expired"===e.error_description)n.login(e.loginOptions);else{var a={error:i,error_description:e.error_description};n.onAuthError&&n.onAuthError(a),t&&t.setError(a)}else t&&t.setSuccess();return}if("standard"!=n.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&r){var u="code="+r+"&grant_type=authorization_code",d=n.endpoints.token(),p=new XMLHttpRequest;p.open("POST",d,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u+="&client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(u+="&code_verifier="+e.pkceCodeVerifier),p.withCredentials=!0,p.onreadystatechange=function(){if(4==p.readyState)if(200==p.status){var e=JSON.parse(p.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),S()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},p.send(u)}function h(r,i,o,a){g(r,i,o,s=(s+new Date().getTime())/2),l&&n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce?(c("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):a&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function f(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function g(e,t,r,i){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=tT(t)):(delete n.refreshToken,delete n.refreshTokenParsed),r?(n.idToken=r,n.idTokenParsed=tT(r)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=tT(e),n.sessionId=n.tokenParsed.sid,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,i&&(n.timeSkew=Math.floor(i/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(c("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var o=(n.tokenParsed.exp-new Date().getTime()/1e3+n.timeSkew)*1e3;c("[KEYCLOAK] Token expires in "+Math.round(o/1e3)+" s"),o<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,o)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.authenticated=!1}function y(){var e="0123456789abcdef",t=d(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 b(e){var t=function(e){switch(n.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,r,i,o=e.indexOf("?"),s=e.indexOf("#");if("query"===n.responseMode&&-1!==o?(r=e.substring(0,o),""!==(i=m(e.substring(o+1,-1!==s?s:e.length),t)).paramsString&&(r+="?"+i.paramsString),-1!==s&&(r+=e.substring(s))):"fragment"===n.responseMode&&-1!==s&&(r=e.substring(0,s),""!==(i=m(e.substring(s+1),t)).paramsString&&(r+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===n.flow||"hybrid"===n.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=r,i.oauthParams}else if("implicit"===n.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=r,i.oauthParams}}(e);if(t){var i=r.get(t.state);return i&&(t.valid=!0,t.redirectUri=i.redirectUri,t.storedNonce=i.nonce,t.prompt=i.prompt,t.pkceCodeVerifier=i.pkceCodeVerifier,t.loginOptions=i.loginOptions),t}}function m(e,t){for(var r=e.split("&"),n={paramsString:"",oauthParams:{}},i=0;i<r.length;i++){var o=r[i].indexOf("="),s=r[i].slice(0,o);-1!==t.indexOf(s)?n.oauthParams[s]=r[i].slice(o+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=r[i])}return n}function v(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,r){e.resolve=t,e.reject=r}),e}function _(){var e=v();if(!o.enable||o.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");o.iframe=t,t.onload=function(){var t=n.endpoints.authorize();"/"===t.charAt(0)?o.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):o.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var r=n.endpoints.checkSessionIframe();return t.setAttribute("src",r),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===o.iframeOrigin&&o.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&n.clearToken();for(var t=o.callbackList.splice(0,o.callbackList.length),r=t.length-1;r>=0;--r){var i=t[r];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function S(){o.enable&&n.token&&setTimeout(function(){w().then(function(e){e&&S()})},1e3*o.interval)}function w(){var e=v();if(o.iframe&&o.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");o.callbackList.push(e);var r=o.iframeOrigin;1==o.callbackList.length&&o.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function k(){var e,t,r,i=v();if(o.enable||n.silentCheckSsoRedirectUri){var s=document.createElement("iframe");s.setAttribute("src",n.endpoints.thirdPartyCookiesIframe()),s.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),s.setAttribute("title","keycloak-3p-check-iframe"),s.style.display="none",document.body.appendChild(s);var a=function(e){s.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(u("[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"),o.enable=!1,n.silentCheckSsoFallback&&(n.silentCheckSsoRedirectUri=!1)),document.body.removeChild(s),window.removeEventListener("message",a),i.setSuccess())};window.addEventListener("message",a,!1)}else i.setSuccess();return e=i.promise,t=n.messageReceiveTimeout,r=null,Promise.race([e,new Promise(function(e,n){r=setTimeout(function(){n({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(r)})}function E(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(n.createLoginUrl(e)),v().promise},logout:async function(e){if("GET"===(e?.logoutMethod??n.logoutMethod))return void window.location.replace(n.createLogoutUrl(e));let r=n.createLogoutUrl(e),i=await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:n.idToken,client_id:n.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(i.redirected){window.location.href=i.url;return}if(i.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(n.createRegisterUrl(e)),v().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return v().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){o.enable=!1;var r=function(e,t,r){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,r){return t[r]=e.cordovaOptions[r],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,r){return e.push(r+"="+t[r]),e},[]).join(",")},s=function(){return n.redirectUri||"http://localhost"};return{login:function(e){var t=v(),o=i(e),a=r(n.createLoginUrl(e),"_blank",o),l=!1,c=!1,u=function(){c=!0,a.close()};return a.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&(h(b(e.url),t),u(),l=!0)}),a.addEventListener("loaderror",function(e){l||(0==e.url.indexOf(s())?(h(b(e.url),t),u(),l=!0):(t.setError(),u()))}),a.addEventListener("exit",function(e){c||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=v(),o=r(n.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return o.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&o.close()}),o.addEventListener("loaderror",function(e){0==e.url.indexOf(s())||(t=!0),o.close()}),o.addEventListener("exit",function(e){t?i.setError():(n.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=v(),o=r(n.createRegisterUrl(),"_blank",i(e));return o.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&(o.close(),h(b(e.url),t))}),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e){var t=r(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return s()}}}if("cordova-native"==e)return o.enable=!1,{login:function(e){var t=v(),r=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(b(e.url),t)}),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=v(),r=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(r),t.promise},register:function(e){var t=v(),r=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(b(e.url),t)}),window.cordova.plugins.browsertab.openUrl(r),t.promise},accountManagement:function(){var e=n.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:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(i){if(n.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(n.didInitialize=!0,n.authenticated=!1,r=function(){try{return new O}catch(e){}return new x}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?E(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?E("cordova"):E(),i){if(void 0!==i.useNonce&&(l=i.useNonce),void 0!==i.checkLoginIframe&&(o.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(o.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(n.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)n.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=i.flow}if(null!=i.timeSkew&&(n.timeSkew=i.timeSkew),i.redirectUri&&(n.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?n.silentCheckSsoFallback=i.silentCheckSsoFallback:n.silentCheckSsoFallback=!0,void 0!==i.pkceMethod){if("S256"!==i.pkceMethod&&!1!==i.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${i.pkceMethod}.`);n.pkceMethod=i.pkceMethod}else n.pkceMethod="S256";"boolean"==typeof i.enableLogging?n.enableLogging=i.enableLogging:n.enableLogging=!1,"POST"===i.logoutMethod?n.logoutMethod="POST":n.logoutMethod="GET","string"==typeof i.scope&&(n.scope=i.scope),"string"==typeof i.acrValues&&(n.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?n.messageReceiveTimeout=i.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var s=v(),a=v();a.promise.then(function(){n.onReady&&n.onReady(n.authenticated),s.setSuccess(n.authenticated)}).catch(function(e){s.setError(e)});var c=function(){var t=v();function r(e){e?n.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}}:n.endpoints={authorize:function(){return p()+"/protocol/openid-connect/auth"},token:function(){return p()+"/protocol/openid-connect/token"},logout:function(){return p()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=p()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=p()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return p()+"/protocol/openid-connect/registrations"},userinfo:function(){return p()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(s=e):s="keycloak.json",s){var i=new XMLHttpRequest;i.open("GET",s,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status||f(i)){var e=JSON.parse(i.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,r(null),t.setSuccess()}else t.setError()},i.send()}else{if(!e.clientId)throw"clientId missing";n.clientId=e.clientId;var o=e.oidcProvider;if(o)if("string"==typeof o){var s,a="/"==o.charAt(o.length-1)?o+".well-known/openid-configuration":o+"/.well-known/openid-configuration",i=new XMLHttpRequest;i.open("GET",a,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){4==i.readyState&&(200==i.status||f(i)?(r(JSON.parse(i.responseText)),t.setSuccess()):t.setError())},i.send()}else r(o),t.setSuccess();else{if(!e.url){for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++)if(l[c].src.match(/.*keycloak\.js/)){e.url=l[c].src.substr(0,l[c].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,r(null),t.setSuccess()}}return t.promise}();function u(){var e=function(e){e||(r.prompt="none"),i&&i.locale&&(r.locale=i.locale),n.login(r).then(function(){a.setSuccess()}).catch(function(e){a.setError(e)})},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.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 r=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(h(b(t.data),a),document.body.removeChild(e),window.removeEventListener("message",r))};window.addEventListener("message",r)},r={};switch(i.onLoad){case"check-sso":o.enable?_().then(function(){w().then(function(r){r?a.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){a.setError(e)})}):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function d(){var e=b(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return _().then(function(){h(e,a)}).catch(function(e){a.setError(e)});i?i.token&&i.refreshToken?(g(i.token,i.refreshToken,i.idToken),o.enable?_().then(function(){w().then(function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess(),S()):a.setSuccess()}).catch(function(e){a.setError(e)})}):n.updateToken(-1).then(function(){n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess()}).catch(function(e){n.onAuthError&&n.onAuthError(),i.onLoad?u():a.setError(e)})):i.onLoad?u():a.setSuccess():a.setSuccess()}return c.then(function(){var e,t;(e=v(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(k).then(d).catch(function(e){s.setError(e)})}),c.catch(function(e){s.setError(e)}),s.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var i,o=y(),s=y(),a=t.redirectUri(e),c={state:o,nonce:s,redirectUri:encodeURIComponent(a),loginOptions:e};e&&e.prompt&&(c.prompt=e.prompt),i=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var u=e&&e.scope||n.scope;u?-1===u.indexOf("openid")&&(u="openid "+u):u="openid";var p=i+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(a)+"&state="+encodeURIComponent(o)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(u);if(l&&(p=p+"&nonce="+encodeURIComponent(s)),e&&e.prompt&&(p+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(p+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(p+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(p+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(p+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(p+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(p+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||n.acrValues)&&(p+="&acr_values="+encodeURIComponent(e.acrValues||n.acrValues)),n.pkceMethod){var h=d(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=h,p+="&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(tP.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(n.pkceMethod,h)+"&code_challenge_method="+n.pkceMethod}return r.add(c),p},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??n.logoutMethod))return n.endpoints.logout();var r=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(r+="&id_token_hint="+encodeURIComponent(n.idToken)),r},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var r=p(),i=void 0;return void 0!==r&&(i=r+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var r=n.resourceAccess[t||n.clientId];return!!r&&r.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=p()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),r.setSuccess(n.profile)):r.setError())},t.send(),r.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),r.setSuccess(n.userInfo)):r.setError())},t.send(),r.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return c("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=v();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,c("[KEYCLOAK] Refreshing token: forced refresh")):(!n.tokenParsed||n.isTokenExpired(e))&&(r=!0,c("[KEYCLOAK] Refreshing token: token expired")),r){var o="grant_type=refresh_token&refresh_token="+n.refreshToken,s=n.endpoints.token();if(i.push(t),1==i.length){var a=new XMLHttpRequest;a.open("POST",s,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.withCredentials=!0,o+="&client_id="+encodeURIComponent(n.clientId);var l=new Date().getTime();a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){c("[KEYCLOAK] Token refreshed"),l=(l+new Date().getTime())/2;var e=JSON.parse(a.responseText);g(e.access_token,e.refresh_token,e.id_token,l),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{u("[KEYCLOAK] Failed to refresh token"),400==a.status&&n.clearToken(),n.onAuthRefreshError&&n.onAuthRefreshError();for(var t=i.pop();null!=t;t=i.pop())t.setError(!0)}},a.send(o)}}else t.setSuccess(!1)};return o.enable?w().then(function(){r()}).catch(function(e){t.setError(e)}):r(),t.promise},n.clearToken=function(){n.token&&(g(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var O=function(){if(!(this instanceof O))return new O;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var r=localStorage.key(t);if(r&&0==r.indexOf("kc-callback-")){var n=localStorage.getItem(r);if(n)try{var i=JSON.parse(n).expires;(!i||i<e)&&localStorage.removeItem(r)}catch(e){localStorage.removeItem(r)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var r="kc-callback-"+t,n=localStorage.getItem(r);return n&&(localStorage.removeItem(r),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var r="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(r,JSON.stringify(t))}},x=function(){if(!(this instanceof x))return new x;this.get=function(n){if(n){var i=t("kc-callback-"+n);if(r("kc-callback-"+n,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){r("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){r(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+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},r=function(e,t,r){var n=e+"="+t+"; expires="+r.toUTCString()+"; ";document.cookie=n}};function A(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var tN=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let tj=e=>t=>(t=>class extends t{constructor(){super(...arguments),this._connectRequested=!1,this._statusCallback=e=>this._onEventProviderStatusChanged(e)}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.connectEvents()}disconnectedCallback(){this.disconnectEvents(),super.disconnectedCallback&&super.disconnectedCallback()}connectEvents(){e.getEventProvider()?this._connectRequested||(this._connectRequested=!0,e.getEventProvider().subscribeStatusChange(this._statusCallback),this._doConnect()):console.log("No event provider available so cannot subscribe")}disconnectEvents(){this._connectRequested&&(this._connectRequested=!1,e.getEventProvider().unsubscribeStatusChange(this._statusCallback),this._onEventsDisconnect())}_doConnect(){return tN(this,void 0,void 0,function*(){this.eventsConnected&&this._onEventsConnect()})}get eventsConnected(){return this._connectRequested&&e.getEventProvider().status===a.CONNECTED}_onEventProviderStatusChanged(e){switch(e){case a.DISCONNECTED:this._onEventsDisconnect();break;case a.CONNECTED:this._doConnect()}}_onEventsConnect(){this._addEventSubscriptions(),this.onEventsConnect()}_onEventsDisconnect(){this._removeEventSubscriptions(),this.onEventsDisconnect()}_addEventSubscriptions(){return tN(this,void 0,void 0,function*(){let t=!!this._attributeRefs,r=!!this._assetIds,n=this._attributeRefs?this._attributeRefs:this._assetIds;if(n&&n.length>0){if(this._subscriptionIds=[],r){let t=yield e.getEventProvider().subscribeAssetEvents(n,!0,e=>this._onEvent(e)),r=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!eb(n,r))return void e.getEventProvider().unsubscribe(t);this._subscriptionIds.push(t)}let i=yield e.getEventProvider().subscribeAttributeEvents(n,t,e=>this._onEvent(e)),o=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!eb(n,o))return void e.getEventProvider().unsubscribe(i);this._subscriptionIds.push(i)}})}_removeEventSubscriptions(){this._subscriptionIds&&(this._subscriptionIds.forEach(t=>{e.getEventProvider().unsubscribe(t)}),this._subscriptionIds=void 0)}_refreshEventSubscriptions(){this._removeEventSubscriptions(),this._addEventSubscriptions()}set assetIds(e){eb(this._assetIds,e)||(this._assetIds=e,this._refreshEventSubscriptions(),this.requestUpdate("assetIds"))}get assetIds(){return this._assetIds}set attributeRefs(e){eb(this._attributeRefs,e)||(this._attributeRefs=e,this._refreshEventSubscriptions())}get attributeRefs(){return this._attributeRefs}_sendEvent(t){e.getEventProvider().sendEvent(t)}_sendEventWithReply(t){return e.getEventProvider().sendEventWithReply(t)}onEventsConnect(){}onEventsDisconnect(){}_onEvent(e){}})(t),tD="#4d9d2a",tU="#FFFFFF",tM="#FFFFFF",tF="#F9F9F9",t$="#CCCCCC",tB="#be0000",tV="#FFFFFF",tK="#4c4c4c",tH="#000000",tW="#000000",tG="#FFFFFF",tq="0 5px 5px -5px rgba(0,0,0,0.3)",tz="0 1px 3px 0 rgba(0,0,0,0.21)";var tJ=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let tY="mdi",tX="openremote",tQ="restricted_user";(o=l||(l={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",o.AUTH_FAILED="AUTH_FAILED",o.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",o.CONSOLE_ERROR="CONSOLE_INIT_ERROR",o.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",o.TRANSLATION_ERROR="TRANSLATION_ERROR",(s=c||(c={})).ERROR="ERROR",s.READY="READY",s.ONLINE="ONLINE",s.OFFLINE="OFFLINE",s.CONNECTING="CONNECTING",s.CONSOLE_INIT="CONSOLE_INIT",s.CONSOLE_READY="CONSOLE_READY",s.TRANSLATE_INIT="TRANSLATE_INIT",s.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",s.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",s.LOGIN="LOGIN";let tZ={en:"english",cn:"chinese",cs:"czech",nl:"dutch",fr:"french",de:"german",it:"italian",pl:"polish",pt:"portuguese",ro:"romanian",es:"spanish",uk:"ukrainian"},t0={cn:"zh-cn"};function t1(e){e.services.formatter.add("uppercase",e=>"string"==typeof e?e.toUpperCase():String(e)),e.services.formatter.add("lll",(e,t)=>{var r;return en()(e).locale(null!=(r=t0[t])?r:t).format("lll")}),e.services.formatter.add("llll",(e,t,r)=>{var n;return en()(e).locale(null!=(n=t0[t])?n:t).format((null==r?void 0:r.weekday)==="long"?"LLLL":"llll")})}function t2(e){let t=e?Object.assign({},e):{};return t.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=tX),t}class t5{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,r])=>{let n=r.roles;e.set(t,n)}),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 ti()}get language(){return Z.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(Z.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(c.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||tX}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 tJ(this,void 0,void 0,function*(){try{return yield this.doInit(e)}catch(e){return console.error("Failed to initialise the manager",e),this._setError(l.MANAGER_FAILED_TO_LOAD),!1}})}doInit(e){return tJ(this,void 0,void 0,function*(){if(this._config&&console.debug("Already initialised"),this._config=t2(e),!(yield this.loadManagerInfo()))return!1;let t=!0,r=new tr(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(c.CONSOLE_READY)});if(this._console=r,"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,this._config.keycloakUrl=this._authServerUrl):this._authServerUrl.startsWith("http")?this._config.keycloakUrl=this._authServerUrl:((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(/\/+$/,""),t=yield this.doAuthInit()}return!!t&&(t&&(t=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(t=(yield this.doTranslateInit())&&t)&&(t=yield this.doDescriptorsInit(),t=yield this.getConsoleAppConfig()),this.doIconInit(),t?(t=yield this.doEventsSubscriptionInit(),this._ready=!0,this._emitEvent(c.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",t)})}loadManagerInfo(){return tJ(this,void 0,void 0,function*(){try{let e=yield ea(()=>this._requestManagerInfo());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(l.MANAGER_FAILED_TO_LOAD),!1}})}_requestManagerInfo(){return new Promise((e,t)=>{let r=new XMLHttpRequest;r.addEventListener("load",()=>{try{if(200!==r.status)throw Error("The manager info request failed with status "+r.status);e(JSON.parse(r.responseText))}catch(e){t(e)}}),r.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),r.open("GET",this._config.managerUrl+"/api/master/info"),r.send()})}doTranslateInit(){return tJ(this,void 0,void 0,function*(){if(Z.isInitialized)return!0;Z.on("initialized",e=>{this._emitEvent(c.TRANSLATE_INIT)}),Z.on("languageChanged",e=>{var t;en().locale(null!=(t=t0[e])?t:e),this._emitEvent(c.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,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 Z.use(tR).init(e),t1(Z)}catch(e){return console.error(e),this._setError(l.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return tJ(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield ti().api.AssetModelResource.getAssetInfos(),t=yield ti().api.AssetModelResource.getMetaItemDescriptors(),r=yield ti().api.AssetModelResource.getValueDescriptors();d.AssetModelUtil._assetTypeInfos=e.data,d.AssetModelUtil._metaItemDescriptors=Object.values(t.data),d.AssetModelUtil._valueDescriptors=Object.values(r.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return tJ(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(l.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(ti().addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return ti().setTimeout(2e4),ti().initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return tJ(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new td(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(l.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===a.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 a.DISCONNECTED:this._onDisconnect();break;case a.CONNECTED:break;case a.CONNECTING:this._emitEvent(c.CONNECTING)}}doConsoleInit(){return tJ(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(c.CONSOLE_INIT),!0}catch(e){return this._setError(l.CONSOLE_ERROR),!1}})}doIconInit(){this._config.loadIcons&&(tC.IconSets.addIconSet("mdi",(0,tC.createMdiIconSet)(t3.managerUrl)),tC.IconSets.addIconSet("or",(0,tC.createSvgIconSet)(tC.OrIconSet.size,tC.OrIconSet.icons)))}getConsoleAppConfig(){return tJ(this,void 0,void 0,function*(){var e;try{let t=yield fetch((null!=(e=t3.managerUrl)?e:"")+"/consoleappconfig/"+t3.displayRealm+".json");return this._consoleAppConfig=yield t.json(),!0}catch(e){return!0}})}getConsolePreferredLanguage(){return tJ(this,arguments,void 0,function*(e=this.console){return e.retrieveData("LANGUAGE")})}getUserPreferredLanguage(){return tJ(this,arguments,void 0,function*(e=this._keycloak){if(e&&e.authenticated){let t=e.profile;if(!t)try{t=yield e.loadUserProfile()}catch(e){console.warn("Could not get user language from keycloak: the user profile could not be loaded.");return}if(null==t?void 0:t.attributes){let e=new Map(Object.entries(t.attributes));if(e.has("locale")){let t=e.get("locale");if("string"==typeof t[0])return t[0]}console.warn("Could not get user language from keycloak: no user attributes were found.")}else console.warn("Could not get user language from keycloak: no valid keycloak user profile was found.")}})}updateKeycloakUserLanguage(e){return tJ(this,arguments,void 0,function*(e,t=this.rest){this.authenticated?t?yield t.api.UserResource.updateCurrentUserLocale(e,{headers:{"Content-Type":"application/json"}}):console.warn("Tried updating user language, but the REST API is not initialized yet."):console.warn("Tried updating user language, but the user is not authenticated.")})}logout(e){this._authenticated&&(this._authenticated=!0,this._keycloak&&(this.isMobile()&&this.console.storeData("REFRESH_TOKEN",null),this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._keycloak.logout(e&&""!==e?{redirectUri:e}:void 0)))}login(e){if("KEYCLOAK"===this._config.auth&&this._keycloak){let t={};e&&e.redirectUrl&&""!==e.redirectUrl&&(t.redirectUri=e.redirectUrl),(null==e?void 0:e.action)&&""!==e.action&&(t.action=e.action),this.isMobile()&&(t.scope="offline_access"),this._keycloak.login(t)}}isSuperUser(){return!!(this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole(tQ)}getApiBaseUrl(){let e=this._config.managerUrl;return e+("/api/"+this._config.realm+"/")}getAppName(){let e=location.pathname.split("/");return e.length>=1?e[1]:""}hasRealmRole(e){return this.isKeycloak()&&this._keycloak.hasRealmRole(e)}hasRole(e,t=this._config.clientId){let r=this.roles;return r&&r.has(t)&&r.get(t).indexOf(e)>=0}getAuthorizationHeader(){if(this.getKeycloakToken())return"Bearer "+this.getKeycloakToken()}retrieveAuthorizationHeader(){return tJ(this,void 0,void 0,function*(){let e=yield this.retrieveKeycloakToken();if(e)return"Bearer "+e})}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}retrieveKeycloakToken(){return tJ(this,void 0,void 0,function*(){if(this.isKeycloak())return yield this._updateKeycloakAccessToken(),this._keycloak.token})}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this._authenticated=!0}loadAndInitialiseKeycloak(){return tJ(this,void 0,void 0,function*(){var e,t,r,n,i;let o=new URLSearchParams(window.location.hash.substring(1)),s=o.has("state")&&o.has("code");try{this._keycloak=new tL({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl});let o=yield this._getNativeOfflineRefreshToken(),s=yield this._keycloak.init({checkLoginIframe:!1,onLoad:"check-sso"});if(!s&&o)try{console.error("SETTING OFFLINE TOKEN"),this._keycloak.refreshToken=o,s=yield this._updateKeycloakAccessToken()}catch(e){console.error("Failed to authenticate using offline token")}if(s){this._name=null==(e=this._keycloak.tokenParsed)?void 0:e.name,this._username=null==(t=this._keycloak.tokenParsed)?void 0:t.preferred_username,this.isMobile()&&(null==(n=null==(r=this._keycloak)?void 0:r.refreshTokenParsed)?void 0:n.typ)==="Offline"&&(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)),this._onAuthenticated(),this._createTokenUpdateInterval(),sessionStorage.removeItem(t5.LOGIN_RETRY_KEY);let o=null==(i=this._keycloak.tokenParsed)?void 0:i.session_state;o&&sessionStorage.getItem("or-session")!==o&&(sessionStorage.setItem("or-session",o),this._emitEvent(c.LOGIN))}else if(this.config.autoLogin)return this.login(),!1;return!0}catch(e){if(this._authenticated=!1,console.error("Failed to initialise Keycloak: "+e),s&&this._keycloak&&this._startNewLogin())return!1;return this._setError(l.AUTH_FAILED),!1}})}_startNewLogin(){return sessionStorage.getItem(t5.LOGIN_RETRY_KEY)?(sessionStorage.removeItem(t5.LOGIN_RETRY_KEY),!1):(console.warn("Keycloak rejected the returned login, starting a new one"),sessionStorage.setItem(t5.LOGIN_RETRY_KEY,"true"),this.login(),!0)}_createTokenUpdateInterval(){this._authenticated?this._keycloakUpdateTokenInterval||(this._keycloakUpdateTokenInterval=window.setInterval(()=>tJ(this,void 0,void 0,function*(){yield this._updateKeycloakAccessToken().catch(()=>{console.debug("Keycloak failed to refresh the access token"),this._onDisconnect()})}),1e4)):console.warn("User is not authenticated; skipping token update interval creation.")}_updateKeycloakAccessToken(){return tJ(this,void 0,void 0,function*(){let e=yield this._keycloak.updateToken(20);return console.debug("Access token update success, refreshed from server: "+e),e&&this._onAuthenticated(),e})}_getNativeOfflineRefreshToken(){return tJ(this,void 0,void 0,function*(){if(this.isMobile())return yield this.console.retrieveData("REFRESH_TOKEN")})}_emitEvent(e){window.setTimeout(()=>{for(let t of this._listeners)t(e)},0)}_setError(e){this._error=e,this._emitEvent(c.ERROR),console.warn("Error set: "+e)}_clearWebHistory(){var e;this.isMobile()&&(null==(e=this.console)||e._doSendGenericMessage("CLEAR_WEB_HISTORY",void 0))}_onDisconnect(){return tJ(this,void 0,void 0,function*(){this._disconnected||(console.debug("Disconnected"),this._disconnected=!0,this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._emitEvent(c.OFFLINE),this.reconnect())})}_onReconnected(){console.debug("Reconnected to the Manager."),this._disconnected=!1,this._createTokenUpdateInterval(),this._emitEvent(c.ONLINE)}reconnect(){return tJ(this,arguments,void 0,function*(e=3e3){if(console.debug("Checking connection to the Manager..."),!this._disconnected)return void console.debug("Manager is still connected. No action necessary.");console.debug("Manager is disconnected!"),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=void 0);let t=()=>tJ(this,void 0,void 0,function*(){var e,t;if(console.debug("Reconnecting to the Manager..."),!this._authenticated){console.debug("User is not authenticated, skipping token refresh");let t=()=>{var e;return(null==(e=this.events)?void 0:e.status)===a.CONNECTED};return t()||(yield null==(e=this.events)?void 0:e.connect()),t()}if(!(yield this.isKeycloakReachable()))return console.error("Keycloak is not reachable. Reconnect attempt failed."),!1;try{yield this._updateKeycloakAccessToken()}catch(t){console.error("Could not update Keycloak access token, attempting again using offline token...",t);let e=yield this._getNativeOfflineRefreshToken();this._keycloak.refreshToken=e,e||console.warn("No offline token was found on this device.");try{yield this._updateKeycloakAccessToken()}catch(e){throw this.login(),Error("Cannot update access token so sending to login")}console.debug("Keycloak access token is valid")}let r=()=>{var e;return(null==(e=this.events)?void 0:e.status)===a.CONNECTED};return r()||(console.debug("Event provider offline, attempting to reconnect using latest auth token."),yield null==(t=this.events)?void 0:t.connect()),r()}),r=yield t();if(void 0!==r){if(!r){e=Math.min(t5.MAX_RECONNECT_DELAY,e+3e3),console.error(`Failed to reconnect to the Manager. Attempting again in ${e}...`),this._reconnectTimer=window.setTimeout(()=>this.reconnect(e),e);return}this._onReconnected()}})}isKeycloakReachable(){return tJ(this,arguments,void 0,function*(e=2e3){let t=new AbortController,r=setTimeout(()=>t.abort(),e);try{let e=this._keycloak.endpoints.token(),r=yield fetch(e,{method:"OPTIONS",signal:t.signal});return 200===r.status}catch(e){return!1}finally{clearTimeout(r)}})}}t5.MAX_RECONNECT_DELAY=45e3,t5.LOGIN_RETRY_KEY="or-login-retry";let t3=new t5,t6=t3})(),ORCore=n})();
|