diff --git a/assets/index-33801a99.js b/assets/index-f8cd6b74.js similarity index 99% rename from assets/index-33801a99.js rename to assets/index-f8cd6b74.js index 2e847524..c2a5196e 100644 --- a/assets/index-33801a99.js +++ b/assets/index-f8cd6b74.js @@ -603,13 +603,13 @@ Use Save As... to download, then click back to return to this page.`)&&(location `+Sn.split(` `).map(function(On){return" "+On}).join(` `)):Sn=Cn.stylize("[Circular]","special")),un(ar)){if(nr&&Zn.match(/^\d+$/))return Sn;(ar=JSON.stringify(""+Zn)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ar=ar.substr(1,ar.length-2),ar=Cn.stylize(ar,"name")):(ar=ar.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ar=Cn.stylize(ar,"string"))}return ar+": "+Sn}function sn(Cn){return Array.isArray(Cn)}function ln(Cn){return typeof Cn=="boolean"}function dn(Cn){return Cn===null}function mn(Cn){return typeof Cn=="number"}function gn(Cn){return typeof Cn=="string"}function un(Cn){return Cn===void 0}function hn(Cn){return bn(Cn)&&$n(Cn)==="[object RegExp]"}function bn(Cn){return typeof Cn=="object"&&Cn!==null}function En(Cn){return bn(Cn)&&$n(Cn)==="[object Date]"}function _n(Cn){return bn(Cn)&&($n(Cn)==="[object Error]"||Cn instanceof Error)}function Tn(Cn){return typeof Cn=="function"}function $n(Cn){return Object.prototype.toString.call(Cn)}function pn(Cn){return Cn<10?"0"+Cn.toString(10):Cn.toString(10)}Ut.debuglog=function(Cn){if(Cn=Cn.toUpperCase(),!Yt[Cn])if(Xt.test(Cn)){var Gn=Gt.pid;Yt[Cn]=function(){var In=Ut.format.apply(Ut,arguments);console.error("%s %d: %s",Cn,Gn,In)}}else Yt[Cn]=function(){};return Yt[Cn]},Ut.inspect=Qt,Qt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Qt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Ut.types=Nt("./support/types"),Ut.isArray=sn,Ut.isBoolean=ln,Ut.isNull=dn,Ut.isNullOrUndefined=function(Cn){return Cn==null},Ut.isNumber=mn,Ut.isString=gn,Ut.isSymbol=function(Cn){return typeof Cn=="symbol"},Ut.isUndefined=un,Ut.isRegExp=hn,Ut.types.isRegExp=hn,Ut.isObject=bn,Ut.isDate=En,Ut.types.isDate=En,Ut.isError=_n,Ut.types.isNativeError=_n,Ut.isFunction=Tn,Ut.isPrimitive=function(Cn){return Cn===null||typeof Cn=="boolean"||typeof Cn=="number"||typeof Cn=="string"||typeof Cn=="symbol"||Cn===void 0},Ut.isBuffer=Nt("./support/isBuffer");var Nn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function An(Cn,Gn){return Object.prototype.hasOwnProperty.call(Cn,Gn)}Ut.log=function(){var Cn,Gn;console.log("%s - %s",(Cn=new Date,Gn=[pn(Cn.getHours()),pn(Cn.getMinutes()),pn(Cn.getSeconds())].join(":"),[Cn.getDate(),Nn[Cn.getMonth()],Gn].join(" ")),Ut.format.apply(Ut,arguments))},Ut.inherits=Nt("inherits"),Ut._extend=function(Cn,Gn){if(!Gn||!bn(Gn))return Cn;for(var In=Object.keys(Gn),Bn=In.length;Bn--;)Cn[In[Bn]]=Gn[In[Bn]];return Cn};var Dn=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function Pn(Cn,Gn){if(!Cn){var In=new Error("Promise was rejected with a falsy value");In.reason=Cn,Cn=In}return Gn(Cn)}Ut.promisify=function(Cn){if(typeof Cn!="function")throw new TypeError('The "original" argument must be of type Function');if(Dn&&Cn[Dn]){var Gn;if(typeof(Gn=Cn[Dn])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Gn,Dn,{value:Gn,enumerable:!1,writable:!1,configurable:!0}),Gn}function Gn(){for(var In,Bn,Zn=new Promise(function(Sn,Rn){In=Sn,Bn=Rn}),nr=[],ar=0;ar{var Pt=_e.exports={};Pt.nextTick=function(){var Dt=typeof window<"u"&&window.setImmediate,Nt=typeof window<"u"&&window.postMessage&&window.addEventListener;if(Dt)return function(Ut){return window.setImmediate(Ut)};if(Nt){var jt=[];return window.addEventListener("message",function(Ut){var Gt=Ut.source;Gt!==window&&Gt!==null||Ut.data!=="process-tick"||(Ut.stopPropagation(),jt.length>0&&jt.shift()())},!0),function(Ut){jt.push(Ut),window.postMessage("process-tick","*")}}return function(Ut){setTimeout(Ut,0)}}(),Pt.title="browser",Pt.browser=!0,Pt.env={},Pt.argv=[],Pt.binding=function(Dt){throw new Error("process.binding is not supported")},Pt.cwd=function(){return"/"},Pt.chdir=function(Dt){throw new Error("process.chdir is not supported")}},6197:(_e,Pt,Dt)=>{var Nt=Dt(8834).lW;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.AbstractTokenizer=void 0;const jt=Dt(4644);Pt.AbstractTokenizer=class{constructor(Ut){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=Ut||{}}async readToken(Ut,Gt=this.position){const Wt=Nt.alloc(Ut.len);if(await this.readBuffer(Wt,{position:Gt})Gt)return this.position+=Gt,Gt}return this.position+=Ut,Ut}async close(){}normalizeOptions(Ut,Gt){if(Gt&&Gt.position!==void 0&&Gt.position{Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.BufferTokenizer=void 0;const Nt=Dt(4644),jt=Dt(6197);class Ut extends jt.AbstractTokenizer{constructor(Wt,qt){super(qt),this.uint8Array=Wt,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:Wt.length}async readBuffer(Wt,qt){if(qt&&qt.position){if(qt.position{Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.fromFile=Pt.FileTokenizer=void 0;const Nt=Dt(6197),jt=Dt(4644),Ut=Dt(5187);class Gt extends Nt.AbstractTokenizer{constructor(qt,Yt){super(Yt),this.fd=qt}async readBuffer(qt,Yt){const Xt=this.normalizeOptions(qt,Yt);this.position=Xt.position;const Zt=await Ut.read(this.fd,qt,Xt.offset,Xt.length,Xt.position);if(this.position+=Zt.bytesRead,Zt.bytesRead{Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.readFile=Pt.writeFileSync=Pt.writeFile=Pt.read=Pt.open=Pt.close=Pt.stat=Pt.createReadStream=Pt.pathExists=void 0;const Nt=Dt(6777);Pt.pathExists=Nt.existsSync,Pt.createReadStream=Nt.createReadStream,Pt.stat=async function(jt){return new Promise((Ut,Gt)=>{Nt.stat(jt,(Wt,qt)=>{Wt?Gt(Wt):Ut(qt)})})},Pt.close=async function(jt){return new Promise((Ut,Gt)=>{Nt.close(jt,Wt=>{Wt?Gt(Wt):Ut()})})},Pt.open=async function(jt,Ut){return new Promise((Gt,Wt)=>{Nt.open(jt,Ut,(qt,Yt)=>{qt?Wt(qt):Gt(Yt)})})},Pt.read=async function(jt,Ut,Gt,Wt,qt){return new Promise((Yt,Xt)=>{Nt.read(jt,Ut,Gt,Wt,qt,(Zt,Qt,en)=>{Zt?Xt(Zt):Yt({bytesRead:Qt,buffer:en})})})},Pt.writeFile=async function(jt,Ut){return new Promise((Gt,Wt)=>{Nt.writeFile(jt,Ut,qt=>{qt?Wt(qt):Gt()})})},Pt.writeFileSync=function(jt,Ut){Nt.writeFileSync(jt,Ut)},Pt.readFile=async function(jt){return new Promise((Ut,Gt)=>{Nt.readFile(jt,(Wt,qt)=>{Wt?Gt(Wt):Ut(qt)})})}},8286:(_e,Pt,Dt)=>{Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.ReadStreamTokenizer=void 0;const Nt=Dt(6197),jt=Dt(4644);class Ut extends Nt.AbstractTokenizer{constructor(Wt,qt){super(qt),this.streamReader=new jt.StreamReader(Wt)}async getFileInfo(){return this.fileInfo}async readBuffer(Wt,qt){const Yt=this.normalizeOptions(Wt,qt),Xt=Yt.position-this.position;if(Xt>0)return await this.ignore(Xt),this.readBuffer(Wt,qt);if(Xt<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(Yt.length===0)return 0;const Zt=await this.streamReader.read(Wt,Yt.offset,Yt.length);if(this.position+=Zt,(!qt||!qt.mayBeLess)&&Zt0){const Qt=new Uint8Array(Yt.length+Zt);return Xt=await this.peekBuffer(Qt,{mayBeLess:Yt.mayBeLess}),Wt.set(Qt.subarray(Zt),Yt.offset),Xt-Zt}if(Zt<0)throw new Error("Cannot peek from a negative offset in a stream")}if(Yt.length>0){try{Xt=await this.streamReader.peek(Wt,Yt.offset,Yt.length)}catch(Zt){if(qt&&qt.mayBeLess&&Zt instanceof jt.EndOfStreamError)return 0;throw Zt}if(!Yt.mayBeLess&&Xt{Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.fromBuffer=Pt.fromStream=Pt.EndOfStreamError=void 0;const Nt=Dt(8286),jt=Dt(932);var Ut=Dt(4644);Object.defineProperty(Pt,"EndOfStreamError",{enumerable:!0,get:function(){return Ut.EndOfStreamError}}),Pt.fromStream=function(Gt,Wt){return Wt=Wt||{},new Nt.ReadStreamTokenizer(Gt,Wt)},Pt.fromBuffer=function(Gt,Wt){return new jt.BufferTokenizer(Gt,Wt)}},3569:(_e,Pt,Dt)=>{Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.fromStream=Pt.fromBuffer=Pt.EndOfStreamError=Pt.fromFile=void 0;const Nt=Dt(5187),jt=Dt(7378);var Ut=Dt(9425);Object.defineProperty(Pt,"fromFile",{enumerable:!0,get:function(){return Ut.fromFile}});var Gt=Dt(7378);Object.defineProperty(Pt,"EndOfStreamError",{enumerable:!0,get:function(){return Gt.EndOfStreamError}}),Object.defineProperty(Pt,"fromBuffer",{enumerable:!0,get:function(){return Gt.fromBuffer}}),Pt.fromStream=async function(Wt,qt){if(qt=qt||{},Wt.path){const Yt=await Nt.stat(Wt.path);qt.path=Wt.path,qt.size=Yt.size}return jt.fromStream(Wt,qt)}},643:(_e,Pt)=>{var Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Yt){return typeof Yt}:function(Yt){return Yt&&typeof Symbol=="function"&&Yt.constructor===Symbol&&Yt!==Symbol.prototype?"symbol":typeof Yt};Pt.Ee=function(Yt,Xt,Zt,Qt,en,tn){for(var nn=arguments.length,rn=Array(nn>6?nn-6:0),an=6;an3?tn-3:0),rn=3;rn{var Nt=Dt(8834).lW;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.AnsiStringType=Pt.StringType=Pt.BufferType=Pt.Uint8ArrayType=Pt.IgnoreType=Pt.Float80_LE=Pt.Float80_BE=Pt.Float64_LE=Pt.Float64_BE=Pt.Float32_LE=Pt.Float32_BE=Pt.Float16_LE=Pt.Float16_BE=Pt.INT64_BE=Pt.UINT64_BE=Pt.INT64_LE=Pt.UINT64_LE=Pt.INT32_LE=Pt.INT32_BE=Pt.INT24_BE=Pt.INT24_LE=Pt.INT16_LE=Pt.INT16_BE=Pt.INT8=Pt.UINT32_BE=Pt.UINT32_LE=Pt.UINT24_BE=Pt.UINT24_LE=Pt.UINT16_BE=Pt.UINT16_LE=Pt.UINT8=void 0;const jt=Dt(2333);function Ut(Wt){return new DataView(Wt.buffer,Wt.byteOffset)}Pt.UINT8={len:1,get:(Wt,qt)=>Ut(Wt).getUint8(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setUint8(qt,Yt),qt+1)},Pt.UINT16_LE={len:2,get:(Wt,qt)=>Ut(Wt).getUint16(qt,!0),put:(Wt,qt,Yt)=>(Ut(Wt).setUint16(qt,Yt,!0),qt+2)},Pt.UINT16_BE={len:2,get:(Wt,qt)=>Ut(Wt).getUint16(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setUint16(qt,Yt),qt+2)},Pt.UINT24_LE={len:3,get(Wt,qt){const Yt=Ut(Wt);return Yt.getUint8(qt)+(Yt.getUint16(qt+1,!0)<<8)},put(Wt,qt,Yt){const Xt=Ut(Wt);return Xt.setUint8(qt,255&Yt),Xt.setUint16(qt+1,Yt>>8,!0),qt+3}},Pt.UINT24_BE={len:3,get(Wt,qt){const Yt=Ut(Wt);return(Yt.getUint16(qt)<<8)+Yt.getUint8(qt+2)},put(Wt,qt,Yt){const Xt=Ut(Wt);return Xt.setUint16(qt,Yt>>8),Xt.setUint8(qt+2,255&Yt),qt+3}},Pt.UINT32_LE={len:4,get:(Wt,qt)=>Ut(Wt).getUint32(qt,!0),put:(Wt,qt,Yt)=>(Ut(Wt).setUint32(qt,Yt,!0),qt+4)},Pt.UINT32_BE={len:4,get:(Wt,qt)=>Ut(Wt).getUint32(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setUint32(qt,Yt),qt+4)},Pt.INT8={len:1,get:(Wt,qt)=>Ut(Wt).getInt8(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setInt8(qt,Yt),qt+1)},Pt.INT16_BE={len:2,get:(Wt,qt)=>Ut(Wt).getInt16(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setInt16(qt,Yt),qt+2)},Pt.INT16_LE={len:2,get:(Wt,qt)=>Ut(Wt).getInt16(qt,!0),put:(Wt,qt,Yt)=>(Ut(Wt).setInt16(qt,Yt,!0),qt+2)},Pt.INT24_LE={len:3,get(Wt,qt){const Yt=Pt.UINT24_LE.get(Wt,qt);return Yt>8388607?Yt-16777216:Yt},put(Wt,qt,Yt){const Xt=Ut(Wt);return Xt.setUint8(qt,255&Yt),Xt.setUint16(qt+1,Yt>>8,!0),qt+3}},Pt.INT24_BE={len:3,get(Wt,qt){const Yt=Pt.UINT24_BE.get(Wt,qt);return Yt>8388607?Yt-16777216:Yt},put(Wt,qt,Yt){const Xt=Ut(Wt);return Xt.setUint16(qt,Yt>>8),Xt.setUint8(qt+2,255&Yt),qt+3}},Pt.INT32_BE={len:4,get:(Wt,qt)=>Ut(Wt).getInt32(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setInt32(qt,Yt),qt+4)},Pt.INT32_LE={len:4,get:(Wt,qt)=>Ut(Wt).getInt32(qt,!0),put:(Wt,qt,Yt)=>(Ut(Wt).setInt32(qt,Yt,!0),qt+4)},Pt.UINT64_LE={len:8,get:(Wt,qt)=>Ut(Wt).getBigUint64(qt,!0),put:(Wt,qt,Yt)=>(Ut(Wt).setBigUint64(qt,Yt,!0),qt+8)},Pt.INT64_LE={len:8,get:(Wt,qt)=>Ut(Wt).getBigInt64(qt,!0),put:(Wt,qt,Yt)=>(Ut(Wt).setBigInt64(qt,Yt,!0),qt+8)},Pt.UINT64_BE={len:8,get:(Wt,qt)=>Ut(Wt).getBigUint64(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setBigUint64(qt,Yt),qt+8)},Pt.INT64_BE={len:8,get:(Wt,qt)=>Ut(Wt).getBigInt64(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setBigInt64(qt,Yt),qt+8)},Pt.Float16_BE={len:2,get(Wt,qt){return jt.read(Wt,qt,!1,10,this.len)},put(Wt,qt,Yt){return jt.write(Wt,Yt,qt,!1,10,this.len),qt+this.len}},Pt.Float16_LE={len:2,get(Wt,qt){return jt.read(Wt,qt,!0,10,this.len)},put(Wt,qt,Yt){return jt.write(Wt,Yt,qt,!0,10,this.len),qt+this.len}},Pt.Float32_BE={len:4,get:(Wt,qt)=>Ut(Wt).getFloat32(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setFloat32(qt,Yt),qt+4)},Pt.Float32_LE={len:4,get:(Wt,qt)=>Ut(Wt).getFloat32(qt,!0),put:(Wt,qt,Yt)=>(Ut(Wt).setFloat32(qt,Yt,!0),qt+4)},Pt.Float64_BE={len:8,get:(Wt,qt)=>Ut(Wt).getFloat64(qt),put:(Wt,qt,Yt)=>(Ut(Wt).setFloat64(qt,Yt),qt+8)},Pt.Float64_LE={len:8,get:(Wt,qt)=>Ut(Wt).getFloat64(qt,!0),put:(Wt,qt,Yt)=>(Ut(Wt).setFloat64(qt,Yt,!0),qt+8)},Pt.Float80_BE={len:10,get(Wt,qt){return jt.read(Wt,qt,!1,63,this.len)},put(Wt,qt,Yt){return jt.write(Wt,Yt,qt,!1,63,this.len),qt+this.len}},Pt.Float80_LE={len:10,get(Wt,qt){return jt.read(Wt,qt,!0,63,this.len)},put(Wt,qt,Yt){return jt.write(Wt,Yt,qt,!0,63,this.len),qt+this.len}},Pt.IgnoreType=class{constructor(Wt){this.len=Wt}get(Wt,qt){}},Pt.Uint8ArrayType=class{constructor(Wt){this.len=Wt}get(Wt,qt){return Wt.subarray(qt,qt+this.len)}},Pt.BufferType=class{constructor(Wt){this.len=Wt}get(Wt,qt){return Nt.from(Wt.subarray(qt,qt+this.len))}},Pt.StringType=class{constructor(Wt,qt){this.len=Wt,this.encoding=qt}get(Wt,qt){return Nt.from(Wt).toString(this.encoding,qt,qt+this.len)}};class Gt{constructor(qt){this.len=qt}static decode(qt,Yt,Xt){let Zt="";for(let Qt=Yt;Qt>10),56320+(1023&qt)))}static singleByteDecoder(qt){if(Gt.inRange(qt,0,127))return qt;const Yt=Gt.windows1252[qt-128];if(Yt===null)throw Error("invaliding encoding");return Yt}get(qt,Yt=0){return Gt.decode(qt,Yt,Yt+this.len)}}Pt.AnsiStringType=Gt,Gt.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},311:(_e,Pt)=>{(Pt=_e.exports=function(Dt){return Dt.replace(/^\s*|\s*$/g,"")}).left=function(Dt){return Dt.replace(/^\s*/,"")},Pt.right=function(Dt){return Dt.replace(/\s*$/,"")}},9299:(_e,Pt,Dt)=>{var Nt=Dt(4406);(function(){var jt={};function Ut(){Nt===void 0&&console.log.apply(console,arguments)}_e.exports=jt,function(Gt,Wt){var qt,Yt,Xt,Zt,Qt,en,tn,nn,rn,an,sn,ln,dn,mn,gn;(function(){var un=function(){function En(_n){this.message="JPEG error: "+_n}return En.prototype=new Error,En.prototype.name="JpegError",En.constructor=En,En}(),hn=function(){var En=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),_n=4017,Tn=799,$n=3406,pn=2276,Nn=1567,An=3784,Dn=5793,Pn=2896;function Cn(Sn){Sn==null&&(Sn={}),Sn.w==null&&(Sn.w=-1),this.V=Sn.n,this.N=Sn.w}function Gn(Sn,Rn){for(var On,Vn,yn,vn=0,wn=[],Un=16;Un>0&&!Sn[Un-1];)Un--;wn.push({children:[],index:0});var Kn=wn[0];for(On=0;On0;)Kn=wn.pop();for(Kn.index++,wn.push(Kn);wn.length<=On;)wn.push(yn={children:[],index:0}),Kn.children[Kn.index]=yn.children,Kn=yn;vn++}On+10)return mr--,ir>>mr&1;if((ir=Sn[Rn++])===255){var Lr=Sn[Rn++];if(Lr){if(Lr===220&&kn){var lo=bn(Sn,Rn+=2);if(Rn+=2,lo>0&&lo!==On.s)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",lo)}else if(Lr===217){if(kn){var uo=8*Wn;if(uo>0&&uo>>7}function ur(Lr){for(var lo=Lr;;){switch(typeof(lo=lo[Xn()])){case"number":return lo;case"object":continue}throw new un("invalid huffman sequence")}}function Wr(Lr){for(var lo=0;Lr>0;)lo=lo<<1|Xn(),Lr--;return lo}function Or(Lr){if(Lr===1)return Xn()===1?1:-1;var lo=Wr(Lr);return lo>=1<0)kr--;else for(var uo=vn,ao=wn;uo<=ao;){var Ro=ur(Lr.i),Xo=15&Ro,Ao=Ro>>4;if(Xo!==0){var ho=En[uo+=Ao];Lr.D[lo+ho]=Or(Xo)*(1<>4,(uo=15&ao)==0)Ao<15?(kr=Wr(Ao)+(1<>4;if(Ao!==0){var qo=En[Ro+=ho];Lr.D[lo+qo]=Or(Ao),Ro++}else{if(ho<15)break;Ro+=16}}},hr=no===1?Vn[0].P*Vn[0].c:qn*On.R;vr<=hr;){var Hr=yn?Math.min(hr-vr,yn):hr;if(Hr>0){for(Jn=0;Jn=65488&&sr.M<=65495)))break;Rn+=2}return Rn-jn}function Zn(Sn,Rn,On){var Vn,yn,vn,wn,Un,Kn,kn,tr,or,Jn,gr,Er,Sr,Rr,sr,hr,Tr,Mr=Sn.$,qn=Sn.D;if(!Mr)throw new un("missing required Quantization Table.");for(var Ln=0;Ln<64;Ln+=8)or=qn[Rn+Ln],Jn=qn[Rn+Ln+1],gr=qn[Rn+Ln+2],Er=qn[Rn+Ln+3],Sr=qn[Rn+Ln+4],Rr=qn[Rn+Ln+5],sr=qn[Rn+Ln+6],hr=qn[Rn+Ln+7],or*=Mr[Ln],Jn|gr|Er|Sr|Rr|sr|hr?(Jn*=Mr[Ln+1],gr*=Mr[Ln+2],Er*=Mr[Ln+3],Sr*=Mr[Ln+4],Rr*=Mr[Ln+5],sr*=Mr[Ln+6],hr*=Mr[Ln+7],yn=(Vn=(Vn=Dn*or+128>>8)+(yn=Dn*Sr+128>>8)+1>>1)-yn,Tr=(vn=gr)*An+(wn=sr)*Nn+128>>8,vn=vn*Nn-wn*An+128>>8,kn=(Un=(Un=Pn*(Jn-hr)+128>>8)+(kn=Rr<<4)+1>>1)-kn,Kn=(tr=(tr=Pn*(Jn+hr)+128>>8)+(Kn=Er<<4)+1>>1)-Kn,wn=(Vn=Vn+(wn=Tr)+1>>1)-wn,vn=(yn=yn+vn+1>>1)-vn,Tr=Un*pn+tr*$n+2048>>12,Un=Un*$n-tr*pn+2048>>12,tr=Tr,Tr=Kn*Tn+kn*_n+2048>>12,Kn=Kn*_n-kn*Tn+2048>>12,kn=Tr,On[Ln]=Vn+tr,On[Ln+7]=Vn-tr,On[Ln+1]=yn+kn,On[Ln+6]=yn-kn,On[Ln+2]=vn+Kn,On[Ln+5]=vn-Kn,On[Ln+3]=wn+Un,On[Ln+4]=wn-Un):(Tr=Dn*or+512>>10,On[Ln]=Tr,On[Ln+1]=Tr,On[Ln+2]=Tr,On[Ln+3]=Tr,On[Ln+4]=Tr,On[Ln+5]=Tr,On[Ln+6]=Tr,On[Ln+7]=Tr);for(var jn=0;jn<8;++jn)or=On[jn],(Jn=On[jn+8])|(gr=On[jn+16])|(Er=On[jn+24])|(Sr=On[jn+32])|(Rr=On[jn+40])|(sr=On[jn+48])|(hr=On[jn+56])?(yn=(Vn=4112+((Vn=Dn*or+2048>>12)+(yn=Dn*Sr+2048>>12)+1>>1))-yn,Tr=(vn=gr)*An+(wn=sr)*Nn+2048>>12,vn=vn*Nn-wn*An+2048>>12,wn=Tr,kn=(Un=(Un=Pn*(Jn-hr)+2048>>12)+(kn=Rr)+1>>1)-kn,Kn=(tr=(tr=Pn*(Jn+hr)+2048>>12)+(Kn=Er)+1>>1)-Kn,Tr=Un*pn+tr*$n+2048>>12,Un=Un*$n-tr*pn+2048>>12,tr=Tr,Tr=Kn*Tn+kn*_n+2048>>12,Kn=Kn*_n-kn*Tn+2048>>12,(or=(Vn=Vn+wn+1>>1)+tr)<16?or=0:or>=4080?or=255:or>>=4,(Jn=(yn=yn+vn+1>>1)+(kn=Tr))<16?Jn=0:Jn>=4080?Jn=255:Jn>>=4,(gr=(vn=yn-vn)+Kn)<16?gr=0:gr>=4080?gr=255:gr>>=4,(Er=(wn=Vn-wn)+Un)<16?Er=0:Er>=4080?Er=255:Er>>=4,(Sr=wn-Un)<16?Sr=0:Sr>=4080?Sr=255:Sr>>=4,(Rr=vn-Kn)<16?Rr=0:Rr>=4080?Rr=255:Rr>>=4,(sr=yn-kn)<16?sr=0:sr>=4080?sr=255:sr>>=4,(hr=Vn-tr)<16?hr=0:hr>=4080?hr=255:hr>>=4,qn[Rn+jn]=or,qn[Rn+jn+8]=Jn,qn[Rn+jn+16]=gr,qn[Rn+jn+24]=Er,qn[Rn+jn+32]=Sr,qn[Rn+jn+40]=Rr,qn[Rn+jn+48]=sr,qn[Rn+jn+56]=hr):(Tr=(Tr=Dn*or+8192>>14)<-2040?0:Tr>=2024?255:Tr+2056>>4,qn[Rn+jn]=Tr,qn[Rn+jn+8]=Tr,qn[Rn+jn+16]=Tr,qn[Rn+jn+24]=Tr,qn[Rn+jn+32]=Tr,qn[Rn+jn+40]=Tr,qn[Rn+jn+48]=Tr,qn[Rn+jn+56]=Tr)}function nr(Sn,Rn){for(var On=Rn.P,Vn=Rn.c,yn=new Int16Array(64),vn=0;vn=Vn)return null;var vn=bn(Sn,Rn);if(vn>=65472&&vn<=65534)return{u:null,M:vn,offset:Rn};for(var wn=bn(Sn,yn);!(wn>=65472&&wn<=65534);){if(++yn>=Vn)return null;wn=bn(Sn,yn)}return{u:vn.toString(16),M:wn,offset:yn}}return Cn.prototype={parse(Sn,Rn){Rn==null&&(Rn={});var On,Vn,yn=Rn.F,vn=0,wn=null,Un=null,Kn=0;function kn(){var Jo=bn(Sn,vn),as=(vn+=2)+Jo-2,Ko=ar(Sn,as,vn);Ko&&Ko.u&&(as=Ko.offset);var Qo=Sn.subarray(vn,as);return vn+=Qo.length,Qo}function tr(Jo){for(var as=Math.ceil(Jo.o/8/Jo.X),Ko=Math.ceil(Jo.s/8/Jo.B),Qo=0;Qo>4){if(Mr>>4!=1)throw new un("DQT - invalid table spec");for(Rr=0;Rr<64;Rr++)qn[En[Rr]]=bn(Sn,vn),vn+=2}else for(Rr=0;Rr<64;Rr++)qn[En[Rr]]=Sn[vn++];or[15&Mr]=qn}break;case 65472:case 65473:case 65474:if(On)throw new un("Only single frame JPEGs supported");vn+=2,(On={}).G=Er===65473,On.Z=Er===65474,On.precision=Sn[vn++];var Ln,jn=bn(Sn,vn),ir=0,mr=0;vn+=2,On.s=yn||jn,On.o=bn(Sn,vn),vn+=2,On.W=[],On._={};var kr=Sn[vn++];for(Sr=0;Sr>4,Wn=15&Sn[vn+1];ir>4?Jn:gr)[15&ur]=Gn(Wr,to)}break;case 65501:Vn=bn(Sn,vn+=2),vn+=2;break;case 65498:var Gr,no=++Kn==1&&!yn;vn+=2;var Hr=Sn[vn++],Lr=[];for(Sr=0;Sr>4],Gr.i=Jn[15&ao],Lr.push(Gr)}var Ro=Sn[vn++],Xo=Sn[vn++],Ao=Sn[vn++];try{var ho=Bn(Sn,vn,On,Lr,Vn,Ro,Xo,Ao>>4,15&Ao,no);vn+=ho}catch(Jo){if(Jo instanceof DNLMarkerError)return this.parse(Sn,{F:Jo.s});if(Jo instanceof EOIMarkerError)break e;throw Jo}break;case 65500:vn+=4;break;case 65535:Sn[vn]!==255&&vn--;break;default:var qo=ar(Sn,vn-2,vn-3);if(qo&&qo.u){vn=qo.offset;break}if(vn>=Sn.length-1)break e;throw new un("JpegImage.parse - unknown marker: "+Er.toString(16))}Er=bn(Sn,vn),vn+=2}for(this.width=On.o,this.height=On.s,this.g=wn,this.b=Un,this.W=[],Sr=0;Sr>8)+jn[or+1];return Mr},get f(){return this.b?!!this.b.a:this.p===3?this.N!==0&&(this.W[0].index!==82||this.W[1].index!==71||this.W[2].index!==66):this.N===1},z:function(Sn){for(var Rn,On,Vn,yn=0,vn=Sn.length;yn4)throw new un("Unsupported color mode");var vn=this.Y(Rn,On,yn);if(this.p===1&&Vn){for(var wn=vn.length,Un=new Uint8ClampedArray(3*wn),Kn=0,kn=0;kn3&&(hn.t258=hn.t258.slice(0,3)),Tn=hn.t258?Math.min(32,hn.t258[0])*hn.t258.length:hn.t277?hn.t277[0]:1,$n==1&&hn.t279!=null&&hn.t278&&hn.t262[0]==32803&&(Tn=Math.round(8*hn.t279[0]/(hn.width*hn.t278[0]))),hn.t50885&&hn.t50885[0]==4&&(Tn=3*hn.t258[0]);var Nn=8*Math.ceil(hn.width*Tn/8),An=hn.t273;(An==null||hn.t322)&&(An=hn.t324);var Dn=hn.t279;$n==1&&An.length==1&&(Dn=[hn.height*(Nn>>>3)]),(Dn==null||hn.t322)&&(Dn=hn.t325);var Pn=new Uint8Array(hn.height*(Nn>>>3)),Cn=0;if(hn.t322!=null){var Gn=hn.t322[0],In=hn.t323[0],Bn=Math.floor((hn.width+Gn-1)/Gn),Zn=Math.floor((hn.height+In-1)/In),nr=new Uint8Array(0|Math.ceil(Gn*In*Tn/8));console.log("====",Bn,Zn);for(var ar=0;ar>>3,Zn=un.t278?un.t278[0]:un.height,nr=Math.ceil(Gn*In*un.width/8);if(Gn==16&&!un.isLE&&un.t33422==null)for(var ar=0;ar>>8&255}else if(In==3)for(An=3;An>>3]>>>7-(7&In)&1;return Gn[1]++,Bn}function $n(Gn,In){if(un==null){un={};for(var Bn=0;Bn>>=1;return Gn}function Nn(Gn,In){return Gn>>In}function An(Gn,In,Bn,Zn,nr,ar){In[Bn]=Nn(Nn(11*Gn[nr]-4*Gn[nr+ar]+Gn[nr+ar+ar]+4,3)+Gn[Zn],1),In[Bn+ar]=Nn(Nn(5*Gn[nr]+4*Gn[nr+ar]-Gn[nr+ar+ar]+4,3)-Gn[Zn],1)}function Dn(Gn,In,Bn,Zn,nr,ar){var Sn=Gn[nr-ar]-Gn[nr+ar],Rn=Gn[nr],On=Gn[Zn];In[Bn]=Nn(Nn(Sn+4,3)+Rn+On,1),In[Bn+ar]=Nn(Nn(4-Sn,3)+Rn-On,1)}function Pn(Gn,In,Bn,Zn,nr,ar){In[Bn]=Nn(Nn(5*Gn[nr]+4*Gn[nr-ar]-Gn[nr-ar-ar]+4,3)+Gn[Zn],1),In[Bn+ar]=Nn(Nn(11*Gn[nr]-4*Gn[nr-ar]+Gn[nr-ar-ar]+4,3)-Gn[Zn],1)}function Cn(Gn){return bn[Gn=Gn<0?0:Gn>4095?4095:Gn]>>>2}return function(Gn,In,Bn,Zn,nr){Zn=new Uint16Array(Zn.buffer);var ar,Sn,Rn,On,Vn,yn,vn,wn,Un=Date.now(),Kn=Gt._binBE,kn=In+Bn;for(In+=4;In>>1)*(Sn>>>1));for(wn=new Int16Array((ar>>>1)*(Sn>>>1)),hn=new Int16Array(1024),Sr=0;Sr<1024;Sr++){var Rr=Sr-512,sr=Math.abs(Rr),hr=Math.floor(768*sr*sr*sr/16581375)+sr;hn[Sr]=Math.sign(Rr)*hr}for(bn=new Uint16Array(4096),Sr=0;Sr<4096;Sr++){var Tr=Sr,Mr=65535*(Math.pow(113,Tr/4095)-1)/112;bn[Sr]=Math.min(Mr,65535)}}var qn=vn[Vn],Ln=pn(ar,1+_n[Rn]),jn=pn(Sn,1+_n[Rn]);if(Rn==0)for(var ir=0;ir>>1)+mr]=Gn[kr]<<8|Gn[kr+1]}else{var Cr=[Gn,8*In],Wn=[],vr=0,Xn=Ln*jn,ur=[0,0],Wr=0;for(or=0;vr0;)Wn[vr++]=or,Wr--;var Or=(Rn-1)%3,to=Or!=1?Ln:0,Gr=Or!=0?jn:0;for(ir=0;ir>>1)+to,Hr=ir*Ln;for(mr=0;mr>>1,lo=2*Ln,uo=2*jn;for(ir=0;ir>14-2*qo&3;var xa=Ao[ho];if(xa!=0)for(ir=0;ir>>1)*(ar>>>1)+(mr>>>1)],Wo=as[kr]-2048,ss=Ko[kr]-2048,$a=Qo[kr]-2048,vs=(Wo<<1)+Go,ks=(ss<<1)+Go,Ss=Go+$a,Is=Go-$a;Zn[hs]=Cn(vs),Zn[hs+1]=Cn(Ss),Zn[hs+ar]=Cn(Is),Zn[hs+ar+1]=Cn(ks)}}In+=4*Er}else if(Jn==16388)In+=4*Er;else if(gr!=8192&&gr!=8448&&gr!=9216)throw Jn.toString(16)}}}}}}}}}console.log(Date.now()-Un)}}(),Gt.decode._decodeLogLuv32=function(un,hn,bn,En,_n,Tn){for(var $n=un.width,pn=4*$n,Nn=0,An=new Uint8Array(pn);Nn>>11,Gn=15&Dn>>>22,In=15&Dn>>>26,Bn=0;Bn<4&&128<>3))>>>(7&Zn)&127)<2047&&(ar[On]=2047),Zn+=7);for(On=0;On<16;On++,Un+=2)Rr=ar[On]<<1,Gt.decode._putsF(_n,(Kn*$n+Un)*Nn,Rr<<16-Nn);Un-=1&Un?1:31}}}else for(var On=0;On>>4,_n[Tn+On+1]=Vn<<4|vn>>>4,_n[Tn+On+2]=vn<<4|yn>>>4}else{pn+=8;var wn,Un,Kn,kn=[bn,0,0,0],tr=new Uint16Array(32770),or=[3857,3856,3599,3342,3085,2828,2571,2314,2057,1800,1543,1286,1029,772,771,768,514,513],Jn=0,gr=Gt.decode._ljpeg_diff;for(tr[0]=15,wn=On=0;On<18;On++)for(var Er=32768>>>(or[On]>>>8),Sr=0;Sr1&&(or=Math.floor(tr/(Jn-1))),ar==68&&Sn==32&&or>0&&(Cn=On.readShort(Zn,562));var gr=[0,0],Er=Gn(pn[Pn]),Sr=[En,0,0,0];for(vn=0;vn>>4),0)<<1)<>>1)&1<>>3;un[En]|=bn>>>16,un[En+1]|=bn>>>8,un[En+2]|=bn},Gt.decode._getbithuff=function(un,hn,bn,En){Gt.decode._get_byte;var _n,Tn=hn[0],$n=hn[1],pn=hn[2],Nn=hn[3];if(bn==0||pn<0)return 0;for(;!Nn&&pn>>32-bn,En?(pn-=En[_n+1]>>>8,_n=255&En[_n+1]):pn-=bn,pn<0)throw"e";return hn[0]=Tn,hn[1]=$n,hn[2]=pn,hn[3]=Nn,_n},Gt.decode._make_decoder=function(un){var hn,bn,En,_n,Tn,$n=[];for(hn=16;hn!=0&&!un[hn];hn--);var pn=17;for($n[0]=hn,En=bn=1;bn<=hn;bn++)for(_n=0;_n>>8;else for(Dn=0;Dn>>8,_n[Tn+(Dn<<1)+1]=255&In[Dn];else if(Gn==14||Gn==12){var Zn=16-Gn;for(Dn=0;Dn1),!Cn){if(hn[bn]==255&&hn[bn+1]==An)return{jpegOffset:bn};if(Gn!=null&&(hn[bn+In]==255&&hn[bn+In+1]==An?Dn=bn+In:Ut("JPEGInterchangeFormat does not point to SOI"),Bn==null?Ut("JPEGInterchangeFormatLength field is missing"):(In>=Pn||In+Zn<=Pn)&&Ut("JPEGInterchangeFormatLength field value is invalid"),Dn!=null))return{jpegOffset:Dn}}if(ar!=null&&(Sn=ar[0],Rn=ar[1]),Gn!=null&&Bn!=null)if(Zn>=2&&In+Zn<=Pn){for(_n=hn[bn+In+Zn-2]==255&&hn[bn+In+Zn-1]==An?new Uint8Array(Zn-2):new Uint8Array(Zn),$n=0;$n<_n.length;$n++)_n[$n]=hn[bn+In+$n];Ut("Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables")}else Ut("JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile");if(_n==null){var yn=0,vn=[];vn[yn++]=255,vn[yn++]=An;var wn=un.t519;if(wn==null)throw new Error("JPEGQTables tag is missing");for($n=0;$n>>8,vn[yn++]=255&Kn,vn[yn++]=$n|Nn<<4,pn=0;pn<16;pn++)vn[yn++]=hn[bn+Un[$n]+pn];for(pn=0;pn>>8&255,vn[yn++]=255&un.height,vn[yn++]=un.width>>>8&255,vn[yn++]=255&un.width,vn[yn++]=On,On==1)vn[yn++]=1,vn[yn++]=17,vn[yn++]=0;else for($n=0;$n<3;$n++)vn[yn++]=$n+1,vn[yn++]=$n!=0?17:(15&Sn)<<4|15&Rn,vn[yn++]=$n;Vn!=null&&Vn[0]!=0&&(vn[yn++]=255,vn[yn++]=221,vn[yn++]=0,vn[yn++]=4,vn[yn++]=Vn[0]>>>8&255,vn[yn++]=255&Vn[0]),_n=new Uint8Array(vn)}var kn=-1;for($n=0;$n<_n.length-1;){if(_n[$n]==255&&_n[$n+1]==192){kn=$n;break}$n++}if(kn==-1){var tr=new Uint8Array(_n.length+10+3*On);tr.set(_n);var or=_n.length;if(kn=_n.length,(_n=tr)[or++]=255,_n[or++]=192,_n[or++]=0,_n[or++]=8+3*On,_n[or++]=8,_n[or++]=un.height>>>8&255,_n[or++]=255&un.height,_n[or++]=un.width>>>8&255,_n[or++]=255&un.width,_n[or++]=On,On==1)_n[or++]=1,_n[or++]=17,_n[or++]=0;else for($n=0;$n<3;$n++)_n[or++]=$n+1,_n[or++]=$n!=0?17:(15&Sn)<<4|15&Rn,_n[or++]=$n}if(hn[Pn]==255&&hn[Pn+1]==218){var Jn=hn[Pn+2]<<8|hn[Pn+3];for((Tn=new Uint8Array(Jn+2))[0]=hn[Pn],Tn[1]=hn[Pn+1],Tn[2]=hn[Pn+2],Tn[3]=hn[Pn+3],$n=0;$n>>8&255,Nn[Dn.sofPosition+6]=255&un.height,Nn[Dn.sofPosition+7]=un.width>>>8&255,Nn[Dn.sofPosition+8]=255&un.width,hn[bn]==255&&hn[bn+1]==SOS||(Nn.set(Dn.sosMarker,An),An+=sosMarker.length),Gn=0;Gn=0&&Nn<128)for(var An=0;An=-127&&Nn<0){for(An=0;An<1-Nn;An++)$n[_n]=Tn[hn],_n++;hn++}}return _n},Gt.decode._decodeThunder=function(un,hn,bn,En,_n){for(var Tn=[0,1,0,-1],$n=[0,1,2,3,0,-3,-2,-1],pn=hn+bn,Nn=2*_n,An=0;hn>>6,Cn=63&Dn;if(hn++,Pn==3&&(An=15&Cn,En[Nn>>>1]|=An<<4*(1-Nn&1),Nn++),Pn==0)for(var Gn=0;Gn>>1]|=An<<4*(1-Nn&1),Nn++;if(Pn==2)for(Gn=0;Gn<2;Gn++)(In=Cn>>>3*(1-Gn)&7)!=4&&(An+=$n[In],En[Nn>>>1]|=An<<4*(1-Nn&1),Nn++);if(Pn==1)for(Gn=0;Gn<3;Gn++){var In;(In=Cn>>>2*(2-Gn)&3)!=2&&(An+=Tn[In],En[Nn>>>1]|=An<<4*(1-Nn&1),Nn++)}}},Gt.decode._dmap={1:0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3},Gt.decode._lens=function(){var un=function(Nn,An,Dn,Pn){for(var Cn=0;Cn>>3>>3]>>>7-(7&Nn)&1),$n==2&&(yn=un[Nn>>>3]>>>(7&Nn)&1),Nn++,Dn+=yn,Rn=="H"){if(pn._lens[ar][Dn]!=null){var vn=pn._lens[ar][Dn];Dn="",An+=vn,vn<64&&(pn._addNtimes(Pn,An,ar),In+=An,ar=1-ar,An=0,--On==0&&(Rn=""))}}else Dn=="0001"&&(Dn="",pn._addNtimes(Pn,nr-In,ar),In=nr),Dn=="001"&&(Dn="",Rn="H",On=2),pn._dmap[Dn]!=null&&(Bn=Zn+pn._dmap[Dn],pn._addNtimes(Pn,Bn-In,ar),In=Bn,Dn="",ar=1-ar);Pn.length==Tn&&Rn==""&&(pn._writeBits(Pn,En,8*_n+Sn*Vn),ar=0,Sn++,In=0,Cn=pn._makeDiff(Pn),Pn=[])}},Gt.decode._findDiff=function(un,hn,bn){for(var En=0;En=hn&&un[En+1]==bn)return un[En]},Gt.decode._makeDiff=function(un){var hn=[];un[0]==1&&hn.push(0,1);for(var bn=1;bn>>3>>3]>>>7-(7&Nn)&1),$n==2&&(Bn=un[Nn>>>3]>>>(7&Nn)&1),Nn++,Dn+=Bn,(An=pn._lens[Cn][Dn])!=null&&(pn._addNtimes(Pn,An,Cn),Dn="",An<64&&(Cn=1-Cn),Pn.length==Tn&&(pn._writeBits(Pn,En,8*_n+Gn*In),Pn=[],Gn++,Cn=0,7&Nn&&(Nn+=8-(7&Nn)),An>=64&&(Nn+=8)))}},Gt.decode._decodeG3=function(un,hn,bn,En,_n,Tn,$n,pn){for(var Nn=Gt.decode,An=hn<<3,Dn=0,Pn="",Cn=[],Gn=[],In=0;In>>3>>3]>>>7-(7&An)&1),$n==2&&(wn=un[An>>>3]>>>(7&An)&1),An++,Pn+=wn,yn){if(Nn._lens[Sn][Pn]!=null){var Un=Nn._lens[Sn][Pn];Pn="",Dn+=Un,Un<64&&(Nn._addNtimes(Cn,Dn,Sn),Sn=1-Sn,Dn=0)}}else On=="H"?Nn._lens[Sn][Pn]!=null&&(Un=Nn._lens[Sn][Pn],Pn="",Dn+=Un,Un<64&&(Nn._addNtimes(Cn,Dn,Sn),Bn+=Dn,Sn=1-Sn,Dn=0,--Vn==0&&(On=""))):(Pn=="0001"&&(Pn="",Nn._addNtimes(Cn,ar-Bn,Sn),Bn=ar),Pn=="001"&&(Pn="",On="H",Vn=2),Nn._dmap[Pn]!=null&&(Zn=nr+Nn._dmap[Pn],Nn._addNtimes(Cn,Zn-Bn,Sn),Bn=Zn,Pn="",Sn=1-Sn));Pn.endsWith("000000000001")&&(Rn>=0&&Nn._writeBits(Cn,En,8*_n+Rn*vn),pn&&($n==1&&(yn=(un[An>>>3]>>>7-(7&An)&1)==1),$n==2&&(yn=(un[An>>>3]>>>(7&An)&1)==1),An++),Pn="",Sn=0,Rn++,Bn=0,Gn=Nn._makeDiff(Cn),Cn=[])}Cn.length==Tn&&Nn._writeBits(Cn,En,8*_n+Rn*vn)},Gt.decode._addNtimes=function(un,hn,bn){for(var En=0;En>>3]|=un[En]<<7-(bn+En&7)},Gt.decode._decodeLZW=Gt.decode._decodeLZW=(Qt=0,en=0,tn=0,nn=0,rn=function(){var un=qt>>>3,hn=(Yt[un]<<16|Yt[un+1]<<8|Yt[un+2])>>>24-(7&qt)-en&(1<>>----------------");for(var Nn=0;Nn<$n;Nn++){var An=un.readUshort(hn,bn);bn+=2;var Dn=un.readUshort(hn,bn);bn+=2;var Pn=un.readUint(hn,bn);bn+=4;var Cn=un.readUint(hn,bn);bn+=4;var Gn=[];if(Dn!=1&&Dn!=7||(Gn=new Uint8Array(hn.buffer,Pn<5?bn-4:Cn,Pn)),Dn==2){var In=Pn<5?bn-4:Cn,Bn=hn[In],Zn=Math.max(0,Math.min(Pn-1,hn.length-In));Bn<128||Zn==0?Gn.push(un.readASCII(hn,In,Zn)):Gn=new Uint8Array(hn.buffer,In,Zn)}if(Dn==3)for(var nr=0;nr4&&(un.writeUint(bn,En,pn),Bn=pn),Pn==1||Pn==7)for(var Zn=0;Zn4&&(pn+=In+=1&In),En+=4}}return[En,pn]},Gt.toRGBA8=function(un,hn){var bn=un.width,En=un.height,_n=bn*En,Tn=4*_n,$n=un.data,pn=new Uint8Array(4*_n),Nn=un.t262?un.t262[0]:2,An=un.t258?Math.min(32,un.t258[0]):1;if(un.t262==null&&An==1&&(Nn=0),Nn==0)for(var Dn=Math.ceil(An*bn/8),Pn=0;Pn>3)]>>7-(7&In)&1;pn[Bn]=pn[Bn+1]=pn[Bn+2]=255*(1-Zn),pn[Bn+3]=255}if(An==4)for(In=0;In>1)]>>4-4*(1&In)&15,pn[Bn]=pn[Bn+1]=pn[Bn+2]=17*(15-Zn),pn[Bn+3]=255;if(An==8)for(In=0;In>3)]>>7-(7&In)&1,pn[Bn]=pn[Bn+1]=pn[Bn+2]=255*Zn,pn[Bn+3]=255;if(An==2)for(In=0;In>2)]>>6-2*(3&In)&3,pn[Bn]=pn[Bn+1]=pn[Bn+2]=85*Zn,pn[Bn+3]=255;if(An==8)for(In=0;In>>3)]>>>7-(7&vn)&1;else if(An==2)wn=$n[Un+(vn>>>2)]>>>6-2*(3&vn)&3;else if(An==4)wn=$n[Un+(vn>>>1)]>>>4-4*(1&vn)&15;else{if(An!=8)throw An;wn=$n[Un+vn*nr]}pn[Bn]=Vn[wn]>>8,pn[Bn+1]=Vn[yn+wn]>>8,pn[Bn+2]=Vn[yn+yn+wn]>>8,pn[Bn+3]=255}}else if(Nn==5){var Kn=(nr=un.t258?un.t258.length:4)>4?1:0;for(In=0;In<_n;In++){Bn=In<<2;var kn=In*nr;if(UDOC){var tr=$n[kn],or=$n[kn+1],Jn=$n[kn+2],gr=$n[kn+3],Er=UDOC.C.cmykToRgb([tr*(1/255),or*(1/255),Jn*(1/255),gr*(1/255)]);pn[Bn]=~~(.5+255*Er[0]),pn[Bn+1]=~~(.5+255*Er[1]),pn[Bn+2]=~~(.5+255*Er[2])}else tr=255-$n[kn],or=255-$n[kn+1],Jn=255-$n[kn+2],gr=(255-$n[kn+3])*.00392156862745098,pn[Bn]=~~(tr*gr+.5),pn[Bn+1]=~~(or*gr+.5),pn[Bn+2]=~~(Jn*gr+.5);pn[Bn+3]=255*(1-Kn)+$n[kn+4]*Kn}}else if(Nn==6&&un.t278){var Sr=un.t278[0];for(Pn=0;Pn>>1))+(1&sr)];var hr=$n[kn+2]-128,Tr=$n[kn+3]-128,Mr=Jn+((Tr>>2)+(Tr>>3)+(Tr>>5)),qn=Jn-((hr>>2)+(hr>>4)+(hr>>5))-((Tr>>1)+(Tr>>3)+(Tr>>4)+(Tr>>5)),Ln=Jn+(hr+(hr>>1)+(hr>>2)+(hr>>6));pn[Bn]=Math.max(0,Math.min(255,Mr)),pn[Bn+1]=Math.max(0,Math.min(255,qn)),pn[Bn+2]=Math.max(0,Math.min(255,Ln)),pn[Bn+3]=255}}}else if(Nn==32845){let Xn=function(ur){return ur<.0031308?12.92*ur:1.055*Math.pow(ur,.4166666666666667)-.055};for(Pn=0;PnEn&&(En=pn,_n=$n)}}Gt.decodeImage(un,_n,hn);var Nn=Gt.toRGBA8(_n),An=_n.width,Dn=_n.height,Pn=document.createElement("canvas");Pn.width=An,Pn.height=Dn;var Cn=Pn.getContext("2d"),Gn=new ImageData(new Uint8ClampedArray(Nn.buffer),An,Dn);return Cn.putImageData(Gn,0,0),Pn.toDataURL()},Gt._binBE={nextZero:function(un,hn){for(;un[hn]!=0;)hn++;return hn},readUshort:function(un,hn){return un[hn]<<8|un[hn+1]},readShort:function(un,hn){var bn=Gt._binBE.ui8;return bn[0]=un[hn+1],bn[1]=un[hn+0],Gt._binBE.i16[0]},readInt:function(un,hn){var bn=Gt._binBE.ui8;return bn[0]=un[hn+3],bn[1]=un[hn+2],bn[2]=un[hn+1],bn[3]=un[hn+0],Gt._binBE.i32[0]},readUint:function(un,hn){var bn=Gt._binBE.ui8;return bn[0]=un[hn+3],bn[1]=un[hn+2],bn[2]=un[hn+1],bn[3]=un[hn+0],Gt._binBE.ui32[0]},readASCII:function(un,hn,bn){for(var En="",_n=0;_n>8&255,un[hn+1]=255&bn},writeInt:function(un,hn,bn){var En=Gt._binBE.ui8;Gt._binBE.i32[0]=bn,un[hn+3]=En[0],un[hn+2]=En[1],un[hn+1]=En[2],un[hn+0]=En[3]},writeUint:function(un,hn,bn){un[hn]=bn>>24&255,un[hn+1]=bn>>16&255,un[hn+2]=bn>>8&255,un[hn+3]=bn>>0&255},writeASCII:function(un,hn,bn){for(var En=0;En>8&255},writeInt:function(un,hn,bn){var En=Gt._binBE.ui8;Gt._binBE.i32[0]=bn,un[hn+0]=En[0],un[hn+1]=En[1],un[hn+2]=En[2],un[hn+3]=En[3]},writeUint:function(un,hn,bn){un[hn]=bn>>>0&255,un[hn+1]=bn>>>8&255,un[hn+2]=bn>>>16&255,un[hn+3]=bn>>>24&255},writeASCII:Gt._binBE.writeASCII},Gt._copyTile=function(un,hn,bn,En,_n,Tn,$n,pn){for(var Nn=Math.min(hn,_n-$n),An=Math.min(bn,Tn-pn),Dn=0;Dn>--On&1)];Rn[ar]=yn}}function Tn(In,Bn,Zn,nr){if(In[Bn+3]!=255)return 0;if(Zn==0)return Bn;for(var ar=0;ar<2;ar++){In[Bn+ar]==0&&(In[Bn+ar]=In.length,In.push(0,0,nr,255));var Sn=Tn(In,In[Bn+ar],Zn-1,nr+1);if(Sn!=0)return Sn}return 0}function $n(In){for(var Bn=In.b,Zn=In.a;Bn<25&&In.e>>8),Zn=Zn<<8|nr,Bn+=8}if(Bn<0)throw"e";In.b=Bn,In.a=Zn}function pn(In,Bn){return Bn.b>(Bn.b-=In)&65535>>16-In}function Nn(In,Bn){var Zn=In[0],nr=0,ar=255;Bn.b<16&&$n(Bn);var Sn=Bn.a>>Bn.b-8&255;for(ar=Zn[(nr=In[1][Sn])+3],Bn.b-=Zn[nr+2];ar==255;)ar=Zn[(nr=Zn[nr+(Bn.a>>--Bn.b&1)])+3];return ar}function An(In,Bn){return In<32768>>16-Bn&&(In+=1-(1<>>1);else if(Bn==6)or=In[kn]+(tr-In[kn-Rn]>>>1);else{if(Bn!=7)throw Bn;or=tr+In[kn]>>>1}In[Kn]+=or}}}return function(In){if(un=In,hn=0,En()!=65496)throw"e";for(var Bn=[],Zn=0,nr=0,ar=[],Sn=[],Rn=[],On=0,Vn=0,yn=0;;){var vn=En();if(vn!=65535){var wn=En();if(vn==65475){nr=bn(),Vn=En(),yn=En(),On=bn();for(var Un=0;Un>4,15&kn]}}else if(vn==65476)for(var tr=hn+wn-2;hn>>4],ar[or[0]]=or.slice(1)}Zn=bn(),hn+=2;break}hn+=wn-2}}else hn--}var Jn=new(nr>8?Uint16Array:Uint8Array)(Vn*yn*On),gr={b:0,a:0,c:Zn==8,e:hn,data:un,d:un.length};if(gr.c)(function(ur,Wr,Or,to,Gr){for(var no=un.length-hn,Hr=0;HrSr&&(Sr=mr),(ir=sr[1])>Rr&&(Rr=ir),Er.push(mr*ir)}if(Sr!=1||Rr!=1){var hr=[],Tr=0;for(Un=0;Un>>6),Kn=0;Kn<3;Kn++)for(var kn=0;kn<41;kn++)wn[Kn][kn]=[Un,1];return wn}function nr(vn,wn){var Un=0,Kn=8-vn.a;if(vn.j,vn.a,wn){if(wn>=Kn)do Un<<=Kn,wn-=Kn,Un|=vn[vn.j]&(1<=8);wn&&(Un<<=wn,Kn-=wn,Un|=vn[vn.j]>>>Kn&(1<sr&&Rr>>2,Jn)return void(Ln[Tr]=hr);gr=wn.t*wn.c[vn.g+kr-ir]+wn.c[vn.g+mr-kr]}else hr=kr>mr&&kr>Cr||kr>>2:Wn+vr>>>1,gr=wn.t*wn.c[vn.g+kr-mr]+wn.c[vn.g+mr-Wn];Er=Xn(gr);var ur=function(Or){for(var to=-1,Gr=0;!Gr;to++)Gr=Or[Or.j]>>>7-Or.a&1,Or.a++,Or.a&=7,Or.a||Or.j++;return to}(Un);if(ur>>1):qn>>>1,or[Er][0]+=Xn(qn),or[Er][1]==vn.f&&(or[Er][0]>>>=1,or[Er][1]>>>=1),or[Er][1]++,hr=gr<0?hr-qn:hr+qn,vn.i&&(hr<0?hr+=wn.w:hr>vn.g&&(hr-=wn.w)),Ln[Tr]=hr>=0?Math.min(hr,vn.g):0}function Sn(vn,wn,Un){for(var Kn=vn[0].length,kn=wn;kn<=Un;kn++)vn[kn][0]=vn[kn-1][1],vn[kn][Kn-1]=vn[kn-1][Kn-2]}function Rn(vn){Sn(vn,Tn,Dn),Sn(vn,un,bn),Sn(vn,Gn,Bn)}function On(vn,wn,Un,Kn,kn,tr,or,Jn,gr,Er,Sr,Rr,sr){for(var hr=0,Tr=1,Mr=knbn;Tr8&&(ar(vn,wn,Un,Kn,kn,Tr,Jn[gr]),ar(vn,wn,Un,Kn,tr,Tr,Jn[gr]),Tr+=2);Rn(Kn)}function Vn(vn,wn,Un,Kn,kn,tr){On(vn,wn,Un,Kn,un,Tn,kn,tr,0,0,1,0,8),On(vn,wn,Un,Kn,$n,Gn,kn,tr,1,0,1,0,8),On(vn,wn,Un,Kn,hn,pn,kn,tr,2,1,0,3,0),On(vn,wn,Un,Kn,Nn,In,kn,tr,0,0,0,3,2),On(vn,wn,Un,Kn,bn,An,kn,tr,1,0,0,3,2),On(vn,wn,Un,Kn,Dn,Bn,kn,tr,2,1,0,3,0)}function yn(vn,wn,Un,Kn,kn,tr){var or=tr.length,Jn=vn.l;kn+1==vn.s&&(Jn=vn.e-kn*vn.l);for(var gr=6*vn.e*Kn+kn*vn.l,Er=0;Er<6;Er++){for(var Sr=0;Sr>>1):sr==2?Gn+(Er>>>1):Tn+Er;var hr=vn.h?(2*Sr/3&2147483646|Sr%3&1)+(Sr%3>>>1):Sr>>>1;wn[gr+Sr]=Un[Rr][hr+1]}gr+=vn.e}}Gt._decompressRAF=function(vn,wn){var Un=function(Tr){var Mr=Gt._binBE.readUshort,qn={b:Mr(Tr,0),i:Tr[2],C:Tr[3],u:Tr[4],q:Mr(Tr,5),k:Mr(Tr,7),e:Mr(Tr,9),l:Mr(Tr,11),s:Tr[13],d:Mr(Tr,14)};if(qn.b!=18771||qn.i>1||qn.q<6||qn.q%6||qn.e<768||qn.e%24||qn.l!=768||qn.k=qn.l||qn.s>16||qn.s!=qn.k/qn.l||qn.s!=Math.ceil(qn.e/qn.l)||qn.d!=qn.q/6||qn.u!=12&&qn.u!=14&&qn.u!=16||qn.C!=16&&qn.C!=0)throw"Invalid data";if(qn.i==0)throw"Not implemented. We need this file!";return qn.h=qn.C==16,qn.m=0|(qn.h?2*qn.l/3:qn.l>>>1),qn.A=qn.m+2,qn.f=64,qn.g=(1<{Dt.r(Pt),Dt.d(Pt,{DOMException:()=>mn,Headers:()=>Xt,Request:()=>an,Response:()=>ln,fetch:()=>gn});var Nt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||Nt!==void 0&&Nt,jt={searchParams:"URLSearchParams"in Nt,iterable:"Symbol"in Nt&&"iterator"in Symbol,blob:"FileReader"in Nt&&"Blob"in Nt&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Nt,arrayBuffer:"ArrayBuffer"in Nt};if(jt.arrayBuffer)var Ut=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Gt=ArrayBuffer.isView||function(un){return un&&Ut.indexOf(Object.prototype.toString.call(un))>-1};function Wt(un){if(typeof un!="string"&&(un=String(un)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(un)||un==="")throw new TypeError('Invalid character in header field name: "'+un+'"');return un.toLowerCase()}function qt(un){return typeof un!="string"&&(un=String(un)),un}function Yt(un){var hn={next:function(){var bn=un.shift();return{done:bn===void 0,value:bn}}};return jt.iterable&&(hn[Symbol.iterator]=function(){return hn}),hn}function Xt(un){this.map={},un instanceof Xt?un.forEach(function(hn,bn){this.append(bn,hn)},this):Array.isArray(un)?un.forEach(function(hn){this.append(hn[0],hn[1])},this):un&&Object.getOwnPropertyNames(un).forEach(function(hn){this.append(hn,un[hn])},this)}function Zt(un){if(un.bodyUsed)return Promise.reject(new TypeError("Already read"));un.bodyUsed=!0}function Qt(un){return new Promise(function(hn,bn){un.onload=function(){hn(un.result)},un.onerror=function(){bn(un.error)}})}function en(un){var hn=new FileReader,bn=Qt(hn);return hn.readAsArrayBuffer(un),bn}function tn(un){if(un.slice)return un.slice(0);var hn=new Uint8Array(un.byteLength);return hn.set(new Uint8Array(un)),hn.buffer}function nn(){return this.bodyUsed=!1,this._initBody=function(un){var hn;this.bodyUsed=this.bodyUsed,this._bodyInit=un,un?typeof un=="string"?this._bodyText=un:jt.blob&&Blob.prototype.isPrototypeOf(un)?this._bodyBlob=un:jt.formData&&FormData.prototype.isPrototypeOf(un)?this._bodyFormData=un:jt.searchParams&&URLSearchParams.prototype.isPrototypeOf(un)?this._bodyText=un.toString():jt.arrayBuffer&&jt.blob&&(hn=un)&&DataView.prototype.isPrototypeOf(hn)?(this._bodyArrayBuffer=tn(un.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):jt.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(un)||Gt(un))?this._bodyArrayBuffer=tn(un):this._bodyText=un=Object.prototype.toString.call(un):this._bodyText="",this.headers.get("content-type")||(typeof un=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):jt.searchParams&&URLSearchParams.prototype.isPrototypeOf(un)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},jt.blob&&(this.blob=function(){var un=Zt(this);if(un)return un;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?Zt(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(en)}),this.text=function(){var un,hn,bn,En=Zt(this);if(En)return En;if(this._bodyBlob)return un=this._bodyBlob,bn=Qt(hn=new FileReader),hn.readAsText(un),bn;if(this._bodyArrayBuffer)return Promise.resolve(function(_n){for(var Tn=new Uint8Array(_n),$n=new Array(Tn.length),pn=0;pn-1?En:bn),this.mode=hn.mode||this.mode||null,this.signal=hn.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&_n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(_n),!(this.method!=="GET"&&this.method!=="HEAD"||hn.cache!=="no-store"&&hn.cache!=="no-cache")){var Tn=/([?&])_=[^&]*/;Tn.test(this.url)?this.url=this.url.replace(Tn,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function sn(un){var hn=new FormData;return un.trim().split("&").forEach(function(bn){if(bn){var En=bn.split("="),_n=En.shift().replace(/\+/g," "),Tn=En.join("=").replace(/\+/g," ");hn.append(decodeURIComponent(_n),decodeURIComponent(Tn))}}),hn}function ln(un,hn){if(!(this instanceof ln))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');hn||(hn={}),this.type="default",this.status=hn.status===void 0?200:hn.status,this.ok=this.status>=200&&this.status<300,this.statusText=hn.statusText===void 0?"":""+hn.statusText,this.headers=new Xt(hn.headers),this.url=hn.url||"",this._initBody(un)}an.prototype.clone=function(){return new an(this,{body:this._bodyInit})},nn.call(an.prototype),nn.call(ln.prototype),ln.prototype.clone=function(){return new ln(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Xt(this.headers),url:this.url})},ln.error=function(){var un=new ln(null,{status:0,statusText:""});return un.type="error",un};var dn=[301,302,303,307,308];ln.redirect=function(un,hn){if(dn.indexOf(hn)===-1)throw new RangeError("Invalid status code");return new ln(null,{status:hn,headers:{location:un}})};var mn=Nt.DOMException;try{new mn}catch{(mn=function(hn,bn){this.message=hn,this.name=bn;var En=Error(hn);this.stack=En.stack}).prototype=Object.create(Error.prototype),mn.prototype.constructor=mn}function gn(un,hn){return new Promise(function(bn,En){var _n=new an(un,hn);if(_n.signal&&_n.signal.aborted)return En(new mn("Aborted","AbortError"));var Tn=new XMLHttpRequest;function $n(){Tn.abort()}Tn.onload=function(){var pn,Nn,An={status:Tn.status,statusText:Tn.statusText,headers:(pn=Tn.getAllResponseHeaders()||"",Nn=new Xt,pn.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(Pn){return Pn.indexOf(` -`)===0?Pn.substr(1,Pn.length):Pn}).forEach(function(Pn){var Cn=Pn.split(":"),Gn=Cn.shift().trim();if(Gn){var In=Cn.join(":").trim();Nn.append(Gn,In)}}),Nn)};An.url="responseURL"in Tn?Tn.responseURL:An.headers.get("X-Request-URL");var Dn="response"in Tn?Tn.response:Tn.responseText;setTimeout(function(){bn(new ln(Dn,An))},0)},Tn.onerror=function(){setTimeout(function(){En(new TypeError("Network request failed"))},0)},Tn.ontimeout=function(){setTimeout(function(){En(new TypeError("Network request failed"))},0)},Tn.onabort=function(){setTimeout(function(){En(new mn("Aborted","AbortError"))},0)},Tn.open(_n.method,function(pn){try{return pn===""&&Nt.location.href?Nt.location.href:pn}catch{return pn}}(_n.url),!0),_n.credentials==="include"?Tn.withCredentials=!0:_n.credentials==="omit"&&(Tn.withCredentials=!1),"responseType"in Tn&&(jt.blob?Tn.responseType="blob":jt.arrayBuffer&&_n.headers.get("Content-Type")&&_n.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(Tn.responseType="arraybuffer")),!hn||typeof hn.headers!="object"||hn.headers instanceof Xt?_n.headers.forEach(function(pn,Nn){Tn.setRequestHeader(Nn,pn)}):Object.getOwnPropertyNames(hn.headers).forEach(function(pn){Tn.setRequestHeader(pn,qt(hn.headers[pn]))}),_n.signal&&(_n.signal.addEventListener("abort",$n),Tn.onreadystatechange=function(){Tn.readyState===4&&_n.signal.removeEventListener("abort",$n)}),Tn.send(_n._bodyInit===void 0?null:_n._bodyInit)})}gn.polyfill=!0,Nt.fetch||(Nt.fetch=gn,Nt.Headers=Xt,Nt.Request=an,Nt.Response=ln)},6290:(_e,Pt,Dt)=>{var Nt=Dt(5048),jt=Dt(9748),Ut=Dt(4655),Gt=Dt(1960);function Wt(Xt,Zt,Qt){var en=Xt;return jt(Zt)?(Qt=Zt,typeof Xt=="string"&&(en={uri:Xt})):en=Gt(Zt,{uri:Xt}),en.callback=Qt,en}function qt(Xt,Zt,Qt){return Yt(Zt=Wt(Xt,Zt,Qt))}function Yt(Xt){if(Xt.callback===void 0)throw new Error("callback argument missing");var Zt=!1,Qt=function(_n,Tn,$n){Zt||(Zt=!0,Xt.callback(_n,Tn,$n))};function en(){var _n=void 0;if(_n=sn.response?sn.response:sn.responseText||function(Tn){try{if(Tn.responseType==="document")return Tn.responseXML;var $n=Tn.responseXML&&Tn.responseXML.documentElement.nodeName==="parsererror";if(Tn.responseType===""&&!$n)return Tn.responseXML}catch{}return null}(sn),bn)try{_n=JSON.parse(_n)}catch{}return _n}function tn(_n){return clearTimeout(ln),_n instanceof Error||(_n=new Error(""+(_n||"Unknown XMLHttpRequest Error"))),_n.statusCode=0,Qt(_n,En)}function nn(){if(!an){var _n;clearTimeout(ln),_n=Xt.useXDR&&sn.status===void 0?200:sn.status===1223?204:sn.status;var Tn=En,$n=null;return _n!==0?(Tn={body:en(),statusCode:_n,method:mn,headers:{},url:dn,rawRequest:sn},sn.getAllResponseHeaders&&(Tn.headers=Ut(sn.getAllResponseHeaders()))):$n=new Error("Internal XMLHttpRequest Error"),Qt($n,Tn,Tn.body)}}var rn,an,sn=Xt.xhr||null;sn||(sn=Xt.cors||Xt.useXDR?new qt.XDomainRequest:new qt.XMLHttpRequest);var ln,dn=sn.url=Xt.uri||Xt.url,mn=sn.method=Xt.method||"GET",gn=Xt.body||Xt.data,un=sn.headers=Xt.headers||{},hn=!!Xt.sync,bn=!1,En={body:void 0,headers:{},statusCode:0,method:mn,url:dn,rawRequest:sn};if("json"in Xt&&Xt.json!==!1&&(bn=!0,un.accept||un.Accept||(un.Accept="application/json"),mn!=="GET"&&mn!=="HEAD"&&(un["content-type"]||un["Content-Type"]||(un["Content-Type"]="application/json"),gn=JSON.stringify(Xt.json===!0?gn:Xt.json))),sn.onreadystatechange=function(){sn.readyState===4&&setTimeout(nn,0)},sn.onload=nn,sn.onerror=tn,sn.onprogress=function(){},sn.onabort=function(){an=!0},sn.ontimeout=tn,sn.open(mn,dn,!hn,Xt.username,Xt.password),hn||(sn.withCredentials=!!Xt.withCredentials),!hn&&Xt.timeout>0&&(ln=setTimeout(function(){if(!an){an=!0,sn.abort("timeout");var _n=new Error("XMLHttpRequest timeout");_n.code="ETIMEDOUT",tn(_n)}},Xt.timeout)),sn.setRequestHeader)for(rn in un)un.hasOwnProperty(rn)&&sn.setRequestHeader(rn,un[rn]);else if(Xt.headers&&!function(_n){for(var Tn in _n)if(_n.hasOwnProperty(Tn))return!1;return!0}(Xt.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in Xt&&(sn.responseType=Xt.responseType),"beforeSend"in Xt&&typeof Xt.beforeSend=="function"&&Xt.beforeSend(sn),sn.send(gn||null),sn}_e.exports=qt,_e.exports.default=qt,qt.XMLHttpRequest=Nt.XMLHttpRequest||function(){},qt.XDomainRequest="withCredentials"in new qt.XMLHttpRequest?qt.XMLHttpRequest:Nt.XDomainRequest,function(Xt,Zt){for(var Qt=0;Qt{_e.exports=self.DOMParser!==void 0?function(Pt){return new self.DOMParser().parseFromString(Pt,"application/xml")}:self.ActiveXObject!==void 0&&new self.ActiveXObject("Microsoft.XMLDOM")?function(Pt){var Dt=new self.ActiveXObject("Microsoft.XMLDOM");return Dt.async="false",Dt.loadXML(Pt),Dt}:function(Pt){var Dt=document.createElement("div");return Dt.innerHTML=Pt,Dt}},1960:_e=>{_e.exports=function(){for(var Dt={},Nt=0;Nt{},6777:()=>{},5546:()=>{},2460:(_e,Pt,Dt)=>{var Nt=Dt(4406),jt=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Gt=Object.getOwnPropertyNames,Wt=Object.prototype.hasOwnProperty,qt=(Mn,dr)=>{for(var br in dr)jt(Mn,br,{get:dr[br],enumerable:!0})},Yt=(Mn=>(dr,br)=>Mn&&Mn.get(dr)||(br=((Ir,Nr,Yr,zr)=>{if(Nr&&typeof Nr=="object"||typeof Nr=="function")for(let _i of Gt(Nr))Wt.call(Ir,_i)||jt(Ir,_i,{get:()=>Nr[_i],enumerable:!(zr=Ut(Nr,_i))||zr.enumerable});return Ir})(jt({},"__esModule",{value:!0}),dr),Mn&&Mn.set(dr,br),br))(typeof WeakMap<"u"?new WeakMap:0),Xt=(Mn,dr,br)=>(((Ir,Nr,Yr)=>{Nr in Ir?jt(Ir,Nr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):Ir[Nr]=Yr})(Mn,typeof dr!="symbol"?dr+"":dr,br),br),Zt={};qt(Zt,{applyPalette:()=>wu,applyPaletteSync:()=>Ml,buildPalette:()=>_u,buildPaletteSync:()=>bs,constants:()=>Qt,conversion:()=>an,distance:()=>Rn,image:()=>xa,palette:()=>hr,quality:()=>$a,utils:()=>ir});var Qt={};qt(Qt,{bt709:()=>en});var en={};qt(en,{Y:()=>tn,x:()=>nn,y:()=>rn});var tn=(Mn=>(Mn[Mn.RED=.2126]="RED",Mn[Mn.GREEN=.7152]="GREEN",Mn[Mn.BLUE=.0722]="BLUE",Mn[Mn.WHITE=1]="WHITE",Mn))(tn||{}),nn=(Mn=>(Mn[Mn.RED=.64]="RED",Mn[Mn.GREEN=.3]="GREEN",Mn[Mn.BLUE=.15]="BLUE",Mn[Mn.WHITE=.3127]="WHITE",Mn))(nn||{}),rn=(Mn=>(Mn[Mn.RED=.33]="RED",Mn[Mn.GREEN=.6]="GREEN",Mn[Mn.BLUE=.06]="BLUE",Mn[Mn.WHITE=.329]="WHITE",Mn))(rn||{}),an={};function sn(Mn){return Mn>.04045?((Mn+.055)/1.055)**2.4:Mn/12.92}function ln(Mn,dr,br){return{x:.4124*(Mn=sn(Mn/255))+.3576*(dr=sn(dr/255))+.1805*(br=sn(br/255)),y:.2126*Mn+.7152*dr+.0722*br,z:.0193*Mn+.1192*dr+.9505*br}}qt(an,{lab2rgb:()=>Sn,lab2xyz:()=>Zn,rgb2hsl:()=>Tn,rgb2lab:()=>Pn,rgb2xyz:()=>ln,xyz2lab:()=>Dn,xyz2rgb:()=>ar});var dn={};function mn(Mn){return Mn*(Math.PI/180)}function gn(Mn,dr,br){let Ir=Mn;return Irdr&&(Ir=dr),Ir>br&&(Ir=br),Ir}function hn(Mn,dr,br){return Mn>br&&(Mn=br),Mn255?Mn=255:Mn<0&&(Mn=0),Mn}function En(Mn){return Mn>255?Mn=255:Mn<0&&(Mn=0),Mn}function _n(Mn,dr){const br=typeof Mn[0];let Ir;if(br==="number"||br==="string"){const Nr=Object.create(null);for(let Yr=0,zr=Mn.length;Yrdr(Yr,zr)||Nr[Yr]-Nr[zr])}else{const Nr=Mn.slice(0);Ir=Mn.sort((Yr,zr)=>dr(Yr,zr)||Nr.indexOf(Yr)-Nr.indexOf(zr))}return Ir}function Tn(Mn,dr,br){const Ir=un(Mn,dr,br),Nr=gn(Mn,dr,br),Yr=Nr-Ir,zr=(Ir+Nr)/510;let _i=0;zr>0&&zr<1&&(_i=Yr/(zr<.5?Nr+Ir:510-Nr-Ir));let qr=0;return Yr>0&&(qr=Nr===Mn?(dr-br)/Yr:Nr===dr?2+(br-Mn)/Yr:4+(Mn-dr)/Yr,qr*=60,qr<0&&(qr+=360)),{h:qr,s:_i,l:zr}}qt(dn,{degrees2radians:()=>mn,inRange0to255:()=>En,inRange0to255Rounded:()=>bn,intInRange:()=>hn,max3:()=>gn,min3:()=>un,stableSort:()=>_n});var $n=.95047,pn=1,Nn=1.08883;function An(Mn){return Mn>.008856?Mn**.3333333333333333:7.787*Mn+.13793103448275862}function Dn(Mn,dr,br){if(Mn=An(Mn/$n),dr=An(dr/pn),br=An(br/Nn),116*dr-16<0)throw new Error("xxx");return{L:Math.max(0,116*dr-16),a:500*(Mn-dr),b:200*(dr-br)}}function Pn(Mn,dr,br){const Ir=ln(Mn,dr,br);return Dn(Ir.x,Ir.y,Ir.z)}var Cn=.95047,Gn=1,In=1.08883;function Bn(Mn){return Mn>.206893034?Mn**3:(Mn-.13793103448275862)/7.787}function Zn(Mn,dr,br){const Ir=(Mn+16)/116,Nr=Ir-br/200;return{x:Cn*Bn(dr/500+Ir),y:Gn*Bn(Ir),z:In*Bn(Nr)}}function nr(Mn){return Mn>.0031308?1.055*Mn**.4166666666666667-.055:12.92*Mn}function ar(Mn,dr,br){const Ir=nr(3.2406*Mn+-1.5372*dr+-.4986*br),Nr=nr(-.9689*Mn+1.8758*dr+.0415*br),Yr=nr(.0557*Mn+-.204*dr+1.057*br);return{r:bn(255*Ir),g:bn(255*Nr),b:bn(255*Yr)}}function Sn(Mn,dr,br){const Ir=Zn(Mn,dr,br);return ar(Ir.x,Ir.y,Ir.z)}var Rn={};qt(Rn,{AbstractDistanceCalculator:()=>On,AbstractEuclidean:()=>kn,AbstractManhattan:()=>gr,CIE94GraphicArts:()=>vn,CIE94Textiles:()=>yn,CIEDE2000:()=>Un,CMetric:()=>Kn,Euclidean:()=>tr,EuclideanBT709:()=>or,EuclideanBT709NoAlpha:()=>Jn,Manhattan:()=>Er,ManhattanBT709:()=>Rr,ManhattanNommyde:()=>Sr,PNGQuant:()=>sr});var On=class{constructor(){Xt(this,"_maxDistance"),Xt(this,"_whitePoint"),this._setDefaults(),this.setWhitePoint(255,255,255,255)}setWhitePoint(Mn,dr,br,Ir){this._whitePoint={r:Mn>0?255/Mn:0,g:dr>0?255/dr:0,b:br>0?255/br:0,a:Ir>0?255/Ir:0},this._maxDistance=this.calculateRaw(Mn,dr,br,Ir,0,0,0,0)}calculateNormalized(Mn,dr){return this.calculateRaw(Mn.r,Mn.g,Mn.b,Mn.a,dr.r,dr.g,dr.b,dr.a)/this._maxDistance}},Vn=class extends On{calculateRaw(Mn,dr,br,Ir,Nr,Yr,zr,_i){const qr=Pn(En(Mn*this._whitePoint.r),En(dr*this._whitePoint.g),En(br*this._whitePoint.b)),so=Pn(En(Nr*this._whitePoint.r),En(Yr*this._whitePoint.g),En(zr*this._whitePoint.b)),eo=qr.L-so.L,io=qr.a-so.a,yo=qr.b-so.b,Bo=Math.sqrt(qr.a*qr.a+qr.b*qr.b),Mo=Bo-Math.sqrt(so.a*so.a+so.b*so.b);let xo=io*io+yo*yo-Mo*Mo;xo=xo<0?0:Math.sqrt(xo);const wo=(_i-Ir)*this._whitePoint.a*this._kA;return Math.sqrt((eo/this._Kl)**2+(Mo/(1+this._K1*Bo))**2+(xo/(1+this._K2*Bo))**2+wo**2)}},yn=class extends Vn{_setDefaults(){this._Kl=2,this._K1=.048,this._K2=.014,this._kA=12.5/255}},vn=class extends Vn{_setDefaults(){this._Kl=1,this._K1=.045,this._K2=.015,this._kA=25/255}},wn=class extends On{_setDefaults(){}static _calculatehp(Mn,dr){const br=Math.atan2(Mn,dr);return br>=0?br:br+wn._deg360InRad}static _calculateRT(Mn,dr){const br=dr**7,Ir=2*Math.sqrt(br/(br+wn._pow25to7)),Nr=wn._deg30InRad*Math.exp(-(((Mn-wn._deg275InRad)/wn._deg25InRad)**2));return-Math.sin(2*Nr)*Ir}static _calculateT(Mn){return 1-.17*Math.cos(Mn-wn._deg30InRad)+.24*Math.cos(2*Mn)+.32*Math.cos(3*Mn+wn._deg6InRad)-.2*Math.cos(4*Mn-wn._deg63InRad)}static _calculate_ahp(Mn,dr,br,Ir){const Nr=br+Ir;return Mn===0?Nr:dr<=wn._deg180InRad?Nr/2:Nr>8)+4*eo*eo+((767-qr)*io*io>>8),Bo=(_i-Ir)*this._whitePoint.a;return Math.sqrt(yo+Bo*Bo)}_setDefaults(){}},kn=class extends On{calculateRaw(Mn,dr,br,Ir,Nr,Yr,zr,_i){const qr=Nr-Mn,so=Yr-dr,eo=zr-br,io=_i-Ir;return Math.sqrt(this._kR*qr*qr+this._kG*so*so+this._kB*eo*eo+this._kA*io*io)}},tr=class extends kn{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},or=class extends kn{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},Jn=class extends kn{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=0}},gr=class extends On{calculateRaw(Mn,dr,br,Ir,Nr,Yr,zr,_i){let qr=Nr-Mn,so=Yr-dr,eo=zr-br,io=_i-Ir;return qr<0&&(qr=0-qr),so<0&&(so=0-so),eo<0&&(eo=0-eo),io<0&&(io=0-io),this._kR*qr+this._kG*so+this._kB*eo+this._kA*io}},Er=class extends gr{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},Sr=class extends gr{_setDefaults(){this._kR=.4984,this._kG=.8625,this._kB=.2979,this._kA=1}},Rr=class extends gr{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},sr=class extends On{calculateRaw(Mn,dr,br,Ir,Nr,Yr,zr,_i){const qr=(_i-Ir)*this._whitePoint.a;return this._colordifferenceCh(Mn*this._whitePoint.r,Nr*this._whitePoint.r,qr)+this._colordifferenceCh(dr*this._whitePoint.g,Yr*this._whitePoint.g,qr)+this._colordifferenceCh(br*this._whitePoint.b,zr*this._whitePoint.b,qr)}_colordifferenceCh(Mn,dr,br){const Ir=Mn-dr,Nr=Ir+br;return Ir*Ir+Nr*Nr}_setDefaults(){}},hr={};qt(hr,{AbstractPaletteQuantizer:()=>Tr,ColorHistogram:()=>no,NeuQuant:()=>ur,NeuQuantFloat:()=>to,RGBQuant:()=>Lr,WuColorCube:()=>Ao,WuQuant:()=>qo});var Tr=class{quantizeSync(){for(const Mn of this.quantize())if(Mn.palette)return Mn.palette;throw new Error("unreachable")}},Mr=class{constructor(){Xt(this,"r"),Xt(this,"g"),Xt(this,"b"),Xt(this,"a"),Xt(this,"uint32"),Xt(this,"rgba"),this.uint32=-1>>>0,this.r=this.g=this.b=this.a=0,this.rgba=new Array(4),this.rgba[0]=0,this.rgba[1]=0,this.rgba[2]=0,this.rgba[3]=0}static createByQuadruplet(Mn){const dr=new Mr;return dr.r=0|Mn[0],dr.g=0|Mn[1],dr.b=0|Mn[2],dr.a=0|Mn[3],dr._loadUINT32(),dr._loadQuadruplet(),dr}static createByRGBA(Mn,dr,br,Ir){const Nr=new Mr;return Nr.r=0|Mn,Nr.g=0|dr,Nr.b=0|br,Nr.a=0|Ir,Nr._loadUINT32(),Nr._loadQuadruplet(),Nr}static createByUint32(Mn){const dr=new Mr;return dr.uint32=Mn>>>0,dr._loadRGBA(),dr._loadQuadruplet(),dr}from(Mn){this.r=Mn.r,this.g=Mn.g,this.b=Mn.b,this.a=Mn.a,this.uint32=Mn.uint32,this.rgba[0]=Mn.r,this.rgba[1]=Mn.g,this.rgba[2]=Mn.b,this.rgba[3]=Mn.a}getLuminosity(Mn){let dr=this.r,br=this.g,Ir=this.b;return Mn&&(dr=Math.min(255,255-this.a+this.a*dr/255),br=Math.min(255,255-this.a+this.a*br/255),Ir=Math.min(255,255-this.a+this.a*Ir/255)),.2126*dr+.7152*br+.0722*Ir}_loadUINT32(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0}_loadRGBA(){this.r=255&this.uint32,this.g=this.uint32>>>8&255,this.b=this.uint32>>>16&255,this.a=this.uint32>>>24&255}_loadQuadruplet(){this.rgba[0]=this.r,this.rgba[1]=this.g,this.rgba[2]=this.b,this.rgba[3]=this.a}},qn=class{constructor(){Xt(this,"_pointArray"),Xt(this,"_width"),Xt(this,"_height"),this._width=0,this._height=0,this._pointArray=[]}getWidth(){return this._width}getHeight(){return this._height}setWidth(Mn){this._width=Mn}setHeight(Mn){this._height=Mn}getPointArray(){return this._pointArray}clone(){const Mn=new qn;Mn._width=this._width,Mn._height=this._height;for(let dr=0,br=this._pointArray.length;dr=Nr&&Mn=0;dr--)if(Mn.uint32===this._pointArray[dr].uint32)return!0;return!1}getNearestColor(Mn,dr){return this._pointArray[0|this._getNearestIndex(Mn,dr)]}getPointContainer(){return this._pointContainer}_nearestPointFromCache(Mn){return typeof this._i32idx[Mn]=="number"?this._i32idx[Mn]:-1}_getNearestIndex(Mn,dr){let br=this._nearestPointFromCache(""+dr.uint32);if(br>=0)return br;let Ir=Number.MAX_VALUE;br=0;for(let Nr=0,Yr=this._pointArray.length;Nr{const br=Tn(Mn.r,Mn.g,Mn.b),Ir=Tn(dr.r,dr.g,dr.b),Nr=Mn.r===Mn.g&&Mn.g===Mn.b?0:1+Ln(br.h,10),Yr=(dr.r===dr.g&&dr.g===dr.b?0:1+Ln(Ir.h,10))-Nr;if(Yr)return-Yr;const zr=Mn.getLuminosity(!0),_i=dr.getLuminosity(!0);if(_i-zr!=0)return _i-zr;const qr=(100*Ir.s|0)-(100*br.s|0);return qr?-qr:0})}},ir={};qt(ir,{HueStatistics:()=>kr,Palette:()=>jn,Point:()=>Mr,PointContainer:()=>qn,ProgressTracker:()=>Wn,arithmetic:()=>dn});var mr=class{constructor(){Xt(this,"num",0),Xt(this,"cols",[])}},kr=class{constructor(Mn,dr){Xt(this,"_numGroups"),Xt(this,"_minCols"),Xt(this,"_stats"),Xt(this,"_groupsFull"),this._numGroups=Mn,this._minCols=dr,this._stats=[];for(let br=0;br<=Mn;br++)this._stats[br]=new mr;this._groupsFull=0}check(Mn){this._groupsFull===this._numGroups+1&&(this.check=()=>{});const dr=255&Mn,br=Mn>>>8&255,Ir=Mn>>>16&255,Nr=dr===br&&br===Ir?0:1+Ln(Tn(dr,br,Ir).h,this._numGroups),Yr=this._stats[Nr],zr=this._minCols;Yr.num++,Yr.num>zr||(Yr.num===zr&&this._groupsFull++,Yr.num<=zr&&this._stats[Nr].cols.push(Mn))}injectIntoDictionary(Mn){for(let dr=0;dr<=this._numGroups;dr++)this._stats[dr].num<=this._minCols&&this._stats[dr].cols.forEach(br=>{Mn[br]?Mn[br]++:Mn[br]=1})}injectIntoArray(Mn){for(let dr=0;dr<=this._numGroups;dr++)this._stats[dr].num<=this._minCols&&this._stats[dr].cols.forEach(br=>{Mn.indexOf(br)===-1&&Mn.push(br)})}},Cr=class{constructor(Mn,dr){Xt(this,"progress"),Xt(this,"_step"),Xt(this,"_range"),Xt(this,"_last"),Xt(this,"_progressRange"),this._range=Mn,this._progressRange=dr,this._step=Math.max(1,this._range/(Cr.steps+1)|0),this._last=-this._step,this.progress=0}shouldNotify(Mn){return Mn-this._last>=this._step&&(this._last=Mn,this.progress=Math.min(this._progressRange*this._last/this._range,this._progressRange),!0)}},Wn=Cr;Xt(Wn,"steps",100);var vr=class{constructor(Mn){Xt(this,"r"),Xt(this,"g"),Xt(this,"b"),Xt(this,"a"),this.r=this.g=this.b=this.a=Mn}toPoint(){return Mr.createByRGBA(this.r>>3,this.g>>3,this.b>>3,this.a>>3)}subtract(Mn,dr,br,Ir){this.r-=0|Mn,this.g-=0|dr,this.b-=0|br,this.a-=0|Ir}},Xn=class extends Tr{constructor(Mn,dr=256){super(),Xt(this,"_pointArray"),Xt(this,"_networkSize"),Xt(this,"_network"),Xt(this,"_sampleFactor"),Xt(this,"_radPower"),Xt(this,"_freq"),Xt(this,"_bias"),Xt(this,"_distance"),this._distance=Mn,this._pointArray=[],this._sampleFactor=1,this._networkSize=dr,this._distance.setWhitePoint(2040,2040,2040,2040)}sample(Mn){this._pointArray=this._pointArray.concat(Mn.getPointArray())}*quantize(){this._init(),yield*this._learn(),yield{palette:this._buildPalette(),progress:100}}_init(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(let Mn=0;Mn>3)*Xn._radiusBias,qr=_i>>Xn._radiusBiasShift;qr<=1&&(qr=0);for(let eo=0;eo>>0;Nr=dr=dr&&(io-=dr),eo++,Yr===0&&(Yr=1),eo%Yr==0){zr-=zr/br|0,_i-=_i/Xn._radiusDecrease|0,qr=_i>>Xn._radiusBiasShift,qr<=1&&(qr=0);for(let rs=0;rs>>0}}}_buildPalette(){const Mn=new jn;return this._network.forEach(dr=>{Mn.add(dr.toPoint())}),Mn.sort(),Mn}_alterNeighbour(Mn,dr,br,Ir,Nr,Yr){let zr=dr-Mn;zr<-1&&(zr=-1);let _i=dr+Mn;_i>this._networkSize&&(_i=this._networkSize);let qr=dr+1,so=dr-1,eo=1;for(;qr<_i||so>zr;){const io=this._radPower[eo++]/Xn._alphaRadBias;if(qr<_i){const yo=this._network[qr++];yo.subtract(io*(yo.r-Nr),io*(yo.g-Ir),io*(yo.b-br),io*(yo.a-Yr))}if(so>zr){const yo=this._network[so--];yo.subtract(io*(yo.r-Nr),io*(yo.g-Ir),io*(yo.b-br),io*(yo.a-Yr))}}}_alterSingle(Mn,dr,br,Ir,Nr,Yr){Mn/=Xn._initAlpha;const zr=this._network[dr];zr.subtract(Mn*(zr.r-Nr),Mn*(zr.g-Ir),Mn*(zr.b-br),Mn*(zr.a-Yr))}_contest(Mn,dr,br,Ir){let Nr=2147483647,Yr=Nr,zr=-1,_i=zr;for(let qr=0;qr>Xn._initialBiasShift-3);io>Xn._betaShift;this._freq[qr]-=yo,this._bias[qr]+=yo<>Xn._betaShift),Xt(ur,"_betaGamma",Xn._initialBias<>3,this.g>>3,this.b>>3,this.a>>3)}subtract(Mn,dr,br,Ir){this.r-=Mn,this.g-=dr,this.b-=br,this.a-=Ir}},Or=class extends Tr{constructor(Mn,dr=256){super(),Xt(this,"_pointArray"),Xt(this,"_networkSize"),Xt(this,"_network"),Xt(this,"_sampleFactor"),Xt(this,"_radPower"),Xt(this,"_freq"),Xt(this,"_bias"),Xt(this,"_distance"),this._distance=Mn,this._pointArray=[],this._sampleFactor=1,this._networkSize=dr,this._distance.setWhitePoint(2040,2040,2040,2040)}sample(Mn){this._pointArray=this._pointArray.concat(Mn.getPointArray())}*quantize(){this._init(),yield*this._learn(),yield{palette:this._buildPalette(),progress:100}}_init(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(let Mn=0;Mn>3)*Or._radiusBias,qr=_i>>Or._radiusBiasShift;qr<=1&&(qr=0);for(let eo=0;eo=dr&&(io-=dr),eo++,Yr===0&&(Yr=1),eo%Yr==0){zr-=zr/br,_i-=_i/Or._radiusDecrease,qr=_i>>Or._radiusBiasShift,qr<=1&&(qr=0);for(let rs=0;rs{Mn.add(dr.toPoint())}),Mn.sort(),Mn}_alterNeighbour(Mn,dr,br,Ir,Nr,Yr){let zr=dr-Mn;zr<-1&&(zr=-1);let _i=dr+Mn;_i>this._networkSize&&(_i=this._networkSize);let qr=dr+1,so=dr-1,eo=1;for(;qr<_i||so>zr;){const io=this._radPower[eo++]/Or._alphaRadBias;if(qr<_i){const yo=this._network[qr++];yo.subtract(io*(yo.r-Nr),io*(yo.g-Ir),io*(yo.b-br),io*(yo.a-Yr))}if(so>zr){const yo=this._network[so--];yo.subtract(io*(yo.r-Nr),io*(yo.g-Ir),io*(yo.b-br),io*(yo.a-Yr))}}}_alterSingle(Mn,dr,br,Ir,Nr,Yr){Mn/=Or._initAlpha;const zr=this._network[dr];zr.subtract(Mn*(zr.r-Nr),Mn*(zr.g-Ir),Mn*(zr.b-br),Mn*(zr.a-Yr))}_contest(Mn,dr,br,Ir){let Nr=2147483647,Yr=Nr,zr=-1,_i=zr;for(let qr=0;qr>Or._initialBiasShift-3);io>Or._betaShift;this._freq[qr]-=yo,this._bias[qr]+=yo<>Or._betaShift),Xt(to,"_betaGamma",Or._initialBias<this._histogram[Ir]-this._histogram[br]);if(Mn.length===0)return[];let dr;switch(this._method){case 1:const br=Math.min(Mn.length,this._initColors),Ir=Mn[br-1],Nr=this._histogram[Ir];dr=Mn.slice(0,br);let Yr=br;const zr=Mn.length;for(;Yr+br)}_colorStats1D(Mn){const dr=this._histogram,br=Mn.getPointArray(),Ir=br.length;for(let Nr=0;Nr{let eo=Math.round(so.w*so.h/zr)*Gr._boxPixels;eo<2&&(eo=2);const io={};this._iterateBox(so,dr,yo=>{const Bo=Ir[yo].uint32;this._hueStats.check(Bo),Bo in qr?qr[Bo]++:Bo in io?++io[Bo]>=eo&&(qr[Bo]=io[Bo]):io[Bo]=1})}),this._hueStats.injectIntoDictionary(qr)}_iterateBox(Mn,dr,br){const Ir=Mn,Nr=Ir.y*dr+Ir.x,Yr=(Ir.y+Ir.h-1)*dr+(Ir.x+Ir.w-1),zr=dr-Ir.w+1;let _i=0,qr=Nr;do br.call(this,qr),qr+=++_i%Ir.w==0?zr:1;while(qr<=Yr)}_makeBoxes(Mn,dr,br,Ir){const Nr=Mn%br,Yr=dr%Ir,zr=Mn-Nr,_i=dr-Yr,qr=[];for(let so=0;sothis._colors;){Yr.length=0;for(let eo=0;eo3*this._colors?this._initialDistance:this._distanceIncrement}if(zryo.distance-io.distance);let eo=0;for(;zr=0;eo--)Ir[eo]===0&&(eo!==so-1&&(br[eo]=br[so-1]),--so);br.length=so,dr.sort(),yield{palette:dr,progress:100}}};function lo(Mn){const dr=[];for(let br=0;br0){const br=this._sums[dr],Ir=this._reds[dr]/br,Nr=this._greens[dr]/br,Yr=this._blues[dr]/br,zr=this._alphas[dr]/br,_i=Mr.createByRGBA(0|Ir,0|Nr,0|Yr,0|zr);Mn.add(_i)}Mn.sort(),yield{palette:Mn,progress:100}}*_preparePalette(){yield*this._calculateMoments();let Mn=0;const dr=lo(this._colors);for(let zr=1;zr1?this._calculateVariance(this._cubes[Mn]):0,dr[zr]=this._cubes[zr].volume>1?this._calculateVariance(this._cubes[zr]):0):(dr[Mn]=0,zr--),Mn=0;let _i=dr[0];for(let qr=1;qr<=zr;++qr)dr[qr]>_i&&(_i=dr[qr],Mn=qr);if(_i<=0){this._colors=zr+1;break}}const br=[],Ir=[],Nr=[],Yr=[];for(let zr=0;zr0?(br[zr]=ho._volume(this._cubes[zr],this._momentsRed)/_i|0,Ir[zr]=ho._volume(this._cubes[zr],this._momentsGreen)/_i|0,Nr[zr]=ho._volume(this._cubes[zr],this._momentsBlue)/_i|0,Yr[zr]=ho._volume(this._cubes[zr],this._momentsAlpha)/_i|0):(br[zr]=0,Ir[zr]=0,Nr[zr]=0,Yr[zr]=0)}this._reds=lo(this._colors+1),this._greens=lo(this._colors+1),this._blues=lo(this._colors+1),this._alphas=lo(this._colors+1),this._sums=lo(this._colors+1);for(let zr=0,_i=this._pixels.length;zr<_i;zr++){const qr=this._pixels[zr];let so=-1,eo=Number.MAX_VALUE;for(let io=0;io>dr),Ir=1+(Mn.g>>dr),Nr=1+(Mn.b>>dr),Yr=1+(Mn.a>>dr);this._weights[Yr][br][Ir][Nr]++,this._momentsRed[Yr][br][Ir][Nr]+=Mn.r,this._momentsGreen[Yr][br][Ir][Nr]+=Mn.g,this._momentsBlue[Yr][br][Ir][Nr]+=Mn.b,this._momentsAlpha[Yr][br][Ir][Nr]+=Mn.a,this._moments[Yr][br][Ir][Nr]+=this._table[Mn.r]+this._table[Mn.g]+this._table[Mn.b]+this._table[Mn.a]}*_calculateMoments(){const Mn=[],dr=[],br=[],Ir=[],Nr=[],Yr=[],zr=ao(this._sideSize,this._sideSize,this._sideSize),_i=ao(this._sideSize,this._sideSize,this._sideSize),qr=ao(this._sideSize,this._sideSize,this._sideSize),so=ao(this._sideSize,this._sideSize,this._sideSize),eo=ao(this._sideSize,this._sideSize,this._sideSize),io=ao(this._sideSize,this._sideSize,this._sideSize);let yo=0;const Bo=new Wn(this._alphaMaxSideIndex*this._maxSideIndex,99);for(let Mo=1;Mo<=this._alphaMaxSideIndex;++Mo){Ro(zr,this._sideSize,this._sideSize,this._sideSize,0),Ro(_i,this._sideSize,this._sideSize,this._sideSize,0),Ro(qr,this._sideSize,this._sideSize,this._sideSize,0),Ro(so,this._sideSize,this._sideSize,this._sideSize,0),Ro(eo,this._sideSize,this._sideSize,this._sideSize,0),Ro(io,this._sideSize,this._sideSize,this._sideSize,0);for(let xo=1;xo<=this._maxSideIndex;++xo,++yo){Bo.shouldNotify(yo)&&(yield{progress:Bo.progress}),Xo(Mn,this._sideSize,0),Xo(dr,this._sideSize,0),Xo(br,this._sideSize,0),Xo(Ir,this._sideSize,0),Xo(Nr,this._sideSize,0),Xo(Yr,this._sideSize,0);for(let wo=1;wo<=this._maxSideIndex;++wo){let os=0,rs=0,xs=0,fs=0,Ds=0,ms=0;for(let Po=1;Po<=this._maxSideIndex;++Po)os+=this._weights[Mo][xo][wo][Po],rs+=this._momentsRed[Mo][xo][wo][Po],xs+=this._momentsGreen[Mo][xo][wo][Po],fs+=this._momentsBlue[Mo][xo][wo][Po],Ds+=this._momentsAlpha[Mo][xo][wo][Po],ms+=this._moments[Mo][xo][wo][Po],Mn[Po]+=os,dr[Po]+=rs,br[Po]+=xs,Ir[Po]+=fs,Nr[Po]+=Ds,Yr[Po]+=ms,zr[xo][wo][Po]=zr[xo-1][wo][Po]+Mn[Po],_i[xo][wo][Po]=_i[xo-1][wo][Po]+dr[Po],qr[xo][wo][Po]=qr[xo-1][wo][Po]+br[Po],so[xo][wo][Po]=so[xo-1][wo][Po]+Ir[Po],eo[xo][wo][Po]=eo[xo-1][wo][Po]+Nr[Po],io[xo][wo][Po]=io[xo-1][wo][Po]+Yr[Po],this._weights[Mo][xo][wo][Po]=this._weights[Mo-1][xo][wo][Po]+zr[xo][wo][Po],this._momentsRed[Mo][xo][wo][Po]=this._momentsRed[Mo-1][xo][wo][Po]+_i[xo][wo][Po],this._momentsGreen[Mo][xo][wo][Po]=this._momentsGreen[Mo-1][xo][wo][Po]+qr[xo][wo][Po],this._momentsBlue[Mo][xo][wo][Po]=this._momentsBlue[Mo-1][xo][wo][Po]+so[xo][wo][Po],this._momentsAlpha[Mo][xo][wo][Po]=this._momentsAlpha[Mo-1][xo][wo][Po]+eo[xo][wo][Po],this._moments[Mo][xo][wo][Po]=this._moments[Mo-1][xo][wo][Po]+io[xo][wo][Po]}}}}static _volumeFloat(Mn,dr){return dr[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMaximum]-dr[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]-dr[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]+dr[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-dr[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMaximum]+dr[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]+dr[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]-dr[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(dr[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]-dr[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]-dr[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+dr[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]-dr[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]+dr[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]+dr[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]-dr[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum])}static _volume(Mn,dr){return 0|ho._volumeFloat(Mn,dr)}static _top(Mn,dr,br,Ir){let Nr;switch(dr){case ho._alpha:Nr=Ir[br][Mn.redMaximum][Mn.greenMaximum][Mn.blueMaximum]-Ir[br][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]-Ir[br][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]+Ir[br][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(Ir[br][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]-Ir[br][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]-Ir[br][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]+Ir[br][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);break;case ho._red:Nr=Ir[Mn.alphaMaximum][br][Mn.greenMaximum][Mn.blueMaximum]-Ir[Mn.alphaMaximum][br][Mn.greenMinimum][Mn.blueMaximum]-Ir[Mn.alphaMinimum][br][Mn.greenMaximum][Mn.blueMaximum]+Ir[Mn.alphaMinimum][br][Mn.greenMinimum][Mn.blueMaximum]-(Ir[Mn.alphaMaximum][br][Mn.greenMaximum][Mn.blueMinimum]-Ir[Mn.alphaMaximum][br][Mn.greenMinimum][Mn.blueMinimum]-Ir[Mn.alphaMinimum][br][Mn.greenMaximum][Mn.blueMinimum]+Ir[Mn.alphaMinimum][br][Mn.greenMinimum][Mn.blueMinimum]);break;case ho._green:Nr=Ir[Mn.alphaMaximum][Mn.redMaximum][br][Mn.blueMaximum]-Ir[Mn.alphaMaximum][Mn.redMinimum][br][Mn.blueMaximum]-Ir[Mn.alphaMinimum][Mn.redMaximum][br][Mn.blueMaximum]+Ir[Mn.alphaMinimum][Mn.redMinimum][br][Mn.blueMaximum]-(Ir[Mn.alphaMaximum][Mn.redMaximum][br][Mn.blueMinimum]-Ir[Mn.alphaMaximum][Mn.redMinimum][br][Mn.blueMinimum]-Ir[Mn.alphaMinimum][Mn.redMaximum][br][Mn.blueMinimum]+Ir[Mn.alphaMinimum][Mn.redMinimum][br][Mn.blueMinimum]);break;case ho._blue:Nr=Ir[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMaximum][br]-Ir[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][br]-Ir[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][br]+Ir[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][br]-(Ir[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][br]-Ir[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][br]-Ir[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][br]+Ir[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][br]);break;default:throw new Error("impossible")}return 0|Nr}static _bottom(Mn,dr,br){switch(dr){case ho._alpha:return-br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMaximum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(-br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);case ho._red:return-br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(-br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);case ho._green:return-br[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(-br[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);case ho._blue:return-br[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]+br[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]-br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]-(-br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);default:return 0}}_calculateVariance(Mn){const dr=ho._volume(Mn,this._momentsRed),br=ho._volume(Mn,this._momentsGreen),Ir=ho._volume(Mn,this._momentsBlue),Nr=ho._volume(Mn,this._momentsAlpha);return ho._volumeFloat(Mn,this._moments)-(dr*dr+br*br+Ir*Ir+Nr*Nr)/ho._volume(Mn,this._weights)}_maximize(Mn,dr,br,Ir,Nr,Yr,zr,_i,qr){const so=0|ho._bottom(Mn,dr,this._momentsRed),eo=0|ho._bottom(Mn,dr,this._momentsGreen),io=0|ho._bottom(Mn,dr,this._momentsBlue),yo=0|ho._bottom(Mn,dr,this._momentsAlpha),Bo=0|ho._bottom(Mn,dr,this._weights);let Mo=0,xo=-1;for(let wo=br;woMo&&(Mo=Po,xo=wo))}}return{max:Mo,position:xo}}_cut(Mn,dr){let br;const Ir=ho._volume(Mn,this._momentsRed),Nr=ho._volume(Mn,this._momentsGreen),Yr=ho._volume(Mn,this._momentsBlue),zr=ho._volume(Mn,this._momentsAlpha),_i=ho._volume(Mn,this._weights),qr=this._maximize(Mn,ho._red,Mn.redMinimum+1,Mn.redMaximum,Ir,Nr,Yr,zr,_i),so=this._maximize(Mn,ho._green,Mn.greenMinimum+1,Mn.greenMaximum,Ir,Nr,Yr,zr,_i),eo=this._maximize(Mn,ho._blue,Mn.blueMinimum+1,Mn.blueMaximum,Ir,Nr,Yr,zr,_i),io=this._maximize(Mn,ho._alpha,Mn.alphaMinimum+1,Mn.alphaMaximum,Ir,Nr,Yr,zr,_i);if(io.max>=qr.max&&io.max>=so.max&&io.max>=eo.max){if(br=ho._alpha,io.position<0)return!1}else br=qr.max>=io.max&&qr.max>=so.max&&qr.max>=eo.max?ho._red:so.max>=io.max&&so.max>=qr.max&&so.max>=eo.max?ho._green:ho._blue;switch(dr.redMaximum=Mn.redMaximum,dr.greenMaximum=Mn.greenMaximum,dr.blueMaximum=Mn.blueMaximum,dr.alphaMaximum=Mn.alphaMaximum,br){case ho._red:dr.redMinimum=Mn.redMaximum=qr.position,dr.greenMinimum=Mn.greenMinimum,dr.blueMinimum=Mn.blueMinimum,dr.alphaMinimum=Mn.alphaMinimum;break;case ho._green:dr.greenMinimum=Mn.greenMaximum=so.position,dr.redMinimum=Mn.redMinimum,dr.blueMinimum=Mn.blueMinimum,dr.alphaMinimum=Mn.alphaMinimum;break;case ho._blue:dr.blueMinimum=Mn.blueMaximum=eo.position,dr.redMinimum=Mn.redMinimum,dr.greenMinimum=Mn.greenMinimum,dr.alphaMinimum=Mn.alphaMinimum;break;case ho._alpha:dr.alphaMinimum=Mn.alphaMaximum=io.position,dr.blueMinimum=Mn.blueMinimum,dr.redMinimum=Mn.redMinimum,dr.greenMinimum=Mn.greenMinimum}return Mn.volume=(Mn.redMaximum-Mn.redMinimum)*(Mn.greenMaximum-Mn.greenMinimum)*(Mn.blueMaximum-Mn.blueMinimum)*(Mn.alphaMaximum-Mn.alphaMinimum),dr.volume=(dr.redMaximum-dr.redMinimum)*(dr.greenMaximum-dr.greenMinimum)*(dr.blueMaximum-dr.blueMinimum)*(dr.alphaMaximum-dr.alphaMinimum),!0}_initialize(Mn){this._colors=Mn,this._cubes=[];for(let dr=0;drJo,ErrorDiffusionArray:()=>Qo,ErrorDiffusionArrayKernel:()=>Ko,ErrorDiffusionRiemersma:()=>ss,NearestColor:()=>as});var Jo=class{quantizeSync(Mn,dr){for(const br of this.quantize(Mn,dr))if(br.pointContainer)return br.pointContainer;throw new Error("unreachable")}},as=class extends Jo{constructor(Mn){super(),Xt(this,"_distance"),this._distance=Mn}*quantize(Mn,dr){const br=Mn.getPointArray(),Ir=Mn.getWidth(),Nr=Mn.getHeight(),Yr=new Wn(Nr,99);for(let zr=0;zr(Mn[Mn.FloydSteinberg=0]="FloydSteinberg",Mn[Mn.FalseFloydSteinberg=1]="FalseFloydSteinberg",Mn[Mn.Stucki=2]="Stucki",Mn[Mn.Atkinson=3]="Atkinson",Mn[Mn.Jarvis=4]="Jarvis",Mn[Mn.Burkes=5]="Burkes",Mn[Mn.Sierra=6]="Sierra",Mn[Mn.TwoSierra=7]="TwoSierra",Mn[Mn.SierraLite=8]="SierraLite",Mn))(Ko||{}),Qo=class extends Jo{constructor(Mn,dr,br=!0,Ir=0,Nr=!1){super(),Xt(this,"_minColorDistance"),Xt(this,"_serpentine"),Xt(this,"_kernel"),Xt(this,"_calculateErrorLikeGIMP"),Xt(this,"_distance"),this._setKernel(dr),this._distance=Mn,this._minColorDistance=Ir,this._serpentine=br,this._calculateErrorLikeGIMP=Nr}*quantize(Mn,dr){const br=Mn.getPointArray(),Ir=new Mr,Nr=Mn.getWidth(),Yr=Mn.getHeight(),zr=[];let _i=1,qr=1;for(const eo of this._kernel){const io=eo[2]+1;qr=0&&vu+xo=0&&Gs+eodr&&(Mn.length=dr);const br=Mn.length;for(let Ir=0;Ir=0&&Mn.x=0&&Mn.y{const so=br[_i+qr*Ir];let{r:eo,g:io,b:yo,a:Bo}=so;for(let os=0;osSs});var vs=.01,ks=.03;function Ss(Mn,dr){if(Mn.getHeight()!==dr.getHeight()||Mn.getWidth()!==dr.getWidth())throw new Error("Images have different sizes!");const br=(255*vs)**2,Ir=(255*ks)**2;let Nr=0,Yr=0;return function(zr,_i,qr){const so=zr.getWidth(),eo=zr.getHeight();for(let io=0;io{let eo=0,io=0,yo=0;for(let Mo=0;MoNt.nextTick(Mn):Mn=>setTimeout(Mn,0);function bs(Mn,{colorDistanceFormula:dr,paletteQuantization:br,colors:Ir}={}){const Nr=Eu(na(dr),br,Ir);return Mn.forEach(Yr=>Nr.sample(Yr)),Nr.quantizeSync()}async function _u(Mn,{colorDistanceFormula:dr,paletteQuantization:br,colors:Ir,onProgress:Nr}={}){return new Promise((Yr,zr)=>{const _i=Eu(na(dr),br,Ir);let qr;Mn.forEach(io=>_i.sample(io));const so=_i.quantize(),eo=()=>{try{const io=so.next();io.done?Yr(qr):(io.value.palette&&(qr=io.value.palette),Nr&&Nr(io.value.progress),Fo(eo))}catch(io){zr(io)}};Fo(eo)})}function Ml(Mn,dr,{colorDistanceFormula:br,imageQuantization:Ir}={}){return yu(na(br),Ir).quantizeSync(Mn,dr)}async function wu(Mn,dr,{colorDistanceFormula:br,imageQuantization:Ir,onProgress:Nr}={}){return new Promise((Yr,zr)=>{let _i;const qr=yu(na(br),Ir).quantize(Mn,dr),so=()=>{try{const eo=qr.next();eo.done?Yr(_i):(eo.value.pointContainer&&(_i=eo.value.pointContainer),Nr&&Nr(eo.value.progress),Fo(so))}catch(eo){zr(eo)}};Fo(so)})}function na(Mn="euclidean-bt709"){switch(Mn){case"cie94-graphic-arts":return new vn;case"cie94-textiles":return new yn;case"ciede2000":return new Un;case"color-metric":return new Kn;case"euclidean":return new tr;case"euclidean-bt709":return new or;case"euclidean-bt709-noalpha":return new Jn;case"manhattan":return new Er;case"manhattan-bt709":return new Rr;case"manhattan-nommyde":return new Sr;case"pngquant":return new sr;default:throw new Error(`Unknown colorDistanceFormula ${Mn}`)}}function yu(Mn,dr="floyd-steinberg"){switch(dr){case"nearest":return new as(Mn);case"riemersma":return new ss(Mn);case"floyd-steinberg":return new Qo(Mn,0);case"false-floyd-steinberg":return new Qo(Mn,1);case"stucki":return new Qo(Mn,2);case"atkinson":return new Qo(Mn,3);case"jarvis":return new Qo(Mn,4);case"burkes":return new Qo(Mn,5);case"sierra":return new Qo(Mn,6);case"two-sierra":return new Qo(Mn,7);case"sierra-lite":return new Qo(Mn,8);default:throw new Error(`Unknown imageQuantization ${dr}`)}}function Eu(Mn,dr="wuquant",br=256){switch(dr){case"neuquant":return new ur(Mn,br);case"rgbquant":return new Lr(Mn,br);case"wuquant":return new qo(Mn,br);case"neuquant-float":return new to(Mn,br);default:throw new Error(`Unknown paletteQuantization ${dr}`)}}_e.exports=Yt(Zt)}},__webpack_module_cache__={};function __webpack_require__(_e){var Pt=__webpack_module_cache__[_e];if(Pt!==void 0)return Pt.exports;var Dt=__webpack_module_cache__[_e]={exports:{}};return __webpack_modules__[_e](Dt,Dt.exports,__webpack_require__),Dt.exports}__webpack_require__.n=_e=>{var Pt=_e&&_e.__esModule?()=>_e.default:()=>_e;return __webpack_require__.d(Pt,{a:Pt}),Pt},__webpack_require__.d=(_e,Pt)=>{for(var Dt in Pt)__webpack_require__.o(Pt,Dt)&&!__webpack_require__.o(_e,Dt)&&Object.defineProperty(_e,Dt,{enumerable:!0,get:Pt[Dt]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(_e,Pt)=>Object.prototype.hasOwnProperty.call(_e,Pt),__webpack_require__.r=_e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_e,"__esModule",{value:!0})},(()=>{var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{AUTO:()=>gr,BLEND_ADD:()=>jn,BLEND_DARKEN:()=>kr,BLEND_DESTINATION_OVER:()=>qn,BLEND_DIFFERENCE:()=>vr,BLEND_EXCLUSION:()=>Xn,BLEND_HARDLIGHT:()=>Wn,BLEND_LIGHTEN:()=>Cr,BLEND_MULTIPLY:()=>Ln,BLEND_OVERLAY:()=>mr,BLEND_SCREEN:()=>ir,BLEND_SOURCE_OVER:()=>Mr,EDGE_CROP:()=>Or,EDGE_EXTEND:()=>ur,EDGE_WRAP:()=>Wr,HORIZONTAL_ALIGN_CENTER:()=>Sr,HORIZONTAL_ALIGN_LEFT:()=>Er,HORIZONTAL_ALIGN_RIGHT:()=>Rr,VERTICAL_ALIGN_BOTTOM:()=>Tr,VERTICAL_ALIGN_MIDDLE:()=>hr,VERTICAL_ALIGN_TOP:()=>sr});var Pt={};__webpack_require__.r(Pt),__webpack_require__.d(Pt,{add:()=>Hr,darken:()=>uo,difference:()=>Xo,dstOver:()=>Gr,exclusion:()=>Ao,hardLight:()=>Ro,lighten:()=>ao,multiply:()=>no,overlay:()=>lo,screen:()=>Lr,srcOver:()=>to});var Dt=__webpack_require__(5546),Nt=__webpack_require__.n(Dt),jt=__webpack_require__(1023),Ut=__webpack_require__.n(jt),Gt=__webpack_require__(2699),Wt=__webpack_require__.n(Gt);function qt(Fn){if(Fn===void 0)return!1;if(typeof Fn!="function")throw new TypeError("Callback must be a function");return!0}function Yt(Fn,zn){if(typeof Fn=="string"&&(Fn=new Error(Fn)),typeof zn=="function")return zn.call(this,Fn);throw Fn}function Xt(Fn,zn,er,rr,lr,fr){zn=Math.round(zn),er=Math.round(er),rr=Math.round(rr),lr=Math.round(lr);for(let wr=er;wr1&&(ba-=1),ba<1/6?Vo+6*(es-Vo)*ba:ba<.5?es:ba<2/3?Vo+(es-Vo)*(2/3-ba)*6:Vo}if(Xr=Bn(Xr,360),Kr=Bn(Kr,100),Qr=Bn(Qr,100),Kr===0)fo=_o=jo=Qr;else{var Oo=Qr<.5?Qr*(1+Kr):Qr+Kr-Qr*Kr,Zo=2*Qr-Oo;fo=Yo(Zo,Oo,Xr+1/3),_o=Yo(Zo,Oo,Xr),jo=Yo(Zo,Oo,Xr-1/3)}return{r:255*fo,g:255*_o,b:255*jo}}(rr.h,Fr,Vr),co=!0,Jr="hsl"),rr.hasOwnProperty("a")&&($r=rr.a)),$r=In($r),{ok:co,format:rr.format||Jr,r:Math.min(255,Math.max(_r.r,0)),g:Math.min(255,Math.max(_r.g,0)),b:Math.min(255,Math.max(_r.b,0)),a:$r}}(Fn);this._originalInput=Fn,this._r=er.r,this._g=er.g,this._b=er.b,this._a=er.a,this._roundA=Math.round(100*this._a)/100,this._format=zn.format||er.format,this._gradientType=zn.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=er.ok}function ln(Fn,zn,er){Fn=Bn(Fn,255),zn=Bn(zn,255),er=Bn(er,255);var rr,lr,fr=Math.max(Fn,zn,er),wr=Math.min(Fn,zn,er),_r=(fr+wr)/2;if(fr==wr)rr=lr=0;else{var $r=fr-wr;switch(lr=_r>.5?$r/(2-fr-wr):$r/(fr+wr),fr){case Fn:rr=(zn-er)/$r+(zn>1)+720)%360;--zn;)rr.h=(rr.h+lr)%360,fr.push(sn(rr));return fr}function Pn(Fn,zn){zn=zn||6;for(var er=sn(Fn).toHsv(),rr=er.h,lr=er.s,fr=er.v,wr=[],_r=1/zn;zn--;)wr.push(sn({h:rr,s:lr,v:fr})),fr=(fr+_r)%1;return wr}sn.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var Fn=this.toRgb();return(299*Fn.r+587*Fn.g+114*Fn.b)/1e3},getLuminance:function(){var Fn,zn,er,rr=this.toRgb();return Fn=rr.r/255,zn=rr.g/255,er=rr.b/255,.2126*(Fn<=.03928?Fn/12.92:Math.pow((Fn+.055)/1.055,2.4))+.7152*(zn<=.03928?zn/12.92:Math.pow((zn+.055)/1.055,2.4))+.0722*(er<=.03928?er/12.92:Math.pow((er+.055)/1.055,2.4))},setAlpha:function(Fn){return this._a=In(Fn),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var Fn=dn(this._r,this._g,this._b);return{h:360*Fn.h,s:Fn.s,v:Fn.v,a:this._a}},toHsvString:function(){var Fn=dn(this._r,this._g,this._b),zn=Math.round(360*Fn.h),er=Math.round(100*Fn.s),rr=Math.round(100*Fn.v);return this._a==1?"hsv("+zn+", "+er+"%, "+rr+"%)":"hsva("+zn+", "+er+"%, "+rr+"%, "+this._roundA+")"},toHsl:function(){var Fn=ln(this._r,this._g,this._b);return{h:360*Fn.h,s:Fn.s,l:Fn.l,a:this._a}},toHslString:function(){var Fn=ln(this._r,this._g,this._b),zn=Math.round(360*Fn.h),er=Math.round(100*Fn.s),rr=Math.round(100*Fn.l);return this._a==1?"hsl("+zn+", "+er+"%, "+rr+"%)":"hsla("+zn+", "+er+"%, "+rr+"%, "+this._roundA+")"},toHex:function(Fn){return mn(this._r,this._g,this._b,Fn)},toHexString:function(Fn){return"#"+this.toHex(Fn)},toHex8:function(Fn){return function(zn,er,rr,lr,fr){var wr=[ar(Math.round(zn).toString(16)),ar(Math.round(er).toString(16)),ar(Math.round(rr).toString(16)),ar(Rn(lr))];return fr&&wr[0].charAt(0)==wr[0].charAt(1)&&wr[1].charAt(0)==wr[1].charAt(1)&&wr[2].charAt(0)==wr[2].charAt(1)&&wr[3].charAt(0)==wr[3].charAt(1)?wr[0].charAt(0)+wr[1].charAt(0)+wr[2].charAt(0)+wr[3].charAt(0):wr.join("")}(this._r,this._g,this._b,this._a,Fn)},toHex8String:function(Fn){return"#"+this.toHex8(Fn)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Bn(this._r,255))+"%",g:Math.round(100*Bn(this._g,255))+"%",b:Math.round(100*Bn(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(100*Bn(this._r,255))+"%, "+Math.round(100*Bn(this._g,255))+"%, "+Math.round(100*Bn(this._b,255))+"%)":"rgba("+Math.round(100*Bn(this._r,255))+"%, "+Math.round(100*Bn(this._g,255))+"%, "+Math.round(100*Bn(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(Gn[mn(this._r,this._g,this._b,!0)]||!1)},toFilter:function(Fn){var zn="#"+gn(this._r,this._g,this._b,this._a),er=zn,rr=this._gradientType?"GradientType = 1, ":"";if(Fn){var lr=sn(Fn);er="#"+gn(lr._r,lr._g,lr._b,lr._a)}return"progid:DXImageTransform.Microsoft.gradient("+rr+"startColorstr="+zn+",endColorstr="+er+")"},toString:function(Fn){var zn=!!Fn;Fn=Fn||this._format;var er=!1,rr=this._a<1&&this._a>=0;return zn||!rr||Fn!=="hex"&&Fn!=="hex6"&&Fn!=="hex3"&&Fn!=="hex4"&&Fn!=="hex8"&&Fn!=="name"?(Fn==="rgb"&&(er=this.toRgbString()),Fn==="prgb"&&(er=this.toPercentageRgbString()),Fn!=="hex"&&Fn!=="hex6"||(er=this.toHexString()),Fn==="hex3"&&(er=this.toHexString(!0)),Fn==="hex4"&&(er=this.toHex8String(!0)),Fn==="hex8"&&(er=this.toHex8String()),Fn==="name"&&(er=this.toName()),Fn==="hsl"&&(er=this.toHslString()),Fn==="hsv"&&(er=this.toHsvString()),er||this.toHexString()):Fn==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return sn(this.toString())},_applyModification:function(Fn,zn){var er=Fn.apply(null,[this].concat([].slice.call(zn)));return this._r=er._r,this._g=er._g,this._b=er._b,this.setAlpha(er._a),this},lighten:function(){return this._applyModification(En,arguments)},brighten:function(){return this._applyModification(_n,arguments)},darken:function(){return this._applyModification(Tn,arguments)},desaturate:function(){return this._applyModification(un,arguments)},saturate:function(){return this._applyModification(hn,arguments)},greyscale:function(){return this._applyModification(bn,arguments)},spin:function(){return this._applyModification($n,arguments)},_applyCombination:function(Fn,zn){return Fn.apply(null,[this].concat([].slice.call(zn)))},analogous:function(){return this._applyCombination(Dn,arguments)},complement:function(){return this._applyCombination(pn,arguments)},monochromatic:function(){return this._applyCombination(Pn,arguments)},splitcomplement:function(){return this._applyCombination(An,arguments)},triad:function(){return this._applyCombination(Nn,[3])},tetrad:function(){return this._applyCombination(Nn,[4])}},sn.fromRatio=function(Fn,zn){if(nn(Fn)=="object"){var er={};for(var rr in Fn)Fn.hasOwnProperty(rr)&&(er[rr]=rr==="a"?Fn[rr]:Sn(Fn[rr]));Fn=er}return sn(Fn,zn)},sn.equals=function(Fn,zn){return!(!Fn||!zn)&&sn(Fn).toRgbString()==sn(zn).toRgbString()},sn.random=function(){return sn.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},sn.mix=function(Fn,zn,er){er=er===0?0:er||50;var rr=sn(Fn).toRgb(),lr=sn(zn).toRgb(),fr=er/100;return sn({r:(lr.r-rr.r)*fr+rr.r,g:(lr.g-rr.g)*fr+rr.g,b:(lr.b-rr.b)*fr+rr.b,a:(lr.a-rr.a)*fr+rr.a})},sn.readability=function(Fn,zn){var er=sn(Fn),rr=sn(zn);return(Math.max(er.getLuminance(),rr.getLuminance())+.05)/(Math.min(er.getLuminance(),rr.getLuminance())+.05)},sn.isReadable=function(Fn,zn,er){var rr,lr,fr,wr,_r,$r=sn.readability(Fn,zn);switch(lr=!1,(fr=er,(wr=((fr=fr||{level:"AA",size:"small"}).level||"AA").toUpperCase())!=="AA"&&wr!=="AAA"&&(wr="AA"),(_r=(fr.size||"small").toLowerCase())!=="small"&&_r!=="large"&&(_r="small"),rr={level:wr,size:_r}).level+rr.size){case"AAsmall":case"AAAlarge":lr=$r>=4.5;break;case"AAlarge":lr=$r>=3;break;case"AAAsmall":lr=$r>=7}return lr},sn.mostReadable=function(Fn,zn,er){var rr,lr,fr,wr,_r=null,$r=0;lr=(er=er||{}).includeFallbackColors,fr=er.level,wr=er.size;for(var Fr=0;Fr$r&&($r=rr,_r=sn(zn[Fr]));return sn.isReadable(Fn,_r,{level:fr,size:wr})||!lr?_r:(er.includeFallbackColors=!1,sn.mostReadable(Fn,["#fff","#000"],er))};var Cn=sn.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Gn=sn.hexNames=function(Fn){var zn={};for(var er in Fn)Fn.hasOwnProperty(er)&&(zn[Fn[er]]=er);return zn}(Cn);function In(Fn){return Fn=parseFloat(Fn),(isNaN(Fn)||Fn<0||Fn>1)&&(Fn=1),Fn}function Bn(Fn,zn){(function(rr){return typeof rr=="string"&&rr.indexOf(".")!=-1&&parseFloat(rr)===1})(Fn)&&(Fn="100%");var er=function(rr){return typeof rr=="string"&&rr.indexOf("%")!=-1}(Fn);return Fn=Math.min(zn,Math.max(0,parseFloat(Fn))),er&&(Fn=parseInt(Fn*zn,10)/100),Math.abs(Fn-zn)<1e-6?1:Fn%zn/parseFloat(zn)}function Zn(Fn){return Math.min(1,Math.max(0,Fn))}function nr(Fn){return parseInt(Fn,16)}function ar(Fn){return Fn.length==1?"0"+Fn:""+Fn}function Sn(Fn){return Fn<=1&&(Fn=100*Fn+"%"),Fn}function Rn(Fn){return Math.round(255*parseFloat(Fn)).toString(16)}function On(Fn){return nr(Fn)/255}var Vn,yn,vn,wn=(yn="[\\s|\\(]+("+(Vn="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Vn+")[,|\\s]+("+Vn+")\\s*\\)?",vn="[\\s|\\(]+("+Vn+")[,|\\s]+("+Vn+")[,|\\s]+("+Vn+")[,|\\s]+("+Vn+")\\s*\\)?",{CSS_UNIT:new RegExp(Vn),rgb:new RegExp("rgb"+yn),rgba:new RegExp("rgba"+vn),hsl:new RegExp("hsl"+yn),hsla:new RegExp("hsla"+vn),hsv:new RegExp("hsv"+yn),hsva:new RegExp("hsva"+vn),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Un(Fn){return!!wn.CSS_UNIT.exec(Fn)}function Kn(Fn,zn){this.size=this.size||Fn,this.smallerSize=this.smallerSize||zn,function(er){for(let rr=1;rrlr?"1":"0";return fr};const tr=[],or=Kn;__webpack_require__(9307);const Jn=(Fn,zn)=>{let{url:er,...rr}=Fn;fetch(er,rr).then(lr=>{if(lr.ok)return lr.arrayBuffer().catch(fr=>{throw new Error(`Response is not a buffer for url ${er}. Error: ${fr.message}`)});throw new Error(`HTTP Status ${lr.status} for url ${er}`)}).then(lr=>zn(null,lr)).catch(lr=>zn(lr))},gr=-1,Er=1,Sr=2,Rr=4,sr=8,hr=16,Tr=32,Mr="srcOver",qn="dstOver",Ln="multiply",jn="add",ir="screen",mr="overlay",kr="darken",Cr="lighten",Wn="hardLight",vr="difference",Xn="exclusion",ur=1,Wr=2,Or=3;function to(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a;return{r:(Fn.r*Fn.a+zn.r*zn.a*(1-Fn.a))/rr,g:(Fn.g*Fn.a+zn.g*zn.a*(1-Fn.a))/rr,b:(Fn.b*Fn.a+zn.b*zn.a*(1-Fn.a))/rr,a:rr}}function Gr(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a;return{r:(zn.r*zn.a+Fn.r*Fn.a*(1-zn.a))/rr,g:(zn.g*zn.a+Fn.g*Fn.a*(1-zn.a))/rr,b:(zn.b*zn.a+Fn.b*Fn.a*(1-zn.a))/rr,a:rr}}function no(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(lr*_r+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(fr*$r+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}function Hr(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a;return{r:(lr+zn.r*zn.a)/rr,g:(fr+zn.g*zn.a)/rr,b:(wr+zn.b*zn.a)/rr,a:rr}}function Lr(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(lr*zn.a+_r*Fn.a-lr*_r+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(fr*zn.a+$r*Fn.a-fr*$r+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(wr*zn.a+Fr*Fn.a-wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}function lo(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(2*_r<=zn.a?2*lr*_r+lr*(1-zn.a)+_r*(1-Fn.a):lr*(1+zn.a)+_r*(1+Fn.a)-2*_r*lr-zn.a*Fn.a)/rr,g:(2*$r<=zn.a?2*fr*$r+fr*(1-zn.a)+$r*(1-Fn.a):fr*(1+zn.a)+$r*(1+Fn.a)-2*$r*fr-zn.a*Fn.a)/rr,b:(2*Fr<=zn.a?2*wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a):wr*(1+zn.a)+Fr*(1+Fn.a)-2*Fr*wr-zn.a*Fn.a)/rr,a:rr}}function uo(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(Math.min(lr*zn.a,_r*Fn.a)+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(Math.min(fr*zn.a,$r*Fn.a)+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(Math.min(wr*zn.a,Fr*Fn.a)+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}function ao(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(Math.max(lr*zn.a,_r*Fn.a)+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(Math.max(fr*zn.a,$r*Fn.a)+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(Math.max(wr*zn.a,Fr*Fn.a)+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}function Ro(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(2*lr<=Fn.a?2*lr*_r+lr*(1-zn.a)+_r*(1-Fn.a):lr*(1+zn.a)+_r*(1+Fn.a)-2*_r*lr-zn.a*Fn.a)/rr,g:(2*fr<=Fn.a?2*fr*$r+fr*(1-zn.a)+$r*(1-Fn.a):fr*(1+zn.a)+$r*(1+Fn.a)-2*$r*fr-zn.a*Fn.a)/rr,b:(2*wr<=Fn.a?2*wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a):wr*(1+zn.a)+Fr*(1+Fn.a)-2*Fr*wr-zn.a*Fn.a)/rr,a:rr}}function Xo(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(lr+_r-2*Math.min(lr*zn.a,_r*Fn.a))/rr,g:(fr+$r-2*Math.min(fr*zn.a,$r*Fn.a))/rr,b:(wr+Fr-2*Math.min(wr*zn.a,Fr*Fn.a))/rr,a:rr}}function Ao(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(lr*zn.a+_r*Fn.a-2*lr*_r+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(fr*zn.a+$r*Fn.a-2*fr*$r+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(wr*zn.a+Fr*Fn.a-2*wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}const ho=function(Fn,zn){for(var er=arguments.length,rr=new Array(er>2?er-2:0),lr=2;lr{rr.push((_r,$r)=>{_r&&wr(_r),fr($r)}),Fn.bind(zn)(...rr)})},qo={},xa=(Fn,zn)=>{qo[Fn]=zn},Jo=Fn=>{const zn=Fn.split("/").slice(-1);var er;return(er=zn[zn.length-1].split(".").pop(),Object.entries(qo).find(rr=>rr[1].includes(er))||[])[0]};var as=__webpack_require__(5025),Ko=__webpack_require__.n(as),Qo=__webpack_require__(6551),hs=__webpack_require__.n(Qo),Go=__webpack_require__(8834).lW;function Wo(Fn){return Fn._exif&&Fn._exif.tags&&Fn._exif.tags.Orientation||1}async function ss(Fn,zn,er){const rr=await async function(lr,fr){const wr=await Ko().fromBuffer(lr);return wr?wr.mime:fr?Jo(fr):null}(Fn,zn);if(typeof rr!="string")return er(new Error("Could not find MIME for Buffer <"+zn+">"));this._originalMime=rr.toLowerCase();try{const lr=this.getMIME();if(!this.constructor.decoders[lr])return Yt.call(this,"Unsupported MIME type: "+lr,er);this.bitmap=this.constructor.decoders[lr](Fn)}catch(lr){return er.call(this,lr,this)}try{this._exif=hs().create(Fn).parse(),function(lr){if(Wo(lr)<2)return;const fr=function(_r){const $r=_r.getWidth(),Fr=_r.getHeight();switch(Wo(_r)){case 1:default:return null;case 2:return function(jr,Vr){return[$r-jr-1,Vr]};case 3:return function(jr,Vr){return[$r-jr-1,Fr-Vr-1]};case 4:return function(jr,Vr){return[jr,Fr-Vr-1]};case 5:return function(jr,Vr){return[Vr,jr]};case 6:return function(jr,Vr){return[Vr,Fr-jr-1]};case 7:return function(jr,Vr){return[$r-Vr-1,Fr-jr-1]};case 8:return function(jr,Vr){return[$r-Vr-1,jr]}}}(lr),wr=Wo(lr)>4;(function(_r,$r,Fr,jr){const Vr=_r.bitmap.data,co=_r.bitmap.width,Jr=Go.alloc(Vr.length);for(let Xr=0;Xr<$r;Xr++)for(let Kr=0;Kr{zn.call(this,null,rr)}):zn.call(this,null,er)}return this}function vs(Fn){return ho($a,this,Fn)}var ks=__webpack_require__(8834).lW;function Ss(Fn,zn,er){return(zn=function(rr){var lr=function(fr,wr){if(typeof fr!="object"||fr===null)return fr;var _r=fr[Symbol.toPrimitive];if(_r!==void 0){var $r=_r.call(fr,"string");if(typeof $r!="object")return $r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fr)}(rr);return typeof lr=="symbol"?lr:String(lr)}(zn))in Fn?Object.defineProperty(Fn,zn,{value:er,enumerable:!0,configurable:!0,writable:!0}):Fn[zn]=er,Fn}const Is="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",Vl=[NaN,NaN];for(let Fn=2;Fn<65;Fn++){const zn=Qt()(Qt().BIN,Is.slice(0,Fn))(new Array(65).join("1"));Vl.push(zn.length)}function Fo(){}function bs(Fn){return Object.prototype.toString.call(Fn).toLowerCase().indexOf("arraybuffer")>-1}function _u(Fn){const zn=ks.alloc(Fn.byteLength),er=new Uint8Array(Fn);for(let rr=0;rrer?zn(er):typeof rr=="object"&&ks.isBuffer(rr)?zn(null,rr):typeof rr=="object"&&bs(rr)?zn(null,_u(rr)):new Error(`Could not load Buffer from <${Fn.url}>`))}const wu={data:null,width:null,height:null};class na extends Wt(){constructor(){for(var zn=arguments.length,er=new Array(zn),rr=0;rrho(this.write,this,$r)),Ss(this,"getBase64Async",$r=>ho(this.getBase64,this,$r)),Ss(this,"getBuffer",$a),Ss(this,"getBufferAsync",vs),Ss(this,"getPixelColour",this.getPixelColor),Ss(this,"setPixelColour",this.setPixelColor);const lr=this;let fr=Fo;function wr(){for(var $r=arguments.length,Fr=new Array($r),jr=0;jr<$r;jr++)Fr[jr]=arguments[jr];const[Vr]=Fr;(Vr||{}).methodName="constructor",setTimeout(()=>{Vr&&fr===Fo?lr.emitError("constructor",Vr):Vr||lr.emitMulti("constructor","initialized"),fr.call(lr,...Fr)},1)}if(bs(er[0])&&(er[0]=_u(er[0])),typeof er[0]=="number"&&typeof er[1]=="number"||parseInt(er[0],10)&&parseInt(er[1],10)){const $r=parseInt(er[0],10),Fr=parseInt(er[1],10);if(fr=er[2],typeof er[2]=="number"&&(this._background=er[2],fr=er[3]),typeof er[2]=="string"&&(this._background=na.cssColorToHex(er[2]),fr=er[3]),fr===void 0&&(fr=Fo),typeof fr!="function")return Yt.call(this,"cb must be a function",wr);this.bitmap={data:ks.alloc($r*Fr*4),width:$r,height:Fr};for(let jr=0;jr{if($r)return Yt.call(this,$r,wr);this.parseBitmap(Fr,er[0].url,wr)})}else if(er[0]instanceof na){const[$r]=er;if(fr=er[1],fr===void 0&&(fr=Fo),typeof fr!="function")return Yt.call(this,"cb must be a function",wr);this.bitmap={data:ks.from($r.bitmap.data),width:$r.bitmap.width,height:$r.bitmap.height},this._quality=$r._quality,this._deflateLevel=$r._deflateLevel,this._deflateStrategy=$r._deflateStrategy,this._filterType=$r._filterType,this._rgba=$r._rgba,this._background=$r._background,this._originalMime=$r._originalMime,wr(null,this)}else if((_r=er[0])&&typeof _r=="object"&&typeof _r.width=="number"&&typeof _r.height=="number"&&(ks.isBuffer(_r.data)||_r.data instanceof Uint8Array||typeof Uint8ClampedArray=="function"&&_r.data instanceof Uint8ClampedArray)&&(_r.data.length===_r.width*_r.height*4||_r.data.length===_r.width*_r.height*3)){const[$r]=er;fr=er[1]||Fo;const Fr=$r.width*$r.height*4===$r.data.length?ks.from($r.data):function(jr){if(jr.length%3!=0)throw new Error("Buffer length is incorrect");const Vr=ks.allocUnsafe(jr.length/3*4);let co=0;for(let Jr=0;Jr{if(Fr)return Yt.call(this,Fr,wr);this.parseBitmap(jr,$r,wr)})}else if(typeof er[0]=="object"&&ks.isBuffer(er[0])){const $r=er[0];if(fr=er[1],typeof fr!="function")return Yt.call(this,"cb must be a function",wr);this.parseBitmap($r,null,wr)}else{fr=er[er.length-1],typeof fr!="function"&&(fr=er[er.length-2],typeof fr!="function"&&(fr=Fo));const $r=na.__extraConstructors.find(Fr=>Fr.test(...er));if(!$r)return Yt.call(this,"No matching constructor overloading was found. Please see the docs for how to call the Jimp constructor.",wr);new Promise((Fr,jr)=>{$r.run.call(this,Fr,jr,...er)}).then(()=>wr(null,this)).catch(wr)}var _r}parseBitmap(zn,er,rr){ss.call(this,zn,null,rr)}rgba(zn,er){return typeof zn!="boolean"?Yt.call(this,"bool must be a boolean, true for RGBA or false for RGB",er):(this._rgba=zn,qt(er)&&er.call(this,null,this),this)}emitMulti(zn,er){let rr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};rr=Object.assign(rr,{methodName:zn,eventName:er}),this.emit("any",rr),zn&&this.emit(zn,rr),this.emit(er,rr)}emitError(zn,er){this.emitMulti(zn,"error",er)}getHeight(){return this.bitmap.height}getWidth(){return this.bitmap.width}inspect(){return""}toString(){return"[object Jimp]"}getMIME(){return this._originalMime||na.MIME_PNG}getExtension(){const zn=this.getMIME();return(qo[zn.toLowerCase()]||[])[0]}write(zn,er){if(!Nt()||!Nt().createWriteStream)throw new Error("Cant access the filesystem. You can use the getBase64 method.");if(typeof zn!="string")return Yt.call(this,"path must be a string",er);if(er===void 0&&(er=Fo),typeof er!="function")return Yt.call(this,"cb must be a function",er);const rr=Jo(zn)||this.getMIME(),lr=Ut().parse(zn);return lr.dir&&Nt().mkdirSync(lr.dir,{recursive:!0}),this.getBuffer(rr,(fr,wr)=>{if(fr)return Yt.call(this,fr,er);const _r=Nt().createWriteStream(zn);_r.on("open",()=>{_r.write(wr),_r.end()}).on("error",$r=>Yt.call(this,$r,er)),_r.on("finish",()=>{er.call(this,null,this)})}),this}getBase64(zn,er){return zn===na.AUTO&&(zn=this.getMIME()),typeof zn!="string"?Yt.call(this,"mime must be a string",er):typeof er!="function"?Yt.call(this,"cb must be a function",er):(this.getBuffer(zn,function(rr,lr){if(rr)return Yt.call(this,rr,er);const fr="data:"+zn+";base64,"+lr.toString("base64");er.call(this,null,fr)}),this)}hash(zn,er){if(typeof(zn=zn||64)=="function"&&(er=zn,zn=64),typeof zn!="number")return Yt.call(this,"base must be a number",er);if(zn<2||zn>64)return Yt.call(this,"base must be a number between 2 and 64",er);let rr=this.pHash();for(rr=Qt()(Qt().BIN,Is.slice(0,zn))(rr);rr.length=this.bitmap.width&&(fr=this.bitmap.width-1),er<0&&(wr=0),er>=this.bitmap.height&&(wr=this.bitmap.height-1)),rr===na.EDGE_WRAP&&(zn<0&&(fr=this.bitmap.width+zn),zn>=this.bitmap.width&&(fr=zn%this.bitmap.width),er<0&&(wr=this.bitmap.height+er),er>=this.bitmap.height&&(wr=er%this.bitmap.height));let _r=this.bitmap.width*wr+fr<<2;return(fr<0||fr>=this.bitmap.width)&&(_r=-1),(wr<0||wr>=this.bitmap.height)&&(_r=-1),qt(lr)&&lr.call(this,null,_r),_r}getPixelColor(zn,er,rr){if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",rr);zn=Math.round(zn),er=Math.round(er);const lr=this.getPixelIndex(zn,er),fr=this.bitmap.data.readUInt32BE(lr);return qt(rr)&&rr.call(this,null,fr),fr}setPixelColor(zn,er,rr,lr){if(typeof zn!="number"||typeof er!="number"||typeof rr!="number")return Yt.call(this,"hex, x and y must be numbers",lr);er=Math.round(er),rr=Math.round(rr);const fr=this.getPixelIndex(er,rr);return this.bitmap.data.writeUInt32BE(zn,fr),qt(lr)&&lr.call(this,null,this),this}hasAlpha(){for(let zn=0;zn1&&arguments[1]!==void 0?arguments[1]:na;Object.entries(Fn).forEach(er=>{let[rr,lr]=er;zn[rr]=lr})}function Eu(Fn){let zn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:na;Object.entries(Fn).forEach(er=>{let[rr,lr]=er;zn.prototype[rr]=lr})}function Mn(Fn,zn,er){const rr="before-"+zn,lr=zn.replace(/e$/,"")+"ed";na.prototype[Fn]=function(){let fr;for(var wr=arguments.length,_r=new Array(wr),$r=0;$r3&&arguments[3]!==void 0?arguments[3]:{},lr=arguments.length>4?arguments[4]:void 0;if(typeof rr=="function"&&(lr=rr,rr={}),!(Fn instanceof this.constructor))return Yt.call(this,"The source must be a Jimp image",lr);if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",lr);let{mode:fr,opacitySource:wr,opacityDest:_r}=rr;fr||(fr=Mr),(typeof wr!="number"||wr<0||wr>1)&&(wr=1),(typeof _r!="number"||_r<0||_r>1)&&(_r=1);const $r=Pt[fr];zn=Math.round(zn),er=Math.round(er);const Fr=this;return _r!==1&&Fr.opacity(_r),Fn.scanQuiet(0,0,Fn.bitmap.width,Fn.bitmap.height,function(jr,Vr,co){const Jr=Fr.getPixelIndex(zn+jr,er+Vr,Or);if(Jr===-1)return;const Xr=$r({r:this.bitmap.data[co+0]/255,g:this.bitmap.data[co+1]/255,b:this.bitmap.data[co+2]/255,a:this.bitmap.data[co+3]/255},{r:Fr.bitmap.data[Jr+0]/255,g:Fr.bitmap.data[Jr+1]/255,b:Fr.bitmap.data[Jr+2]/255,a:Fr.bitmap.data[Jr+3]/255},wr);Fr.bitmap.data[Jr+0]=this.constructor.limit255(255*Xr.r),Fr.bitmap.data[Jr+1]=this.constructor.limit255(255*Xr.g),Fr.bitmap.data[Jr+2]=this.constructor.limit255(255*Xr.b),Fr.bitmap.data[Jr+3]=this.constructor.limit255(255*Xr.a)}),qt(lr)&&lr.call(this,null,this),this}}),na.__extraConstructors=[],na.appendConstructorOption=function(Fn,zn,er){na.__extraConstructors.push({name:Fn,test:zn,run:er})},na.read=function(){for(var Fn=arguments.length,zn=new Array(Fn),er=0;er{new na(...zn,(fr,wr)=>{fr?lr(fr):rr(wr)})})},na.create=na.read,na.rgbaToInt=function(Fn,zn,er,rr,lr){if(typeof Fn!="number"||typeof zn!="number"||typeof er!="number"||typeof rr!="number")return Yt.call(this,"r, g, b and a must be numbers",lr);if(Fn<0||Fn>255)return Yt.call(this,"r must be between 0 and 255",lr);if((zn<0||zn>255)&&Yt.call(this,"g must be between 0 and 255",lr),er<0||er>255)return Yt.call(this,"b must be between 0 and 255",lr);if(rr<0||rr>255)return Yt.call(this,"a must be between 0 and 255",lr);Fn=Math.round(Fn),er=Math.round(er),zn=Math.round(zn),rr=Math.round(rr);const fr=Fn*Math.pow(256,3)+zn*Math.pow(256,2)+er*Math.pow(256,1)+rr*Math.pow(256,0);return qt(lr)&&lr.call(this,null,fr),fr},na.intToRGBA=function(Fn,zn){if(typeof Fn!="number")return Yt.call(this,"i must be a number",zn);const er={};return er.r=Math.floor(Fn/Math.pow(256,3)),er.g=Math.floor((Fn-er.r*Math.pow(256,3))/Math.pow(256,2)),er.b=Math.floor((Fn-er.r*Math.pow(256,3)-er.g*Math.pow(256,2))/Math.pow(256,1)),er.a=Math.floor((Fn-er.r*Math.pow(256,3)-er.g*Math.pow(256,2)-er.b*Math.pow(256,1))/Math.pow(256,0)),qt(zn)&&zn.call(this,null,er),er},na.cssColorToHex=function(Fn){return typeof(Fn=Fn||0)=="number"?Number(Fn):parseInt(sn(Fn).toHex8(),16)},na.limit255=function(Fn){return Fn=Math.max(Fn,0),Math.min(Fn,255)},na.diff=function(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:.1;if(!(Fn instanceof na&&zn instanceof na))return Yt.call(this,"img1 and img2 must be an Jimp images");const rr=Fn.bitmap,lr=zn.bitmap;if(rr.width===lr.width&&rr.height===lr.height||(rr.width*rr.height>lr.width*lr.height?Fn=Fn.cloneQuiet().resize(lr.width,lr.height):zn=zn.cloneQuiet().resize(rr.width,rr.height)),typeof er!="number"||er<0||er>1)return Yt.call(this,"threshold must be a number between 0 and 1");const fr=new na(rr.width,rr.height,4294967295);return{percent:tn()(rr.data,lr.data,fr.bitmap.data,fr.bitmap.width,fr.bitmap.height,{threshold:er})/(fr.bitmap.width*fr.bitmap.height),image:fr}},na.distance=function(Fn,zn){const er=new or,rr=er.getHash(Fn),lr=er.getHash(zn);return er.distance(rr,lr)},na.compareHashes=function(Fn,zn){return new or().distance(Fn,zn)},na.colorDiff=function(Fn,zn){const er=lr=>Math.pow(lr,2),{max:rr}=Math;return Fn.a===0||Fn.a||(Fn.a=255),zn.a===0||zn.a||(zn.a=255),(rr(er(Fn.r-zn.r),er(Fn.r-zn.r-Fn.a+zn.a))+rr(er(Fn.g-zn.g),er(Fn.g-zn.g-Fn.a+zn.a))+rr(er(Fn.b-zn.b),er(Fn.b-zn.b-Fn.a+zn.a)))/195075},Mn("clone","clone",function(Fn){const zn=new na(this);return qt(Fn)&&Fn.call(zn,null,zn),zn}),dr("background",function(Fn,zn){return typeof Fn!="number"?Yt.call(this,"hex must be a hexadecimal rgba value",zn):(this._background=Fn,qt(zn)&&zn.call(this,null,this),this)}),dr("scan",function(Fn,zn,er,rr,lr,fr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"x and y must be numbers",fr);if(typeof er!="number"||typeof rr!="number")return Yt.call(this,"w and h must be numbers",fr);if(typeof lr!="function")return Yt.call(this,"f must be a function",fr);const wr=Xt(this,Fn,zn,er,rr,lr);return qt(fr)&&fr.call(this,null,wr),wr});{let Fn;typeof window<"u"&&typeof window=="object"&&(Fn=window),typeof self<"u"&&typeof self=="object"&&(Fn=self),Fn.Jimp=na,Fn.Buffer=ks}const br=na;var Ir=__webpack_require__(643),Nr=__webpack_require__(2691),Yr=__webpack_require__.n(Nr);const zr="image/jpeg",_i=()=>({mime:{[zr]:["jpeg","jpg","jpe"]},constants:{MIME_JPEG:zr},decoders:{[zr]:Yr().decode},encoders:{[zr]:Fn=>Yr().encode(Fn.bitmap,Fn._quality).data},class:{_quality:100,quality(Fn,zn){return typeof Fn!="number"?Yt.call(this,"n must be a number",zn):Fn<0||Fn>100?Yt.call(this,"n must be a number 0 - 100",zn):(this._quality=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)}}});var qr=__webpack_require__(9902);const so="image/png",eo=()=>({mime:{[so]:["png"]},constants:{MIME_PNG:so,PNG_FILTER_AUTO:-1,PNG_FILTER_NONE:0,PNG_FILTER_SUB:1,PNG_FILTER_UP:2,PNG_FILTER_AVERAGE:3,PNG_FILTER_PATH:4},hasAlpha:{[so]:!0},decoders:{[so]:qr.PNG.sync.read},encoders:{[so](Fn){const zn=new qr.PNG({width:Fn.bitmap.width,height:Fn.bitmap.height});return zn.data=Fn.bitmap.data,qr.PNG.sync.write(zn,{deflateLevel:Fn._deflateLevel,deflateStrategy:Fn._deflateStrategy,filterType:Fn._filterType,colorType:typeof Fn._colorType=="number"?Fn._colorType:Fn._rgba?6:2,inputHasAlpha:Fn._rgba})}},class:{_deflateLevel:9,_deflateStrategy:3,_filterType:-1,_colorType:null,deflateLevel(Fn,zn){return typeof Fn!="number"?Yt.call(this,"l must be a number",zn):Fn<0||Fn>9?Yt.call(this,"l must be a number 0 - 9",zn):(this._deflateLevel=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)},deflateStrategy(Fn,zn){return typeof Fn!="number"?Yt.call(this,"s must be a number",zn):Fn<0||Fn>3?Yt.call(this,"s must be a number 0 - 3",zn):(this._deflateStrategy=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)},filterType(Fn,zn){return typeof Fn!="number"?Yt.call(this,"n must be a number",zn):Fn<-1||Fn>4?Yt.call(this,"n must be -1 (auto) or a number 0 - 4",zn):(this._filterType=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)},colorType(Fn,zn){return typeof Fn!="number"?Yt.call(this,"s must be a number",zn):Fn!==0&&Fn!==2&&Fn!==4&&Fn!==6?Yt.call(this,"s must be a number 0, 2, 4, 6.",zn):(this._colorType=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)}}});var io=__webpack_require__(486),yo=__webpack_require__.n(io);const Bo="image/bmp",Mo="image/x-ms-bmp",xo=Fn=>{return Xt({bitmap:zn=yo().decode(Fn)},0,0,zn.width,zn.height,function(er,rr,lr){const fr=this.bitmap.data[lr+0],wr=this.bitmap.data[lr+1],_r=this.bitmap.data[lr+2],$r=this.bitmap.data[lr+3];this.bitmap.data[lr+0]=$r,this.bitmap.data[lr+1]=_r,this.bitmap.data[lr+2]=wr,this.bitmap.data[lr+3]=zn.is_with_alpha?fr:255}).bitmap;var zn},wo=Fn=>yo().encode(function(zn){return Xt(zn,0,0,zn.bitmap.width,zn.bitmap.height,function(er,rr,lr){const fr=this.bitmap.data[lr+0],wr=this.bitmap.data[lr+1],_r=this.bitmap.data[lr+2],$r=this.bitmap.data[lr+3];this.bitmap.data[lr+0]=$r,this.bitmap.data[lr+1]=_r,this.bitmap.data[lr+2]=wr,this.bitmap.data[lr+3]=fr}).bitmap}(Fn)).data;var os=__webpack_require__(9299),rs=__webpack_require__.n(os),xs=__webpack_require__(8834).lW;const fs="image/tiff";var Ds=__webpack_require__(63),ms=__webpack_require__(9455),Po=__webpack_require__(8834).lW;const Ol="image/gif",Hu=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],Gu=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];var ru=__webpack_require__(8834).lW;function vu(Fn,zn,er,rr){const lr=[0,0,0],fr=(zn.length-1)/2;for(let wr=0;wrFn!=null;function Su(Fn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){const lr=parseInt(.2126*this.bitmap.data[rr]+.7152*this.bitmap.data[rr+1]+.0722*this.bitmap.data[rr+2],10);this.bitmap.data[rr]=lr,this.bitmap.data[rr+1]=lr,this.bitmap.data[rr+2]=lr}),qt(Fn)&&Fn.call(this,null,this),this}function bu(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:50;return{r:(zn.r-Fn.r)*(er/100)+Fn.r,g:(zn.g-Fn.g)*(er/100)+Fn.g,b:(zn.b-Fn.b)*(er/100)+Fn.b}}function Dm(Fn,zn){return Fn&&Array.isArray(Fn)?(Fn=Fn.map(er=>(er.apply!=="xor"&&er.apply!=="mix"||(er.params[0]=sn(er.params[0]).toRgb()),er)),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(er,rr,lr)=>{let fr={r:this.bitmap.data[lr],g:this.bitmap.data[lr+1],b:this.bitmap.data[lr+2]};const wr=(_r,$r)=>this.constructor.limit255(fr[_r]+$r);Fn.forEach(_r=>{if(_r.apply==="mix")fr=bu(fr,_r.params[0],_r.params[1]);else if(_r.apply==="tint")fr=bu(fr,{r:255,g:255,b:255},_r.params[0]);else if(_r.apply==="shade")fr=bu(fr,{r:0,g:0,b:0},_r.params[0]);else if(_r.apply==="xor")fr={r:fr.r^_r.params[0].r,g:fr.g^_r.params[0].g,b:fr.b^_r.params[0].b};else if(_r.apply==="red")fr.r=wr("r",_r.params[0]);else if(_r.apply==="green")fr.g=wr("g",_r.params[0]);else if(_r.apply==="blue")fr.b=wr("b",_r.params[0]);else{if(_r.apply==="hue"&&(_r.apply="spin"),fr=sn(fr),!fr[_r.apply])return Yt.call(this,"action "+_r.apply+" not supported",zn);fr=fr[_r.apply](..._r.params).toRgb()}}),this.bitmap.data[lr]=fr.r,this.bitmap.data[lr+1]=fr.g,this.bitmap.data[lr+2]=fr.b}),qt(zn)&&zn.call(this,null,this),this):Yt.call(this,"actions must be an array",zn)}var Mp=__webpack_require__(8834).lW;function Bm(Fn){const zn=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(er,rr,lr){const fr=zn[((3&rr)<<2)+er%4];this.bitmap.data[lr]=Math.min(this.bitmap.data[lr]+fr,255),this.bitmap.data[lr+1]=Math.min(this.bitmap.data[lr+1]+fr,255),this.bitmap.data[lr+2]=Math.min(this.bitmap.data[lr+2]+fr,255)}),qt(Fn)&&Fn.call(this,null,this),this}var Nm=__webpack_require__(8834).lW;function Fm(Fn,zn,er){if(typeof Fn!="boolean"||typeof zn!="boolean")return Yt.call(this,"horizontal and vertical must be Booleans",er);const rr=Nm.alloc(this.bitmap.data.length);return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(lr,fr,wr){const _r=Fn?this.bitmap.width-1-lr:lr,$r=zn?this.bitmap.height-1-fr:fr,Fr=this.bitmap.width*$r+_r<<2,jr=this.bitmap.data.readUInt32BE(wr);rr.writeUInt32BE(jr,Fr)}),this.bitmap.data=Nm.from(rr),qt(er)&&er.call(this,null,this),this}function Vm(){const Fn={r:new Array(256).fill(0),g:new Array(256).fill(0),b:new Array(256).fill(0)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){Fn.r[this.bitmap.data[rr+0]]++,Fn.g[this.bitmap.data[rr+1]]++,Fn.b[this.bitmap.data[rr+2]]++}),Fn}const $u=function(Fn,zn,er){return 255*(Fn-zn)/(er-zn)},Op=function(Fn){return[Fn.findIndex(zn=>zn>0),255-Fn.slice().reverse().findIndex(zn=>zn>0)]};var qm=__webpack_require__(8058),Ym=__webpack_require__.n(qm);function Rp(Fn,zn){let er=0;for(let rr=0;rr{const $r=[...fr,_r].join(" "),Fr=Rp(Fn,$r);Fr<=er?(Fr>wr&&(wr=Fr),fr.push(_r)):(lr.push(fr),fr=[_r])}),lr.push(fr),{lines:lr,longestLine:wr}}function zo(Fn,zn,er){const{lines:rr}=jm(Fn,zn,er);return rr.length*Fn.common.lineHeight}function Uo(Fn,zn,er,rr,lr){if(lr.width>0&&lr.height>0){const fr=zn.pages[lr.page];Fn.blit(fr,er+lr.xoffset,rr+lr.yoffset,lr.x,lr.y,lr.width,lr.height)}return Fn}function Xm(Fn,zn,er,rr,lr){for(let fr=0;fr0&&this.heightOriginal>0&&this.targetWidth>0&&this.targetHeight>0))throw new Error("Invalid settings specified for the resizer.");this.configurePasses()},Ws.prototype.configurePasses=function(){this.widthOriginal===this.targetWidth?this.resizeWidth=this.bypassResizer:(this.ratioWeightWidthPass=this.widthOriginal/this.targetWidth,this.ratioWeightWidthPass<1&&this.interpolationPass?(this.initializeFirstPassBuffers(!0),this.resizeWidth=this.colorChannels===4?this.resizeWidthInterpolatedRGBA:this.resizeWidthInterpolatedRGB):(this.initializeFirstPassBuffers(!1),this.resizeWidth=this.colorChannels===4?this.resizeWidthRGBA:this.resizeWidthRGB)),this.heightOriginal===this.targetHeight?this.resizeHeight=this.bypassResizer:(this.ratioWeightHeightPass=this.heightOriginal/this.targetHeight,this.ratioWeightHeightPass<1&&this.interpolationPass?(this.initializeSecondPassBuffers(!0),this.resizeHeight=this.resizeHeightInterpolated):(this.initializeSecondPassBuffers(!1),this.resizeHeight=this.colorChannels===4?this.resizeHeightRGBA:this.resizeHeightRGB))},Ws.prototype._resizeWidthInterpolatedRGBChannels=function(Fn,zn){const er=zn?4:3,rr=this.ratioWeightWidthPass,lr=this.widthBuffer;let fr,wr,_r=0,$r=0,Fr=0,jr=0,Vr=0;for(fr=0;_r<1/3;fr+=er,_r+=rr)for($r=fr,Fr=0;$r=Vr)){Jr+=jr;break}co+=er,Jr=co,jr-=Vr}while(jr>0&&co=$r)){jr+=_r;break}Fr=Jr,jr=Fr,_r-=$r}while(_r>0&&Fr3&&(this.outputWidthWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.heightOriginal)))},Ws.prototype.initializeSecondPassBuffers=function(Fn){this.heightBuffer=this.generateUint8Buffer(this.finalResultSize),Fn||(this.outputHeightWorkBench=this.generateFloatBuffer(this.targetWidthMultipliedByChannels),this.colorChannels>3&&(this.outputHeightWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.targetWidth)))},Ws.prototype.generateFloatBuffer=function(Fn){try{return new Float32Array(Fn)}catch{return[]}},Ws.prototype.generateFloat64Buffer=function(Fn){try{return new Float64Array(Fn)}catch{return[]}},Ws.prototype.generateUint8Buffer=function(Fn){try{return new Uint8Array(Fn)}catch{return[]}};const Km=Ws;var zm=__webpack_require__(8834).lW;const Zm={nearestNeighbor(Fn,zn){const er=Fn.width,rr=Fn.height,lr=zn.width,fr=zn.height,wr=Fn.data,_r=zn.data;for(let $r=0;$r0?lr[ba-4]:2*lr[ba]-lr[ba+4],iu=lr[ba],nu=lr[ba+4],xu=Yo0?Xr[ba-4*Vr]:2*Xr[ba]-Xr[ba+4*Vr],iu=Xr[ba],nu=Xr[ba+4*Vr],xu=Yo<_r-2?Xr[ba+8*Vr]:2*Xr[ba+4*Vr]-Xr[ba];Kr[Vo+es]=rr(Vs,iu,nu,xu,Oo)}}const Qr=jr*co;if(Qr>1)for(let fo=0;fo=0&&Qr.x<_r&&Qr.y>=0&&Qr.y<$r){const _o=(_r*(0|Qr.y)+Qr.x|0)<<2,jo=this.bitmap.data.readUInt32BE(_o);Fr.writeUInt32BE(jo,fo)}else Fr.writeUInt32BE(this._background,fo)}if(this.bitmap.data=Fr,zn===!0||typeof zn=="string"){const Jr=_r/2-fr/2,Xr=$r/2-wr/2;this.crop(Jr,Xr,fr,wr)}}const Lp=[()=>({blit(Fn,zn,er,rr,lr,fr,wr,_r){if(!(Fn instanceof this.constructor))return Yt.call(this,"The source must be a Jimp image",_r);if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",_r);if(typeof rr=="function")_r=rr,rr=0,lr=0,fr=Fn.bitmap.width,wr=Fn.bitmap.height;else{if(typeof rr!=typeof lr||typeof lr!=typeof fr||typeof fr!=typeof wr)return Yt.call(this,"srcx, srcy, srcw, srch must be numbers",_r);rr=rr||0,lr=lr||0,fr=fr||Fn.bitmap.width,wr=wr||Fn.bitmap.height}zn=Math.round(zn),er=Math.round(er),rr=Math.round(rr),lr=Math.round(lr),fr=Math.round(fr),wr=Math.round(wr);const $r=this.bitmap.width,Fr=this.bitmap.height,jr=this;return Fn.scanQuiet(rr,lr,fr,wr,function(Vr,co,Jr){const Xr=zn+Vr-rr,Kr=er+co-lr;if(Xr>=0&&Kr>=0&&$r-Xr>0&&Fr-Kr>0){const Qr=jr.getPixelIndex(Xr,Kr),fo={r:this.bitmap.data[Jr],g:this.bitmap.data[Jr+1],b:this.bitmap.data[Jr+2],a:this.bitmap.data[Jr+3]},_o={r:jr.bitmap.data[Qr],g:jr.bitmap.data[Qr+1],b:jr.bitmap.data[Qr+2],a:jr.bitmap.data[Qr+3]};jr.bitmap.data[Qr]=(fo.a*(fo.r-_o.r)-_o.r+255>>8)+_o.r,jr.bitmap.data[Qr+1]=(fo.a*(fo.g-_o.g)-_o.g+255>>8)+_o.g,jr.bitmap.data[Qr+2]=(fo.a*(fo.b-_o.b)-_o.b+255>>8)+_o.b,jr.bitmap.data[Qr+3]=this.constructor.limit255(_o.a+fo.a)}}),qt(_r)&&_r.call(this,null,this),this}}),()=>({blur(Fn,zn){if(typeof Fn!="number")return Yt.call(this,"r must be a number",zn);if(Fn<1)return Yt.call(this,"r must be greater than 0",zn);let er,rr,lr,fr,wr,_r,$r,Fr,jr,Vr,co,Jr,Xr,Kr;const Qr=this.bitmap.width-1,fo=this.bitmap.height-1,_o=Fn+1,jo=Hu[Fn],Yo=Gu[Fn],Oo=[],Zo=[],Vo=[],es=[],ba=[],Vs=[];let iu=2;for(;iu-- >0;){for(Jr=0,Xr=0,_r=0;_rQr?Qr:$r)<<2),er+=this.bitmap.data[Fr++],rr+=this.bitmap.data[Fr++],lr+=this.bitmap.data[Fr++],fr+=this.bitmap.data[Fr];for(wr=0;wr0?Fr<<2:0),jr=Xr+ba[wr],Vr=Xr+Vs[wr],er+=this.bitmap.data[jr++]-this.bitmap.data[Vr++],rr+=this.bitmap.data[jr++]-this.bitmap.data[Vr++],lr+=this.bitmap.data[jr++]-this.bitmap.data[Vr++],fr+=this.bitmap.data[jr]-this.bitmap.data[Vr],Jr++;Xr+=this.bitmap.width<<2}for(wr=0;wrfo?0:this.bitmap.width,er+=Oo[co],rr+=Zo[co],lr+=Vo[co],fr+=es[co];for(Jr=wr<<2,_r=0;_r>>Yo,this.bitmap.data[Jr+3]=Kr,Kr>255&&(this.bitmap.data[Jr+3]=255),Kr>0?(Kr=255/Kr,this.bitmap.data[Jr]=(er*jo>>>Yo)*Kr,this.bitmap.data[Jr+1]=(rr*jo>>>Yo)*Kr,this.bitmap.data[Jr+2]=(lr*jo>>>Yo)*Kr):(this.bitmap.data[Jr+2]=0,this.bitmap.data[Jr+1]=0,this.bitmap.data[Jr]=0),wr===0&&(ba[_r]=((Fr=_r+_o)0?Fr*this.bitmap.width:0),jr=wr+ba[_r],Vr=wr+Vs[_r],er+=Oo[jr]-Oo[Vr],rr+=Zo[jr]-Zo[Vr],lr+=Vo[jr]-Vo[Vr],fr+=es[jr]-es[Vr],Jr+=this.bitmap.width<<2}}return qt(zn)&&zn.call(this,null,this),this}}),()=>({circle(){let Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},zn=arguments.length>1?arguments[1]:void 0;typeof Fn=="function"&&(zn=Fn,Fn={});const er=Fn.radius||(this.bitmap.width>this.bitmap.height?this.bitmap.height:this.bitmap.width)/2,rr=typeof Fn.x=="number"?Fn.x:this.bitmap.width/2,lr=typeof Fn.y=="number"?Fn.y:this.bitmap.height/2;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(fr,wr,_r){const $r=Math.sqrt(Math.pow(fr-rr,2)+Math.pow(wr-lr,2));er-$r<=0?this.bitmap.data[_r+3]=0:er-$r<1&&(this.bitmap.data[_r+3]=255*(er-$r))}),qt(zn)&&zn.call(this,null,this),this}}),()=>({brightness(Fn,zn){return typeof Fn!="number"?Yt.call(this,"val must be numbers",zn):Fn<-1||Fn>1?Yt.call(this,"val must be a number between -1 and +1",zn):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(er,rr,lr){Fn<0?(this.bitmap.data[lr]*=1+Fn,this.bitmap.data[lr+1]*=1+Fn,this.bitmap.data[lr+2]*=1+Fn):(this.bitmap.data[lr]+=(255-this.bitmap.data[lr])*Fn,this.bitmap.data[lr+1]+=(255-this.bitmap.data[lr+1])*Fn,this.bitmap.data[lr+2]+=(255-this.bitmap.data[lr+2])*Fn)}),qt(zn)&&zn.call(this,null,this),this)},contrast(Fn,zn){if(typeof Fn!="number")return Yt.call(this,"val must be numbers",zn);if(Fn<-1||Fn>1)return Yt.call(this,"val must be a number between -1 and +1",zn);const er=(Fn+1)/(1-Fn);function rr(lr){return(lr=Math.floor(er*(lr-127)+127))<0?0:lr>255?255:lr}return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(lr,fr,wr){this.bitmap.data[wr]=rr(this.bitmap.data[wr]),this.bitmap.data[wr+1]=rr(this.bitmap.data[wr+1]),this.bitmap.data[wr+2]=rr(this.bitmap.data[wr+2])}),qt(zn)&&zn.call(this,null,this),this},posterize(Fn,zn){return typeof Fn!="number"?Yt.call(this,"n must be numbers",zn):(Fn<2&&(Fn=2),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(er,rr,lr){this.bitmap.data[lr]=Math.floor(this.bitmap.data[lr]/255*(Fn-1))/(Fn-1)*255,this.bitmap.data[lr+1]=Math.floor(this.bitmap.data[lr+1]/255*(Fn-1))/(Fn-1)*255,this.bitmap.data[lr+2]=Math.floor(this.bitmap.data[lr+2]/255*(Fn-1))/(Fn-1)*255}),qt(zn)&&zn.call(this,null,this),this)},greyscale:Su,grayscale:Su,opacity(Fn,zn){return typeof Fn!="number"?Yt.call(this,"f must be a number",zn):Fn<0||Fn>1?Yt.call(this,"f must be a number from 0 to 1",zn):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(er,rr,lr){const fr=this.bitmap.data[lr+3]*Fn;this.bitmap.data[lr+3]=fr}),qt(zn)&&zn.call(this,null,this),this)},sepia(Fn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){let lr=this.bitmap.data[rr],fr=this.bitmap.data[rr+1],wr=this.bitmap.data[rr+2];lr=.393*lr+.769*fr+.189*wr,fr=.349*lr+.686*fr+.168*wr,wr=.272*lr+.534*fr+.131*wr,this.bitmap.data[rr]=lr<255?lr:255,this.bitmap.data[rr+1]=fr<255?fr:255,this.bitmap.data[rr+2]=wr<255?wr:255}),qt(Fn)&&Fn.call(this,null,this),this},fade(Fn,zn){return typeof Fn!="number"?Yt.call(this,"f must be a number",zn):Fn<0||Fn>1?Yt.call(this,"f must be a number from 0 to 1",zn):(this.opacity(1-Fn),qt(zn)&&zn.call(this,null,this),this)},convolution(Fn,zn,er){typeof zn=="function"&&er===void 0&&(er=zn,zn=null),zn||(zn=this.constructor.EDGE_EXTEND);const rr=ru.from(this.bitmap.data),lr=Fn.length,fr=Fn[0].length,wr=Math.floor(lr/2),_r=Math.floor(fr/2),$r=-wr,Fr=-_r;let jr,Vr,co,Jr,Xr,Kr,Qr,fo,_o,jo;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(Yo,Oo,Zo){Jr=0,co=0,Vr=0;for(let Vo=$r;Vo<=wr;Vo++)for(let es=Fr;es<=_r;es++)fo=Yo+es,_o=Oo+Vo,jr=Fn[Vo+wr][es+_r],jo=this.getPixelIndex(fo,_o,zn),jo===-1?(Qr=0,Kr=0,Xr=0):(Xr=this.bitmap.data[jo+0],Kr=this.bitmap.data[jo+1],Qr=this.bitmap.data[jo+2]),Vr+=jr*Xr,co+=jr*Kr,Jr+=jr*Qr;Vr<0&&(Vr=0),co<0&&(co=0),Jr<0&&(Jr=0),Vr>255&&(Vr=255),co>255&&(co=255),Jr>255&&(Jr=255),rr[Zo+0]=Vr,rr[Zo+1]=co,rr[Zo+2]=Jr}),this.bitmap.data=rr,qt(er)&&er.call(this,null,this),this},opaque(Fn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){this.bitmap.data[rr+3]=255}),qt(Fn)&&Fn.call(this,null,this),this},pixelate(Fn,zn,er,rr,lr,fr){if(typeof zn=="function")fr=zn,lr=null,rr=null,er=null,zn=null;else{if(typeof Fn!="number")return Yt.call(this,"size must be a number",fr);if(Gs(zn)&&typeof zn!="number")return Yt.call(this,"x must be a number",fr);if(Gs(er)&&typeof er!="number")return Yt.call(this,"y must be a number",fr);if(Gs(rr)&&typeof rr!="number")return Yt.call(this,"w must be a number",fr);if(Gs(lr)&&typeof lr!="number")return Yt.call(this,"h must be a number",fr)}const wr=[[1/16,2/16,1/16],[2/16,.25,2/16],[1/16,2/16,1/16]];zn=zn||0,er=er||0,rr=Gs(rr)?rr:this.bitmap.width-zn,lr=Gs(lr)?lr:this.bitmap.height-er;const _r=this.cloneQuiet();return this.scanQuiet(zn,er,rr,lr,function($r,Fr,jr){$r=Fn*Math.floor($r/Fn),Fr=Fn*Math.floor(Fr/Fn);const Vr=vu(_r,wr,$r,Fr);this.bitmap.data[jr]=Vr[0],this.bitmap.data[jr+1]=Vr[1],this.bitmap.data[jr+2]=Vr[2]}),qt(fr)&&fr.call(this,null,this),this},convolute(Fn,zn,er,rr,lr,fr){if(!Array.isArray(Fn))return Yt.call(this,"the kernel must be an array",fr);if(typeof zn=="function")fr=zn,zn=null,er=null,rr=null,lr=null;else{if(Gs(zn)&&typeof zn!="number")return Yt.call(this,"x must be a number",fr);if(Gs(er)&&typeof er!="number")return Yt.call(this,"y must be a number",fr);if(Gs(rr)&&typeof rr!="number")return Yt.call(this,"w must be a number",fr);if(Gs(lr)&&typeof lr!="number")return Yt.call(this,"h must be a number",fr)}zn=Gs(zn)?zn:0,er=Gs(er)?er:0,rr=Gs(rr)?rr:this.bitmap.width-zn,lr=Gs(lr)?lr:this.bitmap.height-er;const wr=this.cloneQuiet();return this.scanQuiet(zn,er,rr,lr,function(_r,$r,Fr){const jr=vu(wr,Fn,_r,$r);this.bitmap.data[Fr]=this.constructor.limit255(jr[0]),this.bitmap.data[Fr+1]=this.constructor.limit255(jr[1]),this.bitmap.data[Fr+2]=this.constructor.limit255(jr[2])}),qt(fr)&&fr.call(this,null,this),this},color:Dm,colour:Dm}),()=>({contain(Fn,zn,er,rr,lr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"w and h must be numbers",lr);typeof er=="string"&&(typeof rr=="function"&&lr===void 0&&(lr=rr),rr=er,er=null),typeof er=="function"&&(lr===void 0&&(lr=er),rr=null,er=null),typeof rr=="function"&&lr===void 0&&(lr=rr,rr=null);const fr=7&(er=er||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),wr=er>>3;if((fr===0||fr&fr-1)&&(wr===0||wr&wr-1))return Yt.call(this,"only use one flag per alignment direction",lr);const _r=fr>>1,$r=wr>>1,Fr=Fn/zn>this.bitmap.width/this.bitmap.height?zn/this.bitmap.height:Fn/this.bitmap.width,jr=this.cloneQuiet().scale(Fr,rr);return this.resize(Fn,zn,rr),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(Vr,co,Jr){this.bitmap.data.writeUInt32BE(this._background,Jr)}),this.blit(jr,(this.bitmap.width-jr.bitmap.width)/2*_r,(this.bitmap.height-jr.bitmap.height)/2*$r),qt(lr)&&lr.call(this,null,this),this}}),()=>({cover(Fn,zn,er,rr,lr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"w and h must be numbers",lr);er&&typeof er=="function"&&lr===void 0?(lr=er,er=null,rr=null):typeof rr=="function"&&lr===void 0&&(lr=rr,rr=null);const fr=7&(er=er||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),wr=er>>3;if((fr===0||fr&fr-1)&&(wr===0||wr&wr-1))return Yt.call(this,"only use one flag per alignment direction",lr);const _r=fr>>1,$r=wr>>1,Fr=Fn/zn>this.bitmap.width/this.bitmap.height?Fn/this.bitmap.width:zn/this.bitmap.height;return this.scale(Fr,rr),this.crop((this.bitmap.width-Fn)/2*_r,(this.bitmap.height-zn)/2*$r,Fn,zn),qt(lr)&&lr.call(this,null,this),this}}),function(Fn){return Fn("crop",function(zn,er,rr,lr,fr){if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",fr);if(typeof rr!="number"||typeof lr!="number")return Yt.call(this,"w and h must be numbers",fr);if(zn=Math.round(zn),er=Math.round(er),rr=Math.round(rr),lr=Math.round(lr),zn===0&&rr===this.bitmap.width){const wr=rr*er+zn<<2,_r=wr+(lr*rr<<2);this.bitmap.data=this.bitmap.data.slice(wr,_r)}else{const wr=Mp.allocUnsafe(rr*lr*4);let _r=0;this.scanQuiet(zn,er,rr,lr,function($r,Fr,jr){const Vr=this.bitmap.data.readUInt32BE(jr,!0);wr.writeUInt32BE(Vr,_r,!0),_r+=4}),this.bitmap.data=wr}return this.bitmap.width=rr,this.bitmap.height=lr,qt(fr)&&fr.call(this,null,this),this}),{class:{autocrop(){const zn=this.bitmap.width,er=this.bitmap.height;let rr,lr=0,fr=2e-4,wr=!0,_r=!1,$r={north:!1,south:!1,east:!1,west:!1};for(var Fr=arguments.length,jr=new Array(Fr),Vr=0;Vrfr)break e}Xr++}if(co=this.getPixelColor(zn,0),!$r.west)e:for(let Oo=0;Oofr)break e}fo++}if(co=this.getPixelColor(0,er),!$r.south)e:for(let Oo=er-1;Oo>=Xr+1;Oo--){for(let Zo=zn-Kr-1;Zo>=0;Zo--){const Vo=this.getPixelColor(Zo,Oo),es=this.constructor.intToRGBA(Vo);if(this.constructor.colorDiff(Jr,es)>fr)break e}Qr++}if(co=this.getPixelColor(zn,er),!$r.east)e:for(let Oo=zn-1;Oo>=0+fo+1;Oo--){for(let Zo=er-1;Zo>=0+Xr;Zo--){const Vo=this.getPixelColor(Oo,Zo),es=this.constructor.intToRGBA(Vo);if(this.constructor.colorDiff(Jr,es)>fr)break e}Kr++}let _o=!1;if(fo-=lr,Kr-=lr,Xr-=lr,Qr-=lr,_r){const Oo=Math.min(Kr,fo),Zo=Math.min(Xr,Qr);fo=Oo,Kr=Oo,Xr=Zo,Qr=Zo}fo=fo>=0?fo:0,Kr=Kr>=0?Kr:0,Xr=Xr>=0?Xr:0,Qr=Qr>=0?Qr:0;const jo=zn-(fo+Kr),Yo=er-(Qr+Xr);return _o=wr?Kr!==0&&Xr!==0&&fo!==0&&Qr!==0:Kr!==0||Xr!==0||fo!==0||Qr!==0,_o&&this.crop(fo,Xr,jo,Yo),qt(rr)&&rr.call(this,null,this),this}}}},()=>({displace(Fn,zn,er){if(typeof Fn!="object"||Fn.constructor!==this.constructor)return Yt.call(this,"The source must be a Jimp image",er);if(typeof zn!="number")return Yt.call(this,"factor must be a number",er);const rr=this.cloneQuiet();return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(lr,fr,wr){let _r=Fn.bitmap.data[wr]/256*zn;_r=Math.round(_r);const $r=this.getPixelIndex(lr+_r,fr);this.bitmap.data[$r]=rr.bitmap.data[wr],this.bitmap.data[$r+1]=rr.bitmap.data[wr+1],this.bitmap.data[$r+2]=rr.bitmap.data[wr+2]}),qt(er)&&er.call(this,null,this),this}}),()=>({dither565:Bm,dither16:Bm}),()=>({fisheye(){let Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{r:2.5},zn=arguments.length>1?arguments[1]:void 0;typeof Fn=="function"&&(zn=Fn,Fn={r:2.5});const er=this.cloneQuiet(),{width:rr,height:lr}=er.bitmap;return er.scanQuiet(0,0,rr,lr,(fr,wr)=>{const _r=fr/rr,$r=wr/lr,Fr=Math.sqrt(Math.pow(_r-.5,2)+Math.pow($r-.5,2)),jr=2*Math.pow(Fr,Fn.r),Vr=(_r-.5)/Fr,co=($r-.5)/Fr,Jr=Math.round((jr*Vr+.5)*rr),Xr=Math.round((jr*co+.5)*lr),Kr=er.getPixelColor(Jr,Xr);this.setPixelColor(Kr,fr,wr)}),this.setPixelColor(er.getPixelColor(rr/2,lr/2),rr/2,lr/2),qt(zn)&&zn.call(this,null,this),this}}),()=>({flip:Fm,mirror:Fm}),()=>({gaussian(Fn,zn){if(typeof Fn!="number")return Yt.call(this,"r must be a number",zn);if(Fn<1)return Yt.call(this,"r must be greater than 0",zn);const er=Math.ceil(2.57*Fn),rr=2*er+1,lr=Fn*Fn*2,fr=lr*Math.PI,wr=[];for(let _r=0;_r({invert(Fn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){this.bitmap.data[rr]=255-this.bitmap.data[rr],this.bitmap.data[rr+1]=255-this.bitmap.data[rr+1],this.bitmap.data[rr+2]=255-this.bitmap.data[rr+2]}),qt(Fn)&&Fn.call(this,null,this),this}}),()=>({mask(Fn){let zn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,rr=arguments.length>3?arguments[3]:void 0;if(!(Fn instanceof this.constructor))return Yt.call(this,"The source must be a Jimp image",rr);if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",rr);zn=Math.round(zn),er=Math.round(er);const lr=this.bitmap.width,fr=this.bitmap.height,wr=this;return Fn.scanQuiet(0,0,Fn.bitmap.width,Fn.bitmap.height,function(_r,$r,Fr){const jr=zn+_r,Vr=er+$r;if(jr>=0&&Vr>=0&&jr({normalize(Fn){const zn=Vm.call(this),er={r:Op(zn.r),g:Op(zn.g),b:Op(zn.b)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(rr,lr,fr){const wr=this.bitmap.data[fr+0],_r=this.bitmap.data[fr+1],$r=this.bitmap.data[fr+2];this.bitmap.data[fr+0]=$u(wr,er.r[0],er.r[1]),this.bitmap.data[fr+1]=$u(_r,er.g[0],er.g[1]),this.bitmap.data[fr+2]=$u($r,er.b[0],er.b[1])}),qt(Fn)&&Fn.call(this,null,this),this}}),()=>({constants:{measureText:Rp,measureTextHeight:zo,FONT_SANS_8_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),FONT_SANS_10_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),FONT_SANS_12_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),FONT_SANS_14_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),FONT_SANS_16_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),FONT_SANS_32_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),FONT_SANS_64_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),FONT_SANS_128_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),FONT_SANS_8_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),FONT_SANS_16_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),FONT_SANS_32_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),FONT_SANS_64_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),FONT_SANS_128_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),loadFont(Fn,zn){return typeof Fn!="string"?Yt.call(this,"file must be a string",zn):new Promise((er,rr)=>{zn=zn||function(lr,fr){lr?rr(lr):er(fr)},Ym()(Fn,(lr,fr)=>{const wr={},_r={};if(lr)return Yt.call(this,lr,zn);for(let $r=0;$r$r.read(Fr+"/"+co));return Promise.all(Vr)})(this,Ut().dirname(Fn),fr.pages).then($r=>{zn(null,{chars:wr,kernings:_r,pages:$r,common:fr.common,info:fr.info})})})})}},class:{print(Fn,zn,er,rr,lr,fr,wr){if(typeof lr=="function"&&wr===void 0&&(wr=lr,lr=1/0),lr===void 0&&(lr=1/0),typeof fr=="function"&&wr===void 0&&(wr=fr,fr=1/0),fr===void 0&&(fr=1/0),typeof Fn!="object")return Yt.call(this,"font must be a Jimp loadFont",wr);if(typeof zn!="number"||typeof er!="number"||typeof lr!="number")return Yt.call(this,"x, y and maxWidth must be numbers",wr);if(typeof lr!="number")return Yt.call(this,"maxWidth must be a number",wr);if(typeof fr!="number")return Yt.call(this,"maxHeight must be a number",wr);let _r,$r;typeof rr=="object"&&rr.text!==null&&rr.text!==void 0?(_r=rr.alignmentX||this.constructor.HORIZONTAL_ALIGN_LEFT,$r=rr.alignmentY||this.constructor.VERTICAL_ALIGN_TOP,{text:rr}=rr):(_r=this.constructor.HORIZONTAL_ALIGN_LEFT,$r=this.constructor.VERTICAL_ALIGN_TOP,rr=rr.toString()),fr!==1/0&&$r===this.constructor.VERTICAL_ALIGN_BOTTOM?er+=fr-zo(Fn,rr,lr):fr!==1/0&&$r===this.constructor.VERTICAL_ALIGN_MIDDLE&&(er+=fr/2-zo(Fn,rr,lr)/2);const Fr=Object.entries(Fn.chars)[0][1].xadvance,{lines:jr,longestLine:Vr}=jm(Fn,rr,lr);return jr.forEach(co=>{const Jr=co.join(" "),Xr=function(Kr,Qr,fo,_o,jo){return jo===Kr.HORIZONTAL_ALIGN_LEFT?0:jo===Kr.HORIZONTAL_ALIGN_CENTER?(_o-Rp(Qr,fo))/2:_o-Rp(Qr,fo)}(this.constructor,Fn,Jr,lr,_r);Xm.call(this,Fn,zn+Xr,er,Jr,Fr),er+=Fn.common.lineHeight}),qt(wr)&&wr.call(this,null,this,{x:zn+Vr,y:er}),this}}}),()=>({constants:{RESIZE_NEAREST_NEIGHBOR:"nearestNeighbor",RESIZE_BILINEAR:"bilinearInterpolation",RESIZE_BICUBIC:"bicubicInterpolation",RESIZE_HERMITE:"hermiteInterpolation",RESIZE_BEZIER:"bezierInterpolation"},class:{resize(Fn,zn,er,rr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"w and h must be numbers",rr);if(typeof er=="function"&&rr===void 0&&(rr=er,er=null),Fn===this.constructor.AUTO&&zn===this.constructor.AUTO)return Yt.call(this,"w and h cannot both be set to auto",rr);if(Fn===this.constructor.AUTO&&(Fn=this.bitmap.width*(zn/this.bitmap.height)),zn===this.constructor.AUTO&&(zn=this.bitmap.height*(Fn/this.bitmap.width)),Fn<0||zn<0)return Yt.call(this,"w and h must be positive numbers",rr);if(Fn=Math.round(Fn)||1,zn=Math.round(zn)||1,typeof kp[er]=="function"){const lr={data:Um.alloc(Fn*zn*4),width:Fn,height:zn};kp[er](this.bitmap,lr),this.bitmap=lr}else{const lr=this;new Km(this.bitmap.width,this.bitmap.height,Fn,zn,!0,!0,fr=>{lr.bitmap.data=Um.from(fr),lr.bitmap.width=Fn,lr.bitmap.height=zn}).resize(this.bitmap.data)}return qt(rr)&&rr.call(this,null,this),this}}}),()=>({rotate(Fn,zn,er){return zn==null&&(zn=!0),typeof zn=="function"&&er===void 0&&(er=zn,zn=!0),typeof Fn!="number"?Yt.call(this,"deg must be a number",er):typeof zn!="boolean"&&typeof zn!="string"?Yt.call(this,"mode must be a boolean or a string",er):(Fn%90!=0||!zn&&this.bitmap.width!==this.bitmap.height&&Fn%180!=0?Dl.call(this,Fn,zn,er):Wu.call(this,Fn),qt(er)&&er.call(this,null,this),this)}}),()=>({scale(Fn,zn,er){if(typeof Fn!="number")return Yt.call(this,"f must be a number",er);if(Fn<0)return Yt.call(this,"f must be a positive number",er);typeof zn=="function"&&er===void 0&&(er=zn,zn=null);const rr=this.bitmap.width*Fn,lr=this.bitmap.height*Fn;return this.resize(rr,lr,zn),qt(er)&&er.call(this,null,this),this},scaleToFit(Fn,zn,er,rr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"w and h must be numbers",rr);typeof er=="function"&&rr===void 0&&(rr=er,er=null);const lr=Fn/zn>this.bitmap.width/this.bitmap.height?zn/this.bitmap.height:Fn/this.bitmap.width;return this.scale(lr,er),qt(rr)&&rr.call(this,null,this),this}}),()=>({shadow(){let Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},zn=arguments.length>1?arguments[1]:void 0;typeof Fn=="function"&&(zn=Fn,Fn={});const{opacity:er=.7,size:rr=1.1,x:lr=-25,y:fr=25,blur:wr=5}=Fn,_r=this.clone(),$r=this.clone();return $r.scan(0,0,$r.bitmap.width,$r.bitmap.height,(Fr,jr,Vr)=>{$r.bitmap.data[Vr]=0,$r.bitmap.data[Vr+1]=0,$r.bitmap.data[Vr+2]=0,$r.bitmap.data[Vr+3]=$r.constructor.limit255($r.bitmap.data[Vr+3]*er),this.bitmap.data[Vr]=0,this.bitmap.data[Vr+1]=0,this.bitmap.data[Vr+2]=0,this.bitmap.data[Vr+3]=0}),$r.resize($r.bitmap.width*rr,$r.bitmap.height*rr).blur(wr),this.composite($r,lr,fr),this.composite(_r,0,0),qt(zn)&&zn.call(this,null,this),this}}),()=>({threshold(Fn,zn){let{max:er,replace:rr=255,autoGreyscale:lr=!0}=Fn;return typeof er!="number"?Yt.call(this,"max must be a number",zn):typeof rr!="number"?Yt.call(this,"replace must be a number",zn):typeof lr!="boolean"?Yt.call(this,"autoGreyscale must be a boolean",zn):(er=this.constructor.limit255(er),rr=this.constructor.limit255(rr),lr&&this.greyscale(),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(fr,wr,_r)=>{const $r=this.bitmap.data[_r]1&&arguments[1]!==void 0?arguments[1]:br;const er={hasAlpha:{},encoders:{},decoders:{},class:{},constants:{}};function rr(lr){Object.entries(lr).forEach(fr=>{let[wr,_r]=fr;er[wr]={...er[wr],..._r}})}Fn.types&&(Fn.types.forEach(function(lr){const fr=lr();Array.isArray(fr.mime)?xa(...fr.mime):Object.entries(fr.mime).forEach(wr=>xa(...wr)),delete fr.mime,rr(fr)}),zn.decoders={...zn.decoders,...er.decoders},zn.encoders={...zn.encoders,...er.encoders},zn.hasAlpha={...zn.hasAlpha,...er.hasAlpha}),Fn.plugins&&Fn.plugins.forEach(function(lr){const fr=lr(dr)||{};fr.class||fr.constants?rr(fr):rr({class:fr})}),Eu(er.class,zn),yu(er.constants,zn)})({types:[()=>(0,Ir.Ee)(_i(),eo(),{mime:{[Bo]:["bmp"]},constants:{MIME_BMP:Bo,MIME_X_MS_BMP:Mo},decoders:{[Bo]:xo,[Mo]:xo},encoders:{[Bo]:wo,[Mo]:wo}},{mime:{[fs]:["tiff","tif"]},constants:{MIME_TIFF:fs},decoders:{[fs]:Fn=>{const zn=rs().decode(Fn),er=zn[0];zn.forEach(lr=>{rs().decodeImage(Fn,lr)});const rr=rs().toRGBA8(er);return{data:xs.from(rr),width:er.t256[0],height:er.t257[0]}}},encoders:{[fs]:Fn=>{const zn=rs().encodeImage(Fn.bitmap.data,Fn.bitmap.width,Fn.bitmap.height);return xs.from(zn)}}},{mime:{[Ol]:["gif"]},constants:{MIME_GIF:Ol},decoders:{[Ol]:Fn=>{const zn=new Ds.N(Fn),er=Po.alloc(zn.width*zn.height*4);return zn.decodeAndBlitFrameRGBA(0,er),{data:er,width:zn.width,height:zn.height}}},encoders:{[Ol]:Fn=>{const zn=new ms.BitmapImage(Fn.bitmap);ms.GifUtil.quantizeDekker(zn,256);const er=new ms.GifFrame(zn);return new ms.GifCodec().encodeGif([er],{}).then(rr=>rr.buffer)}}})],plugins:[Fn=>{const zn=Lp.map(er=>{let rr=er(Fn)||{};return rr.class||rr.constants||(rr={class:rr}),rr});return(0,Ir.Ee)(...zn)}]})})()})();const _Jimp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Jimp=typeof self<"u"&&self.Jimp||_Jimp,defaultScreenshotRenderer=_e=>jsxRuntimeExports.jsx("img",{src:_e});function Screenshot({screenshot:_e,renderScreenshot:Pt=defaultScreenshotRenderer}){const{result:Dt,loading:Nt}=useAsync(async()=>await(_e==null?void 0:_e()),[_e]);return Pt(Dt,Nt)}function Gallery({onChange:_e}){const Pt=usePaper(),[Dt]=useScreenshots(),[Nt,{set:jt,remove:Ut}]=useMap$1();reactExports.useEffect(()=>{_e==null||_e(lodashExports$1.values(Nt))},[Nt]);function Gt(Wt,qt,Yt){qt&&Yt?jt(`${Wt}`,Yt):Ut(`${Wt}`)}return useAsync(async()=>{const Wt=lodashExports$1.head(lodashExports$1.values(Dt)),qt=await(Wt==null?void 0:Wt());qt&&Gt(0,!0,qt)},[Dt]),jsxRuntimeExports.jsx(Scroll,{x:!0,py:2,children:jsxRuntimeExports.jsx(Stack$1,{direction:"row",children:lodashExports$1.values(Dt).map((Wt,qt)=>jsxRuntimeExports.jsx(Screenshot,{screenshot:Wt,renderScreenshot:(Yt,Xt)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box$1,{sx:{minWidth:"320px",height:"320px",flex:0,p:2,"&:not(:last-child)":{pr:1}},children:jsxRuntimeExports.jsxs(Box$1,{sx:{position:"relative",...Pt(1),height:"100%"},children:[!!Yt&&jsxRuntimeExports.jsx(Box$1,{sx:{backgroundImage:Zt=>`linear-gradient(to bottom, ${alpha(Zt.palette.background.paper,.5)}, transparent), url("${Yt}")`,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center"}}),jsxRuntimeExports.jsx(Box$1,{sx:{position:"absolute",p:1,top:0,left:0},children:jsxRuntimeExports.jsx(FormControlLabel$1,{control:jsxRuntimeExports.jsx(Checkbox$1,{checked:!!Nt[qt],disabled:!Yt,color:"primary",sx:{ml:1},onChange:(Zt,Qt)=>Gt(qt,Qt,Yt)}),label:`Viewport ${qt+1}`})}),Xt&&jsxRuntimeExports.jsx(Box$1,{sx:{position:"absolute",m:2,top:0,right:0},children:jsxRuntimeExports.jsx(CircularProgress$1,{})})]})})})},qt))})})}function getFilename(_e=""){return lodashExports$1.kebabCase(_e.replace("*"," star "))||"untitled"}const imageSize=64;async function resizeImage(_e){const Pt=await Jimp.read(Buffer.from(_e.split(",")[1],"base64")),Dt=Pt.getWidth(){const Zt=lodashExports$1.delay(()=>{Dt(Qt=>({...Qt,workspaceMeta:Nt}))},300);return()=>clearTimeout(Zt)},[Nt,Dt],[Nt]);const{save:Ut,estimateWorkspaceSize:Gt}=useWorkspace(),Wt=useLoadingState("general"),qt=useSnackbar(),Yt=reactExports.useMemo(Gt,[]);async function Xt(Zt){return{...Nt,id:nanoid$1(),size:Zt,screenshots:await map$6((Nt==null?void 0:Nt.screenshots)??[],resizeImage),lastModified:Date.now()}}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box$1,{children:jsxRuntimeExports.jsx(Gallery,{onChange:Zt=>jt("screenshots",Zt)})}),jsxRuntimeExports.jsxs(Stack$1,{p:2,gap:2,children:[jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,defaultValue:Nt.name,onChange:Zt=>jt("name",Zt.target.value),label:"Name",fullWidth:!0}),jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,minRows:3,defaultValue:Nt.description,size:"small",onChange:Zt=>jt("description",Zt.target.value),label:"Description",fullWidth:!0,multiline:!0}),jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,defaultValue:Nt.author,size:"small",onChange:Zt=>jt("author",Zt.target.value),label:"Author",fullWidth:!0,multiline:!0}),jsxRuntimeExports.jsx(Box$1,{sx:{pt:2,width:"100%"},children:jsxRuntimeExports.jsx(Button,{sx:{justifyContent:"flex-start",width:"100%",..._e(1)},onClick:()=>Wt(async()=>{const Zt=getFilename(Nt.name),{size:Qt}=await Ut(!1,Zt);download(JSON.stringify(await Xt(Qt)),`${Zt}.workspace.meta`),qt(`Metadata saved, ${Zt}.workspace.meta`)}),startIcon:jsxRuntimeExports.jsx(DownloadOutlined,{}),size:"large",children:jsxRuntimeExports.jsxs(Stack$1,{sx:{ml:1},alignItems:"baseline",children:[Nt.name||"Untitled",jsxRuntimeExports.jsxs(Type$1,{color:"text.secondary",children:[getFilename(Nt.name),".workspace"]}),jsxRuntimeExports.jsxs(Type$1,{color:"text.secondary",children:[lodashExports$1.ceil(Yt/1024/1024,2)," MB"]})]})})})]})]})}function ExportWorkspaceModal(_e){return jsxRuntimeExports.jsxs(Modal,{..._e,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:()=>{var Pt;return(Pt=_e==null?void 0:_e.onClose)==null?void 0:Pt.call(_e,{},"backdropClick")},children:jsxRuntimeExports.jsx(Type$1,{variant:"h6",children:"Publish Workspace"})}),jsxRuntimeExports.jsx(A$3,{})]})}function MenuEntry({startIcon:_e,endIcon:Pt,label:Dt}){return jsxRuntimeExports.jsxs(Stack$1,{direction:"row",gap:1,children:[!!_e&&reactExports.cloneElement(_e,{fontSize:"small",color:"disabled"}),jsxRuntimeExports.jsx("span",{children:Dt}),!!Pt&&reactExports.cloneElement(Pt,{fontSize:"small",color:"disabled"})]})}function useTitleBarVisible(){const[_e,Pt]=reactExports.useState(!1);return reactExports.useEffect(()=>{if("windowControlsOverlay"in navigator){const Dt=()=>{Pt(!!navigator.windowControlsOverlay.visible)};return navigator.windowControlsOverlay.addEventListener("geometrychange",Dt),Dt(),()=>navigator.windowControlsOverlay.removeEventListener("geometrychange",Dt)}},[Pt]),_e}const TitleBar=()=>{const{save:_e,load:Pt}=useWorkspace(),Dt=useTitleBarVisible(),[,Nt]=useView(),[jt,Ut]=reactExports.useState(!1);function Gt(Wt){Nt(({view:qt})=>({view:{type:"branch",orientation:Wt,key:nanoid$1(),children:[{...qt,size:80},{type:"leaf",key:nanoid$1(),content:{type:""},size:20,acceptDrop:!0}]}}))}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box$1,{sx:{mx:.5,borderBottom:Wt=>`1px solid ${Wt.palette.background.default}`,minHeight:36,height:Dt?"env(titlebar-area-height, 50px)":0,width:"env(titlebar-area-width, 100%)",WebkitAppRegion:"drag",overflowX:"auto"},children:jsxRuntimeExports.jsx(Scroll,{x:!0,style:{height:"100%"},children:jsxRuntimeExports.jsx(Box$1,{sx:{height:"100%"},children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",spacing:1,sx:{height:"100%"},alignItems:"center",justifyContent:"flex-start",children:[jsxRuntimeExports.jsx(Box$1,{sx:{p:1,height:"100%",maxWidth:"min-content"},children:jsxRuntimeExports.jsx("img",{src:logo,style:{height:"100%"}})}),[{key:"view",items:[{type:"action",key:"panel-new-right",name:"Add panel to the right",action:()=>Gt("horizontal")},{type:"action",key:"panel-new-bottom",name:"Add panel below",action:()=>Gt("vertical")},{type:"divider"},{type:"action",name:"Reset layout",key:"panel-reset",action:()=>Nt(getDefaultViewTree)}]},{key:"workspace",items:[{type:"action",name:"Open workspace",key:"workspace-load",action:Pt},{type:"action",name:"Save workspace",key:"workspace-save",action:_e},{type:"action",name:jsxRuntimeExports.jsx(MenuEntry,{label:"Publish workspace",endIcon:jsxRuntimeExports.jsx(OpenInNewOutlined,{})}),key:"workspace-save-metadata",action:()=>Ut(!0)}]},{key:"help",items:[{type:"action",name:"Open repository in GitHub",key:"github",action:()=>open(repository,"_blank")},{type:"action",name:"Changelog",key:"changelog",action:()=>open(`${docs}/changelog-${version}.md`,"_blank")},{type:"action",name:"Documentation",key:"documentation",action:()=>open("https://path-visualiser.github.io/docs/overview/","_blank")}]}].map(({key:Wt,items:qt})=>jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Yt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Menu$1,{...bindMenu(Yt),children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{p:0},children:qt.map((Xt,Zt)=>{if(Xt.type==="action"){const{name:Qt,key:en,action:tn}=Xt;return jsxRuntimeExports.jsx(MenuItem$1,{onClick:()=>{tn==null||tn(),Yt.close()},children:Qt},en)}else return jsxRuntimeExports.jsx(Divider$1,{},Zt)})})}),jsxRuntimeExports.jsx(FeaturePickerButton,{...bindTrigger(Yt),sx:{WebkitAppRegion:"no-drag",minWidth:"fit-content",p:.5,px:1},children:lodashExports$1.startCase(Wt)})]})},Wt))]})})})}),jsxRuntimeExports.jsx(ExportWorkspaceModal,{open:jt,onClose:()=>Ut(!1)})]})};function AppBarTitle({children:_e}){return jsxRuntimeExports.jsx(Type$1,{variant:"h6",children:_e})}function ModalAppBar({onClose:_e=()=>{},style:Pt,elevatedStyle:Dt,children:Nt,transitionProperties:jt=["box-shadow","background","border-bottom"],elevatedChildren:Ut,simple:Gt,position:Wt="sticky"}){const qt=useSmallDisplay(),Yt=usePanel(),Xt=useTheme(),[,,Zt,,Qt]=useScrollState();reactExports.useEffect(()=>{Qt(Yt)},[Yt,Qt]);const en=Zt?{background:qt?Xt.palette.background.default:Xt.palette.background.paper,...!Gt&&{boxShadow:Xt.shadows[0]},...Pt}:{background:qt?Xt.palette.background.default:Xt.palette.background.paper,...!Gt&&{boxShadow:Xt.shadows[4]},...Dt};function tn(nn){return typeof nn=="string"?jsxRuntimeExports.jsx(AppBarTitle,{children:nn}):nn}return jsxRuntimeExports.jsx(AppBar$1,{elevation:0,position:Wt,style:{color:Xt.palette.text.primary,transition:Xt.transitions.create(jt),...en},children:jsxRuntimeExports.jsxs(Toolbar$1,{children:[jsxRuntimeExports.jsx(IconButton$1,{style:{marginRight:Xt.spacing(1)},"aria-label":"open drawer",edge:"start",onClick:()=>_e(),children:jsxRuntimeExports.jsx(ArrowBack,{})}),Nt&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(!Ut||Zt),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:tn(Nt)})})}),Ut&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(Ut&&!Zt),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:tn(Ut)})})})]})})}function Modal({children:_e,actions:Pt,width:Dt=480,height:Nt,variant:jt="default",scrollable:Ut=!0,...Gt}){var mn;const[Wt,qt]=reactExports.useState(void 0);reactExports.useEffect(()=>{_e&&qt(_e)},[_e]);const Yt=useTheme(),Xt=useSmallDisplay(),[Zt,Qt]=reactExports.useState(null),[en,tn]=reactExports.useState(null),[nn,rn]=reactExports.useState(!1),[an,sn]=reactExports.useState(0),ln=useTitleBarVisible();reactExports.useEffect(()=>{if(Zt&&en&&!Xt&&!Nt){const gn=()=>{const hn=window.innerHeight-64{window.removeEventListener("resize",gn),un.detach()}}},[Zt,en,Xt,Nt]);const dn=jt==="submodal"&&Xt;return jsxRuntimeExports.jsxs(Dialog$1,{fullScreen:Xt,...Gt,keepMounted:!1,TransitionProps:{unmountOnExit:!0,mountOnEnter:!0},style:{...dn&&{paddingTop:Yt.spacing(8)},...Gt.style},PaperProps:{ref:gn=>Qt(gn),style:{...dn&&{borderRadius:`${Yt.shape.borderRadius}px ${Yt.shape.borderRadius}px 0 0`},background:Xt?Yt.palette.background.default:Yt.palette.background.paper,overflow:"hidden",height:Nt&&!Xt?Nt:nn||Xt?"100%":an||"fit-content",position:"relative",maxWidth:"none",...Xt&&ln&&{paddingTop:36},...(mn=Gt.PaperProps)==null?void 0:mn.style},...Gt.PaperProps},children:[jsxRuntimeExports.jsx(Scroll,{y:!0,style:{height:"100%",width:Xt?void 0:Dt,maxWidth:"100%",overflow:Ut?void 0:"hidden"},children:jsxRuntimeExports.jsx("div",{ref:gn=>tn(gn),style:{width:"100%"},children:Wt})}),Pt]})}function ManagedModal({appBar:_e,trigger:Pt=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),children:Dt,popover:Nt,slotProps:jt}){const Ut=usePaper(),Gt=useAcrylic(),Wt=useSmallDisplay(),qt=Nt&&!Wt;return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Yt=>{var en,tn;const{open:Xt,close:Zt,isOpen:Qt}=Yt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[reactExports.cloneElement(Pt(Xt,Qt)),qt?jsxRuntimeExports.jsx(Popover$1,{...lodashExports$1.merge(bindPopover(Yt),{slotProps:{paper:{sx:{...Gt}}}},jt==null?void 0:jt.popover),children:jsxRuntimeExports.jsx(Box$1,{...lodashExports$1.merge({sx:{width:360,...Ut(1)}},jt==null?void 0:jt.paper),children:Dt??((en=jt==null?void 0:jt.modal)==null?void 0:en.children)})}):jsxRuntimeExports.jsxs(Modal,{open:Qt,onClose:Zt,...jt==null?void 0:jt.modal,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:Zt,..._e}),Dt??((tn=jt==null?void 0:jt.modal)==null?void 0:tn.children)]})]})}})}var rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote$1(_e){return rx_escapable.lastIndex=0,rx_escapable.test(_e)?'"'+_e.replace(rx_escapable,function(Pt){var Dt=meta[Pt];return typeof Dt=="string"?Dt:"\\u"+("0000"+Pt.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+_e+'"'}function str$1(_e,Pt,Dt){var Nt,jt,Ut,Gt,Wt=gap,qt,Yt=Pt[_e];switch(Yt&&typeof Yt=="object"&&typeof Yt.toJSON=="function"&&(Yt=Yt.toJSON(_e)),typeof rep=="function"&&(Yt=rep.call(Pt,_e,Yt)),typeof Yt){case"string":return quote$1(Yt);case"number":return isFinite(Yt)?String(Yt):"null";case"boolean":case"null":return String(Yt);case"object":if(!Yt)return"null";if(gap+=indent,qt=[],Object.prototype.toString.apply(Yt)==="[object Array]"){for(Gt=Yt.length,Nt=0;NtDt?`[ +`)===0?Pn.substr(1,Pn.length):Pn}).forEach(function(Pn){var Cn=Pn.split(":"),Gn=Cn.shift().trim();if(Gn){var In=Cn.join(":").trim();Nn.append(Gn,In)}}),Nn)};An.url="responseURL"in Tn?Tn.responseURL:An.headers.get("X-Request-URL");var Dn="response"in Tn?Tn.response:Tn.responseText;setTimeout(function(){bn(new ln(Dn,An))},0)},Tn.onerror=function(){setTimeout(function(){En(new TypeError("Network request failed"))},0)},Tn.ontimeout=function(){setTimeout(function(){En(new TypeError("Network request failed"))},0)},Tn.onabort=function(){setTimeout(function(){En(new mn("Aborted","AbortError"))},0)},Tn.open(_n.method,function(pn){try{return pn===""&&Nt.location.href?Nt.location.href:pn}catch{return pn}}(_n.url),!0),_n.credentials==="include"?Tn.withCredentials=!0:_n.credentials==="omit"&&(Tn.withCredentials=!1),"responseType"in Tn&&(jt.blob?Tn.responseType="blob":jt.arrayBuffer&&_n.headers.get("Content-Type")&&_n.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(Tn.responseType="arraybuffer")),!hn||typeof hn.headers!="object"||hn.headers instanceof Xt?_n.headers.forEach(function(pn,Nn){Tn.setRequestHeader(Nn,pn)}):Object.getOwnPropertyNames(hn.headers).forEach(function(pn){Tn.setRequestHeader(pn,qt(hn.headers[pn]))}),_n.signal&&(_n.signal.addEventListener("abort",$n),Tn.onreadystatechange=function(){Tn.readyState===4&&_n.signal.removeEventListener("abort",$n)}),Tn.send(_n._bodyInit===void 0?null:_n._bodyInit)})}gn.polyfill=!0,Nt.fetch||(Nt.fetch=gn,Nt.Headers=Xt,Nt.Request=an,Nt.Response=ln)},6290:(_e,Pt,Dt)=>{var Nt=Dt(5048),jt=Dt(9748),Ut=Dt(4655),Gt=Dt(1960);function Wt(Xt,Zt,Qt){var en=Xt;return jt(Zt)?(Qt=Zt,typeof Xt=="string"&&(en={uri:Xt})):en=Gt(Zt,{uri:Xt}),en.callback=Qt,en}function qt(Xt,Zt,Qt){return Yt(Zt=Wt(Xt,Zt,Qt))}function Yt(Xt){if(Xt.callback===void 0)throw new Error("callback argument missing");var Zt=!1,Qt=function(_n,Tn,$n){Zt||(Zt=!0,Xt.callback(_n,Tn,$n))};function en(){var _n=void 0;if(_n=sn.response?sn.response:sn.responseText||function(Tn){try{if(Tn.responseType==="document")return Tn.responseXML;var $n=Tn.responseXML&&Tn.responseXML.documentElement.nodeName==="parsererror";if(Tn.responseType===""&&!$n)return Tn.responseXML}catch{}return null}(sn),bn)try{_n=JSON.parse(_n)}catch{}return _n}function tn(_n){return clearTimeout(ln),_n instanceof Error||(_n=new Error(""+(_n||"Unknown XMLHttpRequest Error"))),_n.statusCode=0,Qt(_n,En)}function nn(){if(!an){var _n;clearTimeout(ln),_n=Xt.useXDR&&sn.status===void 0?200:sn.status===1223?204:sn.status;var Tn=En,$n=null;return _n!==0?(Tn={body:en(),statusCode:_n,method:mn,headers:{},url:dn,rawRequest:sn},sn.getAllResponseHeaders&&(Tn.headers=Ut(sn.getAllResponseHeaders()))):$n=new Error("Internal XMLHttpRequest Error"),Qt($n,Tn,Tn.body)}}var rn,an,sn=Xt.xhr||null;sn||(sn=Xt.cors||Xt.useXDR?new qt.XDomainRequest:new qt.XMLHttpRequest);var ln,dn=sn.url=Xt.uri||Xt.url,mn=sn.method=Xt.method||"GET",gn=Xt.body||Xt.data,un=sn.headers=Xt.headers||{},hn=!!Xt.sync,bn=!1,En={body:void 0,headers:{},statusCode:0,method:mn,url:dn,rawRequest:sn};if("json"in Xt&&Xt.json!==!1&&(bn=!0,un.accept||un.Accept||(un.Accept="application/json"),mn!=="GET"&&mn!=="HEAD"&&(un["content-type"]||un["Content-Type"]||(un["Content-Type"]="application/json"),gn=JSON.stringify(Xt.json===!0?gn:Xt.json))),sn.onreadystatechange=function(){sn.readyState===4&&setTimeout(nn,0)},sn.onload=nn,sn.onerror=tn,sn.onprogress=function(){},sn.onabort=function(){an=!0},sn.ontimeout=tn,sn.open(mn,dn,!hn,Xt.username,Xt.password),hn||(sn.withCredentials=!!Xt.withCredentials),!hn&&Xt.timeout>0&&(ln=setTimeout(function(){if(!an){an=!0,sn.abort("timeout");var _n=new Error("XMLHttpRequest timeout");_n.code="ETIMEDOUT",tn(_n)}},Xt.timeout)),sn.setRequestHeader)for(rn in un)un.hasOwnProperty(rn)&&sn.setRequestHeader(rn,un[rn]);else if(Xt.headers&&!function(_n){for(var Tn in _n)if(_n.hasOwnProperty(Tn))return!1;return!0}(Xt.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in Xt&&(sn.responseType=Xt.responseType),"beforeSend"in Xt&&typeof Xt.beforeSend=="function"&&Xt.beforeSend(sn),sn.send(gn||null),sn}_e.exports=qt,_e.exports.default=qt,qt.XMLHttpRequest=Nt.XMLHttpRequest||function(){},qt.XDomainRequest="withCredentials"in new qt.XMLHttpRequest?qt.XMLHttpRequest:Nt.XDomainRequest,function(Xt,Zt){for(var Qt=0;Qt{_e.exports=self.DOMParser!==void 0?function(Pt){return new self.DOMParser().parseFromString(Pt,"application/xml")}:self.ActiveXObject!==void 0&&new self.ActiveXObject("Microsoft.XMLDOM")?function(Pt){var Dt=new self.ActiveXObject("Microsoft.XMLDOM");return Dt.async="false",Dt.loadXML(Pt),Dt}:function(Pt){var Dt=document.createElement("div");return Dt.innerHTML=Pt,Dt}},1960:_e=>{_e.exports=function(){for(var Dt={},Nt=0;Nt{},6777:()=>{},5546:()=>{},2460:(_e,Pt,Dt)=>{var Nt=Dt(4406),jt=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Gt=Object.getOwnPropertyNames,Wt=Object.prototype.hasOwnProperty,qt=(Mn,dr)=>{for(var br in dr)jt(Mn,br,{get:dr[br],enumerable:!0})},Yt=(Mn=>(dr,br)=>Mn&&Mn.get(dr)||(br=((Ir,Nr,Yr,zr)=>{if(Nr&&typeof Nr=="object"||typeof Nr=="function")for(let _i of Gt(Nr))Wt.call(Ir,_i)||jt(Ir,_i,{get:()=>Nr[_i],enumerable:!(zr=Ut(Nr,_i))||zr.enumerable});return Ir})(jt({},"__esModule",{value:!0}),dr),Mn&&Mn.set(dr,br),br))(typeof WeakMap<"u"?new WeakMap:0),Xt=(Mn,dr,br)=>(((Ir,Nr,Yr)=>{Nr in Ir?jt(Ir,Nr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):Ir[Nr]=Yr})(Mn,typeof dr!="symbol"?dr+"":dr,br),br),Zt={};qt(Zt,{applyPalette:()=>wu,applyPaletteSync:()=>Ml,buildPalette:()=>_u,buildPaletteSync:()=>bs,constants:()=>Qt,conversion:()=>an,distance:()=>Rn,image:()=>xa,palette:()=>hr,quality:()=>$a,utils:()=>ir});var Qt={};qt(Qt,{bt709:()=>en});var en={};qt(en,{Y:()=>tn,x:()=>nn,y:()=>rn});var tn=(Mn=>(Mn[Mn.RED=.2126]="RED",Mn[Mn.GREEN=.7152]="GREEN",Mn[Mn.BLUE=.0722]="BLUE",Mn[Mn.WHITE=1]="WHITE",Mn))(tn||{}),nn=(Mn=>(Mn[Mn.RED=.64]="RED",Mn[Mn.GREEN=.3]="GREEN",Mn[Mn.BLUE=.15]="BLUE",Mn[Mn.WHITE=.3127]="WHITE",Mn))(nn||{}),rn=(Mn=>(Mn[Mn.RED=.33]="RED",Mn[Mn.GREEN=.6]="GREEN",Mn[Mn.BLUE=.06]="BLUE",Mn[Mn.WHITE=.329]="WHITE",Mn))(rn||{}),an={};function sn(Mn){return Mn>.04045?((Mn+.055)/1.055)**2.4:Mn/12.92}function ln(Mn,dr,br){return{x:.4124*(Mn=sn(Mn/255))+.3576*(dr=sn(dr/255))+.1805*(br=sn(br/255)),y:.2126*Mn+.7152*dr+.0722*br,z:.0193*Mn+.1192*dr+.9505*br}}qt(an,{lab2rgb:()=>Sn,lab2xyz:()=>Zn,rgb2hsl:()=>Tn,rgb2lab:()=>Pn,rgb2xyz:()=>ln,xyz2lab:()=>Dn,xyz2rgb:()=>ar});var dn={};function mn(Mn){return Mn*(Math.PI/180)}function gn(Mn,dr,br){let Ir=Mn;return Irdr&&(Ir=dr),Ir>br&&(Ir=br),Ir}function hn(Mn,dr,br){return Mn>br&&(Mn=br),Mn255?Mn=255:Mn<0&&(Mn=0),Mn}function En(Mn){return Mn>255?Mn=255:Mn<0&&(Mn=0),Mn}function _n(Mn,dr){const br=typeof Mn[0];let Ir;if(br==="number"||br==="string"){const Nr=Object.create(null);for(let Yr=0,zr=Mn.length;Yrdr(Yr,zr)||Nr[Yr]-Nr[zr])}else{const Nr=Mn.slice(0);Ir=Mn.sort((Yr,zr)=>dr(Yr,zr)||Nr.indexOf(Yr)-Nr.indexOf(zr))}return Ir}function Tn(Mn,dr,br){const Ir=un(Mn,dr,br),Nr=gn(Mn,dr,br),Yr=Nr-Ir,zr=(Ir+Nr)/510;let _i=0;zr>0&&zr<1&&(_i=Yr/(zr<.5?Nr+Ir:510-Nr-Ir));let qr=0;return Yr>0&&(qr=Nr===Mn?(dr-br)/Yr:Nr===dr?2+(br-Mn)/Yr:4+(Mn-dr)/Yr,qr*=60,qr<0&&(qr+=360)),{h:qr,s:_i,l:zr}}qt(dn,{degrees2radians:()=>mn,inRange0to255:()=>En,inRange0to255Rounded:()=>bn,intInRange:()=>hn,max3:()=>gn,min3:()=>un,stableSort:()=>_n});var $n=.95047,pn=1,Nn=1.08883;function An(Mn){return Mn>.008856?Mn**.3333333333333333:7.787*Mn+.13793103448275862}function Dn(Mn,dr,br){if(Mn=An(Mn/$n),dr=An(dr/pn),br=An(br/Nn),116*dr-16<0)throw new Error("xxx");return{L:Math.max(0,116*dr-16),a:500*(Mn-dr),b:200*(dr-br)}}function Pn(Mn,dr,br){const Ir=ln(Mn,dr,br);return Dn(Ir.x,Ir.y,Ir.z)}var Cn=.95047,Gn=1,In=1.08883;function Bn(Mn){return Mn>.206893034?Mn**3:(Mn-.13793103448275862)/7.787}function Zn(Mn,dr,br){const Ir=(Mn+16)/116,Nr=Ir-br/200;return{x:Cn*Bn(dr/500+Ir),y:Gn*Bn(Ir),z:In*Bn(Nr)}}function nr(Mn){return Mn>.0031308?1.055*Mn**.4166666666666667-.055:12.92*Mn}function ar(Mn,dr,br){const Ir=nr(3.2406*Mn+-1.5372*dr+-.4986*br),Nr=nr(-.9689*Mn+1.8758*dr+.0415*br),Yr=nr(.0557*Mn+-.204*dr+1.057*br);return{r:bn(255*Ir),g:bn(255*Nr),b:bn(255*Yr)}}function Sn(Mn,dr,br){const Ir=Zn(Mn,dr,br);return ar(Ir.x,Ir.y,Ir.z)}var Rn={};qt(Rn,{AbstractDistanceCalculator:()=>On,AbstractEuclidean:()=>kn,AbstractManhattan:()=>gr,CIE94GraphicArts:()=>vn,CIE94Textiles:()=>yn,CIEDE2000:()=>Un,CMetric:()=>Kn,Euclidean:()=>tr,EuclideanBT709:()=>or,EuclideanBT709NoAlpha:()=>Jn,Manhattan:()=>Er,ManhattanBT709:()=>Rr,ManhattanNommyde:()=>Sr,PNGQuant:()=>sr});var On=class{constructor(){Xt(this,"_maxDistance"),Xt(this,"_whitePoint"),this._setDefaults(),this.setWhitePoint(255,255,255,255)}setWhitePoint(Mn,dr,br,Ir){this._whitePoint={r:Mn>0?255/Mn:0,g:dr>0?255/dr:0,b:br>0?255/br:0,a:Ir>0?255/Ir:0},this._maxDistance=this.calculateRaw(Mn,dr,br,Ir,0,0,0,0)}calculateNormalized(Mn,dr){return this.calculateRaw(Mn.r,Mn.g,Mn.b,Mn.a,dr.r,dr.g,dr.b,dr.a)/this._maxDistance}},Vn=class extends On{calculateRaw(Mn,dr,br,Ir,Nr,Yr,zr,_i){const qr=Pn(En(Mn*this._whitePoint.r),En(dr*this._whitePoint.g),En(br*this._whitePoint.b)),so=Pn(En(Nr*this._whitePoint.r),En(Yr*this._whitePoint.g),En(zr*this._whitePoint.b)),eo=qr.L-so.L,io=qr.a-so.a,yo=qr.b-so.b,Bo=Math.sqrt(qr.a*qr.a+qr.b*qr.b),Mo=Bo-Math.sqrt(so.a*so.a+so.b*so.b);let xo=io*io+yo*yo-Mo*Mo;xo=xo<0?0:Math.sqrt(xo);const wo=(_i-Ir)*this._whitePoint.a*this._kA;return Math.sqrt((eo/this._Kl)**2+(Mo/(1+this._K1*Bo))**2+(xo/(1+this._K2*Bo))**2+wo**2)}},yn=class extends Vn{_setDefaults(){this._Kl=2,this._K1=.048,this._K2=.014,this._kA=12.5/255}},vn=class extends Vn{_setDefaults(){this._Kl=1,this._K1=.045,this._K2=.015,this._kA=25/255}},wn=class extends On{_setDefaults(){}static _calculatehp(Mn,dr){const br=Math.atan2(Mn,dr);return br>=0?br:br+wn._deg360InRad}static _calculateRT(Mn,dr){const br=dr**7,Ir=2*Math.sqrt(br/(br+wn._pow25to7)),Nr=wn._deg30InRad*Math.exp(-(((Mn-wn._deg275InRad)/wn._deg25InRad)**2));return-Math.sin(2*Nr)*Ir}static _calculateT(Mn){return 1-.17*Math.cos(Mn-wn._deg30InRad)+.24*Math.cos(2*Mn)+.32*Math.cos(3*Mn+wn._deg6InRad)-.2*Math.cos(4*Mn-wn._deg63InRad)}static _calculate_ahp(Mn,dr,br,Ir){const Nr=br+Ir;return Mn===0?Nr:dr<=wn._deg180InRad?Nr/2:Nr>8)+4*eo*eo+((767-qr)*io*io>>8),Bo=(_i-Ir)*this._whitePoint.a;return Math.sqrt(yo+Bo*Bo)}_setDefaults(){}},kn=class extends On{calculateRaw(Mn,dr,br,Ir,Nr,Yr,zr,_i){const qr=Nr-Mn,so=Yr-dr,eo=zr-br,io=_i-Ir;return Math.sqrt(this._kR*qr*qr+this._kG*so*so+this._kB*eo*eo+this._kA*io*io)}},tr=class extends kn{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},or=class extends kn{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},Jn=class extends kn{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=0}},gr=class extends On{calculateRaw(Mn,dr,br,Ir,Nr,Yr,zr,_i){let qr=Nr-Mn,so=Yr-dr,eo=zr-br,io=_i-Ir;return qr<0&&(qr=0-qr),so<0&&(so=0-so),eo<0&&(eo=0-eo),io<0&&(io=0-io),this._kR*qr+this._kG*so+this._kB*eo+this._kA*io}},Er=class extends gr{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},Sr=class extends gr{_setDefaults(){this._kR=.4984,this._kG=.8625,this._kB=.2979,this._kA=1}},Rr=class extends gr{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},sr=class extends On{calculateRaw(Mn,dr,br,Ir,Nr,Yr,zr,_i){const qr=(_i-Ir)*this._whitePoint.a;return this._colordifferenceCh(Mn*this._whitePoint.r,Nr*this._whitePoint.r,qr)+this._colordifferenceCh(dr*this._whitePoint.g,Yr*this._whitePoint.g,qr)+this._colordifferenceCh(br*this._whitePoint.b,zr*this._whitePoint.b,qr)}_colordifferenceCh(Mn,dr,br){const Ir=Mn-dr,Nr=Ir+br;return Ir*Ir+Nr*Nr}_setDefaults(){}},hr={};qt(hr,{AbstractPaletteQuantizer:()=>Tr,ColorHistogram:()=>no,NeuQuant:()=>ur,NeuQuantFloat:()=>to,RGBQuant:()=>Lr,WuColorCube:()=>Ao,WuQuant:()=>qo});var Tr=class{quantizeSync(){for(const Mn of this.quantize())if(Mn.palette)return Mn.palette;throw new Error("unreachable")}},Mr=class{constructor(){Xt(this,"r"),Xt(this,"g"),Xt(this,"b"),Xt(this,"a"),Xt(this,"uint32"),Xt(this,"rgba"),this.uint32=-1>>>0,this.r=this.g=this.b=this.a=0,this.rgba=new Array(4),this.rgba[0]=0,this.rgba[1]=0,this.rgba[2]=0,this.rgba[3]=0}static createByQuadruplet(Mn){const dr=new Mr;return dr.r=0|Mn[0],dr.g=0|Mn[1],dr.b=0|Mn[2],dr.a=0|Mn[3],dr._loadUINT32(),dr._loadQuadruplet(),dr}static createByRGBA(Mn,dr,br,Ir){const Nr=new Mr;return Nr.r=0|Mn,Nr.g=0|dr,Nr.b=0|br,Nr.a=0|Ir,Nr._loadUINT32(),Nr._loadQuadruplet(),Nr}static createByUint32(Mn){const dr=new Mr;return dr.uint32=Mn>>>0,dr._loadRGBA(),dr._loadQuadruplet(),dr}from(Mn){this.r=Mn.r,this.g=Mn.g,this.b=Mn.b,this.a=Mn.a,this.uint32=Mn.uint32,this.rgba[0]=Mn.r,this.rgba[1]=Mn.g,this.rgba[2]=Mn.b,this.rgba[3]=Mn.a}getLuminosity(Mn){let dr=this.r,br=this.g,Ir=this.b;return Mn&&(dr=Math.min(255,255-this.a+this.a*dr/255),br=Math.min(255,255-this.a+this.a*br/255),Ir=Math.min(255,255-this.a+this.a*Ir/255)),.2126*dr+.7152*br+.0722*Ir}_loadUINT32(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0}_loadRGBA(){this.r=255&this.uint32,this.g=this.uint32>>>8&255,this.b=this.uint32>>>16&255,this.a=this.uint32>>>24&255}_loadQuadruplet(){this.rgba[0]=this.r,this.rgba[1]=this.g,this.rgba[2]=this.b,this.rgba[3]=this.a}},qn=class{constructor(){Xt(this,"_pointArray"),Xt(this,"_width"),Xt(this,"_height"),this._width=0,this._height=0,this._pointArray=[]}getWidth(){return this._width}getHeight(){return this._height}setWidth(Mn){this._width=Mn}setHeight(Mn){this._height=Mn}getPointArray(){return this._pointArray}clone(){const Mn=new qn;Mn._width=this._width,Mn._height=this._height;for(let dr=0,br=this._pointArray.length;dr=Nr&&Mn=0;dr--)if(Mn.uint32===this._pointArray[dr].uint32)return!0;return!1}getNearestColor(Mn,dr){return this._pointArray[0|this._getNearestIndex(Mn,dr)]}getPointContainer(){return this._pointContainer}_nearestPointFromCache(Mn){return typeof this._i32idx[Mn]=="number"?this._i32idx[Mn]:-1}_getNearestIndex(Mn,dr){let br=this._nearestPointFromCache(""+dr.uint32);if(br>=0)return br;let Ir=Number.MAX_VALUE;br=0;for(let Nr=0,Yr=this._pointArray.length;Nr{const br=Tn(Mn.r,Mn.g,Mn.b),Ir=Tn(dr.r,dr.g,dr.b),Nr=Mn.r===Mn.g&&Mn.g===Mn.b?0:1+Ln(br.h,10),Yr=(dr.r===dr.g&&dr.g===dr.b?0:1+Ln(Ir.h,10))-Nr;if(Yr)return-Yr;const zr=Mn.getLuminosity(!0),_i=dr.getLuminosity(!0);if(_i-zr!=0)return _i-zr;const qr=(100*Ir.s|0)-(100*br.s|0);return qr?-qr:0})}},ir={};qt(ir,{HueStatistics:()=>kr,Palette:()=>jn,Point:()=>Mr,PointContainer:()=>qn,ProgressTracker:()=>Wn,arithmetic:()=>dn});var mr=class{constructor(){Xt(this,"num",0),Xt(this,"cols",[])}},kr=class{constructor(Mn,dr){Xt(this,"_numGroups"),Xt(this,"_minCols"),Xt(this,"_stats"),Xt(this,"_groupsFull"),this._numGroups=Mn,this._minCols=dr,this._stats=[];for(let br=0;br<=Mn;br++)this._stats[br]=new mr;this._groupsFull=0}check(Mn){this._groupsFull===this._numGroups+1&&(this.check=()=>{});const dr=255&Mn,br=Mn>>>8&255,Ir=Mn>>>16&255,Nr=dr===br&&br===Ir?0:1+Ln(Tn(dr,br,Ir).h,this._numGroups),Yr=this._stats[Nr],zr=this._minCols;Yr.num++,Yr.num>zr||(Yr.num===zr&&this._groupsFull++,Yr.num<=zr&&this._stats[Nr].cols.push(Mn))}injectIntoDictionary(Mn){for(let dr=0;dr<=this._numGroups;dr++)this._stats[dr].num<=this._minCols&&this._stats[dr].cols.forEach(br=>{Mn[br]?Mn[br]++:Mn[br]=1})}injectIntoArray(Mn){for(let dr=0;dr<=this._numGroups;dr++)this._stats[dr].num<=this._minCols&&this._stats[dr].cols.forEach(br=>{Mn.indexOf(br)===-1&&Mn.push(br)})}},Cr=class{constructor(Mn,dr){Xt(this,"progress"),Xt(this,"_step"),Xt(this,"_range"),Xt(this,"_last"),Xt(this,"_progressRange"),this._range=Mn,this._progressRange=dr,this._step=Math.max(1,this._range/(Cr.steps+1)|0),this._last=-this._step,this.progress=0}shouldNotify(Mn){return Mn-this._last>=this._step&&(this._last=Mn,this.progress=Math.min(this._progressRange*this._last/this._range,this._progressRange),!0)}},Wn=Cr;Xt(Wn,"steps",100);var vr=class{constructor(Mn){Xt(this,"r"),Xt(this,"g"),Xt(this,"b"),Xt(this,"a"),this.r=this.g=this.b=this.a=Mn}toPoint(){return Mr.createByRGBA(this.r>>3,this.g>>3,this.b>>3,this.a>>3)}subtract(Mn,dr,br,Ir){this.r-=0|Mn,this.g-=0|dr,this.b-=0|br,this.a-=0|Ir}},Xn=class extends Tr{constructor(Mn,dr=256){super(),Xt(this,"_pointArray"),Xt(this,"_networkSize"),Xt(this,"_network"),Xt(this,"_sampleFactor"),Xt(this,"_radPower"),Xt(this,"_freq"),Xt(this,"_bias"),Xt(this,"_distance"),this._distance=Mn,this._pointArray=[],this._sampleFactor=1,this._networkSize=dr,this._distance.setWhitePoint(2040,2040,2040,2040)}sample(Mn){this._pointArray=this._pointArray.concat(Mn.getPointArray())}*quantize(){this._init(),yield*this._learn(),yield{palette:this._buildPalette(),progress:100}}_init(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(let Mn=0;Mn>3)*Xn._radiusBias,qr=_i>>Xn._radiusBiasShift;qr<=1&&(qr=0);for(let eo=0;eo>>0;Nr=dr=dr&&(io-=dr),eo++,Yr===0&&(Yr=1),eo%Yr==0){zr-=zr/br|0,_i-=_i/Xn._radiusDecrease|0,qr=_i>>Xn._radiusBiasShift,qr<=1&&(qr=0);for(let rs=0;rs>>0}}}_buildPalette(){const Mn=new jn;return this._network.forEach(dr=>{Mn.add(dr.toPoint())}),Mn.sort(),Mn}_alterNeighbour(Mn,dr,br,Ir,Nr,Yr){let zr=dr-Mn;zr<-1&&(zr=-1);let _i=dr+Mn;_i>this._networkSize&&(_i=this._networkSize);let qr=dr+1,so=dr-1,eo=1;for(;qr<_i||so>zr;){const io=this._radPower[eo++]/Xn._alphaRadBias;if(qr<_i){const yo=this._network[qr++];yo.subtract(io*(yo.r-Nr),io*(yo.g-Ir),io*(yo.b-br),io*(yo.a-Yr))}if(so>zr){const yo=this._network[so--];yo.subtract(io*(yo.r-Nr),io*(yo.g-Ir),io*(yo.b-br),io*(yo.a-Yr))}}}_alterSingle(Mn,dr,br,Ir,Nr,Yr){Mn/=Xn._initAlpha;const zr=this._network[dr];zr.subtract(Mn*(zr.r-Nr),Mn*(zr.g-Ir),Mn*(zr.b-br),Mn*(zr.a-Yr))}_contest(Mn,dr,br,Ir){let Nr=2147483647,Yr=Nr,zr=-1,_i=zr;for(let qr=0;qr>Xn._initialBiasShift-3);io>Xn._betaShift;this._freq[qr]-=yo,this._bias[qr]+=yo<>Xn._betaShift),Xt(ur,"_betaGamma",Xn._initialBias<>3,this.g>>3,this.b>>3,this.a>>3)}subtract(Mn,dr,br,Ir){this.r-=Mn,this.g-=dr,this.b-=br,this.a-=Ir}},Or=class extends Tr{constructor(Mn,dr=256){super(),Xt(this,"_pointArray"),Xt(this,"_networkSize"),Xt(this,"_network"),Xt(this,"_sampleFactor"),Xt(this,"_radPower"),Xt(this,"_freq"),Xt(this,"_bias"),Xt(this,"_distance"),this._distance=Mn,this._pointArray=[],this._sampleFactor=1,this._networkSize=dr,this._distance.setWhitePoint(2040,2040,2040,2040)}sample(Mn){this._pointArray=this._pointArray.concat(Mn.getPointArray())}*quantize(){this._init(),yield*this._learn(),yield{palette:this._buildPalette(),progress:100}}_init(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(let Mn=0;Mn>3)*Or._radiusBias,qr=_i>>Or._radiusBiasShift;qr<=1&&(qr=0);for(let eo=0;eo=dr&&(io-=dr),eo++,Yr===0&&(Yr=1),eo%Yr==0){zr-=zr/br,_i-=_i/Or._radiusDecrease,qr=_i>>Or._radiusBiasShift,qr<=1&&(qr=0);for(let rs=0;rs{Mn.add(dr.toPoint())}),Mn.sort(),Mn}_alterNeighbour(Mn,dr,br,Ir,Nr,Yr){let zr=dr-Mn;zr<-1&&(zr=-1);let _i=dr+Mn;_i>this._networkSize&&(_i=this._networkSize);let qr=dr+1,so=dr-1,eo=1;for(;qr<_i||so>zr;){const io=this._radPower[eo++]/Or._alphaRadBias;if(qr<_i){const yo=this._network[qr++];yo.subtract(io*(yo.r-Nr),io*(yo.g-Ir),io*(yo.b-br),io*(yo.a-Yr))}if(so>zr){const yo=this._network[so--];yo.subtract(io*(yo.r-Nr),io*(yo.g-Ir),io*(yo.b-br),io*(yo.a-Yr))}}}_alterSingle(Mn,dr,br,Ir,Nr,Yr){Mn/=Or._initAlpha;const zr=this._network[dr];zr.subtract(Mn*(zr.r-Nr),Mn*(zr.g-Ir),Mn*(zr.b-br),Mn*(zr.a-Yr))}_contest(Mn,dr,br,Ir){let Nr=2147483647,Yr=Nr,zr=-1,_i=zr;for(let qr=0;qr>Or._initialBiasShift-3);io>Or._betaShift;this._freq[qr]-=yo,this._bias[qr]+=yo<>Or._betaShift),Xt(to,"_betaGamma",Or._initialBias<this._histogram[Ir]-this._histogram[br]);if(Mn.length===0)return[];let dr;switch(this._method){case 1:const br=Math.min(Mn.length,this._initColors),Ir=Mn[br-1],Nr=this._histogram[Ir];dr=Mn.slice(0,br);let Yr=br;const zr=Mn.length;for(;Yr+br)}_colorStats1D(Mn){const dr=this._histogram,br=Mn.getPointArray(),Ir=br.length;for(let Nr=0;Nr{let eo=Math.round(so.w*so.h/zr)*Gr._boxPixels;eo<2&&(eo=2);const io={};this._iterateBox(so,dr,yo=>{const Bo=Ir[yo].uint32;this._hueStats.check(Bo),Bo in qr?qr[Bo]++:Bo in io?++io[Bo]>=eo&&(qr[Bo]=io[Bo]):io[Bo]=1})}),this._hueStats.injectIntoDictionary(qr)}_iterateBox(Mn,dr,br){const Ir=Mn,Nr=Ir.y*dr+Ir.x,Yr=(Ir.y+Ir.h-1)*dr+(Ir.x+Ir.w-1),zr=dr-Ir.w+1;let _i=0,qr=Nr;do br.call(this,qr),qr+=++_i%Ir.w==0?zr:1;while(qr<=Yr)}_makeBoxes(Mn,dr,br,Ir){const Nr=Mn%br,Yr=dr%Ir,zr=Mn-Nr,_i=dr-Yr,qr=[];for(let so=0;sothis._colors;){Yr.length=0;for(let eo=0;eo3*this._colors?this._initialDistance:this._distanceIncrement}if(zryo.distance-io.distance);let eo=0;for(;zr=0;eo--)Ir[eo]===0&&(eo!==so-1&&(br[eo]=br[so-1]),--so);br.length=so,dr.sort(),yield{palette:dr,progress:100}}};function lo(Mn){const dr=[];for(let br=0;br0){const br=this._sums[dr],Ir=this._reds[dr]/br,Nr=this._greens[dr]/br,Yr=this._blues[dr]/br,zr=this._alphas[dr]/br,_i=Mr.createByRGBA(0|Ir,0|Nr,0|Yr,0|zr);Mn.add(_i)}Mn.sort(),yield{palette:Mn,progress:100}}*_preparePalette(){yield*this._calculateMoments();let Mn=0;const dr=lo(this._colors);for(let zr=1;zr1?this._calculateVariance(this._cubes[Mn]):0,dr[zr]=this._cubes[zr].volume>1?this._calculateVariance(this._cubes[zr]):0):(dr[Mn]=0,zr--),Mn=0;let _i=dr[0];for(let qr=1;qr<=zr;++qr)dr[qr]>_i&&(_i=dr[qr],Mn=qr);if(_i<=0){this._colors=zr+1;break}}const br=[],Ir=[],Nr=[],Yr=[];for(let zr=0;zr0?(br[zr]=ho._volume(this._cubes[zr],this._momentsRed)/_i|0,Ir[zr]=ho._volume(this._cubes[zr],this._momentsGreen)/_i|0,Nr[zr]=ho._volume(this._cubes[zr],this._momentsBlue)/_i|0,Yr[zr]=ho._volume(this._cubes[zr],this._momentsAlpha)/_i|0):(br[zr]=0,Ir[zr]=0,Nr[zr]=0,Yr[zr]=0)}this._reds=lo(this._colors+1),this._greens=lo(this._colors+1),this._blues=lo(this._colors+1),this._alphas=lo(this._colors+1),this._sums=lo(this._colors+1);for(let zr=0,_i=this._pixels.length;zr<_i;zr++){const qr=this._pixels[zr];let so=-1,eo=Number.MAX_VALUE;for(let io=0;io>dr),Ir=1+(Mn.g>>dr),Nr=1+(Mn.b>>dr),Yr=1+(Mn.a>>dr);this._weights[Yr][br][Ir][Nr]++,this._momentsRed[Yr][br][Ir][Nr]+=Mn.r,this._momentsGreen[Yr][br][Ir][Nr]+=Mn.g,this._momentsBlue[Yr][br][Ir][Nr]+=Mn.b,this._momentsAlpha[Yr][br][Ir][Nr]+=Mn.a,this._moments[Yr][br][Ir][Nr]+=this._table[Mn.r]+this._table[Mn.g]+this._table[Mn.b]+this._table[Mn.a]}*_calculateMoments(){const Mn=[],dr=[],br=[],Ir=[],Nr=[],Yr=[],zr=ao(this._sideSize,this._sideSize,this._sideSize),_i=ao(this._sideSize,this._sideSize,this._sideSize),qr=ao(this._sideSize,this._sideSize,this._sideSize),so=ao(this._sideSize,this._sideSize,this._sideSize),eo=ao(this._sideSize,this._sideSize,this._sideSize),io=ao(this._sideSize,this._sideSize,this._sideSize);let yo=0;const Bo=new Wn(this._alphaMaxSideIndex*this._maxSideIndex,99);for(let Mo=1;Mo<=this._alphaMaxSideIndex;++Mo){Ro(zr,this._sideSize,this._sideSize,this._sideSize,0),Ro(_i,this._sideSize,this._sideSize,this._sideSize,0),Ro(qr,this._sideSize,this._sideSize,this._sideSize,0),Ro(so,this._sideSize,this._sideSize,this._sideSize,0),Ro(eo,this._sideSize,this._sideSize,this._sideSize,0),Ro(io,this._sideSize,this._sideSize,this._sideSize,0);for(let xo=1;xo<=this._maxSideIndex;++xo,++yo){Bo.shouldNotify(yo)&&(yield{progress:Bo.progress}),Xo(Mn,this._sideSize,0),Xo(dr,this._sideSize,0),Xo(br,this._sideSize,0),Xo(Ir,this._sideSize,0),Xo(Nr,this._sideSize,0),Xo(Yr,this._sideSize,0);for(let wo=1;wo<=this._maxSideIndex;++wo){let os=0,rs=0,xs=0,fs=0,Ds=0,ms=0;for(let Po=1;Po<=this._maxSideIndex;++Po)os+=this._weights[Mo][xo][wo][Po],rs+=this._momentsRed[Mo][xo][wo][Po],xs+=this._momentsGreen[Mo][xo][wo][Po],fs+=this._momentsBlue[Mo][xo][wo][Po],Ds+=this._momentsAlpha[Mo][xo][wo][Po],ms+=this._moments[Mo][xo][wo][Po],Mn[Po]+=os,dr[Po]+=rs,br[Po]+=xs,Ir[Po]+=fs,Nr[Po]+=Ds,Yr[Po]+=ms,zr[xo][wo][Po]=zr[xo-1][wo][Po]+Mn[Po],_i[xo][wo][Po]=_i[xo-1][wo][Po]+dr[Po],qr[xo][wo][Po]=qr[xo-1][wo][Po]+br[Po],so[xo][wo][Po]=so[xo-1][wo][Po]+Ir[Po],eo[xo][wo][Po]=eo[xo-1][wo][Po]+Nr[Po],io[xo][wo][Po]=io[xo-1][wo][Po]+Yr[Po],this._weights[Mo][xo][wo][Po]=this._weights[Mo-1][xo][wo][Po]+zr[xo][wo][Po],this._momentsRed[Mo][xo][wo][Po]=this._momentsRed[Mo-1][xo][wo][Po]+_i[xo][wo][Po],this._momentsGreen[Mo][xo][wo][Po]=this._momentsGreen[Mo-1][xo][wo][Po]+qr[xo][wo][Po],this._momentsBlue[Mo][xo][wo][Po]=this._momentsBlue[Mo-1][xo][wo][Po]+so[xo][wo][Po],this._momentsAlpha[Mo][xo][wo][Po]=this._momentsAlpha[Mo-1][xo][wo][Po]+eo[xo][wo][Po],this._moments[Mo][xo][wo][Po]=this._moments[Mo-1][xo][wo][Po]+io[xo][wo][Po]}}}}static _volumeFloat(Mn,dr){return dr[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMaximum]-dr[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]-dr[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]+dr[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-dr[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMaximum]+dr[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]+dr[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]-dr[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(dr[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]-dr[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]-dr[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+dr[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]-dr[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]+dr[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]+dr[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]-dr[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum])}static _volume(Mn,dr){return 0|ho._volumeFloat(Mn,dr)}static _top(Mn,dr,br,Ir){let Nr;switch(dr){case ho._alpha:Nr=Ir[br][Mn.redMaximum][Mn.greenMaximum][Mn.blueMaximum]-Ir[br][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]-Ir[br][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]+Ir[br][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(Ir[br][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]-Ir[br][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]-Ir[br][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]+Ir[br][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);break;case ho._red:Nr=Ir[Mn.alphaMaximum][br][Mn.greenMaximum][Mn.blueMaximum]-Ir[Mn.alphaMaximum][br][Mn.greenMinimum][Mn.blueMaximum]-Ir[Mn.alphaMinimum][br][Mn.greenMaximum][Mn.blueMaximum]+Ir[Mn.alphaMinimum][br][Mn.greenMinimum][Mn.blueMaximum]-(Ir[Mn.alphaMaximum][br][Mn.greenMaximum][Mn.blueMinimum]-Ir[Mn.alphaMaximum][br][Mn.greenMinimum][Mn.blueMinimum]-Ir[Mn.alphaMinimum][br][Mn.greenMaximum][Mn.blueMinimum]+Ir[Mn.alphaMinimum][br][Mn.greenMinimum][Mn.blueMinimum]);break;case ho._green:Nr=Ir[Mn.alphaMaximum][Mn.redMaximum][br][Mn.blueMaximum]-Ir[Mn.alphaMaximum][Mn.redMinimum][br][Mn.blueMaximum]-Ir[Mn.alphaMinimum][Mn.redMaximum][br][Mn.blueMaximum]+Ir[Mn.alphaMinimum][Mn.redMinimum][br][Mn.blueMaximum]-(Ir[Mn.alphaMaximum][Mn.redMaximum][br][Mn.blueMinimum]-Ir[Mn.alphaMaximum][Mn.redMinimum][br][Mn.blueMinimum]-Ir[Mn.alphaMinimum][Mn.redMaximum][br][Mn.blueMinimum]+Ir[Mn.alphaMinimum][Mn.redMinimum][br][Mn.blueMinimum]);break;case ho._blue:Nr=Ir[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMaximum][br]-Ir[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][br]-Ir[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][br]+Ir[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][br]-(Ir[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][br]-Ir[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][br]-Ir[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][br]+Ir[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][br]);break;default:throw new Error("impossible")}return 0|Nr}static _bottom(Mn,dr,br){switch(dr){case ho._alpha:return-br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMaximum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(-br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);case ho._red:return-br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMaximum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(-br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);case ho._green:return-br[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMaximum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMaximum]-(-br[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);case ho._blue:return-br[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]+br[Mn.alphaMaximum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]-br[Mn.alphaMaximum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]-(-br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMaximum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMaximum][Mn.greenMinimum][Mn.blueMinimum]+br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMaximum][Mn.blueMinimum]-br[Mn.alphaMinimum][Mn.redMinimum][Mn.greenMinimum][Mn.blueMinimum]);default:return 0}}_calculateVariance(Mn){const dr=ho._volume(Mn,this._momentsRed),br=ho._volume(Mn,this._momentsGreen),Ir=ho._volume(Mn,this._momentsBlue),Nr=ho._volume(Mn,this._momentsAlpha);return ho._volumeFloat(Mn,this._moments)-(dr*dr+br*br+Ir*Ir+Nr*Nr)/ho._volume(Mn,this._weights)}_maximize(Mn,dr,br,Ir,Nr,Yr,zr,_i,qr){const so=0|ho._bottom(Mn,dr,this._momentsRed),eo=0|ho._bottom(Mn,dr,this._momentsGreen),io=0|ho._bottom(Mn,dr,this._momentsBlue),yo=0|ho._bottom(Mn,dr,this._momentsAlpha),Bo=0|ho._bottom(Mn,dr,this._weights);let Mo=0,xo=-1;for(let wo=br;woMo&&(Mo=Po,xo=wo))}}return{max:Mo,position:xo}}_cut(Mn,dr){let br;const Ir=ho._volume(Mn,this._momentsRed),Nr=ho._volume(Mn,this._momentsGreen),Yr=ho._volume(Mn,this._momentsBlue),zr=ho._volume(Mn,this._momentsAlpha),_i=ho._volume(Mn,this._weights),qr=this._maximize(Mn,ho._red,Mn.redMinimum+1,Mn.redMaximum,Ir,Nr,Yr,zr,_i),so=this._maximize(Mn,ho._green,Mn.greenMinimum+1,Mn.greenMaximum,Ir,Nr,Yr,zr,_i),eo=this._maximize(Mn,ho._blue,Mn.blueMinimum+1,Mn.blueMaximum,Ir,Nr,Yr,zr,_i),io=this._maximize(Mn,ho._alpha,Mn.alphaMinimum+1,Mn.alphaMaximum,Ir,Nr,Yr,zr,_i);if(io.max>=qr.max&&io.max>=so.max&&io.max>=eo.max){if(br=ho._alpha,io.position<0)return!1}else br=qr.max>=io.max&&qr.max>=so.max&&qr.max>=eo.max?ho._red:so.max>=io.max&&so.max>=qr.max&&so.max>=eo.max?ho._green:ho._blue;switch(dr.redMaximum=Mn.redMaximum,dr.greenMaximum=Mn.greenMaximum,dr.blueMaximum=Mn.blueMaximum,dr.alphaMaximum=Mn.alphaMaximum,br){case ho._red:dr.redMinimum=Mn.redMaximum=qr.position,dr.greenMinimum=Mn.greenMinimum,dr.blueMinimum=Mn.blueMinimum,dr.alphaMinimum=Mn.alphaMinimum;break;case ho._green:dr.greenMinimum=Mn.greenMaximum=so.position,dr.redMinimum=Mn.redMinimum,dr.blueMinimum=Mn.blueMinimum,dr.alphaMinimum=Mn.alphaMinimum;break;case ho._blue:dr.blueMinimum=Mn.blueMaximum=eo.position,dr.redMinimum=Mn.redMinimum,dr.greenMinimum=Mn.greenMinimum,dr.alphaMinimum=Mn.alphaMinimum;break;case ho._alpha:dr.alphaMinimum=Mn.alphaMaximum=io.position,dr.blueMinimum=Mn.blueMinimum,dr.redMinimum=Mn.redMinimum,dr.greenMinimum=Mn.greenMinimum}return Mn.volume=(Mn.redMaximum-Mn.redMinimum)*(Mn.greenMaximum-Mn.greenMinimum)*(Mn.blueMaximum-Mn.blueMinimum)*(Mn.alphaMaximum-Mn.alphaMinimum),dr.volume=(dr.redMaximum-dr.redMinimum)*(dr.greenMaximum-dr.greenMinimum)*(dr.blueMaximum-dr.blueMinimum)*(dr.alphaMaximum-dr.alphaMinimum),!0}_initialize(Mn){this._colors=Mn,this._cubes=[];for(let dr=0;drJo,ErrorDiffusionArray:()=>Qo,ErrorDiffusionArrayKernel:()=>Ko,ErrorDiffusionRiemersma:()=>ss,NearestColor:()=>as});var Jo=class{quantizeSync(Mn,dr){for(const br of this.quantize(Mn,dr))if(br.pointContainer)return br.pointContainer;throw new Error("unreachable")}},as=class extends Jo{constructor(Mn){super(),Xt(this,"_distance"),this._distance=Mn}*quantize(Mn,dr){const br=Mn.getPointArray(),Ir=Mn.getWidth(),Nr=Mn.getHeight(),Yr=new Wn(Nr,99);for(let zr=0;zr(Mn[Mn.FloydSteinberg=0]="FloydSteinberg",Mn[Mn.FalseFloydSteinberg=1]="FalseFloydSteinberg",Mn[Mn.Stucki=2]="Stucki",Mn[Mn.Atkinson=3]="Atkinson",Mn[Mn.Jarvis=4]="Jarvis",Mn[Mn.Burkes=5]="Burkes",Mn[Mn.Sierra=6]="Sierra",Mn[Mn.TwoSierra=7]="TwoSierra",Mn[Mn.SierraLite=8]="SierraLite",Mn))(Ko||{}),Qo=class extends Jo{constructor(Mn,dr,br=!0,Ir=0,Nr=!1){super(),Xt(this,"_minColorDistance"),Xt(this,"_serpentine"),Xt(this,"_kernel"),Xt(this,"_calculateErrorLikeGIMP"),Xt(this,"_distance"),this._setKernel(dr),this._distance=Mn,this._minColorDistance=Ir,this._serpentine=br,this._calculateErrorLikeGIMP=Nr}*quantize(Mn,dr){const br=Mn.getPointArray(),Ir=new Mr,Nr=Mn.getWidth(),Yr=Mn.getHeight(),zr=[];let _i=1,qr=1;for(const eo of this._kernel){const io=eo[2]+1;qr=0&&vu+xo=0&&Gs+eodr&&(Mn.length=dr);const br=Mn.length;for(let Ir=0;Ir=0&&Mn.x=0&&Mn.y{const so=br[_i+qr*Ir];let{r:eo,g:io,b:yo,a:Bo}=so;for(let os=0;osSs});var vs=.01,ks=.03;function Ss(Mn,dr){if(Mn.getHeight()!==dr.getHeight()||Mn.getWidth()!==dr.getWidth())throw new Error("Images have different sizes!");const br=(255*vs)**2,Ir=(255*ks)**2;let Nr=0,Yr=0;return function(zr,_i,qr){const so=zr.getWidth(),eo=zr.getHeight();for(let io=0;io{let eo=0,io=0,yo=0;for(let Mo=0;MoNt.nextTick(Mn):Mn=>setTimeout(Mn,0);function bs(Mn,{colorDistanceFormula:dr,paletteQuantization:br,colors:Ir}={}){const Nr=Eu(na(dr),br,Ir);return Mn.forEach(Yr=>Nr.sample(Yr)),Nr.quantizeSync()}async function _u(Mn,{colorDistanceFormula:dr,paletteQuantization:br,colors:Ir,onProgress:Nr}={}){return new Promise((Yr,zr)=>{const _i=Eu(na(dr),br,Ir);let qr;Mn.forEach(io=>_i.sample(io));const so=_i.quantize(),eo=()=>{try{const io=so.next();io.done?Yr(qr):(io.value.palette&&(qr=io.value.palette),Nr&&Nr(io.value.progress),Fo(eo))}catch(io){zr(io)}};Fo(eo)})}function Ml(Mn,dr,{colorDistanceFormula:br,imageQuantization:Ir}={}){return yu(na(br),Ir).quantizeSync(Mn,dr)}async function wu(Mn,dr,{colorDistanceFormula:br,imageQuantization:Ir,onProgress:Nr}={}){return new Promise((Yr,zr)=>{let _i;const qr=yu(na(br),Ir).quantize(Mn,dr),so=()=>{try{const eo=qr.next();eo.done?Yr(_i):(eo.value.pointContainer&&(_i=eo.value.pointContainer),Nr&&Nr(eo.value.progress),Fo(so))}catch(eo){zr(eo)}};Fo(so)})}function na(Mn="euclidean-bt709"){switch(Mn){case"cie94-graphic-arts":return new vn;case"cie94-textiles":return new yn;case"ciede2000":return new Un;case"color-metric":return new Kn;case"euclidean":return new tr;case"euclidean-bt709":return new or;case"euclidean-bt709-noalpha":return new Jn;case"manhattan":return new Er;case"manhattan-bt709":return new Rr;case"manhattan-nommyde":return new Sr;case"pngquant":return new sr;default:throw new Error(`Unknown colorDistanceFormula ${Mn}`)}}function yu(Mn,dr="floyd-steinberg"){switch(dr){case"nearest":return new as(Mn);case"riemersma":return new ss(Mn);case"floyd-steinberg":return new Qo(Mn,0);case"false-floyd-steinberg":return new Qo(Mn,1);case"stucki":return new Qo(Mn,2);case"atkinson":return new Qo(Mn,3);case"jarvis":return new Qo(Mn,4);case"burkes":return new Qo(Mn,5);case"sierra":return new Qo(Mn,6);case"two-sierra":return new Qo(Mn,7);case"sierra-lite":return new Qo(Mn,8);default:throw new Error(`Unknown imageQuantization ${dr}`)}}function Eu(Mn,dr="wuquant",br=256){switch(dr){case"neuquant":return new ur(Mn,br);case"rgbquant":return new Lr(Mn,br);case"wuquant":return new qo(Mn,br);case"neuquant-float":return new to(Mn,br);default:throw new Error(`Unknown paletteQuantization ${dr}`)}}_e.exports=Yt(Zt)}},__webpack_module_cache__={};function __webpack_require__(_e){var Pt=__webpack_module_cache__[_e];if(Pt!==void 0)return Pt.exports;var Dt=__webpack_module_cache__[_e]={exports:{}};return __webpack_modules__[_e](Dt,Dt.exports,__webpack_require__),Dt.exports}__webpack_require__.n=_e=>{var Pt=_e&&_e.__esModule?()=>_e.default:()=>_e;return __webpack_require__.d(Pt,{a:Pt}),Pt},__webpack_require__.d=(_e,Pt)=>{for(var Dt in Pt)__webpack_require__.o(Pt,Dt)&&!__webpack_require__.o(_e,Dt)&&Object.defineProperty(_e,Dt,{enumerable:!0,get:Pt[Dt]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(_e,Pt)=>Object.prototype.hasOwnProperty.call(_e,Pt),__webpack_require__.r=_e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_e,"__esModule",{value:!0})},(()=>{var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{AUTO:()=>gr,BLEND_ADD:()=>jn,BLEND_DARKEN:()=>kr,BLEND_DESTINATION_OVER:()=>qn,BLEND_DIFFERENCE:()=>vr,BLEND_EXCLUSION:()=>Xn,BLEND_HARDLIGHT:()=>Wn,BLEND_LIGHTEN:()=>Cr,BLEND_MULTIPLY:()=>Ln,BLEND_OVERLAY:()=>mr,BLEND_SCREEN:()=>ir,BLEND_SOURCE_OVER:()=>Mr,EDGE_CROP:()=>Or,EDGE_EXTEND:()=>ur,EDGE_WRAP:()=>Wr,HORIZONTAL_ALIGN_CENTER:()=>Sr,HORIZONTAL_ALIGN_LEFT:()=>Er,HORIZONTAL_ALIGN_RIGHT:()=>Rr,VERTICAL_ALIGN_BOTTOM:()=>Tr,VERTICAL_ALIGN_MIDDLE:()=>hr,VERTICAL_ALIGN_TOP:()=>sr});var Pt={};__webpack_require__.r(Pt),__webpack_require__.d(Pt,{add:()=>Hr,darken:()=>uo,difference:()=>Xo,dstOver:()=>Gr,exclusion:()=>Ao,hardLight:()=>Ro,lighten:()=>ao,multiply:()=>no,overlay:()=>lo,screen:()=>Lr,srcOver:()=>to});var Dt=__webpack_require__(5546),Nt=__webpack_require__.n(Dt),jt=__webpack_require__(1023),Ut=__webpack_require__.n(jt),Gt=__webpack_require__(2699),Wt=__webpack_require__.n(Gt);function qt(Fn){if(Fn===void 0)return!1;if(typeof Fn!="function")throw new TypeError("Callback must be a function");return!0}function Yt(Fn,zn){if(typeof Fn=="string"&&(Fn=new Error(Fn)),typeof zn=="function")return zn.call(this,Fn);throw Fn}function Xt(Fn,zn,er,rr,lr,fr){zn=Math.round(zn),er=Math.round(er),rr=Math.round(rr),lr=Math.round(lr);for(let wr=er;wr1&&(ba-=1),ba<1/6?Vo+6*(es-Vo)*ba:ba<.5?es:ba<2/3?Vo+(es-Vo)*(2/3-ba)*6:Vo}if(Xr=Bn(Xr,360),Kr=Bn(Kr,100),Qr=Bn(Qr,100),Kr===0)fo=_o=jo=Qr;else{var Oo=Qr<.5?Qr*(1+Kr):Qr+Kr-Qr*Kr,Zo=2*Qr-Oo;fo=Yo(Zo,Oo,Xr+1/3),_o=Yo(Zo,Oo,Xr),jo=Yo(Zo,Oo,Xr-1/3)}return{r:255*fo,g:255*_o,b:255*jo}}(rr.h,Fr,Vr),co=!0,Jr="hsl"),rr.hasOwnProperty("a")&&($r=rr.a)),$r=In($r),{ok:co,format:rr.format||Jr,r:Math.min(255,Math.max(_r.r,0)),g:Math.min(255,Math.max(_r.g,0)),b:Math.min(255,Math.max(_r.b,0)),a:$r}}(Fn);this._originalInput=Fn,this._r=er.r,this._g=er.g,this._b=er.b,this._a=er.a,this._roundA=Math.round(100*this._a)/100,this._format=zn.format||er.format,this._gradientType=zn.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=er.ok}function ln(Fn,zn,er){Fn=Bn(Fn,255),zn=Bn(zn,255),er=Bn(er,255);var rr,lr,fr=Math.max(Fn,zn,er),wr=Math.min(Fn,zn,er),_r=(fr+wr)/2;if(fr==wr)rr=lr=0;else{var $r=fr-wr;switch(lr=_r>.5?$r/(2-fr-wr):$r/(fr+wr),fr){case Fn:rr=(zn-er)/$r+(zn>1)+720)%360;--zn;)rr.h=(rr.h+lr)%360,fr.push(sn(rr));return fr}function Pn(Fn,zn){zn=zn||6;for(var er=sn(Fn).toHsv(),rr=er.h,lr=er.s,fr=er.v,wr=[],_r=1/zn;zn--;)wr.push(sn({h:rr,s:lr,v:fr})),fr=(fr+_r)%1;return wr}sn.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var Fn=this.toRgb();return(299*Fn.r+587*Fn.g+114*Fn.b)/1e3},getLuminance:function(){var Fn,zn,er,rr=this.toRgb();return Fn=rr.r/255,zn=rr.g/255,er=rr.b/255,.2126*(Fn<=.03928?Fn/12.92:Math.pow((Fn+.055)/1.055,2.4))+.7152*(zn<=.03928?zn/12.92:Math.pow((zn+.055)/1.055,2.4))+.0722*(er<=.03928?er/12.92:Math.pow((er+.055)/1.055,2.4))},setAlpha:function(Fn){return this._a=In(Fn),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var Fn=dn(this._r,this._g,this._b);return{h:360*Fn.h,s:Fn.s,v:Fn.v,a:this._a}},toHsvString:function(){var Fn=dn(this._r,this._g,this._b),zn=Math.round(360*Fn.h),er=Math.round(100*Fn.s),rr=Math.round(100*Fn.v);return this._a==1?"hsv("+zn+", "+er+"%, "+rr+"%)":"hsva("+zn+", "+er+"%, "+rr+"%, "+this._roundA+")"},toHsl:function(){var Fn=ln(this._r,this._g,this._b);return{h:360*Fn.h,s:Fn.s,l:Fn.l,a:this._a}},toHslString:function(){var Fn=ln(this._r,this._g,this._b),zn=Math.round(360*Fn.h),er=Math.round(100*Fn.s),rr=Math.round(100*Fn.l);return this._a==1?"hsl("+zn+", "+er+"%, "+rr+"%)":"hsla("+zn+", "+er+"%, "+rr+"%, "+this._roundA+")"},toHex:function(Fn){return mn(this._r,this._g,this._b,Fn)},toHexString:function(Fn){return"#"+this.toHex(Fn)},toHex8:function(Fn){return function(zn,er,rr,lr,fr){var wr=[ar(Math.round(zn).toString(16)),ar(Math.round(er).toString(16)),ar(Math.round(rr).toString(16)),ar(Rn(lr))];return fr&&wr[0].charAt(0)==wr[0].charAt(1)&&wr[1].charAt(0)==wr[1].charAt(1)&&wr[2].charAt(0)==wr[2].charAt(1)&&wr[3].charAt(0)==wr[3].charAt(1)?wr[0].charAt(0)+wr[1].charAt(0)+wr[2].charAt(0)+wr[3].charAt(0):wr.join("")}(this._r,this._g,this._b,this._a,Fn)},toHex8String:function(Fn){return"#"+this.toHex8(Fn)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Bn(this._r,255))+"%",g:Math.round(100*Bn(this._g,255))+"%",b:Math.round(100*Bn(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(100*Bn(this._r,255))+"%, "+Math.round(100*Bn(this._g,255))+"%, "+Math.round(100*Bn(this._b,255))+"%)":"rgba("+Math.round(100*Bn(this._r,255))+"%, "+Math.round(100*Bn(this._g,255))+"%, "+Math.round(100*Bn(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(Gn[mn(this._r,this._g,this._b,!0)]||!1)},toFilter:function(Fn){var zn="#"+gn(this._r,this._g,this._b,this._a),er=zn,rr=this._gradientType?"GradientType = 1, ":"";if(Fn){var lr=sn(Fn);er="#"+gn(lr._r,lr._g,lr._b,lr._a)}return"progid:DXImageTransform.Microsoft.gradient("+rr+"startColorstr="+zn+",endColorstr="+er+")"},toString:function(Fn){var zn=!!Fn;Fn=Fn||this._format;var er=!1,rr=this._a<1&&this._a>=0;return zn||!rr||Fn!=="hex"&&Fn!=="hex6"&&Fn!=="hex3"&&Fn!=="hex4"&&Fn!=="hex8"&&Fn!=="name"?(Fn==="rgb"&&(er=this.toRgbString()),Fn==="prgb"&&(er=this.toPercentageRgbString()),Fn!=="hex"&&Fn!=="hex6"||(er=this.toHexString()),Fn==="hex3"&&(er=this.toHexString(!0)),Fn==="hex4"&&(er=this.toHex8String(!0)),Fn==="hex8"&&(er=this.toHex8String()),Fn==="name"&&(er=this.toName()),Fn==="hsl"&&(er=this.toHslString()),Fn==="hsv"&&(er=this.toHsvString()),er||this.toHexString()):Fn==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return sn(this.toString())},_applyModification:function(Fn,zn){var er=Fn.apply(null,[this].concat([].slice.call(zn)));return this._r=er._r,this._g=er._g,this._b=er._b,this.setAlpha(er._a),this},lighten:function(){return this._applyModification(En,arguments)},brighten:function(){return this._applyModification(_n,arguments)},darken:function(){return this._applyModification(Tn,arguments)},desaturate:function(){return this._applyModification(un,arguments)},saturate:function(){return this._applyModification(hn,arguments)},greyscale:function(){return this._applyModification(bn,arguments)},spin:function(){return this._applyModification($n,arguments)},_applyCombination:function(Fn,zn){return Fn.apply(null,[this].concat([].slice.call(zn)))},analogous:function(){return this._applyCombination(Dn,arguments)},complement:function(){return this._applyCombination(pn,arguments)},monochromatic:function(){return this._applyCombination(Pn,arguments)},splitcomplement:function(){return this._applyCombination(An,arguments)},triad:function(){return this._applyCombination(Nn,[3])},tetrad:function(){return this._applyCombination(Nn,[4])}},sn.fromRatio=function(Fn,zn){if(nn(Fn)=="object"){var er={};for(var rr in Fn)Fn.hasOwnProperty(rr)&&(er[rr]=rr==="a"?Fn[rr]:Sn(Fn[rr]));Fn=er}return sn(Fn,zn)},sn.equals=function(Fn,zn){return!(!Fn||!zn)&&sn(Fn).toRgbString()==sn(zn).toRgbString()},sn.random=function(){return sn.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},sn.mix=function(Fn,zn,er){er=er===0?0:er||50;var rr=sn(Fn).toRgb(),lr=sn(zn).toRgb(),fr=er/100;return sn({r:(lr.r-rr.r)*fr+rr.r,g:(lr.g-rr.g)*fr+rr.g,b:(lr.b-rr.b)*fr+rr.b,a:(lr.a-rr.a)*fr+rr.a})},sn.readability=function(Fn,zn){var er=sn(Fn),rr=sn(zn);return(Math.max(er.getLuminance(),rr.getLuminance())+.05)/(Math.min(er.getLuminance(),rr.getLuminance())+.05)},sn.isReadable=function(Fn,zn,er){var rr,lr,fr,wr,_r,$r=sn.readability(Fn,zn);switch(lr=!1,(fr=er,(wr=((fr=fr||{level:"AA",size:"small"}).level||"AA").toUpperCase())!=="AA"&&wr!=="AAA"&&(wr="AA"),(_r=(fr.size||"small").toLowerCase())!=="small"&&_r!=="large"&&(_r="small"),rr={level:wr,size:_r}).level+rr.size){case"AAsmall":case"AAAlarge":lr=$r>=4.5;break;case"AAlarge":lr=$r>=3;break;case"AAAsmall":lr=$r>=7}return lr},sn.mostReadable=function(Fn,zn,er){var rr,lr,fr,wr,_r=null,$r=0;lr=(er=er||{}).includeFallbackColors,fr=er.level,wr=er.size;for(var Fr=0;Fr$r&&($r=rr,_r=sn(zn[Fr]));return sn.isReadable(Fn,_r,{level:fr,size:wr})||!lr?_r:(er.includeFallbackColors=!1,sn.mostReadable(Fn,["#fff","#000"],er))};var Cn=sn.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Gn=sn.hexNames=function(Fn){var zn={};for(var er in Fn)Fn.hasOwnProperty(er)&&(zn[Fn[er]]=er);return zn}(Cn);function In(Fn){return Fn=parseFloat(Fn),(isNaN(Fn)||Fn<0||Fn>1)&&(Fn=1),Fn}function Bn(Fn,zn){(function(rr){return typeof rr=="string"&&rr.indexOf(".")!=-1&&parseFloat(rr)===1})(Fn)&&(Fn="100%");var er=function(rr){return typeof rr=="string"&&rr.indexOf("%")!=-1}(Fn);return Fn=Math.min(zn,Math.max(0,parseFloat(Fn))),er&&(Fn=parseInt(Fn*zn,10)/100),Math.abs(Fn-zn)<1e-6?1:Fn%zn/parseFloat(zn)}function Zn(Fn){return Math.min(1,Math.max(0,Fn))}function nr(Fn){return parseInt(Fn,16)}function ar(Fn){return Fn.length==1?"0"+Fn:""+Fn}function Sn(Fn){return Fn<=1&&(Fn=100*Fn+"%"),Fn}function Rn(Fn){return Math.round(255*parseFloat(Fn)).toString(16)}function On(Fn){return nr(Fn)/255}var Vn,yn,vn,wn=(yn="[\\s|\\(]+("+(Vn="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Vn+")[,|\\s]+("+Vn+")\\s*\\)?",vn="[\\s|\\(]+("+Vn+")[,|\\s]+("+Vn+")[,|\\s]+("+Vn+")[,|\\s]+("+Vn+")\\s*\\)?",{CSS_UNIT:new RegExp(Vn),rgb:new RegExp("rgb"+yn),rgba:new RegExp("rgba"+vn),hsl:new RegExp("hsl"+yn),hsla:new RegExp("hsla"+vn),hsv:new RegExp("hsv"+yn),hsva:new RegExp("hsva"+vn),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Un(Fn){return!!wn.CSS_UNIT.exec(Fn)}function Kn(Fn,zn){this.size=this.size||Fn,this.smallerSize=this.smallerSize||zn,function(er){for(let rr=1;rrlr?"1":"0";return fr};const tr=[],or=Kn;__webpack_require__(9307);const Jn=(Fn,zn)=>{let{url:er,...rr}=Fn;fetch(er,rr).then(lr=>{if(lr.ok)return lr.arrayBuffer().catch(fr=>{throw new Error(`Response is not a buffer for url ${er}. Error: ${fr.message}`)});throw new Error(`HTTP Status ${lr.status} for url ${er}`)}).then(lr=>zn(null,lr)).catch(lr=>zn(lr))},gr=-1,Er=1,Sr=2,Rr=4,sr=8,hr=16,Tr=32,Mr="srcOver",qn="dstOver",Ln="multiply",jn="add",ir="screen",mr="overlay",kr="darken",Cr="lighten",Wn="hardLight",vr="difference",Xn="exclusion",ur=1,Wr=2,Or=3;function to(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a;return{r:(Fn.r*Fn.a+zn.r*zn.a*(1-Fn.a))/rr,g:(Fn.g*Fn.a+zn.g*zn.a*(1-Fn.a))/rr,b:(Fn.b*Fn.a+zn.b*zn.a*(1-Fn.a))/rr,a:rr}}function Gr(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a;return{r:(zn.r*zn.a+Fn.r*Fn.a*(1-zn.a))/rr,g:(zn.g*zn.a+Fn.g*Fn.a*(1-zn.a))/rr,b:(zn.b*zn.a+Fn.b*Fn.a*(1-zn.a))/rr,a:rr}}function no(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(lr*_r+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(fr*$r+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}function Hr(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a;return{r:(lr+zn.r*zn.a)/rr,g:(fr+zn.g*zn.a)/rr,b:(wr+zn.b*zn.a)/rr,a:rr}}function Lr(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(lr*zn.a+_r*Fn.a-lr*_r+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(fr*zn.a+$r*Fn.a-fr*$r+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(wr*zn.a+Fr*Fn.a-wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}function lo(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(2*_r<=zn.a?2*lr*_r+lr*(1-zn.a)+_r*(1-Fn.a):lr*(1+zn.a)+_r*(1+Fn.a)-2*_r*lr-zn.a*Fn.a)/rr,g:(2*$r<=zn.a?2*fr*$r+fr*(1-zn.a)+$r*(1-Fn.a):fr*(1+zn.a)+$r*(1+Fn.a)-2*$r*fr-zn.a*Fn.a)/rr,b:(2*Fr<=zn.a?2*wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a):wr*(1+zn.a)+Fr*(1+Fn.a)-2*Fr*wr-zn.a*Fn.a)/rr,a:rr}}function uo(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(Math.min(lr*zn.a,_r*Fn.a)+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(Math.min(fr*zn.a,$r*Fn.a)+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(Math.min(wr*zn.a,Fr*Fn.a)+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}function ao(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(Math.max(lr*zn.a,_r*Fn.a)+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(Math.max(fr*zn.a,$r*Fn.a)+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(Math.max(wr*zn.a,Fr*Fn.a)+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}function Ro(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(2*lr<=Fn.a?2*lr*_r+lr*(1-zn.a)+_r*(1-Fn.a):lr*(1+zn.a)+_r*(1+Fn.a)-2*_r*lr-zn.a*Fn.a)/rr,g:(2*fr<=Fn.a?2*fr*$r+fr*(1-zn.a)+$r*(1-Fn.a):fr*(1+zn.a)+$r*(1+Fn.a)-2*$r*fr-zn.a*Fn.a)/rr,b:(2*wr<=Fn.a?2*wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a):wr*(1+zn.a)+Fr*(1+Fn.a)-2*Fr*wr-zn.a*Fn.a)/rr,a:rr}}function Xo(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(lr+_r-2*Math.min(lr*zn.a,_r*Fn.a))/rr,g:(fr+$r-2*Math.min(fr*zn.a,$r*Fn.a))/rr,b:(wr+Fr-2*Math.min(wr*zn.a,Fr*Fn.a))/rr,a:rr}}function Ao(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;Fn.a*=er;const rr=zn.a+Fn.a-zn.a*Fn.a,lr=Fn.r*Fn.a,fr=Fn.g*Fn.a,wr=Fn.b*Fn.a,_r=zn.r*zn.a,$r=zn.g*zn.a,Fr=zn.b*zn.a;return{r:(lr*zn.a+_r*Fn.a-2*lr*_r+lr*(1-zn.a)+_r*(1-Fn.a))/rr,g:(fr*zn.a+$r*Fn.a-2*fr*$r+fr*(1-zn.a)+$r*(1-Fn.a))/rr,b:(wr*zn.a+Fr*Fn.a-2*wr*Fr+wr*(1-zn.a)+Fr*(1-Fn.a))/rr,a:rr}}const ho=function(Fn,zn){for(var er=arguments.length,rr=new Array(er>2?er-2:0),lr=2;lr{rr.push((_r,$r)=>{_r&&wr(_r),fr($r)}),Fn.bind(zn)(...rr)})},qo={},xa=(Fn,zn)=>{qo[Fn]=zn},Jo=Fn=>{const zn=Fn.split("/").slice(-1);var er;return(er=zn[zn.length-1].split(".").pop(),Object.entries(qo).find(rr=>rr[1].includes(er))||[])[0]};var as=__webpack_require__(5025),Ko=__webpack_require__.n(as),Qo=__webpack_require__(6551),hs=__webpack_require__.n(Qo),Go=__webpack_require__(8834).lW;function Wo(Fn){return Fn._exif&&Fn._exif.tags&&Fn._exif.tags.Orientation||1}async function ss(Fn,zn,er){const rr=await async function(lr,fr){const wr=await Ko().fromBuffer(lr);return wr?wr.mime:fr?Jo(fr):null}(Fn,zn);if(typeof rr!="string")return er(new Error("Could not find MIME for Buffer <"+zn+">"));this._originalMime=rr.toLowerCase();try{const lr=this.getMIME();if(!this.constructor.decoders[lr])return Yt.call(this,"Unsupported MIME type: "+lr,er);this.bitmap=this.constructor.decoders[lr](Fn)}catch(lr){return er.call(this,lr,this)}try{this._exif=hs().create(Fn).parse(),function(lr){if(Wo(lr)<2)return;const fr=function(_r){const $r=_r.getWidth(),Fr=_r.getHeight();switch(Wo(_r)){case 1:default:return null;case 2:return function(jr,Vr){return[$r-jr-1,Vr]};case 3:return function(jr,Vr){return[$r-jr-1,Fr-Vr-1]};case 4:return function(jr,Vr){return[jr,Fr-Vr-1]};case 5:return function(jr,Vr){return[Vr,jr]};case 6:return function(jr,Vr){return[Vr,Fr-jr-1]};case 7:return function(jr,Vr){return[$r-Vr-1,Fr-jr-1]};case 8:return function(jr,Vr){return[$r-Vr-1,jr]}}}(lr),wr=Wo(lr)>4;(function(_r,$r,Fr,jr){const Vr=_r.bitmap.data,co=_r.bitmap.width,Jr=Go.alloc(Vr.length);for(let Xr=0;Xr<$r;Xr++)for(let Kr=0;Kr{zn.call(this,null,rr)}):zn.call(this,null,er)}return this}function vs(Fn){return ho($a,this,Fn)}var ks=__webpack_require__(8834).lW;function Ss(Fn,zn,er){return(zn=function(rr){var lr=function(fr,wr){if(typeof fr!="object"||fr===null)return fr;var _r=fr[Symbol.toPrimitive];if(_r!==void 0){var $r=_r.call(fr,"string");if(typeof $r!="object")return $r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fr)}(rr);return typeof lr=="symbol"?lr:String(lr)}(zn))in Fn?Object.defineProperty(Fn,zn,{value:er,enumerable:!0,configurable:!0,writable:!0}):Fn[zn]=er,Fn}const Is="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",Vl=[NaN,NaN];for(let Fn=2;Fn<65;Fn++){const zn=Qt()(Qt().BIN,Is.slice(0,Fn))(new Array(65).join("1"));Vl.push(zn.length)}function Fo(){}function bs(Fn){return Object.prototype.toString.call(Fn).toLowerCase().indexOf("arraybuffer")>-1}function _u(Fn){const zn=ks.alloc(Fn.byteLength),er=new Uint8Array(Fn);for(let rr=0;rrer?zn(er):typeof rr=="object"&&ks.isBuffer(rr)?zn(null,rr):typeof rr=="object"&&bs(rr)?zn(null,_u(rr)):new Error(`Could not load Buffer from <${Fn.url}>`))}const wu={data:null,width:null,height:null};class na extends Wt(){constructor(){for(var zn=arguments.length,er=new Array(zn),rr=0;rrho(this.write,this,$r)),Ss(this,"getBase64Async",$r=>ho(this.getBase64,this,$r)),Ss(this,"getBuffer",$a),Ss(this,"getBufferAsync",vs),Ss(this,"getPixelColour",this.getPixelColor),Ss(this,"setPixelColour",this.setPixelColor);const lr=this;let fr=Fo;function wr(){for(var $r=arguments.length,Fr=new Array($r),jr=0;jr<$r;jr++)Fr[jr]=arguments[jr];const[Vr]=Fr;(Vr||{}).methodName="constructor",setTimeout(()=>{Vr&&fr===Fo?lr.emitError("constructor",Vr):Vr||lr.emitMulti("constructor","initialized"),fr.call(lr,...Fr)},1)}if(bs(er[0])&&(er[0]=_u(er[0])),typeof er[0]=="number"&&typeof er[1]=="number"||parseInt(er[0],10)&&parseInt(er[1],10)){const $r=parseInt(er[0],10),Fr=parseInt(er[1],10);if(fr=er[2],typeof er[2]=="number"&&(this._background=er[2],fr=er[3]),typeof er[2]=="string"&&(this._background=na.cssColorToHex(er[2]),fr=er[3]),fr===void 0&&(fr=Fo),typeof fr!="function")return Yt.call(this,"cb must be a function",wr);this.bitmap={data:ks.alloc($r*Fr*4),width:$r,height:Fr};for(let jr=0;jr{if($r)return Yt.call(this,$r,wr);this.parseBitmap(Fr,er[0].url,wr)})}else if(er[0]instanceof na){const[$r]=er;if(fr=er[1],fr===void 0&&(fr=Fo),typeof fr!="function")return Yt.call(this,"cb must be a function",wr);this.bitmap={data:ks.from($r.bitmap.data),width:$r.bitmap.width,height:$r.bitmap.height},this._quality=$r._quality,this._deflateLevel=$r._deflateLevel,this._deflateStrategy=$r._deflateStrategy,this._filterType=$r._filterType,this._rgba=$r._rgba,this._background=$r._background,this._originalMime=$r._originalMime,wr(null,this)}else if((_r=er[0])&&typeof _r=="object"&&typeof _r.width=="number"&&typeof _r.height=="number"&&(ks.isBuffer(_r.data)||_r.data instanceof Uint8Array||typeof Uint8ClampedArray=="function"&&_r.data instanceof Uint8ClampedArray)&&(_r.data.length===_r.width*_r.height*4||_r.data.length===_r.width*_r.height*3)){const[$r]=er;fr=er[1]||Fo;const Fr=$r.width*$r.height*4===$r.data.length?ks.from($r.data):function(jr){if(jr.length%3!=0)throw new Error("Buffer length is incorrect");const Vr=ks.allocUnsafe(jr.length/3*4);let co=0;for(let Jr=0;Jr{if(Fr)return Yt.call(this,Fr,wr);this.parseBitmap(jr,$r,wr)})}else if(typeof er[0]=="object"&&ks.isBuffer(er[0])){const $r=er[0];if(fr=er[1],typeof fr!="function")return Yt.call(this,"cb must be a function",wr);this.parseBitmap($r,null,wr)}else{fr=er[er.length-1],typeof fr!="function"&&(fr=er[er.length-2],typeof fr!="function"&&(fr=Fo));const $r=na.__extraConstructors.find(Fr=>Fr.test(...er));if(!$r)return Yt.call(this,"No matching constructor overloading was found. Please see the docs for how to call the Jimp constructor.",wr);new Promise((Fr,jr)=>{$r.run.call(this,Fr,jr,...er)}).then(()=>wr(null,this)).catch(wr)}var _r}parseBitmap(zn,er,rr){ss.call(this,zn,null,rr)}rgba(zn,er){return typeof zn!="boolean"?Yt.call(this,"bool must be a boolean, true for RGBA or false for RGB",er):(this._rgba=zn,qt(er)&&er.call(this,null,this),this)}emitMulti(zn,er){let rr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};rr=Object.assign(rr,{methodName:zn,eventName:er}),this.emit("any",rr),zn&&this.emit(zn,rr),this.emit(er,rr)}emitError(zn,er){this.emitMulti(zn,"error",er)}getHeight(){return this.bitmap.height}getWidth(){return this.bitmap.width}inspect(){return""}toString(){return"[object Jimp]"}getMIME(){return this._originalMime||na.MIME_PNG}getExtension(){const zn=this.getMIME();return(qo[zn.toLowerCase()]||[])[0]}write(zn,er){if(!Nt()||!Nt().createWriteStream)throw new Error("Cant access the filesystem. You can use the getBase64 method.");if(typeof zn!="string")return Yt.call(this,"path must be a string",er);if(er===void 0&&(er=Fo),typeof er!="function")return Yt.call(this,"cb must be a function",er);const rr=Jo(zn)||this.getMIME(),lr=Ut().parse(zn);return lr.dir&&Nt().mkdirSync(lr.dir,{recursive:!0}),this.getBuffer(rr,(fr,wr)=>{if(fr)return Yt.call(this,fr,er);const _r=Nt().createWriteStream(zn);_r.on("open",()=>{_r.write(wr),_r.end()}).on("error",$r=>Yt.call(this,$r,er)),_r.on("finish",()=>{er.call(this,null,this)})}),this}getBase64(zn,er){return zn===na.AUTO&&(zn=this.getMIME()),typeof zn!="string"?Yt.call(this,"mime must be a string",er):typeof er!="function"?Yt.call(this,"cb must be a function",er):(this.getBuffer(zn,function(rr,lr){if(rr)return Yt.call(this,rr,er);const fr="data:"+zn+";base64,"+lr.toString("base64");er.call(this,null,fr)}),this)}hash(zn,er){if(typeof(zn=zn||64)=="function"&&(er=zn,zn=64),typeof zn!="number")return Yt.call(this,"base must be a number",er);if(zn<2||zn>64)return Yt.call(this,"base must be a number between 2 and 64",er);let rr=this.pHash();for(rr=Qt()(Qt().BIN,Is.slice(0,zn))(rr);rr.length=this.bitmap.width&&(fr=this.bitmap.width-1),er<0&&(wr=0),er>=this.bitmap.height&&(wr=this.bitmap.height-1)),rr===na.EDGE_WRAP&&(zn<0&&(fr=this.bitmap.width+zn),zn>=this.bitmap.width&&(fr=zn%this.bitmap.width),er<0&&(wr=this.bitmap.height+er),er>=this.bitmap.height&&(wr=er%this.bitmap.height));let _r=this.bitmap.width*wr+fr<<2;return(fr<0||fr>=this.bitmap.width)&&(_r=-1),(wr<0||wr>=this.bitmap.height)&&(_r=-1),qt(lr)&&lr.call(this,null,_r),_r}getPixelColor(zn,er,rr){if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",rr);zn=Math.round(zn),er=Math.round(er);const lr=this.getPixelIndex(zn,er),fr=this.bitmap.data.readUInt32BE(lr);return qt(rr)&&rr.call(this,null,fr),fr}setPixelColor(zn,er,rr,lr){if(typeof zn!="number"||typeof er!="number"||typeof rr!="number")return Yt.call(this,"hex, x and y must be numbers",lr);er=Math.round(er),rr=Math.round(rr);const fr=this.getPixelIndex(er,rr);return this.bitmap.data.writeUInt32BE(zn,fr),qt(lr)&&lr.call(this,null,this),this}hasAlpha(){for(let zn=0;zn1&&arguments[1]!==void 0?arguments[1]:na;Object.entries(Fn).forEach(er=>{let[rr,lr]=er;zn[rr]=lr})}function Eu(Fn){let zn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:na;Object.entries(Fn).forEach(er=>{let[rr,lr]=er;zn.prototype[rr]=lr})}function Mn(Fn,zn,er){const rr="before-"+zn,lr=zn.replace(/e$/,"")+"ed";na.prototype[Fn]=function(){let fr;for(var wr=arguments.length,_r=new Array(wr),$r=0;$r3&&arguments[3]!==void 0?arguments[3]:{},lr=arguments.length>4?arguments[4]:void 0;if(typeof rr=="function"&&(lr=rr,rr={}),!(Fn instanceof this.constructor))return Yt.call(this,"The source must be a Jimp image",lr);if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",lr);let{mode:fr,opacitySource:wr,opacityDest:_r}=rr;fr||(fr=Mr),(typeof wr!="number"||wr<0||wr>1)&&(wr=1),(typeof _r!="number"||_r<0||_r>1)&&(_r=1);const $r=Pt[fr];zn=Math.round(zn),er=Math.round(er);const Fr=this;return _r!==1&&Fr.opacity(_r),Fn.scanQuiet(0,0,Fn.bitmap.width,Fn.bitmap.height,function(jr,Vr,co){const Jr=Fr.getPixelIndex(zn+jr,er+Vr,Or);if(Jr===-1)return;const Xr=$r({r:this.bitmap.data[co+0]/255,g:this.bitmap.data[co+1]/255,b:this.bitmap.data[co+2]/255,a:this.bitmap.data[co+3]/255},{r:Fr.bitmap.data[Jr+0]/255,g:Fr.bitmap.data[Jr+1]/255,b:Fr.bitmap.data[Jr+2]/255,a:Fr.bitmap.data[Jr+3]/255},wr);Fr.bitmap.data[Jr+0]=this.constructor.limit255(255*Xr.r),Fr.bitmap.data[Jr+1]=this.constructor.limit255(255*Xr.g),Fr.bitmap.data[Jr+2]=this.constructor.limit255(255*Xr.b),Fr.bitmap.data[Jr+3]=this.constructor.limit255(255*Xr.a)}),qt(lr)&&lr.call(this,null,this),this}}),na.__extraConstructors=[],na.appendConstructorOption=function(Fn,zn,er){na.__extraConstructors.push({name:Fn,test:zn,run:er})},na.read=function(){for(var Fn=arguments.length,zn=new Array(Fn),er=0;er{new na(...zn,(fr,wr)=>{fr?lr(fr):rr(wr)})})},na.create=na.read,na.rgbaToInt=function(Fn,zn,er,rr,lr){if(typeof Fn!="number"||typeof zn!="number"||typeof er!="number"||typeof rr!="number")return Yt.call(this,"r, g, b and a must be numbers",lr);if(Fn<0||Fn>255)return Yt.call(this,"r must be between 0 and 255",lr);if((zn<0||zn>255)&&Yt.call(this,"g must be between 0 and 255",lr),er<0||er>255)return Yt.call(this,"b must be between 0 and 255",lr);if(rr<0||rr>255)return Yt.call(this,"a must be between 0 and 255",lr);Fn=Math.round(Fn),er=Math.round(er),zn=Math.round(zn),rr=Math.round(rr);const fr=Fn*Math.pow(256,3)+zn*Math.pow(256,2)+er*Math.pow(256,1)+rr*Math.pow(256,0);return qt(lr)&&lr.call(this,null,fr),fr},na.intToRGBA=function(Fn,zn){if(typeof Fn!="number")return Yt.call(this,"i must be a number",zn);const er={};return er.r=Math.floor(Fn/Math.pow(256,3)),er.g=Math.floor((Fn-er.r*Math.pow(256,3))/Math.pow(256,2)),er.b=Math.floor((Fn-er.r*Math.pow(256,3)-er.g*Math.pow(256,2))/Math.pow(256,1)),er.a=Math.floor((Fn-er.r*Math.pow(256,3)-er.g*Math.pow(256,2)-er.b*Math.pow(256,1))/Math.pow(256,0)),qt(zn)&&zn.call(this,null,er),er},na.cssColorToHex=function(Fn){return typeof(Fn=Fn||0)=="number"?Number(Fn):parseInt(sn(Fn).toHex8(),16)},na.limit255=function(Fn){return Fn=Math.max(Fn,0),Math.min(Fn,255)},na.diff=function(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:.1;if(!(Fn instanceof na&&zn instanceof na))return Yt.call(this,"img1 and img2 must be an Jimp images");const rr=Fn.bitmap,lr=zn.bitmap;if(rr.width===lr.width&&rr.height===lr.height||(rr.width*rr.height>lr.width*lr.height?Fn=Fn.cloneQuiet().resize(lr.width,lr.height):zn=zn.cloneQuiet().resize(rr.width,rr.height)),typeof er!="number"||er<0||er>1)return Yt.call(this,"threshold must be a number between 0 and 1");const fr=new na(rr.width,rr.height,4294967295);return{percent:tn()(rr.data,lr.data,fr.bitmap.data,fr.bitmap.width,fr.bitmap.height,{threshold:er})/(fr.bitmap.width*fr.bitmap.height),image:fr}},na.distance=function(Fn,zn){const er=new or,rr=er.getHash(Fn),lr=er.getHash(zn);return er.distance(rr,lr)},na.compareHashes=function(Fn,zn){return new or().distance(Fn,zn)},na.colorDiff=function(Fn,zn){const er=lr=>Math.pow(lr,2),{max:rr}=Math;return Fn.a===0||Fn.a||(Fn.a=255),zn.a===0||zn.a||(zn.a=255),(rr(er(Fn.r-zn.r),er(Fn.r-zn.r-Fn.a+zn.a))+rr(er(Fn.g-zn.g),er(Fn.g-zn.g-Fn.a+zn.a))+rr(er(Fn.b-zn.b),er(Fn.b-zn.b-Fn.a+zn.a)))/195075},Mn("clone","clone",function(Fn){const zn=new na(this);return qt(Fn)&&Fn.call(zn,null,zn),zn}),dr("background",function(Fn,zn){return typeof Fn!="number"?Yt.call(this,"hex must be a hexadecimal rgba value",zn):(this._background=Fn,qt(zn)&&zn.call(this,null,this),this)}),dr("scan",function(Fn,zn,er,rr,lr,fr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"x and y must be numbers",fr);if(typeof er!="number"||typeof rr!="number")return Yt.call(this,"w and h must be numbers",fr);if(typeof lr!="function")return Yt.call(this,"f must be a function",fr);const wr=Xt(this,Fn,zn,er,rr,lr);return qt(fr)&&fr.call(this,null,wr),wr});{let Fn;typeof window<"u"&&typeof window=="object"&&(Fn=window),typeof self<"u"&&typeof self=="object"&&(Fn=self),Fn.Jimp=na,Fn.Buffer=ks}const br=na;var Ir=__webpack_require__(643),Nr=__webpack_require__(2691),Yr=__webpack_require__.n(Nr);const zr="image/jpeg",_i=()=>({mime:{[zr]:["jpeg","jpg","jpe"]},constants:{MIME_JPEG:zr},decoders:{[zr]:Yr().decode},encoders:{[zr]:Fn=>Yr().encode(Fn.bitmap,Fn._quality).data},class:{_quality:100,quality(Fn,zn){return typeof Fn!="number"?Yt.call(this,"n must be a number",zn):Fn<0||Fn>100?Yt.call(this,"n must be a number 0 - 100",zn):(this._quality=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)}}});var qr=__webpack_require__(9902);const so="image/png",eo=()=>({mime:{[so]:["png"]},constants:{MIME_PNG:so,PNG_FILTER_AUTO:-1,PNG_FILTER_NONE:0,PNG_FILTER_SUB:1,PNG_FILTER_UP:2,PNG_FILTER_AVERAGE:3,PNG_FILTER_PATH:4},hasAlpha:{[so]:!0},decoders:{[so]:qr.PNG.sync.read},encoders:{[so](Fn){const zn=new qr.PNG({width:Fn.bitmap.width,height:Fn.bitmap.height});return zn.data=Fn.bitmap.data,qr.PNG.sync.write(zn,{deflateLevel:Fn._deflateLevel,deflateStrategy:Fn._deflateStrategy,filterType:Fn._filterType,colorType:typeof Fn._colorType=="number"?Fn._colorType:Fn._rgba?6:2,inputHasAlpha:Fn._rgba})}},class:{_deflateLevel:9,_deflateStrategy:3,_filterType:-1,_colorType:null,deflateLevel(Fn,zn){return typeof Fn!="number"?Yt.call(this,"l must be a number",zn):Fn<0||Fn>9?Yt.call(this,"l must be a number 0 - 9",zn):(this._deflateLevel=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)},deflateStrategy(Fn,zn){return typeof Fn!="number"?Yt.call(this,"s must be a number",zn):Fn<0||Fn>3?Yt.call(this,"s must be a number 0 - 3",zn):(this._deflateStrategy=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)},filterType(Fn,zn){return typeof Fn!="number"?Yt.call(this,"n must be a number",zn):Fn<-1||Fn>4?Yt.call(this,"n must be -1 (auto) or a number 0 - 4",zn):(this._filterType=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)},colorType(Fn,zn){return typeof Fn!="number"?Yt.call(this,"s must be a number",zn):Fn!==0&&Fn!==2&&Fn!==4&&Fn!==6?Yt.call(this,"s must be a number 0, 2, 4, 6.",zn):(this._colorType=Math.round(Fn),qt(zn)&&zn.call(this,null,this),this)}}});var io=__webpack_require__(486),yo=__webpack_require__.n(io);const Bo="image/bmp",Mo="image/x-ms-bmp",xo=Fn=>{return Xt({bitmap:zn=yo().decode(Fn)},0,0,zn.width,zn.height,function(er,rr,lr){const fr=this.bitmap.data[lr+0],wr=this.bitmap.data[lr+1],_r=this.bitmap.data[lr+2],$r=this.bitmap.data[lr+3];this.bitmap.data[lr+0]=$r,this.bitmap.data[lr+1]=_r,this.bitmap.data[lr+2]=wr,this.bitmap.data[lr+3]=zn.is_with_alpha?fr:255}).bitmap;var zn},wo=Fn=>yo().encode(function(zn){return Xt(zn,0,0,zn.bitmap.width,zn.bitmap.height,function(er,rr,lr){const fr=this.bitmap.data[lr+0],wr=this.bitmap.data[lr+1],_r=this.bitmap.data[lr+2],$r=this.bitmap.data[lr+3];this.bitmap.data[lr+0]=$r,this.bitmap.data[lr+1]=_r,this.bitmap.data[lr+2]=wr,this.bitmap.data[lr+3]=fr}).bitmap}(Fn)).data;var os=__webpack_require__(9299),rs=__webpack_require__.n(os),xs=__webpack_require__(8834).lW;const fs="image/tiff";var Ds=__webpack_require__(63),ms=__webpack_require__(9455),Po=__webpack_require__(8834).lW;const Ol="image/gif",Hu=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],Gu=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];var ru=__webpack_require__(8834).lW;function vu(Fn,zn,er,rr){const lr=[0,0,0],fr=(zn.length-1)/2;for(let wr=0;wrFn!=null;function Su(Fn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){const lr=parseInt(.2126*this.bitmap.data[rr]+.7152*this.bitmap.data[rr+1]+.0722*this.bitmap.data[rr+2],10);this.bitmap.data[rr]=lr,this.bitmap.data[rr+1]=lr,this.bitmap.data[rr+2]=lr}),qt(Fn)&&Fn.call(this,null,this),this}function bu(Fn,zn){let er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:50;return{r:(zn.r-Fn.r)*(er/100)+Fn.r,g:(zn.g-Fn.g)*(er/100)+Fn.g,b:(zn.b-Fn.b)*(er/100)+Fn.b}}function Dm(Fn,zn){return Fn&&Array.isArray(Fn)?(Fn=Fn.map(er=>(er.apply!=="xor"&&er.apply!=="mix"||(er.params[0]=sn(er.params[0]).toRgb()),er)),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(er,rr,lr)=>{let fr={r:this.bitmap.data[lr],g:this.bitmap.data[lr+1],b:this.bitmap.data[lr+2]};const wr=(_r,$r)=>this.constructor.limit255(fr[_r]+$r);Fn.forEach(_r=>{if(_r.apply==="mix")fr=bu(fr,_r.params[0],_r.params[1]);else if(_r.apply==="tint")fr=bu(fr,{r:255,g:255,b:255},_r.params[0]);else if(_r.apply==="shade")fr=bu(fr,{r:0,g:0,b:0},_r.params[0]);else if(_r.apply==="xor")fr={r:fr.r^_r.params[0].r,g:fr.g^_r.params[0].g,b:fr.b^_r.params[0].b};else if(_r.apply==="red")fr.r=wr("r",_r.params[0]);else if(_r.apply==="green")fr.g=wr("g",_r.params[0]);else if(_r.apply==="blue")fr.b=wr("b",_r.params[0]);else{if(_r.apply==="hue"&&(_r.apply="spin"),fr=sn(fr),!fr[_r.apply])return Yt.call(this,"action "+_r.apply+" not supported",zn);fr=fr[_r.apply](..._r.params).toRgb()}}),this.bitmap.data[lr]=fr.r,this.bitmap.data[lr+1]=fr.g,this.bitmap.data[lr+2]=fr.b}),qt(zn)&&zn.call(this,null,this),this):Yt.call(this,"actions must be an array",zn)}var Mp=__webpack_require__(8834).lW;function Bm(Fn){const zn=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(er,rr,lr){const fr=zn[((3&rr)<<2)+er%4];this.bitmap.data[lr]=Math.min(this.bitmap.data[lr]+fr,255),this.bitmap.data[lr+1]=Math.min(this.bitmap.data[lr+1]+fr,255),this.bitmap.data[lr+2]=Math.min(this.bitmap.data[lr+2]+fr,255)}),qt(Fn)&&Fn.call(this,null,this),this}var Nm=__webpack_require__(8834).lW;function Fm(Fn,zn,er){if(typeof Fn!="boolean"||typeof zn!="boolean")return Yt.call(this,"horizontal and vertical must be Booleans",er);const rr=Nm.alloc(this.bitmap.data.length);return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(lr,fr,wr){const _r=Fn?this.bitmap.width-1-lr:lr,$r=zn?this.bitmap.height-1-fr:fr,Fr=this.bitmap.width*$r+_r<<2,jr=this.bitmap.data.readUInt32BE(wr);rr.writeUInt32BE(jr,Fr)}),this.bitmap.data=Nm.from(rr),qt(er)&&er.call(this,null,this),this}function Vm(){const Fn={r:new Array(256).fill(0),g:new Array(256).fill(0),b:new Array(256).fill(0)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){Fn.r[this.bitmap.data[rr+0]]++,Fn.g[this.bitmap.data[rr+1]]++,Fn.b[this.bitmap.data[rr+2]]++}),Fn}const $u=function(Fn,zn,er){return 255*(Fn-zn)/(er-zn)},Op=function(Fn){return[Fn.findIndex(zn=>zn>0),255-Fn.slice().reverse().findIndex(zn=>zn>0)]};var qm=__webpack_require__(8058),Ym=__webpack_require__.n(qm);function Rp(Fn,zn){let er=0;for(let rr=0;rr{const $r=[...fr,_r].join(" "),Fr=Rp(Fn,$r);Fr<=er?(Fr>wr&&(wr=Fr),fr.push(_r)):(lr.push(fr),fr=[_r])}),lr.push(fr),{lines:lr,longestLine:wr}}function zo(Fn,zn,er){const{lines:rr}=jm(Fn,zn,er);return rr.length*Fn.common.lineHeight}function Uo(Fn,zn,er,rr,lr){if(lr.width>0&&lr.height>0){const fr=zn.pages[lr.page];Fn.blit(fr,er+lr.xoffset,rr+lr.yoffset,lr.x,lr.y,lr.width,lr.height)}return Fn}function Xm(Fn,zn,er,rr,lr){for(let fr=0;fr0&&this.heightOriginal>0&&this.targetWidth>0&&this.targetHeight>0))throw new Error("Invalid settings specified for the resizer.");this.configurePasses()},Ws.prototype.configurePasses=function(){this.widthOriginal===this.targetWidth?this.resizeWidth=this.bypassResizer:(this.ratioWeightWidthPass=this.widthOriginal/this.targetWidth,this.ratioWeightWidthPass<1&&this.interpolationPass?(this.initializeFirstPassBuffers(!0),this.resizeWidth=this.colorChannels===4?this.resizeWidthInterpolatedRGBA:this.resizeWidthInterpolatedRGB):(this.initializeFirstPassBuffers(!1),this.resizeWidth=this.colorChannels===4?this.resizeWidthRGBA:this.resizeWidthRGB)),this.heightOriginal===this.targetHeight?this.resizeHeight=this.bypassResizer:(this.ratioWeightHeightPass=this.heightOriginal/this.targetHeight,this.ratioWeightHeightPass<1&&this.interpolationPass?(this.initializeSecondPassBuffers(!0),this.resizeHeight=this.resizeHeightInterpolated):(this.initializeSecondPassBuffers(!1),this.resizeHeight=this.colorChannels===4?this.resizeHeightRGBA:this.resizeHeightRGB))},Ws.prototype._resizeWidthInterpolatedRGBChannels=function(Fn,zn){const er=zn?4:3,rr=this.ratioWeightWidthPass,lr=this.widthBuffer;let fr,wr,_r=0,$r=0,Fr=0,jr=0,Vr=0;for(fr=0;_r<1/3;fr+=er,_r+=rr)for($r=fr,Fr=0;$r=Vr)){Jr+=jr;break}co+=er,Jr=co,jr-=Vr}while(jr>0&&co=$r)){jr+=_r;break}Fr=Jr,jr=Fr,_r-=$r}while(_r>0&&Fr3&&(this.outputWidthWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.heightOriginal)))},Ws.prototype.initializeSecondPassBuffers=function(Fn){this.heightBuffer=this.generateUint8Buffer(this.finalResultSize),Fn||(this.outputHeightWorkBench=this.generateFloatBuffer(this.targetWidthMultipliedByChannels),this.colorChannels>3&&(this.outputHeightWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.targetWidth)))},Ws.prototype.generateFloatBuffer=function(Fn){try{return new Float32Array(Fn)}catch{return[]}},Ws.prototype.generateFloat64Buffer=function(Fn){try{return new Float64Array(Fn)}catch{return[]}},Ws.prototype.generateUint8Buffer=function(Fn){try{return new Uint8Array(Fn)}catch{return[]}};const Km=Ws;var zm=__webpack_require__(8834).lW;const Zm={nearestNeighbor(Fn,zn){const er=Fn.width,rr=Fn.height,lr=zn.width,fr=zn.height,wr=Fn.data,_r=zn.data;for(let $r=0;$r0?lr[ba-4]:2*lr[ba]-lr[ba+4],iu=lr[ba],nu=lr[ba+4],xu=Yo0?Xr[ba-4*Vr]:2*Xr[ba]-Xr[ba+4*Vr],iu=Xr[ba],nu=Xr[ba+4*Vr],xu=Yo<_r-2?Xr[ba+8*Vr]:2*Xr[ba+4*Vr]-Xr[ba];Kr[Vo+es]=rr(Vs,iu,nu,xu,Oo)}}const Qr=jr*co;if(Qr>1)for(let fo=0;fo=0&&Qr.x<_r&&Qr.y>=0&&Qr.y<$r){const _o=(_r*(0|Qr.y)+Qr.x|0)<<2,jo=this.bitmap.data.readUInt32BE(_o);Fr.writeUInt32BE(jo,fo)}else Fr.writeUInt32BE(this._background,fo)}if(this.bitmap.data=Fr,zn===!0||typeof zn=="string"){const Jr=_r/2-fr/2,Xr=$r/2-wr/2;this.crop(Jr,Xr,fr,wr)}}const Lp=[()=>({blit(Fn,zn,er,rr,lr,fr,wr,_r){if(!(Fn instanceof this.constructor))return Yt.call(this,"The source must be a Jimp image",_r);if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",_r);if(typeof rr=="function")_r=rr,rr=0,lr=0,fr=Fn.bitmap.width,wr=Fn.bitmap.height;else{if(typeof rr!=typeof lr||typeof lr!=typeof fr||typeof fr!=typeof wr)return Yt.call(this,"srcx, srcy, srcw, srch must be numbers",_r);rr=rr||0,lr=lr||0,fr=fr||Fn.bitmap.width,wr=wr||Fn.bitmap.height}zn=Math.round(zn),er=Math.round(er),rr=Math.round(rr),lr=Math.round(lr),fr=Math.round(fr),wr=Math.round(wr);const $r=this.bitmap.width,Fr=this.bitmap.height,jr=this;return Fn.scanQuiet(rr,lr,fr,wr,function(Vr,co,Jr){const Xr=zn+Vr-rr,Kr=er+co-lr;if(Xr>=0&&Kr>=0&&$r-Xr>0&&Fr-Kr>0){const Qr=jr.getPixelIndex(Xr,Kr),fo={r:this.bitmap.data[Jr],g:this.bitmap.data[Jr+1],b:this.bitmap.data[Jr+2],a:this.bitmap.data[Jr+3]},_o={r:jr.bitmap.data[Qr],g:jr.bitmap.data[Qr+1],b:jr.bitmap.data[Qr+2],a:jr.bitmap.data[Qr+3]};jr.bitmap.data[Qr]=(fo.a*(fo.r-_o.r)-_o.r+255>>8)+_o.r,jr.bitmap.data[Qr+1]=(fo.a*(fo.g-_o.g)-_o.g+255>>8)+_o.g,jr.bitmap.data[Qr+2]=(fo.a*(fo.b-_o.b)-_o.b+255>>8)+_o.b,jr.bitmap.data[Qr+3]=this.constructor.limit255(_o.a+fo.a)}}),qt(_r)&&_r.call(this,null,this),this}}),()=>({blur(Fn,zn){if(typeof Fn!="number")return Yt.call(this,"r must be a number",zn);if(Fn<1)return Yt.call(this,"r must be greater than 0",zn);let er,rr,lr,fr,wr,_r,$r,Fr,jr,Vr,co,Jr,Xr,Kr;const Qr=this.bitmap.width-1,fo=this.bitmap.height-1,_o=Fn+1,jo=Hu[Fn],Yo=Gu[Fn],Oo=[],Zo=[],Vo=[],es=[],ba=[],Vs=[];let iu=2;for(;iu-- >0;){for(Jr=0,Xr=0,_r=0;_rQr?Qr:$r)<<2),er+=this.bitmap.data[Fr++],rr+=this.bitmap.data[Fr++],lr+=this.bitmap.data[Fr++],fr+=this.bitmap.data[Fr];for(wr=0;wr0?Fr<<2:0),jr=Xr+ba[wr],Vr=Xr+Vs[wr],er+=this.bitmap.data[jr++]-this.bitmap.data[Vr++],rr+=this.bitmap.data[jr++]-this.bitmap.data[Vr++],lr+=this.bitmap.data[jr++]-this.bitmap.data[Vr++],fr+=this.bitmap.data[jr]-this.bitmap.data[Vr],Jr++;Xr+=this.bitmap.width<<2}for(wr=0;wrfo?0:this.bitmap.width,er+=Oo[co],rr+=Zo[co],lr+=Vo[co],fr+=es[co];for(Jr=wr<<2,_r=0;_r>>Yo,this.bitmap.data[Jr+3]=Kr,Kr>255&&(this.bitmap.data[Jr+3]=255),Kr>0?(Kr=255/Kr,this.bitmap.data[Jr]=(er*jo>>>Yo)*Kr,this.bitmap.data[Jr+1]=(rr*jo>>>Yo)*Kr,this.bitmap.data[Jr+2]=(lr*jo>>>Yo)*Kr):(this.bitmap.data[Jr+2]=0,this.bitmap.data[Jr+1]=0,this.bitmap.data[Jr]=0),wr===0&&(ba[_r]=((Fr=_r+_o)0?Fr*this.bitmap.width:0),jr=wr+ba[_r],Vr=wr+Vs[_r],er+=Oo[jr]-Oo[Vr],rr+=Zo[jr]-Zo[Vr],lr+=Vo[jr]-Vo[Vr],fr+=es[jr]-es[Vr],Jr+=this.bitmap.width<<2}}return qt(zn)&&zn.call(this,null,this),this}}),()=>({circle(){let Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},zn=arguments.length>1?arguments[1]:void 0;typeof Fn=="function"&&(zn=Fn,Fn={});const er=Fn.radius||(this.bitmap.width>this.bitmap.height?this.bitmap.height:this.bitmap.width)/2,rr=typeof Fn.x=="number"?Fn.x:this.bitmap.width/2,lr=typeof Fn.y=="number"?Fn.y:this.bitmap.height/2;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(fr,wr,_r){const $r=Math.sqrt(Math.pow(fr-rr,2)+Math.pow(wr-lr,2));er-$r<=0?this.bitmap.data[_r+3]=0:er-$r<1&&(this.bitmap.data[_r+3]=255*(er-$r))}),qt(zn)&&zn.call(this,null,this),this}}),()=>({brightness(Fn,zn){return typeof Fn!="number"?Yt.call(this,"val must be numbers",zn):Fn<-1||Fn>1?Yt.call(this,"val must be a number between -1 and +1",zn):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(er,rr,lr){Fn<0?(this.bitmap.data[lr]*=1+Fn,this.bitmap.data[lr+1]*=1+Fn,this.bitmap.data[lr+2]*=1+Fn):(this.bitmap.data[lr]+=(255-this.bitmap.data[lr])*Fn,this.bitmap.data[lr+1]+=(255-this.bitmap.data[lr+1])*Fn,this.bitmap.data[lr+2]+=(255-this.bitmap.data[lr+2])*Fn)}),qt(zn)&&zn.call(this,null,this),this)},contrast(Fn,zn){if(typeof Fn!="number")return Yt.call(this,"val must be numbers",zn);if(Fn<-1||Fn>1)return Yt.call(this,"val must be a number between -1 and +1",zn);const er=(Fn+1)/(1-Fn);function rr(lr){return(lr=Math.floor(er*(lr-127)+127))<0?0:lr>255?255:lr}return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(lr,fr,wr){this.bitmap.data[wr]=rr(this.bitmap.data[wr]),this.bitmap.data[wr+1]=rr(this.bitmap.data[wr+1]),this.bitmap.data[wr+2]=rr(this.bitmap.data[wr+2])}),qt(zn)&&zn.call(this,null,this),this},posterize(Fn,zn){return typeof Fn!="number"?Yt.call(this,"n must be numbers",zn):(Fn<2&&(Fn=2),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(er,rr,lr){this.bitmap.data[lr]=Math.floor(this.bitmap.data[lr]/255*(Fn-1))/(Fn-1)*255,this.bitmap.data[lr+1]=Math.floor(this.bitmap.data[lr+1]/255*(Fn-1))/(Fn-1)*255,this.bitmap.data[lr+2]=Math.floor(this.bitmap.data[lr+2]/255*(Fn-1))/(Fn-1)*255}),qt(zn)&&zn.call(this,null,this),this)},greyscale:Su,grayscale:Su,opacity(Fn,zn){return typeof Fn!="number"?Yt.call(this,"f must be a number",zn):Fn<0||Fn>1?Yt.call(this,"f must be a number from 0 to 1",zn):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(er,rr,lr){const fr=this.bitmap.data[lr+3]*Fn;this.bitmap.data[lr+3]=fr}),qt(zn)&&zn.call(this,null,this),this)},sepia(Fn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){let lr=this.bitmap.data[rr],fr=this.bitmap.data[rr+1],wr=this.bitmap.data[rr+2];lr=.393*lr+.769*fr+.189*wr,fr=.349*lr+.686*fr+.168*wr,wr=.272*lr+.534*fr+.131*wr,this.bitmap.data[rr]=lr<255?lr:255,this.bitmap.data[rr+1]=fr<255?fr:255,this.bitmap.data[rr+2]=wr<255?wr:255}),qt(Fn)&&Fn.call(this,null,this),this},fade(Fn,zn){return typeof Fn!="number"?Yt.call(this,"f must be a number",zn):Fn<0||Fn>1?Yt.call(this,"f must be a number from 0 to 1",zn):(this.opacity(1-Fn),qt(zn)&&zn.call(this,null,this),this)},convolution(Fn,zn,er){typeof zn=="function"&&er===void 0&&(er=zn,zn=null),zn||(zn=this.constructor.EDGE_EXTEND);const rr=ru.from(this.bitmap.data),lr=Fn.length,fr=Fn[0].length,wr=Math.floor(lr/2),_r=Math.floor(fr/2),$r=-wr,Fr=-_r;let jr,Vr,co,Jr,Xr,Kr,Qr,fo,_o,jo;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(Yo,Oo,Zo){Jr=0,co=0,Vr=0;for(let Vo=$r;Vo<=wr;Vo++)for(let es=Fr;es<=_r;es++)fo=Yo+es,_o=Oo+Vo,jr=Fn[Vo+wr][es+_r],jo=this.getPixelIndex(fo,_o,zn),jo===-1?(Qr=0,Kr=0,Xr=0):(Xr=this.bitmap.data[jo+0],Kr=this.bitmap.data[jo+1],Qr=this.bitmap.data[jo+2]),Vr+=jr*Xr,co+=jr*Kr,Jr+=jr*Qr;Vr<0&&(Vr=0),co<0&&(co=0),Jr<0&&(Jr=0),Vr>255&&(Vr=255),co>255&&(co=255),Jr>255&&(Jr=255),rr[Zo+0]=Vr,rr[Zo+1]=co,rr[Zo+2]=Jr}),this.bitmap.data=rr,qt(er)&&er.call(this,null,this),this},opaque(Fn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){this.bitmap.data[rr+3]=255}),qt(Fn)&&Fn.call(this,null,this),this},pixelate(Fn,zn,er,rr,lr,fr){if(typeof zn=="function")fr=zn,lr=null,rr=null,er=null,zn=null;else{if(typeof Fn!="number")return Yt.call(this,"size must be a number",fr);if(Gs(zn)&&typeof zn!="number")return Yt.call(this,"x must be a number",fr);if(Gs(er)&&typeof er!="number")return Yt.call(this,"y must be a number",fr);if(Gs(rr)&&typeof rr!="number")return Yt.call(this,"w must be a number",fr);if(Gs(lr)&&typeof lr!="number")return Yt.call(this,"h must be a number",fr)}const wr=[[1/16,2/16,1/16],[2/16,.25,2/16],[1/16,2/16,1/16]];zn=zn||0,er=er||0,rr=Gs(rr)?rr:this.bitmap.width-zn,lr=Gs(lr)?lr:this.bitmap.height-er;const _r=this.cloneQuiet();return this.scanQuiet(zn,er,rr,lr,function($r,Fr,jr){$r=Fn*Math.floor($r/Fn),Fr=Fn*Math.floor(Fr/Fn);const Vr=vu(_r,wr,$r,Fr);this.bitmap.data[jr]=Vr[0],this.bitmap.data[jr+1]=Vr[1],this.bitmap.data[jr+2]=Vr[2]}),qt(fr)&&fr.call(this,null,this),this},convolute(Fn,zn,er,rr,lr,fr){if(!Array.isArray(Fn))return Yt.call(this,"the kernel must be an array",fr);if(typeof zn=="function")fr=zn,zn=null,er=null,rr=null,lr=null;else{if(Gs(zn)&&typeof zn!="number")return Yt.call(this,"x must be a number",fr);if(Gs(er)&&typeof er!="number")return Yt.call(this,"y must be a number",fr);if(Gs(rr)&&typeof rr!="number")return Yt.call(this,"w must be a number",fr);if(Gs(lr)&&typeof lr!="number")return Yt.call(this,"h must be a number",fr)}zn=Gs(zn)?zn:0,er=Gs(er)?er:0,rr=Gs(rr)?rr:this.bitmap.width-zn,lr=Gs(lr)?lr:this.bitmap.height-er;const wr=this.cloneQuiet();return this.scanQuiet(zn,er,rr,lr,function(_r,$r,Fr){const jr=vu(wr,Fn,_r,$r);this.bitmap.data[Fr]=this.constructor.limit255(jr[0]),this.bitmap.data[Fr+1]=this.constructor.limit255(jr[1]),this.bitmap.data[Fr+2]=this.constructor.limit255(jr[2])}),qt(fr)&&fr.call(this,null,this),this},color:Dm,colour:Dm}),()=>({contain(Fn,zn,er,rr,lr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"w and h must be numbers",lr);typeof er=="string"&&(typeof rr=="function"&&lr===void 0&&(lr=rr),rr=er,er=null),typeof er=="function"&&(lr===void 0&&(lr=er),rr=null,er=null),typeof rr=="function"&&lr===void 0&&(lr=rr,rr=null);const fr=7&(er=er||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),wr=er>>3;if((fr===0||fr&fr-1)&&(wr===0||wr&wr-1))return Yt.call(this,"only use one flag per alignment direction",lr);const _r=fr>>1,$r=wr>>1,Fr=Fn/zn>this.bitmap.width/this.bitmap.height?zn/this.bitmap.height:Fn/this.bitmap.width,jr=this.cloneQuiet().scale(Fr,rr);return this.resize(Fn,zn,rr),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(Vr,co,Jr){this.bitmap.data.writeUInt32BE(this._background,Jr)}),this.blit(jr,(this.bitmap.width-jr.bitmap.width)/2*_r,(this.bitmap.height-jr.bitmap.height)/2*$r),qt(lr)&&lr.call(this,null,this),this}}),()=>({cover(Fn,zn,er,rr,lr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"w and h must be numbers",lr);er&&typeof er=="function"&&lr===void 0?(lr=er,er=null,rr=null):typeof rr=="function"&&lr===void 0&&(lr=rr,rr=null);const fr=7&(er=er||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),wr=er>>3;if((fr===0||fr&fr-1)&&(wr===0||wr&wr-1))return Yt.call(this,"only use one flag per alignment direction",lr);const _r=fr>>1,$r=wr>>1,Fr=Fn/zn>this.bitmap.width/this.bitmap.height?Fn/this.bitmap.width:zn/this.bitmap.height;return this.scale(Fr,rr),this.crop((this.bitmap.width-Fn)/2*_r,(this.bitmap.height-zn)/2*$r,Fn,zn),qt(lr)&&lr.call(this,null,this),this}}),function(Fn){return Fn("crop",function(zn,er,rr,lr,fr){if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",fr);if(typeof rr!="number"||typeof lr!="number")return Yt.call(this,"w and h must be numbers",fr);if(zn=Math.round(zn),er=Math.round(er),rr=Math.round(rr),lr=Math.round(lr),zn===0&&rr===this.bitmap.width){const wr=rr*er+zn<<2,_r=wr+(lr*rr<<2);this.bitmap.data=this.bitmap.data.slice(wr,_r)}else{const wr=Mp.allocUnsafe(rr*lr*4);let _r=0;this.scanQuiet(zn,er,rr,lr,function($r,Fr,jr){const Vr=this.bitmap.data.readUInt32BE(jr,!0);wr.writeUInt32BE(Vr,_r,!0),_r+=4}),this.bitmap.data=wr}return this.bitmap.width=rr,this.bitmap.height=lr,qt(fr)&&fr.call(this,null,this),this}),{class:{autocrop(){const zn=this.bitmap.width,er=this.bitmap.height;let rr,lr=0,fr=2e-4,wr=!0,_r=!1,$r={north:!1,south:!1,east:!1,west:!1};for(var Fr=arguments.length,jr=new Array(Fr),Vr=0;Vrfr)break e}Xr++}if(co=this.getPixelColor(zn,0),!$r.west)e:for(let Oo=0;Oofr)break e}fo++}if(co=this.getPixelColor(0,er),!$r.south)e:for(let Oo=er-1;Oo>=Xr+1;Oo--){for(let Zo=zn-Kr-1;Zo>=0;Zo--){const Vo=this.getPixelColor(Zo,Oo),es=this.constructor.intToRGBA(Vo);if(this.constructor.colorDiff(Jr,es)>fr)break e}Qr++}if(co=this.getPixelColor(zn,er),!$r.east)e:for(let Oo=zn-1;Oo>=0+fo+1;Oo--){for(let Zo=er-1;Zo>=0+Xr;Zo--){const Vo=this.getPixelColor(Oo,Zo),es=this.constructor.intToRGBA(Vo);if(this.constructor.colorDiff(Jr,es)>fr)break e}Kr++}let _o=!1;if(fo-=lr,Kr-=lr,Xr-=lr,Qr-=lr,_r){const Oo=Math.min(Kr,fo),Zo=Math.min(Xr,Qr);fo=Oo,Kr=Oo,Xr=Zo,Qr=Zo}fo=fo>=0?fo:0,Kr=Kr>=0?Kr:0,Xr=Xr>=0?Xr:0,Qr=Qr>=0?Qr:0;const jo=zn-(fo+Kr),Yo=er-(Qr+Xr);return _o=wr?Kr!==0&&Xr!==0&&fo!==0&&Qr!==0:Kr!==0||Xr!==0||fo!==0||Qr!==0,_o&&this.crop(fo,Xr,jo,Yo),qt(rr)&&rr.call(this,null,this),this}}}},()=>({displace(Fn,zn,er){if(typeof Fn!="object"||Fn.constructor!==this.constructor)return Yt.call(this,"The source must be a Jimp image",er);if(typeof zn!="number")return Yt.call(this,"factor must be a number",er);const rr=this.cloneQuiet();return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(lr,fr,wr){let _r=Fn.bitmap.data[wr]/256*zn;_r=Math.round(_r);const $r=this.getPixelIndex(lr+_r,fr);this.bitmap.data[$r]=rr.bitmap.data[wr],this.bitmap.data[$r+1]=rr.bitmap.data[wr+1],this.bitmap.data[$r+2]=rr.bitmap.data[wr+2]}),qt(er)&&er.call(this,null,this),this}}),()=>({dither565:Bm,dither16:Bm}),()=>({fisheye(){let Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{r:2.5},zn=arguments.length>1?arguments[1]:void 0;typeof Fn=="function"&&(zn=Fn,Fn={r:2.5});const er=this.cloneQuiet(),{width:rr,height:lr}=er.bitmap;return er.scanQuiet(0,0,rr,lr,(fr,wr)=>{const _r=fr/rr,$r=wr/lr,Fr=Math.sqrt(Math.pow(_r-.5,2)+Math.pow($r-.5,2)),jr=2*Math.pow(Fr,Fn.r),Vr=(_r-.5)/Fr,co=($r-.5)/Fr,Jr=Math.round((jr*Vr+.5)*rr),Xr=Math.round((jr*co+.5)*lr),Kr=er.getPixelColor(Jr,Xr);this.setPixelColor(Kr,fr,wr)}),this.setPixelColor(er.getPixelColor(rr/2,lr/2),rr/2,lr/2),qt(zn)&&zn.call(this,null,this),this}}),()=>({flip:Fm,mirror:Fm}),()=>({gaussian(Fn,zn){if(typeof Fn!="number")return Yt.call(this,"r must be a number",zn);if(Fn<1)return Yt.call(this,"r must be greater than 0",zn);const er=Math.ceil(2.57*Fn),rr=2*er+1,lr=Fn*Fn*2,fr=lr*Math.PI,wr=[];for(let _r=0;_r({invert(Fn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(zn,er,rr){this.bitmap.data[rr]=255-this.bitmap.data[rr],this.bitmap.data[rr+1]=255-this.bitmap.data[rr+1],this.bitmap.data[rr+2]=255-this.bitmap.data[rr+2]}),qt(Fn)&&Fn.call(this,null,this),this}}),()=>({mask(Fn){let zn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,rr=arguments.length>3?arguments[3]:void 0;if(!(Fn instanceof this.constructor))return Yt.call(this,"The source must be a Jimp image",rr);if(typeof zn!="number"||typeof er!="number")return Yt.call(this,"x and y must be numbers",rr);zn=Math.round(zn),er=Math.round(er);const lr=this.bitmap.width,fr=this.bitmap.height,wr=this;return Fn.scanQuiet(0,0,Fn.bitmap.width,Fn.bitmap.height,function(_r,$r,Fr){const jr=zn+_r,Vr=er+$r;if(jr>=0&&Vr>=0&&jr({normalize(Fn){const zn=Vm.call(this),er={r:Op(zn.r),g:Op(zn.g),b:Op(zn.b)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(rr,lr,fr){const wr=this.bitmap.data[fr+0],_r=this.bitmap.data[fr+1],$r=this.bitmap.data[fr+2];this.bitmap.data[fr+0]=$u(wr,er.r[0],er.r[1]),this.bitmap.data[fr+1]=$u(_r,er.g[0],er.g[1]),this.bitmap.data[fr+2]=$u($r,er.b[0],er.b[1])}),qt(Fn)&&Fn.call(this,null,this),this}}),()=>({constants:{measureText:Rp,measureTextHeight:zo,FONT_SANS_8_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),FONT_SANS_10_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),FONT_SANS_12_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),FONT_SANS_14_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),FONT_SANS_16_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),FONT_SANS_32_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),FONT_SANS_64_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),FONT_SANS_128_BLACK:Ut().join(Ll,"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),FONT_SANS_8_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),FONT_SANS_16_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),FONT_SANS_32_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),FONT_SANS_64_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),FONT_SANS_128_WHITE:Ut().join(Ll,"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),loadFont(Fn,zn){return typeof Fn!="string"?Yt.call(this,"file must be a string",zn):new Promise((er,rr)=>{zn=zn||function(lr,fr){lr?rr(lr):er(fr)},Ym()(Fn,(lr,fr)=>{const wr={},_r={};if(lr)return Yt.call(this,lr,zn);for(let $r=0;$r$r.read(Fr+"/"+co));return Promise.all(Vr)})(this,Ut().dirname(Fn),fr.pages).then($r=>{zn(null,{chars:wr,kernings:_r,pages:$r,common:fr.common,info:fr.info})})})})}},class:{print(Fn,zn,er,rr,lr,fr,wr){if(typeof lr=="function"&&wr===void 0&&(wr=lr,lr=1/0),lr===void 0&&(lr=1/0),typeof fr=="function"&&wr===void 0&&(wr=fr,fr=1/0),fr===void 0&&(fr=1/0),typeof Fn!="object")return Yt.call(this,"font must be a Jimp loadFont",wr);if(typeof zn!="number"||typeof er!="number"||typeof lr!="number")return Yt.call(this,"x, y and maxWidth must be numbers",wr);if(typeof lr!="number")return Yt.call(this,"maxWidth must be a number",wr);if(typeof fr!="number")return Yt.call(this,"maxHeight must be a number",wr);let _r,$r;typeof rr=="object"&&rr.text!==null&&rr.text!==void 0?(_r=rr.alignmentX||this.constructor.HORIZONTAL_ALIGN_LEFT,$r=rr.alignmentY||this.constructor.VERTICAL_ALIGN_TOP,{text:rr}=rr):(_r=this.constructor.HORIZONTAL_ALIGN_LEFT,$r=this.constructor.VERTICAL_ALIGN_TOP,rr=rr.toString()),fr!==1/0&&$r===this.constructor.VERTICAL_ALIGN_BOTTOM?er+=fr-zo(Fn,rr,lr):fr!==1/0&&$r===this.constructor.VERTICAL_ALIGN_MIDDLE&&(er+=fr/2-zo(Fn,rr,lr)/2);const Fr=Object.entries(Fn.chars)[0][1].xadvance,{lines:jr,longestLine:Vr}=jm(Fn,rr,lr);return jr.forEach(co=>{const Jr=co.join(" "),Xr=function(Kr,Qr,fo,_o,jo){return jo===Kr.HORIZONTAL_ALIGN_LEFT?0:jo===Kr.HORIZONTAL_ALIGN_CENTER?(_o-Rp(Qr,fo))/2:_o-Rp(Qr,fo)}(this.constructor,Fn,Jr,lr,_r);Xm.call(this,Fn,zn+Xr,er,Jr,Fr),er+=Fn.common.lineHeight}),qt(wr)&&wr.call(this,null,this,{x:zn+Vr,y:er}),this}}}),()=>({constants:{RESIZE_NEAREST_NEIGHBOR:"nearestNeighbor",RESIZE_BILINEAR:"bilinearInterpolation",RESIZE_BICUBIC:"bicubicInterpolation",RESIZE_HERMITE:"hermiteInterpolation",RESIZE_BEZIER:"bezierInterpolation"},class:{resize(Fn,zn,er,rr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"w and h must be numbers",rr);if(typeof er=="function"&&rr===void 0&&(rr=er,er=null),Fn===this.constructor.AUTO&&zn===this.constructor.AUTO)return Yt.call(this,"w and h cannot both be set to auto",rr);if(Fn===this.constructor.AUTO&&(Fn=this.bitmap.width*(zn/this.bitmap.height)),zn===this.constructor.AUTO&&(zn=this.bitmap.height*(Fn/this.bitmap.width)),Fn<0||zn<0)return Yt.call(this,"w and h must be positive numbers",rr);if(Fn=Math.round(Fn)||1,zn=Math.round(zn)||1,typeof kp[er]=="function"){const lr={data:Um.alloc(Fn*zn*4),width:Fn,height:zn};kp[er](this.bitmap,lr),this.bitmap=lr}else{const lr=this;new Km(this.bitmap.width,this.bitmap.height,Fn,zn,!0,!0,fr=>{lr.bitmap.data=Um.from(fr),lr.bitmap.width=Fn,lr.bitmap.height=zn}).resize(this.bitmap.data)}return qt(rr)&&rr.call(this,null,this),this}}}),()=>({rotate(Fn,zn,er){return zn==null&&(zn=!0),typeof zn=="function"&&er===void 0&&(er=zn,zn=!0),typeof Fn!="number"?Yt.call(this,"deg must be a number",er):typeof zn!="boolean"&&typeof zn!="string"?Yt.call(this,"mode must be a boolean or a string",er):(Fn%90!=0||!zn&&this.bitmap.width!==this.bitmap.height&&Fn%180!=0?Dl.call(this,Fn,zn,er):Wu.call(this,Fn),qt(er)&&er.call(this,null,this),this)}}),()=>({scale(Fn,zn,er){if(typeof Fn!="number")return Yt.call(this,"f must be a number",er);if(Fn<0)return Yt.call(this,"f must be a positive number",er);typeof zn=="function"&&er===void 0&&(er=zn,zn=null);const rr=this.bitmap.width*Fn,lr=this.bitmap.height*Fn;return this.resize(rr,lr,zn),qt(er)&&er.call(this,null,this),this},scaleToFit(Fn,zn,er,rr){if(typeof Fn!="number"||typeof zn!="number")return Yt.call(this,"w and h must be numbers",rr);typeof er=="function"&&rr===void 0&&(rr=er,er=null);const lr=Fn/zn>this.bitmap.width/this.bitmap.height?zn/this.bitmap.height:Fn/this.bitmap.width;return this.scale(lr,er),qt(rr)&&rr.call(this,null,this),this}}),()=>({shadow(){let Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},zn=arguments.length>1?arguments[1]:void 0;typeof Fn=="function"&&(zn=Fn,Fn={});const{opacity:er=.7,size:rr=1.1,x:lr=-25,y:fr=25,blur:wr=5}=Fn,_r=this.clone(),$r=this.clone();return $r.scan(0,0,$r.bitmap.width,$r.bitmap.height,(Fr,jr,Vr)=>{$r.bitmap.data[Vr]=0,$r.bitmap.data[Vr+1]=0,$r.bitmap.data[Vr+2]=0,$r.bitmap.data[Vr+3]=$r.constructor.limit255($r.bitmap.data[Vr+3]*er),this.bitmap.data[Vr]=0,this.bitmap.data[Vr+1]=0,this.bitmap.data[Vr+2]=0,this.bitmap.data[Vr+3]=0}),$r.resize($r.bitmap.width*rr,$r.bitmap.height*rr).blur(wr),this.composite($r,lr,fr),this.composite(_r,0,0),qt(zn)&&zn.call(this,null,this),this}}),()=>({threshold(Fn,zn){let{max:er,replace:rr=255,autoGreyscale:lr=!0}=Fn;return typeof er!="number"?Yt.call(this,"max must be a number",zn):typeof rr!="number"?Yt.call(this,"replace must be a number",zn):typeof lr!="boolean"?Yt.call(this,"autoGreyscale must be a boolean",zn):(er=this.constructor.limit255(er),rr=this.constructor.limit255(rr),lr&&this.greyscale(),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(fr,wr,_r)=>{const $r=this.bitmap.data[_r]1&&arguments[1]!==void 0?arguments[1]:br;const er={hasAlpha:{},encoders:{},decoders:{},class:{},constants:{}};function rr(lr){Object.entries(lr).forEach(fr=>{let[wr,_r]=fr;er[wr]={...er[wr],..._r}})}Fn.types&&(Fn.types.forEach(function(lr){const fr=lr();Array.isArray(fr.mime)?xa(...fr.mime):Object.entries(fr.mime).forEach(wr=>xa(...wr)),delete fr.mime,rr(fr)}),zn.decoders={...zn.decoders,...er.decoders},zn.encoders={...zn.encoders,...er.encoders},zn.hasAlpha={...zn.hasAlpha,...er.hasAlpha}),Fn.plugins&&Fn.plugins.forEach(function(lr){const fr=lr(dr)||{};fr.class||fr.constants?rr(fr):rr({class:fr})}),Eu(er.class,zn),yu(er.constants,zn)})({types:[()=>(0,Ir.Ee)(_i(),eo(),{mime:{[Bo]:["bmp"]},constants:{MIME_BMP:Bo,MIME_X_MS_BMP:Mo},decoders:{[Bo]:xo,[Mo]:xo},encoders:{[Bo]:wo,[Mo]:wo}},{mime:{[fs]:["tiff","tif"]},constants:{MIME_TIFF:fs},decoders:{[fs]:Fn=>{const zn=rs().decode(Fn),er=zn[0];zn.forEach(lr=>{rs().decodeImage(Fn,lr)});const rr=rs().toRGBA8(er);return{data:xs.from(rr),width:er.t256[0],height:er.t257[0]}}},encoders:{[fs]:Fn=>{const zn=rs().encodeImage(Fn.bitmap.data,Fn.bitmap.width,Fn.bitmap.height);return xs.from(zn)}}},{mime:{[Ol]:["gif"]},constants:{MIME_GIF:Ol},decoders:{[Ol]:Fn=>{const zn=new Ds.N(Fn),er=Po.alloc(zn.width*zn.height*4);return zn.decodeAndBlitFrameRGBA(0,er),{data:er,width:zn.width,height:zn.height}}},encoders:{[Ol]:Fn=>{const zn=new ms.BitmapImage(Fn.bitmap);ms.GifUtil.quantizeDekker(zn,256);const er=new ms.GifFrame(zn);return new ms.GifCodec().encodeGif([er],{}).then(rr=>rr.buffer)}}})],plugins:[Fn=>{const zn=Lp.map(er=>{let rr=er(Fn)||{};return rr.class||rr.constants||(rr={class:rr}),rr});return(0,Ir.Ee)(...zn)}]})})()})();const _Jimp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Jimp=typeof self<"u"&&self.Jimp||_Jimp,defaultScreenshotRenderer=_e=>jsxRuntimeExports.jsx("img",{src:_e});function Screenshot({screenshot:_e,renderScreenshot:Pt=defaultScreenshotRenderer}){const{result:Dt,loading:Nt}=useAsync(async()=>await(_e==null?void 0:_e()),[_e]);return Pt(Dt,Nt)}function Gallery({onChange:_e}){const Pt=usePaper(),[Dt]=useScreenshots(),[Nt,{set:jt,remove:Ut}]=useMap$1();reactExports.useEffect(()=>{_e==null||_e(lodashExports$1.values(Nt))},[Nt]);function Gt(Wt,qt,Yt){qt&&Yt?jt(`${Wt}`,Yt):Ut(`${Wt}`)}return useAsync(async()=>{const Wt=lodashExports$1.head(lodashExports$1.values(Dt)),qt=await(Wt==null?void 0:Wt());qt&&Gt(0,!0,qt)},[Dt]),jsxRuntimeExports.jsx(Scroll,{x:!0,py:2,children:jsxRuntimeExports.jsx(Stack$1,{direction:"row",children:lodashExports$1.values(Dt).map((Wt,qt)=>jsxRuntimeExports.jsx(Screenshot,{screenshot:Wt,renderScreenshot:(Yt,Xt)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box$1,{sx:{minWidth:"320px",height:"320px",flex:0,p:2,"&:not(:last-child)":{pr:1}},children:jsxRuntimeExports.jsxs(Box$1,{sx:{position:"relative",...Pt(1),height:"100%"},children:[!!Yt&&jsxRuntimeExports.jsx(Box$1,{sx:{backgroundImage:Zt=>`linear-gradient(to bottom, ${alpha(Zt.palette.background.paper,.5)}, transparent), url("${Yt}")`,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center"}}),jsxRuntimeExports.jsx(Box$1,{sx:{position:"absolute",p:1,top:0,left:0},children:jsxRuntimeExports.jsx(FormControlLabel$1,{control:jsxRuntimeExports.jsx(Checkbox$1,{checked:!!Nt[qt],disabled:!Yt,color:"primary",sx:{ml:1},onChange:(Zt,Qt)=>Gt(qt,Qt,Yt)}),label:`Viewport ${qt+1}`})}),Xt&&jsxRuntimeExports.jsx(Box$1,{sx:{position:"absolute",m:2,top:0,right:0},children:jsxRuntimeExports.jsx(CircularProgress$1,{})})]})})})},qt))})})}function getFilename(_e=""){return lodashExports$1.kebabCase(_e.replace("*"," star "))||"untitled"}const imageSize=64;async function resizeImage(_e){const Pt=await Jimp.read(Buffer.from(_e.split(",")[1],"base64")),Dt=Pt.getWidth(){const Zt=lodashExports$1.delay(()=>{Dt(Qt=>({...Qt,workspaceMeta:Nt}))},300);return()=>clearTimeout(Zt)},[Nt,Dt],[Nt]);const{save:Ut,estimateWorkspaceSize:Gt}=useWorkspace(),Wt=useLoadingState("general"),qt=useSnackbar(),Yt=reactExports.useMemo(Gt,[]);async function Xt(Zt){return{...Nt,id:nanoid$1(),size:Zt,screenshots:await map$6((Nt==null?void 0:Nt.screenshots)??[],resizeImage),lastModified:Date.now()}}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box$1,{children:jsxRuntimeExports.jsx(Gallery,{onChange:Zt=>jt("screenshots",Zt)})}),jsxRuntimeExports.jsxs(Stack$1,{p:2,gap:2,children:[jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,defaultValue:Nt.name,onChange:Zt=>jt("name",Zt.target.value),label:"Name",fullWidth:!0}),jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,minRows:3,defaultValue:Nt.description,size:"small",onChange:Zt=>jt("description",Zt.target.value),label:"Description",fullWidth:!0,multiline:!0}),jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,defaultValue:Nt.author,size:"small",onChange:Zt=>jt("author",Zt.target.value),label:"Author",fullWidth:!0,multiline:!0}),jsxRuntimeExports.jsx(Box$1,{sx:{pt:2,width:"100%"},children:jsxRuntimeExports.jsx(Button,{sx:{justifyContent:"flex-start",width:"100%",..._e(1)},onClick:()=>Wt(async()=>{const Zt=getFilename(Nt.name),{size:Qt}=await Ut(!1,Zt);download(JSON.stringify(await Xt(Qt)),`${Zt}.workspace.meta`),qt(`Metadata saved, ${Zt}.workspace.meta`)}),startIcon:jsxRuntimeExports.jsx(DownloadOutlined,{}),size:"large",children:jsxRuntimeExports.jsxs(Stack$1,{sx:{ml:1},alignItems:"baseline",children:[Nt.name||"Untitled",jsxRuntimeExports.jsxs(Type$1,{color:"text.secondary",children:[getFilename(Nt.name),".workspace"]}),jsxRuntimeExports.jsxs(Type$1,{color:"text.secondary",children:[lodashExports$1.ceil(Yt/1024/1024,2)," MB"]})]})})})]})]})}function ExportWorkspaceModal(_e){return jsxRuntimeExports.jsxs(Modal,{..._e,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:()=>{var Pt;return(Pt=_e==null?void 0:_e.onClose)==null?void 0:Pt.call(_e,{},"backdropClick")},children:jsxRuntimeExports.jsx(Type$1,{variant:"h6",children:"Publish Workspace"})}),jsxRuntimeExports.jsx(A$3,{})]})}function MenuEntry({startIcon:_e,endIcon:Pt,label:Dt}){return jsxRuntimeExports.jsxs(Stack$1,{direction:"row",gap:1,children:[!!_e&&reactExports.cloneElement(_e,{fontSize:"small",color:"disabled"}),jsxRuntimeExports.jsx("span",{children:Dt}),!!Pt&&reactExports.cloneElement(Pt,{fontSize:"small",color:"disabled"})]})}function useTitleBarVisible(){const[_e,Pt]=reactExports.useState(!1);return reactExports.useEffect(()=>{if("windowControlsOverlay"in navigator){const Dt=()=>{Pt(!!navigator.windowControlsOverlay.visible)};return navigator.windowControlsOverlay.addEventListener("geometrychange",Dt),Dt(),()=>navigator.windowControlsOverlay.removeEventListener("geometrychange",Dt)}},[Pt]),_e}const TitleBar=()=>{const{save:_e,load:Pt}=useWorkspace(),Dt=useTitleBarVisible(),[,Nt]=useView(),[jt,Ut]=reactExports.useState(!1);function Gt(Wt){Nt(({view:qt})=>({view:{type:"branch",orientation:Wt,key:nanoid$1(),children:[{...qt,size:80},{type:"leaf",key:nanoid$1(),content:{type:""},size:20,acceptDrop:!0}]}}))}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box$1,{sx:{mx:.5,borderBottom:Wt=>`1px solid ${Wt.palette.background.default}`,minHeight:36,height:Dt?"env(titlebar-area-height, 50px)":0,width:"env(titlebar-area-width, 100%)",WebkitAppRegion:"drag",overflowX:"auto"},children:jsxRuntimeExports.jsx(Scroll,{x:!0,style:{height:"100%"},children:jsxRuntimeExports.jsx(Box$1,{sx:{height:"100%"},children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",spacing:1,sx:{height:"100%"},alignItems:"center",justifyContent:"flex-start",children:[jsxRuntimeExports.jsx(Box$1,{sx:{p:1,height:"100%",maxWidth:"min-content",aspectRatio:1},children:jsxRuntimeExports.jsx("img",{src:logo,style:{height:"100%"}})}),[{key:"view",items:[{type:"action",key:"panel-new-right",name:"Add panel to the right",action:()=>Gt("horizontal")},{type:"action",key:"panel-new-bottom",name:"Add panel below",action:()=>Gt("vertical")},{type:"divider"},{type:"action",name:"Reset layout",key:"panel-reset",action:()=>Nt(getDefaultViewTree)}]},{key:"workspace",items:[{type:"action",name:"Open workspace",key:"workspace-load",action:Pt},{type:"action",name:"Save workspace",key:"workspace-save",action:_e},{type:"action",name:jsxRuntimeExports.jsx(MenuEntry,{label:"Publish workspace",endIcon:jsxRuntimeExports.jsx(OpenInNewOutlined,{})}),key:"workspace-save-metadata",action:()=>Ut(!0)}]},{key:"help",items:[{type:"action",name:"Open repository in GitHub",key:"github",action:()=>open(repository,"_blank")},{type:"action",name:"Changelog",key:"changelog",action:()=>open(`${docs}/changelog-${version}.md`,"_blank")},{type:"action",name:"Documentation",key:"documentation",action:()=>open("https://path-visualiser.github.io/docs/overview/","_blank")}]}].map(({key:Wt,items:qt})=>jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Yt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Menu$1,{...bindMenu(Yt),children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{p:0},children:qt.map((Xt,Zt)=>{if(Xt.type==="action"){const{name:Qt,key:en,action:tn}=Xt;return jsxRuntimeExports.jsx(MenuItem$1,{onClick:()=>{tn==null||tn(),Yt.close()},children:Qt},en)}else return jsxRuntimeExports.jsx(Divider$1,{},Zt)})})}),jsxRuntimeExports.jsx(FeaturePickerButton,{...bindTrigger(Yt),sx:{WebkitAppRegion:"no-drag",minWidth:"fit-content",p:.5,px:1},children:lodashExports$1.startCase(Wt)})]})},Wt))]})})})}),jsxRuntimeExports.jsx(ExportWorkspaceModal,{open:jt,onClose:()=>Ut(!1)})]})};function AppBarTitle({children:_e}){return jsxRuntimeExports.jsx(Type$1,{variant:"h6",children:_e})}function ModalAppBar({onClose:_e=()=>{},style:Pt,elevatedStyle:Dt,children:Nt,transitionProperties:jt=["box-shadow","background","border-bottom"],elevatedChildren:Ut,simple:Gt,position:Wt="sticky"}){const qt=useSmallDisplay(),Yt=usePanel(),Xt=useTheme(),[,,Zt,,Qt]=useScrollState();reactExports.useEffect(()=>{Qt(Yt)},[Yt,Qt]);const en=Zt?{background:qt?Xt.palette.background.default:Xt.palette.background.paper,...!Gt&&{boxShadow:Xt.shadows[0]},...Pt}:{background:qt?Xt.palette.background.default:Xt.palette.background.paper,...!Gt&&{boxShadow:Xt.shadows[4]},...Dt};function tn(nn){return typeof nn=="string"?jsxRuntimeExports.jsx(AppBarTitle,{children:nn}):nn}return jsxRuntimeExports.jsx(AppBar$1,{elevation:0,position:Wt,style:{color:Xt.palette.text.primary,transition:Xt.transitions.create(jt),...en},children:jsxRuntimeExports.jsxs(Toolbar$1,{children:[jsxRuntimeExports.jsx(IconButton$1,{style:{marginRight:Xt.spacing(1)},"aria-label":"open drawer",edge:"start",onClick:()=>_e(),children:jsxRuntimeExports.jsx(ArrowBack,{})}),Nt&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(!Ut||Zt),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:tn(Nt)})})}),Ut&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(Ut&&!Zt),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:tn(Ut)})})})]})})}function Modal({children:_e,actions:Pt,width:Dt=480,height:Nt,variant:jt="default",scrollable:Ut=!0,...Gt}){var mn;const[Wt,qt]=reactExports.useState(void 0);reactExports.useEffect(()=>{_e&&qt(_e)},[_e]);const Yt=useTheme(),Xt=useSmallDisplay(),[Zt,Qt]=reactExports.useState(null),[en,tn]=reactExports.useState(null),[nn,rn]=reactExports.useState(!1),[an,sn]=reactExports.useState(0),ln=useTitleBarVisible();reactExports.useEffect(()=>{if(Zt&&en&&!Xt&&!Nt){const gn=()=>{const hn=window.innerHeight-64{window.removeEventListener("resize",gn),un.detach()}}},[Zt,en,Xt,Nt]);const dn=jt==="submodal"&&Xt;return jsxRuntimeExports.jsxs(Dialog$1,{fullScreen:Xt,...Gt,keepMounted:!1,TransitionProps:{unmountOnExit:!0,mountOnEnter:!0},style:{...dn&&{paddingTop:Yt.spacing(8)},...Gt.style},PaperProps:{ref:gn=>Qt(gn),style:{...dn&&{borderRadius:`${Yt.shape.borderRadius}px ${Yt.shape.borderRadius}px 0 0`},background:Xt?Yt.palette.background.default:Yt.palette.background.paper,overflow:"hidden",height:Nt&&!Xt?Nt:nn||Xt?"100%":an||"fit-content",position:"relative",maxWidth:"none",...Xt&&ln&&{paddingTop:36},...(mn=Gt.PaperProps)==null?void 0:mn.style},...Gt.PaperProps},children:[jsxRuntimeExports.jsx(Scroll,{y:!0,style:{height:"100%",width:Xt?void 0:Dt,maxWidth:"100%",overflow:Ut?void 0:"hidden"},children:jsxRuntimeExports.jsx("div",{ref:gn=>tn(gn),style:{width:"100%"},children:Wt})}),Pt]})}function ManagedModal({appBar:_e,trigger:Pt=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),children:Dt,popover:Nt,slotProps:jt}){const Ut=usePaper(),Gt=useAcrylic(),Wt=useSmallDisplay(),qt=Nt&&!Wt;return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Yt=>{var en,tn;const{open:Xt,close:Zt,isOpen:Qt}=Yt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[reactExports.cloneElement(Pt(Xt,Qt)),qt?jsxRuntimeExports.jsx(Popover$1,{...lodashExports$1.merge(bindPopover(Yt),{slotProps:{paper:{sx:{...Gt}}}},jt==null?void 0:jt.popover),children:jsxRuntimeExports.jsx(Box$1,{...lodashExports$1.merge({sx:{width:360,...Ut(1)}},jt==null?void 0:jt.paper),children:Dt??((en=jt==null?void 0:jt.modal)==null?void 0:en.children)})}):jsxRuntimeExports.jsxs(Modal,{open:Qt,onClose:Zt,...jt==null?void 0:jt.modal,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:Zt,..._e}),Dt??((tn=jt==null?void 0:jt.modal)==null?void 0:tn.children)]})]})}})}var rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote$1(_e){return rx_escapable.lastIndex=0,rx_escapable.test(_e)?'"'+_e.replace(rx_escapable,function(Pt){var Dt=meta[Pt];return typeof Dt=="string"?Dt:"\\u"+("0000"+Pt.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+_e+'"'}function str$1(_e,Pt,Dt){var Nt,jt,Ut,Gt,Wt=gap,qt,Yt=Pt[_e];switch(Yt&&typeof Yt=="object"&&typeof Yt.toJSON=="function"&&(Yt=Yt.toJSON(_e)),typeof rep=="function"&&(Yt=rep.call(Pt,_e,Yt)),typeof Yt){case"string":return quote$1(Yt);case"number":return isFinite(Yt)?String(Yt):"null";case"boolean":case"null":return String(Yt);case"object":if(!Yt)return"null";if(gap+=indent,qt=[],Object.prototype.toString.apply(Yt)==="[object Array]"){for(Gt=Yt.length,Nt=0;NtDt?`[ `+gap+qt.join(`, `+gap)+` `+Wt+"]":"[ "+qt.join(", ")+" ]":"["+qt.join(",")+"]",gap=Wt,Ut}if(rep&&typeof rep=="object")for(Gt=rep.length,Nt=0;NtDt?`{ `+gap+qt.join(`, `+gap)+` -`+Wt+"}":"{ "+qt.join(", ")+" }":"{"+qt.join(",")+"}",gap=Wt,Ut}}function beautify(_e,Pt,Dt,Nt){var jt;if(gap="",indent="",Nt||(Nt=0),typeof Nt!="number")throw new Error("beaufifier: limit must be a number");if(typeof Dt=="number")for(jt=0;jt+jt);return Math.abs(Nt)>4?jsxRuntimeExports.jsxs("span",{children:[Dt,"x10",jsxRuntimeExports.jsx("sup",{style:supProps,children:Nt})]}):lodashExports$1.round(_e,2)}else return _e;case"string":return`${_e}`;case"undefined":return"null";default:return Pt?jsxRuntimeExports.jsx("code",{children:lodashExports$1.isNull(_e)?"null":lodashExports$1.get(_e,"constructor.name")??typeof _e}):jsxRuntimeExports.jsx("code",{style:{whiteSpace:"pre"},children:lodashExports$1.truncate(beautify$1(_e,void 0,2),{length:100})})}}function Property({label:_e,value:Pt,type:Dt,simple:Nt}){return jsxRuntimeExports.jsxs(Flex,{width:"auto",mr:2,mb:.5,alignItems:"baseline",children:[jsxRuntimeExports.jsx(Type$1,{component:"div",variant:"body2",...Dt,sx:{opacity:.54,...Dt==null?void 0:Dt.sx},children:_e}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(Type$1,{component:"div",variant:"body2",...Dt,children:renderProperty(Pt,Nt)??"none"})]},`${_e}::${renderProperty(Pt)}`)}const OMIT_PROPS=["type","id"],ESSENTIAL_PROPS=["f","g","pId"],ALL_PROPS=[...OMIT_PROPS,...ESSENTIAL_PROPS],sortEventKeys=_e=>lodashExports$1.chain(_e).entries().filter(([,Pt])=>!lodashExports$1.isUndefined(Pt)).sortBy(([Pt])=>lodashExports$1.indexOf(ALL_PROPS,Pt)+1||Number.MAX_SAFE_INTEGER).value();function PropertyDialog({event:_e,max:Pt=10,simple:Dt,variant:Nt,...jt}){const Ut=sortEventKeys(_e);return jsxRuntimeExports.jsx(ManagedModal,{...lodashExports$1.merge({appBar:{children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Event Properties"})},trigger:Gt=>jsxRuntimeExports.jsxs(Button$2,{variant:"text",sx:{mx:-1,minWidth:0,width:"fit-content",color:Wt=>Wt.palette.text.secondary,justifyContent:"left"},onClick:Wt=>{Wt.stopPropagation(),Wt.preventDefault(),Gt(Wt)},children:[Ut.length-Pt," more"]})},jt),children:[{name:"common",props:lodashExports$1.filter(Ut,([Gt])=>OMIT_PROPS.includes(Gt))},{name:"search",props:lodashExports$1.filter(Ut,([Gt])=>ESSENTIAL_PROPS.includes(Gt))},{name:"other",props:lodashExports$1.filter(Ut,([Gt])=>!ALL_PROPS.includes(Gt))}].map(({name:Gt,props:Wt},qt)=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!qt&&jsxRuntimeExports.jsx(Divider$1,{sx:{mb:1}}),jsxRuntimeExports.jsx(Type$1,{variant:"overline",color:"text.secondary",component:"div",sx:{px:3},children:lodashExports$1.startCase(Gt)}),jsxRuntimeExports.jsx(Box$1,{sx:{p:1,pt:0,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(2, 1fr)"},children:lodashExports$1.map(Wt,([Yt,Xt])=>jsxRuntimeExports.jsx(ListItem$1,{sx:{py:.5},children:jsxRuntimeExports.jsx(ListItemText$1,{secondary:Yt,primary:renderProperty(Xt)})},`${Yt}::${Xt}`))},Gt)]}))})}function PropertyList(_e){const{event:Pt,variant:Dt="body2",max:Nt=10,simple:jt,...Ut}=_e,Gt=sortEventKeys(Pt);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Flex,{...Ut,children:[lodashExports$1.map(lodashExports$1.slice(Gt,0,Nt),([Wt,qt],Yt)=>jsxRuntimeExports.jsx(Property,{label:Wt,value:qt,type:{variant:Dt},simple:jt},Yt)),Gt.length>Nt&&!jt&&jsxRuntimeExports.jsx(PropertyDialog,{..._e})]})})}function TracePreview({trace:_e,language:Pt="json"}){return jsxRuntimeExports.jsx(Box$1,{sx:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx(ScriptViewer,{options:{readOnly:!0},language:Pt,value:_e?beautify$1({..._e,events:lodashExports$1.take(_e.events,10)},null,2,1):"No data"})})}var dist$4={exports:{}};(function(_e,Pt){(function(Dt,Nt){_e.exports=Nt()})(commonjsGlobal,function(){return function(Dt){function Nt(Ut){if(jt[Ut])return jt[Ut].exports;var Gt=jt[Ut]={i:Ut,l:!1,exports:{}};return Dt[Ut].call(Gt.exports,Gt,Gt.exports,Nt),Gt.l=!0,Gt.exports}var jt={};return Nt.m=Dt,Nt.c=jt,Nt.d=function(Ut,Gt,Wt){Nt.o(Ut,Gt)||Object.defineProperty(Ut,Gt,{configurable:!1,enumerable:!0,get:Wt})},Nt.n=function(Ut){var Gt=Ut&&Ut.__esModule?function(){return Ut.default}:function(){return Ut};return Nt.d(Gt,"a",Gt),Gt},Nt.o=function(Ut,Gt){return Object.prototype.hasOwnProperty.call(Ut,Gt)},Nt.p="",Nt(Nt.s=1)}([function(Dt,Nt,jt){function Ut(Wt){var qt=Wt===void 0?{}:Wt,Yt=qt.ESCAPE,Xt=Yt===void 0?/^\\/:Yt,Zt=qt.VARIABLE_START,Qt=Zt===void 0?/^\${\s*/:Zt,en=qt.VARIABLE_END,tn=en===void 0?/^\s*}/:en,nn=qt.PIPE_START,rn=nn===void 0?/^\s*\|\s*/:nn,an=qt.PIPE_PARAMETER_START,sn=an===void 0?/^\s*:\s*/:an,ln=qt.QUOTED_STRING,dn=ln===void 0?Nt.DEFAULT_QUOTED_STRING_REGEX:ln,mn=qt.QUOTED_STRING_TEST,gn=mn===void 0?null:mn,un=qt.QUOTED_STRING_GET_AND_ADVANCE,hn=un===void 0?null:un,bn=qt.QUOTED_STRING_IN_PARAMETER_TEST,En=bn===void 0?null:bn,_n=qt.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,Tn=_n===void 0?null:_n,$n=gn||function(Dn){return dn.test(Dn)},pn=hn||Gt(dn),Nn=En||function(Dn){return dn.test(Dn)},An=Tn||Gt(dn);return function(Dn){function Pn(Er){Er===void 0&&(Er=1),yn=yn.substr(Er)}function Cn(Er){Er===void 0&&(Er=/^/),Pn(yn.match(Er)[0].length)}function Gn(){var Er;return Cn(Xt),Er=yn.length>0?yn[0]:"",Pn(),Er}function In(Er){var Sr=(Er===void 0?{}:Er).isNull,Rr=Sr!==void 0&&Sr;Kn={name:"",pipes:[]},or=!Rr}function Bn(){vn.variables.push(Kn),In({isNull:!0})}function Zn(Er){var Sr=(Er===void 0?{}:Er).isNull,Rr=Sr!==void 0&&Sr;kn={name:"",parameters:[]},Jn=!Rr}function nr(){Kn.pipes.push(kn),Zn({isNull:!0})}function ar(Er){var Sr=(Er===void 0?{}:Er).isNull,Rr=Sr!==void 0&&Sr;tr="",gr=!Rr}function Sn(){kn.parameters.push(tr),ar({isNull:!0})}function Rn(){return!!tn.test(yn)&&(Cn(tn),wn>=3&&Sn(),wn>=2&&nr(),wn>=1&&Bn(),wn=0,!0)}function On(){return!!rn.test(yn)&&(Cn(rn),wn>=3&&Sn(),wn>=2&&nr(),wn>=1&&Zn(),wn=2,!0)}function Vn(){return!!sn.test(yn)&&(Cn(sn),wn>=3&&Sn(),wn>=2&&ar(),wn=3,!0)}for(var yn=Dn,vn={literals:[],variables:[]},wn=0,Un="",Kn={name:"",pipes:[]},kn={name:"",parameters:[]},tr="",or=!1,Jn=!1,gr=!1;yn&&yn.length>0;)switch(wn){case 0:if(Xt.test(yn)){Un+=Gn();continue}if(Qt.test(yn)){wn=1,In(),vn.literals.push(Un),Un="",Cn(Qt);continue}Un+=yn[0],Pn();break;case 1:if(Xt.test(yn)){Kn.name+=Gn();continue}if(Rn()||On())continue;if($n(yn)){Kn.name+=pn(yn,Pn);continue}Kn.name+=yn[0],Pn();break;case 2:if(Xt.test(yn)){kn.name+=Gn();continue}if(Rn()||Vn()||On())continue;if($n(yn)){kn.name+=pn(yn,Pn);continue}kn.name+=yn[0],Pn();break;case 3:if(Xt.test(yn)){tr+=Gn();continue}if(Rn()||Vn()||On())continue;if(Nn(yn)){tr+=An(yn,Pn);continue}tr+=yn[0],Pn()}return gr&&kn.parameters.push(tr),Jn&&Kn.pipes.push(kn),or&&vn.variables.push(Kn),vn.literals.push(Un),vn}}function Gt(Wt){return function(qt,Yt){var Xt=qt.match(Wt);return Yt(Xt[0].length),Xt.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,Nt.parseStringTemplateGenerator=Ut,Nt.parseStringTemplate=Ut(),Nt.getQuotedStringAndAdvanceForRegex=Gt},function(Dt,Nt,jt){Dt.exports=jt(2)},function(Dt,Nt,jt){function Ut(Gt){for(var Wt in Gt)Nt.hasOwnProperty(Wt)||(Nt[Wt]=Gt[Wt])}Object.defineProperty(Nt,"__esModule",{value:!0}),Ut(jt(0)),Ut(jt(3))},function(Dt,Nt,jt){function Ut(Xt){return function(Zt){return Xt.hasOwnProperty(Zt)?Xt[Zt]:Zt.split(".").reduce(function(Qt,en){return Qt.hasOwnProperty(en)?Qt[en]:""},Xt)}}function Gt(Xt,Zt,Qt,en){en===void 0&&(en=Ut(Zt));var tn=en(Xt.name);return Xt.pipes.reduce(function(nn,rn){return Qt.hasOwnProperty(rn.name)?Qt[rn.name](nn,rn.parameters):nn},tn??"")}function Wt(Xt,Zt,Qt,en){return en===void 0&&(en=Ut(Zt)),Xt.literals.length===0?"":Xt.literals.slice(1).reduce(function(tn,nn,rn){return""+tn+Gt(Xt.variables[rn],Zt,Qt,en)+nn},Xt.literals[0])}function qt(Xt,Zt,Qt){return Wt(Yt.parseStringTemplate(Xt),Zt,Qt)}Object.defineProperty(Nt,"__esModule",{value:!0});var Yt=jt(0);Nt.evaluateParsedString=Wt,Nt.evaluateStringTemplate=qt}])})})(dist$4);var distExports=dist$4.exports;function mapProperties(_e={},Pt){const Dt={};for(const Nt of Object.keys(_e))Dt[Nt]=Nt==="$"?_e[Nt]:Pt(_e[Nt],Nt,_e);return Object.setPrototypeOf(Dt,_e)}function parseProperty(_e){switch(_e==null?void 0:_e.constructor){case Array:{const Pt=lodashExports$1.map(_e,parseProperty);return Dt=>lodashExports$1.map(Pt,Nt=>Nt(Dt))}case Object:{const Pt=lodashExports$1.mapValues(_e,parseProperty);return Dt=>lodashExports$1.mapValues(Pt,Nt=>Nt(Dt))}case String:return parseString(_e);default:return()=>_e}}function normalize(_e={}){return mapProperties(_e,Pt=>lodashExports$1.isFunction(Pt)?Pt:parseProperty(Pt))}const parseToken=_e=>{const Pt=Function("$",`return ${_e};`);return Dt=>Pt(new Proxy(normalize(Dt),{get(Nt,jt){return typeof(Nt==null?void 0:Nt[jt])=="function"?Nt[jt]({}):Nt==null?void 0:Nt[jt]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$1=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memo(_e=>{const Pt=parser$1(_e);return lodashExports$1.join(Pt.literals,"")?Dt=>distExports.evaluateParsedString(Pt,{},{},Nt=>parseToken(Nt)(Dt)):parseToken(Pt.variables[0].name)},{primitive:!0});function commonjsRequire(_e){throw new Error('Could not dynamically require "'+_e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(_e,Pt){(function(Dt,Nt){typeof commonjsRequire=="function"?_e.exports=Nt():Dt.pluralize=Nt()})(commonjsGlobal,function(){var Dt=[],Nt=[],jt={},Ut={},Gt={};function Wt(nn){return typeof nn=="string"?new RegExp("^"+nn+"$","i"):nn}function qt(nn,rn){return nn===rn?rn:nn===nn.toLowerCase()?rn.toLowerCase():nn===nn.toUpperCase()?rn.toUpperCase():nn[0]===nn[0].toUpperCase()?rn.charAt(0).toUpperCase()+rn.substr(1).toLowerCase():rn.toLowerCase()}function Yt(nn,rn){return nn.replace(/\$(\d{1,2})/g,function(an,sn){return rn[sn]||""})}function Xt(nn,rn){return nn.replace(rn[0],function(an,sn){var ln=Yt(rn[1],arguments);return qt(an===""?nn[sn-1]:an,ln)})}function Zt(nn,rn,an){if(!nn.length||jt.hasOwnProperty(nn))return rn;for(var sn=an.length;sn--;){var ln=an[sn];if(ln[0].test(rn))return Xt(rn,ln)}return rn}function Qt(nn,rn,an){return function(sn){var ln=sn.toLowerCase();return rn.hasOwnProperty(ln)?qt(sn,ln):nn.hasOwnProperty(ln)?qt(sn,nn[ln]):Zt(ln,sn,an)}}function en(nn,rn,an,sn){return function(ln){var dn=ln.toLowerCase();return rn.hasOwnProperty(dn)?!0:nn.hasOwnProperty(dn)?!1:Zt(dn,dn,an)===dn}}function tn(nn,rn,an){var sn=rn===1?tn.singular(nn):tn.plural(nn);return(an?rn+" ":"")+sn}return tn.plural=Qt(Gt,Ut,Dt),tn.isPlural=en(Gt,Ut,Dt),tn.singular=Qt(Ut,Gt,Nt),tn.isSingular=en(Ut,Gt,Nt),tn.addPluralRule=function(nn,rn){Dt.push([Wt(nn),rn])},tn.addSingularRule=function(nn,rn){Nt.push([Wt(nn),rn])},tn.addUncountableRule=function(nn){if(typeof nn=="string"){jt[nn.toLowerCase()]=!0;return}tn.addPluralRule(nn,"$0"),tn.addSingularRule(nn,"$0")},tn.addIrregularRule=function(nn,rn){rn=rn.toLowerCase(),nn=nn.toLowerCase(),Gt[nn]=rn,Ut[rn]=nn},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(nn){return tn.addIrregularRule(nn[0],nn[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(nn){return tn.addPluralRule(nn[0],nn[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(nn){return tn.addSingularRule(nn[0],nn[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(tn.addUncountableRule),tn})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs(pluralizeExports),parseTraceWorkerUrl=""+new URL("parseTrace.worker-3082fe1b.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker);function useTraceParser(_e){const Pt=useSnackbar(),Dt=useLoadingState("specimen");return reactExports.useCallback(()=>Dt(async()=>{var Nt;if(_e!=null&&_e.trace){Pt("Processing trace...");try{const jt=await parseTraceAsync(_e);return Pt("Trace loaded",pluralize("step",((Nt=jt==null?void 0:jt.stepsPersistent)==null?void 0:Nt.length)??0,!0)),{components:jt,content:_e.trace}}catch(jt){return console.error(jt),Pt("Error parsing",lodashExports$1.get(jt,"message")),{error:lodashExports$1.get(jt,"message")}}}}),[_e])}function useTraceContent(_e){const Pt=useSnackbar(),Dt=useLoadingState("specimen"),Nt=useConnectionResolver(),[{traces:jt}]=useFeatures(),Ut=reactExports.useMemo(()=>memo(async({source:Xt,id:Zt})=>{if(Xt&&Zt){const Qt=Nt({url:Xt});if(Qt){Pt("Fetching trace...");const en=await Qt.transport().call("features/trace",{id:Zt});return en==null?void 0:en.content}}},{normalizer:JSON.stringify}),[Nt,Pt]),{content:Gt,source:Wt,id:qt}=_e??{},{lastModified:Yt}=lodashExports$1.find(jt,{id:qt,source:Wt})??{};return useAsync(()=>Dt(async()=>{if(qt)return{..._e,content:Gt||await Ut({source:Wt,id:qt,lastModified:Yt})}}),[Ut,Gt,Wt,qt,Yt])}const isNullish=_e=>_e==null;function makePathIndex(_e){const Pt=[],Dt={},Nt={},jt=lodashExports$1.chain(_e==null?void 0:_e.events).map((Wt,qt)=>({step:qt,id:Wt.id,pId:Wt.pId})).groupBy("id").value();lodashExports$1.forEach(_e==null?void 0:_e.events,({id:Wt,pId:qt},Yt)=>{!isNullish(qt)&&Dt[Wt]!==qt&&(Pt.push({id:Wt,pId:qt,step:Yt,prev:lodashExports$1.last(Pt)}),Dt[Wt]=qt),Nt[Yt]=lodashExports$1.last(Pt)});const Ut=(Wt,qt=(Yt=>(Yt=_e==null?void 0:_e.events)==null?void 0:Yt.length)()??0)=>{let Xt=Nt[qt];for(;Xt;){if(Xt.id===Wt)return Xt.pId;Xt=Xt.prev}};return{getParent:Ut,getPath:Wt=>{const qt=[Wt];let Yt={...(_e.events??[])[Wt],step:Wt};for(;Yt;){const Xt=Ut(Yt.id,Yt.step);if(Xt){const Zt=lodashExports$1.findLast(jt[Xt],Qt=>Qt.step<=Yt.step);if(Zt)qt.push(Zt.step),Yt=Zt;else break}else break}return qt}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),inferName:_e=>{var Pt,Dt;return((Dt=(Pt=_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.name)??"Untitled Trace"},error:_e=>{var Pt,Dt,Nt,jt;return((Dt=(Pt=_e==null?void 0:_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.error)||((jt=(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.parsedTrace)==null?void 0:jt.error)},claimImportedFile:async _e=>isTraceFormat(_e)?{claimed:!0,layer:async Pt=>{Pt("Opening trace...");try{return{trace:{...await readUploadedTrace(_e).read()}}}catch(Dt){return console.error(Dt),Pt(`Error opening, ${lodashExports$1.get(Dt,"message")}`),{trace:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(Dt,"message"),name:lodashExports$1.startCase(name$2(_e.name))}}}}}:{claimed:!1},editor:withProduce(({value:_e,produce:Pt})=>{var Dt,Nt,jt,Ut,Gt,Wt,qt,Yt,Xt,Zt,Qt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:en=>Pt(tn=>lodashExports$1.set(tn,"source.trace",en)),value:(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.trace})}),((jt=(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.trace)==null?void 0:jt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:en=>en.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Gt=(Ut=_e==null?void 0:_e.source)==null?void 0:Ut.trace)==null?void 0:Gt.error})}),((qt=(Wt=_e==null?void 0:_e.source)==null?void 0:Wt.parsedTrace)==null?void 0:qt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:en=>en.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Xt=(Yt=_e==null?void 0:_e.source)==null?void 0:Yt.parsedTrace)==null?void 0:Xt.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Qt=(Zt=_e==null?void 0:_e.source)==null?void 0:Zt.parsedTrace)==null?void 0:Qt.content})})]})}),service:withProduce(({value:_e,produce:Pt})=>{var Ut,Gt,Wt;const{palette:Dt}=useTheme(),{result:Nt}=useTraceContent((Ut=_e==null?void 0:_e.source)==null?void 0:Ut.trace),jt=useTraceParser({trace:Nt==null?void 0:Nt.content,context:{color:colorsHex,themeAccent:Dt.primary.main,themeTextPrimary:Dt.text.primary,themeBackground:Dt.background.paper},view:"main"});return reactExports.useEffect(()=>{Pt(qt=>{var Yt,Xt;return lodashExports$1.set(qt,"source.playbackTo",((Xt=(Yt=Nt==null?void 0:Nt.content)==null?void 0:Yt.events)==null?void 0:Xt.length)??0)})},[(Wt=(Gt=Nt==null?void 0:Nt.content)==null?void 0:Gt.events)==null?void 0:Wt.length]),useEffectWhen(async()=>{const qt=await jt();Pt(Yt=>{lodashExports$1.set(Yt,"source.parsedTrace",qt),lodashExports$1.set(Yt,"viewKey",nanoid$1())})},[jt],[Nt==null?void 0:Nt.key,Dt.mode]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:_e})})}),renderer:({layer:_e,index:Pt})=>{var qt,Yt,Xt;const Dt=(Yt=(qt=_e==null?void 0:_e.source)==null?void 0:qt.parsedTrace)==null?void 0:Yt.components,Nt=useThrottle$1(((Xt=_e==null?void 0:_e.source)==null?void 0:Xt.step)??0,1e3/60),jt=use2DPath(_e,Pt,Nt),Ut=reactExports.useMemo(()=>lodashExports$1.map(Dt==null?void 0:Dt.stepsPersistent,Zt=>lodashExports$1.map(Zt,Qt=>lodashExports$1.merge(Qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:Pt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Dt==null?void 0:Dt.stepsPersistent,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,Pt]),Gt=reactExports.useMemo(()=>lodashExports$1.map(Dt==null?void 0:Dt.stepsTransient,Zt=>lodashExports$1.map(Zt,Qt=>lodashExports$1.merge(Qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:Pt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Dt==null?void 0:Dt.stepsTransient,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,Pt]),Wt=reactExports.useMemo(()=>[Gt[Nt]??[]],[Gt,Nt]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{step:Nt,nodes:Ut}),jsxRuntimeExports.jsx(NodeList,{nodes:Wt}),jt]})},steps:_e=>{var Pt,Dt,Nt;return((Nt=(Dt=(Pt=_e==null?void 0:_e.source)==null?void 0:Pt.parsedTrace)==null?void 0:Dt.content)==null?void 0:Nt.events)??[]},provideSelectionInfo:({layer:_e,event:Pt,children:Dt})=>{const{layer:Nt,setLayer:jt}=useLayer(_e),Ut=reactExports.useMemo(()=>{var Yt,Xt,Zt,Qt,en;const Gt=((Zt=(Xt=(Yt=Nt==null?void 0:Nt.source)==null?void 0:Yt.parsedTrace)==null?void 0:Xt.content)==null?void 0:Zt.events)??[],Wt=lodashExports$1.chain((Qt=Pt==null?void 0:Pt.info)==null?void 0:Qt.components).filter(tn=>{var nn;return((nn=tn.meta)==null?void 0:nn.sourceLayer)===(Nt==null?void 0:Nt.key)}).map(tn=>{var nn;return(nn=tn.meta)==null?void 0:nn.step}).filter(lodashExports$1.negate(lodashExports$1.isUndefined)).sort((tn,nn)=>tn-nn).value(),qt=lodashExports$1.chain((en=Pt==null?void 0:Pt.info)==null?void 0:en.components).filter(tn=>{var nn;return((nn=tn.meta)==null?void 0:nn.sourceLayer)===(Nt==null?void 0:Nt.key)}).filter(tn=>{var nn;return(nn=tn.meta)==null?void 0:nn.info}).value();if(Wt.length&&Nt){const tn=lodashExports$1.last(Wt),nn=Gt[tn];if(nn)return{...lodashExports$1.keyBy(lodashExports$1.map(qt,(rn,an)=>({key:`${Nt.key}.${an}`,primary:`Selection in ${inferLayerName(Nt)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:rn.meta.info,vertical:!0})}}})),"key"),[Nt.key]:{primary:inferLayerName(Nt),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:nn,vertical:!0})},[`${nn}`]:{primary:`Go to Step ${tn}`,secondary:`${lodashExports$1.startCase(nn.type)}`,action:()=>jt(produce(Nt,rn=>{lodashExports$1.set(rn,"source.step",tn)})),icon:jsxRuntimeExports.jsx(ArrowOutwardRounded,{})}}}}}return{}},[Nt,Pt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Dt==null?void 0:Dt(Ut)})}};function use2DPath(_e,Pt=0,Dt=0){var Gt,Wt,qt;const{palette:Nt}=useTheme(),{getPath:jt}=reactExports.useMemo(()=>{var Yt,Xt,Zt;return((Yt=_e==null?void 0:_e.source)==null?void 0:Yt.playback)!=="playing"&&((Zt=(Xt=_e==null?void 0:_e.source)==null?void 0:Xt.parsedTrace)!=null&&Zt.content)?makePathIndex(_e.source.parsedTrace.content):{getParent:lodashExports$1.constant(void 0),getPath:lodashExports$1.constant([])}},[(Wt=(Gt=_e==null?void 0:_e.source)==null?void 0:Gt.parsedTrace)==null?void 0:Wt.content,(qt=_e==null?void 0:_e.source)==null?void 0:qt.playback]);return reactExports.useMemo(()=>{var Yt,Xt,Zt,Qt;if((Qt=(Zt=(Xt=(Yt=_e==null?void 0:_e.source)==null?void 0:Yt.parsedTrace)==null?void 0:Xt.content)==null?void 0:Zt.render)!=null&&Qt.path){const{pivot:en={},scale:tn=1}=_e.source.parsedTrace.content.render.path,{x:nn,y:rn}=en,an=nn?parseString(nn):dn=>dn.event.x,sn=rn?parseString(rn):dn=>dn.event.y,ln=lodashExports$1.map(jt(Dt),dn=>{var mn,gn,un,hn;return(hn=(un=(gn=(mn=_e==null?void 0:_e.source)==null?void 0:mn.parsedTrace)==null?void 0:gn.content)==null?void 0:un.events)==null?void 0:hn[dn]});if(ln.length){const dn=[{$:"rect",x:an({event:{x:0,y:0,...lodashExports$1.head(ln)}})-2*tn/2,y:sn({event:{x:0,y:0,...lodashExports$1.head(ln)}})-2*tn/2,fill:getColorHex("destination"),width:2*tn,height:2*tn},{$:"rect",x:an({event:{x:0,y:0,...lodashExports$1.last(ln)}})-2*tn/2,y:sn({event:{x:0,y:0,...lodashExports$1.last(ln)}})-2*tn/2,fill:getColorHex("source"),width:2*tn,height:2*tn},{$:"path",points:ln.map(mn=>({x:an({event:{x:0,y:0,...mn}}),y:sn({event:{x:0,y:0,...mn}})})),fill:Nt.primary.main,alpha:1,lineWidth:1*tn}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports$1.map(dn,mn=>({component:mn,meta:{source:"path",sourceLayerIndex:-99999+Pt}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[_e,Pt,Dt,Nt,jt])}async function findConnection(_e,Pt,Dt){for(const Nt of _e){const jt=await Nt.transport().call("features/algorithms"),Ut=await Nt.transport().call("features/formats");if(lodashExports$1.find(jt,{id:Pt})&&lodashExports$1.find(Ut,{id:Dt}))return Nt}}const controller={...lodashExports$1.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),editor:withProduce(({value:_e,produce:Pt})=>{var Yt,Xt;const{algorithm:Dt}=(_e==null?void 0:_e.source)??{},{layers:Nt,allLayers:jt,layer:Ut,key:Gt}=useLayer(void 0,Zt=>{var Qt;return((Qt=Zt.source)==null?void 0:Qt.type)==="map"}),[{algorithms:Wt}]=useFeatures(),[qt]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(CodeOutlined,{}),label:"Algorithm",value:Dt,items:Wt.map(Zt=>{var Qt;return{...Zt,description:(Qt=lodashExports$1.find(qt,{url:Zt.source}))==null?void 0:Qt.name}}),onChange:async Zt=>Pt(Qt=>lodashExports$1.set(Qt,"source.algorithm",Zt))})}),!(Wt!=null&&Wt.length)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:Gt,items:jt.map(Zt=>({id:Zt.key,hidden:!lodashExports$1.find(Nt,Qt=>Qt.key===Zt.key),name:inferLayerName(Zt)})),onChange:async Zt=>Pt(Qt=>lodashExports$1.set(Qt,"source.mapLayerKey",Zt))})}),Ut&&jsxRuntimeExports.jsxs(Type$1,{variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(Ut)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Xt=(Yt=_e==null?void 0:_e.source)==null?void 0:Yt.trace)==null?void 0:Xt.content})})]})}),service:withProduce(({value:_e,produce:Pt,onChange:Dt})=>{const Nt=controller$1.service,jt=useSnackbar(),{algorithm:Ut,mapLayerKey:Gt,start:Wt,end:qt}=(_e==null?void 0:_e.source)??{},[{layers:Yt}]=useLayers(),[Xt]=useConnections(),[{algorithms:Zt}]=useFeatures(),Qt=reactExports.useMemo(()=>{if(Gt&&Ut)return lodashExports$1.find(Yt,{key:Gt})},[Gt,Ut,Yt]);return useEffectWhenAsync(async en=>{var tn;if(Qt&&Ut){const{format:nn,content:rn}=((tn=Qt==null?void 0:Qt.source)==null?void 0:tn.map)??{};if(nn&&rn){const an=await findConnection(Xt,Ut,nn),sn=lodashExports$1.find(Zt,{id:Ut});if(an){jt(`Executing ${inferLayerName(_e)} using ${an.name}...`);const ln=await an.transport().call("solve/pathfinding",{format:nn,instances:[{start:Wt??0,end:qt??0}],mapURI:`map:${encodeURIComponent(rn)}`,algorithm:Ut});en.aborted?jt("Canceled"):Pt(dn=>lodashExports$1.set(dn,"source.trace",{name:`${sn==null?void 0:sn.name}`,content:ln,key:nanoid$1(),id:nanoid$1()}))}}}},[Qt,Xt,Ut,Wt,qt,Pt,jt,_e,Zt],[Qt,Xt,Ut,Wt,qt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Nt,{value:_e,onChange:Dt})})}),inferName:_e=>{var Pt,Dt;return((Dt=(Pt=_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.name)??"Untitled Query"},provideSelectionInfo:({children:_e,event:Pt,layer:Dt})=>{const Nt=controller$1.provideSelectionInfo,{layer:jt,setLayer:Ut,layers:Gt}=useLayer(Dt),Wt=reactExports.useMemo(()=>{const Yt=lodashExports$1.filter(Gt,{source:{type:"map"}});return lodashExports$1.filter(lodashExports$1.map(Yt,Xt=>{var Qt,en,tn,nn;const{parsedMap:Zt}=(Xt==null?void 0:Xt.source)??{};if(Zt&&Pt){const rn=(nn=(tn=getParser((en=(Qt=Xt==null?void 0:Xt.source)==null?void 0:Qt.map)==null?void 0:en.format))==null?void 0:tn.hydrate)==null?void 0:nn.call(tn,Zt);if(rn){const an=(Pt==null?void 0:Pt.world)&&rn.snap(Pt.world);if(an){const sn=(Pt==null?void 0:Pt.world)&&rn.nodeAt(an);return{point:an,node:sn,key:Xt.key,name:inferLayerName(Xt)}}}}}))},[Gt]),qt=reactExports.useMemo(()=>!!jt&&!!Wt.length&&{[jt.key]:{primary:inferLayerName(jt),items:{...lodashExports$1.reduce(Wt,(Yt,Xt)=>({...Yt,[`${Dt}-${Xt==null?void 0:Xt.key}-source`]:{primary:"Set as source",secondary:Xt==null?void 0:Xt.name,action:()=>Ut(produce(jt,Zt=>{lodashExports$1.set(Zt,"source.start",Xt==null?void 0:Xt.node),lodashExports$1.set(Zt,"source.query",void 0),lodashExports$1.set(Zt,"source.mapLayerKey",Xt==null?void 0:Xt.key),lodashExports$1.set(Zt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(StartIcon,{sx:{transform:"scale(0.5)"}})},[`${Dt}-${Xt==null?void 0:Xt.key}-destination`]:{primary:"Set as destination",secondary:Xt==null?void 0:Xt.name,action:()=>Ut(produce(jt,Zt=>{lodashExports$1.set(Zt,"source.end",Xt==null?void 0:Xt.node),lodashExports$1.set(Zt,"source.query",void 0),lodashExports$1.set(Zt,"source.mapLayerKey",Xt==null?void 0:Xt.key),lodashExports$1.set(Zt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(DestinationIcon,{})}}),{})}}},[Wt,jt,Gt,Ut]);return jsxRuntimeExports.jsx(Nt,{event:Pt,layer:Dt,children:Yt=>_e==null?void 0:_e(lodashExports$1.merge(Yt,qt))})}};function getLayerHandler(_e){var Pt;return layerHandlers[((Pt=_e==null?void 0:_e.source)==null?void 0:Pt.type)??""]}const layerHandlers={trace:controller$1,map:controller$2,query:controller};function inferLayerName(_e){var Pt,Dt;return _e!=null&&_e.name?_e==null?void 0:_e.name:(Pt=_e==null?void 0:_e.source)!=null&&Pt.type?layerHandlers[(Dt=_e.source)==null?void 0:Dt.type].inferName(_e):"Untitled Layer"}var ReactReduxContext=React.createContext(null);function defaultNoopBatch(_e){_e()}var batch=defaultNoopBatch,setBatch=function _e(Pt){return batch=Pt},getBatch=function _e(){return batch};function createListenerCollection(){var _e=getBatch(),Pt=null,Dt=null;return{clear:function(){Pt=null,Dt=null},notify:function(){_e(function(){for(var jt=Pt;jt;)jt.callback(),jt=jt.next})},get:function(){for(var jt=[],Ut=Pt;Ut;)jt.push(Ut),Ut=Ut.next;return jt},subscribe:function(jt){var Ut=!0,Gt=Dt={callback:jt,next:null,prev:Dt};return Gt.prev?Gt.prev.next=Gt:Pt=Gt,function(){!Ut||Pt===null||(Ut=!1,Gt.next?Gt.next.prev=Gt.prev:Dt=Gt.prev,Gt.prev?Gt.prev.next=Gt.next:Pt=Gt.next)}}}}var nullListeners={notify:function _e(){},get:function _e(){return[]}};function createSubscription(_e,Pt){var Dt,Nt=nullListeners;function jt(Zt){return qt(),Nt.subscribe(Zt)}function Ut(){Nt.notify()}function Gt(){Xt.onStateChange&&Xt.onStateChange()}function Wt(){return!!Dt}function qt(){Dt||(Dt=Pt?Pt.addNestedSub(Gt):_e.subscribe(Gt),Nt=createListenerCollection())}function Yt(){Dt&&(Dt(),Dt=void 0,Nt.clear(),Nt=nullListeners)}var Xt={addNestedSub:jt,notifyNestedSubs:Ut,handleChangeWrapper:Gt,isSubscribed:Wt,trySubscribe:qt,tryUnsubscribe:Yt,getListeners:function(){return Nt}};return Xt}var useIsomorphicLayoutEffect$4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function Provider(_e){var Pt=_e.store,Dt=_e.context,Nt=_e.children,jt=reactExports.useMemo(function(){var Wt=createSubscription(Pt);return{store:Pt,subscription:Wt}},[Pt]),Ut=reactExports.useMemo(function(){return Pt.getState()},[Pt]);useIsomorphicLayoutEffect$4(function(){var Wt=jt.subscription;return Wt.onStateChange=Wt.notifyNestedSubs,Wt.trySubscribe(),Ut!==Pt.getState()&&Wt.notifyNestedSubs(),function(){Wt.tryUnsubscribe(),Wt.onStateChange=null}},[jt,Ut]);var Gt=Dt||ReactReduxContext;return React.createElement(Gt.Provider,{value:jt},Nt)}var _excluded$2=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],_excluded2=["reactReduxForwardedRef"],EMPTY_ARRAY=[],NO_SUBSCRIPTION_ARRAY=[null,null];function storeStateUpdatesReducer(_e,Pt){var Dt=_e[1];return[Pt.payload,Dt+1]}function useIsomorphicLayoutEffectWithArgs(_e,Pt,Dt){useIsomorphicLayoutEffect$4(function(){return _e.apply(void 0,Pt)},Dt)}function captureWrapperProps(_e,Pt,Dt,Nt,jt,Ut,Gt){_e.current=Nt,Pt.current=jt,Dt.current=!1,Ut.current&&(Ut.current=null,Gt())}function subscribeUpdates(_e,Pt,Dt,Nt,jt,Ut,Gt,Wt,qt,Yt){if(_e){var Xt=!1,Zt=null,Qt=function(){if(!Xt){var nn=Pt.getState(),rn,an;try{rn=Nt(nn,jt.current)}catch(sn){an=sn,Zt=sn}an||(Zt=null),rn===Ut.current?Gt.current||qt():(Ut.current=rn,Wt.current=rn,Gt.current=!0,Yt({type:"STORE_UPDATED",payload:{error:an}}))}};Dt.onStateChange=Qt,Dt.trySubscribe(),Qt();var en=function(){if(Xt=!0,Dt.tryUnsubscribe(),Dt.onStateChange=null,Zt)throw Zt};return en}}var initStateUpdates=function _e(){return[null,0]};function connectAdvanced(_e,Pt){Pt===void 0&&(Pt={});var Dt=Pt,Nt=Dt.getDisplayName,jt=Nt===void 0?function(ln){return"ConnectAdvanced("+ln+")"}:Nt,Ut=Dt.methodName,Gt=Ut===void 0?"connectAdvanced":Ut,Wt=Dt.renderCountProp,qt=Wt===void 0?void 0:Wt,Yt=Dt.shouldHandleStateChanges,Xt=Yt===void 0?!0:Yt,Zt=Dt.storeKey,Qt=Zt===void 0?"store":Zt;Dt.withRef;var en=Dt.forwardRef,tn=en===void 0?!1:en,nn=Dt.context,rn=nn===void 0?ReactReduxContext:nn,an=_objectWithoutPropertiesLoose$3(Dt,_excluded$2),sn=rn;return function(dn){var mn=dn.displayName||dn.name||"Component",gn=jt(mn),un=_extends$2({},an,{getDisplayName:jt,methodName:Gt,renderCountProp:qt,shouldHandleStateChanges:Xt,storeKey:Qt,displayName:gn,wrappedComponentName:mn,WrappedComponent:dn}),hn=an.pure;function bn(pn){return _e(pn.dispatch,un)}var En=hn?reactExports.useMemo:function(pn){return pn()};function _n(pn){var Nn=reactExports.useMemo(function(){var gr=pn.reactReduxForwardedRef,Er=_objectWithoutPropertiesLoose$3(pn,_excluded2);return[pn.context,gr,Er]},[pn]),An=Nn[0],Dn=Nn[1],Pn=Nn[2],Cn=reactExports.useMemo(function(){return An&&An.Consumer&&reactIsExports.isContextConsumer(React.createElement(An.Consumer,null))?An:sn},[An,sn]),Gn=reactExports.useContext(Cn),In=!!pn.store&&!!pn.store.getState&&!!pn.store.dispatch;Gn&&Gn.store;var Bn=In?pn.store:Gn.store,Zn=reactExports.useMemo(function(){return bn(Bn)},[Bn]),nr=reactExports.useMemo(function(){if(!Xt)return NO_SUBSCRIPTION_ARRAY;var gr=createSubscription(Bn,In?null:Gn.subscription),Er=gr.notifyNestedSubs.bind(gr);return[gr,Er]},[Bn,In,Gn]),ar=nr[0],Sn=nr[1],Rn=reactExports.useMemo(function(){return In?Gn:_extends$2({},Gn,{subscription:ar})},[In,Gn,ar]),On=reactExports.useReducer(storeStateUpdatesReducer,EMPTY_ARRAY,initStateUpdates),Vn=On[0],yn=Vn[0],vn=On[1];if(yn&&yn.error)throw yn.error;var wn=reactExports.useRef(),Un=reactExports.useRef(Pn),Kn=reactExports.useRef(),kn=reactExports.useRef(!1),tr=En(function(){return Kn.current&&Pn===Un.current?Kn.current:Zn(Bn.getState(),Pn)},[Bn,yn,Pn]);useIsomorphicLayoutEffectWithArgs(captureWrapperProps,[Un,wn,kn,Pn,tr,Kn,Sn]),useIsomorphicLayoutEffectWithArgs(subscribeUpdates,[Xt,Bn,ar,Zn,Un,wn,kn,Kn,Sn,vn],[Bn,ar,Zn]);var or=reactExports.useMemo(function(){return React.createElement(dn,_extends$2({},tr,{ref:Dn}))},[Dn,dn,tr]),Jn=reactExports.useMemo(function(){return Xt?React.createElement(Cn.Provider,{value:Rn},or):or},[Cn,or,Rn]);return Jn}var Tn=hn?React.memo(_n):_n;if(Tn.WrappedComponent=dn,Tn.displayName=_n.displayName=gn,tn){var $n=React.forwardRef(function(Nn,An){return React.createElement(Tn,_extends$2({},Nn,{reactReduxForwardedRef:An}))});return $n.displayName=gn,$n.WrappedComponent=dn,hoistStatics($n,dn)}return hoistStatics(Tn,dn)}}function is$5(_e,Pt){return _e===Pt?_e!==0||Pt!==0||1/_e===1/Pt:_e!==_e&&Pt!==Pt}function shallowEqual(_e,Pt){if(is$5(_e,Pt))return!0;if(typeof _e!="object"||_e===null||typeof Pt!="object"||Pt===null)return!1;var Dt=Object.keys(_e),Nt=Object.keys(Pt);if(Dt.length!==Nt.length)return!1;for(var jt=0;jt=0;Nt--){var jt=Pt[Nt](_e);if(jt)return jt}return function(Ut,Gt){throw new Error("Invalid value of type "+typeof _e+" for "+Dt+" argument when connecting component "+Gt.wrappedComponentName+".")}}function strictEqual(_e,Pt){return _e===Pt}function createConnect(_e){var Pt=_e===void 0?{}:_e,Dt=Pt.connectHOC,Nt=Dt===void 0?connectAdvanced:Dt,jt=Pt.mapStateToPropsFactories,Ut=jt===void 0?defaultMapStateToPropsFactories:jt,Gt=Pt.mapDispatchToPropsFactories,Wt=Gt===void 0?defaultMapDispatchToPropsFactories:Gt,qt=Pt.mergePropsFactories,Yt=qt===void 0?defaultMergePropsFactories:qt,Xt=Pt.selectorFactory,Zt=Xt===void 0?finalPropsSelectorFactory:Xt;return function(en,tn,nn,rn){rn===void 0&&(rn={});var an=rn,sn=an.pure,ln=sn===void 0?!0:sn,dn=an.areStatesEqual,mn=dn===void 0?strictEqual:dn,gn=an.areOwnPropsEqual,un=gn===void 0?shallowEqual:gn,hn=an.areStatePropsEqual,bn=hn===void 0?shallowEqual:hn,En=an.areMergedPropsEqual,_n=En===void 0?shallowEqual:En,Tn=_objectWithoutPropertiesLoose$3(an,_excluded),$n=match(en,Ut,"mapStateToProps"),pn=match(tn,Wt,"mapDispatchToProps"),Nn=match(nn,Yt,"mergeProps");return Nt(Zt,_extends$2({methodName:"connect",getDisplayName:function(Dn){return"Connect("+Dn+")"},shouldHandleStateChanges:!!en,initMapStateToProps:$n,initMapDispatchToProps:pn,initMergeProps:Nn,pure:ln,areStatesEqual:mn,areOwnPropsEqual:un,areStatePropsEqual:bn,areMergedPropsEqual:_n},Tn))}}const connect$1=createConnect();setBatch(reactDomExports.unstable_batchedUpdates);function areInputsEqual$1(_e,Pt){if(_e.length!==Pt.length)return!1;for(var Dt=0;Dt<_e.length;Dt++)if(_e[Dt]!==Pt[Dt])return!1;return!0}function useMemoOne(_e,Pt){var Dt=reactExports.useState(function(){return{inputs:Pt,result:_e()}})[0],Nt=reactExports.useRef(!0),jt=reactExports.useRef(Dt),Ut=Nt.current||!!(Pt&&jt.current.inputs&&areInputsEqual$1(Pt,jt.current.inputs)),Gt=Ut?jt.current:{inputs:Pt,result:_e()};return reactExports.useEffect(function(){Nt.current=!1,jt.current=Gt},[Gt]),Gt.result}function useCallbackOne(_e,Pt){return useMemoOne(function(){return _e},Pt)}var useMemo=useMemoOne,useCallback=useCallbackOne,isProduction=!0,prefix$2="Invariant failed";function invariant$1(_e,Pt){if(!_e){if(isProduction)throw new Error(prefix$2);var Dt=typeof Pt=="function"?Pt():Pt,Nt=Dt?"".concat(prefix$2,": ").concat(Dt):prefix$2;throw new Error(Nt)}}var getRect=function _e(Pt){var Dt=Pt.top,Nt=Pt.right,jt=Pt.bottom,Ut=Pt.left,Gt=Nt-Ut,Wt=jt-Dt,qt={top:Dt,right:Nt,bottom:jt,left:Ut,width:Gt,height:Wt,x:Ut,y:Dt,center:{x:(Nt+Ut)/2,y:(jt+Dt)/2}};return qt},expand=function _e(Pt,Dt){return{top:Pt.top-Dt.top,left:Pt.left-Dt.left,bottom:Pt.bottom+Dt.bottom,right:Pt.right+Dt.right}},shrink=function _e(Pt,Dt){return{top:Pt.top+Dt.top,left:Pt.left+Dt.left,bottom:Pt.bottom-Dt.bottom,right:Pt.right-Dt.right}},shift=function _e(Pt,Dt){return{top:Pt.top+Dt.y,left:Pt.left+Dt.x,bottom:Pt.bottom+Dt.y,right:Pt.right+Dt.x}},noSpacing$1={top:0,right:0,bottom:0,left:0},createBox=function _e(Pt){var Dt=Pt.borderBox,Nt=Pt.margin,jt=Nt===void 0?noSpacing$1:Nt,Ut=Pt.border,Gt=Ut===void 0?noSpacing$1:Ut,Wt=Pt.padding,qt=Wt===void 0?noSpacing$1:Wt,Yt=getRect(expand(Dt,jt)),Xt=getRect(shrink(Dt,Gt)),Zt=getRect(shrink(Xt,qt));return{marginBox:Yt,borderBox:getRect(Dt),paddingBox:Xt,contentBox:Zt,margin:jt,border:Gt,padding:qt}},parse$6=function _e(Pt){var Dt=Pt.slice(0,-2),Nt=Pt.slice(-2);if(Nt!=="px")return 0;var jt=Number(Dt);return isNaN(jt)&&invariant$1(!1),jt},getWindowScroll$1=function _e(){return{x:window.pageXOffset,y:window.pageYOffset}},offset=function _e(Pt,Dt){var Nt=Pt.borderBox,jt=Pt.border,Ut=Pt.margin,Gt=Pt.padding,Wt=shift(Nt,Dt);return createBox({borderBox:Wt,border:jt,margin:Ut,padding:Gt})},withScroll=function _e(Pt,Dt){return Dt===void 0&&(Dt=getWindowScroll$1()),offset(Pt,Dt)},calculateBox=function _e(Pt,Dt){var Nt={top:parse$6(Dt.marginTop),right:parse$6(Dt.marginRight),bottom:parse$6(Dt.marginBottom),left:parse$6(Dt.marginLeft)},jt={top:parse$6(Dt.paddingTop),right:parse$6(Dt.paddingRight),bottom:parse$6(Dt.paddingBottom),left:parse$6(Dt.paddingLeft)},Ut={top:parse$6(Dt.borderTopWidth),right:parse$6(Dt.borderRightWidth),bottom:parse$6(Dt.borderBottomWidth),left:parse$6(Dt.borderLeftWidth)};return createBox({borderBox:Pt,margin:Nt,padding:jt,border:Ut})},getBox=function _e(Pt){var Dt=Pt.getBoundingClientRect(),Nt=window.getComputedStyle(Pt);return calculateBox(Dt,Nt)},safeIsNaN=Number.isNaN||function _e(Pt){return typeof Pt=="number"&&Pt!==Pt};function isEqual$2(_e,Pt){return!!(_e===Pt||safeIsNaN(_e)&&safeIsNaN(Pt))}function areInputsEqual(_e,Pt){if(_e.length!==Pt.length)return!1;for(var Dt=0;Dt<_e.length;Dt++)if(!isEqual$2(_e[Dt],Pt[Dt]))return!1;return!0}function memoizeOne(_e,Pt){Pt===void 0&&(Pt=areInputsEqual);var Dt,Nt=[],jt,Ut=!1;function Gt(){for(var Wt=[],qt=0;qt");return Nt.callbacks},Nt.setCallbacks=function(Wt){Nt.callbacks=Wt},Nt}var Dt=Pt.prototype;return Dt.componentDidMount=function(){this.unbind=bindEvents(window,[{eventName:"error",fn:this.onWindowError}])},Dt.componentDidCatch=function(jt){if(jt instanceof RbdInvariant){this.setState({});return}throw jt},Dt.componentWillUnmount=function(){this.unbind()},Dt.render=function(){return this.props.children(this.setCallbacks)},Pt}(React.Component),dragHandleUsageInstructions=` +`+Wt+"}":"{ "+qt.join(", ")+" }":"{"+qt.join(",")+"}",gap=Wt,Ut}}function beautify(_e,Pt,Dt,Nt){var jt;if(gap="",indent="",Nt||(Nt=0),typeof Nt!="number")throw new Error("beaufifier: limit must be a number");if(typeof Dt=="number")for(jt=0;jt+jt);return Math.abs(Nt)>4?jsxRuntimeExports.jsxs("span",{children:[Dt,"x10",jsxRuntimeExports.jsx("sup",{style:supProps,children:Nt})]}):lodashExports$1.round(_e,2)}else return _e;case"string":return`${_e}`;case"undefined":return"null";default:return Pt?jsxRuntimeExports.jsx("code",{children:lodashExports$1.isNull(_e)?"null":lodashExports$1.get(_e,"constructor.name")??typeof _e}):jsxRuntimeExports.jsx("code",{style:{whiteSpace:"pre"},children:lodashExports$1.truncate(beautify$1(_e,void 0,2),{length:100})})}}function Property({label:_e,value:Pt,type:Dt,simple:Nt}){return jsxRuntimeExports.jsxs(Flex,{width:"auto",mr:2,mb:.5,alignItems:"baseline",children:[jsxRuntimeExports.jsx(Type$1,{component:"div",variant:"body2",...Dt,sx:{opacity:.54,...Dt==null?void 0:Dt.sx},children:_e}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(Type$1,{component:"div",variant:"body2",...Dt,children:renderProperty(Pt,Nt)??"none"})]},`${_e}::${renderProperty(Pt)}`)}const OMIT_PROPS=["type","id"],ESSENTIAL_PROPS=["f","g","pId"],ALL_PROPS=[...OMIT_PROPS,...ESSENTIAL_PROPS],sortEventKeys=_e=>lodashExports$1.chain(_e).entries().filter(([,Pt])=>!lodashExports$1.isUndefined(Pt)).sortBy(([Pt])=>lodashExports$1.indexOf(ALL_PROPS,Pt)+1||Number.MAX_SAFE_INTEGER).value();function PropertyDialog({event:_e,max:Pt=10,simple:Dt,variant:Nt,...jt}){const Ut=sortEventKeys(_e);return jsxRuntimeExports.jsx(ManagedModal,{...lodashExports$1.merge({appBar:{children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Event Properties"})},trigger:Gt=>jsxRuntimeExports.jsxs(Button$2,{variant:"text",sx:{mx:-1,minWidth:0,width:"fit-content",color:Wt=>Wt.palette.text.secondary,justifyContent:"left"},onClick:Wt=>{Wt.stopPropagation(),Wt.preventDefault(),Gt(Wt)},children:[Ut.length-Pt," more"]})},jt),children:[{name:"common",props:lodashExports$1.filter(Ut,([Gt])=>OMIT_PROPS.includes(Gt))},{name:"search",props:lodashExports$1.filter(Ut,([Gt])=>ESSENTIAL_PROPS.includes(Gt))},{name:"other",props:lodashExports$1.filter(Ut,([Gt])=>!ALL_PROPS.includes(Gt))}].map(({name:Gt,props:Wt},qt)=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!qt&&jsxRuntimeExports.jsx(Divider$1,{sx:{mb:1}}),jsxRuntimeExports.jsx(Type$1,{variant:"overline",color:"text.secondary",component:"div",sx:{px:3},children:lodashExports$1.startCase(Gt)}),jsxRuntimeExports.jsx(Box$1,{sx:{p:1,pt:0,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(2, 1fr)"},children:lodashExports$1.map(Wt,([Yt,Xt])=>jsxRuntimeExports.jsx(ListItem$1,{sx:{py:.5},children:jsxRuntimeExports.jsx(ListItemText$1,{secondary:Yt,primary:renderProperty(Xt)})},`${Yt}::${Xt}`))},Gt)]}))})}function PropertyList(_e){const{event:Pt,variant:Dt="body2",max:Nt=10,simple:jt,...Ut}=_e,Gt=sortEventKeys(Pt);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Flex,{...Ut,children:[lodashExports$1.map(lodashExports$1.slice(Gt,0,Nt),([Wt,qt],Yt)=>jsxRuntimeExports.jsx(Property,{label:Wt,value:qt,type:{variant:Dt},simple:jt},Yt)),Gt.length>Nt&&!jt&&jsxRuntimeExports.jsx(PropertyDialog,{..._e})]})})}function TracePreview({trace:_e,language:Pt="json"}){return jsxRuntimeExports.jsx(Box$1,{sx:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx(ScriptViewer,{options:{readOnly:!0},language:Pt,value:_e?beautify$1({..._e,events:lodashExports$1.take(_e.events,10)},null,2,1):"No data"})})}var dist$4={exports:{}};(function(_e,Pt){(function(Dt,Nt){_e.exports=Nt()})(commonjsGlobal,function(){return function(Dt){function Nt(Ut){if(jt[Ut])return jt[Ut].exports;var Gt=jt[Ut]={i:Ut,l:!1,exports:{}};return Dt[Ut].call(Gt.exports,Gt,Gt.exports,Nt),Gt.l=!0,Gt.exports}var jt={};return Nt.m=Dt,Nt.c=jt,Nt.d=function(Ut,Gt,Wt){Nt.o(Ut,Gt)||Object.defineProperty(Ut,Gt,{configurable:!1,enumerable:!0,get:Wt})},Nt.n=function(Ut){var Gt=Ut&&Ut.__esModule?function(){return Ut.default}:function(){return Ut};return Nt.d(Gt,"a",Gt),Gt},Nt.o=function(Ut,Gt){return Object.prototype.hasOwnProperty.call(Ut,Gt)},Nt.p="",Nt(Nt.s=1)}([function(Dt,Nt,jt){function Ut(Wt){var qt=Wt===void 0?{}:Wt,Yt=qt.ESCAPE,Xt=Yt===void 0?/^\\/:Yt,Zt=qt.VARIABLE_START,Qt=Zt===void 0?/^\${\s*/:Zt,en=qt.VARIABLE_END,tn=en===void 0?/^\s*}/:en,nn=qt.PIPE_START,rn=nn===void 0?/^\s*\|\s*/:nn,an=qt.PIPE_PARAMETER_START,sn=an===void 0?/^\s*:\s*/:an,ln=qt.QUOTED_STRING,dn=ln===void 0?Nt.DEFAULT_QUOTED_STRING_REGEX:ln,mn=qt.QUOTED_STRING_TEST,gn=mn===void 0?null:mn,un=qt.QUOTED_STRING_GET_AND_ADVANCE,hn=un===void 0?null:un,bn=qt.QUOTED_STRING_IN_PARAMETER_TEST,En=bn===void 0?null:bn,_n=qt.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,Tn=_n===void 0?null:_n,$n=gn||function(Dn){return dn.test(Dn)},pn=hn||Gt(dn),Nn=En||function(Dn){return dn.test(Dn)},An=Tn||Gt(dn);return function(Dn){function Pn(Er){Er===void 0&&(Er=1),yn=yn.substr(Er)}function Cn(Er){Er===void 0&&(Er=/^/),Pn(yn.match(Er)[0].length)}function Gn(){var Er;return Cn(Xt),Er=yn.length>0?yn[0]:"",Pn(),Er}function In(Er){var Sr=(Er===void 0?{}:Er).isNull,Rr=Sr!==void 0&&Sr;Kn={name:"",pipes:[]},or=!Rr}function Bn(){vn.variables.push(Kn),In({isNull:!0})}function Zn(Er){var Sr=(Er===void 0?{}:Er).isNull,Rr=Sr!==void 0&&Sr;kn={name:"",parameters:[]},Jn=!Rr}function nr(){Kn.pipes.push(kn),Zn({isNull:!0})}function ar(Er){var Sr=(Er===void 0?{}:Er).isNull,Rr=Sr!==void 0&&Sr;tr="",gr=!Rr}function Sn(){kn.parameters.push(tr),ar({isNull:!0})}function Rn(){return!!tn.test(yn)&&(Cn(tn),wn>=3&&Sn(),wn>=2&&nr(),wn>=1&&Bn(),wn=0,!0)}function On(){return!!rn.test(yn)&&(Cn(rn),wn>=3&&Sn(),wn>=2&&nr(),wn>=1&&Zn(),wn=2,!0)}function Vn(){return!!sn.test(yn)&&(Cn(sn),wn>=3&&Sn(),wn>=2&&ar(),wn=3,!0)}for(var yn=Dn,vn={literals:[],variables:[]},wn=0,Un="",Kn={name:"",pipes:[]},kn={name:"",parameters:[]},tr="",or=!1,Jn=!1,gr=!1;yn&&yn.length>0;)switch(wn){case 0:if(Xt.test(yn)){Un+=Gn();continue}if(Qt.test(yn)){wn=1,In(),vn.literals.push(Un),Un="",Cn(Qt);continue}Un+=yn[0],Pn();break;case 1:if(Xt.test(yn)){Kn.name+=Gn();continue}if(Rn()||On())continue;if($n(yn)){Kn.name+=pn(yn,Pn);continue}Kn.name+=yn[0],Pn();break;case 2:if(Xt.test(yn)){kn.name+=Gn();continue}if(Rn()||Vn()||On())continue;if($n(yn)){kn.name+=pn(yn,Pn);continue}kn.name+=yn[0],Pn();break;case 3:if(Xt.test(yn)){tr+=Gn();continue}if(Rn()||Vn()||On())continue;if(Nn(yn)){tr+=An(yn,Pn);continue}tr+=yn[0],Pn()}return gr&&kn.parameters.push(tr),Jn&&Kn.pipes.push(kn),or&&vn.variables.push(Kn),vn.literals.push(Un),vn}}function Gt(Wt){return function(qt,Yt){var Xt=qt.match(Wt);return Yt(Xt[0].length),Xt.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,Nt.parseStringTemplateGenerator=Ut,Nt.parseStringTemplate=Ut(),Nt.getQuotedStringAndAdvanceForRegex=Gt},function(Dt,Nt,jt){Dt.exports=jt(2)},function(Dt,Nt,jt){function Ut(Gt){for(var Wt in Gt)Nt.hasOwnProperty(Wt)||(Nt[Wt]=Gt[Wt])}Object.defineProperty(Nt,"__esModule",{value:!0}),Ut(jt(0)),Ut(jt(3))},function(Dt,Nt,jt){function Ut(Xt){return function(Zt){return Xt.hasOwnProperty(Zt)?Xt[Zt]:Zt.split(".").reduce(function(Qt,en){return Qt.hasOwnProperty(en)?Qt[en]:""},Xt)}}function Gt(Xt,Zt,Qt,en){en===void 0&&(en=Ut(Zt));var tn=en(Xt.name);return Xt.pipes.reduce(function(nn,rn){return Qt.hasOwnProperty(rn.name)?Qt[rn.name](nn,rn.parameters):nn},tn??"")}function Wt(Xt,Zt,Qt,en){return en===void 0&&(en=Ut(Zt)),Xt.literals.length===0?"":Xt.literals.slice(1).reduce(function(tn,nn,rn){return""+tn+Gt(Xt.variables[rn],Zt,Qt,en)+nn},Xt.literals[0])}function qt(Xt,Zt,Qt){return Wt(Yt.parseStringTemplate(Xt),Zt,Qt)}Object.defineProperty(Nt,"__esModule",{value:!0});var Yt=jt(0);Nt.evaluateParsedString=Wt,Nt.evaluateStringTemplate=qt}])})})(dist$4);var distExports=dist$4.exports;function mapProperties(_e={},Pt){const Dt={};for(const Nt of Object.keys(_e))Dt[Nt]=Nt==="$"?_e[Nt]:Pt(_e[Nt],Nt,_e);return Object.setPrototypeOf(Dt,_e)}function parseProperty(_e){switch(_e==null?void 0:_e.constructor){case Array:{const Pt=lodashExports$1.map(_e,parseProperty);return Dt=>lodashExports$1.map(Pt,Nt=>Nt(Dt))}case Object:{const Pt=lodashExports$1.mapValues(_e,parseProperty);return Dt=>lodashExports$1.mapValues(Pt,Nt=>Nt(Dt))}case String:return parseString(_e);default:return()=>_e}}function normalize(_e={}){return mapProperties(_e,Pt=>lodashExports$1.isFunction(Pt)?Pt:parseProperty(Pt))}const parseToken=_e=>{const Pt=Function("$",`return ${_e};`);return Dt=>Pt(new Proxy(normalize(Dt),{get(Nt,jt){return typeof(Nt==null?void 0:Nt[jt])=="function"?Nt[jt]({}):Nt==null?void 0:Nt[jt]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$1=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memo(_e=>{const Pt=parser$1(_e);return lodashExports$1.join(Pt.literals,"")?Dt=>distExports.evaluateParsedString(Pt,{},{},Nt=>parseToken(Nt)(Dt)):parseToken(Pt.variables[0].name)},{primitive:!0});function commonjsRequire(_e){throw new Error('Could not dynamically require "'+_e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(_e,Pt){(function(Dt,Nt){typeof commonjsRequire=="function"?_e.exports=Nt():Dt.pluralize=Nt()})(commonjsGlobal,function(){var Dt=[],Nt=[],jt={},Ut={},Gt={};function Wt(nn){return typeof nn=="string"?new RegExp("^"+nn+"$","i"):nn}function qt(nn,rn){return nn===rn?rn:nn===nn.toLowerCase()?rn.toLowerCase():nn===nn.toUpperCase()?rn.toUpperCase():nn[0]===nn[0].toUpperCase()?rn.charAt(0).toUpperCase()+rn.substr(1).toLowerCase():rn.toLowerCase()}function Yt(nn,rn){return nn.replace(/\$(\d{1,2})/g,function(an,sn){return rn[sn]||""})}function Xt(nn,rn){return nn.replace(rn[0],function(an,sn){var ln=Yt(rn[1],arguments);return qt(an===""?nn[sn-1]:an,ln)})}function Zt(nn,rn,an){if(!nn.length||jt.hasOwnProperty(nn))return rn;for(var sn=an.length;sn--;){var ln=an[sn];if(ln[0].test(rn))return Xt(rn,ln)}return rn}function Qt(nn,rn,an){return function(sn){var ln=sn.toLowerCase();return rn.hasOwnProperty(ln)?qt(sn,ln):nn.hasOwnProperty(ln)?qt(sn,nn[ln]):Zt(ln,sn,an)}}function en(nn,rn,an,sn){return function(ln){var dn=ln.toLowerCase();return rn.hasOwnProperty(dn)?!0:nn.hasOwnProperty(dn)?!1:Zt(dn,dn,an)===dn}}function tn(nn,rn,an){var sn=rn===1?tn.singular(nn):tn.plural(nn);return(an?rn+" ":"")+sn}return tn.plural=Qt(Gt,Ut,Dt),tn.isPlural=en(Gt,Ut,Dt),tn.singular=Qt(Ut,Gt,Nt),tn.isSingular=en(Ut,Gt,Nt),tn.addPluralRule=function(nn,rn){Dt.push([Wt(nn),rn])},tn.addSingularRule=function(nn,rn){Nt.push([Wt(nn),rn])},tn.addUncountableRule=function(nn){if(typeof nn=="string"){jt[nn.toLowerCase()]=!0;return}tn.addPluralRule(nn,"$0"),tn.addSingularRule(nn,"$0")},tn.addIrregularRule=function(nn,rn){rn=rn.toLowerCase(),nn=nn.toLowerCase(),Gt[nn]=rn,Ut[rn]=nn},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(nn){return tn.addIrregularRule(nn[0],nn[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(nn){return tn.addPluralRule(nn[0],nn[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(nn){return tn.addSingularRule(nn[0],nn[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(tn.addUncountableRule),tn})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs(pluralizeExports),parseTraceWorkerUrl=""+new URL("parseTrace.worker-0ac9de5d.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker);function useTraceParser(_e){const Pt=useSnackbar(),Dt=useLoadingState("specimen");return reactExports.useCallback(()=>Dt(async()=>{var Nt;if(_e!=null&&_e.trace){Pt("Processing trace...");try{const jt=await parseTraceAsync(_e);return Pt("Trace loaded",pluralize("step",((Nt=jt==null?void 0:jt.stepsPersistent)==null?void 0:Nt.length)??0,!0)),{components:jt,content:_e.trace}}catch(jt){return console.error(jt),Pt("Error parsing",lodashExports$1.get(jt,"message")),{error:lodashExports$1.get(jt,"message")}}}}),[_e])}function useTraceContent(_e){const Pt=useSnackbar(),Dt=useLoadingState("specimen"),Nt=useConnectionResolver(),[{traces:jt}]=useFeatures(),Ut=reactExports.useMemo(()=>memo(async({source:Xt,id:Zt})=>{if(Xt&&Zt){const Qt=Nt({url:Xt});if(Qt){Pt("Fetching trace...");const en=await Qt.transport().call("features/trace",{id:Zt});return en==null?void 0:en.content}}},{normalizer:JSON.stringify}),[Nt,Pt]),{content:Gt,source:Wt,id:qt}=_e??{},{lastModified:Yt}=lodashExports$1.find(jt,{id:qt,source:Wt})??{};return useAsync(()=>Dt(async()=>{if(qt)return{..._e,content:Gt||await Ut({source:Wt,id:qt,lastModified:Yt})}}),[Ut,Gt,Wt,qt,Yt])}const isNullish=_e=>_e==null;function makePathIndex(_e){const Pt=[],Dt={},Nt={},jt=lodashExports$1.chain(_e==null?void 0:_e.events).map((Wt,qt)=>({step:qt,id:Wt.id,pId:Wt.pId})).groupBy("id").value();lodashExports$1.forEach(_e==null?void 0:_e.events,({id:Wt,pId:qt},Yt)=>{!isNullish(qt)&&Dt[Wt]!==qt&&(Pt.push({id:Wt,pId:qt,step:Yt,prev:lodashExports$1.last(Pt)}),Dt[Wt]=qt),Nt[Yt]=lodashExports$1.last(Pt)});const Ut=(Wt,qt=(Yt=>(Yt=_e==null?void 0:_e.events)==null?void 0:Yt.length)()??0)=>{let Xt=Nt[qt];for(;Xt;){if(Xt.id===Wt)return Xt.pId;Xt=Xt.prev}};return{getParent:Ut,getPath:Wt=>{const qt=[Wt];let Yt={...(_e.events??[])[Wt],step:Wt};for(;Yt;){const Xt=Ut(Yt.id,Yt.step);if(Xt){const Zt=lodashExports$1.findLast(jt[Xt],Qt=>Qt.step<=Yt.step);if(Zt)qt.push(Zt.step),Yt=Zt;else break}else break}return qt}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),inferName:_e=>{var Pt,Dt;return((Dt=(Pt=_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.name)??"Untitled Trace"},error:_e=>{var Pt,Dt,Nt,jt;return((Dt=(Pt=_e==null?void 0:_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.error)||((jt=(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.parsedTrace)==null?void 0:jt.error)},claimImportedFile:async _e=>isTraceFormat(_e)?{claimed:!0,layer:async Pt=>{Pt("Opening trace...");try{return{trace:{...await readUploadedTrace(_e).read()}}}catch(Dt){return console.error(Dt),Pt(`Error opening, ${lodashExports$1.get(Dt,"message")}`),{trace:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(Dt,"message"),name:lodashExports$1.startCase(name$2(_e.name))}}}}}:{claimed:!1},editor:withProduce(({value:_e,produce:Pt})=>{var Dt,Nt,jt,Ut,Gt,Wt,qt,Yt,Xt,Zt,Qt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:en=>Pt(tn=>lodashExports$1.set(tn,"source.trace",en)),value:(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.trace})}),((jt=(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.trace)==null?void 0:jt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:en=>en.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Gt=(Ut=_e==null?void 0:_e.source)==null?void 0:Ut.trace)==null?void 0:Gt.error})}),((qt=(Wt=_e==null?void 0:_e.source)==null?void 0:Wt.parsedTrace)==null?void 0:qt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:en=>en.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Xt=(Yt=_e==null?void 0:_e.source)==null?void 0:Yt.parsedTrace)==null?void 0:Xt.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Qt=(Zt=_e==null?void 0:_e.source)==null?void 0:Zt.parsedTrace)==null?void 0:Qt.content})})]})}),service:withProduce(({value:_e,produce:Pt})=>{var Ut,Gt,Wt;const{palette:Dt}=useTheme(),{result:Nt}=useTraceContent((Ut=_e==null?void 0:_e.source)==null?void 0:Ut.trace),jt=useTraceParser({trace:Nt==null?void 0:Nt.content,context:{color:colorsHex,themeAccent:Dt.primary.main,themeTextPrimary:Dt.text.primary,themeBackground:Dt.background.paper},view:"main"});return reactExports.useEffect(()=>{Pt(qt=>{var Yt,Xt;return lodashExports$1.set(qt,"source.playbackTo",((Xt=(Yt=Nt==null?void 0:Nt.content)==null?void 0:Yt.events)==null?void 0:Xt.length)??0)})},[(Wt=(Gt=Nt==null?void 0:Nt.content)==null?void 0:Gt.events)==null?void 0:Wt.length]),useEffectWhen(async()=>{const qt=await jt();Pt(Yt=>{lodashExports$1.set(Yt,"source.parsedTrace",qt),lodashExports$1.set(Yt,"viewKey",nanoid$1())})},[jt],[Nt==null?void 0:Nt.key,Dt.mode]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:_e})})}),renderer:({layer:_e,index:Pt})=>{var qt,Yt,Xt;const Dt=(Yt=(qt=_e==null?void 0:_e.source)==null?void 0:qt.parsedTrace)==null?void 0:Yt.components,Nt=useThrottle$1(((Xt=_e==null?void 0:_e.source)==null?void 0:Xt.step)??0,1e3/60),jt=use2DPath(_e,Pt,Nt),Ut=reactExports.useMemo(()=>lodashExports$1.map(Dt==null?void 0:Dt.stepsPersistent,Zt=>lodashExports$1.map(Zt,Qt=>lodashExports$1.merge(Qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:Pt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Dt==null?void 0:Dt.stepsPersistent,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,Pt]),Gt=reactExports.useMemo(()=>lodashExports$1.map(Dt==null?void 0:Dt.stepsTransient,Zt=>lodashExports$1.map(Zt,Qt=>lodashExports$1.merge(Qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:Pt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Dt==null?void 0:Dt.stepsTransient,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,Pt]),Wt=reactExports.useMemo(()=>[Gt[Nt]??[]],[Gt,Nt]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{step:Nt,nodes:Ut}),jsxRuntimeExports.jsx(NodeList,{nodes:Wt}),jt]})},steps:_e=>{var Pt,Dt,Nt;return((Nt=(Dt=(Pt=_e==null?void 0:_e.source)==null?void 0:Pt.parsedTrace)==null?void 0:Dt.content)==null?void 0:Nt.events)??[]},provideSelectionInfo:({layer:_e,event:Pt,children:Dt})=>{const{layer:Nt,setLayer:jt}=useLayer(_e),Ut=reactExports.useMemo(()=>{var Yt,Xt,Zt,Qt,en;const Gt=((Zt=(Xt=(Yt=Nt==null?void 0:Nt.source)==null?void 0:Yt.parsedTrace)==null?void 0:Xt.content)==null?void 0:Zt.events)??[],Wt=lodashExports$1.chain((Qt=Pt==null?void 0:Pt.info)==null?void 0:Qt.components).filter(tn=>{var nn;return((nn=tn.meta)==null?void 0:nn.sourceLayer)===(Nt==null?void 0:Nt.key)}).map(tn=>{var nn;return(nn=tn.meta)==null?void 0:nn.step}).filter(lodashExports$1.negate(lodashExports$1.isUndefined)).sort((tn,nn)=>tn-nn).value(),qt=lodashExports$1.chain((en=Pt==null?void 0:Pt.info)==null?void 0:en.components).filter(tn=>{var nn;return((nn=tn.meta)==null?void 0:nn.sourceLayer)===(Nt==null?void 0:Nt.key)}).filter(tn=>{var nn;return(nn=tn.meta)==null?void 0:nn.info}).value();if(Wt.length&&Nt){const tn=lodashExports$1.last(Wt),nn=Gt[tn];if(nn)return{...lodashExports$1.keyBy(lodashExports$1.map(qt,(rn,an)=>({key:`${Nt.key}.${an}`,primary:`Selection in ${inferLayerName(Nt)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:rn.meta.info,vertical:!0})}}})),"key"),[Nt.key]:{primary:inferLayerName(Nt),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:nn,vertical:!0})},[`${nn}`]:{primary:`Go to Step ${tn}`,secondary:`${lodashExports$1.startCase(nn.type)}`,action:()=>jt(produce(Nt,rn=>{lodashExports$1.set(rn,"source.step",tn)})),icon:jsxRuntimeExports.jsx(ArrowOutwardRounded,{})}}}}}return{}},[Nt,Pt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Dt==null?void 0:Dt(Ut)})}};function use2DPath(_e,Pt=0,Dt=0){var Gt,Wt,qt;const{palette:Nt}=useTheme(),{getPath:jt}=reactExports.useMemo(()=>{var Yt,Xt,Zt;return((Yt=_e==null?void 0:_e.source)==null?void 0:Yt.playback)!=="playing"&&((Zt=(Xt=_e==null?void 0:_e.source)==null?void 0:Xt.parsedTrace)!=null&&Zt.content)?makePathIndex(_e.source.parsedTrace.content):{getParent:lodashExports$1.constant(void 0),getPath:lodashExports$1.constant([])}},[(Wt=(Gt=_e==null?void 0:_e.source)==null?void 0:Gt.parsedTrace)==null?void 0:Wt.content,(qt=_e==null?void 0:_e.source)==null?void 0:qt.playback]);return reactExports.useMemo(()=>{var Yt,Xt,Zt,Qt;if((Qt=(Zt=(Xt=(Yt=_e==null?void 0:_e.source)==null?void 0:Yt.parsedTrace)==null?void 0:Xt.content)==null?void 0:Zt.render)!=null&&Qt.path){const{pivot:en={},scale:tn=1}=_e.source.parsedTrace.content.render.path,{x:nn,y:rn}=en,an=nn?parseString(nn):dn=>dn.event.x,sn=rn?parseString(rn):dn=>dn.event.y,ln=lodashExports$1.map(jt(Dt),dn=>{var mn,gn,un,hn;return(hn=(un=(gn=(mn=_e==null?void 0:_e.source)==null?void 0:mn.parsedTrace)==null?void 0:gn.content)==null?void 0:un.events)==null?void 0:hn[dn]});if(ln.length){const dn=[{$:"rect",x:an({event:{x:0,y:0,...lodashExports$1.head(ln)}})-2*tn/2,y:sn({event:{x:0,y:0,...lodashExports$1.head(ln)}})-2*tn/2,fill:getColorHex("destination"),width:2*tn,height:2*tn},{$:"rect",x:an({event:{x:0,y:0,...lodashExports$1.last(ln)}})-2*tn/2,y:sn({event:{x:0,y:0,...lodashExports$1.last(ln)}})-2*tn/2,fill:getColorHex("source"),width:2*tn,height:2*tn},{$:"path",points:ln.map(mn=>({x:an({event:{x:0,y:0,...mn}}),y:sn({event:{x:0,y:0,...mn}})})),fill:Nt.primary.main,alpha:1,lineWidth:1*tn}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports$1.map(dn,mn=>({component:mn,meta:{source:"path",sourceLayerIndex:-99999+Pt}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[_e,Pt,Dt,Nt,jt])}async function findConnection(_e,Pt,Dt){for(const Nt of _e){const jt=await Nt.transport().call("features/algorithms"),Ut=await Nt.transport().call("features/formats");if(lodashExports$1.find(jt,{id:Pt})&&lodashExports$1.find(Ut,{id:Dt}))return Nt}}const controller={...lodashExports$1.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),editor:withProduce(({value:_e,produce:Pt})=>{var Yt,Xt;const{algorithm:Dt}=(_e==null?void 0:_e.source)??{},{layers:Nt,allLayers:jt,layer:Ut,key:Gt}=useLayer(void 0,Zt=>{var Qt;return((Qt=Zt.source)==null?void 0:Qt.type)==="map"}),[{algorithms:Wt}]=useFeatures(),[qt]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(CodeOutlined,{}),label:"Algorithm",value:Dt,items:Wt.map(Zt=>{var Qt;return{...Zt,description:(Qt=lodashExports$1.find(qt,{url:Zt.source}))==null?void 0:Qt.name}}),onChange:async Zt=>Pt(Qt=>lodashExports$1.set(Qt,"source.algorithm",Zt))})}),!(Wt!=null&&Wt.length)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:Gt,items:jt.map(Zt=>({id:Zt.key,hidden:!lodashExports$1.find(Nt,Qt=>Qt.key===Zt.key),name:inferLayerName(Zt)})),onChange:async Zt=>Pt(Qt=>lodashExports$1.set(Qt,"source.mapLayerKey",Zt))})}),Ut&&jsxRuntimeExports.jsxs(Type$1,{variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(Ut)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Xt=(Yt=_e==null?void 0:_e.source)==null?void 0:Yt.trace)==null?void 0:Xt.content})})]})}),service:withProduce(({value:_e,produce:Pt,onChange:Dt})=>{const Nt=controller$1.service,jt=useSnackbar(),{algorithm:Ut,mapLayerKey:Gt,start:Wt,end:qt}=(_e==null?void 0:_e.source)??{},[{layers:Yt}]=useLayers(),[Xt]=useConnections(),[{algorithms:Zt}]=useFeatures(),Qt=reactExports.useMemo(()=>{if(Gt&&Ut)return lodashExports$1.find(Yt,{key:Gt})},[Gt,Ut,Yt]);return useEffectWhenAsync(async en=>{var tn;if(Qt&&Ut){const{format:nn,content:rn}=((tn=Qt==null?void 0:Qt.source)==null?void 0:tn.map)??{};if(nn&&rn){const an=await findConnection(Xt,Ut,nn),sn=lodashExports$1.find(Zt,{id:Ut});if(an){jt(`Executing ${inferLayerName(_e)} using ${an.name}...`);const ln=await an.transport().call("solve/pathfinding",{format:nn,instances:[{start:Wt??0,end:qt??0}],mapURI:`map:${encodeURIComponent(rn)}`,algorithm:Ut});en.aborted?jt("Canceled"):Pt(dn=>lodashExports$1.set(dn,"source.trace",{name:`${sn==null?void 0:sn.name}`,content:ln,key:nanoid$1(),id:nanoid$1()}))}}}},[Qt,Xt,Ut,Wt,qt,Pt,jt,_e,Zt],[Qt,Xt,Ut,Wt,qt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Nt,{value:_e,onChange:Dt})})}),inferName:_e=>{var Pt,Dt;return((Dt=(Pt=_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.name)??"Untitled Query"},provideSelectionInfo:({children:_e,event:Pt,layer:Dt})=>{const Nt=controller$1.provideSelectionInfo,{layer:jt,setLayer:Ut,layers:Gt}=useLayer(Dt),Wt=reactExports.useMemo(()=>{const Yt=lodashExports$1.filter(Gt,{source:{type:"map"}});return lodashExports$1.filter(lodashExports$1.map(Yt,Xt=>{var Qt,en,tn,nn;const{parsedMap:Zt}=(Xt==null?void 0:Xt.source)??{};if(Zt&&Pt){const rn=(nn=(tn=getParser((en=(Qt=Xt==null?void 0:Xt.source)==null?void 0:Qt.map)==null?void 0:en.format))==null?void 0:tn.hydrate)==null?void 0:nn.call(tn,Zt);if(rn){const an=(Pt==null?void 0:Pt.world)&&rn.snap(Pt.world);if(an){const sn=(Pt==null?void 0:Pt.world)&&rn.nodeAt(an);return{point:an,node:sn,key:Xt.key,name:inferLayerName(Xt)}}}}}))},[Gt]),qt=reactExports.useMemo(()=>!!jt&&!!Wt.length&&{[jt.key]:{primary:inferLayerName(jt),items:{...lodashExports$1.reduce(Wt,(Yt,Xt)=>({...Yt,[`${Dt}-${Xt==null?void 0:Xt.key}-source`]:{primary:"Set as source",secondary:Xt==null?void 0:Xt.name,action:()=>Ut(produce(jt,Zt=>{lodashExports$1.set(Zt,"source.start",Xt==null?void 0:Xt.node),lodashExports$1.set(Zt,"source.query",void 0),lodashExports$1.set(Zt,"source.mapLayerKey",Xt==null?void 0:Xt.key),lodashExports$1.set(Zt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(StartIcon,{sx:{transform:"scale(0.5)"}})},[`${Dt}-${Xt==null?void 0:Xt.key}-destination`]:{primary:"Set as destination",secondary:Xt==null?void 0:Xt.name,action:()=>Ut(produce(jt,Zt=>{lodashExports$1.set(Zt,"source.end",Xt==null?void 0:Xt.node),lodashExports$1.set(Zt,"source.query",void 0),lodashExports$1.set(Zt,"source.mapLayerKey",Xt==null?void 0:Xt.key),lodashExports$1.set(Zt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(DestinationIcon,{})}}),{})}}},[Wt,jt,Gt,Ut]);return jsxRuntimeExports.jsx(Nt,{event:Pt,layer:Dt,children:Yt=>_e==null?void 0:_e(lodashExports$1.merge(Yt,qt))})}};function getLayerHandler(_e){var Pt;return layerHandlers[((Pt=_e==null?void 0:_e.source)==null?void 0:Pt.type)??""]}const layerHandlers={trace:controller$1,map:controller$2,query:controller};function inferLayerName(_e){var Pt,Dt;return _e!=null&&_e.name?_e==null?void 0:_e.name:(Pt=_e==null?void 0:_e.source)!=null&&Pt.type?layerHandlers[(Dt=_e.source)==null?void 0:Dt.type].inferName(_e):"Untitled Layer"}var ReactReduxContext=React.createContext(null);function defaultNoopBatch(_e){_e()}var batch=defaultNoopBatch,setBatch=function _e(Pt){return batch=Pt},getBatch=function _e(){return batch};function createListenerCollection(){var _e=getBatch(),Pt=null,Dt=null;return{clear:function(){Pt=null,Dt=null},notify:function(){_e(function(){for(var jt=Pt;jt;)jt.callback(),jt=jt.next})},get:function(){for(var jt=[],Ut=Pt;Ut;)jt.push(Ut),Ut=Ut.next;return jt},subscribe:function(jt){var Ut=!0,Gt=Dt={callback:jt,next:null,prev:Dt};return Gt.prev?Gt.prev.next=Gt:Pt=Gt,function(){!Ut||Pt===null||(Ut=!1,Gt.next?Gt.next.prev=Gt.prev:Dt=Gt.prev,Gt.prev?Gt.prev.next=Gt.next:Pt=Gt.next)}}}}var nullListeners={notify:function _e(){},get:function _e(){return[]}};function createSubscription(_e,Pt){var Dt,Nt=nullListeners;function jt(Zt){return qt(),Nt.subscribe(Zt)}function Ut(){Nt.notify()}function Gt(){Xt.onStateChange&&Xt.onStateChange()}function Wt(){return!!Dt}function qt(){Dt||(Dt=Pt?Pt.addNestedSub(Gt):_e.subscribe(Gt),Nt=createListenerCollection())}function Yt(){Dt&&(Dt(),Dt=void 0,Nt.clear(),Nt=nullListeners)}var Xt={addNestedSub:jt,notifyNestedSubs:Ut,handleChangeWrapper:Gt,isSubscribed:Wt,trySubscribe:qt,tryUnsubscribe:Yt,getListeners:function(){return Nt}};return Xt}var useIsomorphicLayoutEffect$4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function Provider(_e){var Pt=_e.store,Dt=_e.context,Nt=_e.children,jt=reactExports.useMemo(function(){var Wt=createSubscription(Pt);return{store:Pt,subscription:Wt}},[Pt]),Ut=reactExports.useMemo(function(){return Pt.getState()},[Pt]);useIsomorphicLayoutEffect$4(function(){var Wt=jt.subscription;return Wt.onStateChange=Wt.notifyNestedSubs,Wt.trySubscribe(),Ut!==Pt.getState()&&Wt.notifyNestedSubs(),function(){Wt.tryUnsubscribe(),Wt.onStateChange=null}},[jt,Ut]);var Gt=Dt||ReactReduxContext;return React.createElement(Gt.Provider,{value:jt},Nt)}var _excluded$2=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],_excluded2=["reactReduxForwardedRef"],EMPTY_ARRAY=[],NO_SUBSCRIPTION_ARRAY=[null,null];function storeStateUpdatesReducer(_e,Pt){var Dt=_e[1];return[Pt.payload,Dt+1]}function useIsomorphicLayoutEffectWithArgs(_e,Pt,Dt){useIsomorphicLayoutEffect$4(function(){return _e.apply(void 0,Pt)},Dt)}function captureWrapperProps(_e,Pt,Dt,Nt,jt,Ut,Gt){_e.current=Nt,Pt.current=jt,Dt.current=!1,Ut.current&&(Ut.current=null,Gt())}function subscribeUpdates(_e,Pt,Dt,Nt,jt,Ut,Gt,Wt,qt,Yt){if(_e){var Xt=!1,Zt=null,Qt=function(){if(!Xt){var nn=Pt.getState(),rn,an;try{rn=Nt(nn,jt.current)}catch(sn){an=sn,Zt=sn}an||(Zt=null),rn===Ut.current?Gt.current||qt():(Ut.current=rn,Wt.current=rn,Gt.current=!0,Yt({type:"STORE_UPDATED",payload:{error:an}}))}};Dt.onStateChange=Qt,Dt.trySubscribe(),Qt();var en=function(){if(Xt=!0,Dt.tryUnsubscribe(),Dt.onStateChange=null,Zt)throw Zt};return en}}var initStateUpdates=function _e(){return[null,0]};function connectAdvanced(_e,Pt){Pt===void 0&&(Pt={});var Dt=Pt,Nt=Dt.getDisplayName,jt=Nt===void 0?function(ln){return"ConnectAdvanced("+ln+")"}:Nt,Ut=Dt.methodName,Gt=Ut===void 0?"connectAdvanced":Ut,Wt=Dt.renderCountProp,qt=Wt===void 0?void 0:Wt,Yt=Dt.shouldHandleStateChanges,Xt=Yt===void 0?!0:Yt,Zt=Dt.storeKey,Qt=Zt===void 0?"store":Zt;Dt.withRef;var en=Dt.forwardRef,tn=en===void 0?!1:en,nn=Dt.context,rn=nn===void 0?ReactReduxContext:nn,an=_objectWithoutPropertiesLoose$3(Dt,_excluded$2),sn=rn;return function(dn){var mn=dn.displayName||dn.name||"Component",gn=jt(mn),un=_extends$2({},an,{getDisplayName:jt,methodName:Gt,renderCountProp:qt,shouldHandleStateChanges:Xt,storeKey:Qt,displayName:gn,wrappedComponentName:mn,WrappedComponent:dn}),hn=an.pure;function bn(pn){return _e(pn.dispatch,un)}var En=hn?reactExports.useMemo:function(pn){return pn()};function _n(pn){var Nn=reactExports.useMemo(function(){var gr=pn.reactReduxForwardedRef,Er=_objectWithoutPropertiesLoose$3(pn,_excluded2);return[pn.context,gr,Er]},[pn]),An=Nn[0],Dn=Nn[1],Pn=Nn[2],Cn=reactExports.useMemo(function(){return An&&An.Consumer&&reactIsExports.isContextConsumer(React.createElement(An.Consumer,null))?An:sn},[An,sn]),Gn=reactExports.useContext(Cn),In=!!pn.store&&!!pn.store.getState&&!!pn.store.dispatch;Gn&&Gn.store;var Bn=In?pn.store:Gn.store,Zn=reactExports.useMemo(function(){return bn(Bn)},[Bn]),nr=reactExports.useMemo(function(){if(!Xt)return NO_SUBSCRIPTION_ARRAY;var gr=createSubscription(Bn,In?null:Gn.subscription),Er=gr.notifyNestedSubs.bind(gr);return[gr,Er]},[Bn,In,Gn]),ar=nr[0],Sn=nr[1],Rn=reactExports.useMemo(function(){return In?Gn:_extends$2({},Gn,{subscription:ar})},[In,Gn,ar]),On=reactExports.useReducer(storeStateUpdatesReducer,EMPTY_ARRAY,initStateUpdates),Vn=On[0],yn=Vn[0],vn=On[1];if(yn&&yn.error)throw yn.error;var wn=reactExports.useRef(),Un=reactExports.useRef(Pn),Kn=reactExports.useRef(),kn=reactExports.useRef(!1),tr=En(function(){return Kn.current&&Pn===Un.current?Kn.current:Zn(Bn.getState(),Pn)},[Bn,yn,Pn]);useIsomorphicLayoutEffectWithArgs(captureWrapperProps,[Un,wn,kn,Pn,tr,Kn,Sn]),useIsomorphicLayoutEffectWithArgs(subscribeUpdates,[Xt,Bn,ar,Zn,Un,wn,kn,Kn,Sn,vn],[Bn,ar,Zn]);var or=reactExports.useMemo(function(){return React.createElement(dn,_extends$2({},tr,{ref:Dn}))},[Dn,dn,tr]),Jn=reactExports.useMemo(function(){return Xt?React.createElement(Cn.Provider,{value:Rn},or):or},[Cn,or,Rn]);return Jn}var Tn=hn?React.memo(_n):_n;if(Tn.WrappedComponent=dn,Tn.displayName=_n.displayName=gn,tn){var $n=React.forwardRef(function(Nn,An){return React.createElement(Tn,_extends$2({},Nn,{reactReduxForwardedRef:An}))});return $n.displayName=gn,$n.WrappedComponent=dn,hoistStatics($n,dn)}return hoistStatics(Tn,dn)}}function is$5(_e,Pt){return _e===Pt?_e!==0||Pt!==0||1/_e===1/Pt:_e!==_e&&Pt!==Pt}function shallowEqual(_e,Pt){if(is$5(_e,Pt))return!0;if(typeof _e!="object"||_e===null||typeof Pt!="object"||Pt===null)return!1;var Dt=Object.keys(_e),Nt=Object.keys(Pt);if(Dt.length!==Nt.length)return!1;for(var jt=0;jt=0;Nt--){var jt=Pt[Nt](_e);if(jt)return jt}return function(Ut,Gt){throw new Error("Invalid value of type "+typeof _e+" for "+Dt+" argument when connecting component "+Gt.wrappedComponentName+".")}}function strictEqual(_e,Pt){return _e===Pt}function createConnect(_e){var Pt=_e===void 0?{}:_e,Dt=Pt.connectHOC,Nt=Dt===void 0?connectAdvanced:Dt,jt=Pt.mapStateToPropsFactories,Ut=jt===void 0?defaultMapStateToPropsFactories:jt,Gt=Pt.mapDispatchToPropsFactories,Wt=Gt===void 0?defaultMapDispatchToPropsFactories:Gt,qt=Pt.mergePropsFactories,Yt=qt===void 0?defaultMergePropsFactories:qt,Xt=Pt.selectorFactory,Zt=Xt===void 0?finalPropsSelectorFactory:Xt;return function(en,tn,nn,rn){rn===void 0&&(rn={});var an=rn,sn=an.pure,ln=sn===void 0?!0:sn,dn=an.areStatesEqual,mn=dn===void 0?strictEqual:dn,gn=an.areOwnPropsEqual,un=gn===void 0?shallowEqual:gn,hn=an.areStatePropsEqual,bn=hn===void 0?shallowEqual:hn,En=an.areMergedPropsEqual,_n=En===void 0?shallowEqual:En,Tn=_objectWithoutPropertiesLoose$3(an,_excluded),$n=match(en,Ut,"mapStateToProps"),pn=match(tn,Wt,"mapDispatchToProps"),Nn=match(nn,Yt,"mergeProps");return Nt(Zt,_extends$2({methodName:"connect",getDisplayName:function(Dn){return"Connect("+Dn+")"},shouldHandleStateChanges:!!en,initMapStateToProps:$n,initMapDispatchToProps:pn,initMergeProps:Nn,pure:ln,areStatesEqual:mn,areOwnPropsEqual:un,areStatePropsEqual:bn,areMergedPropsEqual:_n},Tn))}}const connect$1=createConnect();setBatch(reactDomExports.unstable_batchedUpdates);function areInputsEqual$1(_e,Pt){if(_e.length!==Pt.length)return!1;for(var Dt=0;Dt<_e.length;Dt++)if(_e[Dt]!==Pt[Dt])return!1;return!0}function useMemoOne(_e,Pt){var Dt=reactExports.useState(function(){return{inputs:Pt,result:_e()}})[0],Nt=reactExports.useRef(!0),jt=reactExports.useRef(Dt),Ut=Nt.current||!!(Pt&&jt.current.inputs&&areInputsEqual$1(Pt,jt.current.inputs)),Gt=Ut?jt.current:{inputs:Pt,result:_e()};return reactExports.useEffect(function(){Nt.current=!1,jt.current=Gt},[Gt]),Gt.result}function useCallbackOne(_e,Pt){return useMemoOne(function(){return _e},Pt)}var useMemo=useMemoOne,useCallback=useCallbackOne,isProduction=!0,prefix$2="Invariant failed";function invariant$1(_e,Pt){if(!_e){if(isProduction)throw new Error(prefix$2);var Dt=typeof Pt=="function"?Pt():Pt,Nt=Dt?"".concat(prefix$2,": ").concat(Dt):prefix$2;throw new Error(Nt)}}var getRect=function _e(Pt){var Dt=Pt.top,Nt=Pt.right,jt=Pt.bottom,Ut=Pt.left,Gt=Nt-Ut,Wt=jt-Dt,qt={top:Dt,right:Nt,bottom:jt,left:Ut,width:Gt,height:Wt,x:Ut,y:Dt,center:{x:(Nt+Ut)/2,y:(jt+Dt)/2}};return qt},expand=function _e(Pt,Dt){return{top:Pt.top-Dt.top,left:Pt.left-Dt.left,bottom:Pt.bottom+Dt.bottom,right:Pt.right+Dt.right}},shrink=function _e(Pt,Dt){return{top:Pt.top+Dt.top,left:Pt.left+Dt.left,bottom:Pt.bottom-Dt.bottom,right:Pt.right-Dt.right}},shift=function _e(Pt,Dt){return{top:Pt.top+Dt.y,left:Pt.left+Dt.x,bottom:Pt.bottom+Dt.y,right:Pt.right+Dt.x}},noSpacing$1={top:0,right:0,bottom:0,left:0},createBox=function _e(Pt){var Dt=Pt.borderBox,Nt=Pt.margin,jt=Nt===void 0?noSpacing$1:Nt,Ut=Pt.border,Gt=Ut===void 0?noSpacing$1:Ut,Wt=Pt.padding,qt=Wt===void 0?noSpacing$1:Wt,Yt=getRect(expand(Dt,jt)),Xt=getRect(shrink(Dt,Gt)),Zt=getRect(shrink(Xt,qt));return{marginBox:Yt,borderBox:getRect(Dt),paddingBox:Xt,contentBox:Zt,margin:jt,border:Gt,padding:qt}},parse$6=function _e(Pt){var Dt=Pt.slice(0,-2),Nt=Pt.slice(-2);if(Nt!=="px")return 0;var jt=Number(Dt);return isNaN(jt)&&invariant$1(!1),jt},getWindowScroll$1=function _e(){return{x:window.pageXOffset,y:window.pageYOffset}},offset=function _e(Pt,Dt){var Nt=Pt.borderBox,jt=Pt.border,Ut=Pt.margin,Gt=Pt.padding,Wt=shift(Nt,Dt);return createBox({borderBox:Wt,border:jt,margin:Ut,padding:Gt})},withScroll=function _e(Pt,Dt){return Dt===void 0&&(Dt=getWindowScroll$1()),offset(Pt,Dt)},calculateBox=function _e(Pt,Dt){var Nt={top:parse$6(Dt.marginTop),right:parse$6(Dt.marginRight),bottom:parse$6(Dt.marginBottom),left:parse$6(Dt.marginLeft)},jt={top:parse$6(Dt.paddingTop),right:parse$6(Dt.paddingRight),bottom:parse$6(Dt.paddingBottom),left:parse$6(Dt.paddingLeft)},Ut={top:parse$6(Dt.borderTopWidth),right:parse$6(Dt.borderRightWidth),bottom:parse$6(Dt.borderBottomWidth),left:parse$6(Dt.borderLeftWidth)};return createBox({borderBox:Pt,margin:Nt,padding:jt,border:Ut})},getBox=function _e(Pt){var Dt=Pt.getBoundingClientRect(),Nt=window.getComputedStyle(Pt);return calculateBox(Dt,Nt)},safeIsNaN=Number.isNaN||function _e(Pt){return typeof Pt=="number"&&Pt!==Pt};function isEqual$2(_e,Pt){return!!(_e===Pt||safeIsNaN(_e)&&safeIsNaN(Pt))}function areInputsEqual(_e,Pt){if(_e.length!==Pt.length)return!1;for(var Dt=0;Dt<_e.length;Dt++)if(!isEqual$2(_e[Dt],Pt[Dt]))return!1;return!0}function memoizeOne(_e,Pt){Pt===void 0&&(Pt=areInputsEqual);var Dt,Nt=[],jt,Ut=!1;function Gt(){for(var Wt=[],qt=0;qt");return Nt.callbacks},Nt.setCallbacks=function(Wt){Nt.callbacks=Wt},Nt}var Dt=Pt.prototype;return Dt.componentDidMount=function(){this.unbind=bindEvents(window,[{eventName:"error",fn:this.onWindowError}])},Dt.componentDidCatch=function(jt){if(jt instanceof RbdInvariant){this.setState({});return}throw jt},Dt.componentWillUnmount=function(){this.unbind()},Dt.render=function(){return this.props.children(this.setCallbacks)},Pt}(React.Component),dragHandleUsageInstructions=` Press space bar to start a drag. When dragging you can use the arrow keys to move the item around and escape to cancel. Some screen readers may require you to be in focus mode or to use your pass through key diff --git a/assets/parseTrace.worker-0ac9de5d.js b/assets/parseTrace.worker-0ac9de5d.js new file mode 100644 index 00000000..d2e92619 --- /dev/null +++ b/assets/parseTrace.worker-0ac9de5d.js @@ -0,0 +1,27 @@ +(function(){"use strict";var Ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */vt.exports,function(h,w){(function(){var f,P="4.17.21",O=200,C="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",R="Expected a function",k="Invalid `variable` option passed into `_.template`",Z="__lodash_hash_undefined__",N=500,j="__lodash_placeholder__",an=1,G=2,z=4,pn=1,ln=2,L=1,_n=2,W=4,A=8,D=16,Y=32,J=64,nn=128,sn=256,Ur=512,Ps=30,Ws="...",Fs=800,Ms=16,qu=1,Bs=2,Us=3,de=1/0,oe=9007199254740991,Ds=17976931348623157e292,mt=0/0,Yn=4294967295,qs=Yn-1,$s=Yn>>>1,Ns=[["ary",nn],["bind",L],["bindKey",_n],["curry",A],["curryRight",D],["flip",Ur],["partial",Y],["partialRight",J],["rearg",sn]],Ee="[object Arguments]",xt="[object Array]",Gs="[object AsyncFunction]",Xe="[object Boolean]",Je="[object Date]",Hs="[object DOMException]",yt="[object Error]",At="[object Function]",$u="[object GeneratorFunction]",Nn="[object Map]",Qe="[object Number]",zs="[object Null]",Vn="[object Object]",Nu="[object Promise]",Ks="[object Proxy]",Ve="[object RegExp]",Gn="[object Set]",ke="[object String]",St="[object Symbol]",Zs="[object Undefined]",je="[object WeakMap]",Ys="[object WeakSet]",nt="[object ArrayBuffer]",Ce="[object DataView]",Dr="[object Float32Array]",qr="[object Float64Array]",$r="[object Int8Array]",Nr="[object Int16Array]",Gr="[object Int32Array]",Hr="[object Uint8Array]",zr="[object Uint8ClampedArray]",Kr="[object Uint16Array]",Zr="[object Uint32Array]",Xs=/\b__p \+= '';/g,Js=/\b(__p \+=) '' \+/g,Qs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Gu=/&(?:amp|lt|gt|quot|#39);/g,Hu=/[&<>"']/g,Vs=RegExp(Gu.source),ks=RegExp(Hu.source),js=/<%-([\s\S]+?)%>/g,nl=/<%([\s\S]+?)%>/g,zu=/<%=([\s\S]+?)%>/g,el=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tl=/^\w*$/,rl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yr=/[\\^$.*+?()[\]{}|]/g,il=RegExp(Yr.source),Xr=/^\s+/,ul=/\s/,fl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ol=/\{\n\/\* \[wrapped with (.+)\] \*/,al=/,? & /,sl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ll=/[()=,{}\[\]\/\s]/,cl=/\\(\\)?/g,hl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ku=/\w*$/,gl=/^[-+]0x[0-9a-f]+$/i,pl=/^0b[01]+$/i,_l=/^\[object .+?Constructor\]$/,vl=/^0o[0-7]+$/i,dl=/^(?:0|[1-9]\d*)$/,wl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,ml=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",xl="\\u0300-\\u036f",yl="\\ufe20-\\ufe2f",Al="\\u20d0-\\u20ff",Zu=xl+yl+Al,Yu="\\u2700-\\u27bf",Xu="a-z\\xdf-\\xf6\\xf8-\\xff",Sl="\\xac\\xb1\\xd7\\xf7",bl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Il="\\u2000-\\u206f",Rl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ju="A-Z\\xc0-\\xd6\\xd8-\\xde",Qu="\\ufe0e\\ufe0f",Vu=Sl+bl+Il+Rl,Jr="['’]",Tl="["+It+"]",ku="["+Vu+"]",Rt="["+Zu+"]",ju="\\d+",Ol="["+Yu+"]",nf="["+Xu+"]",ef="[^"+It+Vu+ju+Yu+Xu+Ju+"]",Qr="\\ud83c[\\udffb-\\udfff]",El="(?:"+Rt+"|"+Qr+")",tf="[^"+It+"]",Vr="(?:\\ud83c[\\udde6-\\uddff]){2}",kr="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ju+"]",rf="\\u200d",uf="(?:"+nf+"|"+ef+")",Cl="(?:"+Le+"|"+ef+")",ff="(?:"+Jr+"(?:d|ll|m|re|s|t|ve))?",of="(?:"+Jr+"(?:D|LL|M|RE|S|T|VE))?",af=El+"?",sf="["+Qu+"]?",Ll="(?:"+rf+"(?:"+[tf,Vr,kr].join("|")+")"+sf+af+")*",Pl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lf=sf+af+Ll,Fl="(?:"+[Ol,Vr,kr].join("|")+")"+lf,Ml="(?:"+[tf+Rt+"?",Rt,Vr,kr,Tl].join("|")+")",Bl=RegExp(Jr,"g"),Ul=RegExp(Rt,"g"),jr=RegExp(Qr+"(?="+Qr+")|"+Ml+lf,"g"),Dl=RegExp([Le+"?"+nf+"+"+ff+"(?="+[ku,Le,"$"].join("|")+")",Cl+"+"+of+"(?="+[ku,Le+uf,"$"].join("|")+")",Le+"?"+uf+"+"+ff,Le+"+"+of,Wl,Pl,ju,Fl].join("|"),"g"),ql=RegExp("["+rf+It+Zu+Qu+"]"),$l=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Gl=-1,en={};en[Dr]=en[qr]=en[$r]=en[Nr]=en[Gr]=en[Hr]=en[zr]=en[Kr]=en[Zr]=!0,en[Ee]=en[xt]=en[nt]=en[Xe]=en[Ce]=en[Je]=en[yt]=en[At]=en[Nn]=en[Qe]=en[Vn]=en[Ve]=en[Gn]=en[ke]=en[je]=!1;var V={};V[Ee]=V[xt]=V[nt]=V[Ce]=V[Xe]=V[Je]=V[Dr]=V[qr]=V[$r]=V[Nr]=V[Gr]=V[Nn]=V[Qe]=V[Vn]=V[Ve]=V[Gn]=V[ke]=V[St]=V[Hr]=V[zr]=V[Kr]=V[Zr]=!0,V[yt]=V[At]=V[je]=!1;var Hl={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zl={"&":"&","<":"<",">":">",'"':""","'":"'"},Kl={"&":"&","<":"<",">":">",""":'"',"'":"'"},Zl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Yl=parseFloat,Xl=parseInt,cf=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,Jl=typeof self=="object"&&self&&self.Object===Object&&self,vn=cf||Jl||Function("return this")(),ni=w&&!w.nodeType&&w,we=ni&&!0&&h&&!h.nodeType&&h,hf=we&&we.exports===ni,ei=hf&&cf.process,Wn=function(){try{var l=we&&we.require&&we.require("util").types;return l||ei&&ei.binding&&ei.binding("util")}catch{}}(),gf=Wn&&Wn.isArrayBuffer,pf=Wn&&Wn.isDate,_f=Wn&&Wn.isMap,vf=Wn&&Wn.isRegExp,df=Wn&&Wn.isSet,wf=Wn&&Wn.isTypedArray;function Tn(l,p,g){switch(g.length){case 0:return l.call(p);case 1:return l.call(p,g[0]);case 2:return l.call(p,g[0],g[1]);case 3:return l.call(p,g[0],g[1],g[2])}return l.apply(p,g)}function Ql(l,p,g,x){for(var T=-1,H=l==null?0:l.length;++T-1}function ti(l,p,g){for(var x=-1,T=l==null?0:l.length;++x-1;);return g}function Rf(l,p){for(var g=l.length;g--&&Pe(p,l[g],0)>-1;);return g}function uc(l,p){for(var g=l.length,x=0;g--;)l[g]===p&&++x;return x}var fc=fi(Hl),oc=fi(zl);function ac(l){return"\\"+Zl[l]}function sc(l,p){return l==null?f:l[p]}function We(l){return ql.test(l)}function lc(l){return $l.test(l)}function cc(l){for(var p,g=[];!(p=l.next()).done;)g.push(p.value);return g}function li(l){var p=-1,g=Array(l.size);return l.forEach(function(x,T){g[++p]=[T,x]}),g}function Tf(l,p){return function(g){return l(p(g))}}function le(l,p){for(var g=-1,x=l.length,T=0,H=[];++g-1}function kc(n,e){var t=this.__data__,r=zt(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}kn.prototype.clear=Xc,kn.prototype.delete=Jc,kn.prototype.get=Qc,kn.prototype.has=Vc,kn.prototype.set=kc;function jn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Un(n,e,t,r,i,o){var a,s=e&an,c=e&G,_=e&z;if(t&&(a=i?t(n,r,i,o):t(n)),a!==f)return a;if(!rn(n))return n;var v=E(n);if(v){if(a=tg(n),!s)return Sn(n,a)}else{var d=mn(n),m=d==At||d==$u;if(ve(n))return so(n,s);if(d==Vn||d==Ee||m&&!i){if(a=c||m?{}:Eo(n),!s)return c?Kh(n,ph(a,n)):zh(n,qf(a,n))}else{if(!V[d])return i?n:{};a=rg(n,d,s)}}o||(o=new zn);var y=o.get(n);if(y)return y;o.set(n,a),ia(n)?n.forEach(function(I){a.add(Un(I,e,t,I,n,o))}):ta(n)&&n.forEach(function(I,U){a.set(U,Un(I,e,t,U,n,o))});var b=_?c?Bi:Mi:c?In:gn,M=v?f:b(n);return Fn(M||n,function(I,U){M&&(U=I,I=n[U]),ot(a,U,Un(I,e,t,U,n,o))}),a}function _h(n){var e=gn(n);return function(t){return $f(t,n,e)}}function $f(n,e,t){var r=t.length;if(n==null)return!r;for(n=Q(n);r--;){var i=t[r],o=e[i],a=n[i];if(a===f&&!(i in n)||!o(a))return!1}return!0}function Nf(n,e,t){if(typeof n!="function")throw new Mn(R);return pt(function(){n.apply(f,t)},e)}function at(n,e,t,r){var i=-1,o=Tt,a=!0,s=n.length,c=[],_=e.length;if(!s)return c;t&&(e=tn(e,On(t))),r?(o=ti,a=!1):e.length>=O&&(o=et,a=!1,e=new ye(e));n:for(;++ii?0:i+t),r=r===f||r>i?i:F(r),r<0&&(r+=i),r=t>r?0:fa(r);t0&&t(s)?e>1?dn(s,e-1,t,r,i):se(i,s):r||(i[i.length]=s)}return i}var di=_o(),zf=_o(!0);function Xn(n,e){return n&&di(n,e,gn)}function wi(n,e){return n&&zf(n,e,gn)}function Zt(n,e){return ae(e,function(t){return ie(n[t])})}function Se(n,e){e=pe(e,n);for(var t=0,r=e.length;n!=null&&te}function wh(n,e){return n!=null&&X.call(n,e)}function mh(n,e){return n!=null&&e in Q(n)}function xh(n,e,t){return n>=wn(e,t)&&n=120&&v.length>=120)?new ye(a&&v):f}v=n[0];var d=-1,m=s[0];n:for(;++d-1;)s!==n&&Ut.call(s,c,1),Ut.call(n,c,1);return n}function eo(n,e){for(var t=n?e.length:0,r=t-1;t--;){var i=e[t];if(t==r||i!==o){var o=i;re(i)?Ut.call(n,i,1):Oi(n,i)}}return n}function Ii(n,e){return n+$t(Mf()*(e-n+1))}function Wh(n,e,t,r){for(var i=-1,o=hn(qt((e-n)/(t||1)),0),a=g(o);o--;)a[r?o:++i]=n,n+=t;return a}function Ri(n,e){var t="";if(!n||e<1||e>oe)return t;do e%2&&(t+=n),e=$t(e/2),e&&(n+=n);while(e);return t}function B(n,e){return Hi(Po(n,e,Rn),n+"")}function Fh(n){return Df(ze(n))}function Mh(n,e){var t=ze(n);return rr(t,Ae(e,0,t.length))}function ct(n,e,t,r){if(!rn(n))return n;e=pe(e,n);for(var i=-1,o=e.length,a=o-1,s=n;s!=null&&++ii?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=g(i);++r>>1,a=n[o];a!==null&&!Cn(a)&&(t?a<=e:a=O){var _=e?null:Jh(n);if(_)return Et(_);a=!1,i=et,c=new ye}else c=e?[]:s;n:for(;++r=r?n:Dn(n,e,t)}var ao=Rc||function(n){return vn.clearTimeout(n)};function so(n,e){if(e)return n.slice();var t=n.length,r=Cf?Cf(t):new n.constructor(t);return n.copy(r),r}function Pi(n){var e=new n.constructor(n.byteLength);return new Mt(e).set(new Mt(n)),e}function $h(n,e){var t=e?Pi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Nh(n){var e=new n.constructor(n.source,Ku.exec(n));return e.lastIndex=n.lastIndex,e}function Gh(n){return ft?Q(ft.call(n)):{}}function lo(n,e){var t=e?Pi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function co(n,e){if(n!==e){var t=n!==f,r=n===null,i=n===n,o=Cn(n),a=e!==f,s=e===null,c=e===e,_=Cn(e);if(!s&&!_&&!o&&n>e||o&&a&&c&&!s&&!_||r&&a&&c||!t&&c||!i)return 1;if(!r&&!o&&!_&&n=s)return c;var _=t[r];return c*(_=="desc"?-1:1)}}return n.index-e.index}function ho(n,e,t,r){for(var i=-1,o=n.length,a=t.length,s=-1,c=e.length,_=hn(o-a,0),v=g(c+_),d=!r;++s1?t[i-1]:f,a=i>2?t[2]:f;for(o=n.length>3&&typeof o=="function"?(i--,o):f,a&&yn(t[0],t[1],a)&&(o=i<3?f:o,i=1),e=Q(e);++r-1?i[o?e[a]:a]:f}}function mo(n){return te(function(e){var t=e.length,r=t,i=Bn.prototype.thru;for(n&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new Mn(R);if(i&&!a&&er(o)=="wrapper")var a=new Bn([],!0)}for(r=a?r:t;++r1&&$.reverse(),v&&cs))return!1;var _=o.get(n),v=o.get(e);if(_&&v)return _==e&&v==n;var d=-1,m=!0,y=t&ln?new ye:f;for(o.set(n,e),o.set(e,n);++d1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(fl,`{ +/* [wrapped with `+e+`] */ +`)}function ug(n){return E(n)||Re(n)||!!(Wf&&n&&n[Wf])}function re(n,e){var t=typeof n;return e=e??oe,!!e&&(t=="number"||t!="symbol"&&dl.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Fs)return arguments[0]}else e=0;return n.apply(f,arguments)}}function rr(n,e){var t=-1,r=n.length,i=r-1;for(e=e===f?r:e;++t1?n[e-1]:f;return t=typeof t=="function"?(n.pop(),t):f,zo(n,t)});function Ko(n){var e=u(n);return e.__chain__=!0,e}function vp(n,e){return e(n),n}function ir(n,e){return e(n)}var dp=te(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,i=function(o){return vi(o,n)};return e>1||this.__actions__.length||!(r instanceof q)||!re(t)?this.thru(i):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:ir,args:[i],thisArg:f}),new Bn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(f),o}))});function wp(){return Ko(this)}function mp(){return new Bn(this.value(),this.__chain__)}function xp(){this.__values__===f&&(this.__values__=ua(this.value()));var n=this.__index__>=this.__values__.length,e=n?f:this.__values__[this.__index__++];return{done:n,value:e}}function yp(){return this}function Ap(n){for(var e,t=this;t instanceof Ht;){var r=Do(t);r.__index__=0,r.__values__=f,e?i.__wrapped__=r:e=r;var i=r;t=t.__wrapped__}return i.__wrapped__=n,e}function Sp(){var n=this.__wrapped__;if(n instanceof q){var e=n;return this.__actions__.length&&(e=new q(this)),e=e.reverse(),e.__actions__.push({func:ir,args:[zi],thisArg:f}),new Bn(e,this.__chain__)}return this.thru(zi)}function bp(){return fo(this.__wrapped__,this.__actions__)}var Ip=Qt(function(n,e,t){X.call(n,t)?++n[t]:ne(n,t,1)});function Rp(n,e,t){var r=E(n)?mf:vh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}function Tp(n,e){var t=E(n)?ae:Hf;return t(n,S(e,3))}var Op=wo(qo),Ep=wo($o);function Cp(n,e){return dn(ur(n,e),1)}function Lp(n,e){return dn(ur(n,e),de)}function Pp(n,e,t){return t=t===f?1:F(t),dn(ur(n,e),t)}function Zo(n,e){var t=E(n)?Fn:he;return t(n,S(e,3))}function Yo(n,e){var t=E(n)?Vl:Gf;return t(n,S(e,3))}var Wp=Qt(function(n,e,t){X.call(n,t)?n[t].push(e):ne(n,t,[e])});function Fp(n,e,t,r){n=bn(n)?n:ze(n),t=t&&!r?F(t):0;var i=n.length;return t<0&&(t=hn(i+t,0)),lr(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&Pe(n,e,t)>-1}var Mp=B(function(n,e,t){var r=-1,i=typeof e=="function",o=bn(n)?g(n.length):[];return he(n,function(a){o[++r]=i?Tn(e,a,t):st(a,e,t)}),o}),Bp=Qt(function(n,e,t){ne(n,t,e)});function ur(n,e){var t=E(n)?tn:Jf;return t(n,S(e,3))}function Up(n,e,t,r){return n==null?[]:(E(e)||(e=e==null?[]:[e]),t=r?f:t,E(t)||(t=t==null?[]:[t]),jf(n,e,t))}var Dp=Qt(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function qp(n,e,t){var r=E(n)?ri:Sf,i=arguments.length<3;return r(n,S(e,4),t,i,he)}function $p(n,e,t){var r=E(n)?kl:Sf,i=arguments.length<3;return r(n,S(e,4),t,i,Gf)}function Np(n,e){var t=E(n)?ae:Hf;return t(n,ar(S(e,3)))}function Gp(n){var e=E(n)?Df:Fh;return e(n)}function Hp(n,e,t){(t?yn(n,e,t):e===f)?e=1:e=F(e);var r=E(n)?ch:Mh;return r(n,e)}function zp(n){var e=E(n)?hh:Uh;return e(n)}function Kp(n){if(n==null)return 0;if(bn(n))return lr(n)?Fe(n):n.length;var e=mn(n);return e==Nn||e==Gn?n.size:Ai(n).length}function Zp(n,e,t){var r=E(n)?ii:Dh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}var Yp=B(function(n,e){if(n==null)return[];var t=e.length;return t>1&&yn(n,e[0],e[1])?e=[]:t>2&&yn(e[0],e[1],e[2])&&(e=[e[0]]),jf(n,dn(e,1),[])}),fr=Tc||function(){return vn.Date.now()};function Xp(n,e){if(typeof e!="function")throw new Mn(R);return n=F(n),function(){if(--n<1)return e.apply(this,arguments)}}function Xo(n,e,t){return e=t?f:e,e=n&&e==null?n.length:e,ee(n,nn,f,f,f,f,e)}function Jo(n,e){var t;if(typeof e!="function")throw new Mn(R);return n=F(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=f),t}}var Zi=B(function(n,e,t){var r=L;if(t.length){var i=le(t,Ge(Zi));r|=Y}return ee(n,r,e,t,i)}),Qo=B(function(n,e,t){var r=L|_n;if(t.length){var i=le(t,Ge(Qo));r|=Y}return ee(e,r,n,t,i)});function Vo(n,e,t){e=t?f:e;var r=ee(n,A,f,f,f,f,f,e);return r.placeholder=Vo.placeholder,r}function ko(n,e,t){e=t?f:e;var r=ee(n,D,f,f,f,f,f,e);return r.placeholder=ko.placeholder,r}function jo(n,e,t){var r,i,o,a,s,c,_=0,v=!1,d=!1,m=!0;if(typeof n!="function")throw new Mn(R);e=$n(e)||0,rn(t)&&(v=!!t.leading,d="maxWait"in t,o=d?hn($n(t.maxWait)||0,e):o,m="trailing"in t?!!t.trailing:m);function y(on){var Zn=r,fe=i;return r=i=f,_=on,a=n.apply(fe,Zn),a}function b(on){return _=on,s=pt(U,e),v?y(on):a}function M(on){var Zn=on-c,fe=on-_,wa=e-Zn;return d?wn(wa,o-fe):wa}function I(on){var Zn=on-c,fe=on-_;return c===f||Zn>=e||Zn<0||d&&fe>=o}function U(){var on=fr();if(I(on))return $(on);s=pt(U,M(on))}function $(on){return s=f,m&&r?y(on):(r=i=f,a)}function Ln(){s!==f&&ao(s),_=0,r=c=i=s=f}function An(){return s===f?a:$(fr())}function Pn(){var on=fr(),Zn=I(on);if(r=arguments,i=this,c=on,Zn){if(s===f)return b(c);if(d)return ao(s),s=pt(U,e),y(c)}return s===f&&(s=pt(U,e)),a}return Pn.cancel=Ln,Pn.flush=An,Pn}var Jp=B(function(n,e){return Nf(n,1,e)}),Qp=B(function(n,e,t){return Nf(n,$n(e)||0,t)});function Vp(n){return ee(n,Ur)}function or(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Mn(R);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=t.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return t.cache=o.set(i,a)||o,a};return t.cache=new(or.Cache||jn),t}or.Cache=jn;function ar(n){if(typeof n!="function")throw new Mn(R);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function kp(n){return Jo(2,n)}var jp=qh(function(n,e){e=e.length==1&&E(e[0])?tn(e[0],On(S())):tn(dn(e,1),On(S()));var t=e.length;return B(function(r){for(var i=-1,o=wn(r.length,t);++i=e}),Re=Zf(function(){return arguments}())?Zf:function(n){return un(n)&&X.call(n,"callee")&&!Pf.call(n,"callee")},E=g.isArray,p_=gf?On(gf):Ah;function bn(n){return n!=null&&sr(n.length)&&!ie(n)}function fn(n){return un(n)&&bn(n)}function __(n){return n===!0||n===!1||un(n)&&xn(n)==Xe}var ve=Ec||iu,v_=pf?On(pf):Sh;function d_(n){return un(n)&&n.nodeType===1&&!_t(n)}function w_(n){if(n==null)return!0;if(bn(n)&&(E(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||He(n)||Re(n)))return!n.length;var e=mn(n);if(e==Nn||e==Gn)return!n.size;if(gt(n))return!Ai(n).length;for(var t in n)if(X.call(n,t))return!1;return!0}function m_(n,e){return lt(n,e)}function x_(n,e,t){t=typeof t=="function"?t:f;var r=t?t(n,e):f;return r===f?lt(n,e,f,t):!!r}function Xi(n){if(!un(n))return!1;var e=xn(n);return e==yt||e==Hs||typeof n.message=="string"&&typeof n.name=="string"&&!_t(n)}function y_(n){return typeof n=="number"&&Ff(n)}function ie(n){if(!rn(n))return!1;var e=xn(n);return e==At||e==$u||e==Gs||e==Ks}function ea(n){return typeof n=="number"&&n==F(n)}function sr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=oe}function rn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function un(n){return n!=null&&typeof n=="object"}var ta=_f?On(_f):Ih;function A_(n,e){return n===e||yi(n,e,Di(e))}function S_(n,e,t){return t=typeof t=="function"?t:f,yi(n,e,Di(e),t)}function b_(n){return ra(n)&&n!=+n}function I_(n){if(ag(n))throw new T(C);return Yf(n)}function R_(n){return n===null}function T_(n){return n==null}function ra(n){return typeof n=="number"||un(n)&&xn(n)==Qe}function _t(n){if(!un(n)||xn(n)!=Vn)return!1;var e=Bt(n);if(e===null)return!0;var t=X.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Pt.call(t)==Sc}var Ji=vf?On(vf):Rh;function O_(n){return ea(n)&&n>=-oe&&n<=oe}var ia=df?On(df):Th;function lr(n){return typeof n=="string"||!E(n)&&un(n)&&xn(n)==ke}function Cn(n){return typeof n=="symbol"||un(n)&&xn(n)==St}var He=wf?On(wf):Oh;function E_(n){return n===f}function C_(n){return un(n)&&mn(n)==je}function L_(n){return un(n)&&xn(n)==Ys}var P_=nr(Si),W_=nr(function(n,e){return n<=e});function ua(n){if(!n)return[];if(bn(n))return lr(n)?Hn(n):Sn(n);if(tt&&n[tt])return cc(n[tt]());var e=mn(n),t=e==Nn?li:e==Gn?Et:ze;return t(n)}function ue(n){if(!n)return n===0?n:0;if(n=$n(n),n===de||n===-de){var e=n<0?-1:1;return e*Ds}return n===n?n:0}function F(n){var e=ue(n),t=e%1;return e===e?t?e-t:e:0}function fa(n){return n?Ae(F(n),0,Yn):0}function $n(n){if(typeof n=="number")return n;if(Cn(n))return mt;if(rn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=rn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=bf(n);var t=pl.test(n);return t||vl.test(n)?Xl(n.slice(2),t?2:8):gl.test(n)?mt:+n}function oa(n){return Jn(n,In(n))}function F_(n){return n?Ae(F(n),-oe,oe):n===0?n:0}function K(n){return n==null?"":En(n)}var M_=$e(function(n,e){if(gt(e)||bn(e)){Jn(e,gn(e),n);return}for(var t in e)X.call(e,t)&&ot(n,t,e[t])}),aa=$e(function(n,e){Jn(e,In(e),n)}),cr=$e(function(n,e,t,r){Jn(e,In(e),n,r)}),B_=$e(function(n,e,t,r){Jn(e,gn(e),n,r)}),U_=te(vi);function D_(n,e){var t=qe(n);return e==null?t:qf(t,e)}var q_=B(function(n,e){n=Q(n);var t=-1,r=e.length,i=r>2?e[2]:f;for(i&&yn(e[0],e[1],i)&&(r=1);++t1),o}),Jn(n,Bi(n),t),r&&(t=Un(t,an|G|z,Qh));for(var i=e.length;i--;)Oi(t,e[i]);return t});function rv(n,e){return la(n,ar(S(e)))}var iv=te(function(n,e){return n==null?{}:Lh(n,e)});function la(n,e){if(n==null)return{};var t=tn(Bi(n),function(r){return[r]});return e=S(e),no(n,t,function(r,i){return e(r,i[0])})}function uv(n,e,t){e=pe(e,n);var r=-1,i=e.length;for(i||(i=1,n=f);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var i=Mf();return wn(n+i*(e-n+Yl("1e-"+((i+"").length-1))),e)}return Ii(n,e)}var vv=Ne(function(n,e,t){return e=e.toLowerCase(),n+(t?ga(e):e)});function ga(n){return ki(K(n).toLowerCase())}function pa(n){return n=K(n),n&&n.replace(wl,fc).replace(Ul,"")}function dv(n,e,t){n=K(n),e=En(e);var r=n.length;t=t===f?r:Ae(F(t),0,r);var i=t;return t-=e.length,t>=0&&n.slice(t,i)==e}function wv(n){return n=K(n),n&&ks.test(n)?n.replace(Hu,oc):n}function mv(n){return n=K(n),n&&il.test(n)?n.replace(Yr,"\\$&"):n}var xv=Ne(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),yv=Ne(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),Av=vo("toLowerCase");function Sv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;if(!e||r>=e)return n;var i=(e-r)/2;return jt($t(i),t)+n+jt(qt(i),t)}function bv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;return e&&r>>0,t?(n=K(n),n&&(typeof e=="string"||e!=null&&!Ji(e))&&(e=En(e),!e&&We(n))?_e(Hn(n),0,t):n.split(e,t)):[]}var Lv=Ne(function(n,e,t){return n+(t?" ":"")+ki(e)});function Pv(n,e,t){return n=K(n),t=t==null?0:Ae(F(t),0,n.length),e=En(e),n.slice(t,t+e.length)==e}function Wv(n,e,t){var r=u.templateSettings;t&&yn(n,e,t)&&(e=f),n=K(n),e=cr({},e,r,bo);var i=cr({},e.imports,r.imports,bo),o=gn(i),a=si(i,o),s,c,_=0,v=e.interpolate||bt,d="__p += '",m=ci((e.escape||bt).source+"|"+v.source+"|"+(v===zu?hl:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),y="//# sourceURL="+(X.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Gl+"]")+` +`;n.replace(m,function(I,U,$,Ln,An,Pn){return $||($=Ln),d+=n.slice(_,Pn).replace(ml,ac),U&&(s=!0,d+=`' + +__e(`+U+`) + +'`),An&&(c=!0,d+=`'; +`+An+`; +__p += '`),$&&(d+=`' + +((__t = (`+$+`)) == null ? '' : __t) + +'`),_=Pn+I.length,I}),d+=`'; +`;var b=X.call(e,"variable")&&e.variable;if(!b)d=`with (obj) { +`+d+` +} +`;else if(ll.test(b))throw new T(k);d=(c?d.replace(Xs,""):d).replace(Js,"$1").replace(Qs,"$1;"),d="function("+(b||"obj")+`) { +`+(b?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+d+`return __p +}`;var M=va(function(){return H(o,y+"return "+d).apply(f,a)});if(M.source=d,Xi(M))throw M;return M}function Fv(n){return K(n).toLowerCase()}function Mv(n){return K(n).toUpperCase()}function Bv(n,e,t){if(n=K(n),n&&(t||e===f))return bf(n);if(!n||!(e=En(e)))return n;var r=Hn(n),i=Hn(e),o=If(r,i),a=Rf(r,i)+1;return _e(r,o,a).join("")}function Uv(n,e,t){if(n=K(n),n&&(t||e===f))return n.slice(0,Of(n)+1);if(!n||!(e=En(e)))return n;var r=Hn(n),i=Rf(r,Hn(e))+1;return _e(r,0,i).join("")}function Dv(n,e,t){if(n=K(n),n&&(t||e===f))return n.replace(Xr,"");if(!n||!(e=En(e)))return n;var r=Hn(n),i=If(r,Hn(e));return _e(r,i).join("")}function qv(n,e){var t=Ps,r=Ws;if(rn(e)){var i="separator"in e?e.separator:i;t="length"in e?F(e.length):t,r="omission"in e?En(e.omission):r}n=K(n);var o=n.length;if(We(n)){var a=Hn(n);o=a.length}if(t>=o)return n;var s=t-Fe(r);if(s<1)return r;var c=a?_e(a,0,s).join(""):n.slice(0,s);if(i===f)return c+r;if(a&&(s+=c.length-s),Ji(i)){if(n.slice(s).search(i)){var _,v=c;for(i.global||(i=ci(i.source,K(Ku.exec(i))+"g")),i.lastIndex=0;_=i.exec(v);)var d=_.index;c=c.slice(0,d===f?s:d)}}else if(n.indexOf(En(i),s)!=s){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function $v(n){return n=K(n),n&&Vs.test(n)?n.replace(Gu,_c):n}var Nv=Ne(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),ki=vo("toUpperCase");function _a(n,e,t){return n=K(n),e=t?f:e,e===f?lc(n)?wc(n):ec(n):n.match(e)||[]}var va=B(function(n,e){try{return Tn(n,f,e)}catch(t){return Xi(t)?t:new T(t)}}),Gv=te(function(n,e){return Fn(e,function(t){t=Qn(t),ne(n,t,Zi(n[t],n))}),n});function Hv(n){var e=n==null?0:n.length,t=S();return n=e?tn(n,function(r){if(typeof r[1]!="function")throw new Mn(R);return[t(r[0]),r[1]]}):[],B(function(r){for(var i=-1;++ioe)return[];var t=Yn,r=wn(n,Yn);e=S(e),n-=Yn;for(var i=ai(r,e);++t0||e<0)?new q(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==f&&(e=F(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},q.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},q.prototype.toArray=function(){return this.take(Yn)},Xn(q.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(u.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,c=a instanceof q,_=s[0],v=c||E(a),d=function(U){var $=i.apply(u,se([U],s));return r&&m?$[0]:$};v&&t&&typeof _=="function"&&_.length!=1&&(c=v=!1);var m=this.__chain__,y=!!this.__actions__.length,b=o&&!m,M=c&&!y;if(!o&&v){a=M?a:new q(this);var I=n.apply(a,s);return I.__actions__.push({func:ir,args:[d],thisArg:f}),new Bn(I,m)}return b&&M?n.apply(this,s):(I=this.thru(d),b?r?I.value()[0]:I.value():I)})}),Fn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Ct[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(E(o)?o:[],i)}return this[t](function(a){return e.apply(E(a)?a:[],i)})}}),Xn(q.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";X.call(De,r)||(De[r]=[]),De[r].push({name:e,func:t})}}),De[Vt(f,_n).name]=[{name:"wrapper",func:f}],q.prototype.clone=$c,q.prototype.reverse=Nc,q.prototype.value=Gc,u.prototype.at=dp,u.prototype.chain=wp,u.prototype.commit=mp,u.prototype.next=xp,u.prototype.plant=Ap,u.prototype.reverse=Sp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=bp,u.prototype.first=u.prototype.head,tt&&(u.prototype[tt]=yp),u},Me=mc();we?((we.exports=Me)._=Me,ni._=Me):vn._=Me}).call(Ke)}(vt,vt.exports);var Te=vt.exports,ma=function(){},xa=ma(),Oe=function(h){return h!==xa&&h!==null},ya=Oe,Aa=Array.prototype.forEach,Sa=Object.create,ba=function(h,w){var f;for(f in h)w[f]=h[f]},Ia=function(h){var w=Sa(null);return Aa.call(arguments,function(f){ya(f)&&ba(Object(f),w)}),w},Ra=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1},hr,uu;function Ta(){return uu||(uu=1,hr=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}),hr}var Oa=Ra()?Math.sign:Ta(),Ea=Oa,Ca=Math.abs,La=Math.floor,Pa=function(h){return isNaN(h)?0:(h=Number(h),h===0||!isFinite(h)?h:Ea(h)*La(Ca(h)))},Wa=Pa,Fa=Math.max,Ma=function(h){return Fa(0,Wa(h))},fu=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h},Ba=Oe,ou=function(h){if(!Ba(h))throw new TypeError("Cannot use null or undefined");return h},Ua={exports:{}},Da=function(){var h=Object.assign,w;return typeof h!="function"?!1:(w={foo:"raz"},h(w,{bar:"dwa"},{trzy:"trzy"}),w.foo+w.bar+w.trzy==="razdwatrzy")},gr,au;function qa(){return au||(au=1,gr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),gr}var pr,su;function $a(){if(su)return pr;su=1;var h=Oe,w=Object.keys;return pr=function(f){return w(h(f)?Object(f):f)},pr}var _r,lu;function Na(){return lu||(lu=1,_r=qa()()?Object.keys:$a()),_r}var vr,cu;function Ga(){if(cu)return vr;cu=1;var h=Na(),w=ou,f=Math.max;return vr=function(P,O){var C,R,k=f(arguments.length,2),Z;for(P=Object(w(P)),Z=function(N){try{P[N]=O[N]}catch(j){C||(C=j)}},R=1;R-1},wr}var fs=is()?String.prototype.contains:us(),dt=_u,du=rs,wu=hu,mu=Ia,Ze=fs,os=pu.exports=function(h,w){var f,P,O,C,R;return arguments.length<2||typeof h!="string"?(C=w,w=h,h=null):C=arguments[2],dt(h)?(f=Ze.call(h,"c"),P=Ze.call(h,"e"),O=Ze.call(h,"w")):(f=O=!0,P=!1),R={value:w,configurable:f,enumerable:P,writable:O},C?wu(mu(C),R):R};os.gs=function(h,w,f){var P,O,C,R;return typeof h!="string"?(C=f,f=w,w=h,h=null):C=arguments[3],dt(w)?du(w)?dt(f)?du(f)||(C=f,f=void 0):f=void 0:(C=w,w=f=void 0):w=void 0,dt(h)?(P=Ze.call(h,"c"),O=Ze.call(h,"e")):(P=!0,O=!1),R={get:w,set:f,configurable:P,enumerable:O},C?wu(mu(C),R):R};var Ye=pu.exports,mr={exports:{}};(function(h,w){var f=Ye,P=fu,O=Function.prototype.apply,C=Function.prototype.call,R=Object.create,k=Object.defineProperty,Z=Object.defineProperties,N=Object.prototype.hasOwnProperty,j={configurable:!0,enumerable:!1,writable:!0},an,G,z,pn,ln,L,_n;an=function(W,A){var D;return P(A),N.call(this,"__ee__")?D=this.__ee__:(D=j.value=R(null),k(this,"__ee__",j),j.value=null),D[W]?typeof D[W]=="object"?D[W].push(A):D[W]=[D[W],A]:D[W]=A,this},G=function(W,A){var D,Y;return P(A),Y=this,an.call(this,W,D=function(){z.call(Y,W,D),O.call(A,this,arguments)}),D.__eeOnceListener__=A,this},z=function(W,A){var D,Y,J,nn;if(P(A),!N.call(this,"__ee__"))return this;if(D=this.__ee__,!D[W])return this;if(Y=D[W],typeof Y=="object")for(nn=0;J=Y[nn];++nn)(J===A||J.__eeOnceListener__===A)&&(Y.length===2?D[W]=Y[nn?0:1]:Y.splice(nn,1));else(Y===A||Y.__eeOnceListener__===A)&&delete D[W];return this},pn=function(W){var A,D,Y,J,nn;if(N.call(this,"__ee__")&&(J=this.__ee__[W],!!J))if(typeof J=="object"){for(D=arguments.length,nn=new Array(D-1),A=1;A=55296&&D<=56319&&(sn+=G[++L])),sn=z?N.call(z,pn,sn,_n):sn,ln?(j.value=sn,an(W,_n,j)):W[_n]=sn,++_n;A=_n}}if(A===void 0)for(A=P(G.length),ln&&(W=new ln(A)),L=0;Lasync w=>{const f=new h,P=await w(f);return f.terminate(),P},Is=h=>w=>bs(h)(f=>(f.postMessage(w),new Promise((P,O)=>{f.onmessage=C=>{P(C.data)},f.onerror=O})));var Rs=""+new URL("parseTraceSlave.worker-3d3cfe01.js",self.location.href).href;const{min:Ts}=Math,Os=navigator.hardwareConcurrency??8;class Es extends Worker{constructor(){super(Rs,{type:"module"})}}const Cs=Is(Es);async function Ls({trace:h,context:w,view:f="main"}){var R,k;const P=Te.ceil((((R=h==null?void 0:h.events)==null?void 0:R.length)??0)/Os),O=Te.range(0,(k=h==null?void 0:h.events)==null?void 0:k.length,P),C=Te.flatten(await Promise.all(Te.map(O,Z=>{var N;return Cs({trace:h,context:w,view:f,from:Z,to:Ts(Z+P,((N=h==null?void 0:h.events)==null?void 0:N.length)??0)})})));return{stepsPersistent:Te.flatMap(C,"stepsPersistent"),stepsTransient:Te.flatMap(C,"stepsTransient")}}onmessage=async({data:h})=>{postMessage(await Ls(h))}})(); diff --git a/assets/parseTrace.worker-3082fe1b.js b/assets/parseTrace.worker-3082fe1b.js deleted file mode 100644 index 0b2480e9..00000000 --- a/assets/parseTrace.worker-3082fe1b.js +++ /dev/null @@ -1,27 +0,0 @@ -(function(){"use strict";var Ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */vt.exports,function(h,w){(function(){var f,P="4.17.21",O=200,C="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",R="Expected a function",k="Invalid `variable` option passed into `_.template`",Z="__lodash_hash_undefined__",N=500,j="__lodash_placeholder__",an=1,G=2,z=4,pn=1,ln=2,L=1,_n=2,W=4,A=8,D=16,Y=32,J=64,nn=128,sn=256,Br=512,Es=30,Cs="...",Ls=800,Ps=16,Uu=1,Ws=2,Fs=3,de=1/0,oe=9007199254740991,Ms=17976931348623157e292,mt=0/0,Yn=4294967295,Bs=Yn-1,Us=Yn>>>1,Ds=[["ary",nn],["bind",L],["bindKey",_n],["curry",A],["curryRight",D],["flip",Br],["partial",Y],["partialRight",J],["rearg",sn]],Ee="[object Arguments]",xt="[object Array]",qs="[object AsyncFunction]",Xe="[object Boolean]",Je="[object Date]",$s="[object DOMException]",yt="[object Error]",At="[object Function]",Du="[object GeneratorFunction]",Nn="[object Map]",Qe="[object Number]",Ns="[object Null]",Vn="[object Object]",qu="[object Promise]",Gs="[object Proxy]",Ve="[object RegExp]",Gn="[object Set]",ke="[object String]",St="[object Symbol]",Hs="[object Undefined]",je="[object WeakMap]",zs="[object WeakSet]",nt="[object ArrayBuffer]",Ce="[object DataView]",Ur="[object Float32Array]",Dr="[object Float64Array]",qr="[object Int8Array]",$r="[object Int16Array]",Nr="[object Int32Array]",Gr="[object Uint8Array]",Hr="[object Uint8ClampedArray]",zr="[object Uint16Array]",Kr="[object Uint32Array]",Ks=/\b__p \+= '';/g,Zs=/\b(__p \+=) '' \+/g,Ys=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$u=/&(?:amp|lt|gt|quot|#39);/g,Nu=/[&<>"']/g,Xs=RegExp($u.source),Js=RegExp(Nu.source),Qs=/<%-([\s\S]+?)%>/g,Vs=/<%([\s\S]+?)%>/g,Gu=/<%=([\s\S]+?)%>/g,ks=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,js=/^\w*$/,nl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zr=/[\\^$.*+?()[\]{}|]/g,el=RegExp(Zr.source),Yr=/^\s+/,tl=/\s/,rl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,il=/\{\n\/\* \[wrapped with (.+)\] \*/,ul=/,? & /,fl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ol=/[()=,{}\[\]\/\s]/,al=/\\(\\)?/g,sl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Hu=/\w*$/,ll=/^[-+]0x[0-9a-f]+$/i,cl=/^0b[01]+$/i,hl=/^\[object .+?Constructor\]$/,gl=/^0o[0-7]+$/i,pl=/^(?:0|[1-9]\d*)$/,_l=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,vl=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",dl="\\u0300-\\u036f",wl="\\ufe20-\\ufe2f",ml="\\u20d0-\\u20ff",zu=dl+wl+ml,Ku="\\u2700-\\u27bf",Zu="a-z\\xdf-\\xf6\\xf8-\\xff",xl="\\xac\\xb1\\xd7\\xf7",yl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Al="\\u2000-\\u206f",Sl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yu="A-Z\\xc0-\\xd6\\xd8-\\xde",Xu="\\ufe0e\\ufe0f",Ju=xl+yl+Al+Sl,Xr="['’]",bl="["+It+"]",Qu="["+Ju+"]",Rt="["+zu+"]",Vu="\\d+",Il="["+Ku+"]",ku="["+Zu+"]",ju="[^"+It+Ju+Vu+Ku+Zu+Yu+"]",Jr="\\ud83c[\\udffb-\\udfff]",Rl="(?:"+Rt+"|"+Jr+")",nf="[^"+It+"]",Qr="(?:\\ud83c[\\udde6-\\uddff]){2}",Vr="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Yu+"]",ef="\\u200d",tf="(?:"+ku+"|"+ju+")",Tl="(?:"+Le+"|"+ju+")",rf="(?:"+Xr+"(?:d|ll|m|re|s|t|ve))?",uf="(?:"+Xr+"(?:D|LL|M|RE|S|T|VE))?",ff=Rl+"?",of="["+Xu+"]?",Ol="(?:"+ef+"(?:"+[nf,Qr,Vr].join("|")+")"+of+ff+")*",El="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",af=of+ff+Ol,Ll="(?:"+[Il,Qr,Vr].join("|")+")"+af,Pl="(?:"+[nf+Rt+"?",Rt,Qr,Vr,bl].join("|")+")",Wl=RegExp(Xr,"g"),Fl=RegExp(Rt,"g"),kr=RegExp(Jr+"(?="+Jr+")|"+Pl+af,"g"),Ml=RegExp([Le+"?"+ku+"+"+rf+"(?="+[Qu,Le,"$"].join("|")+")",Tl+"+"+uf+"(?="+[Qu,Le+tf,"$"].join("|")+")",Le+"?"+tf+"+"+rf,Le+"+"+uf,Cl,El,Vu,Ll].join("|"),"g"),Bl=RegExp("["+ef+It+zu+Xu+"]"),Ul=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Dl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ql=-1,en={};en[Ur]=en[Dr]=en[qr]=en[$r]=en[Nr]=en[Gr]=en[Hr]=en[zr]=en[Kr]=!0,en[Ee]=en[xt]=en[nt]=en[Xe]=en[Ce]=en[Je]=en[yt]=en[At]=en[Nn]=en[Qe]=en[Vn]=en[Ve]=en[Gn]=en[ke]=en[je]=!1;var V={};V[Ee]=V[xt]=V[nt]=V[Ce]=V[Xe]=V[Je]=V[Ur]=V[Dr]=V[qr]=V[$r]=V[Nr]=V[Nn]=V[Qe]=V[Vn]=V[Ve]=V[Gn]=V[ke]=V[St]=V[Gr]=V[Hr]=V[zr]=V[Kr]=!0,V[yt]=V[At]=V[je]=!1;var $l={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Nl={"&":"&","<":"<",">":">",'"':""","'":"'"},Gl={"&":"&","<":"<",">":">",""":'"',"'":"'"},Hl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zl=parseFloat,Kl=parseInt,sf=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,Zl=typeof self=="object"&&self&&self.Object===Object&&self,vn=sf||Zl||Function("return this")(),jr=w&&!w.nodeType&&w,we=jr&&!0&&h&&!h.nodeType&&h,lf=we&&we.exports===jr,ni=lf&&sf.process,Wn=function(){try{var l=we&&we.require&&we.require("util").types;return l||ni&&ni.binding&&ni.binding("util")}catch{}}(),cf=Wn&&Wn.isArrayBuffer,hf=Wn&&Wn.isDate,gf=Wn&&Wn.isMap,pf=Wn&&Wn.isRegExp,_f=Wn&&Wn.isSet,vf=Wn&&Wn.isTypedArray;function Tn(l,p,g){switch(g.length){case 0:return l.call(p);case 1:return l.call(p,g[0]);case 2:return l.call(p,g[0],g[1]);case 3:return l.call(p,g[0],g[1],g[2])}return l.apply(p,g)}function Yl(l,p,g,x){for(var T=-1,H=l==null?0:l.length;++T-1}function ei(l,p,g){for(var x=-1,T=l==null?0:l.length;++x-1;);return g}function bf(l,p){for(var g=l.length;g--&&Pe(p,l[g],0)>-1;);return g}function tc(l,p){for(var g=l.length,x=0;g--;)l[g]===p&&++x;return x}var rc=ui($l),ic=ui(Nl);function uc(l){return"\\"+Hl[l]}function fc(l,p){return l==null?f:l[p]}function We(l){return Bl.test(l)}function oc(l){return Ul.test(l)}function ac(l){for(var p,g=[];!(p=l.next()).done;)g.push(p.value);return g}function si(l){var p=-1,g=Array(l.size);return l.forEach(function(x,T){g[++p]=[T,x]}),g}function If(l,p){return function(g){return l(p(g))}}function le(l,p){for(var g=-1,x=l.length,T=0,H=[];++g-1}function Jc(n,e){var t=this.__data__,r=zt(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}kn.prototype.clear=Kc,kn.prototype.delete=Zc,kn.prototype.get=Yc,kn.prototype.has=Xc,kn.prototype.set=Jc;function jn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Un(n,e,t,r,i,o){var a,s=e&an,c=e&G,_=e&z;if(t&&(a=i?t(n,r,i,o):t(n)),a!==f)return a;if(!rn(n))return n;var v=E(n);if(v){if(a=jh(n),!s)return Sn(n,a)}else{var d=mn(n),m=d==At||d==Du;if(ve(n))return oo(n,s);if(d==Vn||d==Ee||m&&!i){if(a=c||m?{}:To(n),!s)return c?Gh(n,ch(a,n)):Nh(n,Uf(a,n))}else{if(!V[d])return i?n:{};a=ng(n,d,s)}}o||(o=new zn);var y=o.get(n);if(y)return y;o.set(n,a),ta(n)?n.forEach(function(I){a.add(Un(I,e,t,I,n,o))}):na(n)&&n.forEach(function(I,U){a.set(U,Un(I,e,t,U,n,o))});var b=_?c?Mi:Fi:c?In:gn,M=v?f:b(n);return Fn(M||n,function(I,U){M&&(U=I,I=n[U]),ot(a,U,Un(I,e,t,U,n,o))}),a}function hh(n){var e=gn(n);return function(t){return Df(t,n,e)}}function Df(n,e,t){var r=t.length;if(n==null)return!r;for(n=Q(n);r--;){var i=t[r],o=e[i],a=n[i];if(a===f&&!(i in n)||!o(a))return!1}return!0}function qf(n,e,t){if(typeof n!="function")throw new Mn(R);return pt(function(){n.apply(f,t)},e)}function at(n,e,t,r){var i=-1,o=Tt,a=!0,s=n.length,c=[],_=e.length;if(!s)return c;t&&(e=tn(e,On(t))),r?(o=ei,a=!1):e.length>=O&&(o=et,a=!1,e=new ye(e));n:for(;++ii?0:i+t),r=r===f||r>i?i:F(r),r<0&&(r+=i),r=t>r?0:ia(r);t0&&t(s)?e>1?dn(s,e-1,t,r,i):se(i,s):r||(i[i.length]=s)}return i}var vi=go(),Gf=go(!0);function Xn(n,e){return n&&vi(n,e,gn)}function di(n,e){return n&&Gf(n,e,gn)}function Zt(n,e){return ae(e,function(t){return ie(n[t])})}function Se(n,e){e=pe(e,n);for(var t=0,r=e.length;n!=null&&te}function _h(n,e){return n!=null&&X.call(n,e)}function vh(n,e){return n!=null&&e in Q(n)}function dh(n,e,t){return n>=wn(e,t)&&n=120&&v.length>=120)?new ye(a&&v):f}v=n[0];var d=-1,m=s[0];n:for(;++d-1;)s!==n&&Ut.call(s,c,1),Ut.call(n,c,1);return n}function jf(n,e){for(var t=n?e.length:0,r=t-1;t--;){var i=e[t];if(t==r||i!==o){var o=i;re(i)?Ut.call(n,i,1):Ti(n,i)}}return n}function bi(n,e){return n+$t(Wf()*(e-n+1))}function Ch(n,e,t,r){for(var i=-1,o=hn(qt((e-n)/(t||1)),0),a=g(o);o--;)a[r?o:++i]=n,n+=t;return a}function Ii(n,e){var t="";if(!n||e<1||e>oe)return t;do e%2&&(t+=n),e=$t(e/2),e&&(n+=n);while(e);return t}function B(n,e){return Gi(Co(n,e,Rn),n+"")}function Lh(n){return Bf(ze(n))}function Ph(n,e){var t=ze(n);return rr(t,Ae(e,0,t.length))}function ct(n,e,t,r){if(!rn(n))return n;e=pe(e,n);for(var i=-1,o=e.length,a=o-1,s=n;s!=null&&++ii?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=g(i);++r>>1,a=n[o];a!==null&&!Cn(a)&&(t?a<=e:a=O){var _=e?null:Zh(n);if(_)return Et(_);a=!1,i=et,c=new ye}else c=e?[]:s;n:for(;++r=r?n:Dn(n,e,t)}var fo=Sc||function(n){return vn.clearTimeout(n)};function oo(n,e){if(e)return n.slice();var t=n.length,r=Of?Of(t):new n.constructor(t);return n.copy(r),r}function Li(n){var e=new n.constructor(n.byteLength);return new Mt(e).set(new Mt(n)),e}function Uh(n,e){var t=e?Li(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Dh(n){var e=new n.constructor(n.source,Hu.exec(n));return e.lastIndex=n.lastIndex,e}function qh(n){return ft?Q(ft.call(n)):{}}function ao(n,e){var t=e?Li(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function so(n,e){if(n!==e){var t=n!==f,r=n===null,i=n===n,o=Cn(n),a=e!==f,s=e===null,c=e===e,_=Cn(e);if(!s&&!_&&!o&&n>e||o&&a&&c&&!s&&!_||r&&a&&c||!t&&c||!i)return 1;if(!r&&!o&&!_&&n=s)return c;var _=t[r];return c*(_=="desc"?-1:1)}}return n.index-e.index}function lo(n,e,t,r){for(var i=-1,o=n.length,a=t.length,s=-1,c=e.length,_=hn(o-a,0),v=g(c+_),d=!r;++s1?t[i-1]:f,a=i>2?t[2]:f;for(o=n.length>3&&typeof o=="function"?(i--,o):f,a&&yn(t[0],t[1],a)&&(o=i<3?f:o,i=1),e=Q(e);++r-1?i[o?e[a]:a]:f}}function vo(n){return te(function(e){var t=e.length,r=t,i=Bn.prototype.thru;for(n&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new Mn(R);if(i&&!a&&er(o)=="wrapper")var a=new Bn([],!0)}for(r=a?r:t;++r1&&$.reverse(),v&&cs))return!1;var _=o.get(n),v=o.get(e);if(_&&v)return _==e&&v==n;var d=-1,m=!0,y=t&ln?new ye:f;for(o.set(n,e),o.set(e,n);++d1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(rl,`{ -/* [wrapped with `+e+`] */ -`)}function tg(n){return E(n)||Re(n)||!!(Lf&&n&&n[Lf])}function re(n,e){var t=typeof n;return e=e??oe,!!e&&(t=="number"||t!="symbol"&&pl.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Ls)return arguments[0]}else e=0;return n.apply(f,arguments)}}function rr(n,e){var t=-1,r=n.length,i=r-1;for(e=e===f?r:e;++t1?n[e-1]:f;return t=typeof t=="function"?(n.pop(),t):f,Go(n,t)});function Ho(n){var e=u(n);return e.__chain__=!0,e}function gp(n,e){return e(n),n}function ir(n,e){return e(n)}var pp=te(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,i=function(o){return _i(o,n)};return e>1||this.__actions__.length||!(r instanceof q)||!re(t)?this.thru(i):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:ir,args:[i],thisArg:f}),new Bn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(f),o}))});function _p(){return Ho(this)}function vp(){return new Bn(this.value(),this.__chain__)}function dp(){this.__values__===f&&(this.__values__=ra(this.value()));var n=this.__index__>=this.__values__.length,e=n?f:this.__values__[this.__index__++];return{done:n,value:e}}function wp(){return this}function mp(n){for(var e,t=this;t instanceof Ht;){var r=Bo(t);r.__index__=0,r.__values__=f,e?i.__wrapped__=r:e=r;var i=r;t=t.__wrapped__}return i.__wrapped__=n,e}function xp(){var n=this.__wrapped__;if(n instanceof q){var e=n;return this.__actions__.length&&(e=new q(this)),e=e.reverse(),e.__actions__.push({func:ir,args:[Hi],thisArg:f}),new Bn(e,this.__chain__)}return this.thru(Hi)}function yp(){return io(this.__wrapped__,this.__actions__)}var Ap=Qt(function(n,e,t){X.call(n,t)?++n[t]:ne(n,t,1)});function Sp(n,e,t){var r=E(n)?df:gh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}function bp(n,e){var t=E(n)?ae:Nf;return t(n,S(e,3))}var Ip=_o(Uo),Rp=_o(Do);function Tp(n,e){return dn(ur(n,e),1)}function Op(n,e){return dn(ur(n,e),de)}function Ep(n,e,t){return t=t===f?1:F(t),dn(ur(n,e),t)}function zo(n,e){var t=E(n)?Fn:he;return t(n,S(e,3))}function Ko(n,e){var t=E(n)?Xl:$f;return t(n,S(e,3))}var Cp=Qt(function(n,e,t){X.call(n,t)?n[t].push(e):ne(n,t,[e])});function Lp(n,e,t,r){n=bn(n)?n:ze(n),t=t&&!r?F(t):0;var i=n.length;return t<0&&(t=hn(i+t,0)),lr(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&Pe(n,e,t)>-1}var Pp=B(function(n,e,t){var r=-1,i=typeof e=="function",o=bn(n)?g(n.length):[];return he(n,function(a){o[++r]=i?Tn(e,a,t):st(a,e,t)}),o}),Wp=Qt(function(n,e,t){ne(n,t,e)});function ur(n,e){var t=E(n)?tn:Yf;return t(n,S(e,3))}function Fp(n,e,t,r){return n==null?[]:(E(e)||(e=e==null?[]:[e]),t=r?f:t,E(t)||(t=t==null?[]:[t]),Vf(n,e,t))}var Mp=Qt(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function Bp(n,e,t){var r=E(n)?ti:yf,i=arguments.length<3;return r(n,S(e,4),t,i,he)}function Up(n,e,t){var r=E(n)?Jl:yf,i=arguments.length<3;return r(n,S(e,4),t,i,$f)}function Dp(n,e){var t=E(n)?ae:Nf;return t(n,ar(S(e,3)))}function qp(n){var e=E(n)?Bf:Lh;return e(n)}function $p(n,e,t){(t?yn(n,e,t):e===f)?e=1:e=F(e);var r=E(n)?ah:Ph;return r(n,e)}function Np(n){var e=E(n)?sh:Fh;return e(n)}function Gp(n){if(n==null)return 0;if(bn(n))return lr(n)?Fe(n):n.length;var e=mn(n);return e==Nn||e==Gn?n.size:yi(n).length}function Hp(n,e,t){var r=E(n)?ri:Mh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}var zp=B(function(n,e){if(n==null)return[];var t=e.length;return t>1&&yn(n,e[0],e[1])?e=[]:t>2&&yn(e[0],e[1],e[2])&&(e=[e[0]]),Vf(n,dn(e,1),[])}),fr=bc||function(){return vn.Date.now()};function Kp(n,e){if(typeof e!="function")throw new Mn(R);return n=F(n),function(){if(--n<1)return e.apply(this,arguments)}}function Zo(n,e,t){return e=t?f:e,e=n&&e==null?n.length:e,ee(n,nn,f,f,f,f,e)}function Yo(n,e){var t;if(typeof e!="function")throw new Mn(R);return n=F(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=f),t}}var Ki=B(function(n,e,t){var r=L;if(t.length){var i=le(t,Ge(Ki));r|=Y}return ee(n,r,e,t,i)}),Xo=B(function(n,e,t){var r=L|_n;if(t.length){var i=le(t,Ge(Xo));r|=Y}return ee(e,r,n,t,i)});function Jo(n,e,t){e=t?f:e;var r=ee(n,A,f,f,f,f,f,e);return r.placeholder=Jo.placeholder,r}function Qo(n,e,t){e=t?f:e;var r=ee(n,D,f,f,f,f,f,e);return r.placeholder=Qo.placeholder,r}function Vo(n,e,t){var r,i,o,a,s,c,_=0,v=!1,d=!1,m=!0;if(typeof n!="function")throw new Mn(R);e=$n(e)||0,rn(t)&&(v=!!t.leading,d="maxWait"in t,o=d?hn($n(t.maxWait)||0,e):o,m="trailing"in t?!!t.trailing:m);function y(on){var Zn=r,fe=i;return r=i=f,_=on,a=n.apply(fe,Zn),a}function b(on){return _=on,s=pt(U,e),v?y(on):a}function M(on){var Zn=on-c,fe=on-_,va=e-Zn;return d?wn(va,o-fe):va}function I(on){var Zn=on-c,fe=on-_;return c===f||Zn>=e||Zn<0||d&&fe>=o}function U(){var on=fr();if(I(on))return $(on);s=pt(U,M(on))}function $(on){return s=f,m&&r?y(on):(r=i=f,a)}function Ln(){s!==f&&fo(s),_=0,r=c=i=s=f}function An(){return s===f?a:$(fr())}function Pn(){var on=fr(),Zn=I(on);if(r=arguments,i=this,c=on,Zn){if(s===f)return b(c);if(d)return fo(s),s=pt(U,e),y(c)}return s===f&&(s=pt(U,e)),a}return Pn.cancel=Ln,Pn.flush=An,Pn}var Zp=B(function(n,e){return qf(n,1,e)}),Yp=B(function(n,e,t){return qf(n,$n(e)||0,t)});function Xp(n){return ee(n,Br)}function or(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Mn(R);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=t.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return t.cache=o.set(i,a)||o,a};return t.cache=new(or.Cache||jn),t}or.Cache=jn;function ar(n){if(typeof n!="function")throw new Mn(R);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function Jp(n){return Yo(2,n)}var Qp=Bh(function(n,e){e=e.length==1&&E(e[0])?tn(e[0],On(S())):tn(dn(e,1),On(S()));var t=e.length;return B(function(r){for(var i=-1,o=wn(r.length,t);++i=e}),Re=zf(function(){return arguments}())?zf:function(n){return un(n)&&X.call(n,"callee")&&!Cf.call(n,"callee")},E=g.isArray,c_=cf?On(cf):mh;function bn(n){return n!=null&&sr(n.length)&&!ie(n)}function fn(n){return un(n)&&bn(n)}function h_(n){return n===!0||n===!1||un(n)&&xn(n)==Xe}var ve=Rc||ru,g_=hf?On(hf):xh;function p_(n){return un(n)&&n.nodeType===1&&!_t(n)}function __(n){if(n==null)return!0;if(bn(n)&&(E(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||He(n)||Re(n)))return!n.length;var e=mn(n);if(e==Nn||e==Gn)return!n.size;if(gt(n))return!yi(n).length;for(var t in n)if(X.call(n,t))return!1;return!0}function v_(n,e){return lt(n,e)}function d_(n,e,t){t=typeof t=="function"?t:f;var r=t?t(n,e):f;return r===f?lt(n,e,f,t):!!r}function Yi(n){if(!un(n))return!1;var e=xn(n);return e==yt||e==$s||typeof n.message=="string"&&typeof n.name=="string"&&!_t(n)}function w_(n){return typeof n=="number"&&Pf(n)}function ie(n){if(!rn(n))return!1;var e=xn(n);return e==At||e==Du||e==qs||e==Gs}function jo(n){return typeof n=="number"&&n==F(n)}function sr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=oe}function rn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function un(n){return n!=null&&typeof n=="object"}var na=gf?On(gf):Ah;function m_(n,e){return n===e||xi(n,e,Ui(e))}function x_(n,e,t){return t=typeof t=="function"?t:f,xi(n,e,Ui(e),t)}function y_(n){return ea(n)&&n!=+n}function A_(n){if(ug(n))throw new T(C);return Kf(n)}function S_(n){return n===null}function b_(n){return n==null}function ea(n){return typeof n=="number"||un(n)&&xn(n)==Qe}function _t(n){if(!un(n)||xn(n)!=Vn)return!1;var e=Bt(n);if(e===null)return!0;var t=X.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Pt.call(t)==xc}var Xi=pf?On(pf):Sh;function I_(n){return jo(n)&&n>=-oe&&n<=oe}var ta=_f?On(_f):bh;function lr(n){return typeof n=="string"||!E(n)&&un(n)&&xn(n)==ke}function Cn(n){return typeof n=="symbol"||un(n)&&xn(n)==St}var He=vf?On(vf):Ih;function R_(n){return n===f}function T_(n){return un(n)&&mn(n)==je}function O_(n){return un(n)&&xn(n)==zs}var E_=nr(Ai),C_=nr(function(n,e){return n<=e});function ra(n){if(!n)return[];if(bn(n))return lr(n)?Hn(n):Sn(n);if(tt&&n[tt])return ac(n[tt]());var e=mn(n),t=e==Nn?si:e==Gn?Et:ze;return t(n)}function ue(n){if(!n)return n===0?n:0;if(n=$n(n),n===de||n===-de){var e=n<0?-1:1;return e*Ms}return n===n?n:0}function F(n){var e=ue(n),t=e%1;return e===e?t?e-t:e:0}function ia(n){return n?Ae(F(n),0,Yn):0}function $n(n){if(typeof n=="number")return n;if(Cn(n))return mt;if(rn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=rn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Af(n);var t=cl.test(n);return t||gl.test(n)?Kl(n.slice(2),t?2:8):ll.test(n)?mt:+n}function ua(n){return Jn(n,In(n))}function L_(n){return n?Ae(F(n),-oe,oe):n===0?n:0}function K(n){return n==null?"":En(n)}var P_=$e(function(n,e){if(gt(e)||bn(e)){Jn(e,gn(e),n);return}for(var t in e)X.call(e,t)&&ot(n,t,e[t])}),fa=$e(function(n,e){Jn(e,In(e),n)}),cr=$e(function(n,e,t,r){Jn(e,In(e),n,r)}),W_=$e(function(n,e,t,r){Jn(e,gn(e),n,r)}),F_=te(_i);function M_(n,e){var t=qe(n);return e==null?t:Uf(t,e)}var B_=B(function(n,e){n=Q(n);var t=-1,r=e.length,i=r>2?e[2]:f;for(i&&yn(e[0],e[1],i)&&(r=1);++t1),o}),Jn(n,Mi(n),t),r&&(t=Un(t,an|G|z,Yh));for(var i=e.length;i--;)Ti(t,e[i]);return t});function nv(n,e){return aa(n,ar(S(e)))}var ev=te(function(n,e){return n==null?{}:Oh(n,e)});function aa(n,e){if(n==null)return{};var t=tn(Mi(n),function(r){return[r]});return e=S(e),kf(n,t,function(r,i){return e(r,i[0])})}function tv(n,e,t){e=pe(e,n);var r=-1,i=e.length;for(i||(i=1,n=f);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var i=Wf();return wn(n+i*(e-n+zl("1e-"+((i+"").length-1))),e)}return bi(n,e)}var gv=Ne(function(n,e,t){return e=e.toLowerCase(),n+(t?ca(e):e)});function ca(n){return Vi(K(n).toLowerCase())}function ha(n){return n=K(n),n&&n.replace(_l,rc).replace(Fl,"")}function pv(n,e,t){n=K(n),e=En(e);var r=n.length;t=t===f?r:Ae(F(t),0,r);var i=t;return t-=e.length,t>=0&&n.slice(t,i)==e}function _v(n){return n=K(n),n&&Js.test(n)?n.replace(Nu,ic):n}function vv(n){return n=K(n),n&&el.test(n)?n.replace(Zr,"\\$&"):n}var dv=Ne(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),wv=Ne(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),mv=po("toLowerCase");function xv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;if(!e||r>=e)return n;var i=(e-r)/2;return jt($t(i),t)+n+jt(qt(i),t)}function yv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;return e&&r>>0,t?(n=K(n),n&&(typeof e=="string"||e!=null&&!Xi(e))&&(e=En(e),!e&&We(n))?_e(Hn(n),0,t):n.split(e,t)):[]}var Ov=Ne(function(n,e,t){return n+(t?" ":"")+Vi(e)});function Ev(n,e,t){return n=K(n),t=t==null?0:Ae(F(t),0,n.length),e=En(e),n.slice(t,t+e.length)==e}function Cv(n,e,t){var r=u.templateSettings;t&&yn(n,e,t)&&(e=f),n=K(n),e=cr({},e,r,Ao);var i=cr({},e.imports,r.imports,Ao),o=gn(i),a=ai(i,o),s,c,_=0,v=e.interpolate||bt,d="__p += '",m=li((e.escape||bt).source+"|"+v.source+"|"+(v===Gu?sl:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),y="//# sourceURL="+(X.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ql+"]")+` -`;n.replace(m,function(I,U,$,Ln,An,Pn){return $||($=Ln),d+=n.slice(_,Pn).replace(vl,uc),U&&(s=!0,d+=`' + -__e(`+U+`) + -'`),An&&(c=!0,d+=`'; -`+An+`; -__p += '`),$&&(d+=`' + -((__t = (`+$+`)) == null ? '' : __t) + -'`),_=Pn+I.length,I}),d+=`'; -`;var b=X.call(e,"variable")&&e.variable;if(!b)d=`with (obj) { -`+d+` -} -`;else if(ol.test(b))throw new T(k);d=(c?d.replace(Ks,""):d).replace(Zs,"$1").replace(Ys,"$1;"),d="function("+(b||"obj")+`) { -`+(b?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+d+`return __p -}`;var M=pa(function(){return H(o,y+"return "+d).apply(f,a)});if(M.source=d,Yi(M))throw M;return M}function Lv(n){return K(n).toLowerCase()}function Pv(n){return K(n).toUpperCase()}function Wv(n,e,t){if(n=K(n),n&&(t||e===f))return Af(n);if(!n||!(e=En(e)))return n;var r=Hn(n),i=Hn(e),o=Sf(r,i),a=bf(r,i)+1;return _e(r,o,a).join("")}function Fv(n,e,t){if(n=K(n),n&&(t||e===f))return n.slice(0,Rf(n)+1);if(!n||!(e=En(e)))return n;var r=Hn(n),i=bf(r,Hn(e))+1;return _e(r,0,i).join("")}function Mv(n,e,t){if(n=K(n),n&&(t||e===f))return n.replace(Yr,"");if(!n||!(e=En(e)))return n;var r=Hn(n),i=Sf(r,Hn(e));return _e(r,i).join("")}function Bv(n,e){var t=Es,r=Cs;if(rn(e)){var i="separator"in e?e.separator:i;t="length"in e?F(e.length):t,r="omission"in e?En(e.omission):r}n=K(n);var o=n.length;if(We(n)){var a=Hn(n);o=a.length}if(t>=o)return n;var s=t-Fe(r);if(s<1)return r;var c=a?_e(a,0,s).join(""):n.slice(0,s);if(i===f)return c+r;if(a&&(s+=c.length-s),Xi(i)){if(n.slice(s).search(i)){var _,v=c;for(i.global||(i=li(i.source,K(Hu.exec(i))+"g")),i.lastIndex=0;_=i.exec(v);)var d=_.index;c=c.slice(0,d===f?s:d)}}else if(n.indexOf(En(i),s)!=s){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function Uv(n){return n=K(n),n&&Xs.test(n)?n.replace($u,hc):n}var Dv=Ne(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),Vi=po("toUpperCase");function ga(n,e,t){return n=K(n),e=t?f:e,e===f?oc(n)?_c(n):kl(n):n.match(e)||[]}var pa=B(function(n,e){try{return Tn(n,f,e)}catch(t){return Yi(t)?t:new T(t)}}),qv=te(function(n,e){return Fn(e,function(t){t=Qn(t),ne(n,t,Ki(n[t],n))}),n});function $v(n){var e=n==null?0:n.length,t=S();return n=e?tn(n,function(r){if(typeof r[1]!="function")throw new Mn(R);return[t(r[0]),r[1]]}):[],B(function(r){for(var i=-1;++ioe)return[];var t=Yn,r=wn(n,Yn);e=S(e),n-=Yn;for(var i=oi(r,e);++t0||e<0)?new q(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==f&&(e=F(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},q.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},q.prototype.toArray=function(){return this.take(Yn)},Xn(q.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(u.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,c=a instanceof q,_=s[0],v=c||E(a),d=function(U){var $=i.apply(u,se([U],s));return r&&m?$[0]:$};v&&t&&typeof _=="function"&&_.length!=1&&(c=v=!1);var m=this.__chain__,y=!!this.__actions__.length,b=o&&!m,M=c&&!y;if(!o&&v){a=M?a:new q(this);var I=n.apply(a,s);return I.__actions__.push({func:ir,args:[d],thisArg:f}),new Bn(I,m)}return b&&M?n.apply(this,s):(I=this.thru(d),b?r?I.value()[0]:I.value():I)})}),Fn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Ct[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(E(o)?o:[],i)}return this[t](function(a){return e.apply(E(a)?a:[],i)})}}),Xn(q.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";X.call(De,r)||(De[r]=[]),De[r].push({name:e,func:t})}}),De[Vt(f,_n).name]=[{name:"wrapper",func:f}],q.prototype.clone=Uc,q.prototype.reverse=Dc,q.prototype.value=qc,u.prototype.at=pp,u.prototype.chain=_p,u.prototype.commit=vp,u.prototype.next=dp,u.prototype.plant=mp,u.prototype.reverse=xp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=yp,u.prototype.first=u.prototype.head,tt&&(u.prototype[tt]=wp),u},Me=vc();we?((we.exports=Me)._=Me,jr._=Me):vn._=Me}).call(Ke)}(vt,vt.exports);var Te=vt.exports,da=function(){},wa=da(),Oe=function(h){return h!==wa&&h!==null},ma=Oe,xa=Array.prototype.forEach,ya=Object.create,Aa=function(h,w){var f;for(f in h)w[f]=h[f]},Sa=function(h){var w=ya(null);return xa.call(arguments,function(f){ma(f)&&Aa(Object(f),w)}),w},ba=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1},hr,iu;function Ia(){return iu||(iu=1,hr=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}),hr}var Ra=ba()?Math.sign:Ia(),Ta=Ra,Oa=Math.abs,Ea=Math.floor,Ca=function(h){return isNaN(h)?0:(h=Number(h),h===0||!isFinite(h)?h:Ta(h)*Ea(Oa(h)))},La=Ca,Pa=Math.max,Wa=function(h){return Pa(0,La(h))},uu=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h},Fa=Oe,fu=function(h){if(!Fa(h))throw new TypeError("Cannot use null or undefined");return h},Ma={exports:{}},Ba=function(){var h=Object.assign,w;return typeof h!="function"?!1:(w={foo:"raz"},h(w,{bar:"dwa"},{trzy:"trzy"}),w.foo+w.bar+w.trzy==="razdwatrzy")},gr,ou;function Ua(){return ou||(ou=1,gr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),gr}var pr,au;function Da(){if(au)return pr;au=1;var h=Oe,w=Object.keys;return pr=function(f){return w(h(f)?Object(f):f)},pr}var _r,su;function qa(){return su||(su=1,_r=Ua()()?Object.keys:Da()),_r}var vr,lu;function $a(){if(lu)return vr;lu=1;var h=qa(),w=fu,f=Math.max;return vr=function(P,O){var C,R,k=f(arguments.length,2),Z;for(P=Object(w(P)),Z=function(N){try{P[N]=O[N]}catch(j){C||(C=j)}},R=1;R-1},wr}var is=ts()?String.prototype.contains:rs(),dt=pu,vu=es,du=cu,wu=Sa,Ze=is,us=gu.exports=function(h,w){var f,P,O,C,R;return arguments.length<2||typeof h!="string"?(C=w,w=h,h=null):C=arguments[2],dt(h)?(f=Ze.call(h,"c"),P=Ze.call(h,"e"),O=Ze.call(h,"w")):(f=O=!0,P=!1),R={value:w,configurable:f,enumerable:P,writable:O},C?du(wu(C),R):R};us.gs=function(h,w,f){var P,O,C,R;return typeof h!="string"?(C=f,f=w,w=h,h=null):C=arguments[3],dt(w)?vu(w)?dt(f)?vu(f)||(C=f,f=void 0):f=void 0:(C=w,w=f=void 0):w=void 0,dt(h)?(P=Ze.call(h,"c"),O=Ze.call(h,"e")):(P=!0,O=!1),R={get:w,set:f,configurable:P,enumerable:O},C?du(wu(C),R):R};var Ye=gu.exports,mr={exports:{}};(function(h,w){var f=Ye,P=uu,O=Function.prototype.apply,C=Function.prototype.call,R=Object.create,k=Object.defineProperty,Z=Object.defineProperties,N=Object.prototype.hasOwnProperty,j={configurable:!0,enumerable:!1,writable:!0},an,G,z,pn,ln,L,_n;an=function(W,A){var D;return P(A),N.call(this,"__ee__")?D=this.__ee__:(D=j.value=R(null),k(this,"__ee__",j),j.value=null),D[W]?typeof D[W]=="object"?D[W].push(A):D[W]=[D[W],A]:D[W]=A,this},G=function(W,A){var D,Y;return P(A),Y=this,an.call(this,W,D=function(){z.call(Y,W,D),O.call(A,this,arguments)}),D.__eeOnceListener__=A,this},z=function(W,A){var D,Y,J,nn;if(P(A),!N.call(this,"__ee__"))return this;if(D=this.__ee__,!D[W])return this;if(Y=D[W],typeof Y=="object")for(nn=0;J=Y[nn];++nn)(J===A||J.__eeOnceListener__===A)&&(Y.length===2?D[W]=Y[nn?0:1]:Y.splice(nn,1));else(Y===A||Y.__eeOnceListener__===A)&&delete D[W];return this},pn=function(W){var A,D,Y,J,nn;if(N.call(this,"__ee__")&&(J=this.__ee__[W],!!J))if(typeof J=="object"){for(D=arguments.length,nn=new Array(D-1),A=1;A=55296&&D<=56319&&(sn+=G[++L])),sn=z?N.call(z,pn,sn,_n):sn,ln?(j.value=sn,an(W,_n,j)):W[_n]=sn,++_n;A=_n}}if(A===void 0)for(A=P(G.length),ln&&(W=new ln(A)),L=0;Lasync w=>{const f=new h,P=await w(f);return f.terminate(),P},As=h=>w=>ys(h)(f=>(f.postMessage(w),new Promise((P,O)=>{f.onmessage=C=>{P(C.data)},f.onerror=O})));var Ss=""+new URL("parseTraceSlave.worker-5d9eede9.js",self.location.href).href;const{min:bs}=Math,Is=navigator.hardwareConcurrency??8;class Rs extends Worker{constructor(){super(Ss,{type:"module"})}}const Ts=As(Rs);async function Os({trace:h,context:w,view:f="main"}){var R,k;const P=Te.ceil((((R=h==null?void 0:h.events)==null?void 0:R.length)??0)/Is),O=Te.range(0,(k=h==null?void 0:h.events)==null?void 0:k.length,P),C=Te.flatten(await Promise.all(Te.map(O,Z=>{var N;return Ts({trace:h,context:w,view:f,from:Z,to:bs(Z+P,((N=h==null?void 0:h.events)==null?void 0:N.length)??0)})})));return{stepsPersistent:Te.flatMap(C,"stepsPersistent"),stepsTransient:Te.flatMap(C,"stepsTransient")}}onmessage=async({data:h})=>{postMessage(await Os(h))}})(); diff --git a/assets/parseTraceSlave.worker-3d3cfe01.js b/assets/parseTraceSlave.worker-3d3cfe01.js new file mode 100644 index 00000000..b58e99b9 --- /dev/null +++ b/assets/parseTraceSlave.worker-3d3cfe01.js @@ -0,0 +1,28 @@ +(function(){"use strict";var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ws(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var Ft={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Ft.exports,function(f,l){(function(){var i,h="4.17.21",m=200,d="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",y="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",_=500,b="__lodash_placeholder__",q=1,F=2,C=4,D=1,M=2,I=1,P=2,L=4,A=8,E=16,W=32,U=64,J=128,rn=256,Pn=512,gt=30,Ht="...",Bi=800,Kt=16,vt=1,Ui=2,Gi=3,Nn=1/0,wn=9007199254740991,De=17976931348623157e292,ae=0/0,$n=4294967295,zi=$n-1,Zt=$n>>>1,Vt=[["ary",J],["bind",I],["bindKey",P],["curry",A],["curryRight",E],["flip",Pn],["partial",W],["partialRight",U],["rearg",rn]],le="[object Arguments]",xe="[object Array]",dt="[object AsyncFunction]",se="[object Boolean]",be="[object Date]",un="[object DOMException]",ie="[object Error]",xn="[object Function]",Se="[object GeneratorFunction]",dn="[object Map]",Cn="[object Number]",Ae="[object Null]",Hn="[object Object]",_t="[object Promise]",Yt="[object Proxy]",an="[object RegExp]",_n="[object Set]",kn="[object String]",Qt="[object Symbol]",Lh="[object Undefined]",mt="[object WeakMap]",qh="[object WeakSet]",yt="[object ArrayBuffer]",Je="[object DataView]",Hi="[object Float32Array]",Ki="[object Float64Array]",Zi="[object Int8Array]",Vi="[object Int16Array]",Yi="[object Int32Array]",Qi="[object Uint8Array]",Xi="[object Uint8ClampedArray]",Ji="[object Uint16Array]",ji="[object Uint32Array]",Mh=/\b__p \+= '';/g,Fh=/\b(__p \+=) '' \+/g,Nh=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ko=/&(?:amp|lt|gt|quot|#39);/g,Zo=/[&<>"']/g,$h=RegExp(Ko.source),Dh=RegExp(Zo.source),Wh=/<%-([\s\S]+?)%>/g,Bh=/<%([\s\S]+?)%>/g,Vo=/<%=([\s\S]+?)%>/g,Uh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gh=/^\w*$/,zh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ki=/[\\^$.*+?()[\]{}|]/g,Hh=RegExp(ki.source),nu=/^\s+/,Kh=/\s/,Zh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vh=/\{\n\/\* \[wrapped with (.+)\] \*/,Yh=/,? & /,Qh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Xh=/[()=,{}\[\]\/\s]/,Jh=/\\(\\)?/g,jh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yo=/\w*$/,kh=/^[-+]0x[0-9a-f]+$/i,np=/^0b[01]+$/i,ep=/^\[object .+?Constructor\]$/,tp=/^0o[0-7]+$/i,rp=/^(?:0|[1-9]\d*)$/,ip=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,up=/['\n\r\u2028\u2029\\]/g,Jt="\\ud800-\\udfff",fp="\\u0300-\\u036f",op="\\ufe20-\\ufe2f",ap="\\u20d0-\\u20ff",Qo=fp+op+ap,Xo="\\u2700-\\u27bf",Jo="a-z\\xdf-\\xf6\\xf8-\\xff",lp="\\xac\\xb1\\xd7\\xf7",sp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cp="\\u2000-\\u206f",hp=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",jo="A-Z\\xc0-\\xd6\\xd8-\\xde",ko="\\ufe0e\\ufe0f",na=lp+sp+cp+hp,eu="['’]",pp="["+Jt+"]",ea="["+na+"]",jt="["+Qo+"]",ta="\\d+",gp="["+Xo+"]",ra="["+Jo+"]",ia="[^"+Jt+na+ta+Xo+Jo+jo+"]",tu="\\ud83c[\\udffb-\\udfff]",vp="(?:"+jt+"|"+tu+")",ua="[^"+Jt+"]",ru="(?:\\ud83c[\\udde6-\\uddff]){2}",iu="[\\ud800-\\udbff][\\udc00-\\udfff]",je="["+jo+"]",fa="\\u200d",oa="(?:"+ra+"|"+ia+")",dp="(?:"+je+"|"+ia+")",aa="(?:"+eu+"(?:d|ll|m|re|s|t|ve))?",la="(?:"+eu+"(?:D|LL|M|RE|S|T|VE))?",sa=vp+"?",ca="["+ko+"]?",_p="(?:"+fa+"(?:"+[ua,ru,iu].join("|")+")"+ca+sa+")*",mp="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ha=ca+sa+_p,wp="(?:"+[gp,ru,iu].join("|")+")"+ha,xp="(?:"+[ua+jt+"?",jt,ru,iu,pp].join("|")+")",bp=RegExp(eu,"g"),Sp=RegExp(jt,"g"),uu=RegExp(tu+"(?="+tu+")|"+xp+ha,"g"),Ap=RegExp([je+"?"+ra+"+"+aa+"(?="+[ea,je,"$"].join("|")+")",dp+"+"+la+"(?="+[ea,je+oa,"$"].join("|")+")",je+"?"+oa+"+"+aa,je+"+"+la,yp,mp,ta,wp].join("|"),"g"),Op=RegExp("["+fa+Jt+Qo+ko+"]"),Tp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ip=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rp=-1,ln={};ln[Hi]=ln[Ki]=ln[Zi]=ln[Vi]=ln[Yi]=ln[Qi]=ln[Xi]=ln[Ji]=ln[ji]=!0,ln[le]=ln[xe]=ln[yt]=ln[se]=ln[Je]=ln[be]=ln[ie]=ln[xn]=ln[dn]=ln[Cn]=ln[Hn]=ln[an]=ln[_n]=ln[kn]=ln[mt]=!1;var on={};on[le]=on[xe]=on[yt]=on[Je]=on[se]=on[be]=on[Hi]=on[Ki]=on[Zi]=on[Vi]=on[Yi]=on[dn]=on[Cn]=on[Hn]=on[an]=on[_n]=on[kn]=on[Qt]=on[Qi]=on[Xi]=on[Ji]=on[ji]=!0,on[ie]=on[xn]=on[mt]=!1;var Ep={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Pp={"&":"&","<":"<",">":">",'"':""","'":"'"},Cp={"&":"&","<":"<",">":">",""":'"',"'":"'"},Lp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qp=parseFloat,Mp=parseInt,pa=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,Fp=typeof self=="object"&&self&&self.Object===Object&&self,Sn=pa||Fp||Function("return this")(),fu=l&&!l.nodeType&&l,We=fu&&!0&&f&&!f.nodeType&&f,ga=We&&We.exports===fu,ou=ga&&pa.process,Kn=function(){try{var p=We&&We.require&&We.require("util").types;return p||ou&&ou.binding&&ou.binding("util")}catch{}}(),va=Kn&&Kn.isArrayBuffer,da=Kn&&Kn.isDate,_a=Kn&&Kn.isMap,ma=Kn&&Kn.isRegExp,ya=Kn&&Kn.isSet,wa=Kn&&Kn.isTypedArray;function Dn(p,S,x){switch(x.length){case 0:return p.call(S);case 1:return p.call(S,x[0]);case 2:return p.call(S,x[0],x[1]);case 3:return p.call(S,x[0],x[1],x[2])}return p.apply(S,x)}function Np(p,S,x,$){for(var K=-1,nn=p==null?0:p.length;++K-1}function au(p,S,x){for(var $=-1,K=p==null?0:p.length;++$-1;);return x}function Ra(p,S){for(var x=p.length;x--&&ke(S,p[x],0)>-1;);return x}function Kp(p,S){for(var x=p.length,$=0;x--;)p[x]===S&&++$;return $}var Zp=hu(Ep),Vp=hu(Pp);function Yp(p){return"\\"+Lp[p]}function Qp(p,S){return p==null?i:p[S]}function nt(p){return Op.test(p)}function Xp(p){return Tp.test(p)}function Jp(p){for(var S,x=[];!(S=p.next()).done;)x.push(S.value);return x}function du(p){var S=-1,x=Array(p.size);return p.forEach(function($,K){x[++S]=[K,$]}),x}function Ea(p,S){return function(x){return p(S(x))}}function Ie(p,S){for(var x=-1,$=p.length,K=0,nn=[];++x<$;){var mn=p[x];(mn===S||mn===b)&&(p[x]=b,nn[K++]=x)}return nn}function er(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=$}),x}function jp(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=[$,$]}),x}function kp(p,S,x){for(var $=x-1,K=p.length;++$-1}function Dg(n,e){var t=this.__data__,r=dr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}ce.prototype.clear=Mg,ce.prototype.delete=Fg,ce.prototype.get=Ng,ce.prototype.has=$g,ce.prototype.set=Dg;function he(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Qn(n,e,t,r,u,a){var s,c=e&q,v=e&F,O=e&C;if(t&&(s=u?t(n,r,u,a):t(n)),s!==i)return s;if(!hn(n))return n;var T=Z(n);if(T){if(s=Gv(n),!c)return Ln(n,s)}else{var R=Tn(n),N=R==xn||R==Se;if(qe(n))return cl(n,c);if(R==Hn||R==le||N&&!u){if(s=v||N?{}:Pl(n),!c)return v?Cv(n,nv(s,n)):Pv(n,Ua(s,n))}else{if(!on[R])return u?n:{};s=zv(n,R,c)}}a||(a=new ee);var B=a.get(n);if(B)return B;a.set(n,s),us(n)?n.forEach(function(H){s.add(Qn(H,e,t,H,n,a))}):rs(n)&&n.forEach(function(H,X){s.set(X,Qn(H,e,t,X,n,a))});var z=O?v?Gu:Uu:v?Mn:bn,Y=T?i:z(n);return Zn(Y||n,function(H,X){Y&&(X=H,H=n[X]),Tt(s,X,Qn(H,e,t,X,n,a))}),s}function ev(n){var e=bn(n);return function(t){return Ga(t,n,e)}}function Ga(n,e,t){var r=t.length;if(n==null)return!r;for(n=fn(n);r--;){var u=t[r],a=e[u],s=n[u];if(s===i&&!(u in n)||!a(s))return!1}return!0}function za(n,e,t){if(typeof n!="function")throw new Vn(g);return qt(function(){n.apply(i,t)},e)}function It(n,e,t,r){var u=-1,a=kt,s=!0,c=n.length,v=[],O=e.length;if(!c)return v;t&&(e=sn(e,Wn(t))),r?(a=au,s=!1):e.length>=m&&(a=wt,s=!1,e=new Ge(e));n:for(;++uu?0:u+t),r=r===i||r>u?u:V(r),r<0&&(r+=u),r=t>r?0:os(r);t0&&t(c)?e>1?An(c,e-1,t,r,u):Te(u,c):r||(u[u.length]=c)}return u}var Su=_l(),Za=_l(!0);function ue(n,e){return n&&Su(n,e,bn)}function Au(n,e){return n&&Za(n,e,bn)}function mr(n,e){return Oe(e,function(t){return _e(n[t])})}function He(n,e){e=Ce(e,n);for(var t=0,r=e.length;n!=null&&te}function iv(n,e){return n!=null&&tn.call(n,e)}function uv(n,e){return n!=null&&e in fn(n)}function fv(n,e,t){return n>=On(e,t)&&n=120&&T.length>=120)?new Ge(s&&T):i}T=n[0];var R=-1,N=c[0];n:for(;++R-1;)c!==n&&lr.call(c,v,1),lr.call(n,v,1);return n}function rl(n,e){for(var t=n?e.length:0,r=t-1;t--;){var u=e[t];if(t==r||u!==a){var a=u;de(u)?lr.call(n,u,1):Mu(n,u)}}return n}function Cu(n,e){return n+hr($a()*(e-n+1))}function yv(n,e,t,r){for(var u=-1,a=yn(cr((e-n)/(t||1)),0),s=x(a);a--;)s[r?a:++u]=n,n+=t;return s}function Lu(n,e){var t="";if(!n||e<1||e>wn)return t;do e%2&&(t+=n),e=hr(e/2),e&&(n+=n);while(e);return t}function Q(n,e){return Qu(ql(n,e,Fn),n+"")}function wv(n){return Ba(ct(n))}function xv(n,e){var t=ct(n);return Er(t,ze(e,0,t.length))}function Pt(n,e,t,r){if(!hn(n))return n;e=Ce(e,n);for(var u=-1,a=e.length,s=a-1,c=n;c!=null&&++uu?0:u+e),t=t>u?u:t,t<0&&(t+=u),u=e>t?0:t-e>>>0,e>>>=0;for(var a=x(u);++r>>1,s=n[a];s!==null&&!Un(s)&&(t?s<=e:s=m){var O=e?null:Fv(n);if(O)return er(O);s=!1,u=wt,v=new Ge}else v=e?[]:c;n:for(;++r=r?n:Xn(n,e,t)}var sl=hg||function(n){return Sn.clearTimeout(n)};function cl(n,e){if(e)return n.slice();var t=n.length,r=La?La(t):new n.constructor(t);return n.copy(r),r}function Du(n){var e=new n.constructor(n.byteLength);return new or(e).set(new or(n)),e}function Tv(n,e){var t=e?Du(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Iv(n){var e=new n.constructor(n.source,Yo.exec(n));return e.lastIndex=n.lastIndex,e}function Rv(n){return Ot?fn(Ot.call(n)):{}}function hl(n,e){var t=e?Du(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function pl(n,e){if(n!==e){var t=n!==i,r=n===null,u=n===n,a=Un(n),s=e!==i,c=e===null,v=e===e,O=Un(e);if(!c&&!O&&!a&&n>e||a&&s&&v&&!c&&!O||r&&s&&v||!t&&v||!u)return 1;if(!r&&!a&&!O&&n=c)return v;var O=t[r];return v*(O=="desc"?-1:1)}}return n.index-e.index}function gl(n,e,t,r){for(var u=-1,a=n.length,s=t.length,c=-1,v=e.length,O=yn(a-s,0),T=x(v+O),R=!r;++c1?t[u-1]:i,s=u>2?t[2]:i;for(a=n.length>3&&typeof a=="function"?(u--,a):i,s&&Rn(t[0],t[1],s)&&(a=u<3?i:a,u=1),e=fn(e);++r-1?u[a?e[s]:s]:i}}function wl(n){return ve(function(e){var t=e.length,r=t,u=Yn.prototype.thru;for(n&&e.reverse();r--;){var a=e[r];if(typeof a!="function")throw new Vn(g);if(u&&!s&&Ir(a)=="wrapper")var s=new Yn([],!0)}for(r=s?r:t;++r1&&k.reverse(),T&&vc))return!1;var O=a.get(n),T=a.get(e);if(O&&T)return O==e&&T==n;var R=-1,N=!0,B=t&M?new Ge:i;for(a.set(n,e),a.set(e,n);++R1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(Zh,`{ +/* [wrapped with `+e+`] */ +`)}function Kv(n){return Z(n)||Ve(n)||!!(Fa&&n&&n[Fa])}function de(n,e){var t=typeof n;return e=e??wn,!!e&&(t=="number"||t!="symbol"&&rp.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Bi)return arguments[0]}else e=0;return n.apply(i,arguments)}}function Er(n,e){var t=-1,r=n.length,u=r-1;for(e=e===i?r:e;++t1?n[e-1]:i;return t=typeof t=="function"?(n.pop(),t):i,Kl(n,t)});function Zl(n){var e=o(n);return e.__chain__=!0,e}function t_(n,e){return e(n),n}function Pr(n,e){return e(n)}var r_=ve(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,u=function(a){return bu(a,n)};return e>1||this.__actions__.length||!(r instanceof j)||!de(t)?this.thru(u):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:Pr,args:[u],thisArg:i}),new Yn(r,this.__chain__).thru(function(a){return e&&!a.length&&a.push(i),a}))});function i_(){return Zl(this)}function u_(){return new Yn(this.value(),this.__chain__)}function f_(){this.__values__===i&&(this.__values__=fs(this.value()));var n=this.__index__>=this.__values__.length,e=n?i:this.__values__[this.__index__++];return{done:n,value:e}}function o_(){return this}function a_(n){for(var e,t=this;t instanceof vr;){var r=Wl(t);r.__index__=0,r.__values__=i,e?u.__wrapped__=r:e=r;var u=r;t=t.__wrapped__}return u.__wrapped__=n,e}function l_(){var n=this.__wrapped__;if(n instanceof j){var e=n;return this.__actions__.length&&(e=new j(this)),e=e.reverse(),e.__actions__.push({func:Pr,args:[Xu],thisArg:i}),new Yn(e,this.__chain__)}return this.thru(Xu)}function s_(){return al(this.__wrapped__,this.__actions__)}var c_=br(function(n,e,t){tn.call(n,t)?++n[t]:pe(n,t,1)});function h_(n,e,t){var r=Z(n)?xa:tv;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}function p_(n,e){var t=Z(n)?Oe:Ka;return t(n,G(e,3))}var g_=yl(Bl),v_=yl(Ul);function d_(n,e){return An(Cr(n,e),1)}function __(n,e){return An(Cr(n,e),Nn)}function m_(n,e,t){return t=t===i?1:V(t),An(Cr(n,e),t)}function Vl(n,e){var t=Z(n)?Zn:Ee;return t(n,G(e,3))}function Yl(n,e){var t=Z(n)?$p:Ha;return t(n,G(e,3))}var y_=br(function(n,e,t){tn.call(n,t)?n[t].push(e):pe(n,t,[e])});function w_(n,e,t,r){n=qn(n)?n:ct(n),t=t&&!r?V(t):0;var u=n.length;return t<0&&(t=yn(u+t,0)),Nr(n)?t<=u&&n.indexOf(e,t)>-1:!!u&&ke(n,e,t)>-1}var x_=Q(function(n,e,t){var r=-1,u=typeof e=="function",a=qn(n)?x(n.length):[];return Ee(n,function(s){a[++r]=u?Dn(e,s,t):Rt(s,e,t)}),a}),b_=br(function(n,e,t){pe(n,t,e)});function Cr(n,e){var t=Z(n)?sn:Ja;return t(n,G(e,3))}function S_(n,e,t,r){return n==null?[]:(Z(e)||(e=e==null?[]:[e]),t=r?i:t,Z(t)||(t=t==null?[]:[t]),el(n,e,t))}var A_=br(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function O_(n,e,t){var r=Z(n)?lu:Oa,u=arguments.length<3;return r(n,G(e,4),t,u,Ee)}function T_(n,e,t){var r=Z(n)?Dp:Oa,u=arguments.length<3;return r(n,G(e,4),t,u,Ha)}function I_(n,e){var t=Z(n)?Oe:Ka;return t(n,Mr(G(e,3)))}function R_(n){var e=Z(n)?Ba:wv;return e(n)}function E_(n,e,t){(t?Rn(n,e,t):e===i)?e=1:e=V(e);var r=Z(n)?Jg:xv;return r(n,e)}function P_(n){var e=Z(n)?jg:Sv;return e(n)}function C_(n){if(n==null)return 0;if(qn(n))return Nr(n)?et(n):n.length;var e=Tn(n);return e==dn||e==_n?n.size:Ru(n).length}function L_(n,e,t){var r=Z(n)?su:Av;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}var q_=Q(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Rn(n,e[0],e[1])?e=[]:t>2&&Rn(e[0],e[1],e[2])&&(e=[e[0]]),el(n,An(e,1),[])}),Lr=pg||function(){return Sn.Date.now()};function M_(n,e){if(typeof e!="function")throw new Vn(g);return n=V(n),function(){if(--n<1)return e.apply(this,arguments)}}function Ql(n,e,t){return e=t?i:e,e=n&&e==null?n.length:e,ge(n,J,i,i,i,i,e)}function Xl(n,e){var t;if(typeof e!="function")throw new Vn(g);return n=V(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=i),t}}var ju=Q(function(n,e,t){var r=I;if(t.length){var u=Ie(t,lt(ju));r|=W}return ge(n,r,e,t,u)}),Jl=Q(function(n,e,t){var r=I|P;if(t.length){var u=Ie(t,lt(Jl));r|=W}return ge(e,r,n,t,u)});function jl(n,e,t){e=t?i:e;var r=ge(n,A,i,i,i,i,i,e);return r.placeholder=jl.placeholder,r}function kl(n,e,t){e=t?i:e;var r=ge(n,E,i,i,i,i,i,e);return r.placeholder=kl.placeholder,r}function ns(n,e,t){var r,u,a,s,c,v,O=0,T=!1,R=!1,N=!0;if(typeof n!="function")throw new Vn(g);e=jn(e)||0,hn(t)&&(T=!!t.leading,R="maxWait"in t,a=R?yn(jn(t.maxWait)||0,e):a,N="trailing"in t?!!t.trailing:N);function B(vn){var re=r,ye=u;return r=u=i,O=vn,s=n.apply(ye,re),s}function z(vn){return O=vn,c=qt(X,e),T?B(vn):s}function Y(vn){var re=vn-v,ye=vn-O,ys=e-re;return R?On(ys,a-ye):ys}function H(vn){var re=vn-v,ye=vn-O;return v===i||re>=e||re<0||R&&ye>=a}function X(){var vn=Lr();if(H(vn))return k(vn);c=qt(X,Y(vn))}function k(vn){return c=i,N&&r?B(vn):(r=u=i,s)}function Gn(){c!==i&&sl(c),O=0,r=v=u=c=i}function En(){return c===i?s:k(Lr())}function zn(){var vn=Lr(),re=H(vn);if(r=arguments,u=this,v=vn,re){if(c===i)return z(v);if(R)return sl(c),c=qt(X,e),B(v)}return c===i&&(c=qt(X,e)),s}return zn.cancel=Gn,zn.flush=En,zn}var F_=Q(function(n,e){return za(n,1,e)}),N_=Q(function(n,e,t){return za(n,jn(e)||0,t)});function $_(n){return ge(n,Pn)}function qr(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Vn(g);var t=function(){var r=arguments,u=e?e.apply(this,r):r[0],a=t.cache;if(a.has(u))return a.get(u);var s=n.apply(this,r);return t.cache=a.set(u,s)||a,s};return t.cache=new(qr.Cache||he),t}qr.Cache=he;function Mr(n){if(typeof n!="function")throw new Vn(g);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function D_(n){return Xl(2,n)}var W_=Ov(function(n,e){e=e.length==1&&Z(e[0])?sn(e[0],Wn(G())):sn(An(e,1),Wn(G()));var t=e.length;return Q(function(r){for(var u=-1,a=On(r.length,t);++u=e}),Ve=Ya(function(){return arguments}())?Ya:function(n){return pn(n)&&tn.call(n,"callee")&&!Ma.call(n,"callee")},Z=x.isArray,n0=va?Wn(va):av;function qn(n){return n!=null&&Fr(n.length)&&!_e(n)}function gn(n){return pn(n)&&qn(n)}function e0(n){return n===!0||n===!1||pn(n)&&In(n)==se}var qe=vg||cf,t0=da?Wn(da):lv;function r0(n){return pn(n)&&n.nodeType===1&&!Mt(n)}function i0(n){if(n==null)return!0;if(qn(n)&&(Z(n)||typeof n=="string"||typeof n.splice=="function"||qe(n)||st(n)||Ve(n)))return!n.length;var e=Tn(n);if(e==dn||e==_n)return!n.size;if(Lt(n))return!Ru(n).length;for(var t in n)if(tn.call(n,t))return!1;return!0}function u0(n,e){return Et(n,e)}function f0(n,e,t){t=typeof t=="function"?t:i;var r=t?t(n,e):i;return r===i?Et(n,e,i,t):!!r}function nf(n){if(!pn(n))return!1;var e=In(n);return e==ie||e==un||typeof n.message=="string"&&typeof n.name=="string"&&!Mt(n)}function o0(n){return typeof n=="number"&&Na(n)}function _e(n){if(!hn(n))return!1;var e=In(n);return e==xn||e==Se||e==dt||e==Yt}function ts(n){return typeof n=="number"&&n==V(n)}function Fr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wn}function hn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function pn(n){return n!=null&&typeof n=="object"}var rs=_a?Wn(_a):cv;function a0(n,e){return n===e||Iu(n,e,Hu(e))}function l0(n,e,t){return t=typeof t=="function"?t:i,Iu(n,e,Hu(e),t)}function s0(n){return is(n)&&n!=+n}function c0(n){if(Yv(n))throw new K(d);return Qa(n)}function h0(n){return n===null}function p0(n){return n==null}function is(n){return typeof n=="number"||pn(n)&&In(n)==Cn}function Mt(n){if(!pn(n)||In(n)!=Hn)return!1;var e=ar(n);if(e===null)return!0;var t=tn.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ir.call(t)==lg}var ef=ma?Wn(ma):hv;function g0(n){return ts(n)&&n>=-wn&&n<=wn}var us=ya?Wn(ya):pv;function Nr(n){return typeof n=="string"||!Z(n)&&pn(n)&&In(n)==kn}function Un(n){return typeof n=="symbol"||pn(n)&&In(n)==Qt}var st=wa?Wn(wa):gv;function v0(n){return n===i}function d0(n){return pn(n)&&Tn(n)==mt}function _0(n){return pn(n)&&In(n)==qh}var m0=Tr(Eu),y0=Tr(function(n,e){return n<=e});function fs(n){if(!n)return[];if(qn(n))return Nr(n)?ne(n):Ln(n);if(xt&&n[xt])return Jp(n[xt]());var e=Tn(n),t=e==dn?du:e==_n?er:ct;return t(n)}function me(n){if(!n)return n===0?n:0;if(n=jn(n),n===Nn||n===-Nn){var e=n<0?-1:1;return e*De}return n===n?n:0}function V(n){var e=me(n),t=e%1;return e===e?t?e-t:e:0}function os(n){return n?ze(V(n),0,$n):0}function jn(n){if(typeof n=="number")return n;if(Un(n))return ae;if(hn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=hn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Ta(n);var t=np.test(n);return t||tp.test(n)?Mp(n.slice(2),t?2:8):kh.test(n)?ae:+n}function as(n){return fe(n,Mn(n))}function w0(n){return n?ze(V(n),-wn,wn):n===0?n:0}function en(n){return n==null?"":Bn(n)}var x0=ot(function(n,e){if(Lt(e)||qn(e)){fe(e,bn(e),n);return}for(var t in e)tn.call(e,t)&&Tt(n,t,e[t])}),ls=ot(function(n,e){fe(e,Mn(e),n)}),$r=ot(function(n,e,t,r){fe(e,Mn(e),n,r)}),b0=ot(function(n,e,t,r){fe(e,bn(e),n,r)}),S0=ve(bu);function A0(n,e){var t=ft(n);return e==null?t:Ua(t,e)}var O0=Q(function(n,e){n=fn(n);var t=-1,r=e.length,u=r>2?e[2]:i;for(u&&Rn(e[0],e[1],u)&&(r=1);++t1),a}),fe(n,Gu(n),t),r&&(t=Qn(t,q|F|C,Nv));for(var u=e.length;u--;)Mu(t,e[u]);return t});function z0(n,e){return cs(n,Mr(G(e)))}var H0=ve(function(n,e){return n==null?{}:_v(n,e)});function cs(n,e){if(n==null)return{};var t=sn(Gu(n),function(r){return[r]});return e=G(e),tl(n,t,function(r,u){return e(r,u[0])})}function K0(n,e,t){e=Ce(e,n);var r=-1,u=e.length;for(u||(u=1,n=i);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var u=$a();return On(n+u*(e-n+qp("1e-"+((u+"").length-1))),e)}return Cu(n,e)}var t1=at(function(n,e,t){return e=e.toLowerCase(),n+(t?gs(e):e)});function gs(n){return uf(en(n).toLowerCase())}function vs(n){return n=en(n),n&&n.replace(ip,Zp).replace(Sp,"")}function r1(n,e,t){n=en(n),e=Bn(e);var r=n.length;t=t===i?r:ze(V(t),0,r);var u=t;return t-=e.length,t>=0&&n.slice(t,u)==e}function i1(n){return n=en(n),n&&Dh.test(n)?n.replace(Zo,Vp):n}function u1(n){return n=en(n),n&&Hh.test(n)?n.replace(ki,"\\$&"):n}var f1=at(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),o1=at(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),a1=ml("toLowerCase");function l1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;if(!e||r>=e)return n;var u=(e-r)/2;return Or(hr(u),t)+n+Or(cr(u),t)}function s1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;return e&&r>>0,t?(n=en(n),n&&(typeof e=="string"||e!=null&&!ef(e))&&(e=Bn(e),!e&&nt(n))?Le(ne(n),0,t):n.split(e,t)):[]}var _1=at(function(n,e,t){return n+(t?" ":"")+uf(e)});function m1(n,e,t){return n=en(n),t=t==null?0:ze(V(t),0,n.length),e=Bn(e),n.slice(t,t+e.length)==e}function y1(n,e,t){var r=o.templateSettings;t&&Rn(n,e,t)&&(e=i),n=en(n),e=$r({},e,r,Ol);var u=$r({},e.imports,r.imports,Ol),a=bn(u),s=vu(u,a),c,v,O=0,T=e.interpolate||Xt,R="__p += '",N=_u((e.escape||Xt).source+"|"+T.source+"|"+(T===Vo?jh:Xt).source+"|"+(e.evaluate||Xt).source+"|$","g"),B="//# sourceURL="+(tn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rp+"]")+` +`;n.replace(N,function(H,X,k,Gn,En,zn){return k||(k=Gn),R+=n.slice(O,zn).replace(up,Yp),X&&(c=!0,R+=`' + +__e(`+X+`) + +'`),En&&(v=!0,R+=`'; +`+En+`; +__p += '`),k&&(R+=`' + +((__t = (`+k+`)) == null ? '' : __t) + +'`),O=zn+H.length,H}),R+=`'; +`;var z=tn.call(e,"variable")&&e.variable;if(!z)R=`with (obj) { +`+R+` +} +`;else if(Xh.test(z))throw new K(y);R=(v?R.replace(Mh,""):R).replace(Fh,"$1").replace(Nh,"$1;"),R="function("+(z||"obj")+`) { +`+(z?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(c?", __e = _.escape":"")+(v?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+R+`return __p +}`;var Y=_s(function(){return nn(a,B+"return "+R).apply(i,s)});if(Y.source=R,nf(Y))throw Y;return Y}function w1(n){return en(n).toLowerCase()}function x1(n){return en(n).toUpperCase()}function b1(n,e,t){if(n=en(n),n&&(t||e===i))return Ta(n);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=ne(e),a=Ia(r,u),s=Ra(r,u)+1;return Le(r,a,s).join("")}function S1(n,e,t){if(n=en(n),n&&(t||e===i))return n.slice(0,Pa(n)+1);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Ra(r,ne(e))+1;return Le(r,0,u).join("")}function A1(n,e,t){if(n=en(n),n&&(t||e===i))return n.replace(nu,"");if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Ia(r,ne(e));return Le(r,u).join("")}function O1(n,e){var t=gt,r=Ht;if(hn(e)){var u="separator"in e?e.separator:u;t="length"in e?V(e.length):t,r="omission"in e?Bn(e.omission):r}n=en(n);var a=n.length;if(nt(n)){var s=ne(n);a=s.length}if(t>=a)return n;var c=t-et(r);if(c<1)return r;var v=s?Le(s,0,c).join(""):n.slice(0,c);if(u===i)return v+r;if(s&&(c+=v.length-c),ef(u)){if(n.slice(c).search(u)){var O,T=v;for(u.global||(u=_u(u.source,en(Yo.exec(u))+"g")),u.lastIndex=0;O=u.exec(T);)var R=O.index;v=v.slice(0,R===i?c:R)}}else if(n.indexOf(Bn(u),c)!=c){var N=v.lastIndexOf(u);N>-1&&(v=v.slice(0,N))}return v+r}function T1(n){return n=en(n),n&&$h.test(n)?n.replace(Ko,eg):n}var I1=at(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),uf=ml("toUpperCase");function ds(n,e,t){return n=en(n),e=t?i:e,e===i?Xp(n)?ig(n):Up(n):n.match(e)||[]}var _s=Q(function(n,e){try{return Dn(n,i,e)}catch(t){return nf(t)?t:new K(t)}}),R1=ve(function(n,e){return Zn(e,function(t){t=oe(t),pe(n,t,ju(n[t],n))}),n});function E1(n){var e=n==null?0:n.length,t=G();return n=e?sn(n,function(r){if(typeof r[1]!="function")throw new Vn(g);return[t(r[0]),r[1]]}):[],Q(function(r){for(var u=-1;++uwn)return[];var t=$n,r=On(n,$n);e=G(e),n-=$n;for(var u=gu(r,e);++t0||e<0)?new j(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==i&&(e=V(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},j.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},j.prototype.toArray=function(){return this.take($n)},ue(j.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),u=o[r?"take"+(e=="last"?"Right":""):e],a=r||/^find/.test(e);u&&(o.prototype[e]=function(){var s=this.__wrapped__,c=r?[1]:arguments,v=s instanceof j,O=c[0],T=v||Z(s),R=function(X){var k=u.apply(o,Te([X],c));return r&&N?k[0]:k};T&&t&&typeof O=="function"&&O.length!=1&&(v=T=!1);var N=this.__chain__,B=!!this.__actions__.length,z=a&&!N,Y=v&&!B;if(!a&&T){s=Y?s:new j(this);var H=n.apply(s,c);return H.__actions__.push({func:Pr,args:[R],thisArg:i}),new Yn(H,N)}return z&&Y?n.apply(this,c):(H=this.thru(R),z?r?H.value()[0]:H.value():H)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(n){var e=tr[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);o.prototype[n]=function(){var u=arguments;if(r&&!this.__chain__){var a=this.value();return e.apply(Z(a)?a:[],u)}return this[t](function(s){return e.apply(Z(s)?s:[],u)})}}),ue(j.prototype,function(n,e){var t=o[e];if(t){var r=t.name+"";tn.call(ut,r)||(ut[r]=[]),ut[r].push({name:e,func:t})}}),ut[Sr(i,P).name]=[{name:"wrapper",func:i}],j.prototype.clone=Tg,j.prototype.reverse=Ig,j.prototype.value=Rg,o.prototype.at=r_,o.prototype.chain=i_,o.prototype.commit=u_,o.prototype.next=f_,o.prototype.plant=a_,o.prototype.reverse=l_,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=s_,o.prototype.first=o.prototype.head,xt&&(o.prototype[xt]=o_),o},tt=ug();We?((We.exports=tt)._=tt,fu._=tt):Sn._=tt}).call(Ye)}(Ft,Ft.exports);var cn=Ft.exports;function Dr(f={},l){const i={};for(const h of Object.keys(f))i[h]=h==="$"?f[h]:l(f[h],h,f);return Object.setPrototypeOf(i,f)}var xs=function(){},bs=xs(),Me=function(f){return f!==bs&&f!==null},Ss=Me,As=Array.prototype.forEach,Os=Object.create,Ts=function(f,l){var i;for(i in f)l[i]=f[i]},hf=function(f){var l=Os(null);return As.call(arguments,function(i){Ss(i)&&Ts(Object(i),l)}),l},Is=function(){var f=Math.sign;return typeof f!="function"?!1:f(10)===1&&f(-20)===-1},Wr,pf;function Rs(){return pf||(pf=1,Wr=function(f){return f=Number(f),isNaN(f)||f===0?f:f>0?1:-1}),Wr}var Es=Is()?Math.sign:Rs(),Ps=Es,Cs=Math.abs,Ls=Math.floor,qs=function(f){return isNaN(f)?0:(f=Number(f),f===0||!isFinite(f)?f:Ps(f)*Ls(Cs(f)))},Ms=qs,Fs=Math.max,Fe=function(f){return Fs(0,Ms(f))},Ns=Fe,gf=function(f,l,i){var h;return isNaN(f)?(h=l,h>=0?i&&h?h-1:h:1):f===!1?!1:Ns(f)},we=function(f){if(typeof f!="function")throw new TypeError(f+" is not a function");return f},$s=Me,Qe=function(f){if(!$s(f))throw new TypeError("Cannot use null or undefined");return f},Ds=we,Ws=Qe,Bs=Function.prototype.bind,vf=Function.prototype.call,Us=Object.keys,Gs=Object.prototype.propertyIsEnumerable,zs=function(f,l){return function(i,h){var m,d=arguments[2],g=arguments[3];return i=Object(Ws(i)),Ds(h),m=Us(i),g&&m.sort(typeof g=="function"?Bs.call(g,i):void 0),typeof f!="function"&&(f=m[f]),vf.call(f,m,function(y,w){return Gs.call(i,y)?vf.call(h,d,i[y],y,i,w):l})}},Nt=zs("forEach"),Ne={},df={exports:{}},Hs=function(){var f=Object.assign,l;return typeof f!="function"?!1:(l={foo:"raz"},f(l,{bar:"dwa"},{trzy:"trzy"}),l.foo+l.bar+l.trzy==="razdwatrzy")},Br,_f;function Ks(){return _f||(_f=1,Br=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Br}var Ur,mf;function Zs(){if(mf)return Ur;mf=1;var f=Me,l=Object.keys;return Ur=function(i){return l(f(i)?Object(i):i)},Ur}var Gr,yf;function Vs(){return yf||(yf=1,Gr=Ks()()?Object.keys:Zs()),Gr}var zr,wf;function Ys(){if(wf)return zr;wf=1;var f=Vs(),l=Qe,i=Math.max;return zr=function(h,m){var d,g,y=i(arguments.length,2),w;for(h=Object(l(h)),w=function(_){try{h[_]=m[_]}catch(b){d||(d=b)}},g=1;g-1},Yr}var pc=cc()?String.prototype.contains:hc(),$t=Cf,qf=sc,Mf=xf,Ff=hf,ht=pc,gc=Pf.exports=function(f,l){var i,h,m,d,g;return arguments.length<2||typeof f!="string"?(d=l,l=f,f=null):d=arguments[2],$t(f)?(i=ht.call(f,"c"),h=ht.call(f,"e"),m=ht.call(f,"w")):(i=m=!0,h=!1),g={value:l,configurable:i,enumerable:h,writable:m},d?Mf(Ff(d),g):g};gc.gs=function(f,l,i){var h,m,d,g;return typeof f!="string"?(d=i,i=l,l=f,f=null):d=arguments[3],$t(l)?qf(l)?$t(i)?qf(i)||(d=i,i=void 0):i=void 0:(d=l,l=i=void 0):l=void 0,$t(f)?(h=ht.call(f,"c"),m=ht.call(f,"e")):(h=!0,m=!1),g={get:l,set:i,configurable:h,enumerable:m},d?Mf(Ff(d),g):g};var $e=Pf.exports,Qr={exports:{}};(function(f,l){var i=$e,h=we,m=Function.prototype.apply,d=Function.prototype.call,g=Object.create,y=Object.defineProperty,w=Object.defineProperties,_=Object.prototype.hasOwnProperty,b={configurable:!0,enumerable:!1,writable:!0},q,F,C,D,M,I,P;q=function(L,A){var E;return h(A),_.call(this,"__ee__")?E=this.__ee__:(E=b.value=g(null),y(this,"__ee__",b),b.value=null),E[L]?typeof E[L]=="object"?E[L].push(A):E[L]=[E[L],A]:E[L]=A,this},F=function(L,A){var E,W;return h(A),W=this,q.call(this,L,E=function(){C.call(W,L,E),m.call(A,this,arguments)}),E.__eeOnceListener__=A,this},C=function(L,A){var E,W,U,J;if(h(A),!_.call(this,"__ee__"))return this;if(E=this.__ee__,!E[L])return this;if(W=E[L],typeof W=="object")for(J=0;U=W[J];++J)(U===A||U.__eeOnceListener__===A)&&(W.length===2?E[L]=W[J?0:1]:W.splice(J,1));else(W===A||W.__eeOnceListener__===A)&&delete E[L];return this},D=function(L){var A,E,W,U,J;if(_.call(this,"__ee__")&&(U=this.__ee__[L],!!U))if(typeof U=="object"){for(E=arguments.length,J=new Array(E-1),A=1;A=55296&&E<=56319&&(rn+=F[++I])),rn=C?_.call(C,D,rn,P):rn,M?(b.value=rn,q(L,P,b)):L[P]=rn,++P;A=P}}if(A===void 0)for(A=h(F.length),M&&(L=new M(A)),I=0;I=0?b=g(b):b=l(this.length)-g(d(b)),w=b;w<_;++w)if(m.call(this,w)&&(q=this[w],f(q)))return w;return-1},xi}var Si,so;function eh(){if(so)return Si;so=1;var f=bi(),l=Object.create;return Si=function(){var i=0,h=[],m=l(null);return{get:function(d){var g=0,y=h,w,_=d.length;if(_===0)return y[_]||null;if(y=y[_]){for(;g<_-1;){if(w=f.call(y[0],d[g]),w===-1)return null;y=y[1][w],++g}return w=f.call(y[0],d[g]),w===-1?null:y[1][w]||null}return null},set:function(d){var g=0,y=h,w,_=d.length;if(_===0)y[_]=++i;else{for(y[_]||(y[_]=[[],[]]),y=y[_];g<_-1;)w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1,y[1].push([[],[]])),y=y[1][w],++g;w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1),y[1][w]=++i}return m[i]=d,i},delete:function(d){var g=0,y=h,w,_=m[d],b=_.length,q=[];if(b===0)delete y[b];else if(y=y[b]){for(;g"}},qi}var Mi,To;function lh(){if(To)return Mi;To=1;var f=ah(),l=/[\n\r\u2028\u2029]/g;return Mi=function(i){var h=f(i);return h.length>100&&(h=h.slice(0,99)+"…"),h=h.replace(l,function(m){return JSON.stringify(m).slice(1,-1)}),h},Mi}var Gt={exports:{}},Io;function Ro(){if(Io)return Gt.exports;Io=1,Gt.exports=f,Gt.exports.default=f;function f(l){return!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function"}return Gt.exports}var Eo;function sh(){if(Eo)return yo;Eo=1;var f=vo(),l=uh(),i=oh(),h=lh(),m=Ro(),d=Ri(),g=Object.create,y=l("then","then:finally","done","done:finally");return Ne.promise=function(w,_){var b=g(null),q=g(null),F=g(null);if(w===!0)w=null;else if(w=i(w),!y[w])throw new TypeError("'"+h(w)+"' is not valid promise mode");_.on("set",function(C,D,M){var I=!1;if(!m(M)){q[C]=M,_.emit("setasync",C,1);return}b[C]=1,F[C]=M;var P=function(W){var U=b[C];if(I)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) +Consider to rely on 'then' or 'done' mode instead.`);U&&(delete b[C],q[C]=W,_.emit("setasync",C,U))},L=function(){I=!0,b[C]&&(delete b[C],delete F[C],_.delete(C))},A=w;if(A||(A="then"),A==="then"){var E=function(){d(L)};M=M.then(function(W){d(P.bind(this,W))},E),typeof M.finally=="function"&&M.finally(E)}else if(A==="done"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");M.done(P,L)}else if(A==="done:finally"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof M.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");M.done(P),M.finally(L)}}),_.on("get",function(C,D,M){var I;if(b[C]){++b[C];return}I=F[C];var P=function(){_.emit("getasync",C,D,M)};m(I)?typeof I.done=="function"?I.done(P):I.then(function(){d(P)}):P()}),_.on("delete",function(C){if(delete F[C],b[C]){delete b[C];return}if(hasOwnProperty.call(q,C)){var D=q[C];delete q[C],_.emit("deleteasync",C,[D])}}),_.on("clear",function(){var C=q;q=g(null),b=g(null),F=g(null),_.emit("clearasync",f(C,function(D){return[D]}))})},yo}var Po={},Co;function ch(){if(Co)return Po;Co=1;var f=we,l=Nt,i=Ne,h=Function.prototype.apply;return i.dispose=function(m,d,g){var y;if(f(m),g.async&&i.async||g.promise&&i.promise){d.on("deleteasync",y=function(w,_){h.call(m,null,_)}),d.on("clearasync",function(w){l(w,function(_,b){y(b,_)})});return}d.on("delete",y=function(w,_){m(_)}),d.on("clear",function(w){l(w,function(_,b){y(b,_)})})},Po}var Lo={},Fi,qo;function hh(){return qo||(qo=1,Fi=2147483647),Fi}var Ni,Mo;function ph(){if(Mo)return Ni;Mo=1;var f=Fe,l=hh();return Ni=function(i){if(i=f(i),i>l)throw new TypeError(i+" exceeds maximum possible timeout");return i},Ni}var Fo;function gh(){if(Fo)return Lo;Fo=1;var f=pi(),l=Nt,i=Ri(),h=Ro(),m=ph(),d=Ne,g=Function.prototype,y=Math.max,w=Math.min,_=Object.create;return d.maxAge=function(b,q,F){var C,D,M,I;b=m(b),b&&(C=_(null),D=F.async&&d.async||F.promise&&d.promise?"async":"",q.on("set"+D,function(P){C[P]=setTimeout(function(){q.delete(P)},b),typeof C[P].unref=="function"&&C[P].unref(),I&&(I[P]&&I[P]!=="nextTick"&&clearTimeout(I[P]),I[P]=setTimeout(function(){delete I[P]},M),typeof I[P].unref=="function"&&I[P].unref())}),q.on("delete"+D,function(P){clearTimeout(C[P]),delete C[P],I&&(I[P]!=="nextTick"&&clearTimeout(I[P]),delete I[P])}),F.preFetch&&(F.preFetch===!0||isNaN(F.preFetch)?M=.333:M=y(w(Number(F.preFetch),1),0),M&&(I={},M=(1-M)*b,q.on("get"+D,function(P,L,A){I[P]||(I[P]="nextTick",i(function(){var E;I[P]==="nextTick"&&(delete I[P],q.delete(P),F.async&&(L=f(L),L.push(g)),E=q.memoized.apply(A,L),F.promise&&h(E)&&(typeof E.done=="function"?E.done(g,g):E.then(g,g)))}))}))),q.on("clear"+D,function(){l(C,function(P){clearTimeout(P)}),C={},I&&(l(I,function(P){P!=="nextTick"&&clearTimeout(P)}),I={})}))},Lo}var No={},$i,$o;function vh(){if($o)return $i;$o=1;var f=Fe,l=Object.create,i=Object.prototype.hasOwnProperty;return $i=function(h){var m=0,d=1,g=l(null),y=l(null),w=0,_;return h=f(h),{hit:function(b){var q=y[b],F=++w;if(g[F]=b,y[b]=F,!q)return++m,m<=h?void 0:(b=g[d],_(b),b);if(delete g[q],d===q)for(;!i.call(g,++d););},delete:_=function(b){var q=y[b];if(q&&(delete g[q],delete y[b],--m,d===q)){if(!m){w=0,d=1;return}for(;!i.call(g,++d););}},clear:function(){m=0,d=1,g=l(null),y=l(null),w=0}}},$i}var Do;function dh(){if(Do)return No;Do=1;var f=Fe,l=vh(),i=Ne;return i.max=function(h,m,d){var g,y,w;h=f(h),h&&(y=l(h),g=d.async&&i.async||d.promise&&i.promise?"async":"",m.on("set"+g,w=function(_){_=y.hit(_),_!==void 0&&m.delete(_)}),m.on("get"+g,w),m.on("delete"+g,y.delete),m.on("clear"+g,y.clear))},No}var Wo={},Bo;function _h(){if(Bo)return Wo;Bo=1;var f=$e,l=Ne,i=Object.create,h=Object.defineProperties;return l.refCounter=function(m,d,g){var y,w;y=i(null),w=g.async&&l.async||g.promise&&l.promise?"async":"",d.on("set"+w,function(_,b){y[_]=b||1}),d.on("get"+w,function(_){++y[_]}),d.on("delete"+w,function(_){delete y[_]}),d.on("clear"+w,function(){y={}}),h(d.memoized,{deleteRef:f(function(){var _=d.get(arguments);return _===null||!y[_]?null:--y[_]?!1:(d.delete(_),!0)}),getRefCount:f(function(){var _=d.get(arguments);return _===null||!y[_]?0:y[_]})})},Wo}var mh=hf,yh=gf,wh=Qc,xh=function(f){var l=mh(arguments[1]),i;return l.normalizer||(i=l.length=yh(l.length,f.length,l.async),i!==0&&(l.primitive?i===!1?l.normalizer=Xc():i>1&&(l.normalizer=Jc()(i)):i===!1?l.normalizer=eh()():i===1?l.normalizer=th()():l.normalizer=rh()(i))),l.async&&ih(),l.promise&&sh(),l.dispose&&ch(),l.maxAge&&gh(),l.max&&dh(),l.refCounter&&_h(),wh(f,l)},bh=ws(xh),Uo={exports:{}};(function(f,l){(function(i,h){f.exports=h()})(Ye,function(){return function(i){function h(d){if(m[d])return m[d].exports;var g=m[d]={i:d,l:!1,exports:{}};return i[d].call(g.exports,g,g.exports,h),g.l=!0,g.exports}var m={};return h.m=i,h.c=m,h.d=function(d,g,y){h.o(d,g)||Object.defineProperty(d,g,{configurable:!1,enumerable:!0,get:y})},h.n=function(d){var g=d&&d.__esModule?function(){return d.default}:function(){return d};return h.d(g,"a",g),g},h.o=function(d,g){return Object.prototype.hasOwnProperty.call(d,g)},h.p="",h(h.s=1)}([function(i,h,m){function d(y){var w=y===void 0?{}:y,_=w.ESCAPE,b=_===void 0?/^\\/:_,q=w.VARIABLE_START,F=q===void 0?/^\${\s*/:q,C=w.VARIABLE_END,D=C===void 0?/^\s*}/:C,M=w.PIPE_START,I=M===void 0?/^\s*\|\s*/:M,P=w.PIPE_PARAMETER_START,L=P===void 0?/^\s*:\s*/:P,A=w.QUOTED_STRING,E=A===void 0?h.DEFAULT_QUOTED_STRING_REGEX:A,W=w.QUOTED_STRING_TEST,U=W===void 0?null:W,J=w.QUOTED_STRING_GET_AND_ADVANCE,rn=J===void 0?null:J,Pn=w.QUOTED_STRING_IN_PARAMETER_TEST,gt=Pn===void 0?null:Pn,Ht=w.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,Bi=Ht===void 0?null:Ht,Kt=U||function(Nn){return E.test(Nn)},vt=rn||g(E),Ui=gt||function(Nn){return E.test(Nn)},Gi=Bi||g(E);return function(Nn){function wn(an){an===void 0&&(an=1),un=un.substr(an)}function De(an){an===void 0&&(an=/^/),wn(un.match(an)[0].length)}function ae(){var an;return De(b),an=un.length>0?un[0]:"",wn(),an}function $n(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;dn={name:"",pipes:[]},Hn=!kn}function zi(){ie.variables.push(dn),$n({isNull:!0})}function Zt(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Cn={name:"",parameters:[]},_t=!kn}function Vt(){dn.pipes.push(Cn),Zt({isNull:!0})}function le(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Ae="",Yt=!kn}function xe(){Cn.parameters.push(Ae),le({isNull:!0})}function dt(){return!!D.test(un)&&(De(D),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&zi(),xn=0,!0)}function se(){return!!I.test(un)&&(De(I),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&Zt(),xn=2,!0)}function be(){return!!L.test(un)&&(De(L),xn>=3&&xe(),xn>=2&&le(),xn=3,!0)}for(var un=Nn,ie={literals:[],variables:[]},xn=0,Se="",dn={name:"",pipes:[]},Cn={name:"",parameters:[]},Ae="",Hn=!1,_t=!1,Yt=!1;un&&un.length>0;)switch(xn){case 0:if(b.test(un)){Se+=ae();continue}if(F.test(un)){xn=1,$n(),ie.literals.push(Se),Se="",De(F);continue}Se+=un[0],wn();break;case 1:if(b.test(un)){dn.name+=ae();continue}if(dt()||se())continue;if(Kt(un)){dn.name+=vt(un,wn);continue}dn.name+=un[0],wn();break;case 2:if(b.test(un)){Cn.name+=ae();continue}if(dt()||be()||se())continue;if(Kt(un)){Cn.name+=vt(un,wn);continue}Cn.name+=un[0],wn();break;case 3:if(b.test(un)){Ae+=ae();continue}if(dt()||be()||se())continue;if(Ui(un)){Ae+=Gi(un,wn);continue}Ae+=un[0],wn()}return Yt&&Cn.parameters.push(Ae),_t&&dn.pipes.push(Cn),Hn&&ie.variables.push(dn),ie.literals.push(Se),ie}}function g(y){return function(w,_){var b=w.match(y);return _(b[0].length),b.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(h,"__esModule",{value:!0}),h.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,h.parseStringTemplateGenerator=d,h.parseStringTemplate=d(),h.getQuotedStringAndAdvanceForRegex=g},function(i,h,m){i.exports=m(2)},function(i,h,m){function d(g){for(var y in g)h.hasOwnProperty(y)||(h[y]=g[y])}Object.defineProperty(h,"__esModule",{value:!0}),d(m(0)),d(m(3))},function(i,h,m){function d(b){return function(q){return b.hasOwnProperty(q)?b[q]:q.split(".").reduce(function(F,C){return F.hasOwnProperty(C)?F[C]:""},b)}}function g(b,q,F,C){C===void 0&&(C=d(q));var D=C(b.name);return b.pipes.reduce(function(M,I){return F.hasOwnProperty(I.name)?F[I.name](M,I.parameters):M},D??"")}function y(b,q,F,C){return C===void 0&&(C=d(q)),b.literals.length===0?"":b.literals.slice(1).reduce(function(D,M,I){return""+D+g(b.variables[I],q,F,C)+M},b.literals[0])}function w(b,q,F){return y(_.parseStringTemplate(b),q,F)}Object.defineProperty(h,"__esModule",{value:!0});var _=m(0);h.evaluateParsedString=y,h.evaluateStringTemplate=w}])})})(Uo);var Go=Uo.exports;const zo=f=>{const l=Function("$",`return ${f};`);return i=>l(new Proxy(zt(i),{get(h,m){return typeof(h==null?void 0:h[m])=="function"?h[m]({}):h==null?void 0:h[m]}}))},Sh=/^\{\{\s*/,Ah=/^\s*\}\}/,Di=/\b\B/,Oh=Go.parseStringTemplateGenerator({VARIABLE_START:Sh,VARIABLE_END:Ah,PIPE_START:Di,PIPE_PARAMETER_START:Di,QUOTED_STRING:Di}),Th=bh(f=>{const l=Oh(f);return cn.join(l.literals,"")?i=>Go.evaluateParsedString(l,{},{},h=>zo(h)(i)):zo(l.variables[0].name)},{primitive:!0});function Xe(f){switch(f==null?void 0:f.constructor){case Array:{const l=cn.map(f,Xe);return i=>cn.map(l,h=>h(i))}case Object:{const l=cn.mapValues(f,Xe);return i=>cn.mapValues(l,h=>h(i))}case String:return Th(f);default:return()=>f}}function zt(f={}){return Dr(f,l=>cn.isFunction(l)?l:Xe(l))}function Ih(f={}){return new Proxy(f,{get:(l,i)=>typeof l[i]=="function"?l[i]:()=>l[i]})}function Wi(f,l){return Object.setPrototypeOf(Dr(l,i=>h=>i(f)),f)}function Rh(f){const{$for:l,...i}=f;if(l){const{$let:h="i",$from:m=0,$to:d=1,$step:g=1}=l,y=Xe(m),w=Xe(d),_=Xe(g);return(b={})=>cn.range(y(b),w(b),_(b)).map(q=>{const F=Wi(b,zt({[h]:q}));return Wi(F,zt(i))})}else return(h={})=>[Wi(h,zt(i))]}function Eh(f,l){const i=d=>{const{$:g}=d,y=Rh(d);return g in l?w=>cn.flatMap(y(w),_=>cn.flatMap(h[g],b=>b(_))):w=>cn.map(y(w),_=>Object.setPrototypeOf(Dr(_,b=>b(_)),null))},h=cn.mapValues(l,d=>cn.map(d,i)),m=cn.flatMap(f,i);return d=>cn.flatMap(m,g=>g(d))}const Ph=f=>f==null,Ho=f=>f.display!=="transient";function Ch({trace:f,context:l,view:i="main",from:h=0,to:m=(d=>(d=f==null?void 0:f.events)==null?void 0:d.length)()??0}){var q,F,C,D;const g=Eh(((C=(F=(q=f==null?void 0:f.render)==null?void 0:q.views)==null?void 0:F[i])==null?void 0:C.components)??[],((D=f==null?void 0:f.render)==null?void 0:D.components)??{}),y=M=>M&&Object.hasOwn(M,"alpha")?M.alpha>0:!0,w=M=>I=>({component:I,meta:{source:"trace",step:M,info:I.$info}}),_=cn.chain(f==null?void 0:f.events).map((M,I)=>({step:I,id:M.id,data:M,pId:M.pId})).groupBy("id").value(),b=cn.chain(cn.range(h,m)).map(M=>{var W;const I=f.events[M],P=f.events,L=g(Ih({alpha:1,...l,step:M,parent:Ph(I.pId)?void 0:P[((W=cn.findLast(_[I.pId],U=>U.step<=M))==null?void 0:W.step)??0],event:I,events:P})),A=L.filter(Ho),E=L.filter(cn.negate(Ho));return{persistent:A,transient:E}}).map(M=>cn.mapValues(M,I=>I.filter(y))).map((M,I)=>cn.mapValues(M,P=>P.map(w(h+I)))).value();return{stepsPersistent:cn.map(b,M=>M.persistent),stepsTransient:cn.map(b,M=>M.transient)}}onmessage=({data:f})=>{postMessage(Ch(f))}})(); diff --git a/assets/parseTraceSlave.worker-5d9eede9.js b/assets/parseTraceSlave.worker-5d9eede9.js deleted file mode 100644 index f2585035..00000000 --- a/assets/parseTraceSlave.worker-5d9eede9.js +++ /dev/null @@ -1,28 +0,0 @@ -(function(){"use strict";var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ms(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var Ft={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */Ft.exports,function(f,l){(function(){var i,h="4.17.21",m=200,d="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",y="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",_=500,b="__lodash_placeholder__",q=1,F=2,C=4,D=1,M=2,I=1,P=2,L=4,A=8,E=16,W=32,U=64,J=128,rn=256,Pn=512,gt=30,Ht="...",Wi=800,Kt=16,vt=1,Bi=2,Ui=3,Nn=1/0,wn=9007199254740991,De=17976931348623157e292,ae=0/0,$n=4294967295,Gi=$n-1,Zt=$n>>>1,Vt=[["ary",J],["bind",I],["bindKey",P],["curry",A],["curryRight",E],["flip",Pn],["partial",W],["partialRight",U],["rearg",rn]],le="[object Arguments]",xe="[object Array]",dt="[object AsyncFunction]",se="[object Boolean]",be="[object Date]",un="[object DOMException]",ie="[object Error]",xn="[object Function]",Se="[object GeneratorFunction]",dn="[object Map]",Cn="[object Number]",Ae="[object Null]",Hn="[object Object]",_t="[object Promise]",Yt="[object Proxy]",an="[object RegExp]",_n="[object Set]",kn="[object String]",Qt="[object Symbol]",Ph="[object Undefined]",mt="[object WeakMap]",Ch="[object WeakSet]",yt="[object ArrayBuffer]",Je="[object DataView]",zi="[object Float32Array]",Hi="[object Float64Array]",Ki="[object Int8Array]",Zi="[object Int16Array]",Vi="[object Int32Array]",Yi="[object Uint8Array]",Qi="[object Uint8ClampedArray]",Xi="[object Uint16Array]",Ji="[object Uint32Array]",Lh=/\b__p \+= '';/g,qh=/\b(__p \+=) '' \+/g,Mh=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zo=/&(?:amp|lt|gt|quot|#39);/g,Ho=/[&<>"']/g,Fh=RegExp(zo.source),Nh=RegExp(Ho.source),$h=/<%-([\s\S]+?)%>/g,Dh=/<%([\s\S]+?)%>/g,Ko=/<%=([\s\S]+?)%>/g,Wh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bh=/^\w*$/,Uh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ji=/[\\^$.*+?()[\]{}|]/g,Gh=RegExp(ji.source),ki=/^\s+/,zh=/\s/,Hh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Kh=/\{\n\/\* \[wrapped with (.+)\] \*/,Zh=/,? & /,Vh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Yh=/[()=,{}\[\]\/\s]/,Qh=/\\(\\)?/g,Xh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zo=/\w*$/,Jh=/^[-+]0x[0-9a-f]+$/i,jh=/^0b[01]+$/i,kh=/^\[object .+?Constructor\]$/,np=/^0o[0-7]+$/i,ep=/^(?:0|[1-9]\d*)$/,tp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,rp=/['\n\r\u2028\u2029\\]/g,Jt="\\ud800-\\udfff",ip="\\u0300-\\u036f",up="\\ufe20-\\ufe2f",fp="\\u20d0-\\u20ff",Vo=ip+up+fp,Yo="\\u2700-\\u27bf",Qo="a-z\\xdf-\\xf6\\xf8-\\xff",op="\\xac\\xb1\\xd7\\xf7",ap="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lp="\\u2000-\\u206f",sp=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xo="A-Z\\xc0-\\xd6\\xd8-\\xde",Jo="\\ufe0e\\ufe0f",jo=op+ap+lp+sp,nu="['’]",cp="["+Jt+"]",ko="["+jo+"]",jt="["+Vo+"]",na="\\d+",hp="["+Yo+"]",ea="["+Qo+"]",ta="[^"+Jt+jo+na+Yo+Qo+Xo+"]",eu="\\ud83c[\\udffb-\\udfff]",pp="(?:"+jt+"|"+eu+")",ra="[^"+Jt+"]",tu="(?:\\ud83c[\\udde6-\\uddff]){2}",ru="[\\ud800-\\udbff][\\udc00-\\udfff]",je="["+Xo+"]",ia="\\u200d",ua="(?:"+ea+"|"+ta+")",gp="(?:"+je+"|"+ta+")",fa="(?:"+nu+"(?:d|ll|m|re|s|t|ve))?",oa="(?:"+nu+"(?:D|LL|M|RE|S|T|VE))?",aa=pp+"?",la="["+Jo+"]?",vp="(?:"+ia+"(?:"+[ra,tu,ru].join("|")+")"+la+aa+")*",dp="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_p="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sa=la+aa+vp,mp="(?:"+[hp,tu,ru].join("|")+")"+sa,yp="(?:"+[ra+jt+"?",jt,tu,ru,cp].join("|")+")",wp=RegExp(nu,"g"),xp=RegExp(jt,"g"),iu=RegExp(eu+"(?="+eu+")|"+yp+sa,"g"),bp=RegExp([je+"?"+ea+"+"+fa+"(?="+[ko,je,"$"].join("|")+")",gp+"+"+oa+"(?="+[ko,je+ua,"$"].join("|")+")",je+"?"+ua+"+"+fa,je+"+"+oa,_p,dp,na,mp].join("|"),"g"),Sp=RegExp("["+ia+Jt+Vo+Jo+"]"),Ap=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Op=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tp=-1,ln={};ln[zi]=ln[Hi]=ln[Ki]=ln[Zi]=ln[Vi]=ln[Yi]=ln[Qi]=ln[Xi]=ln[Ji]=!0,ln[le]=ln[xe]=ln[yt]=ln[se]=ln[Je]=ln[be]=ln[ie]=ln[xn]=ln[dn]=ln[Cn]=ln[Hn]=ln[an]=ln[_n]=ln[kn]=ln[mt]=!1;var on={};on[le]=on[xe]=on[yt]=on[Je]=on[se]=on[be]=on[zi]=on[Hi]=on[Ki]=on[Zi]=on[Vi]=on[dn]=on[Cn]=on[Hn]=on[an]=on[_n]=on[kn]=on[Qt]=on[Yi]=on[Qi]=on[Xi]=on[Ji]=!0,on[ie]=on[xn]=on[mt]=!1;var Ip={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Rp={"&":"&","<":"<",">":">",'"':""","'":"'"},Ep={"&":"&","<":"<",">":">",""":'"',"'":"'"},Pp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cp=parseFloat,Lp=parseInt,ca=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,qp=typeof self=="object"&&self&&self.Object===Object&&self,Sn=ca||qp||Function("return this")(),uu=l&&!l.nodeType&&l,We=uu&&!0&&f&&!f.nodeType&&f,ha=We&&We.exports===uu,fu=ha&&ca.process,Kn=function(){try{var p=We&&We.require&&We.require("util").types;return p||fu&&fu.binding&&fu.binding("util")}catch{}}(),pa=Kn&&Kn.isArrayBuffer,ga=Kn&&Kn.isDate,va=Kn&&Kn.isMap,da=Kn&&Kn.isRegExp,_a=Kn&&Kn.isSet,ma=Kn&&Kn.isTypedArray;function Dn(p,S,x){switch(x.length){case 0:return p.call(S);case 1:return p.call(S,x[0]);case 2:return p.call(S,x[0],x[1]);case 3:return p.call(S,x[0],x[1],x[2])}return p.apply(S,x)}function Mp(p,S,x,$){for(var K=-1,nn=p==null?0:p.length;++K-1}function ou(p,S,x){for(var $=-1,K=p==null?0:p.length;++$-1;);return x}function Ta(p,S){for(var x=p.length;x--&&ke(S,p[x],0)>-1;);return x}function zp(p,S){for(var x=p.length,$=0;x--;)p[x]===S&&++$;return $}var Hp=cu(Ip),Kp=cu(Rp);function Zp(p){return"\\"+Pp[p]}function Vp(p,S){return p==null?i:p[S]}function nt(p){return Sp.test(p)}function Yp(p){return Ap.test(p)}function Qp(p){for(var S,x=[];!(S=p.next()).done;)x.push(S.value);return x}function vu(p){var S=-1,x=Array(p.size);return p.forEach(function($,K){x[++S]=[K,$]}),x}function Ia(p,S){return function(x){return p(S(x))}}function Ie(p,S){for(var x=-1,$=p.length,K=0,nn=[];++x<$;){var mn=p[x];(mn===S||mn===b)&&(p[x]=b,nn[K++]=x)}return nn}function er(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=$}),x}function Xp(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=[$,$]}),x}function Jp(p,S,x){for(var $=x-1,K=p.length;++$-1}function Ng(n,e){var t=this.__data__,r=dr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}ce.prototype.clear=Lg,ce.prototype.delete=qg,ce.prototype.get=Mg,ce.prototype.has=Fg,ce.prototype.set=Ng;function he(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Qn(n,e,t,r,u,a){var s,c=e&q,v=e&F,O=e&C;if(t&&(s=u?t(n,r,u,a):t(n)),s!==i)return s;if(!hn(n))return n;var T=Z(n);if(T){if(s=Bv(n),!c)return Ln(n,s)}else{var R=Tn(n),N=R==xn||R==Se;if(qe(n))return ll(n,c);if(R==Hn||R==le||N&&!u){if(s=v||N?{}:Rl(n),!c)return v?Ev(n,jg(s,n)):Rv(n,Wa(s,n))}else{if(!on[R])return u?n:{};s=Uv(n,R,c)}}a||(a=new ee);var B=a.get(n);if(B)return B;a.set(n,s),rs(n)?n.forEach(function(H){s.add(Qn(H,e,t,H,n,a))}):es(n)&&n.forEach(function(H,X){s.set(X,Qn(H,e,t,X,n,a))});var z=O?v?Uu:Bu:v?Mn:bn,Y=T?i:z(n);return Zn(Y||n,function(H,X){Y&&(X=H,H=n[X]),Tt(s,X,Qn(H,e,t,X,n,a))}),s}function kg(n){var e=bn(n);return function(t){return Ba(t,n,e)}}function Ba(n,e,t){var r=t.length;if(n==null)return!r;for(n=fn(n);r--;){var u=t[r],a=e[u],s=n[u];if(s===i&&!(u in n)||!a(s))return!1}return!0}function Ua(n,e,t){if(typeof n!="function")throw new Vn(g);return qt(function(){n.apply(i,t)},e)}function It(n,e,t,r){var u=-1,a=kt,s=!0,c=n.length,v=[],O=e.length;if(!c)return v;t&&(e=sn(e,Wn(t))),r?(a=ou,s=!1):e.length>=m&&(a=wt,s=!1,e=new Ge(e));n:for(;++uu?0:u+t),r=r===i||r>u?u:V(r),r<0&&(r+=u),r=t>r?0:us(r);t0&&t(c)?e>1?An(c,e-1,t,r,u):Te(u,c):r||(u[u.length]=c)}return u}var bu=vl(),Ha=vl(!0);function ue(n,e){return n&&bu(n,e,bn)}function Su(n,e){return n&&Ha(n,e,bn)}function mr(n,e){return Oe(e,function(t){return _e(n[t])})}function He(n,e){e=Ce(e,n);for(var t=0,r=e.length;n!=null&&te}function tv(n,e){return n!=null&&tn.call(n,e)}function rv(n,e){return n!=null&&e in fn(n)}function iv(n,e,t){return n>=On(e,t)&&n=120&&T.length>=120)?new Ge(s&&T):i}T=n[0];var R=-1,N=c[0];n:for(;++R-1;)c!==n&&lr.call(c,v,1),lr.call(n,v,1);return n}function el(n,e){for(var t=n?e.length:0,r=t-1;t--;){var u=e[t];if(t==r||u!==a){var a=u;de(u)?lr.call(n,u,1):qu(n,u)}}return n}function Pu(n,e){return n+hr(Fa()*(e-n+1))}function _v(n,e,t,r){for(var u=-1,a=yn(cr((e-n)/(t||1)),0),s=x(a);a--;)s[r?a:++u]=n,n+=t;return s}function Cu(n,e){var t="";if(!n||e<1||e>wn)return t;do e%2&&(t+=n),e=hr(e/2),e&&(n+=n);while(e);return t}function Q(n,e){return Yu(Cl(n,e,Fn),n+"")}function mv(n){return Da(ct(n))}function yv(n,e){var t=ct(n);return Er(t,ze(e,0,t.length))}function Pt(n,e,t,r){if(!hn(n))return n;e=Ce(e,n);for(var u=-1,a=e.length,s=a-1,c=n;c!=null&&++uu?0:u+e),t=t>u?u:t,t<0&&(t+=u),u=e>t?0:t-e>>>0,e>>>=0;for(var a=x(u);++r>>1,s=n[a];s!==null&&!Un(s)&&(t?s<=e:s=m){var O=e?null:qv(n);if(O)return er(O);s=!1,u=wt,v=new Ge}else v=e?[]:c;n:for(;++r=r?n:Xn(n,e,t)}var al=sg||function(n){return Sn.clearTimeout(n)};function ll(n,e){if(e)return n.slice();var t=n.length,r=Pa?Pa(t):new n.constructor(t);return n.copy(r),r}function $u(n){var e=new n.constructor(n.byteLength);return new or(e).set(new or(n)),e}function Av(n,e){var t=e?$u(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Ov(n){var e=new n.constructor(n.source,Zo.exec(n));return e.lastIndex=n.lastIndex,e}function Tv(n){return Ot?fn(Ot.call(n)):{}}function sl(n,e){var t=e?$u(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function cl(n,e){if(n!==e){var t=n!==i,r=n===null,u=n===n,a=Un(n),s=e!==i,c=e===null,v=e===e,O=Un(e);if(!c&&!O&&!a&&n>e||a&&s&&v&&!c&&!O||r&&s&&v||!t&&v||!u)return 1;if(!r&&!a&&!O&&n=c)return v;var O=t[r];return v*(O=="desc"?-1:1)}}return n.index-e.index}function hl(n,e,t,r){for(var u=-1,a=n.length,s=t.length,c=-1,v=e.length,O=yn(a-s,0),T=x(v+O),R=!r;++c1?t[u-1]:i,s=u>2?t[2]:i;for(a=n.length>3&&typeof a=="function"?(u--,a):i,s&&Rn(t[0],t[1],s)&&(a=u<3?i:a,u=1),e=fn(e);++r-1?u[a?e[s]:s]:i}}function ml(n){return ve(function(e){var t=e.length,r=t,u=Yn.prototype.thru;for(n&&e.reverse();r--;){var a=e[r];if(typeof a!="function")throw new Vn(g);if(u&&!s&&Ir(a)=="wrapper")var s=new Yn([],!0)}for(r=s?r:t;++r1&&k.reverse(),T&&vc))return!1;var O=a.get(n),T=a.get(e);if(O&&T)return O==e&&T==n;var R=-1,N=!0,B=t&M?new Ge:i;for(a.set(n,e),a.set(e,n);++R1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(Hh,`{ -/* [wrapped with `+e+`] */ -`)}function zv(n){return Z(n)||Ve(n)||!!(qa&&n&&n[qa])}function de(n,e){var t=typeof n;return e=e??wn,!!e&&(t=="number"||t!="symbol"&&ep.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Wi)return arguments[0]}else e=0;return n.apply(i,arguments)}}function Er(n,e){var t=-1,r=n.length,u=r-1;for(e=e===i?r:e;++t1?n[e-1]:i;return t=typeof t=="function"?(n.pop(),t):i,zl(n,t)});function Hl(n){var e=o(n);return e.__chain__=!0,e}function n_(n,e){return e(n),n}function Pr(n,e){return e(n)}var e_=ve(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,u=function(a){return xu(a,n)};return e>1||this.__actions__.length||!(r instanceof j)||!de(t)?this.thru(u):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:Pr,args:[u],thisArg:i}),new Yn(r,this.__chain__).thru(function(a){return e&&!a.length&&a.push(i),a}))});function t_(){return Hl(this)}function r_(){return new Yn(this.value(),this.__chain__)}function i_(){this.__values__===i&&(this.__values__=is(this.value()));var n=this.__index__>=this.__values__.length,e=n?i:this.__values__[this.__index__++];return{done:n,value:e}}function u_(){return this}function f_(n){for(var e,t=this;t instanceof vr;){var r=$l(t);r.__index__=0,r.__values__=i,e?u.__wrapped__=r:e=r;var u=r;t=t.__wrapped__}return u.__wrapped__=n,e}function o_(){var n=this.__wrapped__;if(n instanceof j){var e=n;return this.__actions__.length&&(e=new j(this)),e=e.reverse(),e.__actions__.push({func:Pr,args:[Qu],thisArg:i}),new Yn(e,this.__chain__)}return this.thru(Qu)}function a_(){return fl(this.__wrapped__,this.__actions__)}var l_=br(function(n,e,t){tn.call(n,t)?++n[t]:pe(n,t,1)});function s_(n,e,t){var r=Z(n)?ya:nv;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}function c_(n,e){var t=Z(n)?Oe:za;return t(n,G(e,3))}var h_=_l(Dl),p_=_l(Wl);function g_(n,e){return An(Cr(n,e),1)}function v_(n,e){return An(Cr(n,e),Nn)}function d_(n,e,t){return t=t===i?1:V(t),An(Cr(n,e),t)}function Kl(n,e){var t=Z(n)?Zn:Ee;return t(n,G(e,3))}function Zl(n,e){var t=Z(n)?Fp:Ga;return t(n,G(e,3))}var __=br(function(n,e,t){tn.call(n,t)?n[t].push(e):pe(n,t,[e])});function m_(n,e,t,r){n=qn(n)?n:ct(n),t=t&&!r?V(t):0;var u=n.length;return t<0&&(t=yn(u+t,0)),Nr(n)?t<=u&&n.indexOf(e,t)>-1:!!u&&ke(n,e,t)>-1}var y_=Q(function(n,e,t){var r=-1,u=typeof e=="function",a=qn(n)?x(n.length):[];return Ee(n,function(s){a[++r]=u?Dn(e,s,t):Rt(s,e,t)}),a}),w_=br(function(n,e,t){pe(n,t,e)});function Cr(n,e){var t=Z(n)?sn:Qa;return t(n,G(e,3))}function x_(n,e,t,r){return n==null?[]:(Z(e)||(e=e==null?[]:[e]),t=r?i:t,Z(t)||(t=t==null?[]:[t]),ka(n,e,t))}var b_=br(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function S_(n,e,t){var r=Z(n)?au:Sa,u=arguments.length<3;return r(n,G(e,4),t,u,Ee)}function A_(n,e,t){var r=Z(n)?Np:Sa,u=arguments.length<3;return r(n,G(e,4),t,u,Ga)}function O_(n,e){var t=Z(n)?Oe:za;return t(n,Mr(G(e,3)))}function T_(n){var e=Z(n)?Da:mv;return e(n)}function I_(n,e,t){(t?Rn(n,e,t):e===i)?e=1:e=V(e);var r=Z(n)?Qg:yv;return r(n,e)}function R_(n){var e=Z(n)?Xg:xv;return e(n)}function E_(n){if(n==null)return 0;if(qn(n))return Nr(n)?et(n):n.length;var e=Tn(n);return e==dn||e==_n?n.size:Iu(n).length}function P_(n,e,t){var r=Z(n)?lu:bv;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}var C_=Q(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Rn(n,e[0],e[1])?e=[]:t>2&&Rn(e[0],e[1],e[2])&&(e=[e[0]]),ka(n,An(e,1),[])}),Lr=cg||function(){return Sn.Date.now()};function L_(n,e){if(typeof e!="function")throw new Vn(g);return n=V(n),function(){if(--n<1)return e.apply(this,arguments)}}function Vl(n,e,t){return e=t?i:e,e=n&&e==null?n.length:e,ge(n,J,i,i,i,i,e)}function Yl(n,e){var t;if(typeof e!="function")throw new Vn(g);return n=V(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=i),t}}var Ju=Q(function(n,e,t){var r=I;if(t.length){var u=Ie(t,lt(Ju));r|=W}return ge(n,r,e,t,u)}),Ql=Q(function(n,e,t){var r=I|P;if(t.length){var u=Ie(t,lt(Ql));r|=W}return ge(e,r,n,t,u)});function Xl(n,e,t){e=t?i:e;var r=ge(n,A,i,i,i,i,i,e);return r.placeholder=Xl.placeholder,r}function Jl(n,e,t){e=t?i:e;var r=ge(n,E,i,i,i,i,i,e);return r.placeholder=Jl.placeholder,r}function jl(n,e,t){var r,u,a,s,c,v,O=0,T=!1,R=!1,N=!0;if(typeof n!="function")throw new Vn(g);e=jn(e)||0,hn(t)&&(T=!!t.leading,R="maxWait"in t,a=R?yn(jn(t.maxWait)||0,e):a,N="trailing"in t?!!t.trailing:N);function B(vn){var re=r,ye=u;return r=u=i,O=vn,s=n.apply(ye,re),s}function z(vn){return O=vn,c=qt(X,e),T?B(vn):s}function Y(vn){var re=vn-v,ye=vn-O,_s=e-re;return R?On(_s,a-ye):_s}function H(vn){var re=vn-v,ye=vn-O;return v===i||re>=e||re<0||R&&ye>=a}function X(){var vn=Lr();if(H(vn))return k(vn);c=qt(X,Y(vn))}function k(vn){return c=i,N&&r?B(vn):(r=u=i,s)}function Gn(){c!==i&&al(c),O=0,r=v=u=c=i}function En(){return c===i?s:k(Lr())}function zn(){var vn=Lr(),re=H(vn);if(r=arguments,u=this,v=vn,re){if(c===i)return z(v);if(R)return al(c),c=qt(X,e),B(v)}return c===i&&(c=qt(X,e)),s}return zn.cancel=Gn,zn.flush=En,zn}var q_=Q(function(n,e){return Ua(n,1,e)}),M_=Q(function(n,e,t){return Ua(n,jn(e)||0,t)});function F_(n){return ge(n,Pn)}function qr(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Vn(g);var t=function(){var r=arguments,u=e?e.apply(this,r):r[0],a=t.cache;if(a.has(u))return a.get(u);var s=n.apply(this,r);return t.cache=a.set(u,s)||a,s};return t.cache=new(qr.Cache||he),t}qr.Cache=he;function Mr(n){if(typeof n!="function")throw new Vn(g);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function N_(n){return Yl(2,n)}var $_=Sv(function(n,e){e=e.length==1&&Z(e[0])?sn(e[0],Wn(G())):sn(An(e,1),Wn(G()));var t=e.length;return Q(function(r){for(var u=-1,a=On(r.length,t);++u=e}),Ve=Za(function(){return arguments}())?Za:function(n){return pn(n)&&tn.call(n,"callee")&&!La.call(n,"callee")},Z=x.isArray,j_=pa?Wn(pa):fv;function qn(n){return n!=null&&Fr(n.length)&&!_e(n)}function gn(n){return pn(n)&&qn(n)}function k_(n){return n===!0||n===!1||pn(n)&&In(n)==se}var qe=pg||sf,n0=ga?Wn(ga):ov;function e0(n){return pn(n)&&n.nodeType===1&&!Mt(n)}function t0(n){if(n==null)return!0;if(qn(n)&&(Z(n)||typeof n=="string"||typeof n.splice=="function"||qe(n)||st(n)||Ve(n)))return!n.length;var e=Tn(n);if(e==dn||e==_n)return!n.size;if(Lt(n))return!Iu(n).length;for(var t in n)if(tn.call(n,t))return!1;return!0}function r0(n,e){return Et(n,e)}function i0(n,e,t){t=typeof t=="function"?t:i;var r=t?t(n,e):i;return r===i?Et(n,e,i,t):!!r}function ku(n){if(!pn(n))return!1;var e=In(n);return e==ie||e==un||typeof n.message=="string"&&typeof n.name=="string"&&!Mt(n)}function u0(n){return typeof n=="number"&&Ma(n)}function _e(n){if(!hn(n))return!1;var e=In(n);return e==xn||e==Se||e==dt||e==Yt}function ns(n){return typeof n=="number"&&n==V(n)}function Fr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wn}function hn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function pn(n){return n!=null&&typeof n=="object"}var es=va?Wn(va):lv;function f0(n,e){return n===e||Tu(n,e,zu(e))}function o0(n,e,t){return t=typeof t=="function"?t:i,Tu(n,e,zu(e),t)}function a0(n){return ts(n)&&n!=+n}function l0(n){if(Zv(n))throw new K(d);return Va(n)}function s0(n){return n===null}function c0(n){return n==null}function ts(n){return typeof n=="number"||pn(n)&&In(n)==Cn}function Mt(n){if(!pn(n)||In(n)!=Hn)return!1;var e=ar(n);if(e===null)return!0;var t=tn.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ir.call(t)==og}var nf=da?Wn(da):sv;function h0(n){return ns(n)&&n>=-wn&&n<=wn}var rs=_a?Wn(_a):cv;function Nr(n){return typeof n=="string"||!Z(n)&&pn(n)&&In(n)==kn}function Un(n){return typeof n=="symbol"||pn(n)&&In(n)==Qt}var st=ma?Wn(ma):hv;function p0(n){return n===i}function g0(n){return pn(n)&&Tn(n)==mt}function v0(n){return pn(n)&&In(n)==Ch}var d0=Tr(Ru),_0=Tr(function(n,e){return n<=e});function is(n){if(!n)return[];if(qn(n))return Nr(n)?ne(n):Ln(n);if(xt&&n[xt])return Qp(n[xt]());var e=Tn(n),t=e==dn?vu:e==_n?er:ct;return t(n)}function me(n){if(!n)return n===0?n:0;if(n=jn(n),n===Nn||n===-Nn){var e=n<0?-1:1;return e*De}return n===n?n:0}function V(n){var e=me(n),t=e%1;return e===e?t?e-t:e:0}function us(n){return n?ze(V(n),0,$n):0}function jn(n){if(typeof n=="number")return n;if(Un(n))return ae;if(hn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=hn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Aa(n);var t=jh.test(n);return t||np.test(n)?Lp(n.slice(2),t?2:8):Jh.test(n)?ae:+n}function fs(n){return fe(n,Mn(n))}function m0(n){return n?ze(V(n),-wn,wn):n===0?n:0}function en(n){return n==null?"":Bn(n)}var y0=ot(function(n,e){if(Lt(e)||qn(e)){fe(e,bn(e),n);return}for(var t in e)tn.call(e,t)&&Tt(n,t,e[t])}),os=ot(function(n,e){fe(e,Mn(e),n)}),$r=ot(function(n,e,t,r){fe(e,Mn(e),n,r)}),w0=ot(function(n,e,t,r){fe(e,bn(e),n,r)}),x0=ve(xu);function b0(n,e){var t=ft(n);return e==null?t:Wa(t,e)}var S0=Q(function(n,e){n=fn(n);var t=-1,r=e.length,u=r>2?e[2]:i;for(u&&Rn(e[0],e[1],u)&&(r=1);++t1),a}),fe(n,Uu(n),t),r&&(t=Qn(t,q|F|C,Mv));for(var u=e.length;u--;)qu(t,e[u]);return t});function U0(n,e){return ls(n,Mr(G(e)))}var G0=ve(function(n,e){return n==null?{}:vv(n,e)});function ls(n,e){if(n==null)return{};var t=sn(Uu(n),function(r){return[r]});return e=G(e),nl(n,t,function(r,u){return e(r,u[0])})}function z0(n,e,t){e=Ce(e,n);var r=-1,u=e.length;for(u||(u=1,n=i);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var u=Fa();return On(n+u*(e-n+Cp("1e-"+((u+"").length-1))),e)}return Pu(n,e)}var n1=at(function(n,e,t){return e=e.toLowerCase(),n+(t?hs(e):e)});function hs(n){return rf(en(n).toLowerCase())}function ps(n){return n=en(n),n&&n.replace(tp,Hp).replace(xp,"")}function e1(n,e,t){n=en(n),e=Bn(e);var r=n.length;t=t===i?r:ze(V(t),0,r);var u=t;return t-=e.length,t>=0&&n.slice(t,u)==e}function t1(n){return n=en(n),n&&Nh.test(n)?n.replace(Ho,Kp):n}function r1(n){return n=en(n),n&&Gh.test(n)?n.replace(ji,"\\$&"):n}var i1=at(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),u1=at(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),f1=dl("toLowerCase");function o1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;if(!e||r>=e)return n;var u=(e-r)/2;return Or(hr(u),t)+n+Or(cr(u),t)}function a1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;return e&&r>>0,t?(n=en(n),n&&(typeof e=="string"||e!=null&&!nf(e))&&(e=Bn(e),!e&&nt(n))?Le(ne(n),0,t):n.split(e,t)):[]}var v1=at(function(n,e,t){return n+(t?" ":"")+rf(e)});function d1(n,e,t){return n=en(n),t=t==null?0:ze(V(t),0,n.length),e=Bn(e),n.slice(t,t+e.length)==e}function _1(n,e,t){var r=o.templateSettings;t&&Rn(n,e,t)&&(e=i),n=en(n),e=$r({},e,r,Sl);var u=$r({},e.imports,r.imports,Sl),a=bn(u),s=gu(u,a),c,v,O=0,T=e.interpolate||Xt,R="__p += '",N=du((e.escape||Xt).source+"|"+T.source+"|"+(T===Ko?Xh:Xt).source+"|"+(e.evaluate||Xt).source+"|$","g"),B="//# sourceURL="+(tn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tp+"]")+` -`;n.replace(N,function(H,X,k,Gn,En,zn){return k||(k=Gn),R+=n.slice(O,zn).replace(rp,Zp),X&&(c=!0,R+=`' + -__e(`+X+`) + -'`),En&&(v=!0,R+=`'; -`+En+`; -__p += '`),k&&(R+=`' + -((__t = (`+k+`)) == null ? '' : __t) + -'`),O=zn+H.length,H}),R+=`'; -`;var z=tn.call(e,"variable")&&e.variable;if(!z)R=`with (obj) { -`+R+` -} -`;else if(Yh.test(z))throw new K(y);R=(v?R.replace(Lh,""):R).replace(qh,"$1").replace(Mh,"$1;"),R="function("+(z||"obj")+`) { -`+(z?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(c?", __e = _.escape":"")+(v?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+R+`return __p -}`;var Y=vs(function(){return nn(a,B+"return "+R).apply(i,s)});if(Y.source=R,ku(Y))throw Y;return Y}function m1(n){return en(n).toLowerCase()}function y1(n){return en(n).toUpperCase()}function w1(n,e,t){if(n=en(n),n&&(t||e===i))return Aa(n);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=ne(e),a=Oa(r,u),s=Ta(r,u)+1;return Le(r,a,s).join("")}function x1(n,e,t){if(n=en(n),n&&(t||e===i))return n.slice(0,Ra(n)+1);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Ta(r,ne(e))+1;return Le(r,0,u).join("")}function b1(n,e,t){if(n=en(n),n&&(t||e===i))return n.replace(ki,"");if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Oa(r,ne(e));return Le(r,u).join("")}function S1(n,e){var t=gt,r=Ht;if(hn(e)){var u="separator"in e?e.separator:u;t="length"in e?V(e.length):t,r="omission"in e?Bn(e.omission):r}n=en(n);var a=n.length;if(nt(n)){var s=ne(n);a=s.length}if(t>=a)return n;var c=t-et(r);if(c<1)return r;var v=s?Le(s,0,c).join(""):n.slice(0,c);if(u===i)return v+r;if(s&&(c+=v.length-c),nf(u)){if(n.slice(c).search(u)){var O,T=v;for(u.global||(u=du(u.source,en(Zo.exec(u))+"g")),u.lastIndex=0;O=u.exec(T);)var R=O.index;v=v.slice(0,R===i?c:R)}}else if(n.indexOf(Bn(u),c)!=c){var N=v.lastIndexOf(u);N>-1&&(v=v.slice(0,N))}return v+r}function A1(n){return n=en(n),n&&Fh.test(n)?n.replace(zo,kp):n}var O1=at(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),rf=dl("toUpperCase");function gs(n,e,t){return n=en(n),e=t?i:e,e===i?Yp(n)?tg(n):Wp(n):n.match(e)||[]}var vs=Q(function(n,e){try{return Dn(n,i,e)}catch(t){return ku(t)?t:new K(t)}}),T1=ve(function(n,e){return Zn(e,function(t){t=oe(t),pe(n,t,Ju(n[t],n))}),n});function I1(n){var e=n==null?0:n.length,t=G();return n=e?sn(n,function(r){if(typeof r[1]!="function")throw new Vn(g);return[t(r[0]),r[1]]}):[],Q(function(r){for(var u=-1;++uwn)return[];var t=$n,r=On(n,$n);e=G(e),n-=$n;for(var u=pu(r,e);++t0||e<0)?new j(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==i&&(e=V(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},j.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},j.prototype.toArray=function(){return this.take($n)},ue(j.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),u=o[r?"take"+(e=="last"?"Right":""):e],a=r||/^find/.test(e);u&&(o.prototype[e]=function(){var s=this.__wrapped__,c=r?[1]:arguments,v=s instanceof j,O=c[0],T=v||Z(s),R=function(X){var k=u.apply(o,Te([X],c));return r&&N?k[0]:k};T&&t&&typeof O=="function"&&O.length!=1&&(v=T=!1);var N=this.__chain__,B=!!this.__actions__.length,z=a&&!N,Y=v&&!B;if(!a&&T){s=Y?s:new j(this);var H=n.apply(s,c);return H.__actions__.push({func:Pr,args:[R],thisArg:i}),new Yn(H,N)}return z&&Y?n.apply(this,c):(H=this.thru(R),z?r?H.value()[0]:H.value():H)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(n){var e=tr[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);o.prototype[n]=function(){var u=arguments;if(r&&!this.__chain__){var a=this.value();return e.apply(Z(a)?a:[],u)}return this[t](function(s){return e.apply(Z(s)?s:[],u)})}}),ue(j.prototype,function(n,e){var t=o[e];if(t){var r=t.name+"";tn.call(ut,r)||(ut[r]=[]),ut[r].push({name:e,func:t})}}),ut[Sr(i,P).name]=[{name:"wrapper",func:i}],j.prototype.clone=Ag,j.prototype.reverse=Og,j.prototype.value=Tg,o.prototype.at=e_,o.prototype.chain=t_,o.prototype.commit=r_,o.prototype.next=i_,o.prototype.plant=f_,o.prototype.reverse=o_,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=a_,o.prototype.first=o.prototype.head,xt&&(o.prototype[xt]=u_),o},tt=rg();We?((We.exports=tt)._=tt,uu._=tt):Sn._=tt}).call(Ye)}(Ft,Ft.exports);var cn=Ft.exports;function Dr(f={},l){const i={};for(const h of Object.keys(f))i[h]=h==="$"?f[h]:l(f[h],h,f);return Object.setPrototypeOf(i,f)}var ys=function(){},ws=ys(),Me=function(f){return f!==ws&&f!==null},xs=Me,bs=Array.prototype.forEach,Ss=Object.create,As=function(f,l){var i;for(i in f)l[i]=f[i]},cf=function(f){var l=Ss(null);return bs.call(arguments,function(i){xs(i)&&As(Object(i),l)}),l},Os=function(){var f=Math.sign;return typeof f!="function"?!1:f(10)===1&&f(-20)===-1},Wr,hf;function Ts(){return hf||(hf=1,Wr=function(f){return f=Number(f),isNaN(f)||f===0?f:f>0?1:-1}),Wr}var Is=Os()?Math.sign:Ts(),Rs=Is,Es=Math.abs,Ps=Math.floor,Cs=function(f){return isNaN(f)?0:(f=Number(f),f===0||!isFinite(f)?f:Rs(f)*Ps(Es(f)))},Ls=Cs,qs=Math.max,Fe=function(f){return qs(0,Ls(f))},Ms=Fe,pf=function(f,l,i){var h;return isNaN(f)?(h=l,h>=0?i&&h?h-1:h:1):f===!1?!1:Ms(f)},we=function(f){if(typeof f!="function")throw new TypeError(f+" is not a function");return f},Fs=Me,Qe=function(f){if(!Fs(f))throw new TypeError("Cannot use null or undefined");return f},Ns=we,$s=Qe,Ds=Function.prototype.bind,gf=Function.prototype.call,Ws=Object.keys,Bs=Object.prototype.propertyIsEnumerable,Us=function(f,l){return function(i,h){var m,d=arguments[2],g=arguments[3];return i=Object($s(i)),Ns(h),m=Ws(i),g&&m.sort(typeof g=="function"?Ds.call(g,i):void 0),typeof f!="function"&&(f=m[f]),gf.call(f,m,function(y,w){return Bs.call(i,y)?gf.call(h,d,i[y],y,i,w):l})}},Nt=Us("forEach"),Ne={},vf={exports:{}},Gs=function(){var f=Object.assign,l;return typeof f!="function"?!1:(l={foo:"raz"},f(l,{bar:"dwa"},{trzy:"trzy"}),l.foo+l.bar+l.trzy==="razdwatrzy")},Br,df;function zs(){return df||(df=1,Br=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Br}var Ur,_f;function Hs(){if(_f)return Ur;_f=1;var f=Me,l=Object.keys;return Ur=function(i){return l(f(i)?Object(i):i)},Ur}var Gr,mf;function Ks(){return mf||(mf=1,Gr=zs()()?Object.keys:Hs()),Gr}var zr,yf;function Zs(){if(yf)return zr;yf=1;var f=Ks(),l=Qe,i=Math.max;return zr=function(h,m){var d,g,y=i(arguments.length,2),w;for(h=Object(l(h)),w=function(_){try{h[_]=m[_]}catch(b){d||(d=b)}},g=1;g-1},Yr}var cc=lc()?String.prototype.contains:sc(),$t=Pf,Lf=ac,qf=wf,Mf=cf,ht=cc,hc=Ef.exports=function(f,l){var i,h,m,d,g;return arguments.length<2||typeof f!="string"?(d=l,l=f,f=null):d=arguments[2],$t(f)?(i=ht.call(f,"c"),h=ht.call(f,"e"),m=ht.call(f,"w")):(i=m=!0,h=!1),g={value:l,configurable:i,enumerable:h,writable:m},d?qf(Mf(d),g):g};hc.gs=function(f,l,i){var h,m,d,g;return typeof f!="string"?(d=i,i=l,l=f,f=null):d=arguments[3],$t(l)?Lf(l)?$t(i)?Lf(i)||(d=i,i=void 0):i=void 0:(d=l,l=i=void 0):l=void 0,$t(f)?(h=ht.call(f,"c"),m=ht.call(f,"e")):(h=!0,m=!1),g={get:l,set:i,configurable:h,enumerable:m},d?qf(Mf(d),g):g};var $e=Ef.exports,Qr={exports:{}};(function(f,l){var i=$e,h=we,m=Function.prototype.apply,d=Function.prototype.call,g=Object.create,y=Object.defineProperty,w=Object.defineProperties,_=Object.prototype.hasOwnProperty,b={configurable:!0,enumerable:!1,writable:!0},q,F,C,D,M,I,P;q=function(L,A){var E;return h(A),_.call(this,"__ee__")?E=this.__ee__:(E=b.value=g(null),y(this,"__ee__",b),b.value=null),E[L]?typeof E[L]=="object"?E[L].push(A):E[L]=[E[L],A]:E[L]=A,this},F=function(L,A){var E,W;return h(A),W=this,q.call(this,L,E=function(){C.call(W,L,E),m.call(A,this,arguments)}),E.__eeOnceListener__=A,this},C=function(L,A){var E,W,U,J;if(h(A),!_.call(this,"__ee__"))return this;if(E=this.__ee__,!E[L])return this;if(W=E[L],typeof W=="object")for(J=0;U=W[J];++J)(U===A||U.__eeOnceListener__===A)&&(W.length===2?E[L]=W[J?0:1]:W.splice(J,1));else(W===A||W.__eeOnceListener__===A)&&delete E[L];return this},D=function(L){var A,E,W,U,J;if(_.call(this,"__ee__")&&(U=this.__ee__[L],!!U))if(typeof U=="object"){for(E=arguments.length,J=new Array(E-1),A=1;A=55296&&E<=56319&&(rn+=F[++I])),rn=C?_.call(C,D,rn,P):rn,M?(b.value=rn,q(L,P,b)):L[P]=rn,++P;A=P}}if(A===void 0)for(A=h(F.length),M&&(L=new M(A)),I=0;I=0?b=g(b):b=l(this.length)-g(d(b)),w=b;w<_;++w)if(m.call(this,w)&&(q=this[w],f(q)))return w;return-1},wi}var bi,ao;function kc(){if(ao)return bi;ao=1;var f=xi(),l=Object.create;return bi=function(){var i=0,h=[],m=l(null);return{get:function(d){var g=0,y=h,w,_=d.length;if(_===0)return y[_]||null;if(y=y[_]){for(;g<_-1;){if(w=f.call(y[0],d[g]),w===-1)return null;y=y[1][w],++g}return w=f.call(y[0],d[g]),w===-1?null:y[1][w]||null}return null},set:function(d){var g=0,y=h,w,_=d.length;if(_===0)y[_]=++i;else{for(y[_]||(y[_]=[[],[]]),y=y[_];g<_-1;)w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1,y[1].push([[],[]])),y=y[1][w],++g;w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1),y[1][w]=++i}return m[i]=d,i},delete:function(d){var g=0,y=h,w,_=m[d],b=_.length,q=[];if(b===0)delete y[b];else if(y=y[b]){for(;g"}},Li}var qi,Ao;function oh(){if(Ao)return qi;Ao=1;var f=fh(),l=/[\n\r\u2028\u2029]/g;return qi=function(i){var h=f(i);return h.length>100&&(h=h.slice(0,99)+"…"),h=h.replace(l,function(m){return JSON.stringify(m).slice(1,-1)}),h},qi}var Gt={exports:{}},Oo;function To(){if(Oo)return Gt.exports;Oo=1,Gt.exports=f,Gt.exports.default=f;function f(l){return!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function"}return Gt.exports}var Io;function ah(){if(Io)return _o;Io=1;var f=po(),l=rh(),i=uh(),h=oh(),m=To(),d=Ii(),g=Object.create,y=l("then","then:finally","done","done:finally");return Ne.promise=function(w,_){var b=g(null),q=g(null),F=g(null);if(w===!0)w=null;else if(w=i(w),!y[w])throw new TypeError("'"+h(w)+"' is not valid promise mode");_.on("set",function(C,D,M){var I=!1;if(!m(M)){q[C]=M,_.emit("setasync",C,1);return}b[C]=1,F[C]=M;var P=function(W){var U=b[C];if(I)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) -Consider to rely on 'then' or 'done' mode instead.`);U&&(delete b[C],q[C]=W,_.emit("setasync",C,U))},L=function(){I=!0,b[C]&&(delete b[C],delete F[C],_.delete(C))},A=w;if(A||(A="then"),A==="then"){var E=function(){d(L)};M=M.then(function(W){d(P.bind(this,W))},E),typeof M.finally=="function"&&M.finally(E)}else if(A==="done"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");M.done(P,L)}else if(A==="done:finally"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof M.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");M.done(P),M.finally(L)}}),_.on("get",function(C,D,M){var I;if(b[C]){++b[C];return}I=F[C];var P=function(){_.emit("getasync",C,D,M)};m(I)?typeof I.done=="function"?I.done(P):I.then(function(){d(P)}):P()}),_.on("delete",function(C){if(delete F[C],b[C]){delete b[C];return}if(hasOwnProperty.call(q,C)){var D=q[C];delete q[C],_.emit("deleteasync",C,[D])}}),_.on("clear",function(){var C=q;q=g(null),b=g(null),F=g(null),_.emit("clearasync",f(C,function(D){return[D]}))})},_o}var Ro={},Eo;function lh(){if(Eo)return Ro;Eo=1;var f=we,l=Nt,i=Ne,h=Function.prototype.apply;return i.dispose=function(m,d,g){var y;if(f(m),g.async&&i.async||g.promise&&i.promise){d.on("deleteasync",y=function(w,_){h.call(m,null,_)}),d.on("clearasync",function(w){l(w,function(_,b){y(b,_)})});return}d.on("delete",y=function(w,_){m(_)}),d.on("clear",function(w){l(w,function(_,b){y(b,_)})})},Ro}var Po={},Mi,Co;function sh(){return Co||(Co=1,Mi=2147483647),Mi}var Fi,Lo;function ch(){if(Lo)return Fi;Lo=1;var f=Fe,l=sh();return Fi=function(i){if(i=f(i),i>l)throw new TypeError(i+" exceeds maximum possible timeout");return i},Fi}var qo;function hh(){if(qo)return Po;qo=1;var f=hi,l=Nt,i=Ii(),h=To(),m=ch(),d=Ne,g=Function.prototype,y=Math.max,w=Math.min,_=Object.create;return d.maxAge=function(b,q,F){var C,D,M,I;b=m(b),b&&(C=_(null),D=F.async&&d.async||F.promise&&d.promise?"async":"",q.on("set"+D,function(P){C[P]=setTimeout(function(){q.delete(P)},b),typeof C[P].unref=="function"&&C[P].unref(),I&&(I[P]&&I[P]!=="nextTick"&&clearTimeout(I[P]),I[P]=setTimeout(function(){delete I[P]},M),typeof I[P].unref=="function"&&I[P].unref())}),q.on("delete"+D,function(P){clearTimeout(C[P]),delete C[P],I&&(I[P]!=="nextTick"&&clearTimeout(I[P]),delete I[P])}),F.preFetch&&(F.preFetch===!0||isNaN(F.preFetch)?M=.333:M=y(w(Number(F.preFetch),1),0),M&&(I={},M=(1-M)*b,q.on("get"+D,function(P,L,A){I[P]||(I[P]="nextTick",i(function(){var E;I[P]==="nextTick"&&(delete I[P],q.delete(P),F.async&&(L=f(L),L.push(g)),E=q.memoized.apply(A,L),F.promise&&h(E)&&(typeof E.done=="function"?E.done(g,g):E.then(g,g)))}))}))),q.on("clear"+D,function(){l(C,function(P){clearTimeout(P)}),C={},I&&(l(I,function(P){P!=="nextTick"&&clearTimeout(P)}),I={})}))},Po}var Mo={},Ni,Fo;function ph(){if(Fo)return Ni;Fo=1;var f=Fe,l=Object.create,i=Object.prototype.hasOwnProperty;return Ni=function(h){var m=0,d=1,g=l(null),y=l(null),w=0,_;return h=f(h),{hit:function(b){var q=y[b],F=++w;if(g[F]=b,y[b]=F,!q)return++m,m<=h?void 0:(b=g[d],_(b),b);if(delete g[q],d===q)for(;!i.call(g,++d););},delete:_=function(b){var q=y[b];if(q&&(delete g[q],delete y[b],--m,d===q)){if(!m){w=0,d=1;return}for(;!i.call(g,++d););}},clear:function(){m=0,d=1,g=l(null),y=l(null),w=0}}},Ni}var No;function gh(){if(No)return Mo;No=1;var f=Fe,l=ph(),i=Ne;return i.max=function(h,m,d){var g,y,w;h=f(h),h&&(y=l(h),g=d.async&&i.async||d.promise&&i.promise?"async":"",m.on("set"+g,w=function(_){_=y.hit(_),_!==void 0&&m.delete(_)}),m.on("get"+g,w),m.on("delete"+g,y.delete),m.on("clear"+g,y.clear))},Mo}var $o={},Do;function vh(){if(Do)return $o;Do=1;var f=$e,l=Ne,i=Object.create,h=Object.defineProperties;return l.refCounter=function(m,d,g){var y,w;y=i(null),w=g.async&&l.async||g.promise&&l.promise?"async":"",d.on("set"+w,function(_,b){y[_]=b||1}),d.on("get"+w,function(_){++y[_]}),d.on("delete"+w,function(_){delete y[_]}),d.on("clear"+w,function(){y={}}),h(d.memoized,{deleteRef:f(function(){var _=d.get(arguments);return _===null||!y[_]?null:--y[_]?!1:(d.delete(_),!0)}),getRefCount:f(function(){var _=d.get(arguments);return _===null||!y[_]?0:y[_]})})},$o}var dh=cf,_h=pf,mh=Vc,yh=function(f){var l=dh(arguments[1]),i;return l.normalizer||(i=l.length=_h(l.length,f.length,l.async),i!==0&&(l.primitive?i===!1?l.normalizer=Yc():i>1&&(l.normalizer=Qc()(i)):i===!1?l.normalizer=kc()():i===1?l.normalizer=nh()():l.normalizer=eh()(i))),l.async&&th(),l.promise&&ah(),l.dispose&&lh(),l.maxAge&&hh(),l.max&&gh(),l.refCounter&&vh(),mh(f,l)},wh=ms(yh),Wo={exports:{}};(function(f,l){(function(i,h){f.exports=h()})(Ye,function(){return function(i){function h(d){if(m[d])return m[d].exports;var g=m[d]={i:d,l:!1,exports:{}};return i[d].call(g.exports,g,g.exports,h),g.l=!0,g.exports}var m={};return h.m=i,h.c=m,h.d=function(d,g,y){h.o(d,g)||Object.defineProperty(d,g,{configurable:!1,enumerable:!0,get:y})},h.n=function(d){var g=d&&d.__esModule?function(){return d.default}:function(){return d};return h.d(g,"a",g),g},h.o=function(d,g){return Object.prototype.hasOwnProperty.call(d,g)},h.p="",h(h.s=1)}([function(i,h,m){function d(y){var w=y===void 0?{}:y,_=w.ESCAPE,b=_===void 0?/^\\/:_,q=w.VARIABLE_START,F=q===void 0?/^\${\s*/:q,C=w.VARIABLE_END,D=C===void 0?/^\s*}/:C,M=w.PIPE_START,I=M===void 0?/^\s*\|\s*/:M,P=w.PIPE_PARAMETER_START,L=P===void 0?/^\s*:\s*/:P,A=w.QUOTED_STRING,E=A===void 0?h.DEFAULT_QUOTED_STRING_REGEX:A,W=w.QUOTED_STRING_TEST,U=W===void 0?null:W,J=w.QUOTED_STRING_GET_AND_ADVANCE,rn=J===void 0?null:J,Pn=w.QUOTED_STRING_IN_PARAMETER_TEST,gt=Pn===void 0?null:Pn,Ht=w.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,Wi=Ht===void 0?null:Ht,Kt=U||function(Nn){return E.test(Nn)},vt=rn||g(E),Bi=gt||function(Nn){return E.test(Nn)},Ui=Wi||g(E);return function(Nn){function wn(an){an===void 0&&(an=1),un=un.substr(an)}function De(an){an===void 0&&(an=/^/),wn(un.match(an)[0].length)}function ae(){var an;return De(b),an=un.length>0?un[0]:"",wn(),an}function $n(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;dn={name:"",pipes:[]},Hn=!kn}function Gi(){ie.variables.push(dn),$n({isNull:!0})}function Zt(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Cn={name:"",parameters:[]},_t=!kn}function Vt(){dn.pipes.push(Cn),Zt({isNull:!0})}function le(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Ae="",Yt=!kn}function xe(){Cn.parameters.push(Ae),le({isNull:!0})}function dt(){return!!D.test(un)&&(De(D),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&Gi(),xn=0,!0)}function se(){return!!I.test(un)&&(De(I),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&Zt(),xn=2,!0)}function be(){return!!L.test(un)&&(De(L),xn>=3&&xe(),xn>=2&&le(),xn=3,!0)}for(var un=Nn,ie={literals:[],variables:[]},xn=0,Se="",dn={name:"",pipes:[]},Cn={name:"",parameters:[]},Ae="",Hn=!1,_t=!1,Yt=!1;un&&un.length>0;)switch(xn){case 0:if(b.test(un)){Se+=ae();continue}if(F.test(un)){xn=1,$n(),ie.literals.push(Se),Se="",De(F);continue}Se+=un[0],wn();break;case 1:if(b.test(un)){dn.name+=ae();continue}if(dt()||se())continue;if(Kt(un)){dn.name+=vt(un,wn);continue}dn.name+=un[0],wn();break;case 2:if(b.test(un)){Cn.name+=ae();continue}if(dt()||be()||se())continue;if(Kt(un)){Cn.name+=vt(un,wn);continue}Cn.name+=un[0],wn();break;case 3:if(b.test(un)){Ae+=ae();continue}if(dt()||be()||se())continue;if(Bi(un)){Ae+=Ui(un,wn);continue}Ae+=un[0],wn()}return Yt&&Cn.parameters.push(Ae),_t&&dn.pipes.push(Cn),Hn&&ie.variables.push(dn),ie.literals.push(Se),ie}}function g(y){return function(w,_){var b=w.match(y);return _(b[0].length),b.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(h,"__esModule",{value:!0}),h.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,h.parseStringTemplateGenerator=d,h.parseStringTemplate=d(),h.getQuotedStringAndAdvanceForRegex=g},function(i,h,m){i.exports=m(2)},function(i,h,m){function d(g){for(var y in g)h.hasOwnProperty(y)||(h[y]=g[y])}Object.defineProperty(h,"__esModule",{value:!0}),d(m(0)),d(m(3))},function(i,h,m){function d(b){return function(q){return b.hasOwnProperty(q)?b[q]:q.split(".").reduce(function(F,C){return F.hasOwnProperty(C)?F[C]:""},b)}}function g(b,q,F,C){C===void 0&&(C=d(q));var D=C(b.name);return b.pipes.reduce(function(M,I){return F.hasOwnProperty(I.name)?F[I.name](M,I.parameters):M},D??"")}function y(b,q,F,C){return C===void 0&&(C=d(q)),b.literals.length===0?"":b.literals.slice(1).reduce(function(D,M,I){return""+D+g(b.variables[I],q,F,C)+M},b.literals[0])}function w(b,q,F){return y(_.parseStringTemplate(b),q,F)}Object.defineProperty(h,"__esModule",{value:!0});var _=m(0);h.evaluateParsedString=y,h.evaluateStringTemplate=w}])})})(Wo);var Bo=Wo.exports;const Uo=f=>{const l=Function("$",`return ${f};`);return i=>l(new Proxy(zt(i),{get(h,m){return typeof(h==null?void 0:h[m])=="function"?h[m]({}):h==null?void 0:h[m]}}))},xh=/^\{\{\s*/,bh=/^\s*\}\}/,$i=/\b\B/,Sh=Bo.parseStringTemplateGenerator({VARIABLE_START:xh,VARIABLE_END:bh,PIPE_START:$i,PIPE_PARAMETER_START:$i,QUOTED_STRING:$i}),Ah=wh(f=>{const l=Sh(f);return cn.join(l.literals,"")?i=>Bo.evaluateParsedString(l,{},{},h=>Uo(h)(i)):Uo(l.variables[0].name)},{primitive:!0});function Xe(f){switch(f==null?void 0:f.constructor){case Array:{const l=cn.map(f,Xe);return i=>cn.map(l,h=>h(i))}case Object:{const l=cn.mapValues(f,Xe);return i=>cn.mapValues(l,h=>h(i))}case String:return Ah(f);default:return()=>f}}function zt(f={}){return Dr(f,l=>cn.isFunction(l)?l:Xe(l))}function Oh(f={}){return new Proxy(f,{get:(l,i)=>typeof l[i]=="function"?l[i]:()=>l[i]})}function Di(f,l){return Object.setPrototypeOf(Dr(l,i=>h=>i(f)),f)}function Th(f){const{$for:l,...i}=f;if(l){const{$let:h="i",$from:m=0,$to:d=1,$step:g=1}=l,y=Xe(m),w=Xe(d),_=Xe(g);return(b={})=>cn.range(y(b),w(b),_(b)).map(q=>{const F=Di(b,zt({[h]:q}));return Di(F,zt(i))})}else return(h={})=>[Di(h,zt(i))]}function Ih(f,l){const i=d=>{const{$:g}=d,y=Th(d);return g in l?w=>cn.flatMap(y(w),_=>cn.flatMap(h[g],b=>b(_))):w=>cn.map(y(w),_=>Object.setPrototypeOf(Dr(_,b=>b(_)),null))},h=cn.mapValues(l,d=>cn.map(d,i)),m=cn.flatMap(f,i);return d=>cn.flatMap(m,g=>g(d))}const Rh=f=>f==null,Go=f=>f.display!=="transient";function Eh({trace:f,context:l,view:i="main",from:h=0,to:m=(d=>(d=f==null?void 0:f.events)==null?void 0:d.length)()??0}){var q,F,C,D;const g=Ih(((C=(F=(q=f==null?void 0:f.render)==null?void 0:q.views)==null?void 0:F[i])==null?void 0:C.components)??[],((D=f==null?void 0:f.render)==null?void 0:D.components)??{}),y=M=>M&&Object.hasOwn(M,"alpha")?M.alpha>0:!0,w=M=>I=>({component:I,meta:{source:"trace",step:M,info:I.$info}}),_=cn.chain(f==null?void 0:f.events).map((M,I)=>({step:I,id:M.id,data:M,pId:M.pId})).groupBy("id").value(),b=cn.chain(cn.range(h,m)).map(M=>{var W;const I=f.events[M],P=f.events,L=g(Oh({alpha:1,...l,step:M,parent:Rh(I.pId)?void 0:P[((W=cn.findLast(_[I.pId],U=>U.step<=M))==null?void 0:W.step)??0],event:I,events:P})),A=L.filter(Go),E=L.filter(cn.negate(Go));return{persistent:A,transient:E}}).map(M=>cn.mapValues(M,I=>I.filter(y))).map((M,I)=>cn.mapValues(M,P=>P.map(w(h+I)))).value();return{stepsPersistent:cn.map(b,M=>M.persistent),stepsTransient:cn.map(b,M=>M.transient)}}onmessage=({data:f})=>{postMessage(Eh(f))}})(); diff --git a/index.html b/index.html index 43f9e56c..a336102a 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - +