@vertexvis/viewer-toolkit-react 0.0.3-canary.12 → 0.0.3-canary.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs.js +1 -1
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.esm.js +1 -1
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +4 -4
- package/dist/index-BkmxazkT.js +0 -103
- package/dist/index-BkmxazkT.js.map +0 -1
- package/dist/index-BzHa3pcp.js +0 -103
- package/dist/index-BzHa3pcp.js.map +0 -1
- package/dist/png-decoder-DjeBCNQd.js +0 -6
- package/dist/png-decoder-DjeBCNQd.js.map +0 -1
- package/dist/png-decoder-h492rmTZ.js +0 -5
- package/dist/png-decoder-h492rmTZ.js.map +0 -1
- package/dist/shadow-css-008a49f5-B4spmWZX.js +0 -13
- package/dist/shadow-css-008a49f5-B4spmWZX.js.map +0 -1
- package/dist/shadow-css-008a49f5-JLlISfDE.js +0 -13
- package/dist/shadow-css-008a49f5-JLlISfDE.js.map +0 -1
- package/dist/shadow-css-78885382-C7hFYObd.js +0 -16
- package/dist/shadow-css-78885382-C7hFYObd.js.map +0 -1
- package/dist/shadow-css-78885382-lSysRry8.js +0 -16
- package/dist/shadow-css-78885382-lSysRry8.js.map +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{c as t,_ as e,a as n,b as r}from"./index-BkmxazkT.js";import"react/jsx-runtime";import"recoil";import"react";import"@vertexvis/ui-react";import"@vertexvis/viewer-react";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) 2025 Vertex Software LLC. All rights reserved.
|
|
4
|
-
*/const i={deserialize:t=>Object.assign(Error(t.message),{name:t.name,stack:t.stack}),serialize:t=>({__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack})},isSerializedError=t=>t&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker,s=undefined;let a={deserialize:t=>isSerializedError(t)?i.deserialize(t):t,serialize:t=>t instanceof Error?i.serialize(t):t},o;function deserialize(t){return a.deserialize(t)}function serialize(t){return a.serialize(t)}function getBundleURLCached(){return o||(o=getBundleURL()),o}function getBundleURL(){try{throw new Error}catch(t){const e=(""+t.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(e)return getBaseURL(e[0])}return"/"}function getBaseURL(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}const l="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4,isAbsoluteURL=t=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t);function createSourceBlobURL(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function selectWorkerImplementation(){if("undefined"==typeof Worker)return class t{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class t extends Worker{constructor(t,e){var n,r;"string"==typeof t&&e&&e._baseURL?t=new URL(t,e._baseURL):"string"==typeof t&&!isAbsoluteURL(t)&&getBundleURLCached().match(/^file:\/\//i)&&(t=new URL(t,getBundleURLCached().replace(/\/[^\/]+$/,"/")),(null===(n=null==e?void 0:e.CORSWorkaround)||void 0===n||n)&&(t=createSourceBlobURL(`importScripts(${JSON.stringify(t)});`))),"string"==typeof t&&isAbsoluteURL(t)&&(null===(r=null==e?void 0:e.CORSWorkaround)||void 0===r||r)&&(t=createSourceBlobURL(`importScripts(${JSON.stringify(t)});`)),super(t,e)}}class e extends t{constructor(t,e){const n=undefined;super(window.URL.createObjectURL(t),e)}static fromText(t,n){const r=new window.Blob([t],{type:"text/javascript"});return new e(r,n)}}return{blob:e,default:t}}let h;function getWorkerImplementation(){return h||(h=selectWorkerImplementation()),h}var c=1e3,u=60*c,d=60*u,f=24*d,p=7*f,_=365.25*f,ms=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return parse(t);if("number"===n&&isFinite(t))return e.long?fmtLong(t):fmtShort(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function parse(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r;switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*_;case"weeks":case"week":case"w":return n*p;case"days":case"day":case"d":return n*f;case"hours":case"hour":case"hrs":case"hr":case"h":return n*d;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(t){var e=Math.abs(t);return e>=f?Math.round(t/f)+"d":e>=d?Math.round(t/d)+"h":e>=u?Math.round(t/u)+"m":e>=c?Math.round(t/c)+"s":t+"ms"}function fmtLong(t){var e=Math.abs(t);return e>=f?plural(t,e,f,"day"):e>=d?plural(t,e,d,"hour"):e>=u?plural(t,e,u,"minute"):e>=c?plural(t,e,c,"second"):t+" ms"}function plural(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}function setup(t){function selectColor(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return createDebug.colors[Math.abs(e)%createDebug.colors.length]}function createDebug(t){let e,n=null,r,i;function debug(...t){if(!debug.enabled)return;const n=debug,r=Number(new Date),i=r-(e||r);n.diff=i,n.prev=e,n.curr=r,e=r,t[0]=createDebug.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((e,r)=>{if("%%"===e)return"%";s++;const i=createDebug.formatters[r];if("function"==typeof i){const r=t[s];e=i.call(n,r),t.splice(s,1),s--}return e})),createDebug.formatArgs.call(n,t);const a=undefined;(n.log||createDebug.log).apply(n,t)}return debug.namespace=t,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(t),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==n?n:(r!==createDebug.namespaces&&(r=createDebug.namespaces,i=createDebug.enabled(t)),i),set:t=>{n=t}}),"function"==typeof createDebug.init&&createDebug.init(debug),debug}function extend(t,e){const n=createDebug(this.namespace+(void 0===e?":":e)+t);return n.log=this.log,n}function enable(t){let e;createDebug.save(t),createDebug.namespaces=t,createDebug.names=[],createDebug.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),r=n.length;for(e=0;e<r;e++)n[e]&&("-"===(t=n[e].replace(/\*/g,".*?"))[0]?createDebug.skips.push(new RegExp("^"+t.substr(1)+"$")):createDebug.names.push(new RegExp("^"+t+"$")))}function disable(){const t=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((t=>"-"+t))].join(",");return createDebug.enable(""),t}function enabled(t){if("*"===t[t.length-1])return!0;let e,n;for(e=0,n=createDebug.skips.length;e<n;e++)if(createDebug.skips[e].test(t))return!1;for(e=0,n=createDebug.names.length;e<n;e++)if(createDebug.names[e].test(t))return!0;return!1}function toNamespace(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}function coerce(t){return t instanceof Error?t.stack||t.message:t}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=coerce,createDebug.disable=disable,createDebug.enable=enable,createDebug.enabled=enabled,createDebug.humanize=ms,createDebug.destroy=destroy,Object.keys(t).forEach((e=>{createDebug[e]=t[e]})),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=selectColor,createDebug.enable(createDebug.load()),createDebug}var b=setup,m=t((function(t,e){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)}function save(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}}function load(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}function localstorage(){try{return localStorage}catch(t){}}e.formatArgs=formatArgs,e.save=save,e.load=load,e.useColors=useColors,e.storage=localstorage(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=b(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}));const hasSymbols=()=>"function"==typeof Symbol,hasSymbol=t=>hasSymbols()&&Boolean(Symbol[t]),getSymbol=t=>hasSymbol(t)?Symbol[t]:"@@"+t;hasSymbol("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const g=getSymbol("iterator"),w=getSymbol("observable"),y=getSymbol("species");function getMethod(t,e){const n=t[e];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function getSpecies(t){let e=t.constructor;return void 0!==e&&(e=e[y],null===e&&(e=void 0)),void 0!==e?e:E}function isObservable(t){return t instanceof E}function hostReportError(t){hostReportError.log?hostReportError.log(t):setTimeout((()=>{throw t}),0)}function enqueue(t){Promise.resolve().then((()=>{try{t()}catch(t){hostReportError(t)}}))}function cleanupSubscription(t){const e=t._cleanup;if(void 0!==e&&(t._cleanup=void 0,e))try{if("function"==typeof e)e();else{const t=getMethod(e,"unsubscribe");t&&t.call(e)}}catch(t){hostReportError(t)}}function closeSubscription(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function flushSubscription(t){const e=t._queue;if(e){t._queue=void 0,t._state="ready";for(const n of e)if(notifySubscription(t,n.type,n.value),"closed"===t._state)break}}function notifySubscription(t,e,n){t._state="running";const r=t._observer;try{const i=r?getMethod(r,e):void 0;switch(e){case"next":i&&i.call(r,n);break;case"error":if(closeSubscription(t),!i)throw n;i.call(r,n);break;case"complete":closeSubscription(t),i&&i.call(r)}}catch(t){hostReportError(t)}"closed"===t._state?cleanupSubscription(t):"running"===t._state&&(t._state="ready")}function onNotify(t,e,n){if("closed"!==t._state)return"buffering"===t._state?(t._queue=t._queue||[],void t._queue.push({type:e,value:n})):"ready"!==t._state?(t._state="buffering",t._queue=[{type:e,value:n}],void enqueue((()=>flushSubscription(t)))):void notifySubscription(t,e,n)}class v{constructor(t,e){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";const n=new k(this);try{this._cleanup=e.call(void 0,n)}catch(t){n.error(t)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(closeSubscription(this),cleanupSubscription(this))}}class k{constructor(t){this._subscription=t}get closed(){return"closed"===this._subscription._state}next(t){onNotify(this._subscription,"next",t)}error(t){onNotify(this._subscription,"error",t)}complete(){onNotify(this._subscription,"complete")}}class E{constructor(t){if(!(this instanceof E))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}subscribe(t,e,n){return"object"==typeof t&&null!==t||(t={next:t,error:e,complete:n}),new v(t,this._subscriber)}pipe(t,...e){let n=this;for(const r of[t,...e])n=r(n);return n}tap(t,e,n){const r="object"!=typeof t||null===t?{next:t,error:e,complete:n}:t;return new E((t=>this.subscribe({next(e){r.next&&r.next(e),t.next(e)},error(e){r.error&&r.error(e),t.error(e)},complete(){r.complete&&r.complete(),t.complete()},start(t){r.start&&r.start(t)}})))}forEach(t){return new Promise(((e,n)=>{if("function"!=typeof t)return void n(new TypeError(t+" is not a function"));function done(){r.unsubscribe(),e(void 0)}const r=this.subscribe({next(e){try{t(e,done)}catch(t){n(t),r.unsubscribe()}},error(t){n(t)},complete(){e(void 0)}})}))}map(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=undefined;return new(getSpecies(this))((e=>this.subscribe({next(n){let r=n;try{r=t(n)}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}})))}filter(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=undefined;return new(getSpecies(this))((e=>this.subscribe({next(n){try{if(!t(n))return}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}})))}reduce(t,e){if("function"!=typeof t)throw new TypeError(t+" is not a function");const n=getSpecies(this),r=arguments.length>1;let i=!1,s=e;return new n((e=>this.subscribe({next(n){const a=!i;if(i=!0,!a||r)try{s=t(s,n)}catch(t){return e.error(t)}else s=n},error(t){e.error(t)},complete(){if(!i&&!r)return e.error(new TypeError("Cannot reduce an empty sequence"));e.next(s),e.complete()}})))}concat(...t){const e=getSpecies(this);return new e((n=>{let r,i=0;function startNext(s){r=s.subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){i===t.length?(r=void 0,n.complete()):startNext(e.from(t[i++]))}})}return startNext(this),()=>{r&&(r.unsubscribe(),r=void 0)}}))}flatMap(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=getSpecies(this);return new e((n=>{const r=[],i=this.subscribe({next(i){let s;if(t)try{s=t(i)}catch(t){return n.error(t)}else s=i;const a=e.from(s).subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){const t=r.indexOf(a);t>=0&&r.splice(t,1),completeIfDone()}});r.push(a)},error(t){n.error(t)},complete(){completeIfDone()}});function completeIfDone(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach((t=>t.unsubscribe())),i.unsubscribe()}}))}[w](){return this}static from(t){const e="function"==typeof this?this:E;if(null==t)throw new TypeError(t+" is not an object");const n=getMethod(t,w);if(n){const r=n.call(t);if(Object(r)!==r)throw new TypeError(r+" is not an object");return isObservable(r)&&r.constructor===e?r:new e((t=>r.subscribe(t)))}if(hasSymbol("iterator")){const n=getMethod(t,g);if(n)return new e((e=>{enqueue((()=>{if(!e.closed){for(const r of n.call(t))if(e.next(r),e.closed)return;e.complete()}}))}))}if(Array.isArray(t))return new e((e=>{enqueue((()=>{if(!e.closed){for(const n of t)if(e.next(n),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}static of(...t){const e=undefined;return new("function"==typeof this?this:E)((e=>{enqueue((()=>{if(!e.closed){for(const n of t)if(e.next(n),e.closed)return;e.complete()}}))}))}static get[y](){return this}}function unsubscribe(t){"function"==typeof t?t():t&&"function"==typeof t.unsubscribe&&t.unsubscribe()}hasSymbols()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:w,hostReportError:hostReportError},configurable:!0});class x extends E{constructor(){super((t=>(this._observers.add(t),()=>this._observers.delete(t)))),this._observers=new Set}next(t){for(const e of this._observers)e.next(t)}error(t){for(const e of this._observers)e.error(t)}complete(){for(const t of this._observers)t.complete()}}function multicast(t){const e=new x;let n,r=0;return new E((i=>{n||(n=t.subscribe(e));const s=e.subscribe(i);return r++,()=>{r--,s.unsubscribe(),0===r&&(unsubscribe(n),n=void 0)}}))}function allSettled(t){return Promise.all(t.map((t=>{const onFulfill=t=>({status:"fulfilled",value:t}),onReject=t=>({status:"rejected",reason:t}),e=Promise.resolve(t);try{return e.then(onFulfill,onReject)}catch(t){return Promise.reject(t)}})))}var A;!function(t){t.initialized="initialized",t.taskCanceled="taskCanceled",t.taskCompleted="taskCompleted",t.taskFailed="taskFailed",t.taskQueued="taskQueued",t.taskQueueDrained="taskQueueDrained",t.taskStart="taskStart",t.terminated="terminated"}(A||(A={}));const C=Symbol("thread.errors"),U=Symbol("thread.events"),T=Symbol("thread.terminate"),S=Symbol("thread.transferable"),R=Symbol("thread.worker");function fail$1(t){throw Error(t)}const O={errors:t=>t[C]||fail$1("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:t=>t[U]||fail$1("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:t=>t[T]()};var __awaiter$1=function(t,e,n,r){function adopt(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function fulfilled(t){try{step(r.next(t))}catch(t){i(t)}}function rejected(t){try{step(r.throw(t))}catch(t){i(t)}}function step(t){t.done?n(t.value):adopt(t.value).then(fulfilled,rejected)}step((r=r.apply(t,e||[])).next())}))};let z=1;function createArray(t){const e=[];for(let n=0;n<t;n++)e.push(n);return e}function delay(t){return new Promise((e=>setTimeout(e,t)))}function flatMap(t,e){return t.reduce(((t,n)=>[...t,...e(n)]),[])}function slugify(t){return t.replace(/\W/g," ").trim().replace(/\s+/g,"-")}function spawnWorkers(t,e){return createArray(e).map((()=>({init:t(),runningTasks:[]})))}class D{constructor(t,e){this.eventSubject=new x,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const n="number"==typeof e?{size:e}:e||{},{size:r=l}=n;this.debug=m(`threads:pool:${slugify(n.name||String(z++))}`),this.options=n,this.workers=spawnWorkers(t,r),this.eventObservable=multicast(E.from(this.eventSubject)),Promise.all(this.workers.map((t=>t.init))).then((()=>this.eventSubject.next({type:A.initialized,size:this.workers.length})),(t=>{this.debug("Error while initializing pool worker:",t),this.eventSubject.error(t),this.initErrors.push(t)}))}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find((e=>e.runningTasks.length<t))}runPoolTask(t,e){return __awaiter$1(this,void 0,void 0,(function*(){const n=this.workers.indexOf(t)+1;this.debug(`Running task #${e.id} on worker #${n}...`),this.eventSubject.next({type:A.taskStart,taskID:e.id,workerID:n});try{const r=yield e.run(yield t.init);this.debug(`Task #${e.id} completed successfully`),this.eventSubject.next({type:A.taskCompleted,returnValue:r,taskID:e.id,workerID:n})}catch(t){this.debug(`Task #${e.id} failed`),this.eventSubject.next({type:A.taskFailed,taskID:e.id,error:t,workerID:n})}}))}run(t,e){return __awaiter$1(this,void 0,void 0,(function*(){const n=(()=>__awaiter$1(this,void 0,void 0,(function*(){const removeTaskFromWorkersRunningTasks=()=>{t.runningTasks=t.runningTasks.filter((t=>t!==n))};yield delay(0);try{yield this.runPoolTask(t,e)}finally{removeTaskFromWorkersRunningTasks(),this.isClosing||this.scheduleWork()}})))();t.runningTasks.push(n)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e)return this.debug("Task queue is empty"),void this.eventSubject.next({type:A.taskQueueDrained});this.run(t,e)}taskCompletion(t){return new Promise(((e,n)=>{const r=this.events().subscribe((i=>{i.type===A.taskCompleted&&i.taskID===t?(r.unsubscribe(),e(i.returnValue)):i.type===A.taskFailed&&i.taskID===t?(r.unsubscribe(),n(i.error)):i.type===A.terminated&&(r.unsubscribe(),n(Error("Pool has been terminated before task was run.")))}))}))}settled(t=!1){return __awaiter$1(this,void 0,void 0,(function*(){const getCurrentlyRunningTasks=()=>flatMap(this.workers,(t=>t.runningTasks)),e=[],n=this.eventObservable.subscribe((t=>{t.type===A.taskFailed&&e.push(t.error)}));return this.initErrors.length>0?Promise.reject(this.initErrors[0]):t&&0===this.taskQueue.length?(yield allSettled(getCurrentlyRunningTasks()),e):(yield new Promise(((t,e)=>{const n=this.eventObservable.subscribe({next(e){e.type===A.taskQueueDrained&&(n.unsubscribe(),t(void 0))},error:e})})),yield allSettled(getCurrentlyRunningTasks()),n.unsubscribe(),e)}))}completed(t=!1){return __awaiter$1(this,void 0,void 0,(function*(){const e=this.settled(t),n=new Promise(((t,n)=>{const r=this.eventObservable.subscribe({next(i){i.type===A.taskQueueDrained?(r.unsubscribe(),t(e)):i.type===A.taskFailed&&(r.unsubscribe(),n(i.error))},error:n})})),r=yield Promise.race([e,n]);if(r.length>0)throw r[0]}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const n=this.nextTaskID++,r=this.taskCompletion(n);r.catch((t=>{this.debug(`Task #${n} errored:`,t)}));const i={id:n,run:t,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter((t=>t!==i)),this.eventSubject.next({type:A.taskCanceled,taskID:i.id}))},then:r.then.bind(r)};if(this.taskQueue.length>=e)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:A.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(t){return __awaiter$1(this,void 0,void 0,(function*(){this.isClosing=!0,t||(yield this.completed(!0)),this.eventSubject.next({type:A.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map((t=>__awaiter$1(this,void 0,void 0,(function*(){return O.terminate(yield t.init)})))))}))}}function PoolConstructor(t,e){return new D(t,e)}D.EventType=A,PoolConstructor.EventType=A;const I=PoolConstructor,doNothing$1=()=>{};function createPromiseWithResolver(){let t=!1,e,n=doNothing$1;const r=undefined,i=undefined;return[new Promise((r=>{t?r(e):n=r})),r=>{t=!0,e=r,n(e)}]}var N;!function(t){t.internalError="internalError",t.message="message",t.termination="termination"}(N||(N={}));const doNothing=()=>{},returnInput=t=>t,runDeferred=t=>Promise.resolve().then(t);function fail(t){throw t}function isThenable(t){return t&&"function"==typeof t.then}class F extends E{constructor(t){super((e=>{const n=this,r=Object.assign(Object.assign({},e),{complete(){e.complete(),n.onCompletion()},error(t){e.error(t),n.onError(t)},next(t){e.next(t),n.onNext(t)}});try{return this.initHasRun=!0,t(r)}catch(t){r.error(t)}})),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state="rejected",this.rejection=t;for(const e of this.rejectionCallbacks)runDeferred((()=>e(t)))}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks)runDeferred((()=>t(this.firstValue)))}then(t,e){const n=t||returnInput,r=e||fail;let i=!1;return new Promise(((t,e)=>{const rejectionCallback=n=>{if(!i){i=!0;try{t(r(n))}catch(t){e(t)}}},fulfillmentCallback=e=>{try{t(n(e))}catch(t){rejectionCallback(t)}};return this.initHasRun||this.subscribe({error:rejectionCallback}),"fulfilled"===this.state?t(n(this.firstValue)):"rejected"===this.state?(i=!0,t(r(this.rejection))):(this.fulfillmentCallbacks.push(fulfillmentCallback),void this.rejectionCallbacks.push(rejectionCallback))}))}catch(t){return this.then(void 0,t)}finally(t){const e=t||doNothing;return this.then((t=>(e(),t)),(()=>e()))}static from(t){return isThenable(t)?new F((e=>{const onFulfilled=t=>{e.next(t),e.complete()},onRejected=t=>{e.error(t)};t.then(onFulfilled,onRejected)})):super.from(t)}}function isTransferable$1(t){return!(!t||"object"!=typeof t)}function isTransferDescriptor(t){return t&&"object"==typeof t&&t[S]}function Transfer(t,e){if(!e){if(!isTransferable$1(t))throw Error();e=[t]}return{[S]:!0,send:t,transferables:e}}var L,P;!function(t){t.cancel="cancel",t.run="run"}(L||(L={})),function(t){t.error="error",t.init="init",t.result="result",t.running="running",t.uncaughtError="uncaughtError"}(P||(P={}));const B=m("threads:master:messages");let j=1;const dedupe=t=>Array.from(new Set(t)),isJobErrorMessage=t=>t&&t.type===P.error,isJobResultMessage=t=>t&&t.type===P.result,isJobStartMessage=t=>t&&t.type===P.running;function createObservableForJob(t,e){return new E((n=>{let r;const messageHandler=i=>{if(B("Message from worker:",i.data),i.data&&i.data.uid===e)if(isJobStartMessage(i.data))r=i.data.resultType;else if(isJobResultMessage(i.data))"promise"===r?(void 0!==i.data.payload&&n.next(deserialize(i.data.payload)),n.complete(),t.removeEventListener("message",messageHandler)):(i.data.payload&&n.next(deserialize(i.data.payload)),i.data.complete&&(n.complete(),t.removeEventListener("message",messageHandler)));else if(isJobErrorMessage(i.data)){const e=deserialize(i.data.error);n.error(e),t.removeEventListener("message",messageHandler)}};return t.addEventListener("message",messageHandler),()=>{if("observable"===r||!r){const n={type:L.cancel,uid:e};t.postMessage(n)}t.removeEventListener("message",messageHandler)}}))}function prepareArguments(t){if(0===t.length)return{args:[],transferables:[]};const e=[],n=[];for(const r of t)isTransferDescriptor(r)?(e.push(serialize(r.send)),n.push(...r.transferables)):e.push(serialize(r));return{args:e,transferables:0===n.length?n:dedupe(n)}}function createProxyFunction(t,e){return(...n)=>{const r=j++,{args:i,transferables:s}=prepareArguments(n),a={type:L.run,uid:r,method:e,args:i};B("Sending command to run function to worker:",a);try{t.postMessage(a,s)}catch(t){return F.from(Promise.reject(t))}return F.from(multicast(createObservableForJob(t,r)))}}function createProxyModule(t,e){const n={};for(const r of e)n[r]=createProxyFunction(t,r);return n}var __awaiter=function(t,e,n,r){function adopt(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function fulfilled(t){try{step(r.next(t))}catch(t){i(t)}}function rejected(t){try{step(r.throw(t))}catch(t){i(t)}}function step(t){t.done?n(t.value):adopt(t.value).then(fulfilled,rejected)}step((r=r.apply(t,e||[])).next())}))};const M=m("threads:master:messages"),Z=m("threads:master:spawn"),W=m("threads:master:thread-utils"),isInitMessage=t=>t&&"init"===t.type,isUncaughtErrorMessage=t=>t&&"uncaughtError"===t.type,H="undefined"!=typeof process&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function withTimeout(t,e,n){return __awaiter(this,void 0,void 0,(function*(){let r;const i=new Promise(((t,i)=>{r=setTimeout((()=>i(Error(n))),e)})),s=yield Promise.race([t,i]);return clearTimeout(r),s}))}function receiveInitMessage(t){return new Promise(((e,n)=>{const messageHandler=r=>{M("Message from worker before finishing initialization:",r.data),isInitMessage(r.data)?(t.removeEventListener("message",messageHandler),e(r.data)):isUncaughtErrorMessage(r.data)&&(t.removeEventListener("message",messageHandler),n(deserialize(r.data.error)))};t.addEventListener("message",messageHandler)}))}function createEventObservable(t,e){return new E((n=>{const messageHandler=t=>{const e={type:N.message,data:t.data};n.next(e)},rejectionHandler=t=>{W("Unhandled promise rejection event in thread:",t);const e={type:N.internalError,error:Error(t.reason)};n.next(e)};t.addEventListener("message",messageHandler),t.addEventListener("unhandledrejection",rejectionHandler),e.then((()=>{const e={type:N.termination};t.removeEventListener("message",messageHandler),t.removeEventListener("unhandledrejection",rejectionHandler),n.next(e),n.complete()}))}))}function createTerminator(t){const[e,n]=createPromiseWithResolver(),r=undefined;return{terminate:()=>__awaiter(this,void 0,void 0,(function*(){W("Terminating worker"),yield t.terminate(),n()})),termination:e}}function setPrivateThreadProps(t,e,n,r){const i=n.filter((t=>t.type===N.internalError)).map((t=>t.error));return Object.assign(t,{[C]:i,[U]:n,[T]:r,[R]:e})}function spawn(t,e){return __awaiter(this,void 0,void 0,(function*(){Z("Initializing new thread");const e=H,n=undefined,r=(yield withTimeout(receiveInitMessage(t),e,`Timeout: Did not receive an init message from worker after ${e}ms. Make sure the worker calls expose().`)).exposed,{termination:i,terminate:s}=createTerminator(t),a=createEventObservable(t,i);if("function"===r.type){const e=undefined;return setPrivateThreadProps(createProxyFunction(t),t,a,s)}if("module"===r.type){const e=undefined;return setPrivateThreadProps(createProxyModule(t,r.methods),t,a,s)}{const t=r.type;throw Error(`Worker init message states unexpected type of expose(): ${t}`)}}))}const $=getWorkerImplementation().blob;getWorkerImplementation().default;var K=function(){function TerminateController(){this.threads=[],this.pools=[]}return TerminateController.prototype.addThread=function(t){this.threads.push(t)},TerminateController.prototype.addPool=function(t){this.pools.push(t)},TerminateController.prototype.terminate=function(t){return void 0===t&&(t=!1),e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,Promise.all(r(r([],this.threads.map((function(t){return O.terminate(t)}))),this.pools.map((function(e){return e.terminate(t)}))))];case 1:return e.sent(),[2]}}))}))},TerminateController}();function getGlobal(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}var G=getGlobal();function instanceOf(t,e){var n=G[e];return null!=n&&t instanceof n}function isTransferable(t){return instanceOf(t,"ArrayBuffer")||instanceOf(t,"MessagePort")||instanceOf(t,"ImageBitmap")||instanceOf(t,"OffscreenCanvas")}function isTypedArray(t){return instanceOf(t,"Int8Array")||instanceOf(t,"Uint8Array")||instanceOf(t,"Uint8ClampedArray")||instanceOf(t,"Int16Array")||instanceOf(t,"Uint16Array")||instanceOf(t,"Int32Array")||instanceOf(t,"Uint32Array")||instanceOf(t,"Float32Array")||instanceOf(t,"Float64Array")||instanceOf(t,"BigInt64Array")||instanceOf(t,"BigUint64Array")}function makeTransferable(t){return isTransferable(t)?Transfer(t):null!=t&&"object"==typeof t?Transfer(t,findTransferables(t)):t;var e}function findTransferables(t){if(isTransferable(t))return[t];if("object"==typeof t){if(Array.isArray(t)){var e=[];return t.forEach((function(t){return e.push.apply(e,findTransferables(t))})),e}return isTypedArray(t)?[t.buffer]:null!=t?Object.values(t).reduce((function(t,e){return t.push.apply(t,findTransferables(e)),t}),[]):[]}return[]}const Q="png-decoder-worker.js",q='!function(){"use strict";\n/*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */function t(t,e,n,i){return new(n||(n=Promise))((function(r,a){function s(t){try{l(i.next(t))}catch(t){a(t)}}function o(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}l((i=i.apply(t,e||[])).next())}))}function e(t,e){var n,i,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}}const n={deserialize:t=>Object.assign(Error(t.message),{name:t.name,stack:t.stack}),serialize:t=>({__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack})};let i={deserialize(t){return(e=t)&&"object"==typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker?n.deserialize(t):t;var e},serialize:t=>t instanceof Error?n.serialize(t):t};function r(t){return i.deserialize(t)}function a(t){return i.serialize(t)}const s=Symbol("thread.transferable");function o(t,e){if(!e){if(!(n=t)||"object"!=typeof n)throw Error();e=[t]}var n;return{[s]:!0,send:t,transferables:e}}var l,h;!function(t){t.cancel="cancel",t.run="run"}(l||(l={})),function(t){t.error="error",t.init="init",t.result="result",t.running="running",t.uncaughtError="uncaughtError"}(h||(h={}));var d=function(){const t="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||t)},f=function(t,e){self.postMessage(t,e)},c=function(t){const e=e=>{t(e.data)};return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}},u=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function s(t){try{l(i.next(t))}catch(t){a(t)}}function o(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}l((i=i.apply(t,e||[])).next())}))};let _=!1;const p=new Map,w=t=>t&&t.type===l.run,b=t=>{return!!(e=t)&&("symbol"==typeof Symbol.observable&&"function"==typeof e[Symbol.observable]?e===e[Symbol.observable]():"function"==typeof e["@@observable"]&&e===e["@@observable"]())||function(t){return t&&"object"==typeof t&&"function"==typeof t.subscribe}(t);var e};function g(t){return function(t){return t&&"object"==typeof t&&t[s]}(t)?{payload:t.send,transferables:t.transferables}:{payload:t,transferables:void 0}}function m(t,e){const{payload:n,transferables:i}=g(e),r={type:h.error,uid:t,error:a(n)};f(r,i)}function y(t,e,n){const{payload:i,transferables:r}=g(n),a={type:h.result,uid:t,complete:!!e||void 0,payload:i};f(a,r)}function k(t){try{const e={type:h.uncaughtError,error:a(t)};f(e)}catch(e){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.Latest error:",e,"Original error:",t)}}function v(t,e,n){return u(this,void 0,void 0,(function*(){let i;try{i=e(...n)}catch(e){return m(t,e)}const r=b(i)?"observable":"promise";if(function(t,e){const n={type:h.running,uid:t,resultType:e};f(n)}(t,r),b(i)){const e=i.subscribe((e=>y(t,!1,a(e))),(e=>{m(t,a(e)),p.delete(t)}),(()=>{y(t,!0),p.delete(t)}));p.set(t,e)}else try{const e=yield i;y(t,!0,a(e))}catch(e){m(t,a(e))}}))}function E(t){if(!d())throw Error("expose() called in the master thread.");if(_)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(_=!0,"function"==typeof t)c((e=>{w(e)&&!e.method&&v(e.uid,t,e.args.map(r))})),function(){const t={type:h.init,exposed:{type:"function"}};f(t)}();else{if("object"!=typeof t||!t)throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${t}`);c((e=>{w(e)&&e.method&&v(e.uid,t[e.method],e.args.map(r))}));!function(t){const e={type:h.init,exposed:{type:"module",methods:t}};f(e)}(Object.keys(t).filter((e=>"function"==typeof t[e])))}c((t=>{if((e=t)&&e.type===l.cancel){const e=t.uid,n=p.get(e);n&&(n.unsubscribe(),p.delete(e))}var e}))}"undefined"!=typeof self&&"function"==typeof self.addEventListener&&d()&&(self.addEventListener("error",(t=>{setTimeout((()=>k(t.error||t)),250)})),self.addEventListener("unhandledrejection",(t=>{const e=t.reason;e&&"string"==typeof e.message&&setTimeout((()=>k(e)),250)}))),"undefined"!=typeof process&&"function"==typeof process.on&&d()&&(process.on("uncaughtException",(t=>{setTimeout((()=>k(t)),250)})),process.on("unhandledRejection",(t=>{t&&"string"==typeof t.message&&setTimeout((()=>k(t)),250)})));var A=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();function x(t,e){var n=A[e];return null!=n&&t instanceof n}function U(t){return x(t,"ArrayBuffer")||x(t,"MessagePort")||x(t,"ImageBitmap")||x(t,"OffscreenCanvas")}function z(t){return U(t)?o(t):null!=t&&"object"==typeof t?o(t,R(t)):t}function R(t){if(U(t))return[t];if("object"==typeof t){if(Array.isArray(t)){var e=[];return t.forEach((function(t){return e.push.apply(e,R(t))})),e}return function(t){return x(t,"Int8Array")||x(t,"Uint8Array")||x(t,"Uint8ClampedArray")||x(t,"Int16Array")||x(t,"Uint16Array")||x(t,"Int32Array")||x(t,"Uint32Array")||x(t,"Float32Array")||x(t,"Float64Array")||x(t,"BigInt64Array")||x(t,"BigUint64Array")}(t)?[t.buffer]:null!=t?Object.values(t).reduce((function(t,e){return t.push.apply(t,R(e)),t}),[]):[]}return[]}!function(t){if(t.TextEncoder&&t.TextDecoder)return!1;function e(t="utf-8"){if("utf-8"!==t)throw new RangeError(`Failed to construct \'TextEncoder\': The encoding label provided (\'${t}\') is invalid.`)}function n(t="utf-8",e={fatal:!1}){if("utf-8"!==t)throw new RangeError(`Failed to construct \'TextDecoder\': The encoding label provided (\'${t}\') is invalid.`);if(e.fatal)throw new Error("Failed to construct \'TextDecoder\': the \'fatal\' option is unsupported.")}Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to encode: the \'stream\' option is unsupported.");let n=0;const i=t.length;let r=0,a=Math.max(32,i+(i>>1)+7),s=new Uint8Array(a>>3<<3);for(;n<i;){let e=t.charCodeAt(n++);if(e>=55296&&e<=56319){if(n<i){const i=t.charCodeAt(n);56320==(64512&i)&&(++n,e=((1023&e)<<10)+(1023&i)+65536)}if(e>=55296&&e<=56319)continue}if(r+4>s.length){a+=8,a*=1+n/t.length*2,a=a>>3<<3;const e=new Uint8Array(a);e.set(s),s=e}if(0!=(4294967168&e)){if(0==(4294965248&e))s[r++]=e>>6&31|192;else if(0==(4294901760&e))s[r++]=e>>12&15|224,s[r++]=e>>6&63|128;else{if(0!=(4292870144&e))continue;s[r++]=e>>18&7|240,s[r++]=e>>12&63|128,s[r++]=e>>6&63|128}s[r++]=63&e|128}else s[r++]=e}return s.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to decode: the \'stream\' option is unsupported.");const n=new Uint8Array(t);let i=0;const r=n.length,a=[];for(;i<r;){const t=n[i++];if(0===t)break;if(0==(128&t))a.push(t);else if(192==(224&t)){const e=63&n[i++];a.push((31&t)<<6|e)}else if(224==(240&t)){const e=63&n[i++],r=63&n[i++];a.push((31&t)<<12|e<<6|r)}else if(240==(248&t)){let e=(7&t)<<18|(63&n[i++])<<12|(63&n[i++])<<6|63&n[i++];e>65535&&(e-=65536,a.push(e>>>10&1023|55296),e=56320|1023&e),a.push(e)}}return String.fromCharCode.apply(null,a)},t.TextEncoder=e,t.TextDecoder=n}("undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0);const L=new TextDecoder("utf-8");const T=new TextEncoder;class N{constructor(t=8192,e={}){let n=!1;"number"==typeof t?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const i=e.offset?e.offset>>>0:0,r=t.byteLength-i;let a=i;(ArrayBuffer.isView(t)||t instanceof N)&&(t.byteLength!==t.buffer.byteLength&&(a=t.byteOffset+i),t=t.buffer),this.lastWrittenByte=n?r:0,this.buffer=t,this.length=r,this.byteLength=r,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,r),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const e=2*(this.offset+t),n=new Uint8Array(e);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=this.byteLength=e,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){const e=new Uint8Array(t);for(let n=0;n<t;n++)e[n]=this.readByte();return e}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let e="";for(let n=0;n<t;n++)e+=this.readChar();return e}readUtf8(t=1){return e=this.readBytes(t),L.decode(e);var e}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let e=0;e<t.length;e++)this._data.setUint8(this.offset++,t[e]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let e=0;e<t.length;e++)this.writeUint8(t.charCodeAt(e));return this}writeUtf8(t){return this.writeBytes(function(t){return T.encode(t)}(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}\n/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */function O(t){let e=t.length;for(;--e>=0;)t[e]=0}const S=256,C=286,D=30,I=15,B=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Z=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),F=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),M=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),P=new Array(576);O(P);const H=new Array(60);O(H);const j=new Array(512);O(j);const W=new Array(256);O(W);const K=new Array(29);O(K);const $=new Array(D);function Y(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}let G,X,V;function q(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}O($);const J=t=>t<256?j[t]:j[256+(t>>>7)],Q=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},tt=(t,e,n)=>{t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,Q(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},et=(t,e,n)=>{tt(t,n[2*e],n[2*e+1])},nt=(t,e)=>{let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1},it=(t,e,n)=>{const i=new Array(16);let r,a,s=0;for(r=1;r<=I;r++)i[r]=s=s+n[r-1]<<1;for(a=0;a<=e;a++){let e=t[2*a+1];0!==e&&(t[2*a]=nt(i[e]++,e))}},rt=t=>{let e;for(e=0;e<C;e++)t.dyn_ltree[2*e]=0;for(e=0;e<D;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},at=t=>{t.bi_valid>8?Q(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},st=(t,e,n,i)=>{const r=2*e,a=2*n;return t[r]<t[a]||t[r]===t[a]&&i[e]<=i[n]},ot=(t,e,n)=>{const i=t.heap[n];let r=n<<1;for(;r<=t.heap_len&&(r<t.heap_len&&st(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!st(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i},lt=(t,e,n)=>{let i,r,a,s,o=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],r=t.pending_buf[t.l_buf+o],o++,0===i?et(t,r,e):(a=W[r],et(t,a+S+1,e),s=B[a],0!==s&&(r-=K[a],tt(t,r,s)),i--,a=J(i),et(t,a,n),s=Z[a],0!==s&&(i-=$[a],tt(t,i,s)))}while(o<t.last_lit);et(t,256,e)},ht=(t,e)=>{const n=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,a=e.stat_desc.elems;let s,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<a;s++)0!==n[2*s]?(t.heap[++t.heap_len]=h=s,t.depth[s]=0):n[2*s+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,n[2*l]=1,t.depth[l]=0,t.opt_len--,r&&(t.static_len-=i[2*l+1]);for(e.max_code=h,s=t.heap_len>>1;s>=1;s--)ot(t,n,s);l=a;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ot(t,n,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,n[2*l]=n[2*s]+n[2*o],t.depth[l]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,n[2*s+1]=n[2*o+1]=l,t.heap[1]=l++,ot(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const n=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,f,c,u,_,p=0;for(c=0;c<=I;c++)t.bl_count[c]=0;for(n[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],c=n[2*n[2*d+1]+1]+1,c>l&&(c=l,p++),n[2*d+1]=c,d>i||(t.bl_count[c]++,u=0,d>=o&&(u=s[d-o]),_=n[2*d],t.opt_len+=_*(c+u),a&&(t.static_len+=_*(r[2*d+1]+u)));if(0!==p){do{for(c=l-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[l]--,p-=2}while(p>0);for(c=l;0!==c;c--)for(d=t.bl_count[c];0!==d;)f=t.heap[--h],f>i||(n[2*f+1]!==c&&(t.opt_len+=(c-n[2*f+1])*n[2*f],n[2*f+1]=c),d--)}})(t,e),it(n,h,t.bl_count)},dt=(t,e,n)=>{let i,r,a=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++o<l&&r===s||(o<h?t.bl_tree[2*r]+=o:0!==r?(r!==a&&t.bl_tree[2*r]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,a=r,0===s?(l=138,h=3):r===s?(l=6,h=3):(l=7,h=4))},ft=(t,e,n)=>{let i,r,a=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),i=0;i<=n;i++)if(r=s,s=e[2*(i+1)+1],!(++o<l&&r===s)){if(o<h)do{et(t,r,t.bl_tree)}while(0!=--o);else 0!==r?(r!==a&&(et(t,r,t.bl_tree),o--),et(t,16,t.bl_tree),tt(t,o-3,2)):o<=10?(et(t,17,t.bl_tree),tt(t,o-3,3)):(et(t,18,t.bl_tree),tt(t,o-11,7));o=0,a=r,0===s?(l=138,h=3):r===s?(l=6,h=3):(l=7,h=4)}};let ct=!1;const ut=(t,e,n,i)=>{tt(t,0+(i?1:0),3),((t,e,n,i)=>{at(t),i&&(Q(t,n),Q(t,~n)),t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n})(t,e,n,!0)};var _t=(t,e,n,i)=>{let r,a,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<S;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),ht(t,t.l_desc),ht(t,t.d_desc),s=(t=>{let e;for(dt(t,t.dyn_ltree,t.l_desc.max_code),dt(t,t.dyn_dtree,t.d_desc.max_code),ht(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*M[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),r=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=r&&(r=a)):r=a=n+5,n+4<=r&&-1!==e?ut(t,e,n,i):4===t.strategy||a===r?(tt(t,2+(i?1:0),3),lt(t,P,H)):(tt(t,4+(i?1:0),3),((t,e,n,i)=>{let r;for(tt(t,e-257,5),tt(t,n-1,5),tt(t,i-4,4),r=0;r<i;r++)tt(t,t.bl_tree[2*M[r]+1],3);ft(t,t.dyn_ltree,e-1),ft(t,t.dyn_dtree,n-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),lt(t,t.dyn_ltree,t.dyn_dtree)),rt(t),i&&at(t)},pt={_tr_init:t=>{ct||((()=>{let t,e,n,i,r;const a=new Array(16);for(n=0,i=0;i<28;i++)for(K[i]=n,t=0;t<1<<B[i];t++)W[n++]=i;for(W[n-1]=i,r=0,i=0;i<16;i++)for($[i]=r,t=0;t<1<<Z[i];t++)j[r++]=i;for(r>>=7;i<D;i++)for($[i]=r<<7,t=0;t<1<<Z[i]-7;t++)j[256+r++]=i;for(e=0;e<=I;e++)a[e]=0;for(t=0;t<=143;)P[2*t+1]=8,t++,a[8]++;for(;t<=255;)P[2*t+1]=9,t++,a[9]++;for(;t<=279;)P[2*t+1]=7,t++,a[7]++;for(;t<=287;)P[2*t+1]=8,t++,a[8]++;for(it(P,287,a),t=0;t<D;t++)H[2*t+1]=5,H[2*t]=nt(t,5);G=new Y(P,B,257,C,I),X=new Y(H,Z,0,D,I),V=new Y(new Array(0),F,0,19,7)})(),ct=!0),t.l_desc=new q(t.dyn_ltree,G),t.d_desc=new q(t.dyn_dtree,X),t.bl_desc=new q(t.bl_tree,V),t.bi_buf=0,t.bi_valid=0,rt(t)},_tr_stored_block:ut,_tr_flush_block:_t,_tr_tally:(t,e,n)=>(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(W[n]+S+1)]++,t.dyn_dtree[2*J(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{tt(t,2,3),et(t,256,P),(t=>{16===t.bi_valid?(Q(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var wt=(t,e,n,i)=>{let r=65535&t|0,a=t>>>16&65535|0,s=0;for(;0!==n;){s=n>2e3?2e3:n,n-=s;do{r=r+e[i++]|0,a=a+r|0}while(--s);r%=65521,a%=65521}return r|a<<16|0};const bt=new Uint32Array((()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e})());var gt=(t,e,n,i)=>{const r=bt,a=i+n;t^=-1;for(let n=i;n<a;n++)t=t>>>8^r[255&(t^e[n])];return-1^t},mt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},yt={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:kt,_tr_stored_block:vt,_tr_flush_block:Et,_tr_tally:At,_tr_align:xt}=pt,{Z_NO_FLUSH:Ut,Z_PARTIAL_FLUSH:zt,Z_FULL_FLUSH:Rt,Z_FINISH:Lt,Z_BLOCK:Tt,Z_OK:Nt,Z_STREAM_END:Ot,Z_STREAM_ERROR:St,Z_DATA_ERROR:Ct,Z_BUF_ERROR:Dt,Z_DEFAULT_COMPRESSION:It,Z_FILTERED:Bt,Z_HUFFMAN_ONLY:Zt,Z_RLE:Ft,Z_FIXED:Mt,Z_DEFAULT_STRATEGY:Pt,Z_UNKNOWN:Ht,Z_DEFLATED:jt}=yt,Wt=258,Kt=262,$t=103,Yt=113,Gt=666,Xt=(t,e)=>(t.msg=mt[e],e),Vt=t=>(t<<1)-(t>4?9:0),qt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let Jt=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const Qt=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},te=(t,e)=>{Et(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Qt(t.strm)},ee=(t,e)=>{t.pending_buf[t.pending++]=e},ne=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},ie=(t,e,n,i)=>{let r=t.avail_in;return r>i&&(r=i),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),n),1===t.state.wrap?t.adler=wt(t.adler,e,r,n):2===t.state.wrap&&(t.adler=gt(t.adler,e,r,n)),t.next_in+=r,t.total_in+=r,r)},re=(t,e)=>{let n,i,r=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-Kt?t.strstart-(t.w_size-Kt):0,h=t.window,d=t.w_mask,f=t.prev,c=t.strstart+Wt;let u=h[a+s-1],_=h[a+s];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do{if(n=e,h[n+s]===_&&h[n+s-1]===u&&h[n]===h[a]&&h[++n]===h[a+1]){a+=2,n++;do{}while(h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&a<c);if(i=Wt-(c-a),a=c-Wt,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[a+s-1],_=h[a+s]}}}while((e=f[e&d])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},ae=t=>{const e=t.w_size;let n,i,r,a,s;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,n=i;do{r=t.head[--n],t.head[n]=r>=e?r-e:0}while(--i);i=e,n=i;do{r=t.prev[--n],t.prev[n]=r>=e?r-e:0}while(--i);a+=e}if(0===t.strm.avail_in)break;if(i=ie(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=i,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=Jt(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=Jt(t,t.ins_h,t.window[s+3-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<Kt&&0!==t.strm.avail_in)},se=(t,e)=>{let n,i;for(;;){if(t.lookahead<Kt){if(ae(t),t.lookahead<Kt&&e===Ut)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-Kt&&(t.match_length=re(t,n)),t.match_length>=3)if(i=At(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+1]);else i=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2},oe=(t,e)=>{let n,i,r;for(;;){if(t.lookahead<Kt){if(ae(t),t.lookahead<Kt&&e===Ut)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-Kt&&(t.match_length=re(t,n),t.match_length<=5&&(t.strategy===Bt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,i=At(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(te(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=At(t,0,t.window[t.strstart-1]),i&&te(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=At(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2};function le(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}const he=[new le(0,0,0,0,((t,e)=>{let n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ae(t),0===t.lookahead&&e===Ut)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,te(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-Kt&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(te(t,!1),t.strm.avail_out),1)})),new le(4,4,8,4,se),new le(4,5,16,8,se),new le(4,6,32,32,se),new le(4,4,16,16,oe),new le(8,16,32,32,oe),new le(8,16,128,128,oe),new le(8,32,128,256,oe),new le(32,128,258,1024,oe),new le(32,258,258,4096,oe)];function de(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=jt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),qt(this.dyn_ltree),qt(this.dyn_dtree),qt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),qt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),qt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const fe=t=>{if(!t||!t.state)return Xt(t,St);t.total_in=t.total_out=0,t.data_type=Ht;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:Yt,t.adler=2===e.wrap?0:1,e.last_flush=Ut,kt(e),Nt},ce=t=>{const e=fe(t);var n;return e===Nt&&((n=t.state).window_size=2*n.w_size,qt(n.head),n.max_lazy_match=he[n.level].max_lazy,n.good_match=he[n.level].good_length,n.nice_match=he[n.level].nice_length,n.max_chain_length=he[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),e},ue=(t,e,n,i,r,a)=>{if(!t)return St;let s=1;if(e===It&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),r<1||r>9||n!==jt||i<8||i>15||e<0||e>9||a<0||a>Mt)return Xt(t,St);8===i&&(i=9);const o=new de;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=a,o.method=n,ce(t)};var _e={deflateInit:(t,e)=>ue(t,e,jt,15,8,Pt),deflateInit2:ue,deflateReset:ce,deflateResetKeep:fe,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?St:(t.state.gzhead=e,Nt):St,deflate:(t,e)=>{let n,i;if(!t||!t.state||e>Tt||e<0)return t?Xt(t,St):St;const r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===Gt&&e!==Lt)return Xt(t,0===t.avail_out?Dt:St);r.strm=t;const a=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,ee(r,31),ee(r,139),ee(r,8),r.gzhead?(ee(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ee(r,255&r.gzhead.time),ee(r,r.gzhead.time>>8&255),ee(r,r.gzhead.time>>16&255),ee(r,r.gzhead.time>>24&255),ee(r,9===r.level?2:r.strategy>=Zt||r.level<2?4:0),ee(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(ee(r,255&r.gzhead.extra.length),ee(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=gt(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(ee(r,0),ee(r,0),ee(r,0),ee(r,0),ee(r,0),ee(r,9===r.level?2:r.strategy>=Zt||r.level<2?4:0),ee(r,3),r.status=Yt);else{let e=jt+(r.w_bits-8<<4)<<8,n=-1;n=r.strategy>=Zt||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,r.status=Yt,ne(r,e),0!==r.strstart&&(ne(r,t.adler>>>16),ne(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(n=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),Qt(t),n=r.pending,r.pending!==r.pending_buf_size));)ee(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),Qt(t),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,ee(r,i)}while(0!==i);r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),Qt(t),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,ee(r,i)}while(0!==i);r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.status=$t)}else r.status=$t;if(r.status===$t&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Qt(t),r.pending+2<=r.pending_buf_size&&(ee(r,255&t.adler),ee(r,t.adler>>8&255),t.adler=0,r.status=Yt)):r.status=Yt),0!==r.pending){if(Qt(t),0===t.avail_out)return r.last_flush=-1,Nt}else if(0===t.avail_in&&Vt(e)<=Vt(a)&&e!==Lt)return Xt(t,Dt);if(r.status===Gt&&0!==t.avail_in)return Xt(t,Dt);if(0!==t.avail_in||0!==r.lookahead||e!==Ut&&r.status!==Gt){let n=r.strategy===Zt?((t,e)=>{let n;for(;;){if(0===t.lookahead&&(ae(t),0===t.lookahead)){if(e===Ut)return 1;break}if(t.match_length=0,n=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===Ft?((t,e)=>{let n,i,r,a;const s=t.window;for(;;){if(t.lookahead<=Wt){if(ae(t),t.lookahead<=Wt&&e===Ut)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=t.strstart-1,i=s[r],i===s[++r]&&i===s[++r]&&i===s[++r])){a=t.strstart+Wt;do{}while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&r<a);t.match_length=Wt-(a-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=At(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2})(r,e):he[r.level].func(r,e);if(3!==n&&4!==n||(r.status=Gt),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),Nt;if(2===n&&(e===zt?xt(r):e!==Tt&&(vt(r,0,0,!1),e===Rt&&(qt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Qt(t),0===t.avail_out))return r.last_flush=-1,Nt}return e!==Lt?Nt:r.wrap<=0?Ot:(2===r.wrap?(ee(r,255&t.adler),ee(r,t.adler>>8&255),ee(r,t.adler>>16&255),ee(r,t.adler>>24&255),ee(r,255&t.total_in),ee(r,t.total_in>>8&255),ee(r,t.total_in>>16&255),ee(r,t.total_in>>24&255)):(ne(r,t.adler>>>16),ne(r,65535&t.adler)),Qt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Nt:Ot)},deflateEnd:t=>{if(!t||!t.state)return St;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==$t&&e!==Yt&&e!==Gt?Xt(t,St):(t.state=null,e===Yt?Xt(t,Ct):Nt)},deflateSetDictionary:(t,e)=>{let n=e.length;if(!t||!t.state)return St;const i=t.state,r=i.wrap;if(2===r||1===r&&42!==i.status||i.lookahead)return St;if(1===r&&(t.adler=wt(t.adler,e,n,0)),i.wrap=0,n>=i.w_size){0===r&&(qt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(n-i.w_size,n),0),e=t,n=i.w_size}const a=t.avail_in,s=t.next_in,o=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,ae(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=Jt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,ae(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=s,t.input=o,t.avail_in=a,i.wrap=r,Nt},deflateInfo:"pako deflate (from Nodeca project)"};const pe=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var we=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const e in n)pe(n,e)&&(t[e]=n[e])}}return t},be=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;const n=new Uint8Array(e);for(let e=0,i=0,r=t.length;e<r;e++){let r=t[e];n.set(r,i),i+=r.length}return n};let ge=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){ge=!1}const me=new Uint8Array(256);for(let t=0;t<256;t++)me[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;me[254]=me[254]=1;var ye=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,n,i,r,a,s=t.length,o=0;for(r=0;r<s;r++)n=t.charCodeAt(r),55296==(64512&n)&&r+1<s&&(i=t.charCodeAt(r+1),56320==(64512&i)&&(n=65536+(n-55296<<10)+(i-56320),r++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(o),a=0,r=0;a<o;r++)n=t.charCodeAt(r),55296==(64512&n)&&r+1<s&&(i=t.charCodeAt(r+1),56320==(64512&i)&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|63&n):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|63&n):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|63&n);return e},ke=(t,e)=>{const n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,r;const a=new Array(2*n);for(r=0,i=0;i<n;){let e=t[i++];if(e<128){a[r++]=e;continue}let s=me[e];if(s>4)a[r++]=65533,i+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&i<n;)e=e<<6|63&t[i++],s--;s>1?a[r++]=65533:e<65536?a[r++]=e:(e-=65536,a[r++]=55296|e>>10&1023,a[r++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&ge)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n})(a,r)},ve=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+me[t[n]]>e?n:e};var Ee=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ae=Object.prototype.toString,{Z_NO_FLUSH:xe,Z_SYNC_FLUSH:Ue,Z_FULL_FLUSH:ze,Z_FINISH:Re,Z_OK:Le,Z_STREAM_END:Te,Z_DEFAULT_COMPRESSION:Ne,Z_DEFAULT_STRATEGY:Oe,Z_DEFLATED:Se}=yt;function Ce(t){this.options=we({level:Ne,method:Se,chunkSize:16384,windowBits:15,memLevel:8,strategy:Oe},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ee,this.strm.avail_out=0;let n=_e.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==Le)throw new Error(mt[n]);if(e.header&&_e.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?ye(e.dictionary):"[object ArrayBuffer]"===Ae.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=_e.deflateSetDictionary(this.strm,t),n!==Le)throw new Error(mt[n]);this._dict_set=!0}}Ce.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize;let r,a;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Re:xe,"string"==typeof t?n.input=ye(t):"[object ArrayBuffer]"===Ae.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(a===Ue||a===ze)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(r=_e.deflate(n,a),r===Te)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=_e.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Le;if(0!==n.avail_out){if(a>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Ce.prototype.onData=function(t){this.chunks.push(t)},Ce.prototype.onEnd=function(t){t===Le&&(this.result=be(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var De=function(t,e){let n,i,r,a,s,o,l,h,d,f,c,u,_,p,w,b,g,m,y,k,v,E,A,x;const U=t.state;n=t.next_in,A=t.input,i=n+(t.avail_in-5),r=t.next_out,x=t.output,a=r-(e-t.avail_out),s=r+(t.avail_out-257),o=U.dmax,l=U.wsize,h=U.whave,d=U.wnext,f=U.window,c=U.hold,u=U.bits,_=U.lencode,p=U.distcode,w=(1<<U.lenbits)-1,b=(1<<U.distbits)-1;t:do{u<15&&(c+=A[n++]<<u,u+=8,c+=A[n++]<<u,u+=8),g=_[c&w];e:for(;;){if(m=g>>>24,c>>>=m,u-=m,m=g>>>16&255,0===m)x[r++]=65535&g;else{if(!(16&m)){if(0==(64&m)){g=_[(65535&g)+(c&(1<<m)-1)];continue e}if(32&m){U.mode=12;break t}t.msg="invalid literal/length code",U.mode=30;break t}y=65535&g,m&=15,m&&(u<m&&(c+=A[n++]<<u,u+=8),y+=c&(1<<m)-1,c>>>=m,u-=m),u<15&&(c+=A[n++]<<u,u+=8,c+=A[n++]<<u,u+=8),g=p[c&b];n:for(;;){if(m=g>>>24,c>>>=m,u-=m,m=g>>>16&255,!(16&m)){if(0==(64&m)){g=p[(65535&g)+(c&(1<<m)-1)];continue n}t.msg="invalid distance code",U.mode=30;break t}if(k=65535&g,m&=15,u<m&&(c+=A[n++]<<u,u+=8,u<m&&(c+=A[n++]<<u,u+=8)),k+=c&(1<<m)-1,k>o){t.msg="invalid distance too far back",U.mode=30;break t}if(c>>>=m,u-=m,m=r-a,k>m){if(m=k-m,m>h&&U.sane){t.msg="invalid distance too far back",U.mode=30;break t}if(v=0,E=f,0===d){if(v+=l-m,m<y){y-=m;do{x[r++]=f[v++]}while(--m);v=r-k,E=x}}else if(d<m){if(v+=l+d-m,m-=d,m<y){y-=m;do{x[r++]=f[v++]}while(--m);if(v=0,d<y){m=d,y-=m;do{x[r++]=f[v++]}while(--m);v=r-k,E=x}}}else if(v+=d-m,m<y){y-=m;do{x[r++]=f[v++]}while(--m);v=r-k,E=x}for(;y>2;)x[r++]=E[v++],x[r++]=E[v++],x[r++]=E[v++],y-=3;y&&(x[r++]=E[v++],y>1&&(x[r++]=E[v++]))}else{v=r-k;do{x[r++]=x[v++],x[r++]=x[v++],x[r++]=x[v++],y-=3}while(y>2);y&&(x[r++]=x[v++],y>1&&(x[r++]=x[v++]))}break}}break}}while(n<i&&r<s);y=u>>3,n-=y,u-=y<<3,c&=(1<<u)-1,t.next_in=n,t.next_out=r,t.avail_in=n<i?i-n+5:5-(n-i),t.avail_out=r<s?s-r+257:257-(r-s),U.hold=c,U.bits=u};const Ie=15,Be=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ze=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Fe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Me=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Pe=(t,e,n,i,r,a,s,o)=>{const l=o.bits;let h,d,f,c,u,_,p=0,w=0,b=0,g=0,m=0,y=0,k=0,v=0,E=0,A=0,x=null,U=0;const z=new Uint16Array(16),R=new Uint16Array(16);let L,T,N,O=null,S=0;for(p=0;p<=Ie;p++)z[p]=0;for(w=0;w<i;w++)z[e[n+w]]++;for(m=l,g=Ie;g>=1&&0===z[g];g--);if(m>g&&(m=g),0===g)return r[a++]=20971520,r[a++]=20971520,o.bits=1,0;for(b=1;b<g&&0===z[b];b++);for(m<b&&(m=b),v=1,p=1;p<=Ie;p++)if(v<<=1,v-=z[p],v<0)return-1;if(v>0&&(0===t||1!==g))return-1;for(R[1]=0,p=1;p<Ie;p++)R[p+1]=R[p]+z[p];for(w=0;w<i;w++)0!==e[n+w]&&(s[R[e[n+w]]++]=w);if(0===t?(x=O=s,_=19):1===t?(x=Be,U-=257,O=Ze,S-=257,_=256):(x=Fe,O=Me,_=-1),A=0,w=0,p=b,u=a,y=m,k=0,f=-1,E=1<<m,c=E-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){L=p-k,s[w]<_?(T=0,N=s[w]):s[w]>_?(T=O[S+s[w]],N=x[U+s[w]]):(T=96,N=0),h=1<<p-k,d=1<<y,b=d;do{d-=h,r[u+(A>>k)+d]=L<<24|T<<16|N|0}while(0!==d);for(h=1<<p-1;A&h;)h>>=1;if(0!==h?(A&=h-1,A+=h):A=0,w++,0==--z[p]){if(p===g)break;p=e[n+s[w]]}if(p>m&&(A&c)!==f){for(0===k&&(k=m),u+=b,y=p-k,v=1<<y;y+k<g&&(v-=z[y+k],!(v<=0));)y++,v<<=1;if(E+=1<<y,1===t&&E>852||2===t&&E>592)return 1;f=A&c,r[f]=m<<24|y<<16|u-a|0}}return 0!==A&&(r[u+A]=p-k<<24|64<<16|0),o.bits=m,0};const{Z_FINISH:He,Z_BLOCK:je,Z_TREES:We,Z_OK:Ke,Z_STREAM_END:$e,Z_NEED_DICT:Ye,Z_STREAM_ERROR:Ge,Z_DATA_ERROR:Xe,Z_MEM_ERROR:Ve,Z_BUF_ERROR:qe,Z_DEFLATED:Je}=yt,Qe=12,tn=30,en=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function nn(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const rn=t=>{if(!t||!t.state)return Ge;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Ke},an=t=>{if(!t||!t.state)return Ge;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,rn(t)},sn=(t,e)=>{let n;if(!t||!t.state)return Ge;const i=t.state;return e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Ge:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,an(t))},on=(t,e)=>{if(!t)return Ge;const n=new nn;t.state=n,n.window=null;const i=sn(t,e);return i!==Ke&&(t.state=null),i};let ln,hn,dn=!0;const fn=t=>{if(dn){ln=new Int32Array(512),hn=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Pe(1,t.lens,0,288,ln,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Pe(2,t.lens,0,32,hn,0,t.work,{bits:5}),dn=!1}t.lencode=ln,t.lenbits=9,t.distcode=hn,t.distbits=5},cn=(t,e,n,i)=>{let r;const a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(e.subarray(n-i,n-i+r),a.wnext),(i-=r)?(a.window.set(e.subarray(n-i,n),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0};var un={inflateReset:an,inflateReset2:sn,inflateResetKeep:rn,inflateInit:t=>on(t,15),inflateInit2:on,inflate:(t,e)=>{let n,i,r,a,s,o,l,h,d,f,c,u,_,p,w,b,g,m,y,k,v,E,A=0;const x=new Uint8Array(4);let U,z;const R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return Ge;n=t.state,n.mode===Qe&&(n.mode=13),s=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,h=n.hold,d=n.bits,f=o,c=l,E=Ke;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(2&n.wrap&&35615===h){n.check=0,x[0]=255&h,x[1]=h>>>8&255,n.check=gt(n.check,x,2,0),h=0,d=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=tn;break}if((15&h)!==Je){t.msg="unknown compression method",n.mode=tn;break}if(h>>>=4,d-=4,v=8+(15&h),0===n.wbits)n.wbits=v;else if(v>n.wbits){t.msg="invalid window size",n.mode=tn;break}n.dmax=1<<n.wbits,t.adler=n.check=1,n.mode=512&h?10:Qe,h=0,d=0;break;case 2:for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(n.flags=h,(255&n.flags)!==Je){t.msg="unknown compression method",n.mode=tn;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=tn;break}n.head&&(n.head.text=h>>8&1),512&n.flags&&(x[0]=255&h,x[1]=h>>>8&255,n.check=gt(n.check,x,2,0)),h=0,d=0,n.mode=3;case 3:for(;d<32;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.head&&(n.head.time=h),512&n.flags&&(x[0]=255&h,x[1]=h>>>8&255,x[2]=h>>>16&255,x[3]=h>>>24&255,n.check=gt(n.check,x,4,0)),h=0,d=0,n.mode=4;case 4:for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.head&&(n.head.xflags=255&h,n.head.os=h>>8),512&n.flags&&(x[0]=255&h,x[1]=h>>>8&255,n.check=gt(n.check,x,2,0)),h=0,d=0,n.mode=5;case 5:if(1024&n.flags){for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.length=h,n.head&&(n.head.extra_len=h),512&n.flags&&(x[0]=255&h,x[1]=h>>>8&255,n.check=gt(n.check,x,2,0)),h=0,d=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(u=n.length,u>o&&(u=o),u&&(n.head&&(v=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(a,a+u),v)),512&n.flags&&(n.check=gt(n.check,i,u,a)),o-=u,a+=u,n.length-=u),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===o)break t;u=0;do{v=i[a+u++],n.head&&v&&n.length<65536&&(n.head.name+=String.fromCharCode(v))}while(v&&u<o);if(512&n.flags&&(n.check=gt(n.check,i,u,a)),o-=u,a+=u,v)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===o)break t;u=0;do{v=i[a+u++],n.head&&v&&n.length<65536&&(n.head.comment+=String.fromCharCode(v))}while(v&&u<o);if(512&n.flags&&(n.check=gt(n.check,i,u,a)),o-=u,a+=u,v)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(h!==(65535&n.check)){t.msg="header crc mismatch",n.mode=tn;break}h=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Qe;break;case 10:for(;d<32;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}t.adler=n.check=en(h),h=0,d=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=d,Ye;t.adler=n.check=1,n.mode=Qe;case Qe:if(e===je||e===We)break t;case 13:if(n.last){h>>>=7&d,d-=7&d,n.mode=27;break}for(;d<3;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}switch(n.last=1&h,h>>>=1,d-=1,3&h){case 0:n.mode=14;break;case 1:if(fn(n),n.mode=20,e===We){h>>>=2,d-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=tn}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=tn;break}if(n.length=65535&h,h=0,d=0,n.mode=15,e===We)break t;case 15:n.mode=16;case 16:if(u=n.length,u){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;r.set(i.subarray(a,a+u),s),o-=u,a+=u,l-=u,s+=u,n.length-=u;break}n.mode=Qe;break;case 17:for(;d<14;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(n.nlen=257+(31&h),h>>>=5,d-=5,n.ndist=1+(31&h),h>>>=5,d-=5,n.ncode=4+(15&h),h>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=tn;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.lens[R[n.have++]]=7&h,h>>>=3,d-=3}for(;n.have<19;)n.lens[R[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,U={bits:n.lenbits},E=Pe(0,n.lens,0,19,n.lencode,0,n.work,U),n.lenbits=U.bits,E){t.msg="invalid code lengths set",n.mode=tn;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;A=n.lencode[h&(1<<n.lenbits)-1],w=A>>>24,b=A>>>16&255,g=65535&A,!(w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(g<16)h>>>=w,d-=w,n.lens[n.have++]=g;else{if(16===g){for(z=w+2;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(h>>>=w,d-=w,0===n.have){t.msg="invalid bit length repeat",n.mode=tn;break}v=n.lens[n.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===g){for(z=w+3;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}h>>>=w,d-=w,v=0,u=3+(7&h),h>>>=3,d-=3}else{for(z=w+7;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}h>>>=w,d-=w,v=0,u=11+(127&h),h>>>=7,d-=7}if(n.have+u>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=tn;break}for(;u--;)n.lens[n.have++]=v}}if(n.mode===tn)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=tn;break}if(n.lenbits=9,U={bits:n.lenbits},E=Pe(1,n.lens,0,n.nlen,n.lencode,0,n.work,U),n.lenbits=U.bits,E){t.msg="invalid literal/lengths set",n.mode=tn;break}if(n.distbits=6,n.distcode=n.distdyn,U={bits:n.distbits},E=Pe(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,U),n.distbits=U.bits,E){t.msg="invalid distances set",n.mode=tn;break}if(n.mode=20,e===We)break t;case 20:n.mode=21;case 21:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=d,De(t,c),s=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,h=n.hold,d=n.bits,n.mode===Qe&&(n.back=-1);break}for(n.back=0;A=n.lencode[h&(1<<n.lenbits)-1],w=A>>>24,b=A>>>16&255,g=65535&A,!(w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(b&&0==(240&b)){for(m=w,y=b,k=g;A=n.lencode[k+((h&(1<<m+y)-1)>>m)],w=A>>>24,b=A>>>16&255,g=65535&A,!(m+w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}h>>>=m,d-=m,n.back+=m}if(h>>>=w,d-=w,n.back+=w,n.length=g,0===b){n.mode=26;break}if(32&b){n.back=-1,n.mode=Qe;break}if(64&b){t.msg="invalid literal/length code",n.mode=tn;break}n.extra=15&b,n.mode=22;case 22:if(n.extra){for(z=n.extra;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=n.distcode[h&(1<<n.distbits)-1],w=A>>>24,b=A>>>16&255,g=65535&A,!(w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(0==(240&b)){for(m=w,y=b,k=g;A=n.distcode[k+((h&(1<<m+y)-1)>>m)],w=A>>>24,b=A>>>16&255,g=65535&A,!(m+w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}h>>>=m,d-=m,n.back+=m}if(h>>>=w,d-=w,n.back+=w,64&b){t.msg="invalid distance code",n.mode=tn;break}n.offset=g,n.extra=15&b,n.mode=24;case 24:if(n.extra){for(z=n.extra;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=tn;break}n.mode=25;case 25:if(0===l)break t;if(u=c-l,n.offset>u){if(u=n.offset-u,u>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=tn;break}u>n.wnext?(u-=n.wnext,_=n.wsize-u):_=n.wnext-u,u>n.length&&(u=n.length),p=n.window}else p=r,_=s-n.offset,u=n.length;u>l&&(u=l),l-=u,n.length-=u;do{r[s++]=p[_++]}while(--u);0===n.length&&(n.mode=21);break;case 26:if(0===l)break t;r[s++]=n.length,l--,n.mode=21;break;case 27:if(n.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[a++]<<d,d+=8}if(c-=l,t.total_out+=c,n.total+=c,c&&(t.adler=n.check=n.flags?gt(n.check,r,c,s-c):wt(n.check,r,c,s-c)),c=l,(n.flags?h:en(h))!==n.check){t.msg="incorrect data check",n.mode=tn;break}h=0,d=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;d<32;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(h!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=tn;break}h=0,d=0}n.mode=29;case 29:E=$e;break t;case tn:E=Xe;break t;case 31:return Ve;default:return Ge}return t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=d,(n.wsize||c!==t.avail_out&&n.mode<tn&&(n.mode<27||e!==He))&&cn(t,t.output,t.next_out,c-t.avail_out),f-=t.avail_in,c-=t.avail_out,t.total_in+=f,t.total_out+=c,n.total+=c,n.wrap&&c&&(t.adler=n.check=n.flags?gt(n.check,r,c,t.next_out-c):wt(n.check,r,c,t.next_out-c)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Qe?128:0)+(20===n.mode||15===n.mode?256:0),(0===f&&0===c||e===He)&&E===Ke&&(E=qe),E},inflateEnd:t=>{if(!t||!t.state)return Ge;let e=t.state;return e.window&&(e.window=null),t.state=null,Ke},inflateGetHeader:(t,e)=>{if(!t||!t.state)return Ge;const n=t.state;return 0==(2&n.wrap)?Ge:(n.head=e,e.done=!1,Ke)},inflateSetDictionary:(t,e)=>{const n=e.length;let i,r,a;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?Ge:11===i.mode&&(r=1,r=wt(r,e,n,0),r!==i.check)?Xe:(a=cn(t,e,n,n),a?(i.mode=31,Ve):(i.havedict=1,Ke))):Ge},inflateInfo:"pako inflate (from Nodeca project)"};var _n=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const pn=Object.prototype.toString,{Z_NO_FLUSH:wn,Z_FINISH:bn,Z_OK:gn,Z_STREAM_END:mn,Z_NEED_DICT:yn,Z_STREAM_ERROR:kn,Z_DATA_ERROR:vn,Z_MEM_ERROR:En}=yt;function An(t){this.options=we({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ee,this.strm.avail_out=0;let n=un.inflateInit2(this.strm,e.windowBits);if(n!==gn)throw new Error(mt[n]);if(this.header=new _n,un.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=ye(e.dictionary):"[object ArrayBuffer]"===pn.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=un.inflateSetDictionary(this.strm,e.dictionary),n!==gn)))throw new Error(mt[n])}function xn(t,e){const n=new An(e);if(n.push(t),n.err)throw n.msg||mt[n.err];return n.result}An.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,s,o;if(this.ended)return!1;for(s=e===~~e?e:!0===e?bn:wn,"[object ArrayBuffer]"===pn.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),a=un.inflate(n,s),a===yn&&r&&(a=un.inflateSetDictionary(n,r),a===gn?a=un.inflate(n,s):a===vn&&(a=yn));n.avail_in>0&&a===mn&&n.state.wrap>0&&0!==t[n.next_in];)un.inflateReset(n),a=un.inflate(n,s);switch(a){case kn:case vn:case yn:case En:return this.onEnd(a),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(0===n.avail_out||a===mn))if("string"===this.options.to){let t=ve(n.output,n.next_out),e=n.next_out-t,r=ke(n.output,t);n.next_out=e,n.avail_out=i-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(a!==gn||0!==o){if(a===mn)return a=un.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},An.prototype.onData=function(t){this.chunks.push(t)},An.prototype.onEnd=function(t){t===gn&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=be(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Un={Inflate:An,inflate:xn,inflateRaw:function(t,e){return(e=e||{}).raw=!0,xn(t,e)},ungzip:xn,constants:yt};const{Inflate:zn,inflate:Rn,inflateRaw:Ln,ungzip:Tn}=Un;var Nn=zn,On=Rn;const Sn=[137,80,78,71,13,10,26,10],Cn=[];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;Cn[t]=e}const Dn=4294967295;function In(t,e){return(function(t,e,n){let i=t;for(let t=0;t<n;t++)i=Cn[255&(i^e[t])]^i>>>8;return i}(Dn,t,e)^Dn)>>>0}var Bn,Zn,Fn,Mn;!function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.GREYSCALE=0]="GREYSCALE",t[t.TRUECOLOUR=2]="TRUECOLOUR",t[t.INDEXED_COLOUR=3]="INDEXED_COLOUR",t[t.GREYSCALE_ALPHA=4]="GREYSCALE_ALPHA",t[t.TRUECOLOUR_ALPHA=6]="TRUECOLOUR_ALPHA"}(Bn||(Bn={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.DEFLATE=0]="DEFLATE"}(Zn||(Zn={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.ADAPTIVE=0]="ADAPTIVE"}(Fn||(Fn={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.NO_INTERLACE=0]="NO_INTERLACE",t[t.ADAM7=1]="ADAM7"}(Mn||(Mn={}));const Pn=new Uint8Array(0),Hn=new Uint16Array([255]),jn=255===new Uint8Array(Hn.buffer)[0];class Wn extends N{constructor(t,e={}){super(t);const{checkCrc:n=!1}=e;this._checkCrc=n,this._inflator=new Nn,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._end=!1,this._hasPalette=!1,this._palette=[],this._compressionMethod=Zn.UNKNOWN,this._filterMethod=Fn.UNKNOWN,this._interlaceMethod=Mn.UNKNOWN,this._colorType=-1,this.setBigEndian()}decode(){for(this.decodeSignature();!this._end;)this.decodeChunk();return this.decodeImage(),this._png}decodeSignature(){for(let t=0;t<Sn.length;t++)if(this.readUint8()!==Sn[t])throw new Error(`wrong PNG signature. Byte at ${t} should be ${Sn[t]}.`)}decodeChunk(){const t=this.readUint32(),e=this.readChars(4),n=this.offset;switch(e){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case"tEXt":this.decodetEXt(t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t)}if(this.offset-n!==t)throw new Error(`Length mismatch while decoding chunk ${e}`);if(this._checkCrc){const n=this.readUint32(),i=t+4,r=In(new Uint8Array(this.buffer,this.byteOffset+this.offset-i-4,i),i);if(r!==n)throw new Error(`CRC mismatch for chunk ${e}. Expected ${n}, found ${r}`)}else this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=function(t){if(1!==t&&2!==t&&4!==t&&8!==t&&16!==t)throw new Error(`invalid bit depth: ${t}`);return t}(this.readUint8());const e=this.readUint8();let n;switch(this._colorType=e,e){case Bn.GREYSCALE:n=1;break;case Bn.TRUECOLOUR:n=3;break;case Bn.INDEXED_COLOUR:n=1;break;case Bn.GREYSCALE_ALPHA:n=2;break;case Bn.TRUECOLOUR_ALPHA:n=4;break;default:throw new Error(`Unknown color type: ${e}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==Zn.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodePLTE(t){if(t%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const e=t/3;this._hasPalette=!0;const n=[];this._palette=n;for(let t=0;t<e;t++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._inflator.push(new Uint8Array(this.buffer,this.offset+this.byteOffset,t)),this.skip(t)}decodetRNS(t){if(3===this._colorType){if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let e=0;for(;e<t;e++){const t=this.readByte();this._palette[e].push(t)}for(;e<this._palette.length;e++)this._palette[e].push(255)}}decodeiCCP(t){let e,n="";for(;"\0"!==(e=this.readChar());)n+=e;const i=this.readUint8();if(i!==Zn.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${i}`);const r=this.readBytes(t-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:On(r)}}decodetEXt(t){let e,n="";for(;"\0"!==(e=this.readChar());)n+=e;this._png.text[n]=this.readChars(t-n.length-1)}decodepHYs(){const t=this.readUint32(),e=this.readUint32(),n=this.readByte();this._png.resolution={x:t,y:e,unit:n}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._inflator.result;if(this._filterMethod!==Fn.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod!==Mn.NO_INTERLACE)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this.decodeInterlaceNull(t)}decodeInterlaceNull(t){const e=this._png.height,n=this._png.channels*this._png.depth/8,i=this._png.width*n,r=new Uint8Array(this._png.height*i);let a,s,o=Pn,l=0;for(let h=0;h<e;h++){switch(a=t.subarray(l+1,l+1+i),s=r.subarray(h*i,(h+1)*i),t[l]){case 0:Kn(a,s,i);break;case 1:$n(a,s,i,n);break;case 2:Yn(a,s,o,i);break;case 3:Gn(a,s,o,i,n);break;case 4:Xn(a,s,o,i,n);break;default:throw new Error(`Unsupported filter: ${t[l]}`)}o=s,l+=i+1}if(this._hasPalette&&(this._png.palette=this._palette),16===this._png.depth){const t=new Uint16Array(r.buffer);if(jn)for(let e=0;e<t.length;e++)t[e]=(255&(h=t[e]))<<8|h>>8&255;this._png.data=t}else this._png.data=r;var h}}function Kn(t,e,n){for(let i=0;i<n;i++)e[i]=t[i]}function $n(t,e,n,i){let r=0;for(;r<i;r++)e[r]=t[r];for(;r<n;r++)e[r]=t[r]+e[r-i]&255}function Yn(t,e,n,i){let r=0;if(0===n.length)for(;r<i;r++)e[r]=t[r];else for(;r<i;r++)e[r]=t[r]+n[r]&255}function Gn(t,e,n,i,r){let a=0;if(0===n.length){for(;a<r;a++)e[a]=t[a];for(;a<i;a++)e[a]=t[a]+(e[a-r]>>1)&255}else{for(;a<r;a++)e[a]=t[a]+(n[a]>>1)&255;for(;a<i;a++)e[a]=t[a]+(e[a-r]+n[a]>>1)&255}}function Xn(t,e,n,i,r){let a=0;if(0===n.length){for(;a<r;a++)e[a]=t[a];for(;a<i;a++)e[a]=t[a]+e[a-r]&255}else{for(;a<r;a++)e[a]=t[a]+n[a]&255;for(;a<i;a++)e[a]=t[a]+Vn(e[a-r],n[a],n[a-r])&255}}function Vn(t,e,n){const i=t+e-n,r=Math.abs(i-t),a=Math.abs(i-e),s=Math.abs(i-n);return r<=a&&r<=s?t:a<=s?e:n}var qn;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"}(qn||(qn={}));!function(n,i){var r=(void 0===i?{}:i).expose,a=void 0===r?E:r;function s(n){var i=this;return function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];return t(i,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.apply(void 0,r)];case 1:return[2,z(t.sent())]}}))}))}}if("function"==typeof n)return a(s(n));var o=Object.entries(n).reduce((function(t,e){var n=e[0],i=e[1];return t[n]=s(i),t}),{});a(o)}((async t=>{return new Wn(t,e).decode();var e}))}();\n';function makeController(){return new K}function makeWorker(){return $.fromText(q,{name:Q})}async function spawnWorker(t){const e=await spawn(makeWorker());return null!=t&&t.addThread(e),(...t)=>e.apply(null,[...t.map((t=>makeTransferable(t)))])}function spawnPool(t){return I((()=>spawnWorker(t.terminate)),t)}export{makeController,makeWorker,spawnPool,spawnWorker};
|
|
5
|
-
//# sourceMappingURL=png-decoder-h492rmTZ.js.map
|