@leapdev/auth-agent 2.0.0-alpha.6 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +0,0 @@
1
- /*! For license information please see AuthAgent.umd.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AuthAgent=e():t.AuthAgent=e()}(self,(()=>(()=>{var __webpack_modules__={7111:(t,e,n)=>{var r=n(9859),i=n(6733),o=n(9821),a=r.TypeError;t.exports=function(t){if(i(t))return t;throw a(o(t)+" is not a function")}},7988:(t,e,n)=>{var r=n(9859),i=n(2359),o=n(9821),a=r.TypeError;t.exports=function(t){if(i(t))return t;throw a(o(t)+" is not a constructor")}},8505:(t,e,n)=>{var r=n(9859),i=n(6733),o=r.String,a=r.TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw a("Can't set "+o(t)+" as a prototype")}},9736:(t,e,n)=>{var r=n(95),i=n(7263),o=n(1787).f,a=r("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},6637:(t,e,n)=>{"use strict";var r=n(966).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},7728:(t,e,n)=>{var r=n(9859),i=n(1321),o=r.TypeError;t.exports=function(t,e){if(i(e,t))return t;throw o("Incorrect invocation")}},1176:(t,e,n)=>{var r=n(9859),i=n(5052),o=r.String,a=r.TypeError;t.exports=function(t){if(i(t))return t;throw a(o(t)+" is not an object")}},9540:(t,e,n)=>{var r=n(905),i=n(3231),o=n(9646),a=function(t){return function(e,n,a){var s,u=r(e),c=o(u),l=i(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},9794:(t,e,n)=>{var r=n(9859),i=n(3231),o=n(9646),a=n(2324),s=r.Array,u=Math.max;t.exports=function(t,e,n){for(var r=o(t),c=i(e,r),l=i(void 0===n?r:n,r),f=s(u(l-c,0)),p=0;c<l;c++,p++)a(f,p,t[c]);return f.length=p,f}},1909:(t,e,n)=>{var r=n(5968);t.exports=r([].slice)},3867:(t,e,n)=>{var r=n(9794),i=Math.floor,o=function(t,e){var n=t.length,u=i(n/2);return n<8?a(t,e):s(t,o(r(t,0,u),e),o(r(t,u),e),e)},a=function(t,e){for(var n,r,i=t.length,o=1;o<i;){for(r=o,n=t[o];r&&e(t[r-1],n)>0;)t[r]=t[--r];r!==o++&&(t[r]=n)}return t},s=function(t,e,n,r){for(var i=e.length,o=n.length,a=0,s=0;a<i||s<o;)t[a+s]=a<i&&s<o?r(e[a],n[s])<=0?e[a++]:n[s++]:a<i?e[a++]:n[s++];return t};t.exports=o},4575:(t,e,n)=>{var r=n(95)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(s){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},t(o)}catch(s){}return n}},7079:(t,e,n)=>{var r=n(5968),i=r({}.toString),o=r("".slice);t.exports=function(t){return o(i(t),8,-1)}},1589:(t,e,n)=>{var r=n(9859),i=n(1601),o=n(6733),a=n(7079),s=n(95)("toStringTag"),u=r.Object,c="Arguments"==a(function(){return arguments}());t.exports=i?a:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(n){}}(e=u(t),s))?n:c?a(e):"Object"==(r=a(e))&&o(e.callee)?"Arguments":r}},7081:(t,e,n)=>{var r=n(8270),i=n(4826),o=n(7933),a=n(1787);t.exports=function(t,e,n){for(var s=i(e),u=a.f,c=o.f,l=0;l<s.length;l++){var f=s[l];r(t,f)||n&&r(n,f)||u(t,f,c(e,f))}}},8127:(t,e,n)=>{var r=n(95)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(i){}}return!1}},7528:(t,e,n)=>{var r=n(4229);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3723:(t,e,n)=>{"use strict";var r=n(693).IteratorPrototype,i=n(7263),o=n(5358),a=n(4555),s=n(5495),u=function(){return this};t.exports=function(t,e,n,c){var l=e+" Iterator";return t.prototype=i(r,{next:o(+!c,n)}),a(t,l,!1,!0),s[l]=u,t}},5762:(t,e,n)=>{var r=n(7400),i=n(1787),o=n(5358);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},5358:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},2324:(t,e,n)=>{"use strict";var r=n(9310),i=n(1787),o=n(5358);t.exports=function(t,e,n){var a=r(e);a in t?i.f(t,a,o(0,n)):t[a]=n}},4768:(t,e,n)=>{var r=n(6733),i=n(5762),o=n(6039),a=n(8400);t.exports=function(t,e,n,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:e;return r(n)&&o(n,c,s),s.global?u?t[e]=n:a(e,n):(s.unsafe?t[e]&&(u=!0):delete t[e],u?t[e]=n:i(t,e,n)),t}},8312:(t,e,n)=>{var r=n(4768);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},8400:(t,e,n)=>{var r=n(9859),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7675:(t,e,n)=>{"use strict";var r=n(3103),i=n(266),o=n(4231),a=n(1805),s=n(6733),u=n(3723),c=n(7567),l=n(6540),f=n(4555),p=n(5762),h=n(4768),d=n(95),g=n(5495),v=n(693),y=a.PROPER,b=a.CONFIGURABLE,m=v.IteratorPrototype,_=v.BUGGY_SAFARI_ITERATORS,w=d("iterator"),S="keys",O="values",k="entries",P=function(){return this};t.exports=function(t,e,n,a,d,v,E){u(n,e,a);var T,A,x,C=function(t){if(t===d&&I)return I;if(!_&&t in j)return j[t];switch(t){case S:case O:case k:return function(){return new n(this,t)}}return function(){return new n(this)}},R=e+" Iterator",N=!1,j=t.prototype,U=j[w]||j["@@iterator"]||d&&j[d],I=!_&&U||C(d),M="Array"==e&&j.entries||U;if(M&&(T=c(M.call(new t)))!==Object.prototype&&T.next&&(o||c(T)===m||(l?l(T,m):s(T[w])||h(T,w,P)),f(T,R,!0,!0),o&&(g[R]=P)),y&&d==O&&U&&U.name!==O&&(!o&&b?p(j,"name",O):(N=!0,I=function(){return i(U,this)})),d)if(A={values:C(O),keys:v?I:C(S),entries:C(k)},E)for(x in A)(_||N||!(x in j))&&h(j,x,A[x]);else r({target:e,proto:!0,forced:_||N},A);return o&&!E||j[w]===I||h(j,w,I,{name:d}),g[e]=I,A}},7400:(t,e,n)=>{var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:(t,e,n)=>{var r=n(9859),i=n(5052),o=r.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},5694:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8865:(t,e,n)=>{var r=n(2635)("span").classList,i=r&&r.constructor&&r.constructor.prototype;t.exports=i===Object.prototype?void 0:i},8639:t=>{t.exports="object"==typeof window&&"object"!=typeof Deno},8983:(t,e,n)=>{var r=n(598),i=n(9859);t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},2023:(t,e,n)=>{var r=n(598);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},8801:(t,e,n)=>{var r=n(7079),i=n(9859);t.exports="process"==r(i.process)},263:(t,e,n)=>{var r=n(598);t.exports=/web0s(?!.*chrome)/i.test(r)},598:(t,e,n)=>{var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:(t,e,n)=>{var r,i,o=n(9859),a=n(598),s=o.process,u=o.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},3837:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:(t,e,n)=>{var r=n(9859),i=n(7933).f,o=n(5762),a=n(4768),s=n(8400),u=n(7081),c=n(6541);t.exports=function(t,e){var n,l,f,p,h,d=t.target,g=t.global,v=t.stat;if(n=g?r:v?r[d]||s(d,{}):(r[d]||{}).prototype)for(l in e){if(p=e[l],f=t.dontCallGetSet?(h=i(n,l))&&h.value:n[l],!c(g?l:d+(v?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(t.sham||f&&f.sham)&&o(p,"sham",!0),a(n,l,p,t)}}},4229:t=>{t.exports=function(t){try{return!!t()}catch(e){return!0}}},4954:(t,e,n)=>{"use strict";n(7950);var r=n(5968),i=n(4768),o=n(3466),a=n(4229),s=n(95),u=n(5762),c=s("species"),l=RegExp.prototype;t.exports=function(t,e,n,f){var p=s(t),h=!a((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),d=h&&!a((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!h||!d||n){var g=r(/./[p]),v=e(p,""[t],(function(t,e,n,i,a){var s=r(t),u=e.exec;return u===o||u===l.exec?h&&!a?{done:!0,value:g(e,n,i)}:{done:!0,value:s(n,e,i)}:{done:!1}}));i(String.prototype,t,v[0]),i(l,p,v[1])}f&&u(l[p],"sham",!0)}},3171:(t,e,n)=>{var r=n(7188),i=Function.prototype,o=i.apply,a=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},7636:(t,e,n)=>{var r=n(5968),i=n(7111),o=n(7188),a=r(r.bind);t.exports=function(t,e){return i(t),void 0===e?t:o?a(t,e):function(){return t.apply(e,arguments)}}},7188:(t,e,n)=>{var r=n(4229);t.exports=!r((function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:(t,e,n)=>{var r=n(7188),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},1805:(t,e,n)=>{var r=n(7400),i=n(8270),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),u=s&&"something"===(function(){}).name,c=s&&(!r||r&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},5968:(t,e,n)=>{var r=n(7188),i=Function.prototype,o=i.bind,a=i.call,s=r&&o.bind(a,a);t.exports=r?function(t){return t&&s(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},1333:(t,e,n)=>{var r=n(9859),i=n(6733),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},8830:(t,e,n)=>{var r=n(1589),i=n(5300),o=n(5495),a=n(95)("iterator");t.exports=function(t){if(null!=t)return i(t,a)||i(t,"@@iterator")||o[r(t)]}},8403:(t,e,n)=>{var r=n(9859),i=n(266),o=n(7111),a=n(1176),s=n(9821),u=n(8830),c=r.TypeError;t.exports=function(t,e){var n=arguments.length<2?u(t):e;if(o(n))return a(i(n,t));throw c(s(t)+" is not iterable")}},5300:(t,e,n)=>{var r=n(7111);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},17:(t,e,n)=>{var r=n(5968),i=n(2991),o=Math.floor,a=r("".charAt),s=r("".replace),u=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,f,p){var h=n+t.length,d=r.length,g=l;return void 0!==f&&(f=i(f),g=c),s(p,g,(function(i,s){var c;switch(a(s,0)){case"$":return"$";case"&":return t;case"`":return u(e,0,n);case"'":return u(e,h);case"<":c=f[u(s,1,-1)];break;default:var l=+s;if(0===l)return i;if(l>d){var p=o(l/10);return 0===p?i:p<=d?void 0===r[p-1]?a(s,1):r[p-1]+a(s,1):i}c=r[l-1]}return void 0===c?"":c}))}},9859:t=>{var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof global&&global)||function(){return this}()||Function("return this")()},8270:(t,e,n)=>{var r=n(5968),i=n(2991),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},5977:t=>{t.exports={}},4665:(t,e,n)=>{var r=n(9859);t.exports=function(t,e){var n=r.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},3777:(t,e,n)=>{var r=n(1333);t.exports=r("document","documentElement")},4394:(t,e,n)=>{var r=n(7400),i=n(4229),o=n(2635);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},9337:(t,e,n)=>{var r=n(9859),i=n(5968),o=n(4229),a=n(7079),s=r.Object,u=i("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?u(t,""):s(t)}:s},8511:(t,e,n)=>{var r=n(5968),i=n(6733),o=n(5353),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},6407:(t,e,n)=>{var r,i,o,a=n(8694),s=n(9859),u=n(5968),c=n(5052),l=n(5762),f=n(8270),p=n(5353),h=n(4399),d=n(5977),g="Object already initialized",v=s.TypeError,y=s.WeakMap;if(a||p.state){var b=p.state||(p.state=new y),m=u(b.get),_=u(b.has),w=u(b.set);r=function(t,e){if(_(b,t))throw new v(g);return e.facade=t,w(b,t,e),e},i=function(t){return m(b,t)||{}},o=function(t){return _(b,t)}}else{var S=h("state");d[S]=!0,r=function(t,e){if(f(t,S))throw new v(g);return e.facade=t,l(t,S,e),e},i=function(t){return f(t,S)?t[S]:{}},o=function(t){return f(t,S)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=i(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},1943:(t,e,n)=>{var r=n(95),i=n(5495),o=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[o]===t)}},6733:t=>{t.exports=function(t){return"function"==typeof t}},2359:(t,e,n)=>{var r=n(5968),i=n(4229),o=n(6733),a=n(1589),s=n(1333),u=n(8511),c=function(){},l=[],f=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=r(p.exec),d=!p.exec(c),g=function(t){if(!o(t))return!1;try{return f(c,l,t),!0}catch(e){return!1}},v=function(t){if(!o(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!h(p,u(t))}catch(e){return!0}};v.sham=!0,t.exports=!f||i((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?v:g},6541:(t,e,n)=>{var r=n(4229),i=n(6733),o=/#|\.prototype\./,a=function(t,e){var n=u[s(t)];return n==l||n!=c&&(i(e)?r(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},5052:(t,e,n)=>{var r=n(6733);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},4231:t=>{t.exports=!1},8311:(t,e,n)=>{var r=n(5052),i=n(7079),o=n(95)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},9395:(t,e,n)=>{var r=n(9859),i=n(1333),o=n(6733),a=n(1321),s=n(6969),u=r.Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return o(e)&&a(e.prototype,u(t))}},9003:(t,e,n)=>{var r=n(9859),i=n(7636),o=n(266),a=n(1176),s=n(9821),u=n(1943),c=n(9646),l=n(1321),f=n(8403),p=n(8830),h=n(7281),d=r.TypeError,g=function(t,e){this.stopped=t,this.result=e},v=g.prototype;t.exports=function(t,e,n){var r,y,b,m,_,w,S,O=n&&n.that,k=!(!n||!n.AS_ENTRIES),P=!(!n||!n.IS_ITERATOR),E=!(!n||!n.INTERRUPTED),T=i(e,O),A=function(t){return r&&h(r,"normal",t),new g(!0,t)},x=function(t){return k?(a(t),E?T(t[0],t[1],A):T(t[0],t[1])):E?T(t,A):T(t)};if(P)r=t;else{if(!(y=p(t)))throw d(s(t)+" is not iterable");if(u(y)){for(b=0,m=c(t);m>b;b++)if((_=x(t[b]))&&l(v,_))return _;return new g(!1)}r=f(t,y)}for(w=r.next;!(S=o(w,r)).done;){try{_=x(S.value)}catch(C){h(r,"throw",C)}if("object"==typeof _&&_&&l(v,_))return _}return new g(!1)}},7281:(t,e,n)=>{var r=n(266),i=n(1176),o=n(5300);t.exports=function(t,e,n){var a,s;i(t);try{if(!(a=o(t,"return"))){if("throw"===e)throw n;return n}a=r(a,t)}catch(u){s=!0,a=u}if("throw"===e)throw n;if(s)throw a;return i(a),n}},693:(t,e,n)=>{"use strict";var r,i,o,a=n(4229),s=n(6733),u=n(7263),c=n(7567),l=n(4768),f=n(95),p=n(4231),h=f("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(i=c(c(o)))!==Object.prototype&&(r=i):d=!0),null==r||a((function(){var t={};return r[h].call(t)!==t}))?r={}:p&&(r=u(r)),s(r[h])||l(r,h,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},5495:t=>{t.exports={}},9646:(t,e,n)=>{var r=n(4237);t.exports=function(t){return r(t.length)}},6039:(t,e,n)=>{var r=n(4229),i=n(6733),o=n(8270),a=n(7400),s=n(1805).CONFIGURABLE,u=n(8511),c=n(6407),l=c.enforce,f=c.get,p=Object.defineProperty,h=a&&!r((function(){return 8!==p((function(){}),"length",{value:8}).length})),d=String(String).split("String"),g=t.exports=function(t,e,n){if("Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||s&&t.name!==e)&&p(t,"name",{value:e,configurable:!0}),h&&n&&o(n,"arity")&&t.length!==n.arity&&p(t,"length",{value:n.arity}),n&&o(n,"constructor")&&n.constructor){if(a)try{p(t,"prototype",{writable:!1})}catch(i){}}else t.prototype=void 0;var r=l(t);return o(r,"source")||(r.source=d.join("string"==typeof e?e:"")),t};Function.prototype.toString=g((function(){return i(this)&&f(this).source||u(this)}),"toString")},917:t=>{var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},4794:(t,e,n)=>{var r,i,o,a,s,u,c,l,f=n(9859),p=n(7636),h=n(7933).f,d=n(5795).set,g=n(2023),v=n(8983),y=n(263),b=n(8801),m=f.MutationObserver||f.WebKitMutationObserver,_=f.document,w=f.process,S=f.Promise,O=h(f,"queueMicrotask"),k=O&&O.value;k||(r=function(){var t,e;for(b&&(t=w.domain)&&t.exit();i;){e=i.fn,i=i.next;try{e()}catch(n){throw i?a():o=void 0,n}}o=void 0,t&&t.enter()},g||b||y||!m||!_?!v&&S&&S.resolve?((c=S.resolve(void 0)).constructor=S,l=p(c.then,c),a=function(){l(r)}):b?a=function(){w.nextTick(r)}:(d=p(d,f),a=function(){d(r)}):(s=!0,u=_.createTextNode(""),new m(r).observe(u,{characterData:!0}),a=function(){u.data=s=!s})),t.exports=k||function(t){var e={fn:t,next:void 0};o&&(o.next=e),i||(i=e,a()),o=e}},3839:(t,e,n)=>{var r=n(6358),i=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},7274:(t,e,n)=>{var r=n(4229),i=n(95),o=n(4231),a=i("iterator");t.exports=!r((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n="";return t.pathname="c%20d",e.forEach((function(t,r){e.delete("b"),n+=r+t})),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},8694:(t,e,n)=>{var r=n(9859),i=n(6733),o=n(8511),a=r.WeakMap;t.exports=i(a)&&/native code/.test(o(a))},6485:(t,e,n)=>{"use strict";var r=n(7111),i=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new i(t)}},7272:(t,e,n)=>{var r=n(9859),i=n(8311),o=r.TypeError;t.exports=function(t){if(i(t))throw o("The method doesn't accept regular expressions");return t}},47:(t,e,n)=>{"use strict";var r=n(7400),i=n(5968),o=n(266),a=n(4229),s=n(5632),u=n(894),c=n(9195),l=n(2991),f=n(9337),p=Object.assign,h=Object.defineProperty,d=i([].concat);t.exports=!p||a((function(){if(r&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=p({},t)[n]||s(p({},e)).join("")!=i}))?function(t,e){for(var n=l(t),i=arguments.length,a=1,p=u.f,h=c.f;i>a;)for(var g,v=f(arguments[a++]),y=p?d(s(v),p(v)):s(v),b=y.length,m=0;b>m;)g=y[m++],r&&!o(h,v,g)||(n[g]=v[g]);return n}:p},7263:(t,e,n)=>{var r,i=n(1176),o=n(219),a=n(3837),s=n(5977),u=n(3777),c=n(2635),l=n(4399),f=l("IE_PROTO"),p=function(){},h=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},g=function(){try{r=new ActiveXObject("htmlfile")}catch(i){}var t,e;g="undefined"!=typeof document?document.domain&&r?d(r):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):d(r);for(var n=a.length;n--;)delete g.prototype[a[n]];return g()};s[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(p.prototype=i(t),n=new p,p.prototype=null,n[f]=t):n=g(),void 0===e?n:o.f(n,e)}},219:(t,e,n)=>{var r=n(7400),i=n(7137),o=n(1787),a=n(1176),s=n(905),u=n(5632);e.f=r&&!i?Object.defineProperties:function(t,e){a(t);for(var n,r=s(e),i=u(e),c=i.length,l=0;c>l;)o.f(t,n=i[l++],r[n]);return t}},1787:(t,e,n)=>{var r=n(9859),i=n(7400),o=n(4394),a=n(7137),s=n(1176),u=n(9310),c=r.TypeError,l=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p="enumerable",h="configurable",d="writable";e.f=i?a?function(t,e,n){if(s(t),e=u(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&d in n&&!n.writable){var r=f(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:p in n?n.enumerable:r.enumerable,writable:!1})}return l(t,e,n)}:l:function(t,e,n){if(s(t),e=u(e),s(n),o)try{return l(t,e,n)}catch(r){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:(t,e,n)=>{var r=n(7400),i=n(266),o=n(9195),a=n(5358),s=n(905),u=n(9310),c=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=s(t),e=u(e),l)try{return f(t,e)}catch(n){}if(c(t,e))return a(!i(o.f,t,e),t[e])}},8151:(t,e,n)=>{var r=n(140),i=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},894:(t,e)=>{e.f=Object.getOwnPropertySymbols},7567:(t,e,n)=>{var r=n(9859),i=n(8270),o=n(6733),a=n(2991),s=n(4399),u=n(7528),c=s("IE_PROTO"),l=r.Object,f=l.prototype;t.exports=u?l.getPrototypeOf:function(t){var e=a(t);if(i(e,c))return e[c];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof l?f:null}},1321:(t,e,n)=>{var r=n(5968);t.exports=r({}.isPrototypeOf)},140:(t,e,n)=>{var r=n(5968),i=n(8270),o=n(905),a=n(9540).indexOf,s=n(5977),u=r([].push);t.exports=function(t,e){var n,r=o(t),c=0,l=[];for(n in r)!i(s,n)&&i(r,n)&&u(l,n);for(;e.length>c;)i(r,n=e[c++])&&(~a(l,n)||u(l,n));return l}},5632:(t,e,n)=>{var r=n(140),i=n(3837);t.exports=Object.keys||function(t){return r(t,i)}},9195:(t,e)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);e.f=i?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},6540:(t,e,n)=>{var r=n(5968),i=n(1176),o=n(8505);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(a){}return function(n,r){return i(n),o(r),e?t(n,r):n.__proto__=r,n}}():void 0)},2914:(t,e,n)=>{var r=n(9859),i=n(266),o=n(6733),a=n(5052),s=r.TypeError;t.exports=function(t,e){var n,r;if("string"===e&&o(n=t.toString)&&!a(r=i(n,t)))return r;if(o(n=t.valueOf)&&!a(r=i(n,t)))return r;if("string"!==e&&o(n=t.toString)&&!a(r=i(n,t)))return r;throw s("Can't convert object to primitive value")}},4826:(t,e,n)=>{var r=n(1333),i=n(5968),o=n(8151),a=n(894),s=n(1176),u=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(s(t)),n=a.f;return n?u(e,n(t)):e}},4624:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},8321:(t,e,n)=>{var r=n(9859),i=n(4473),o=n(6733),a=n(6541),s=n(8511),u=n(95),c=n(8639),l=n(4231),f=n(6358),p=i&&i.prototype,h=u("species"),d=!1,g=o(r.PromiseRejectionEvent),v=a("Promise",(function(){var t=s(i),e=t!==String(i);if(!e&&66===f)return!0;if(l&&(!p.catch||!p.finally))return!0;if(f>=51&&/native code/.test(t))return!1;var n=new i((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};return(n.constructor={})[h]=r,!(d=n.then((function(){}))instanceof r)||!e&&c&&!g}));t.exports={CONSTRUCTOR:v,REJECTION_EVENT:g,SUBCLASSING:d}},4473:(t,e,n)=>{var r=n(9859);t.exports=r.Promise},2391:(t,e,n)=>{var r=n(1176),i=n(5052),o=n(6485);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},6866:(t,e,n)=>{var r=n(4473),i=n(4575),o=n(8321).CONSTRUCTOR;t.exports=o||!i((function(t){r.all(t).then(void 0,(function(){}))}))},3358:t=>{var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=e},8115:(t,e,n)=>{var r=n(9859),i=n(266),o=n(1176),a=n(6733),s=n(7079),u=n(3466),c=r.TypeError;t.exports=function(t,e){var n=t.exec;if(a(n)){var r=i(n,t,e);return null!==r&&o(r),r}if("RegExp"===s(t))return i(u,t,e);throw c("RegExp#exec called on incompatible receiver")}},3466:(t,e,n)=>{"use strict";var r,i,o=n(266),a=n(5968),s=n(3326),u=n(895),c=n(5650),l=n(3036),f=n(7263),p=n(6407).get,h=n(2926),d=n(461),g=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,y=v,b=a("".charAt),m=a("".indexOf),_=a("".replace),w=a("".slice),S=(i=/b*/g,o(v,r=/a/,"a"),o(v,i,"a"),0!==r.lastIndex||0!==i.lastIndex),O=c.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(S||k||O||h||d)&&(y=function(t){var e,n,r,i,a,c,l,h=this,d=p(h),P=s(t),E=d.raw;if(E)return E.lastIndex=h.lastIndex,e=o(y,E,P),h.lastIndex=E.lastIndex,e;var T=d.groups,A=O&&h.sticky,x=o(u,h),C=h.source,R=0,N=P;if(A&&(x=_(x,"y",""),-1===m(x,"g")&&(x+="g"),N=w(P,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==b(P,h.lastIndex-1))&&(C="(?: "+C+")",N=" "+N,R++),n=new RegExp("^(?:"+C+")",x)),k&&(n=new RegExp("^"+C+"$(?!\\s)",x)),S&&(r=h.lastIndex),i=o(v,A?n:h,N),A?i?(i.input=w(i.input,R),i[0]=w(i[0],R),i.index=h.lastIndex,h.lastIndex+=i[0].length):h.lastIndex=0:S&&i&&(h.lastIndex=h.global?i.index+i[0].length:r),k&&i&&i.length>1&&o(g,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&T)for(i.groups=c=f(null),a=0;a<T.length;a++)c[(l=T[a])[0]]=i[l[1]];return i}),t.exports=y},895:(t,e,n)=>{"use strict";var r=n(1176);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},3349:(t,e,n)=>{var r=n(266),i=n(8270),o=n(1321),a=n(895),s=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in s||i(t,"flags")||!o(s,t)?e:r(a,t)}},5650:(t,e,n)=>{var r=n(4229),i=n(9859).RegExp,o=r((function(){var t=i("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),a=o||r((function(){return!i("a","y").sticky})),s=o||r((function(){var t=i("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},2926:(t,e,n)=>{var r=n(4229),i=n(9859).RegExp;t.exports=r((function(){var t=i(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},461:(t,e,n)=>{var r=n(4229),i=n(9859).RegExp;t.exports=r((function(){var t=i("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},8885:(t,e,n)=>{var r=n(9859).TypeError;t.exports=function(t){if(null==t)throw r("Can't call method on "+t);return t}},2101:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},1832:(t,e,n)=>{"use strict";var r=n(1333),i=n(1787),o=n(95),a=n(7400),s=o("species");t.exports=function(t){var e=r(t),n=i.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},4555:(t,e,n)=>{var r=n(1787).f,i=n(8270),o=n(95)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!i(t,o)&&r(t,o,{configurable:!0,value:e})}},4399:(t,e,n)=>{var r=n(3036),i=n(1441),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},5353:(t,e,n)=>{var r=n(9859),i=n(8400),o="__core-js_shared__",a=r[o]||i(o,{});t.exports=a},3036:(t,e,n)=>{var r=n(4231),i=n(5353);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.6",mode:r?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.6/LICENSE",source:"https://github.com/zloirock/core-js"})},7942:(t,e,n)=>{var r=n(1176),i=n(7988),o=n(95)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},966:(t,e,n)=>{var r=n(5968),i=n(3329),o=n(3326),a=n(8885),s=r("".charAt),u=r("".charCodeAt),c=r("".slice),l=function(t){return function(e,n){var r,l,f=o(a(e)),p=i(n),h=f.length;return p<0||p>=h?t?"":void 0:(r=u(f,p))<55296||r>56319||p+1===h||(l=u(f,p+1))<56320||l>57343?t?s(f,p):r:t?c(f,p,p+2):l-56320+(r-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},5795:(t,e,n)=>{var r,i,o,a,s=n(9859),u=n(3171),c=n(7636),l=n(6733),f=n(8270),p=n(4229),h=n(3777),d=n(1909),g=n(2635),v=n(7579),y=n(2023),b=n(8801),m=s.setImmediate,_=s.clearImmediate,w=s.process,S=s.Dispatch,O=s.Function,k=s.MessageChannel,P=s.String,E=0,T={},A="onreadystatechange";try{r=s.location}catch(j){}var x=function(t){if(f(T,t)){var e=T[t];delete T[t],e()}},C=function(t){return function(){x(t)}},R=function(t){x(t.data)},N=function(t){s.postMessage(P(t),r.protocol+"//"+r.host)};m&&_||(m=function(t){v(arguments.length,1);var e=l(t)?t:O(t),n=d(arguments,1);return T[++E]=function(){u(e,void 0,n)},i(E),E},_=function(t){delete T[t]},b?i=function(t){w.nextTick(C(t))}:S&&S.now?i=function(t){S.now(C(t))}:k&&!y?(a=(o=new k).port2,o.port1.onmessage=R,i=c(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!p(N)?(i=N,s.addEventListener("message",R,!1)):i=A in g("script")?function(t){h.appendChild(g("script")).onreadystatechange=function(){h.removeChild(this),x(t)}}:function(t){setTimeout(C(t),0)}),t.exports={set:m,clear:_}},3231:(t,e,n)=>{var r=n(3329),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},905:(t,e,n)=>{var r=n(9337),i=n(8885);t.exports=function(t){return r(i(t))}},3329:(t,e,n)=>{var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:(t,e,n)=>{var r=n(3329),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},2991:(t,e,n)=>{var r=n(9859),i=n(8885),o=r.Object;t.exports=function(t){return o(i(t))}},2066:(t,e,n)=>{var r=n(9859),i=n(266),o=n(5052),a=n(9395),s=n(5300),u=n(2914),c=n(95),l=r.TypeError,f=c("toPrimitive");t.exports=function(t,e){if(!o(t)||a(t))return t;var n,r=s(t,f);if(r){if(void 0===e&&(e="default"),n=i(r,t,e),!o(n)||a(n))return n;throw l("Can't convert object to primitive value")}return void 0===e&&(e="number"),u(t,e)}},9310:(t,e,n)=>{var r=n(2066),i=n(9395);t.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},1601:(t,e,n)=>{var r={};r[n(95)("toStringTag")]="z",t.exports="[object z]"===String(r)},3326:(t,e,n)=>{var r=n(9859),i=n(1589),o=r.String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},9821:(t,e,n)=>{var r=n(9859).String;t.exports=function(t){try{return r(t)}catch(e){return"Object"}}},1441:(t,e,n)=>{var r=n(5968),i=0,o=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+o,36)}},6969:(t,e,n)=>{var r=n(3839);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:(t,e,n)=>{var r=n(7400),i=n(4229);t.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},7579:(t,e,n)=>{var r=n(9859).TypeError;t.exports=function(t,e){if(t<e)throw r("Not enough arguments");return t}},95:(t,e,n)=>{var r=n(9859),i=n(3036),o=n(8270),a=n(1441),s=n(3839),u=n(6969),c=i("wks"),l=r.Symbol,f=l&&l.for,p=u?l:l&&l.withoutSetter||a;t.exports=function(t){if(!o(c,t)||!s&&"string"!=typeof c[t]){var e="Symbol."+t;s&&o(l,t)?c[t]=l[t]:c[t]=u&&f?f(e):p(e)}return c[t]}},5735:(t,e,n)=>{"use strict";var r=n(905),i=n(9736),o=n(5495),a=n(6407),s=n(1787).f,u=n(7675),c=n(4231),l=n(7400),f="Array Iterator",p=a.set,h=a.getterFor(f);t.exports=u(Array,"Array",(function(t,e){p(this,{type:f,target:r(t),index:0,kind:e})}),(function(){var t=h(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var d=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!c&&l&&"values"!==d.name)try{s(d,"name",{value:"values"})}catch(g){}},3105:(t,e,n)=>{var r=n(3103),i=n(47);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},6032:(t,e,n)=>{"use strict";var r=n(3103),i=n(266),o=n(7111),a=n(6485),s=n(4624),u=n(9003);r({target:"Promise",stat:!0,forced:n(6866)},{all:function(t){var e=this,n=a.f(e),r=n.resolve,c=n.reject,l=s((function(){var n=o(e.resolve),a=[],s=0,l=1;u(t,(function(t){var o=s++,u=!1;l++,i(n,e,t).then((function(t){u||(u=!0,a[o]=t,--l||r(a))}),c)})),--l||r(a)}));return l.error&&c(l.value),n.promise}})},6135:(t,e,n)=>{"use strict";var r=n(3103),i=n(4231),o=n(8321).CONSTRUCTOR,a=n(4473),s=n(1333),u=n(6733),c=n(4768),l=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(t){return this.then(void 0,t)}}),!i&&u(a)){var f=s("Promise").prototype.catch;l.catch!==f&&c(l,"catch",f,{unsafe:!0})}},6087:(t,e,n)=>{"use strict";var r,i,o,a=n(3103),s=n(4231),u=n(8801),c=n(9859),l=n(266),f=n(4768),p=n(6540),h=n(4555),d=n(1832),g=n(7111),v=n(6733),y=n(5052),b=n(7728),m=n(7942),_=n(5795).set,w=n(4794),S=n(4665),O=n(4624),k=n(3358),P=n(6407),E=n(4473),T=n(8321),A=n(6485),x="Promise",C=T.CONSTRUCTOR,R=T.REJECTION_EVENT,N=T.SUBCLASSING,j=P.getterFor(x),U=P.set,I=E&&E.prototype,M=E,H=I,L=c.TypeError,D=c.document,F=c.process,G=A.f,B=G,K=!!(D&&D.createEvent&&c.dispatchEvent),q="unhandledrejection",z=function(t){var e;return!(!y(t)||!v(e=t.then))&&e},W=function(t,e){var n,r,i,o=e.value,a=1==e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,f=t.domain;try{s?(a||(2===e.rejection&&Y(e),e.rejection=1),!0===s?n=o:(f&&f.enter(),n=s(o),f&&(f.exit(),i=!0)),n===t.promise?c(L("Promise-chain cycle")):(r=z(n))?l(r,n,u,c):u(n)):c(o)}catch(p){f&&!i&&f.exit(),c(p)}},$=function(t,e){t.notified||(t.notified=!0,w((function(){for(var n,r=t.reactions;n=r.get();)W(n,t);t.notified=!1,e&&!t.rejection&&V(t)})))},X=function(t,e,n){var r,i;K?((r=D.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},!R&&(i=c["on"+t])?i(r):t===q&&S("Unhandled promise rejection",n)},V=function(t){l(_,c,(function(){var e,n=t.facade,r=t.value;if(J(t)&&(e=O((function(){u?F.emit("unhandledRejection",r,n):X(q,n,r)})),t.rejection=u||J(t)?2:1,e.error))throw e.value}))},J=function(t){return 1!==t.rejection&&!t.parent},Y=function(t){l(_,c,(function(){var e=t.facade;u?F.emit("rejectionHandled",e):X("rejectionhandled",e,t.value)}))},Q=function(t,e,n){return function(r){t(e,r,n)}},Z=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,$(t,!0))},tt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw L("Promise can't be resolved itself");var r=z(e);r?w((function(){var n={done:!1};try{l(r,e,Q(tt,n,t),Q(Z,n,t))}catch(i){Z(n,i,t)}})):(t.value=e,t.state=1,$(t,!1))}catch(i){Z({done:!1},i,t)}}};if(C&&(H=(M=function(t){b(this,H),g(t),l(r,this);var e=j(this);try{t(Q(tt,e),Q(Z,e))}catch(n){Z(e,n)}}).prototype,(r=function(t){U(this,{type:x,done:!1,notified:!1,parent:!1,reactions:new k,rejection:!1,state:0,value:void 0})}).prototype=f(H,"then",(function(t,e){var n=j(this),r=G(m(this,M));return n.parent=!0,r.ok=!v(t)||t,r.fail=v(e)&&e,r.domain=u?F.domain:void 0,0==n.state?n.reactions.add(r):w((function(){W(r,n)})),r.promise})),i=function(){var t=new r,e=j(t);this.promise=t,this.resolve=Q(tt,e),this.reject=Q(Z,e)},A.f=G=function(t){return t===M||undefined===t?new i(t):B(t)},!s&&v(E)&&I!==Object.prototype)){o=I.then,N||f(I,"then",(function(t,e){var n=this;return new M((function(t,e){l(o,n,t,e)})).then(t,e)}),{unsafe:!0});try{delete I.constructor}catch(et){}p&&p(I,H)}a({global:!0,constructor:!0,wrap:!0,forced:C},{Promise:M}),h(M,x,!1,!0),d(x)},3439:(t,e,n)=>{n(6087),n(6032),n(6135),n(6767),n(9320),n(2047)},6767:(t,e,n)=>{"use strict";var r=n(3103),i=n(266),o=n(7111),a=n(6485),s=n(4624),u=n(9003);r({target:"Promise",stat:!0,forced:n(6866)},{race:function(t){var e=this,n=a.f(e),r=n.reject,c=s((function(){var a=o(e.resolve);u(t,(function(t){i(a,e,t).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},9320:(t,e,n)=>{"use strict";var r=n(3103),i=n(266),o=n(6485);r({target:"Promise",stat:!0,forced:n(8321).CONSTRUCTOR},{reject:function(t){var e=o.f(this);return i(e.reject,void 0,t),e.promise}})},2047:(t,e,n)=>{"use strict";var r=n(3103),i=n(1333),o=n(4231),a=n(4473),s=n(8321).CONSTRUCTOR,u=n(2391),c=i("Promise"),l=o&&!s;r({target:"Promise",stat:!0,forced:o||s},{resolve:function(t){return u(l&&this===c?a:this,t)}})},7950:(t,e,n)=>{"use strict";var r=n(3103),i=n(3466);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},8233:(t,e,n)=>{"use strict";var r=n(1805).PROPER,i=n(4768),o=n(1176),a=n(3326),s=n(4229),u=n(3349),c="toString",l=RegExp.prototype.toString,f=s((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),p=r&&l.name!=c;(f||p)&&i(RegExp.prototype,c,(function(){var t=o(this);return"/"+a(t.source)+"/"+a(u(t))}),{unsafe:!0})},6708:(t,e,n)=>{"use strict";var r,i=n(3103),o=n(5968),a=n(7933).f,s=n(4237),u=n(3326),c=n(7272),l=n(8885),f=n(8127),p=n(4231),h=o("".endsWith),d=o("".slice),g=Math.min,v=f("endsWith");i({target:"String",proto:!0,forced:!!(p||v||(r=a(String.prototype,"endsWith"),!r||r.writable))&&!v},{endsWith:function(t){var e=u(l(this));c(t);var n=arguments.length>1?arguments[1]:void 0,r=e.length,i=void 0===n?r:g(s(n),r),o=u(t);return h?h(e,o,i):d(e,i-o.length,i)===o}})},5940:(t,e,n)=>{"use strict";var r=n(3171),i=n(266),o=n(5968),a=n(4954),s=n(4229),u=n(1176),c=n(6733),l=n(3329),f=n(4237),p=n(3326),h=n(8885),d=n(6637),g=n(5300),v=n(17),y=n(8115),b=n(95)("replace"),m=Math.max,_=Math.min,w=o([].concat),S=o([].push),O=o("".indexOf),k=o("".slice),P="$0"==="a".replace(/./,"$0"),E=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(t,e,n){var o=E?"$":"$0";return[function(t,n){var r=h(this),o=null==t?void 0:g(t,b);return o?i(o,t,r,n):i(e,p(r),t,n)},function(t,i){var a=u(this),s=p(t);if("string"==typeof i&&-1===O(i,o)&&-1===O(i,"$<")){var h=n(e,a,s,i);if(h.done)return h.value}var g=c(i);g||(i=p(i));var b=a.global;if(b){var P=a.unicode;a.lastIndex=0}for(var E=[];;){var T=y(a,s);if(null===T)break;if(S(E,T),!b)break;""===p(T[0])&&(a.lastIndex=d(s,f(a.lastIndex),P))}for(var A,x="",C=0,R=0;R<E.length;R++){for(var N=p((T=E[R])[0]),j=m(_(l(T.index),s.length),0),U=[],I=1;I<T.length;I++)S(U,void 0===(A=T[I])?A:String(A));var M=T.groups;if(g){var H=w([N],U,j,s);void 0!==M&&S(H,M);var L=p(r(i,void 0,H))}else L=v(N,s,j,U,M,i);j>=C&&(x+=k(s,C,j)+L,C=j+N.length)}return x+k(s,C)}]}),!!s((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!P||E)},4908:(t,e,n)=>{"use strict";var r=n(266),i=n(4954),o=n(1176),a=n(8885),s=n(2101),u=n(3326),c=n(5300),l=n(8115);i("search",(function(t,e,n){return[function(e){var n=a(this),i=null==e?void 0:c(e,t);return i?r(i,e,n):new RegExp(e)[t](u(n))},function(t){var r=o(this),i=u(t),a=n(e,r,i);if(a.done)return a.value;var c=r.lastIndex;s(c,0)||(r.lastIndex=0);var f=l(r,i);return s(r.lastIndex,c)||(r.lastIndex=c),null===f?-1:f.index}]}))},8319:(t,e,n)=>{"use strict";var r=n(3171),i=n(266),o=n(5968),a=n(4954),s=n(8311),u=n(1176),c=n(8885),l=n(7942),f=n(6637),p=n(4237),h=n(3326),d=n(5300),g=n(9794),v=n(8115),y=n(3466),b=n(5650),m=n(4229),_=b.UNSUPPORTED_Y,w=4294967295,S=Math.min,O=[].push,k=o(/./.exec),P=o(O),E=o("".slice);a("split",(function(t,e,n){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var o=h(c(this)),a=void 0===n?w:n>>>0;if(0===a)return[];if(void 0===t)return[o];if(!s(t))return i(e,o,t,a);for(var u,l,f,p=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,b=new RegExp(t.source,d+"g");(u=i(y,b,o))&&!((l=b.lastIndex)>v&&(P(p,E(o,v,u.index)),u.length>1&&u.index<o.length&&r(O,p,g(u,1)),f=u[0].length,v=l,p.length>=a));)b.lastIndex===u.index&&b.lastIndex++;return v===o.length?!f&&k(b,"")||P(p,""):P(p,E(o,v)),p.length>a?g(p,0,a):p}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:i(e,this,t,n)}:e,[function(e,n){var r=c(this),a=null==e?void 0:d(e,t);return a?i(a,e,r,n):i(o,h(r),e,n)},function(t,r){var i=u(this),a=h(t),s=n(o,i,a,r,o!==e);if(s.done)return s.value;var c=l(i,RegExp),d=i.unicode,g=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(_?"g":"y"),y=new c(_?"^(?:"+i.source+")":i,g),b=void 0===r?w:r>>>0;if(0===b)return[];if(0===a.length)return null===v(y,a)?[a]:[];for(var m=0,O=0,k=[];O<a.length;){y.lastIndex=_?0:O;var T,A=v(y,_?E(a,O):a);if(null===A||(T=S(p(y.lastIndex+(_?O:0)),a.length))===m)O=f(a,O,d);else{if(P(k,E(a,m,O)),k.length===b)return k;for(var x=1;x<=A.length-1;x++)if(P(k,A[x]),k.length===b)return k;O=m=T}}return P(k,E(a,m)),k}]}),!!m((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),_)},4112:(t,e,n)=>{"use strict";var r,i=n(3103),o=n(5968),a=n(7933).f,s=n(4237),u=n(3326),c=n(7272),l=n(8885),f=n(8127),p=n(4231),h=o("".startsWith),d=o("".slice),g=Math.min,v=f("startsWith");i({target:"String",proto:!0,forced:!!(p||v||(r=a(String.prototype,"startsWith"),!r||r.writable))&&!v},{startsWith:function(t){var e=u(l(this));c(t);var n=s(g(arguments.length>1?arguments[1]:void 0,e.length)),r=u(t);return h?h(e,r,n):d(e,n,n+r.length)===r}})},6886:(t,e,n)=>{var r=n(9859),i=n(5694),o=n(8865),a=n(5735),s=n(5762),u=n(95),c=u("iterator"),l=u("toStringTag"),f=a.values,p=function(t,e){if(t){if(t[c]!==f)try{s(t,c,f)}catch(r){t[c]=f}if(t[l]||s(t,l,e),i[e])for(var n in a)if(t[n]!==a[n])try{s(t,n,a[n])}catch(r){t[n]=a[n]}}};for(var h in i)p(r[h]&&r[h].prototype,h);p(o,"DOMTokenList")},2653:(t,e,n)=>{"use strict";n(5735);var r=n(3103),i=n(9859),o=n(266),a=n(5968),s=n(7400),u=n(7274),c=n(4768),l=n(8312),f=n(4555),p=n(3723),h=n(6407),d=n(7728),g=n(6733),v=n(8270),y=n(7636),b=n(1589),m=n(1176),_=n(5052),w=n(3326),S=n(7263),O=n(5358),k=n(8403),P=n(8830),E=n(7579),T=n(95),A=n(3867),x=T("iterator"),C="URLSearchParams",R="URLSearchParamsIterator",N=h.set,j=h.getterFor(C),U=h.getterFor(R),I=Object.getOwnPropertyDescriptor,M=function(t){if(!s)return i[t];var e=I(i,t);return e&&e.value},H=M("fetch"),L=M("Request"),D=M("Headers"),F=L&&L.prototype,G=D&&D.prototype,B=i.RegExp,K=i.TypeError,q=i.decodeURIComponent,z=i.encodeURIComponent,W=a("".charAt),$=a([].join),X=a([].push),V=a("".replace),J=a([].shift),Y=a([].splice),Q=a("".split),Z=a("".slice),tt=/\+/g,et=Array(4),nt=function(t){return et[t-1]||(et[t-1]=B("((?:%[\\da-f]{2}){"+t+"})","gi"))},rt=function(t){try{return q(t)}catch(e){return t}},it=function(t){var e=V(t,tt," "),n=4;try{return q(e)}catch(r){for(;n;)e=V(e,nt(n--),rt);return e}},ot=/[!'()~]|%20/g,at={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},st=function(t){return at[t]},ut=function(t){return V(z(t),ot,st)},ct=p((function(t,e){N(this,{type:R,iterator:k(j(t).entries),kind:e})}),"Iterator",(function(){var t=U(this),e=t.kind,n=t.iterator.next(),r=n.value;return n.done||(n.value="keys"===e?r.key:"values"===e?r.value:[r.key,r.value]),n}),!0),lt=function(t){this.entries=[],this.url=null,void 0!==t&&(_(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===W(t,0)?Z(t,1):t:w(t)))};lt.prototype={type:C,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,n,r,i,a,s,u,c=P(t);if(c)for(n=(e=k(t,c)).next;!(r=o(n,e)).done;){if(a=(i=k(m(r.value))).next,(s=o(a,i)).done||(u=o(a,i)).done||!o(a,i).done)throw K("Expected sequence with length 2");X(this.entries,{key:w(s.value),value:w(u.value)})}else for(var l in t)v(t,l)&&X(this.entries,{key:l,value:w(t[l])})},parseQuery:function(t){if(t)for(var e,n,r=Q(t,"&"),i=0;i<r.length;)(e=r[i++]).length&&(n=Q(e,"="),X(this.entries,{key:it(J(n)),value:it($(n,"="))}))},serialize:function(){for(var t,e=this.entries,n=[],r=0;r<e.length;)t=e[r++],X(n,ut(t.key)+"="+ut(t.value));return $(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ft=function(){d(this,pt);var t=arguments.length>0?arguments[0]:void 0;N(this,new lt(t))},pt=ft.prototype;if(l(pt,{append:function(t,e){E(arguments.length,2);var n=j(this);X(n.entries,{key:w(t),value:w(e)}),n.updateURL()},delete:function(t){E(arguments.length,1);for(var e=j(this),n=e.entries,r=w(t),i=0;i<n.length;)n[i].key===r?Y(n,i,1):i++;e.updateURL()},get:function(t){E(arguments.length,1);for(var e=j(this).entries,n=w(t),r=0;r<e.length;r++)if(e[r].key===n)return e[r].value;return null},getAll:function(t){E(arguments.length,1);for(var e=j(this).entries,n=w(t),r=[],i=0;i<e.length;i++)e[i].key===n&&X(r,e[i].value);return r},has:function(t){E(arguments.length,1);for(var e=j(this).entries,n=w(t),r=0;r<e.length;)if(e[r++].key===n)return!0;return!1},set:function(t,e){E(arguments.length,1);for(var n,r=j(this),i=r.entries,o=!1,a=w(t),s=w(e),u=0;u<i.length;u++)(n=i[u]).key===a&&(o?Y(i,u--,1):(o=!0,n.value=s));o||X(i,{key:a,value:s}),r.updateURL()},sort:function(){var t=j(this);A(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,n=j(this).entries,r=y(t,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((e=n[i++]).value,e.key,this)},keys:function(){return new ct(this,"keys")},values:function(){return new ct(this,"values")},entries:function(){return new ct(this,"entries")}},{enumerable:!0}),c(pt,x,pt.entries,{name:"entries"}),c(pt,"toString",(function(){return j(this).serialize()}),{enumerable:!0}),f(ft,C),r({global:!0,constructor:!0,forced:!u},{URLSearchParams:ft}),!u&&g(D)){var ht=a(G.has),dt=a(G.set),gt=function(t){if(_(t)){var e,n=t.body;if(b(n)===C)return e=t.headers?new D(t.headers):new D,ht(e,"content-type")||dt(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),S(t,{body:O(0,w(n)),headers:O(0,e)})}return t};if(g(H)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return H(t,arguments.length>1?gt(arguments[1]):{})}}),g(L)){var vt=function(t){return d(this,F),new L(t,arguments.length>1?gt(arguments[1]):{})};F.constructor=vt,vt.prototype=F,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:vt})}}t.exports={URLSearchParams:ft,getState:j}},523:(t,e,n)=>{n(2653)},1965:(module,exports,__webpack_require__)=>{var __WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(n){return new Sha256(e,!0).update(n)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(t){return e.create().update(t)};for(var n=0;n<OUTPUT_TYPES.length;++n){var r=OUTPUT_TYPES[n];e[r]=createOutputMethod(r,t)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"==typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(null==t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(n,r){return new HmacSha256(n,e,!0).update(r)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(e){return new HmacSha256(e,t)},e.update=function(t,n){return e.create(t).update(n)};for(var n=0;n<OUTPUT_TYPES.length;++n){var r=OUTPUT_TYPES[n];e[r]=createHmacOutputMethod(r,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,e,n){var r,i=typeof t;if("string"===i){var o,a=[],s=t.length,u=0;for(r=0;r<s;++r)(o=t.charCodeAt(r))<128?a[u++]=o:o<2048?(a[u++]=192|o>>6,a[u++]=128|63&o):o<55296||o>=57344?(a[u++]=224|o>>12,a[u++]=128|o>>6&63,a[u++]=128|63&o):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++r)),a[u++]=240|o>>18,a[u++]=128|o>>12&63,a[u++]=128|o>>6&63,a[u++]=128|63&o);t=a}else{if("object"!==i)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(e,!0).update(t).array());var c=[],l=[];for(r=0;r<64;++r){var f=t[r]||0;c[r]=92^f,l[r]=54^f}Sha256.call(this,e,n),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=n}Sha256.prototype.update=function(t){if(!this.finalized){var e,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);e=!0}for(var r,i,o=0,a=t.length,s=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),e)for(i=this.start;o<a&&i<64;++o)s[i>>2]|=t[o]<<SHIFT[3&i++];else for(i=this.start;o<a&&i<64;++o)(r=t.charCodeAt(o))<128?s[i>>2]|=r<<SHIFT[3&i++]:r<2048?(s[i>>2]|=(192|r>>6)<<SHIFT[3&i++],s[i>>2]|=(128|63&r)<<SHIFT[3&i++]):r<55296||r>=57344?(s[i>>2]|=(224|r>>12)<<SHIFT[3&i++],s[i>>2]|=(128|r>>6&63)<<SHIFT[3&i++],s[i>>2]|=(128|63&r)<<SHIFT[3&i++]):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++o)),s[i>>2]|=(240|r>>18)<<SHIFT[3&i++],s[i>>2]|=(128|r>>12&63)<<SHIFT[3&i++],s[i>>2]|=(128|r>>6&63)<<SHIFT[3&i++],s[i>>2]|=(128|63&r)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,e,n,r,i,o,a,s,u,c=this.h0,l=this.h1,f=this.h2,p=this.h3,h=this.h4,d=this.h5,g=this.h6,v=this.h7,y=this.blocks;for(t=16;t<64;++t)e=((i=y[t-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,n=((i=y[t-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,y[t]=y[t-16]+e+y[t-7]+n<<0;for(u=l&f,t=0;t<64;t+=4)this.first?(this.is224?(o=300032,v=(i=y[0]-1413257819)-150054599<<0,p=i+24177077<<0):(o=704751109,v=(i=y[0]-210244248)-1521486534<<0,p=i+143694565<<0),this.first=!1):(e=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),r=(o=c&l)^c&f^u,v=p+(i=v+(n=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&d^~h&g)+K[t]+y[t])<<0,p=i+(e+r)<<0),e=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),r=(a=p&c)^p&l^o,g=f+(i=g+(n=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&h^~v&d)+K[t+1]+y[t+1])<<0,e=((f=i+(e+r)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(s=f&p)^f&c^a,d=l+(i=d+(n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&v^~g&h)+K[t+2]+y[t+2])<<0,e=((l=i+(e+r)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(u=l&f)^l&p^s,h=c+(i=h+(n=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&g^~d&v)+K[t+3]+y[t+3])<<0,c=i+(e+r)<<0;this.h0=this.h0+c<<0,this.h1=this.h1+l<<0,this.h2=this.h2+f<<0,this.h3=this.h3+p<<0,this.h4=this.h4+h<<0,this.h5=this.h5+d<<0,this.h6=this.h6+g<<0,this.h7=this.h7+v<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,u=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(u+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),u},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,u=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||u.push(s>>24&255,s>>16&255,s>>8&255,255&s),u},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=(function(){return exports}).call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},6635:function(t,e,n){var r;t=n.nmd(t),(function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=16,c=32,l=64,f=128,p=256,h=1/0,d=9007199254740991,g=NaN,v=4294967295,y=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",c],["partialRight",l],["rearg",p]],b="[object Arguments]",m="[object Array]",_="[object Boolean]",w="[object Date]",S="[object Error]",O="[object Function]",k="[object GeneratorFunction]",P="[object Map]",E="[object Number]",T="[object Object]",A="[object Promise]",x="[object RegExp]",C="[object Set]",R="[object String]",N="[object Symbol]",j="[object WeakMap]",U="[object ArrayBuffer]",I="[object DataView]",M="[object Float32Array]",H="[object Float64Array]",L="[object Int8Array]",D="[object Int16Array]",F="[object Int32Array]",G="[object Uint8Array]",B="[object Uint8ClampedArray]",K="[object Uint16Array]",q="[object Uint32Array]",z=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,J=RegExp(X.source),Y=RegExp(V.source),Q=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nt=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ot=RegExp(it.source),at=/^\s+/,st=/\s/,ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ct=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pt=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,gt=/\w*$/,vt=/^[-+]0x[0-9a-f]+$/i,yt=/^0b[01]+$/i,bt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,_t=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,St=/($^)/,Ot=/['\n\r\u2028\u2029\\]/g,kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",Tt="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",xt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="['\u2019]",Rt="[\\ud800-\\udfff]",Nt="["+xt+"]",jt="["+kt+"]",Ut="\\d+",It="[\\u2700-\\u27bf]",Mt="["+Et+"]",Ht="[^\\ud800-\\udfff"+xt+Ut+Pt+Et+Tt+"]",Lt="\\ud83c[\\udffb-\\udfff]",Dt="[^\\ud800-\\udfff]",Ft="(?:\\ud83c[\\udde6-\\uddff]){2}",Gt="[\\ud800-\\udbff][\\udc00-\\udfff]",Bt="["+Tt+"]",Kt="(?:"+Mt+"|"+Ht+")",qt="(?:"+Bt+"|"+Ht+")",zt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Wt="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",$t="(?:"+jt+"|"+Lt+")"+"?",Xt="[\\ufe0e\\ufe0f]?",Vt=Xt+$t+("(?:\\u200d(?:"+[Dt,Ft,Gt].join("|")+")"+Xt+$t+")*"),Jt="(?:"+[It,Ft,Gt].join("|")+")"+Vt,Yt="(?:"+[Dt+jt+"?",jt,Ft,Gt,Rt].join("|")+")",Qt=RegExp(Ct,"g"),Zt=RegExp(jt,"g"),te=RegExp(Lt+"(?="+Lt+")|"+Yt+Vt,"g"),ee=RegExp([Bt+"?"+Mt+"+"+zt+"(?="+[Nt,Bt,"$"].join("|")+")",qt+"+"+Wt+"(?="+[Nt,Bt+Kt,"$"].join("|")+")",Bt+"?"+Kt+"+"+zt,Bt+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ut,Jt].join("|"),"g"),ne=RegExp("[\\u200d\\ud800-\\udfff"+kt+At+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ie=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ae={};ae[M]=ae[H]=ae[L]=ae[D]=ae[F]=ae[G]=ae[B]=ae[K]=ae[q]=!0,ae[b]=ae[m]=ae[U]=ae[_]=ae[I]=ae[w]=ae[S]=ae[O]=ae[P]=ae[E]=ae[T]=ae[x]=ae[C]=ae[R]=ae[j]=!1;var se={};se[b]=se[m]=se[U]=se[I]=se[_]=se[w]=se[M]=se[H]=se[L]=se[D]=se[F]=se[P]=se[E]=se[T]=se[x]=se[C]=se[R]=se[N]=se[G]=se[B]=se[K]=se[q]=!0,se[S]=se[O]=se[j]=!1;var ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ce=parseFloat,le=parseInt,fe="object"==typeof global&&global&&global.Object===Object&&global,pe="object"==typeof self&&self&&self.Object===Object&&self,he=fe||pe||Function("return this")(),de=e&&!e.nodeType&&e,ge=de&&t&&!t.nodeType&&t,ve=ge&&ge.exports===de,ye=ve&&fe.process,be=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||ye&&ye.binding&&ye.binding("util")}catch(e){}}(),me=be&&be.isArrayBuffer,_e=be&&be.isDate,we=be&&be.isMap,Se=be&&be.isRegExp,Oe=be&&be.isSet,ke=be&&be.isTypedArray;function Pe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Te(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ce(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Re(t,e){return!!(null==t?0:t.length)&&Ge(t,e,0)>-1}function Ne(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Ue(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ie(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Me(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function He(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Le=ze("length");function De(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Fe(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ge(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Fe(t,Ke,n)}function Be(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Ke(t){return t!=t}function qe(t,e){var n=null==t?0:t.length;return n?Xe(t,e)/n:g}function ze(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function $e(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Xe(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function Ve(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Je(t){return t?t.slice(0,gn(t)+1).replace(at,""):t}function Ye(t){return function(e){return t(e)}}function Qe(t,e){return je(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function tn(t,e){for(var n=-1,r=t.length;++n<r&&Ge(e,t[n],0)>-1;);return n}function en(t,e){for(var n=t.length;n--&&Ge(e,t[n],0)>-1;);return n}function nn(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var rn=We({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),on=We({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function an(t){return"\\"+ue[t]}function sn(t){return ne.test(t)}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function cn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==s||(t[n]=s,o[i++]=n)}return o}function fn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function pn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function hn(t){return sn(t)?function(t){var e=te.lastIndex=0;for(;te.test(t);)++e;return e}(t):Le(t)}function dn(t){return sn(t)?function(t){return t.match(te)||[]}(t):function(t){return t.split("")}(t)}function gn(t){for(var e=t.length;e--&&st.test(t.charAt(e)););return e}var vn=We({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var yn=function t(e){var n,r=(e=null==e?he:yn.defaults(he.Object(),e,yn.pick(he,ie))).Array,st=e.Date,kt=e.Error,Pt=e.Function,Et=e.Math,Tt=e.Object,At=e.RegExp,xt=e.String,Ct=e.TypeError,Rt=r.prototype,Nt=Pt.prototype,jt=Tt.prototype,Ut=e["__core-js_shared__"],It=Nt.toString,Mt=jt.hasOwnProperty,Ht=0,Lt=(n=/[^.]+$/.exec(Ut&&Ut.keys&&Ut.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Dt=jt.toString,Ft=It.call(Tt),Gt=he._,Bt=At("^"+It.call(Mt).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kt=ve?e.Buffer:i,qt=e.Symbol,zt=e.Uint8Array,Wt=Kt?Kt.allocUnsafe:i,$t=cn(Tt.getPrototypeOf,Tt),Xt=Tt.create,Vt=jt.propertyIsEnumerable,Jt=Rt.splice,Yt=qt?qt.isConcatSpreadable:i,te=qt?qt.iterator:i,ne=qt?qt.toStringTag:i,ue=function(){try{var t=ho(Tt,"defineProperty");return t({},"",{}),t}catch(e){}}(),fe=e.clearTimeout!==he.clearTimeout&&e.clearTimeout,pe=st&&st.now!==he.Date.now&&st.now,de=e.setTimeout!==he.setTimeout&&e.setTimeout,ge=Et.ceil,ye=Et.floor,be=Tt.getOwnPropertySymbols,Le=Kt?Kt.isBuffer:i,We=e.isFinite,bn=Rt.join,mn=cn(Tt.keys,Tt),_n=Et.max,wn=Et.min,Sn=st.now,On=e.parseInt,kn=Et.random,Pn=Rt.reverse,En=ho(e,"DataView"),Tn=ho(e,"Map"),An=ho(e,"Promise"),xn=ho(e,"Set"),Cn=ho(e,"WeakMap"),Rn=ho(Tt,"create"),Nn=Cn&&new Cn,jn={},Un=Go(En),In=Go(Tn),Mn=Go(An),Hn=Go(xn),Ln=Go(Cn),Dn=qt?qt.prototype:i,Fn=Dn?Dn.valueOf:i,Gn=Dn?Dn.toString:i;function Bn(t){if(is(t)&&!$a(t)&&!(t instanceof Wn)){if(t instanceof zn)return t;if(Mt.call(t,"__wrapped__"))return Bo(t)}return new zn(t)}var Kn=function(){function t(){}return function(e){if(!rs(e))return{};if(Xt)return Xt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function qn(){}function zn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function $n(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Vn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Xn(t);this.size=e.size}function Qn(t,e){var n=$a(t),r=!n&&Wa(t),i=!n&&!r&&Ya(t),o=!n&&!r&&!i&&ps(t),a=n||r||i||o,s=a?Ve(t.length,xt):[],u=s.length;for(var c in t)!e&&!Mt.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wo(c,u))||s.push(c);return s}function Zn(t){var e=t.length;return e?t[Jr(0,e-1)]:i}function tr(t,e){return Lo(Ri(t),cr(e,0,t.length))}function er(t){return Lo(Ri(t))}function nr(t,e,n){(n!==i&&!Ka(t[e],n)||n===i&&!(e in t))&&sr(t,e,n)}function rr(t,e,n){var r=t[e];Mt.call(t,e)&&Ka(r,n)&&(n!==i||e in t)||sr(t,e,n)}function ir(t,e){for(var n=t.length;n--;)if(Ka(t[n][0],e))return n;return-1}function or(t,e,n,r){return dr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function ar(t,e){return t&&Ni(e,Us(e),t)}function sr(t,e,n){"__proto__"==e&&ue?ue(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ur(t,e){for(var n=-1,o=e.length,a=r(o),s=null==t;++n<o;)a[n]=s?i:xs(t,e[n]);return a}function cr(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function lr(t,e,n,r,o,a){var s,u=1&e,c=2&e,l=4&e;if(n&&(s=o?n(t,r,o,a):n(t)),s!==i)return s;if(!rs(t))return t;var f=$a(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Mt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!u)return Ri(t,s)}else{var p=yo(t),h=p==O||p==k;if(Ya(t))return Pi(t,u);if(p==T||p==b||h&&!o){if(s=c||h?{}:mo(t),!u)return c?function(t,e){return Ni(t,vo(t),e)}(t,function(t,e){return t&&Ni(e,Is(e),t)}(s,t)):function(t,e){return Ni(t,go(t),e)}(t,ar(s,t))}else{if(!se[p])return o?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case U:return Ei(t);case _:case w:return new r(+t);case I:return function(t,e){var n=e?Ei(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case H:case L:case D:case F:case G:case B:case K:case q:return Ti(t,n);case P:return new r;case E:case R:return new r(t);case x:return function(t){var e=new t.constructor(t.source,gt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new r;case N:return i=t,Fn?Tt(Fn.call(i)):{}}var i}(t,p,u)}}a||(a=new Yn);var d=a.get(t);if(d)return d;a.set(t,s),cs(t)?t.forEach((function(r){s.add(lr(r,e,n,r,t,a))})):os(t)&&t.forEach((function(r,i){s.set(i,lr(r,e,n,i,t,a))}));var g=f?i:(l?c?ao:oo:c?Is:Us)(t);return Te(g||t,(function(r,i){g&&(r=t[i=r]),rr(s,i,lr(r,e,n,i,t,a))})),s}function fr(t,e,n){var r=n.length;if(null==t)return!r;for(t=Tt(t);r--;){var o=n[r],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function pr(t,e,n){if("function"!=typeof t)throw new Ct(o);return Uo((function(){t.apply(i,n)}),e)}function hr(t,e,n,r){var i=-1,o=Re,a=!0,s=t.length,u=[],c=e.length;if(!s)return u;n&&(e=je(e,Ye(n))),r?(o=Ne,a=!1):e.length>=200&&(o=Ze,a=!1,e=new Jn(e));t:for(;++i<s;){var l=t[i],f=null==n?l:n(l);if(l=r||0!==l?l:0,a&&f==f){for(var p=c;p--;)if(e[p]===f)continue t;u.push(l)}else o(e,f,r)||u.push(l)}return u}Bn.templateSettings={escape:Q,evaluate:Z,interpolate:tt,variable:"",imports:{_:Bn}},Bn.prototype=qn.prototype,Bn.prototype.constructor=Bn,zn.prototype=Kn(qn.prototype),zn.prototype.constructor=zn,Wn.prototype=Kn(qn.prototype),Wn.prototype.constructor=Wn,$n.prototype.clear=function(){this.__data__=Rn?Rn(null):{},this.size=0},$n.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$n.prototype.get=function(t){var e=this.__data__;if(Rn){var n=e[t];return n===a?i:n}return Mt.call(e,t)?e[t]:i},$n.prototype.has=function(t){var e=this.__data__;return Rn?e[t]!==i:Mt.call(e,t)},$n.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Rn&&e===i?a:e,this},Xn.prototype.clear=function(){this.__data__=[],this.size=0},Xn.prototype.delete=function(t){var e=this.__data__,n=ir(e,t);return!(n<0)&&(n==e.length-1?e.pop():Jt.call(e,n,1),--this.size,!0)},Xn.prototype.get=function(t){var e=this.__data__,n=ir(e,t);return n<0?i:e[n][1]},Xn.prototype.has=function(t){return ir(this.__data__,t)>-1},Xn.prototype.set=function(t,e){var n=this.__data__,r=ir(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Vn.prototype.clear=function(){this.size=0,this.__data__={hash:new $n,map:new(Tn||Xn),string:new $n}},Vn.prototype.delete=function(t){var e=fo(this,t).delete(t);return this.size-=e?1:0,e},Vn.prototype.get=function(t){return fo(this,t).get(t)},Vn.prototype.has=function(t){return fo(this,t).has(t)},Vn.prototype.set=function(t,e){var n=fo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Jn.prototype.add=Jn.prototype.push=function(t){return this.__data__.set(t,a),this},Jn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Xn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Xn){var r=n.__data__;if(!Tn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Vn(r)}return n.set(t,e),this.size=n.size,this};var dr=Ii(Sr),gr=Ii(Or,!0);function vr(t,e){var n=!0;return dr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function yr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],s=e(a);if(null!=s&&(u===i?s==s&&!fs(s):n(s,u)))var u=s,c=a}return c}function br(t,e){var n=[];return dr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function mr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=_o),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?mr(s,e-1,n,r,i):Ue(i,s):r||(i[i.length]=s)}return i}var _r=Mi(),wr=Mi(!0);function Sr(t,e){return t&&_r(t,e,Us)}function Or(t,e){return t&&wr(t,e,Us)}function kr(t,e){return Ce(e,(function(e){return ts(t[e])}))}function Pr(t,e){for(var n=0,r=(e=wi(e,t)).length;null!=t&&n<r;)t=t[Fo(e[n++])];return n&&n==r?t:i}function Er(t,e,n){var r=e(t);return $a(t)?r:Ue(r,n(t))}function Tr(t){return null==t?t===i?"[object Undefined]":"[object Null]":ne&&ne in Tt(t)?function(t){var e=Mt.call(t,ne),n=t[ne];try{t[ne]=i;var r=!0}catch(a){}var o=Dt.call(t);r&&(e?t[ne]=n:delete t[ne]);return o}(t):function(t){return Dt.call(t)}(t)}function Ar(t,e){return t>e}function xr(t,e){return null!=t&&Mt.call(t,e)}function Cr(t,e){return null!=t&&e in Tt(t)}function Rr(t,e,n){for(var o=n?Ne:Re,a=t[0].length,s=t.length,u=s,c=r(s),l=1/0,f=[];u--;){var p=t[u];u&&e&&(p=je(p,Ye(e))),l=wn(p.length,l),c[u]=!n&&(e||a>=120&&p.length>=120)?new Jn(u&&p):i}p=t[0];var h=-1,d=c[0];t:for(;++h<a&&f.length<l;){var g=p[h],v=e?e(g):g;if(g=n||0!==g?g:0,!(d?Ze(d,v):o(f,v,n))){for(u=s;--u;){var y=c[u];if(!(y?Ze(y,v):o(t[u],v,n)))continue t}d&&d.push(v),f.push(g)}}return f}function Nr(t,e,n){var r=null==(t=Co(t,e=wi(e,t)))?t:t[Fo(Zo(e))];return null==r?i:Pe(r,t,n)}function jr(t){return is(t)&&Tr(t)==b}function Ur(t,e,n,r,o){return t===e||(null==t||null==e||!is(t)&&!is(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var s=$a(t),u=$a(e),c=s?m:yo(t),l=u?m:yo(e),f=(c=c==b?T:c)==T,p=(l=l==b?T:l)==T,h=c==l;if(h&&Ya(t)){if(!Ya(e))return!1;s=!0,f=!1}if(h&&!f)return a||(a=new Yn),s||ps(t)?ro(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case I:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case U:return!(t.byteLength!=e.byteLength||!o(new zt(t),new zt(e)));case _:case w:case E:return Ka(+t,+e);case S:return t.name==e.name&&t.message==e.message;case x:case R:return t==e+"";case P:var s=un;case C:var u=1&r;if(s||(s=fn),t.size!=e.size&&!u)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var l=ro(s(t),s(e),r,i,o,a);return a.delete(t),l;case N:if(Fn)return Fn.call(t)==Fn.call(e)}return!1}(t,e,c,n,r,o,a);if(!(1&n)){var d=f&&Mt.call(t,"__wrapped__"),g=p&&Mt.call(e,"__wrapped__");if(d||g){var v=d?t.value():t,y=g?e.value():e;return a||(a=new Yn),o(v,y,n,r,a)}}if(!h)return!1;return a||(a=new Yn),function(t,e,n,r,o,a){var s=1&n,u=oo(t),c=u.length,l=oo(e).length;if(c!=l&&!s)return!1;var f=c;for(;f--;){var p=u[f];if(!(s?p in e:Mt.call(e,p)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var g=!0;a.set(t,e),a.set(e,t);var v=s;for(;++f<c;){var y=t[p=u[f]],b=e[p];if(r)var m=s?r(b,y,p,e,t,a):r(y,b,p,t,e,a);if(!(m===i?y===b||o(y,b,n,r,a):m)){g=!1;break}v||(v="constructor"==p)}if(g&&!v){var _=t.constructor,w=e.constructor;_==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w||(g=!1)}return a.delete(t),a.delete(e),g}(t,e,n,r,o,a)}(t,e,n,r,Ur,o))}function Ir(t,e,n,r){var o=n.length,a=o,s=!r;if(null==t)return!a;for(t=Tt(t);o--;){var u=n[o];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=n[o])[0],l=t[c],f=u[1];if(s&&u[2]){if(l===i&&!(c in t))return!1}else{var p=new Yn;if(r)var h=r(l,f,c,t,e,p);if(!(h===i?Ur(f,l,3,r,p):h))return!1}}return!0}function Mr(t){return!(!rs(t)||(e=t,Lt&&Lt in e))&&(ts(t)?Bt:bt).test(Go(t));var e}function Hr(t){return"function"==typeof t?t:null==t?au:"object"==typeof t?$a(t)?Kr(t[0],t[1]):Br(t):gu(t)}function Lr(t){if(!Eo(t))return mn(t);var e=[];for(var n in Tt(t))Mt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Dr(t){if(!rs(t))return function(t){var e=[];if(null!=t)for(var n in Tt(t))e.push(n);return e}(t);var e=Eo(t),n=[];for(var r in t)("constructor"!=r||!e&&Mt.call(t,r))&&n.push(r);return n}function Fr(t,e){return t<e}function Gr(t,e){var n=-1,i=Va(t)?r(t.length):[];return dr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Br(t){var e=po(t);return 1==e.length&&e[0][2]?Ao(e[0][0],e[0][1]):function(n){return n===t||Ir(n,t,e)}}function Kr(t,e){return Oo(t)&&To(e)?Ao(Fo(t),e):function(n){var r=xs(n,t);return r===i&&r===e?Cs(n,t):Ur(e,r,3)}}function qr(t,e,n,r,o){t!==e&&_r(e,(function(a,s){if(o||(o=new Yn),rs(a))!function(t,e,n,r,o,a,s){var u=No(t,n),c=No(e,n),l=s.get(c);if(l)return void nr(t,n,l);var f=a?a(u,c,n+"",t,e,s):i,p=f===i;if(p){var h=$a(c),d=!h&&Ya(c),g=!h&&!d&&ps(c);f=c,h||d||g?$a(u)?f=u:Ja(u)?f=Ri(u):d?(p=!1,f=Pi(c,!0)):g?(p=!1,f=Ti(c,!0)):f=[]:ss(c)||Wa(c)?(f=u,Wa(u)?f=_s(u):rs(u)&&!ts(u)||(f=mo(c))):p=!1}p&&(s.set(c,f),o(f,c,r,a,s),s.delete(c));nr(t,n,f)}(t,e,s,n,qr,r,o);else{var u=r?r(No(t,s),a,s+"",t,e,o):i;u===i&&(u=a),nr(t,s,u)}}),Is)}function zr(t,e){var n=t.length;if(n)return wo(e+=e<0?n:0,n)?t[e]:i}function Wr(t,e,n){e=e.length?je(e,(function(t){return $a(t)?function(e){return Pr(e,1===t.length?t[0]:t)}:t})):[au];var r=-1;e=je(e,Ye(lo()));var i=Gr(t,(function(t,n,i){var o=je(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;for(;++r<a;){var u=Ai(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function $r(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=Pr(t,a);n(s,a)&&ei(o,wi(a,t),s)}return o}function Xr(t,e,n,r){var i=r?Be:Ge,o=-1,a=e.length,s=t;for(t===e&&(e=Ri(e)),n&&(s=je(t,Ye(n)));++o<a;)for(var u=0,c=e[o],l=n?n(c):c;(u=i(s,l,u,r))>-1;)s!==t&&Jt.call(s,u,1),Jt.call(t,u,1);return t}function Vr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;wo(i)?Jt.call(t,i,1):hi(t,i)}}return t}function Jr(t,e){return t+ye(kn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=ye(e/2))&&(t+=t)}while(e);return n}function Qr(t,e){return Io(xo(t,e,au),t+"")}function Zr(t){return Zn(Ks(t))}function ti(t,e){var n=Ks(t);return Lo(n,cr(e,0,n.length))}function ei(t,e,n,r){if(!rs(t))return t;for(var o=-1,a=(e=wi(e,t)).length,s=a-1,u=t;null!=u&&++o<a;){var c=Fo(e[o]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=s){var f=u[c];(l=r?r(f,c,u):i)===i&&(l=rs(f)?f:wo(e[o+1])?[]:{})}rr(u,c,l),u=u[c]}return t}var ni=Nn?function(t,e){return Nn.set(t,e),t}:au,ri=ue?function(t,e){return ue(t,"toString",{configurable:!0,enumerable:!1,value:ru(e),writable:!0})}:au;function ii(t){return Lo(Ks(t))}function oi(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ai(t,e){var n;return dr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function si(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!fs(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ui(t,e,au,n)}function ui(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=n(e))!=e,u=null===e,c=fs(e),l=e===i;o<a;){var f=ye((o+a)/2),p=n(t[f]),h=p!==i,d=null===p,g=p==p,v=fs(p);if(s)var y=r||g;else y=l?g&&(r||h):u?g&&h&&(r||!d):c?g&&h&&!d&&(r||!v):!d&&!v&&(r?p<=e:p<e);y?o=f+1:a=f}return wn(a,4294967294)}function ci(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Ka(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function li(t){return"number"==typeof t?t:fs(t)?g:+t}function fi(t){if("string"==typeof t)return t;if($a(t))return je(t,fi)+"";if(fs(t))return Gn?Gn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function pi(t,e,n){var r=-1,i=Re,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=Ne;else if(o>=200){var c=e?null:Yi(t);if(c)return fn(c);a=!1,i=Ze,u=new Jn}else u=e?[]:s;t:for(;++r<o;){var l=t[r],f=e?e(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var p=u.length;p--;)if(u[p]===f)continue t;e&&u.push(f),s.push(l)}else i(u,f,n)||(u!==s&&u.push(f),s.push(l))}return s}function hi(t,e){return null==(t=Co(t,e=wi(e,t)))||delete t[Fo(Zo(e))]}function di(t,e,n,r){return ei(t,e,n(Pr(t,e)),r)}function gi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?oi(t,r?0:o,r?o+1:i):oi(t,r?o+1:0,r?i:o)}function vi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Ie(e,(function(t,e){return e.func.apply(e.thisArg,Ue([t],e.args))}),n)}function yi(t,e,n){var i=t.length;if(i<2)return i?pi(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=t[o],u=-1;++u<i;)u!=o&&(a[o]=hr(a[o]||s,t[u],e,n));return pi(mr(a,1),e,n)}function bi(t,e,n){for(var r=-1,o=t.length,a=e.length,s={};++r<o;){var u=r<a?e[r]:i;n(s,t[r],u)}return s}function mi(t){return Ja(t)?t:[]}function _i(t){return"function"==typeof t?t:au}function wi(t,e){return $a(t)?t:Oo(t,e)?[t]:Do(ws(t))}var Si=Qr;function Oi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:oi(t,e,n)}var ki=fe||function(t){return he.clearTimeout(t)};function Pi(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function Ei(t){var e=new t.constructor(t.byteLength);return new zt(e).set(new zt(t)),e}function Ti(t,e){var n=e?Ei(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ai(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=fs(t),s=e!==i,u=null===e,c=e==e,l=fs(e);if(!u&&!l&&!a&&t>e||a&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!l&&t<e||l&&n&&o&&!r&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}function xi(t,e,n,i){for(var o=-1,a=t.length,s=n.length,u=-1,c=e.length,l=_n(a-s,0),f=r(c+l),p=!i;++u<c;)f[u]=e[u];for(;++o<s;)(p||o<a)&&(f[n[o]]=t[o]);for(;l--;)f[u++]=t[o++];return f}function Ci(t,e,n,i){for(var o=-1,a=t.length,s=-1,u=n.length,c=-1,l=e.length,f=_n(a-u,0),p=r(f+l),h=!i;++o<f;)p[o]=t[o];for(var d=o;++c<l;)p[d+c]=e[c];for(;++s<u;)(h||o<a)&&(p[d+n[s]]=t[o++]);return p}function Ri(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ni(t,e,n,r){var o=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var u=e[a],c=r?r(n[u],t[u],u,n,t):i;c===i&&(c=t[u]),o?sr(n,u,c):rr(n,u,c)}return n}function ji(t,e){return function(n,r){var i=$a(n)?Ee:or,o=e?e():{};return i(n,t,lo(r,2),o)}}function Ui(t){return Qr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&So(n[0],n[1],s)&&(a=o<3?i:a,o=1),e=Tt(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}function Ii(t,e){return function(n,r){if(null==n)return n;if(!Va(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Tt(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Mi(t){return function(e,n,r){for(var i=-1,o=Tt(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}function Hi(t){return function(e){var n=sn(e=ws(e))?dn(e):i,r=n?n[0]:e.charAt(0),o=n?Oi(n,1).join(""):e.slice(1);return r[t]()+o}}function Li(t){return function(e){return Ie(tu(Ws(e).replace(Qt,"")),t,"")}}function Di(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Kn(t.prototype),r=t.apply(n,e);return rs(r)?r:n}}function Fi(t){return function(e,n,r){var o=Tt(e);if(!Va(e)){var a=lo(n,3);e=Us(e),n=function(t){return a(o[t],t,o)}}var s=t(e,n,r);return s>-1?o[a?e[s]:s]:i}}function Gi(t){return io((function(e){var n=e.length,r=n,a=zn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new Ct(o);if(a&&!u&&"wrapper"==uo(s))var u=new zn([],!0)}for(r=u?r:n;++r<n;){var c=uo(s=e[r]),l="wrapper"==c?so(s):i;u=l&&ko(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[uo(l[0])].apply(u,l[3]):1==s.length&&ko(s)?u[c]():u.thru(s)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&$a(r))return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Bi(t,e,n,o,a,s,u,c,l,p){var h=e&f,d=1&e,g=2&e,v=24&e,y=512&e,b=g?i:Di(t);return function i(){for(var f=arguments.length,m=r(f),_=f;_--;)m[_]=arguments[_];if(v)var w=co(i),S=nn(m,w);if(o&&(m=xi(m,o,a,v)),s&&(m=Ci(m,s,u,v)),f-=S,v&&f<p){var O=ln(m,w);return Vi(t,e,Bi,i.placeholder,n,m,O,c,l,p-f)}var k=d?n:this,P=g?k[t]:t;return f=m.length,c?m=Ro(m,c):y&&f>1&&m.reverse(),h&&l<f&&(m.length=l),this&&this!==he&&this instanceof i&&(P=b||Di(P)),P.apply(k,m)}}function Ki(t,e){return function(n,r){return function(t,e,n,r){return Sr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function qi(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=fi(n),r=fi(r)):(n=li(n),r=li(r)),o=t(n,r)}return o}}function zi(t){return io((function(e){return e=je(e,Ye(lo())),Qr((function(n){var r=this;return t(e,(function(t){return Pe(t,r,n)}))}))}))}function Wi(t,e){var n=(e=e===i?" ":fi(e)).length;if(n<2)return n?Yr(e,t):e;var r=Yr(e,ge(t/hn(e)));return sn(e)?Oi(dn(r),0,t).join(""):r.slice(0,t)}function $i(t){return function(e,n,o){return o&&"number"!=typeof o&&So(e,n,o)&&(n=o=i),e=vs(e),n===i?(n=e,e=0):n=vs(n),function(t,e,n,i){for(var o=-1,a=_n(ge((e-t)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=t,t+=n;return s}(e,n,o=o===i?e<n?1:-1:vs(o),t)}}function Xi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ms(e),n=ms(n)),t(e,n)}}function Vi(t,e,n,r,o,a,s,u,f,p){var h=8&e;e|=h?c:l,4&(e&=~(h?l:c))||(e&=-4);var d=[t,e,o,h?a:i,h?s:i,h?i:a,h?i:s,u,f,p],g=n.apply(i,d);return ko(t)&&jo(g,d),g.placeholder=r,Mo(g,t,e)}function Ji(t){var e=Et[t];return function(t,n){if(t=ms(t),(n=null==n?0:wn(ys(n),292))&&We(t)){var r=(ws(t)+"e").split("e");return+((r=(ws(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Yi=xn&&1/fn(new xn([,-0]))[1]==h?function(t){return new xn(t)}:fu;function Qi(t){return function(e){var n=yo(e);return n==P?un(e):n==C?pn(e):function(t,e){return je(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Zi(t,e,n,a,h,d,g,v){var y=2&e;if(!y&&"function"!=typeof t)throw new Ct(o);var b=a?a.length:0;if(b||(e&=-97,a=h=i),g=g===i?g:_n(ys(g),0),v=v===i?v:ys(v),b-=h?h.length:0,e&l){var m=a,_=h;a=h=i}var w=y?i:so(t),S=[t,e,n,a,h,m,_,d,g,v];if(w&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==f&&8==n||r==f&&n==p&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?xi(c,u,e[4]):u,t[4]=c?ln(t[3],s):e[4]}(u=e[5])&&(c=t[5],t[5]=c?Ci(c,u,e[6]):u,t[6]=c?ln(t[5],s):e[6]);(u=e[7])&&(t[7]=u);r&f&&(t[8]=null==t[8]?e[8]:wn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(S,w),t=S[0],e=S[1],n=S[2],a=S[3],h=S[4],!(v=S[9]=S[9]===i?y?0:t.length:_n(S[9]-b,0))&&24&e&&(e&=-25),e&&1!=e)O=8==e||e==u?function(t,e,n){var o=Di(t);return function a(){for(var s=arguments.length,u=r(s),c=s,l=co(a);c--;)u[c]=arguments[c];var f=s<3&&u[0]!==l&&u[s-1]!==l?[]:ln(u,l);return(s-=f.length)<n?Vi(t,e,Bi,a.placeholder,i,u,f,i,i,n-s):Pe(this&&this!==he&&this instanceof a?o:t,this,u)}}(t,e,v):e!=c&&33!=e||h.length?Bi.apply(i,S):function(t,e,n,i){var o=1&e,a=Di(t);return function e(){for(var s=-1,u=arguments.length,c=-1,l=i.length,f=r(l+u),p=this&&this!==he&&this instanceof e?a:t;++c<l;)f[c]=i[c];for(;u--;)f[c++]=arguments[++s];return Pe(p,o?n:this,f)}}(t,e,n,a);else var O=function(t,e,n){var r=1&e,i=Di(t);return function e(){return(this&&this!==he&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Mo((w?ni:jo)(O,S),t,e)}function to(t,e,n,r){return t===i||Ka(t,jt[n])&&!Mt.call(r,n)?e:t}function eo(t,e,n,r,o,a){return rs(t)&&rs(e)&&(a.set(e,t),qr(t,e,i,eo,a),a.delete(e)),t}function no(t){return ss(t)?i:t}function ro(t,e,n,r,o,a){var s=1&n,u=t.length,c=e.length;if(u!=c&&!(s&&c>u))return!1;var l=a.get(t),f=a.get(e);if(l&&f)return l==e&&f==t;var p=-1,h=!0,d=2&n?new Jn:i;for(a.set(t,e),a.set(e,t);++p<u;){var g=t[p],v=e[p];if(r)var y=s?r(v,g,p,e,t,a):r(g,v,p,t,e,a);if(y!==i){if(y)continue;h=!1;break}if(d){if(!He(e,(function(t,e){if(!Ze(d,e)&&(g===t||o(g,t,n,r,a)))return d.push(e)}))){h=!1;break}}else if(g!==v&&!o(g,v,n,r,a)){h=!1;break}}return a.delete(t),a.delete(e),h}function io(t){return Io(xo(t,i,Xo),t+"")}function oo(t){return Er(t,Us,go)}function ao(t){return Er(t,Is,vo)}var so=Nn?function(t){return Nn.get(t)}:fu;function uo(t){for(var e=t.name+"",n=jn[e],r=Mt.call(jn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function co(t){return(Mt.call(Bn,"placeholder")?Bn:t).placeholder}function lo(){var t=Bn.iteratee||su;return t=t===su?Hr:t,arguments.length?t(arguments[0],arguments[1]):t}function fo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function po(t){for(var e=Us(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,To(i)]}return e}function ho(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Mr(n)?n:i}var go=be?function(t){return null==t?[]:(t=Tt(t),Ce(be(t),(function(e){return Vt.call(t,e)})))}:bu,vo=be?function(t){for(var e=[];t;)Ue(e,go(t)),t=$t(t);return e}:bu,yo=Tr;function bo(t,e,n){for(var r=-1,i=(e=wi(e,t)).length,o=!1;++r<i;){var a=Fo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&ns(i)&&wo(a,i)&&($a(t)||Wa(t))}function mo(t){return"function"!=typeof t.constructor||Eo(t)?{}:Kn($t(t))}function _o(t){return $a(t)||Wa(t)||!!(Yt&&t&&t[Yt])}function wo(t,e){var n=typeof t;return!!(e=null==e?d:e)&&("number"==n||"symbol"!=n&&_t.test(t))&&t>-1&&t%1==0&&t<e}function So(t,e,n){if(!rs(n))return!1;var r=typeof e;return!!("number"==r?Va(n)&&wo(e,n.length):"string"==r&&e in n)&&Ka(n[e],t)}function Oo(t,e){if($a(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!fs(t))||(nt.test(t)||!et.test(t)||null!=e&&t in Tt(e))}function ko(t){var e=uo(t),n=Bn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=so(n);return!!r&&t===r[0]}(En&&yo(new En(new ArrayBuffer(1)))!=I||Tn&&yo(new Tn)!=P||An&&yo(An.resolve())!=A||xn&&yo(new xn)!=C||Cn&&yo(new Cn)!=j)&&(yo=function(t){var e=Tr(t),n=e==T?t.constructor:i,r=n?Go(n):"";if(r)switch(r){case Un:return I;case In:return P;case Mn:return A;case Hn:return C;case Ln:return j}return e});var Po=Ut?ts:mu;function Eo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||jt)}function To(t){return t==t&&!rs(t)}function Ao(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==i||t in Tt(n)))}}function xo(t,e,n){return e=_n(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=_n(i.length-e,0),s=r(a);++o<a;)s[o]=i[e+o];o=-1;for(var u=r(e+1);++o<e;)u[o]=i[o];return u[e]=n(s),Pe(t,this,u)}}function Co(t,e){return e.length<2?t:Pr(t,oi(e,0,-1))}function Ro(t,e){for(var n=t.length,r=wn(e.length,n),o=Ri(t);r--;){var a=e[r];t[r]=wo(a,n)?o[a]:i}return t}function No(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var jo=Ho(ni),Uo=de||function(t,e){return he.setTimeout(t,e)},Io=Ho(ri);function Mo(t,e,n){var r=e+"";return Io(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ut,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Te(y,(function(n){var r="_."+n[0];e&n[1]&&!Re(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ct);return e?e[1].split(lt):[]}(r),n)))}function Ho(t){var e=0,n=0;return function(){var r=Sn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Lo(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Jr(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var Do=function(t){var e=Ha(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(rt,(function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)})),e}));function Fo(t){if("string"==typeof t||fs(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Go(t){if(null!=t){try{return It.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Bo(t){if(t instanceof Wn)return t.clone();var e=new zn(t.__wrapped__,t.__chain__);return e.__actions__=Ri(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Ko=Qr((function(t,e){return Ja(t)?hr(t,mr(e,1,Ja,!0)):[]})),qo=Qr((function(t,e){var n=Zo(e);return Ja(n)&&(n=i),Ja(t)?hr(t,mr(e,1,Ja,!0),lo(n,2)):[]})),zo=Qr((function(t,e){var n=Zo(e);return Ja(n)&&(n=i),Ja(t)?hr(t,mr(e,1,Ja,!0),i,n):[]}));function Wo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ys(n);return i<0&&(i=_n(r+i,0)),Fe(t,lo(e,3),i)}function $o(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=ys(n),o=n<0?_n(r+o,0):wn(o,r-1)),Fe(t,lo(e,3),o,!0)}function Xo(t){return(null==t?0:t.length)?mr(t,1):[]}function Vo(t){return t&&t.length?t[0]:i}var Jo=Qr((function(t){var e=je(t,mi);return e.length&&e[0]===t[0]?Rr(e):[]})),Yo=Qr((function(t){var e=Zo(t),n=je(t,mi);return e===Zo(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Rr(n,lo(e,2)):[]})),Qo=Qr((function(t){var e=Zo(t),n=je(t,mi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Rr(n,i,e):[]}));function Zo(t){var e=null==t?0:t.length;return e?t[e-1]:i}var ta=Qr(ea);function ea(t,e){return t&&t.length&&e&&e.length?Xr(t,e):t}var na=io((function(t,e){var n=null==t?0:t.length,r=ur(t,e);return Vr(t,je(e,(function(t){return wo(t,n)?+t:t})).sort(Ai)),r}));function ra(t){return null==t?t:Pn.call(t)}var ia=Qr((function(t){return pi(mr(t,1,Ja,!0))})),oa=Qr((function(t){var e=Zo(t);return Ja(e)&&(e=i),pi(mr(t,1,Ja,!0),lo(e,2))})),aa=Qr((function(t){var e=Zo(t);return e="function"==typeof e?e:i,pi(mr(t,1,Ja,!0),i,e)}));function sa(t){if(!t||!t.length)return[];var e=0;return t=Ce(t,(function(t){if(Ja(t))return e=_n(t.length,e),!0})),Ve(e,(function(e){return je(t,ze(e))}))}function ua(t,e){if(!t||!t.length)return[];var n=sa(t);return null==e?n:je(n,(function(t){return Pe(e,i,t)}))}var ca=Qr((function(t,e){return Ja(t)?hr(t,e):[]})),la=Qr((function(t){return yi(Ce(t,Ja))})),fa=Qr((function(t){var e=Zo(t);return Ja(e)&&(e=i),yi(Ce(t,Ja),lo(e,2))})),pa=Qr((function(t){var e=Zo(t);return e="function"==typeof e?e:i,yi(Ce(t,Ja),i,e)})),ha=Qr(sa);var da=Qr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,ua(t,n)}));function ga(t){var e=Bn(t);return e.__chain__=!0,e}function va(t,e){return e(t)}var ya=io((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ur(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Wn&&wo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:va,args:[o],thisArg:i}),new zn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)}));var ba=ji((function(t,e,n){Mt.call(t,n)?++t[n]:sr(t,n,1)}));var ma=Fi(Wo),_a=Fi($o);function wa(t,e){return($a(t)?Te:dr)(t,lo(e,3))}function Sa(t,e){return($a(t)?Ae:gr)(t,lo(e,3))}var Oa=ji((function(t,e,n){Mt.call(t,n)?t[n].push(e):sr(t,n,[e])}));var ka=Qr((function(t,e,n){var i=-1,o="function"==typeof e,a=Va(t)?r(t.length):[];return dr(t,(function(t){a[++i]=o?Pe(e,t,n):Nr(t,e,n)})),a})),Pa=ji((function(t,e,n){sr(t,n,e)}));function Ea(t,e){return($a(t)?je:Gr)(t,lo(e,3))}var Ta=ji((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Aa=Qr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&So(t,e[0],e[1])?e=[]:n>2&&So(e[0],e[1],e[2])&&(e=[e[0]]),Wr(t,mr(e,1),[])})),xa=pe||function(){return he.Date.now()};function Ca(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Zi(t,f,i,i,i,i,e)}function Ra(t,e){var n;if("function"!=typeof e)throw new Ct(o);return t=ys(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Na=Qr((function(t,e,n){var r=1;if(n.length){var i=ln(n,co(Na));r|=c}return Zi(t,r,e,n,i)})),ja=Qr((function(t,e,n){var r=3;if(n.length){var i=ln(n,co(ja));r|=c}return Zi(e,r,t,n,i)}));function Ua(t,e,n){var r,a,s,u,c,l,f=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new Ct(o);function g(e){var n=r,o=a;return r=a=i,f=e,u=t.apply(o,n)}function v(t){return f=t,c=Uo(b,e),p?g(t):u}function y(t){var n=t-l;return l===i||n>=e||n<0||h&&t-f>=s}function b(){var t=xa();if(y(t))return m(t);c=Uo(b,function(t){var n=e-(t-l);return h?wn(n,s-(t-f)):n}(t))}function m(t){return c=i,d&&r?g(t):(r=a=i,u)}function _(){var t=xa(),n=y(t);if(r=arguments,a=this,l=t,n){if(c===i)return v(l);if(h)return ki(c),c=Uo(b,e),g(l)}return c===i&&(c=Uo(b,e)),u}return e=ms(e)||0,rs(n)&&(p=!!n.leading,s=(h="maxWait"in n)?_n(ms(n.maxWait)||0,e):s,d="trailing"in n?!!n.trailing:d),_.cancel=function(){c!==i&&ki(c),f=0,r=l=a=c=i},_.flush=function(){return c===i?u:m(xa())},_}var Ia=Qr((function(t,e){return pr(t,1,e)})),Ma=Qr((function(t,e,n){return pr(t,ms(e)||0,n)}));function Ha(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ct(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ha.Cache||Vn),n}function La(t){if("function"!=typeof t)throw new Ct(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ha.Cache=Vn;var Da=Si((function(t,e){var n=(e=1==e.length&&$a(e[0])?je(e[0],Ye(lo())):je(mr(e,1),Ye(lo()))).length;return Qr((function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Pe(t,this,r)}))})),Fa=Qr((function(t,e){var n=ln(e,co(Fa));return Zi(t,c,i,e,n)})),Ga=Qr((function(t,e){var n=ln(e,co(Ga));return Zi(t,l,i,e,n)})),Ba=io((function(t,e){return Zi(t,p,i,i,i,e)}));function Ka(t,e){return t===e||t!=t&&e!=e}var qa=Xi(Ar),za=Xi((function(t,e){return t>=e})),Wa=jr(function(){return arguments}())?jr:function(t){return is(t)&&Mt.call(t,"callee")&&!Vt.call(t,"callee")},$a=r.isArray,Xa=me?Ye(me):function(t){return is(t)&&Tr(t)==U};function Va(t){return null!=t&&ns(t.length)&&!ts(t)}function Ja(t){return is(t)&&Va(t)}var Ya=Le||mu,Qa=_e?Ye(_e):function(t){return is(t)&&Tr(t)==w};function Za(t){if(!is(t))return!1;var e=Tr(t);return e==S||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ss(t)}function ts(t){if(!rs(t))return!1;var e=Tr(t);return e==O||e==k||"[object AsyncFunction]"==e||"[object Proxy]"==e}function es(t){return"number"==typeof t&&t==ys(t)}function ns(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function rs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function is(t){return null!=t&&"object"==typeof t}var os=we?Ye(we):function(t){return is(t)&&yo(t)==P};function as(t){return"number"==typeof t||is(t)&&Tr(t)==E}function ss(t){if(!is(t)||Tr(t)!=T)return!1;var e=$t(t);if(null===e)return!0;var n=Mt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&It.call(n)==Ft}var us=Se?Ye(Se):function(t){return is(t)&&Tr(t)==x};var cs=Oe?Ye(Oe):function(t){return is(t)&&yo(t)==C};function ls(t){return"string"==typeof t||!$a(t)&&is(t)&&Tr(t)==R}function fs(t){return"symbol"==typeof t||is(t)&&Tr(t)==N}var ps=ke?Ye(ke):function(t){return is(t)&&ns(t.length)&&!!ae[Tr(t)]};var hs=Xi(Fr),ds=Xi((function(t,e){return t<=e}));function gs(t){if(!t)return[];if(Va(t))return ls(t)?dn(t):Ri(t);if(te&&t[te])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[te]());var e=yo(t);return(e==P?un:e==C?fn:Ks)(t)}function vs(t){return t?(t=ms(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ys(t){var e=vs(t),n=e%1;return e==e?n?e-n:e:0}function bs(t){return t?cr(ys(t),0,v):0}function ms(t){if("number"==typeof t)return t;if(fs(t))return g;if(rs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=rs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Je(t);var n=yt.test(t);return n||mt.test(t)?le(t.slice(2),n?2:8):vt.test(t)?g:+t}function _s(t){return Ni(t,Is(t))}function ws(t){return null==t?"":fi(t)}var Ss=Ui((function(t,e){if(Eo(e)||Va(e))Ni(e,Us(e),t);else for(var n in e)Mt.call(e,n)&&rr(t,n,e[n])})),Os=Ui((function(t,e){Ni(e,Is(e),t)})),ks=Ui((function(t,e,n,r){Ni(e,Is(e),t,r)})),Ps=Ui((function(t,e,n,r){Ni(e,Us(e),t,r)})),Es=io(ur);var Ts=Qr((function(t,e){t=Tt(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&So(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],s=Is(a),u=-1,c=s.length;++u<c;){var l=s[u],f=t[l];(f===i||Ka(f,jt[l])&&!Mt.call(t,l))&&(t[l]=a[l])}return t})),As=Qr((function(t){return t.push(i,eo),Pe(Hs,i,t)}));function xs(t,e,n){var r=null==t?i:Pr(t,e);return r===i?n:r}function Cs(t,e){return null!=t&&bo(t,e,Cr)}var Rs=Ki((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Dt.call(e)),t[e]=n}),ru(au)),Ns=Ki((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Dt.call(e)),Mt.call(t,e)?t[e].push(n):t[e]=[n]}),lo),js=Qr(Nr);function Us(t){return Va(t)?Qn(t):Lr(t)}function Is(t){return Va(t)?Qn(t,!0):Dr(t)}var Ms=Ui((function(t,e,n){qr(t,e,n)})),Hs=Ui((function(t,e,n,r){qr(t,e,n,r)})),Ls=io((function(t,e){var n={};if(null==t)return n;var r=!1;e=je(e,(function(e){return e=wi(e,t),r||(r=e.length>1),e})),Ni(t,ao(t),n),r&&(n=lr(n,7,no));for(var i=e.length;i--;)hi(n,e[i]);return n}));var Ds=io((function(t,e){return null==t?{}:function(t,e){return $r(t,e,(function(e,n){return Cs(t,n)}))}(t,e)}));function Fs(t,e){if(null==t)return{};var n=je(ao(t),(function(t){return[t]}));return e=lo(e),$r(t,n,(function(t,n){return e(t,n[0])}))}var Gs=Qi(Us),Bs=Qi(Is);function Ks(t){return null==t?[]:Qe(t,Us(t))}var qs=Li((function(t,e,n){return e=e.toLowerCase(),t+(n?zs(e):e)}));function zs(t){return Zs(ws(t).toLowerCase())}function Ws(t){return(t=ws(t))&&t.replace(wt,rn).replace(Zt,"")}var $s=Li((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Xs=Li((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Vs=Hi("toLowerCase");var Js=Li((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ys=Li((function(t,e,n){return t+(n?" ":"")+Zs(e)}));var Qs=Li((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Zs=Hi("toUpperCase");function tu(t,e,n){return t=ws(t),(e=n?i:e)===i?function(t){return re.test(t)}(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.match(ft)||[]}(t):t.match(e)||[]}var eu=Qr((function(t,e){try{return Pe(t,i,e)}catch(n){return Za(n)?n:new kt(n)}})),nu=io((function(t,e){return Te(e,(function(e){e=Fo(e),sr(t,e,Na(t[e],t))})),t}));function ru(t){return function(){return t}}var iu=Gi(),ou=Gi(!0);function au(t){return t}function su(t){return Hr("function"==typeof t?t:lr(t,1))}var uu=Qr((function(t,e){return function(n){return Nr(n,t,e)}})),cu=Qr((function(t,e){return function(n){return Nr(t,n,e)}}));function lu(t,e,n){var r=Us(e),i=kr(e,r);null!=n||rs(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=kr(e,Us(e)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=ts(t);return Te(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Ri(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Ue([this.value()],arguments))})})),t}function fu(){}var pu=zi(je),hu=zi(xe),du=zi(He);function gu(t){return Oo(t)?ze(Fo(t)):function(t){return function(e){return Pr(e,t)}}(t)}var vu=$i(),yu=$i(!0);function bu(){return[]}function mu(){return!1}var _u=qi((function(t,e){return t+e}),0),wu=Ji("ceil"),Su=qi((function(t,e){return t/e}),1),Ou=Ji("floor");var ku,Pu=qi((function(t,e){return t*e}),1),Eu=Ji("round"),Tu=qi((function(t,e){return t-e}),0);return Bn.after=function(t,e){if("function"!=typeof e)throw new Ct(o);return t=ys(t),function(){if(--t<1)return e.apply(this,arguments)}},Bn.ary=Ca,Bn.assign=Ss,Bn.assignIn=Os,Bn.assignInWith=ks,Bn.assignWith=Ps,Bn.at=Es,Bn.before=Ra,Bn.bind=Na,Bn.bindAll=nu,Bn.bindKey=ja,Bn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return $a(t)?t:[t]},Bn.chain=ga,Bn.chunk=function(t,e,n){e=(n?So(t,e,n):e===i)?1:_n(ys(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,u=r(ge(o/e));a<o;)u[s++]=oi(t,a,a+=e);return u},Bn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Bn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Ue($a(n)?Ri(n):[n],mr(e,1))},Bn.cond=function(t){var e=null==t?0:t.length,n=lo();return t=e?je(t,(function(t){if("function"!=typeof t[1])throw new Ct(o);return[n(t[0]),t[1]]})):[],Qr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Pe(i[0],this,n))return Pe(i[1],this,n)}}))},Bn.conforms=function(t){return function(t){var e=Us(t);return function(n){return fr(n,t,e)}}(lr(t,1))},Bn.constant=ru,Bn.countBy=ba,Bn.create=function(t,e){var n=Kn(t);return null==e?n:ar(n,e)},Bn.curry=function t(e,n,r){var o=Zi(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Bn.curryRight=function t(e,n,r){var o=Zi(e,u,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Bn.debounce=Ua,Bn.defaults=Ts,Bn.defaultsDeep=As,Bn.defer=Ia,Bn.delay=Ma,Bn.difference=Ko,Bn.differenceBy=qo,Bn.differenceWith=zo,Bn.drop=function(t,e,n){var r=null==t?0:t.length;return r?oi(t,(e=n||e===i?1:ys(e))<0?0:e,r):[]},Bn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?oi(t,0,(e=r-(e=n||e===i?1:ys(e)))<0?0:e):[]},Bn.dropRightWhile=function(t,e){return t&&t.length?gi(t,lo(e,3),!0,!0):[]},Bn.dropWhile=function(t,e){return t&&t.length?gi(t,lo(e,3),!0):[]},Bn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&So(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=ys(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:ys(r))<0&&(r+=o),r=n>r?0:bs(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Bn.filter=function(t,e){return($a(t)?Ce:br)(t,lo(e,3))},Bn.flatMap=function(t,e){return mr(Ea(t,e),1)},Bn.flatMapDeep=function(t,e){return mr(Ea(t,e),h)},Bn.flatMapDepth=function(t,e,n){return n=n===i?1:ys(n),mr(Ea(t,e),n)},Bn.flatten=Xo,Bn.flattenDeep=function(t){return(null==t?0:t.length)?mr(t,h):[]},Bn.flattenDepth=function(t,e){return(null==t?0:t.length)?mr(t,e=e===i?1:ys(e)):[]},Bn.flip=function(t){return Zi(t,512)},Bn.flow=iu,Bn.flowRight=ou,Bn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Bn.functions=function(t){return null==t?[]:kr(t,Us(t))},Bn.functionsIn=function(t){return null==t?[]:kr(t,Is(t))},Bn.groupBy=Oa,Bn.initial=function(t){return(null==t?0:t.length)?oi(t,0,-1):[]},Bn.intersection=Jo,Bn.intersectionBy=Yo,Bn.intersectionWith=Qo,Bn.invert=Rs,Bn.invertBy=Ns,Bn.invokeMap=ka,Bn.iteratee=su,Bn.keyBy=Pa,Bn.keys=Us,Bn.keysIn=Is,Bn.map=Ea,Bn.mapKeys=function(t,e){var n={};return e=lo(e,3),Sr(t,(function(t,r,i){sr(n,e(t,r,i),t)})),n},Bn.mapValues=function(t,e){var n={};return e=lo(e,3),Sr(t,(function(t,r,i){sr(n,r,e(t,r,i))})),n},Bn.matches=function(t){return Br(lr(t,1))},Bn.matchesProperty=function(t,e){return Kr(t,lr(e,1))},Bn.memoize=Ha,Bn.merge=Ms,Bn.mergeWith=Hs,Bn.method=uu,Bn.methodOf=cu,Bn.mixin=lu,Bn.negate=La,Bn.nthArg=function(t){return t=ys(t),Qr((function(e){return zr(e,t)}))},Bn.omit=Ls,Bn.omitBy=function(t,e){return Fs(t,La(lo(e)))},Bn.once=function(t){return Ra(2,t)},Bn.orderBy=function(t,e,n,r){return null==t?[]:($a(e)||(e=null==e?[]:[e]),$a(n=r?i:n)||(n=null==n?[]:[n]),Wr(t,e,n))},Bn.over=pu,Bn.overArgs=Da,Bn.overEvery=hu,Bn.overSome=du,Bn.partial=Fa,Bn.partialRight=Ga,Bn.partition=Ta,Bn.pick=Ds,Bn.pickBy=Fs,Bn.property=gu,Bn.propertyOf=function(t){return function(e){return null==t?i:Pr(t,e)}},Bn.pull=ta,Bn.pullAll=ea,Bn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Xr(t,e,lo(n,2)):t},Bn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Xr(t,e,i,n):t},Bn.pullAt=na,Bn.range=vu,Bn.rangeRight=yu,Bn.rearg=Ba,Bn.reject=function(t,e){return($a(t)?Ce:br)(t,La(lo(e,3)))},Bn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=lo(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Vr(t,i),n},Bn.rest=function(t,e){if("function"!=typeof t)throw new Ct(o);return Qr(t,e=e===i?e:ys(e))},Bn.reverse=ra,Bn.sampleSize=function(t,e,n){return e=(n?So(t,e,n):e===i)?1:ys(e),($a(t)?tr:ti)(t,e)},Bn.set=function(t,e,n){return null==t?t:ei(t,e,n)},Bn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:ei(t,e,n,r)},Bn.shuffle=function(t){return($a(t)?er:ii)(t)},Bn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&So(t,e,n)?(e=0,n=r):(e=null==e?0:ys(e),n=n===i?r:ys(n)),oi(t,e,n)):[]},Bn.sortBy=Aa,Bn.sortedUniq=function(t){return t&&t.length?ci(t):[]},Bn.sortedUniqBy=function(t,e){return t&&t.length?ci(t,lo(e,2)):[]},Bn.split=function(t,e,n){return n&&"number"!=typeof n&&So(t,e,n)&&(e=n=i),(n=n===i?v:n>>>0)?(t=ws(t))&&("string"==typeof e||null!=e&&!us(e))&&!(e=fi(e))&&sn(t)?Oi(dn(t),0,n):t.split(e,n):[]},Bn.spread=function(t,e){if("function"!=typeof t)throw new Ct(o);return e=null==e?0:_n(ys(e),0),Qr((function(n){var r=n[e],i=Oi(n,0,e);return r&&Ue(i,r),Pe(t,this,i)}))},Bn.tail=function(t){var e=null==t?0:t.length;return e?oi(t,1,e):[]},Bn.take=function(t,e,n){return t&&t.length?oi(t,0,(e=n||e===i?1:ys(e))<0?0:e):[]},Bn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?oi(t,(e=r-(e=n||e===i?1:ys(e)))<0?0:e,r):[]},Bn.takeRightWhile=function(t,e){return t&&t.length?gi(t,lo(e,3),!1,!0):[]},Bn.takeWhile=function(t,e){return t&&t.length?gi(t,lo(e,3)):[]},Bn.tap=function(t,e){return e(t),t},Bn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Ct(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ua(t,e,{leading:r,maxWait:e,trailing:i})},Bn.thru=va,Bn.toArray=gs,Bn.toPairs=Gs,Bn.toPairsIn=Bs,Bn.toPath=function(t){return $a(t)?je(t,Fo):fs(t)?[t]:Ri(Do(ws(t)))},Bn.toPlainObject=_s,Bn.transform=function(t,e,n){var r=$a(t),i=r||Ya(t)||ps(t);if(e=lo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:rs(t)&&ts(o)?Kn($t(t)):{}}return(i?Te:Sr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Bn.unary=function(t){return Ca(t,1)},Bn.union=ia,Bn.unionBy=oa,Bn.unionWith=aa,Bn.uniq=function(t){return t&&t.length?pi(t):[]},Bn.uniqBy=function(t,e){return t&&t.length?pi(t,lo(e,2)):[]},Bn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?pi(t,i,e):[]},Bn.unset=function(t,e){return null==t||hi(t,e)},Bn.unzip=sa,Bn.unzipWith=ua,Bn.update=function(t,e,n){return null==t?t:di(t,e,_i(n))},Bn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:di(t,e,_i(n),r)},Bn.values=Ks,Bn.valuesIn=function(t){return null==t?[]:Qe(t,Is(t))},Bn.without=ca,Bn.words=tu,Bn.wrap=function(t,e){return Fa(_i(e),t)},Bn.xor=la,Bn.xorBy=fa,Bn.xorWith=pa,Bn.zip=ha,Bn.zipObject=function(t,e){return bi(t||[],e||[],rr)},Bn.zipObjectDeep=function(t,e){return bi(t||[],e||[],ei)},Bn.zipWith=da,Bn.entries=Gs,Bn.entriesIn=Bs,Bn.extend=Os,Bn.extendWith=ks,lu(Bn,Bn),Bn.add=_u,Bn.attempt=eu,Bn.camelCase=qs,Bn.capitalize=zs,Bn.ceil=wu,Bn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=ms(n))==n?n:0),e!==i&&(e=(e=ms(e))==e?e:0),cr(ms(t),e,n)},Bn.clone=function(t){return lr(t,4)},Bn.cloneDeep=function(t){return lr(t,5)},Bn.cloneDeepWith=function(t,e){return lr(t,5,e="function"==typeof e?e:i)},Bn.cloneWith=function(t,e){return lr(t,4,e="function"==typeof e?e:i)},Bn.conformsTo=function(t,e){return null==e||fr(t,e,Us(e))},Bn.deburr=Ws,Bn.defaultTo=function(t,e){return null==t||t!=t?e:t},Bn.divide=Su,Bn.endsWith=function(t,e,n){t=ws(t),e=fi(e);var r=t.length,o=n=n===i?r:cr(ys(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Bn.eq=Ka,Bn.escape=function(t){return(t=ws(t))&&Y.test(t)?t.replace(V,on):t},Bn.escapeRegExp=function(t){return(t=ws(t))&&ot.test(t)?t.replace(it,"\\$&"):t},Bn.every=function(t,e,n){var r=$a(t)?xe:vr;return n&&So(t,e,n)&&(e=i),r(t,lo(e,3))},Bn.find=ma,Bn.findIndex=Wo,Bn.findKey=function(t,e){return De(t,lo(e,3),Sr)},Bn.findLast=_a,Bn.findLastIndex=$o,Bn.findLastKey=function(t,e){return De(t,lo(e,3),Or)},Bn.floor=Ou,Bn.forEach=wa,Bn.forEachRight=Sa,Bn.forIn=function(t,e){return null==t?t:_r(t,lo(e,3),Is)},Bn.forInRight=function(t,e){return null==t?t:wr(t,lo(e,3),Is)},Bn.forOwn=function(t,e){return t&&Sr(t,lo(e,3))},Bn.forOwnRight=function(t,e){return t&&Or(t,lo(e,3))},Bn.get=xs,Bn.gt=qa,Bn.gte=za,Bn.has=function(t,e){return null!=t&&bo(t,e,xr)},Bn.hasIn=Cs,Bn.head=Vo,Bn.identity=au,Bn.includes=function(t,e,n,r){t=Va(t)?t:Ks(t),n=n&&!r?ys(n):0;var i=t.length;return n<0&&(n=_n(i+n,0)),ls(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ge(t,e,n)>-1},Bn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ys(n);return i<0&&(i=_n(r+i,0)),Ge(t,e,i)},Bn.inRange=function(t,e,n){return e=vs(e),n===i?(n=e,e=0):n=vs(n),function(t,e,n){return t>=wn(e,n)&&t<_n(e,n)}(t=ms(t),e,n)},Bn.invoke=js,Bn.isArguments=Wa,Bn.isArray=$a,Bn.isArrayBuffer=Xa,Bn.isArrayLike=Va,Bn.isArrayLikeObject=Ja,Bn.isBoolean=function(t){return!0===t||!1===t||is(t)&&Tr(t)==_},Bn.isBuffer=Ya,Bn.isDate=Qa,Bn.isElement=function(t){return is(t)&&1===t.nodeType&&!ss(t)},Bn.isEmpty=function(t){if(null==t)return!0;if(Va(t)&&($a(t)||"string"==typeof t||"function"==typeof t.splice||Ya(t)||ps(t)||Wa(t)))return!t.length;var e=yo(t);if(e==P||e==C)return!t.size;if(Eo(t))return!Lr(t).length;for(var n in t)if(Mt.call(t,n))return!1;return!0},Bn.isEqual=function(t,e){return Ur(t,e)},Bn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Ur(t,e,i,n):!!r},Bn.isError=Za,Bn.isFinite=function(t){return"number"==typeof t&&We(t)},Bn.isFunction=ts,Bn.isInteger=es,Bn.isLength=ns,Bn.isMap=os,Bn.isMatch=function(t,e){return t===e||Ir(t,e,po(e))},Bn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Ir(t,e,po(e),n)},Bn.isNaN=function(t){return as(t)&&t!=+t},Bn.isNative=function(t){if(Po(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mr(t)},Bn.isNil=function(t){return null==t},Bn.isNull=function(t){return null===t},Bn.isNumber=as,Bn.isObject=rs,Bn.isObjectLike=is,Bn.isPlainObject=ss,Bn.isRegExp=us,Bn.isSafeInteger=function(t){return es(t)&&t>=-9007199254740991&&t<=d},Bn.isSet=cs,Bn.isString=ls,Bn.isSymbol=fs,Bn.isTypedArray=ps,Bn.isUndefined=function(t){return t===i},Bn.isWeakMap=function(t){return is(t)&&yo(t)==j},Bn.isWeakSet=function(t){return is(t)&&"[object WeakSet]"==Tr(t)},Bn.join=function(t,e){return null==t?"":bn.call(t,e)},Bn.kebabCase=$s,Bn.last=Zo,Bn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ys(n))<0?_n(r+o,0):wn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Fe(t,Ke,o,!0)},Bn.lowerCase=Xs,Bn.lowerFirst=Vs,Bn.lt=hs,Bn.lte=ds,Bn.max=function(t){return t&&t.length?yr(t,au,Ar):i},Bn.maxBy=function(t,e){return t&&t.length?yr(t,lo(e,2),Ar):i},Bn.mean=function(t){return qe(t,au)},Bn.meanBy=function(t,e){return qe(t,lo(e,2))},Bn.min=function(t){return t&&t.length?yr(t,au,Fr):i},Bn.minBy=function(t,e){return t&&t.length?yr(t,lo(e,2),Fr):i},Bn.stubArray=bu,Bn.stubFalse=mu,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=Pu,Bn.nth=function(t,e){return t&&t.length?zr(t,ys(e)):i},Bn.noConflict=function(){return he._===this&&(he._=Gt),this},Bn.noop=fu,Bn.now=xa,Bn.pad=function(t,e,n){t=ws(t);var r=(e=ys(e))?hn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Wi(ye(i),n)+t+Wi(ge(i),n)},Bn.padEnd=function(t,e,n){t=ws(t);var r=(e=ys(e))?hn(t):0;return e&&r<e?t+Wi(e-r,n):t},Bn.padStart=function(t,e,n){t=ws(t);var r=(e=ys(e))?hn(t):0;return e&&r<e?Wi(e-r,n)+t:t},Bn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),On(ws(t).replace(at,""),e||0)},Bn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&So(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=vs(t),e===i?(e=t,t=0):e=vs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=kn();return wn(t+o*(e-t+ce("1e-"+((o+"").length-1))),e)}return Jr(t,e)},Bn.reduce=function(t,e,n){var r=$a(t)?Ie:$e,i=arguments.length<3;return r(t,lo(e,4),n,i,dr)},Bn.reduceRight=function(t,e,n){var r=$a(t)?Me:$e,i=arguments.length<3;return r(t,lo(e,4),n,i,gr)},Bn.repeat=function(t,e,n){return e=(n?So(t,e,n):e===i)?1:ys(e),Yr(ws(t),e)},Bn.replace=function(){var t=arguments,e=ws(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Bn.result=function(t,e,n){var r=-1,o=(e=wi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[Fo(e[r])];a===i&&(r=o,a=n),t=ts(a)?a.call(t):a}return t},Bn.round=Eu,Bn.runInContext=t,Bn.sample=function(t){return($a(t)?Zn:Zr)(t)},Bn.size=function(t){if(null==t)return 0;if(Va(t))return ls(t)?hn(t):t.length;var e=yo(t);return e==P||e==C?t.size:Lr(t).length},Bn.snakeCase=Js,Bn.some=function(t,e,n){var r=$a(t)?He:ai;return n&&So(t,e,n)&&(e=i),r(t,lo(e,3))},Bn.sortedIndex=function(t,e){return si(t,e)},Bn.sortedIndexBy=function(t,e,n){return ui(t,e,lo(n,2))},Bn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=si(t,e);if(r<n&&Ka(t[r],e))return r}return-1},Bn.sortedLastIndex=function(t,e){return si(t,e,!0)},Bn.sortedLastIndexBy=function(t,e,n){return ui(t,e,lo(n,2),!0)},Bn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=si(t,e,!0)-1;if(Ka(t[n],e))return n}return-1},Bn.startCase=Ys,Bn.startsWith=function(t,e,n){return t=ws(t),n=null==n?0:cr(ys(n),0,t.length),e=fi(e),t.slice(n,n+e.length)==e},Bn.subtract=Tu,Bn.sum=function(t){return t&&t.length?Xe(t,au):0},Bn.sumBy=function(t,e){return t&&t.length?Xe(t,lo(e,2)):0},Bn.template=function(t,e,n){var r=Bn.templateSettings;n&&So(t,e,n)&&(e=i),t=ws(t),e=ks({},e,r,to);var o,a,s=ks({},e.imports,r.imports,to),u=Us(s),c=Qe(s,u),l=0,f=e.interpolate||St,p="__p += '",h=At((e.escape||St).source+"|"+f.source+"|"+(f===tt?dt:St).source+"|"+(e.evaluate||St).source+"|$","g"),d="//# sourceURL="+(Mt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";t.replace(h,(function(e,n,r,i,s,u){return r||(r=i),p+=t.slice(l,u).replace(Ot,an),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),s&&(a=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),p+="';\n";var g=Mt.call(e,"variable")&&e.variable;if(g){if(pt.test(g))throw new kt("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(a?p.replace(z,""):p).replace(W,"$1").replace($,"$1;"),p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var v=eu((function(){return Pt(u,d+"return "+p).apply(i,c)}));if(v.source=p,Za(v))throw v;return v},Bn.times=function(t,e){if((t=ys(t))<1||t>d)return[];var n=v,r=wn(t,v);e=lo(e),t-=v;for(var i=Ve(r,e);++n<t;)e(n);return i},Bn.toFinite=vs,Bn.toInteger=ys,Bn.toLength=bs,Bn.toLower=function(t){return ws(t).toLowerCase()},Bn.toNumber=ms,Bn.toSafeInteger=function(t){return t?cr(ys(t),-9007199254740991,d):0===t?t:0},Bn.toString=ws,Bn.toUpper=function(t){return ws(t).toUpperCase()},Bn.trim=function(t,e,n){if((t=ws(t))&&(n||e===i))return Je(t);if(!t||!(e=fi(e)))return t;var r=dn(t),o=dn(e);return Oi(r,tn(r,o),en(r,o)+1).join("")},Bn.trimEnd=function(t,e,n){if((t=ws(t))&&(n||e===i))return t.slice(0,gn(t)+1);if(!t||!(e=fi(e)))return t;var r=dn(t);return Oi(r,0,en(r,dn(e))+1).join("")},Bn.trimStart=function(t,e,n){if((t=ws(t))&&(n||e===i))return t.replace(at,"");if(!t||!(e=fi(e)))return t;var r=dn(t);return Oi(r,tn(r,dn(e))).join("")},Bn.truncate=function(t,e){var n=30,r="...";if(rs(e)){var o="separator"in e?e.separator:o;n="length"in e?ys(e.length):n,r="omission"in e?fi(e.omission):r}var a=(t=ws(t)).length;if(sn(t)){var s=dn(t);a=s.length}if(n>=a)return t;var u=n-hn(r);if(u<1)return r;var c=s?Oi(s,0,u).join(""):t.slice(0,u);if(o===i)return c+r;if(s&&(u+=c.length-u),us(o)){if(t.slice(u).search(o)){var l,f=c;for(o.global||(o=At(o.source,ws(gt.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var p=l.index;c=c.slice(0,p===i?u:p)}}else if(t.indexOf(fi(o),u)!=u){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+r},Bn.unescape=function(t){return(t=ws(t))&&J.test(t)?t.replace(X,vn):t},Bn.uniqueId=function(t){var e=++Ht;return ws(t)+e},Bn.upperCase=Qs,Bn.upperFirst=Zs,Bn.each=wa,Bn.eachRight=Sa,Bn.first=Vo,lu(Bn,(ku={},Sr(Bn,(function(t,e){Mt.call(Bn.prototype,e)||(ku[e]=t)})),ku),{chain:!1}),Bn.VERSION="4.17.21",Te(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Bn[t].placeholder=Bn})),Te(["drop","take"],(function(t,e){Wn.prototype[t]=function(n){n=n===i?1:_n(ys(n),0);var r=this.__filtered__&&!e?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,v),type:t+(r.__dir__<0?"Right":"")}),r},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Te(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:lo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Te(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Te(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(au)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Qr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return Nr(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(La(lo(t)))},Wn.prototype.slice=function(t,e){t=ys(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Wn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ys(e))<0?n.dropRight(-e):n.take(e-t)),n)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(v)},Sr(Wn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Bn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Bn.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,u=e instanceof Wn,c=s[0],l=u||$a(e),f=function(t){var e=o.apply(Bn,Ue([t],s));return r&&p?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var p=this.__chain__,h=!!this.__actions__.length,d=a&&!p,g=u&&!h;if(!a&&l){e=g?e:new Wn(this);var v=t.apply(e,s);return v.__actions__.push({func:va,args:[f],thisArg:i}),new zn(v,p)}return d&&g?t.apply(this,s):(v=this.thru(f),d?r?v.value()[0]:v.value():v)})})),Te(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Rt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Bn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply($a(i)?i:[],t)}return this[n]((function(n){return e.apply($a(n)?n:[],t)}))}})),Sr(Wn.prototype,(function(t,e){var n=Bn[e];if(n){var r=n.name+"";Mt.call(jn,r)||(jn[r]=[]),jn[r].push({name:e,func:n})}})),jn[Bi(i,2).name]=[{name:"wrapper",func:i}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Ri(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ri(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ri(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=$a(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=wn(e,t+a);break;case"takeRight":t=_n(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,c=r?s:a-1,l=this.__iteratees__,f=l.length,p=0,h=wn(u,this.__takeCount__);if(!n||!r&&i==u&&h==u)return vi(t,this.__actions__);var d=[];t:for(;u--&&p<h;){for(var g=-1,v=t[c+=e];++g<f;){var y=l[g],b=y.iteratee,m=y.type,_=b(v);if(2==m)v=_;else if(!_){if(1==m)continue t;break t}}d[p++]=v}return d},Bn.prototype.at=ya,Bn.prototype.chain=function(){return ga(this)},Bn.prototype.commit=function(){return new zn(this.value(),this.__chain__)},Bn.prototype.next=function(){this.__values__===i&&(this.__values__=gs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Bn.prototype.plant=function(t){for(var e,n=this;n instanceof qn;){var r=Bo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Bn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:va,args:[ra],thisArg:i}),new zn(e,this.__chain__)}return this.thru(ra)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return vi(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,te&&(Bn.prototype[te]=function(){return this}),Bn}();he._=yn,(r=(function(){return yn}).call(e,n,e,t))===i||(t.exports=r)}).call(this)},5967:function(t){t.exports=function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};function r(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function i(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function o(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},c={exports:{}};!function(t){!function(e,n){var r=Math.pow(2,-24),i=Math.pow(2,32),o=Math.pow(2,53),a={encode:function(t){var e,r=new ArrayBuffer(256),a=new DataView(r),s=0;function u(t){for(var n=r.byteLength,i=s+t;n<i;)n*=2;if(n!==r.byteLength){var o=a;r=new ArrayBuffer(n),a=new DataView(r);for(var u=s+3>>2,c=0;c<u;++c)a.setUint32(4*c,o.getUint32(4*c))}return e=t,a}function c(){s+=e}function l(t){c(u(1).setUint8(s,t))}function f(t){for(var e=u(t.length),n=0;n<t.length;++n)e.setUint8(s+n,t[n]);c()}function p(t,e){e<24?l(t<<5|e):e<256?(l(t<<5|24),l(e)):e<65536?(l(t<<5|25),function(t){c(u(2).setUint16(s,t))}(e)):e<4294967296?(l(t<<5|26),function(t){c(u(4).setUint32(s,t))}(e)):(l(t<<5|27),function(t){var e=t%i,n=(t-e)/i,r=u(8);r.setUint32(s,n),r.setUint32(s+4,e),c()}(e))}if(function t(e){var r;if(!1===e)return l(244);if(!0===e)return l(245);if(null===e)return l(246);if(e===n)return l(247);switch(typeof e){case"number":if(Math.floor(e)===e){if(0<=e&&e<=o)return p(0,e);if(-o<=e&&e<0)return p(1,-(e+1))}return l(251),function(t){c(u(8).setFloat64(s,t))}(e);case"string":var i=[];for(r=0;r<e.length;++r){var a=e.charCodeAt(r);a<128?i.push(a):a<2048?(i.push(192|a>>6),i.push(128|63&a)):a<55296?(i.push(224|a>>12),i.push(128|a>>6&63),i.push(128|63&a)):(a=(1023&a)<<10,a|=1023&e.charCodeAt(++r),a+=65536,i.push(240|a>>18),i.push(128|a>>12&63),i.push(128|a>>6&63),i.push(128|63&a))}return p(3,i.length),f(i);default:var h;if(Array.isArray(e))for(p(4,h=e.length),r=0;r<h;++r)t(e[r]);else if(e instanceof Uint8Array)p(2,e.length),f(e);else{var d=Object.keys(e);for(p(5,h=d.length),r=0;r<h;++r){var g=d[r];t(g),t(e[g])}}}}(t),"slice"in r)return r.slice(0,s);for(var h=new ArrayBuffer(s),d=new DataView(h),g=0;g<s;++g)d.setUint8(g,a.getUint8(g));return h},decode:function(t,e,o){var a=new DataView(t),s=0;function u(t,e){return s+=e,t}function c(e){return u(new Uint8Array(t,s,e),e)}function l(){return u(a.getUint8(s),1)}function f(){return u(a.getUint16(s),2)}function p(){return u(a.getUint32(s),4)}function h(){return 255===a.getUint8(s)&&(s+=1,!0)}function d(t){if(t<24)return t;if(24===t)return l();if(25===t)return f();if(26===t)return p();if(27===t)return p()*i+p();if(31===t)return-1;throw"Invalid length encoding"}function g(t){var e=l();if(255===e)return-1;var n=d(31&e);if(n<0||e>>5!==t)throw"Invalid indefinite length element";return n}function v(t,e){for(var n=0;n<e;++n){var r=l();128&r&&(r<224?(r=(31&r)<<6|63&l(),e-=1):r<240?(r=(15&r)<<12|(63&l())<<6|63&l(),e-=2):(r=(15&r)<<18|(63&l())<<12|(63&l())<<6|63&l(),e-=3)),r<65536?t.push(r):(r-=65536,t.push(55296|r>>10),t.push(56320|1023&r))}}"function"!=typeof e&&(e=function(t){return t}),"function"!=typeof o&&(o=function(){return n});var y=function t(){var i,p,y=l(),b=y>>5,m=31&y;if(7===b)switch(m){case 25:return function(){var t=new ArrayBuffer(4),e=new DataView(t),n=f(),i=32768&n,o=31744&n,a=1023&n;if(31744===o)o=261120;else if(0!==o)o+=114688;else if(0!==a)return a*r;return e.setUint32(0,i<<16|o<<13|a<<13),e.getFloat32(0)}();case 26:return u(a.getFloat32(s),4);case 27:return u(a.getFloat64(s),8)}if((p=d(m))<0&&(b<2||6<b))throw"Invalid length";switch(b){case 0:return p;case 1:return-1-p;case 2:if(p<0){for(var _=[],w=0;(p=g(b))>=0;)w+=p,_.push(c(p));var S=new Uint8Array(w),O=0;for(i=0;i<_.length;++i)S.set(_[i],O),O+=_[i].length;return S}return c(p);case 3:var k=[];if(p<0)for(;(p=g(b))>=0;)v(k,p);else v(k,p);return String.fromCharCode.apply(null,k);case 4:var P;if(p<0)for(P=[];!h();)P.push(t());else for(P=new Array(p),i=0;i<p;++i)P[i]=t();return P;case 5:var E={};for(i=0;i<p||p<0&&!h();++i)E[t()]=t();return E;case 6:return e(t(),p);case 7:switch(p){case 20:return!1;case 21:return!0;case 22:return null;case 23:return n;default:return o(p)}}}();if(s!==t.byteLength)throw"Remaining bytes";return y}};t.exports?t.exports=a:e.CBOR||(e.CBOR=a)}(u)}(c);var l=c.exports,f={exports:{}};!function(t,e){!function(t){var e="0.1.0",n={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function r(){var t,e,n="";for(t=0;t<32;t++)e=16*Math.random()|0,8!==t&&12!==t&&16!==t&&20!==t||(n+="-"),n+=(12===t?4:16===t?3&e|8:e).toString(16);return n}function i(t,e){var r=n[e||"all"];return r&&r.test(t)||!1}r.isUUID=i,r.VERSION=e,t.uuid=r,t.isUUID=i}(e),null!==t&&(t.exports=e.uuid)}(f,f.exports);var p,h,d,g,v,y=f.exports,b=function(){return y.uuid?y.uuid():y()},m=function(){function t(t){var e,n,r,i=t.setup;if(this._PNSDKSuffix={},this.instanceId="pn-".concat(b()),this.secretKey=i.secretKey||i.secret_key,this.subscribeKey=i.subscribeKey||i.subscribe_key,this.publishKey=i.publishKey||i.publish_key,this.sdkName=i.sdkName,this.sdkFamily=i.sdkFamily,this.partnerId=i.partnerId,this.setAuthKey(i.authKey),this.setCipherKey(i.cipherKey),this.setFilterExpression(i.filterExpression),"string"!=typeof i.origin&&!Array.isArray(i.origin)&&void 0!==i.origin)throw new Error("Origin must be either undefined, a string or a list of strings.");this.origin=i.origin||Array.from({length:20},(function(t,e){return"ps".concat(e+1,".pndsn.com")})),this.secure=i.ssl||!1,this.restore=i.restore||!1,this.proxy=i.proxy,this.keepAlive=i.keepAlive,this.keepAliveSettings=i.keepAliveSettings,this.autoNetworkDetection=i.autoNetworkDetection||!1,this.dedupeOnSubscribe=i.dedupeOnSubscribe||!1,this.maximumCacheSize=i.maximumCacheSize||100,this.customEncrypt=i.customEncrypt,this.customDecrypt=i.customDecrypt,this.fileUploadPublishRetryLimit=null!==(e=i.fileUploadPublishRetryLimit)&&void 0!==e?e:5,this.useRandomIVs=null===(n=i.useRandomIVs)||void 0===n||n,this.enableSubscribeBeta=null!==(r=i.enableSubscribeBeta)&&void 0!==r&&r,"undefined"!=typeof location&&"https:"===location.protocol&&(this.secure=!0),this.logVerbosity=i.logVerbosity||!1,this.suppressLeaveEvents=i.suppressLeaveEvents||!1,this.announceFailedHeartbeats=i.announceFailedHeartbeats||!0,this.announceSuccessfulHeartbeats=i.announceSuccessfulHeartbeats||!1,this.useInstanceId=i.useInstanceId||!1,this.useRequestId=i.useRequestId||!1,this.requestMessageCountThreshold=i.requestMessageCountThreshold,this.setTransactionTimeout(i.transactionalRequestTimeout||15e3),this.setSubscribeTimeout(i.subscribeRequestTimeout||31e4),this.setSendBeaconConfig(i.useSendBeacon||!0),i.presenceTimeout?this.setPresenceTimeout(i.presenceTimeout):this._presenceTimeout=300,null!=i.heartbeatInterval&&this.setHeartbeatInterval(i.heartbeatInterval),this.setUUID(i.uuid)}return t.prototype.getAuthKey=function(){return this.authKey},t.prototype.setAuthKey=function(t){return this.authKey=t,this},t.prototype.setCipherKey=function(t){return this.cipherKey=t,this},t.prototype.getUUID=function(){return this.UUID},t.prototype.setUUID=function(t){if(!t||"string"!=typeof t||0===t.trim().length)throw new Error("Missing uuid parameter. Provide a valid string uuid");return this.UUID=t,this},t.prototype.getFilterExpression=function(){return this.filterExpression},t.prototype.setFilterExpression=function(t){return this.filterExpression=t,this},t.prototype.getPresenceTimeout=function(){return this._presenceTimeout},t.prototype.setPresenceTimeout=function(t){return t>=20?this._presenceTimeout=t:(this._presenceTimeout=20,console.log("WARNING: Presence timeout is less than the minimum. Using minimum value: ",this._presenceTimeout)),this.setHeartbeatInterval(this._presenceTimeout/2-1),this},t.prototype.setProxy=function(t){this.proxy=t},t.prototype.getHeartbeatInterval=function(){return this._heartbeatInterval},t.prototype.setHeartbeatInterval=function(t){return this._heartbeatInterval=t,this},t.prototype.getSubscribeTimeout=function(){return this._subscribeRequestTimeout},t.prototype.setSubscribeTimeout=function(t){return this._subscribeRequestTimeout=t,this},t.prototype.getTransactionTimeout=function(){return this._transactionalRequestTimeout},t.prototype.setTransactionTimeout=function(t){return this._transactionalRequestTimeout=t,this},t.prototype.isSendBeaconEnabled=function(){return this._useSendBeacon},t.prototype.setSendBeaconConfig=function(t){return this._useSendBeacon=t,this},t.prototype.getVersion=function(){return"7.0.1"},t.prototype._addPnsdkSuffix=function(t,e){this._PNSDKSuffix[t]=e},t.prototype._getPnsdkSuffix=function(t){var e=this;return Object.keys(this._PNSDKSuffix).reduce((function(n,r){return n+t+e._PNSDKSuffix[r]}),"")},t}(),_=_||function(t,e){var n={},r=n.lib={},i=function(){},o=r.Base={extend:function(t){i.prototype=this;var e=new i;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=r.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes;if(t=t.sigBytes,this.clamp(),r%4)for(var i=0;i<t;i++)e[r+i>>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535<n.length)for(i=0;i<t;i+=4)e[r+i>>>2]=n[i>>>2];else e.push.apply(e,n);return this.sigBytes+=t,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n=[],r=0;r<e;r+=4)n.push(4294967296*t.random()|0);return new a.init(n,e)}}),s=n.enc={},u=s.Hex={stringify:function(t){var e=t.words;t=t.sigBytes;for(var n=[],r=0;r<t;r++){var i=e[r>>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new a.init(n,e/2)}},c=s.Latin1={stringify:function(t){var e=t.words;t=t.sigBytes;for(var n=[],r=0;r<t;r++)n.push(String.fromCharCode(e[r>>>2]>>>24-r%4*8&255));return n.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new a.init(n,e)}},l=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,s=i/(4*o);if(e=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*o,i=t.min(4*e,i),e){for(var u=0;u<e;u+=o)this._doProcessBlock(r,u);u=r.splice(0,e),n.sigBytes-=i}return new a.init(u,i)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});r.Hasher=f.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new p.HMAC.init(t,n).finalize(e)}}});var p=n.algo={};return n}(Math);!function(t){for(var e=_,n=(i=e.lib).WordArray,r=i.Hasher,i=e.algo,o=[],a=[],s=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var l;t:{l=u;for(var f=t.sqrt(l),p=2;p<=f;p++)if(!(l%p)){l=!1;break t}l=!0}l&&(8>c&&(o[c]=s(t.pow(u,.5))),a[c]=s(t.pow(u,1/3)),c++),u++}var h=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=n[6],f=n[7],p=0;64>p;p++){if(16>p)h[p]=0|t[e+p];else{var d=h[p-15],g=h[p-2];h[p]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+h[p-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+h[p-16]}d=f+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+a[p]+h[p],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&o^i&o),f=l,l=c,c=u,u=s+d|0,s=o,o=i,i=r,r=d+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+f|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA256=r._createHelper(i),e.HmacSHA256=r._createHmacHelper(i)}(Math),h=(p=_).enc.Utf8,p.algo.HMAC=p.lib.Base.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=h.parse(e));var n=t.blockSize,r=4*n;e.sigBytes>r&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),o=this._iKey=e.clone(),a=i.words,s=o.words,u=0;u<n;u++)a[u]^=1549556828,s[u]^=909522486;i.sigBytes=o.sigBytes=r,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}}),g=(d=_).lib.WordArray,d.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp(),t=[];for(var i=0;i<n;i+=3)for(var o=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<n;a++)t.push(r.charAt(o>>>6*(3-a)&63));if(e=r.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var e=t.length,n=this._map;(r=n.charAt(64))&&-1!=(r=t.indexOf(r))&&(e=r);for(var r=[],i=0,o=0;o<e;o++)if(o%4){var a=n.indexOf(t.charAt(o-1))<<o%4*2,s=n.indexOf(t.charAt(o))>>>6-o%4*2;r[i>>>2]|=(a|s)<<24-i%4*8,i++}return g.create(r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(t){function e(t,e,n,r,i,o,a){return((t=t+(e&n|~e&r)+i+a)<<o|t>>>32-o)+e}function n(t,e,n,r,i,o,a){return((t=t+(e&r|n&~r)+i+a)<<o|t>>>32-o)+e}function r(t,e,n,r,i,o,a){return((t=t+(e^n^r)+i+a)<<o|t>>>32-o)+e}function i(t,e,n,r,i,o,a){return((t=t+(n^(e|~r))+i+a)<<o|t>>>32-o)+e}for(var o=_,a=(u=o.lib).WordArray,s=u.Hasher,u=o.algo,c=[],l=0;64>l;l++)c[l]=4294967296*t.abs(t.sin(l+1))|0;u=u.MD5=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,o){for(var a=0;16>a;a++){var s=t[u=o+a];t[u]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}a=this._hash.words;var u=t[o+0],l=(s=t[o+1],t[o+2]),f=t[o+3],p=t[o+4],h=t[o+5],d=t[o+6],g=t[o+7],v=t[o+8],y=t[o+9],b=t[o+10],m=t[o+11],_=t[o+12],w=t[o+13],S=t[o+14],O=t[o+15],k=e(k=a[0],T=a[1],E=a[2],P=a[3],u,7,c[0]),P=e(P,k,T,E,s,12,c[1]),E=e(E,P,k,T,l,17,c[2]),T=e(T,E,P,k,f,22,c[3]);k=e(k,T,E,P,p,7,c[4]),P=e(P,k,T,E,h,12,c[5]),E=e(E,P,k,T,d,17,c[6]),T=e(T,E,P,k,g,22,c[7]),k=e(k,T,E,P,v,7,c[8]),P=e(P,k,T,E,y,12,c[9]),E=e(E,P,k,T,b,17,c[10]),T=e(T,E,P,k,m,22,c[11]),k=e(k,T,E,P,_,7,c[12]),P=e(P,k,T,E,w,12,c[13]),E=e(E,P,k,T,S,17,c[14]),k=n(k,T=e(T,E,P,k,O,22,c[15]),E,P,s,5,c[16]),P=n(P,k,T,E,d,9,c[17]),E=n(E,P,k,T,m,14,c[18]),T=n(T,E,P,k,u,20,c[19]),k=n(k,T,E,P,h,5,c[20]),P=n(P,k,T,E,b,9,c[21]),E=n(E,P,k,T,O,14,c[22]),T=n(T,E,P,k,p,20,c[23]),k=n(k,T,E,P,y,5,c[24]),P=n(P,k,T,E,S,9,c[25]),E=n(E,P,k,T,f,14,c[26]),T=n(T,E,P,k,v,20,c[27]),k=n(k,T,E,P,w,5,c[28]),P=n(P,k,T,E,l,9,c[29]),E=n(E,P,k,T,g,14,c[30]),k=r(k,T=n(T,E,P,k,_,20,c[31]),E,P,h,4,c[32]),P=r(P,k,T,E,v,11,c[33]),E=r(E,P,k,T,m,16,c[34]),T=r(T,E,P,k,S,23,c[35]),k=r(k,T,E,P,s,4,c[36]),P=r(P,k,T,E,p,11,c[37]),E=r(E,P,k,T,g,16,c[38]),T=r(T,E,P,k,b,23,c[39]),k=r(k,T,E,P,w,4,c[40]),P=r(P,k,T,E,u,11,c[41]),E=r(E,P,k,T,f,16,c[42]),T=r(T,E,P,k,d,23,c[43]),k=r(k,T,E,P,y,4,c[44]),P=r(P,k,T,E,_,11,c[45]),E=r(E,P,k,T,O,16,c[46]),k=i(k,T=r(T,E,P,k,l,23,c[47]),E,P,u,6,c[48]),P=i(P,k,T,E,g,10,c[49]),E=i(E,P,k,T,S,15,c[50]),T=i(T,E,P,k,h,21,c[51]),k=i(k,T,E,P,_,6,c[52]),P=i(P,k,T,E,f,10,c[53]),E=i(E,P,k,T,b,15,c[54]),T=i(T,E,P,k,s,21,c[55]),k=i(k,T,E,P,v,6,c[56]),P=i(P,k,T,E,O,10,c[57]),E=i(E,P,k,T,d,15,c[58]),T=i(T,E,P,k,w,21,c[59]),k=i(k,T,E,P,p,6,c[60]),P=i(P,k,T,E,m,10,c[61]),E=i(E,P,k,T,l,15,c[62]),T=i(T,E,P,k,y,21,c[63]),a[0]=a[0]+k|0,a[1]=a[1]+T|0,a[2]=a[2]+E|0,a[3]=a[3]+P|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(n.length+1),this._process(),n=(e=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return e},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}}),o.MD5=s._createHelper(u),o.HmacMD5=s._createHmacHelper(u)}(Math),function(){var t,e=_,n=(t=e.lib).Base,r=t.WordArray,i=(t=e.algo).EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=(s=this.cfg).hasher.create(),i=r.create(),o=i.words,a=s.keySize,s=s.iterations;o.length<a;){u&&n.update(u);var u=n.update(t).finalize(e);n.reset();for(var c=1;c<s;c++)u=n.finalize(u),n.reset();i.concat(u)}return i.sigBytes=4*a,i}});e.EvpKDF=function(t,e,n){return i.create(n).compute(t,e)}}(),_.lib.Cipher||function(t){var e=(h=_).lib,n=e.Base,r=e.WordArray,i=e.BufferedBlockAlgorithm,o=h.enc.Base64,a=h.algo.EvpKDF,s=e.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,n,r){return("string"==typeof n?d:p).encrypt(t,e,n,r)},decrypt:function(e,n,r){return("string"==typeof n?d:p).decrypt(t,e,n,r)}}}});e.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=h.mode={},c=function(t,e,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)t[e+i]^=r[i]},l=(e.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();l.Encryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize;c.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)}}),l.Decryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize,i=t.slice(e,e+r);n.decryptBlock(t,e),c.call(this,t,e,r),this._prevBlock=i}}),u=u.CBC=l,l=(h.pad={}).Pkcs7={pad:function(t,e){for(var n,i=(n=(n=4*e)-t.sigBytes%n)<<24|n<<16|n<<8|n,o=[],a=0;a<n;a+=4)o.push(i);n=r.create(o,n),t.concat(n)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},e.BlockCipher=s.extend({cfg:s.cfg.extend({mode:u,padding:l}),reset:function(){s.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var f=e.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),p=(u=(h.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?r.create([1398893684,1701076831]).concat(t).concat(e):e).toString(o)},parse:function(t){var e=(t=o.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var n=r.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return f.create({ciphertext:t,salt:n})}},e.SerializableCipher=n.extend({cfg:n.extend({format:u}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r);return e=i.finalize(e),i=i.cfg,f.create({ciphertext:e,key:n,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),h=(h.kdf={}).OpenSSL={execute:function(t,e,n,i){return i||(i=r.random(8)),t=a.create({keySize:e+n}).compute(t,i),n=r.create(t.words.slice(e),4*n),t.sigBytes=4*e,f.create({key:t,iv:n,salt:i})}},d=e.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:h}),encrypt:function(t,e,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize),r.iv=n.iv,(t=p.encrypt.call(this,t,e,n.key,r)).mixIn(n),t},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),n=r.kdf.execute(n,t.keySize,t.ivSize,e.salt),r.iv=n.iv,p.decrypt.call(this,t,e,n.key,r)}})}(),function(){for(var t=_,e=t.lib.BlockCipher,n=t.algo,r=[],i=[],o=[],a=[],s=[],u=[],c=[],l=[],f=[],p=[],h=[],d=0;256>d;d++)h[d]=128>d?d<<1:d<<1^283;var g=0,v=0;for(d=0;256>d;d++){var y=(y=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&y^99;r[g]=y,i[y]=g;var b=h[g],m=h[b],w=h[m],S=257*h[y]^16843008*y;o[g]=S<<24|S>>>8,a[g]=S<<16|S>>>16,s[g]=S<<8|S>>>24,u[g]=S,S=16843009*w^65537*m^257*b^16843008*g,c[y]=S<<24|S>>>8,l[y]=S<<16|S>>>16,f[y]=S<<8|S>>>24,p[y]=S,g?(g=b^h[h[h[w^b]]],v^=h[h[v]]):g=v=1}var O=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=e.extend({_doReset:function(){for(var t=(n=this._key).words,e=n.sigBytes/4,n=4*((this._nRounds=e+6)+1),i=this._keySchedule=[],o=0;o<n;o++)if(o<e)i[o]=t[o];else{var a=i[o-1];o%e?6<e&&4==o%e&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=r[(a=a<<8|a>>>24)>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=O[o/e|0]<<24),i[o]=i[o-e]^a}for(t=this._invKeySchedule=[],e=0;e<n;e++)o=n-e,a=e%4?i[o]:i[o-4],t[e]=4>e||4>=o?a:c[r[a>>>24]]^l[r[a>>>16&255]]^f[r[a>>>8&255]]^p[r[255&a]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,a,s,u,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,c,l,f,p,i),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,o,a,s){for(var u=this._nRounds,c=t[e]^n[0],l=t[e+1]^n[1],f=t[e+2]^n[2],p=t[e+3]^n[3],h=4,d=1;d<u;d++){var g=r[c>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&p]^n[h++],v=r[l>>>24]^i[f>>>16&255]^o[p>>>8&255]^a[255&c]^n[h++],y=r[f>>>24]^i[p>>>16&255]^o[c>>>8&255]^a[255&l]^n[h++];p=r[p>>>24]^i[c>>>16&255]^o[l>>>8&255]^a[255&f]^n[h++],c=g,l=v,f=y}g=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^n[h++],v=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&c])^n[h++],y=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^n[h++],p=(s[p>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^n[h++],t[e]=g,t[e+1]=v,t[e+2]=y,t[e+3]=p},keySize:8}),t.AES=e._createHelper(n)}(),_.mode.ECB=((v=_.lib.BlockCipherMode.extend()).Encryptor=v.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),v.Decryptor=v.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),v);var w=_;function S(t){var e,n=[];for(e=0;e<t.length;e+=1)n[e/4|0]|=t[e]<<24-8*e;return w.lib.WordArray.create(n,t.length)}var O=function(){function t(t){var e=t.config;this._config=e,this._iv="0123456789012345",this._allowedKeyEncodings=["hex","utf8","base64","binary"],this._allowedKeyLengths=[128,256],this._allowedModes=["ecb","cbc"],this._defaultOptions={encryptKey:!0,keyEncoding:"utf8",keyLength:256,mode:"cbc"}}return t.prototype.HMACSHA256=function(t){return w.HmacSHA256(t,this._config.secretKey).toString(w.enc.Base64)},t.prototype.SHA256=function(t){return w.SHA256(t).toString(w.enc.Hex)},t.prototype._parseOptions=function(t){var e=t||{};return e.hasOwnProperty("encryptKey")||(e.encryptKey=this._defaultOptions.encryptKey),e.hasOwnProperty("keyEncoding")||(e.keyEncoding=this._defaultOptions.keyEncoding),e.hasOwnProperty("keyLength")||(e.keyLength=this._defaultOptions.keyLength),e.hasOwnProperty("mode")||(e.mode=this._defaultOptions.mode),-1===this._allowedKeyEncodings.indexOf(e.keyEncoding.toLowerCase())&&(e.keyEncoding=this._defaultOptions.keyEncoding),-1===this._allowedKeyLengths.indexOf(parseInt(e.keyLength,10))&&(e.keyLength=this._defaultOptions.keyLength),-1===this._allowedModes.indexOf(e.mode.toLowerCase())&&(e.mode=this._defaultOptions.mode),e},t.prototype._decodeKey=function(t,e){return"base64"===e.keyEncoding?w.enc.Base64.parse(t):"hex"===e.keyEncoding?w.enc.Hex.parse(t):t},t.prototype._getPaddedKey=function(t,e){return t=this._decodeKey(t,e),e.encryptKey?w.enc.Utf8.parse(this.SHA256(t).slice(0,32)):t},t.prototype._getMode=function(t){return"ecb"===t.mode?w.mode.ECB:w.mode.CBC},t.prototype._getIV=function(t){return"cbc"===t.mode?w.enc.Utf8.parse(this._iv):null},t.prototype._getRandomIV=function(){return w.lib.WordArray.random(16)},t.prototype.encrypt=function(t,e,n){return this._config.customEncrypt?this._config.customEncrypt(t):this.pnEncrypt(t,e,n)},t.prototype.decrypt=function(t,e,n){return this._config.customDecrypt?this._config.customDecrypt(t):this.pnDecrypt(t,e,n)},t.prototype.pnEncrypt=function(t,e,n){if(!e&&!this._config.cipherKey)return t;n=this._parseOptions(n);var r=this._getMode(n),i=this._getPaddedKey(e||this._config.cipherKey,n);if(this._config.useRandomIVs){var o=this._getRandomIV(),a=w.AES.encrypt(t,i,{iv:o,mode:r}).ciphertext;return o.clone().concat(a.clone()).toString(w.enc.Base64)}var s=this._getIV(n);return w.AES.encrypt(t,i,{iv:s,mode:r}).ciphertext.toString(w.enc.Base64)||t},t.prototype.pnDecrypt=function(t,e,n){if(!e&&!this._config.cipherKey)return t;n=this._parseOptions(n);var r=this._getMode(n),i=this._getPaddedKey(e||this._config.cipherKey,n);if(this._config.useRandomIVs){var o=S((u=Buffer.from(t,"base64")).slice(0,16)),a=S(u.slice(16));try{var s=w.AES.decrypt({ciphertext:a},i,{iv:o,mode:r}).toString(w.enc.Utf8);return JSON.parse(s)}catch(t){return null}}else{o=this._getIV(n);try{var u=w.enc.Base64.parse(t);return s=w.AES.decrypt({ciphertext:u},i,{iv:o,mode:r}).toString(w.enc.Utf8),JSON.parse(s)}catch(t){return null}}},t}(),k=function(){function t(t){var e=t.timeEndpoint;this._timeEndpoint=e}return t.prototype.onReconnection=function(t){this._reconnectionCallback=t},t.prototype.startPolling=function(){this._timeTimer=setInterval(this._performTimeLoop.bind(this),3e3)},t.prototype.stopPolling=function(){clearInterval(this._timeTimer)},t.prototype._performTimeLoop=function(){var t=this;this._timeEndpoint((function(e){e.error||(clearInterval(t._timeTimer),t._reconnectionCallback())}))},t}(),P=function(){function t(t){var e=t.config;this.hashHistory=[],this._config=e}return t.prototype.getKey=function(t){var e=function(t){var e=0;if(0===t.length)return e;for(var n=0;n<t.length;n+=1)e=(e<<5)-e+t.charCodeAt(n),e&=e;return e}(JSON.stringify(t.payload)).toString(),n=t.publishMetaData.publishTimetoken;return"".concat(n,"-").concat(e)},t.prototype.isDuplicate=function(t){return this.hashHistory.includes(this.getKey(t))},t.prototype.addEntry=function(t){this.hashHistory.length>=this._config.maximumCacheSize&&this.hashHistory.shift(),this.hashHistory.push(this.getKey(t))},t.prototype.clearHistory=function(){this.hashHistory=[]},t}();function E(t){return encodeURIComponent(t).replace(/[!~*'()]/g,(function(t){return"%".concat(t.charCodeAt(0).toString(16).toUpperCase())}))}function T(t){return function(t){var e=[];return Object.keys(t).forEach((function(t){return e.push(t)})),e}(t).sort()}var A={signPamFromParams:function(t){return T(t).map((function(e){return"".concat(e,"=").concat(E(t[e]))})).join("&")},endsWith:function(t,e){return-1!==t.indexOf(e,this.length-e.length)},createPromise:function(){var t,e;return{promise:new Promise((function(n,r){t=n,e=r})),reject:e,fulfill:t}},encodeString:E},x={PNNetworkUpCategory:"PNNetworkUpCategory",PNNetworkDownCategory:"PNNetworkDownCategory",PNNetworkIssuesCategory:"PNNetworkIssuesCategory",PNTimeoutCategory:"PNTimeoutCategory",PNBadRequestCategory:"PNBadRequestCategory",PNAccessDeniedCategory:"PNAccessDeniedCategory",PNUnknownCategory:"PNUnknownCategory",PNReconnectedCategory:"PNReconnectedCategory",PNConnectedCategory:"PNConnectedCategory",PNRequestMessageCountExceededCategory:"PNRequestMessageCountExceededCategory"},C=function(){function t(t){var e=t.subscribeEndpoint,n=t.leaveEndpoint,r=t.heartbeatEndpoint,i=t.setStateEndpoint,o=t.timeEndpoint,a=t.getFileUrl,s=t.config,u=t.crypto,c=t.listenerManager;this._listenerManager=c,this._config=s,this._leaveEndpoint=n,this._heartbeatEndpoint=r,this._setStateEndpoint=i,this._subscribeEndpoint=e,this._getFileUrl=a,this._crypto=u,this._channels={},this._presenceChannels={},this._heartbeatChannels={},this._heartbeatChannelGroups={},this._channelGroups={},this._presenceChannelGroups={},this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[],this._currentTimetoken=0,this._lastTimetoken=0,this._storedTimetoken=null,this._subscriptionStatusAnnounced=!1,this._isOnline=!0,this._reconnectionManager=new k({timeEndpoint:o}),this._dedupingManager=new P({config:s})}return t.prototype.adaptStateChange=function(t,e){var n=this,r=t.state,i=t.channels,o=void 0===i?[]:i,a=t.channelGroups,s=void 0===a?[]:a;return o.forEach((function(t){t in n._channels&&(n._channels[t].state=r)})),s.forEach((function(t){t in n._channelGroups&&(n._channelGroups[t].state=r)})),this._setStateEndpoint({state:r,channels:o,channelGroups:s},e)},t.prototype.adaptPresenceChange=function(t){var e=this,n=t.connected,r=t.channels,i=void 0===r?[]:r,o=t.channelGroups,a=void 0===o?[]:o;n?(i.forEach((function(t){e._heartbeatChannels[t]={state:{}}})),a.forEach((function(t){e._heartbeatChannelGroups[t]={state:{}}}))):(i.forEach((function(t){t in e._heartbeatChannels&&delete e._heartbeatChannels[t]})),a.forEach((function(t){t in e._heartbeatChannelGroups&&delete e._heartbeatChannelGroups[t]})),!1===this._config.suppressLeaveEvents&&this._leaveEndpoint({channels:i,channelGroups:a},(function(t){e._listenerManager.announceStatus(t)}))),this.reconnect()},t.prototype.adaptSubscribeChange=function(t){var e=this,n=t.timetoken,r=t.channels,i=void 0===r?[]:r,o=t.channelGroups,a=void 0===o?[]:o,s=t.withPresence,u=void 0!==s&&s,c=t.withHeartbeats,l=void 0!==c&&c;this._config.subscribeKey&&""!==this._config.subscribeKey?(n&&(this._lastTimetoken=this._currentTimetoken,this._currentTimetoken=n),"0"!==this._currentTimetoken&&0!==this._currentTimetoken&&(this._storedTimetoken=this._currentTimetoken,this._currentTimetoken=0),i.forEach((function(t){e._channels[t]={state:{}},u&&(e._presenceChannels[t]={}),(l||e._config.getHeartbeatInterval())&&(e._heartbeatChannels[t]={}),e._pendingChannelSubscriptions.push(t)})),a.forEach((function(t){e._channelGroups[t]={state:{}},u&&(e._presenceChannelGroups[t]={}),(l||e._config.getHeartbeatInterval())&&(e._heartbeatChannelGroups[t]={}),e._pendingChannelGroupSubscriptions.push(t)})),this._subscriptionStatusAnnounced=!1,this.reconnect()):console&&console.log&&console.log("subscribe key missing; aborting subscribe")},t.prototype.adaptUnsubscribeChange=function(t,e){var n=this,r=t.channels,i=void 0===r?[]:r,o=t.channelGroups,a=void 0===o?[]:o,s=[],u=[];i.forEach((function(t){t in n._channels&&(delete n._channels[t],s.push(t),t in n._heartbeatChannels&&delete n._heartbeatChannels[t]),t in n._presenceChannels&&(delete n._presenceChannels[t],s.push(t))})),a.forEach((function(t){t in n._channelGroups&&(delete n._channelGroups[t],u.push(t),t in n._heartbeatChannelGroups&&delete n._heartbeatChannelGroups[t]),t in n._presenceChannelGroups&&(delete n._presenceChannelGroups[t],u.push(t))})),0===s.length&&0===u.length||(!1!==this._config.suppressLeaveEvents||e||this._leaveEndpoint({channels:s,channelGroups:u},(function(t){t.affectedChannels=s,t.affectedChannelGroups=u,t.currentTimetoken=n._currentTimetoken,t.lastTimetoken=n._lastTimetoken,n._listenerManager.announceStatus(t)})),0===Object.keys(this._channels).length&&0===Object.keys(this._presenceChannels).length&&0===Object.keys(this._channelGroups).length&&0===Object.keys(this._presenceChannelGroups).length&&(this._lastTimetoken=0,this._currentTimetoken=0,this._storedTimetoken=null,this._region=null,this._reconnectionManager.stopPolling()),this.reconnect())},t.prototype.unsubscribeAll=function(t){this.adaptUnsubscribeChange({channels:this.getSubscribedChannels(),channelGroups:this.getSubscribedChannelGroups()},t)},t.prototype.getHeartbeatChannels=function(){return Object.keys(this._heartbeatChannels)},t.prototype.getHeartbeatChannelGroups=function(){return Object.keys(this._heartbeatChannelGroups)},t.prototype.getSubscribedChannels=function(){return Object.keys(this._channels)},t.prototype.getSubscribedChannelGroups=function(){return Object.keys(this._channelGroups)},t.prototype.reconnect=function(){this._startSubscribeLoop(),this._registerHeartbeatTimer()},t.prototype.disconnect=function(){this._stopSubscribeLoop(),this._stopHeartbeatTimer(),this._reconnectionManager.stopPolling()},t.prototype._registerHeartbeatTimer=function(){this._stopHeartbeatTimer(),0!==this._config.getHeartbeatInterval()&&void 0!==this._config.getHeartbeatInterval()&&(this._performHeartbeatLoop(),this._heartbeatTimer=setInterval(this._performHeartbeatLoop.bind(this),1e3*this._config.getHeartbeatInterval()))},t.prototype._stopHeartbeatTimer=function(){this._heartbeatTimer&&(clearInterval(this._heartbeatTimer),this._heartbeatTimer=null)},t.prototype._performHeartbeatLoop=function(){var t=this,e=this.getHeartbeatChannels(),n=this.getHeartbeatChannelGroups(),r={};0===e.length&&0===n.length||(this.getSubscribedChannels().forEach((function(e){var n=t._channels[e].state;Object.keys(n).length&&(r[e]=n)})),this.getSubscribedChannelGroups().forEach((function(e){var n=t._channelGroups[e].state;Object.keys(n).length&&(r[e]=n)})),this._heartbeatEndpoint({channels:e,channelGroups:n,state:r},(function(e){e.error&&t._config.announceFailedHeartbeats&&t._listenerManager.announceStatus(e),e.error&&t._config.autoNetworkDetection&&t._isOnline&&(t._isOnline=!1,t.disconnect(),t._listenerManager.announceNetworkDown(),t.reconnect()),!e.error&&t._config.announceSuccessfulHeartbeats&&t._listenerManager.announceStatus(e)}).bind(this)))},t.prototype._startSubscribeLoop=function(){var t=this;this._stopSubscribeLoop();var e={},n=[],r=[];if(Object.keys(this._channels).forEach((function(r){var i=t._channels[r].state;Object.keys(i).length&&(e[r]=i),n.push(r)})),Object.keys(this._presenceChannels).forEach((function(t){n.push("".concat(t,"-pnpres"))})),Object.keys(this._channelGroups).forEach((function(n){var i=t._channelGroups[n].state;Object.keys(i).length&&(e[n]=i),r.push(n)})),Object.keys(this._presenceChannelGroups).forEach((function(t){r.push("".concat(t,"-pnpres"))})),0!==n.length||0!==r.length){var i={channels:n,channelGroups:r,state:e,timetoken:this._currentTimetoken,filterExpression:this._config.filterExpression,region:this._region};this._subscribeCall=this._subscribeEndpoint(i,this._processSubscribeResponse.bind(this))}},t.prototype._processSubscribeResponse=function(t,e){var n=this;if(t.error){if(t.errorData&&"Aborted"===t.errorData.message)return;t.category===x.PNTimeoutCategory?this._startSubscribeLoop():t.category===x.PNNetworkIssuesCategory?(this.disconnect(),t.error&&this._config.autoNetworkDetection&&this._isOnline&&(this._isOnline=!1,this._listenerManager.announceNetworkDown()),this._reconnectionManager.onReconnection((function(){n._config.autoNetworkDetection&&!n._isOnline&&(n._isOnline=!0,n._listenerManager.announceNetworkUp()),n.reconnect(),n._subscriptionStatusAnnounced=!0;var e={category:x.PNReconnectedCategory,operation:t.operation,lastTimetoken:n._lastTimetoken,currentTimetoken:n._currentTimetoken};n._listenerManager.announceStatus(e)})),this._reconnectionManager.startPolling(),this._listenerManager.announceStatus(t)):t.category===x.PNBadRequestCategory?(this._stopHeartbeatTimer(),this._listenerManager.announceStatus(t)):this._listenerManager.announceStatus(t)}else{if(this._storedTimetoken?(this._currentTimetoken=this._storedTimetoken,this._storedTimetoken=null):(this._lastTimetoken=this._currentTimetoken,this._currentTimetoken=e.metadata.timetoken),!this._subscriptionStatusAnnounced){var r={};r.category=x.PNConnectedCategory,r.operation=t.operation,r.affectedChannels=this._pendingChannelSubscriptions,r.subscribedChannels=this.getSubscribedChannels(),r.affectedChannelGroups=this._pendingChannelGroupSubscriptions,r.lastTimetoken=this._lastTimetoken,r.currentTimetoken=this._currentTimetoken,this._subscriptionStatusAnnounced=!0,this._listenerManager.announceStatus(r),this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[]}var i=e.messages||[],o=this._config,a=o.requestMessageCountThreshold,s=o.dedupeOnSubscribe;if(a&&i.length>=a){var u={};u.category=x.PNRequestMessageCountExceededCategory,u.operation=t.operation,this._listenerManager.announceStatus(u)}i.forEach((function(t){var e=t.channel,r=t.subscriptionMatch,i=t.publishMetaData;if(e===r&&(r=null),s){if(n._dedupingManager.isDuplicate(t))return;n._dedupingManager.addEntry(t)}if(A.endsWith(t.channel,"-pnpres"))(u={channel:null,subscription:null}).actualChannel=null!=r?e:null,u.subscribedChannel=null!=r?r:e,e&&(u.channel=e.substring(0,e.lastIndexOf("-pnpres"))),r&&(u.subscription=r.substring(0,r.lastIndexOf("-pnpres"))),u.action=t.payload.action,u.state=t.payload.data,u.timetoken=i.publishTimetoken,u.occupancy=t.payload.occupancy,u.uuid=t.payload.uuid,u.timestamp=t.payload.timestamp,t.payload.join&&(u.join=t.payload.join),t.payload.leave&&(u.leave=t.payload.leave),t.payload.timeout&&(u.timeout=t.payload.timeout),n._listenerManager.announcePresence(u);else if(1===t.messageType)(u={channel:null,subscription:null}).channel=e,u.subscription=r,u.timetoken=i.publishTimetoken,u.publisher=t.issuingClientId,t.userMetadata&&(u.userMetadata=t.userMetadata),u.message=t.payload,n._listenerManager.announceSignal(u);else if(2===t.messageType)(u={channel:null,subscription:null}).channel=e,u.subscription=r,u.timetoken=i.publishTimetoken,u.publisher=t.issuingClientId,t.userMetadata&&(u.userMetadata=t.userMetadata),u.message={event:t.payload.event,type:t.payload.type,data:t.payload.data},n._listenerManager.announceObjects(u),"user"===t.payload.type?n._listenerManager.announceUser(u):"space"===t.payload.type?n._listenerManager.announceSpace(u):"membership"===t.payload.type&&n._listenerManager.announceMembership(u);else if(3===t.messageType)(u={}).channel=e,u.subscription=r,u.timetoken=i.publishTimetoken,u.publisher=t.issuingClientId,u.data={messageTimetoken:t.payload.data.messageTimetoken,actionTimetoken:t.payload.data.actionTimetoken,type:t.payload.data.type,uuid:t.issuingClientId,value:t.payload.data.value},u.event=t.payload.event,n._listenerManager.announceMessageAction(u);else if(4===t.messageType){(u={}).channel=e,u.subscription=r,u.timetoken=i.publishTimetoken,u.publisher=t.issuingClientId;var o=t.payload;if(n._config.cipherKey){var a=n._crypto.decrypt(t.payload);"object"==typeof a&&null!==a&&(o=a)}t.userMetadata&&(u.userMetadata=t.userMetadata),u.message=o.message,u.file={id:o.file.id,name:o.file.name,url:n._getFileUrl({id:o.file.id,name:o.file.name,channel:e})},n._listenerManager.announceFile(u)}else{var u;(u={channel:null,subscription:null}).actualChannel=null!=r?e:null,u.subscribedChannel=null!=r?r:e,u.channel=e,u.subscription=r,u.timetoken=i.publishTimetoken,u.publisher=t.issuingClientId,t.userMetadata&&(u.userMetadata=t.userMetadata),n._config.cipherKey?u.message=n._crypto.decrypt(t.payload):u.message=t.payload,n._listenerManager.announceMessage(u)}})),this._region=e.metadata.region,this._startSubscribeLoop()}},t.prototype._stopSubscribeLoop=function(){this._subscribeCall&&("function"==typeof this._subscribeCall.abort&&this._subscribeCall.abort(),this._subscribeCall=null)},t}(),R={PNTimeOperation:"PNTimeOperation",PNHistoryOperation:"PNHistoryOperation",PNDeleteMessagesOperation:"PNDeleteMessagesOperation",PNFetchMessagesOperation:"PNFetchMessagesOperation",PNMessageCounts:"PNMessageCountsOperation",PNSubscribeOperation:"PNSubscribeOperation",PNUnsubscribeOperation:"PNUnsubscribeOperation",PNPublishOperation:"PNPublishOperation",PNSignalOperation:"PNSignalOperation",PNAddMessageActionOperation:"PNAddActionOperation",PNRemoveMessageActionOperation:"PNRemoveMessageActionOperation",PNGetMessageActionsOperation:"PNGetMessageActionsOperation",PNCreateUserOperation:"PNCreateUserOperation",PNUpdateUserOperation:"PNUpdateUserOperation",PNDeleteUserOperation:"PNDeleteUserOperation",PNGetUserOperation:"PNGetUsersOperation",PNGetUsersOperation:"PNGetUsersOperation",PNCreateSpaceOperation:"PNCreateSpaceOperation",PNUpdateSpaceOperation:"PNUpdateSpaceOperation",PNDeleteSpaceOperation:"PNDeleteSpaceOperation",PNGetSpaceOperation:"PNGetSpacesOperation",PNGetSpacesOperation:"PNGetSpacesOperation",PNGetMembersOperation:"PNGetMembersOperation",PNUpdateMembersOperation:"PNUpdateMembersOperation",PNGetMembershipsOperation:"PNGetMembershipsOperation",PNUpdateMembershipsOperation:"PNUpdateMembershipsOperation",PNListFilesOperation:"PNListFilesOperation",PNGenerateUploadUrlOperation:"PNGenerateUploadUrlOperation",PNPublishFileOperation:"PNPublishFileOperation",PNGetFileUrlOperation:"PNGetFileUrlOperation",PNDownloadFileOperation:"PNDownloadFileOperation",PNGetAllUUIDMetadataOperation:"PNGetAllUUIDMetadataOperation",PNGetUUIDMetadataOperation:"PNGetUUIDMetadataOperation",PNSetUUIDMetadataOperation:"PNSetUUIDMetadataOperation",PNRemoveUUIDMetadataOperation:"PNRemoveUUIDMetadataOperation",PNGetAllChannelMetadataOperation:"PNGetAllChannelMetadataOperation",PNGetChannelMetadataOperation:"PNGetChannelMetadataOperation",PNSetChannelMetadataOperation:"PNSetChannelMetadataOperation",PNRemoveChannelMetadataOperation:"PNRemoveChannelMetadataOperation",PNSetMembersOperation:"PNSetMembersOperation",PNSetMembershipsOperation:"PNSetMembershipsOperation",PNPushNotificationEnabledChannelsOperation:"PNPushNotificationEnabledChannelsOperation",PNRemoveAllPushNotificationsOperation:"PNRemoveAllPushNotificationsOperation",PNWhereNowOperation:"PNWhereNowOperation",PNSetStateOperation:"PNSetStateOperation",PNHereNowOperation:"PNHereNowOperation",PNGetStateOperation:"PNGetStateOperation",PNHeartbeatOperation:"PNHeartbeatOperation",PNChannelGroupsOperation:"PNChannelGroupsOperation",PNRemoveGroupOperation:"PNRemoveGroupOperation",PNChannelsForGroupOperation:"PNChannelsForGroupOperation",PNAddChannelsToGroupOperation:"PNAddChannelsToGroupOperation",PNRemoveChannelsFromGroupOperation:"PNRemoveChannelsFromGroupOperation",PNAccessManagerGrant:"PNAccessManagerGrant",PNAccessManagerGrantToken:"PNAccessManagerGrantToken",PNAccessManagerAudit:"PNAccessManagerAudit",PNAccessManagerRevokeToken:"PNAccessManagerRevokeToken",PNHandshakeOperation:"PNHandshakeOperation",PNReceiveMessagesOperation:"PNReceiveMessagesOperation"},N=function(){function t(t){this._maximumSamplesCount=100,this._trackedLatencies={},this._latencies={},this._maximumSamplesCount=t.maximumSamplesCount||this._maximumSamplesCount}return t.prototype.operationsLatencyForRequest=function(){var t=this,e={};return Object.keys(this._latencies).forEach((function(n){var r=t._latencies[n],i=t._averageLatency(r);i>0&&(e["l_".concat(n)]=i)})),e},t.prototype.startLatencyMeasure=function(t,e){t!==R.PNSubscribeOperation&&e&&(this._trackedLatencies[e]=Date.now())},t.prototype.stopLatencyMeasure=function(t,e){if(t!==R.PNSubscribeOperation&&e){var n=this._endpointName(t),r=this._latencies[n],i=this._trackedLatencies[e];r||(this._latencies[n]=[],r=this._latencies[n]),r.push(Date.now()-i),r.length>this._maximumSamplesCount&&r.splice(0,r.length-this._maximumSamplesCount),delete this._trackedLatencies[e]}},t.prototype._averageLatency=function(t){return Math.floor(t.reduce((function(t,e){return t+e}),0)/t.length)},t.prototype._endpointName=function(t){var e=null;switch(t){case R.PNPublishOperation:e="pub";break;case R.PNSignalOperation:e="sig";break;case R.PNHistoryOperation:case R.PNFetchMessagesOperation:case R.PNDeleteMessagesOperation:case R.PNMessageCounts:e="hist";break;case R.PNUnsubscribeOperation:case R.PNWhereNowOperation:case R.PNHereNowOperation:case R.PNHeartbeatOperation:case R.PNSetStateOperation:case R.PNGetStateOperation:e="pres";break;case R.PNAddChannelsToGroupOperation:case R.PNRemoveChannelsFromGroupOperation:case R.PNChannelGroupsOperation:case R.PNRemoveGroupOperation:case R.PNChannelsForGroupOperation:e="cg";break;case R.PNPushNotificationEnabledChannelsOperation:case R.PNRemoveAllPushNotificationsOperation:e="push";break;case R.PNCreateUserOperation:case R.PNUpdateUserOperation:case R.PNDeleteUserOperation:case R.PNGetUserOperation:case R.PNGetUsersOperation:case R.PNCreateSpaceOperation:case R.PNUpdateSpaceOperation:case R.PNDeleteSpaceOperation:case R.PNGetSpaceOperation:case R.PNGetSpacesOperation:case R.PNGetMembersOperation:case R.PNUpdateMembersOperation:case R.PNGetMembershipsOperation:case R.PNUpdateMembershipsOperation:e="obj";break;case R.PNAddMessageActionOperation:case R.PNRemoveMessageActionOperation:case R.PNGetMessageActionsOperation:e="msga";break;case R.PNAccessManagerGrant:case R.PNAccessManagerAudit:e="pam";break;case R.PNAccessManagerGrantToken:case R.PNAccessManagerRevokeToken:e="pamv3";break;default:e="time"}return e},t}(),j=function(){function t(t,e,n){this._payload=t,this._setDefaultPayloadStructure(),this.title=e,this.body=n}return Object.defineProperty(t.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{set:function(t){this._title=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subtitle",{set:function(t){this._subtitle=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"body",{set:function(t){this._body=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"badge",{set:function(t){this._badge=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sound",{set:function(t){this._sound=t},enumerable:!1,configurable:!0}),t.prototype._setDefaultPayloadStructure=function(){},t.prototype.toObject=function(){return{}},t}(),U=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),Object.defineProperty(r.prototype,"configurations",{set:function(t){t&&t.length&&(this._configurations=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"notification",{get:function(){return this._payload.aps},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"title",{get:function(){return this._title},set:function(t){t&&t.length&&(this._payload.aps.alert.title=t,this._title=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"subtitle",{get:function(){return this._subtitle},set:function(t){t&&t.length&&(this._payload.aps.alert.subtitle=t,this._subtitle=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"body",{get:function(){return this._body},set:function(t){t&&t.length&&(this._payload.aps.alert.body=t,this._body=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"badge",{get:function(){return this._badge},set:function(t){null!=t&&(this._payload.aps.badge=t,this._badge=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"sound",{get:function(){return this._sound},set:function(t){t&&t.length&&(this._payload.aps.sound=t,this._sound=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"silent",{set:function(t){this._isSilent=t},enumerable:!1,configurable:!0}),r.prototype._setDefaultPayloadStructure=function(){this._payload.aps={alert:{}}},r.prototype.toObject=function(){var t=this,e=n({},this._payload),r=e.aps,i=r.alert;if(this._isSilent&&(r["content-available"]=1),"apns2"===this._apnsPushType){if(!this._configurations||!this._configurations.length)throw new ReferenceError("APNS2 configuration is missing");var o=[];this._configurations.forEach((function(e){o.push(t._objectFromAPNS2Configuration(e))})),o.length&&(e.pn_push=o)}return i&&Object.keys(i).length||delete r.alert,this._isSilent&&(delete r.alert,delete r.badge,delete r.sound,i={}),this._isSilent||Object.keys(i).length?e:null},r.prototype._objectFromAPNS2Configuration=function(t){var e=this;if(!t.targets||!t.targets.length)throw new ReferenceError("At least one APNS2 target should be provided");var n=[];t.targets.forEach((function(t){n.push(e._objectFromAPNSTarget(t))}));var r=t.collapseId,i=t.expirationDate,o={auth_method:"token",targets:n,version:"v2"};return r&&r.length&&(o.collapse_id=r),i&&(o.expiration=i.toISOString()),o},r.prototype._objectFromAPNSTarget=function(t){if(!t.topic||!t.topic.length)throw new TypeError("Target 'topic' undefined.");var e=t.topic,n=t.environment,r=void 0===n?"development":n,i=t.excludedDevices,o=void 0===i?[]:i,a={topic:e,environment:r};return o.length&&(a.excluded_devices=o),a},r}(j),I=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),Object.defineProperty(r.prototype,"backContent",{get:function(){return this._backContent},set:function(t){t&&t.length&&(this._payload.back_content=t,this._backContent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"backTitle",{get:function(){return this._backTitle},set:function(t){t&&t.length&&(this._payload.back_title=t,this._backTitle=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"count",{get:function(){return this._count},set:function(t){null!=t&&(this._payload.count=t,this._count=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"title",{get:function(){return this._title},set:function(t){t&&t.length&&(this._payload.title=t,this._title=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"type",{get:function(){return this._type},set:function(t){t&&t.length&&(this._payload.type=t,this._type=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"subtitle",{get:function(){return this.backTitle},set:function(t){this.backTitle=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"body",{get:function(){return this.backContent},set:function(t){this.backContent=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"badge",{get:function(){return this.count},set:function(t){this.count=t},enumerable:!1,configurable:!0}),r.prototype.toObject=function(){return Object.keys(this._payload).length?n({},this._payload):null},r}(j),M=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),Object.defineProperty(r.prototype,"notification",{get:function(){return this._payload.notification},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"data",{get:function(){return this._payload.data},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"title",{get:function(){return this._title},set:function(t){t&&t.length&&(this._payload.notification.title=t,this._title=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"body",{get:function(){return this._body},set:function(t){t&&t.length&&(this._payload.notification.body=t,this._body=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"sound",{get:function(){return this._sound},set:function(t){t&&t.length&&(this._payload.notification.sound=t,this._sound=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"icon",{get:function(){return this._icon},set:function(t){t&&t.length&&(this._payload.notification.icon=t,this._icon=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tag",{get:function(){return this._tag},set:function(t){t&&t.length&&(this._payload.notification.tag=t,this._tag=t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"silent",{set:function(t){this._isSilent=t},enumerable:!1,configurable:!0}),r.prototype._setDefaultPayloadStructure=function(){this._payload.notification={},this._payload.data={}},r.prototype.toObject=function(){var t=n({},this._payload.data),e=null,r={};if(Object.keys(this._payload).length>2){var i=this._payload;i.notification,i.data;var o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["notification","data"]);t=n(n({},t),o)}return this._isSilent?t.notification=this._payload.notification:e=this._payload.notification,Object.keys(t).length&&(r.data=t),e&&Object.keys(e).length&&(r.notification=e),Object.keys(r).length?r:null},r}(j),H=function(){function t(t,e){this._payload={apns:{},mpns:{},fcm:{}},this._title=t,this._body=e,this.apns=new U(this._payload.apns,t,e),this.mpns=new I(this._payload.mpns,t,e),this.fcm=new M(this._payload.fcm,t,e)}return Object.defineProperty(t.prototype,"debugging",{set:function(t){this._debugging=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._title},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"body",{get:function(){return this._body},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subtitle",{get:function(){return this._subtitle},set:function(t){this._subtitle=t,this.apns.subtitle=t,this.mpns.subtitle=t,this.fcm.subtitle=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"badge",{get:function(){return this._badge},set:function(t){this._badge=t,this.apns.badge=t,this.mpns.badge=t,this.fcm.badge=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sound",{get:function(){return this._sound},set:function(t){this._sound=t,this.apns.sound=t,this.mpns.sound=t,this.fcm.sound=t},enumerable:!1,configurable:!0}),t.prototype.buildPayload=function(t){var e={};if(t.includes("apns")||t.includes("apns2")){this.apns._apnsPushType=t.includes("apns")?"apns":"apns2";var n=this.apns.toObject();n&&Object.keys(n).length&&(e.pn_apns=n)}if(t.includes("mpns")){var r=this.mpns.toObject();r&&Object.keys(r).length&&(e.pn_mpns=r)}if(t.includes("fcm")){var i=this.fcm.toObject();i&&Object.keys(i).length&&(e.pn_gcm=i)}return Object.keys(e).length&&this._debugging&&(e.pn_debug=!0),e},t}(),L=function(){function t(){this._listeners=[]}return t.prototype.addListener=function(t){this._listeners.push(t)},t.prototype.removeListener=function(t){var e=[];this._listeners.forEach((function(n){n!==t&&e.push(n)})),this._listeners=e},t.prototype.removeAllListeners=function(){this._listeners=[]},t.prototype.announcePresence=function(t){this._listeners.forEach((function(e){e.presence&&e.presence(t)}))},t.prototype.announceStatus=function(t){this._listeners.forEach((function(e){e.status&&e.status(t)}))},t.prototype.announceMessage=function(t){this._listeners.forEach((function(e){e.message&&e.message(t)}))},t.prototype.announceSignal=function(t){this._listeners.forEach((function(e){e.signal&&e.signal(t)}))},t.prototype.announceMessageAction=function(t){this._listeners.forEach((function(e){e.messageAction&&e.messageAction(t)}))},t.prototype.announceFile=function(t){this._listeners.forEach((function(e){e.file&&e.file(t)}))},t.prototype.announceObjects=function(t){this._listeners.forEach((function(e){e.objects&&e.objects(t)}))},t.prototype.announceUser=function(t){this._listeners.forEach((function(e){e.user&&e.user(t)}))},t.prototype.announceSpace=function(t){this._listeners.forEach((function(e){e.space&&e.space(t)}))},t.prototype.announceMembership=function(t){this._listeners.forEach((function(e){e.membership&&e.membership(t)}))},t.prototype.announceNetworkUp=function(){var t={};t.category=x.PNNetworkUpCategory,this.announceStatus(t)},t.prototype.announceNetworkDown=function(){var t={};t.category=x.PNNetworkDownCategory,this.announceStatus(t)},t}(),D=function(){function t(t,e){this._config=t,this._cbor=e}return t.prototype.setToken=function(t){t&&t.length>0?this._token=t:this._token=void 0},t.prototype.getToken=function(){return this._token},t.prototype.extractPermissions=function(t){var e={read:!1,write:!1,manage:!1,delete:!1,get:!1,update:!1,join:!1};return 128==(128&t)&&(e.join=!0),64==(64&t)&&(e.update=!0),32==(32&t)&&(e.get=!0),8==(8&t)&&(e.delete=!0),4==(4&t)&&(e.manage=!0),2==(2&t)&&(e.write=!0),1==(1&t)&&(e.read=!0),e},t.prototype.parseToken=function(t){var e=this,n=this._cbor.decodeToken(t);if(void 0!==n){var r=n.res.uuid?Object.keys(n.res.uuid):[],i=Object.keys(n.res.chan),o=Object.keys(n.res.grp),a=n.pat.uuid?Object.keys(n.pat.uuid):[],s=Object.keys(n.pat.chan),u=Object.keys(n.pat.grp),c={version:n.v,timestamp:n.t,ttl:n.ttl,authorized_uuid:n.uuid},l=r.length>0,f=i.length>0,p=o.length>0;(l||f||p)&&(c.resources={},l&&(c.resources.uuids={},r.forEach((function(t){c.resources.uuids[t]=e.extractPermissions(n.res.uuid[t])}))),f&&(c.resources.channels={},i.forEach((function(t){c.resources.channels[t]=e.extractPermissions(n.res.chan[t])}))),p&&(c.resources.groups={},o.forEach((function(t){c.resources.groups[t]=e.extractPermissions(n.res.grp[t])}))));var h=a.length>0,d=s.length>0,g=u.length>0;return(h||d||g)&&(c.patterns={},h&&(c.patterns.uuids={},a.forEach((function(t){c.patterns.uuids[t]=e.extractPermissions(n.pat.uuid[t])}))),d&&(c.patterns.channels={},s.forEach((function(t){c.patterns.channels[t]=e.extractPermissions(n.pat.chan[t])}))),g&&(c.patterns.groups={},u.forEach((function(t){c.patterns.groups[t]=e.extractPermissions(n.pat.grp[t])})))),Object.keys(n.meta).length>0&&(c.meta=n.meta),c.signature=n.sig,c}},t}(),F=function(t){function n(e,n){var r=this.constructor,i=t.call(this,e)||this;return i.name=i.constructor.name,i.status=n,i.message=e,Object.setPrototypeOf(i,r.prototype),i}return e(n,t),n}(Error);function G(t){return(e={message:t}).type="validationError",e.error=!0,e;var e}function B(t,e,n){return t.usePost&&t.usePost(e,n)?t.postURL(e,n):t.usePatch&&t.usePatch(e,n)?t.patchURL(e,n):t.useGetFile&&t.useGetFile(e,n)?t.getFileURL(e,n):t.getURL(e,n)}function K(t){if(t.sdkName)return t.sdkName;var e="PubNub-JS-".concat(t.sdkFamily);t.partnerId&&(e+="-".concat(t.partnerId)),e+="/".concat(t.getVersion());var n=t._getPnsdkSuffix(" ");return n.length>0&&(e+=n),e}function q(t,e,n){return e.usePost&&e.usePost(t,n)?"POST":e.usePatch&&e.usePatch(t,n)?"PATCH":e.useDelete&&e.useDelete(t,n)?"DELETE":e.useGetFile&&e.useGetFile(t,n)?"GETFILE":"GET"}function z(t,e,n,r,i){var o=t.config,a=t.crypto,s=q(t,i,r);n.timestamp=Math.floor((new Date).getTime()/1e3),"PNPublishOperation"===i.getOperation()&&i.usePost&&i.usePost(t,r)&&(s="GET"),"GETFILE"===s&&(s="GET");var u="".concat(s,"\n").concat(o.publishKey,"\n").concat(e,"\n").concat(A.signPamFromParams(n),"\n");if("POST"===s)u+="string"==typeof(c=i.postPayload(t,r))?c:JSON.stringify(c);else if("PATCH"===s){var c;u+="string"==typeof(c=i.patchPayload(t,r))?c:JSON.stringify(c)}var l="v2.".concat(a.HMACSHA256(u));l=(l=(l=l.replace(/\+/g,"-")).replace(/\//g,"_")).replace(/=+$/,""),n.signature=l}function W(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=t.networking,a=t.config,s=t.telemetryManager,u=t.tokenManager,c=b(),l=null,f=null,p={};e.getOperation()===R.PNTimeOperation||e.getOperation()===R.PNChannelGroupsOperation?l=r[0]:(p=r[0],l=r[1]),"undefined"==typeof Promise||l||(f=A.createPromise());var h=e.validateParams(t,p);if(h)return l?l(G(h)):f?(f.reject(new F("Validation failed, check status for details",G(h))),f.promise):void 0;var d,g=e.prepareParams(t,p),v=B(e,t,p),y={url:v,operation:e.getOperation(),timeout:e.getRequestTimeout(t),headers:e.getRequestHeaders?e.getRequestHeaders():{},ignoreBody:"function"==typeof e.ignoreBody&&e.ignoreBody(t),forceBuffered:"function"==typeof e.forceBuffered?e.forceBuffered(t,p):null,abortSignal:"function"==typeof e.getAbortSignal?e.getAbortSignal(t,p):null};g.uuid=a.UUID,g.pnsdk=K(a);var m=s.operationsLatencyForRequest();if(Object.keys(m).length&&(g=n(n({},g),m)),a.useInstanceId&&(g.instanceid=a.instanceId),a.useRequestId&&(g.requestid=c),e.isAuthSupported()){var _=u.getToken()||a.getAuthKey();_&&(g.auth=_)}a.secretKey&&z(t,v,g,p,e);var w=function(n,r){if(n.error)return e.handleError&&e.handleError(t,p,n),void(l?l(n):f&&f.reject(new F("PubNub call failed, check status for details",n)));s.stopLatencyMeasure(e.getOperation(),c);var i=e.handleResponse(t,r,p);"function"!=typeof(null==i?void 0:i.then)&&(i=Promise.resolve(i)),i.then((function(t){l?l(n,t):f&&f.fulfill(t)})).catch((function(t){if(l){var n=t;e.getOperation()===R.PNSubscribeOperation&&(n={statusCode:400,error:!0,operation:e.getOperation(),errorData:t,category:x.PNUnknownCategory}),l(n,null)}else f&&f.reject(new F("PubNub call failed, check status for details",t))}))};if(s.startLatencyMeasure(e.getOperation(),c),"POST"===q(t,e,p)){var S=e.postPayload(t,p);d=o.POST(g,S,y,w)}else"PATCH"===q(t,e,p)?(S=e.patchPayload(t,p),d=o.PATCH(g,S,y,w)):d="DELETE"===q(t,e,p)?o.DELETE(g,y,w):"GETFILE"===q(t,e,p)?o.GETFILE(g,y,w):o.GET(g,y,w);return e.getOperation()===R.PNSubscribeOperation?d:f?f.promise:void 0}var $=Object.freeze({__proto__:null,getOperation:function(){return R.PNAddChannelsToGroupOperation},validateParams:function(t,e){var n=e.channels,r=e.channelGroup,i=t.config;return r?n&&0!==n.length?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"},getURL:function(t,e){var n=e.channelGroup,r=t.config;return"/v1/channel-registration/sub-key/".concat(r.subscribeKey,"/channel-group/").concat(A.encodeString(n))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.channels;return{add:(void 0===n?[]:n).join(",")}},handleResponse:function(){return{}}}),X=Object.freeze({__proto__:null,getOperation:function(){return R.PNRemoveChannelsFromGroupOperation},validateParams:function(t,e){var n=e.channels,r=e.channelGroup,i=t.config;return r?n&&0!==n.length?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"},getURL:function(t,e){var n=e.channelGroup,r=t.config;return"/v1/channel-registration/sub-key/".concat(r.subscribeKey,"/channel-group/").concat(A.encodeString(n))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.channels;return{remove:(void 0===n?[]:n).join(",")}},handleResponse:function(){return{}}}),V=Object.freeze({__proto__:null,getOperation:function(){return R.PNRemoveGroupOperation},validateParams:function(t,e){var n=e.channelGroup,r=t.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"},getURL:function(t,e){var n=e.channelGroup,r=t.config;return"/v1/channel-registration/sub-key/".concat(r.subscribeKey,"/channel-group/").concat(A.encodeString(n),"/remove")},isAuthSupported:function(){return!0},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},prepareParams:function(){return{}},handleResponse:function(){return{}}}),J=Object.freeze({__proto__:null,getOperation:function(){return R.PNChannelGroupsOperation},validateParams:function(t){if(!t.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(t){var e=t.config;return"/v1/channel-registration/sub-key/".concat(e.subscribeKey,"/channel-group")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e){return{groups:e.payload.groups}}}),Y=Object.freeze({__proto__:null,getOperation:function(){return R.PNChannelsForGroupOperation},validateParams:function(t,e){var n=e.channelGroup,r=t.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"},getURL:function(t,e){var n=e.channelGroup,r=t.config;return"/v1/channel-registration/sub-key/".concat(r.subscribeKey,"/channel-group/").concat(A.encodeString(n))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e){return{channels:e.payload.channels}}}),Q=Object.freeze({__proto__:null,getOperation:function(){return R.PNPushNotificationEnabledChannelsOperation},validateParams:function(t,e){var n=e.device,r=e.pushGateway,i=e.channels,o=e.topic,a=t.config;return n?r?"apns2"!==r||o?i&&0!==i.length?a.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(t,e){var n=e.device,r=e.pushGateway,i=t.config;return"apns2"===r?"/v2/push/sub-key/".concat(i.subscribeKey,"/devices-apns2/").concat(n):"/v1/push/sub-key/".concat(i.subscribeKey,"/devices/").concat(n)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var r=e.pushGateway,i=e.channels,o=void 0===i?[]:i,a=e.environment,s=void 0===a?"development":a,u=e.topic,c={type:r,add:o.join(",")};return"apns2"===r&&delete(c=n(n({},c),{environment:s,topic:u})).type,c},handleResponse:function(){return{}}}),Z=Object.freeze({__proto__:null,getOperation:function(){return R.PNPushNotificationEnabledChannelsOperation},validateParams:function(t,e){var n=e.device,r=e.pushGateway,i=e.channels,o=e.topic,a=t.config;return n?r?"apns2"!==r||o?i&&0!==i.length?a.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(t,e){var n=e.device,r=e.pushGateway,i=t.config;return"apns2"===r?"/v2/push/sub-key/".concat(i.subscribeKey,"/devices-apns2/").concat(n):"/v1/push/sub-key/".concat(i.subscribeKey,"/devices/").concat(n)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var r=e.pushGateway,i=e.channels,o=void 0===i?[]:i,a=e.environment,s=void 0===a?"development":a,u=e.topic,c={type:r,remove:o.join(",")};return"apns2"===r&&delete(c=n(n({},c),{environment:s,topic:u})).type,c},handleResponse:function(){return{}}}),tt=Object.freeze({__proto__:null,getOperation:function(){return R.PNPushNotificationEnabledChannelsOperation},validateParams:function(t,e){var n=e.device,r=e.pushGateway,i=e.topic,o=t.config;return n?r?"apns2"!==r||i?o.subscribeKey?void 0:"Missing Subscribe Key":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(t,e){var n=e.device,r=e.pushGateway,i=t.config;return"apns2"===r?"/v2/push/sub-key/".concat(i.subscribeKey,"/devices-apns2/").concat(n):"/v1/push/sub-key/".concat(i.subscribeKey,"/devices/").concat(n)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var r=e.pushGateway,i=e.environment,o=void 0===i?"development":i,a=e.topic,s={type:r};return"apns2"===r&&delete(s=n(n({},s),{environment:o,topic:a})).type,s},handleResponse:function(t,e){return{channels:e}}}),et=Object.freeze({__proto__:null,getOperation:function(){return R.PNRemoveAllPushNotificationsOperation},validateParams:function(t,e){var n=e.device,r=e.pushGateway,i=e.topic,o=t.config;return n?r?"apns2"!==r||i?o.subscribeKey?void 0:"Missing Subscribe Key":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(t,e){var n=e.device,r=e.pushGateway,i=t.config;return"apns2"===r?"/v2/push/sub-key/".concat(i.subscribeKey,"/devices-apns2/").concat(n,"/remove"):"/v1/push/sub-key/".concat(i.subscribeKey,"/devices/").concat(n,"/remove")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var r=e.pushGateway,i=e.environment,o=void 0===i?"development":i,a=e.topic,s={type:r};return"apns2"===r&&delete(s=n(n({},s),{environment:o,topic:a})).type,s},handleResponse:function(){return{}}}),nt=Object.freeze({__proto__:null,getOperation:function(){return R.PNUnsubscribeOperation},validateParams:function(t){if(!t.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(t,e){var n=t.config,r=e.channels,i=void 0===r?[]:r,o=i.length>0?i.join(","):",";return"/v2/presence/sub-key/".concat(n.subscribeKey,"/channel/").concat(A.encodeString(o),"/leave")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.channelGroups,r=void 0===n?[]:n,i={};return r.length>0&&(i["channel-group"]=r.join(",")),i},handleResponse:function(){return{}}}),rt=Object.freeze({__proto__:null,getOperation:function(){return R.PNWhereNowOperation},validateParams:function(t){if(!t.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(t,e){var n=t.config,r=e.uuid,i=void 0===r?n.UUID:r;return"/v2/presence/sub-key/".concat(n.subscribeKey,"/uuid/").concat(A.encodeString(i))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e){return e.payload?{channels:e.payload.channels}:{channels:[]}}}),it=Object.freeze({__proto__:null,getOperation:function(){return R.PNHeartbeatOperation},validateParams:function(t){if(!t.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(t,e){var n=t.config,r=e.channels,i=void 0===r?[]:r,o=i.length>0?i.join(","):",";return"/v2/presence/sub-key/".concat(n.subscribeKey,"/channel/").concat(A.encodeString(o),"/heartbeat")},isAuthSupported:function(){return!0},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},prepareParams:function(t,e){var n=e.channelGroups,r=void 0===n?[]:n,i=e.state,o=void 0===i?{}:i,a=t.config,s={};return r.length>0&&(s["channel-group"]=r.join(",")),s.state=JSON.stringify(o),s.heartbeat=a.getPresenceTimeout(),s},handleResponse:function(){return{}}}),ot=Object.freeze({__proto__:null,getOperation:function(){return R.PNGetStateOperation},validateParams:function(t){if(!t.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(t,e){var n=t.config,r=e.uuid,i=void 0===r?n.UUID:r,o=e.channels,a=void 0===o?[]:o,s=a.length>0?a.join(","):",";return"/v2/presence/sub-key/".concat(n.subscribeKey,"/channel/").concat(A.encodeString(s),"/uuid/").concat(i)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.channelGroups,r=void 0===n?[]:n,i={};return r.length>0&&(i["channel-group"]=r.join(",")),i},handleResponse:function(t,e,n){var r=n.channels,i=void 0===r?[]:r,o=n.channelGroups,a=void 0===o?[]:o,s={};return 1===i.length&&0===a.length?s[i[0]]=e.payload:s=e.payload,{channels:s}}}),at=Object.freeze({__proto__:null,getOperation:function(){return R.PNSetStateOperation},validateParams:function(t,e){var n=t.config,r=e.state,i=e.channels,o=void 0===i?[]:i,a=e.channelGroups,s=void 0===a?[]:a;return r?n.subscribeKey?0===o.length&&0===s.length?"Please provide a list of channels and/or channel-groups":void 0:"Missing Subscribe Key":"Missing State"},getURL:function(t,e){var n=t.config,r=e.channels,i=void 0===r?[]:r,o=i.length>0?i.join(","):",";return"/v2/presence/sub-key/".concat(n.subscribeKey,"/channel/").concat(A.encodeString(o),"/uuid/").concat(A.encodeString(n.UUID),"/data")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.state,r=e.channelGroups,i=void 0===r?[]:r,o={};return o.state=JSON.stringify(n),i.length>0&&(o["channel-group"]=i.join(",")),o},handleResponse:function(t,e){return{state:e.payload}}}),st=Object.freeze({__proto__:null,getOperation:function(){return R.PNHereNowOperation},validateParams:function(t){if(!t.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(t,e){var n=t.config,r=e.channels,i=void 0===r?[]:r,o=e.channelGroups,a=void 0===o?[]:o,s="/v2/presence/sub-key/".concat(n.subscribeKey);if(i.length>0||a.length>0){var u=i.length>0?i.join(","):",";s+="/channel/".concat(A.encodeString(u))}return s},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var r=e.channelGroups,i=void 0===r?[]:r,o=e.includeUUIDs,a=void 0===o||o,s=e.includeState,u=void 0!==s&&s,c=e.queryParameters,l=void 0===c?{}:c,f={};return a||(f.disable_uuids=1),u&&(f.state=1),i.length>0&&(f["channel-group"]=i.join(",")),n(n({},f),l)},handleResponse:function(t,e,n){var r=n.channels,i=void 0===r?[]:r,o=n.channelGroups,a=void 0===o?[]:o,s=n.includeUUIDs,u=void 0===s||s,c=n.includeState,l=void 0!==c&&c;return i.length>1||a.length>0||0===a.length&&0===i.length?function(){var t={};return t.totalChannels=e.payload.total_channels,t.totalOccupancy=e.payload.total_occupancy,t.channels={},Object.keys(e.payload.channels).forEach((function(n){var r=e.payload.channels[n],i=[];return t.channels[n]={occupants:i,name:n,occupancy:r.occupancy},u&&r.uuids.forEach((function(t){l?i.push({state:t.state,uuid:t.uuid}):i.push({state:null,uuid:t})})),t})),t}():function(){var t={},n=[];return t.totalChannels=1,t.totalOccupancy=e.occupancy,t.channels={},t.channels[i[0]]={occupants:n,name:i[0],occupancy:e.occupancy},u&&e.uuids&&e.uuids.forEach((function(t){l?n.push({state:t.state,uuid:t.uuid}):n.push({state:null,uuid:t})})),t}()},handleError:function(t,e,n){402!==n.statusCode||this.getURL(t,e).includes("channel")||(n.errorData.message="You have tried to perform a Global Here Now operation, your keyset configuration does not support that. Please provide a channel, or enable the Global Here Now feature from the Portal.")}}),ut=Object.freeze({__proto__:null,getOperation:function(){return R.PNAddMessageActionOperation},validateParams:function(t,e){var n=t.config,r=e.action,i=e.channel;return e.messageTimetoken?n.subscribeKey?i?r?r.value?r.type?r.type.length>15?"Action.type value exceed maximum length of 15":void 0:"Missing Action.type":"Missing Action.value":"Missing Action":"Missing message channel":"Missing Subscribe Key":"Missing message timetoken"},usePost:function(){return!0},postURL:function(t,e){var n=t.config,r=e.channel,i=e.messageTimetoken;return"/v1/message-actions/".concat(n.subscribeKey,"/channel/").concat(A.encodeString(r),"/message/").concat(i)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},getRequestHeaders:function(){return{"Content-Type":"application/json"}},isAuthSupported:function(){return!0},prepareParams:function(){return{}},postPayload:function(t,e){return e.action},handleResponse:function(t,e){return{data:e.data}}}),ct=Object.freeze({__proto__:null,getOperation:function(){return R.PNRemoveMessageActionOperation},validateParams:function(t,e){var n=t.config,r=e.channel,i=e.actionTimetoken;return e.messageTimetoken?i?n.subscribeKey?r?void 0:"Missing message channel":"Missing Subscribe Key":"Missing action timetoken":"Missing message timetoken"},useDelete:function(){return!0},getURL:function(t,e){var n=t.config,r=e.channel,i=e.actionTimetoken,o=e.messageTimetoken;return"/v1/message-actions/".concat(n.subscribeKey,"/channel/").concat(A.encodeString(r),"/message/").concat(o,"/action/").concat(i)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e){return{data:e.data}}}),lt=Object.freeze({__proto__:null,getOperation:function(){return R.PNGetMessageActionsOperation},validateParams:function(t,e){var n=t.config,r=e.channel;return n.subscribeKey?r?void 0:"Missing message channel":"Missing Subscribe Key"},getURL:function(t,e){var n=t.config,r=e.channel;return"/v1/message-actions/".concat(n.subscribeKey,"/channel/").concat(A.encodeString(r))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.limit,r=e.start,i=e.end,o={};return n&&(o.limit=n),r&&(o.start=r),i&&(o.end=i),o},handleResponse:function(t,e){var n={data:e.data,start:null,end:null};return n.data.length&&(n.end=n.data[n.data.length-1].actionTimetoken,n.start=n.data[0].actionTimetoken),n}}),ft={getOperation:function(){return R.PNListFilesOperation},validateParams:function(t,e){if(!(null==e?void 0:e.channel))return"channel can't be empty"},getURL:function(t,e){var n=t.config;return"/v1/files/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel),"/files")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n={};return e.limit&&(n.limit=e.limit),e.next&&(n.next=e.next),n},handleResponse:function(t,e){return{status:e.status,data:e.data,next:e.next,count:e.count}}},pt={getOperation:function(){return R.PNGenerateUploadUrlOperation},validateParams:function(t,e){return(null==e?void 0:e.channel)?(null==e?void 0:e.name)?void 0:"name can't be empty":"channel can't be empty"},usePost:function(){return!0},postURL:function(t,e){var n=t.config;return"/v1/files/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel),"/generate-upload-url")},postPayload:function(t,e){return{name:e.name}},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e){return{status:e.status,data:e.data,file_upload_request:e.file_upload_request}}},ht={getOperation:function(){return R.PNPublishFileOperation},validateParams:function(t,e){return(null==e?void 0:e.channel)?(null==e?void 0:e.fileId)?(null==e?void 0:e.fileName)?void 0:"file name can't be empty":"file id can't be empty":"channel can't be empty"},getURL:function(t,e){var n=t.config,r=n.publishKey,i=n.subscribeKey,o=function(t,e){var n=t.crypto,r=t.config,i=JSON.stringify(e);return r.cipherKey&&(i=n.encrypt(i),i=JSON.stringify(i)),i||""}(t,{message:e.message,file:{name:e.fileName,id:e.fileId}});return"/v1/files/publish-file/".concat(r,"/").concat(i,"/0/").concat(A.encodeString(e.channel),"/0/").concat(A.encodeString(o))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n={};return e.ttl&&(n.ttl=e.ttl),void 0!==e.storeInHistory&&(n.store=e.storeInHistory?"1":"0"),e.meta&&"object"==typeof e.meta&&(n.meta=JSON.stringify(e.meta)),n},handleResponse:function(t,e){return{timetoken:e[2]}}},dt=function(t){var e=function(t){var e=this,n=t.generateUploadUrl,o=t.publishFile,a=t.modules,s=a.PubNubFile,u=a.config,c=a.cryptography,l=a.networking;return function(t){var a=t.channel,f=t.file,p=t.message,h=t.cipherKey,d=t.meta,g=t.ttl,v=t.storeInHistory;return r(e,void 0,void 0,(function(){var t,e,r,y,b,m,_,w,S,O,k,P,E,T,A,x,C,R,N,j,U,I,M,H,L,D,B,K;return i(this,(function(i){switch(i.label){case 0:if(!a)throw new F("Validation failed, check status for details",G("channel can't be empty"));if(!f)throw new F("Validation failed, check status for details",G("file can't be empty"));return t=s.create(f),[4,n({channel:a,name:t.name})];case 1:return e=i.sent(),r=e.file_upload_request,y=r.url,b=r.form_fields,m=e.data,_=m.id,w=m.name,s.supportsEncryptFile&&(null!=h?h:u.cipherKey)?[4,c.encryptFile(null!=h?h:u.cipherKey,t,s)]:[3,3];case 2:t=i.sent(),i.label=3;case 3:S=b,t.mimeType&&(S=b.map((function(e){return"Content-Type"===e.key?{key:e.key,value:t.mimeType}:e}))),i.label=4;case 4:return i.trys.push([4,18,,20]),s.supportsFileUri&&f.uri?(P=(k=l).POSTFILE,E=[y,S],[4,t.toFileUri()]):[3,7];case 5:return[4,P.apply(k,E.concat([i.sent()]))];case 6:return O=i.sent(),[3,17];case 7:return s.supportsFile?(A=(T=l).POSTFILE,x=[y,S],[4,t.toFile()]):[3,10];case 8:return[4,A.apply(T,x.concat([i.sent()]))];case 9:return O=i.sent(),[3,17];case 10:return s.supportsBuffer?(R=(C=l).POSTFILE,N=[y,S],[4,t.toBuffer()]):[3,13];case 11:return[4,R.apply(C,N.concat([i.sent()]))];case 12:return O=i.sent(),[3,17];case 13:return s.supportsBlob?(U=(j=l).POSTFILE,I=[y,S],[4,t.toBlob()]):[3,16];case 14:return[4,U.apply(j,I.concat([i.sent()]))];case 15:return O=i.sent(),[3,17];case 16:throw new Error("Unsupported environment");case 17:return[3,20];case 18:return M=i.sent(),[4,(q=M.response,new Promise((function(t){var e="";q.on("data",(function(t){e+=t.toString("utf8")})),q.on("end",(function(){t(e)}))})))];case 19:throw H=i.sent(),L=/<Message>(.*)<\/Message>/gi.exec(H),new F(L?"Upload to bucket failed: ".concat(L[1]):"Upload to bucket failed.",M);case 20:if(204!==O.status)throw new F("Upload to bucket was unsuccessful",O);D=u.fileUploadPublishRetryLimit,B=!1,K={timetoken:"0"},i.label=21;case 21:return i.trys.push([21,23,,24]),[4,o({channel:a,message:p,fileId:_,fileName:w,meta:d,storeInHistory:v,ttl:g})];case 22:return K=i.sent(),B=!0,[3,24];case 23:return i.sent(),D-=1,[3,24];case 24:if(!B&&D>0)return[3,21];i.label=25;case 25:if(B)return[2,{timetoken:K.timetoken,id:_,name:w}];throw new F("Publish failed. You may want to execute that operation manually using pubnub.publishFile",{channel:a,id:_,name:w})}var q}))}))}}(t);return function(t,n){var r=e(t);return"function"==typeof n?(r.then((function(t){return n(null,t)})).catch((function(t){return n(t,null)})),r):r}},gt=function(t,e){var n=e.channel,r=e.id,i=e.name,o=t.config,a=t.networking;if(!n)throw new F("Validation failed, check status for details",G("channel can't be empty"));if(!r)throw new F("Validation failed, check status for details",G("file id can't be empty"));if(!i)throw new F("Validation failed, check status for details",G("file name can't be empty"));var s="/v1/files/".concat(o.subscribeKey,"/channels/").concat(A.encodeString(n),"/files/").concat(r,"/").concat(i),u={};u.uuid=o.getUUID(),u.pnsdk=K(o),o.getAuthKey()&&(u.auth=o.getAuthKey()),o.secretKey&&z(t,s,u,{},{getOperation:function(){return"PubNubGetFileUrlOperation"}});var c=Object.keys(u).map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(u[t]))})).join("&");return""!==c?"".concat(a.getStandardOrigin()).concat(s,"?").concat(c):"".concat(a.getStandardOrigin()).concat(s)},vt={getOperation:function(){return R.PNDownloadFileOperation},validateParams:function(t,e){return(null==e?void 0:e.channel)?(null==e?void 0:e.name)?(null==e?void 0:e.id)?void 0:"id can't be empty":"name can't be empty":"channel can't be empty"},useGetFile:function(){return!0},getFileURL:function(t,e){var n=t.config;return"/v1/files/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel),"/files/").concat(e.id,"/").concat(e.name)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},ignoreBody:function(){return!0},forceBuffered:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e,n){var o=t.PubNubFile,a=t.config,s=t.cryptography;return r(void 0,void 0,void 0,(function(){var t,r,u,c;return i(this,(function(i){switch(i.label){case 0:return t=e.response.body,o.supportsEncryptFile&&(null!==(r=n.cipherKey)&&void 0!==r?r:a.cipherKey)?[4,s.decrypt(null!==(u=n.cipherKey)&&void 0!==u?u:a.cipherKey,t)]:[3,2];case 1:t=i.sent(),i.label=2;case 2:return[2,o.create({data:t,name:null!==(c=e.response.name)&&void 0!==c?c:n.name,mimeType:e.response.type})]}}))}))}},yt={getOperation:function(){return R.PNListFilesOperation},validateParams:function(t,e){return(null==e?void 0:e.channel)?(null==e?void 0:e.id)?(null==e?void 0:e.name)?void 0:"file name can't be empty":"file id can't be empty":"channel can't be empty"},useDelete:function(){return!0},getURL:function(t,e){var n=t.config;return"/v1/files/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel),"/files/").concat(e.id,"/").concat(e.name)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e){return{status:e.status}}},bt={getOperation:function(){return R.PNGetAllUUIDMetadataOperation},validateParams:function(){},getURL:function(t){var e=t.config;return"/v2/objects/".concat(e.subscribeKey,"/uuids")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r,i,o,s,u,c,l,f,p={};return(null===(n=null==e?void 0:e.include)||void 0===n?void 0:n.customFields)&&(p.include="custom"),(null===(r=null==e?void 0:e.include)||void 0===r?void 0:r.totalCount)&&(p.count=null===(i=e.include)||void 0===i?void 0:i.totalCount),(null===(o=null==e?void 0:e.page)||void 0===o?void 0:o.next)&&(p.start=null===(s=e.page)||void 0===s?void 0:s.next),(null===(u=null==e?void 0:e.page)||void 0===u?void 0:u.prev)&&(p.end=null===(c=e.page)||void 0===c?void 0:c.prev),(null==e?void 0:e.filter)&&(p.filter=e.filter),p.limit=null!==(l=null==e?void 0:e.limit)&&void 0!==l?l:100,(null==e?void 0:e.sort)&&(p.sort=Object.entries(null!==(f=e.sort)&&void 0!==f?f:{}).map((function(t){var e=a(t,2),n=e[0],r=e[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),p},handleResponse:function(t,e){return{status:e.status,data:e.data,totalCount:e.totalCount,next:e.next,prev:e.prev}}},mt={getOperation:function(){return R.PNGetUUIDMetadataOperation},validateParams:function(){},getURL:function(t,e){var n,r=t.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(A.encodeString(null!==(n=null==e?void 0:e.uuid)&&void 0!==n?n:r.getUUID()))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r,i,o=t.config;return{uuid:null!==(n=null==e?void 0:e.uuid)&&void 0!==n?n:o.getUUID(),include:(null===(i=null===(r=null==e?void 0:e.include)||void 0===r?void 0:r.customFields)||void 0===i||i)&&"custom"}},handleResponse:function(t,e){return{status:e.status,data:e.data}}},_t={getOperation:function(){return R.PNSetUUIDMetadataOperation},validateParams:function(t,e){if(!(null==e?void 0:e.data))return"Data cannot be empty"},usePatch:function(){return!0},patchURL:function(t,e){var n,r=t.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(A.encodeString(null!==(n=e.uuid)&&void 0!==n?n:r.getUUID()))},patchPayload:function(t,e){return e.data},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r,i,o=t.config;return{uuid:null!==(n=null==e?void 0:e.uuid)&&void 0!==n?n:o.getUUID(),include:(null===(i=null===(r=null==e?void 0:e.include)||void 0===r?void 0:r.customFields)||void 0===i||i)&&"custom"}},handleResponse:function(t,e){return{status:e.status,data:e.data}}},wt={getOperation:function(){return R.PNRemoveUUIDMetadataOperation},validateParams:function(){},getURL:function(t,e){var n,r=t.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(A.encodeString(null!==(n=null==e?void 0:e.uuid)&&void 0!==n?n:r.getUUID()))},useDelete:function(){return!0},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r=t.config;return{uuid:null!==(n=null==e?void 0:e.uuid)&&void 0!==n?n:r.getUUID()}},handleResponse:function(t,e){return{status:e.status,data:e.data}}},St={getOperation:function(){return R.PNGetAllChannelMetadataOperation},validateParams:function(){},getURL:function(t){var e=t.config;return"/v2/objects/".concat(e.subscribeKey,"/channels")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r,i,o,s,u,c,l,f,p={};return(null===(n=null==e?void 0:e.include)||void 0===n?void 0:n.customFields)&&(p.include="custom"),(null===(r=null==e?void 0:e.include)||void 0===r?void 0:r.totalCount)&&(p.count=null===(i=e.include)||void 0===i?void 0:i.totalCount),(null===(o=null==e?void 0:e.page)||void 0===o?void 0:o.next)&&(p.start=null===(s=e.page)||void 0===s?void 0:s.next),(null===(u=null==e?void 0:e.page)||void 0===u?void 0:u.prev)&&(p.end=null===(c=e.page)||void 0===c?void 0:c.prev),(null==e?void 0:e.filter)&&(p.filter=e.filter),p.limit=null!==(l=null==e?void 0:e.limit)&&void 0!==l?l:100,(null==e?void 0:e.sort)&&(p.sort=Object.entries(null!==(f=e.sort)&&void 0!==f?f:{}).map((function(t){var e=a(t,2),n=e[0],r=e[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),p},handleResponse:function(t,e){return{status:e.status,data:e.data,totalCount:e.totalCount,prev:e.prev,next:e.next}}},Ot={getOperation:function(){return R.PNGetChannelMetadataOperation},validateParams:function(t,e){if(!(null==e?void 0:e.channel))return"Channel cannot be empty"},getURL:function(t,e){var n=t.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r;return{include:(null===(r=null===(n=null==e?void 0:e.include)||void 0===n?void 0:n.customFields)||void 0===r||r)&&"custom"}},handleResponse:function(t,e){return{status:e.status,data:e.data}}},kt={getOperation:function(){return R.PNSetChannelMetadataOperation},validateParams:function(t,e){return(null==e?void 0:e.channel)?(null==e?void 0:e.data)?void 0:"Data cannot be empty":"Channel cannot be empty"},usePatch:function(){return!0},patchURL:function(t,e){var n=t.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel))},patchPayload:function(t,e){return e.data},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r;return{include:(null===(r=null===(n=null==e?void 0:e.include)||void 0===n?void 0:n.customFields)||void 0===r||r)&&"custom"}},handleResponse:function(t,e){return{status:e.status,data:e.data}}},Pt={getOperation:function(){return R.PNRemoveChannelMetadataOperation},validateParams:function(t,e){if(!(null==e?void 0:e.channel))return"Channel cannot be empty"},getURL:function(t,e){var n=t.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel))},useDelete:function(){return!0},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e){return{status:e.status,data:e.data}}},Et={getOperation:function(){return R.PNGetMembersOperation},validateParams:function(t,e){if(!(null==e?void 0:e.channel))return"UUID cannot be empty"},getURL:function(t,e){var n=t.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel),"/uuids")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r,i,o,s,u,c,l,f,p,h,d,g={};return(null==e?void 0:e.include)&&(g.include=[],(null===(n=e.include)||void 0===n?void 0:n.customFields)&&g.include.push("custom"),(null===(r=e.include)||void 0===r?void 0:r.customUUIDFields)&&g.include.push("uuid.custom"),(null===(o=null===(i=e.include)||void 0===i?void 0:i.UUIDFields)||void 0===o||o)&&g.include.push("uuid"),g.include=g.include.join(",")),(null===(s=null==e?void 0:e.include)||void 0===s?void 0:s.totalCount)&&(g.count=null===(u=e.include)||void 0===u?void 0:u.totalCount),(null===(c=null==e?void 0:e.page)||void 0===c?void 0:c.next)&&(g.start=null===(l=e.page)||void 0===l?void 0:l.next),(null===(f=null==e?void 0:e.page)||void 0===f?void 0:f.prev)&&(g.end=null===(p=e.page)||void 0===p?void 0:p.prev),(null==e?void 0:e.filter)&&(g.filter=e.filter),g.limit=null!==(h=null==e?void 0:e.limit)&&void 0!==h?h:100,(null==e?void 0:e.sort)&&(g.sort=Object.entries(null!==(d=e.sort)&&void 0!==d?d:{}).map((function(t){var e=a(t,2),n=e[0],r=e[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),g},handleResponse:function(t,e){return{status:e.status,data:e.data,totalCount:e.totalCount,prev:e.prev,next:e.next}}},Tt={getOperation:function(){return R.PNSetMembersOperation},validateParams:function(t,e){return(null==e?void 0:e.channel)?(null==e?void 0:e.uuids)&&0!==(null==e?void 0:e.uuids.length)?void 0:"UUIDs cannot be empty":"Channel cannot be empty"},usePatch:function(){return!0},patchURL:function(t,e){var n=t.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(A.encodeString(e.channel),"/uuids")},patchPayload:function(t,e){var n;return(n={set:[],remove:[]})[e.type]=e.uuids.map((function(t){return"string"==typeof t?{uuid:{id:t}}:{uuid:{id:t.id},custom:t.custom}})),n},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r,i,o,s,u,c,l,f,p={};return(null==e?void 0:e.include)&&(p.include=[],(null===(n=e.include)||void 0===n?void 0:n.customFields)&&p.include.push("custom"),(null===(r=e.include)||void 0===r?void 0:r.customUUIDFields)&&p.include.push("uuid.custom"),(null===(i=e.include)||void 0===i?void 0:i.UUIDFields)&&p.include.push("uuid"),p.include=p.include.join(",")),(null===(o=null==e?void 0:e.include)||void 0===o?void 0:o.totalCount)&&(p.count=!0),(null===(s=null==e?void 0:e.page)||void 0===s?void 0:s.next)&&(p.start=null===(u=e.page)||void 0===u?void 0:u.next),(null===(c=null==e?void 0:e.page)||void 0===c?void 0:c.prev)&&(p.end=null===(l=e.page)||void 0===l?void 0:l.prev),(null==e?void 0:e.filter)&&(p.filter=e.filter),(null==e?void 0:e.limit)&&(p.limit=e.limit),(null==e?void 0:e.sort)&&(p.sort=Object.entries(null!==(f=e.sort)&&void 0!==f?f:{}).map((function(t){var e=a(t,2),n=e[0],r=e[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),p},handleResponse:function(t,e){return{status:e.status,data:e.data,totalCount:e.totalCount,prev:e.prev,next:e.next}}},At={getOperation:function(){return R.PNGetMembershipsOperation},validateParams:function(){},getURL:function(t,e){var n,r=t.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(A.encodeString(null!==(n=null==e?void 0:e.uuid)&&void 0!==n?n:r.getUUID()),"/channels")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r,i,o,s,u,c,l,f,p,h,d={};return(null==e?void 0:e.include)&&(d.include=[],(null===(n=e.include)||void 0===n?void 0:n.customFields)&&d.include.push("custom"),(null===(r=e.include)||void 0===r?void 0:r.customChannelFields)&&d.include.push("channel.custom"),(null===(i=e.include)||void 0===i?void 0:i.channelFields)&&d.include.push("channel"),d.include=d.include.join(",")),(null===(o=null==e?void 0:e.include)||void 0===o?void 0:o.totalCount)&&(d.count=null===(s=e.include)||void 0===s?void 0:s.totalCount),(null===(u=null==e?void 0:e.page)||void 0===u?void 0:u.next)&&(d.start=null===(c=e.page)||void 0===c?void 0:c.next),(null===(l=null==e?void 0:e.page)||void 0===l?void 0:l.prev)&&(d.end=null===(f=e.page)||void 0===f?void 0:f.prev),(null==e?void 0:e.filter)&&(d.filter=e.filter),d.limit=null!==(p=null==e?void 0:e.limit)&&void 0!==p?p:100,(null==e?void 0:e.sort)&&(d.sort=Object.entries(null!==(h=e.sort)&&void 0!==h?h:{}).map((function(t){var e=a(t,2),n=e[0],r=e[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),d},handleResponse:function(t,e){return{status:e.status,data:e.data,totalCount:e.totalCount,prev:e.prev,next:e.next}}},xt={getOperation:function(){return R.PNSetMembershipsOperation},validateParams:function(t,e){if(!(null==e?void 0:e.channels)||0===(null==e?void 0:e.channels.length))return"Channels cannot be empty"},usePatch:function(){return!0},patchURL:function(t,e){var n,r=t.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(A.encodeString(null!==(n=e.uuid)&&void 0!==n?n:r.getUUID()),"/channels")},patchPayload:function(t,e){var n;return(n={set:[],remove:[]})[e.type]=e.channels.map((function(t){return"string"==typeof t?{channel:{id:t}}:{channel:{id:t.id},custom:t.custom}})),n},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n,r,i,o,s,u,c,l,f,p={};return(null==e?void 0:e.include)&&(p.include=[],(null===(n=e.include)||void 0===n?void 0:n.customFields)&&p.include.push("custom"),(null===(r=e.include)||void 0===r?void 0:r.customChannelFields)&&p.include.push("channel.custom"),(null===(i=e.include)||void 0===i?void 0:i.channelFields)&&p.include.push("channel"),p.include=p.include.join(",")),(null===(o=null==e?void 0:e.include)||void 0===o?void 0:o.totalCount)&&(p.count=!0),(null===(s=null==e?void 0:e.page)||void 0===s?void 0:s.next)&&(p.start=null===(u=e.page)||void 0===u?void 0:u.next),(null===(c=null==e?void 0:e.page)||void 0===c?void 0:c.prev)&&(p.end=null===(l=e.page)||void 0===l?void 0:l.prev),(null==e?void 0:e.filter)&&(p.filter=e.filter),(null==e?void 0:e.limit)&&(p.limit=e.limit),(null==e?void 0:e.sort)&&(p.sort=Object.entries(null!==(f=e.sort)&&void 0!==f?f:{}).map((function(t){var e=a(t,2),n=e[0],r=e[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),p},handleResponse:function(t,e){return{status:e.status,data:e.data,totalCount:e.totalCount,prev:e.prev,next:e.next}}},Ct=Object.freeze({__proto__:null,getOperation:function(){return R.PNAccessManagerAudit},validateParams:function(t){if(!t.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(t){var e=t.config;return"/v2/auth/audit/sub-key/".concat(e.subscribeKey)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(t,e){var n=e.channel,r=e.channelGroup,i=e.authKeys,o=void 0===i?[]:i,a={};return n&&(a.channel=n),r&&(a["channel-group"]=r),o.length>0&&(a.auth=o.join(",")),a},handleResponse:function(t,e){return e.payload}}),Rt=Object.freeze({__proto__:null,getOperation:function(){return R.PNAccessManagerGrant},validateParams:function(t,e){var n=t.config;return n.subscribeKey?n.publishKey?n.secretKey?null==e.uuids||e.authKeys?null==e.uuids||null==e.channels&&null==e.channelGroups?void 0:"Both channel/channelgroup and uuid cannot be used in the same request":"authKeys are required for grant request on uuids":"Missing Secret Key":"Missing Publish Key":"Missing Subscribe Key"},getURL:function(t){var e=t.config;return"/v2/auth/grant/sub-key/".concat(e.subscribeKey)},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(t,e){var n=e.channels,r=void 0===n?[]:n,i=e.channelGroups,o=void 0===i?[]:i,a=e.uuids,s=void 0===a?[]:a,u=e.ttl,c=e.read,l=void 0!==c&&c,f=e.write,p=void 0!==f&&f,h=e.manage,d=void 0!==h&&h,g=e.get,v=void 0!==g&&g,y=e.join,b=void 0!==y&&y,m=e.update,_=void 0!==m&&m,w=e.authKeys,S=void 0===w?[]:w,O=e.delete,k={};return k.r=l?"1":"0",k.w=p?"1":"0",k.m=d?"1":"0",k.d=O?"1":"0",k.g=v?"1":"0",k.j=b?"1":"0",k.u=_?"1":"0",r.length>0&&(k.channel=r.join(",")),o.length>0&&(k["channel-group"]=o.join(",")),S.length>0&&(k.auth=S.join(",")),s.length>0&&(k["target-uuid"]=s.join(",")),(u||0===u)&&(k.ttl=u),k},handleResponse:function(){return{}}});function Nt(t){var e=0;return t.join&&(e|=128),t.update&&(e|=64),t.get&&(e|=32),t.delete&&(e|=8),t.manage&&(e|=4),t.write&&(e|=2),t.read&&(e|=1),e}var jt=Object.freeze({__proto__:null,getOperation:function(){return R.PNAccessManagerGrantToken},extractPermissions:Nt,validateParams:function(t,e){var n=t.config;return n.subscribeKey?n.publishKey?n.secretKey?e.resources||e.patterns?(!e.resources||e.resources.uuids&&0!==Object.keys(e.resources.uuids).length||e.resources.channels&&0!==Object.keys(e.resources.channels).length||e.resources.groups&&0!==Object.keys(e.resources.groups).length)&&(!e.patterns||e.patterns.uuids&&0!==Object.keys(e.patterns.uuids).length||e.patterns.channels&&0!==Object.keys(e.patterns.channels).length||e.patterns.groups&&0!==Object.keys(e.patterns.groups).length)?void 0:"Missing values for either Resources or Patterns.":"Missing either Resources or Patterns.":"Missing Secret Key":"Missing Publish Key":"Missing Subscribe Key"},postURL:function(t){var e=t.config;return"/v3/pam/".concat(e.subscribeKey,"/grant")},usePost:function(){return!0},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(){return{}},postPayload:function(t,e){return function(t,e){var n=e.ttl,r=e.resources,i=e.patterns,o=e.meta,a=e.authorized_uuid,s={ttl:0,permissions:{resources:{channels:{},groups:{},uuids:{},users:{},spaces:{}},patterns:{channels:{},groups:{},uuids:{},users:{},spaces:{}},meta:{}}};if(r){var u=r.uuids,c=r.channels,l=r.groups;u&&Object.keys(u).forEach((function(t){s.permissions.resources.uuids[t]=Nt(u[t])})),c&&Object.keys(c).forEach((function(t){s.permissions.resources.channels[t]=Nt(c[t])})),l&&Object.keys(l).forEach((function(t){s.permissions.resources.groups[t]=Nt(l[t])}))}if(i){var f=i.uuids,p=i.channels,h=i.groups;f&&Object.keys(f).forEach((function(t){s.permissions.patterns.uuids[t]=Nt(f[t])})),p&&Object.keys(p).forEach((function(t){s.permissions.patterns.channels[t]=Nt(p[t])})),h&&Object.keys(h).forEach((function(t){s.permissions.patterns.groups[t]=Nt(h[t])}))}return(n||0===n)&&(s.ttl=n),o&&(s.permissions.meta=o),a&&(s.permissions.uuid="".concat(a)),s}(0,e)},handleResponse:function(t,e){return e.data.token}}),Ut={getOperation:function(){return R.PNAccessManagerRevokeToken},validateParams:function(t,e){return t.config.secretKey?e?void 0:"token can't be empty":"Missing Secret Key"},getURL:function(t,e){var n=t.config;return"/v3/pam/".concat(n.subscribeKey,"/grant/").concat(A.encodeString(e))},useDelete:function(){return!0},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(t){return{uuid:t.config.getUUID()}},handleResponse:function(t,e){return{status:e.status,data:e.data}}};function It(t,e){var n=t.crypto,r=t.config,i=JSON.stringify(e);return r.cipherKey&&(i=n.encrypt(i),i=JSON.stringify(i)),i}var Mt=Object.freeze({__proto__:null,getOperation:function(){return R.PNPublishOperation},validateParams:function(t,e){var n=t.config,r=e.message;return e.channel?r?n.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"},usePost:function(t,e){var n=e.sendByPost;return void 0!==n&&n},getURL:function(t,e){var n=t.config,r=e.channel,i=It(t,e.message);return"/publish/".concat(n.publishKey,"/").concat(n.subscribeKey,"/0/").concat(A.encodeString(r),"/0/").concat(A.encodeString(i))},postURL:function(t,e){var n=t.config,r=e.channel;return"/publish/".concat(n.publishKey,"/").concat(n.subscribeKey,"/0/").concat(A.encodeString(r),"/0")},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},postPayload:function(t,e){return It(t,e.message)},prepareParams:function(t,e){var n=e.meta,r=e.replicate,i=void 0===r||r,o=e.storeInHistory,a=e.ttl,s={};return null!=o&&(s.store=o?"1":"0"),a&&(s.ttl=a),!1===i&&(s.norep="true"),n&&"object"==typeof n&&(s.meta=JSON.stringify(n)),s},handleResponse:function(t,e){return{timetoken:e[2]}}}),Ht=Object.freeze({__proto__:null,getOperation:function(){return R.PNSignalOperation},validateParams:function(t,e){var n=t.config,r=e.message;return e.channel?r?n.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"},getURL:function(t,e){var n,r=t.config,i=e.channel,o=(n=e.message,JSON.stringify(n));return"/signal/".concat(r.publishKey,"/").concat(r.subscribeKey,"/0/").concat(A.encodeString(i),"/0/").concat(A.encodeString(o))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(t,e){return{timetoken:e[2]}}});function Lt(t,e){var n=t.config,r=t.crypto;if(!n.cipherKey)return e;try{return r.decrypt(e)}catch(t){return e}}var Dt=Object.freeze({__proto__:null,getOperation:function(){return R.PNHistoryOperation},validateParams:function(t,e){var n=e.channel,r=t.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},getURL:function(t,e){var n=e.channel,r=t.config;return"/v2/history/sub-key/".concat(r.subscribeKey,"/channel/").concat(A.encodeString(n))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.start,r=e.end,i=e.reverse,o=e.count,a=void 0===o?100:o,s=e.stringifiedTimeToken,u=void 0!==s&&s,c=e.includeMeta,l=void 0!==c&&c,f={include_token:"true"};return f.count=a,n&&(f.start=n),r&&(f.end=r),u&&(f.string_message_token="true"),null!=i&&(f.reverse=i.toString()),l&&(f.include_meta="true"),f},handleResponse:function(t,e){var n={messages:[],startTimeToken:e[1],endTimeToken:e[2]};return Array.isArray(e[0])&&e[0].forEach((function(e){var r={timetoken:e.timetoken,entry:Lt(t,e.message)};e.meta&&(r.meta=e.meta),n.messages.push(r)})),n}}),Ft=Object.freeze({__proto__:null,getOperation:function(){return R.PNDeleteMessagesOperation},validateParams:function(t,e){var n=e.channel,r=t.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},useDelete:function(){return!0},getURL:function(t,e){var n=e.channel,r=t.config;return"/v3/history/sub-key/".concat(r.subscribeKey,"/channel/").concat(A.encodeString(n))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.start,r=e.end,i={};return n&&(i.start=n),r&&(i.end=r),i},handleResponse:function(t,e){return e.payload}}),Gt=Object.freeze({__proto__:null,getOperation:function(){return R.PNMessageCounts},validateParams:function(t,e){var n=e.channels,r=e.timetoken,i=e.channelTimetokens,o=t.config;return n?r&&i?"timetoken and channelTimetokens are incompatible together":r&&i&&i.length>1&&n.length!==i.length?"Length of channelTimetokens and channels do not match":o.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},getURL:function(t,e){var n=e.channels,r=t.config,i=n.join(",");return"/v3/history/sub-key/".concat(r.subscribeKey,"/message-counts/").concat(A.encodeString(i))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.timetoken,r=e.channelTimetokens,i={};if(r&&1===r.length){var o=a(r,1)[0];i.timetoken=o}else r?i.channelsTimetoken=r.join(","):n&&(i.timetoken=n);return i},handleResponse:function(t,e){return{channels:e.channels}}}),Bt=Object.freeze({__proto__:null,getOperation:function(){return R.PNFetchMessagesOperation},validateParams:function(t,e){var n=e.channels,r=e.includeMessageActions,i=void 0!==r&&r,o=t.config;if(!n||0===n.length)return"Missing channels";if(!o.subscribeKey)return"Missing Subscribe Key";if(i&&n.length>1)throw new TypeError("History can return actions data for a single channel only. Either pass a single channel or disable the includeMessageActions flag.")},getURL:function(t,e){var n=e.channels,r=void 0===n?[]:n,i=e.includeMessageActions,o=void 0!==i&&i,a=t.config,s=o?"history-with-actions":"history",u=r.length>0?r.join(","):",";return"/v3/".concat(s,"/sub-key/").concat(a.subscribeKey,"/channel/").concat(A.encodeString(u))},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=e.channels,r=e.start,i=e.end,o=e.includeMessageActions,a=e.count,s=e.stringifiedTimeToken,u=void 0!==s&&s,c=e.includeMeta,l=void 0!==c&&c,f=e.includeUuid,p=e.includeUUID,h=void 0===p||p,d=e.includeMessageType,g=void 0===d||d,v={};return v.max=a||(n.length>1||!0===o?25:100),r&&(v.start=r),i&&(v.end=i),u&&(v.string_message_token="true"),l&&(v.include_meta="true"),h&&!1!==f&&(v.include_uuid="true"),g&&(v.include_message_type="true"),v},handleResponse:function(t,e){var n={channels:{}};return Object.keys(e.channels||{}).forEach((function(r){n.channels[r]=[],(e.channels[r]||[]).forEach((function(e){var i={};i.channel=r,i.timetoken=e.timetoken,i.message=function(t,e){var n=t.config,r=t.crypto;if(!n.cipherKey)return e;try{return r.decrypt(e)}catch(t){return e}}(t,e.message),i.messageType=e.message_type,i.uuid=e.uuid,e.actions&&(i.actions=e.actions,i.data=e.actions),e.meta&&(i.meta=e.meta),n.channels[r].push(i)}))})),e.more&&(n.more=e.more),n}}),Kt=Object.freeze({__proto__:null,getOperation:function(){return R.PNTimeOperation},getURL:function(){return"/time/0"},getRequestTimeout:function(t){return t.config.getTransactionTimeout()},prepareParams:function(){return{}},isAuthSupported:function(){return!1},handleResponse:function(t,e){return{timetoken:e[0]}},validateParams:function(){}}),qt=Object.freeze({__proto__:null,getOperation:function(){return R.PNSubscribeOperation},validateParams:function(t){if(!t.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(t,e){var n=t.config,r=e.channels,i=void 0===r?[]:r,o=i.length>0?i.join(","):",";return"/v2/subscribe/".concat(n.subscribeKey,"/").concat(A.encodeString(o),"/0")},getRequestTimeout:function(t){return t.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n=t.config,r=e.state,i=e.channelGroups,o=void 0===i?[]:i,a=e.timetoken,s=e.filterExpression,u=e.region,c={heartbeat:n.getPresenceTimeout()};return o.length>0&&(c["channel-group"]=o.join(",")),s&&s.length>0&&(c["filter-expr"]=s),Object.keys(r).length&&(c.state=JSON.stringify(r)),a&&(c.tt=a),u&&(c.tr=u),c},handleResponse:function(t,e){var n=[];e.m.forEach((function(t){var e={publishTimetoken:t.p.t,region:t.p.r},r={shard:parseInt(t.a,10),subscriptionMatch:t.b,channel:t.c,messageType:t.e,payload:t.d,flags:t.f,issuingClientId:t.i,subscribeKey:t.k,originationTimetoken:t.o,userMetadata:t.u,publishMetaData:e};n.push(r)}));var r={timetoken:e.t.t,region:e.t.r};return{messages:n,metadata:r}}}),zt={getOperation:function(){return R.PNHandshakeOperation},validateParams:function(t,e){if(!(null==e?void 0:e.channels)&&!(null==e?void 0:e.channelGroups))return"channels and channleGroups both should not be empty"},getURL:function(t,e){var n=t.config,r=e.channels?e.channels.join(","):",";return"/v2/subscribe/".concat(n.subscribeKey,"/").concat(A.encodeString(r),"/0")},getRequestTimeout:function(t){return t.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},prepareParams:function(t,e){var n={};return e.channelGroups&&e.channelGroups.length>0&&(n["channel-group"]=e.channelGroups.join(",")),n.tt=0,n},handleResponse:function(t,e){return{region:e.t.r,timetoken:e.t.t}}},Wt={getOperation:function(){return R.PNReceiveMessagesOperation},validateParams:function(t,e){return(null==e?void 0:e.channels)||(null==e?void 0:e.channelGroups)?(null==e?void 0:e.timetoken)?(null==e?void 0:e.region)?void 0:"region can not be empty":"timetoken can not be empty":"channels and channleGroups both should not be empty"},getURL:function(t,e){var n=t.config,r=e.channels?e.channels.join(","):",";return"/v2/subscribe/".concat(n.subscribeKey,"/").concat(A.encodeString(r),"/0")},getRequestTimeout:function(t){return t.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},getAbortSignal:function(t,e){return e.abortSignal},prepareParams:function(t,e){var n={};return e.channelGroups&&e.channelGroups.length>0&&(n["channel-group"]=e.channelGroups.join(",")),n.tt=e.timetoken,n.tr=e.region,n},handleResponse:function(t,e){var n=[];return e.m.forEach((function(t){var e={shard:parseInt(t.a,10),subscriptionMatch:t.b,channel:t.c,messageType:t.e,payload:t.d,flags:t.f,issuingClientId:t.i,subscribeKey:t.k,originationTimetoken:t.o,publishMetaData:{timetoken:t.p.t,region:t.p.r}};n.push(e)})),{messages:n,metadata:{region:e.t.r,timetoken:e.t.t}}}},$t=function(){function t(t){void 0===t&&(t=!1),this.sync=t,this.listeners=new Set}return t.prototype.subscribe=function(t){var e=this;return this.listeners.add(t),function(){e.listeners.delete(t)}},t.prototype.notify=function(t){var e=this,n=function(){e.listeners.forEach((function(e){e(t)}))};this.sync?n():setTimeout(n,0)},t}(),Xt=function(){function t(t){this.label=t,this.transitionMap=new Map,this.enterEffects=[],this.exitEffects=[]}return t.prototype.transition=function(t,e){var n;if(this.transitionMap.has(e.type))return null===(n=this.transitionMap.get(e.type))||void 0===n?void 0:n(t,e)},t.prototype.on=function(t,e){return this.transitionMap.set(t,e),this},t.prototype.with=function(t,e){return[this,t,null!=e?e:[]]},t.prototype.onEnter=function(t){return this.enterEffects.push(t),this},t.prototype.onExit=function(t){return this.exitEffects.push(t),this},t}(),Vt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.describe=function(t){return new Xt(t)},n.prototype.start=function(t,e){this.currentState=t,this.currentContext=e,this.notify({type:"engineStarted",state:t,context:e})},n.prototype.transition=function(t){var e,n,r,i,s,u;if(!this.currentState)throw new Error("Start the engine first");this.notify({type:"eventReceived",event:t});var c=this.currentState.transition(this.currentContext,t);if(c){var l=a(c,3),f=l[0],p=l[1],h=l[2];try{for(var d=o(this.currentState.exitEffects),g=d.next();!g.done;g=d.next()){var v=g.value;this.notify({type:"invocationDispatched",invocation:v(this.currentContext)})}}catch(t){e={error:t}}finally{try{g&&!g.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}var y=this.currentState;this.currentState=f;var b=this.currentContext;this.currentContext=p,this.notify({type:"transitionDone",fromState:y,fromContext:b,toState:f,toContext:p,event:t});try{for(var m=o(h),_=m.next();!_.done;_=m.next())v=_.value,this.notify({type:"invocationDispatched",invocation:v})}catch(t){r={error:t}}finally{try{_&&!_.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}try{for(var w=o(this.currentState.enterEffects),S=w.next();!S.done;S=w.next())v=S.value,this.notify({type:"invocationDispatched",invocation:v(this.currentContext)})}catch(t){s={error:t}}finally{try{S&&!S.done&&(u=w.return)&&u.call(w)}finally{if(s)throw s.error}}}},n}($t),Jt=function(){function t(t){this.dependencies=t,this.instances=new Map,this.handlers=new Map}return t.prototype.on=function(t,e){this.handlers.set(t,e)},t.prototype.dispatch=function(t){if("CANCEL"!==t.type){var e=this.handlers.get(t.type);if(!e)throw new Error("Unhandled invocation '".concat(t.type,"'"));var n=e(t.payload,this.dependencies);t.managed&&this.instances.set(t.type,n),n.start()}else if(this.instances.has(t.payload)){var r=this.instances.get(t.payload);null==r||r.cancel(),this.instances.delete(t.payload)}},t}();function Yt(t,e){var n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return{type:t,payload:null==e?void 0:e.apply(void 0,s([],a(n),!1))}};return n.type=t,n}function Qt(t,e){var n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return{type:t,payload:e.apply(void 0,s([],a(n),!1)),managed:!0}};return n.type=t,n.cancel={type:"CANCEL",payload:t,managed:!1},n}var Zt,te,ee,ne=function(t){function n(){var e=this.constructor,n=t.call(this,"The operation was aborted.")||this;return n.name="AbortError",Object.setPrototypeOf(n,e.prototype),n}return e(n,t),n}(Error),re=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._aborted=!1,e}return e(n,t),Object.defineProperty(n.prototype,"aborted",{get:function(){return this._aborted},enumerable:!1,configurable:!0}),n.prototype.throwIfAborted=function(){if(this._aborted)throw new ne},n.prototype.abort=function(){this._aborted=!0,this.notify(new ne)},n}($t),ie=function(t){function n(e,n,r){var i=t.call(this,e,n)||this;return i.asyncFunction=r,i.abortSignal=new re,i}return e(n,t),n.prototype.start=function(){this.asyncFunction(this.payload,this.abortSignal,this.dependencies)},n.prototype.cancel=function(){this.abortSignal.abort()},n}((function(t,e){this.payload=t,this.dependencies=e})),oe=function(t){return function(e,n){return new ie(e,n,t)}},ae=Qt("HANDSHAKE",(function(t,e){return{channels:t,groups:e}})),se=Qt("RECEIVE_EVENTS",(function(t,e,n){return{channels:t,groups:e,cursor:n}})),ue=(te=function(t){return t},ee=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{type:Zt,payload:te.apply(void 0,s([],a(t),!1)),managed:!1}},ee.type=Zt="EMIT_EVENTS",ee),ce=Qt("RECONNECT",(function(t){return t})),le=Qt("HANDSHAKE_RECONNECT",(function(t){return t})),fe=Yt("SUBSCRIPTION_CHANGE",(function(t,e){return{channels:t,groups:e}})),pe=Yt("DISCONNECT",(function(){return{}})),he=Yt("RECONNECT",(function(){return{}}));Yt("RESTORE",(function(t,e,n,r){return{channels:t,groups:e,timetoken:n,region:r}}));var de=Yt("HANDSHAKING_SUCCESS",(function(t){return t})),ge=Yt("HANDSHAKING_FAILURE",(function(t){return t})),ve=Yt("HANDSHAKING_RECONNECTING_SUCCESS",(function(t){return{cursor:t}})),ye=Yt("HANDSHAKING_RECONNECTING_FAILURE",(function(t){return t})),be=Yt("HANDSHAKING_RECONNECTING_GIVEUP",(function(){return{}})),me=Yt("HANDSHAKING_RECONNECTING_RETRY",(function(){return{}})),_e=Yt("RECEIVING_SUCCESS",(function(t,e){return{cursor:t,events:e}})),we=Yt("RECEIVING_FAILURE",(function(t){return t})),Se=Yt("RECONNECTING_SUCCESS",(function(t,e){return{cursor:t,events:e}})),Oe=Yt("RECONNECTING_FAILURE",(function(t){return t})),ke=Yt("RECONNECTING_GIVEUP",(function(){return{}})),Pe=Yt("RECONNECTING_RETRY",(function(){return{}})),Ee=function(t){function n(e,n){var o=t.call(this,n)||this;return o.on(ae.type,oe((function(t,n,a){var s=a.handshake;return r(o,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:n.throwIfAborted(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,s({abortSignal:n,channels:t.channels,channelGroups:t.groups})];case 2:return r=i.sent(),e.transition(de(r)),[3,4];case 3:return(o=i.sent())instanceof Error&&"Aborted"===o.message?[2]:o instanceof F?[2,e.transition(ge(o))]:[3,4];case 4:return[2]}}))}))}))),o.on(se.type,oe((function(t,n,a){var s=a.receiveEvents;return r(o,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:n.throwIfAborted(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,s({abortSignal:n,channels:t.channels,channelGroups:t.groups,timetoken:t.cursor.timetoken,region:t.cursor.region})];case 2:return r=i.sent(),e.transition(_e(r.metadata,r.messages)),[3,4];case 3:return(o=i.sent())instanceof Error&&"Aborted"===o.message?[2]:o instanceof F?[2,e.transition(we(o))]:[3,4];case 4:return[2]}}))}))}))),o.on(ue.type,oe((function(t,e,n){return n.receiveEvents,r(o,void 0,void 0,(function(){return i(this,(function(e){return t.length>0&&console.log(t),[2]}))}))}))),o.on(ce.type,oe((function(t,n,a){var s=a.receiveEvents,u=a.shouldRetry,c=a.getRetryDelay,l=a.delay;return r(o,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return u(t.reason,t.attempts)?(n.throwIfAborted(),[4,l(c(t.attempts))]):[2,e.transition(ke())];case 1:i.sent(),n.throwIfAborted(),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,s({abortSignal:n,channels:t.channels,channelGroups:t.groups,timetoken:t.cursor.timetoken,region:t.cursor.region})];case 3:return r=i.sent(),[2,e.transition(Se(r.metadata,r.messages))];case 4:return(o=i.sent())instanceof Error&&"Aborted"===o.message?[2]:o instanceof F?[2,e.transition(Oe(o))]:[3,5];case 5:return[2]}}))}))}))),o.on(le.type,oe((function(t,n,a){var s=a.handshake,u=a.shouldRetry,c=a.getRetryDelay,l=a.delay;return r(o,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return u(t.reason,t.attempts)?(n.throwIfAborted(),[4,l(c(t.attempts))]):[2,e.transition(be())];case 1:i.sent(),n.throwIfAborted(),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,s({abortSignal:n,channels:t.channels,channelGroups:t.groups})];case 3:return r=i.sent(),[2,e.transition(ve(r.metadata))];case 4:return(o=i.sent())instanceof Error&&"Aborted"===o.message?[2]:o instanceof F?[2,e.transition(ye(o))]:[3,5];case 5:return[2]}}))}))}))),o}return e(n,t),n}(Jt),Te=new Xt("STOPPED");Te.on(fe.type,(function(t,e){return Te.with({channels:e.payload.channels,groups:e.payload.groups})})),Te.on(he.type,(function(t){return Ue.with(n({},t))}));var Ae=new Xt("HANDSHAKE_FAILURE");Ae.on(me.type,(function(t){return je.with(n(n({},t),{attempts:0}))})),Ae.on(pe.type,(function(t){return Te.with({channels:t.channels,groups:t.groups})}));var xe=new Xt("STOPPED");xe.on(fe.type,(function(t,e){return xe.with({channels:e.payload.channels,groups:e.payload.groups,cursor:t.cursor})})),xe.on(he.type,(function(t){return Ne.with(n({},t))}));var Ce=new Xt("RECEIVE_FAILURE");Ce.on(Pe.type,(function(t){return Re.with(n(n({},t),{attempts:0}))})),Ce.on(pe.type,(function(t){return xe.with({channels:t.channels,groups:t.groups,cursor:t.cursor})}));var Re=new Xt("RECEIVE_RECONNECTING");Re.onEnter((function(t){return ce(t)})),Re.onExit((function(){return ce.cancel})),Re.on(Se.type,(function(t,e){return Ne.with({channels:t.channels,groups:t.groups,cursor:e.payload.cursor},[ue(e.payload.events)])})),Re.on(Oe.type,(function(t,e){return Re.with(n(n({},t),{attempts:t.attempts+1,reason:e.payload}))})),Re.on(ke.type,(function(t){return Ce.with({groups:t.groups,channels:t.channels,cursor:t.cursor,reason:t.reason})})),Re.on(pe.type,(function(t){return xe.with({channels:t.channels,groups:t.groups,cursor:t.cursor})}));var Ne=new Xt("RECEIVING");Ne.onEnter((function(t){return se(t.channels,t.groups,t.cursor)})),Ne.onExit((function(){return se.cancel})),Ne.on(_e.type,(function(t,e){return Ne.with(n(n({},t),{cursor:e.payload.cursor}),[ue(e.payload.events)])})),Ne.on(fe.type,(function(t,e){return 0===e.payload.channels.length&&0===e.payload.groups.length?Ie.with(void 0):Ne.with(n(n({},t),{channels:e.payload.channels,groups:e.payload.groups}))})),Ne.on(we.type,(function(t,e){return Re.with(n(n({},t),{attempts:0,reason:e.payload}))})),Ne.on(pe.type,(function(t){return xe.with({channels:t.channels,groups:t.groups,cursor:t.cursor})}));var je=new Xt("HANDSHAKE_RECONNECTING");je.onEnter((function(t){return le(t)})),je.onExit((function(){return ce.cancel})),je.on(Se.type,(function(t,e){return Ne.with({channels:t.channels,groups:t.groups,cursor:e.payload.cursor},[ue(e.payload.events)])})),je.on(Oe.type,(function(t,e){return je.with(n(n({},t),{attempts:t.attempts+1,reason:e.payload}))})),je.on(ke.type,(function(t){return Ae.with({groups:t.groups,channels:t.channels,reason:t.reason})})),je.on(pe.type,(function(t){return Te.with({channels:t.channels,groups:t.groups})}));var Ue=new Xt("HANDSHAKING");Ue.onEnter((function(t){return ae(t.channels,t.groups)})),Ue.onExit((function(){return ae.cancel})),Ue.on(fe.type,(function(t,e){return 0===e.payload.channels.length&&0===e.payload.groups.length?Ie.with(void 0):Ue.with({channels:e.payload.channels,groups:e.payload.groups})})),Ue.on(de.type,(function(t,e){return Ne.with({channels:t.channels,groups:t.groups,cursor:e.payload})})),Ue.on(ge.type,(function(t,e){return je.with(n(n({},t),{attempts:0,reason:e.payload}))})),Ue.on(pe.type,(function(t){return Te.with({channels:t.channels,groups:t.groups})}));var Ie=new Xt("UNSUBSCRIBED");Ie.on(fe.type,(function(t,e){return Ue.with({channels:e.payload.channels,groups:e.payload.groups})}));var Me=function(){function t(t){var e=this;this.engine=new Vt,this.channels=[],this.groups=[],this.dispatcher=new Ee(this.engine,t),this.engine.subscribe((function(t){"invocationDispatched"===t.type&&e.dispatcher.dispatch(t.invocation)})),this.engine.start(Ie,void 0)}return Object.defineProperty(t.prototype,"_engine",{get:function(){return this.engine},enumerable:!1,configurable:!0}),t.prototype.subscribe=function(t){var e=t.channels,n=t.groups;this.channels=s(s([],a(this.channels),!1),a(null!=e?e:[]),!1),this.groups=s(s([],a(this.groups),!1),a(null!=n?n:[]),!1),this.engine.transition(fe(this.channels,this.groups))},t.prototype.unsubscribe=function(t){var e=t.channels,n=t.groups;this.channels=this.channels.filter((function(t){var n;return null===(n=!(null==e?void 0:e.includes(t)))||void 0===n||n})),this.groups=this.groups.filter((function(t){var e;return null===(e=!(null==n?void 0:n.includes(t)))||void 0===e||e})),this.engine.transition(fe(this.channels.slice(0),this.groups.slice(0)))},t.prototype.unsubscribeAll=function(){this.channels=[],this.groups=[],this.engine.transition(fe(this.channels.slice(0),this.groups.slice(0)))},t.prototype.reconnect=function(){this.engine.transition(he())},t.prototype.disconnect=function(){this.engine.transition(pe())},t}(),He=function(){function t(t){var e=this,r=t.networking,i=t.cbor,o=new m({setup:t});this._config=o;var u=new O({config:o}),c=t.cryptography;r.init(o);var l=new D(o,i);this._tokenManager=l;var f=new N({maximumSamplesCount:6e4});this._telemetryManager=f;var p={config:o,networking:r,crypto:u,cryptography:c,tokenManager:l,telemetryManager:f,PubNubFile:t.PubNubFile};this.File=t.PubNubFile,this.encryptFile=function(t,n){return c.encryptFile(t,n,e.File)},this.decryptFile=function(t,n){return c.decryptFile(t,n,e.File)};var h=W.bind(this,p,Kt),d=W.bind(this,p,nt),g=W.bind(this,p,it),v=W.bind(this,p,at),y=W.bind(this,p,qt),b=new L;if(this._listenerManager=b,this.iAmHere=W.bind(this,p,it),this.iAmAway=W.bind(this,p,nt),this.setPresenceState=W.bind(this,p,at),this.handshake=W.bind(this,p,zt),this.receiveMessages=W.bind(this,p,Wt),!0===o.enableSubscribeBeta){var _=new Me({handshake:this.handshake,receiveEvents:this.receiveMessages});this.subscribe=_.subscribe.bind(_),this.unsubscribe=_.unsubscribe.bind(_),this.eventEngine=_}else{var w=new C({timeEndpoint:h,leaveEndpoint:d,heartbeatEndpoint:g,setStateEndpoint:v,subscribeEndpoint:y,crypto:p.crypto,config:p.config,listenerManager:b,getFileUrl:function(t){return gt(p,t)}});this.subscribe=w.adaptSubscribeChange.bind(w),this.unsubscribe=w.adaptUnsubscribeChange.bind(w),this.disconnect=w.disconnect.bind(w),this.reconnect=w.reconnect.bind(w),this.unsubscribeAll=w.unsubscribeAll.bind(w),this.getSubscribedChannels=w.getSubscribedChannels.bind(w),this.getSubscribedChannelGroups=w.getSubscribedChannelGroups.bind(w),this.setState=w.adaptStateChange.bind(w),this.presence=w.adaptPresenceChange.bind(w),this.destroy=function(t){w.unsubscribeAll(t),w.disconnect()}}this.addListener=b.addListener.bind(b),this.removeListener=b.removeListener.bind(b),this.removeAllListeners=b.removeAllListeners.bind(b),this.parseToken=l.parseToken.bind(l),this.setToken=l.setToken.bind(l),this.getToken=l.getToken.bind(l),this.channelGroups={listGroups:W.bind(this,p,J),listChannels:W.bind(this,p,Y),addChannels:W.bind(this,p,$),removeChannels:W.bind(this,p,X),deleteGroup:W.bind(this,p,V)},this.push={addChannels:W.bind(this,p,Q),removeChannels:W.bind(this,p,Z),deleteDevice:W.bind(this,p,et),listChannels:W.bind(this,p,tt)},this.hereNow=W.bind(this,p,st),this.whereNow=W.bind(this,p,rt),this.getState=W.bind(this,p,ot),this.grant=W.bind(this,p,Rt),this.grantToken=W.bind(this,p,jt),this.audit=W.bind(this,p,Ct),this.revokeToken=W.bind(this,p,Ut),this.publish=W.bind(this,p,Mt),this.fire=function(t,n){return t.replicate=!1,t.storeInHistory=!1,e.publish(t,n)},this.signal=W.bind(this,p,Ht),this.history=W.bind(this,p,Dt),this.deleteMessages=W.bind(this,p,Ft),this.messageCounts=W.bind(this,p,Gt),this.fetchMessages=W.bind(this,p,Bt),this.addMessageAction=W.bind(this,p,ut),this.removeMessageAction=W.bind(this,p,ct),this.getMessageActions=W.bind(this,p,lt),this.listFiles=W.bind(this,p,ft);var S=W.bind(this,p,pt);this.publishFile=W.bind(this,p,ht),this.sendFile=dt({generateUploadUrl:S,publishFile:this.publishFile,modules:p}),this.getFileUrl=function(t){return gt(p,t)},this.downloadFile=W.bind(this,p,vt),this.deleteFile=W.bind(this,p,yt),this.objects={getAllUUIDMetadata:W.bind(this,p,bt),getUUIDMetadata:W.bind(this,p,mt),setUUIDMetadata:W.bind(this,p,_t),removeUUIDMetadata:W.bind(this,p,wt),getAllChannelMetadata:W.bind(this,p,St),getChannelMetadata:W.bind(this,p,Ot),setChannelMetadata:W.bind(this,p,kt),removeChannelMetadata:W.bind(this,p,Pt),getChannelMembers:W.bind(this,p,Et),setChannelMembers:function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return W.call.apply(W,s([e,p,Tt,n({type:"set"},t)],a(r),!1))},removeChannelMembers:function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return W.call.apply(W,s([e,p,Tt,n({type:"delete"},t)],a(r),!1))},getMemberships:W.bind(this,p,At),setMemberships:function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return W.call.apply(W,s([e,p,xt,n({type:"set"},t)],a(r),!1))},removeMemberships:function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return W.call.apply(W,s([e,p,xt,n({type:"delete"},t)],a(r),!1))}},this.createUser=function(t){return e.objects.setUUIDMetadata({uuid:t.userId,data:t.data,include:t.include})},this.updateUser=this.createUser,this.removeUser=function(t){return e.objects.removeUUIDMetadata({uuid:null==t?void 0:t.userId})},this.fetchUser=function(t){return e.objects.getUUIDMetadata({uuid:null==t?void 0:t.userId,include:null==t?void 0:t.include})},this.fetchUsers=this.objects.getAllUUIDMetadata,this.createSpace=function(t){return e.objects.setChannelMetadata({channel:t.spaceId,data:t.data,include:t.include})},this.updateSpace=this.createSpace,this.removeSpace=function(t){return e.objects.removeChannelMetadata({channel:t.spaceId})},this.fetchSpace=function(t){return e.objects.getChannelMetadata({channel:t.spaceId,include:t.include})},this.fetchSpaces=this.objects.getAllChannelMetadata,this.time=h,this.stop=this.destroy,this.encrypt=u.encrypt.bind(u),this.decrypt=u.decrypt.bind(u),this.getAuthKey=p.config.getAuthKey.bind(p.config),this.setAuthKey=p.config.setAuthKey.bind(p.config),this.setCipherKey=p.config.setCipherKey.bind(p.config),this.getUUID=p.config.getUUID.bind(p.config),this.setUUID=p.config.setUUID.bind(p.config),this.getFilterExpression=p.config.getFilterExpression.bind(p.config),this.setFilterExpression=p.config.setFilterExpression.bind(p.config),this.setHeartbeatInterval=p.config.setHeartbeatInterval.bind(p.config),r.hasModule("proxy")&&(this.setProxy=function(t){p.config.setProxy(t),e.reconnect()})}return t.prototype.getVersion=function(){return this._config.getVersion()},t.prototype._addPnsdkSuffix=function(t,e){this._config._addPnsdkSuffix(t,e)},t.prototype.networkDownDetected=function(){this._listenerManager.announceNetworkDown(),this._config.restore?this.disconnect():this.destroy(!0)},t.prototype.networkUpDetected=function(){this._listenerManager.announceNetworkUp(),this.reconnect()},t.notificationPayload=function(t,e){return new H(t,e)},t.generateUUID=function(){return b()},t.OPERATIONS=R,t.CATEGORIES=x,t}(),Le=function(){function t(t){var e=this;this._modules={},Object.keys(t).forEach((function(n){e._modules[n]=t[n].bind(e)}))}return t.prototype.init=function(t){this._config=t,Array.isArray(this._config.origin)?this._currentSubDomain=Math.floor(Math.random()*this._config.origin.length):this._currentSubDomain=0,this._coreParams={},this.shiftStandardOrigin()},t.prototype.nextOrigin=function(){var t=this._config.secure?"https://":"http://";if("string"==typeof this._config.origin)return"".concat(t).concat(this._config.origin);this._currentSubDomain+=1,this._currentSubDomain>=this._config.origin.length&&(this._currentSubDomain=0);var e=this._config.origin[this._currentSubDomain];return"".concat(t).concat(e)},t.prototype.hasModule=function(t){return t in this._modules},t.prototype.shiftStandardOrigin=function(){return this._standardOrigin=this.nextOrigin(),this._standardOrigin},t.prototype.getStandardOrigin=function(){return this._standardOrigin},t.prototype.POSTFILE=function(t,e,n){return this._modules.postfile(t,e,n)},t.prototype.GETFILE=function(t,e,n){return this._modules.getfile(t,e,n)},t.prototype.POST=function(t,e,n,r){return this._modules.post(t,e,n,r)},t.prototype.PATCH=function(t,e,n,r){return this._modules.patch(t,e,n,r)},t.prototype.GET=function(t,e,n){return this._modules.get(t,e,n)},t.prototype.DELETE=function(t,e,n){return this._modules.del(t,e,n)},t.prototype._detectErrorCategory=function(t){if("ENOTFOUND"===t.code)return x.PNNetworkIssuesCategory;if("ECONNREFUSED"===t.code)return x.PNNetworkIssuesCategory;if("ECONNRESET"===t.code)return x.PNNetworkIssuesCategory;if("EAI_AGAIN"===t.code)return x.PNNetworkIssuesCategory;if(0===t.status||t.hasOwnProperty("status")&&void 0===t.status)return x.PNNetworkIssuesCategory;if(t.timeout)return x.PNTimeoutCategory;if("ETIMEDOUT"===t.code)return x.PNNetworkIssuesCategory;if(t.response){if(t.response.badRequest)return x.PNBadRequestCategory;if(t.response.forbidden)return x.PNAccessDeniedCategory}return x.PNUnknownCategory},t}(),De=function(){function t(t,e){this._base64ToBinary=e,this._decode=t}return t.prototype.decodeToken=function(t){var e="";t.length%4==3?e="=":t.length%4==2&&(e="==");var n=t.replace(/-/gi,"+").replace(/_/gi,"/")+e,r=this._decode(this._base64ToBinary(n));if("object"==typeof r)return r},t}(),Fe={exports:{}},Ge={exports:{}};!function(t){function e(t){if(t)return function(t){for(var n in e.prototype)t[n]=e.prototype[n];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}(Ge);var Be=Xe;Xe.default=Xe,Xe.stable=Qe,Xe.stableStringify=Qe;var Ke="[...]",qe="[Circular]",ze=[],We=[];function $e(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Xe(t,e,n,r){var i;void 0===r&&(r=$e()),Je(t,"",0,[],void 0,0,r);try{i=0===We.length?JSON.stringify(t,e,n):JSON.stringify(t,tn(e),n)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==ze.length;){var o=ze.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Ve(t,e,n,r){var i=Object.getOwnPropertyDescriptor(r,n);void 0!==i.get?i.configurable?(Object.defineProperty(r,n,{value:t}),ze.push([r,n,e,i])):We.push([e,n,t]):(r[n]=t,ze.push([r,n,e]))}function Je(t,e,n,r,i,o,a){var s;if(o+=1,"object"==typeof t&&null!==t){for(s=0;s<r.length;s++)if(r[s]===t)return void Ve(qe,t,e,i);if(void 0!==a.depthLimit&&o>a.depthLimit)return void Ve(Ke,t,e,i);if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)return void Ve(Ke,t,e,i);if(r.push(t),Array.isArray(t))for(s=0;s<t.length;s++)Je(t[s],s,s,r,t,o,a);else{var u=Object.keys(t);for(s=0;s<u.length;s++){var c=u[s];Je(t[c],c,s,r,t,o,a)}}r.pop()}}function Ye(t,e){return t<e?-1:t>e?1:0}function Qe(t,e,n,r){void 0===r&&(r=$e());var i,o=Ze(t,"",0,[],void 0,0,r)||t;try{i=0===We.length?JSON.stringify(o,e,n):JSON.stringify(o,tn(e),n)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==ze.length;){var a=ze.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return i}function Ze(t,e,n,r,i,o,a){var s;if(o+=1,"object"==typeof t&&null!==t){for(s=0;s<r.length;s++)if(r[s]===t)return void Ve(qe,t,e,i);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==a.depthLimit&&o>a.depthLimit)return void Ve(Ke,t,e,i);if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)return void Ve(Ke,t,e,i);if(r.push(t),Array.isArray(t))for(s=0;s<t.length;s++)Ze(t[s],s,s,r,t,o,a);else{var u={},c=Object.keys(t).sort(Ye);for(s=0;s<c.length;s++){var l=c[s];Ze(t[l],l,s,r,t,o,a),u[l]=t[l]}if(void 0===i)return u;ze.push([i,e,t]),i[e]=u}r.pop()}}function tn(t){return t=void 0!==t?t:function(t,e){return e},function(e,n){if(We.length>0)for(var r=0;r<We.length;r++){var i=We[r];if(i[1]===e&&i[0]===n){n=i[2],We.splice(r,1);break}}return t.call(this,e,n)}}var en=String.prototype.replace,nn=/%20/g,rn="RFC3986",on={default:rn,formatters:{RFC1738:function(t){return en.call(t,nn,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:rn},an=on,sn=Object.prototype.hasOwnProperty,un=Array.isArray,cn=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ln=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},r=0;r<t.length;++r)void 0!==t[r]&&(n[r]=t[r]);return n},fn={arrayToObject:ln,assign:function(t,e){return Object.keys(e).reduce((function(t,n){return t[n]=e[n],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],n=[],r=0;r<e.length;++r)for(var i=e[r],o=i.obj[i.prop],a=Object.keys(o),s=0;s<a.length;++s){var u=a[s],c=o[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(e.push({obj:o,prop:u}),n.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),n=e.obj[e.prop];if(un(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);e.obj[e.prop]=r}}}(e),t},decode:function(t,e,n){var r=t.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(t){return r}},encode:function(t,e,n,r,i){if(0===t.length)return t;var o=t;if("symbol"==typeof t?o=Symbol.prototype.toString.call(t):"string"!=typeof t&&(o=String(t)),"iso-8859-1"===n)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var a="",s=0;s<o.length;++s){var u=o.charCodeAt(s);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===an.RFC1738&&(40===u||41===u)?a+=o.charAt(s):u<128?a+=cn[u]:u<2048?a+=cn[192|u>>6]+cn[128|63&u]:u<55296||u>=57344?a+=cn[224|u>>12]+cn[128|u>>6&63]+cn[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&o.charCodeAt(s)),a+=cn[240|u>>18]+cn[128|u>>12&63]+cn[128|u>>6&63]+cn[128|63&u])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(un(t)){for(var n=[],r=0;r<t.length;r+=1)n.push(e(t[r]));return n}return e(t)},merge:function t(e,n,r){if(!n)return e;if("object"!=typeof n){if(un(e))e.push(n);else{if(!e||"object"!=typeof e)return[e,n];(r&&(r.plainObjects||r.allowPrototypes)||!sn.call(Object.prototype,n))&&(e[n]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(n);var i=e;return un(e)&&!un(n)&&(i=ln(e,r)),un(e)&&un(n)?(n.forEach((function(n,i){if(sn.call(e,i)){var o=e[i];o&&"object"==typeof o&&n&&"object"==typeof n?e[i]=t(o,n,r):e.push(n)}else e[i]=n})),e):Object.keys(n).reduce((function(e,i){var o=n[i];return sn.call(e,i)?e[i]=t(e[i],o,r):e[i]=o,e}),i)}},pn=fn,hn=on,dn=Object.prototype.hasOwnProperty,gn={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},vn=Array.isArray,yn=String.prototype.split,bn=Array.prototype.push,mn=function(t,e){bn.apply(t,vn(e)?e:[e])},_n=Date.prototype.toISOString,wn=hn.default,Sn={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:pn.encode,encodeValuesOnly:!1,format:wn,formatter:hn.formatters[wn],indices:!1,serializeDate:function(t){return _n.call(t)},skipNulls:!1,strictNullHandling:!1},On=function t(e,n,r,i,o,a,s,u,c,l,f,p,h,d){var g,v=e;if("function"==typeof s?v=s(n,v):v instanceof Date?v=l(v):"comma"===r&&vn(v)&&(v=pn.maybeMap(v,(function(t){return t instanceof Date?l(t):t}))),null===v){if(i)return a&&!h?a(n,Sn.encoder,d,"key",f):n;v=""}if("string"==typeof(g=v)||"number"==typeof g||"boolean"==typeof g||"symbol"==typeof g||"bigint"==typeof g||pn.isBuffer(v)){if(a){var y=h?n:a(n,Sn.encoder,d,"key",f);if("comma"===r&&h){for(var b=yn.call(String(v),","),m="",_=0;_<b.length;++_)m+=(0===_?"":",")+p(a(b[_],Sn.encoder,d,"value",f));return[p(y)+"="+m]}return[p(y)+"="+p(a(v,Sn.encoder,d,"value",f))]}return[p(n)+"="+p(String(v))]}var w,S=[];if(void 0===v)return S;if("comma"===r&&vn(v))w=[{value:v.length>0?v.join(",")||null:void 0}];else if(vn(s))w=s;else{var O=Object.keys(v);w=u?O.sort(u):O}for(var k=0;k<w.length;++k){var P=w[k],E="object"==typeof P&&void 0!==P.value?P.value:v[P];if(!o||null!==E){var T=vn(v)?"function"==typeof r?r(n,P):n:n+(c?"."+P:"["+P+"]");mn(S,t(E,T,r,i,o,a,s,u,c,l,f,p,h,d))}}return S},kn=fn,Pn=Object.prototype.hasOwnProperty,En=Array.isArray,Tn={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:kn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},An=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},xn=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Cn=function(t,e,n,r){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,a=n.depth>0&&/(\[[^[\]]*])/.exec(i),s=a?i.slice(0,a.index):i,u=[];if(s){if(!n.plainObjects&&Pn.call(Object.prototype,s)&&!n.allowPrototypes)return;u.push(s)}for(var c=0;n.depth>0&&null!==(a=o.exec(i))&&c<n.depth;){if(c+=1,!n.plainObjects&&Pn.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+i.slice(a.index)+"]"),function(t,e,n,r){for(var i=r?e:xn(e,n),o=t.length-1;o>=0;--o){var a,s=t[o];if("[]"===s&&n.parseArrays)a=[].concat(i);else{a=n.plainObjects?Object.create(null):{};var u="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,c=parseInt(u,10);n.parseArrays||""!==u?!isNaN(c)&&s!==u&&String(c)===u&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(a=[])[c]=i:"__proto__"!==u&&(a[u]=i):a={0:i}}i=a}return i}(u,e,n,r)}},Rn={formats:on,parse:function(t,e){var n=function(t){if(!t)return Tn;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?Tn.charset:t.charset;return{allowDots:void 0===t.allowDots?Tn.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:Tn.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:Tn.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Tn.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:Tn.comma,decoder:"function"==typeof t.decoder?t.decoder:Tn.decoder,delimiter:"string"==typeof t.delimiter||kn.isRegExp(t.delimiter)?t.delimiter:Tn.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:Tn.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:Tn.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:Tn.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:Tn.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Tn.strictNullHandling}}(e);if(""===t||null==t)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof t?function(t,e){var n,r={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=e.parameterLimit===1/0?void 0:e.parameterLimit,a=i.split(e.delimiter,o),s=-1,u=e.charset;if(e.charsetSentinel)for(n=0;n<a.length;++n)0===a[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[n]?u="utf-8":"utf8=%26%2310003%3B"===a[n]&&(u="iso-8859-1"),s=n,n=a.length);for(n=0;n<a.length;++n)if(n!==s){var c,l,f=a[n],p=f.indexOf("]="),h=-1===p?f.indexOf("="):p+1;-1===h?(c=e.decoder(f,Tn.decoder,u,"key"),l=e.strictNullHandling?null:""):(c=e.decoder(f.slice(0,h),Tn.decoder,u,"key"),l=kn.maybeMap(xn(f.slice(h+1),e),(function(t){return e.decoder(t,Tn.decoder,u,"value")}))),l&&e.interpretNumericEntities&&"iso-8859-1"===u&&(l=An(l)),f.indexOf("[]=")>-1&&(l=En(l)?[l]:l),Pn.call(r,c)?r[c]=kn.combine(r[c],l):r[c]=l}return r}(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),a=0;a<o.length;++a){var s=o[a],u=Cn(s,r[s],n,"string"==typeof t);i=kn.merge(i,u,n)}return kn.compact(i)},stringify:function(t,e){var n,r=t,i=function(t){if(!t)return Sn;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||Sn.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=hn.default;if(void 0!==t.format){if(!dn.call(hn.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var r=hn.formatters[n],i=Sn.filter;return("function"==typeof t.filter||vn(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:Sn.addQueryPrefix,allowDots:void 0===t.allowDots?Sn.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Sn.charsetSentinel,delimiter:void 0===t.delimiter?Sn.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:Sn.encode,encoder:"function"==typeof t.encoder?t.encoder:Sn.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:Sn.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:Sn.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:Sn.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Sn.strictNullHandling}}(e);"function"==typeof i.filter?r=(0,i.filter)("",r):vn(i.filter)&&(n=i.filter);var o,a=[];if("object"!=typeof r||null===r)return"";o=e&&e.arrayFormat in gn?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=gn[o];n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var u=0;u<n.length;++u){var c=n[u];i.skipNulls&&null===r[c]||mn(a,On(r[c],c,s,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset))}var l=a.join(i.delimiter),f=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),l.length>0?f+l:""}};function Nn(t){return Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nn(t)}var jn=function(t){return null!==t&&"object"===Nn(t)};function Un(t){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(t)}var In=jn,Mn=Hn;function Hn(t){if(t)return function(t){for(var e in Hn.prototype)Object.prototype.hasOwnProperty.call(Hn.prototype,e)&&(t[e]=Hn.prototype[e]);return t}(t)}Hn.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},Hn.prototype.parse=function(t){return this._parser=t,this},Hn.prototype.responseType=function(t){return this._responseType=t,this},Hn.prototype.serialize=function(t){return this._serializer=t,this},Hn.prototype.timeout=function(t){if(!t||"object"!==Un(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},Hn.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var Ln=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),Dn=new Set([408,413,429,500,502,503,504,521,522,524]);Hn.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(t,e);if(!0===n)return!0;if(!1===n)return!1}catch(t){console.error(t)}if(e&&e.status&&Dn.has(e.status))return!0;if(t){if(t.code&&Ln.has(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},Hn.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},Hn.prototype.then=function(t,e){var n=this;if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){r.on("abort",(function(){if(!(n._maxRetries&&n._maxRetries>n._retries))if(n.timedout&&n.timedoutError)e(n.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=n.status,t.method=n.method,t.url=n.url,e(t)}})),r.end((function(n,r){n?e(n):t(r)}))}))}return this._fullfilledPromise.then(t,e)},Hn.prototype.catch=function(t){return this.then(void 0,t)},Hn.prototype.use=function(t){return t(this),this},Hn.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},Hn.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},Hn.prototype.get=function(t){return this._header[t.toLowerCase()]},Hn.prototype.getHeader=Hn.prototype.get,Hn.prototype.set=function(t,e){if(In(t)){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},Hn.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},Hn.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(In(t)){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&this.field(n,t[n]);return this}if(Array.isArray(e)){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.field(t,e[r]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},Hn.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},Hn.prototype._auth=function(t,e,n,r){switch(n.type){case"basic":this.set("Authorization","Basic ".concat(r("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},Hn.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},Hn.prototype.redirects=function(t){return this._maxRedirects=t,this},Hn.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},Hn.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},Hn.prototype.send=function(t){var e=In(t),n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&In(this._data))for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._data[r]=t[r]);else"string"==typeof t?(n||this.type("form"),(n=this._header["content-type"])&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||n||this.type("json"),this},Hn.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},Hn.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.slice(e+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.slice(0,e)+"?"+n.join("&")}}},Hn.prototype._appendQueryString=function(){console.warn("Unsupported")},Hn.prototype._timeoutError=function(t,e,n){if(!this._aborted){var r=new Error("".concat(t+e,"ms exceeded"));r.timeout=e,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)}},Hn.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))};var Fn={};function Gn(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Bn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}Fn.type=function(t){return t.split(/ *; */).shift()},Fn.params=function(t){var e,n={},r=Gn(t.split(/ *; */));try{for(r.s();!(e=r.n()).done;){var i=e.value.split(/ *= */),o=i.shift(),a=i.shift();o&&a&&(n[o]=a)}}catch(t){r.e(t)}finally{r.f()}return n},Fn.parseLinks=function(t){var e,n={},r=Gn(t.split(/ *, */));try{for(r.s();!(e=r.n()).done;){var i=e.value.split(/ *; */),o=i[0].slice(1,-1);n[i[1].split(/ *= */)[1].slice(1,-1)]=o}}catch(t){r.e(t)}finally{r.f()}return n},Fn.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t};var Kn=Fn,qn=zn;function zn(t){if(t)return function(t){for(var e in zn.prototype)Object.prototype.hasOwnProperty.call(zn.prototype,e)&&(t[e]=zn.prototype[e]);return t}(t)}function Wn(t){return function(t){if(Array.isArray(t))return $n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return $n(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$n(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Xn(){this._defaults=[]}zn.prototype.get=function(t){return this.header[t.toLowerCase()]},zn.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=Kn.type(e);var n=Kn.params(e);for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(this[r]=n[r]);this.links={};try{t.link&&(this.links=Kn.parseLinks(t.link))}catch(t){}},zn.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t},["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(t){Xn.prototype[t]=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this._defaults.push({fn:t,args:n}),this}})),Xn.prototype._setDefaults=function(t){this._defaults.forEach((function(e){t[e.fn].apply(t,Wn(e.args))}))};var Vn=Xn;!function(t,e){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var r;"undefined"!=typeof window?r=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),r=void 0):r=self;var i=Ge.exports,o=Be,a=Rn,s=Mn,u=jn,c=qn,l=Vn;function f(){}t.exports=function(t,n){return"function"==typeof n?new e.Request("GET",t).end(n):1===arguments.length?new e.Request("GET",t):new e.Request(t,n)};var p=e=t.exports;e.Request=m,p.getXHR=function(){if(r.XMLHttpRequest&&(!r.location||"file:"!==r.location.protocol||!r.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var h="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function d(t){if(!u(t))return t;var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&g(e,n,t[n]);return e.join("&")}function g(t,e,n){if(void 0!==n)if(null!==n)if(Array.isArray(n))n.forEach((function(n){g(t,e,n)}));else if(u(n))for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&g(t,"".concat(e,"[").concat(r,"]"),n[r]);else t.push(encodeURI(e)+"="+encodeURIComponent(n));else t.push(encodeURI(e))}function v(t){for(var e,n,r={},i=t.split("&"),o=0,a=i.length;o<a;++o)-1===(n=(e=i[o]).indexOf("="))?r[decodeURIComponent(e)]="":r[decodeURIComponent(e.slice(0,n))]=decodeURIComponent(e.slice(n+1));return r}function y(t){return/[/+]json($|[^-\w])/i.test(t)}function b(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,n,r,i,o=t.split(/\r?\n/),a={},s=0,u=o.length;s<u;++s)-1!==(e=(n=o[s]).indexOf(":"))&&(r=n.slice(0,e).toLowerCase(),i=h(n.slice(e+1)),a[r]=i);return a}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function m(t,e){var n=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,r=null;try{r=new b(n)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,n.xhr?(e.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,e.status=n.xhr.status?n.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),n.callback(e)}n.emit("response",r);try{n._isResponseOK(r)||(t=new Error(r.statusText||r.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=r,t.status=r.status,n.callback(t,r)):n.callback(null,r)}))}function _(t,e,n){var r=p("DELETE",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r}p.serializeObject=d,p.parseString=v,p.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},p.serialize={"application/x-www-form-urlencoded":a.stringify,"application/json":o},p.parse={"application/x-www-form-urlencoded":v,"application/json":JSON.parse},c(b.prototype),b.prototype._parseBody=function(t){var e=p.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&y(this.type)&&(e=p.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},b.prototype.toError=function(){var t=this.req,e=t.method,n=t.url,r="cannot ".concat(e," ").concat(n," (").concat(this.status,")"),i=new Error(r);return i.status=this.status,i.method=e,i.url=n,i},p.Response=b,i(m.prototype),s(m.prototype),m.prototype.type=function(t){return this.set("Content-Type",p.types[t]||t),this},m.prototype.accept=function(t){return this.set("Accept",p.types[t]||t),this},m.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var i=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,i)},m.prototype.query=function(t){return"string"!=typeof t&&(t=d(t)),t&&this._query.push(t),this},m.prototype.attach=function(t,e,n){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,n||e.name)}return this},m.prototype._getFormData=function(){return this._formData||(this._formData=new r.FormData),this._formData},m.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var n=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),n(t,e)},m.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},m.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},m.prototype.ca=m.prototype.agent,m.prototype.buffer=m.prototype.ca,m.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},m.prototype.pipe=m.prototype.write,m.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},m.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||f,this._finalizeQueryString(),this._end()},m.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},m.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=p.getXHR();var e=this.xhr,n=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var n=e.readyState;if(n>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===n){var r;try{r=e.status}catch(t){r=0}if(!r){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var r=function(e,n){n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(t._uploadTimeoutTimer)),n.direction=e,t.emit("progress",n)};if(this.hasListeners("progress"))try{e.addEventListener("progress",r.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",r.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],o=this._serializer||p.serialize[i?i.split(";")[0]:""];!o&&y(i)&&(o=p.serialize["application/json"]),o&&(n=o(n))}for(var a in this.header)null!==this.header[a]&&Object.prototype.hasOwnProperty.call(this.header,a)&&e.setRequestHeader(a,this.header[a]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===n?null:n)},p.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){l.prototype[t.toLowerCase()]=function(e,n){var r=new p.Request(t,e);return this._setDefaults(r),n&&r.end(n),r}})),l.prototype.del=l.prototype.delete,p.get=function(t,e,n){var r=p("GET",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},p.head=function(t,e,n){var r=p("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},p.options=function(t,e,n){var r=p("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},p.del=_,p.delete=_,p.patch=function(t,e,n){var r=p("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},p.post=function(t,e,n){var r=p("POST",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},p.put=function(t,e,n){var r=p("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r}}(Fe,Fe.exports);var Jn=Fe.exports;function Yn(t){var e=(new Date).getTime(),n=(new Date).toISOString(),r=console&&console.log?console:window&&window.console&&window.console.log?window.console:console;r.log("<<<<<"),r.log("[".concat(n,"]"),"\n",t.url,"\n",t.qs),r.log("-----"),t.on("response",(function(n){var i=(new Date).getTime()-e,o=(new Date).toISOString();r.log(">>>>>>"),r.log("[".concat(o," / ").concat(i,"]"),"\n",t.url,"\n",t.qs,"\n",n.text),r.log("-----")}))}function Qn(t,e,n){var r=this;this._config.logVerbosity&&(t=t.use(Yn)),this._config.proxy&&this._modules.proxy&&(t=this._modules.proxy.call(this,t)),this._config.keepAlive&&this._modules.keepAlive&&(t=this._modules.keepAlive(t));var i=t;if(e.abortSignal)var o=e.abortSignal.subscribe((function(){i.abort(),o()}));return!0===e.forceBuffered?i="undefined"==typeof Blob?i.buffer().responseType("arraybuffer"):i.responseType("arraybuffer"):!1===e.forceBuffered&&(i=i.buffer(!1)),(i=i.timeout(e.timeout)).on("abort",(function(){return n({category:x.PNUnknownCategory,error:!0,operation:e.operation,errorData:new Error("Aborted")},null)})),i.end((function(t,i){var o,a={};if(a.error=null!==t,a.operation=e.operation,i&&i.status&&(a.statusCode=i.status),t){if(t.response&&t.response.text&&!r._config.logVerbosity)try{a.errorData=JSON.parse(t.response.text)}catch(e){a.errorData=t}else a.errorData=t;return a.category=r._detectErrorCategory(t),n(a,null)}if(e.ignoreBody)o={headers:i.headers,redirects:i.redirects,response:i};else try{o=JSON.parse(i.text)}catch(t){return a.errorData=i,a.error=!0,n(a,null)}return o.error&&1===o.error&&o.status&&o.message&&o.service?(a.errorData=o,a.statusCode=o.status,a.error=!0,a.category=r._detectErrorCategory(a),n(a,null)):(o.error&&o.error.message&&(a.errorData=o.error),n(a,o))})),i}function Zn(t,e,n){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return r=Jn.post(t),e.forEach((function(t){var e=t.key,n=t.value;r=r.field(e,n)})),r.attach("file",n,{contentType:"application/octet-stream"}),[4,r];case 1:return[2,i.sent()]}}))}))}function tr(t,e,n){var r=Jn.get(this.getStandardOrigin()+e.url).set(e.headers).query(t);return Qn.call(this,r,e,n)}function er(t,e,n){var r=Jn.get(this.getStandardOrigin()+e.url).set(e.headers).query(t);return Qn.call(this,r,e,n)}function nr(t,e,n,r){var i=Jn.post(this.getStandardOrigin()+n.url).query(t).set(n.headers).send(e);return Qn.call(this,i,n,r)}function rr(t,e,n,r){var i=Jn.patch(this.getStandardOrigin()+n.url).query(t).set(n.headers).send(e);return Qn.call(this,i,n,r)}function ir(t,e,n){var r=Jn.delete(this.getStandardOrigin()+e.url).set(e.headers).query(t);return Qn.call(this,r,e,n)}function or(t,e){var n=new Uint8Array(t.byteLength+e.byteLength);return n.set(new Uint8Array(t),0),n.set(new Uint8Array(e),t.byteLength),n.buffer}var ar,sr=function(){function t(){}return Object.defineProperty(t.prototype,"algo",{get:function(){return"aes-256-cbc"},enumerable:!1,configurable:!0}),t.prototype.encrypt=function(t,e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.getKey(t)];case 1:if(n=r.sent(),e instanceof ArrayBuffer)return[2,this.encryptArrayBuffer(n,e)];if("string"==typeof e)return[2,this.encryptString(n,e)];throw new Error("Cannot encrypt this file. In browsers file encryption supports only string or ArrayBuffer")}}))}))},t.prototype.decrypt=function(t,e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.getKey(t)];case 1:if(n=r.sent(),e instanceof ArrayBuffer)return[2,this.decryptArrayBuffer(n,e)];if("string"==typeof e)return[2,this.decryptString(n,e)];throw new Error("Cannot decrypt this file. In browsers file decryption supports only string or ArrayBuffer")}}))}))},t.prototype.encryptFile=function(t,e,n){return r(this,void 0,void 0,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getKey(t)];case 1:return r=i.sent(),[4,e.toArrayBuffer()];case 2:return o=i.sent(),[4,this.encryptArrayBuffer(r,o)];case 3:return a=i.sent(),[2,n.create({name:e.name,mimeType:"application/octet-stream",data:a})]}}))}))},t.prototype.decryptFile=function(t,e,n){return r(this,void 0,void 0,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getKey(t)];case 1:return r=i.sent(),[4,e.toArrayBuffer()];case 2:return o=i.sent(),[4,this.decryptArrayBuffer(r,o)];case 3:return a=i.sent(),[2,n.create({name:e.name,data:a})]}}))}))},t.prototype.getKey=function(t){return r(this,void 0,void 0,(function(){var e,n,r;return i(this,(function(i){switch(i.label){case 0:return e=Buffer.from(t),[4,crypto.subtle.digest("SHA-256",e.buffer)];case 1:return n=i.sent(),r=Buffer.from(Buffer.from(n).toString("hex").slice(0,32),"utf8").buffer,[2,crypto.subtle.importKey("raw",r,"AES-CBC",!0,["encrypt","decrypt"])]}}))}))},t.prototype.encryptArrayBuffer=function(t,e){return r(this,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:return n=crypto.getRandomValues(new Uint8Array(16)),r=or,o=[n.buffer],[4,crypto.subtle.encrypt({name:"AES-CBC",iv:n},t,e)];case 1:return[2,r.apply(void 0,o.concat([i.sent()]))]}}))}))},t.prototype.decryptArrayBuffer=function(t,e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(r){return n=e.slice(0,16),[2,crypto.subtle.decrypt({name:"AES-CBC",iv:n},t,e.slice(16))]}))}))},t.prototype.encryptString=function(t,e){return r(this,void 0,void 0,(function(){var n,r,o,a;return i(this,(function(i){switch(i.label){case 0:return n=crypto.getRandomValues(new Uint8Array(16)),r=Buffer.from(e).buffer,[4,crypto.subtle.encrypt({name:"AES-CBC",iv:n},t,r)];case 1:return o=i.sent(),a=or(n.buffer,o),[2,Buffer.from(a).toString("utf8")]}}))}))},t.prototype.decryptString=function(t,e){return r(this,void 0,void 0,(function(){var n,r,o,a;return i(this,(function(i){switch(i.label){case 0:return n=Buffer.from(e),r=n.slice(0,16),o=n.slice(16),[4,crypto.subtle.decrypt({name:"AES-CBC",iv:r},t,o)];case 1:return a=i.sent(),[2,Buffer.from(a).toString("utf8")]}}))}))},t.IV_LENGTH=16,t}(),ur=(ar=function(){function t(t){if(t instanceof File)this.data=t,this.name=this.data.name,this.mimeType=this.data.type;else if(t.data){var e=t.data;this.data=new File([e],t.name,{type:t.mimeType}),this.name=t.name,t.mimeType&&(this.mimeType=t.mimeType)}if(void 0===this.data)throw new Error("Couldn't construct a file out of supplied options.");if(void 0===this.name)throw new Error("Couldn't guess filename out of the options. Please provide one.")}return t.create=function(t){return new this(t)},t.prototype.toBuffer=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){throw new Error("This feature is only supported in Node.js environments.")}))}))},t.prototype.toStream=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){throw new Error("This feature is only supported in Node.js environments.")}))}))},t.prototype.toFileUri=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){throw new Error("This feature is only supported in react native environments.")}))}))},t.prototype.toBlob=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.data]}))}))},t.prototype.toArrayBuffer=function(){return r(this,void 0,void 0,(function(){var t=this;return i(this,(function(e){return[2,new Promise((function(e,n){var r=new FileReader;r.addEventListener("load",(function(){if(r.result instanceof ArrayBuffer)return e(r.result)})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(t.data)}))]}))}))},t.prototype.toString=function(){return r(this,void 0,void 0,(function(){var t=this;return i(this,(function(e){return[2,new Promise((function(e,n){var r=new FileReader;r.addEventListener("load",(function(){if("string"==typeof r.result)return e(r.result)})),r.addEventListener("error",(function(){n(r.error)})),r.readAsBinaryString(t.data)}))]}))}))},t.prototype.toFile=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.data]}))}))},t}(),ar.supportsFile="undefined"!=typeof File,ar.supportsBlob="undefined"!=typeof Blob,ar.supportsArrayBuffer="undefined"!=typeof ArrayBuffer,ar.supportsBuffer=!1,ar.supportsStream=!1,ar.supportsString=!0,ar.supportsEncryptFile=!0,ar.supportsFileUri=!1,ar);function cr(t){if(!navigator||!navigator.sendBeacon)return!1;navigator.sendBeacon(t)}function lr(t){for(var e=w.enc.Base64.parse(t).words,n=new ArrayBuffer(4*e.length),r=new Uint8Array(n),i=0,o=0,a=0;a<e.length;a+=1){var s=e[a];r[o=4*a]=(4278190080&s)>>24,r[o+1]=(16711680&s)>>16,r[o+2]=(65280&s)>>8,r[o+3]=255&s}for(var u=o+3;u>=o;u-=1)0===r[u]&&i<3&&(i+=1);return i>0?r.buffer.slice(0,r.byteLength-i):r.buffer}function fr(t){var e=function(t){return t&&"object"==typeof t&&t.constructor===Object};if(!e(t))return t;var n={};return Object.keys(t).forEach((function(r){var i=function(t){return"string"==typeof t||t instanceof String}(r),o=r,a=t[r];Array.isArray(r)||i&&r.indexOf(",")>=0?o=(i?r.split(","):r).reduce((function(t,e){return t+String.fromCharCode(e)}),""):(function(t){return"number"==typeof t&&isFinite(t)}(r)||i&&!isNaN(r))&&(o=String.fromCharCode(i?parseInt(r,10):10)),n[o]=e(a)?fr(a):a})),n}var pr=function(t){function n(e){var n=this,r=e.listenToBrowserNetworkEvents,i=void 0===r||r;return e.sdkFamily="Web",e.networking=new Le({del:ir,get:er,post:nr,patch:rr,sendBeacon:cr,getfile:tr,postfile:Zn}),e.cbor=new De((function(t){return fr(l.decode(t))}),lr),e.PubNubFile=ur,e.cryptography=new sr,n=t.call(this,e)||this,i&&(window.addEventListener("offline",(function(){n.networkDownDetected()})),window.addEventListener("online",(function(){n.networkUpDetected()}))),n}return e(n,t),n}(He);return pr}()}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.amdO={},__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AuthAgent:()=>bt});__webpack_require__(3439);var t=__webpack_require__(6635);function e(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var n=0;function r(t){return"__private_"+n+++"_"+t}__webpack_require__(7950),__webpack_require__(8319),__webpack_require__(3105),__webpack_require__(4908),__webpack_require__(5735),__webpack_require__(6886),__webpack_require__(523),__webpack_require__(8233);const i={autoLogin:!0,autoLogout:!0,autoRefreshToken:!1,idleTimeoutInMinutes:30,uniqueSession:!0,hooks:{}},o=["authHost","clientId","scopes"],a="/oauth/close";var s,u=r("authHost"),c=r("clientId"),l=r("xhr"),f=r("redirectUrl");class p{constructor(n,r){Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:void 0}),this.getRedirections=()=>new Promise(((t,n)=>{e(this,l)[l]({method:"GET",endpoint:"https://cdn.leap.com.au/leap_auth/auth_agent/redirections_v2.json",options:null,accessToken:void 0},((e,r)=>200===r?t(e):n(e)))})),this.exchangeAuthCodeForAccessToken=t=>new Promise(((n,r)=>{e(this,l)[l]({method:"POST",endpoint:`${e(this,u)[u]}/oauth/token`,options:{body:{grant_type:"authorization_code",code:t.code,code_verifier:t.verifier,client_id:e(this,c)[c],redirect_uri:t.redirectUri}},accessToken:void 0},((t,e)=>200===e?n(t):r(t)))})),this.renewAccessToken=t=>new Promise(((n,r)=>{e(this,l)[l]({method:"POST",endpoint:`${e(this,u)[u]}/oauth/token`,options:{body:{grant_type:"refresh_token",refresh_token:t.refreshToken,code_verifier:t.verifier,client_id:e(this,c)[c]}},accessToken:void 0},((t,e)=>200===e?n(t):r(t)))})),this.userInfo=t=>new Promise(((n,r)=>{e(this,l)[l]({method:"GET",endpoint:`${e(this,u)[u]}/api/userinfo`,options:null,accessToken:t},((t,e)=>200===e?n(t):r(t)))})),this.linkUser=t=>{const{jti:n,newWindow:r,callback:i}=t,o=r?e(this,u)[u]+a:t.redirectUrl,s=`/cloudprovider/link?client_id=${e(this,c)[c]}&prompt=none&jti=${n}&callback=${o}`;e(this,f)[f]({requestUrl:s,newWindow:r,callback:i})},this.unlinkUser=t=>{const{jti:n,newWindow:r,callback:i}=t,o=r?e(this,u)[u]+a:t.redirectUrl,s=`/cloudprovider/unlink?client_id=${e(this,c)[c]}&jti=${n}&callback=${o}`;e(this,f)[f]({requestUrl:s,newWindow:r,callback:i})},this.getCloudProviderToken=(t,n)=>{const r=`${e(this,u)[u]}/cloudprovider/accesstoken`+(n?"/"+n:"");return new Promise(((n,i)=>{e(this,l)[l]({method:"GET",endpoint:r,options:null,accessToken:t},((t,e)=>200===e?n(t):i(t)))}))},this.cloudProviderUserInfo=t=>new Promise(((n,r)=>{e(this,l)[l]({method:"GET",endpoint:`${e(this,u)[u]}/cloudprovider/userinfo`,options:null,accessToken:t},((t,e)=>200===e?n(t):r(t)))})),this.cloudProviderReauthenticate=t=>{const{nonce:n,newWindow:r,callback:i}=t,o=`/cloudprovider/reauthenticate?nonce=${n}&redirectUrl=${r?e(this,u)[u]+a:t.redirectUrl}`;e(this,f)[f]({requestUrl:o,newWindow:r,callback:i})},this.cloudProviderReauthenticateLink=t=>new Promise(((n,r)=>{e(this,l)[l]({method:"GET",endpoint:`${e(this,u)[u]}/cloudprovider/reauthenticate/link`,options:null,accessToken:t},((t,e)=>200===e?n(t):r(t)))})),this.statusAdminConsent=t=>new Promise(((n,r)=>{e(this,l)[l]({method:"GET",endpoint:`${e(this,u)[u]}/cloudprovider/adminconsent/status?client_id=${e(this,c)[c]}`,options:null,accessToken:t},((t,e)=>200===e?n(t):r(t)))})),this.getAdminConsent=t=>{const{domain:n,newWindow:r,callback:i}=t,o=r?e(this,u)[u]+a:t.redirectUrl,s=`/cloudprovider/adminconsent?client_id=${e(this,c)[c]}&redirectUrl=${o}${n?"&domain="+n:""}`;e(this,f)[f]({requestUrl:s,newWindow:r,callback:i})},this.revokeAdminConsent=t=>new Promise(((n,r)=>{e(this,l)[l]({method:"DELETE",endpoint:`${e(this,u)[u]}/cloudprovider/adminconsent?client_id=${e(this,c)[c]}`,options:null,accessToken:t},((t,e)=>200===e?n(t):r(t)))})),this.getLinkMap=(t,n)=>new Promise(((r,i)=>{e(this,l)[l]({method:"GET",endpoint:`${e(this,u)[u]}/cloudprovider/linkmap?client_id=${e(this,c)[c]}${n?"&allUsers=true":""}`,options:null,accessToken:t},((t,e)=>200===e?r(t):i(t)))})),this.setLinkMap=(t,n)=>new Promise(((r,i)=>{e(this,l)[l]({method:"PUT",endpoint:`${e(this,u)[u]}/cloudprovider/linkmap?client_id=${e(this,c)[c]}`,options:{body:n},accessToken:t},((t,e)=>200===e?r(t):i(t)))})),this.authoriseSupport=(t,n)=>{const{code:r,duration:i}=n;return new Promise(((n,o)=>{e(this,l)[l]({method:"POST",endpoint:`${e(this,u)[u]}/support/authorization`,options:{body:{requestCode:r,duration:i,client_id:e(this,c)[c]}},accessToken:t},((t,e)=>200===e?n(t):o(t)))}))},this.changePassword=t=>{const{newWindow:n,callback:r,redirectUrl:i}=t;let o=`/oauth/changepassword?client_id=${e(this,c)[c]}`,s="",l=!1;n?r&&"function"==typeof r?s=e(this,u)[u]+a:(s="",l=!0):s=e(this,u)[u]+"/oauth/logout?force=true&redirect_uri="+(i||window.location.href),s&&(o+=`&redirect_uri=${encodeURIComponent(s)}`),e(this,f)[f]({requestUrl:o,newWindow:n,callback:r,noListener:l})},Object.defineProperty(this,l,{writable:!0,value:(e,n)=>{const{method:r,endpoint:i,accessToken:o}=e;let{options:a}=e;a=(0,t.merge)({},{contentType:"application/json",accessControlAllowOrigin:"*",body:void 0},a||{});const s=new XMLHttpRequest;s.open(r,i,!0),s.setRequestHeader("Content-type",a.contentType),s.setRequestHeader("Access-Control-Allow-Origin",a.accessControlAllowOrigin),o&&s.setRequestHeader("Authorization","Bearer "+o),s.onload=()=>{try{let t;s.response&&(t=JSON.parse(s.response)),n(t,s.status)}catch(t){n(s.response,s.status)}},a.body&&(a.body=JSON.stringify(a.body)),s.send(a.body)}}),Object.defineProperty(this,f,{writable:!0,value:n=>{const{requestUrl:r,newWindow:i,callback:o,noListener:a}=n,s=e(this,u)[u]+r;if(i){const e=window.open(s,"_blank"),n=r=>{r&&"closeMe"===r.data&&e&&(e.close(),(0,t.isFunction)(o)&&(o(),window.removeEventListener("message",n,!1)))};a||window.addEventListener("message",n,!1)}else window.location.href=s}}),e(this,u)[u]=n,e(this,c)[c]=r}}var h=new Uint8Array(16);function d(){if(!s&&!(s="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return s(h)}const g=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const v=function(t){return"string"==typeof t&&g.test(t)};for(var y=[],b=0;b<256;++b)y.push((b+256).toString(16).substr(1));const m=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(y[t[e+0]]+y[t[e+1]]+y[t[e+2]]+y[t[e+3]]+"-"+y[t[e+4]]+y[t[e+5]]+"-"+y[t[e+6]]+y[t[e+7]]+"-"+y[t[e+8]]+y[t[e+9]]+"-"+y[t[e+10]]+y[t[e+11]]+y[t[e+12]]+y[t[e+13]]+y[t[e+14]]+y[t[e+15]]).toLowerCase();if(!v(n))throw TypeError("Stringified UUID is invalid");return n};const _=function(t){if(!v(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n};function w(t,e,n){function r(t,r,i,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=_(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+t.length);if(a.set(r),a.set(t,r.length),(a=n(a))[6]=15&a[6]|e,a[8]=63&a[8]|128,i){o=o||0;for(var s=0;s<16;++s)i[o+s]=a[s];return i}return m(a)}try{r.name=t}catch(i){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function S(t){return 14+(t+64>>>9<<4)+1}function O(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function k(t,e,n,r,i,o){return O((a=O(O(e,t),O(r,o)))<<(s=i)|a>>>32-s,n);var a,s}function P(t,e,n,r,i,o,a){return k(e&n|~e&r,t,e,i,o,a)}function E(t,e,n,r,i,o,a){return k(e&r|n&~r,t,e,i,o,a)}function T(t,e,n,r,i,o,a){return k(e^n^r,t,e,i,o,a)}function A(t,e,n,r,i,o,a){return k(n^(e|~r),t,e,i,o,a)}const x=function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){for(var e=[],n=32*t.length,r="0123456789abcdef",i=0;i<n;i+=8){var o=t[i>>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(15&o),16);e.push(a)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[S(e)-1]=e;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,a=0;a<t.length;a+=16){var s=n,u=r,c=i,l=o;n=P(n,r,i,o,t[a],7,-680876936),o=P(o,n,r,i,t[a+1],12,-389564586),i=P(i,o,n,r,t[a+2],17,606105819),r=P(r,i,o,n,t[a+3],22,-1044525330),n=P(n,r,i,o,t[a+4],7,-176418897),o=P(o,n,r,i,t[a+5],12,1200080426),i=P(i,o,n,r,t[a+6],17,-1473231341),r=P(r,i,o,n,t[a+7],22,-45705983),n=P(n,r,i,o,t[a+8],7,1770035416),o=P(o,n,r,i,t[a+9],12,-1958414417),i=P(i,o,n,r,t[a+10],17,-42063),r=P(r,i,o,n,t[a+11],22,-1990404162),n=P(n,r,i,o,t[a+12],7,1804603682),o=P(o,n,r,i,t[a+13],12,-40341101),i=P(i,o,n,r,t[a+14],17,-1502002290),n=E(n,r=P(r,i,o,n,t[a+15],22,1236535329),i,o,t[a+1],5,-165796510),o=E(o,n,r,i,t[a+6],9,-1069501632),i=E(i,o,n,r,t[a+11],14,643717713),r=E(r,i,o,n,t[a],20,-373897302),n=E(n,r,i,o,t[a+5],5,-701558691),o=E(o,n,r,i,t[a+10],9,38016083),i=E(i,o,n,r,t[a+15],14,-660478335),r=E(r,i,o,n,t[a+4],20,-405537848),n=E(n,r,i,o,t[a+9],5,568446438),o=E(o,n,r,i,t[a+14],9,-1019803690),i=E(i,o,n,r,t[a+3],14,-187363961),r=E(r,i,o,n,t[a+8],20,1163531501),n=E(n,r,i,o,t[a+13],5,-1444681467),o=E(o,n,r,i,t[a+2],9,-51403784),i=E(i,o,n,r,t[a+7],14,1735328473),n=T(n,r=E(r,i,o,n,t[a+12],20,-1926607734),i,o,t[a+5],4,-378558),o=T(o,n,r,i,t[a+8],11,-2022574463),i=T(i,o,n,r,t[a+11],16,1839030562),r=T(r,i,o,n,t[a+14],23,-35309556),n=T(n,r,i,o,t[a+1],4,-1530992060),o=T(o,n,r,i,t[a+4],11,1272893353),i=T(i,o,n,r,t[a+7],16,-155497632),r=T(r,i,o,n,t[a+10],23,-1094730640),n=T(n,r,i,o,t[a+13],4,681279174),o=T(o,n,r,i,t[a],11,-358537222),i=T(i,o,n,r,t[a+3],16,-722521979),r=T(r,i,o,n,t[a+6],23,76029189),n=T(n,r,i,o,t[a+9],4,-640364487),o=T(o,n,r,i,t[a+12],11,-421815835),i=T(i,o,n,r,t[a+15],16,530742520),n=A(n,r=T(r,i,o,n,t[a+2],23,-995338651),i,o,t[a],6,-198630844),o=A(o,n,r,i,t[a+7],10,1126891415),i=A(i,o,n,r,t[a+14],15,-1416354905),r=A(r,i,o,n,t[a+5],21,-57434055),n=A(n,r,i,o,t[a+12],6,1700485571),o=A(o,n,r,i,t[a+3],10,-1894986606),i=A(i,o,n,r,t[a+10],15,-1051523),r=A(r,i,o,n,t[a+1],21,-2054922799),n=A(n,r,i,o,t[a+8],6,1873313359),o=A(o,n,r,i,t[a+15],10,-30611744),i=A(i,o,n,r,t[a+6],15,-1560198380),r=A(r,i,o,n,t[a+13],21,1309151649),n=A(n,r,i,o,t[a+4],6,-145523070),o=A(o,n,r,i,t[a+11],10,-1120210379),i=A(i,o,n,r,t[a+2],15,718787259),r=A(r,i,o,n,t[a+9],21,-343485551),n=O(n,s),r=O(r,u),i=O(i,c),o=O(o,l)}return[n,r,i,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,n=new Uint32Array(S(e)),r=0;r<e;r+=8)n[r>>5]|=(255&t[r/8])<<r%32;return n}(t),8*t.length))};w("v3",48,x);const C=function(t,e,n){var r=(t=t||{}).random||(t.rng||d)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return m(r)};function R(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function N(t,e){return t<<e|t>>>32-e}const j=function(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var r=unescape(encodeURIComponent(t));t=[];for(var i=0;i<r.length;++i)t.push(r.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=t.length/4+2,a=Math.ceil(o/16),s=new Array(a),u=0;u<a;++u){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=t[64*u+4*l]<<24|t[64*u+4*l+1]<<16|t[64*u+4*l+2]<<8|t[64*u+4*l+3];s[u]=c}s[a-1][14]=8*(t.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(t.length-1)&4294967295;for(var f=0;f<a;++f){for(var p=new Uint32Array(80),h=0;h<16;++h)p[h]=s[f][h];for(var d=16;d<80;++d)p[d]=N(p[d-3]^p[d-8]^p[d-14]^p[d-16],1);for(var g=n[0],v=n[1],y=n[2],b=n[3],m=n[4],_=0;_<80;++_){var w=Math.floor(_/20),S=N(g,5)+R(w,v,y,b)+m+e[w]+p[_]>>>0;m=b,b=y,y=N(v,30)>>>0,v=g,g=S}n[0]=n[0]+g>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+y>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+m>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]};w("v5",80,j);var U=__webpack_require__(5967),I=__webpack_require__.n(U);const M="1",H="2",L="3";var D=r("pubnubKeys"),F=r("pubnub"),G=r("eventListeners"),B=r("initFirmChannel"),K=r("initUserChannel"),q=r("initUniqueSessionChannel");class z{constructor(){Object.defineProperty(this,D,{writable:!0,value:void 0}),Object.defineProperty(this,F,{writable:!0,value:void 0}),Object.defineProperty(this,G,{writable:!0,value:[]}),this.init=t=>{const{authHost:n,clientId:r,firmId:i,userId:o,uniqueSession:a}=t;e(this,B)[B](i,o),e(this,K)[K](o),a&&e(this,q)[q]({authHost:n,clientId:r})},this.destroy=()=>{e(this,F)[F]&&(e(this,F)[F].unsubscribeAll(),e(this,G)[G]=[])},this.registerEventListenerForUserChannel=n=>{const{topic:r,messageType:i,callback:o}=n;if(!(0,t.isFunction)(o))throw Error(`Registering Event Listener ${r} ${i}: callback needs to be a function`);e(this,G)[G].push({topic:r,messageType:i,callback:o})},Object.defineProperty(this,B,{writable:!0,value:(t,n)=>{e(this,F)[F].addListener({presence:t=>{const{action:r,uuid:i}=t;if(i!==e(this,D)[D].uuid&&("leave"===r||"timeout"===r)){const t=i.split("~"),e=t[0]||"",r=t[1]||"",o=t[2]||"",a=o===M||o===H||o===L;e===n&&"00000000-0000-0000-0000-000000000000"===r&&a&&bt.logout(!0)}}}),e(this,F)[F].subscribe({channels:[t],withPresence:!0})}}),Object.defineProperty(this,K,{writable:!0,value:n=>{e(this,F)[F].addListener({message:n=>{const{content:r}=n.message;if(r&&r.topic&&r.messageType&&r.data)for(const i of e(this,G)[G])if(i.topic===r.topic&&i.messageType===r.messageType&&i.callback&&(0,t.isFunction)(i.callback))return i.callback(r.data)}}),e(this,F)[F].subscribe({channels:[`user_${n}`],withPresence:!1})}}),Object.defineProperty(this,q,{writable:!0,value:t=>{const n=bt.getDecodedAccessToken(),{authHost:r,clientId:i}=t,{userId:o,sessionId:a,impersonatorId:s}=n;if(!n)return;const u=`auth-session-${o}`;e(this,F)[F].addListener({message:t=>{const e=bt.getDecodedAccessToken();e||bt.logout(!0);const{sessionId:n,impersonatorId:o,userId:a}=e;if(n&&t&&t.message){const e=t.message.sessionId,s=t.message.authHost,u=t.message.clientId,c=t.message.logout,l=o||t.message.impersonatorId;s===r&&(u===i&&e!==n||u!==i&&e===n&&c)&&(void 0!==l&&""!==l?console.log("user "+l+" impersonating user "+a):bt.logout(!0))}}}),e(this,F)[F].subscribe({channels:[u],withPresence:!0}),e(this,F)[F].publish({message:{authHost:r,clientId:i,sessionId:a,impersonatorId:s},channel:u},(t=>{t.error&&console.log("pubnub error")}))}}),e(this,D)[D]={publishKey:"pub-13f5288e-cd88-4ef9-9e68-0c11cd03ddb8",subscribeKey:"sub-a456f002-0095-11e2-9638-9581afc33ebf",uuid:C()},e(this,F)[F]=new(I())(e(this,D)[D])}}var W=__webpack_require__(1965);const $=t=>{const e="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";return Array.from({length:t},(()=>e[Math.floor(Math.random()*e.length)])).join("")};__webpack_require__(6708),__webpack_require__(5940),__webpack_require__(4112);const X=(t,e)=>{let n=!0;return Object.keys(e).forEach((r=>{t[r]!==e[r]&&(n=!1)})),n},V=(t,e)=>t.findIndex((t=>e.startsWith(`http://${t}`)||e.startsWith(`https://${t}`)))>=0,J=["afterLogin","beforeLogout"];var Y=r("accessToken"),Q=r("config"),Z=r("leapAuthService"),tt=r("notification"),et=r("refreshInfo"),nt=r("exchangeAuthCodeForAccessToken"),rt=r("verifyAndPerformRedirections"),it=r("startRefreshAccessTokenProcess"),ot=r("destroyRefreshAccessTokenProcess");class at{constructor(n){var r=this;Object.defineProperty(this,Y,{writable:!0,value:void 0}),Object.defineProperty(this,Q,{writable:!0,value:void 0}),Object.defineProperty(this,Z,{writable:!0,value:void 0}),Object.defineProperty(this,tt,{writable:!0,value:void 0}),Object.defineProperty(this,et,{writable:!0,value:void 0}),this.registerEventListenerForUserChannel=t=>{const{topic:n,messageType:r,callback:i}=t;e(this,tt)[tt].registerEventListenerForUserChannel({topic:n,messageType:r,callback:i})},this.initNotification=()=>{const t=this.getDecodedAccessToken();t&&e(this,tt)[tt].init({authHost:e(this,Q)[Q].authHost,clientId:e(this,Q)[Q].clientId,firmId:t.firmId,userId:t.userId,uniqueSession:!!e(this,Q)[Q].uniqueSession})},this.destroyNotification=()=>{e(this,tt)[tt].destroy()},this.login=async function(){if(await r.checkAuthCode()&&e(r,Y)[Y])return e(r,Y)[Y];{const n=$(64),i=$(6);window.sessionStorage.setItem(i,n);const o=(t=n,btoa((0,W.sha256)(t).toLowerCase())),a=e(r,Q)[Q].scopes.join(","),s=`${e(r,Q)[Q].authHost}/oauth/authorize?response_type=code&scope=${a}&client_id=${e(r,Q)[Q].clientId}&redirect_uri=${encodeURIComponent(window.location.href)}&code_challenge=${encodeURIComponent(o)}&code_challenge_method=SH256&state=${i}`;return void window.location.assign(s)}var t},this.logout=(t=!1,n)=>{e(this,Y)[Y]=void 0;const r=encodeURIComponent(n||window.location.href);window.location.href=`${e(this,Q)[Q].authHost}/oauth/logout?force=${t}&redirect_uri=${r}`,e(this,ot)[ot]()},this.getAccessToken=()=>void 0!==e(this,Y)[Y]&&e(this,Y)[Y]?e(this,Y)[Y]:(this.login(),""),this.getDecodedAccessToken=()=>{if(!e(this,Y)[Y])return;const t=e(this,Y)[Y].split(".")[1];if(t)try{const e=window.atob(t);return JSON.parse(e)}catch(n){throw Error("Fail to decode access token.")}},this.getHooks=()=>e(this,Q)[Q]?e(this,Q)[Q].hooks:void 0,this.setHook=n=>{const{name:r,callback:i}=n;if(J.indexOf(r)<0)throw Error("Unimplemented hook : "+r);if((0,t.isFunction)(i))throw Error("hook must be a function: "+r);e(this,Q)[Q]=Object.assign({},e(this,Q)[Q],{hooks:Object.assign({},e(this,Q)[Q].hooks,{[r]:i})})},this.autoLogin=()=>e(this,Q)[Q]&&e(this,Q)[Q].autoLogin||!1,this.autoLogout=()=>e(this,Q)[Q]&&e(this,Q)[Q].autoLogin||!1,this.idleTimeoutInMinutes=()=>e(this,Q)[Q]&&e(this,Q)[Q].idleTimeoutInMinutes||30,this.checkAuthCode=async function(){const t=window.location.search,n=new URLSearchParams(t),i=n.get("code"),o=n.get("state");if(i&&o){const t=window.sessionStorage.getItem(o);window.sessionStorage.removeItem(o),n.delete("code"),n.delete("state");const a=window.location.origin+"/"+n.toString();if(window.history.replaceState(null,"",a),t){const n=await e(r,nt)[nt]({code:i,verifier:t,redirectUri:a});return await e(r,rt)[rt]()||(e(r,Q)[Q].autoRefreshToken&&n.refresh_token&&n.expires_in&&(e(r,et)[et]={refreshToken:n.refresh_token,accessTokenExpireIn:n.expires_in,verifier:t,timer:void 0},console.log("---------------------refreshInfo",e(r,et)[et]),e(r,it)[it]()),e(r,Y)[Y]=n.access_token,console.log("---------------------accessToken",e(r,Y)[Y])),!0}return!1}return!1},this.getUserInfo=()=>e(this,Z)[Z].userInfo(e(this,Y)[Y]),this.linkUser=t=>{const n=this.getDecodedAccessToken();if(!n)return;const r=t.redirectUrl||window.location.href;e(this,Z)[Z].linkUser({redirectUrl:r,jti:n.jti,newWindow:t.newWindow,callback:t.callback})},this.unlinkUser=t=>{const n=this.getDecodedAccessToken();if(!n)return;const r=t.redirectUrl||window.location.href;e(this,Z)[Z].unlinkUser({redirectUrl:r,jti:n.jti,newWindow:t.newWindow,callback:t.callback})},this.getCloudProviderToken=t=>{if(!e(this,Y)[Y])throw Error("Not authenticated yet");return e(this,Z)[Z].getCloudProviderToken(e(this,Y)[Y],t)},this.cloudProviderUserInfo=()=>{if(!e(this,Y)[Y])throw Error("Not authenticated yet");return e(this,Z)[Z].cloudProviderUserInfo(e(this,Y)[Y])},this.cloudProviderReauthenticate=async function(t){if(!e(r,Y)[Y])throw Error("Not authenticated yet");let{nonce:n,redirectUrl:i}=t;const{newWindow:o,callback:a}=t;if(i=i||window.location.href,!n){n=(await e(r,Z)[Z].cloudProviderReauthenticateLink(e(r,Y)[Y])).nonce}return e(r,Z)[Z].cloudProviderReauthenticate({redirectUrl:i,nonce:n,newWindow:o,callback:a})},this.statusAdminConsent=()=>{if(!e(this,Y)[Y])throw Error("Not authenticated yet");return e(this,Z)[Z].statusAdminConsent(e(this,Y)[Y])},this.getAdminConsent=t=>{const n=t.redirectUrl||window.location.href;e(this,Z)[Z].getAdminConsent(Object.assign({},t,{redirectUrl:n}))},this.revokeAdminConsent=()=>{if(!e(this,Y)[Y])throw Error("Not authenticated yet");return e(this,Z)[Z].revokeAdminConsent(e(this,Y)[Y])},this.getLinkMap=(t=!1)=>{if(!e(this,Y)[Y])throw Error("Not authenticated yet");return e(this,Z)[Z].getLinkMap(e(this,Y)[Y],t)},this.setLinkMap=t=>{if(!e(this,Y)[Y])throw Error("Not authenticated yet");if(!(()=>{if(Array.isArray(t)){for(const e of t)if(!(e.internalUser&&e.externalUser&&e.externalUser.id))return!1;return!0}return!1})())throw Error("linkmap in wrong format");return e(this,Z)[Z].setLinkMap(e(this,Y)[Y],t)},this.authoriseSupport=t=>{if(!e(this,Y)[Y])throw Error("Not authenticated yet");return e(this,Z)[Z].authoriseSupport(e(this,Y)[Y],t)},this.changePassword=t=>{const n=t.redirectUrl||window.location.href;e(this,Z)[Z].changePassword(Object.assign({},t,{redirectUrl:n}))},Object.defineProperty(this,nt,{writable:!0,value:async function(t){const{code:n,verifier:i,redirectUri:o}=t;return e(r,Z)[Z].exchangeAuthCodeForAccessToken({code:n,verifier:i,redirectUri:o})}}),Object.defineProperty(this,rt,{writable:!0,value:async function(){const t=await e(r,Z)[Z].getRedirections(),n=((t,e,n)=>{let r,i;const o=n.topLevelDomains,a=n.environments,s=o.find((e=>t.endsWith(e)));if(s){for(let n=0;n<a.length;n++){const r=a[n];if(X(e,r.criteria)&&r.topLevelDomain!==s&&V(r.applications,t)){i=r;break}}i&&(r=`${i.authHost}/oauth/passthrough?jti=${e.jti}&redirect=${encodeURIComponent(t.replace(s,i.topLevelDomain))}`)}return r})(window.location.origin,r.getDecodedAccessToken(),t);return!!n&&(r.logout(!1,n),!0)}}),Object.defineProperty(this,it,{writable:!0,value:()=>{if(!e(this,et)[et])return;e(this,et)[et].timer&&(clearTimeout(e(this,et)[et].timer),e(this,et)[et]=Object.assign({},e(this,et)[et],{timer:void 0}));const t=1e3*(e(this,et)[et].accessTokenExpireIn-10),n=setTimeout((async function(){if(!e(r,et)[et])return;const t=await e(r,Z)[Z].renewAccessToken({refreshToken:e(r,et)[et].refreshToken,verifier:e(r,et)[et].verifier});t&&(t.refresh_token&&t.expires_in&&(e(r,et)[et]=Object.assign({},e(r,et)[et],{refreshToken:t.refresh_token,accessTokenExpireIn:t.expires_in}),e(r,it)[it]()),e(r,Y)[Y]=t.access_token)}),t);e(this,et)[et]=Object.assign({},e(this,et)[et],{timer:n})}}),Object.defineProperty(this,ot,{writable:!0,value:()=>{e(this,et)[et]&&(e(this,et)[et].timer&&clearTimeout(e(this,et)[et].timer),e(this,et)[et]=void 0)}}),e(this,Y)[Y]=void 0,e(this,Q)[Q]=(e=>{if((0,t.forEach)(o,(n=>{if(!(0,t.has)(e,n))throw Error("Missing config parameter : "+n)})),!(0,t.isArray)(e.scopes))throw Error("Scopes must be an array with string values");return Object.assign({},i,e)})(n),e(this,Z)[Z]=new p(e(this,Q)[Q].authHost,e(this,Q)[Q].clientId),e(this,tt)[tt]=new z}}var st=r("timeoutInMinutes"),ut=r("timer"),ct=r("onTimeout"),lt=r("cleanUpTracker"),ft=r("clearTimeout"),pt=r("resetTimer");class ht{constructor(t){Object.defineProperty(this,st,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),this.tracker=()=>{window.addEventListener("onload",e(this,pt)[pt],!0),window.addEventListener("mousemove",e(this,pt)[pt],!0),window.addEventListener("onmousedown",e(this,pt)[pt],!0),window.addEventListener("onscroll",e(this,pt)[pt],!0),window.addEventListener("onkeypress",e(this,pt)[pt],!0)},Object.defineProperty(this,lt,{writable:!0,value:()=>{window.removeEventListener("onload",e(this,pt)[pt],!0),window.removeEventListener("mousemove",e(this,pt)[pt],!0),window.removeEventListener("onmousedown",e(this,pt)[pt],!0),window.removeEventListener("onscroll",e(this,pt)[pt],!0),window.removeEventListener("onkeypress",e(this,pt)[pt],!0)}}),Object.defineProperty(this,ft,{writable:!0,value:()=>{e(this,ut)[ut]&&clearTimeout(e(this,ut)[ut])}}),Object.defineProperty(this,pt,{writable:!0,value:()=>{e(this,ft)[ft](),e(this,ut)[ut]=setTimeout((()=>{e(this,ft)[ft](),e(this,lt)[lt](),e(this,ct)[ct]()}),60*e(this,st)[st]*1e3)}});const{timeoutInMinutes:n,onTimeout:r}=t;e(this,st)[st]=n,e(this,ct)[ct]=r}}let dt;const gt=()=>dt?dt.getAccessToken():"",vt=async()=>{if(!dt)throw Error("Not init yet");return dt.login().then((e=>{var n;const r=null==(n=dt)?void 0:n.getHooks(),i=!!(e&&r&&(0,t.isFunction)(r.afterLogin))&&r.afterLogin(e);return Promise.resolve(i).then((()=>(e&&dt&&dt.initNotification(),e)))}))},yt=async(e=!1,n)=>{var r;if(!dt)throw Error("Not init yet");const i=null==(r=dt)?void 0:r.getHooks(),o=!(!i||!(0,t.isFunction)(i.beforeLogout))&&i.beforeLogout();return Promise.resolve(o).then((()=>{dt&&(dt.destroyNotification(),dt.logout(e,n))})).catch((function(t){throw console.error("Error while logging out : ",t),Error(t)}))},bt={init:async t=>{if(dt=new at(t),!dt)return!1;if(dt.autoLogout()){const t=dt.idleTimeoutInMinutes();new ht({timeoutInMinutes:t,onTimeout:yt}).tracker()}if(await dt.checkAuthCode())return gt();return dt.autoLogin()&&vt(),!0},registerHook:(t,e)=>{if(!dt)throw Error("Not init yet");dt&&dt.setHook({name:t,callback:e})},login:vt,logout:yt,getAccessToken:gt,getDecodedAccessToken:()=>{if(!dt)throw Error("Not init yet");return dt.getDecodedAccessToken()},userInfo:()=>{if(!dt)throw Error("Not init yet");return dt.getUserInfo()},linkUser:(t,e,n)=>{if(!dt)throw Error("Not init yet");dt.linkUser({redirectUrl:t,newWindow:e,callback:n})},unlinkUser:(t,e,n)=>{if(!dt)throw Error("Not init yet");dt.unlinkUser({redirectUrl:t,newWindow:e,callback:n})},getCloudProviderToken:t=>{if(!dt)throw Error("Not init yet");return dt.getCloudProviderToken(t)},cloudProviderUserInfo:()=>{if(!dt)throw Error("Not init yet");return dt.cloudProviderUserInfo()},cloudProviderReauthenticate:(t,e,n,r)=>{if(!dt)throw Error("Not init yet");return dt.cloudProviderReauthenticate({redirectUrl:e,nonce:t,newWindow:n,callback:r})},statusAdminConsent:()=>{if(!dt)throw Error("Not init yet");return dt.statusAdminConsent()},getAdminConsent:(t,e,n,r)=>{if(!dt)throw Error("Not init yet");dt.getAdminConsent({domain:t,redirectUrl:e,newWindow:n,callback:r})},revokeAdminConsent:()=>{if(!dt)throw Error("Not init yet");return dt.revokeAdminConsent()},getLinkMap:t=>{if(!dt)throw Error("Not init yet");return dt.getLinkMap(t)},setLinkMap:t=>{if(!dt)throw Error("Not init yet");return dt.setLinkMap(t)},authoriseSupport:(t,e)=>{if(!dt)throw Error("Not init yet");return dt.authoriseSupport({code:t,duration:e})},changePassword:(t,e,n)=>{if(!dt)throw Error("Not init yet");dt.changePassword({redirectUrl:t,newWindow:e,callback:n})},registerEventListener:(t,e,n)=>{if(!dt)throw Error("Not init yet");dt.registerEventListenerForUserChannel({topic:t,messageType:e,callback:n})}}})(),__webpack_exports__})()));
3
- //# sourceMappingURL=AuthAgent.umd.js.map