(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{400:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var t=/\((.*)\)/.exec(this.toString());return t?t[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(t,e){return e=this.concat.apply([],this),t>1&&e.some(Array.isArray)?e.flat(t-1):e},Array.prototype.flatMap=function(t,e){return this.map(t,e).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(t){if("function"!=typeof t)return this.then(t,t);var e=this.constructor||Promise;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){throw r}))}))}),Object.fromEntries||(Object.fromEntries=function(t){return Array.from(t).reduce((function(t,e){return t[e[0]]=e[1],t}),{})}),Array.prototype.at||(Array.prototype.at=function(t){var e=Math.trunc(t)||0;if(e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]})},6297:function(t,e,r){"use strict";var n,i=Object.create,o=Object.defineProperty,a=Object.defineProperties,s=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,l=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,p=(t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v=(t,e)=>{for(var r in e||(e={}))f.call(e,r)&&p(t,r,e[r]);if(h)for(var r of h(e))d.call(e,r)&&p(t,r,e[r]);return t},m=(t,e)=>a(t,u(e)),g=(t,e,r,n)=>{if(e&&"object"===typeof e||"function"===typeof e)for(let i of c(e))f.call(t,i)||i===r||o(t,i,{get:()=>e[i],enumerable:!(n=s(e,i))||n.enumerable});return t},y=(t,e,r)=>new Promise(((n,i)=>{var o=t=>{try{s(r.next(t))}catch(e){i(e)}},a=t=>{try{s(r.throw(t))}catch(e){i(e)}},s=t=>t.done?n(t.value):Promise.resolve(t.value).then(o,a);s((r=r.apply(t,e)).next())})),b={};((t,e)=>{for(var r in e)o(t,r,{get:e[r],enumerable:!0})})(b,{DefaultLogger:()=>C,ErrorCode:()=>x,FlagNotFoundError:()=>A,GeneralError:()=>E,InternalEventEmitter:()=>L,InvalidContextError:()=>R,LOG_LEVELS:()=>P,NOOP_PROVIDER:()=>z,NOOP_TRANSACTION_CONTEXT_PROPAGATOR:()=>U,OpenFeature:()=>Y,OpenFeatureAPI:()=>q,OpenFeatureClient:()=>K,OpenFeatureCommonAPI:()=>V,OpenFeatureError:()=>_,OpenFeatureEventEmitter:()=>N,ParseError:()=>S,ProviderEvents:()=>M,ProviderStatus:()=>D,SafeLogger:()=>I,StandardResolutionReasons:()=>w,TargetingKeyMissingError:()=>k,TypeMismatchError:()=>T,isObject:()=>Z,isString:()=>F,objectOrUndefined:()=>H,stringOrUndefined:()=>j}),t.exports=(n=b,g(o({},"__esModule",{value:!0}),n));var _=class extends Error{constructor(t){super(t),Object.setPrototypeOf(this,_.prototype),this.name="OpenFeatureError"}},w={TARGETING_MATCH:"TARGETING_MATCH",SPLIT:"SPLIT",DISABLED:"DISABLED",DEFAULT:"DEFAULT",UNKNOWN:"UNKNOWN",STATIC:"STATIC",CACHED:"CACHED",ERROR:"ERROR"},x=(t=>(t.PROVIDER_NOT_READY="PROVIDER_NOT_READY",t.FLAG_NOT_FOUND="FLAG_NOT_FOUND",t.PARSE_ERROR="PARSE_ERROR",t.TYPE_MISMATCH="TYPE_MISMATCH",t.TARGETING_KEY_MISSING="TARGETING_KEY_MISSING",t.INVALID_CONTEXT="INVALID_CONTEXT",t.GENERAL="GENERAL",t))(x||{}),E=class extends _{constructor(t){super(t),Object.setPrototypeOf(this,E.prototype),this.name="GeneralError",this.code="GENERAL"}},A=class extends _{constructor(t){super(t),Object.setPrototypeOf(this,A.prototype),this.name="FlagNotFoundError",this.code="FLAG_NOT_FOUND"}},S=class extends _{constructor(t){super(t),Object.setPrototypeOf(this,S.prototype),this.name="ParseError",this.code="PARSE_ERROR"}},T=class extends _{constructor(t){super(t),Object.setPrototypeOf(this,T.prototype),this.name="TypeMismatchError",this.code="TYPE_MISMATCH"}},k=class extends _{constructor(t){super(t),Object.setPrototypeOf(this,k.prototype),this.name="TargetingKeyMissingError",this.code="TARGETING_KEY_MISSING"}},R=class extends _{constructor(t){super(t),Object.setPrototypeOf(this,R.prototype),this.name="InvalidContextError",this.code="INVALID_CONTEXT"}},M=(t=>(t.Ready="PROVIDER_READY",t.Error="PROVIDER_ERROR",t.ConfigurationChanged="PROVIDER_CONFIGURATION_CHANGED",t.Stale="PROVIDER_STALE",t))(M||{}),C=class{error(...t){console.error(...t)}warn(...t){console.warn(...t)}info(){}debug(){}},P=["error","warn","info","debug"],I=class{constructor(t){this.fallbackLogger=new C;try{for(const e of P)if(!t[e]||"function"!==typeof t[e])throw new Error(`The provided logger is missing the ${e} method.`);this.logger=t}catch(e){console.error(e),console.error("Falling back to the default logger."),this.logger=this.fallbackLogger}}error(...t){this.log("error",...t)}warn(...t){this.log("warn",...t)}info(...t){this.log("info",...t)}debug(...t){this.log("debug",...t)}log(t,...e){try{this.logger[t](...e)}catch(r){this.fallbackLogger[t](...e)}}},O=((t,e,r)=>(r=null!=t?i(l(t)):{},g(!e&&t&&t.__esModule?r:o(r,"default",{value:t,enumerable:!0}),t)))(r(5293)),B=class{constructor(t){this.globalLogger=t,this._handlers=new WeakMap,this.eventEmitter=new O.default({captureRejections:!0}),this.eventEmitter.on("error",(t=>{var e;null==(e=this._logger)||e.error("Error running event handler:",t)}))}emit(t,e){this.eventEmitter.emit(t,e)}addHandler(t,e){const r=t=>y(this,null,(function*(){yield e(t)}));this._handlers.set(e,r),this.eventEmitter.on(t,r)}removeHandler(t,e){const r=this._handlers.get(e);r&&this.eventEmitter.removeListener(t,r)}removeAllHandlers(t){t?this.eventEmitter.removeAllListeners(t):this.eventEmitter.removeAllListeners()}getHandlers(t){return this.eventEmitter.listeners(t)}setLogger(t){return this._eventLogger=new I(t),this}get _logger(){var t,e;return null!=(e=this._eventLogger)?e:null==(t=this.globalLogger)?void 0:t.call(this)}},N=class extends B{},L=class extends B{},D=(t=>(t.NOT_READY="NOT_READY",t.READY="READY",t.ERROR="ERROR",t))(D||{}),U=new class{getTransactionContext(){return{}}setTransactionContext(t,e){e()}};function F(t){return"string"===typeof t}function j(t){return F(t)?t:void 0}function Z(t){return"object"===typeof t}function H(t){return Z(t)?t:void 0}function G(t){return"undefined"!==typeof t&&null!==t}var V=class{constructor(){this._hooks=[],this._transactionContextPropagator=U,this._context={},this._logger=new C,this._events=new L((()=>this._logger)),this._clientEventHandlers=new Map,this._clientProviders=new Map,this._clientEvents=new Map}addHooks(...t){return this._hooks=[...this._hooks,...t],this}getHooks(){return this._hooks}clearHooks(){return this._hooks=[],this}setLogger(t){return this._logger=new I(t),this}get providerMetadata(){return this._defaultProvider.metadata}addHandler(t,e){this._events.addHandler(t,e)}removeHandler(t,e){this._events.removeHandler(t,e)}getHandlers(t){return this._events.getHandlers(t)}setProvider(t,e){var r,n,i,o,a,s,u;const c=j(t),h=null!=(r=H(t))?r:H(e);if(!h)return this;const l=this.getProviderForClient(c);if(l===h)return this;const f=this.getAssociatedEventEmitters(c);if("function"===typeof h.initialize&&void 0===h.status){(this._logger||console).warn(`Provider ${null==(n=null==h?void 0:h.metadata)?void 0:n.name} implements 'initialize' but not 'status'. Please implement 'status'.`)}return"NOT_READY"===(null==h?void 0:h.status)&&"function"===typeof h.initialize?null==(a=null==(o=null==(i=h.initialize)?void 0:i.call(h,this._context))?void 0:o.then((()=>{var t;this.getAssociatedEventEmitters(c).forEach((t=>{null==t||t.emit("PROVIDER_READY",{clientName:c})})),null==(t=this._events)||t.emit("PROVIDER_READY",{clientName:c})})))||a.catch((t=>{var e;this.getAssociatedEventEmitters(c).forEach((e=>{null==e||e.emit("PROVIDER_ERROR",{clientName:c,message:t.message})})),null==(e=this._events)||e.emit("PROVIDER_ERROR",{clientName:c,message:t.message})})):(f.forEach((t=>{null==t||t.emit("PROVIDER_READY",{clientName:c})})),null==(s=this._events)||s.emit("PROVIDER_READY",{clientName:c})),c?this._clientProviders.set(c,h):this._defaultProvider=h,this.transferListeners(l,h,c,f),[...this._clientProviders.values(),this._defaultProvider].includes(l)||null==(u=null==l?void 0:l.onClose)||u.call(l),this}getProviderForClient(t){var e;return t&&null!=(e=this._clientProviders.get(t))?e:this._defaultProvider}buildAndCacheEventEmitterForClient(t){const e=this._clientEvents.get(t);if(e)return e;const r=new L((()=>this._logger));this._clientEvents.set(t,r);const n=this.getProviderForClient(t);return Object.values(M).forEach((e=>{var i;return null==(i=n.events)?void 0:i.addHandler(e,(n=>y(this,null,(function*(){r.emit(e,m(v({},n),{clientName:t}))}))))})),r}getUnboundEmitters(){const t=[...this._clientProviders.keys()];return[...[...this._clientEvents.keys()].filter(G).filter((e=>!t.includes(e))).map((t=>this._clientEvents.get(t))),this._clientEvents.get(void 0)].filter(G)}getAssociatedEventEmitters(t){return t?[this.buildAndCacheEventEmitterForClient(t)]:this.getUnboundEmitters()}transferListeners(t,e,r,n){var i;null==(i=this._clientEventHandlers.get(r))||i.forEach((e=>{var r;return null==(r=t.events)?void 0:r.removeHandler(...e)}));const o=Object.values(M).map((t=>[t,e=>y(this,null,(function*(){n.forEach((n=>{null==n||n.emit(t,m(v({},e),{clientName:r}))})),this._events.emit(t,m(v({},e),{clientName:r}))}))]));this._clientEventHandlers.set(r,o),o.forEach((t=>{var r;return null==(r=e.events)?void 0:r.addHandler(...t)}))}close(){return y(this,null,(function*(){var t,e;try{yield null==(e=null==(t=null==this?void 0:this._defaultProvider)?void 0:t.onClose)?void 0:e.call(t)}catch(n){this.handleShutdownError(this._defaultProvider,n)}const r=Array.from(this._clientProviders);yield Promise.all(r.map((t=>y(this,[t],(function*([,t]){var e;try{yield null==(e=t.onClose)?void 0:e.call(t)}catch(n){this.handleShutdownError(this._defaultProvider,n)}})))))}))}handleShutdownError(t,e){this._logger.error(`Error during shutdown of provider ${t.metadata.name}: ${e}`),this._logger.error(null==e?void 0:e.stack)}setTransactionContextPropagator(t){const e="Invalid TransactionContextPropagator, will not be set: ";return"function"!==typeof(null==t?void 0:t.getTransactionContext)?this._logger.error(`${e}: getTransactionContext is not a function.`):"function"!==typeof(null==t?void 0:t.setTransactionContext)?this._logger.error(`${e}: setTransactionContext is not a function.`):this._transactionContextPropagator=t,this}setTransactionContext(t,e,...r){this._transactionContextPropagator.setTransactionContext(t,e,...r)}getTransactionContext(){try{return this._transactionContextPropagator.getTransactionContext()}catch(t){const e=t;return this._logger.error(`Error getting transaction context: ${null==e?void 0:e.message}, returning empty context.`),this._logger.error(null==e?void 0:e.stack),{}}}},z=new class{constructor(){this.metadata={name:"No-op Provider"}}get status(){return"NOT_READY"}resolveBooleanEvaluation(t,e){return this.noOp(e)}resolveStringEvaluation(t,e){return this.noOp(e)}resolveNumberEvaluation(t,e){return this.noOp(e)}resolveObjectEvaluation(t,e){return this.noOp(e)}noOp(t){return Promise.resolve({value:t,reason:"No-op"})}},W=Symbol.for("@openfeature/js-sdk/api"),X=globalThis,q=class extends V{constructor(){super(),this._defaultProvider=z}static getInstance(){const t=X[W];if(t)return t;const e=new q;return X[W]=e,e}setContext(t){return this._context=t,this}getContext(){return this._context}getClient(t,e,r){var n,i;const o=j(t),a=j(e),s=null!=(i=null!=(n=H(t))?n:H(e))?i:H(r);return new K((()=>this.getProviderForClient(o)),(()=>this.buildAndCacheEventEmitterForClient(o)),(()=>this._logger),{name:o,version:a},s)}},Y=q.getInstance(),K=class{constructor(t,e,r,n,i={}){this.providerAccessor=t,this.emitterAccessor=e,this.globalLogger=r,this.options=n,this._hooks=[],this._context=i}get metadata(){return{name:this.options.name,version:this.options.version,providerMetadata:this.providerAccessor().metadata}}addHandler(t,e){var r;this.emitterAccessor().addHandler(t,e);const n=!this._provider.status||"READY"===this._provider.status;if("PROVIDER_READY"===t&&n)try{e({clientName:this.metadata.name})}catch(i){null==(r=this._logger)||r.error("Error running event handler:",i)}}removeHandler(t,e){this.emitterAccessor().removeHandler(t,e)}getHandlers(t){return this.emitterAccessor().getHandlers(t)}setLogger(t){return this._clientLogger=new I(t),this}setContext(t){return this._context=t,this}getContext(){return this._context}addHooks(...t){return this._hooks=[...this._hooks,...t],this}getHooks(){return this._hooks}clearHooks(){return this._hooks=[],this}getBooleanValue(t,e,r,n){return y(this,null,(function*(){return(yield this.getBooleanDetails(t,e,r,n)).value}))}getBooleanDetails(t,e,r,n){return this.evaluate(t,this._provider.resolveBooleanEvaluation,e,"boolean",r,n)}getStringValue(t,e,r,n){return y(this,null,(function*(){return(yield this.getStringDetails(t,e,r,n)).value}))}getStringDetails(t,e,r,n){return this.evaluate(t,this._provider.resolveStringEvaluation,e,"string",r,n)}getNumberValue(t,e,r,n){return y(this,null,(function*(){return(yield this.getNumberDetails(t,e,r,n)).value}))}getNumberDetails(t,e,r,n){return this.evaluate(t,this._provider.resolveNumberEvaluation,e,"number",r,n)}getObjectValue(t,e,r,n){return y(this,null,(function*(){return(yield this.getObjectDetails(t,e,r,n)).value}))}getObjectDetails(t,e,r,n){return this.evaluate(t,this._provider.resolveObjectEvaluation,e,"object",r,n)}evaluate(t,e,r,n){return y(this,arguments,(function*(t,e,r,n,i={},o={}){var a;const s=[...Y.getHooks(),...this.getHooks(),...o.hooks||[],...this._provider.hooks||[]],u=[...s].reverse(),c=v(v(v(v({},Y.getContext()),Y.getTransactionContext()),this._context),i),h={flagKey:t,defaultValue:r,flagValueType:n,clientMetadata:this.metadata,providerMetadata:Y.providerMetadata,context:c,logger:this._logger};try{const n=yield this.beforeHooks(s,h,o),i=yield e.call(this._provider,t,r,n,this._logger),c=m(v({},i),{flagMetadata:Object.freeze(null!=(a=i.flagMetadata)?a:{}),flagKey:t});return yield this.afterHooks(u,h,c,o),c}catch(l){const e=null==l?void 0:l.message,n=(null==l?void 0:l.code)||"GENERAL";return yield this.errorHooks(u,h,l,o),{errorCode:n,errorMessage:e,value:r,reason:w.ERROR,flagMetadata:Object.freeze({}),flagKey:t}}finally{yield this.finallyHooks(u,h,o)}}))}beforeHooks(t,e,r){return y(this,null,(function*(){var n;for(const i of t)Object.freeze(e),Object.assign(e.context,v(v({},e.context),yield null==(n=null==i?void 0:i.before)?void 0:n.call(i,e,Object.freeze(r.hookHints))));return Object.freeze(e.context)}))}afterHooks(t,e,r,n){return y(this,null,(function*(){var i;for(const o of t)yield null==(i=null==o?void 0:o.after)?void 0:i.call(o,e,r,n.hookHints)}))}errorHooks(t,e,r,n){return y(this,null,(function*(){var i;for(const a of t)try{yield null==(i=null==a?void 0:a.error)?void 0:i.call(a,e,r,n.hookHints)}catch(o){this._logger.error(`Unhandled error during 'error' hook: ${o}`),o instanceof Error&&this._logger.error(o.stack),this._logger.error(null==o?void 0:o.stack)}}))}finallyHooks(t,e,r){return y(this,null,(function*(){var n;for(const o of t)try{yield null==(n=null==o?void 0:o.finally)?void 0:n.call(o,e,r.hookHints)}catch(i){this._logger.error(`Unhandled error during 'finally' hook: ${i}`),i instanceof Error&&this._logger.error(i.stack),this._logger.error(null==i?void 0:i.stack)}}))}get _provider(){return this.providerAccessor()}get _logger(){return this._clientLogger||this.globalLogger()}}},584:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EnvPrefix=e.ConsoleText=e.ConsoleColor=void 0,function(t){t.Reset="\x1b[0m",t.Cyan="\x1b[36m",t.Red="\x1b[31m",t.Green="\x1b[32m"}(e.ConsoleColor||(e.ConsoleColor={})),function(t){t.ErrorTitle="\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:"}(e.ConsoleText||(e.ConsoleText={})),function(t){t.App="APP_"}(e.EnvPrefix||(e.EnvPrefix={}))},1673:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.envBoolean=e.envNumber=e.envString=e.envEnum=void 0;const n=r(584);e.envEnum=function(t,e,r){return()=>{if("string"===typeof t&&Object.values(e).includes(t))return t;if("string"===typeof r&&Object.values(e).includes(r))return r;throw new Error(`${n.ConsoleColor.Green}\u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c${n.ConsoleColor.Reset} - \u043e\u0434\u043d\u043e \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 ${Object.values(e)} | ${n.ConsoleColor.Red}\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438${n.ConsoleColor.Reset} - ${t}`)}},e.envString=function(t,e){return()=>{if("string"===typeof t&&""!==t)return t;if("string"===typeof e&&""!==e)return e;throw new Error(`${n.ConsoleColor.Green}\u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c${n.ConsoleColor.Reset} - \u0442\u0438\u043f String | ${n.ConsoleColor.Red}\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438${n.ConsoleColor.Reset} - ${typeof t}`)}},e.envNumber=function(t,e){return()=>{if(("string"===typeof t||"number"===typeof t)&&!Number.isNaN(Number(t)))return Number(t);if("number"===typeof e&&!Number.isNaN(e))return e;throw new Error(`${n.ConsoleColor.Green}\u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c${n.ConsoleColor.Reset} - \u0442\u0438\u043f Number | ${n.ConsoleColor.Red}\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438${n.ConsoleColor.Reset} - ${typeof t}`)}},e.envBoolean=function(t,e){return()=>{if("true"===t)return!0;if("false"===t)return!1;if("boolean"===typeof t)return t;if("boolean"===typeof e)return e;throw new Error(`${n.ConsoleColor.Green}\u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c${n.ConsoleColor.Reset} - \u0442\u0438\u043f Boolean | ${n.ConsoleColor.Red}\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438${n.ConsoleColor.Reset} - ${typeof t}`)}}},6406:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createEmptyOrInvalidEnvsErrorLog=void 0;const n=r(584);function i([t,e]){return`${n.ConsoleColor.Cyan}${t}: ${e}${n.ConsoleColor.Reset}`}e.createEmptyOrInvalidEnvsErrorLog=function(t){return["\n",n.ConsoleText.ErrorTitle,Object.entries(t).map(i).join("\n"),"\n"].join("\n")}},621:function(t,e,r){"use strict";var n=r(3454);Object.defineProperty(e,"__esModule",{value:!0}),e.validateAndCreate=void 0;const i=r(584),o=r(6406);e.validateAndCreate=function(t){const e={},r={};for(const n in t)try{if(!n.startsWith(i.EnvPrefix.App))throw new Error(`\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 ${i.EnvPrefix.App}`);const e=t[n]();r[n]=e}catch(a){a instanceof Error&&(e[n]=a.message)}if(Object.keys(e).length){const t=o.createEmptyOrInvalidEnvsErrorLog(e);if("undefined"!==typeof window)throw console.error(t),new Error(t);console.error(t),n.exit(1)}return r}},2502:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(621),e),i(r(6406),e),i(r(1673),e),i(r(584),e),i(r(1851),e)},1851:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1003:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FontMimeTypesList=e.defaultPwa=e.defaultSocial=e.defaultReferrerPolicy=e.defaultColorScheme=e.defaultThemeColor=e.defaultViewport=e.defaultFaviconUrl=void 0,e.defaultFaviconUrl="/static/common/favicon.png",e.defaultViewport="width=device-width, initial-scale=1",e.defaultThemeColor="#ffdd2d",e.defaultColorScheme="light only",e.defaultReferrerPolicy="strict-origin",e.defaultSocial={siteName:"\u0422-\u0411\u0430\u043d\u043a",siteTwitter:"https://\u0445.com/tbank_ru",type:"website",locale:"ru_RU",cardTwitter:"summary_large_image",appIdVk:"VK-RTRG-218928-gWfNz"},e.defaultPwa={manifest:"/manifest.json",serviceWorker:"/sw.js",icons:[{href:"https://tbank.ru/apple-touch-icon-57x57.png",rel:"apple-touch-icon",sizes:"57x57"},{href:"https://tbank.ru/apple-touch-icon-60x60.png",rel:"apple-touch-icon",sizes:"60x60"},{href:"https://tbank.ru/apple-touch-icon-72x72.png",rel:"apple-touch-icon",sizes:"72x72"},{href:"https://tbank.ru/apple-touch-icon-76x76.png",rel:"apple-touch-icon",sizes:"76x76"},{href:"https://tbank.ru/apple-touch-icon-114x114.png",rel:"apple-touch-icon",sizes:"114x114"},{href:"https://tbank.ru/apple-touch-icon-120x120.png",rel:"apple-touch-icon",sizes:"120x120"},{href:"https://tbank.ru/apple-touch-icon-144x144.png",rel:"apple-touch-icon",sizes:"144x144"},{href:"https://tbank.ru/apple-touch-icon-152x152.png",rel:"apple-touch-icon",sizes:"152x152"},{href:"https://tbank.ru/apple-touch-icon-180x180.png",rel:"apple-touch-icon",sizes:"180x180"},{href:"https://tbank.ru/android-chrome-192x192.png",rel:"android-touch-icon",sizes:"192x192",type:"image/png"},{href:"https://tbank.ru/favicon-16x16.png",rel:"icon",sizes:"16x16"},{href:"https://tbank.ru/favicon-16x16.png",rel:"icon",sizes:"16x16"},{href:"https://tbank.ru/favicon-32x32.png",rel:"icon",sizes:"32x32"},{href:"https://tbank.ru/favicon-96x96.png",rel:"icon",sizes:"96x96"},{rel:"icon",type:"image/png",href:"https://tbank.ru/android-chrome-192x192.png",sizes:"192x192"},{rel:"icon",href:"https://static.tinkoff.ru/dist/portal-new/images/favicon.ico",type:"image/x-icon"},{rel:"mask-icon",href:"https://tbank.ru/safari-pinned-tab.svg",color:"#333333"}]},function(t){t.eot="application/vnd.ms-fontobject",t.otf="font/otf",t.ttf="font/ttf",t.woff="font/woff",t.woff2="font/woff2"}(e.FontMimeTypesList||(e.FontMimeTypesList={}))},8232:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(1003),e),i(r(9657),e),i(r(8855),e)},8855:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9657:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HeadProject=void 0;const i=n(r(7294)),o=r(1003),a=r(6682);e.HeadProject=({title:t,cdnUrl:e,description:r,relativeFaviconPath:n,pwa:s,fonts:u,canonical:c,keywords:h,social:l,colorScheme:f,themeColor:d,viewport:p,wrapper:v,referrerPolicy:m,preload:g,formatDetection:y,verification:b})=>{const _=null!==s&&void 0!==s?s:o.defaultPwa,w=null!==f&&void 0!==f?f:o.defaultColorScheme,x=null!==d&&void 0!==d?d:o.defaultThemeColor,E=Object.assign(Object.assign({},l),o.defaultSocial),A=`${a.getCdnUrlWithoutSlashAtTheEnd(e)}${null!==n&&void 0!==n?n:o.defaultFaviconUrl}`,S=(t,e)=>i.default.createElement("link",Object.assign({key:e},t)),T=t=>i.default.createElement("link",{rel:"preload",href:t.href,type:t.type,as:"font"}),k=t=>i.default.createElement("link",{rel:"preload",href:t,as:"image"});return i.default.createElement(v,null,i.default.createElement("meta",{charSet:"utf-8"}),i.default.createElement("meta",{name:"referrer",content:null!==m&&void 0!==m?m:o.defaultReferrerPolicy}),i.default.createElement("meta",{name:"viewport",content:null!==p&&void 0!==p?p:o.defaultViewport}),i.default.createElement("title",null,t),i.default.createElement("meta",{name:"description",content:r}),(null===h||void 0===h?void 0:h.length)&&i.default.createElement("meta",{name:"keywords",content:h.join(", ")}),i.default.createElement("link",{rel:"icon",href:A}),c&&i.default.createElement("link",{rel:"canonical",href:c}),y&&i.default.createElement("meta",{name:"format-detection",content:y}),"object"===typeof g&&(t=>{var e,r;return i.default.createElement(i.default.Fragment,null,null===(e=null===t||void 0===t?void 0:t.fonts)||void 0===e?void 0:e.map(T),null===(r=null===t||void 0===t?void 0:t.images)||void 0===r?void 0:r.map(k))})(g),i.default.createElement("meta",{name:"color-scheme",content:w}),i.default.createElement("meta",{name:"theme-color",content:x}),"object"===typeof _&&(({manifest:t,serviceWorker:e,icons:r})=>i.default.createElement(i.default.Fragment,null,i.default.createElement("link",{rel:"manifest",href:t}),r.map(S),i.default.createElement("script",{dangerouslySetInnerHTML:{__html:a.createRegisterServiceWorkerScript(e)}})))(_),Array.isArray(u)&&(t=>i.default.createElement(i.default.Fragment,null,t.map(((t,e)=>i.default.createElement("link",{key:e,href:t,rel:"preconnect"}))),t.map(((t,e)=>i.default.createElement("link",{key:e,href:t,rel:"stylesheet"})))))(u),i.default.createElement("meta",{property:"og:title",content:E.title}),i.default.createElement("meta",{property:"og:description",content:E.description}),i.default.createElement("meta",{property:"og:image",content:E.image}),i.default.createElement("meta",{property:"og:image:alt",content:E.imageAlt}),i.default.createElement("meta",{property:"og:url",content:E.url}),i.default.createElement("meta",{property:"og:site_name",content:E.siteName}),i.default.createElement("meta",{property:"og:type",content:E.type}),i.default.createElement("meta",{property:"og:locale",content:E.locale}),i.default.createElement("meta",{property:"vk:image",content:E.imageVk}),i.default.createElement("meta",{name:"twitter:title",content:E.title}),i.default.createElement("meta",{name:"twitter:description",content:E.description}),i.default.createElement("meta",{name:"twitter:image",content:E.imageTwitter}),i.default.createElement("meta",{name:"twitter:image:alt",content:E.imageAltTwitter}),i.default.createElement("meta",{name:"twitter:site",content:E.siteTwitter}),i.default.createElement("meta",{name:"twitter:card",content:E.cardTwitter}),i.default.createElement("meta",{property:"fb:app_id",content:E.appIdFb}),E.appIdVk&&(R=E.appIdVk,i.default.createElement(i.default.Fragment,null,i.default.createElement("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:a.createVkPixelSnippet(R)}}),i.default.createElement("noscript",null,i.default.createElement("img",{src:`https://vk.com/rtrg?p=${E.appIdVk}`,style:{position:"fixed",left:"-999px"},alt:""})))),(null===b||void 0===b?void 0:b.yandex)&&i.default.createElement("meta",{name:"yandex-verification",content:b.yandex}),(null===b||void 0===b?void 0:b.google)&&i.default.createElement("meta",{name:"google-site-verification",content:b.google}));var R}},6682:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCdnUrlWithoutSlashAtTheEnd=e.createVkPixelSnippet=e.createRegisterServiceWorkerScript=void 0,e.createRegisterServiceWorkerScript=function(t){return`if (typeof window !== 'undefined') {\n window.addEventListener('load', function() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register('${t}').catch(console.error);\n }\n });\n }`},e.createVkPixelSnippet=function(t){return`\n !function(){\n var t = document.createElement("script");\n t.type="text/javascript",\n t.async=!0,\n t.src="https://vk.com/js/api/openapi.js?162",\n t.onload = function() {\n var VK = window.VK;\n if (!VK) return;\n VK.Retargeting.Init("${t}"),\n VK.Retargeting.Hit()\n },document.head.appendChild(t)}();\n `};e.getCdnUrlWithoutSlashAtTheEnd=t=>"/"!==t[t.length-1]?t:t.slice(0,-1)},4297:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STARTUP_HANDLER_INITIALIZATION_ERROR_MESSAGE=e.STARTUP_HANDLER_UNDEFINED_ERROR_MESSAGE=e.BASE_URL_EXTRACT_ERROR=e.SYNTAX_ERROR=e.NETWORK_ERROR_MESSAGE=e.REQUEST_ERROR_MESSAGE=e.RESPONSE_OK_STATUS=e.HEALTH_CHECK_SUCCESS_CODE=e.GET_HTTP_METHOD=e.defaultPropValues=e.baseStyles=void 0,e.baseStyles={documentBody:{display:"block",margin:0,padding:0,fontFamily:"'Open Sans', 'Segoe UI', '-apple-system', 'Roboto', 'Helvetica', 'Arial', sans-serif"},overlay:{position:"fixed",left:0,top:0,bottom:0,right:0,background:"#000",zIndex:999999},modal:{background:"#000",color:"#fff",overflow:"hidden",boxSizing:"border-box",padding:"32px 20px",width:"calc(100vw - 2 * 10px)",maxWidth:"500px",position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",borderRadius:"30px",maxHeight:"calc(100vh - 69px * 2)",display:"flex",flexDirection:"column",zIndex:2,fontWeight:400,fontSize:"16px",lineHeight:"25px",textAlign:"center",whiteSpace:"break-spaces"},body:{display:"flex",flexDirection:"column",alignItems:"center"},title:{fontWeight:700,fontSize:"20px",lineHeight:"28px",color:"#fff",margin:0},description:{margin:0,marginTop:"20px"},errorInfo:{opacity:.5,fontSize:"0.9em",margin:0,marginTop:"20px"},button:{color:"#fff",background:"#000",margin:"24px auto 0",height:"40px",padding:"0 24px",boxSizing:"border-box",borderRadius:"20px",fontWeight:600,fontSize:"16px",lineHeight:"21px",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",whiteSpace:"nowrap",width:"fit-content"}},e.defaultPropValues={staticCheckFile:"/healthz.json",errors:{staticAvailabilityError:{code:"F2998",title:"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435\xa0\u0442\u0430\u043a",description:"\u041c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c \u043e\xa0\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0438\xa0\u0440\u0435\u0448\u0430\u0435\u043c\xa0\u0435\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u0439\u0442\u0438 \u043f\u043e\u0437\u0436\u0435"},syntaxError:{code:"F2999",title:"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435\xa0\u0442\u0430\u043a",description:"\u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\xa0\u043e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435\xa0\u043d\u0430\u043c",buttonText:"\u0425\u043e\u0440\u043e\u0448\u043e"}}},e.GET_HTTP_METHOD="GET",e.HEALTH_CHECK_SUCCESS_CODE=200,e.RESPONSE_OK_STATUS={status:"OK"},e.REQUEST_ERROR_MESSAGE="\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435:",e.NETWORK_ERROR_MESSAGE="\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435:",e.SYNTAX_ERROR="syntaxerror",e.BASE_URL_EXTRACT_ERROR="\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u0438\u0437",e.STARTUP_HANDLER_UNDEFINED_ERROR_MESSAGE="startupErrorHandler \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d",e.STARTUP_HANDLER_INITIALIZATION_ERROR_MESSAGE="\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c startupErrorHandler"},5512:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HeadScriptStartupErrorHandler=void 0;const i=n(r(7294)),o=r(6438),a=r(4297);e.HeadScriptStartupErrorHandler=({wrapper:t,appStaticUrl:e,customStyles:r,errors:n=a.defaultPropValues.errors,staticCheckImage:s})=>{s||(s=`${(0,o.extractBaseUrl)(e)}${a.defaultPropValues.staticCheckFile}`);return i.default.createElement(t,null,i.default.createElement("style",{dangerouslySetInnerHTML:{__html:(0,o.generateStyles)({customStyles:r})}}),i.default.createElement("script",{src:`${e}/libs/startup-error-handler/bundle.min.js`,crossOrigin:"anonymous"}),i.default.createElement("script",{dangerouslySetInnerHTML:{__html:(t=>{const e=JSON.stringify(t);return`\n if (typeof window.startupErrorHandler === 'undefined') {\n console.error('${a.STARTUP_HANDLER_UNDEFINED_ERROR_MESSAGE}');\n } else if (typeof window.startupErrorHandler.init !== 'function') {\n console.error('${a.STARTUP_HANDLER_INITIALIZATION_ERROR_MESSAGE}');\n } else {\n window.startupErrorHandler.init(${e});\n }\n `})({staticCheckImage:s,errors:n})}}))}},9772:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.HeadScriptStartupErrorHandler=void 0;var o=r(5512);Object.defineProperty(e,"HeadScriptStartupErrorHandler",{enumerable:!0,get:function(){return o.HeadScriptStartupErrorHandler}}),i(r(5117),e)},5117:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6438:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateStyles=e.isSyntaxError=e.checkUrlAccessibility=e.createMessageFromErrorInfo=e.createHTMLElement=e.extractBaseUrl=void 0;const n=r(4297);e.extractBaseUrl=t=>{try{const{origin:e}=new URL(t);return e}catch(e){return console.error(`${n.BASE_URL_EXTRACT_ERROR} "${t}"`),""}};e.createHTMLElement=(t,e,r,n)=>{const i=document.createElement(t);return i.classList.add(r),n&&(i.innerHTML=n),e.appendChild(i),i};e.createMessageFromErrorInfo=t=>{let e=t.message;return t.filename&&(e+=" at "+t.filename),t.lineno&&(e+=":"+t.lineno),t.colno&&(e+=":"+t.colno),e};e.checkUrlAccessibility=(t,e)=>{const r=new XMLHttpRequest;r.open(n.GET_HTTP_METHOD,t,!0),r.onload=()=>{r.status===n.HEALTH_CHECK_SUCCESS_CODE?e(!1,n.RESPONSE_OK_STATUS):e(new Error(`${n.REQUEST_ERROR_MESSAGE} ${r.status}`),n.RESPONSE_OK_STATUS)},r.onerror=()=>{e(new Error(n.NETWORK_ERROR_MESSAGE),n.RESPONSE_OK_STATUS)},r.send()};e.isSyntaxError=t=>t.toLowerCase().includes(n.SYNTAX_ERROR);e.generateStyles=({customStyles:t})=>Object.entries(n.baseStyles).map((([e,r])=>`.${e}{${o(Object.assign(Object.assign({},r),null===t||void 0===t?void 0:t[e]))}}`)).join("");const i=new RegExp(/[A-Z]/g),o=t=>Object.keys(t).reduce(((e,r)=>`${e}${r.replace(i,(t=>`-${t.toLowerCase()}`))}:${t[r].toString()};`),"")},3938:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractStorage=void 0;e.AbstractStorage=class{}},7983:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NullStorage=void 0;const n=r(3938);class i extends n.AbstractStorage{getLength(){console.error(new Error("Storage.getLength(): storage is undefined"))}clear(){console.error(new Error("Storage.clear(): storage undefined"))}getItem(){console.error(new Error("Storage.getItem(): storage undefined"))}getItemObject(){console.error(new Error("Storage.getItemObject(): storage undefined"))}key(){console.error(new Error("Storage.key(): storage undefined"))}removeItem(){console.error(new Error("Storage.removeItem(): storage undefined"))}setItem(){console.error(new Error("Storage.setItem(): storage undefined"))}setItemObject(){console.error(new Error("Storage.setItemObject(): storage undefined"))}}e.NullStorage=i},5928:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RealStorage=void 0;const n=r(3938);class i extends n.AbstractStorage{constructor(t){super(),this.storage=t.storage,this.onError=t.onError}getLength(){return this.storage.length}clear(){return this.storage.clear()}getItem(t){try{return this.storage.getItem(t)}catch(e){return this.onError(e),null}}getItemObject(t){try{const e=this.getItem(t);return null!==e?JSON.parse(e):e}catch(e){return this.onError(e),null}}key(t){return this.storage.key(t)}removeItem(t){return this.storage.removeItem(t)}setItem(t,e){try{this.storage.setItem(t,e)}catch(r){this.onError(r)}}setItemObject(t,e){try{this.setItem(t,JSON.stringify(e))}catch(r){this.onError(r)}}}e.RealStorage=i},8275:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initSessionStorage=e.initLocalStorage=void 0;const n=r(5928),i=r(7983),o=r(3884),a=r(5652),s=r(7302),u=t=>{const e=e=>{if(t.onError)return t.onError(e);console.error(e)};if(s.isServer)return new i.NullStorage;const r=a.getWindowStorage(t.storageType,e);return r?new n.RealStorage({storage:r,onError:e}):new i.NullStorage};e.initLocalStorage=t=>u(Object.assign(Object.assign({},t),{storageType:o.StorageType.localStorage}));e.initSessionStorage=t=>u(Object.assign(Object.assign({},t),{storageType:o.StorageType.sessionStorage}))},7302:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isServer=void 0,e.isServer="undefined"===typeof window},3587:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(3884),e),i(r(8275),e),i(r(7983),e),i(r(5928),e),i(r(3938),e)},3884:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StorageType=void 0,function(t){t.localStorage="localStorage",t.sessionStorage="sessionStorage"}(e.StorageType||(e.StorageType={}))},5652:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getWindowStorage=void 0;e.getWindowStorage=(t,e)=>{try{const e="specialsStorageCheck";return window[t].setItem(e,"true"),window[t].removeItem(e),window[t]}catch(r){return e(r),null}}},8649:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QUERY_PARAMS_FOR_REPLACE_AFTER_LOGIN=e.INVALID_SESSION_ERROR_CODE=e.SSO_CLIENT_API_OPTIONS=e.SSO_API_OPTIONS=e.PROJECT_API_OPTIONS=e.PROJECT_USER_AUTH_OPTIONS=void 0,e.PROJECT_USER_AUTH_OPTIONS={query:{authTokenQueryName:"auth_token",completeUriQueryName:"complete_uri",postCompleteRedirectUriQueryName:"post_complete_redirect_uri"},pages:{projectLoginPage:"/auth/login"}},e.PROJECT_API_OPTIONS={userInfoUrl:"/v1/users/info",logoutUrl:"/v1/auth/logout",loginUrl:"/v1/auth/login",cookies:{authStatusCookieName:"spec_auth_status"}},e.SSO_API_OPTIONS={pingUrl:"/auth/ping",logoutUrl:"/auth/logout"},e.SSO_CLIENT_API_OPTIONS={validateUrl:"/validate",completeUrl:"/complete"},e.INVALID_SESSION_ERROR_CODE="B4001",e.QUERY_PARAMS_FOR_REPLACE_AFTER_LOGIN=["session_state","state","auth"]},3631:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8649),e),i(r(6148),e),i(r(5727),e),i(r(5857),e),i(r(6197),e),i(r(9285),e),i(r(2385),e),i(r(4862),e),i(r(5108),e),i(r(9696),e),i(r(4170),e),i(r(6766),e),i(r(4709),e),i(r(8352),e),i(r(8972),e),i(r(2519),e),i(r(7687),e),i(r(1897),e),i(r(8024),e),i(r(1132),e),i(r(2645),e),i(r(7980),e),i(r(3342),e)},6766:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ProjectUserAuth=void 0;const i=r(4709),o=r(9285),a=r(6197),s=r(8649);e.ProjectUserAuth=class{constructor(t,e,r,n,i,o,a){this.options=t,this.window=e,this.projectApi=r,this.ssoClientApi=n,this.ssoApi=i,this.iframeAuthStateSyncManager=o,this.legacyAuthAdapter=a,this.subscribers=new Set,this.iframeAuthStateSyncManager.onReceiveAuthStateFromIframe((t=>{this.notifySubscribers(t)}))}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}logout(){return n(this,void 0,void 0,(function*(){const t=[this.ssoApi.logout()];this.projectApi.hasAuthStatusCookie()&&t.push(this.projectApi.logout()),yield Promise.all(t),this.notifySubscribers({status:i.ProjectUserAuthStatus.Guest,error:void 0,data:void 0})}))}auth(){return n(this,void 0,void 0,(function*(){this.notifySubscribers({status:i.ProjectUserAuthStatus.Loading,error:void 0,data:void 0});try{const e=this.getAuthTokenFromQuery();if(e){this.clearAuthTokenQueryParam();try{yield this.ssoClientApi.validate()}catch(t){if(this.isUnauthorizedError(t))return void this.redirectToSsoClientLinkAuthPage(e)}}const r=yield this.legacyAuthAdapter.prepareAuth();let n;const o=this.needStartLogin();if(o&&(n=yield this.projectApi.login(r),this.clearAuthQueryParams()),o||this.projectApi.hasAuthStatusCookie())try{const t=yield this.projectApi.userInfo();return void this.notifySubscribers({status:i.ProjectUserAuthStatus.LoggedIn,error:void 0,data:{userInfo:t,login:n}})}catch(t){return void(this.isInvalidSessionError(t)?this.notifySubscribers({status:i.ProjectUserAuthStatus.Guest,data:void 0,error:void 0}):this.notifySubscribers({status:i.ProjectUserAuthStatus.Error,data:void 0,error:t}))}return void this.notifySubscribers({status:i.ProjectUserAuthStatus.Guest,error:void 0,data:void 0})}catch(t){return void this.notifySubscribers({status:i.ProjectUserAuthStatus.Error,data:void 0,error:t})}}))}redirectToSsoClientLinkAuthPage(t){const e=this.createSsoClientLinkAuthPageUrl();this.addThemeDefaultQuery(e),this.addAuthTokenQuery(e,t),this.addCompleteUriQuery(e),this.addPostCompleteRedirectUriQuery(e),this.window.location.href=e.toString()}addQueryFromCurrentUrlExceptAuthToken(t){const{query:e}=this.options,r=new URL(this.window.location.href);for(const[n,i]of r.searchParams)n!==e.authTokenQueryName&&t.searchParams.append(n,i)}addCompleteUriQuery(t){const{query:e}=this.options;t.searchParams.append(e.completeUriQueryName,this.window.location.origin+"/authorization/complete")}addPostCompleteRedirectUriQuery(t){const{query:e,pages:r}=this.options,n=new URL(this.window.location.origin+r.projectLoginPage);n.searchParams.append("auth","true"),this.addQueryFromCurrentUrlExceptAuthToken(n),t.searchParams.append(e.postCompleteRedirectUriQueryName,n.toString())}addThemeDefaultQuery(t){t.searchParams.append("theme","default")}addAuthTokenQuery(t,e){const{query:r}=this.options;t.searchParams.append(r.authTokenQueryName,e)}createSsoClientLinkAuthPageUrl(){return new URL(this.window.location.origin+"/authorization/authorize")}notifySubscribers(t){this.iframeAuthStateSyncManager.sendAuthStateToParentWindow(t),this.subscribers.forEach((e=>e(t)))}needStartLogin(){if("true"===new URLSearchParams(this.window.location.search).get("auth"))return!0;const t=this.window.location.pathname.replace(/\/$/,"");return this.options.pages.projectLoginPage===t}clearAuthQueryParams(){const t=new URL(this.window.location.href);s.QUERY_PARAMS_FOR_REPLACE_AFTER_LOGIN.forEach((e=>{t.searchParams.delete(e)})),this.window.history.replaceState(null,"",t.toString())}clearAuthTokenQueryParam(){const t=new URL(this.window.location.href);t.searchParams.delete(this.options.query.authTokenQueryName),this.window.history.replaceState(null,"",t.toString())}getAuthTokenFromQuery(){return new URLSearchParams(this.window.location.search).get(this.options.query.authTokenQueryName)}isInvalidSessionError(t){return a.HttpErrorProject.isHttpErrorProject(t)&&[s.INVALID_SESSION_ERROR_CODE].includes(t.errorCode)}isUnauthorizedError(t){return t instanceof a.HttpErrorBackend&&t.response.httpCode===o.HttpStatus.UNAUTHORIZED}}},4709:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProjectUserAuthStatus=void 0,function(t){t.Loading="Loading",t.LoggedIn="LoggedIn",t.Error="Error",t.Guest="Guest"}(e.ProjectUserAuthStatus||(e.ProjectUserAuthStatus={}))},8352:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ProjectUserAuthCreator=void 0;const i=n(r(9669)),o=r(8649),a=r(7980),s=r(4170),u=r(6766),c=r(5727),h=r(2385),l=r(2519),f=r(8972),d=r(7687),p=r(1897),v=r(8024),m=r(2645),g=r(2584);class y{static create({ssoApi:t,ssoClientApi:e,projectApi:r,srcOrigin:n,options:i}){const a=y.createSsoClientApi(e);return new u.ProjectUserAuth(i||o.PROJECT_USER_AUTH_OPTIONS,window,y.createProjectApi(r),a,y.createSsoApi(t),y.createIframeAuthStateSyncManager(n),y.createLegacyAuthAdapter(a))}static createIframeAuthStateSyncManager(t){return new a.IframeAuthStateSyncManager({srcOrigin:t},window)}static createProjectApi(t){return t instanceof p.ProjectApiBase?t:new f.ProjectApi(y.createHttpClient(t),o.PROJECT_API_OPTIONS,document)}static createSsoClientApi(t){return t instanceof v.SsoClientApiBase?t:new l.SsoClientApi(y.createHttpClient(t),o.SSO_CLIENT_API_OPTIONS)}static createSsoApi(t){return t instanceof m.SsoApiBase?t:new d.SsoApi(y.createHttpClient(t),o.SSO_API_OPTIONS)}static createHttpClient(t){return new c.HttpClient(new s.AxiosHttpAdapter(i.default.create({baseURL:t})),new h.HttpRetry)}static createLegacyAuthAdapter(t){return new g.LegacyAuthAdapter(window,t)}}e.ProjectUserAuthCreator=y},2584:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.LegacyAuthAdapter=void 0;e.LegacyAuthAdapter=class{constructor(t,e){this.window=t,this.ssoClientApi=e}prepareAuth(){return r(this,void 0,void 0,(function*(){const t=new URLSearchParams(this.window.location.search),e=t.get("code"),r=t.get("state"),n=t.get("session_state");if(!r||!n||!e)return;const i=yield this.ssoClientApi.complete({state:r,session_state:n,code:e}),o=new URL(this.window.location.href);return o.searchParams.append("auth","true"),o.searchParams.delete("code"),this.window.history.replaceState(null,"",o.toString()),i}))}}},8972:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ProjectApi=void 0;const i=r(1897);class o extends i.ProjectApiBase{constructor(t,e,r){super(),this.httpClient=t,this.options=e,this.document=r}hasAuthStatusCookie(){return this.document.cookie.includes(this.options.cookies.authStatusCookieName)}logout(){return n(this,void 0,void 0,(function*(){yield this.httpClient.post({url:this.options.logoutUrl})}))}login(t){return n(this,void 0,void 0,(function*(){return(yield this.httpClient.post({url:this.options.loginUrl,body:t?{accessTokenSso:t}:void 0})).payload}))}userInfo(){return n(this,void 0,void 0,(function*(){return(yield this.httpClient.get({url:this.options.userInfoUrl})).payload}))}}e.ProjectApi=o},1897:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProjectApiBase=void 0;e.ProjectApiBase=class{}},7687:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.SsoApi=void 0;const i=r(2645);class o extends i.SsoApiBase{constructor(t,e){super(),this.httpClient=t,this.options=e}ping(){return n(this,void 0,void 0,(function*(){yield this.httpClient.post({url:this.options.pingUrl,withCredentials:!0})}))}logout(){return n(this,void 0,void 0,(function*(){yield this.httpClient.post({url:this.options.logoutUrl,withCredentials:!0})}))}}e.SsoApi=o},2645:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SsoApiBase=void 0;e.SsoApiBase=class{}},2519:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.SsoClientApi=void 0;const i=r(8024);class o extends i.SsoClientApiBase{constructor(t,e){super(),this.httpClient=t,this.options=e}validate(){return n(this,void 0,void 0,(function*(){return yield this.httpClient.get({url:this.options.validateUrl,withCredentials:!0})}))}complete(t){return n(this,void 0,void 0,(function*(){const{access_token:e}=yield this.httpClient.get({url:this.options.completeUrl,withCredentials:!0,query:t});return e}))}}e.SsoClientApi=o},8024:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SsoClientApiBase=void 0;e.SsoClientApiBase=class{}},1132:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7980:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IframeAuthStateSyncManager=void 0;const n=r(3342);e.IframeAuthStateSyncManager=class{constructor(t,e){this.options=t,this.window=e}onReceiveAuthStateFromIframe(t){const e=e=>{this.isSameOrigin(e)&&this.isMessageByProjectUserAuthenticator(e)&&t(this.parseJsonProjectUserState(e.data.state))};return this.window.addEventListener("message",e),()=>this.window.removeEventListener("message",e)}sendAuthStateToParentWindow(t){if(this.window.parent!==this.window){const e={type:n.IframeEventType.StateChanged,state:JSON.stringify(t)};this.window.parent.postMessage(e,this.options.srcOrigin)}}isSameOrigin(t){return this.normalizeOrigin(t.origin)===this.normalizeOrigin(this.options.srcOrigin)}parseJsonProjectUserState(t){return JSON.parse(t)}isMessageByProjectUserAuthenticator(t){var e;return Boolean((null===(e=null===t||void 0===t?void 0:t.data)||void 0===e?void 0:e.type)===n.IframeEventType.StateChanged)}normalizeOrigin(t){return t.replace(/\/$/,"")}}},3342:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IframeEventType=void 0,function(t){t.StateChanged="spec:project-user-auth:state-changed"}(e.IframeEventType||(e.IframeEventType={}))},5727:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HttpClient=void 0;e.HttpClient=class{constructor(t,e){this.httpAdapter=t,this.httpRetry=e}get(t){return this.withRetry(Object.assign({method:"GET"},t))}post(t){return this.withRetry(Object.assign({method:"POST"},t))}patch(t){return this.withRetry(Object.assign({method:"PATCH"},t))}put(t){return this.withRetry(Object.assign({method:"PUT"},t))}delete(t){return this.withRetry(Object.assign({method:"DELETE"},t))}subscribe(t,e){return this.httpAdapter.subscribe(t,e)}withRetry(t){return this.httpRetry.retry({retryConfigData:t.retry,makeHttpRequestCallback:e=>this.httpAdapter.request(Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({},t.headers),e)}))})}}},5857:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6197:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HttpErrorProject=e.HttpErrorBackend=e.HttpErrorNoResponse=e.HttpErrorUnknown=void 0;class r extends Error{constructor(t,e){super(t),this.error=e}}e.HttpErrorUnknown=r;class n extends Error{constructor(t,e){super(t),this.request=e}}e.HttpErrorNoResponse=n;class i extends Error{constructor(t,e){super(t),this.response=e}static isHttpErrorBackend(t){return!!t&&(Object.prototype.hasOwnProperty.call(t,"response")&&Object.prototype.hasOwnProperty.call(t.response,"httpCode"))}}e.HttpErrorBackend=i;class o extends Error{constructor(t,e){super(t),this.httpCode=e.httpCode,this.errorCode=e.errorCode,this.errorPayload=e.errorPayload,this.errorMessage=e.errorMessage,this.timestamp=e.timestamp,this.requestId=e.requestId}static isHttpErrorProject(t){return!!t&&["httpCode","errorCode","errorMessage","timestamp"].every((e=>Object.prototype.hasOwnProperty.call(t,e)))}}e.HttpErrorProject=o},9285:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HttpStatus=void 0,function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLYHINTS=103]="EARLYHINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.AMBIGUOUS=300]="AMBIGUOUS",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED=421]="MISDIRECTED",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED"}(e.HttpStatus||(e.HttpStatus={}))},5108:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_RETRY_CONFIG=e.RETRY_ABLE_HTTP_STATUSES=e.IDEMPOTENCY_HEADER_KEY=void 0;const n=r(9285);e.IDEMPOTENCY_HEADER_KEY="X-Idempotency-Key",e.RETRY_ABLE_HTTP_STATUSES=[n.HttpStatus.INTERNAL_SERVER_ERROR,n.HttpStatus.TOO_MANY_REQUESTS],e.DEFAULT_RETRY_CONFIG={timeBetweenRetryExponent:1.3,delayInMs:100,retryMaxLimit:3}},2385:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpRetry=void 0;const i=r(6197),o=r(5108),a=r(6148);class s{static calculateTimeToWait(t,e,r){return Math.pow(t*e,r)}retry({retryConfigData:t,makeHttpRequestCallback:e,onRetry:r}){return n(this,void 0,void 0,(function*(){const u=this.getRetryConfig(t);if(null===u)return yield e();const c=this.generateIdempotentId();return function t(u,h){return n(this,void 0,void 0,(function*(){try{if(u>0){const t=s.calculateTimeToWait(u,h.delayInMs,h.timeBetweenRetryExponent);yield a.wait(t)}return yield e({[o.IDEMPOTENCY_HEADER_KEY]:c})}catch(n){if(ut),(t=>(e(this.mapExceptionToErrorInstance(t)),Promise.reject(t))))),()=>{this.axios.interceptors.response.eject(r),this.axios.interceptors.request.eject(r)}}request({url:t,method:e,body:r,query:i,headers:o,withCredentials:a,responseType:s}){return n(this,void 0,void 0,(function*(){try{return(yield this.axios.request({url:t,method:e,data:r,params:i,headers:o,withCredentials:a,responseType:s})).data}catch(n){throw this.mapExceptionToErrorInstance(n)}}))}mapExceptionToErrorInstance(t){var e;if(i.HttpErrorProject.isHttpErrorProject(null===(e=null===t||void 0===t?void 0:t.response)||void 0===e?void 0:e.data))return new i.HttpErrorProject(t.message,t.response.data);if(null===t||void 0===t?void 0:t.response){const e=t.response;return new i.HttpErrorBackend(t.message,{httpCode:e.status})}return(null===t||void 0===t?void 0:t.request)?new i.HttpErrorNoResponse(t.message,t.request):new i.HttpErrorUnknown(t.message,t)}}e.AxiosHttpAdapter=a},6148:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8468),e),i(r(737),e)},737:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.uuid4=void 0;const i=n(r(2474));e.uuid4=function(){if(i.default.randomUUID)return i.default.randomUUID();const t=function(){a>o.length-16&&(i.default.randomFillSync(o),a=0);return o.slice(a,a+=16)}();return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(t,e=0){return s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]}(t)};const o=new Uint8Array(256);let a=o.length;const s=[];for(let u=0;u<256;++u)s.push((u+256).toString(16).slice(1))},8468:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wait=void 0,e.wait=function(t){return new Promise((e=>setTimeout(e,t)))}},7940:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LoaderType=e.RequestStatus=void 0,function(t){t.Loading="loading",t.Success="success",t.Error="error"}(e.RequestStatus||(e.RequestStatus={})),function(t){t.Remote="remote",t.Local="local"}(e.LoaderType||(e.LoaderType={}))},6942:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResourcesLoaderContext=void 0;const n=r(7294);e.ResourcesLoaderContext=n.createContext({})},1760:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useResourcesLoaderContext=void 0;const n=r(7294),i=r(6942);e.useResourcesLoaderContext=()=>n.useContext(i.ResourcesLoaderContext)},6093:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Resources=void 0;e.Resources=class{constructor({data:t}){this.data=t}getData(){return this.data}}},198:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(9961),e),i(r(7940),e),i(r(6093),e),i(r(1760),e),i(r(1443),e),i(r(2861),e)},1443:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ResourcesLoader=void 0;const s=o(r(7294)),u=r(7940),c=r(6942);e.ResourcesLoader=function(t){const e=function(t){const[e,r]=s.useState((()=>t.type===u.LoaderType.Local?{status:u.RequestStatus.Success,data:t.data,error:void 0}:{status:u.RequestStatus.Loading,data:void 0,error:void 0})),n=e=>{"function"===typeof t.onLoad&&t.onLoad(e)};t.type===u.LoaderType.Local&&n(t.data);return s.useEffect((()=>{t.type===u.LoaderType.Remote&&function(t){return a(this,void 0,void 0,(function*(){const e=yield fetch(`${t}?t=${Date.now()}`);return yield e.json()}))}(t.url).then((t=>{n(t),r({status:u.RequestStatus.Success,data:t,error:void 0})})).catch((t=>{console.log(t),r({status:u.RequestStatus.Error,error:t,data:void 0})}))}),[]),e}(t);if(e.status===u.RequestStatus.Success)return s.default.createElement(c.ResourcesLoaderContext.Provider,{value:e.data},t.children);if(t.type===u.LoaderType.Remote){if(t.loading&&e.status===u.RequestStatus.Loading)return t.loading;if(t.error&&e.status===u.RequestStatus.Error)return t.error}return null}},9961:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2861:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createResourcesLoaderPropsRemote=e.createResourcesLoaderPropsLocal=void 0;const n=r(7940);e.createResourcesLoaderPropsLocal=function(t,e){return{type:n.LoaderType.Local,data:t,onLoad:e}},e.createResourcesLoaderPropsRemote=function(t,e){return{type:n.LoaderType.Remote,url:t,onLoad:e}}},1891:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultRedirectUri=e.SecretCodeStatus=void 0,function(t){t.Enabled="Enabled",t.Disabled="Disabled"}(e.SecretCodeStatus||(e.SecretCodeStatus={})),e.defaultRedirectUri="https://tbank.ru"},4854:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.SecretCodeChecker=void 0;const a=o(r(7294)),s=r(5233),u=r(1891);e.SecretCodeChecker=function(t){const[e,r]=a.useState(!1);return a.useEffect((()=>{if(s.isSecretCodeEnabled(t)){const{deps:e,config:n}=t.getSecretCodeParams();if(e.localStorage.getItem(n.key)===n.code)return s.replaceSecretCodeFromQueryString(n,e),r(!0);if(new URLSearchParams(e.window.location.search).get(n.key)===n.code)return s.saveSecretCodeToLocalStorage(n,e),s.replaceSecretCodeFromQueryString(n,e),r(!0);e.window.location.href=n.redirectUrl||u.defaultRedirectUri}}),[t]),s.isSecretCodeEnabled(t)?e?a.default.createElement(a.default.Fragment,null,t.children):null:a.default.createElement(a.default.Fragment,null,t.children)}},1569:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(4854),e),i(r(1891),e),i(r(9408),e),i(r(5233),e)},9408:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5233:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createSecretCodePropsDisabled=e.createSecretCodePropsEnabled=e.saveSecretCodeToLocalStorage=e.replaceSecretCodeFromQueryString=e.isSecretCodeEnabled=void 0;const n=r(1891);e.isSecretCodeEnabled=function(t){return t.status===n.SecretCodeStatus.Enabled},e.replaceSecretCodeFromQueryString=function(t,{window:e,shallowUrlReplace:r}){const n=new URL(e.location.href);n.searchParams.has(t.key)&&(n.searchParams.delete(t.key),r?r(n):e.history.replaceState(null,document.title,n.toString()))},e.saveSecretCodeToLocalStorage=function(t,{localStorage:e}){e.setItem(t.key,t.code)},e.createSecretCodePropsEnabled=function(t){return{status:n.SecretCodeStatus.Enabled,getSecretCodeParams:t}},e.createSecretCodePropsDisabled=function(){return{status:n.SecretCodeStatus.Disabled}}},7129:function(t,e){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.PAYLOAD_KEY=e.Severity=e.MASKED_PARAMS_SENTRY_LOGS=void 0,e.MASKED_PARAMS_SENTRY_LOGS=["token","sessionid","sessionId","state","session_state","code"],function(t){t.Fatal="fatal",t.Error="error",t.Warning="warning",t.Log="log",t.Info="info",t.Debug="debug",t.Critical="critical"}(r||(e.Severity=r={})),e.PAYLOAD_KEY="payload"},1554:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SentryBrowser=void 0;const n=r(6719),i=r(7129);e.SentryBrowser=class{static getRealOrFake(t){return t.sentryBrowser?t.sentryBrowser:new n.SentryBrowserFake}constructor(t,e,r,n){this.sentry=t,this.payloadFormatter=e,this.extrasFormatter=r,this.breadcrumbsFormatter=n,this.captureExceptionAsEvent=!0,this.captureException=({trackingId:t,error:e,message:r,payload:n,isMaskingDisabled:o})=>{const a=o?n:this.payloadFormatter.mask({payload:n,privateKeys:this.privateKeys}),s=e||new Error(r);return this.sentry.configureScope((e=>{e.setLevel(i.Severity.Error),e.setExtras(this.getPreparedExtras({error:s,trackingId:t,message:r,[this.getPayloadKey()]:a,isMaskingDisabled:o}))})),this.captureExceptionAsEvent?this.sentry.captureEvent({message:r}):this.sentry.captureException(s)},this.captureEvent=({trackingId:t,message:e,payload:r,isMaskingDisabled:n})=>{const o=n?r:this.payloadFormatter.mask({payload:r,privateKeys:this.privateKeys});return this.sentry.configureScope((r=>{r.setLevel(i.Severity.Info),r.setExtras(this.getPreparedExtras({trackingId:t,message:e,[this.getPayloadKey()]:o,isMaskingDisabled:n}))})),this.sentry.captureEvent({message:e})},this.captureExceptionAndThrowError=(t,e)=>{throw this.captureException({message:t,error:e}),e},this.createCaptureExceptionAndThrowError=t=>e=>this.captureExceptionAndThrowError(t,e)}init({sentryOptions:t,privateKeys:e=i.MASKED_PARAMS_SENTRY_LOGS,captureExceptionAsEvent:r=!0,formattersOptions:n}){this.privateKeys=e,this.captureExceptionAsEvent=r,this.formattersOptions=n,this.sentry.init(Object.assign(Object.assign({},t),{beforeSend:this.beforeSendPrepare(),beforeBreadcrumb:this.beforeBreadcrumbPrepare()}))}beforeSendPrepare(){return t=>{var e;return(null===(e=t.extra)||void 0===e?void 0:e.isMaskingDisabled)?t:this.payloadFormatter.mask({payload:t,privateKeys:this.privateKeys})}}beforeBreadcrumbPrepare(){return t=>{var e;return(null===(e=this.formattersOptions)||void 0===e?void 0:e.breadcrumbs)?this.breadcrumbsFormatter.format(t):t}}getPreparedExtras(t){var e;return(null===(e=this.formattersOptions)||void 0===e?void 0:e.extras)?this.extrasFormatter.format(t):t}getPayloadKey(){var t;const e=null===(t=this.formattersOptions)||void 0===t?void 0:t.payloadPostfix;return e?`${i.PAYLOAD_KEY}${e[0].toUpperCase()}${e.substring(1)}`:i.PAYLOAD_KEY}}},5555:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SentryBrowserAbstract=void 0;e.SentryBrowserAbstract=class{}},6719:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SentryBrowserFake=void 0;e.SentryBrowserFake=class{constructor(){this.init=t=>{console.error("SentryBrowser init not implemented")},this.captureException=t=>(console.error("SentryBrowser captureException not implemented"),null),this.captureEvent=t=>(console.error("SentryBrowser captureEvent not implemented"),null),this.captureExceptionAndThrowError=(t,e)=>{console.error("SentryBrowser captureExceptionAndThrowError not implemented")},this.createCaptureExceptionAndThrowError=t=>{console.error("SentryBrowser createCaptureExceptionAndThrowError not implemented")}}}},336:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HeadScriptSentryBrowser=void 0;const i=n(r(7294));function o(t){return`\n if (typeof window.sentryBrowser === 'undefined') {\n console.error('sentryBrowser \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d');\n } else if (typeof window.sentryBrowser.init !== 'function') {\n console.error('\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c sentryBrowser');\n } else {\n window.sentryBrowser.init(${JSON.stringify(t)});\n }\n `}e.HeadScriptSentryBrowser=function({wrapper:t,appStaticUrl:e,sentryBrowserParams:r}){return i.default.createElement(t,null,i.default.createElement("script",{src:`${e}/libs/sentry-browser/bundle.min.js`,crossOrigin:"anonymous"}),i.default.createElement("script",{dangerouslySetInnerHTML:{__html:o(r)}}))}},5939:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(336),e),i(r(1554),e),i(r(5555),e),i(r(7129),e),i(r(4468),e)},4468:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5825:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EVENT_FAILURE_NAME=e.EVENTEA_PROJECT=e.PRODUCT_CATEGORY=e.TRACKING_STATE_PARAMS_TO_COOKIE=e.CookieKey=e.PARAM_NOT_INIT=e.IS_SERVER=e.TINKOFF_WEB_TRACKING_URL=void 0,e.TINKOFF_WEB_TRACKING_URL="https://acdn.t-static.ru/twa/v5/bundles/generic/client.js?container=sub_modules&ttm=tinkoff-pwa_special-projects",e.IS_SERVER="undefined"===typeof window,e.PARAM_NOT_INIT="noInit",function(t){t.Referer="spec_app_referer",t.Payload="spec_app_payload"}(e.CookieKey||(e.CookieKey={})),e.TRACKING_STATE_PARAMS_TO_COOKIE=["wuid","wuidVisitNum"],e.PRODUCT_CATEGORY="Specprojects",e.EVENTEA_PROJECT="special-projects",e.EVENT_FAILURE_NAME="web-tracker-download-failed"},4490:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractTracking=void 0;e.AbstractTracking=class{}},2039:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NullTracking=void 0;e.NullTracking=class{constructor(){this.sendEvent=()=>{this.showError()},this.updateLocation=()=>{this.showError()}}saveTrackingStateToCookie(){this.showError()}subscribeTrackingPageLoad(){this.showError()}subscribeTrackingFailure(){this.showError()}setSsoId(){this.showError()}updatePersonalizedLandingMetrics(){this.showError()}showError(){console.error(new Error("\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c @tinkoff/web-tracking \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435"))}}},7105:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RealTracking=void 0;const i=n(r(4054)),o=r(684),a=r(5825),s=r(4463);e.RealTracking=class{constructor(t){this.sendEvent=(t,e)=>{e&&this.tracking.extend(e),this.eventea.send({project:a.EVENTEA_PROJECT,event:t,payload:e})},this.updateLocation=()=>{this.tracking.updateLocation()},this.subscribeTrackingPageLoad=t=>{if(this.hasTrackingStateAlreadyInitialized())return void t();const e=()=>{window.removeEventListener("pageLoad",e),t()};window.addEventListener("pageLoad",e)};const e=new i.default;e.resolve(o.getTracking()),this.tracking=e,this.eventea=new s.EventeaQueue,this.eventeaStatistQueue=new s.EventeaStatistQueue,this.props=t||{}}subscribeTrackingFailure(t){if(window.webTrackingDownloadScriptFailed)return void t();const e=()=>{window.removeEventListener(a.EVENT_FAILURE_NAME,e),t()};window.addEventListener(a.EVENT_FAILURE_NAME,e)}saveTrackingStateToCookie(){const t=new URLSearchParams;a.TRACKING_STATE_PARAMS_TO_COOKIE.forEach((e=>{var r,n,i;t.append(e,(null===(i=null===(n=null===(r=window.tracking)||void 0===r?void 0:r.state)||void 0===n?void 0:n[e])||void 0===i?void 0:i.toString())||a.PARAM_NOT_INIT)})),document.cookie=`${this.props.appRefererCookieName||a.CookieKey.Referer}=${window.location.href};path=/`,document.cookie=`${this.props.appPayloadCookieName||a.CookieKey.Payload}=${t.toString()};path=/`}setSsoId(t){this.eventeaStatistQueue.updateClientParameters({ssoId:t})}updatePersonalizedLandingMetrics(t){var e;const r=null===(e=window.tracking)||void 0===e?void 0:e.state;r&&(r.personalizedLandingMetrics={state:{}},Object.entries(t).forEach((([t,e])=>{r.personalizedLandingMetrics.state[t]=e})))}hasTrackingStateAlreadyInitialized(){var t;const e=null===(t=window.tracking)||void 0===t?void 0:t.state;return!!e&&a.TRACKING_STATE_PARAMS_TO_COOKIE.every((t=>"undefined"!==typeof e[t]))}}},2561:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7624),e),i(r(5825),e),i(r(2039),e),i(r(7105),e),i(r(4490),e),i(r(8574),e),i(r(8627),e)},7624:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTracking=void 0;const n=r(2039),i=r(7105);e.createTracking=function(t){return"undefined"===typeof window?new n.NullTracking:new i.RealTracking(t)}},8627:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HeadScriptTracking=void 0;const i=n(r(7294)),o=r(5825);function a(t,e){return`\n !function(){\n if (typeof window.tracking !== "object") {\n window.tracking = {};\n }\n if (typeof window.tracking.state !== "object") {\n window.tracking.state = {};\n }\n if (typeof window.tracking.state.productCategory !== "string") {\n window.tracking.state.productCategory = "${e}";\n } \n if (typeof window.tracking.state.productName !== "string") {\n window.tracking.state.productName = "${t}";\n }\n }();\n `}e.HeadScriptTracking=({head:t,productName:e,productCategory:r=o.PRODUCT_CATEGORY})=>i.default.createElement(t,null,i.default.createElement("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:a(e,r)}}))},8574:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ScriptTracking=void 0;const i=n(r(7294)),o=r(5825);e.ScriptTracking=({script:t})=>i.default.createElement(t,{src:o.TINKOFF_WEB_TRACKING_URL,type:"text/javascript",defer:!0,onError:()=>{window.webTrackingDownloadScriptFailed=!0,window.dispatchEvent(new Event(o.EVENT_FAILURE_NAME))}})},9361:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}},337:function(t,e,r){"use strict";e.Z=function(t){for(var e=1;e=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o};var n,i=(n=r(7273))&&n.__esModule?n:{default:n}},4463:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EventeaQueueObserver=e.EventeaQueue=e.EventeaStatistQueue=void 0;var n=r(7708);Object.defineProperty(e,"EventeaStatistQueue",{enumerable:!0,get:function(){return n.EventeaStatistQueue}});const i="undefined"!==typeof window?window:void 0;e.EventeaQueue=class{__addEventToStore(...t){(null===i||void 0===i?void 0:i._evnteq)&&i._evnteq.push(...t)}get getQueue(){var t;return Array.isArray(null===i||void 0===i?void 0:i._evnteq)?null===i||void 0===i?void 0:i._evnteq:null===(t=null===i||void 0===i?void 0:i._evnteq)||void 0===t?void 0:t.queue}constructor(t){var e,r;this.errorHandlers=null===t||void 0===t?void 0:t.errorHandlers,i?!i._evnteq&&(i._evnteq=[]):null===(r=null===(e=this.errorHandlers)||void 0===e?void 0:e.handleQueueUsageAtServer)||void 0===r||r.call(e)}send(t){this.__addEventToStore(["send",t])}sendOnce(t){return this.__addEventToStore(["sendOnce",t]),!0}data(t){this.__addEventToStore(["data",t])}};e.EventeaQueueObserver=class{set watch(t){var e,r;this.observerSuspended?null===(r=null===(e=this.errorHandlers)||void 0===e?void 0:e.handleQueueUsageAtServer)||void 0===r||r.call(e):(this.watcher=t,this.push(...this.queue),this.queue=[])}push(...t){var e,r;if(this.watcher)try{this.watcher(t)}catch(n){const{message:t}=n;null===(r=null===(e=this.errorHandlers)||void 0===e?void 0:e.handleObserverWatcherErrors)||void 0===r||r.call(e,t)}else this.queue.push(...t)}constructor(t){var e,r;this.observerSuspended=!1,this.queue=[],this.errorHandlers=null===t||void 0===t?void 0:t.errorHandlers,i?(Array.isArray(i._evnteq)&&this.queue.push(...i._evnteq),i._evnteq=this):(this.observerSuspended=!0,null===(r=null===(e=this.errorHandlers)||void 0===e?void 0:e.handleQueueUsageAtServer)||void 0===r||r.call(e))}}},7708:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EventeaStatistQueue=void 0;const r="eventeaStatist";e.EventeaStatistQueue=class{constructor(){this.instance=null,this.resolveInstance=()=>{},this.instancePromise=new Promise((t=>{this.resolveInstance=t})),this.updateClientParameters=(...t)=>{if(this.instance)return this.instance.updateClientParameters(...t);this.instancePromise.then((e=>e.updateClientParameters(...t)))};const t=t=>{this.instance=t,this.resolveInstance(t)},e=window.eventeaStatist;if(e)return void t(e);const n=Object.getOwnPropertyDescriptor(window,r);Object.defineProperty(window,r,{set:e=>{var r;null===(r=null===n||void 0===n?void 0:n.set)||void 0===r||r.call(n,e),t(e)},configurable:!0})}}},684:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getTracking=void 0,e.getTracking=function(){if("undefined"===typeof window)throw new Error("EClientOnly");return new Promise((function(t){var e=window.tracking;e&&e.fullfill?t(e):window.addEventListener("tracking-created",(function(e){t(e.detail||window.tracking)}))}))}},4054:function(t,e,r){"use strict";var n=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e0;this._trackingResolve(t),t.ready.then(this._readyResolve),t.extend(this._stateAcc),r&&this._listeners.change&&this._listeners.change.forEach((function(r){r(t.state,e._stateAcc)})),this._listeners=Object.create(null)},t.prototype.addPixels=function(t){return this.tracking?this.tracking.addPixels(t):this.trackingReady.then((function(e){return e.addPixels(t)}))},t.prototype.resolve=function(t){var e=this;return Promise.resolve(t).then((function(t){return e.setTracking(t),t}))},Object.defineProperty(t.prototype,"state",{get:function(){return this.tracking?this.tracking.state:this._stateAcc},enumerable:!1,configurable:!0}),t.prototype.callUtil=function(t){for(var e,r=[],i=1;i=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),i.forEach(["post","put","patch"],(function(t){c.headers[t]=i.merge(s)})),t.exports=c},7288:function(t){t.exports={version:"0.26.0"}},1849:function(t){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([r]):a[e]?a[e]+", "+r:r}})),a):a}},8713:function(t){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},4875:function(t,e,r){"use strict";var n=r(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){i[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var o={};i.transitional=function(t,e,r){function i(t,e){return"[Axios v"+n+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,n,a){if(!1===t)throw new Error(i(n," has been removed"+(e?" in "+e:"")));return e&&!o[n]&&(o[n]=!0,console.warn(i(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,n,a)}},t.exports={assertOptions:function(t,e,r){if("object"!==typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),i=n.length;i-- >0;){var o=n[i],a=e[o];if(a){var s=t[o],u=void 0===s||a(s,o,t);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},4867:function(t,e,r){"use strict";var n=r(1849),i=Object.prototype.toString;function o(t){return Array.isArray(t)}function a(t){return"undefined"===typeof t}function s(t){return"[object ArrayBuffer]"===i.call(t)}function u(t){return null!==t&&"object"===typeof t}function c(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function h(t){return"[object Function]"===i.call(t)}function l(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),o(t))for(var r=0,n=t.length;r>>8^255&p^99,n[r]=p,i[p]=r;var v=t[r],m=t[v],g=t[m],y=257*t[p]^16843008*p;a[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,u[r]=y<<8|y>>>24,c[r]=y,y=16843009*g^65537*m^257*v^16843008*r,h[p]=y<<24|y>>>8,l[p]=y<<16|y>>>16,f[p]=y<<8|y>>>24,d[p]=y,r?(r=v^t[t[t[g^v]]],o^=t[t[o]]):r=o=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],v=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,i=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(c=n[c>>>24]<<24|n[c>>>16&255]<<16|n[c>>>8&255]<<8|n[255&c]):(c=n[(c=c<<8|c>>>24)>>>24]<<24|n[c>>>16&255]<<16|n[c>>>8&255]<<8|n[255&c],c^=p[a/r|0]<<24),o[a]=o[a-r]^c);for(var s=this._invKeySchedule=[],u=0;u>>24]]^l[n[c>>>16&255]]^f[n[c>>>8&255]]^d[n[255&c]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,c,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,l,f,d,i),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,a,s){for(var u=this._nRounds,c=t[e]^r[0],h=t[e+1]^r[1],l=t[e+2]^r[2],f=t[e+3]^r[3],d=4,p=1;p>>24]^i[h>>>16&255]^o[l>>>8&255]^a[255&f]^r[d++],m=n[h>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&c]^r[d++],g=n[l>>>24]^i[f>>>16&255]^o[c>>>8&255]^a[255&h]^r[d++],y=n[f>>>24]^i[c>>>16&255]^o[h>>>8&255]^a[255&l]^r[d++];c=v,h=m,l=g,f=y}v=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^r[d++],m=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^r[d++],g=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^r[d++],y=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^r[d++],t[e]=v,t[e+1]=m,t[e+2]=g,t[e+3]=y},keySize:8});t.AES=e._createHelper(v)}(),o.AES)}()},7407:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(8269),r(8214),r(888),r(5109),function(){var t=o,e=t.lib.BlockCipher,r=t.algo;const n=16,i=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var s={pbox:[],sbox:[]};function u(t,e){let r=e>>24&255,n=e>>16&255,i=e>>8&255,o=255&e,a=t.sbox[0][r]+t.sbox[1][n];return a^=t.sbox[2][i],a+=t.sbox[3][o],a}function c(t,e,r){let i,o=e,a=r;for(let s=0;s1;--s)o^=t.pbox[s],a=u(t,o)^a,i=o,o=a,a=i;return i=o,o=a,a=i,a^=t.pbox[1],o^=t.pbox[0],{left:o,right:a}}function l(t,e,r){for(let n=0;n<4;n++){t.sbox[n]=[];for(let e=0;e<256;e++)t.sbox[n][e]=a[n][e]}let o=0;for(let a=0;a=r&&(o=0);let s=0,u=0,h=0;for(let i=0;i>>2];t.sigBytes-=e}},v=(r.BlockCipher=h.extend({cfg:h.cfg.extend({mode:d,padding:p}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),r.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),m=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?i.create([1398893684,1701076831]).concat(r).concat(e):e).toString(u)},parse:function(t){var e,r=u.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=i.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),v.create({ciphertext:r,salt:e})}},g=r.SerializableCipher=n.extend({cfg:n.extend({format:m}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),a=i.cfg;return v.create({ciphertext:o,key:r,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),y=(e.kdf={}).OpenSSL={execute:function(t,e,r,n,o){if(n||(n=i.random(8)),o)a=c.create({keySize:e+r,hasher:o}).compute(t,n);else var a=c.create({keySize:e+r}).compute(t,n);var s=i.create(a.words.slice(e),4*r);return a.sigBytes=4*e,v.create({key:a,iv:s,salt:n})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:y}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize,n.salt,n.hasher);n.iv=i.iv;var o=g.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt,n.hasher);return n.iv=i.iv,g.decrypt.call(this,t,e,i.key,n)}})}()))}()},8249:function(t,e,r){t.exports=function(){var t=t||function(t,e){var n;if("undefined"!==typeof window&&window.crypto&&(n=window.crypto),"undefined"!==typeof self&&self.crypto&&(n=self.crypto),"undefined"!==typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!==typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&"undefined"!==typeof r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(2480)}catch(m){}var i=function(){if(n){if("function"===typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(m){}if("function"===typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(m){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),a={},s=a.lib={},u=s.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.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)}},c=s.WordArray=u.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var s=0;s>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new c.init(r,e/2)}},f=h.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new c.init(r,e)}},d=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},p=s.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,h=t.min(4*u,o);if(u){for(var l=0;l>>6-a%4*2;i[o>>>2]|=s<<24-o%4*8,o++}return e.create(i,o)}t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-a%4*2;i[o>>>2]|=s<<24-o%4*8,o++}return e.create(i,o)}t.enc.Base64url={stringify:function(t,e){void 0===e&&(e=!0);var r=t.words,n=t.sigBytes,i=e?this._safe_map:this._map;t.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,u=0;u<4&&a+.75*u>>6*(3-u)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t,e){void 0===e&&(e=!0);var n=t.length,i=e?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var r=t.length,n=[],i=0;i>>1]|=t.charCodeAt(i)<<16-i%2*16;return e.create(n,2*r)}},r.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],o=0;o>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(a))}return i.join("")},parse:function(t){for(var r=t.length,i=[],o=0;o>>1]|=n(t.charCodeAt(o)<<16-o%2*16);return e.create(i,2*r)}}}(),i.enc.Utf16)}()},888:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(2783),r(9824),function(){var t=o,e=t.lib,r=e.Base,n=e.WordArray,i=t.algo,a=i.MD5,s=i.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,i=this.cfg,o=i.hasher.create(),a=n.create(),s=a.words,u=i.keySize,c=i.iterations;s.lengthi&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),a=this._iKey=e.clone(),s=o.words,u=a.words,c=0;c>>2]|=t[i]<<24-i%4*8;e.call(this,n,r)}else e.apply(this,arguments)};r.prototype=t}}(),i.lib.WordArray)}()},8214:function(t,e,r){!function(e,n){var i;t.exports=(i=r(8249),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,a=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=a.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=t[e+0],u=t[e+1],d=t[e+2],p=t[e+3],v=t[e+4],m=t[e+5],g=t[e+6],y=t[e+7],b=t[e+8],_=t[e+9],w=t[e+10],x=t[e+11],E=t[e+12],A=t[e+13],S=t[e+14],T=t[e+15],k=o[0],R=o[1],M=o[2],C=o[3];k=c(k,R,M,C,a,7,s[0]),C=c(C,k,R,M,u,12,s[1]),M=c(M,C,k,R,d,17,s[2]),R=c(R,M,C,k,p,22,s[3]),k=c(k,R,M,C,v,7,s[4]),C=c(C,k,R,M,m,12,s[5]),M=c(M,C,k,R,g,17,s[6]),R=c(R,M,C,k,y,22,s[7]),k=c(k,R,M,C,b,7,s[8]),C=c(C,k,R,M,_,12,s[9]),M=c(M,C,k,R,w,17,s[10]),R=c(R,M,C,k,x,22,s[11]),k=c(k,R,M,C,E,7,s[12]),C=c(C,k,R,M,A,12,s[13]),M=c(M,C,k,R,S,17,s[14]),k=h(k,R=c(R,M,C,k,T,22,s[15]),M,C,u,5,s[16]),C=h(C,k,R,M,g,9,s[17]),M=h(M,C,k,R,x,14,s[18]),R=h(R,M,C,k,a,20,s[19]),k=h(k,R,M,C,m,5,s[20]),C=h(C,k,R,M,w,9,s[21]),M=h(M,C,k,R,T,14,s[22]),R=h(R,M,C,k,v,20,s[23]),k=h(k,R,M,C,_,5,s[24]),C=h(C,k,R,M,S,9,s[25]),M=h(M,C,k,R,p,14,s[26]),R=h(R,M,C,k,b,20,s[27]),k=h(k,R,M,C,A,5,s[28]),C=h(C,k,R,M,d,9,s[29]),M=h(M,C,k,R,y,14,s[30]),k=l(k,R=h(R,M,C,k,E,20,s[31]),M,C,m,4,s[32]),C=l(C,k,R,M,b,11,s[33]),M=l(M,C,k,R,x,16,s[34]),R=l(R,M,C,k,S,23,s[35]),k=l(k,R,M,C,u,4,s[36]),C=l(C,k,R,M,v,11,s[37]),M=l(M,C,k,R,y,16,s[38]),R=l(R,M,C,k,w,23,s[39]),k=l(k,R,M,C,A,4,s[40]),C=l(C,k,R,M,a,11,s[41]),M=l(M,C,k,R,p,16,s[42]),R=l(R,M,C,k,g,23,s[43]),k=l(k,R,M,C,_,4,s[44]),C=l(C,k,R,M,E,11,s[45]),M=l(M,C,k,R,T,16,s[46]),k=f(k,R=l(R,M,C,k,d,23,s[47]),M,C,a,6,s[48]),C=f(C,k,R,M,y,10,s[49]),M=f(M,C,k,R,S,15,s[50]),R=f(R,M,C,k,m,21,s[51]),k=f(k,R,M,C,E,6,s[52]),C=f(C,k,R,M,p,10,s[53]),M=f(M,C,k,R,w,15,s[54]),R=f(R,M,C,k,u,21,s[55]),k=f(k,R,M,C,b,6,s[56]),C=f(C,k,R,M,T,10,s[57]),M=f(M,C,k,R,g,15,s[58]),R=f(R,M,C,k,A,21,s[59]),k=f(k,R,M,C,v,6,s[60]),C=f(C,k,R,M,x,10,s[61]),M=f(M,C,k,R,d,15,s[62]),R=f(R,M,C,k,_,21,s[63]),o[0]=o[0]+k|0,o[1]=o[1]+R|0,o[2]=o[2]+M|0,o[3]=o[3]+C|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var h=u[c];u[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,r,n,i,o,a){var s=t+(e&r|~e&n)+i+a;return(s<>>32-o)+e}function h(t,e,r,n,i,o,a){var s=t+(e&n|r&~n)+i+a;return(s<>>32-o)+e}function l(t,e,r,n,i,o,a){var s=t+(e^r^n)+i+a;return(s<>>32-o)+e}function f(t,e,r,n,i,o,a){var s=t+(r^(e|~n))+i+a;return(s<>>32-o)+e}e.MD5=o._createHelper(u),e.HmacMD5=o._createHmacHelper(u)}(Math),i.MD5)}()},8568:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(5109),o.mode.CFB=function(){var t=o.lib.BlockCipherMode.extend();function e(t,e,r,n){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var a=0;a>24&255)){var e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}else t+=1<<24;return t}function r(t){return 0===(t[0]=e(t[0]))&&(t[1]=e(t[1])),t}var n=t.Encryptor=t.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),r(a);var s=a.slice(0);n.encryptBlock(s,0);for(var u=0;u>>2]|=i<<24-o%4*8,t.sigBytes+=i},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},o.pad.Ansix923)}()},2807:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(5109),o.pad.Iso10126={pad:function(t,e){var r=4*e,n=r-t.sigBytes%r;t.concat(o.lib.WordArray.random(n-1)).concat(o.lib.WordArray.create([n<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},o.pad.Iso10126)}()},1077:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(5109),o.pad.Iso97971={pad:function(t,e){t.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(t,e)},unpad:function(t){o.pad.ZeroPadding.unpad(t),t.sigBytes--}},o.pad.Iso97971)}()},6991:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(5109),o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding)}()},6475:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(5109),o.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){var e=t.words,r=t.sigBytes-1;for(r=t.sigBytes-1;r>=0;r--)if(e[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},o.pad.ZeroPadding)}()},2112:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(2153),r(9824),function(){var t=o,e=t.lib,r=e.Base,n=e.WordArray,i=t.algo,a=i.SHA256,s=i.HMAC,u=i.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:25e4}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=s.create(r.hasher,t),o=n.create(),a=n.create([1]),u=o.words,c=a.words,h=r.keySize,l=r.iterations;u.length>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)u.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(e){var o=e.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=c>>>16|4294901760&h,f=h<<16|65535&c;for(n[0]^=c,n[1]^=l,n[2]^=h,n[3]^=f,n[4]^=c,n[5]^=l,n[6]^=h,n[7]^=f,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(t,e){var r=this._X;u.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function u(){for(var t=this._X,e=this._C,r=0;r<8;r++)i[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var n=t[r]+e[r],o=65535&n,s=n>>>16,u=((o*o>>>17)+o*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=u^c}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=e._createHelper(s)}(),o.RabbitLegacy)}()},4454:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(8269),r(8214),r(888),r(5109),function(){var t=o,e=t.lib.StreamCipher,r=t.algo,n=[],i=[],a=[],s=r.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var n=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)u.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(e){var o=e.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=c>>>16|4294901760&h,f=h<<16|65535&c;for(i[0]^=c,i[1]^=l,i[2]^=h,i[3]^=f,i[4]^=c,i[5]^=l,i[6]^=h,i[7]^=f,r=0;r<4;r++)u.call(this)}},_doProcessBlock:function(t,e){var r=this._X;u.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function u(){for(var t=this._X,e=this._C,r=0;r<8;r++)i[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var n=t[r]+e[r],o=65535&n,s=n>>>16,u=((o*o>>>17)+o*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=u^c}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=e._createHelper(s)}(),o.Rabbit)}()},1857:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(8269),r(8214),r(888),r(5109),function(){var t=o,e=t.lib.StreamCipher,r=t.algo,n=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var a=i%r,s=e[a>>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var u=n[i];n[i]=n[o],n[o]=u}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var t=this._S,e=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[r],t[r]=o,n|=t[(t[e]+t[r])%256]<<24-8*i}return this._i=e,this._j=r,n}t.RC4=e._createHelper(n);var a=r.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)i.call(this)}});t.RC4Drop=e._createHelper(a)}(),o.RC4)}()},706:function(t,e,r){!function(e,n){var i;t.exports=(i=r(8249),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,a=e.algo,s=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),h=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=n.create([0,1518500249,1859775393,2400959708,2840853838]),f=n.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,_,w,x,E,A,S,T,k,R=this._hash.words,M=l.words,C=f.words,P=s.words,I=u.words,O=c.words,B=h.words;for(x=o=R[0],E=a=R[1],A=d=R[2],S=_=R[3],T=w=R[4],r=0;r<80;r+=1)k=o+t[e+P[r]]|0,k+=r<16?p(a,d,_)+M[0]:r<32?v(a,d,_)+M[1]:r<48?m(a,d,_)+M[2]:r<64?g(a,d,_)+M[3]:y(a,d,_)+M[4],k=(k=b(k|=0,O[r]))+w|0,o=w,w=_,_=b(d,10),d=a,a=k,k=x+t[e+I[r]]|0,k+=r<16?y(E,A,S)+C[0]:r<32?g(E,A,S)+C[1]:r<48?m(E,A,S)+C[2]:r<64?v(E,A,S)+C[3]:p(E,A,S)+C[4],k=(k=b(k|=0,B[r]))+T|0,x=T,T=S,S=b(A,10),A=E,E=k;k=R[1]+d+S|0,R[1]=R[2]+_+T|0,R[2]=R[3]+w+x|0,R[3]=R[4]+o+E|0,R[4]=R[0]+a+A|0,R[0]=k},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function v(t,e,r){return t&e|~t&r}function m(t,e,r){return(t|~e)^r}function g(t,e,r){return t&r|e&~r}function y(t,e,r){return t^(e|~r)}function b(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(Math),i.RIPEMD160)}()},2783:function(t,e,r){!function(e,n){var i;t.exports=(i=r(8249),function(){var t=i,e=t.lib,r=e.WordArray,n=e.Hasher,o=t.algo,a=[],s=o.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],u=r[4],c=0;c<80;c++){if(c<16)a[c]=0|t[e+c];else{var h=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=h<<1|h>>>31}var l=(n<<5|n>>>27)+u+a[c];l+=c<20?1518500249+(i&o|~i&s):c<40?1859775393+(i^o^s):c<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,u=s,s=o,o=i<<30|i>>>2,i=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+u|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=n._createHelper(s),t.HmacSHA1=n._createHmacHelper(s)}(),i.SHA1)}()},7792:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(2153),function(){var t=o,e=t.lib.WordArray,r=t.algo,n=r.SHA256,i=r.SHA224=n.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=n._createHelper(i),t.HmacSHA224=n._createHmacHelper(i)}(),o.SHA224)}()},2153:function(t,e,r){!function(e,n){var i;t.exports=(i=r(8249),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,a=e.algo,s=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(s[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var c=[],h=a.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],h=r[5],l=r[6],f=r[7],d=0;d<64;d++){if(d<16)c[d]=0|t[e+d];else{var p=c[d-15],v=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,m=c[d-2],g=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[d]=v+c[d-7]+g+c[d-16]}var y=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&h^~s&l)+u[d]+c[d];f=l,l=h,h=s,s=a+_|0,a=o,o=i,i=n,n=_+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+h|0,r[6]=r[6]+l|0,r[7]=r[7]+f|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(h),e.HmacSHA256=o._createHmacHelper(h)}(Math),i.SHA256)}()},3327:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(4938),function(t){var e=o,r=e.lib,n=r.WordArray,i=r.Hasher,a=e.x64.Word,s=e.algo,u=[],c=[],h=[];!function(){for(var t=1,e=0,r=0;r<24;r++){u[t+5*e]=(r+1)*(r+2)/2%64;var n=(2*t+3*e)%5;t=e%5,e=n}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,l=0,f=0;f<7;f++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(R=r[i]).high^=a,R.low^=o}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var d=0,p=0,v=0;v<5;v++)d^=(R=r[f+5*v]).high,p^=R.low;var m=l[f];m.high=d,m.low=p}for(f=0;f<5;f++){var g=l[(f+4)%5],y=l[(f+1)%5],b=y.high,_=y.low;for(d=g.high^(b<<1|_>>>31),p=g.low^(_<<1|b>>>31),v=0;v<5;v++)(R=r[f+5*v]).high^=d,R.low^=p}for(var w=1;w<25;w++){var x=(R=r[w]).high,E=R.low,A=u[w];A<32?(d=x<>>32-A,p=E<>>32-A):(d=E<>>64-A,p=x<>>64-A);var S=l[c[w]];S.high=d,S.low=p}var T=l[0],k=r[0];for(T.high=k.high,T.low=k.low,f=0;f<5;f++)for(v=0;v<5;v++){var R=r[w=f+5*v],M=l[w],C=l[(f+1)%5+5*v],P=l[(f+2)%5+5*v];R.high=M.high^~C.high&P.high,R.low=M.low^~C.low&P.low}R=r[0];var I=h[s];R.high^=I.high,R.low^=I.low}},_doFinalize:function(){var e=this._data,r=e.words,i=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[i>>>5]|=1<<24-i%32,r[(t.ceil((i+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,u=s/8,c=[],h=0;h>>24)|4278255360&(f<<24|f>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),c.push(d),c.push(f)}return new n.init(c,s)},clone:function(){for(var t=i.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=i._createHelper(f),e.HmacSHA3=i._createHmacHelper(f)}(Math),o.SHA3)}()},7460:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(4938),r(34),function(){var t=o,e=t.x64,r=e.Word,n=e.WordArray,i=t.algo,a=i.SHA512,s=i.SHA384=a.extend({_doReset:function(){this._hash=new n.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=a._createHelper(s),t.HmacSHA384=a._createHmacHelper(s)}(),o.SHA384)}()},34:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(4938),function(){var t=o,e=t.lib.Hasher,r=t.x64,n=r.Word,i=r.WordArray,a=t.algo;function s(){return n.create.apply(n,arguments)}var u=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=s()}();var h=a.SHA512=e.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],h=r[5],l=r[6],f=r[7],d=n.high,p=n.low,v=i.high,m=i.low,g=o.high,y=o.low,b=a.high,_=a.low,w=s.high,x=s.low,E=h.high,A=h.low,S=l.high,T=l.low,k=f.high,R=f.low,M=d,C=p,P=v,I=m,O=g,B=y,N=b,L=_,D=w,U=x,F=E,j=A,Z=S,H=T,G=k,V=R,z=0;z<80;z++){var W,X,q=c[z];if(z<16)X=q.high=0|t[e+2*z],W=q.low=0|t[e+2*z+1];else{var Y=c[z-15],K=Y.high,J=Y.low,$=(K>>>1|J<<31)^(K>>>8|J<<24)^K>>>7,Q=(J>>>1|K<<31)^(J>>>8|K<<24)^(J>>>7|K<<25),tt=c[z-2],et=tt.high,rt=tt.low,nt=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,it=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=c[z-7],at=ot.high,st=ot.low,ut=c[z-16],ct=ut.high,ht=ut.low;X=(X=(X=$+at+((W=Q+st)>>>0>>0?1:0))+nt+((W+=it)>>>0>>0?1:0))+ct+((W+=ht)>>>0>>0?1:0),q.high=X,q.low=W}var lt,ft=D&F^~D&Z,dt=U&j^~U&H,pt=M&P^M&O^P&O,vt=C&I^C&B^I&B,mt=(M>>>28|C<<4)^(M<<30|C>>>2)^(M<<25|C>>>7),gt=(C>>>28|M<<4)^(C<<30|M>>>2)^(C<<25|M>>>7),yt=(D>>>14|U<<18)^(D>>>18|U<<14)^(D<<23|U>>>9),bt=(U>>>14|D<<18)^(U>>>18|D<<14)^(U<<23|D>>>9),_t=u[z],wt=_t.high,xt=_t.low,Et=G+yt+((lt=V+bt)>>>0>>0?1:0),At=gt+vt;G=Z,V=H,Z=F,H=j,F=D,j=U,D=N+(Et=(Et=(Et=Et+ft+((lt+=dt)>>>0
>>0?1:0))+wt+((lt+=xt)>>>0>>0?1:0))+X+((lt+=W)>>>0>>0?1:0))+((U=L+lt|0)>>>0>>0?1:0)|0,N=O,L=B,O=P,B=I,P=M,I=C,M=Et+(mt+pt+(At>>>0>>0?1:0))+((C=lt+At|0)>>>0>>0?1:0)|0}p=n.low=p+C,n.high=d+M+(p>>>0>>0?1:0),m=i.low=m+I,i.high=v+P+(m>>>0>>0?1:0),y=o.low=y+B,o.high=g+O+(y>>>0>>0?1:0),_=a.low=_+L,a.high=b+N+(_>>>0>>0?1:0),x=s.low=x+U,s.high=w+D+(x>>>0>>0?1:0),A=h.low=A+j,h.high=E+F+(A>>>0>>0?1:0),T=l.low=T+H,l.high=S+Z+(T>>>0>>0?1:0),R=f.low=R+V,f.high=k+G+(R>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(n+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(h),t.HmacSHA512=e._createHmacHelper(h)}(),o.SHA512)}()},4253:function(t,e,r){!function(e,n,i){var o;t.exports=(o=r(8249),r(8269),r(8214),r(888),r(5109),function(){var t=o,e=t.lib,r=e.WordArray,n=e.BlockCipher,i=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=i.DES=n.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var n=a[r]-1;e[r]=t[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var c=i[o]=[],h=u[o];for(r=0;r<24;r++)c[r/6|0]|=e[(s[r]-1+h)%28]<<31-r%6,c[4+(r/6|0)]|=e[28+(s[r+24]-1+h)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var l=this._invSubKeys=[];for(r=0;r<16;r++)l[r]=i[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],f.call(this,4,252645135),f.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,u=0;u<8;u++)s|=c[u][((a^i[u])&h[u])>>>0];this._lBlock=a,this._rBlock=o^s}var l=this._lBlock;this._lBlock=this._rBlock,this._rBlock=l,f.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<192.");var e=t.slice(0,2),n=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=l.createEncryptor(r.create(e)),this._des2=l.createEncryptor(r.create(n)),this._des3=l.createEncryptor(r.create(i))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=n._createHelper(p)}(),o.TripleDES)}()},4938:function(t,e,r){!function(e,n){var i;t.exports=(i=r(8249),function(t){var e=i,r=e.lib,n=r.Base,o=r.WordArray,a=e.x64={};a.Word=n.extend({init:function(t,e){this.high=t,this.low=e}}),a.WordArray=n.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:8*e.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n80*n){o=s=t[0],a=u=t[1];for(var b=n;bs&&(s=l),f>u&&(u=f);p=0!==(p=Math.max(s-o,u-a))?32767/p:0}return i(g,y,n,o,a,p,0),y}function r(t,e,r,n,i){var o,a;if(i===T(t,e,r,n)>0)for(o=e;o=e;o-=n)a=E(o,t[o],t[o+1],a);return a&&g(a,a.next)&&(A(a),a=a.next),a}function n(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!g(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function i(t,e,r,c,h,l,d){if(t){!d&&l&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=f(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,c,h,l);for(var p,v,m=t;t.prev!==t.next;)if(p=t.prev,v=t.next,l?a(t,c,h,l):o(t))e.push(p.i/r|0),e.push(t.i/r|0),e.push(v.i/r|0),A(t),t=v.next,m=v.next;else if((t=v)===m){d?1===d?i(t=s(n(t),e,r),e,r,c,h,l,2):2===d&&u(t,e,r,c,h,l):i(n(t),e,r,c,h,l,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(m(e,r,n)>=0)return!1;for(var i=e.x,o=r.x,a=n.x,s=e.y,u=r.y,c=n.y,h=io?i>a?i:a:o>a?o:a,d=s>u?s>c?s:c:u>c?u:c,v=n.next;v!==e;){if(v.x>=h&&v.x<=f&&v.y>=l&&v.y<=d&&p(i,s,o,u,a,c,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function a(t,e,r,n){var i=t.prev,o=t,a=t.next;if(m(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,c=a.x,h=i.y,l=o.y,d=a.y,v=su?s>c?s:c:u>c?u:c,b=h>l?h>d?h:d:l>d?l:d,_=f(v,g,e,r,n),w=f(y,b,e,r,n),x=t.prevZ,E=t.nextZ;x&&x.z>=_&&E&&E.z<=w;){if(x.x>=v&&x.x<=y&&x.y>=g&&x.y<=b&&x!==i&&x!==a&&p(s,h,u,l,c,d,x.x,x.y)&&m(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,E.x>=v&&E.x<=y&&E.y>=g&&E.y<=b&&E!==i&&E!==a&&p(s,h,u,l,c,d,E.x,E.y)&&m(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(;x&&x.z>=_;){if(x.x>=v&&x.x<=y&&x.y>=g&&x.y<=b&&x!==i&&x!==a&&p(s,h,u,l,c,d,x.x,x.y)&&m(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;E&&E.z<=w;){if(E.x>=v&&E.x<=y&&E.y>=g&&E.y<=b&&E!==i&&E!==a&&p(s,h,u,l,c,d,E.x,E.y)&&m(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function s(t,e,r){var i=t;do{var o=i.prev,a=i.next.next;!g(o,a)&&y(o,i,i.next,a)&&w(o,a)&&w(a,o)&&(e.push(o.i/r|0),e.push(i.i/r|0),e.push(a.i/r|0),A(i),A(i.next),i=t=a),i=i.next}while(i!==t);return n(i)}function u(t,e,r,o,a,s){var u=t;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&v(u,c)){var h=x(u,c);return u=n(u,u.next),h=n(h,h.next),i(u,e,r,o,a,s,0),void i(h,e,r,o,a,s,0)}c=c.next}u=u.next}while(u!==t)}function c(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a&&(a=s,r=n.x=n.x&&n.x>=h&&i!==n.x&&p(or.x||n.x===r.x&&l(r,n)))&&(r=n,d=u)),n=n.next}while(n!==c);return r}(t,e);if(!r)return e;var i=x(r,t);return n(i,i.next),n(r,r.next)}function l(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function f(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,r=t;do{(e.x=(t-a)*(o-s)&&(t-a)*(n-s)>=(r-a)*(e-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&y(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!==r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||g(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function g(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,r,n){var i=_(m(t,e,r)),o=_(m(t,e,n)),a=_(m(r,n,t)),s=_(m(r,n,e));return i!==o&&a!==s||(!(0!==i||!b(t,r,e))||(!(0!==o||!b(t,n,e))||(!(0!==a||!b(r,t,n))||!(0!==s||!b(r,e,n)))))}function b(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function _(t){return t>0?1:t<0?-1:0}function w(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function x(t,e){var r=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function E(t,e,r,n){var i=new S(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},6729:function(t){"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,a){if("function"!==typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||t,a),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i0}});else{var t=function(t){for(var e=window.document,r=i(e);r;)r=i(e=r.ownerDocument);return e}(),e=[],r=null,n=null;a.prototype.THROTTLE_TIMEOUT=100,a.prototype.POLL_INTERVAL=null,a.prototype.USE_MUTATION_OBSERVER=!0,a._setupCrossOriginUpdater=function(){return r||(r=function(t,r){n=t&&r?f(t,r):{top:0,bottom:0,left:0,right:0,width:0,height:0},e.forEach((function(t){t._checkForIntersections()}))}),r},a._resetCrossOriginUpdater=function(){r=null,n=null},a.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},a.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._unmonitorIntersections(t.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},a.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},a.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},a.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,r){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==r[e-1]}))},a.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},a.prototype._monitorIntersections=function(e){var r=e.defaultView;if(r&&-1==this._monitoringDocuments.indexOf(e)){var n=this._checkForIntersections,o=null,a=null;this.POLL_INTERVAL?o=r.setInterval(n,this.POLL_INTERVAL):(s(r,"resize",n,!0),s(e,"scroll",n,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in r&&(a=new r.MutationObserver(n)).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push((function(){var t=e.defaultView;t&&(o&&t.clearInterval(o),u(t,"resize",n,!0)),u(e,"scroll",n,!0),a&&a.disconnect()}));var c=this.root&&(this.root.ownerDocument||this.root)||t;if(e!=c){var h=i(e);h&&this._monitorIntersections(h.ownerDocument)}}},a.prototype._unmonitorIntersections=function(e){var r=this._monitoringDocuments.indexOf(e);if(-1!=r){var n=this.root&&(this.root.ownerDocument||this.root)||t,o=this._observationTargets.some((function(t){var r=t.element.ownerDocument;if(r==e)return!0;for(;r&&r!=n;){var o=i(r);if((r=o&&o.ownerDocument)==e)return!0}return!1}));if(!o){var a=this._monitoringUnsubscribes[r];if(this._monitoringDocuments.splice(r,1),this._monitoringUnsubscribes.splice(r,1),a(),e!=n){var s=i(e);s&&this._unmonitorIntersections(s.ownerDocument)}}}},a.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e=0&&s>=0&&{top:r,bottom:n,left:i,right:o,width:a,height:s}||null}function h(t){var e;try{e=t.getBoundingClientRect()}catch(r){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function l(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function f(t,e){var r=e.top-t.top,n=e.left-t.left;return{top:r,left:n,height:e.height,width:e.width,bottom:r+e.height,right:n+e.width}}function d(t,e){for(var r=e;r;){if(r==t)return!0;r=p(r)}return!1}function p(e){var r=e.parentNode;return 9==e.nodeType&&e!=t?i(e):(r&&r.assignedSlot&&(r=r.assignedSlot.parentNode),r&&11==r.nodeType&&r.host?r.host:r)}function v(t){return t&&9===t.nodeType}}()},8949:function(t,e,r){"use strict";r.d(e,{Fl:function(){return Pt},Gf:function(){return He},LO:function(){return kt},aD:function(){return Ce},jQ:function(){return je},ky:function(){return lr},le:function(){return ge},rC:function(){return cr}});function n(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;nt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(t){var e=function(t,e){if("object"!==typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===typeof e?e:String(e)}var Z=Symbol("mobx-stored-annotations");function H(t){return Object.assign((function(e,r){G(e,r,t)}),t)}function G(t,e,r){C(t,Z)||x(t,Z,B({},t[Z])),function(t){return t.annotationType_===J}(r)||(t[Z][e]=r)}var V=Symbol("mobx administration"),z=function(){function t(t){void 0===t&&(t="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Vt.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach((function(t){return t()}))},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(t){return t()}))},e.reportObserved=function(){return ve(this)},e.reportChanged=function(){de(),me(this),ce.stateVersion=ce.stateVersionn&&(n=s.dependenciesState_)}r.length=i,t.newObserving_=null,o=e.length;for(;o--;){var u=e[o];0===u.diffValue_&&le(u,t),u.diffValue_=0}for(;i--;){var c=r[i];1===c.diffValue_&&(c.diffValue_=0,he(c,t))}n!==Vt.UP_TO_DATE_&&(t.dependenciesState_=n,t.onBecomeStale_())}(t),ie(n),i}function Qt(t){var e=t.observing_;t.observing_=[];for(var r=e.length;r--;)le(e[r],t);t.dependenciesState_=Vt.NOT_TRACKING_}function te(t){var e=ee();try{return t()}finally{re(e)}}function ee(){var t=ce.trackingDerivation;return ce.trackingDerivation=null,t}function re(t){ce.trackingDerivation=t}function ne(t){var e=ce.allowStateReads;return ce.allowStateReads=t,e}function ie(t){ce.allowStateReads=t}function oe(t){if(t.dependenciesState_!==Vt.UP_TO_DATE_){t.dependenciesState_=Vt.UP_TO_DATE_;for(var e=t.observing_,r=e.length;r--;)e[r].lowestObserverState_=Vt.UP_TO_DATE_}}var ae=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0,this.stateVersion=Number.MIN_SAFE_INTEGER},se=!0,ue=!1,ce=function(){var t=o();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(se=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new ae).version&&(se=!1),se?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new ae):(setTimeout((function(){ue||n(35)}),1),new ae)}();function he(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function le(t,e){t.observers_.delete(e),0===t.observers_.size&&fe(t)}function fe(t){!1===t.isPendingUnobservation_&&(t.isPendingUnobservation_=!0,ce.pendingUnobservations.push(t))}function de(){ce.inBatch++}function pe(){if(0===--ce.inBatch){be();for(var t=ce.pendingUnobservations,e=0;e0&&fe(t),!1)}function me(t){t.lowestObserverState_!==Vt.STALE_&&(t.lowestObserverState_=Vt.STALE_,t.observers_.forEach((function(t){t.dependenciesState_===Vt.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=Vt.STALE_})))}var ge=function(){function t(t,e,r,n){void 0===t&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Vt.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=zt.NONE,this.name_=t,this.onInvalidate_=e,this.errorHandler_=r,this.requiresObservable_=n}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,ce.pendingReactions.push(this),be())},e.isScheduled=function(){return this.isScheduled_},e.runReaction_=function(){if(!this.isDisposed_){de(),this.isScheduled_=!1;var t=ce.trackingContext;if(ce.trackingContext=this,Kt(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}ce.trackingContext=t,pe()}},e.track=function(t){if(!this.isDisposed_){de();0,this.isRunning_=!0;var e=ce.trackingContext;ce.trackingContext=this;var r=$t(this,t,void 0);ce.trackingContext=e,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Qt(this),Yt(r)&&this.reportExceptionInDerivation_(r.cause),pe()}},e.reportExceptionInDerivation_=function(t){var e=this;if(this.errorHandler_)this.errorHandler_(t,this);else{if(ce.disableErrorBoundaries)throw t;var r="[mobx] uncaught error in '"+this+"'";ce.suppressReactionErrors||console.error(r,t),ce.globalReactionErrorHandlers.forEach((function(r){return r(t,e)}))}},e.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(de(),Qt(this),pe()))},e.getDisposer_=function(){var t=this.dispose.bind(this);return t[V]=this,t},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(t){void 0===t&&(t=!1),function(){n("trace() is not available in production builds");for(var t=!1,e=arguments.length,r=new Array(e),i=0;i0||ce.isRunningReactions||ye(_e)}function _e(){ce.isRunningReactions=!0;for(var t=ce.pendingReactions,e=0;t.length>0;){100===++e&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var r=t.splice(0),n=0,i=r.length;n0&&(r.dependencies=(e=t.observing_,Array.from(new Set(e))).map(Ge)),r}var Ve=0;function ze(){this.message="FLOW_CANCELLED"}ze.prototype=Object.create(Error.prototype);var We=rt("flow"),Xe=rt("flow.bound",{bound:!0}),qe=Object.assign((function(t,e){if(y(e))return G(t,e,We);var r=t,n=r.name||"",i=function(){var t,e=this,i=arguments,o=++Ve,a=Ce(n+" - runid: "+o+" - init",r).apply(e,i),s=void 0,u=new Promise((function(e,r){var i=0;function u(t){var e;s=void 0;try{e=Ce(n+" - runid: "+o+" - yield "+i++,a.next).call(a,t)}catch(u){return r(u)}h(e)}function c(t){var e;s=void 0;try{e=Ce(n+" - runid: "+o+" - yield "+i++,a.throw).call(a,t)}catch(u){return r(u)}h(e)}function h(t){if(!g(null==t?void 0:t.then))return t.done?e(t.value):(s=Promise.resolve(t.value)).then(u,c);t.then(h,r)}t=r,u(void 0)}));return u.cancel=Ce(n+" - runid: "+o+" - cancel",(function(){try{s&&Ye(s);var e=a.return(void 0),r=Promise.resolve(e.value);r.then(m,m),Ye(r),t(new ze)}catch(n){t(n)}})),u};return i.isMobXFlow=!0,i}),We);function Ye(t){g(t.cancel)&&t.cancel()}function Ke(t){return!0===(null==t?void 0:t.isMobXFlow)}function Je(t,e){return!!t&&(void 0!==e?!!Hr(t)&&t[V].values_.has(e):Hr(t)||!!t[V]||W(t)||we(t)||Xt(t))}function $e(t){return Je(t)}function Qe(t){switch(t.length){case 0:return ce.trackingDerivation;case 1:return en(t[0]);case 2:return en(t[0],t[1])}}function tr(t,e){void 0===e&&(e=void 0),de();try{return t.apply(e)}finally{pe()}}function er(t){return t[V]}qe.bound=H(Xe);var rr={has:function(t,e){return er(t).has_(e)},get:function(t,e){return er(t).get_(e)},set:function(t,e,r){var n;return!!y(e)&&(null==(n=er(t).set_(e,r,!0))||n)},deleteProperty:function(t,e){var r;return!!y(e)&&(null==(r=er(t).delete_(e,!0))||r)},defineProperty:function(t,e,r){var n;return null==(n=er(t).defineProperty_(e,r))||n},ownKeys:function(t){return er(t).ownKeys_()},preventExtensions:function(t){n(13)}};function nr(t){return void 0!==t.interceptors_&&t.interceptors_.length>0}function ir(t,e){var r=t.interceptors_||(t.interceptors_=[]);return r.push(e),v((function(){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}))}function or(t,e){var r=ee();try{for(var i=[].concat(t.interceptors_||[]),o=0,a=i.length;o0}function sr(t,e){var r=t.changeListeners_||(t.changeListeners_=[]);return r.push(e),v((function(){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}))}function ur(t,e){var r=ee(),n=t.changeListeners_;if(n){for(var i=0,o=(n=n.slice()).length;i0?t.map(this.dehancer):t},e.intercept_=function(t){return ir(this,t)},e.observe_=function(t,e){return void 0===e&&(e=!1),e&&t({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),sr(this,t)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(t){("number"!==typeof t||isNaN(t)||t<0)&&n("Out of range: "+t);var e=this.values_.length;if(t!==e)if(t>e){for(var r=new Array(t-e),i=0;i0&&Qr(t+e+1)},e.spliceWithArray_=function(t,e,r){var n=this;this.atom_;var i=this.values_.length;if(void 0===t?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),e=1===arguments.length?i-t:void 0===e||null===e?0:Math.max(0,Math.min(e,i-t)),void 0===r&&(r=h),nr(this)){var o=or(this,{object:this.proxy_,type:fr,index:t,removedCount:e,added:r});if(!o)return h;e=o.removedCount,r=o.added}if(r=0===r.length?r:r.map((function(t){return n.enhancer_(t,void 0)})),this.legacyMode_){var a=r.length-e;this.updateArrayLength_(i,a)}var s=this.spliceItemsIntoValues_(t,e,r);return 0===e&&0===r.length||this.notifyArraySplice_(t,r,s),this.dehanceValues_(s)},e.spliceItemsIntoValues_=function(t,e,r){var n;if(r.length<1e4)return(n=this.values_).splice.apply(n,[t,e].concat(r));var i=this.values_.slice(t,t+e),o=this.values_.slice(t+e);this.values_.length+=r.length-e;for(var a=0;a=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[t]);console.warn("[mobx] Out of bounds read: "+t)},e.set_=function(t,e){var r=this.values_;if(this.legacyMode_&&t>r.length&&n(17,t,r.length),t2?r-2:0),i=2;i-1&&(this.splice(r,1),!0)}};function yr(t,e){"function"===typeof Array.prototype[t]&&(gr[t]=e(t))}function br(t){return function(){var e=this[V];e.atom_.reportObserved();var r=e.dehanceValues_(e.values_);return r[t].apply(r,arguments)}}function _r(t){return function(e,r){var n=this,i=this[V];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[t]((function(t,i){return e.call(r,t,i,n)}))}}function wr(t){return function(){var e=this,r=this[V];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(t,r,n){return i(t,r,n,e)},n[t].apply(n,arguments)}}yr("concat",br),yr("flat",br),yr("includes",br),yr("indexOf",br),yr("join",br),yr("lastIndexOf",br),yr("slice",br),yr("toString",br),yr("toLocaleString",br),yr("every",_r),yr("filter",_r),yr("find",_r),yr("findIndex",_r),yr("flatMap",_r),yr("forEach",_r),yr("map",_r),yr("some",_r),yr("reduce",wr),yr("reduceRight",wr);var xr,Er,Ar=A("ObservableArrayAdministration",vr);function Sr(t){return b(t)&&Ar(t[V])}var Tr={},kr="add",Rr="delete";xr=Symbol.iterator,Er=Symbol.toStringTag;var Mr,Cr,Pr=function(){function t(t,e,r){var i=this;void 0===e&&(e=Y),void 0===r&&(r="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[V]=Tr,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=e,this.name_=r,g(Map)||n(18),this.keysAtom_=X("ObservableMap.keys()"),this.data_=new Map,this.hasMap_=new Map,Ft(!0,(function(){i.merge(t)}))}var e=t.prototype;return e.has_=function(t){return this.data_.has(t)},e.has=function(t){var e=this;if(!ce.trackingDerivation)return this.has_(t);var r=this.hasMap_.get(t);if(!r){var n=r=new Gt(this.has_(t),K,"ObservableMap.key?",!1);this.hasMap_.set(t,n),De(n,(function(){return e.hasMap_.delete(t)}))}return r.get()},e.set=function(t,e){var r=this.has_(t);if(nr(this)){var n=or(this,{type:r?dr:kr,object:this,newValue:e,name:t});if(!n)return this;e=n.newValue}return r?this.updateValue_(t,e):this.addValue_(t,e),this},e.delete=function(t){var e=this;if((this.keysAtom_,nr(this))&&!or(this,{type:Rr,object:this,name:t}))return!1;if(this.has_(t)){var r=ar(this),n=r?{observableKind:"map",debugObjectName:this.name_,type:Rr,object:this,oldValue:this.data_.get(t).value_,name:t}:null;return tr((function(){var r;e.keysAtom_.reportChanged(),null==(r=e.hasMap_.get(t))||r.setNewValue_(!1),e.data_.get(t).setNewValue_(void 0),e.data_.delete(t)})),r&&ur(this,n),!0}return!1},e.updateValue_=function(t,e){var r=this.data_.get(t);if((e=r.prepareNewValue_(e))!==ce.UNCHANGED){var n=ar(this),i=n?{observableKind:"map",debugObjectName:this.name_,type:dr,object:this,oldValue:r.value_,name:t,newValue:e}:null;0,r.setNewValue_(e),n&&ur(this,i)}},e.addValue_=function(t,e){var r=this;this.keysAtom_,tr((function(){var n,i=new Gt(e,r.enhancer_,"ObservableMap.key",!1);r.data_.set(t,i),e=i.value_,null==(n=r.hasMap_.get(t))||n.setNewValue_(!0),r.keysAtom_.reportChanged()}));var n=ar(this),i=n?{observableKind:"map",debugObjectName:this.name_,type:kr,object:this,name:t,newValue:e}:null;n&&ur(this,i)},e.get=function(t){return this.has(t)?this.dehanceValue_(this.data_.get(t).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var t=this,e=this.keys();return cn({next:function(){var r=e.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:t.get(i)}}})},e.entries=function(){var t=this,e=this.keys();return cn({next:function(){var r=e.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:[i,t.get(i)]}}})},e[xr]=function(){return this.entries()},e.forEach=function(t,e){for(var r,n=F(this);!(r=n()).done;){var i=r.value,o=i[0],a=i[1];t.call(e,a,o,this)}},e.merge=function(t){var e=this;return Ir(t)&&(t=new Map(t)),tr((function(){_(t)?function(t){var e=Object.keys(t);if(!k)return e;var r=Object.getOwnPropertySymbols(t);return r.length?[].concat(e,r.filter((function(e){return c.propertyIsEnumerable.call(t,e)}))):e}(t).forEach((function(r){return e.set(r,t[r])})):Array.isArray(t)?t.forEach((function(t){var r=t[0],n=t[1];return e.set(r,n)})):S(t)?(t.constructor!==Map&&n(19,t),t.forEach((function(t,r){return e.set(r,t)}))):null!==t&&void 0!==t&&n(20,t)})),this},e.clear=function(){var t=this;tr((function(){te((function(){for(var e,r=F(t.keys());!(e=r()).done;){var n=e.value;t.delete(n)}}))}))},e.replace=function(t){var e=this;return tr((function(){for(var r,i=function(t){if(S(t)||Ir(t))return t;if(Array.isArray(t))return new Map(t);if(_(t)){var e=new Map;for(var r in t)e.set(r,t[r]);return e}return n(21,t)}(t),o=new Map,a=!1,s=F(e.data_.keys());!(r=s()).done;){var u=r.value;if(!i.has(u))if(e.delete(u))a=!0;else{var c=e.data_.get(u);o.set(u,c)}}for(var h,l=F(i.entries());!(h=l()).done;){var f=h.value,d=f[0],p=f[1],v=e.data_.has(d);if(e.set(d,p),e.data_.has(d)){var m=e.data_.get(d);o.set(d,m),v||(a=!0)}}if(!a)if(e.data_.size!==o.size)e.keysAtom_.reportChanged();else for(var g=e.data_.keys(),y=o.keys(),b=g.next(),w=y.next();!b.done;){if(b.value!==w.value){e.keysAtom_.reportChanged();break}b=g.next(),w=y.next()}e.data_=o})),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(t,e){return sr(this,t)},e.intercept_=function(t){return ir(this,t)},O(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Er,get:function(){return"Map"}}]),t}(),Ir=A("ObservableMap",Pr);var Or={};Mr=Symbol.iterator,Cr=Symbol.toStringTag;var Br=function(){function t(t,e,r){void 0===e&&(e=Y),void 0===r&&(r="ObservableSet"),this.name_=void 0,this[V]=Or,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,g(Set)||n(22),this.atom_=X(this.name_),this.enhancer_=function(t,n){return e(t,n,r)},t&&this.replace(t)}var e=t.prototype;return e.dehanceValue_=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.clear=function(){var t=this;tr((function(){te((function(){for(var e,r=F(t.data_.values());!(e=r()).done;){var n=e.value;t.delete(n)}}))}))},e.forEach=function(t,e){for(var r,n=F(this);!(r=n()).done;){var i=r.value;t.call(e,i,i,this)}},e.add=function(t){var e=this;if((this.atom_,nr(this))&&!or(this,{type:kr,object:this,newValue:t}))return this;if(!this.has(t)){tr((function(){e.data_.add(e.enhancer_(t,void 0)),e.atom_.reportChanged()}));var r=!1,n=ar(this),i=n?{observableKind:"set",debugObjectName:this.name_,type:kr,object:this,newValue:t}:null;r,n&&ur(this,i)}return this},e.delete=function(t){var e=this;if(nr(this)&&!or(this,{type:Rr,object:this,oldValue:t}))return!1;if(this.has(t)){var r=ar(this),n=r?{observableKind:"set",debugObjectName:this.name_,type:Rr,object:this,oldValue:t}:null;return tr((function(){e.atom_.reportChanged(),e.data_.delete(t)})),r&&ur(this,n),!0}return!1},e.has=function(t){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(t))},e.entries=function(){var t=0,e=Array.from(this.keys()),r=Array.from(this.values());return cn({next:function(){var n=t;return t+=1,nqr){for(var e=qr;e=0&&r++}t=un(t),e=un(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,c=e.constructor;if(u!==c&&!(g(u)&&u instanceof u&&g(c)&&c instanceof c)&&"constructor"in t&&"constructor"in e)return!1}if(0===r)return!1;r<0&&(r=-1),i=i||[];for(var h=(n=n||[]).length;h--;)if(n[h]===t)return i[h]===e;if(n.push(t),i.push(e),s){if((h=t.length)!==e.length)return!1;for(;h--;)if(!sn(t[h],e[h],r-1,n,i))return!1}else{var l,f=Object.keys(t);if(h=f.length,Object.keys(e).length!==h)return!1;for(;h--;)if(!C(e,l=f[h])||!sn(t[l],e[l],r-1,n,i))return!1}return n.pop(),i.pop(),!0}function un(t){return Sr(t)?t.slice():S(t)||Ir(t)||T(t)||Nr(t)?Array.from(t.entries()):t}function cn(t){return t[Symbol.iterator]=hn,t}function hn(){return this}["Symbol","Map","Set"].forEach((function(t){"undefined"===typeof o()[t]&&n("MobX requires global '"+t+"' to be available or polyfilled")})),"object"===typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}},extras:{getDebugName:nn},$mobx:V})},3454:function(t,e,r){"use strict";var n,i;t.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"===typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(7663)},6840:function(t,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(4915)}])},4915:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return ur}});var n=r(6042),i=r(9396),o=r(5893),a=(r(400),r(7294)),s=(r(2313),r(6337),r(9008)),u=r.n(s),c=r(4298),h=r.n(c),l=r(523),f=r(8232),d=r(9772),p=r(198),v=r(5939),m=r(2561),g=r(6704),y=r(2660),b={pwa:!1,title:"\u0417\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0443 \u043a\u043e\u043f\u0438\u0442\u044c",description:"\u041f\u0440\u0438\u043c\u0438\u0442\u0435 \u0432\u044b\u0437\u043e\u0432 \u043e\u0442 \u0422-\u0411\u0430\u043d\u043a\u0430 \u0438 \u043f\u043e\u0431\u043e\u0440\u0438\u0442\u0435\u0441\u044c \u0437\u0430 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0439 \u043f\u0440\u0438\u0437 \u0438\u0437 \u043e\u0431\u0449\u0435\u0433\u043e \u0444\u043e\u043d\u0434\u0430 \u0432 2 \u043c\u043b\u043d \u20bd",themeColor:"black",viewport:"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no",social:{title:"\u0417\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0443 \u043a\u043e\u043f\u0438\u0442\u044c",description:"\u041f\u0440\u0438\u043c\u0438\u0442\u0435 \u0432\u044b\u0437\u043e\u0432 \u043e\u0442 \u0422-\u0411\u0430\u043d\u043a\u0430 \u0438 \u043f\u043e\u0431\u043e\u0440\u0438\u0442\u0435\u0441\u044c \u0437\u0430 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0439 \u043f\u0440\u0438\u0437 \u0438\u0437 \u043e\u0431\u0449\u0435\u0433\u043e \u0444\u043e\u043d\u0434\u0430 \u0432 2 \u043c\u043b\u043d \u20bd",image:"".concat(g.p.APP_STATIC_URL,"/meta/share_fb.png"),imageTwitter:"".concat(g.p.APP_STATIC_URL,"/meta/share_tw.png"),imageVk:"".concat(g.p.APP_STATIC_URL,"/meta/share_vk.png"),url:"https://saving-challenge.tbank.ru",appIdFb:"TODO"},cdnUrl:g.p.APP_STATIC_BASE_URL},_=r(5031),w=r(3631),x=r(1438),E=r(828),A=r(4322),S=function t(e){var r=this;(0,x.Z)(this,t),this.localStorage=e,this.headersData={authToken:"",sessionId:"",userId:"",mb:{mbversion:"",platform:"",auth:""}},this.setAuthToken=function(t){r.headersData.authToken=t||"",r.localStorage.setItem(y.UA,t||"")},this.setMbHeadersData=function(t){Object.entries(t).map((function(t){var e=(0,E.Z)(t,2),n=e[0],i=e[1];r.headersData.mb[n]=i}))},this.setUserIdData=function(t){r.headersData.userId=t||""},this.setSessionIdData=function(t){r.headersData.sessionId=t||""},this.getHeaders=function(){var t={};return Object.entries(r.getMbHeadersData()).forEach((function(e){var r=(0,E.Z)(e,2),n=r[0],i=r[1];t["x-project-".concat(n)]=i})),(0,i.Z)((0,n.Z)({},t),{"x-project-session-id":r.getSessionIdData(),"x-project-user-id":r.getUserIdData(),"x-project-auth-token":r.getAuthToken()})},this.getSessionIdData=function(){return r.headersData.sessionId},this.getMbHeadersData=function(){return r.headersData.mb},this.getUserIdData=function(){return r.headersData.userId},this.getAuthToken=function(){var t=r.headersData.authToken;return""!==t?t:r.localStorage.getItem(y.UA)||""}};(0,A.Lj)(S,_.V.localStorageService);var T=r(3587),k=r(9534),R=r(7566),M=function(){function t(e){(0,x.Z)(this,t),this.abPlatformHttpClient=e}return t.prototype.requestToggleValues=function(t){var e=(0,n.Z)({},t);if(t.method===R.RequestMethod.POST){var r=t.data,i=(0,k.Z)(t,["data"]);e=(0,n.Z)({body:r},i)}return this.abPlatformHttpClient.post(e)},t}();(0,A.Lj)(M,_.V.aBPlatformHTTPClient);var C=r(7568),P=r(4051),I=r.n(P),O=r(5293),B=Object.defineProperty,N=Object.defineProperties,L=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,j=(t,e,r)=>e in t?B(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Z=(t,e)=>{for(var r in e||(e={}))U.call(e,r)&&j(t,r,e[r]);if(D)for(var r of D(e))F.call(e,r)&&j(t,r,e[r]);return t},H=(t,e)=>N(t,L(e)),G=(t,e,r)=>new Promise(((n,i)=>{var o=t=>{try{s(r.next(t))}catch(e){i(e)}},a=t=>{try{s(r.throw(t))}catch(e){i(e)}},s=t=>t.done?n(t.value):Promise.resolve(t.value).then(o,a);s((r=r.apply(t,e)).next())})),V=class extends Error{constructor(t){super(t),Object.setPrototypeOf(this,V.prototype),this.name="OpenFeatureError"}},z="ERROR",W=(t=>(t.Ready="PROVIDER_READY",t.Error="PROVIDER_ERROR",t.ConfigurationChanged="PROVIDER_CONFIGURATION_CHANGED",t.Stale="PROVIDER_STALE",t))(W||{}),X=class{error(...t){console.error(...t)}warn(...t){console.warn(...t)}info(){}debug(){}},q=["error","warn","info","debug"],Y=class{constructor(t){this.fallbackLogger=new X;try{for(const e of q)if(!t[e]||"function"!==typeof t[e])throw new Error(`The provided logger is missing the ${e} method.`);this.logger=t}catch(e){console.error(e),console.error("Falling back to the default logger."),this.logger=this.fallbackLogger}}error(...t){this.log("error",...t)}warn(...t){this.log("warn",...t)}info(...t){this.log("info",...t)}debug(...t){this.log("debug",...t)}log(t,...e){try{this.logger[t](...e)}catch(r){this.fallbackLogger[t](...e)}}},K=class{constructor(t){this.globalLogger=t,this._handlers=new WeakMap,this.eventEmitter=new O({captureRejections:!0}),this.eventEmitter.on("error",(t=>{var e;null==(e=this._logger)||e.error("Error running event handler:",t)}))}emit(t,e){this.eventEmitter.emit(t,e)}addHandler(t,e){const r=t=>G(this,null,(function*(){yield e(t)}));this._handlers.set(e,r),this.eventEmitter.on(t,r)}removeHandler(t,e){const r=this._handlers.get(e);r&&this.eventEmitter.removeListener(t,r)}removeAllHandlers(t){t?this.eventEmitter.removeAllListeners(t):this.eventEmitter.removeAllListeners()}getHandlers(t){return this.eventEmitter.listeners(t)}setLogger(t){return this._eventLogger=new Y(t),this}get _logger(){var t,e;return null!=(e=this._eventLogger)?e:null==(t=this.globalLogger)?void 0:t.call(this)}},J=class extends K{},$=new class{getTransactionContext(){return{}}setTransactionContext(t,e){e()}};function Q(t){return function(t){return"string"===typeof t}(t)?t:void 0}function tt(t){return function(t){return"object"===typeof t}(t)?t:void 0}function et(t){return"undefined"!==typeof t&&null!==t}var rt=new class{constructor(){this.metadata={name:"No-op Provider"}}get status(){return"NOT_READY"}resolveBooleanEvaluation(t,e){return this.noOp(e)}resolveStringEvaluation(t,e){return this.noOp(e)}resolveNumberEvaluation(t,e){return this.noOp(e)}resolveObjectEvaluation(t,e){return this.noOp(e)}noOp(t){return Promise.resolve({value:t,reason:"No-op"})}},nt=Symbol.for("@openfeature/js-sdk/api"),it=globalThis,ot=class extends class{constructor(){this._hooks=[],this._transactionContextPropagator=$,this._context={},this._logger=new X,this._events=new J((()=>this._logger)),this._clientEventHandlers=new Map,this._clientProviders=new Map,this._clientEvents=new Map}addHooks(...t){return this._hooks=[...this._hooks,...t],this}getHooks(){return this._hooks}clearHooks(){return this._hooks=[],this}setLogger(t){return this._logger=new Y(t),this}get providerMetadata(){return this._defaultProvider.metadata}addHandler(t,e){this._events.addHandler(t,e)}removeHandler(t,e){this._events.removeHandler(t,e)}getHandlers(t){return this._events.getHandlers(t)}setProvider(t,e){var r,n,i,o,a,s,u;const c=Q(t),h=null!=(r=tt(t))?r:tt(e);if(!h)return this;const l=this.getProviderForClient(c);if(l===h)return this;const f=this.getAssociatedEventEmitters(c);if("function"===typeof h.initialize&&void 0===h.status){(this._logger||console).warn(`Provider ${null==(n=null==h?void 0:h.metadata)?void 0:n.name} implements 'initialize' but not 'status'. Please implement 'status'.`)}return"NOT_READY"===(null==h?void 0:h.status)&&"function"===typeof h.initialize?null==(a=null==(o=null==(i=h.initialize)?void 0:i.call(h,this._context))?void 0:o.then((()=>{var t;this.getAssociatedEventEmitters(c).forEach((t=>{null==t||t.emit("PROVIDER_READY",{clientName:c})})),null==(t=this._events)||t.emit("PROVIDER_READY",{clientName:c})})))||a.catch((t=>{var e;this.getAssociatedEventEmitters(c).forEach((e=>{null==e||e.emit("PROVIDER_ERROR",{clientName:c,message:t.message})})),null==(e=this._events)||e.emit("PROVIDER_ERROR",{clientName:c,message:t.message})})):(f.forEach((t=>{null==t||t.emit("PROVIDER_READY",{clientName:c})})),null==(s=this._events)||s.emit("PROVIDER_READY",{clientName:c})),c?this._clientProviders.set(c,h):this._defaultProvider=h,this.transferListeners(l,h,c,f),[...this._clientProviders.values(),this._defaultProvider].includes(l)||null==(u=null==l?void 0:l.onClose)||u.call(l),this}getProviderForClient(t){var e;return t&&null!=(e=this._clientProviders.get(t))?e:this._defaultProvider}buildAndCacheEventEmitterForClient(t){const e=this._clientEvents.get(t);if(e)return e;const r=new J((()=>this._logger));this._clientEvents.set(t,r);const n=this.getProviderForClient(t);return Object.values(W).forEach((e=>{var i;return null==(i=n.events)?void 0:i.addHandler(e,(n=>G(this,null,(function*(){r.emit(e,H(Z({},n),{clientName:t}))}))))})),r}getUnboundEmitters(){const t=[...this._clientProviders.keys()];return[...[...this._clientEvents.keys()].filter(et).filter((e=>!t.includes(e))).map((t=>this._clientEvents.get(t))),this._clientEvents.get(void 0)].filter(et)}getAssociatedEventEmitters(t){return t?[this.buildAndCacheEventEmitterForClient(t)]:this.getUnboundEmitters()}transferListeners(t,e,r,n){var i;null==(i=this._clientEventHandlers.get(r))||i.forEach((e=>{var r;return null==(r=t.events)?void 0:r.removeHandler(...e)}));const o=Object.values(W).map((t=>[t,e=>G(this,null,(function*(){n.forEach((n=>{null==n||n.emit(t,H(Z({},e),{clientName:r}))})),this._events.emit(t,H(Z({},e),{clientName:r}))}))]));this._clientEventHandlers.set(r,o),o.forEach((t=>{var r;return null==(r=e.events)?void 0:r.addHandler(...t)}))}close(){return G(this,null,(function*(){var t,e;try{yield null==(e=null==(t=null==this?void 0:this._defaultProvider)?void 0:t.onClose)?void 0:e.call(t)}catch(n){this.handleShutdownError(this._defaultProvider,n)}const r=Array.from(this._clientProviders);yield Promise.all(r.map((t=>G(this,[t],(function*([,t]){var e;try{yield null==(e=t.onClose)?void 0:e.call(t)}catch(n){this.handleShutdownError(this._defaultProvider,n)}})))))}))}handleShutdownError(t,e){this._logger.error(`Error during shutdown of provider ${t.metadata.name}: ${e}`),this._logger.error(null==e?void 0:e.stack)}setTransactionContextPropagator(t){const e="Invalid TransactionContextPropagator, will not be set: ";return"function"!==typeof(null==t?void 0:t.getTransactionContext)?this._logger.error(`${e}: getTransactionContext is not a function.`):"function"!==typeof(null==t?void 0:t.setTransactionContext)?this._logger.error(`${e}: setTransactionContext is not a function.`):this._transactionContextPropagator=t,this}setTransactionContext(t,e,...r){this._transactionContextPropagator.setTransactionContext(t,e,...r)}getTransactionContext(){try{return this._transactionContextPropagator.getTransactionContext()}catch(t){const e=t;return this._logger.error(`Error getting transaction context: ${null==e?void 0:e.message}, returning empty context.`),this._logger.error(null==e?void 0:e.stack),{}}}}{constructor(){super(),this._defaultProvider=rt}static getInstance(){const t=it[nt];if(t)return t;const e=new ot;return it[nt]=e,e}setContext(t){return this._context=t,this}getContext(){return this._context}getClient(t,e,r){var n,i;const o=Q(t),a=Q(e),s=null!=(i=null!=(n=tt(t))?n:tt(e))?i:tt(r);return new st((()=>this.getProviderForClient(o)),(()=>this.buildAndCacheEventEmitterForClient(o)),(()=>this._logger),{name:o,version:a},s)}},at=ot.getInstance(),st=class{constructor(t,e,r,n,i={}){this.providerAccessor=t,this.emitterAccessor=e,this.globalLogger=r,this.options=n,this._hooks=[],this._context=i}get metadata(){return{name:this.options.name,version:this.options.version,providerMetadata:this.providerAccessor().metadata}}addHandler(t,e){var r;this.emitterAccessor().addHandler(t,e);const n=!this._provider.status||"READY"===this._provider.status;if("PROVIDER_READY"===t&&n)try{e({clientName:this.metadata.name})}catch(i){null==(r=this._logger)||r.error("Error running event handler:",i)}}removeHandler(t,e){this.emitterAccessor().removeHandler(t,e)}getHandlers(t){return this.emitterAccessor().getHandlers(t)}setLogger(t){return this._clientLogger=new Y(t),this}setContext(t){return this._context=t,this}getContext(){return this._context}addHooks(...t){return this._hooks=[...this._hooks,...t],this}getHooks(){return this._hooks}clearHooks(){return this._hooks=[],this}getBooleanValue(t,e,r,n){return G(this,null,(function*(){return(yield this.getBooleanDetails(t,e,r,n)).value}))}getBooleanDetails(t,e,r,n){return this.evaluate(t,this._provider.resolveBooleanEvaluation,e,"boolean",r,n)}getStringValue(t,e,r,n){return G(this,null,(function*(){return(yield this.getStringDetails(t,e,r,n)).value}))}getStringDetails(t,e,r,n){return this.evaluate(t,this._provider.resolveStringEvaluation,e,"string",r,n)}getNumberValue(t,e,r,n){return G(this,null,(function*(){return(yield this.getNumberDetails(t,e,r,n)).value}))}getNumberDetails(t,e,r,n){return this.evaluate(t,this._provider.resolveNumberEvaluation,e,"number",r,n)}getObjectValue(t,e,r,n){return G(this,null,(function*(){return(yield this.getObjectDetails(t,e,r,n)).value}))}getObjectDetails(t,e,r,n){return this.evaluate(t,this._provider.resolveObjectEvaluation,e,"object",r,n)}evaluate(t,e,r,n){return G(this,arguments,(function*(t,e,r,n,i={},o={}){var a;const s=[...at.getHooks(),...this.getHooks(),...o.hooks||[],...this._provider.hooks||[]],u=[...s].reverse(),c=Z(Z(Z(Z({},at.getContext()),at.getTransactionContext()),this._context),i),h={flagKey:t,defaultValue:r,flagValueType:n,clientMetadata:this.metadata,providerMetadata:at.providerMetadata,context:c,logger:this._logger};try{const n=yield this.beforeHooks(s,h,o),i=yield e.call(this._provider,t,r,n,this._logger),c=H(Z({},i),{flagMetadata:Object.freeze(null!=(a=i.flagMetadata)?a:{}),flagKey:t});return yield this.afterHooks(u,h,c,o),c}catch(l){const e=null==l?void 0:l.message,n=(null==l?void 0:l.code)||"GENERAL";return yield this.errorHooks(u,h,l,o),{errorCode:n,errorMessage:e,value:r,reason:z,flagMetadata:Object.freeze({}),flagKey:t}}finally{yield this.finallyHooks(u,h,o)}}))}beforeHooks(t,e,r){return G(this,null,(function*(){var n;for(const i of t)Object.freeze(e),Object.assign(e.context,Z(Z({},e.context),yield null==(n=null==i?void 0:i.before)?void 0:n.call(i,e,Object.freeze(r.hookHints))));return Object.freeze(e.context)}))}afterHooks(t,e,r,n){return G(this,null,(function*(){var i;for(const o of t)yield null==(i=null==o?void 0:o.after)?void 0:i.call(o,e,r,n.hookHints)}))}errorHooks(t,e,r,n){return G(this,null,(function*(){var i;for(const a of t)try{yield null==(i=null==a?void 0:a.error)?void 0:i.call(a,e,r,n.hookHints)}catch(o){this._logger.error(`Unhandled error during 'error' hook: ${o}`),o instanceof Error&&this._logger.error(o.stack),this._logger.error(null==o?void 0:o.stack)}}))}finallyHooks(t,e,r){return G(this,null,(function*(){var n;for(const o of t)try{yield null==(n=null==o?void 0:o.finally)?void 0:n.call(o,e,r.hookHints)}catch(i){this._logger.error(`Unhandled error during 'finally' hook: ${i}`),i instanceof Error&&this._logger.error(i.stack),this._logger.error(null==i?void 0:i.stack)}}))}get _provider(){return this.providerAccessor()}get _logger(){return this._clientLogger||this.globalLogger()}},ut=function t(e){(0,x.Z)(this,t),this.featureToggleProvider=e;var r=this;this.init=function(){var t=(0,C.Z)(I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,at.setProvider(r.featureToggleProvider);case 2:return t.next=4,at.setContext({tenant:"ded-ps",userIds:{ssoId:e}});case 4:r.client=at.getClient();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};(0,A.Lj)(ut,_.V.featureToggleProvider);var ct,ht=r(4924);!function(t){t[t.UserId=y.FC]="UserId"}(ct||(ct={}));var lt=function(){function t(e){var r=this;(0,x.Z)(this,t),this.globalWindow=e,this.defaultMaxAge=5184e3,this.getUserId=function(){return r.getCookie(ct.UserId)},this.setUserId=function(t){r.setCookie(ct.UserId,t)},this.deleteUserId=function(){r.deleteCookie(ct.UserId)},this.getAllCookies=function(){return r.globalWindow.document.cookie}}var e=t.prototype;return e.getCookie=function(t){return this.globalWindow.document.cookie.split(";").map((function(t){return t.split("=")})).reduce((function(t,e){return t[decodeURIComponent(e[0].trim())]=decodeURIComponent(e[1].trim()),t}),{})[t]},e.setCookie=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i="number"===typeof r["max-age"]?r["max-age"]:this.defaultMaxAge;r=(0,n.Z)((0,ht.Z)({path:"/"},"max-age",i),r);var o=encodeURIComponent(t)+"="+encodeURIComponent(e);for(var a in r){o+="; "+a;var s=r[a];!0!==s&&(o+="="+s)}this.globalWindow.document.cookie=o},e.deleteCookie=function(t){this.setCookie(t,"",{"max-age":-1})},t}();(0,A.Lj)(lt,_.V.globalWindow);var ft=function t(e,r){var n=this;(0,x.Z)(this,t),this.resources=e,this.platformService=r,this.buildErrorData=function(t){var e=n.extractBreadcrumbs(t),r=n.platformService.isMb(),i=n.extractResources(e),o=null!==i&&void 0!==i?i:n.resources.errors.fallback;return{resources:r?o.mb:o.web,breadcrumbs:e,buildResults:{isMatched:"undefined"!==typeof i}}},this.extractBreadcrumbs=function(t){return w.HttpErrorProject.isHttpErrorProject(t)?{httpCode:t.httpCode,errorCode:t.errorCode,requestId:t.requestId}:w.HttpErrorBackend.isHttpErrorBackend(t)?{httpCode:t.response.httpCode}:{}},this.extractResources=function(t){var e=n.resources.errors,r=t.errorCode,i=t.httpCode;if(r){var o=e.errorCodes.find((function(t){return t.errorCodes.includes(r)}));if(o)return o}if(i){var a=e.httpCodes.find((function(t){return t.httpCodes.includes(i)}));if(a)return a}}};(0,A.Lj)(ft,_.V.resources,_.V.platformService);var dt=r(8029),pt=r(1418),vt=function(t){(0,dt.Z)(r,t);var e=(0,pt.Z)(r);function r(t){var n;return(0,x.Z)(this,r),(n=e.call(this,t)).abPlatformApi=t,n}return r}(r(6151).FeatureToggleProvider);(0,A.Lj)(vt,_.V.aBPlatformApi);var mt=r(9815),gt=function(){function t(e,r,n){(0,x.Z)(this,t),this.config=e,this.sentryBrowser=r,this.user=n,this.errorNames={ErrorBoundaryError:"ErrorBoundaryError",HttpErrorBackend:"HttpErrorBackend",UnmatchedError:"UnmatchedError"}}var e=t.prototype;return e.handleErrorBoundaryError=function(t){this.error(this.errorNames.ErrorBoundaryError,t)},e.handleHttpErrorBackend=function(t){this.error(this.errorNames.HttpErrorBackend,t)},e.handleUnMatchedError=function(t){this.error(this.errorNames.UnmatchedError,void 0,(0,n.Z)({},t))},e.log=function(){for(var t=arguments.length,e=new Array(t),r=0;ra)return!0;if(o0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return Object.entries(t).forEach((function(t){var r=(0,E.Z)(t,2),n=r[0],i=r[1];i&&e.append(n,i.toString())})),e},e.getAuthScenario=function(){return this.getQueryValue(this.keys.authScenario)},e.getMobileVersion=function(){return this.getQueryValue(this.keys.mobileVersion)},e.getAuth=function(){return this.getQueryValue(this.keys.auth)},e.getMobileVersionQuery=function(){return this.getQueryValue(this.keys.mobileVersion)},e.getPlatformQuery=function(){return this.getQueryValue(this.keys.platform)},e.replaceDynamicParamsInUrl=function(t,e){return Object.entries(e).forEach((function(e){var r=(0,E.Z)(e,2),n=r[0],i=r[1];t=t.replace(":".concat(n),"string"===typeof i?i:i.toString())})),t},t}();(0,A.Lj)(St,_.V.globalWindow);var Tt=function t(e,r,n,i){var o=this;(0,x.Z)(this,t),this.projectApiHeaders=e,this.queryStringService=r,this.localStorageService=n,this.cookieStorage=i,this.setMbData=function(){var t={mbversion:o.queryStringService.getMobileVersionQuery()||o.localStorageService.getItem("mbversion")||"",platform:o.queryStringService.getPlatformQuery()||o.localStorageService.getItem("platform")||"",auth:o.queryStringService.getAuth()||o.localStorageService.getItem("auth")||""};Object.entries(t).map((function(t){var e=(0,E.Z)(t,2),r=e[0],n=e[1];o.localStorageService.setItem(r,n)})),o.projectApiHeaders.setMbHeadersData(t)},this.setUserIdData=function(t){var e=t||"";e&&(o.localStorageService.setItem(y.FC,e),o.cookieStorage.setUserId(e));var r=e||o.localStorageService.getItem(y.FC)||o.cookieStorage.getUserId();o.projectApiHeaders.setUserIdData(r)}};(0,A.Lj)(Tt,_.V.projectApiHeaders,_.V.queryStringService,_.V.localStorageService,_.V.cookieStorage);var kt=function(){function t(e){var r=this;(0,x.Z)(this,t),this.user=e,this.tracking=(0,m.createTracking)(),this.updateLocation=function(){r.tracking.updateLocation()},this.trackClickToAuthedZone=function(t){r.tracking.sendEvent("specAction1",(0,n.Z)({specVar:t},r.getSpecVar4()))},this.trackUserAuth=function(t,e,i,o){var a={specVar2:e,specScreenType:t};o&&(a.specDbId=o),i&&(a.specVar=i),r.tracking.sendEvent("specAuth",(0,n.Z)({},a,r.getSpecVar4()))},this.trackOpenInvestBox=function(){r.tracking.sendEvent("specAction2")},this.trackClickInvestBoxAdvantages=function(t){r.tracking.sendEvent("specAction3",(0,n.Z)({specVar:t?y.V1.Close:y.V1.Open},r.getSpecVar4()))},this.trackUserStatus=function(t){r.tracking.sendEvent("specAction4",(0,n.Z)({specVar:t},r.getSpecVar4()))},this.trackOpenInvestBoxOnChallengePage=function(){r.tracking.sendEvent("specAction5",r.getSpecVar4())},this.trackTJClick=function(t){r.tracking.sendEvent("specAction6",(0,n.Z)({specVar:t},r.getSpecVar4()))},this.trackRingClick=function(){r.tracking.sendEvent("specAction7",r.getSpecVar4())},this.trackLinkClick=function(t){r.tracking.sendEvent("specAction8",(0,n.Z)({specVar:t},r.getSpecVar4()))},this.trackNotificationToggle=function(t){r.tracking.sendEvent("specAction9",(0,n.Z)({specVar:t},r.getSpecVar4()))},this.trackCustomChallengePageLoad=function(){r.tracking.sendEvent("specAction10",r.getSpecVar4())},this.getSpecVar4=function(){var t;return{specVar4:null===(t=r.user.userState)||void 0===t?void 0:t.user.ssoId}}}return t.prototype.setPersonalizedLandingMetrics=function(t){var e=window.tracking;e&&(e.state.personalizedLandingMetrics={},e.state.personalizedLandingMetrics.state={},Object.entries(t).forEach((function(t){var r=(0,E.Z)(t,2),n=r[0],i=r[1];e.state.personalizedLandingMetrics.state[n]=i})))},t}();(0,A.Lj)(kt,_.V.user);var Rt=function t(){(0,x.Z)(this,t),this.setUserSubscriptionStatus=function(){var t=(0,C.Z)(I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve({status:"ok"}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getWinners=(0,C.Z)(I().mark((function t(){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{status:"ok",payload:[{ulid:"1",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"2",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"3",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"4",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"5",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"6",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"7",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"8",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"9",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"10",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"11",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"12",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"13",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"14",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"15",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"16",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"17",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"18",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"19",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"20",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"21",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"22",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"23",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"24",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"25",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"26",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"27",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"28",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"29",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"30",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e4,phone:"8******3535"},{ulid:"31",firstName:"\u0418\u043c\u044f",lastName:"\u0424\u0430\u043c\u0438\u043b\u0438\u044f",amount:1e6,phone:"8******3535"}]});case 1:case"end":return t.stop()}}),t)}))),this.setOnboardingStatus=function(){var t=(0,C.Z)(I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.wait)(1e3);case 2:return t.abrupt("return",Promise.resolve({status:"ok"}));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};function Mt(t,e,r,n){var i,o=arguments.length,a=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,r,a):i(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a}Object.create;Object.create;"function"===typeof SuppressedError&&SuppressedError;var Ct=r(8949),Pt=function t(){var e=this;(0,x.Z)(this,t),this.sumToggleVariant=y.LB,this.setSumToggleVariant=function(t){e.sumToggleVariant=t},(0,Ct.rC)(this)};function It(t,e){var r,n;t.bind(_.V.envs).toConstant(g.p),t.bind(_.V.resources).toConstant(e),t.bind(_.V.globalWindow).toConstant(globalThis.window),t.bind(_.V.config).toConstant((r=t.get(_.V.envs),n=t.get(_.V.globalWindow),{envName:r.APP_ENVIRONMENT,logLevel:"debug",isServer:"undefined"===typeof n,appProjectUrl:r.APP_PROJECT_URL,appProjectApiUrl:r.APP_PROJECT_API_URL,appProjectApiMockEnabled:r.APP_PROJECT_API_MOCK_ENABLED,appProjectAuthApiMockEnabled:r.APP_PROJECT_AUTH_API_MOCK_ENABLED,appSsoApiUrl:r.APP_SSO_API_URL,appSsoClientUrl:r.APP_SSO_CLIENT_URL,appSsoApiMockEnabled:r.APP_SSO_API_MOCK_ENABLED,appSsoClientApiMockEnabled:r.APP_SSO_CLIENT_API_MOCK_ENABLED,appPostCompleteRedirectPath:r.APP_POST_COMPLETE_REDIRECT_PATH,appResourcesUseLocal:r.APP_RESOURCES_USE_LOCAL,appResourcesUrl:r.APP_RESOURCES_URL,appSentryDsn:r.APP_SENTRY_DSN,appSecretCodeEnabled:r.APP_SECRET_CODE_ENABLED,isLocal:r.APP_ENVIRONMENT===y.qA.Local,isStage:r.APP_ENVIRONMENT===y.qA.Stage,isProd:r.APP_ENVIRONMENT===y.qA.Prod,isIframe:"undefined"!==typeof n&&n.parent!==n,appStaticUrl:r.APP_STATIC_URL})),t.bind(_.V.queryStringService).toInstance(St).inSingletonScope(),t.bind(_.V.httpClientProjectApi).toInstance(At).inSingletonScope(),t.bind(_.V.localStorageService).toInstance((function(){return(0,T.initLocalStorage)()})).inSingletonScope(),t.bind(_.V.trackingService).toInstance(kt).inSingletonScope(),t.get(_.V.config).appProjectApiMockEnabled?t.bind(_.V.projectApi).toInstance(Rt).inSingletonScope():t.bind(_.V.projectApi).toInstance(Et).inSingletonScope(),t.bind(_.V.sentryBrowser).toInstance((function(){return v.SentryBrowser.getRealOrFake(t.get(_.V.globalWindow))})).inSingletonScope(),t.bind(_.V.loggerService).toInstance(gt).inSingletonScope(),t.bind(_.V.platformService).toInstance(bt).inSingletonScope(),t.bind(_.V.errorsService).toInstance(ft).inSingletonScope(),t.bind(_.V.cookieStorage).toInstance(lt).inSingletonScope(),t.bind(_.V.tracingService).toInstance(Tt).inSingletonScope(),t.bind(_.V.aBPlatformHTTPClient).toInstance(xt).inSingletonScope(),t.bind(_.V.aBPlatformApi).toInstance(M).inSingletonScope(),t.bind(_.V.featureToggleProvider).toInstance(vt).inSingletonScope(),t.bind(_.V.aBPlatformClient).toInstance(ut).inSingletonScope(),t.bind(_.V.aBStore).toInstance(Pt).inSingletonScope(),t.bind(_.V.navigationService).toInstance(yt).inSingletonScope(),t.bind(_.V.clientRoutes).toConstant(y.r8)}Mt([Ct.LO],Pt.prototype,"sumToggleVariant",void 0),Mt([Ct.aD],Pt.prototype,"setSumToggleVariant",void 0);var Ot=r(9582),Bt=r(9553),Nt=function(t){return t.status===Bt.t.Initial},Lt=function(){function t(e,r,o,a,s,u,c,h,l,f,d,p,v,m,g,b,_){var w=this;(0,x.Z)(this,t),this.user=e,this.projectApi=r,this.projectUserAuth=o,this.configService=a,this.winnersStore=s,this.errorsService=u,this.loggerService=c,this.tracking=h,this.platformService=l,this.tracingService=f,this.projectApiHeaders=d,this.localStorage=p,this.queryStringService=v,this.abPlatformClient=m,this.abStore=g,this.navigationService=b,this.resources=_;var E=this;this.setUserSubscriptionStatus=function(){var t=(0,C.Z)(I().mark((function t(e){var r;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,E.projectApi.setUserSubscriptionStatus(e);case 3:(r=E.user.userState)&&E.user.updateUserSettings((0,i.Z)((0,n.Z)({},r),{notifications:{remindersEnabled:e}})),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),E.loggerService.handleHttpErrorBackend(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}();var A=this;this.fetchWinners=(0,C.Z)(I().mark((function t(){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:A.winnersStore.setIsLoading(!0);try{A.winnersStore.setWinners(y.Ww)}catch(e){A.loggerService.handleHttpErrorBackend(e)}A.winnersStore.setIsLoading(!1);case 3:case"end":return t.stop()}}),t)}))),this.buildErrorData=function(t){var e=w.errorsService.buildErrorData(t.error);return e.buildResults.isMatched||w.loggerService.handleUnMatchedError(e.breadcrumbs),e};var S=this;this.logout=(0,C.Z)(I().mark((function t(){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:S.projectUserAuth.logout();case 1:case"end":return t.stop()}}),t)})));var T=this;this.handleErrorAction=function(){var t=(0,C.Z)(I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next=t.t0===Ot._.Logout?3:t.t0===Ot._.Reload?5:t.t0===Ot._.RedirectToCardForm?7:t.t0===Ot._.RedirectToOtherProductsMB?9:t.t0===Ot._.RedirectToOtherProducts?11:t.t0===Ot._.RedirectToInvestOpen?13:t.t0===Ot._.RedirectToInvestOpenMB?15:17;break;case 3:return T.logout(),t.abrupt("break",17);case 5:return T.navigationService.pageReload(),t.abrupt("break",17);case 7:return T.navigationService.goToFormOnMainPage(),t.abrupt("break",17);case 9:return T.navigationService.navigateToExternalLink(T.resources.content.ExternalLinks.juniorLinkMB,"_blank"),t.abrupt("break",17);case 11:return T.navigationService.navigateToExternalLink(T.resources.content.ExternalLinks.juniorLink,"_blank"),t.abrupt("break",17);case 13:return T.navigationService.navigateToExternalLink(T.resources.content.MustOpenInvest.link.href,"_blank"),t.abrupt("break",17);case 15:return T.navigationService.navigateToExternalLink(T.resources.content.MustOpenInvest.link.mbHref,"_blank"),t.abrupt("break",17);case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.isMb=function(){return w.platformService.isMb()};var k=this;this.fetchSumToggle=(0,C.Z)(I().mark((function t(){var e,r,o,a;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=null===(e=k.user.userState)||void 0===e?void 0:e.user.ssoId)){t.next=16;break}return t.next=5,k.abPlatformClient.init(r);case 5:return t.prev=5,t.next=9,null===(o=k.abPlatformClient.client)||void 0===o?void 0:o.getBooleanDetails(y.ZI,y.LB);case 9:(a=t.sent)&&(k.tracking.setPersonalizedLandingMetrics((0,i.Z)((0,n.Z)({},a.flagMetadata),{dcoReason:a.reason})),k.abStore.setSumToggleVariant(a.value)),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(5),k.loggerService.log(t.t0);case 16:return t.abrupt("return",Promise.resolve());case 17:case"end":return t.stop()}}),t,null,[[5,13]])}))),this.trackChallengeAnalytics=function(t){var e=t.isWaitingChallengeStart,r=t.isChallengeInProgress,n=t.isFailedProgress,i=t.isCheckingProgress,o=t.isChallengeCompleted,a=t.hasWinners,s=t.isWinner,u=t.completedWeeks;e&&w.tracking.trackUserStatus(y.J0.UserInitial),r&&w.tracking.trackUserStatus("".concat(y.J0.UserInProgress).concat(u)),n&&w.tracking.trackUserStatus(y.J0.UserFailed),i&&w.tracking.trackUserStatus("".concat(y.J0.UserChecking)),o&&(a?s?w.tracking.trackUserStatus("".concat(y.J0.UserWinner)):w.tracking.trackUserStatus("".concat(y.J0.UserNotWinner)):w.tracking.trackUserStatus("".concat(y.J0.UserCompleted)))},this.setNavigate=function(t){w.navigationService.setNavigate(t)},this.sendCompletedOnboardingStatus=function(t){w.projectApi.setOnboardingStatus(t);var e=w.user.userState;e&&w.user.updateUserSettings((0,i.Z)((0,n.Z)({},e),{user:(0,n.Z)({},e.user,t)}))},this.getUserType=function(t){if(t)return Nt(t)&&t.investboxStatus===Bt.B.Missing?y.FW.UserClientNoInvestbox:y.FW.UserClientParticipant}}return t.prototype.init=function(){var t=this;return(0,C.Z)(I().mark((function e(){var r,n;return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.platformService.init(),!t.isMb()){e.next=7;break}if(t.configService.isProd){e.next=6;break}return r=function(){return new Promise((function(t){var e=document.createElement("script");e.src="https://cdn.jsdelivr.net/npm/eruda",e.type="text/javascript",e.onload=function(){var e=document.createElement("script");e.innerHTML="\n eruda.init();\n ".concat(t(""),"\n "),document.body.appendChild(e)},document.body.appendChild(e)}))},e.next=6,r();case 6:t.tracingService.setMbData();case 7:t.projectApiHeaders.setSessionIdData((0,w.uuid4)()),(n=t.queryStringService.getCustomSSOToken())&&t.localStorage.setItem("customSSOToken",n),t.projectUserAuth.subscribe((function(e){t.user.handleUserAuthStateChange(e);var r,n,i,o,a=t.platformService.isMb()?y.YY.Native:y.YY.Web;t.user.isUserLoggedIn&&(t.tracingService.setUserIdData(null===(r=e.data)||void 0===r||null===(n=r.userInfo)||void 0===n?void 0:n.user.id),t.tracking.trackUserAuth(a,y.c.AuthUserValid,t.getUserType(),null===(i=e.data)||void 0===i?void 0:i.userInfo.user.id));t.user.isUserError&&t.tracking.trackUserAuth(a,"".concat(y.c.AuthError).concat(t.buildErrorData({error:e.error}).breadcrumbs.errorCode),t.getUserType(),null===(o=e.data)||void 0===o?void 0:o.userInfo.user.id)})),t.configService.isLocal&&t.projectUserAuth.subscribe(console.log),t.configService.isServer||t.projectUserAuth.auth();case 13:case"end":return e.stop()}}),e)})))()},t}();(0,A.Lj)(Lt,_.V.user,_.V.projectApi,_.V.projectUserAuth,_.V.config,_.V.winnersStore,_.V.errorsService,_.V.loggerService,_.V.trackingService,_.V.platformService,_.V.tracingService,_.V.projectApiHeaders,_.V.localStorageService,_.V.queryStringService,_.V.aBPlatformClient,_.V.aBStore,_.V.navigationService,_.V.resources);var Dt=function(){function t(){(0,x.Z)(this,t)}var e=t.prototype;return e.getPossibleAccumulation=function(t,e){for(var r=t,n=1;n<=e;n++)r-=100*n;return y.AN+Math.max(0,r)},e.getChallengeContentToggles=function(t){var e=Nt(t),r=e&&t.investboxStatus===Bt.B.Pending,n=e&&t.investboxStatus===Bt.B.Missing,i=e&&t.investboxStatus===Bt.B.Open,o=function(t){return t.status===Bt.t.Checking}(t),a=function(t){return t.status===Bt.t.Failed}(t),s=function(t){return t.status===Bt.t.Completed}(t),u=function(t){return t.status===Bt.t.Active}(t),c=!e||i,h=u||e?t.sumOnCurrentWeek:void 0,l=u||e?t.targetSumOnCurrentWeek:void 0;return{isWaitingChallengeStart:e,isInvestMissing:n,isInvestOpening:r,isCheckingProgress:o,isFailedProgress:a,isChallengeCompleted:s,isChallengeInProgress:u,hasProgress:c,sumOnCurrentWeek:h,targetSumOnCurrentWeek:l,isCurrentWeekCompleted:void 0!==h&&void 0!==l&&h>=l,failedWeek:a?t.completedWeeks+1:void 0,targetSumOnNextWeek:u?t.targetSumOnNextWeek:void 0,timeToNextWeek:u?t.currentWeekEndDate:void 0,startChallengeDay:t.startDay.day}},t}(),Ut=r(2951),Ft=function(){function t(){(0,x.Z)(this,t),this.state={status:w.ProjectUserAuthStatus.Loading,error:void 0,data:void 0},(0,Ct.rC)(this)}var e=t.prototype;return e.updateUserSettings=function(t){var e;this.state=(0,i.Z)((0,n.Z)({},this.state),{error:void 0,status:w.ProjectUserAuthStatus.LoggedIn,data:{userInfo:t,login:null===(e=this.state.data)||void 0===e?void 0:e.login}})},e.handleUserAuthStateChange=function(t){this.state=t},(0,Ut.Z)(t,[{key:"isUserLoading",get:function(){return this.state.status===w.ProjectUserAuthStatus.Loading}},{key:"isUserError",get:function(){return this.state.status===w.ProjectUserAuthStatus.Error}},{key:"isUserGuest",get:function(){return this.state.status===w.ProjectUserAuthStatus.Guest}},{key:"isUserLoggedIn",get:function(){return this.state.status===w.ProjectUserAuthStatus.LoggedIn}},{key:"userError",get:function(){return this.state.error?this.state.error:null}},{key:"userState",get:function(){var t;if(!this.state.error)return null===(t=this.state.data)||void 0===t?void 0:t.userInfo}}]),t}();Mt([Ct.LO],Ft.prototype,"state",void 0),Mt([Ct.Fl],Ft.prototype,"isUserLoading",null),Mt([Ct.Fl],Ft.prototype,"isUserError",null),Mt([Ct.Fl],Ft.prototype,"isUserGuest",null),Mt([Ct.Fl],Ft.prototype,"isUserLoggedIn",null),Mt([Ct.Fl],Ft.prototype,"userError",null),Mt([Ct.Fl],Ft.prototype,"userState",null),Mt([Ct.aD],Ft.prototype,"updateUserSettings",null),Mt([Ct.aD],Ft.prototype,"handleUserAuthStateChange",null);var jt=function(){function t(){(0,x.Z)(this,t),this.winners=[],this.winnersToShowNumber=y.kF,this.isLoading=!1,(0,Ct.ky)(this,{winners:Ct.LO,winnersToShowNumber:Ct.LO,isLoading:Ct.LO,winnerInfo:Ct.Fl,setWinners:Ct.aD,setWinnersToShowNumber:Ct.aD,setIsLoading:Ct.aD})}var e=t.prototype;return e.setWinners=function(t){this.winners=t},e.setWinnersToShowNumber=function(t){this.winnersToShowNumber=t},e.setIsLoading=function(t){this.isLoading=t},(0,Ut.Z)(t,[{key:"winnerInfo",get:function(){var t=new Map;return(0,mt.Z)(this.winners).sort((function(t,e){return e.amount-t.amount})).reduce((function(t,e){var r=t.get(e.amount);return r?r.push(e):t.set(e.amount,[e]),t}),t)}}]),t}(),Zt=r(5785),Ht=r(2662),Gt=r(2670),Vt=r(5807),zt=r(1296),Wt=r(1230),Xt=r(1330),qt=r(7871),Yt=r(2631),Kt=function(){function t(e,r,n){(0,x.Z)(this,t),this.value=e,this.time=r,this.next=null,this.isStepped=!1,this.ease=n?"function"===typeof n?n:oe(n):null}return(0,Ut.Z)(t,null,[{key:"createList",value:function(e){if("list"in e){var r,n=e.list,i=n[0],o=i.value,a=i.time,s=r=new t("string"===typeof o?ie(o):o,a,e.ease);if(n.length>2||2===n.length&&n[1].value!==o)for(var u=1;u0?t:1}},{key:"parent",get:function(){return this._parent},set:function(t){this.cleanup(),this._parent=t}},{key:"init",value:function(e){if(e){this.cleanup(),this._origConfig=e,this.minLifetime=e.lifetime.min,this.maxLifetime=e.lifetime.max,e.ease?this.customEase="function"===typeof e.ease?e.ease:oe(e.ease):this.customEase=null,this.particlesPerWave=1,e.particlesPerWave&&e.particlesPerWave>1&&(this.particlesPerWave=e.particlesPerWave),this.frequency=e.frequency,this.spawnChance="number"===typeof e.spawnChance&&e.spawnChance>0?e.spawnChance:1,this.emitterLifetime=e.emitterLifetime||-1,this.maxParticles=e.maxParticles>0?e.maxParticles:1e3,this.addAtBack=!!e.addAtBack,this.rotation=0,this.ownerPos.set(0),e.pos?this.spawnPos.copyFrom(e.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=void 0===e.emit||!!e.emit,this.autoUpdate=!!e.autoUpdate;var r=e.behaviors.map((function(e){var r=t.knownBehaviors[e.type];return r?new r(e.config):(console.error("Unknown behavior: ".concat(e.type)),null)})).filter((function(t){return!!t}));r.push(he),r.sort((function(t,e){return t===he?e.order===se.Spawn?1:-1:e===he?t.order===se.Spawn?-1:1:t.order-e.order})),this.initBehaviors=r.slice(),this.updateBehaviors=r.filter((function(t){return t!==he&&t.updateParticle})),this.recycleBehaviors=r.filter((function(t){return t!==he&&t.recycleParticle}))}}},{key:"getBehavior",value:function(e){return t.knownBehaviors[e]&&this.initBehaviors.find((function(r){return(0,Gt.Z)(r,t.knownBehaviors[e])}))||null}},{key:"fillPool",value:function(t){for(;t>0;--t){var e=new ue(this);e.next=this._poolFirst,this._poolFirst=e}}},{key:"recycle",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0;rr.maxLife||r.age<0)this.recycle(r);else{var n=r.age*r.oneOverLife;this.customEase&&(n=4===this.customEase.length?this.customEase(n,0,1,1):this.customEase(n)),r.agePercent=n;for(var i=0;i=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles)this._spawnTimer+=this._frequency;else{var c=void 0,h=void 0;if(this._prevPosIsValid&&this._posChanged){var l=1+this._spawnTimer/t;c=(s-o)*l+o,h=(u-a)*l+a}else c=s,h=u;for(var f=null,d=null,p=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),v=0;v=this.spawnChance)){var m=void 0;if(m=this.minLifetime===this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,!(-this._spawnTimer>=m)){var g=void 0;this._poolFirst?(g=this._poolFirst,this._poolFirst=this._poolFirst.next,g.next=null):g=new ue(this),g.init(m),this.addAtBack?this._parent.addChildAt(g,0):this._parent.addChild(g),f?(d.next=g,g.prev=d,d=g):d=f=g,++this.particleCount}}if(f){this._activeParticlesLast?(this._activeParticlesLast.next=f,f.prev=this._activeParticlesLast,this._activeParticlesLast=d):(this._activeParticlesFirst=f,this._activeParticlesLast=d);for(var y=0;y=this.spawnChance)){var a=void 0;this._poolFirst?(a=this._poolFirst,this._poolFirst=this._poolFirst.next,a.next=null):a=new ue(this);var s=void 0;s=this.minLifetime===this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,a.init(s),this.addAtBack?this._parent.addChildAt(a,0):this._parent.addChild(a),r?(n.next=a,a.prev=n,n=a):n=r=a,++this.particleCount}if(r){this._activeParticlesLast?(this._activeParticlesLast.next=r,r.prev=this._activeParticlesLast,this._activeParticlesLast=n):(this._activeParticlesFirst=r,this._activeParticlesLast=n);for(var u=0;uthis.maxSpeed&&ne(r,this.maxSpeed/o)}t.x+=(n+r.x)/2*e,t.y+=(i+r.y)/2*e,this.rotate&&(t.rotation=Math.atan2(r.y,r.x))}}]),t}();function me(t){return this.ease&&(t=this.ease(t)),(this.first.next.value-this.first.value)*t+this.first.value}function ge(t){this.ease&&(t=this.ease(t));var e=this.first.value,r=this.first.next.value;return te((r.r-e.r)*t+e.r,(r.g-e.g)*t+e.g,(r.b-e.b)*t+e.b)}function ye(t){this.ease&&(t=this.ease(t));for(var e=this.first,r=e.next;t>r.time;)e=r,r=r.next;return t=(t-e.time)/(r.time-e.time),(r.value-e.value)*t+e.value}function be(t){this.ease&&(t=this.ease(t));for(var e=this.first,r=e.next;t>r.time;)e=r,r=r.next;t=(t-e.time)/(r.time-e.time);var n=e.value,i=r.value;return te((i.r-n.r)*t+n.r,(i.g-n.g)*t+n.g,(i.b-n.b)*t+n.b)}function _e(t){this.ease&&(t=this.ease(t));for(var e=this.first;e.next&&t>e.next.time;)e=e.next;return e.value}function we(t){this.ease&&(t=this.ease(t));for(var e=this.first;e.next&&t>e.next.time;)e=e.next;var r=e.value;return te(r.r,r.g,r.b)}ve.type="moveAcceleration",ve.editorConfig=null;var xe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,x.Z)(this,t),this.first=null,this.isColor=!!e,this.interpolate=null,this.ease=null}return(0,Ut.Z)(t,[{key:"reset",value:function(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?ge:me:t.isStepped?this.interpolate=this.isColor?we:_e:this.interpolate=this.isColor?be:ye,this.ease=this.first.ease}}]),t}(),Ee=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.list=new xe(!1),this.list.reset(Kt.createList(e.alpha))}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)e.alpha=this.list.first.value,e=e.next}},{key:"updateParticle",value:function(t){t.alpha=this.list.interpolate(t.agePercent)}}]),t}();Ee.type="alpha",Ee.editorConfig=null;var Ae=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.value=e.alpha}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)e.alpha=this.value,e=e.next}}]),t}();function Se(t){for(var e=[],r=0;r0;--i)e.push(n)}}return e}Ae.type="alphaStatic",Ae.editorConfig=null;var Te=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.anims=[];for(var r=0;r0?n.framerate:60,a={textures:i,duration:o>0?i.length/o:0,framerate:o,loop:o>0&&!!n.loop};this.anims.push(a)}}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;){var r=Math.floor(Math.random()*this.anims.length),n=e.config.anim=this.anims[r];e.texture=n.textures[0],e.config.animElapsed=0,-1===n.framerate?(e.config.animDuration=e.maxLife,e.config.animFramerate=n.textures.length/e.maxLife):(e.config.animDuration=n.duration,e.config.animFramerate=n.framerate),e=e.next}}},{key:"updateParticle",value:function(t,e){var r=t.config,n=r.anim;r.animElapsed+=e,r.animElapsed>=r.animDuration&&(r.anim.loop?r.animElapsed=r.animElapsed%r.animDuration:r.animElapsed=r.animDuration-1e-6);var i=r.animElapsed*r.animFramerate+1e-7|0;t.texture=n.textures[i]||n.textures[n.textures.length-1]||Vt.xE.EMPTY}}]),t}();Te.type="animatedRandom",Te.editorConfig=null;var ke=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal;var r=e.anim,n=Se(r.textures),i=r.framerate<0?-1:r.framerate>0?r.framerate:60;this.anim={textures:n,duration:i>0?n.length/i:0,framerate:i,loop:i>0&&!!r.loop}}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t,r=this.anim;e;)e.texture=r.textures[0],e.config.animElapsed=0,-1===r.framerate?(e.config.animDuration=e.maxLife,e.config.animFramerate=r.textures.length/e.maxLife):(e.config.animDuration=r.duration,e.config.animFramerate=r.framerate),e=e.next}},{key:"updateParticle",value:function(t,e){var r=this.anim,n=t.config;n.animElapsed+=e,n.animElapsed>=n.animDuration&&(r.loop?n.animElapsed=n.animElapsed%n.animDuration:n.animElapsed=n.animDuration-1e-6);var i=n.animElapsed*n.animFramerate+1e-7|0;t.texture=r.textures[i]||r.textures[r.textures.length-1]||Vt.xE.EMPTY}}]),t}();ke.type="animatedSingle",ke.editorConfig=null;var Re=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.value=e.blendMode}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)e.blendMode=ae(this.value),e=e.next}}]),t}();Re.type="blendMode",Re.editorConfig=null;var Me=function(){function t(e){(0,x.Z)(this,t),this.order=se.Spawn,this.spacing=e.spacing*$t,this.start=e.start*$t,this.distance=e.distance}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=0,r=t;r;){var n=void 0;n=this.spacing?this.start+this.spacing*e:Math.random()*Math.PI*2,r.rotation=n,this.distance&&(r.position.x=this.distance,Qt(n,r.position)),r=r.next,++e}}}]),t}();Me.type="spawnBurst",Me.editorConfig=null;var Ce=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.list=new xe(!0),this.list.reset(Kt.createList(e.color))}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t,r=this.list.first.value,n=te(r.r,r.g,r.b);e;)e.tint=n,e=e.next}},{key:"updateParticle",value:function(t){t.tint=this.list.interpolate(t.agePercent)}}]),t}();Ce.type="color",Ce.editorConfig=null;var Pe=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal;var r=e.color;"#"===r.charAt(0)?r=r.substr(1):0===r.indexOf("0x")&&(r=r.substr(2)),this.value=parseInt(r,16)}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)e.tint=this.value,e=e.next}}]),t}();Pe.type="colorStatic",Pe.editorConfig=null;var Ie=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.index=0,this.textures=e.textures.map((function(t){return"string"===typeof t?Jt(t):t}))}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}]),t}();Ie.type="textureOrdered",Ie.editorConfig=null;var Oe=new Xt.E9,Be=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],Ne=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(Be).join("|"),"g");var Le=function(){function t(e){var r;if((0,x.Z)(this,t),this.order=se.Late,e.path)if("function"===typeof e.path)this.path=e.path;else try{this.path=function(t){for(var e=t.match(Ne),r=e.length-1;r>=0;--r)Be.indexOf(e[r])>=0&&(e[r]="Math.".concat(e[r]));return t=e.join(""),new Function("x","return ".concat(t,";"))}(e.path)}catch(n){this.path=null}else this.path=function(t){return t};this.list=new xe(!1),this.list.reset(Kt.createList(e.speed)),this.minMult=null!==(r=e.minMult)&&void 0!==r?r:1}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new Xt.E9(e.x,e.y),e.config.movement=0;var r=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=r,e=e.next}}},{key:"updateParticle",value:function(t,e){var r=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=r*e,Oe.x=t.config.movement,Oe.y=this.path(Oe.x),Qt(t.config.initRotation,Oe),t.position.x=t.config.initPosition.x+Oe.x,t.position.y=t.config.initPosition.y+Oe.y}}]),t}();Le.type="movePath",Le.editorConfig=null;var De=function(){function t(){(0,x.Z)(this,t),this.order=se.Spawn}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){}}]),t}();De.type="spawnPoint",De.editorConfig=null;var Ue=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.textures=e.textures.map((function(t){return"string"===typeof t?Jt(t):t}))}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;){var r=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[r],e=e.next}}}]),t}();Ue.type="textureRandom",Ue.editorConfig=null;var Fe=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.minStart=e.minStart*$t,this.maxStart=e.maxStart*$t,this.minSpeed=e.minSpeed*$t,this.maxSpeed=e.maxSpeed*$t,this.accel=e.accel*$t}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}},{key:"updateParticle",value:function(t,e){if(this.accel){var r=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+r)/2*e}else t.rotation+=t.config.rotSpeed*e}}]),t}();Fe.type="rotation",Fe.editorConfig=null;var je=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.min=e.min*$t,this.max=e.max*$t}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}]),t}();je.type="rotationStatic",je.editorConfig=null;var Ze=function(){function t(e){(0,x.Z)(this,t),this.order=se.Late+1,this.rotation=(e.rotation||0)*$t}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)e.rotation=this.rotation,e=e.next}}]),t}();Ze.type="noRotation",Ze.editorConfig=null;var He=function(){function t(e){var r;(0,x.Z)(this,t),this.order=se.Normal,this.list=new xe(!1),this.list.reset(Kt.createList(e.scale)),this.minMult=null!==(r=e.minMult)&&void 0!==r?r:1}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;){var r=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=r,e.scale.x=e.scale.y=this.list.first.value*r,e=e.next}}},{key:"updateParticle",value:function(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}]),t}();He.type="scale",He.editorConfig=null;var Ge=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.min=e.min,this.max=e.max}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;){var r=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=r,e=e.next}}}]),t}();Ge.type="scaleStatic",Ge.editorConfig=null;var Ve=function(){function t(e){(0,x.Z)(this,t),this.order=se.Spawn;var r=t.shapes[e.type];if(!r)throw new Error("No shape found with type '".concat(e.type,"'"));this.shape=new r(e.data)}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)this.shape.getRandPos(e),e=e.next}}],[{key:"registerShape",value:function(e,r){t.shapes[r||e.type]=e}}]),t}();Ve.type="spawnShape",Ve.editorConfig=null,Ve.shapes={},Ve.registerShape(pe),Ve.registerShape(fe),Ve.registerShape(de),Ve.registerShape(de,"circle");var ze=function(){function t(e){(0,x.Z)(this,t),this.order=se.Normal,this.texture="string"===typeof e.texture?Jt(e.texture):e.texture}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;)e.texture=this.texture,e=e.next}}]),t}();ze.type="textureSingle",ze.editorConfig=null;var We=function(){function t(e){var r;(0,x.Z)(this,t),this.order=se.Late,this.list=new xe(!1),this.list.reset(Kt.createList(e.speed)),this.minMult=null!==(r=e.minMult)&&void 0!==r?r:1}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;){var r=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=r,e.config.velocity?e.config.velocity.set(this.list.first.value*r,0):e.config.velocity=new Xt.E9(this.list.first.value*r,0),Qt(e.rotation,e.config.velocity),e=e.next}}},{key:"updateParticle",value:function(t,e){var r=this.list.interpolate(t.agePercent)*t.config.speedMult,n=t.config.velocity;re(n),ne(n,r),t.x+=n.x*e,t.y+=n.y*e}}]),t}();We.type="moveSpeed",We.editorConfig=null;var Xe=function(){function t(e){(0,x.Z)(this,t),this.order=se.Late,this.min=e.min,this.max=e.max}return(0,Ut.Z)(t,[{key:"initParticles",value:function(t){for(var e=t;e;){var r=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(r,0):e.config.velocity=new Xt.E9(r,0),Qt(e.rotation,e.config.velocity),e=e.next}}},{key:"updateParticle",value:function(t,e){var r=t.config.velocity;t.x+=r.x*e,t.y+=r.y*e}}]),t}();Xe.type="moveSpeedStatic",Xe.editorConfig=null;Yt.W2;le.registerBehavior(ve),le.registerBehavior(Ee),le.registerBehavior(Ae),le.registerBehavior(Te),le.registerBehavior(ke),le.registerBehavior(Re),le.registerBehavior(Me),le.registerBehavior(Ce),le.registerBehavior(Pe),le.registerBehavior(Ie),le.registerBehavior(Le),le.registerBehavior(De),le.registerBehavior(Ue),le.registerBehavior(Fe),le.registerBehavior(je),le.registerBehavior(Ze),le.registerBehavior(He),le.registerBehavior(Ge),le.registerBehavior(Ve),le.registerBehavior(ze),le.registerBehavior(We),le.registerBehavior(Xe);var qe=r(1808),Ye=function(t){return function(t,e){var r,n,i,o,a,s,u,c,h,l,f,d,p,v,m,g,y,b,_,w,x;if("behaviors"in t)return t;var E,A,S={lifetime:t.lifetime,ease:t.ease,particlesPerWave:t.particlesPerWave,frequency:t.frequency,spawnChance:t.spawnChance,emitterLifetime:t.emitterLifetime,maxParticles:t.maxParticles,addAtBack:t.addAtBack,pos:t.pos,emit:t.emit,autoUpdate:t.autoUpdate,behaviors:[]};if(t.alpha)if("start"in t.alpha)if(t.alpha.start===t.alpha.end)1!==t.alpha.start&&S.behaviors.push({type:"alphaStatic",config:{alpha:t.alpha.start}});else{var T={list:[{time:0,value:t.alpha.start},{time:1,value:t.alpha.end}]};S.behaviors.push({type:"alpha",config:{alpha:T}})}else 1===t.alpha.list.length?1!==t.alpha.list[0].value&&S.behaviors.push({type:"alphaStatic",config:{alpha:t.alpha.list[0].value}}):S.behaviors.push({type:"alpha",config:{alpha:t.alpha}});if(t.acceleration&&(t.acceleration.x||t.acceleration.y))"start"in t.speed?(E=t.speed.start*(null!==(r=t.speed.minimumSpeedMultiplier)&&void 0!==r?r:1),A=t.speed.start):(E=t.speed.list[0].value*(null!==(n=t.minimumSpeedMultiplier)&&void 0!==n?n:1),A=t.speed.list[0].value),S.behaviors.push({type:"moveAcceleration",config:{accel:t.acceleration,minStart:E,maxStart:A,rotate:!t.noRotation,maxSpeed:t.maxSpeed}});else if(null===(i=t.extraData)||void 0===i?void 0:i.path){var k,R;"start"in t.speed?(R=null!==(o=t.speed.minimumSpeedMultiplier)&&void 0!==o?o:1,k=t.speed.start===t.speed.end?{list:[{time:0,value:t.speed.start}]}:{list:[{time:0,value:t.speed.start},{time:1,value:t.speed.end}]}):(k=t.speed,R=null!==(a=t.minimumSpeedMultiplier)&&void 0!==a?a:1),S.behaviors.push({type:"movePath",config:{path:t.extraData.path,speed:k,minMult:R}})}else if(t.speed)if("start"in t.speed)if(t.speed.start===t.speed.end)S.behaviors.push({type:"moveSpeedStatic",config:{min:t.speed.start*(null!==(s=t.speed.minimumSpeedMultiplier)&&void 0!==s?s:1),max:t.speed.start}});else{var M={list:[{time:0,value:t.speed.start},{time:1,value:t.speed.end}]};S.behaviors.push({type:"moveSpeed",config:{speed:M,minMult:t.speed.minimumSpeedMultiplier}})}else 1===t.speed.list.length?S.behaviors.push({type:"moveSpeedStatic",config:{min:t.speed.list[0].value*(null!==(u=t.minimumSpeedMultiplier)&&void 0!==u?u:1),max:t.speed.list[0].value}}):S.behaviors.push({type:"moveSpeed",config:{speed:t.speed,minMult:null!==(c=t.minimumSpeedMultiplier)&&void 0!==c?c:1}});if(t.scale)if("start"in t.scale){var C=null!==(h=t.scale.minimumScaleMultiplier)&&void 0!==h?h:1;if(t.scale.start===t.scale.end)S.behaviors.push({type:"scaleStatic",config:{min:t.scale.start*C,max:t.scale.start}});else{var P={list:[{time:0,value:t.scale.start},{time:1,value:t.scale.end}]};S.behaviors.push({type:"scale",config:{scale:P,minMult:C}})}}else if(1===t.scale.list.length){var I=null!==(l=t.minimumScaleMultiplier)&&void 0!==l?l:1,O=t.scale.list[0].value;S.behaviors.push({type:"scaleStatic",config:{min:O*I,max:O}})}else S.behaviors.push({type:"scale",config:{scale:t.scale,minMult:null!==(f=t.minimumScaleMultiplier)&&void 0!==f?f:1}});if(t.color)if("start"in t.color)if(t.color.start===t.color.end)"ffffff"!==t.color.start&&S.behaviors.push({type:"colorStatic",config:{color:t.color.start}});else{var B={list:[{time:0,value:t.color.start},{time:1,value:t.color.end}]};S.behaviors.push({type:"color",config:{color:B}})}else 1===t.color.list.length?"ffffff"!==t.color.list[0].value&&S.behaviors.push({type:"colorStatic",config:{color:t.color.list[0].value}}):S.behaviors.push({type:"color",config:{color:t.color}});if(t.rotationAcceleration||(null===(d=t.rotationSpeed)||void 0===d?void 0:d.min)||(null===(p=t.rotationSpeed)||void 0===p?void 0:p.max)?S.behaviors.push({type:"rotation",config:{accel:t.rotationAcceleration||0,minSpeed:(null===(v=t.rotationSpeed)||void 0===v?void 0:v.min)||0,maxSpeed:(null===(m=t.rotationSpeed)||void 0===m?void 0:m.max)||0,minStart:(null===(g=t.startRotation)||void 0===g?void 0:g.min)||0,maxStart:(null===(y=t.startRotation)||void 0===y?void 0:y.max)||0}}):((null===(b=t.startRotation)||void 0===b?void 0:b.min)||(null===(_=t.startRotation)||void 0===_?void 0:_.max))&&S.behaviors.push({type:"rotationStatic",config:{min:(null===(w=t.startRotation)||void 0===w?void 0:w.min)||0,max:(null===(x=t.startRotation)||void 0===x?void 0:x.max)||0}}),t.noRotation&&S.behaviors.push({type:"noRotation",config:{}}),t.blendMode&&"normal"!==t.blendMode&&S.behaviors.push({type:"blendMode",config:{blendMode:t.blendMode}}),Array.isArray(e)&&"string"!==typeof e[0]&&"framerate"in e[0]){for(var N=0;N0;if(void 0!==e||r)return s({},t,void 0!==e?e:{})}}]),t}();e.FeatureToggleProvider=v},7566:function(t,e){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.RequestMethod=void 0,function(t){t.GET="GET",t.POST="POST",t.PUT="PUT",t.PATCH="PATCH",t.DELETE="DELETE"}(r||(e.RequestMethod=r={}))},8260:function(t,e,r){"use strict";r.d(e,{I:function(){return U}});var n=r(1438),i=r(2951),o=r(2670),a=r(6042),s=r(828),u=r(2222),c={grad:.9,turn:360,rad:360/(2*Math.PI)},h=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},l=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},f=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},d=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},p=function(t){return{r:f(t.r,0,255),g:f(t.g,0,255),b:f(t.b,0,255),a:f(t.a)}},v=function(t){return{r:l(t.r),g:l(t.g),b:l(t.b),a:l(t.a,3)}},m=/^#([0-9a-f]{3,8})$/i,g=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},y=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,o=Math.max(e,r,n),a=o-Math.min(e,r,n),s=a?o===e?(r-n)/a:o===r?2+(n-e)/a:4+(e-r)/a:0;return{h:60*(s<0?s+6:s),s:o?a/o*100:0,v:o/255*100,a:i}},b=function(t){var e=t.h,r=t.s,n=t.v,i=t.a;e=e/360*6,r/=100,n/=100;var o=Math.floor(e),a=n*(1-r),s=n*(1-(e-o)*r),u=n*(1-(1-e+o)*r),c=o%6;return{r:255*[n,s,a,a,u,n][c],g:255*[u,n,n,s,a,a][c],b:255*[a,a,u,n,n,s][c],a:i}},_=function(t){return{h:d(t.h),s:f(t.s,0,100),l:f(t.l,0,100),a:f(t.a)}},w=function(t){return{h:l(t.h),s:l(t.s),l:l(t.l),a:l(t.a,3)}},x=function(t){return b((r=(e=t).s,{h:e.h,s:(r*=((n=e.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:e.a}));var e,r,n},E=function(t){return{h:(e=y(t)).h,s:(i=(200-(r=e.s))*(n=e.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,r,n,i},A=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,S=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,T=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,k=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,R={string:[[function(t){var e=m.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?l(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?l(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=T.exec(t)||k.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:p({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=A.exec(t)||S.exec(t);if(!e)return null;var r,n,i=_({h:(r=e[1],n=e[2],void 0===n&&(n="deg"),Number(r)*(c[n]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return x(i)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,n=t.b,i=t.a,o=void 0===i?1:i;return h(e)&&h(r)&&h(n)?p({r:Number(e),g:Number(r),b:Number(n),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,r=t.s,n=t.l,i=t.a,o=void 0===i?1:i;if(!h(e)||!h(r)||!h(n))return null;var a=_({h:Number(e),s:Number(r),l:Number(n),a:Number(o)});return x(a)},"hsl"],[function(t){var e=t.h,r=t.s,n=t.v,i=t.a,o=void 0===i?1:i;if(!h(e)||!h(r)||!h(n))return null;var a=function(t){return{h:d(t.h),s:f(t.s,0,100),v:f(t.v,0,100),a:f(t.a)}}({h:Number(e),s:Number(r),v:Number(n),a:Number(o)});return b(a)},"hsv"]]},M=function(t,e){for(var r=0;r=.5},t.prototype.toHex=function(){return e=(t=v(this.rgba)).r,r=t.g,n=t.b,o=(i=t.a)<1?g(l(255*i)):"","#"+g(e)+g(r)+g(n)+o;var t,e,r,n,i,o},t.prototype.toRgb=function(){return v(this.rgba)},t.prototype.toRgbString=function(){return e=(t=v(this.rgba)).r,r=t.g,n=t.b,(i=t.a)<1?"rgba("+e+", "+r+", "+n+", "+i+")":"rgb("+e+", "+r+", "+n+")";var t,e,r,n,i},t.prototype.toHsl=function(){return w(E(this.rgba))},t.prototype.toHslString=function(){return e=(t=w(E(this.rgba))).h,r=t.s,n=t.l,(i=t.a)<1?"hsla("+e+", "+r+"%, "+n+"%, "+i+")":"hsl("+e+", "+r+"%, "+n+"%)";var t,e,r,n,i},t.prototype.toHsv=function(){return t=y(this.rgba),{h:l(t.h),s:l(t.s),v:l(t.v),a:l(t.a,3)};var t},t.prototype.invert=function(){return N({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),N(P(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),N(P(this.rgba,-t))},t.prototype.grayscale=function(){return N(P(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),N(O(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),N(O(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?N({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):l(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=E(this.rgba);return"number"==typeof t?N({h:t,s:e.s,l:e.l,a:e.a}):l(e.h)},t.prototype.isEqual=function(t){return this.toHex()===N(t).toHex()},t}(),N=function(t){return(0,o.Z)(t,B)?t:new B(t)},L=[];!function(t){t.forEach((function(t){L.indexOf(t)<0&&(t(B,R),L.push(t))}))}([function(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var i in r)n[r[i]]=i;var o={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,a,s=n[this.toHex()];if(s)return s;if(null==e?void 0:e.closest){var u=this.toRgb(),c=1/0,h="black";if(!o.length)for(var l in r)o[l]=new t(r[l]).toRgb();for(var f in r){var d=(i=u,a=o[f],Math.pow(i.r-a.r,2)+Math.pow(i.g-a.g,2)+Math.pow(i.b-a.b,2));d0&&void 0!==arguments[0]?arguments[0]:16777215;(0,n.Z)(this,t),this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}return(0,i.Z)(t,[{key:"red",get:function(){return this._components[0]}},{key:"green",get:function(){return this._components[1]}},{key:"blue",get:function(){return this._components[2]}},{key:"alpha",get:function(){return this._components[3]}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(e){if((0,o.Z)(e,t))this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set PIXI.Color#value to null");(null===this._value||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}},{key:"cloneSource",value:function(t){return"string"==typeof t||"number"==typeof t||(0,o.Z)(t,Number)||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?(0,a.Z)({},t):t}},{key:"isSourceEqual",value:function(t,e){var r="undefined"===typeof t?"undefined":(0,u.Z)(t);if(r!==("undefined"===typeof e?"undefined":(0,u.Z)(e)))return!1;if("number"===r||"string"===r||(0,o.Z)(t,Number))return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every((function(t,r){return t===e[r]}));if(null!==t&&null!==e){var n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every((function(r){return t[r]===e[r]}))}return t===e}},{key:"toRgba",value:function(){var t=(0,s.Z)(this._components,4);return{r:t[0],g:t[1],b:t[2],a:t[3]}}},{key:"toRgb",value:function(){var t=(0,s.Z)(this._components,3);return{r:t[0],g:t[1],b:t[2]}}},{key:"toRgbaString",value:function(){var t=(0,s.Z)(this.toUint8RgbArray(),3),e=t[0],r=t[1],n=t[2];return"rgba(".concat(e,",").concat(r,",").concat(n,",").concat(this.alpha,")")}},{key:"toUint8RgbArray",value:function(t){var e=(0,s.Z)(this._components,3),r=e[0],n=e[1],i=e[2];return(t=null!==t&&void 0!==t?t:[])[0]=Math.round(255*r),t[1]=Math.round(255*n),t[2]=Math.round(255*i),t}},{key:"toRgbArray",value:function(t){t=null!==t&&void 0!==t?t:[];var e=(0,s.Z)(this._components,3),r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t}},{key:"toNumber",value:function(){return this._int}},{key:"toLittleEndianNumber",value:function(){var t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}},{key:"multiply",value:function(e){var r=(0,s.Z)(t.temp.setValue(e)._components,4),n=r[0],i=r[1],o=r[2],a=r[3];return this._components[0]*=n,this._components[1]*=i,this._components[2]*=o,this._components[3]*=a,this.refreshInt(),this._value=null,this}},{key:"premultiply",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}},{key:"toPremultiplied",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;var r=this._int>>16&255,n=this._int>>8&255,i=255&this._int;return e&&(r=r*t+.5|0,n=n*t+.5|0,i=i*t+.5|0),(255*t<<24)+(r<<16)+(n<<8)+i}},{key:"toHex",value:function(){var t=this._int.toString(16);return"#".concat("000000".substring(0,6-t.length)+t)}},{key:"toHexa",value:function(){var t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}},{key:"setAlpha",value:function(t){return this._components[3]=this._clamp(t),this}},{key:"round",value:function(t){var e=(0,s.Z)(this._components,3),r=e[0],n=e[1],i=e[2];return this._components[0]=Math.round(r*t)/t,this._components[1]=Math.round(n*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}},{key:"toArray",value:function(t){t=null!==t&&void 0!==t?t:[];var e=(0,s.Z)(this._components,4),r=e[0],n=e[1],i=e[2],o=e[3];return t[0]=r,t[1]=n,t[2]=i,t[3]=o,t}},{key:"normalize",value:function(e){var r,n,i,a,u,c,h,l;if(("number"==typeof e||(0,o.Z)(e,Number))&&e>=0&&e<=16777215){r=(e>>16&255)/255,n=(e>>8&255)/255,i=(255&e)/255,a=1}else if((Array.isArray(e)||(0,o.Z)(e,Float32Array))&&e.length>=3&&e.length<=4)e=this._clamp(e),r=(u=(0,s.Z)(e,4))[0],n=u[1],i=u[2],a=void 0===(c=u[3])?1:c;else if(((0,o.Z)(e,Uint8Array)||(0,o.Z)(e,Uint8ClampedArray))&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),r=(h=(0,s.Z)(e,4))[0],n=h[1],i=h[2],a=void 0===(l=h[3])?255:l,r/=255,n/=255,i/=255,a/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){var f=t.HEX_PATTERN.exec(e);f&&(e="#".concat(f[2]))}var d,p=N(e);p.isValid()&&(r=(d=p.rgba).r,n=d.g,i=d.b,a=d.a,r/=255,n/=255,i/=255)}if(void 0===r)throw new Error("Unable to convert color ".concat(e));this._components[0]=r,this._components[1]=n,this._components[2]=i,this._components[3]=a,this.refreshInt()}},{key:"refreshInt",value:function(){this._clamp(this._components);var t=(0,s.Z)(this._components,3),e=t[0],r=t[1],n=t[2];this._int=(255*e<<16)+(255*r<<8)+(255*n|0)}},{key:"_clamp",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach((function(n,i){t[i]=Math.min(Math.max(n,e),r)})),t)}}]),t}();D.shared=new D,D.temp=new D,D.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;var U=D},3253:function(){},1296:function(t,e,r){"use strict";r.d(e,{A7:function(){return b},G5:function(){return _},I2:function(){return u},N3:function(){return i},Nt:function(){return d},T$:function(){return a},UN:function(){return g},V0:function(){return o},Vi:function(){return n},WB:function(){return p},aH:function(){return f},cB:function(){return y},iw:function(){return v},lg:function(){return s},mr:function(){return w},oT:function(){return l},sp:function(){return c},vK:function(){return h},yl:function(){return m}});var n=function(t){return t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t}(n||{}),i=function(t){return t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t}(i||{}),o=function(t){return t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t}(o||{}),a=function(t){return t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t}(a||{}),s=function(t){return t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t}(s||{}),u=function(t){return t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t}(u||{}),c=function(t){return t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t}(c||{}),h=function(t){return t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t}(h||{}),l=function(t){return t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t}(l||{}),f=function(t){return t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t}(f||{}),d=function(t){return t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t}(d||{}),p=function(t){return t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t}(p||{}),v=function(t){return t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t}(v||{}),m=function(t){return t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t}(m||{}),g=function(t){return t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t}(g||{}),y=function(t){return t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t}(y||{}),b=function(t){return t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t}(b||{}),_=function(t){return t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t}(_||{}),w=function(t){return t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t}(w||{})},5807:function(t,e,r){"use strict";r.d(e,{iw:function(){return i.iw},T$:function(){return i.T$},VL:function(){return M},a$:function(){return C},JZ:function(){return F},Ie:function(){return ut},lW:function(){return I},qm:function(){return T},yl:function(){return i.yl},Cd:function(){return j.Cd},Il:function(){return v.I},ZX:function(){return j.ZX},lg:function(){return i.lg},Pj:function(){return j.Pj},nw:function(){return m.n},I2:function(){return i.I2},wn:function(){return dt},wG:function(){return U},A7:function(){return i.A7},KI:function(){return i.WB},y3:function(){return j.y3},bO:function(){return ct},AB:function(){return j.AB},_b:function(){return j._b},E9:function(){return j.E9},mg:function(){return j.mg},$r:function(){return nt},ud:function(){return Ct},jl:function(){return j.jl},Ae:function(){return j.Ae},TI:function(){return kt},c9:function(){return j.c9},HS:function(){return j.HS},pX:function(){return Qe},ex:function(){return at},ZM:function(){return w},vK:function(){return i.vK},xE:function(){return Tt},UX:function(){return Zt},vB:function(){return Ie.vB},wx:function(){return j.wx},uF:function(){return Ie.uF},oo:function(){return ot},eH:function(){return er},Rv:function(){return y},Nt:function(){return i.Nt},e6:function(){return Be},Y9:function(){return Le},kP:function(){return Ne},Rw:function(){return m.R},Xd:function(){return o.Xd},P6:function(){return a}});var n=r(6042),i=r(1296),o=r(5110),a=r(2489),s=r(4111),u=r(1438),c=r(2951),h=r(5785),l=r(2662),f=r(8029),d=r(1357),p=r(1418),v=r(8260),m=r(7955),g=r(2670),y=function(){function t(e){(0,u.Z)(this,t),"number"==typeof e?this.rawBinaryData=new ArrayBuffer(e):(0,g.Z)(e,Uint8Array)?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return(0,c.Z)(t,[{key:"int8View",get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}},{key:"uint8View",get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}},{key:"int16View",get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}},{key:"uint16View",get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}},{key:"int32View",get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}},{key:"view",value:function(t){return this["".concat(t,"View")]}},{key:"destroy",value:function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}}],[{key:"sizeOf",value:function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error("".concat(t," isn't a valid view type"))}}}]),t}(),b=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function _(t){for(var e="",r=0;r0&&(e+="\nelse "),r=0;--i){var o=x[i];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var A=function(){function t(e){(0,u.Z)(this,t),this.items=[],this._name=e,this._aliasCount=0}return(0,c.Z)(t,[{key:"emit",value:function(t,e,r,n,i,o,a,s){if(arguments.length>8)throw new Error("max arguments reached");var u=this,c=u.name,h=u.items;this._aliasCount++;for(var l=0,f=h.length;l0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}},{key:"add",value:function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}},{key:"remove",value:function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}},{key:"contains",value:function(t){return this.items.includes(t)}},{key:"removeAll",value:function(){return this.ensureNonAliasedItems(),this.items.length=0,this}},{key:"destroy",value:function(){this.removeAll(),this.items=null,this._name=null}},{key:"empty",get:function(){return 0===this.items.length}},{key:"name",get:function(){return this._name}}]),t}();Object.defineProperties(A.prototype,{dispatch:{value:A.prototype.emit},run:{value:A.prototype.emit}});var S=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,u.Z)(this,t),this._width=e,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new A("setRealSize"),this.onUpdate=new A("update"),this.onError=new A("onError")}return(0,c.Z)(t,[{key:"bind",value:function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}},{key:"unbind",value:function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}},{key:"resize",value:function(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}},{key:"valid",get:function(){return!!this._width&&!!this._height}},{key:"update",value:function(){this.destroyed||this.onUpdate.emit()}},{key:"load",value:function(){return Promise.resolve(this)}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"style",value:function(t,e,r){return!1}},{key:"dispose",value:function(){}},{key:"destroy",value:function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}}],[{key:"test",value:function(t,e){return!1}}]),t}(),T=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(t,n){var i;(0,u.Z)(this,r);var o,a=n||{},s=a.width,c=a.height;if(!s||!c)throw new Error("BufferResource width or height invalid");return(i=e.call(this,s,c)).data=t,i.unpackAlignment=null!==(o=n.unpackAlignment)&&void 0!==o?o:4,(0,d.Z)(i)}return(0,c.Z)(r,[{key:"upload",value:function(t,e,r){var n=t.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,this.unpackAlignment),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===i.iw.UNPACK);var o=e.realWidth,a=e.realHeight;return r.width===o&&r.height===a?n.texSubImage2D(e.target,0,0,0,o,a,e.format,r.type,this.data):(r.width=o,r.height=a,n.texImage2D(e.target,0,r.internalFormat,o,a,0,e.format,r.type,this.data)),!0}},{key:"dispose",value:function(){this.data=null}}],[{key:"test",value:function(t){return null===t||(0,g.Z)(t,Int8Array)||(0,g.Z)(t,Uint8Array)||(0,g.Z)(t,Uint8ClampedArray)||(0,g.Z)(t,Int16Array)||(0,g.Z)(t,Uint16Array)||(0,g.Z)(t,Int32Array)||(0,g.Z)(t,Uint32Array)||(0,g.Z)(t,Float32Array)}}]),r}(S),k={scaleMode:i.aH.NEAREST,alphaMode:i.iw.NPM},R=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(0,u.Z)(this,r),t=e.call(this);var s=(i=Object.assign({},r.defaultOptions,i)).alphaMode,c=i.mipmap,h=i.anisotropicLevel,l=i.scaleMode,f=i.width,p=i.height,v=i.wrapMode,m=i.format,y=i.type,b=i.target,_=i.resolution,w=i.resourceOptions;return n&&!(0,g.Z)(n,S)&&((n=E(n,w)).internal=!0),t.resolution=_||o.Xd.RESOLUTION,t.width=Math.round((f||0)*t.resolution)/t.resolution,t.height=Math.round((p||0)*t.resolution)/t.resolution,t._mipmap=c,t.anisotropicLevel=h,t._wrapMode=v,t._scaleMode=l,t.format=m,t.type=y,t.target=b,t.alphaMode=s,t.uid=(0,a.uid)(),t.touched=0,t.isPowerOfTwo=!1,t._refreshPOT(),t._glTextures={},t.dirtyId=0,t.dirtyStyleId=0,t.cacheId=null,t.valid=f>0&&p>0,t.textureCacheIds=[],t.destroyed=!1,t.resource=null,t._batchEnabled=0,t._batchLocation=0,t.parentTextureArray=null,t.setResource(n),(0,d.Z)(t)}return(0,c.Z)(r,[{key:"realWidth",get:function(){return Math.round(this.width*this.resolution)}},{key:"realHeight",get:function(){return Math.round(this.height*this.resolution)}},{key:"mipmap",get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}},{key:"scaleMode",get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}},{key:"wrapMode",get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}},{key:"setStyle",value:function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this}},{key:"setSize",value:function(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}},{key:"setRealSize",value:function(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}},{key:"_refreshPOT",value:function(){this.isPowerOfTwo=(0,a.isPow2)(this.realWidth)&&(0,a.isPow2)(this.realHeight)}},{key:"setResolution",value:function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this}},{key:"setResource",value:function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}},{key:"update",value:function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}},{key:"onError",value:function(t){this.emit("error",this,t)}},{key:"destroy",value:function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete a.BaseTextureCache[this.cacheId],delete a.TextureCache[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),r.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}},{key:"dispose",value:function(){this.emit("dispose",this)}},{key:"castToBaseTexture",value:function(){return this}}],[{key:"from",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.Xd.STRICT_TEXTURE_CACHE,i="string"==typeof t,s=null;if(i)s=t;else{if(!t._pixiId){var u=(null===e||void 0===e?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId="".concat(u,"_").concat((0,a.uid)())}s=t._pixiId}var c=a.BaseTextureCache[s];if(i&&n&&!c)throw new Error('The cacheId "'.concat(s,'" does not exist in BaseTextureCache.'));return c||((c=new r(t,e)).cacheId=s,r.addToCache(c,s)),c}},{key:"fromBuffer",value:function(t,e,o,a){t=t||new Float32Array(e*o*4);var s,u,c=new T(t,(0,n.Z)({width:e,height:o},null===a||void 0===a?void 0:a.resourceOptions));return(0,g.Z)(t,Float32Array)?(s=i.I2.RGBA,u=i.vK.FLOAT):(0,g.Z)(t,Int32Array)?(s=i.I2.RGBA_INTEGER,u=i.vK.INT):(0,g.Z)(t,Uint32Array)?(s=i.I2.RGBA_INTEGER,u=i.vK.UNSIGNED_INT):(0,g.Z)(t,Int16Array)?(s=i.I2.RGBA_INTEGER,u=i.vK.SHORT):(0,g.Z)(t,Uint16Array)?(s=i.I2.RGBA_INTEGER,u=i.vK.UNSIGNED_SHORT):(0,g.Z)(t,Int8Array)?(s=i.I2.RGBA,u=i.vK.BYTE):(s=i.I2.RGBA,u=i.vK.UNSIGNED_BYTE),c.internal=!0,new r(c,Object.assign({},k,{type:u,format:s},a))}},{key:"addToCache",value:function(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),a.BaseTextureCache[e]&&a.BaseTextureCache[e]!==t&&console.warn("BaseTexture added to the cache with an id [".concat(e,"] that already had an entry")),a.BaseTextureCache[e]=t)}},{key:"removeFromCache",value:function(t){if("string"==typeof t){var e=a.BaseTextureCache[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete a.BaseTextureCache[t],e}}else if(null===t||void 0===t?void 0:t.textureCacheIds){for(var n=0;n1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,u.Z)(this,t),this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=r,this.id=P++,this.disposeRunner=new A("disposeBuffer")}return(0,c.Z)(t,[{key:"update",value:function(t){(0,g.Z)(t,Array)&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}},{key:"dispose",value:function(){this.disposeRunner.emit(this,!1)}},{key:"destroy",value:function(){this.dispose(),this.data=null}},{key:"index",get:function(){return this.type===i.mr.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?i.mr.ELEMENT_ARRAY_BUFFER:i.mr.ARRAY_BUFFER}}],[{key:"from",value:function(e){return(0,g.Z)(e,Array)&&(e=new Float32Array(e)),new t(e)}}]),t}(),O=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.vK.FLOAT,a=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,h=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1;(0,u.Z)(this,t),this.buffer=e,this.size=r,this.normalized=n,this.type=o,this.stride=a,this.start=s,this.instance=c,this.divisor=h}return(0,c.Z)(t,[{key:"destroy",value:function(){this.buffer=null}}],[{key:"from",value:function(e,r,n,i,o){return new t(e,r,n,i,o)}}]),t}(),B={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var N={5126:4,5123:2,5121:1},L=0,D={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},U=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,u.Z)(this,t),this.buffers=e,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=L++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new A("disposeGeometry"),this.refCount=0}return(0,c.Z)(t,[{key:"addAttribute",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];if(!e)throw new Error("You must pass a buffer when creating an attribute");(0,g.Z)(e,I)||((0,g.Z)(e,Array)&&(e=new Float32Array(e)),e=new I(e));var u=t.split("|");if(u.length>1){for(var c=0;c0&&void 0!==arguments[0]&&arguments[0];return(0,u.Z)(this,r),(t=e.call(this))._buffer=new I(null,n,!1),t._indexBuffer=new I(null,n,!0),t.addAttribute("aVertexPosition",t._buffer,2,!1,i.vK.FLOAT).addAttribute("aTextureCoord",t._buffer,2,!1,i.vK.FLOAT).addAttribute("aColor",t._buffer,4,!0,i.vK.UNSIGNED_BYTE).addAttribute("aTextureId",t._buffer,1,!0,i.vK.FLOAT).addIndex(t._indexBuffer),(0,d.Z)(t)}return r}(U),j=r(1330),Z=[{test:function(t){return"float"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n if(uv["'.concat(t,'"] !== ud["').concat(t,'"].value)\n {\n ud["').concat(t,'"].value = uv["').concat(t,'"]\n gl.uniform1f(ud["').concat(t,'"].location, uv["').concat(t,'"])\n }\n ')}},{test:function(t,e){return("sampler2D"===t.type||"samplerCube"===t.type||"sampler2DArray"===t.type)&&1===t.size&&!t.isArray&&(null==e||void 0!==e.castToBaseTexture)},code:function(t){return't = syncData.textureCount++;\n\n renderer.texture.bind(uv["'.concat(t,'"], t);\n\n if(ud["').concat(t,'"].value !== t)\n {\n ud["').concat(t,'"].value = t;\n gl.uniform1i(ud["').concat(t,'"].location, t);\n; // eslint-disable-line max-len\n }')}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a},code:function(t){return'\n gl.uniformMatrix3fv(ud["'.concat(t,'"].location, false, uv["').concat(t,'"].toArray(true));\n ')},codeUbo:function(t){return"\n var ".concat(t,"_matrix = uv.").concat(t,".toArray(true);\n\n data[offset] = ").concat(t,"_matrix[0];\n data[offset+1] = ").concat(t,"_matrix[1];\n data[offset+2] = ").concat(t,"_matrix[2];\n \n data[offset + 4] = ").concat(t,"_matrix[3];\n data[offset + 5] = ").concat(t,"_matrix[4];\n data[offset + 6] = ").concat(t,"_matrix[5];\n \n data[offset + 8] = ").concat(t,"_matrix[6];\n data[offset + 9] = ").concat(t,"_matrix[7];\n data[offset + 10] = ").concat(t,"_matrix[8];\n ")}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x},code:function(t){return'\n cv = ud["'.concat(t,'"].value;\n v = uv["').concat(t,'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["').concat(t,'"].location, v.x, v.y);\n }')},codeUbo:function(t){return"\n v = uv.".concat(t,";\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n ")}},{test:function(t){return"vec2"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n cv = ud["'.concat(t,'"].value;\n v = uv["').concat(t,'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["').concat(t,'"].location, v[0], v[1]);\n }\n ')}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width},code:function(t){return'\n cv = ud["'.concat(t,'"].value;\n v = uv["').concat(t,'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["').concat(t,'"].location, v.x, v.y, v.width, v.height)\n }')},codeUbo:function(t){return"\n v = uv.".concat(t,";\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n ")}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red},code:function(t){return'\n cv = ud["'.concat(t,'"].value;\n v = uv["').concat(t,'"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud["').concat(t,'"].location, v.red, v.green, v.blue, v.alpha)\n }')},codeUbo:function(t){return"\n v = uv.".concat(t,";\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n data[offset+3] = v.alpha;\n ")}},{test:function(t,e){return"vec3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red},code:function(t){return'\n cv = ud["'.concat(t,'"].value;\n v = uv["').concat(t,'"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n \n gl.uniform3f(ud["').concat(t,'"].location, v.red, v.green, v.blue)\n }')},codeUbo:function(t){return"\n v = uv.".concat(t,";\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n ")}},{test:function(t){return"vec4"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n cv = ud["'.concat(t,'"].value;\n v = uv["').concat(t,'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["').concat(t,'"].location, v[0], v[1], v[2], v[3])\n }')}}],H={float:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }",vec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }",vec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",vec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",int:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",ivec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",ivec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",ivec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",uint:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }",uvec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }",uvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }",uvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }",bvec2:"\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",bvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",bvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",samplerCube:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",sampler2DArray:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }"},G={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var V,z={},W=z;function X(){if(!V){V=i.cB.MEDIUM;var t=function(){if(W===z||(null===W||void 0===W?void 0:W.isContextLost())){var t,e=o.Xd.ADAPTER.createCanvas();o.Xd.PREFER_ENV>=i.Vi.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),W=t}return W}();t&&t.getShaderPrecisionFormat&&(V=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?i.cB.HIGH:i.cB.MEDIUM)}return V}var q={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Y(t){return q[t]}var K=null,J={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function $(t,e){if(!K){var r=Object.keys(J);K={};for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"pixi-shader",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(0,u.Z)(this,t),this.extra={},this.id=tt++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=o,"#version"!==this.vertexSrc.substring(0,8)&&(n=n.replace(/\s+/g,"-"),et[n]?(et[n]++,n+="-".concat(et[n])):et[n]=1,this.vertexSrc="#define SHADER_NAME ".concat(n,"\n").concat(this.vertexSrc),this.fragmentSrc="#define SHADER_NAME ".concat(n,"\n").concat(this.fragmentSrc),this.vertexSrc=Q(this.vertexSrc,t.defaultVertexPrecision,i.cB.HIGH),this.fragmentSrc=Q(this.fragmentSrc,t.defaultFragmentPrecision,X())),this.glPrograms={},this.syncUniforms=null}return(0,c.Z)(t,null,[{key:"defaultVertexSrc",get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"}},{key:"defaultFragmentSrc",get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"}},{key:"from",value:function(e,r,n){var i=e+r,o=a.ProgramCache[i];return o||(a.ProgramCache[i]=o=new t(e,r,n)),o}}]),t}();rt.defaultVertexPrecision=i.cB.HIGH,rt.defaultFragmentPrecision=a.isMobile.apple.device?i.cB.HIGH:i.cB.MEDIUM;var nt=rt,it=0,ot=function(){function t(e,r,n){(0,u.Z)(this,t),this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=it++,this.static=!!r,this.ubo=!!n,(0,g.Z)(e,I)?(this.buffer=e,this.buffer.type=i.mr.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new I(new Float32Array(1)),this.buffer.type=i.mr.UNIFORM_BUFFER,this.autoManage=!0))}return(0,c.Z)(t,[{key:"update",value:function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}},{key:"add",value:function(e,r,n){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new t(r,n)}}],[{key:"from",value:function(e,r,n){return new t(e,r,n)}},{key:"uboFrom",value:function(e,r){return new t(e,null===r||void 0===r||r,!0)}}]),t}(),at=function(){function t(e,r){(0,u.Z)(this,t),this.uniformBindCount=0,this.program=e,r?(0,g.Z)(r,ot)?this.uniformGroup=r:this.uniformGroup=new ot(r):this.uniformGroup=new ot({}),this.disposeRunner=new A("disposeShader")}return(0,c.Z)(t,[{key:"checkUniformExists",value:function(t,e){if(e.uniforms[t])return!0;for(var r in e.uniforms){var n=e.uniforms[r];if(!0===n.group&&this.checkUniformExists(t,n))return!0}return!1}},{key:"destroy",value:function(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}},{key:"uniforms",get:function(){return this.uniformGroup.uniforms}}],[{key:"from",value:function(e,r,n){return new t(nt.from(e,r),n)}}]),t}(),st=function(){function t(e,r){if((0,u.Z)(this,t),this.vertexSrc=e,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}return(0,c.Z)(t,[{key:"generateShader",value:function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),r=0;r0&&(e+="\nelse "),r0&&void 0!==arguments[0]?arguments[0]:{},e=t.vertex,n=void 0===e?r.defaultVertexSrc:e,i=t.fragment,o=void 0===i?r.defaultFragmentTemplate:i;this.shaderGenerator=new st(n,o)}},{key:"contextChange",value:function(){var t=this.renderer.gl;o.Xd.PREFER_ENV===i.Vi.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),r.defaultMaxTextures),this.maxTextures=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var r=e.createShader(e.FRAGMENT_SHADER);;){var n=b.replace(/%forloop%/gi,_(t));if(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.maxTextures,t)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(var e=0;ethis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}},{key:"buildTexturesAndDrawCalls",value:function(){var t=this._bufferedTextures,e=this.maxTextures,n=r._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++M._globalBatch,u=0,c=n[0],h=0;i.copyBoundTextures(o,e);for(var l=0;l=e&&(i.boundArray(c,o,s,e),this.buildDrawCalls(c,h,l),h=l,c=n[++u],++s),f._batchEnabled=s,f.touched=a,c.elements[c.count++]=f)}c.count>0&&(i.boundArray(c,o,s,e),this.buildDrawCalls(c,h,this._bufferSize),++u,++s);for(var d=0;d0),p=0;p=0;--n)t[n]=r[n]||null,t[n]&&(t[n]._batchLocation=n)}},{key:"boundArray",value:function(t,e,r,n){for(var i=t.elements,o=t.ids,a=t.count,s=0,u=0;u=0&&h=i.Vi.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl}},{key:"getExtensions",value:function(){var t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}},{key:"handleContextLost",value:function(t){var e=this;t.preventDefault(),setTimeout((function(){e.gl.isContextLost()&&e.extensions.loseContext&&e.extensions.loseContext.restoreContext()}),0)}},{key:"handleContextRestored",value:function(){this.renderer.runners.contextChange.emit(this.gl)}},{key:"destroy",value:function(){var t=this.renderer.view;this.renderer=null,void 0!==t.removeEventListener&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}},{key:"postrender",value:function(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}},{key:"validateContext",value:function(t){var e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&(0,g.Z)(t,globalThis.WebGL2RenderingContext);r&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}]),t}();gt.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},gt.extension={type:m.n.RendererSystem,name:"context"},m.R.add(gt);var yt=function(){function t(e,r){if((0,u.Z)(this,t),this.width=Math.round(e),this.height=Math.round(r),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new A("disposeFramebuffer"),this.multisample=i.G5.NONE}return(0,c.Z)(t,[{key:"colorTexture",get:function(){return this.colorTextures[0]}},{key:"addColorTexture",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.colorTextures[t]=e||new M(null,{scaleMode:i.aH.NEAREST,resolution:1,mipmap:i.WB.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}},{key:"addDepthTexture",value:function(t){return this.depthTexture=t||new M(null,{scaleMode:i.aH.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.WB.OFF,format:i.I2.DEPTH_COMPONENT,type:i.vK.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}},{key:"enableDepth",value:function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}},{key:"enableStencil",value:function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}},{key:"resize",value:function(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if((0,u.Z)(this,r),"number"==typeof c){var h=arguments[0],l=arguments[1],f=arguments[2],p=arguments[3];c={width:h,height:l,scaleMode:f,resolution:p}}return c.width=null!==(n=c.width)&&void 0!==n?n:100,c.height=null!==(o=c.height)&&void 0!==o?o:100,null!==(a=c.multisample)&&void 0!==a||(c.multisample=i.G5.NONE),(t=e.call(this,null,c)).mipmap=i.WB.OFF,t.valid=!0,t._clear=new v.I([0,0,0,0]),t.framebuffer=new yt(t.realWidth,t.realHeight).addColorTexture(0,(0,s.Z)(t)),t.framebuffer.multisample=c.multisample,t.maskStack=[],t.filterStack=[{}],(0,d.Z)(t)}return(0,c.Z)(r,[{key:"clearColor",get:function(){return this._clear.value},set:function(t){this._clear.setValue(t)}},{key:"clear",get:function(){return this._clear}},{key:"multisample",get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t}},{key:"resize",value:function(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}},{key:"dispose",value:function(){this.framebuffer.dispose(),(0,h.Z)((0,l.Z)(r.prototype),"dispose",this).call(this)}},{key:"destroy",value:function(){(0,h.Z)((0,l.Z)(r.prototype),"destroy",this).call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}]),r}(M),_t=r(2222),wt=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(t){var n;(0,u.Z)(this,r);var i=t,o=i.naturalWidth||i.videoWidth||i.width,a=i.naturalHeight||i.videoHeight||i.height;return(n=e.call(this,o,a)).source=t,n.noSubImage=!1,(0,d.Z)(n)}return(0,c.Z)(r,[{key:"upload",value:function(t,e,r,n){var o=t.gl,a=e.realWidth,s=e.realHeight;if(n=n||this.source,("undefined"===typeof HTMLImageElement?"undefined":(0,_t.Z)(HTMLImageElement))<"u"&&(0,g.Z)(n,HTMLImageElement)){if(!n.complete||0===n.naturalWidth)return!1}else if(("undefined"===typeof HTMLVideoElement?"undefined":(0,_t.Z)(HTMLVideoElement))<"u"&&(0,g.Z)(n,HTMLVideoElement)&&n.readyState<=1)return!1;return o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===i.iw.UNPACK),this.noSubImage||e.target!==o.TEXTURE_2D||r.width!==a||r.height!==s?(r.width=a,r.height=s,o.texImage2D(e.target,0,r.internalFormat,e.format,r.type,n)):o.texSubImage2D(o.TEXTURE_2D,0,0,0,e.format,r.type,n),!0}},{key:"update",value:function(){if(!this.destroyed){var t=this.source,e=t.naturalWidth||t.videoWidth||t.width,n=t.naturalHeight||t.videoHeight||t.height;this.resize(e,n),(0,h.Z)((0,l.Z)(r.prototype),"update",this).call(this)}}},{key:"dispose",value:function(){this.source=null}}],[{key:"crossOrigin",value:function(t,e,r){void 0!==r||e.startsWith("data:")?!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous"):t.crossOrigin=(0,a.determineCrossOrigin)(e)}}]),r}(S),xt=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(t,n){var i,a;if((0,u.Z)(this,r),n=n||{},"string"==typeof t){var s=new Image;wt.crossOrigin(s,t,n.crossorigin),s.src=t,t=s}return i=e.call(this,t),!t.complete&&i._width&&i._height&&(i._width=0,i._height=0),i.url=t.src,i._process=null,i.preserveBitmap=!1,i.createBitmap=(null!==(a=n.createBitmap)&&void 0!==a?a:o.Xd.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,i.alphaMode="number"==typeof n.alphaMode?n.alphaMode:null,i.bitmap=null,i._load=null,!1!==n.autoLoad&&i.load(),(0,d.Z)(i)}return(0,c.Z)(r,[{key:"load",value:function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((function(t,r){var n=e.source;e.url=n.src;var i=function(){e.destroyed||(n.onload=null,n.onerror=null,e.update(),e._load=null,e.createBitmap?t(e.process()):t(e))};n.complete&&n.src?i():(n.onload=i,n.onerror=function(t){r(t),e.onError.emit(t)})}))),this._load}},{key:"process",value:function(){var t=this,e=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);var r=globalThis.createImageBitmap,n=!e.crossOrigin||"anonymous"===e.crossOrigin;return this._process=fetch(e.src,{mode:n?"cors":"no-cors"}).then((function(t){return t.blob()})).then((function(n){return r(n,0,0,e.width,e.height,{premultiplyAlpha:null===t.alphaMode||t.alphaMode===i.iw.UNPACK?"premultiply":"none"})})).then((function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))})),this._process}},{key:"upload",value:function(t,e,n){if("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),!this.createBitmap)return(0,h.Z)((0,l.Z)(r.prototype),"upload",this).call(this,t,e,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if((0,h.Z)((0,l.Z)(r.prototype),"upload",this).call(this,t,e,n,this.bitmap),!this.preserveBitmap){var i=!0,o=e._glTextures;for(var a in o){var s=o[a];if(s!==n&&s.dirtyId!==e.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}},{key:"dispose",value:function(){this.source.onload=null,this.source.onerror=null,(0,h.Z)((0,l.Z)(r.prototype),"dispose",this).call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}}],[{key:"test",value:function(t){return("undefined"===typeof HTMLImageElement?"undefined":(0,_t.Z)(HTMLImageElement))<"u"&&("string"==typeof t||(0,g.Z)(t,HTMLImageElement))}}]),r}(wt),Et=function(){function t(){(0,u.Z)(this,t),this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return(0,c.Z)(t,[{key:"set",value:function(t,e,r){var n=e.width,i=e.height;if(r){var o=t.width/2/n,a=t.height/2/i,s=t.x/n+o,u=t.y/i+a;r=j.Lv.add(r,j.Lv.NW),this.x0=s+o*j.Lv.uX(r),this.y0=u+a*j.Lv.uY(r),r=j.Lv.add(r,2),this.x1=s+o*j.Lv.uX(r),this.y1=u+a*j.Lv.uY(r),r=j.Lv.add(r,2),this.x2=s+o*j.Lv.uX(r),this.y2=u+a*j.Lv.uY(r),r=j.Lv.add(r,2),this.x3=s+o*j.Lv.uX(r),this.y3=u+a*j.Lv.uY(r)}else this.x0=t.x/n,this.y0=t.y/i,this.x1=(t.x+t.width)/n,this.y1=t.y/i,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/i,this.x3=t.x/n,this.y3=(t.y+t.height)/i;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}]),t}();Et.prototype.toString=function(){return"[@pixi/core:TextureUvs x0=".concat(this.x0," y0=").concat(this.y0," x1=").concat(this.x1," y1=").concat(this.y1," x2=").concat(this.x2," y2=").concat(this.y2," x3=").concat(this.x3," y3=").concat(this.y3,"]")};var At=new Et;function St(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}var Tt=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(t,n,i,o,a,c,h){var l;if((0,u.Z)(this,r),(l=e.call(this)).noFrame=!1,n||(l.noFrame=!0,n=new j.Ae(0,0,1,1)),(0,g.Z)(t,r)&&(t=t.baseTexture),l.baseTexture=t,l._frame=n,l.trim=o,l.valid=!1,l.destroyed=!1,l._uvs=At,l.uvMatrix=null,l.orig=i||n,l._rotate=Number(a||0),!0===a)l._rotate=2;else if(l._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return l.defaultAnchor=c?new j.E9(c.x,c.y):new j.E9(0,0),l.defaultBorders=h,l._updateID=0,l.textureCacheIds=[],t.valid?l.noFrame?t.valid&&l.onBaseTextureUpdated(t):l.frame=n:t.once("loaded",l.onBaseTextureUpdated,(0,s.Z)(l)),l.noFrame&&t.on("update",l.onBaseTextureUpdated,(0,s.Z)(l)),(0,d.Z)(l)}return(0,c.Z)(r,[{key:"update",value:function(){this.baseTexture.resource&&this.baseTexture.resource.update()}},{key:"onBaseTextureUpdated",value:function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}},{key:"destroy",value:function(t){if(this.baseTexture){if(t){var e=this.baseTexture.resource;(null===e||void 0===e?void 0:e.url)&&a.TextureCache[e.url]&&r.removeFromCache(e.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,r.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}},{key:"clone",value:function(){var t,e=this._frame.clone(),n=this._frame===this.orig?e:this.orig.clone(),i=new r(this.baseTexture,!this.noFrame&&e,n,null===(t=this.trim)||void 0===t?void 0:t.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}},{key:"updateUvs",value:function(){this._uvs===At&&(this._uvs=new Et),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}},{key:"resolution",get:function(){return this.baseTexture.resolution}},{key:"frame",get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,r=t.y,n=t.width,i=t.height,o=e+n>this.baseTexture.width,a=r+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: ".concat(e," + ").concat(n," = ").concat(e+n," > ").concat(this.baseTexture.width),c="Y: ".concat(r," + ").concat(i," = ").concat(r+i," > ").concat(this.baseTexture.height);throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: ".concat(u," ").concat(s," ").concat(c))}this.valid=n&&i&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}},{key:"castToBaseTexture",value:function(){return this.baseTexture}}],[{key:"from",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.Xd.STRICT_TEXTURE_CACHE,i="string"==typeof t,s=null;if(i)s=t;else if((0,g.Z)(t,M)){if(!t.cacheId){var u=(null===e||void 0===e?void 0:e.pixiIdPrefix)||"pixiid";t.cacheId="".concat(u,"-").concat((0,a.uid)()),M.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){var c=(null===e||void 0===e?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId="".concat(c,"_").concat((0,a.uid)())}s=t._pixiId}var h=a.TextureCache[s];if(i&&n&&!h)throw new Error('The cacheId "'.concat(s,'" does not exist in TextureCache.'));return h||(0,g.Z)(t,M)?!h&&(0,g.Z)(t,M)&&(h=new r(t),r.addToCache(h,s)):(e.resolution||(e.resolution=(0,a.getResolutionOfUrl)(t)),(h=new r(new M(t,e))).baseTexture.cacheId=s,M.addToCache(h.baseTexture,s),r.addToCache(h,s)),h}},{key:"fromURL",value:function(t,e){var n=Object.assign({autoLoad:!1},null===e||void 0===e?void 0:e.resourceOptions),i=r.from(t,Object.assign({resourceOptions:n},e),!1),o=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):o.load().then((function(){return Promise.resolve(i)}))}},{key:"fromBuffer",value:function(t,e,n,i){return new r(M.fromBuffer(t,e,n,i))}},{key:"fromLoader",value:function(t,e,n,i){var o=new M(t,Object.assign({scaleMode:M.defaultOptions.scaleMode,resolution:(0,a.getResolutionOfUrl)(e)},i)),s=o.resource;(0,g.Z)(s,xt)&&(s.url=e);var u=new r(o);return n||(n=e),M.addToCache(u.baseTexture,n),r.addToCache(u,n),n!==e&&(M.addToCache(u.baseTexture,e),r.addToCache(u,e)),u.baseTexture.valid?Promise.resolve(u):new Promise((function(t){u.baseTexture.once("loaded",(function(){return t(u)}))}))}},{key:"addToCache",value:function(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),a.TextureCache[e]&&a.TextureCache[e]!==t&&console.warn("Texture added to the cache with an id [".concat(e,"] that already had an entry")),a.TextureCache[e]=t)}},{key:"removeFromCache",value:function(t){if("string"==typeof t){var e=a.TextureCache[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete a.TextureCache[t],e}}else if(null===t||void 0===t?void 0:t.textureCacheIds){for(var n=0;n2&&void 0!==arguments[2])||arguments[2],n=this.baseTexture.resolution,i=Math.round(t*n)/n,o=Math.round(e*n)/n;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(i,o),this.updateUvs()}},{key:"setResolution",value:function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}}],[{key:"create",value:function(t){return new r(new bt(t))}}]),r}(Tt),Rt=function(){function t(e){(0,u.Z)(this,t),this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return(0,c.Z)(t,[{key:"createTexture",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.G5.NONE,n=new bt(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new kt(n)}},{key:"getOptimalTexture",value:function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.G5.NONE;t=Math.max(Math.ceil(t*n-1e-6),1),e=Math.max(Math.ceil(e*n-1e-6),1),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?r=o>1?-o:-1:(r=((65535&(t=(0,a.nextPow2)(t)))<<16|65535&(e=(0,a.nextPow2)(e)))>>>0,o>1&&(r+=4294967296*o)),this.texturePool[r]||(this.texturePool[r]=[]);var s=this.texturePool[r].pop();return s||(s=this.createTexture(t,e,o)),s.filterPoolKey=r,s.setResolution(n),s}},{key:"getFilterTexture",value:function(t,e,r){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||i.G5.NONE);return n.filterFrame=t.filterFrame,n}},{key:"returnTexture",value:function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}},{key:"returnFilterTexture",value:function(t){this.returnTexture(t)}},{key:"clear",value:function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var n=0;n0&&t.height>0,this.texturePool)if(Number(e)<0){var r=this.texturePool[e];if(r)for(var n=0;n1&&((l=this.getOptimalFilterTexture(h.width,h.height,e.resolution)).filterFrame=h.filterFrame),r[f].apply(this,h,l,i.yl.CLEAR,e);var d=h;h=l,l=d}r[f].apply(this,h,c.renderTexture,i.yl.BLEND,e),f>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(l)}e.clear(),this.statePool.push(e)}},{key:"bindAndClear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.yl.CLEAR,r=this.renderer,n=r.renderTexture,o=r.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,null===t||void 0===t?void 0:t.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=t.filterFrame.width,a.height=t.filterFrame.height,n.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(e===i.yl.CLEAR||e===i.yl.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}},{key:"applyFilter",value:function(t,e,r,n){var o=this.renderer;o.state.set(t.state),this.bindAndClear(r,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.lg.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.lg.TRIANGLE_STRIP))}},{key:"calculateSpriteMatrix",value:function(t,e){var r=this.activeState,n=r.sourceFrame,i=r.destinationFrame,o=e._texture.orig,a=t.set(i.width,0,0,i.height,n.x,n.y),s=e.worldTransform.copyTo(j.y3.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(e.anchor.x,e.anchor.y),a}},{key:"destroy",value:function(){this.renderer=null,this.texturePool.clear(!1)}},{key:"getOptimalFilterTexture",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.G5.NONE;return this.texturePool.getOptimalTexture(t,e,r,n)}},{key:"getFilterTexture",value:function(t,e,r){if("number"==typeof t){var n=t;t=e,e=n}t=t||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||i.G5.NONE);return o.filterFrame=t.filterFrame,o}},{key:"returnFilterTexture",value:function(t){this.texturePool.returnTexture(t)}},{key:"emptyPool",value:function(){this.texturePool.clear(!0)}},{key:"resize",value:function(){this.texturePool.setScreenSize(this.renderer.view)}},{key:"transformAABB",value:function(t,e){var r=It[0],n=It[1],i=It[2],o=It[3];r.set(e.left,e.top),n.set(e.left,e.bottom),i.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(r,r),t.apply(n,n),t.apply(i,i),t.apply(o,o);var a=Math.min(r.x,n.x,i.x,o.x),s=Math.min(r.y,n.y,i.y,o.y),u=Math.max(r.x,n.x,i.x,o.x),c=Math.max(r.y,n.y,i.y,o.y);e.x=a,e.y=s,e.width=u-a,e.height=c-s}},{key:"roundFrame",value:function(t,e,r,n,i){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?Ot.copyFrom(i):Ot.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.transformAABB(i,t),t.ceil(e),this.transformAABB(i.invert(),t)}}}]),t}();Bt.extension={type:m.n.RendererSystem,name:"filter"},m.R.add(Bt);var Nt=function t(e){(0,u.Z)(this,t),this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.G5.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},Lt=new j.Ae,Dt=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new yt(10,10),this.msaaSamples=null}return(0,c.Z)(t,[{key:"contextChange",value:function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new j.Ae,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;o.Xd.PREFER_ENV===i.Vi.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}},{key:"bind",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,i.mipLevel=r),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,i.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o>r,u=e.height>>r,c=s/e.width;this.setViewport(e.x*c,e.y*c,s,u)}else{var h=t.width>>r,l=t.height>>r;this.setViewport(0,0,h,l)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}},{key:"setViewport",value:function(t,e,r,n){var i=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),n=Math.round(n),(i.width!==r||i.height!==n||i.x!==t||i.y!==e)&&(i.x=t,i.y=e,i.width=r,i.height=n,this.gl.viewport(t,e,r,n))}},{key:"size",get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}},{key:"clear",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.V0.COLOR|i.V0.DEPTH,a=this.gl;a.clearColor(t,e,r,n),a.clear(o)}},{key:"initFramebuffer",value:function(t){var e=this.gl,r=new Nt(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r}},{key:"resizeFramebuffer",value:function(t){var e,r=this.gl,n=t.glFramebuffers[this.CONTEXT_UID];n.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),e=1===this.renderer.context.webGLVersion?r.DEPTH_STENCIL:t.depth&&t.stencil?r.DEPTH24_STENCIL8:t.depth?r.DEPTH_COMPONENT24:r.STENCIL_INDEX8,n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,e,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,e,t.width,t.height));var i=t.colorTextures,o=i.length;r.drawBuffers||(o=Math.min(o,1));for(var a=0;a1&&this.canMultisampleFramebuffer(t)?n.msaaBuffer=n.msaaBuffer||r.createRenderbuffer():n.msaaBuffer&&(r.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var a,s,u=[],c=0;c1&&r.drawBuffers(u),t.depthTexture&&this.writeDepthTexture){var f=t.depthTexture;this.renderer.texture.bind(f,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,f._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?n.stencil&&(r.deleteRenderbuffer(n.stencil),n.stencil=null):(n.stencil=n.stencil||r.createRenderbuffer(),1===this.renderer.context.webGLVersion?(a=r.DEPTH_STENCIL_ATTACHMENT,s=r.DEPTH_STENCIL):t.depth&&t.stencil?(a=r.DEPTH_STENCIL_ATTACHMENT,s=r.DEPTH24_STENCIL8):t.depth?(a=r.DEPTH_ATTACHMENT,s=r.DEPTH_COMPONENT24):(a=r.STENCIL_ATTACHMENT,s=r.STENCIL_INDEX8),r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,s,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,s,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,a,r.RENDERBUFFER,n.stencil))}},{key:"canMultisampleFramebuffer",value:function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture}},{key:"detectSamples",value:function(t){var e=this.msaaSamples,r=i.G5.NONE;if(t<=1||null===e)return r;for(var n=0;n=0&&this.managedFramebuffers.splice(i,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&n.deleteRenderbuffer(r.msaaBuffer),r.stencil&&n.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&this.disposeFramebuffer(r.blitFramebuffer,e)}}},{key:"disposeAll",value:function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r2&&void 0!==arguments[2])||arguments[2],n=this.gl,o=this.CONTEXT_UID,a=this.renderer.buffer,s=e.program;s.glPrograms[o]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,s);var u=this.getSignature(t,s),c=t.glVertexArrayObjects[this.CONTEXT_UID],h=c[u];if(h)return c[s.id]=h,h;var l=t.buffers,f=t.attributes,d={},p={};for(var v in l)d[v]=0,p[v]=0;for(var m in f)!f[m].size&&s.attributeData[m]?f[m].size=s.attributeData[m].size:f[m].size||console.warn("PIXI Geometry attribute '".concat(m,"' size cannot be determined (likely the bound shader does not have the attribute)")),d[f[m].buffer]+=f[m].size*Ut[f[m].type];for(var g in f){var y=f[g],b=y.size;void 0===y.stride&&(d[y.buffer]===b*Ut[y.type]?y.stride=0:y.stride=d[y.buffer]),void 0===y.start&&(y.start=p[y.buffer],p[y.buffer]+=b*Ut[y.type])}h=n.createVertexArray(),n.bindVertexArray(h);for(var _=0;_"u"?.5:r,this.isSimple=!1}return(0,c.Z)(t,[{key:"texture",get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1}},{key:"multiplyUvs",value:function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,n=0;n0&&void 0!==arguments[0]?arguments[0]:null;(0,u.Z)(this,t),this.type=i.A7.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=dt.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}return(0,c.Z)(t,[{key:"filter",get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}},{key:"reset",value:function(){this.pooled&&(this.maskObject=null,this.type=i.A7.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}},{key:"copyCountersOrReset",value:function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}]),t}(),Vt=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return(0,c.Z)(t,[{key:"setMaskStack",value:function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}},{key:"push",value:function(t,e){var r=e;if(!r.isMaskData){var n=this.maskDataPool.pop()||new Gt;n.pooled=!0,n.maskObject=e,r=n}var o=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(r.copyCountersOrReset(o),r._colorMask=o?o._colorMask:15,r.autoDetect&&this.detect(r),r._target=t,r.type!==i.A7.SPRITE&&this.maskStack.push(r),r.enabled)switch(r.type){case i.A7.SCISSOR:this.renderer.scissor.push(r);break;case i.A7.STENCIL:this.renderer.stencil.push(r);break;case i.A7.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r);break;case i.A7.COLOR:this.pushColorMask(r)}r.type===i.A7.SPRITE&&this.maskStack.push(r)}},{key:"pop",value:function(t){var e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case i.A7.SCISSOR:this.renderer.scissor.pop(e);break;case i.A7.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case i.A7.SPRITE:this.popSpriteMask(e);break;case i.A7.COLOR:this.popColorMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){var r=this.maskStack[this.maskStack.length-1];r.type===i.A7.SPRITE&&r._filters&&(r._filters[0].maskSprite=r.maskObject)}}}},{key:"detect",value:function(t){var e=t.maskObject;e?e.isSprite?t.type=i.A7.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=i.A7.SCISSOR:t.type=i.A7.STENCIL:t.type=i.A7.COLOR}},{key:"pushSpriteMask",value:function(t){var e=t.maskObject,r=t._target,n=t._filters;n||((n=this.alphaMaskPool[this.alphaMaskIndex])||(n=this.alphaMaskPool[this.alphaMaskIndex]=[new Ht])),n[0].resolution=t.resolution,n[0].multisample=t.multisample,n[0].maskSprite=e;var i=r.filterArea;r.filterArea=e.getBounds(!0),this.renderer.filter.push(r,n),r.filterArea=i,t._filters||this.alphaMaskIndex++}},{key:"popSpriteMask",value:function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}},{key:"pushColorMask",value:function(t){var e=t._colorMask,r=t._colorMask=e&t.colorMask;r!==e&&this.renderer.gl.colorMask(0!==(1&r),0!==(2&r),0!==(4&r),0!==(8&r))}},{key:"popColorMask",value:function(t){var e=t._colorMask,r=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;r!==e&&this.renderer.gl.colorMask(0!==(1&r),0!==(2&r),0!==(4&r),0!==(8&r))}},{key:"destroy",value:function(){this.renderer=null}}]),t}();Vt.extension={type:m.n.RendererSystem,name:"mask"},m.R.add(Vt);var zt=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this.maskStack=[],this.glConst=0}return(0,c.Z)(t,[{key:"getStackLength",value:function(){return this.maskStack.length}},{key:"setMaskStack",value:function(t){var e=this.renderer.gl,r=this.getStackLength();this.maskStack=t;var n=this.getStackLength();n!==r&&(0===n?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}},{key:"_useCurrent",value:function(){}},{key:"destroy",value:function(){this.renderer=null,this.maskStack=null}}]),t}(),Wt=new j.y3,Xt=[],qt=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(t){var n;return(0,u.Z)(this,r),(n=e.call(this,t)).glConst=o.Xd.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,(0,d.Z)(n)}return(0,c.Z)(r,[{key:"getStackLength",value:function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}},{key:"calcScissorRect",value:function(t){if(!t._scissorRectLocal){var e,r=t._scissorRect,n=t.maskObject,i=this.renderer,o=i.renderTexture,a=n.getBounds(!0,null!==(e=Xt.pop())&&void 0!==e?e:new j.Ae);this.roundFrameToPixels(a,o.current?o.current.resolution:i.resolution,o.sourceFrame,o.destinationFrame,i.projection.transform),r&&a.fit(r),t._scissorRectLocal=a}}},{key:"testScissor",value:function(t){var e=t.maskObject;if(!e.isFastRect||!e.isFastRect()||r.isMatrixRotated(e.worldTransform)||r.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var n=t._scissorRectLocal;return n.width>0&&n.height>0}},{key:"roundFrameToPixels",value:function(t,e,n,i,o){r.isMatrixRotated(o)||((o=o?Wt.copyFrom(o):Wt.identity()).translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,t),t.fit(i),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}},{key:"push",value:function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}},{key:"pop",value:function(t){var e=this.renderer.gl;t&&Xt.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}},{key:"_useCurrent",value:function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}}],[{key:"isMatrixRotated",value:function(t){if(!t)return!1;var e=t.a,r=t.b,n=t.c,i=t.d;return(Math.abs(r)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(i)>1e-4)}}]),r}(zt);qt.extension={type:m.n.RendererSystem,name:"scissor"};var Yt=qt;m.R.add(Yt);var Kt=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(t){var n;return(0,u.Z)(this,r),(n=e.call(this,t)).glConst=o.Xd.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,(0,d.Z)(n)}return(0,c.Z)(r,[{key:"getStackLength",value:function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}},{key:"push",value:function(t){var e=t.maskObject,r=this.renderer.gl,n=t._stencilCounter;0===n&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),t._stencilCounter++;var i=t._colorMask;0!==i&&(t._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilFunc(r.EQUAL,n,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==i&&(t._colorMask=i,r.colorMask(0!==(1&i),0!==(2&i),0!==(4&i),0!==(8&i))),this._useCurrent()}},{key:"pop",value:function(t){var e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{var r=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,n=r?r._colorMask:15;0!==n&&(r._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==n&&(r._colorMask=n,e.colorMask(0!==(1&n),0!==(2&n),0!==(4&n),0!==(8&n))),this._useCurrent()}}},{key:"_useCurrent",value:function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}]),r}(zt);Kt.extension={type:m.n.RendererSystem,name:"stencil"},m.R.add(Kt);var Jt=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get:function(){return(0,a.deprecation)("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get:function(){return(0,a.deprecation)("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get:function(){return(0,a.deprecation)("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}return(0,c.Z)(t,[{key:"init",value:function(){var t=this.rendererPlugins;for(var e in t)this.plugins[e]=new t[e](this.renderer)}},{key:"destroy",value:function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}]),t}();Jt.extension={type:[m.n.RendererSystem,m.n.CanvasRendererSystem],name:"_plugin"},m.R.add(Jt);var $t=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new j.y3,this.transform=null}return(0,c.Z)(t,[{key:"update",value:function(t,e,r,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,n),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)}},{key:"calculateProjection",value:function(t,e,r,n){var i=this.projectionMatrix,o=n?-1:1;i.identity(),i.a=1/e.width*2,i.d=o*(1/e.height*2),i.tx=-1-e.x*i.a,i.ty=-o-e.y*i.d}},{key:"setTransform",value:function(t){}},{key:"destroy",value:function(){this.renderer=null}}]),t}();$t.extension={type:m.n.RendererSystem,name:"projection"},m.R.add($t);var Qt=r(9534),te=new j.wx,ee=new j.Ae,re=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this._tempMatrix=new j.y3}return(0,c.Z)(t,[{key:"generateTexture",value:function(t,e){var r,n=e||{},i=n.region,o=(0,Qt.Z)(n,["region"]),a=(null===i||void 0===i?void 0:i.copyTo(ee))||t.getLocalBounds(ee,!0),s=o.resolution||this.renderer.resolution;a.width=Math.max(a.width,1/s),a.height=Math.max(a.height,1/s),o.width=a.width,o.height=a.height,o.resolution=s,null!==(r=o.multisample)&&void 0!==r||(o.multisample=this.renderer.multisample);var u=kt.create(o);this._tempMatrix.tx=-a.x,this._tempMatrix.ty=-a.y;var c=t.transform;return t.transform=te,this.renderer.render(t,{renderTexture:u,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=c,u}},{key:"destroy",value:function(){}}]),t}();re.extension={type:[m.n.RendererSystem,m.n.CanvasRendererSystem],name:"textureGenerator"},m.R.add(re);var ne=new j.Ae,ie=new j.Ae,oe=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new j.Ae,this.destinationFrame=new j.Ae,this.viewportFrame=new j.Ae}return(0,c.Z)(t,[{key:"contextChange",value:function(){var t,e=null===(t=this.renderer)||void 0===t?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}},{key:"bind",value:function(){var t,e,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,a=this.renderer;this.current=n,n?(r=(t=n.baseTexture).resolution,i||(ne.width=n.frame.width,ne.height=n.frame.height,i=ne),o||(ie.x=n.frame.x,ie.y=n.frame.y,ie.width=i.width,ie.height=i.height,o=ie),e=t.framebuffer):(r=a.resolution,i||(ne.width=a._view.screen.width,ne.height=a._view.screen.height,i=ne),o||((o=ne).width=i.width,o.height=i.height));var s=this.viewportFrame;s.x=o.x*r,s.y=o.y*r,s.width=o.width*r,s.height=o.height*r,n||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(e,s),this.renderer.projection.update(o,i,r,!e),n?this.renderer.mask.setMaskStack(t.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(i),this.destinationFrame.copyFrom(o)}},{key:"clear",value:function(t,e){var r=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=v.I.shared.setValue(t||r);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);var i=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=i.width!==o.width||i.height!==o.height;if(a){var s=this.viewportFrame,u=s.x,c=s.y,h=s.width,l=s.height;u=Math.round(u),c=Math.round(c),h=Math.round(h),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(u,c,h,l)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,e),a&&this.renderer.scissor.pop()}},{key:"resize",value:function(){this.bind(null)}},{key:"reset",value:function(){this.bind(null)}},{key:"destroy",value:function(){this.renderer=null}}]),t}();oe.extension={type:m.n.RendererSystem,name:"renderTexture"},m.R.add(oe);var ae=function(){function t(e,r){(0,u.Z)(this,t),this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return(0,c.Z)(t,[{key:"destroy",value:function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}]),t}();function se(t,e,r){var n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),n}function ue(t){for(var e=new Array(t),r=0;re?1:-1}));for(var u=0;u1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,n%r!==0&&n<16){var s=n%r%16;n+=s,i+=s}n+r>16?(i=16*Math.ceil(i/16),a.offset=i,i+=r,n=r):(a.offset=i,n+=r,i+=r)}return{uboElements:e,size:i=16*Math.ceil(i/16)}}(r),i=n.uboElements,o=n.size,a=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],s=0;s1){var p=Y(u.data.type),v=Math.max(me[u.data.type]/16,1),m=p/v,g=(4-m%4)%4;a.push("\n cv = ud.".concat(h,".value;\n v = uv.").concat(h,";\n offset = ").concat(u.offset/4,";\n\n t = 0;\n\n for(var i=0; i < ").concat(u.data.size*v,"; i++)\n {\n for(var j = 0; j < ").concat(m,"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += ").concat(g,";\n }\n\n "))}else{var y=ve[u.data.type];a.push("\n cv = ud.".concat(h,".value;\n v = uv.").concat(h,";\n offset = ").concat(u.offset/4,";\n ").concat(y,";\n "))}}return a.push("\n renderer.buffer.update(buffer);\n "),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",a.join("\n"))}}var ye=0,be={textureCount:0,uboCount:0},_e=function(){function t(e){(0,u.Z)(this,t),this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=ye++}return(0,c.Z)(t,[{key:"systemCheck",value:function(){if(!function(){if("boolean"==typeof pe)return pe;try{pe=!0===new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")}catch(t){pe=!1}return pe}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}},{key:"contextChange",value:function(t){this.gl=t,this.reset()}},{key:"bind",value:function(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;var r=t.program,n=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==r&&(this.program=r,this.gl.useProgram(n.program)),e||(be.textureCount=0,be.uboCount=0,this.syncUniformGroup(t.uniformGroup,be)),n}},{key:"setUniforms",value:function(t){var e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)}},{key:"syncUniformGroup",value:function(t,e){var r=this.getGlProgram();(!t.static||t.dirtyId!==r.uniformDirtyGroups[t.id])&&(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))}},{key:"syncUniforms",value:function(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)}},{key:"createSyncGroups",value:function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){var r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var n in t.uniforms){var i=e[n];if(i){for(var o=t.uniforms[n],a=!1,s=0;s1&&void 0!==arguments[1]?arguments[1]:[];return e[i.T$.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.ADD]=[t.ONE,t.ONE],e[i.T$.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.NONE]=[0,0],e[i.T$.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[i.T$.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.T$.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[i.T$.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[i.T$.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[i.T$.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[i.T$.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[i.T$.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[i.T$.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[i.T$.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[i.T$.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()}},{key:"set",value:function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,r=0;e;)1&e&&this.map[r].call(this,!!(t.data&1<>=1,r++;this.stateId=t.data}for(var n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))}},{key:"run",value:function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,n=0;nthis.maxIdle&&(t.destroyTexture(i,!0),e[n]=null,r=!0)}if(r){for(var o=0,a=0;a=0;n--)this.unload(t.children[n])}},{key:"destroy",value:function(){this.renderer=null}}]),t}();Se.defaultMode=i.UN.AUTO,Se.defaultMaxIdle=3600,Se.defaultCheckCountMax=600,Se.extension={type:m.n.RendererSystem,name:"textureGC"};var Te=Se;m.R.add(Te);var ke=function t(e){(0,u.Z)(this,t),this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.vK.UNSIGNED_BYTE,this.internalFormat=i.I2.RGBA,this.samplerType=0},Re=r(4924);var Me=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new M,this.hasIntegerTextures=!1}return(0,c.Z)(t,[{key:"contextChange",value:function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){var e,r,n,o,a,s,u,c,h,l,f,d,p;return"WebGL2RenderingContext"in globalThis&&(0,g.Z)(t,globalThis.WebGL2RenderingContext)?(f={},(0,Re.Z)(f,i.vK.UNSIGNED_BYTE,(r={},(0,Re.Z)(r,i.I2.RGBA,t.RGBA8),(0,Re.Z)(r,i.I2.RGB,t.RGB8),(0,Re.Z)(r,i.I2.RG,t.RG8),(0,Re.Z)(r,i.I2.RED,t.R8),(0,Re.Z)(r,i.I2.RGBA_INTEGER,t.RGBA8UI),(0,Re.Z)(r,i.I2.RGB_INTEGER,t.RGB8UI),(0,Re.Z)(r,i.I2.RG_INTEGER,t.RG8UI),(0,Re.Z)(r,i.I2.RED_INTEGER,t.R8UI),(0,Re.Z)(r,i.I2.ALPHA,t.ALPHA),(0,Re.Z)(r,i.I2.LUMINANCE,t.LUMINANCE),(0,Re.Z)(r,i.I2.LUMINANCE_ALPHA,t.LUMINANCE_ALPHA),r)),(0,Re.Z)(f,i.vK.BYTE,(n={},(0,Re.Z)(n,i.I2.RGBA,t.RGBA8_SNORM),(0,Re.Z)(n,i.I2.RGB,t.RGB8_SNORM),(0,Re.Z)(n,i.I2.RG,t.RG8_SNORM),(0,Re.Z)(n,i.I2.RED,t.R8_SNORM),(0,Re.Z)(n,i.I2.RGBA_INTEGER,t.RGBA8I),(0,Re.Z)(n,i.I2.RGB_INTEGER,t.RGB8I),(0,Re.Z)(n,i.I2.RG_INTEGER,t.RG8I),(0,Re.Z)(n,i.I2.RED_INTEGER,t.R8I),n)),(0,Re.Z)(f,i.vK.UNSIGNED_SHORT,(o={},(0,Re.Z)(o,i.I2.RGBA_INTEGER,t.RGBA16UI),(0,Re.Z)(o,i.I2.RGB_INTEGER,t.RGB16UI),(0,Re.Z)(o,i.I2.RG_INTEGER,t.RG16UI),(0,Re.Z)(o,i.I2.RED_INTEGER,t.R16UI),(0,Re.Z)(o,i.I2.DEPTH_COMPONENT,t.DEPTH_COMPONENT16),o)),(0,Re.Z)(f,i.vK.SHORT,(a={},(0,Re.Z)(a,i.I2.RGBA_INTEGER,t.RGBA16I),(0,Re.Z)(a,i.I2.RGB_INTEGER,t.RGB16I),(0,Re.Z)(a,i.I2.RG_INTEGER,t.RG16I),(0,Re.Z)(a,i.I2.RED_INTEGER,t.R16I),a)),(0,Re.Z)(f,i.vK.UNSIGNED_INT,(s={},(0,Re.Z)(s,i.I2.RGBA_INTEGER,t.RGBA32UI),(0,Re.Z)(s,i.I2.RGB_INTEGER,t.RGB32UI),(0,Re.Z)(s,i.I2.RG_INTEGER,t.RG32UI),(0,Re.Z)(s,i.I2.RED_INTEGER,t.R32UI),(0,Re.Z)(s,i.I2.DEPTH_COMPONENT,t.DEPTH_COMPONENT24),s)),(0,Re.Z)(f,i.vK.INT,(u={},(0,Re.Z)(u,i.I2.RGBA_INTEGER,t.RGBA32I),(0,Re.Z)(u,i.I2.RGB_INTEGER,t.RGB32I),(0,Re.Z)(u,i.I2.RG_INTEGER,t.RG32I),(0,Re.Z)(u,i.I2.RED_INTEGER,t.R32I),u)),(0,Re.Z)(f,i.vK.FLOAT,(c={},(0,Re.Z)(c,i.I2.RGBA,t.RGBA32F),(0,Re.Z)(c,i.I2.RGB,t.RGB32F),(0,Re.Z)(c,i.I2.RG,t.RG32F),(0,Re.Z)(c,i.I2.RED,t.R32F),(0,Re.Z)(c,i.I2.DEPTH_COMPONENT,t.DEPTH_COMPONENT32F),c)),(0,Re.Z)(f,i.vK.HALF_FLOAT,(h={},(0,Re.Z)(h,i.I2.RGBA,t.RGBA16F),(0,Re.Z)(h,i.I2.RGB,t.RGB16F),(0,Re.Z)(h,i.I2.RG,t.RG16F),(0,Re.Z)(h,i.I2.RED,t.R16F),h)),(0,Re.Z)(f,i.vK.UNSIGNED_SHORT_5_6_5,(0,Re.Z)({},i.I2.RGB,t.RGB565)),(0,Re.Z)(f,i.vK.UNSIGNED_SHORT_4_4_4_4,(0,Re.Z)({},i.I2.RGBA,t.RGBA4)),(0,Re.Z)(f,i.vK.UNSIGNED_SHORT_5_5_5_1,(0,Re.Z)({},i.I2.RGBA,t.RGB5_A1)),(0,Re.Z)(f,i.vK.UNSIGNED_INT_2_10_10_10_REV,(l={},(0,Re.Z)(l,i.I2.RGBA,t.RGB10_A2),(0,Re.Z)(l,i.I2.RGBA_INTEGER,t.RGB10_A2UI),l)),(0,Re.Z)(f,i.vK.UNSIGNED_INT_10F_11F_11F_REV,(0,Re.Z)({},i.I2.RGB,t.R11F_G11F_B10F)),(0,Re.Z)(f,i.vK.UNSIGNED_INT_5_9_9_9_REV,(0,Re.Z)({},i.I2.RGB,t.RGB9_E5)),(0,Re.Z)(f,i.vK.UNSIGNED_INT_24_8,(0,Re.Z)({},i.I2.DEPTH_STENCIL,t.DEPTH24_STENCIL8)),(0,Re.Z)(f,i.vK.FLOAT_32_UNSIGNED_INT_24_8_REV,(0,Re.Z)({},i.I2.DEPTH_STENCIL,t.DEPTH32F_STENCIL8)),e=f):(p={},(0,Re.Z)(p,i.vK.UNSIGNED_BYTE,(d={},(0,Re.Z)(d,i.I2.RGBA,t.RGBA),(0,Re.Z)(d,i.I2.RGB,t.RGB),(0,Re.Z)(d,i.I2.ALPHA,t.ALPHA),(0,Re.Z)(d,i.I2.LUMINANCE,t.LUMINANCE),(0,Re.Z)(d,i.I2.LUMINANCE_ALPHA,t.LUMINANCE_ALPHA),d)),(0,Re.Z)(p,i.vK.UNSIGNED_SHORT_5_6_5,(0,Re.Z)({},i.I2.RGB,t.RGB)),(0,Re.Z)(p,i.vK.UNSIGNED_SHORT_4_4_4_4,(0,Re.Z)({},i.I2.RGBA,t.RGBA)),(0,Re.Z)(p,i.vK.UNSIGNED_SHORT_5_5_5_1,(0,Re.Z)({},i.I2.RGBA,t.RGBA)),e=p),e}(t),this.samplerTypes=function(t){var e,r,n;return"WebGL2RenderingContext"in globalThis&&(0,g.Z)(t,globalThis.WebGL2RenderingContext)?(r={},(0,Re.Z)(r,t.RGB,i.oT.FLOAT),(0,Re.Z)(r,t.RGBA,i.oT.FLOAT),(0,Re.Z)(r,t.ALPHA,i.oT.FLOAT),(0,Re.Z)(r,t.LUMINANCE,i.oT.FLOAT),(0,Re.Z)(r,t.LUMINANCE_ALPHA,i.oT.FLOAT),(0,Re.Z)(r,t.R8,i.oT.FLOAT),(0,Re.Z)(r,t.R8_SNORM,i.oT.FLOAT),(0,Re.Z)(r,t.RG8,i.oT.FLOAT),(0,Re.Z)(r,t.RG8_SNORM,i.oT.FLOAT),(0,Re.Z)(r,t.RGB8,i.oT.FLOAT),(0,Re.Z)(r,t.RGB8_SNORM,i.oT.FLOAT),(0,Re.Z)(r,t.RGB565,i.oT.FLOAT),(0,Re.Z)(r,t.RGBA4,i.oT.FLOAT),(0,Re.Z)(r,t.RGB5_A1,i.oT.FLOAT),(0,Re.Z)(r,t.RGBA8,i.oT.FLOAT),(0,Re.Z)(r,t.RGBA8_SNORM,i.oT.FLOAT),(0,Re.Z)(r,t.RGB10_A2,i.oT.FLOAT),(0,Re.Z)(r,t.RGB10_A2UI,i.oT.FLOAT),(0,Re.Z)(r,t.SRGB8,i.oT.FLOAT),(0,Re.Z)(r,t.SRGB8_ALPHA8,i.oT.FLOAT),(0,Re.Z)(r,t.R16F,i.oT.FLOAT),(0,Re.Z)(r,t.RG16F,i.oT.FLOAT),(0,Re.Z)(r,t.RGB16F,i.oT.FLOAT),(0,Re.Z)(r,t.RGBA16F,i.oT.FLOAT),(0,Re.Z)(r,t.R32F,i.oT.FLOAT),(0,Re.Z)(r,t.RG32F,i.oT.FLOAT),(0,Re.Z)(r,t.RGB32F,i.oT.FLOAT),(0,Re.Z)(r,t.RGBA32F,i.oT.FLOAT),(0,Re.Z)(r,t.R11F_G11F_B10F,i.oT.FLOAT),(0,Re.Z)(r,t.RGB9_E5,i.oT.FLOAT),(0,Re.Z)(r,t.R8I,i.oT.INT),(0,Re.Z)(r,t.R8UI,i.oT.UINT),(0,Re.Z)(r,t.R16I,i.oT.INT),(0,Re.Z)(r,t.R16UI,i.oT.UINT),(0,Re.Z)(r,t.R32I,i.oT.INT),(0,Re.Z)(r,t.R32UI,i.oT.UINT),(0,Re.Z)(r,t.RG8I,i.oT.INT),(0,Re.Z)(r,t.RG8UI,i.oT.UINT),(0,Re.Z)(r,t.RG16I,i.oT.INT),(0,Re.Z)(r,t.RG16UI,i.oT.UINT),(0,Re.Z)(r,t.RG32I,i.oT.INT),(0,Re.Z)(r,t.RG32UI,i.oT.UINT),(0,Re.Z)(r,t.RGB8I,i.oT.INT),(0,Re.Z)(r,t.RGB8UI,i.oT.UINT),(0,Re.Z)(r,t.RGB16I,i.oT.INT),(0,Re.Z)(r,t.RGB16UI,i.oT.UINT),(0,Re.Z)(r,t.RGB32I,i.oT.INT),(0,Re.Z)(r,t.RGB32UI,i.oT.UINT),(0,Re.Z)(r,t.RGBA8I,i.oT.INT),(0,Re.Z)(r,t.RGBA8UI,i.oT.UINT),(0,Re.Z)(r,t.RGBA16I,i.oT.INT),(0,Re.Z)(r,t.RGBA16UI,i.oT.UINT),(0,Re.Z)(r,t.RGBA32I,i.oT.INT),(0,Re.Z)(r,t.RGBA32UI,i.oT.UINT),(0,Re.Z)(r,t.DEPTH_COMPONENT16,i.oT.FLOAT),(0,Re.Z)(r,t.DEPTH_COMPONENT24,i.oT.FLOAT),(0,Re.Z)(r,t.DEPTH_COMPONENT32F,i.oT.FLOAT),(0,Re.Z)(r,t.DEPTH_STENCIL,i.oT.FLOAT),(0,Re.Z)(r,t.DEPTH24_STENCIL8,i.oT.FLOAT),(0,Re.Z)(r,t.DEPTH32F_STENCIL8,i.oT.FLOAT),e=r):(n={},(0,Re.Z)(n,t.RGB,i.oT.FLOAT),(0,Re.Z)(n,t.RGBA,i.oT.FLOAT),(0,Re.Z)(n,t.ALPHA,i.oT.FLOAT),(0,Re.Z)(n,t.LUMINANCE,i.oT.FLOAT),(0,Re.Z)(n,t.LUMINANCE_ALPHA,i.oT.FLOAT),(0,Re.Z)(n,t.DEPTH_STENCIL,i.oT.FLOAT),e=n),e}(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;if((null===(t=null===t||void 0===t?void 0:t.castToBaseTexture())||void 0===t?void 0:t.valid)&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var n=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(t.target,n.texture)),n.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),this.updateTexture(t)):n.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[e]=null}},{key:"reset",value:function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t=0;--a){var s=r[a];s&&s._glTextures[o].samplerType!==i.oT.FLOAT&&this.renderer.texture.unbind(s)}}},{key:"initTexture",value:function(t){var e=new ke(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}},{key:"initTextureType",value:function(t,e){var r,n,o;e.internalFormat=null!==(n=null===(r=this.internalFormats[t.type])||void 0===r?void 0:r[t.format])&&void 0!==n?n:t.format,e.samplerType=null!==(o=this.samplerTypes[e.internalFormat])&&void 0!==o?o:i.oT.FLOAT,2===this.webGLVersion&&t.type===i.vK.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}},{key:"updateTexture",value:function(t){var e,r=t._glTextures[this.CONTEXT_UID];if(r){var n=this.renderer;if(this.initTextureType(t,r),null===(e=t.resource)||void 0===e?void 0:e.upload(n,t,r))r.samplerType!==i.oT.FLOAT&&(this.hasIntegerTextures=!0);else{var o=t.realWidth,a=t.realHeight,s=n.gl;(r.width!==o||r.height!==a||r.dirtyId<0)&&(r.width=o,r.height=a,s.texImage2D(t.target,0,r.internalFormat,o,a,0,t.format,r.type,null))}t.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(t),r.dirtyId=t.dirtyId}}},{key:"destroyTexture",value:function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(t);-1!==n&&(0,a.removeItems)(this.managedTextures,n,1)}}},{key:"updateTextureStyle",value:function(t){var e,r=t._glTextures[this.CONTEXT_UID];r&&(t.mipmap!==i.WB.POW2&&2===this.webGLVersion||t.isPowerOfTwo?r.mipmap=t.mipmap>=1:r.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?r.wrapMode=t.wrapMode:r.wrapMode=i.Nt.CLAMP,(null===(e=t.resource)||void 0===e?void 0:e.style(this.renderer,t,r))||this.setStyle(t,r),r.dirtyStyleId=t.dirtyStyleId)}},{key:"setStyle",value:function(t,e){var r=this.gl;if(e.mipmap&&t.mipmap!==i.WB.ON_MANUAL&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===i.aH.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===i.aH.LINEAR){var o=Math.min(t.anisotropicLevel,r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===i.aH.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===i.aH.LINEAR?r.LINEAR:r.NEAREST)}},{key:"destroy",value:function(){this.renderer=null}}]),t}();Me.extension={type:m.n.RendererSystem,name:"texture"},m.R.add(Me);var Ce=function(){function t(e){(0,u.Z)(this,t),this.renderer=e}return(0,c.Z)(t,[{key:"contextChange",value:function(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}},{key:"bind",value:function(t){var e=this.gl,r=this.CONTEXT_UID,n=t._glTransformFeedbacks[r]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,n)}},{key:"unbind",value:function(){var t=this.gl;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}},{key:"beginTransformFeedback",value:function(t,e){var r=this.gl,n=this.renderer;e&&n.shader.bind(e),r.beginTransformFeedback(t)}},{key:"endTransformFeedback",value:function(){this.gl.endTransformFeedback()}},{key:"createGLTransformFeedback",value:function(t){var e=this,r=e.gl,n=e.renderer,i=e.CONTEXT_UID,o=r.createTransformFeedback();t._glTransformFeedbacks[i]=o,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,o);for(var a=0;a=i.G5.HIGH?this.multisample=i.G5.HIGH:e>=i.G5.MEDIUM?this.multisample=i.G5.MEDIUM:e>=i.G5.LOW?this.multisample=i.G5.LOW:this.multisample=i.G5.NONE}},{key:"destroy",value:function(){}}]),t}();De.extension={type:m.n.RendererSystem,name:"_multisample"},m.R.add(De);var Ue=function t(e){(0,u.Z)(this,t),this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},Fe=function(){function t(e){(0,u.Z)(this,t),this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return(0,c.Z)(t,[{key:"destroy",value:function(){this.renderer=null}},{key:"contextChange",value:function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}},{key:"bind",value:function(t){var e=this.gl,r=this.CONTEXT_UID,n=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,n.buffer)}},{key:"unbind",value:function(t){this.gl.bindBuffer(t,null)}},{key:"bindBufferBase",value:function(t,e){var r=this.gl,n=this.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var i=t._glBuffers[n]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,i.buffer)}}},{key:"bindBufferRange",value:function(t,e,r){var n=this.gl,i=this.CONTEXT_UID;r=r||0;var o=t._glBuffers[i]||this.createGLBuffer(t);n.bindBufferRange(n.UNIFORM_BUFFER,e||0,o.buffer,256*r,256)}},{key:"update",value:function(t){var e=this.gl,r=this.CONTEXT_UID,n=t._glBuffers[r]||this.createGLBuffer(t);if(t._updateID!==n.updateID)if(n.updateID=t._updateID,e.bindBuffer(t.type,n.buffer),n.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var i=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,i)}}},{key:"dispose",value:function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),r&&(e||n.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}}},{key:"disposeAll",value:function(t){for(var e=Object.keys(this.managedBuffers),r=0;r0&&void 0!==arguments[0]&&arguments[0];this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),(0,h.Z)((0,l.Z)(r.prototype),"destroy",this).call(this)}},{key:"plugins",get:function(){return this._plugin.plugins}},{key:"multisample",get:function(){return this._multisample.multisample}},{key:"width",get:function(){return this._view.element.width}},{key:"height",get:function(){return this._view.element.height}},{key:"resolution",get:function(){return this._view.resolution},set:function(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}},{key:"autoDensity",get:function(){return this._view.autoDensity}},{key:"view",get:function(){return this._view.element}},{key:"screen",get:function(){return this._view.screen}},{key:"lastObjectRendered",get:function(){return this.objectRenderer.lastObjectRendered}},{key:"renderingToScreen",get:function(){return this.objectRenderer.renderingToScreen}},{key:"rendererLogId",get:function(){return"WebGL ".concat(this.context.webGLVersion)}},{key:"clearBeforeRender",get:function(){return(0,a.deprecation)("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}},{key:"useContextAlpha",get:function(){return(0,a.deprecation)("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}},{key:"preserveDrawingBuffer",get:function(){return(0,a.deprecation)("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}},{key:"backgroundColor",get:function(){return(0,a.deprecation)("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color},set:function(t){(0,a.deprecation)("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}},{key:"backgroundAlpha",get:function(){return(0,a.deprecation)("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha},set:function(t){(0,a.deprecation)("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}},{key:"powerPreference",get:function(){return(0,a.deprecation)("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}},{key:"generateTexture",value:function(t,e){return this.textureGenerator.generateTexture(t,e)}}],[{key:"test",value:function(t){return!(null===t||void 0===t?void 0:t.forceCanvas)&&(0,a.isWebGLSupported)()}}]),r}(Ae);Ze.extension={type:m.n.Renderer,priority:1},Ze.__plugins={},Ze.__systems={};var He=Ze;m.R.handleByMap(m.n.RendererPlugin,He.__plugins),m.R.handleByMap(m.n.RendererSystem,He.__systems),m.R.add(He);var Ge=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(t,n){var i;(0,u.Z)(this,r);var o=n||{},a=o.width,s=o.height;(i=e.call(this,a,s)).items=[],i.itemDirtyIds=[];for(var c=0;c0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=i.sp.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}},{key:"upload",value:function(t,e,n){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var Qe=$e,tr=function(t){(0,f.Z)(r,t);var e=(0,p.Z)(r);function r(t,n){var i;if((0,u.Z)(this,r),n=n||{},!(0,g.Z)(t,HTMLVideoElement)){var o=document.createElement("video");!1!==n.autoLoad&&o.setAttribute("preload","auto"),!1!==n.playsinline&&(o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline","")),!0===n.muted&&(o.setAttribute("muted",""),o.muted=!0),!0===n.loop&&o.setAttribute("loop",""),!1!==n.autoPlay&&o.setAttribute("autoplay",""),"string"==typeof t&&(t=[t]);var a=t[0].src||t[0];wt.crossOrigin(o,a,n.crossorigin);for(var c=0;c2}},{key:"_onPlayStart",value:function(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}},{key:"_onPlayStop",value:function(){this._configureAutoUpdate()}},{key:"_onSeeked",value:function(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}},{key:"_onCanPlay",value:function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}},{key:"dispose",value:function(){this._configureAutoUpdate();var t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),(0,h.Z)((0,l.Z)(r.prototype),"dispose",this).call(this)}},{key:"autoUpdate",get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}},{key:"updateFPS",get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}},{key:"_configureAutoUpdate",value:function(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ie.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Ie.vB.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ie.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}}],[{key:"test",value:function(t,e){return globalThis.HTMLVideoElement&&(0,g.Z)(t,HTMLVideoElement)||r.TYPES.includes(e)}}]),r}(wt);tr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],tr.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};var er=tr;x.push(Je,xt,ze,er,Qe,T,Xe,Ve)},2631:function(t,e,r){"use strict";r.d(e,{YZ:function(){return l},W2:function(){return g},s$:function(){return f}});var n=r(5807),i=r(1438),o=r(2951),a=r(5785),s=r(2662),u=r(8029),c=r(1357),h=r(1418),l=function(){function t(){(0,i.Z)(this,t),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return(0,o.Z)(t,[{key:"isEmpty",value:function(){return this.minX>this.maxX||this.minY>this.maxY}},{key:"clear",value:function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}},{key:"getRectangle",value:function(t){return this.minX>this.maxX||this.minY>this.maxY?n.Ae.EMPTY:((t=t||new n.Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}},{key:"addPoint",value:function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}},{key:"addPointMatrix",value:function(t,e){var r=t.a,n=t.b,i=t.c,o=t.d,a=t.tx,s=t.ty,u=r*e.x+i*e.y+a,c=n*e.x+o*e.y+s;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}},{key:"addQuad",value:function(t){var e=this.minX,r=this.minY,n=this.maxX,i=this.maxY,o=t[0],a=t[1];e=on?o:n,i=a>i?a:i,e=(o=t[2])n?o:n,i=a>i?a:i,e=(o=t[4])n?o:n,i=a>i?a:i,e=(o=t[6])n?o:n,i=a>i?a:i,this.minX=e,this.minY=r,this.maxX=n,this.maxY=i}},{key:"addFrame",value:function(t,e,r,n,i){this.addFrameMatrix(t.worldTransform,e,r,n,i)}},{key:"addFrameMatrix",value:function(t,e,r,n,i){var o=t.a,a=t.b,s=t.c,u=t.d,c=t.tx,h=t.ty,l=this.minX,f=this.minY,d=this.maxX,p=this.maxY,v=o*e+s*r+c,m=a*e+u*r+h;l=vd?v:d,p=m>p?m:p,l=(v=o*n+s*r+c)d?v:d,p=m>p?m:p,l=(v=o*e+s*i+c)d?v:d,p=m>p?m:p,l=(v=o*n+s*i+c)d?v:d,p=m>p?m:p,this.minX=l,this.minY=f,this.maxX=d,this.maxY=p}},{key:"addVertexData",value:function(t,e,r){for(var n=this.minX,i=this.minY,o=this.maxX,a=this.maxY,s=e;so?u:o,a=c>a?c:a}this.minX=n,this.minY=i,this.maxX=o,this.maxY=a}},{key:"addVertices",value:function(t,e,r,n){this.addVerticesMatrix(t.worldTransform,e,r,n)}},{key:"addVerticesMatrix",value:function(t,e,r,n){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:i,a=t.a,s=t.b,u=t.c,c=t.d,h=t.tx,l=t.ty,f=this.minX,d=this.minY,p=this.maxX,v=this.maxY,m=r;mn?t.maxX:n,this.maxY=t.maxY>i?t.maxY:i}},{key:"addBoundsMask",value:function(t,e){var r=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,i=t.maxXu?i:u,this.maxY=o>c?o:c}}},{key:"addBoundsMatrix",value:function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}},{key:"addBoundsArea",value:function(t,e){var r=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,i=t.maxXu?i:u,this.maxY=o>c?o:c}}},{key:"pad",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}},{key:"addFramePad",value:function(t,e,r,n,i,o){t-=i,e-=o,r+=i,n+=o,this.minX=this.minXr?this.maxX:r,this.minY=this.minYn?this.maxY:n}}]),t}(),f=function(t){(0,u.Z)(r,t);var e=(0,h.Z)(r);function r(){var t;return(0,i.Z)(this,r),(t=e.call(this)).tempDisplayObjectParent=null,t.transform=new n.wx,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new l,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,(0,c.Z)(t)}return(0,o.Z)(r,[{key:"destroyed",get:function(){return this._destroyed}},{key:"_recursivePostUpdateTransform",value:function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}},{key:"updateTransform",value:function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}},{key:"getBounds",value:function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new n.Ae),e=this._boundsRect),this._bounds.getRectangle(e)}},{key:"getLocalBounds",value:function(t){t||(this._localBoundsRect||(this._localBoundsRect=new n.Ae),t=this._localBoundsRect),this._localBounds||(this._localBounds=new l);var e,r=this.transform,i=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=null!==(e=null===i||void 0===i?void 0:i.worldAlpha)&&void 0!==e?e:1,this.transform=this._tempDisplayObjectParent.transform;var o=this._bounds,a=this._boundsID;this._bounds=this._localBounds;var s=this.getBounds(!1,t);return this.parent=i,this.transform=r,this._bounds=o,this._bounds.updateID+=this._boundsID-a,s}},{key:"toGlobal",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}},{key:"toLocal",value:function(t,e,r,n){return e&&(t=e.toGlobal(t,r,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)}},{key:"setParent",value:function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}},{key:"removeFromParent",value:function(){var t;null===(t=this.parent)||void 0===t||t.removeChild(this)}},{key:"setTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0;return this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=n||1,this.rotation=i,this.skew.x=o,this.skew.y=a,this.pivot.x=s,this.pivot.y=u,this}},{key:"destroy",value:function(t){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}},{key:"_tempDisplayObjectParent",get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new d),this.tempDisplayObjectParent}},{key:"enableTempParent",value:function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t}},{key:"disableTempParent",value:function(t){this.parent=t}},{key:"x",get:function(){return this.position.x},set:function(t){this.transform.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){this.transform.position.y=t}},{key:"worldTransform",get:function(){return this.transform.worldTransform}},{key:"localTransform",get:function(){return this.transform.localTransform}},{key:"position",get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)}},{key:"scale",get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)}},{key:"pivot",get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)}},{key:"skew",get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)}},{key:"rotation",get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t}},{key:"angle",get:function(){return this.transform.rotation*n.jl},set:function(t){this.transform.rotation=t*n.ZX}},{key:"zIndex",get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)}},{key:"worldVisible",get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},{key:"mask",get:function(){return this._mask},set:function(t){if(this._mask!==t){if(this._mask){var e=this._mask.isMaskData?this._mask.maskObject:this._mask;e&&(e._maskRefCount--,0===e._maskRefCount&&(e.renderable=!0,e.isMask=!1))}if(this._mask=t,this._mask){var r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(0===r._maskRefCount&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),n=0;n1)for(var n=0;nthis.children.length)throw new Error("".concat(t,"addChildAt: The index ").concat(e," supplied is out of bounds ").concat(this.children.length));return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}},{key:"swapChildren",value:function(t,e){if(t!==e){var r=this.getChildIndex(t),n=this.getChildIndex(e);this.children[r]=e,this.children[n]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index ".concat(e," supplied is out of bounds ").concat(this.children.length));var r=this.getChildIndex(t);n.P6.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)}},{key:"getChildAt",value:function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index (".concat(t,") does not exist."));return this.children[t]}},{key:"removeChild",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r1)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.children.length,n=e,i=r,o=i-n;if(o>0&&o<=i){t=this.children.splice(n,o);for(var a=0;a1&&this.children.sort(v),this.sortDirty=!1}},{key:"updateTransform",value:function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t1&&void 0!==arguments[1]&&arguments[1],n=(0,a.Z)((0,s.Z)(r.prototype),"getLocalBounds",this).call(this,t);if(!e)for(var i=0,o=this.children.length;i0&&e.height>0){var n,i;this.cullArea?(n=this.cullArea,i=this.worldTransform):this._render!==r.prototype._render&&(n=this.getBounds(!0));var o=t.projection.transform;if(o&&(i?(i=p.copyFrom(i)).prepend(o):i=o),n&&e.intersects(n,i))this._render(t);else if(this.cullArea)return;for(var a=0,s=this.children.length;a2&&void 0!==arguments[2]?arguments[2]:-1;return this.handle(t,(function(t){e.includes(t.ref)||(e.push(t.ref),e.sort((function(t,e){return u(e,r)-u(t,r)})))}),(function(t){var r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)}))}}},1330:function(t,e,r){"use strict";r.d(e,{Cd:function(){return f},ZX:function(){return s},Pj:function(){return d},y3:function(){return m},AB:function(){return S},_b:function(){return o},E9:function(){return c},mg:function(){return p},jl:function(){return a},Ae:function(){return l},c9:function(){return v},HS:function(){return u},wx:function(){return k},Lv:function(){return A}});var n=r(1438),i=r(2951),o=2*Math.PI,a=180/Math.PI,s=Math.PI/180,u=function(t){return t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t}(u||{}),c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,n.Z)(this,t),this.x=0,this.y=0,this.x=e,this.y=r}return(0,i.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.set(t.x,t.y),this}},{key:"copyTo",value:function(t){return t.set(this.x,this.y),t}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.x=t,this.y=e,this}}]),t}();c.prototype.toString=function(){return"[@pixi/math:Point x=".concat(this.x," y=").concat(this.y,"]")};var h=[new c,new c,new c,new c],l=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;(0,n.Z)(this,t),this.x=Number(e),this.y=Number(r),this.width=Number(i),this.height=Number(o),this.type=u.RECT}return(0,i.Z)(t,[{key:"left",get:function(){return this.x}},{key:"right",get:function(){return this.x+this.width}},{key:"top",get:function(){return this.y}},{key:"bottom",get:function(){return this.y+this.height}},{key:"clone",value:function(){return new t(this.x,this.y,this.width,this.height)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}},{key:"copyTo",value:function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}},{key:"contains",value:function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&et.right?t.right:this.right)<=r)return!1;var n=this.yt.bottom?t.bottom:this.bottom)>n}var i=this.left,o=this.right,a=this.top,s=this.bottom;if(o<=i||s<=a)return!1;var u=h[0].set(t.left,t.top),c=h[1].set(t.left,t.bottom),l=h[2].set(t.right,t.top),f=h[3].set(t.right,t.bottom);if(l.x<=u.x||c.y<=u.y)return!1;var d=Math.sign(e.a*e.d-e.b*e.c);if(0===d||(e.apply(u,u),e.apply(c,c),e.apply(l,l),e.apply(f,f),Math.max(u.x,c.x,l.x,f.x)<=i||Math.min(u.x,c.x,l.x,f.x)>=o||Math.max(u.y,c.y,l.y,f.y)<=a||Math.min(u.y,c.y,l.y,f.y)>=s))return!1;var p=d*(c.y-u.y),v=d*(u.x-c.x),m=p*i+v*a,g=p*o+v*a,y=p*i+v*s,b=p*o+v*s;if(Math.max(m,g,y,b)<=p*u.x+v*u.y||Math.min(m,g,y,b)>=p*f.x+v*f.y)return!1;var _=d*(u.y-l.y),w=d*(l.x-u.x),x=_*i+w*a,E=_*o+w*a,A=_*i+w*s,S=_*o+w*s;return!(Math.max(x,E,A,S)<=_*u.x+w*u.y||Math.min(x,E,A,S)>=_*f.x+w*f.y)}},{key:"pad",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}},{key:"fit",value:function(t){var e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),i=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=n,this.height=Math.max(i-n,0),this}},{key:"ceil",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.001,r=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=n-this.y,this}},{key:"enlarge",value:function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),i=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=n,this.height=i-n,this}}],[{key:"EMPTY",get:function(){return new t(0,0,0,0)}}]),t}();l.prototype.toString=function(){return"[@pixi/math:Rectangle x=".concat(this.x," y=").concat(this.y," width=").concat(this.width," height=").concat(this.height,"]")};var f=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(0,n.Z)(this,t),this.x=e,this.y=r,this.radius=i,this.type=u.CIRC}return(0,i.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y,this.radius)}},{key:"contains",value:function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,n=this.x-t,i=this.y-e;return(n*=n)+(i*=i)<=r}},{key:"getBounds",value:function(){return new l(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}}]),t}();f.prototype.toString=function(){return"[@pixi/math:Circle x=".concat(this.x," y=").concat(this.y," radius=").concat(this.radius,"]")};var d=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;(0,n.Z)(this,t),this.x=e,this.y=r,this.width=i,this.height=o,this.type=u.ELIP}return(0,i.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y,this.width,this.height)}},{key:"contains",value:function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,n=(e-this.y)/this.height;return(r*=r)+(n*=n)<=1}},{key:"getBounds",value:function(){return new l(this.x-this.width,this.y-this.height,this.width,this.height)}}]),t}();d.prototype.toString=function(){return"[@pixi/math:Ellipse x=".concat(this.x," y=").concat(this.y," width=").concat(this.width," height=").concat(this.height,"]")};var p=function(){function t(){for(var e=arguments.length,r=new Array(e),i=0;ie!=c>e&&t<(e-s)/(c-s)*(u-a)+a&&(r=!r)}return r}}]),t}();p.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke=".concat(this.closeStroke,"points=").concat(this.points.reduce((function(t,e){return"".concat(t,", ").concat(e)}),""),"]")};var v=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:20;(0,n.Z)(this,t),this.x=e,this.y=r,this.width=i,this.height=o,this.radius=a,this.type=u.RREC}return(0,i.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y,this.width,this.height,this.radius)}},{key:"contains",value:function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;var n=t-(this.x+r),i=e-(this.y+r),o=r*r;if(n*n+i*i<=o||(n=t-(this.x+this.width-r))*n+i*i<=o||n*n+(i=e-(this.y+this.height-r))*i<=o||(n=t-(this.x+r))*n+i*i<=o)return!0}return!1}}]),t}();v.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x=".concat(this.x," y=").concat(this.y,"width=").concat(this.width," height=").concat(this.height," radius=").concat(this.radius,"]")};var m=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(0,n.Z)(this,t),this.array=null,this.a=e,this.b=r,this.c=i,this.d=o,this.tx=a,this.ty=s}return(0,i.Z)(t,[{key:"fromArray",value:function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}},{key:"set",value:function(t,e,r,n,i,o){return this.a=t,this.b=e,this.c=r,this.d=n,this.tx=i,this.ty=o,this}},{key:"toArray",value:function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}},{key:"apply",value:function(t,e){e=e||new c;var r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e}},{key:"applyInverse",value:function(t,e){e=e||new c;var r=1/(this.a*this.d+this.c*-this.b),n=t.x,i=t.y;return e.x=this.d*r*n+-this.c*r*i+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*i+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,e}},{key:"translate",value:function(t,e){return this.tx+=t,this.ty+=e,this}},{key:"scale",value:function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}},{key:"rotate",value:function(t){var e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,o=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this}},{key:"append",value:function(t){var e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this}},{key:"setTransform",value:function(t,e,r,n,i,o,a,s,u){return this.a=Math.cos(a+u)*i,this.b=Math.sin(a+u)*i,this.c=-Math.sin(a-s)*o,this.d=Math.cos(a-s)*o,this.tx=t-(r*this.a+n*this.c),this.ty=e-(r*this.b+n*this.d),this}},{key:"prepend",value:function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,n=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}},{key:"decompose",value:function(t){var e=this.a,r=this.b,n=this.c,i=this.d,a=t.pivot,s=-Math.atan2(-n,i),u=Math.atan2(r,e),c=Math.abs(s+u);return c<1e-5||Math.abs(o-c)<1e-5?(t.rotation=u,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=u),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(n*n+i*i),t.position.x=this.tx+(a.x*e+a.y*n),t.position.y=this.ty+(a.x*r+a.y*i),t}},{key:"invert",value:function(){var t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,o=t*n-e*r;return this.a=n/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(t*this.ty-e*i)/o,this}},{key:"identity",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}},{key:"clone",value:function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}},{key:"copyTo",value:function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}},{key:"copyFrom",value:function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}}],[{key:"IDENTITY",get:function(){return new t}},{key:"TEMP_MATRIX",get:function(){return new t}}]),t}();m.prototype.toString=function(){return"[@pixi/math:Matrix a=".concat(this.a," b=").concat(this.b," c=").concat(this.c," d=").concat(this.d," tx=").concat(this.tx," ty=").concat(this.ty,"]")};var g=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],y=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],b=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],_=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],w=[],x=[],E=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];w.push(e);for(var r=0;r<16;r++)for(var n=E(g[t]*g[r]+b[t]*y[r]),i=E(y[t]*g[r]+_[t]*y[r]),o=E(g[t]*b[r]+b[t]*_[r]),a=E(y[t]*b[r]+_[t]*_[r]),s=0;s<16;s++)if(g[s]===n&&y[s]===i&&b[s]===o&&_[s]===a){e.push(s);break}}for(var u=0;u<16;u++){var c=new m;c.set(g[u],y[u],b[u],_[u],0,0),x.push(c)}}();var A={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return g[t]},uY:function(t){return y[t]},vX:function(t){return b[t]},vY:function(t){return _[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return w[t][e]},sub:function(t,e){return w[t][A.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2===(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?A.S:A.N:2*Math.abs(e)<=Math.abs(t)?t>0?A.E:A.W:e>0?t>0?A.SE:A.SW:t>0?A.NE:A.NW},matrixAppendRotationInv:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=x[A.inv(e)];i.tx=r,i.ty=n,t.append(i)}},S=function(){function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;(0,n.Z)(this,t),this._x=i,this._y=o,this.cb=e,this.scope=r}return(0,i.Z)(t,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.cb,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scope;return new t(e,r,this._x,this._y)}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}},{key:"copyFrom",value:function(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}},{key:"copyTo",value:function(t){return t.set(this._x,this._y),t}},{key:"equals",value:function(t){return t.x===this._x&&t.y===this._y}},{key:"x",get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}},{key:"y",get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}]),t}();S.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=".concat(this.x," y=").concat(this.y," scope=").concat(this.scope,"]")};var T=function(){function t(){(0,n.Z)(this,t),this.worldTransform=new m,this.localTransform=new m,this.position=new S(this.onChange,this,0,0),this.scale=new S(this.onChange,this,1,1),this.pivot=new S(this.onChange,this,0,0),this.skew=new S(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return(0,i.Z)(t,[{key:"onChange",value:function(){this._localID++}},{key:"updateSkew",value:function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}},{key:"updateLocalTransform",value:function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}},{key:"updateTransform",value:function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,n=this.worldTransform;n.a=e.a*r.a+e.b*r.c,n.b=e.a*r.b+e.b*r.d,n.c=e.c*r.a+e.d*r.c,n.d=e.c*r.b+e.d*r.d,n.tx=e.tx*r.a+e.ty*r.c+r.tx,n.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}},{key:"setFromMatrix",value:function(t){t.decompose(this),this._localID++}},{key:"rotation",get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}}]),t}();T.IDENTITY=new T;var k=T;k.prototype.toString=function(){return"[@pixi/math:Transform position=(".concat(this.position.x,", ").concat(this.position.y,") rotation=").concat(this.rotation," scale=(").concat(this.scale.x,", ").concat(this.scale.y,") skew=(").concat(this.skew.x,", ").concat(this.skew.y,") ]")}},5110:function(t,e,r){"use strict";var n;r.d(e,{tq:function(){return E},Xd:function(){return o}});var i,o={ADAPTER:{createCanvas:function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:function(){return CanvasRenderingContext2D},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){return null!==(n=document.baseURI)&&void 0!==n?n:window.location.href},getFontFaceSet:function(){return document.fonts},fetch:function(t,e){return fetch(t,e)},parseXML:function(t){return(new DOMParser).parseFromString(t,"text/xml")}},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},a=/iPhone/i,s=/iPod/i,u=/iPad/i,c=/\biOS-universal(?:.+)Mac\b/i,h=/\bAndroid(?:.+)Mobile\b/i,l=/Android/i,f=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,d=/Silk/i,p=/Windows Phone/i,v=/\bWindows(?:.+)ARM\b/i,m=/BlackBerry/i,g=/BB10/i,y=/Opera Mini/i,b=/\b(CriOS|Chrome)(?:.+)Mobile/i,_=/Mobile(?:.+)Firefox\b/i,w=function(t){return"undefined"!==typeof t&&"MacIntel"===t.platform&&"number"===typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"===typeof MSStream};function x(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"===typeof navigator?"string"===typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,n=r.split("[FBAN");"undefined"!==typeof n[1]&&(r=n[0]),"undefined"!==typeof(n=r.split("Twitter"))[1]&&(r=n[0]);var i=function(t){return function(e){return e.test(t)}}(r),o={apple:{phone:i(a)&&!i(p),ipod:i(s),tablet:!i(a)&&(i(u)||w(e))&&!i(p),universal:i(c),device:(i(a)||i(s)||i(u)||i(c)||w(e))&&!i(p)},amazon:{phone:i(f),tablet:!i(f)&&i(d),device:i(f)||i(d)},android:{phone:!i(p)&&i(f)||!i(p)&&i(h),tablet:!i(p)&&!i(f)&&!i(h)&&(i(d)||i(l)),device:!i(p)&&(i(f)||i(d)||i(h)||i(l))||i(/\bokhttp\b/i)},windows:{phone:i(p),tablet:i(v),device:i(p)||i(v)},other:{blackberry:i(m),blackberry10:i(g),opera:i(y),firefox:i(_),chrome:i(b),device:i(m)||i(g)||i(y)||i(_)||i(b)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}var E=(null!==(i=x.default)&&void 0!==i?i:x)(globalThis.navigator)},1230:function(t,e,r){"use strict";r.d(e,{j:function(){return m}});var n=r(4111),i=r(1438),o=r(2951),a=r(5785),s=r(2662),u=r(8029),c=r(2670),h=r(1357),l=r(1418),f=r(5807),d=r(2631),p=new f.E9,v=new Uint16Array([0,1,2,0,2,3]),m=function(t){(0,u.Z)(r,t);var e=(0,l.Z)(r);function r(t){var o;return(0,i.Z)(this,r),(o=e.call(this))._anchor=new f.AB(o._onAnchorUpdate,(0,n.Z)(o),t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),o._texture=null,o._width=0,o._height=0,o._tintColor=new f.Il(16777215),o._tintRGB=null,o.tint=16777215,o.blendMode=f.T$.NORMAL,o._cachedTint=16777215,o.uvs=null,o.texture=t||f.xE.EMPTY,o.vertexData=new Float32Array(8),o.vertexTrimmedData=null,o._transformID=-1,o._textureID=-1,o._transformTrimmedID=-1,o._textureTrimmedID=-1,o.indices=v,o.pluginName="batch",o.isSprite=!0,o._roundPixels=f.Xd.ROUND_PIXELS,(0,h.Z)(o)}return(0,o.Z)(r,[{key:"_onTextureUpdate",value:function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=f.P6.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=f.P6.sign(this.scale.y)*this._height/this._texture.orig.height)}},{key:"_onAnchorUpdate",value:function(){this._transformID=-1,this._transformTrimmedID=-1}},{key:"calculateVertices",value:function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,r=e.a,n=e.b,i=e.c,o=e.d,a=e.tx,s=e.ty,u=this.vertexData,c=t.trim,h=t.orig,l=this._anchor,d=0,p=0,v=0,m=0;if(c?(d=(p=c.x-l._x*h.width)+c.width,v=(m=c.y-l._y*h.height)+c.height):(d=(p=-l._x*h.width)+h.width,v=(m=-l._y*h.height)+h.height),u[0]=r*p+i*m+a,u[1]=o*m+n*p+s,u[2]=r*d+i*m+a,u[3]=o*m+n*d+s,u[4]=r*d+i*v+a,u[5]=o*v+n*d+s,u[6]=r*p+i*v+a,u[7]=o*v+n*p+s,this._roundPixels)for(var g=f.Xd.RESOLUTION,y=0;y=n&&p.x=i&&p.y1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,o.Z)(this,t),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=r,this.priority=n,this.once=i}return(0,a.Z)(t,[{key:"match",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.fn===t&&this.context===e}},{key:"emit",value:function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}},{key:"connect",value:function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}},{key:"destroy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e}}]),t}(),c=function(){function t(){var e=this;(0,o.Z)(this,t),this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new u(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&null===e._requestId&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return(0,a.Z)(t,[{key:"_requestIfNeeded",value:function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}},{key:"_cancelIfNeeded",value:function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}},{key:"_startIfPossible",value:function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}},{key:"add",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.NORMAL;return this._addListener(new u(t,e,r))}},{key:"addOnce",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.NORMAL;return this._addListener(new u(t,e,r,!0))}},{key:"_addListener",value:function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this}},{key:"remove",value:function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}},{key:"count",get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t}},{key:"start",value:function(){this.started||(this.started=!0,this._requestIfNeeded())}},{key:"stop",value:function(){this.started&&(this.started=!1,this._cancelIfNeeded())}},{key:"destroy",value:function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}},{key:"update",value:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:performance.now();if(r>this.lastTime){if((e=this.elapsedMS=r-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var n=r-this._lastFrame|0;if(n2&&void 0!==arguments[2]?arguments[2]:3;if(!h[e]){var n=(new Error).stack;("undefined"===typeof n?"undefined":(0,c.Z)(n))>"u"?console.warn("PixiJS Deprecation Warning: ","".concat(e,"\nDeprecated since v").concat(t)):(n=n.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6","".concat(e,"\nDeprecated since v").concat(t)),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ","".concat(e,"\nDeprecated since v").concat(t)),console.warn(n))),h[e]=!0}}var f={get parse(){return l("7.3.0","utils.url.parse is deprecated, use native URL API instead."),u.parse},get format(){return l("7.3.0","utils.url.format is deprecated, use native URL API instead."),u.format},get resolve(){return l("7.3.0","utils.url.resolve is deprecated, use native URL API instead."),u.resolve}};function d(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received ".concat(JSON.stringify(t)))}function p(t){return t.split("?")[0].split("#")[0]}var v,m,g={toPosix:function(t){return e="\\",r="/",t.replace(new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),r);var e,r},isUrl:function(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:function(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},isBlobUrl:function(t){return t.startsWith("blob:")},hasProtocol:function(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol:function(t){d(t),t=this.toPosix(t);var e=/^file:\/\/\//.exec(t);if(e)return e[0];var r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute:function(t,e,r){if(d(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;var i=p(this.toPosix(null!==e&&void 0!==e?e:n.Xd.ADAPTER.getBaseUrl())),o=p(this.toPosix(null!==r&&void 0!==r?r:this.rootname(i)));return(t=this.toPosix(t)).startsWith("/")?g.join(o,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize:function(t){if(d(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;var e="",r=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));var n=t.endsWith("/");return(t=function(t,e){for(var r="",n=0,i=-1,o=0,a=-1,s=0;s<=t.length;++s){if(s2){var u=r.lastIndexOf("/");if(u!==r.length-1){-1===u?(r="",n=0):n=(r=r.slice(0,u)).length-1-r.lastIndexOf("/"),i=s,o=0;continue}}else if(2===r.length||1===r.length){r="",n=0,i=s,o=0;continue}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/".concat(t.slice(i+1,s)):r=t.slice(i+1,s),n=s-i-1;i=s,o=0}else 46===a&&-1!==o?++o:o=-1}return r}(t,!1)).length>0&&n&&(t+="/"),r?"/".concat(t):e+t},isAbsolute:function(t){return d(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join:function(){for(var t=arguments.length,e=new Array(t),r=0;r0)if(void 0===n)n=o;else{var a,s=null!==(a=e[i-1])&&void 0!==a?a:"";this.extname(s)?n+="/../".concat(o):n+="/".concat(o)}}return void 0===n?".":this.normalize(n)},dirname:function(t){if(d(t),0===t.length)return".";for(var e=(t=this.toPosix(t)).charCodeAt(0),r=47===e,n=-1,i=!0,o=this.getProtocol(t),a=t,s=(t=t.slice(o.length)).length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!i){n=s;break}}else i=!1;return-1===n?r?"/":this.isUrl(a)?o+t:o:r&&1===n?"//":o+t.slice(0,n)},rootname:function(t){d(t);var e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){var r=t.indexOf("/",e.length);(e=-1!==r?t.slice(0,r):t).endsWith("/")||(e+="/")}return e},basename:function(t,e){d(t),e&&d(e),t=p(this.toPosix(t));var r,n=0,i=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,s=-1;for(r=t.length-1;r>=0;--r){var u=t.charCodeAt(r);if(47===u){if(!o){n=r+1;break}}else-1===s&&(o=!1,s=r+1),a>=0&&(u===e.charCodeAt(a)?-1===--a&&(i=r):(a=-1,i=s))}return n===i?i=s:-1===i&&(i=t.length),t.slice(n,i)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!o){n=r+1;break}}else-1===i&&(o=!1,i=r+1);return-1===i?"":t.slice(n,i)},extname:function(t){d(t);for(var e=-1,r=0,n=-1,i=!0,o=0,a=(t=p(this.toPosix(t))).length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){r=a+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)},parse:function(t){d(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,n=(t=p(this.toPosix(t))).charCodeAt(0),i=this.isAbsolute(t);e.root=this.rootname(t),r=i||this.hasProtocol(t)?1:0;for(var o=-1,a=0,s=-1,u=!0,c=t.length-1,h=0;c>=r;--c)if(47!==(n=t.charCodeAt(c)))-1===s&&(u=!1,s=c+1),46===n?-1===o?o=c:1!==h&&(h=1):-1!==o&&(h=-1);else if(!u){a=c+1;break}return-1===o||-1===s||0===h||1===h&&o===s-1&&o===a+1?-1!==s&&(e.base=e.name=0===a&&i?t.slice(1,s):t.slice(a,s)):(0===a&&i?(e.name=t.slice(1,o),e.base=t.slice(1,s)):(e.name=t.slice(a,o),e.base=t.slice(a,s)),e.ext=t.slice(o,s)),e.dir=this.dirname(t),e},sep:"/",delimiter:":"},y=r(7568),b=r(4051),_=r.n(b),w=r(1296);function x(){return E.apply(this,arguments)}function E(){return(E=(0,y.Z)(_().mark((function t(){return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(null!==v&&void 0!==v||(v=(0,y.Z)(_().mark((function t(){var e,r,n,i,o,a;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=document.createElement("canvas").getContext("webgl")){t.next=4;break}return t.abrupt("return",w.iw.UNPACK);case 4:return t.next=6,new Promise((function(t){var e=document.createElement("video");e.onloadeddata=function(){return t(e)},e.onerror=function(){return t(null)},e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()}));case 6:if(n=t.sent){t.next=9;break}return t.abrupt("return",w.iw.UNPACK);case 9:return i=r.createTexture(),r.bindTexture(r.TEXTURE_2D,i),o=r.createFramebuffer(),r.bindFramebuffer(r.FRAMEBUFFER,o),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),a=new Uint8Array(4),t.abrupt("return",(r.readPixels(0,0,1,1,r.RGBA,r.UNSIGNED_BYTE,a),r.deleteFramebuffer(o),r.deleteTexture(i),null===(e=r.getExtension("WEBGL_lose_context"))||void 0===e||e.loseContext(),a[0]<=a[3]?w.iw.PMA:w.iw.UNPACK));case 15:case"end":return t.stop()}}),t)})))()),v));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function A(){l("7.0.0","skipHello is deprecated, please use settings.RENDER_OPTIONS.hello")}function S(){l("7.0.0",'sayHello is deprecated, please use Renderer\'s "hello" option')}function T(){return("undefined"===typeof m?"undefined":(0,c.Z)(m))>"u"&&(m=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:n.Xd.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{var e;if(!n.Xd.ADAPTER.getWebGLRenderingContext())return!1;var r=n.Xd.ADAPTER.createCanvas(),i=r.getContext("webgl",t)||r.getContext("experimental-webgl",t),o=!!(null===(e=null===i||void 0===i?void 0:i.getContextAttributes())||void 0===e?void 0:e.stencil);if(i){var a=i.getExtension("WEBGL_lose_context");a&&a.loseContext()}return i=null,o}catch(s){return!1}}()),m}var k=r(8260);function R(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return l("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),k.I.shared.setValue(t).toRgbArray(e)}function M(t){return l("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),k.I.shared.setValue(t).toHex()}function C(t){return l("7.2.0","utils.string2hex is deprecated, use Color#toNumber instead"),k.I.shared.setValue(t).toNumber()}function P(t){return l("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),k.I.shared.setValue(t).toNumber()}var I=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[w.T$.NORMAL_NPM]=w.T$.NORMAL,t[w.T$.ADD_NPM]=w.T$.ADD,t[w.T$.SCREEN_NPM]=w.T$.SCREEN,e[w.T$.NORMAL]=w.T$.NORMAL_NPM,e[w.T$.ADD]=w.T$.ADD_NPM,e[w.T$.SCREEN]=w.T$.SCREEN_NPM;var n=[];return n.push(e),n.push(t),n}();function O(t,e){return I[e?1:0][t]}function B(t,e,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return l("7.2.0","utils.premultiplyRgba has moved to Color.premultiply"),k.I.shared.setValue(t).premultiply(e,n).toArray(null!==r&&void 0!==r?r:new Float32Array(4))}function N(t,e){return l("7.2.0","utils.premultiplyTint has moved to Color.toPremultiplied"),k.I.shared.setValue(t).toPremultiplied(e)}function L(t,e,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return l("7.2.0","utils.premultiplyTintToRgba has moved to Color.premultiply"),k.I.shared.setValue(t).premultiply(e,n).toArray(null!==r&&void 0!==r?r:new Float32Array(4))}var D=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function U(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got ".concat(e.length," and expected ").concat(r));for(var n=0,i=0;n>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function V(t){return!(t&t-1)&&!!t}function z(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}function W(t,e,r){var n,i=t.length;if(!(e>=i||0===r)){var o=i-(r=e+r>i?i-e:r);for(n=e;n1&&void 0!==arguments[1]?arguments[1]:globalThis.location;if(t.startsWith("data:"))return"";e=e||globalThis.location;var r=new URL(t,document.baseURI);return r.hostname!==e.hostname||r.port!==e.port||r.protocol!==e.protocol?"anonymous":""}function ft(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=null===(e=n.Xd.RETINA_PREFIX)||void 0===e?void 0:e.exec(t);return i?parseFloat(i[1]):r}},1876:function(t){!function(){var e={449:function(t,e){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),a=o[0],s=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),h=0,l=s>0?a-4:a;for(r=0;r>16&255,c[h++]=e>>8&255,c[h++]=255&e;2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[h++]=255&e);1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[h++]=e>>8&255,c[h++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,u=n-i;su?u:s+a));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function h(t,e,r){for(var n,i=[],o=e;oa)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"===typeof t){if("string"===typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return c(t,e,r)}function c(t,e,r){if("string"===typeof t)return function(t,e){"string"===typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|v(t,e),n=s(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return f(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!==typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);var i=function(t){if(u.isBuffer(t)){var e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!==typeof t.length||G(t.length)?s(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!==typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return h(t),s(t<0?0:0|p(t))}function f(t){for(var e=t.length<0?0:0|p(t.length),r=s(e),n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function v(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!==typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(i)return n?-1:F(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),G(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"===typeof e)return e&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var h=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var l=!0,f=0;fi&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(h=c);break;case 2:128===(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(h=u)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return R(n)}e.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?s(t):void 0!==e?"string"===typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},u.allocUnsafe=function(t){return l(t)},u.allocUnsafeSlow=function(t){return l(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);ir&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(n,i),h=t.slice(e,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return x(this,t,e,r);case"latin1":case"binary":return E(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function N(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},u.prototype.fill=function(t,e,r,n){if("string"===typeof t){if("string"===typeof e?(n=e,e=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"===typeof t?t&=255:"boolean"===typeof t&&(t=Number(t));if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function j(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function Z(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function G(t){return t!==t}var V=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},543:function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,h=-7,l=r?i-1:0,f=r?-1:1,d=t[e+l];for(l+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+t[e+l],l+=f,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+l],l+=f,h-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,h=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+l>=1?f/u:f*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,c-=8);t[r+d-p]|=128*v}}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var o=r[t]={exports:{}},a=!0;try{e[t](o,o.exports,n),a=!1}finally{a&&delete r[t]}return o.exports}n.ab="//";var i=n(877);t.exports=i}()},2474:function(t,e,r){var n=r(1876).Buffer,i=r(3454);!function(){var e={8996:function(t,e,r){var n=e;n.bignum=r(4563),n.define=r(8620).define,n.base=r(5945),n.constants=r(4554),n.decoders=r(1579),n.encoders=r(8649)},8620:function(t,e,r){var n=r(8996),i=r(1140);function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){var e;try{e=r(6144).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){e=function(t){this._initNamed(t)}}return i(e,t),e.prototype._initNamed=function(e){t.call(this,e)},new e(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n.decoders[t])),this.decoders[t]},o.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n.encoders[t])),this.encoders[t]},o.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},8965:function(t,e,r){var n=r(1140),i=r(5945).Reporter,o=r(4300).Buffer;function a(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function s(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return t instanceof s||(t=new s(t,e)),this.length+=t.length,t}),this);else if("number"===typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"===typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(a,i),e.C=a,a.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},a.prototype.restore=function(t){var e=new a(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},a.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},a.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=s,s.prototype.join=function(t,e){return t||(t=new o(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"===typeof this.value?t[e]=this.value:"string"===typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},5945:function(t,e,r){var n=e;n.Reporter=r(6441).b,n.DecoderBuffer=r(8965).C,n.EncoderBuffer=r(8965).R,n.Node=r(4e3)},4e3:function(t,e,r){var n=r(5945).Reporter,i=r(5945).EncoderBuffer,o=r(5945).DecoderBuffer,a=r(7985),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function c(t,e){var r={};this._baseState=r,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=c;var h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var t=this._baseState,e={};h.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},c.prototype._wrap=function(){var t=this._baseState;u.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},c.prototype._init=function(t){var e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),a.equal(e.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(a(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!==typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){c.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),s.forEach((function(t){c.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(r),this}})),c.prototype.use=function(t){a(t);var e=this._baseState;return a(null===e.use),e.use=t,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(t){var e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},c.prototype.explicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},c.prototype.implicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},c.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},c.prototype.key=function(t){var e=this._baseState;return a(null===e.key),e.key=t,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(t){var e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},c.prototype.contains=function(t){var e=this._baseState;return a(null===e.use),e.contains=t,this},c.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var n,i=r.default,a=!0,s=null;if(null!==r.key&&(s=t.enterKey(r.key)),r.optional){var u=null;if(null!==r.explicit?u=r.explicit:null!==r.implicit?u=r.implicit:null!==r.tag&&(u=r.tag),null!==u||r.any){if(a=this._peekTag(t,u,r.any),t.isError(a))return a}else{var c=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),a=!0}catch(t){a=!1}t.restore(c)}}if(r.obj&&a&&(n=t.enterObject()),a){if(null!==r.explicit){var h=this._decodeTag(t,r.explicit);if(t.isError(h))return h;t=h}var l=t.offset;if(null===r.use&&null===r.choice){if(r.any)c=t.save();var f=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(f))return f;r.any?i=t.raw(c):t=f}if(e&&e.track&&null!==r.tag&&e.track(t.path(),l,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var d=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(d,e)}}return r.obj&&a&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==a?null!==s&&t.exitKey(s):t.leaveKey(s,r.key,i),i},c.prototype._decodeGeneric=function(t,e,r){var n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},c.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(t,e){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some((function(o){var a=t.save(),s=r.choice[o];try{var u=s._decode(t,e);if(t.isError(u))return!1;n={type:o,value:u},i=!0}catch(e){return t.restore(a),!1}return!0}),this),i?n:t.error("Choice not matched")},c.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},c.prototype._encode=function(t,e,r){var n=this._baseState;if(null===n.default||n.default!==t){var i=this._encodeValue(t,e,r);if(void 0!==i&&!this._skipDefault(i,e,r))return i}},c.prototype._encodeValue=function(t,e,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);var o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}var a=null,s=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)a=this._getUse(i.contains,r)._encode(t,e),s=!0;else if(i.children)a=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var n=e.enterKey(r._baseState.key);if("object"!==typeof t)return e.error("Child expected, but input is not object");var i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i}),this).filter((function(t){return t})),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(t.map((function(r){var n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),u))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(a=this._encodePrimitive(i.tag,t),s=!0);if(!i.any&&null===i.choice){var c=null!==i.implicit?i.implicit:i.tag,h=null===i.implicit?"universal":"context";null===c?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(c,s,h,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(t,e){var r=this._baseState,n=r.choice[t.type];return n||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},c.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},c.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},c.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},6441:function(t,e,r){var n=r(1140);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.b=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){var n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){var e,r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},6205:function(t,e,r){var n=r(4554);e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=n._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=n._reverse(e.tag)},4554:function(t,e,r){var n=e;n._reverse=function(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r})),e},n.der=r(6205)},5030:function(t,e,r){var n=r(1140),i=r(8996),o=i.base,a=i.bignum,s=i.constants.der;function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new c,this.tree._init(t.body)}function c(t){o.Node.call(this,"der",t)}function h(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var n=s.tagClass[r>>6],i=0===(32&r);if(31===(31&r)){var o=r;for(r=0;128===(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0===(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=s.tagClassByName[r||"universal"]<<6)}t.exports=u,u.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(c,a.Node),c.prototype._encodeComposite=function(t,e,r,n){var o,a=l(t,e,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var s=1,u=n.length;u>=256;u>>=8)s++;(o=new i(2+s))[0]=a,o[1]=128|s;u=1+s;for(var c=n.length;c>0;u--,c>>=8)o[u]=255&c;return this._createEncoderBuffer([o,n])},c.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new i(2*t.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(n=t.length-1;n>=0;n--){a=t[n];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[h(n.getFullYear()),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[h(n.getFullYear()%100),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(t,e){if("string"===typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!==typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=new i(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);n=1;for(var a=t;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},c.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},c.prototype._use=function(t,e){return"function"===typeof t&&(t=t(e)),t._getEncoder("der").tree},c.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;h+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var f=h[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?v+r:c[f-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),h=this.clone();if(u){for(s=0;!h.isZero();s++)a=h.andln(255),h.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],_=8191&b,w=b>>>13,x=0|a[4],E=8191&x,A=x>>>13,S=0|a[5],T=8191&S,k=S>>>13,R=0|a[6],M=8191&R,C=R>>>13,P=0|a[7],I=8191&P,O=P>>>13,B=0|a[8],N=8191&B,L=B>>>13,D=0|a[9],U=8191&D,F=D>>>13,j=0|s[0],Z=8191&j,H=j>>>13,G=0|s[1],V=8191&G,z=G>>>13,W=0|s[2],X=8191&W,q=W>>>13,Y=0|s[3],K=8191&Y,J=Y>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ht=0|s[8],lt=8191&ht,ft=ht>>>13,dt=0|s[9],pt=8191&dt,vt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(n=Math.imul(l,Z))|0)+((8191&(i=(i=Math.imul(l,H))+Math.imul(f,Z)|0))<<13)|0;c=((o=Math.imul(f,H))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,Z),i=(i=Math.imul(p,H))+Math.imul(v,Z)|0,o=Math.imul(v,H);var gt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,z)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,Z),i=(i=Math.imul(g,H))+Math.imul(y,Z)|0,o=Math.imul(y,H),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,z)|0;var yt=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,Z),i=(i=Math.imul(_,H))+Math.imul(w,Z)|0,o=Math.imul(w,H),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,q)|0;var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,K)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(A,Z)|0,o=Math.imul(A,H),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,z)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,z)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,J)|0;var _t=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(k,Z)|0,o=Math.imul(k,H),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,q)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var wt=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(C,Z)|0,o=Math.imul(C,H),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,z)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var xt=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,at)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0;var Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,Z),i=(i=Math.imul(N,H))+Math.imul(L,Z)|0,o=Math.imul(L,H),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0;var At=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,Z),i=(i=Math.imul(U,H))+Math.imul(F,Z)|0,o=Math.imul(F,H),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,z)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,ft)|0;var St=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,vt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,z))+Math.imul(F,V)|0,o=Math.imul(F,z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ct)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ft)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,q))+Math.imul(F,X)|0,o=Math.imul(F,q),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,ft)|0;var kt=(c+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,vt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,vt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,J))+Math.imul(F,K)|0,o=Math.imul(F,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ft)|0;var Rt=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,vt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ft)|0;var Mt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,vt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,vt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,vt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,vt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(O,lt)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,vt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(F,ut)|0,o=Math.imul(F,ct),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,ft)|0;var It=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,vt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(F,lt)|0,o=Math.imul(F,ft);var Ot=(c+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,vt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Bt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,vt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,vt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=mt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=_t,u[5]=wt,u[6]=xt,u[7]=Et,u[8]=At,u[9]=St,u[10]=Tt,u[11]=kt,u[12]=Rt,u[13]=Mt,u[14]=Ct,u[15]=Pt,u[16]=It,u[17]=Ot,u[18]=Bt,0!==c&&(u[19]=c,r.length++),r};function p(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?f(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/a|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(h),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,v=1;0===(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(h),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(e.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(y,g),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var v=d,m=0;0!==v.cmp(s);m++)v=v.redSqr();n(m=0;n--){for(var c=e.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===h)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,x),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},7957:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(4300).Buffer}catch(t){}function s(t,e,r){for(var i=0,o=Math.min(t.length,r),a=0,s=e;s=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:c,a|=u}return n(!(240&a),"Invalid character in "+t),i}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a"}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for?o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h:o.prototype.inspect=h;var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],h=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modrn(h).toString(t);r=(p=p.idivn(h)).isZero()?v+r:l[c-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;h+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],_=8191&b,w=b>>>13,x=0|a[4],E=8191&x,A=x>>>13,S=0|a[5],T=8191&S,k=S>>>13,R=0|a[6],M=8191&R,C=R>>>13,P=0|a[7],I=8191&P,O=P>>>13,B=0|a[8],N=8191&B,L=B>>>13,D=0|a[9],U=8191&D,F=D>>>13,j=0|s[0],Z=8191&j,H=j>>>13,G=0|s[1],V=8191&G,z=G>>>13,W=0|s[2],X=8191&W,q=W>>>13,Y=0|s[3],K=8191&Y,J=Y>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ht=0|s[8],lt=8191&ht,ft=ht>>>13,dt=0|s[9],pt=8191&dt,vt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(n=Math.imul(l,Z))|0)+((8191&(i=(i=Math.imul(l,H))+Math.imul(f,Z)|0))<<13)|0;c=((o=Math.imul(f,H))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,Z),i=(i=Math.imul(p,H))+Math.imul(v,Z)|0,o=Math.imul(v,H);var gt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,z)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,Z),i=(i=Math.imul(g,H))+Math.imul(y,Z)|0,o=Math.imul(y,H),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,z)|0;var yt=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,Z),i=(i=Math.imul(_,H))+Math.imul(w,Z)|0,o=Math.imul(w,H),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,q)|0;var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,K)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(A,Z)|0,o=Math.imul(A,H),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,z)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,z)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,J)|0;var _t=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(k,Z)|0,o=Math.imul(k,H),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,q)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var wt=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(C,Z)|0,o=Math.imul(C,H),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,z)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var xt=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,at)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0;var Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,Z),i=(i=Math.imul(N,H))+Math.imul(L,Z)|0,o=Math.imul(L,H),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0;var At=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,Z),i=(i=Math.imul(U,H))+Math.imul(F,Z)|0,o=Math.imul(F,H),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,z)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,ft)|0;var St=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,vt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,z))+Math.imul(F,V)|0,o=Math.imul(F,z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ct)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ft)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,q))+Math.imul(F,X)|0,o=Math.imul(F,q),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,ft)|0;var kt=(c+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,vt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,vt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,J))+Math.imul(F,K)|0,o=Math.imul(F,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ft)|0;var Rt=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,vt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ft)|0;var Mt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,vt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,vt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,vt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,vt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(O,lt)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,vt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(F,ut)|0,o=Math.imul(F,ct),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,ft)|0;var It=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,vt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(F,lt)|0,o=Math.imul(F,ft);var Ot=(c+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,vt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Bt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,vt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,vt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=mt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=_t,u[5]=wt,u[6]=xt,u[7]=Et,u[8]=At,u[9]=St,u[10]=Tt,u[11]=kt,u[12]=Rt,u[13]=Mt,u[14]=Ct,u[15]=Pt,u[16]=It,u[17]=Ot,u[18]=Bt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(t,e,r){return m(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(v=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,e):r<63?p(this,t,e):r<1024?m(this,t,e):g(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/a|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(h),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,v=1;0===(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(h),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(e.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(w,_),w.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new x;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return b[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var v=d,m=0;0!==v.cmp(s);m++)v=v.redSqr();n(m=0;n--){for(var c=e.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===h)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},i(T,S),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6844:function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r>>24]^h[p>>>16&255]^l[v>>>8&255]^f[255&m]^e[g++],a=c[p>>>24]^h[v>>>16&255]^l[m>>>8&255]^f[255&d]^e[g++],s=c[v>>>24]^h[m>>>16&255]^l[d>>>8&255]^f[255&p]^e[g++],u=c[m>>>24]^h[d>>>16&255]^l[p>>>8&255]^f[255&v]^e[g++],d=o,p=a,v=s,m=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[v>>>8&255]<<8|n[255&m])^e[g++],a=(n[p>>>24]<<24|n[v>>>16&255]<<16|n[m>>>8&255]<<8|n[255&d])^e[g++],s=(n[v>>>24]<<24|n[m>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[g++],u=(n[m>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&v])^e[g++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,n[c]=a;var h=t[a],l=t[h],f=t[l],d=257*t[c]^16843008*c;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*f^65537*l^257*h^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=h^t[t[t[f^h]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(t){this._key=i(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-e]^a}for(var c=[],h=0;h>>24]]^u.INV_SUB_MIX[1][u.SBOX[f>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[f>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&f]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},c.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=c},9794:function(t,e,r){var n=r(6675),i=r(3207).Buffer,o=r(1932),a=r(1140),s=r(3286),u=r(3513),c=r(1575);function h(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new s(r),o=e.length,a=o%16;n.update(e),a&&(a=16-a,n.update(i.alloc(a,0))),n.update(i.alloc(8,0));var u=8*o,h=i.alloc(8);h.writeUIntBE(u,0,8),n.update(h),t._finID=n.state;var l=i.from(t._finID);return c(l),l}function l(t,e,r,a){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var c=this._cipher.encryptBlock(u);this._ghash=new s(c),r=h(this,r,c),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}a(l,o),l.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(e,!1,r.key,r.iv);return f(t,n.key,n.iv)},e.createDecipheriv=f},3774:function(t,e,r){var n=r(4996),i=r(9794),o=r(3207).Buffer,a=r(5391),s=r(1932),u=r(6675),c=r(8644);function h(t,e,r){s.call(this),this._cache=new f,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(1140)(h,s),h.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function f(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var s=n[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"===typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"===typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,e,r):"auth"===s.type?new i(s.module,e,r):new h(s.module,e,r)}h.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},f.prototype.add=function(t){this.cache=o.concat([this.cache,t])},f.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},f.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,e&&(r[0]=r[0]^225<<24)}this.state=o(n)},a.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},1575:function(t){t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},3177:function(t,e,r){var n=r(3513);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},6512:function(t,e,r){var n=r(3207).Buffer,i=r(3513);function o(t,e,r){var o=e.length,a=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:a]),a}e.encrypt=function(t,e,r){for(var i,a=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){a=n.concat([a,o(t,e,r)]);break}i=t._cache.length,a=n.concat([a,o(t,e.slice(0,i),r)]),e=e.slice(i)}return a}},2028:function(t,e,r){var n=r(3207).Buffer;function i(t,e,r){for(var n,i,a=-1,s=0;++a<8;)n=e&1<<7-a?128:0,s+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>a%8,t._prev=o(t._prev,r?n:i);return s}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new i(o(e));return r}t.exports=a,a.getr=s},1624:function(t,e,r){t.exports=r(2908)},5799:function(t,e,r){var n=r(3207).Buffer,i=r(5809),o=r(4381),a=r(1140),s=r(9200),u=r(5968),c=r(2908);function h(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function f(t){return new h(t)}function d(t){return new l(t)}Object.keys(c).forEach((function(t){c[t].id=n.from(c[t].id,"hex"),c[t.toLowerCase()]=c[t]})),a(h,o.Writable),h.prototype._write=function(t,e,r){this._hash.update(t),r()},h.prototype.update=function(t,e){return"string"===typeof t&&(t=n.from(t,e)),this._hash.update(t),this},h.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=s(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},a(l,o.Writable),l.prototype._write=function(t,e,r){this._hash.update(t),r()},l.prototype.update=function(t,e){return"string"===typeof t&&(t=n.from(t,e)),this._hash.update(t),this},l.prototype.verify=function(t,e,r){"string"===typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return u(e,i,t,this._signType,this._tag)},t.exports={Sign:f,Verify:d,createSign:f,createVerify:d}},9200:function(t,e,r){var n=r(3207).Buffer,i=r(7025),o=r(1729),a=r(5586).ec,s=r(7957),u=r(7835),c=r(9267);function h(t,e){var r=c[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new a(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}function l(t,e,r){for(var n,i=e.params.priv_key,o=e.params.p,a=e.params.q,u=e.params.g,c=new s(0),h=p(t,a).mod(a),l=!1,g=d(i,a,t,r);!1===l;)c=m(u,n=v(a,g,r),o,a),0===(l=n.invm(a).imul(h.add(i.mul(c))).mod(a)).cmpn(0)&&(l=!1,c=new s(0));return f(c,l)}function f(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}function d(t,e,r,o){if((t=n.from(t.toArray())).length0&&r.ishrn(n),r}function v(t,e,r){var o,a;do{for(o=n.alloc(0);8*o.length=e)throw new Error("invalid sig")}t.exports=function(t,e,r,o,s){var h=a(r);if("ec"===h.type){if("ecdsa"!==o&&"ecdsa/rsa"!==o)throw new Error("wrong public key type");return u(t,e,h)}if("dsa"===h.type){if("dsa"!==o)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,s=r.data.g,u=r.data.pub_key,h=a.signature.decode(t,"der"),l=h.s,f=h.r;c(l,o),c(f,o);var d=i.mont(n),p=l.invm(o);return 0===s.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(u.toRed(d).redPow(f.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(f)}(t,e,h)}if("rsa"!==o&&"ecdsa/rsa"!==o)throw new Error("wrong public key type");e=n.concat([s,e]);for(var l=h.modulus.byteLength(),f=[1],d=0;e.length+f.length+2r)?e=("rmd160"===t?new u:c(t)).update(e).digest():e.lengths?e=t(e):e.length0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,t.keys,a)}},u.prototype._update=function(t,e,r,n){var i=this._desState,a=o.readUInt32BE(t,e),s=o.readUInt32BE(t,e+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n>>0,a=f}o.rip(s,a,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var a=r,s=e,u=t.keys.length-2;u>=0;u-=2){var c=t.keys[u],h=t.keys[u+1];o.expand(a,t.tmp,0),c^=t.tmp[0],h^=t.tmp[1];var l=o.substitute(c,h),f=a;a=(s^o.permute(l))>>>0,s=f}o.rip(a,s,n,i)}},8995:function(t,e,r){"use strict";var n=r(7985),i=r(1140),o=r(6371),a=r(5511);function s(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new s(this.type,this.options.key);this._edeState=e}i(u,o),t.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=a.prototype._pad,u.prototype._unpad=a.prototype._unpad},5349:function(t,e){"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=e>>>s+a&1,i<<=1,i|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var o=0,a=0,s=r.length>>>1,u=0;u>>r[u]&1;for(u=s;u>>r[u]&1;n[i+0]=o>>>0,n[i+1]=a>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(t>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.lengtht;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(c))for(;r.mod(h).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(f);)r.iadd(d);if(v(p=r.shrn(1))&&v(r)&&m(p)&&m(r)&&a.test(p)&&a.test(r))return r}}},5586:function(t,e,r){"use strict";var n=e;n.version=r(2531).i8,n.utils=r(8266),n.rand=r(6844),n.curve=r(2422),n.curves=r(8136),n.ec=r(465),n.eddsa=r(1512)},9655:function(t,e,r){"use strict";var n=r(4563),i=r(8266),o=i.getNAF,a=i.getJSF,s=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=u;e--)c=(c<<1)+n[e];a.push(c)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(u=0;u=0;c--){for(e=0;c>=0&&0===a[c];c--)e++;if(c>=0&&e++,u=u.dblp(e),c<0)break;var h=a[c];s(0!==h),u="affine"===t.type?h>0?u.mixedAdd(i[h-1>>1]):u.mixedAdd(i[-h-1>>1].neg()):h>0?u.add(i[h-1>>1]):u.add(i[-h-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,c=this._wnafT3,h=0,l=0;l=1;l-=2){var d=l-1,p=l;if(1===s[d]&&1===s[p]){var v=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(v[1]=e[d].add(e[p]),v[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(v[1]=e[d].toJ().mixedAdd(e[p]),v[2]=e[d].add(e[p].neg())):(v[1]=e[d].toJ().mixedAdd(e[p]),v[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[d],r[p]);h=Math.max(g[0].length,h),c[d]=new Array(h),c[p]=new Array(h);for(var y=0;y=0;l--){for(var E=0;l>=0;){var A=!0;for(y=0;y=0&&E++,w=w.dblp(E),l<0)break;for(y=0;y0?S=u[y][T-1>>1]:T<0&&(S=u[y][-T-1>>1].neg()),w="affine"===S.type?w.mixedAdd(S):w.add(S))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),c=o.redMul(s),h=i.redMul(s),l=a.redMul(o);return this.curve.point(u,c,l,h)},c.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=c.redSub(s).redSub(s);t=this.curve._mulC(n.redISub(c)).redMul(u),e=this.curve._mulC(c).redMul(i.redISub(o)),r=c.redMul(u)}return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),c=o.redMul(a),h=s.redMul(u),l=o.redMul(u),f=a.redMul(s);return this.curve.point(c,h,f,l)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(h);return this.curve.twisted?(e=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(e=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},2422:function(t,e,r){"use strict";var n=e;n.base=r(9655),n.short=r(2655),n.mont=r(1979),n.edwards=r(4559)},1979:function(t,e,r){"use strict";var n=r(4563),i=r(1140),o=r(9655),a=r(8266);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new u(this,t,e)},s.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},2655:function(t,e,r){"use strict";var n=r(8266),i=r(4563),o=r(1140),a=r(9655),s=n.assert;function u(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,u,c,h,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=t,d=this.n.clone(),p=new i(1),v=new i(0),m=new i(0),g=new i(1),y=0;0!==f.cmpn(0);){var b=d.div(f);c=d.sub(b.mul(f)),h=m.sub(b.mul(p));var _=g.sub(b.mul(v));if(!n&&c.cmp(l)<0)e=u.neg(),r=p,n=c.neg(),o=h;else if(n&&2===++y)break;u=c,d=f,f=c,m=p,p=h,g=v,v=_}a=c.neg(),s=h;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),h=c.redMul(s),l=n.redMul(c),f=u.redSqr().redIAdd(h).redISub(l).redISub(l),d=u.redMul(l.redISub(f)).redISub(o.redMul(h)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(f,d,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(h).redISub(h),f=s.redMul(h.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(l,f,d)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},8136:function(t,e,r){"use strict";var n,i=e,o=r(6544),a=r(2422),s=r(8266).assert;function u(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(2507)}catch(t){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},465:function(t,e,r){"use strict";var n=r(4563),i=r(1485),o=r(8266),a=r(8136),s=r(6844),u=o.assert,c=r(9257),h=r(7909);function l(t){if(!(this instanceof l))return new l(t);"string"===typeof t&&(u(a.hasOwnProperty(t),"Unknown curve "+t),t=a[t]),t instanceof a.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=l,l.prototype.keyPair=function(t){return new c(this,t)},l.prototype.keyFromPrivate=function(t,e){return c.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return c.fromPublic(this,t,e)},l.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||s(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(e.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},l.prototype.sign=function(t,e,r,o){"object"===typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),u=t.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),f=0;;f++){var d=o.k?o.k(f):new n(c.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var v=p.getX(),m=v.umod(this.n);if(0!==m.cmpn(0)){var g=d.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==v.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new h({r:m,s:g,recoveryParam:y})}}}}}},l.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new h(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(t).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new h(e,i);var o=this.n,a=new n(t),s=e.r,c=e.s,l=1&r,f=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=f?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var d=e.r.invm(o),p=o.sub(a).mul(d).umod(o),v=c.mul(d).umod(o);return this.g.mulAdd(p,s,v)},l.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new h(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},9257:function(t,e,r){"use strict";var n=r(4563),i=r(8266).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"===typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},7909:function(t,e,r){"use strict";var n=r(4563),i=r(8266),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o>>=0;return!(i<=127)&&(e.place=a,i)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=u(t,r);if(!1===a)return!1;var c=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var h=u(t,r);if(!1===h)return!1;if(t.length!==h+r.place)return!1;var l=t.slice(r.place,h+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=c(e),r=c(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];h(n,e.length),(n=n.concat(e)).push(2),h(n,r.length);var o=n.concat(r),a=[48];return h(a,o.length),a=a.concat(o),i.encode(a,t)}},1512:function(t,e,r){"use strict";var n=r(6544),i=r(8136),o=r(8266),a=o.assert,s=o.parseBytes,u=r(7430),c=r(9085);function h(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof h))return new h(t);t=i[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=h,h.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var t=this.hash(),e=0;e(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,a,s,u=t.andln(3)+n&3,c=e.andln(3)+i&3;if(3===u&&(u=-1),3===c&&(c=-1),0===(1&u))o=0;else o=3!==(s=t.andln(7)+n&7)&&5!==s||2!==c?u:-u;if(r[0].push(o),0===(1&c))a=0;else a=3!==(s=e.andln(7)+i&7)&&5!==s||2!==u?c:-c;r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"===typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},8644:function(t,e,r){var n=r(3207).Buffer,i=r(8675);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),c=n.alloc(0);a>0||o>0;){var h=new i;h.update(c),h.update(t),e&&h.update(e),c=h.digest();var l=0;if(a>0){var f=s.length-a;l=Math.min(a,c.length),c.copy(s,f,0,l),a-=l}if(l0){var d=u.length-o,p=Math.min(o,c.length-l);c.copy(u,d,l,l+p),o-=p}}return c.fill(0),{key:s,iv:u}}},3603:function(t,e,r){"use strict";var n=r(3207).Buffer,i=r(4381).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1140)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!==typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},6544:function(t,e,r){var n=e;n.utils=r(2815),n.common=r(8112),n.sha=r(8053),n.ripemd=r(99),n.hmac=r(8538),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},8112:function(t,e,r){"use strict";var n=r(2815),i=r(7985);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},2815:function(t,e,r){"use strict";var n=r(7985),i=r(1140);function o(t,e){return 55296===(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320===(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"===typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,c){var h=0,l=e;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,c){return e+n+o+s+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},1485:function(t,e,r){"use strict";var n=r(6544),i=r(1707),o=r(7985);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>>32-e}function c(t,e,r,n,i,o,a){return u(t+(e&r|~e&n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return u(t+(e&n|r&~n)+i+o|0,a)+e|0}function l(t,e,r,n,i,o,a){return u(t+(e^r^n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return u(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,t[0],3614090360,7),o=c(o,r,n,i,t[1],3905402710,12),i=c(i,o,r,n,t[2],606105819,17),n=c(n,i,o,r,t[3],3250441966,22),r=c(r,n,i,o,t[4],4118548399,7),o=c(o,r,n,i,t[5],1200080426,12),i=c(i,o,r,n,t[6],2821735955,17),n=c(n,i,o,r,t[7],4249261313,22),r=c(r,n,i,o,t[8],1770035416,7),o=c(o,r,n,i,t[9],2336552879,12),i=c(i,o,r,n,t[10],4294925233,17),n=c(n,i,o,r,t[11],2304563134,22),r=c(r,n,i,o,t[12],1804603682,7),o=c(o,r,n,i,t[13],4254626195,12),i=c(i,o,r,n,t[14],2792965006,17),r=h(r,n=c(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=h(o,r,n,i,t[6],3225465664,9),i=h(i,o,r,n,t[11],643717713,14),n=h(n,i,o,r,t[0],3921069994,20),r=h(r,n,i,o,t[5],3593408605,5),o=h(o,r,n,i,t[10],38016083,9),i=h(i,o,r,n,t[15],3634488961,14),n=h(n,i,o,r,t[4],3889429448,20),r=h(r,n,i,o,t[9],568446438,5),o=h(o,r,n,i,t[14],3275163606,9),i=h(i,o,r,n,t[3],4107603335,14),n=h(n,i,o,r,t[8],1163531501,20),r=h(r,n,i,o,t[13],2850285829,5),o=h(o,r,n,i,t[2],4243563512,9),i=h(i,o,r,n,t[7],1735328473,14),r=l(r,n=h(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=l(o,r,n,i,t[8],2272392833,11),i=l(i,o,r,n,t[11],1839030562,16),n=l(n,i,o,r,t[14],4259657740,23),r=l(r,n,i,o,t[1],2763975236,4),o=l(o,r,n,i,t[4],1272893353,11),i=l(i,o,r,n,t[7],4139469664,16),n=l(n,i,o,r,t[10],3200236656,23),r=l(r,n,i,o,t[13],681279174,4),o=l(o,r,n,i,t[0],3936430074,11),i=l(i,o,r,n,t[3],3572445317,16),n=l(n,i,o,r,t[6],76029189,23),r=l(r,n,i,o,t[9],3654602809,4),o=l(o,r,n,i,t[12],3873151461,11),i=l(i,o,r,n,t[15],530742520,16),r=f(r,n=l(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=f(o,r,n,i,t[7],1126891415,10),i=f(i,o,r,n,t[14],2878612391,15),n=f(n,i,o,r,t[5],4237533241,21),r=f(r,n,i,o,t[12],1700485571,6),o=f(o,r,n,i,t[3],2399980690,10),i=f(i,o,r,n,t[10],4293915773,15),n=f(n,i,o,r,t[1],2240044497,21),r=f(r,n,i,o,t[8],1873313359,6),o=f(o,r,n,i,t[15],4264355552,10),i=f(i,o,r,n,t[6],2734768916,15),n=f(n,i,o,r,t[13],1309151649,21),r=f(r,n,i,o,t[4],4149444226,6),o=f(o,r,n,i,t[11],3174756917,10),i=f(i,o,r,n,t[2],718787259,15),n=f(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},6596:function(t,e,r){var n=r(4563),i=r(6844);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),a=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var c=t.shrn(u),h=s.toRed(o);e>0;e--){var l=this._randrange(new n(2),s);r&&r(l);var f=l.toRed(o).redPow(c);if(0!==f.cmp(a)&&0!==f.cmp(h)){for(var d=1;d0;e--){var h=this._randrange(new n(2),a),l=t.gcd(h);if(0!==l.cmpn(1))return l;var f=h.toRed(i).redPow(u);if(0!==f.cmp(o)&&0!==f.cmp(c)){for(var d=1;d>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},7850:function(t,e,r){"use strict";var n=r(8996);e.certificate=r(7544);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));e.PublicKey=a;var s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=c;var h=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=h,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var l=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=l;var f=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},7544:function(t,e,r){"use strict";var n=r(8996),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(u)})),h=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),l=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),f=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(h),this.key("validity").use(l),this.key("subject").use(h),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));t.exports=p},6163:function(t,e,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,a=r(8644),s=r(2048),u=r(3207).Buffer;t.exports=function(t,e){var r,c=t.toString(),h=c.match(n);if(h){var l="aes"+h[1],f=u.from(h[2],"hex"),d=u.from(h[3].replace(/[\r\n]/g,""),"base64"),p=a(e,f.slice(0,8),parseInt(h[1],10)).key,v=[],m=s.createDecipheriv(l,p,f);v.push(m.update(d)),v.push(m.final()),r=u.concat(v)}else{var g=c.match(o);r=new u(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},7835:function(t,e,r){var n=r(7850),i=r(2510),o=r(6163),a=r(2048),s=r(5684),u=r(3207).Buffer;function c(t){var e;"object"!==typeof t||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"===typeof t&&(t=u.from(t));var r,i,a=o(t,e),s=a.tag,c=a.data;switch(s){case"CERTIFICATE":i=n.certificate.decode(c,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=n.PublicKey.decode(c,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=n.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+s);case"ENCRYPTED PRIVATE KEY":c=h(c=n.EncryptedPrivateKey.decode(c,"der"),e);case"PRIVATE KEY":switch(r=(i=n.PrivateKey.decode(c,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:n.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=n.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+s);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(c,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(c,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(c,"der")};case"EC PRIVATE KEY":return{curve:(c=n.ECPrivateKey.decode(c,"der")).parameters.value,privateKey:c.privateKey};default:throw new Error("unknown key type "+s)}}function h(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[t.algorithm.decrypt.cipher.algo.join(".")],c=t.algorithm.decrypt.cipher.iv,h=t.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,f=s.pbkdf2Sync(e,r,n,l,"sha1"),d=a.createDecipheriv(o,f,c),p=[];return p.push(d.update(h)),p.push(d.final()),u.concat(p)}t.exports=c,c.signature=n.signature},5684:function(t,e,r){var n=r(6113),i=r(1428),o=r(5200),a=r(919);n.pbkdf2Sync&&-1!==n.pbkdf2Sync.toString().indexOf("keylen, digest")?(e.pbkdf2Sync=function(t,e,r,s,u){return i(r,s),t=a(t,o,"Password"),e=a(e,o,"Salt"),u=u||"sha1",n.pbkdf2Sync(t,e,r,s,u)},e.pbkdf2=function(t,e,r,s,u,c){if(i(r,s),t=a(t,o,"Password"),e=a(e,o,"Salt"),"function"===typeof u&&(c=u,u="sha1"),"function"!==typeof c)throw new Error("No callback provided to pbkdf2");return n.pbkdf2(t,e,r,s,u,c)}):(e.pbkdf2Sync=r(7936),e.pbkdf2=r(8512))},8512:function(t,e,n){var o,a=n(3207).Buffer,s=n(1428),u=n(5200),c=n(7936),h=n(919),l=r.g.crypto&&r.g.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function p(t){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==d[t])return d[t];var e=v(o=o||a.alloc(8),o,10,128,t).then((function(){return!0})).catch((function(){return!1}));return d[t]=e,e}function v(t,e,r,n,i){return l.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return l.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return a.from(t)}))}t.exports=function(t,e,n,o,a,l){"function"===typeof a&&(l=a,a=void 0);var d=f[(a=a||"sha1").toLowerCase()];if(!d||"function"!==typeof r.g.Promise)return i.nextTick((function(){var r;try{r=c(t,e,n,o,a)}catch(t){return l(t)}l(null,r)}));if(s(n,o),t=h(t,u,"Password"),e=h(e,u,"Salt"),"function"!==typeof l)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){i.nextTick((function(){e(null,t)}))}),(function(t){i.nextTick((function(){e(t)}))}))}(p(d).then((function(r){return r?v(t,e,n,o,d):c(t,e,n,o,a)})),l)}},5200:function(t){var e;e="utf-8",t.exports=e},1428:function(t){var e=Math.pow(2,30)-1;t.exports=function(t,r){if("number"!==typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!==typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!==r)throw new TypeError("Bad key length")}},7936:function(t,e,r){var n={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20},i=r(7025),o=r(3207).Buffer,a=r(1428),s=r(5200),u=r(919);t.exports=function(t,e,r,c,h){a(r,c),t=u(t,s,"Password"),e=u(e,s,"Salt"),h=h||"sha1";var l=o.allocUnsafe(c),f=o.allocUnsafe(e.length+4);e.copy(f,0,0,e.length);for(var d=0,p=n[h],v=Math.ceil(c/p),m=1;m<=v;m++){f.writeUInt32BE(m,e.length);for(var g=i(h,t).update(f).digest(),y=g,b=1;bf||new a(e).cmp(u.modulus)>=0)throw new Error("decryption error");o=r?c(new a(e),u):s(e,u);var d=h.alloc(f-o.length);if(o=h.concat([d,o],f),4===i)return l(u,o);if(1===i)return function(t,e,r){var n=e.slice(0,2),i=2,o=0;for(;0!==e[i++];)if(i>=e.length){o++;break}var a=e.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,o,r);if(3===i)return o;throw new Error("unknown padding")}},337:function(t,e,r){var n=r(7835),i=r(9404),o=r(5809),a=r(203),s=r(5491),u=r(4563),c=r(713),h=r(1729),l=r(3207).Buffer;function f(t,e){var r=t.modulus.byteLength(),n=e.length,c=o("sha1").update(l.alloc(0)).digest(),h=c.length,f=2*h;if(n>r-f-2)throw new Error("message too long");var d=l.alloc(r-n-f-2),p=r-h-1,v=i(h),m=s(l.concat([c,d,l.alloc(1,1),e],p),a(v,p)),g=s(v,a(m,h));return new u(l.concat([l.alloc(1),g,m],r))}function d(t){for(var e,r=l.allocUnsafe(t),n=0,o=i(2*t),a=0;no-11)throw new Error("message too long");n=r?l.alloc(o-i-3,255):d(o-i-3);return new u(l.concat([l.from([0,r?1:2]),n,l.alloc(1),e],o))}(a,e,r);else{if(3!==i)throw new Error("unknown padding");if((o=new u(e)).cmp(a.modulus)>=0)throw new Error("data too long for modulus")}return r?h(o,a):c(o,a)}},713:function(t,e,r){var n=r(4563),i=r(3207).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},5491:function(t){t.exports=function(t,e){for(var r=t.length,n=-1;++na)throw new RangeError("requested too many random bytes");var r=s.allocUnsafe(t);if(t>0)if(t>o)for(var n=0;nh||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function f(t,e,r){if("number"!==typeof t||t!==t)throw new TypeError("size must be a number");if(t>h||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function d(t,e,r,n){var o=t.buffer,a=new Uint8Array(o,e,r);return c.getRandomValues(a),n?void i.nextTick((function(){n(null,t)})):t}c&&c.getRandomValues?(e.randomFill=function(t,e,n,i){if(!s.isBuffer(t)&&!(t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof e)i=e,e=0,n=t.length;else if("function"===typeof n)i=n,n=t.length-e;else if("function"!==typeof i)throw new TypeError('"cb" argument must be a function');return l(e,t.length),f(n,e,t.length),d(t,e,n,i)},e.randomFillSync=function(t,e,n){"undefined"===typeof e&&(e=0);if(!s.isBuffer(t)&&!(t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(e,t.length),void 0===n&&(n=t.length-e);return f(n,e,t.length),d(t,e,n)}):(e.randomFill=o,e.randomFillSync=o)},9349:function(t){"use strict";const e={};function r(t,r,n){function i(t,e,n){return"string"===typeof r?r:r(t,e,n)}n||(n=Error);class o extends n{constructor(t,e,r){super(i(t,e,r))}}o.prototype.name=n.name,o.prototype.code=t,e[t]=o}function n(t,e){if(Array.isArray(t)){const r=t.length;return t=t.map((t=>String(t))),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:2===r?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}return`of ${e} ${String(t)}`}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){let i,o;if("string"===typeof e&&function(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))o=`The ${t} ${i} ${n(e,"type")}`;else{const r=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";o=`The "${t}" ${r} ${i} ${n(e,"type")}`}return o+=". Received type "+typeof r,o}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},3289:function(t,e,r){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var o=r(4787),a=r(7513);r(1140)(h,o);for(var s=n(a.prototype),u=0;u0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?E(t,new x):R(t,a,e,!0);else if(a.ended)E(t,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?R(t,a,e,!1):O(t,a)):R(t,a,e,!1)}else n||(a.reading=!1,O(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=M?t=M:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function O(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(B,t,e))}function B(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){h("readable nexttick read 0"),t.read(0)}function D(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function j(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(Z,e,t))}function Z(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):P(this),null;if(0===(t=C(t,e))&&e.ended)return 0===e.length&&j(this),null;var n,i=e.needReadable;return h("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&j(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(t){E(this,new w("_read()"))},T.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,h("pipe count=%d opts=%j",n.pipesCount,e);var o=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?u:g;function s(t,e){h("onunpipe"),t===r&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,f())}function u(){h("onend"),t.end()}n.endEmitted?i.nextTick(o):r.once("end",o),t.on("unpipe",s);var c=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,U(t))}}(r);t.on("drain",c);var l=!1;function f(){h("cleanup"),t.removeListener("close",v),t.removeListener("finish",m),t.removeListener("drain",c),t.removeListener("error",p),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",d),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c()}function d(e){h("ondata");var i=t.write(e);h("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==H(n.pipes,t))&&!l&&(h("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(e){h("onerror",e),g(),t.removeListener("error",p),0===a(t,"error")&&E(t,e)}function v(){t.removeListener("finish",m),g()}function m(){h("onfinish"),t.removeListener("close",v),g()}function g(){h("unpipe"),r.unpipe(t)}return r.on("data",d),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",v),t.once("finish",m),t.emit("pipe",r),n.flowing||(h("pipe resume"),r.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,h("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(L,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(N,this),r},T.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(N,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(D,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new x(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new m("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,O(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(t,e){e(t)}},5224:function(t,e,r){"use strict";var n;function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(6007),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),h=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function v(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[l]=null,t[s]=null,t[u]=null,e(p(r,!1)))}}function m(t){i.nextTick(v,t)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((n={get stream(){return this[d]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[h])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(p(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[h]?r(p(void 0,!0)):e[f](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[f])}return this[l]=r,r}},o(n,Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[d].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),g);t.exports=function(t){var e,r=Object.create(y,(o(e={},d,{value:t,writable:!0}),o(e,s,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,h,{value:t._readableState.endEmitted,writable:!0}),o(e,f,{value:function(t,e){var n=r[d].read();n?(r[l]=null,r[s]=null,r[u]=null,t(p(n,!1))):(r[s]=t,r[u]=e)},writable:!0}),e));return r[l]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[s]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[h]=!0})),t.on("readable",m.bind(null,r)),r}},4041:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e=a.allocUnsafe(t>>>0),r=this.head,n=0;r;)c(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return e.reduce(h)}},483:function(t,e,r){"use strict";var n=r(9349).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},1455:function(t,e,r){t.exports=r(2781)},4381:function(t,e,r){var n=r(2781);"disable"===i.env.READABLE_STREAM&&n?(t.exports=n.Readable,Object.assign(t.exports,n),t.exports.Stream=n):((e=t.exports=r(4787)).Stream=n||e,e.Readable=e,e.Writable=r(7513),e.Duplex=r(3289),e.Transform=r(6551),e.PassThrough=r(4788),e.finished=r(6007),e.pipeline=r(1522))},4239:function(t,e,r){"use strict";var n=r(4300).Buffer,i=r(1140),o=r(3603),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],h=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<>>32-e}function v(t,e,r,n,i,o,a,s){return p(t+(e^r^n)+o+a|0,s)+i|0}function m(t,e,r,n,i,o,a,s){return p(t+(e&r|~e&n)+o+a|0,s)+i|0}function g(t,e,r,n,i,o,a,s){return p(t+((e|~r)^n)+o+a|0,s)+i|0}function y(t,e,r,n,i,o,a,s){return p(t+(e&n|r&~n)+o+a|0,s)+i|0}function b(t,e,r,n,i,o,a,s){return p(t+(e^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,_=0|this._a,w=0|this._b,x=0|this._c,E=0|this._d,A=0|this._e,S=0;S<80;S+=1){var T,k;S<16?(T=v(r,n,i,o,d,t[s[S]],l[0],c[S]),k=b(_,w,x,E,A,t[u[S]],f[0],h[S])):S<32?(T=m(r,n,i,o,d,t[s[S]],l[1],c[S]),k=y(_,w,x,E,A,t[u[S]],f[1],h[S])):S<48?(T=g(r,n,i,o,d,t[s[S]],l[2],c[S]),k=g(_,w,x,E,A,t[u[S]],f[2],h[S])):S<64?(T=y(r,n,i,o,d,t[s[S]],l[3],c[S]),k=m(_,w,x,E,A,t[u[S]],f[3],h[S])):(T=b(r,n,i,o,d,t[s[S]],l[4],c[S]),k=v(_,w,x,E,A,t[u[S]],f[4],h[S])),r=d,d=o,o=p(i,10),i=n,n=T,_=A,A=E,E=p(x,10),x=w,w=k}var R=this._b+i+E|0;this._b=this._c+o+A|0,this._c=this._d+d+_|0,this._d=this._e+r+w|0,this._e=this._a+n+x|0,this._a=R},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},3207:function(t,e,r){var n=r(4300),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},4602:function(t,e,r){var n=r(3207).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"===typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},6246:function(t,e,r){var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(6721),n.sha1=r(8319),n.sha224=r(4911),n.sha256=r(7586),n.sha384=r(9891),n.sha512=r(561)},6721:function(t,e,r){var n=r(1140),i=r(4602),o=r(3207).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<5|t>>>27}function h(t){return t<<30|t>>>2}function l(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0;u<16;++u)e[u]=t.readInt32BE(4*u);for(;u<80;++u)e[u]=e[u-3]^e[u-8]^e[u-14]^e[u-16];for(var f=0;f<80;++f){var d=~~(f/20),p=c(r)+l(d,n,i,o)+s+e[f]+a[d]|0;s=o,o=i,i=h(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},8319:function(t,e,r){var n=r(1140),i=r(4602),o=r(3207).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<1|t>>>31}function h(t){return t<<5|t>>>27}function l(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0;u<16;++u)e[u]=t.readInt32BE(4*u);for(;u<80;++u)e[u]=c(e[u-3]^e[u-8]^e[u-14]^e[u-16]);for(var d=0;d<80;++d){var p=~~(d/20),v=h(r)+f(p,n,i,o)+s+e[d]+a[p]|0;s=o,o=i,i=l(n),n=r,r=v}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},4911:function(t,e,r){var n=r(1140),i=r(7586),o=r(4602),a=r(3207).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},7586:function(t,e,r){var n=r(1140),i=r(4602),o=r(3207).Buffer,a=[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],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function l(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function f(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function p(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0|this._f,v=0|this._g,m=0|this._h,g=0;g<16;++g)e[g]=t.readInt32BE(4*g);for(;g<64;++g)e[g]=p(e[g-2])+e[g-7]+d(e[g-15])+e[g-16]|0;for(var y=0;y<64;++y){var b=m+f(s)+c(s,u,v)+a[y]+e[y]|0,_=l(r)+h(r,n,i)|0;m=v,v=u,u=s,s=o+b|0,o=i,i=n,n=r,r=b+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=u+this._f|0,this._g=v+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},9891:function(t,e,r){var n=r(1140),i=r(561),o=r(4602),a=r(3207).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},561:function(t,e,r){var n=r(1140),i=r(4602),o=r(3207).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function f(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function v(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,b=0|this._hh,_=0|this._al,w=0|this._bl,x=0|this._cl,E=0|this._dl,A=0|this._el,S=0|this._fl,T=0|this._gl,k=0|this._hl,R=0;R<32;R+=2)e[R]=t.readInt32BE(4*R),e[R+1]=t.readInt32BE(4*R+4);for(;R<160;R+=2){var M=e[R-30],C=e[R-30+1],P=d(M,C),I=p(C,M),O=v(M=e[R-4],C=e[R-4+1]),B=m(C,M),N=e[R-14],L=e[R-14+1],D=e[R-32],U=e[R-32+1],F=I+L|0,j=P+N+g(F,I)|0;j=(j=j+O+g(F=F+B|0,B)|0)+D+g(F=F+U|0,U)|0,e[R]=j,e[R+1]=F}for(var Z=0;Z<160;Z+=2){j=e[Z],F=e[Z+1];var H=h(r,n,i),G=h(_,w,x),V=l(r,_),z=l(_,r),W=f(s,A),X=f(A,s),q=a[Z],Y=a[Z+1],K=c(s,u,y),J=c(A,S,T),$=k+X|0,Q=b+W+g($,k)|0;Q=(Q=(Q=Q+K+g($=$+J|0,J)|0)+q+g($=$+Y|0,Y)|0)+j+g($=$+F|0,F)|0;var tt=z+G|0,et=V+H+g(tt,z)|0;b=y,k=T,y=u,T=S,u=s,S=A,s=o+Q+g(A=E+$|0,E)|0,o=i,E=x,i=n,x=w,n=r,w=_,r=Q+et+g(_=$+tt|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+x|0,this._dl=this._dl+E|0,this._el=this._el+A|0,this._fl=this._fl+S|0,this._gl=this._gl+T|0,this._hl=this._hl+k|0,this._ah=this._ah+r+g(this._al,_)|0,this._bh=this._bh+n+g(this._bl,w)|0,this._ch=this._ch+i+g(this._cl,x)|0,this._dh=this._dh+o+g(this._dl,E)|0,this._eh=this._eh+s+g(this._el,A)|0,this._fh=this._fh+u+g(this._fl,S)|0,this._gh=this._gh+y+g(this._gl,T)|0,this._hh=this._hh+b+g(this._hl,k)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},1862:function(t,e,r){"use strict";var n=r(3207).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!==typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=h,this.end=l,e=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},2777:function(t){function e(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,r){if(e("noDeprecation"))return t;var n=!1;return function(){if(!n){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return t.apply(this,arguments)}}},4300:function(t){"use strict";t.exports=r(1876)},6113:function(t){"use strict";t.exports=r(2474)},2361:function(t){"use strict";t.exports=r(5293)},2781:function(t){"use strict";t.exports=r(9681)},1576:function(t){"use strict";t.exports=r(2553)},3837:function(t){"use strict";t.exports=r(9720)},6144:function(t){"use strict";t.exports=r(1951)},5866:function(t){"use strict";t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},2908:function(t){"use strict";t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},9267:function(t){"use strict";t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},7992:function(t){"use strict";t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},2531:function(t){"use strict";t.exports={i8:"6.5.3"}},2510:function(t){"use strict";t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},o={};function a(t){var r=o[t];if(void 0!==r)return r.exports;var n=o[t]={id:t,loaded:!1,exports:{}},i=!0;try{e[t].call(n.exports,n,n.exports,a),i=!1}finally{i&&delete o[t]}return n.loaded=!0,n.exports}a.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},a.ab="//";var s={};!function(){"use strict";var t=s;t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=a(9404),t.createHash=t.Hash=a(5809),t.createHmac=t.Hmac=a(7025);var e=a(1624),r=Object.keys(e),n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);t.getHashes=function(){return n};var i=a(5684);t.pbkdf2=i.pbkdf2,t.pbkdf2Sync=i.pbkdf2Sync;var o=a(9569);t.Cipher=o.Cipher,t.createCipher=o.createCipher,t.Cipheriv=o.Cipheriv,t.createCipheriv=o.createCipheriv,t.Decipher=o.Decipher,t.createDecipher=o.createDecipher,t.Decipheriv=o.Decipheriv,t.createDecipheriv=o.createDecipheriv,t.getCiphers=o.getCiphers,t.listCiphers=o.listCiphers;var u=a(7047);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var c=a(5799);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=a(8238);var h=a(6111);t.publicEncrypt=h.publicEncrypt,t.privateEncrypt=h.privateEncrypt,t.publicDecrypt=h.publicDecrypt,t.privateDecrypt=h.privateDecrypt;var l=a(6573);t.randomFill=l.randomFill,t.randomFillSync=l.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}(),t.exports=s}()},5293:function(t){!function(){"use strict";var e={699:function(t){var e,r="object"===typeof Reflect?Reflect:null,n=r&&"function"===typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"===typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!==t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"===typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"===typeof t.on&&v(t,"error",e,r)}(t,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,a;if(s(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"===typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(t))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,function(t){console&&console.warn&&console.warn(t)}(c)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[t];if(void 0===u)return!1;if("function"===typeof u)n(u,this,e);else{var c=u.length,h=p(u,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var o=r[t]={exports:{}},a=!0;try{e[t](o,o.exports,n),a=!1}finally{a&&delete r[t]}return o.exports}n.ab="//";var i=n(699);t.exports=i}()},9885:function(){},1987:function(t,e,r){!function(){var e={477:function(t){"use strict";t.exports=r(7673)}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}},a=!0;try{e[t](o,o.exports,i),a=!1}finally{a&&delete n[t]}return o.exports}i.ab="//";var o={};!function(){var t,e=o,r=(t=i(477))&&"object"==typeof t&&"default"in t?t.default:t,n=/https?|ftp|gopher|file/;function a(t){"string"==typeof t&&(t=b(t));var e=function(t,e,r){var n=t.auth,i=t.hostname,o=t.protocol||"",a=t.pathname||"",s=t.hash||"",u=t.query||"",c=!1;n=n?encodeURIComponent(n).replace(/%3A/i,":")+"@":"",t.host?c=n+t.host:i&&(c=n+(~i.indexOf(":")?"["+i+"]":i),t.port&&(c+=":"+t.port)),u&&"object"==typeof u&&(u=e.encode(u));var h=t.search||u&&"?"+u||"";return o&&":"!==o.substr(-1)&&(o+=":"),t.slashes||(!o||r.test(o))&&!1!==c?(c="//"+(c||""),a&&"/"!==a[0]&&(a="/"+a)):c||(c=""),s&&"#"!==s[0]&&(s="#"+s),h&&"?"!==h[0]&&(h="?"+h),{protocol:o,host:c,pathname:a=a.replace(/[?#]/g,encodeURIComponent),search:h=h.replace("#","%23"),hash:s}}(t,r,n);return""+e.protocol+e.host+e.pathname+e.search+e.hash}var s="http://",u="w.w",c=s+u,h=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,l=/https?|ftp|gopher|file/;function f(t,e){var r="string"==typeof t?b(t):t;t="object"==typeof t?a(t):t;var n=b(e),i="";r.protocol&&!r.slashes&&(i=r.protocol,t=t.replace(r.protocol,""),i+="/"===e[0]||"/"===t[0]?"/":""),i&&n.protocol&&(i="",n.slashes||(i=n.protocol,e=e.replace(n.protocol,"")));var o=t.match(h);o&&!n.protocol&&(t=t.substr((i=o[1]+(o[2]||"")).length),/^\/\/[^/]/.test(e)&&(i=i.slice(0,-1)));var u=new URL(t,c+"/"),f=new URL(e,u).toString().replace(c,""),d=n.protocol||r.protocol;return d+=r.slashes||n.slashes?"//":"",!i&&d?f=f.replace(s,d):i&&(f=f.replace(s,"")),l.test(f)||~e.indexOf(".")||"/"===t.slice(-1)||"/"===e.slice(-1)||"/"!==f.slice(-1)||(f=f.slice(0,-1)),i&&(f=i+("/"===f[0]?f.substr(1):f)),f}function d(){}d.prototype.parse=b,d.prototype.format=a,d.prototype.resolve=f,d.prototype.resolveObject=f;var p=/^https?|ftp|gopher|file/,v=/^(.*?)([#?].*)/,m=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,g=/^([a-z0-9.+-]*:)?\/\/\/*/i,y=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function b(t,e,n){if(void 0===e&&(e=!1),void 0===n&&(n=!1),t&&"object"==typeof t&&t instanceof d)return t;var i=(t=t.trim()).match(v);t=i?i[1].replace(/\\/g,"/")+i[2]:t.replace(/\\/g,"/"),y.test(t)&&"/"!==t.slice(-1)&&(t+="/");var o=!/(^javascript)/.test(t)&&t.match(m),s=g.test(t),h="";o&&(p.test(o[1])||(h=o[1].toLowerCase(),t=""+o[2]+o[3]),o[2]||(s=!1,p.test(o[1])?(h=o[1],t=""+o[3]):t="//"+o[3]),3!==o[2].length&&1!==o[2].length||(h=o[1],t="/"+o[3]));var l,f=(i?i[1]:t).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),b=f&&f[1],_=new d,w="",x="";try{l=new URL(t)}catch(e){w=e,h||n||!/^\/\//.test(t)||/^\/\/.+[@.]/.test(t)||(x="/",t=t.substr(1));try{l=new URL(t,c)}catch(t){return _.protocol=h,_.href=h,_}}_.slashes=s&&!x,_.host=l.host===u?"":l.host,_.hostname=l.hostname===u?"":l.hostname.replace(/(\[|\])/g,""),_.protocol=w?h||null:l.protocol,_.search=l.search.replace(/\\/g,"%5C"),_.hash=l.hash.replace(/\\/g,"%5C");var E=t.split("#");!_.search&&~E[0].indexOf("?")&&(_.search="?"),_.hash||""!==E[1]||(_.hash="#"),_.query=e?r.decode(l.search.substr(1)):_.search.substr(1),_.pathname=x+(o?function(t){return t.replace(/['^|`]/g,(function(t){return"%"+t.charCodeAt().toString(16).toUpperCase()})).replace(/((?:%[0-9A-F]{2})+)/g,(function(t,e){try{return decodeURIComponent(e).split("").map((function(t){var e=t.charCodeAt();return e>256||/^[a-z0-9]$/i.test(t)?t:"%"+e.toString(16).toUpperCase()})).join("")}catch(t){return e}}))}(l.pathname):l.pathname),"about:"===_.protocol&&"blank"===_.pathname&&(_.protocol="",_.pathname=""),w&&"/"!==t[0]&&(_.pathname=_.pathname.substr(1)),h&&!p.test(h)&&"/"!==t.slice(-1)&&"/"===_.pathname&&(_.pathname=""),_.path=_.pathname+_.search,_.auth=[l.username,l.password].map(decodeURIComponent).filter(Boolean).join(":"),_.port=l.port,b&&!_.host.endsWith(b)&&(_.host+=b,_.port=b.slice(1)),_.href=x?""+_.pathname+_.search+_.hash:a(_);var A=/^(file)/.test(_.href)?["host","hostname"]:[];return Object.keys(_).forEach((function(t){~A.indexOf(t)||(_[t]=_[t]||null)})),_}e.parse=b,e.format=a,e.resolve=f,e.resolveObject=function(t,e){return b(f(t,e))},e.Url=d}(),t.exports=o}()},7663:function(t){!function(){var e={308:function(t){var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"===typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"===typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,u=[],c=!1,h=-1;function l(){c&&s&&(c=!1,s.length?u=s.concat(u):h=-1,u.length&&f())}function f(){if(!c){var t=a(l);c=!0;for(var e=u.length;e;){for(s=u,u=[];++h1)for(var r=1;rString(t))),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:2===r?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}return`of ${e} ${String(t)}`}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){let i,o;if("string"===typeof e&&function(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))o=`The ${t} ${i} ${n(e,"type")}`;else{const r=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";o=`The "${t}" ${r} ${i} ${n(e,"type")}`}return o+=". Received type "+typeof r,o}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},716:function(t,e,r){"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var o=r(787),a=r(513);r(140)(h,o);for(var s=i(a.prototype),u=0;u0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?E(t,new x):R(t,a,e,!0);else if(a.ended)E(t,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?R(t,a,e,!1):O(t,a)):R(t,a,e,!1)}else n||(a.reading=!1,O(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=M?t=M:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(I,t))}function I(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function O(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(B,t,e))}function B(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){h("readable nexttick read 0"),t.read(0)}function D(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function j(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(Z,e,t))}function Z(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):P(this),null;if(0===(t=C(t,e))&&e.ended)return 0===e.length&&j(this),null;var n,i=e.needReadable;return h("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&j(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(t){E(this,new w("_read()"))},T.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?u:g;function s(t,e){h("onunpipe"),t===r&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,f())}function u(){h("onend"),t.end()}i.endEmitted?n.nextTick(o):r.once("end",o),t.on("unpipe",s);var c=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,U(t))}}(r);t.on("drain",c);var l=!1;function f(){h("cleanup"),t.removeListener("close",v),t.removeListener("finish",m),t.removeListener("drain",c),t.removeListener("error",p),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",d),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||c()}function d(e){h("ondata");var n=t.write(e);h("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==H(i.pipes,t))&&!l&&(h("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function p(e){h("onerror",e),g(),t.removeListener("error",p),0===a(t,"error")&&E(t,e)}function v(){t.removeListener("finish",m),g()}function m(){h("onfinish"),t.removeListener("close",v),g()}function g(){h("unpipe"),r.unpipe(t)}return r.on("data",d),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",v),t.once("finish",m),t.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,h("on readable",i.length,i.reading),i.length?P(this):i.reading||n.nextTick(L,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(N,this),r},T.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(N,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(D,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new x(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new m("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var i=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,O(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(t,e){e(t)}},224:function(t,e,r){"use strict";var i;function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(7),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),h=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function v(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[l]=null,t[s]=null,t[u]=null,e(p(r,!1)))}}function m(t){n.nextTick(v,t)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i={get stream(){return this[d]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[h])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(e,r){n.nextTick((function(){t[c]?r(t[c]):e(p(void 0,!0))}))}));var r,i=this[l];if(i)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[h]?r(p(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[f])}return this[l]=r,r}},o(i,Symbol.asyncIterator,(function(){return this})),o(i,"return",(function(){var t=this;return new Promise((function(e,r){t[d].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),i),g);t.exports=function(t){var e,r=Object.create(y,(o(e={},d,{value:t,writable:!0}),o(e,s,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,h,{value:t._readableState.endEmitted,writable:!0}),o(e,f,{value:function(t,e){var n=r[d].read();n?(r[l]=null,r[s]=null,r[u]=null,t(p(n,!1))):(r[s]=t,r[u]=e)},writable:!0}),e));return r[l]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[s]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[h]=!0})),t.on("readable",m.bind(null,r)),r}},41:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e=a.allocUnsafe(t>>>0),r=this.head,n=0;r;)c(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return e.reduce(h)}},483:function(t,e,r){"use strict";var n=r(349).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},455:function(t,e,r){t.exports=r(781)},207:function(t,e,r){var n=r(300),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},552:function(t,e,r){t.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(140)(i,n),i.Readable=r(787),i.Writable=r(513),i.Duplex=r(716),i.Transform=r(551),i.PassThrough=r(788),i.finished=r(7),i.pipeline=r(522),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"===typeof t.destroy&&t.destroy())}function c(t){if(h(),0===n.listenerCount(this,"error"))throw t}function h(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",c),t.on("error",c),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t}},862:function(t,e,r){"use strict";var n=r(207).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!==typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=h,this.end=l,e=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},777:function(t){function e(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,r){if(e("noDeprecation"))return t;var n=!1;return function(){if(!n){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return t.apply(this,arguments)}}},300:function(t){"use strict";t.exports=r(1876)},361:function(t){"use strict";t.exports=r(5293)},781:function(t){"use strict";t.exports=r(5293).EventEmitter},837:function(t){"use strict";t.exports=r(9720)}},i={};function o(t){var r=i[t];if(void 0!==r)return r.exports;var n=i[t]={exports:{}},a=!0;try{e[t](n,n.exports,o),a=!1}finally{a&&delete i[t]}return n.exports}o.ab="//";var a=o(552);t.exports=a}()},9720:function(t,e,r){var n=r(1876).Buffer,i=r(3454);!function(){var e={997:function(t){t.exports=function(t,r,n){if(t.filter)return t.filter(r,n);if(void 0===t||null===t)throw new TypeError;if("function"!=typeof r)throw new TypeError;for(var i=[],o=0;o-1?i(r):r}},302:function(t,e,r){"use strict";var n=r(194),i=r(627),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),h=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(n,a,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+h(0,t.length-(arguments.length-1))})}return e};var l=function(){return s(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},981:function(t){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var a=0;a1&&"boolean"!==typeof e)throw new a('"allowMissing" argument must be a boolean');var r=T(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),s=o.name,c=o.value,h=!1,l=o.alias;l&&(n=l[0],w(r,_([0,1],l)));for(var f=1,d=!0;f=r.length){var y=u(c,p);c=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else d=b(c,p),c=c[p];d&&!h&&(v[s]=c)}}return c}},567:function(t,e,r){"use strict";var n="undefined"!==typeof Symbol&&Symbol,i=r(186);t.exports=function(){return"function"===typeof n&&("function"===typeof Symbol&&("symbol"===typeof n("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},186:function(t){"use strict";t.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"===typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"===typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},646:function(t,e,r){"use strict";var n=r(194);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},140:function(t){"function"===typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},749:function(t){"use strict";var e="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(t){return!(e&&t&&"object"===typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===r.call(t)},i=function(t){return!!n(t)||null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Array]"!==r.call(t)&&"[object Function]"===r.call(t.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,t.exports=o?n:i},611:function(t){"use strict";var e=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,o=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(t){}}(),s=a?o(a):{};t.exports=function(t){return"function"===typeof t&&(!!n.test(r.call(t))||(i?o(t)===s:"[object GeneratorFunction]"===e.call(t)))}},387:function(t,e,n){"use strict";var i=n(981),o=n(382),a=n(171),s=a("Object.prototype.toString"),u=n(567)()&&"symbol"===typeof Symbol.toStringTag,c=o(),h=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!d&&function(t){var e=!1;return i(f,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},913:function(t){t.exports=function(t){return t instanceof n}},989:function(t,e,r){"use strict";var n=r(749),i=r(611),o=r(728),a=r(387);function s(t){return t.call.bind(t)}var u="undefined"!==typeof BigInt,c="undefined"!==typeof Symbol,h=s(Object.prototype.toString),l=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(c)var v=s(Symbol.prototype.valueOf);function m(t,e){if("object"!==typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function g(t){return"[object Map]"===h(t)}function y(t){return"[object Set]"===h(t)}function b(t){return"[object WeakMap]"===h(t)}function _(t){return"[object WeakSet]"===h(t)}function w(t){return"[object ArrayBuffer]"===h(t)}function x(t){return"undefined"!==typeof ArrayBuffer&&(w.working?w(t):t instanceof ArrayBuffer)}function E(t){return"[object DataView]"===h(t)}function A(t){return"undefined"!==typeof DataView&&(E.working?E(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!==typeof Promise&&t instanceof Promise||null!==t&&"object"===typeof t&&"function"===typeof t.then&&"function"===typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||A(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},g.working="undefined"!==typeof Map&&g(new Map),e.isMap=function(t){return"undefined"!==typeof Map&&(g.working?g(t):t instanceof Map)},y.working="undefined"!==typeof Set&&y(new Set),e.isSet=function(t){return"undefined"!==typeof Set&&(y.working?y(t):t instanceof Set)},b.working="undefined"!==typeof WeakMap&&b(new WeakMap),e.isWeakMap=function(t){return"undefined"!==typeof WeakMap&&(b.working?b(t):t instanceof WeakMap)},_.working="undefined"!==typeof WeakSet&&_(new WeakSet),e.isWeakSet=function(t){return _(t)},w.working="undefined"!==typeof ArrayBuffer&&w(new ArrayBuffer),e.isArrayBuffer=x,E.working="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=A;var S="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(t){return"[object SharedArrayBuffer]"===h(t)}function k(t){return"undefined"!==typeof S&&("undefined"===typeof T.working&&(T.working=T(new S)),T.working?T(t):t instanceof S)}function R(t){return m(t,l)}function M(t){return m(t,f)}function C(t){return m(t,d)}function P(t){return u&&m(t,p)}function I(t){return c&&m(t,v)}e.isSharedArrayBuffer=k,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===h(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===h(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===h(t)},e.isGeneratorObject=function(t){return"[object Generator]"===h(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===h(t)},e.isNumberObject=R,e.isStringObject=M,e.isBooleanObject=C,e.isBigIntObject=P,e.isSymbolObject=I,e.isBoxedPrimitive=function(t){return R(t)||M(t)||C(t)||P(t)||I(t)},e.isAnyArrayBuffer=function(t){return"undefined"!==typeof Uint8Array&&(x(t)||k(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},467:function(t,e,r){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&e._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),f(n,t,n.depth)}function h(t,e){var r=c.styles[e];return r?"\x1b["+c.colors[r][0]+"m"+t+"\x1b["+c.colors[r][1]+"m":t}function l(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&S(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return b(i)||(i=f(t,i,n)),i}var o=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(y(e))return t.stylize(""+e,"number");if(m(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(S(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return d(r)}var c,h="",l=!1,x=["{","}"];(v(r)&&(l=!0,x=["[","]"]),S(r))&&(h=" [Function"+(r.name?": "+r.name:"")+"]");return w(r)&&(h=" "+RegExp.prototype.toString.call(r)),E(r)&&(h=" "+Date.prototype.toUTCString.call(r)),A(r)&&(h=" "+d(r)),0!==a.length||l&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=l?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,h,x)):x[0]+h+x[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),C(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=g(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function v(t){return Array.isArray(t)}function m(t){return"boolean"===typeof t}function g(t){return null===t}function y(t){return"number"===typeof t}function b(t){return"string"===typeof t}function _(t){return void 0===t}function w(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"===typeof t&&null!==t}function E(t){return x(t)&&"[object Date]"===T(t)}function A(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function S(t){return"function"===typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!a[t])if(s.test(t)){var r=i.pid;a[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(989),e.isArray=v,e.isBoolean=m,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=y,e.isString=b,e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=_,e.isRegExp=w,e.types.isRegExp=w,e.isObject=x,e.isDate=E,e.types.isDate=E,e.isError=A,e.types.isNativeError=A,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=r(913);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",M(),e.format.apply(e,arguments))},e.inherits=r(140),e._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var P="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');if(P&&t[P]){var e;if("function"!==typeof(e=t[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,P,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o0&&u>s&&(u=s);for(var c=0;c=0?(h=p.substr(0,v),l=p.substr(v+1)):(h=p,l=""),f=decodeURIComponent(h),d=decodeURIComponent(l),e(o,f)?Array.isArray(o[f])?o[f].push(d):o[f]=[o[f],d]:o[f]=d}return o}},2361:function(t){"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,r,n,i){return r=r||"&",n=n||"=",null===t&&(t=void 0),"object"===typeof t?Object.keys(t).map((function(i){var o=encodeURIComponent(e(i))+n;return Array.isArray(t[i])?t[i].map((function(t){return o+encodeURIComponent(e(t))})).join(r):o+encodeURIComponent(e(t[i]))})).join(r):i?encodeURIComponent(e(i))+n+encodeURIComponent(e(t)):""}},7673:function(t,e,r){"use strict";e.decode=e.parse=r(2587),e.encode=e.stringify=r(2361)},523:function(t){!function(){"use strict";t.exports={polyfill:function(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style)||!0===t.__forceSmoothScrollPolyfill__){var r,n=t.HTMLElement||t.Element,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},o=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,a=(r=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?p.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):i.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!==typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?i.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!==typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):p.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var t=arguments[0].left,e=arguments[0].top;p.call(this,this,"undefined"===typeof t?this.scrollLeft:~~t,"undefined"===typeof e?this.scrollTop:~~e)}else{if("number"===typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!==typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var r=f(this),n=r.getBoundingClientRect(),o=this.getBoundingClientRect();r!==e.body?(p.call(this,r,r.scrollLeft+o.left-n.left,r.scrollTop+o.top-n.top),"fixed"!==t.getComputedStyle(r).position&&t.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):t.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(t,e){this.scrollLeft=t,this.scrollTop=e}function u(t){if(null===t||"object"!==typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"===typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(t,e){return"Y"===e?t.clientHeight+a1?1:s,r=.5*(1-Math.cos(Math.PI*a)),n=e.startX+(e.x-e.startX)*r,i=e.startY+(e.y-e.startY)*r,e.method.call(e.scrollable,n,i),n===e.x&&i===e.y||t.requestAnimationFrame(d.bind(t,e))}function p(r,n,a){var u,c,h,l,f=o();r===e.body?(u=t,c=t.scrollX||t.pageXOffset,h=t.scrollY||t.pageYOffset,l=i.scroll):(u=r,c=r.scrollLeft,h=r.scrollTop,l=s),d({scrollable:u,method:l,startTime:f,startX:c,startY:h,x:n,y:a})}}}}()},7010:function(t,e,r){"use strict";r.r(e),r.d(e,{assoc:function(){return l},deepMerge:function(){return w},dissoc:function(){return v},get:function(){return u},merge:function(){return b},update:function(){return y}});var n=Array.prototype.slice;function i(t){return"object"===typeof t}function o(t){if(Array.isArray(t))return t.slice();var e={};for(var r in t)e[r]=t[r];return e}function a(t,e,r){return i(t)&&null!==t&&e in t?t[e]:r}function s(t,e,r){var n=e[0],i=e.slice(1);return a(t,n)&&i.length?s(t[n],i,r):a(t,n,r)}function u(t,e,r){return Array.isArray(e)?s(t,e,r):a(t,e,r)}function c(t,e,r){if(t[e]===r)return t;var n=o(t);return n[e]=r,n}function h(t,e,r){if(s(t,e)===r)return t;var n=e[0],i=e.slice(1),a=o(t);return i.length?a[n]=h(n in a?a[n]:{},i,r):a[n]=r,a}function l(t){for(var e,r,n=arguments,i=arguments.length,o=t,a=1;a>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:function(t,e,r){var n=r(1876),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},2480:function(){},943:function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}r.d(e,{Z:function(){return n}})},1357:function(t,e,r){"use strict";r.d(e,{Z:function(){return o}});var n=r(4111),i=r(2222);function o(t,e){return!e||"object"!==(0,i.Z)(e)&&"function"!==typeof e?(0,n.Z)(t):e}},828:function(t,e,r){"use strict";r.d(e,{Z:function(){return o}});var n=r(3375);var i=r(1566);function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||(0,n.Z)(t,e)||(0,i.Z)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},9815:function(t,e,r){"use strict";r.d(e,{Z:function(){return a}});var n=r(943);var i=r(3375);var o=r(1566);function a(t){return function(t){if(Array.isArray(t))return(0,n.Z)(t)}(t)||(0,i.Z)(t)||(0,o.Z)(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.")}()}},2222:function(t,e,r){"use strict";function n(t){return t&&t.constructor===Symbol?"symbol":typeof t}r.d(e,{Z:function(){return n}})},1566:function(t,e,r){"use strict";r.d(e,{Z:function(){return i}});var n=r(943);function i(t,e){if(t){if("string"===typeof t)return(0,n.Z)(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,n.Z)(t,e):void 0}}},6930:function(t,e,r){"use strict";r.d(e,{D0:function(){return c},jm:function(){return a}});var n=r(7294),i=n.createContext(null);function o(t=!0){const e=n.useContext(i);if(t&&null===e)throw new Error("Could not get a container from a context. Did you forget to pass the container through 'ContainerProvider'?");return e}var a=({children:t,container:e,isolated:r=!1})=>{const a=o(!1),s=r?null:a,u=n.useMemo((()=>{const t=e.clone();return s&&t.extend(s),t}),[e,s]);return n.createElement(i.Provider,{value:u},t)},s=n.createContext([]),u=()=>n.useContext(s),c=(...t)=>t.map((t=>()=>(t=>{const e=o(),r=u();return n.useMemo((()=>e.get(t,r)),[t,r,e])})(t)))},4322:function(t,e,r){"use strict";r.d(e,{Lj:function(){return E},W2:function(){return x},r:function(){return v}});var n,i,o,a,s=new WeakMap,u=new Map,c=new Map;(i=n||(n={}))[i.Constant=0]="Constant",i[i.Instance=1]="Instance",i[i.Factory=2]="Factory",(a=o||(o={}))[a.Container=0]="Container",a[a.Resolution=1]="Resolution",a[a.Singleton=2]="Singleton",a[a.Transient=3]="Transient";var h=class{constructor(t){this.impl=t,this.type=n.Instance}},l=class extends h{constructor(){super(...arguments),this.scope=o.Container,this.cache=new WeakMap}},f=class extends h{constructor(){super(...arguments),this.scope=o.Resolution}},d=class extends h{constructor(t){super(t),this.impl=t,this.scope=o.Singleton}},p=class extends h{constructor(){super(...arguments),this.scope=o.Transient}},v=t=>{const e=Symbol(t);return{__t:null,__d:t,__s:e,__o:!1,optional:{__t:null,__d:t,__s:e,__o:!0}}},m=class{constructor(){this.parent=null,this.map=new Map}set(t,e,r=m.notag){const n=this.map.get(e.__s);n?n.set(r,t):this.map.set(e.__s,(new Map).set(r,t))}find(t,e,r){const n=this.map.get(t.__s);if(void 0!==n){if(r){const t=n.get(r);if(t)return t}if(e)for(let t=0,r=e.length;t{e.map.set(n,t(r))})),e}clone(){return this.from((t=>new Map(t)))}},g=m;g.notag=Symbol("NO_TAG");var y=class{constructor(t,e){this.vault=t,this.condition=e}static vault(t){return t.vault}bind(t){return new class{constructor(t,e,r){this.vault=t,this.token=e,this.condition=r}toConstant(t){this.vault.set(new class{constructor(t){this.impl=t,this.type=n.Constant}}(t),this.token,this.condition)}toFactory(t,e){this.vault.set(new class{constructor(t){this.impl=t,this.type=n.Factory}}({creator:t,initializer:e}),this.token,this.condition)}toInstance(t){return new class{constructor(t,e,r,n){this.vault=t,this.impl=e,this.token=r,this.condition=n}inContainerScope(){this.set(l)}inResolutionScope(){this.set(f)}inSingletonScope(){this.set(d)}inTransientScope(){this.set(p)}set(t){this.vault.set(new t(this.impl),this.token,this.condition)}}(this.vault,t,this.token,this.condition)}}(this.vault,t,this.condition)}use(...t){return new class{constructor(t,e,r,n){this.vault=t,this.tokens=e,this.getVault=r,this.condition=n}from(t){const{tokens:e}=this;for(let r=0,n=e.length;rthis.resolveToken(t,r,n,e.split())))}resolveToken(t,e,r,n=new w){const i=this.vault.get(t,n,e,r);if(i)return this.resolveBinding(i,n);if(!t.__o)throw new Error(`No matching bindings found for '${t.__d}' token.`)}resolveBinding(t,e){return(t=>t.type===n.Instance)(t)?(t=>t.scope===o.Singleton)(t)?this.resolveCache(t,e,(()=>t.cache),(e=>{t.cache=e})):(t=>t.scope===o.Container)(t)?this.resolveCache(t,e,(()=>t.cache.get(this.vault)),(e=>{t.cache.set(this.vault,e)})):(t=>t.scope===o.Resolution)(t)?this.resolveCache(t,e,(()=>e.instances.get(t)),(r=>{e.instances.set(t,r)})):this.createInstance(t.impl,e):(t=>t.type===n.Factory)(t)?(...r)=>{const n=this.createInstance(t.impl.creator,e);return n instanceof Promise?n.then((e=>x.resolveInitialization(e,r,t.impl.initializer))):x.resolveInitialization(n,r,t.impl.initializer)}:t.impl}resolveCache(t,e,r,n){const i=r();if(void 0!==i)return i;const o=this.createInstance(t.impl,e);return n(o),o}createInstance(t,e){const r=this.getParameters(t,e),n=s.get(t);if(void 0!==n)return n?t(...r):new t(...r);try{const e=t(...r);return s.set(t,!0),e}catch(i){const e=new t(...r);return s.set(t,!1),e}}getParameters(t,e){const r=u.get(t);if(r)return this.resolveTokens(r,e,c.get(t),t);if(0===t.length)return[];throw new Error(`Missing required 'injected' registration of '${t.name}'`)}static resolveInitialization(t,e,r){const n=null==r?void 0:r(t,...e);return n instanceof Promise?n.then((()=>t)):t}},E=(t,...e)=>(u.set(t,e),t)},1808:function(t,e,r){"use strict";r.d(e,{MxU:function(){return X},W20:function(){return o.W2},TCu:function(){return Sr},jyi:function(){return a.j},xEZ:function(){return i.xE}});var n=r(1438),i=r(5807),o=r(2631),a=r(1230),s=new i.y3;o.s$.prototype._cacheAsBitmap=!1,o.s$.prototype._cacheData=null,o.s$.prototype._cacheAsBitmapResolution=null,o.s$.prototype._cacheAsBitmapMultisample=null;var u=function t(){(0,n.Z)(this,t),this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(o.s$.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new u),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),o.s$.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},o.s$.prototype._initCachedDisplayObject=function(t){var e,r;if(!(null===(e=this._cacheData)||void 0===e?void 0:e.sprite)){var n=this.alpha;this.alpha=1,t.batch.flush();var o=this.getLocalBounds(new i.Ae,!0);if(null===(r=this.filters)||void 0===r?void 0:r.length){var u=this.filters[0].padding;o.pad(u)}var c,h=this.cacheAsBitmapResolution||t.resolution;o.ceil(h),o.width=Math.max(o.width,1/h),o.height=Math.max(o.height,1/h);var l=t.renderTexture.current,f=t.renderTexture.sourceFrame.clone(),d=t.renderTexture.destinationFrame.clone(),p=t.projection.transform,v=i.TI.create({width:o.width,height:o.height,resolution:h,multisample:null!==(c=this.cacheAsBitmapMultisample)&&void 0!==c?c:t.multisample}),m="cacheAsBitmap_".concat(i.P6.uid());this._cacheData.textureCacheId=m,i.VL.addToCache(v.baseTexture,m),i.xE.addToCache(v,m);var g=this.transform.localTransform.copyTo(s).invert().translate(-o.x,-o.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:v,clear:!0,transform:g,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=p,t.renderTexture.bind(l,f,d),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var y=new a.j(v);y.transform.worldTransform=this.transform.worldTransform,y.anchor.x=-o.x/o.width,y.anchor.y=-o.y/o.height,y.alpha=n,y._bounds=this._bounds,this._cacheData.sprite=y,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=y.containsPoint.bind(y)}},o.s$.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},o.s$.prototype._initCachedDisplayObjectCanvas=function(t){var e;if(!(null===(e=this._cacheData)||void 0===e?void 0:e.sprite)){var r=this.getLocalBounds(new i.Ae,!0),n=this.alpha;this.alpha=1;var o=t.canvasContext.activeContext,u=t._projTransform,c=this.cacheAsBitmapResolution||t.resolution;r.ceil(c),r.width=Math.max(r.width,1/c),r.height=Math.max(r.height,1/c);var h=i.TI.create({width:r.width,height:r.height,resolution:c}),l="cacheAsBitmap_".concat(i.P6.uid());this._cacheData.textureCacheId=l,i.VL.addToCache(h.baseTexture,l),i.xE.addToCache(h,l);var f=s;this.transform.localTransform.copyTo(f),f.invert(),f.tx-=r.x,f.ty-=r.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:h,clear:!0,transform:f,skipUpdateTransform:!1}),t.canvasContext.activeContext=o,t._projTransform=u,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var d=new a.j(h);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-r.x/r.width,d.anchor.y=-r.y/r.height,d.alpha=n,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=d.containsPoint.bind(d)}},o.s$.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},o.s$.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},o.s$.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,i.VL.removeFromCache(this._cacheData.textureCacheId),i.xE.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},o.s$.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},o.s$.prototype.name=null,o.W2.prototype.getChildByName=function(t,e){for(var r=0,n=this.children.length;r0&&void 0!==arguments[0]?arguments[0]:new i.E9,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};var c=r(2951),h=r(8029),l=r(1357),f=r(1418),d="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",p=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,n.Z)(this,r),(t=e.call(this,i.kP,d,{uAlpha:1})).alpha=o,(0,l.Z)(t)}return(0,c.Z)(r,[{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t}}]),r}(i.wn),v={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},m=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n");function g(t){for(var e,r=v[t],n=r.length,i=m,o="",a=0;a=n&&(e=t-a-1),o+=s=s.replace("%value%",r[e].toString()),o+="\n"}return i=(i=i.replace("%blur%",o)).replace("%size%",t.toString())}function y(t,e){var r,n=Math.ceil(t/2),i="\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }",o="";r=e?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:8,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.wn.defaultResolution,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5;(0,n.Z)(this,r);var h=y(c,t),f=g(c);return(o=e.call(this,h,f)).horizontal=t,o.resolution=u,o._quality=0,o.quality=s,o.blur=a,(0,l.Z)(o)}return(0,c.Z)(r,[{key:"apply",value:function(t,e,r,n){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,n);else{var o=t.getFilterTexture(),a=t.renderer,s=e,u=o;this.state.blend=!1,t.applyFilter(this,s,u,i.yl.CLEAR);for(var c=1;c0&&void 0!==arguments[0]?arguments[0]:8,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.wn.defaultResolution,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;return(0,n.Z)(this,r),(t=e.call(this))._repeatEdgePixels=!1,t.blurXFilter=new b(!0,o,a,s,u),t.blurYFilter=new b(!1,o,a,s,u),t.resolution=s,t.quality=a,t.blur=o,t.repeatEdgePixels=!1,(0,l.Z)(t)}return(0,c.Z)(r,[{key:"apply",value:function(t,e,r,n){var o=Math.abs(this.blurXFilter.strength),a=Math.abs(this.blurYFilter.strength);if(o&&a){var s=t.getFilterTexture();this.blurXFilter.apply(t,e,s,i.yl.CLEAR),this.blurYFilter.apply(t,s,r,n),t.returnFilterTexture(s)}else a?this.blurYFilter.apply(t,e,r,n):this.blurXFilter.apply(t,e,r,n)}},{key:"updatePadding",value:function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}},{key:"blur",get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()}},{key:"quality",get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t}},{key:"blurX",get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()}},{key:"blurY",get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()}},{key:"blendMode",get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t}},{key:"repeatEdgePixels",get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()}}]),r}(i.wn),w=r(828),x=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(){var t;(0,n.Z)(this,r);var o={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(t=e.call(this,i.Y9,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",o)).alpha=1,(0,l.Z)(t)}return(0,c.Z)(r,[{key:"_loadMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r}},{key:"_multiply",value:function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t}},{key:"_colorMatrix",value:function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}},{key:"brightness",value:function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)}},{key:"tint",value:function(t,e){var r=(0,w.Z)(i.Il.shared.setValue(t).toArray(),3),n=[r[0],0,0,0,0,0,r[1],0,0,0,0,0,r[2],0,0,0,0,0,1,0];this._loadMatrix(n,e)}},{key:"greyscale",value:function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)}},{key:"blackAndWhite",value:function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)}},{key:"hue",value:function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),n=Math.sin(t),i=1/3,o=(0,Math.sqrt)(i),a=[r+(1-r)*i,i*(1-r)-o*n,i*(1-r)+o*n,0,0,i*(1-r)+o*n,r+i*(1-r),i*(1-r)-o*n,0,0,i*(1-r)-o*n,i*(1-r)+o*n,r+i*(1-r),0,0,0,0,0,1,0];this._loadMatrix(a,e)}},{key:"contrast",value:function(t,e){var r=(t||0)+1,n=-.5*(r-1),i=[r,0,0,0,n,0,r,0,0,n,0,0,r,0,n,0,0,0,1,0];this._loadMatrix(i,e)}},{key:"saturate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0,r=2*t/3+1,n=-.5*(r-1),i=[r,n,n,0,0,n,r,n,0,0,n,n,r,0,0,0,0,0,1,0];this._loadMatrix(i,e)}},{key:"desaturate",value:function(){this.saturate(-1)}},{key:"negative",value:function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)}},{key:"sepia",value:function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)}},{key:"technicolor",value:function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)}},{key:"polaroid",value:function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)}},{key:"toBGR",value:function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)}},{key:"kodachrome",value:function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)}},{key:"browni",value:function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)}},{key:"vintage",value:function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)}},{key:"colorTone",value:function(t,e,r,n,o){t=t||.2,e=e||.15,r=r||16770432,n=n||3375104;var a=i.Il.shared,s=(0,w.Z)(a.setValue(r).toArray(),3),u=s[0],c=s[1],h=s[2],l=(0,w.Z)(a.setValue(n).toArray(),3),f=l[0],d=l[1],p=l[2],v=[.3,.59,.11,0,0,u,c,h,t,0,f,d,p,e,0,u-f,c-d,h-p,0,0];this._loadMatrix(v,o)}},{key:"night",value:function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)}},{key:"predator",value:function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)}},{key:"lsd",value:function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)}},{key:"reset",value:function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)}},{key:"matrix",get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t}}]),r}(i.wn);x.prototype.grayscale=x.prototype.greyscale;var E=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(t,o){var a;(0,n.Z)(this,r);var s=new i.y3;return t.renderable=!1,(a=e.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})).maskSprite=t,a.maskMatrix=s,null==o&&(o=20),a.scale=new i.E9(o,o),(0,l.Z)(a)}return(0,c.Z)(r,[{key:"apply",value:function(t,e,r,n){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var i=this.maskSprite.worldTransform,o=Math.sqrt(i.a*i.a+i.b*i.b),a=Math.sqrt(i.c*i.c+i.d*i.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=i.a/o,this.uniforms.rotation[1]=i.b/o,this.uniforms.rotation[2]=i.c/a,this.uniforms.rotation[3]=i.d/a),t.applyFilter(this,e,r,n)}},{key:"map",get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t}}]),r}(i.wn),A=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(){return(0,n.Z)(this,r),e.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')}return r}(i.wn),S="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",T=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random();return(0,n.Z)(this,r),(t=e.call(this,i.Y9,S,{uNoise:0,uSeed:0})).noise=o,t.seed=a,(0,l.Z)(t)}return(0,c.Z)(r,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t}}]),r}(i.wn);const k={AlphaFilter:p,BlurFilter:_,BlurFilterPass:b,ColorMatrixFilter:x,DisplacementFilter:E,FXAAFilter:A,NoiseFilter:T};Object.entries(k).forEach((([t,e])=>{Object.defineProperty(k,t,{get:()=>(i.P6.deprecation("7.1.0",`filters.${t} has moved to ${t}`),e)})}));var R=r(2670),M=new(function(){function t(){(0,n.Z)(this,t),this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}return(0,c.Z)(t,[{key:"init",value:function(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}},{key:"pauseUpdate",get:function(){return this._pauseUpdate},set:function(t){this._pauseUpdate=t}},{key:"addTickerListener",value:function(){this.tickerAdded||!this.domElement||(i.vB.system.add(this.tickerUpdate,this,i.uF.INTERACTION),this.tickerAdded=!0)}},{key:"removeTickerListener",value:function(){this.tickerAdded&&(i.vB.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}},{key:"pointerMoved",value:function(){this._didMove=!0}},{key:"update",value:function(){if(this.domElement&&!this._pauseUpdate)if(this._didMove)this._didMove=!1;else{var t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}}},{key:"tickerUpdate",value:function(t){this._deltaTime+=t,!(this._deltaTime=0;o--)if(t.currentTarget=r[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"all",value:function(t,e){var r=function(e){o.forEach((function(r){t.currentTarget=n[e],i.notifyTarget(t,r)}))},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._allInteractiveElements,i=this;if(0!==n.length){t.eventPhase=t.BUBBLING_PHASE;for(var o=Array.isArray(e)?e:[e],a=n.length-1;a>=0;a--)r(a)}}},{key:"propagationPath",value:function(t){for(var e=[t],r=0;r<2048&&t!==this.rootTarget;r++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}},{key:"hitTestMoveRecursive",value:function(t,e,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=!1;if(this._interactivePrune(t))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(M.pauseUpdate=!1),t.interactiveChildren&&t.children)for(var s=t.children,u=s.length-1;u>=0;u--){var c=s[u],h=this.hitTestMoveRecursive(c,this._isInteractive(e)?e:c.eventMode,r,n,i,o||i(t,r));if(h){if(h.length>0&&!h[h.length-1].parent)continue;var l=t.isInteractive();(h.length>0||l)&&(l&&this._allInteractiveElements.push(t),h.push(t)),0===this._hitElements.length&&(this._hitElements=h),a=!0}}var f=this._isInteractive(e),d=t.isInteractive();return d&&d&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a?this._hitElements:f&&!i(t,r)&&n(t,r)?d?[t]:[]:null}},{key:"hitTestRecursive",value:function(t,e,r,n,i){if(this._interactivePrune(t)||i(t,r))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(M.pauseUpdate=!1),t.interactiveChildren&&t.children)for(var o=t.children,a=o.length-1;a>=0;a--){var s=o[a],u=this.hitTestRecursive(s,this._isInteractive(e)?e:s.eventMode,r,n,i);if(u){if(u.length>0&&!u[u.length-1].parent)continue;var c=t.isInteractive();return(u.length>0||c)&&u.push(t),u}}var h=this._isInteractive(e),l=t.isInteractive();return h&&n(t,r)?l?[t]:[]:null}},{key:"_isInteractive",value:function(t){return"static"===t||"dynamic"===t}},{key:"_interactivePrune",value:function(t){return!(t&&!t.isMask&&t.visible&&t.renderable&&"none"!==t.eventMode&&("passive"!==t.eventMode||t.interactiveChildren)&&!t.isMask)}},{key:"hitPruneFn",value:function(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,N),!t.hitArea.contains(N.x,N.y)))return!0;if(t._mask){var r,n=t._mask.isMaskData?t._mask.maskObject:t._mask;if(n&&!(null===(r=n.containsPoint)||void 0===r?void 0:r.call(n,e)))return!0}return!1}},{key:"hitTestFn",value:function(t,e){return"passive"!==t.eventMode&&(!!t.hitArea||!!t.containsPoint&&t.containsPoint(e))}},{key:"notifyTarget",value:function(t,e){var r,n;e=null!==e&&void 0!==e?e:t.type;var i="on".concat(e);null===(n=(r=t.currentTarget)[i])||void 0===n||n.call(r,t);var o=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,o),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"mapPointerDown",value:function(t){if((0,R.Z)(t,I)){var e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var r=2===e.button;this.dispatchEvent(e,r?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}else console.warn("EventBoundary cannot map a non-pointer event as a pointer event")}},{key:"mapPointerMove",value:function(t){var e,r;if((0,R.Z)(t,I)){this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;var n=this.createPointerEvent(t);this._isPointerMoveEvent=!1;var i,o="mouse"===n.pointerType||"pen"===n.pointerType,a=this.trackingData(t.pointerId),s=this.findMountedTarget(a.overTargets);if((null===(e=a.overTargets)||void 0===e?void 0:e.length)>0&&s!==n.target){var u="mousemove"===t.type?"mouseout":"pointerout",c=this.createPointerEvent(t,u,s);if(this.dispatchEvent(c,"pointerout"),o&&this.dispatchEvent(c,"mouseout"),!n.composedPath().includes(s)){var h=this.createPointerEvent(t,"pointerleave",s);for(h.eventPhase=h.AT_TARGET;h.target&&!n.composedPath().includes(h.target);)h.currentTarget=h.target,this.notifyTarget(h),o&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;this.freeEvent(h)}this.freeEvent(c)}if(s!==n.target){var l="mousemove"===t.type?"mouseover":"pointerover",f=this.clonePointerEvent(n,l);this.dispatchEvent(f,"pointerover"),o&&this.dispatchEvent(f,"mouseover");for(var d=null===s||void 0===s?void 0:s.parent;d&&d!==this.rootTarget.parent&&d!==n.target;)d=d.parent;if(!d||d===this.rootTarget.parent){var p=this.clonePointerEvent(n,"pointerenter");for(p.eventPhase=p.AT_TARGET;p.target&&p.target!==s&&p.target!==this.rootTarget.parent;)p.currentTarget=p.target,this.notifyTarget(p),o&&this.notifyTarget(p,"mouseenter"),p.target=p.target.parent;this.freeEvent(p)}this.freeEvent(f)}var v=[],m=null===(i=this.enableGlobalMoveEvents)||void 0===i||i;this.moveOnAll?v.push("pointermove"):this.dispatchEvent(n,"pointermove"),m&&v.push("globalpointermove"),"touch"===n.pointerType&&(this.moveOnAll?v.splice(1,0,"touchmove"):this.dispatchEvent(n,"touchmove"),m&&v.push("globaltouchmove")),o&&(this.moveOnAll?v.splice(1,0,"mousemove"):this.dispatchEvent(n,"mousemove"),m&&v.push("globalmousemove"),this.cursor=null===(r=n.target)||void 0===r?void 0:r.cursor),v.length>0&&this.all(n,v),this._allInteractiveElements.length=0,this._hitElements.length=0,a.overTargets=n.composedPath(),this.freeEvent(n)}else console.warn("EventBoundary cannot map a non-pointer event as a pointer event")}},{key:"mapPointerOver",value:function(t){var e;if((0,R.Z)(t,I)){var r=this.trackingData(t.pointerId),n=this.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;this.dispatchEvent(n,"pointerover"),i&&this.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(this.cursor=null===(e=n.target)||void 0===e?void 0:e.cursor);var o=this.clonePointerEvent(n,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;r.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(o)}else console.warn("EventBoundary cannot map a non-pointer event as a pointer event")}},{key:"mapPointerOut",value:function(t){if((0,R.Z)(t,I)){var e=this.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,n=this.findMountedTarget(e.overTargets),i=this.createPointerEvent(t,"pointerout",n);this.dispatchEvent(i),r&&this.dispatchEvent(i,"mouseout");var o=this.createPointerEvent(t,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),r&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;e.overTargets=null,this.freeEvent(i),this.freeEvent(o)}this.cursor=null}else console.warn("EventBoundary cannot map a non-pointer event as a pointer event")}},{key:"mapPointerUp",value:function(t){if((0,R.Z)(t,I)){var e=performance.now(),r=this.createPointerEvent(t);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){var n=2===r.button;this.dispatchEvent(r,n?"rightup":"mouseup")}var i=this.trackingData(t.pointerId),o=this.findMountedTarget(i.pressTargetsByButton[t.button]),a=o;if(o&&!r.composedPath().includes(o)){for(var s=o;s&&!r.composedPath().includes(s);){if(r.currentTarget=s,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){var u=2===r.button;this.notifyTarget(r,u?"rightupoutside":"mouseupoutside")}s=s.parent}delete i.pressTargetsByButton[t.button],a=s}if(a){var c=this.clonePointerEvent(r,"click");c.target=a,c.path=null,i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:e});var h=i.clicksByButton[t.button];if(h.target===c.target&&e-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=c.target,h.timeStamp=e,c.detail=h.clickCount,"mouse"===c.pointerType){var l=2===c.button;this.dispatchEvent(c,l?"rightclick":"click")}else"touch"===c.pointerType&&this.dispatchEvent(c,"tap");this.dispatchEvent(c,"pointertap"),this.freeEvent(c)}this.freeEvent(r)}else console.warn("EventBoundary cannot map a non-pointer event as a pointer event")}},{key:"mapPointerUpOutside",value:function(t){if((0,R.Z)(t,I)){var e=this.trackingData(t.pointerId),r=this.findMountedTarget(e.pressTargetsByButton[t.button]),n=this.createPointerEvent(t);if(r){for(var i=r;i;)n.currentTarget=i,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):("mouse"===n.pointerType||"pen"===n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),i=i.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(n)}else console.warn("EventBoundary cannot map a non-pointer event as a pointer event")}},{key:"mapWheel",value:function(t){if((0,R.Z)(t,O)){var e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}else console.warn("EventBoundary cannot map a non-wheel event as a wheel event")}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[0],r=1;r0&&(e=t.composedPath()[0]);for(var r=e!==this.domElement?"outside":"",n=this.normalizeToPointerData(t),i=0,o=n.length;i"u"&&(i.button=0),(0,U.Z)(i.buttons)>"u"&&(i.buttons=1),(0,U.Z)(i.isPrimary)>"u"&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),(0,U.Z)(i.width)>"u"&&(i.width=i.radiusX||1),(0,U.Z)(i.height)>"u"&&(i.height=i.radiusY||1),(0,U.Z)(i.tiltX)>"u"&&(i.tiltX=0),(0,U.Z)(i.tiltY)>"u"&&(i.tiltY=0),(0,U.Z)(i.pointerType)>"u"&&(i.pointerType="touch"),(0,U.Z)(i.pointerId)>"u"&&(i.pointerId=i.identifier||0),(0,U.Z)(i.pressure)>"u"&&(i.pressure=i.force||.5),(0,U.Z)(i.twist)>"u"&&(i.twist=0),(0,U.Z)(i.tangentialPressure)>"u"&&(i.tangentialPressure=0),(0,U.Z)(i.layerX)>"u"&&(i.layerX=i.offsetX=i.clientX),(0,U.Z)(i.layerY)>"u"&&(i.layerY=i.offsetY=i.clientY),i.isNormalized=!0,i.type=t.type,e.push(i)}else if(globalThis.MouseEvent&&(!(0,R.Z)(t,MouseEvent)||this.supportsPointerEvents&&(0,R.Z)(t,globalThis.PointerEvent)))e.push(t);else{var o=t;(0,U.Z)(o.isPrimary)>"u"&&(o.isPrimary=!0),(0,U.Z)(o.width)>"u"&&(o.width=1),(0,U.Z)(o.height)>"u"&&(o.height=1),(0,U.Z)(o.tiltX)>"u"&&(o.tiltX=0),(0,U.Z)(o.tiltY)>"u"&&(o.tiltY=0),(0,U.Z)(o.pointerType)>"u"&&(o.pointerType="mouse"),(0,U.Z)(o.pointerId)>"u"&&(o.pointerId=1),(0,U.Z)(o.pressure)>"u"&&(o.pressure=.5),(0,U.Z)(o.twist)>"u"&&(o.twist=0),(0,U.Z)(o.tangentialPressure)>"u"&&(o.tangentialPressure=0),o.isNormalized=!0,e.push(o)}return e}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}},{key:"bootstrapEvent",value:function(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=F[t.type]||t.type),t}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}}],[{key:"defaultEventMode",get:function(){return this._defaultEventMode}}]),t}();j.extension={name:"events",type:[i.nw.RendererSystem,i.nw.CanvasRendererSystem]},j.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};var Z=j;function H(t){return"dynamic"===t||"static"===t}i.Rw.add(Z);var G={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){var t;return null!==(t=this._internalInteractive)&&void 0!==t?t:H(Z.defaultEventMode)},set interactive(t){i.P6.deprecation("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=t,this.eventMode=t?"static":"auto"},_internalEventMode:void 0,get eventMode(){var t;return null!==(t=this._internalEventMode)&&void 0!==t?t:Z.defaultEventMode},set eventMode(t){this._internalInteractive=H(t),this._internalEventMode=t},isInteractive:function(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener:function(t,e,r){var n="function"==typeof e?void 0:e;t="boolean"==typeof r&&r||"object"==typeof r&&r.capture?"".concat(t,"capture"):t,e="function"==typeof e?e:e.handleEvent,this.on(t,e,n)},removeEventListener:function(t,e,r){var n="function"==typeof e?void 0:e;t="boolean"==typeof r&&r||"object"==typeof r&&r.capture?"".concat(t,"capture"):t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,n)},dispatchEvent:function(t){if(!(0,R.Z)(t,C))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};o.s$.mixin(G);o.s$.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var V=100,z=function(){function t(e){(0,n.Z)(this,t),this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(i.P6.isMobile.tablet||i.P6.isMobile.phone)&&this.createTouchHook();var r=document.createElement("div");r.style.width="".concat(V,"px"),r.style.height="".concat(V,"px"),r.style.position="absolute",r.style.top="".concat(0,"px"),r.style.left="".concat(0,"px"),r.style.zIndex=2..toString(),this.div=r,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return(0,c.Z)(t,[{key:"isActive",get:function(){return this._isActive}},{key:"isMobileAccessibility",get:function(){return this._isMobileAccessibility}},{key:"createTouchHook",value:function(){var t=this,e=document.createElement("button");e.style.width="".concat(1,"px"),e.style.height="".concat(1,"px"),e.style.position="absolute",e.style.top="".concat(-1e3,"px"),e.style.left="".concat(-1e3,"px"),e.style.zIndex=2..toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",(function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e}},{key:"destroyTouchHook",value:function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}},{key:"activate",value:function(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(t=this.renderer.view.parentNode)||void 0===t||t.appendChild(this.div))}},{key:"deactivate",value:function(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(t=this.div.parentNode)||void 0===t||t.removeChild(this.div))}},{key:"updateAccessibleObjects",value:function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);var e=t.children;if(e)for(var r=0;r title : ").concat(t.title,"
tabIndex: ").concat(t.tabIndex)}},{key:"capHitArea",value:function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,r=e.width,n=e.height;t.x+t.width>r&&(t.width=r-t.x),t.y+t.height>n&&(t.height=n-t.y)}},{key:"addChild",value:function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="".concat(V,"px"),e.style.height="".concat(V,"px"),e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:(!t.accessibleHint||null===t.accessibleHint)&&(e.title="displayObject ".concat(t.tabIndex)),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}},{key:"_dispatchEvent",value:function(t,e){var r=t.target.displayObject,n=this.renderer.events.rootBoundary,i=Object.assign(new C(n),{target:r});n.rootTarget=this.renderer.lastObjectRendered,e.forEach((function(t){return n.dispatchEvent(i,t)}))}},{key:"_onClick",value:function(t){this._dispatchEvent(t,["click","pointertap","tap"])}},{key:"_onFocus",value:function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}},{key:"_onFocusOut",value:function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}},{key:"_onKeyDown",value:function(t){9===t.keyCode&&this.activate()}},{key:"_onMouseMove",value:function(t){0===t.movementX&&0===t.movementY||this.deactivate()}},{key:"destroy",value:function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}]),t}();z.extension={name:"accessibility",type:[i.nw.RendererPlugin,i.nw.CanvasRendererPlugin]},i.Rw.add(z);var W=function(){function t(e){var r=this;(0,n.Z)(this,t),this.stage=new o.W2,e=Object.assign({forceCanvas:!1},e),this.renderer=(0,i.e6)(e),t._plugins.forEach((function(t){t.init.call(r,e)}))}return(0,c.Z)(t,[{key:"render",value:function(){this.renderer.render(this.stage)}},{key:"view",get:function(){var t;return null===(t=this.renderer)||void 0===t?void 0:t.view}},{key:"screen",get:function(){var t;return null===(t=this.renderer)||void 0===t?void 0:t.screen}},{key:"destroy",value:function(e,r){var n=this,i=t._plugins.slice(0);i.reverse(),i.forEach((function(t){t.destroy.call(n)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}}]),t}();W._plugins=[];var X=W;i.Rw.handleByList(i.nw.Application,X._plugins);var q=function(){function t(){(0,n.Z)(this,t)}return(0,c.Z)(t,null,[{key:"init",value:function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame((function(){return e.resize()})))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){var t,r;if(e.cancelResize(),e._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{var n=e._resizeTo;t=n.clientWidth,r=n.clientHeight}e.renderer.resize(t,r),e.render()}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}},{key:"destroy",value:function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}]),t}();q.extension=i.nw.Application,i.Rw.add(q);var Y={loader:i.nw.LoadParser,resolver:i.nw.ResolveParser,cache:i.nw.CacheParser,detection:i.nw.DetectionParser};i.Rw.handle(i.nw.Asset,(function(t){var e,r=t.ref;Object.entries(Y).filter((function(t){var e=(0,w.Z)(t,1)[0];return!!r[e]})).forEach((function(t){var n=(0,w.Z)(t,2),o=n[0],a=n[1];return i.Rw.add(Object.assign(r[o],{extension:null!==(e=r[o].extension)&&void 0!==e?e:a}))}))}),(function(t){var e=t.ref;Object.keys(Y).filter((function(t){return!!e[t]})).forEach((function(t){return i.Rw.remove(e[t])}))}));var K=r(7568),J=r(9815),$=r(4051),Q=r.n($),tt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,n.Z)(this,t),this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=r}return(0,c.Z)(t,[{key:"add",value:function(t){var e=this;t.forEach((function(t){e._assetList.push(t)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}},{key:"_next",value:function(){var t=this;return(0,K.Z)(Q().mark((function e(){var r,n,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._assetList.length||!t._isActive){e.next=8;break}for(t._isLoading=!0,r=[],n=Math.min(t._assetList.length,t._maxConcurrent),i=0;i2&&void 0!==arguments[2]&&arguments[2];return Array.isArray(t)||(t=[t]),e?t.map((function(t){return"string"==typeof t||r?e(t):t})):t},nt=new(function(){function t(){(0,n.Z)(this,t),this._parsers=[],this._cache=new Map,this._cacheMap=new Map}return(0,c.Z)(t,[{key:"reset",value:function(){this._cacheMap.clear(),this._cache.clear()}},{key:"has",value:function(t){return this._cache.has(t)}},{key:"get",value:function(t){var e=this._cache.get(t);return e||console.warn("[Assets] Asset id ".concat(t," was not found in the Cache")),e}},{key:"set",value:function(t,e){for(var r,n=this,o=rt(t),a=0;a0,o=!0,a=!1,s=void 0;try{for(var u,c=r[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){if(!u.value.match(vt)){n=!1;break}}}catch(l){a=!0,s=l}finally{try{o||null==c.return||c.return()}finally{if(a)throw s}}var h=r.join(" ");return n||(h='"'.concat(h.replace(/[\\"]/g,"\\$&"),'"')),h}var gt={extension:{type:i.nw.LoadParser,priority:ut.Low},name:"loadWebFont",test:function(t){return ct(t,pt)||et(t,dt)},load:function(t,e){return(0,K.Z)(Q().mark((function r(){var n,o,a,s,u,c,h,l,f,d,p,v,m,g;return Q().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(n=i.Xd.ADAPTER.getFontFaceSet())){r.next=16;break}l=[],f=null!==(u=null===(o=e.data)||void 0===o?void 0:o.family)&&void 0!==u?u:mt(t),d=null!==(c=null===(a=e.data)||void 0===a||null===(s=a.weights)||void 0===s?void 0:s.filter((function(t){return ft.includes(t)})))&&void 0!==c?c:["normal"],p=null!==(h=e.data)&&void 0!==h?h:{},v=0;case 6:if(!(v { self.postMessage(result); });\n ")},xt="\n async function loadImageBitmap(url)\n {\n const response = await fetch(url);\n\n if (!response.ok)\n {\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: `\n + `${response.status} ${response.statusText}`);\n }\n\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n\n return imageBitmap;\n }\n self.onmessage = async (event) =>\n {\n try\n {\n const imageBitmap = await loadImageBitmap(event.data.data[0]);\n\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id,\n }, [imageBitmap]);\n }\n catch(e)\n {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id,\n });\n }\n };",Et=new(function(){function t(){(0,n.Z)(this,t),this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}return(0,c.Z)(t,[{key:"isImageBitmapSupported",value:function(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise((function(t){var e=URL.createObjectURL(new Blob([wt.code],{type:"application/javascript"})),r=new Worker(e);r.addEventListener("message",(function(n){r.terminate(),URL.revokeObjectURL(e),t(n.data)}))}))),this._isImageBitmapSupported}},{key:"loadImageBitmap",value:function(t){return this._run("loadImageBitmap",[t])}},{key:"_initWorkers",value:function(){var t=this;return(0,K.Z)(Q().mark((function e(){return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t._initialized||(t._initialized=!0);case 1:case"end":return e.stop()}}),e)})))()}},{key:"getWorker",value:function(){var t=this;void 0===yt&&(yt=navigator.hardwareConcurrency||4);var e=this.workerPool.pop();return!e&&this._createdWorkers0&&void 0!==arguments[0]?arguments[0]:{},e=this;return(0,K.Z)(Q().mark((function r(){var n,i,o,a,s,u,c;return Q().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e._initialized){r.next=4;break}return console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?"),r.abrupt("return");case 4:if(e._initialized=!0,t.defaultSearchParams&&e.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(e.resolver.basePath=t.basePath),t.bundleIdentifier&&e.resolver.setBundleIdentifier(t.bundleIdentifier),!t.manifest){r.next=12;break}if(o=t.manifest,r.t0="string"==typeof o,!r.t0){r.next=11;break}return r.next=10,e.load(o);case 10:o=r.sent;case 11:e.resolver.addManifest(o);case 12:return s=null!==(a=null===(n=t.texturePreference)||void 0===n?void 0:n.resolution)&&void 0!==a?a:1,u="number"==typeof s?[s]:s,r.next=17,e._detectFormats({preferredFormats:null===(i=t.texturePreference)||void 0===i?void 0:i.format,skipDetections:t.skipDetections,detections:e._detections});case 17:c=r.sent,e.resolver.prefer({params:{format:c,resolution:u}}),t.preferences&&e.setPreferences(t.preferences);case 19:case"end":return r.stop()}}),r)})))()}},{key:"add",value:function(t,e,r,n,i){this.resolver.add(t,e,r,n,i)}},{key:"load",value:function(t,e){var r=this;return(0,K.Z)(Q().mark((function n(){var i,o,a,s;return Q().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=r._initialized,n.t0){n.next=4;break}return n.next=4,r.init();case 4:return i=at(t),o=rt(t).map((function(t){if("string"!=typeof t){var e=r.resolver.getAlias(t);return e.some((function(t){return!r.resolver.hasKey(t)}))&&r.add(t),Array.isArray(e)?e[0]:e}return r.resolver.hasKey(t)||r.add({alias:t,src:t}),t})),a=r.resolver.resolve(o),n.next=9,r._mapLoadToResolve(a,e);case 9:return s=n.sent,n.abrupt("return",i?s[o[0]]:s);case 11:case"end":return n.stop()}}),n)})))()}},{key:"addBundle",value:function(t,e){this.resolver.addBundle(t,e)}},{key:"loadBundle",value:function(t,e){var r=this;return(0,K.Z)(Q().mark((function n(){var i,o,a,s,u,c,h,l;return Q().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=r._initialized,n.t0){n.next=4;break}return n.next=4,r.init();case 4:return i=!1,"string"==typeof t&&(i=!0,t=[t]),o=r.resolver.resolveBundle(t),a={},s=Object.keys(o),u=0,c=0,h=function(){null===e||void 0===e||e(++u/c)},l=s.map((function(t){var e=o[t];return c+=Object.keys(e).length,r._mapLoadToResolve(e,h).then((function(e){a[t]=e}))})),n.next=11,Promise.all(l);case 11:return n.abrupt("return",(n.sent,i?a[t[0]]:a));case 12:case"end":return n.stop()}}),n)})))()}},{key:"backgroundLoad",value:function(t){var e=this;return(0,K.Z)(Q().mark((function r(){var n;return Q().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=e._initialized,r.t0){r.next=4;break}return r.next=4,e.init();case 4:"string"==typeof t&&(t=[t]),n=e.resolver.resolve(t),e._backgroundLoader.add(Object.values(n));case 7:case"end":return r.stop()}}),r)})))()}},{key:"backgroundLoadBundle",value:function(t){var e=this;return(0,K.Z)(Q().mark((function r(){var n;return Q().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=e._initialized,r.t0){r.next=4;break}return r.next=4,e.init();case 4:"string"==typeof t&&(t=[t]),n=e.resolver.resolveBundle(t),Object.values(n).forEach((function(t){e._backgroundLoader.add(Object.values(t))}));case 7:case"end":return r.stop()}}),r)})))()}},{key:"reset",value:function(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}},{key:"get",value:function(t){if("string"==typeof t)return nt.get(t);for(var e={},r=0;r1&&void 0!==arguments[1]?arguments[1]:{width:1,height:1,autoLoad:!0};return(0,n.Z)(this,r),"string"==typeof t?(a=t,s=new Uint8Array):(a=null,s=t),(o=e.call(this,s,u)).origin=a,o.buffer=s?new i.Rv(s):null,o._load=null,o.loaded=!1,null!==o.origin&&!1!==u.autoLoad&&o.load(),null===o.origin&&o.buffer&&(o._load=Promise.resolve((0,ue.Z)(o)),o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),(0,l.Z)(o)}return(0,c.Z)(r,[{key:"onBlobLoaded",value:function(t){}},{key:"load",value:function(){var t=this;return this._load||(this._load=fetch(this.origin).then((function(t){return t.blob()})).then((function(t){return t.arrayBuffer()})).then((function(e){return t.data=new Uint32Array(e),t.buffer=new i.Rv(e),t.loaded=!0,t.onBlobLoaded(e),t.update(),t}))),this._load}}]),r}(i.qm),he=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(t,i){var o;return(0,n.Z)(this,r),(o=e.call(this,t,i)).format=i.format,o.levels=i.levels||1,o._width=i.width,o._height=i.height,o._extension=r._formatToExtension(o.format),(i.levelBuffers||o.buffer)&&(o._levelBuffers=i.levelBuffers||r._createLevelBuffers((0,R.Z)(t,Uint8Array)?t:o.buffer.uint8View,o.format,o.levels,4,4,o.width,o.height)),(0,l.Z)(o)}return(0,c.Z)(r,[{key:"upload",value:function(t,e,r){var n=t.gl;if(!t.context.extensions[this._extension])throw new Error("".concat(this._extension," textures are not supported on the current machine"));if(!this._levelBuffers)return!1;n.pixelStorei(n.UNPACK_ALIGNMENT,4);for(var i=0,o=this.levels;i=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}},{key:"_createLevelBuffers",value:function(t,e,r,n,i,o,a){for(var s=new Array(r),u=t.byteOffset,c=o,h=a,l=c+n-1&~(n-1),f=h+i-1&~(i-1),d=l*f*ee[e],p=0;p1?c:l,levelHeight:r>1?h:f,levelBuffer:new Uint8Array(t.buffer,u,d)},u+=d,d=(l=(c=c>>1||1)+n-1&~(n-1))*(f=(h=h>>1||1)+i-1&~(i-1))*ee[e];return s}}]),r}(ce),le=124,fe=3,de=4,pe=7,ve=19,me=2,ge=0,ye=1,be=2,_e=3,we=(ie={},(0,it.Z)(ie,827611204,te.COMPRESSED_RGBA_S3TC_DXT1_EXT),(0,it.Z)(ie,861165636,te.COMPRESSED_RGBA_S3TC_DXT3_EXT),(0,it.Z)(ie,894720068,te.COMPRESSED_RGBA_S3TC_DXT5_EXT),ie),xe={70:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:te.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:te.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:te.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function Ee(t){var e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");var r=new Uint32Array(t,0,le/Uint32Array.BYTES_PER_ELEMENT),n=r[fe],i=r[de],o=r[pe],a=new Uint32Array(t,ve*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),s=a[1];if(4&s){var u=a[me];if(808540228!==u){var c=we[u],h=new Uint8Array(t,128);return[new he(h,{format:c,width:i,height:n,levels:o})]}var l=new Uint32Array(e.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),f=l[ge],d=l[ye],p=l[be],v=l[_e],m=xe[f];if(void 0===m)throw new Error("DDSParser cannot parse texture data with DXGI format ".concat(f));if(4===p)throw new Error("DDSParser does not support cubemap textures");if(6===d)throw new Error("DDSParser does not supported 3D texture data");var g=new Array;if(1===v)g.push(new Uint8Array(t,148));else{for(var y=ee[m],b=0,_=i,w=n,x=0;x>>=1,w>>>=1}for(var E=148,A=0;A2&&void 0!==arguments[2]&&arguments[2],n=new DataView(e);if(!Ze(t,n))return null;var o=n.getUint32(Te,!0)===Se,a=n.getUint32(ke,o),s=n.getUint32(Re,o),u=n.getUint32(Me,o),c=n.getUint32(Ce,o),h=n.getUint32(Pe,o)||1,l=n.getUint32(Ie,o)||1,f=n.getUint32(Oe,o)||1,d=n.getUint32(Be,o),p=n.getUint32(Ne,o),v=n.getUint32(Le,o);if(0===h||1!==l)throw new Error("Only 2D textures are supported");if(1!==d)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==f)throw new Error("WebGL does not support array textures");var m,g=4,y=4,b=c+3&-4,_=h+3&-4,w=new Array(f),x=c*h;if(0===a&&(x=b*_),void 0===(m=0!==a?De[a]?De[a]*Ue[s]:Fe[a]:ee[u]))throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var E=r?Ge(n,v,o):null,A=x*m,S=c,T=h,k=b,R=_,M=64+v,C=0;C1||0!==a?S:k,levelHeight:p>1||0!==a?T:R,levelBuffer:new Uint8Array(e,I,A)},I+=A}M=(M+=P+4)%4!==0?M+4-M%4:M,A=(k=(S=S>>1||1)+g-1&~(g-1))*(R=(T=T>>1||1)+y-1&~(y-1))*m}return 0!==a?{uncompressed:w.map((function(t){var e=t[0].levelBuffer,r=!1;return a===i.vK.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):a===i.vK.UNSIGNED_INT?(r=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):a===i.vK.INT&&(r=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new i.qm(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:a,format:r?He(s):s}})),kvData:E}:{compressed:w.map((function(t){return new he(null,{format:u,width:c,height:h,levels:p,levelBuffers:t})})),kvData:E}}function Ze(t,e){for(var r=0;re-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u0&&o.baseTexture.format===i.I2.RGBA,!u){r.renderTexture.bind(o);var h=o.framebuffer.glFramebuffers[r.CONTEXT_UID];h.blitFramebuffer&&r.framebuffer.bind(h.blitFramebuffer)}}else n=r.resolution,e||((e=Xe).width=r.width/n,e.height=r.height/n),a=!0,s=this._rendererPremultipliedAlpha,r.renderTexture.bind();var l=Math.max(Math.round(e.width*n),1),f=Math.max(Math.round(e.height*n),1),d=new Uint8Array(4*l*f);return c.readPixels(Math.round(e.x*n),Math.round(e.y*n),l,f,c.RGBA,c.UNSIGNED_BYTE,d),u&&(null===o||void 0===o||o.destroy(!0)),{pixels:d,width:l,height:f,flipY:a,premultipliedAlpha:s}}},{key:"destroy",value:function(){this.renderer=null}}],[{key:"_flipY",value:function(t,e,r){for(var n=e<<2,i=r>>1,o=new Uint8Array(n),a=0;a=0&&s>=0&&n>=0&&o>=0){var p=Math.ceil(2.3*Math.sqrt(a+s)),v=8*p+(n?4:0)+(o?4:0);if(u.length=v,0!==v){if(0===p)return u.length=8,u[0]=u[6]=e+n,u[1]=u[3]=r+o,u[2]=u[4]=e-n,void(u[5]=u[7]=r-o);var m=0,g=4*p+(n?2:0)+2,y=g,b=v,_=n+a,w=o,x=e+_,E=e-_,A=r+w;if(u[m++]=x,u[m++]=A,u[--g]=A,u[--g]=E,o){var S=r-w;u[y++]=E,u[y++]=S,u[--b]=S,u[--b]=x}for(var T=1;T1&&void 0!==arguments[1]&&arguments[1],r=t.length;if(!(r<6)){for(var n=0,i=0,o=t[r-2],a=t[r-1];i0||e&&n<=0)for(var c=r/2,h=c+c%2;h=6){Je(r,!1);for(var s=[],u=0;u=0&&o>=0&&a.push(r,n,r+i,n,r+i,n+o,r,n+o)},triangulate:function(t,e){var r=t.points,n=e.points;if(0!==r.length){var i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(i,i+1,i+2,i+1,i+2,i+3)}}},tr={build:function(t){Ke.build(t)},triangulate:function(t,e){Ke.triangulate(t,e)}},er=function(t){return t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t}(er||{}),rr=function(t){return t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t}(rr||{}),nr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;if(!this.adaptive||!t||isNaN(t))return e;var r=Math.ceil(t/this.maxLength);return rthis.maxSegments&&(r=this.maxSegments),r}},ir=function(){function t(){(0,n.Z)(this,t)}return(0,c.Z)(t,null,[{key:"curveTo",value:function(t,e,r,n,i,o){var a=o[o.length-2],s=o[o.length-1]-e,u=a-t,c=n-e,h=r-t,l=Math.abs(s*h-u*c);if(l<1e-8||0===i)return(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e),null;var f=s*s+u*u,d=c*c+h*h,p=s*c+u*h,v=i*Math.sqrt(f)/l,m=i*Math.sqrt(d)/l,g=v*p/f,y=m*p/d,b=v*h+m*u,_=v*c+m*s,w=u*(m+g),x=s*(m+g),E=h*(v+y),A=c*(v+y);return{cx:b+t,cy:_+e,radius:i,startAngle:Math.atan2(x-_,w-b),endAngle:Math.atan2(A-_,E-b),anticlockwise:u*c>h*s}}},{key:"arc",value:function(t,e,r,n,o,a,s,u,c){for(var h=s-a,l=nr._segmentsCount(Math.abs(h)*o,40*Math.ceil(Math.abs(h)/i._b)),f=h/(2*l),d=2*f,p=Math.cos(f),v=Math.sin(f),m=l-1,g=m%1/m,y=0;y<=m;++y){var b=f+a+d*(y+g*y),_=Math.cos(b),w=-Math.sin(b);c.push((p*_+v*w)*o+r,(p*-w+v*_)*o+n)}}}]),t}(),or=function(){function t(){(0,n.Z)(this,t)}return(0,c.Z)(t,null,[{key:"curveLength",value:function(t,e,r,n,i,o,a,s){for(var u=0,c=0,h=0,l=0,f=0,d=0,p=0,v=0,m=0,g=0,y=0,b=t,_=e,w=1;w<=10;++w)g=b-(v=(p=(d=(f=1-(c=w/10))*f)*f)*t+3*d*c*r+3*f*(h=c*c)*i+(l=h*c)*a),y=_-(m=p*e+3*d*c*n+3*f*h*o+l*s),b=v,_=m,u+=Math.sqrt(g*g+y*y);return u}},{key:"curveTo",value:function(e,r,n,i,o,a,s){var u=s[s.length-2],c=s[s.length-1];s.length-=2;var h=nr._segmentsCount(t.curveLength(u,c,e,r,n,i,o,a)),l=0,f=0,d=0,p=0,v=0;s.push(u,c);for(var m=1,g=0;m<=h;++m)d=(f=(l=1-(g=m/h))*l)*l,v=(p=g*g)*g,s.push(d*u+3*f*g*e+3*l*p*n+v*o,d*c+3*f*g*r+3*l*p*i+v*a)}}]),t}();function ar(t,e,r,n,i,o,a,s){var u,c;a?(u=n,c=-r):(u=-n,c=r);var h=t-r*i+u,l=e-n*i+c,f=t+r*o+u,d=e+n*o+c;return s.push(h,l,f,d),2}function sr(t,e,r,n,i,o,a,s){var u=r-t,c=n-e,h=Math.atan2(u,c),l=Math.atan2(i-t,o-e);s&&hl&&(l+=2*Math.PI);var f=h,d=l-h,p=Math.abs(d),v=Math.sqrt(u*u+c*c),m=1+(15*p*Math.sqrt(v)/Math.PI>>0),g=d/m;if(f+=g,s){a.push(t,e,r,n);for(var y=1,b=f;y=0&&(a.join===er.ROUND?v+=sr(x,E,x-T*I,E-k*I,x-R*I,E-M*I,d,!1)+4:v+=2,d.push(x-R*O,E-M*O,x+R*I,E+M*I));else{var H=(-T+_)*(-k+E)-(-T+x)*(-k+w),G=(-R+A)*(-M+E)-(-R+x)*(-M+S),V=(N*G-D*H)/j,z=(U*H-L*G)/j,W=(V-x)*(V-x)+(z-E)*(z-E),X=x+(V-x)*I,q=E+(z-E)*I,Y=x-(V-x)*O,K=E-(z-E)*O,J=Z?I:O,$=W<=Math.min(N*N+L*L,D*D+U*U)+J*J*y,Q=a.join;if(Q===er.MITER&&W/y>b&&(Q=er.BEVEL),$)switch(Q){case er.MITER:d.push(X,q,Y,K);break;case er.BEVEL:Z?d.push(X,q,x+T*O,E+k*O,X,q,x+R*O,E+M*O):d.push(x-T*I,E-k*I,Y,K,x-R*I,E-M*I,Y,K),v+=2;break;case er.ROUND:Z?(d.push(X,q,x+T*O,E+k*O),v+=sr(x,E,x+T*O,E+k*O,x+R*O,E+M*O,d,!0)+4,d.push(X,q,x+R*O,E+M*O)):(d.push(x-T*I,E-k*I,Y,K),v+=sr(x,E,x-T*I,E-k*I,x-R*I,E-M*I,d,!1)+4,d.push(x-R*I,E-M*I,Y,K))}else{switch(d.push(x-T*I,E-k*I,x+T*O,E+k*O),Q){case er.MITER:Z?d.push(Y,K,Y,K):d.push(X,q,X,q),v+=2;break;case er.ROUND:v+=Z?sr(x,E,x+T*O,E+k*O,x+R*O,E+M*O,d,!0)+2:sr(x,E,x-T*I,E-k*I,x-R*I,E-M*I,d,!1)+2}d.push(x-R*I,E-M*I,x+R*O,E+M*O),v+=2}}}_=n[2*(p-2)],w=n[2*(p-2)+1],x=n[2*(p-1)],T=-(w-(E=n[2*(p-1)+1])),k=_-x,T/=C=Math.sqrt(T*T+k*k),k/=C,T*=g,k*=g,d.push(x-T*I,E-k*I,x+T*O,E+k*O),c||(a.cap===rr.ROUND?v+=sr(x-T*(I-O)*.5,E-k*(I-O)*.5,x-T*I,E-k*I,x+T*O,E+k*O,d,!1)+2:a.cap===rr.SQUARE&&(v+=ar(x,E,T,k,I,O,!1,d)));for(var tt=e.indices,et=nr.epsilon*nr.epsilon,rt=m;rt1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;(0,n.Z)(this,t),this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=r,this.matrix=o,this.type=e.type}return(0,c.Z)(t,[{key:"clone",value:function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)}},{key:"destroy",value:function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}]),t}(),gr=function(){function t(){(0,n.Z)(this,t),this.reset()}return(0,c.Z)(t,[{key:"begin",value:function(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r}},{key:"end",value:function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}},{key:"reset",value:function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}]),t}(),yr=new i.E9,br=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(){var t;return(0,n.Z)(this,r),(t=e.call(this)).closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new o.YZ,t.boundsDirty=-1,(0,l.Z)(t)}return(0,c.Z)(r,[{key:"bounds",get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}},{key:"invalidate",value:function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}},{key:"drawShape",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=new mr(t,e,r,n);return this.graphicsData.push(i),this.dirty++,this}},{key:"drawHole",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.graphicsData.length)return null;var r=new mr(t,null,null,e),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this}},{key:"destroy",value:function(){(0,pr.Z)((0,vr.Z)(r.prototype),"destroy",this).call(this);for(var t=0;t0&&(n=(r=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&g===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=g?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0}},{key:"_compareStyles",value:function(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}},{key:"validateBatching",value:function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t131070)return!1;for(var t=this.batches,e=0;e0&&((o=dr.pop())||((o=new i.a$).texArray=new i.Ie),this.drawCalls.push(o)),o.start=l,o.size=0,o.texArray.count=0,o.type=h),v.touched=1,v._batchEnabled=t,v._batchLocation=a,v.wrapMode=i.Nt.REPEAT,o.texArray.elements[o.texArray.count++]=v,a++)),o.size+=d.size,l+=d.size,u=v._batchLocation,this.addColors(r,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(n,u,d.attribSize,d.attribStart)}i.VL._globalBatch=t,this.packAttributes()}},{key:"packAttributes",value:function(){for(var t=this.points,e=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(3*t.length*4),o=new Float32Array(i),a=new Uint32Array(i),s=0,u=0;u4&&void 0!==arguments[4]?arguments[4]:0,a=i.Il.shared.setValue(e).toLittleEndianNumber(),s=i.Il.shared.setValue(a).toPremultiplied(r);t.length=Math.max(t.length,o+n);for(var u=0;u3&&void 0!==arguments[3]?arguments[3]:0;t.length=Math.max(t.length,n+r);for(var i=0;i5&&void 0!==arguments[5]?arguments[5]:null,a=0,s=e.length,u=r.frame;a0&&void 0!==arguments[0]?arguments[0]:null;return(0,n.Z)(this,r),(t=e.call(this)).shader=null,t.pluginName="batch",t.currentPath=null,t.batches=[],t.batchTint=-1,t.batchDirty=-1,t.vertexData=null,t._fillStyle=new wr,t._lineStyle=new xr,t._matrix=null,t._holeMode=!1,t.state=i.ZM.for2d(),t._geometry=o||new _r,t._geometry.refCount++,t._transformID=-1,t._tintColor=new i.Il(16777215),t.blendMode=i.T$.NORMAL,(0,l.Z)(t)}return(0,c.Z)(r,[{key:"geometry",get:function(){return this._geometry}},{key:"clone",value:function(){return this.finishPoly(),new r(this._geometry)}},{key:"blendMode",get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t}},{key:"tint",get:function(){return this._tintColor.value},set:function(t){this._tintColor.setValue(t)}},{key:"fill",get:function(){return this._fillStyle}},{key:"line",get:function(){return this._lineStyle}},{key:"lineStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return"number"==typeof t&&(t={width:t,color:e,alpha:r,alignment:n,native:i}),this.lineTextureStyle(t)}},{key:"lineTextureStyle",value:function(t){var e={width:0,texture:i.xE.WHITE,color:(null===t||void 0===t?void 0:t.texture)?16777215:0,matrix:null,alignment:.5,native:!1,cap:rr.BUTT,join:er.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();var r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},t)):this._lineStyle.reset(),this}},{key:"startPoly",value:function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new i.mg,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new i.mg,this.currentPath.closeStroke=!1}},{key:"finishPoly",value:function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}},{key:"moveTo",value:function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}},{key:"lineTo",value:function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return(n!==t||i!==e)&&r.push(t,e),this}},{key:"_initCurve",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,r,n){this._initCurve();var i=this.currentPath.points;return 0===i.length&&this.moveTo(0,0),hr.curveTo(t,e,r,n,i),this}},{key:"bezierCurveTo",value:function(t,e,r,n,i,o){return this._initCurve(),or.curveTo(t,e,r,n,i,o,this.currentPath.points),this}},{key:"arcTo",value:function(t,e,r,n,i){this._initCurve(t,e);var o=this.currentPath.points,a=ir.curveTo(t,e,r,n,i,o);if(a){var s=a.cx,u=a.cy,c=a.radius,h=a.startAngle,l=a.endAngle,f=a.anticlockwise;this.arc(s,u,c,h,l,f)}return this}},{key:"arc",value:function(t,e,r,n,o){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(n===o)return this;if(!a&&o<=n?o+=i._b:a&&n<=o&&(n+=i._b),o-n===0)return this;var s=t+Math.cos(n)*r,u=e+Math.sin(n)*r,c=this._geometry.closePointEps,h=this.currentPath?this.currentPath.points:null;if(h){var l=Math.abs(h[h.length-2]-s),f=Math.abs(h[h.length-1]-u);l0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.beginTextureFill({texture:i.xE.WHITE,color:t,alpha:e})}},{key:"normalizeColor",value:function(t){var e,r,n=i.Il.shared.setValue(null!==(e=t.color)&&void 0!==e?e:0);t.color=n.toNumber(),null!==(r=t.alpha)&&void 0!==r||(t.alpha=n.alpha)}},{key:"beginTextureFill",value:function(t){var e={texture:i.xE.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();var r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}},{key:"endFill",value:function(){return this.finishPoly(),this._fillStyle.reset(),this}},{key:"drawRect",value:function(t,e,r,n){return this.drawShape(new i.Ae(t,e,r,n))}},{key:"drawRoundedRect",value:function(t,e,r,n,o){return this.drawShape(new i.c9(t,e,r,n,o))}},{key:"drawCircle",value:function(t,e,r){return this.drawShape(new i.Cd(t,e,r))}},{key:"drawEllipse",value:function(t,e,r,n){return this.drawShape(new i.Pj(t,e,r,n))}},{key:"drawPolygon",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r3&&void 0!==arguments[3]?arguments[3]:i.lg.TRIANGLES;return(0,n.Z)(this,r),(s=e.call(this)).geometry=t,s.shader=o,s.state=a||i.ZM.for2d(),s.drawMode=u,s.start=0,s.size=0,s.uvs=null,s.indices=null,s.vertexData=new Float32Array(1),s.vertexDirty=-1,s._transformID=-1,s._roundPixels=i.Xd.ROUND_PIXELS,s.batchUvs=null,(0,l.Z)(s)}return(0,c.Z)(r,[{key:"geometry",get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}},{key:"uvBuffer",get:function(){return this.geometry.buffers[1]}},{key:"verticesBuffer",get:function(){return this.geometry.buffers[0]}},{key:"material",get:function(){return this.shader},set:function(t){this.shader=t}},{key:"blendMode",get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t}},{key:"roundPixels",get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}},{key:"tint",get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t}},{key:"tintValue",get:function(){return this.shader.tintValue}},{key:"texture",get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t}},{key:"_render",value:function(t){var e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===i.lg.TRIANGLES&&e.length<2*r.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)}},{key:"_renderDefault",value:function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}},{key:"_renderToBatch",value:function(t){var e=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=r._tintRGB,this._texture=r.texture;var n=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[n]),t.plugins[n].render(this)}},{key:"calculateVertices",value:function(){var t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var n=this.transform.worldTransform,o=n.a,a=n.b,s=n.c,u=n.d,c=n.tx,h=n.ty,l=this.vertexData,f=0;fr&&!t.autoResize&&(a=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var u=e[0]._texture.baseTexture,c=u.alphaMode>0;this.state.blendMode=i.P6.correctBlendMode(t.blendMode,c),o.state.set(this.state);var h=o.gl,l=t.worldTransform.copyTo(this.tempMatrix);l.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=l.toArray(!0),this.shader.uniforms.uColor=i.Il.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,c).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=u,this.renderer.shader.bind(this.shader);for(var f=!1,d=0,p=0;dn&&(v=n),p>=s.length&&s.push(this._generateOneMoreBuffer(t));var m=s[p];m.uploadDynamic(e,d,v);var g=t._bufferUpdateIDs[p]||0;(f=f||m._updateID0);n[a]=c,n[a+o]=c,n[a+2*o]=c,n[a+3*o]=c,a+=4*o}}},{key:"destroy",value:function(){(0,pr.Z)((0,vr.Z)(r.prototype),"destroy",this).call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}]),r}(i.bO);Br.extension={name:"particle",type:i.nw.RendererPlugin},i.Rw.add(Br);var Nr=function(t){return t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",t}(Nr||{}),Lr={willReadFrequently:!0},Dr=function(){function t(e,r,i,o,a,s,u,c,h){(0,n.Z)(this,t),this.text=e,this.style=r,this.width=i,this.height=o,this.lines=a,this.lineWidths=s,this.lineHeight=u,this.maxLineWidth=c,this.fontProperties=h}return(0,c.Z)(t,null,[{key:"experimentalLetterSpacingSupported",get:function(){var e=t._experimentalLetterSpacingSupported;if(void 0!==e){var r=i.Xd.ADAPTER.getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}},{key:"measureText",value:function(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t._canvas;n=null!==n&&void 0!==n?n:r.wordWrap;var o=r.toFontString(),a=t.measureFont(o);0===a.fontSize&&(a.fontSize=r.fontSize,a.ascent=r.fontSize);var s=i.getContext("2d",Lr);s.font=o;for(var u=(n?t.wordWrap(e,r,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(u.length),h=0,l=0;l0&&(i?o-=r:o+=(t.graphemeSegmenter(e).length-1)*r),o}},{key:"wordWrap",value:function(e,r){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t._canvas,i=n.getContext("2d",Lr),o=0,a="",s="",u=Object.create(null),c=r.letterSpacing,h=r.whiteSpace,l=t.collapseSpaces(h),f=t.collapseNewlines(h),d=!l,p=r.wordWrapWidth+c,v=t.tokenize(e),m=0;mp)if(""!==a&&(s+=t.addLine(a),a="",o=0),t.canBreakWords(g,r.breakWords))for(var w=t.wordWrapSplit(g),x=0;xp&&(s+=t.addLine(a),d=!1,a="",o=0),a+=E,o+=k}else{a.length>0&&(s+=t.addLine(a),a="",o=0);var R=m===v.length-1;s+=t.addLine(g,!R),d=!1,a="",o=0}else _+o>p&&(d=!1,s+=t.addLine(a),a="",o=0),(a.length>0||!t.isBreakingSpace(g)||d)&&(a+=g,o+=_)}return s+=t.addLine(a,!1)}},{key:"addLine",value:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=t.trimRight(e),e=r?"".concat(e,"\n"):e}},{key:"getFromCache",value:function(e,r,n,i){var o=n[e];return"number"!=typeof o&&(o=t._measureText(e,r,i)+r,n[e]=o),o}},{key:"collapseSpaces",value:function(t){return"normal"===t||"pre-line"===t}},{key:"collapseNewlines",value:function(t){return"normal"===t}},{key:"trimRight",value:function(e){if("string"!=typeof e)return"";for(var r=e.length-1;r>=0;r--){var n=e[r];if(!t.isBreakingSpace(n))break;e=e.slice(0,-1)}return e}},{key:"isNewline",value:function(e){return"string"==typeof e&&t._newlines.includes(e.charCodeAt(0))}},{key:"isBreakingSpace",value:function(e,r){return"string"==typeof e&&t._breakingSpaces.includes(e.charCodeAt(0))}},{key:"tokenize",value:function(e){var r=[],n="";if("string"!=typeof e)return r;for(var i=0;is;--f){for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:"";e?delete t._fonts[e]:t._fonts={}}},{key:"_canvas",get:function(){if(!t.__canvas){var e;try{var r,n=new OffscreenCanvas(0,0);if(null===(r=n.getContext("2d",Lr))||void 0===r?void 0:r.measureText)return t.__canvas=n,n;e=i.Xd.ADAPTER.createCanvas()}catch(o){e=i.Xd.ADAPTER.createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}},{key:"_context",get:function(){return t.__context||(t.__context=t._canvas.getContext("2d",Lr)),t.__context}}]),t}();Dr.METRICS_STRING="|\xc9q\xc5",Dr.BASELINE_SYMBOL="M",Dr.BASELINE_MULTIPLIER=1.4,Dr.HEIGHT_MULTIPLIER=2,Dr.graphemeSegmenter=function(){if("function"==typeof(null===Intl||void 0===Intl?void 0:Intl.Segmenter)){var t=new Intl.Segmenter;return function(e){return(0,J.Z)(t.segment(e)).map((function(t){return t.segment}))}}return function(t){return(0,J.Z)(t)}}(),Dr.experimentalLetterSpacing=!1,Dr._fonts={},Dr._newlines=[10,13],Dr._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Ur=Dr,Fr=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],jr=function(){function t(e){(0,n.Z)(this,t),this.styleID=0,this.reset(),Gr(this,e,e)}return(0,c.Z)(t,[{key:"clone",value:function(){var e={};return Gr(e,this,t.defaultStyle),new t(e)}},{key:"reset",value:function(){Gr(this,t.defaultStyle,t.defaultStyle)}},{key:"align",get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)}},{key:"breakWords",get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}},{key:"dropShadow",get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}},{key:"dropShadowAlpha",get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}},{key:"dropShadowAngle",get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}},{key:"dropShadowBlur",get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}},{key:"dropShadowColor",get:function(){return this._dropShadowColor},set:function(t){var e=Hr(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}},{key:"dropShadowDistance",get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}},{key:"fill",get:function(){return this._fill},set:function(t){var e=Hr(t);this._fill!==e&&(this._fill=e,this.styleID++)}},{key:"fillGradientType",get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}},{key:"fillGradientStops",get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r=0;r--){var n=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!Fr.includes(n)&&(n='"'.concat(n,'"')),e[r]=n}return"".concat(this.fontStyle," ").concat(this.fontVariant," ").concat(this.fontWeight," ").concat(t," ").concat(e.join(","))}}]),t}();jr.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Nr.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};var Zr=jr;function Hr(t){var e=i.Il.shared,r=function(t){var r=e.setValue(t);return 1===r.alpha?r.toHex():r.toRgbaString()};return Array.isArray(t)?t.map(r):r(t)}function Gr(t,e,r){for(var n in r)Array.isArray(e[n])?t[n]=e[n].slice():t[n]=e[n]}var Vr={texture:!0,children:!1,baseTexture:!0},zr=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(t,o,a){var s;(0,n.Z)(this,r);var u=!1;a||(a=i.Xd.ADAPTER.createCanvas(),u=!0),a.width=3,a.height=3;var c,h=i.xE.from(a);return h.orig=new i.Ae,h.trim=new i.Ae,(s=e.call(this,h))._ownCanvas=u,s.canvas=a,s.context=a.getContext("2d",{willReadFrequently:!0}),s._resolution=null!==(c=r.defaultResolution)&&void 0!==c?c:i.Xd.RESOLUTION,s._autoResolution=r.defaultAutoResolution,s._text=null,s._style=null,s._styleListener=null,s._font="",s.text=t,s.style=o,s.localStyleID=-1,(0,l.Z)(s)}return(0,c.Z)(r,[{key:"updateText",value:function(t){var e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),this.dirty||!t){this._font=this._style.toFontString();var r,n,o=this.context,a=Ur.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=a.width,u=a.height,c=a.lines,h=a.lineHeight,l=a.lineWidths,f=a.maxLineWidth,d=a.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,s)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,u)+2*e.padding)*this._resolution),o.scale(this._resolution,this._resolution),o.clearRect(0,0,this.canvas.width,this.canvas.height),o.font=this._font,o.lineWidth=e.strokeThickness,o.textBaseline=e.textBaseline,o.lineJoin=e.lineJoin,o.miterLimit=e.miterLimit;for(var p=e.dropShadow?2:1,v=0;v3&&void 0!==arguments[3]&&arguments[3],i=this._style.letterSpacing,o=!1;if(Ur.experimentalLetterSpacingSupported&&(Ur.experimentalLetterSpacing?(this.context.letterSpacing="".concat(i,"px"),this.context.textLetterSpacing="".concat(i,"px"),o=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),0===i||o)n?this.context.strokeText(t,e,r):this.context.fillText(t,e,r);else for(var a=e,s=Ur.graphemeSegmenter(t),u=this.context.measureText(t).width,c=0,h=0;h0&&v>m&&(g=(m+v)/2);var y=m+d,b=r.lineHeight*(p+1),_=y;p+10}}]),t}();function qr(t,e){var r,n=!1;if(null===t||void 0===t||null===(r=t._textures)||void 0===r?void 0:r.length)for(var o=0;o=0;n--)this.add(t.children[n]);return this}},{key:"destroy",value:function(){this.ticking&&i.vB.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}}]),t}();en.uploadsPerFrame=4;var rn=en;function nn(t,e){return!!(0,R.Z)(e,i.VL)&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function on(t,e){if(!(0,R.Z)(e,Sr))return!1;var r=e.geometry;e.finishPoly(),r.updateBatches();for(var n=r.batches,i=0;i1?i.ex.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",e):i.ex.from(cn,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",e)}},{key:"render",value:function(t){var e=this.renderer,r=this.quad,n=r.vertices;n[0]=n[6]=t._width*-t.anchor.x,n[1]=n[3]=t._height*-t.anchor.y,n[2]=n[4]=t._width*(1-t.anchor.x),n[5]=n[7]=t._height*(1-t.anchor.y);var o=t.uvRespectAnchor?t.anchor.x:0,a=t.uvRespectAnchor?t.anchor.y:0;(n=r.uvs)[0]=n[6]=-o,n[1]=n[3]=-a,n[2]=n[4]=1-o,n[5]=n[7]=1-a,r.invalidate();var s=t._texture,u=s.baseTexture,c=u.alphaMode>0,h=t.tileTransform.localTransform,l=t.uvMatrix,f=u.isPowerOfTwo&&s.frame.width===u.width&&s.frame.height===u.height;f&&(u._glTextures[e.CONTEXT_UID]?f=u.wrapMode!==i.Nt.CLAMP:u.wrapMode===i.Nt.CLAMP&&(u.wrapMode=i.Nt.REPEAT));var d=f?this.simpleShader:this.shader,p=s.width,v=s.height,m=t._width,g=t._height;hn.set(h.a*p/m,h.b*p/g,h.c*v/m,h.d*v/g,h.tx/m,h.ty/g),hn.invert(),f?hn.prepend(l.mapCoord):(d.uniforms.uMapCoord=l.mapCoord.toArray(!0),d.uniforms.uClampFrame=l.uClampFrame,d.uniforms.uClampOffset=l.uClampOffset),d.uniforms.uTransform=hn.toArray(!0),d.uniforms.uColor=i.Il.shared.setValue(t.tint).premultiply(t.worldAlpha,c).toArray(d.uniforms.uColor),d.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),d.uniforms.uSampler=s,e.shader.bind(d),e.geometry.bind(r),this.state.blendMode=i.P6.correctBlendMode(t.blendMode,c),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}]),r}(i.bO);ln.extension={name:"tilingSprite",type:i.nw.RendererPlugin},i.Rw.add(ln);var fn=function(){function t(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,n.Z)(this,t),this.linkedSheets=[],this._texture=(0,R.Z)(e,i.xE)?e:null,this.baseTexture=(0,R.Z)(e,i.VL)?e:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;var a=this.baseTexture.resource;this.resolution=this._updateResolution(o||(a?a.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return(0,c.Z)(t,[{key:"_updateResolution",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.data.meta.scale,r=i.P6.getResolutionOfUrl(t,null);return null===r&&(r=parseFloat(null!==e&&void 0!==e?e:"1")),1!==r&&this.baseTexture.setResolution(r),r}},{key:"parse",value:function(){var e=this;return new Promise((function(r){e._callback=r,e._batchIndex=0,e._frameKeys.length<=t.BATCH_SIZE?(e._processFrames(0),e._processAnimations(),e._parseComplete()):e._nextBatch()}))}},{key:"_processFrames",value:function(e){for(var r=e,n=t.BATCH_SIZE;r-e0&&void 0!==arguments[0]&&arguments[0];for(var r in this.textures)this.textures[r].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(null===(t=this._texture)||void 0===t||t.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}}]),t}();fn.BATCH_SIZE=1e3;var dn=fn,pn=["jpg","png","jpeg","avif","webp"];function vn(t,e,r){var n={};if(t.forEach((function(t){n[t]=e})),Object.keys(e.textures).forEach((function(t){n[t]=e.textures[t]})),!r){var o=i.P6.path.dirname(t[0]);e.linkedSheets.forEach((function(t,r){var i=vn(["".concat(o,"/").concat(e.data.meta.related_multi_packs[r])],t,!0);Object.assign(n,i)}))}return n}var mn={extension:i.nw.Asset,cache:{test:function(t){return(0,R.Z)(t,dn)},getCacheableAssets:function(t,e){return vn(t,e,!1)}},resolver:{test:function(t){var e=t.split("?")[0].split("."),r=e.pop(),n=e.pop();return"json"===r&&pn.includes(n)},parse:function(t){var e,r,n=t.split(".");return{resolution:parseFloat(null!==(r=null===(e=i.Xd.RETINA_PREFIX.exec(t))||void 0===e?void 0:e[1])&&void 0!==r?r:"1"),format:n[n.length-2],src:t}}},loader:{name:"spritesheetLoader",extension:{type:i.nw.LoadParser,priority:ut.Normal},testParse:function(t,e){return(0,K.Z)(Q().mark((function r(){return Q().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",".json"===i.P6.path.extname(e.src).toLowerCase()&&!!t.frames);case 1:case"end":return r.stop()}}),r)})))()},parse:function(t,e,r){return(0,K.Z)(Q().mark((function n(){var o,a,s,u,c,h,l,f,d,p,v,m,g,y,b,_;return Q().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(a=i.P6.path.dirname(e.src))&&a.lastIndexOf("/")!==a.length-1&&(a+="/"),s=a+t.meta.image,s=Qt(s,e.src),n.next=7,r.load([s]);case 7:return n.t0=s,u=n.sent[n.t0],c=new dn(u.baseTexture,t,e.src),n.next=12,c.parse();case 12:if(h=null===t||void 0===t||null===(o=t.meta)||void 0===o?void 0:o.related_multi_packs,!Array.isArray(h)){n.next=46;break}l=[],f=!0,d=!1,p=void 0,n.prev=16,v=h[Symbol.iterator]();case 18:if(f=(m=v.next()).done){n.next=28;break}if("string"==typeof(g=m.value)){n.next=23;break}return n.abrupt("continue",25);case 23:b=a+g,(null===(y=e.data)||void 0===y?void 0:y.ignoreMultiPack)||(b=Qt(b,e.src),l.push(r.load({src:b,data:{ignoreMultiPack:!0}})));case 25:f=!0,n.next=18;break;case 28:n.next=34;break;case 30:n.prev=30,n.t1=n.catch(16),d=!0,p=n.t1;case 34:n.prev=34,n.prev=35,f||null==v.return||v.return();case 37:if(n.prev=37,!d){n.next=40;break}throw p;case 40:return n.finish(37);case 41:return n.finish(34);case 42:return n.next=44,Promise.all(l);case 44:_=n.sent,c.linkedSheets=_,_.forEach((function(t){t.linkedSheets=[c].concat(c.linkedSheets.filter((function(e){return e!==t})))}));case 46:return n.abrupt("return",c);case 47:case"end":return n.stop()}}),n,null,[[16,30,34,42],[35,,37,41]])})))()},unload:function(t){t.destroy(!0)}}};i.Rw.add(mn);var gn=r(9534),yn=function t(){(0,n.Z)(this,t),this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},bn=function(){function t(){(0,n.Z)(this,t)}return(0,c.Z)(t,null,[{key:"test",value:function(t){return"string"==typeof t&&t.startsWith("info face=")}},{key:"parse",value:function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in e){var i=e[n].match(/^[a-z]+/gm)[0],o=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var s in o){var u=o[s].split("="),c=u[0],h=u[1].replace(/"/gm,""),l=parseFloat(h),f=isNaN(l)?h:l;a[c]=f}r[i].push(a)}var d=new yn;return r.info.forEach((function(t){return d.info.push({face:t.face,size:parseInt(t.size,10)})})),r.common.forEach((function(t){return d.common.push({lineHeight:parseInt(t.lineHeight,10)})})),r.page.forEach((function(t){return d.page.push({id:parseInt(t.id,10),file:t.file})})),r.char.forEach((function(t){return d.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),r.kerning.forEach((function(t){return d.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),r.distanceField.forEach((function(t){return d.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType})})),d}}]),t}(),_n=function(){function t(){(0,n.Z)(this,t)}return(0,c.Z)(t,null,[{key:"test",value:function(t){var e=t;return"string"!=typeof t&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")}},{key:"parse",value:function(t){for(var e=new yn,r=t.getElementsByTagName("info"),n=t.getElementsByTagName("common"),i=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),s=t.getElementsByTagName("distanceField"),u=0;u"))&&_n.test(i.Xd.ADAPTER.parseXML(t))}},{key:"parse",value:function(t){return _n.parse(i.Xd.ADAPTER.parseXML(t))}}]),t}(),xn=[bn,_n,wn];function En(t,e,r,n,o,a,s){var u=r.text,c=r.fontProperties;e.translate(n,o),e.scale(a,a);var h=s.strokeThickness/2,l=-s.strokeThickness/2;if(e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=function(t,e,r,n,i,o){var a,s=r.fill;if(!Array.isArray(s))return s;if(1===s.length)return s[0];var u=r.dropShadow?r.dropShadowDistance:0,c=r.padding||0,h=t.width/n-u-2*c,l=t.height/n-u-2*c,f=s.slice(),d=r.fillGradientStops.slice();if(!d.length)for(var p=f.length+1,v=1;v=h-M*u){if(0===_)throw new Error("[BitmapFont] textureHeight ".concat(h,"px is too small (fontFamily: '").concat(d.fontFamily,"', fontSize: ").concat(d.fontSize,"px, char: '").concat(S,"')"));--A,m=null,g=null,y=null,_=0,b=0,w=0}else if(w=Math.max(M+T.fontProperties.descent,w),C*u+b>=p){if(0===b)throw new Error("[BitmapFont] textureWidth ".concat(c,"px is too small (fontFamily: '").concat(d.fontFamily,"', fontSize: ").concat(d.fontSize,"px, char: '").concat(S,"')"));--A,_+=w*u,_=Math.ceil(_),b=0,w=0}else{En(m,g,T,b,_,u,d);var P=Sn(T.text);v.char.push({id:P,page:E.length-1,x:b/u,y:_/u,width:C,height:M,xoffset:0,yoffset:0,xadvance:k-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0)}),b+=(C+2*s)*u,b=Math.ceil(b)}}if(!(null===n||void 0===n?void 0:n.skipKerning))for(var I=0,O=f.length;I1&&void 0!==arguments[1]?arguments[1]:{};(0,n.Z)(this,r),o=e.call(this);var s=Object.assign({},r.styleDefaults,a),u=s.align,c=s.tint,h=s.maxWidth,l=s.letterSpacing,f=s.fontName,d=s.fontSize;if(!kn.available[f])throw new Error('Missing BitmapFont "'.concat(f,'"'));return o._activePagesMeshData=[],o._textWidth=0,o._textHeight=0,o._align=u,o._tintColor=new i.Il(c),o._font=void 0,o._fontName=f,o._fontSize=d,o.text=t,o._maxWidth=h,o._maxLineHeight=0,o._letterSpacing=l,o._anchor=new i.AB((function(){o.dirty=!0}),(0,ue.Z)(o),0,0),o._roundPixels=i.Xd.ROUND_PIXELS,o.dirty=!0,o._resolution=i.Xd.RESOLUTION,o._autoResolution=!0,o._textureCache={},o}return(0,c.Z)(r,[{key:"updateText",value:function(){for(var t,e=kn.available[this._fontName],r=this.fontSize,n=r/e.size,o=new i.E9,a=[],s=[],u=[],c=An(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),h=this._maxWidth*e.size/r,l="none"===e.distanceFieldType?Rn:Mn,f=null,d=0,p=0,v=0,m=-1,g=0,y=0,b=0,_=0,w=0;w0&&o.x>h&&(++y,i.P6.removeItems(a,1+m-y,1+w-m),w=m,m=-1,s.push(g),u.push(a.length>0?a[a.length-1].prevSpaces:0),p=Math.max(p,g),v++,o.x=0,o.y+=e.lineHeight,f=null,_=0)}}else s.push(d),u.push(-1),p=Math.max(p,d),++v,++y,o.x=0,o.y+=e.lineHeight,f=null,_=0}var T=c[c.length-1];"\r"!==T&&"\n"!==T&&(/(?:\s)/.test(T)&&(d=g),s.push(d),p=Math.max(p,d),u.push(-1));for(var k=[],R=0;R<=v;R++){var M=0;"right"===this._align?M=p-s[R]:"center"===this._align?M=(p-s[R])/2:"justify"===this._align&&(M=u[R]<0?0:(p-s[R])/u[R]),k.push(M)}var C=a.length,P={},I=[],O=this._activePagesMeshData;(t=l).push.apply(t,(0,J.Z)(O));for(var B=0;B 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // Gamma correction for coverage-like alpha\r\n float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r\n float gamma = mix(1.0, 1.0 / 2.2, luma);\r\n float coverage = pow(uColor.a * alpha, gamma); \r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, coverage);\r\n}\r\n"),uniforms:{uFWidth:0}}),j=i.T$.NORMAL_NPM);var Z=new Cr(U,F);Z.blendMode=j,D={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:Z,vertices:null,uvs:null,indices:null}}D.index=0,D.indexCount=0,D.vertexCount=0,D.uvsCount=0,D.total=0;var H=this._textureCache;H[L]=H[L]||new i.xE(N.baseTexture),D.mesh.texture=H[L],D.mesh.tint=this._tintColor.value,I.push(D),P[L]=D}P[L].total++}for(var G=0;G6*q)||X.vertices.length<2*Cr.BATCHABLE_SIZE)X.vertices=new Float32Array(8*q),X.uvs=new Float32Array(8*q),X.indices=new Uint16Array(6*q);else for(var Y=X.total,K=X.vertices,$=4*Y*2;$0&&(this._fonts.forEach((function(t){URL.revokeObjectURL(t.src),t.refs--,0===t.refs&&(t.fontFace&&document.fonts.delete(t.fontFace),delete r.availableFonts[t.originalUrl])})),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}},{key:"loadFont",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.availableFonts;if(n[t]){var o=n[t];return this._fonts.push(o),o.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}var a=this;return i.Xd.ADAPTER.fetch(t).then((function(t){return t.blob()})).then(function(){var t=(0,K.Z)(Q().mark((function t(e){return Q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){var n=URL.createObjectURL(e),i=new FileReader;i.onload=function(){return t([n,i.result])},i.onerror=r,i.readAsDataURL(e)})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then(function(){var r=(0,K.Z)(Q().mark((function r(o){var s,u,c,h,l;return Q().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=(0,w.Z)(o,2),u=s[0],c=s[1],h=Object.assign({family:i.P6.path.basename(t,i.P6.path.extname(t)),weight:"normal",style:"normal",display:"auto",src:u,dataSrc:c,refs:1,originalUrl:t,fontFace:null},e),n[t]=h,a._fonts.push(h),a.styleID++,l=new FontFace(h.family,"url(".concat(h.src,")"),{weight:h.weight,style:h.style,display:h.display}),h.fontFace=l,r.next=7,l.load();case 7:return document.fonts.add(l),r.next=10,document.fonts.ready;case 10:a.styleID++,a.fontsDirty=!0;case 12:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}())}},{key:"addOverride",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&((n=this._overrides).push.apply(n,(0,J.Z)(o)),this.styleID++)}},{key:"removeOverride",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&(this._overrides=this._overrides.filter((function(t){return!i.includes(t)})),this.styleID++)}},{key:"toCSS",value:function(t){return["transform: scale(".concat(t,")"),"transform-origin: top left","display: inline-block","color: ".concat(this.normalizeColor(this.fill)),"font-size: ".concat(this.fontSize,"px"),"font-family: ".concat(this.fontFamily),"font-weight: ".concat(this.fontWeight),"font-style: ".concat(this.fontStyle),"font-variant: ".concat(this.fontVariant),"letter-spacing: ".concat(this.letterSpacing,"px"),"text-align: ".concat(this.align),"padding: ".concat(this.padding,"px"),"white-space: ".concat(this.whiteSpace)].concat((0,J.Z)(this.lineHeight?["line-height: ".concat(this.lineHeight,"px")]:[]),(0,J.Z)(this.wordWrap?["word-wrap: ".concat(this.breakWords?"break-all":"break-word"),"max-width: ".concat(this.wordWrapWidth,"px")]:[]),(0,J.Z)(this.strokeThickness?["-webkit-text-stroke-width: ".concat(this.strokeThickness,"px"),"-webkit-text-stroke-color: ".concat(this.normalizeColor(this.stroke)),"text-stroke-width: ".concat(this.strokeThickness,"px"),"text-stroke-color: ".concat(this.normalizeColor(this.stroke)),"paint-order: stroke"]:[]),(0,J.Z)(this.dropShadow?[this.dropShadowToCSS()]:[]),(0,J.Z)(this._overrides)).join(";")}},{key:"toGlobalCSS",value:function(){return this._fonts.reduce((function(t,e){return"".concat(t,'\n @font-face {\n font-family: "').concat(e.family,"\";\n src: url('").concat(e.dataSrc,"');\n font-weight: ").concat(e.weight,";\n font-style: ").concat(e.style,";\n font-display: ").concat(e.display,";\n }")}),this._stylesheet)}},{key:"stylesheet",get:function(){return this._stylesheet},set:function(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}},{key:"normalizeColor",value:function(t){return Array.isArray(t)&&(t=i.P6.rgb2hex(t)),"number"==typeof t?i.P6.hex2string(t):t}},{key:"dropShadowToCSS",value:function(){var t=this.normalizeColor(this.dropShadowColor),e=this.dropShadowAlpha,r=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(255*e|0).toString(16).padStart(2,"0"));var i="".concat(r,"px ").concat(n,"px");return this.dropShadowBlur>0?"text-shadow: ".concat(i," ").concat(this.dropShadowBlur,"px ").concat(t):"text-shadow: ".concat(i," ").concat(t)}},{key:"reset",value:function(){Object.assign(this,r.defaultOptions)}},{key:"onBeforeDraw",value:function(){var t=this.fontsDirty;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise((function(t){return setTimeout(t,100)})):Promise.resolve()}},{key:"isSafari",get:function(){var t=i.Xd.ADAPTER.getNavigator().userAgent;return/^((?!chrome|android).)*safari/i.test(t)}},{key:"fillGradientStops",get:function(){return(0,pr.Z)((0,vr.Z)(r.prototype),"fillGradientStops",this)},set:function(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}},{key:"fillGradientType",get:function(){return(0,pr.Z)((0,vr.Z)(r.prototype),"fillGradientType",this)},set:function(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}},{key:"miterLimit",get:function(){return(0,pr.Z)((0,vr.Z)(r.prototype),"miterLimit",this)},set:function(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}},{key:"trim",get:function(){return(0,pr.Z)((0,vr.Z)(r.prototype),"trim",this)},set:function(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}},{key:"textBaseline",get:function(){return(0,pr.Z)((0,vr.Z)(r.prototype),"textBaseline",this)},set:function(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}},{key:"leading",get:function(){return(0,pr.Z)((0,vr.Z)(r.prototype),"leading",this)},set:function(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}},{key:"lineJoin",get:function(){return(0,pr.Z)((0,vr.Z)(r.prototype),"lineJoin",this)},set:function(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}}],[{key:"from",value:function(t){return new r(Object.keys(r.defaultOptions).reduce((function(e,r){return(0,ot.Z)((0,D.Z)({},e),(0,it.Z)({},r,t[r]))}),{}))}}]),r}(Zr);Bn.availableFonts={},Bn.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};var Nn=Bn,Ln=function(t){(0,h.Z)(r,t);var e=(0,f.Z)(r);function r(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.Z)(this,r),(t=e.call(this,i.xE.EMPTY))._text=null,t._style=null,t._autoResolution=!0,t.localStyleID=-1,t.dirty=!1,t._updateID=0,t.ownsStyle=!1;var s=new Image,u=i.xE.from(s,{scaleMode:i.Xd.SCALE_MODE,resourceOptions:{autoLoad:!1}});u.orig=new i.Ae,u.trim=new i.Ae,t.texture=u;var c,h="http://www.w3.org/2000/svg",f="http://www.w3.org/1999/xhtml",d=document.createElementNS(h,"svg"),p=document.createElementNS(h,"foreignObject"),v=document.createElementNS(f,"div"),m=document.createElementNS(f,"style");return p.setAttribute("width","10000"),p.setAttribute("height","10000"),p.style.overflow="hidden",d.appendChild(p),t.maxWidth=r.defaultMaxWidth,t.maxHeight=r.defaultMaxHeight,t._domElement=v,t._styleElement=m,t._svgRoot=d,t._foreignObject=p,t._foreignObject.appendChild(m),t._foreignObject.appendChild(v),t._image=s,t._loadImage=new Image,t._autoResolution=r.defaultAutoResolution,t._resolution=null!==(c=r.defaultResolution)&&void 0!==c?c:i.Xd.RESOLUTION,t.text=o,t.style=a,(0,l.Z)(t)}return(0,c.Z)(r,[{key:"measureText",value:function(t){var e,r,n=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t),i=n.text,o=n.style,a=n.resolution;Object.assign(this._domElement,{innerHTML:i,style:o.toCSS(a)}),this._styleElement.textContent=o.toGlobalCSS(),document.body.appendChild(this._svgRoot);var s=this._domElement.getBoundingClientRect();this._svgRoot.remove();var u=s.width,c=s.height;(u>this.maxWidth||c>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");var h=Math.min(this.maxWidth,Math.ceil(u)),l=Math.min(this.maxHeight,Math.ceil(c));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),i!==this._text&&(this._domElement.innerHTML=this._text),o!==this._style&&(Object.assign(this._domElement,{style:null===(e=this._style)||void 0===e?void 0:e.toCSS(a)}),this._styleElement.textContent=null===(r=this._style)||void 0===r?void 0:r.toGlobalCSS()),{width:h+2*o.padding,height:l+2*o.padding}}},{key:"updateText",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this;return(0,K.Z)(Q().mark((function r(){var n,i,o,a,s,u,c;return Q().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=e.style,i=e._image,o=e._loadImage,e.localStyleID!==n.styleID&&(e.dirty=!0,e.localStyleID=n.styleID),e.dirty||!t){r.next=3;break}return r.abrupt("return");case 3:return a=e.measureText(),s=a.width,u=a.height,i.width=o.width=Math.ceil(Math.max(1,s)),i.height=o.height=Math.ceil(Math.max(1,u)),e._updateID++,c=e._updateID,r.next=8,new Promise((function(t){o.onload=(0,K.Z)(Q().mark((function r(){return Q().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(c/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}}]),r}(a.j);Ln.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Ln.defaultMaxWidth=2024,Ln.defaultMaxHeight=2024,Ln.defaultAutoResolution=!0}},function(t){var e=function(e){return t(t.s=e)};t.O(0,[774,179],(function(){return e(6840),e(387)}));var r=t.O();_N_E=r}]); //# sourceMappingURL=_app-b3cb47eda05fc18a.js.map