File: //var/packages/UniversalViewer/target/dist/assets/index-DJ8vcah8.js
var Fn={},ri;function Ia(){if(ri)return Fn;ri=1,Fn.byteLength=l,Fn.toByteArray=s,Fn.fromByteArray=p;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,o=i.length;r<o;++r)e[r]=i[r],t[i.charCodeAt(r)]=r;t[45]=62,t[95]=63;function a(d){var m=d.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=d.indexOf("=");v===-1&&(v=m);var F=v===m?0:4-v%4;return[v,F]}function l(d){var m=a(d),v=m[0],F=m[1];return(v+F)*3/4-F}function u(d,m,v){return(m+v)*3/4-v}function s(d){var m,v=a(d),F=v[0],b=v[1],g=new n(u(d,F,b)),y=0,S=b>0?F-4:F,C;for(C=0;C<S;C+=4)m=t[d.charCodeAt(C)]<<18|t[d.charCodeAt(C+1)]<<12|t[d.charCodeAt(C+2)]<<6|t[d.charCodeAt(C+3)],g[y++]=m>>16&255,g[y++]=m>>8&255,g[y++]=m&255;return b===2&&(m=t[d.charCodeAt(C)]<<2|t[d.charCodeAt(C+1)]>>4,g[y++]=m&255),b===1&&(m=t[d.charCodeAt(C)]<<10|t[d.charCodeAt(C+1)]<<4|t[d.charCodeAt(C+2)]>>2,g[y++]=m>>8&255,g[y++]=m&255),g}function f(d){return e[d>>18&63]+e[d>>12&63]+e[d>>6&63]+e[d&63]}function h(d,m,v){for(var F,b=[],g=m;g<v;g+=3)F=(d[g]<<16&16711680)+(d[g+1]<<8&65280)+(d[g+2]&255),b.push(f(F));return b.join("")}function p(d){for(var m,v=d.length,F=v%3,b=[],g=16383,y=0,S=v-F;y<S;y+=g)b.push(h(d,y,y+g>S?S:y+g));return F===1?(m=d[v-1],b.push(e[m>>2]+e[m<<4&63]+"==")):F===2&&(m=(d[v-2]<<8)+d[v-1],b.push(e[m>>10]+e[m>>4&63]+e[m<<2&63]+"=")),b.join("")}return Fn}var it=Ia();function yn(e){let t=e.length;for(;--t>=0;)e[t]=0}const Ca=3,Da=258,Gr=29,Aa=256,Pa=Aa+1+Gr,Vr=30,Ea=512,Ta=new Array((Pa+2)*2);yn(Ta);const La=new Array(Vr*2);yn(La);const Oa=new Array(Ea);yn(Oa);const Ma=new Array(Da-Ca+1);yn(Ma);const wa=new Array(Gr);yn(wa);const Ra=new Array(Vr);yn(Ra);const Ba=(e,t,n,i)=>{let r=e&65535|0,o=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do r=r+t[i++]|0,o=o+r|0;while(--a);r%=65521,o%=65521}return r|o<<16|0};var Rt=Ba;const _a=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},za=new Uint32Array(_a()),Na=(e,t,n,i)=>{const r=za,o=i+n;e^=-1;for(let a=i;a<o;a++)e=e>>>8^r[(e^t[a])&255];return e^-1};var Oe=Na,Bt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},jr={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const Ua=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ga=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const i in n)Ua(n,i)&&(e[i]=n[i])}}return e},Va=e=>{let t=0;for(let i=0,r=e.length;i<r;i++)t+=e[i].length;const n=new Uint8Array(t);for(let i=0,r=0,o=e.length;i<o;i++){let a=e[i];n.set(a,r),r+=a.length}return n},Hr={assign:Ga,flattenChunks:Va};let Wr=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Wr=!1}const Mn=new Uint8Array(256);for(let e=0;e<256;e++)Mn[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Mn[254]=Mn[254]=1;var ja=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,i,r,o,a=e.length,l=0;for(r=0;r<a;r++)n=e.charCodeAt(r),(n&64512)===55296&&r+1<a&&(i=e.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(l),o=0,r=0;o<l;r++)n=e.charCodeAt(r),(n&64512)===55296&&r+1<a&&(i=e.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const Ha=(e,t)=>{if(t<65534&&e.subarray&&Wr)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n};var Wa=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let i,r;const o=new Array(n*2);for(r=0,i=0;i<n;){let a=e[i++];if(a<128){o[r++]=a;continue}let l=Mn[a];if(l>4){o[r++]=65533,i+=l-1;continue}for(a&=l===2?31:l===3?15:7;l>1&&i<n;)a=a<<6|e[i++]&63,l--;if(l>1){o[r++]=65533;continue}a<65536?o[r++]=a:(a-=65536,o[r++]=55296|a>>10&1023,o[r++]=56320|a&1023)}return Ha(o,r)},Xa=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Mn[e[n]]>t?n:t},_t={string2buf:ja,buf2string:Wa,utf8border:Xa};function Za(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Ya=Za;const zn=16209,qa=16191;var $a=function(t,n){let i,r,o,a,l,u,s,f,h,p,d,m,v,F,b,g,y,S,C,_,A,R,U,B;const z=t.state;i=t.next_in,U=t.input,r=i+(t.avail_in-5),o=t.next_out,B=t.output,a=o-(n-t.avail_out),l=o+(t.avail_out-257),u=z.dmax,s=z.wsize,f=z.whave,h=z.wnext,p=z.window,d=z.hold,m=z.bits,v=z.lencode,F=z.distcode,b=(1<<z.lenbits)-1,g=(1<<z.distbits)-1;e:do{m<15&&(d+=U[i++]<<m,m+=8,d+=U[i++]<<m,m+=8),y=v[d&b];n:for(;;){if(S=y>>>24,d>>>=S,m-=S,S=y>>>16&255,S===0)B[o++]=y&65535;else if(S&16){C=y&65535,S&=15,S&&(m<S&&(d+=U[i++]<<m,m+=8),C+=d&(1<<S)-1,d>>>=S,m-=S),m<15&&(d+=U[i++]<<m,m+=8,d+=U[i++]<<m,m+=8),y=F[d&g];t:for(;;){if(S=y>>>24,d>>>=S,m-=S,S=y>>>16&255,S&16){if(_=y&65535,S&=15,m<S&&(d+=U[i++]<<m,m+=8,m<S&&(d+=U[i++]<<m,m+=8)),_+=d&(1<<S)-1,_>u){t.msg="invalid distance too far back",z.mode=zn;break e}if(d>>>=S,m-=S,S=o-a,_>S){if(S=_-S,S>f&&z.sane){t.msg="invalid distance too far back",z.mode=zn;break e}if(A=0,R=p,h===0){if(A+=s-S,S<C){C-=S;do B[o++]=p[A++];while(--S);A=o-_,R=B}}else if(h<S){if(A+=s+h-S,S-=h,S<C){C-=S;do B[o++]=p[A++];while(--S);if(A=0,h<C){S=h,C-=S;do B[o++]=p[A++];while(--S);A=o-_,R=B}}}else if(A+=h-S,S<C){C-=S;do B[o++]=p[A++];while(--S);A=o-_,R=B}for(;C>2;)B[o++]=R[A++],B[o++]=R[A++],B[o++]=R[A++],C-=3;C&&(B[o++]=R[A++],C>1&&(B[o++]=R[A++]))}else{A=o-_;do B[o++]=B[A++],B[o++]=B[A++],B[o++]=B[A++],C-=3;while(C>2);C&&(B[o++]=B[A++],C>1&&(B[o++]=B[A++]))}}else if((S&64)===0){y=F[(y&65535)+(d&(1<<S)-1)];continue t}else{t.msg="invalid distance code",z.mode=zn;break e}break}}else if((S&64)===0){y=v[(y&65535)+(d&(1<<S)-1)];continue n}else if(S&32){z.mode=qa;break e}else{t.msg="invalid literal/length code",z.mode=zn;break e}break}}while(i<r&&o<l);C=m>>3,i-=C,m-=C<<3,d&=(1<<m)-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?5+(r-i):5-(i-r),t.avail_out=o<l?257+(l-o):257-(o-l),z.hold=d,z.bits=m};const sn=15,oi=852,ai=592,li=0,vt=1,si=2,Ka=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ja=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Qa=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),el=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),nl=(e,t,n,i,r,o,a,l)=>{const u=l.bits;let s=0,f=0,h=0,p=0,d=0,m=0,v=0,F=0,b=0,g=0,y,S,C,_,A,R=null,U;const B=new Uint16Array(sn+1),z=new Uint16Array(sn+1);let re=null,de,te,ue;for(s=0;s<=sn;s++)B[s]=0;for(f=0;f<i;f++)B[t[n+f]]++;for(d=u,p=sn;p>=1&&B[p]===0;p--);if(d>p&&(d=p),p===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,l.bits=1,0;for(h=1;h<p&&B[h]===0;h++);for(d<h&&(d=h),F=1,s=1;s<=sn;s++)if(F<<=1,F-=B[s],F<0)return-1;if(F>0&&(e===li||p!==1))return-1;for(z[1]=0,s=1;s<sn;s++)z[s+1]=z[s]+B[s];for(f=0;f<i;f++)t[n+f]!==0&&(a[z[t[n+f]]++]=f);if(e===li?(R=re=a,U=20):e===vt?(R=Ka,re=Ja,U=257):(R=Qa,re=el,U=0),g=0,f=0,s=h,A=o,m=d,v=0,C=-1,b=1<<d,_=b-1,e===vt&&b>oi||e===si&&b>ai)return 1;for(;;){de=s-v,a[f]+1<U?(te=0,ue=a[f]):a[f]>=U?(te=re[a[f]-U],ue=R[a[f]-U]):(te=96,ue=0),y=1<<s-v,S=1<<m,h=S;do S-=y,r[A+(g>>v)+S]=de<<24|te<<16|ue|0;while(S!==0);for(y=1<<s-1;g&y;)y>>=1;if(y!==0?(g&=y-1,g+=y):g=0,f++,--B[s]===0){if(s===p)break;s=t[n+a[f]]}if(s>d&&(g&_)!==C){for(v===0&&(v=d),A+=h,m=s-v,F=1<<m;m+v<p&&(F-=B[m+v],!(F<=0));)m++,F<<=1;if(b+=1<<m,e===vt&&b>oi||e===si&&b>ai)return 1;C=g&_,r[C]=d<<24|m<<16|A-o|0}}return g!==0&&(r[A+g]=s-v<<24|64<<16|0),l.bits=d,0};var Pn=nl;const tl=0,Xr=1,Zr=2,{Z_FINISH:ui,Z_BLOCK:il,Z_TREES:Nn,Z_OK:tn,Z_STREAM_END:rl,Z_NEED_DICT:ol,Z_STREAM_ERROR:Ce,Z_DATA_ERROR:Yr,Z_MEM_ERROR:qr,Z_BUF_ERROR:al,Z_DEFLATED:fi}=jr,ut=16180,ci=16181,di=16182,hi=16183,pi=16184,vi=16185,mi=16186,gi=16187,bi=16188,yi=16189,rt=16190,Re=16191,mt=16192,Si=16193,gt=16194,Fi=16195,xi=16196,ki=16197,Ii=16198,Un=16199,Gn=16200,Ci=16201,Di=16202,Ai=16203,Pi=16204,Ei=16205,bt=16206,Ti=16207,Li=16208,ne=16209,$r=16210,Kr=16211,ll=852,sl=592,ul=15,fl=ul,Oi=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function cl(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const on=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<ut||t.mode>Kr?1:0},Jr=e=>{if(on(e))return Ce;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=ut,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ll),t.distcode=t.distdyn=new Int32Array(sl),t.sane=1,t.back=-1,tn},Qr=e=>{if(on(e))return Ce;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Jr(e)},eo=(e,t)=>{let n;if(on(e))return Ce;const i=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Ce:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,Qr(e))},no=(e,t)=>{if(!e)return Ce;const n=new cl;e.state=n,n.strm=e,n.window=null,n.mode=ut;const i=eo(e,t);return i!==tn&&(e.state=null),i},dl=e=>no(e,fl);let Mi=!0,yt,St;const hl=e=>{if(Mi){yt=new Int32Array(512),St=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Pn(Xr,e.lens,0,288,yt,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Pn(Zr,e.lens,0,32,St,0,e.work,{bits:5}),Mi=!1}e.lencode=yt,e.lenbits=9,e.distcode=St,e.distbits=5},to=(e,t,n,i)=>{let r;const o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),i>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>i&&(r=i),o.window.set(t.subarray(n-i,n-i+r),o.wnext),i-=r,i?(o.window.set(t.subarray(n-i,n),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},pl=(e,t)=>{let n,i,r,o,a,l,u,s,f,h,p,d,m,v,F=0,b,g,y,S,C,_,A,R;const U=new Uint8Array(4);let B,z;const re=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(on(e)||!e.output||!e.input&&e.avail_in!==0)return Ce;n=e.state,n.mode===Re&&(n.mode=mt),a=e.next_out,r=e.output,u=e.avail_out,o=e.next_in,i=e.input,l=e.avail_in,s=n.hold,f=n.bits,h=l,p=u,R=tn;e:for(;;)switch(n.mode){case ut:if(n.wrap===0){n.mode=mt;break}for(;f<16;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if(n.wrap&2&&s===35615){n.wbits===0&&(n.wbits=15),n.check=0,U[0]=s&255,U[1]=s>>>8&255,n.check=Oe(n.check,U,2,0),s=0,f=0,n.mode=ci;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((s&255)<<8)+(s>>8))%31){e.msg="incorrect header check",n.mode=ne;break}if((s&15)!==fi){e.msg="unknown compression method",n.mode=ne;break}if(s>>>=4,f-=4,A=(s&15)+8,n.wbits===0&&(n.wbits=A),A>15||A>n.wbits){e.msg="invalid window size",n.mode=ne;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=s&512?yi:Re,s=0,f=0;break;case ci:for(;f<16;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if(n.flags=s,(n.flags&255)!==fi){e.msg="unknown compression method",n.mode=ne;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=ne;break}n.head&&(n.head.text=s>>8&1),n.flags&512&&n.wrap&4&&(U[0]=s&255,U[1]=s>>>8&255,n.check=Oe(n.check,U,2,0)),s=0,f=0,n.mode=di;case di:for(;f<32;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}n.head&&(n.head.time=s),n.flags&512&&n.wrap&4&&(U[0]=s&255,U[1]=s>>>8&255,U[2]=s>>>16&255,U[3]=s>>>24&255,n.check=Oe(n.check,U,4,0)),s=0,f=0,n.mode=hi;case hi:for(;f<16;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}n.head&&(n.head.xflags=s&255,n.head.os=s>>8),n.flags&512&&n.wrap&4&&(U[0]=s&255,U[1]=s>>>8&255,n.check=Oe(n.check,U,2,0)),s=0,f=0,n.mode=pi;case pi:if(n.flags&1024){for(;f<16;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}n.length=s,n.head&&(n.head.extra_len=s),n.flags&512&&n.wrap&4&&(U[0]=s&255,U[1]=s>>>8&255,n.check=Oe(n.check,U,2,0)),s=0,f=0}else n.head&&(n.head.extra=null);n.mode=vi;case vi:if(n.flags&1024&&(d=n.length,d>l&&(d=l),d&&(n.head&&(A=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(o,o+d),A)),n.flags&512&&n.wrap&4&&(n.check=Oe(n.check,i,d,o)),l-=d,o+=d,n.length-=d),n.length))break e;n.length=0,n.mode=mi;case mi:if(n.flags&2048){if(l===0)break e;d=0;do A=i[o+d++],n.head&&A&&n.length<65536&&(n.head.name+=String.fromCharCode(A));while(A&&d<l);if(n.flags&512&&n.wrap&4&&(n.check=Oe(n.check,i,d,o)),l-=d,o+=d,A)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=gi;case gi:if(n.flags&4096){if(l===0)break e;d=0;do A=i[o+d++],n.head&&A&&n.length<65536&&(n.head.comment+=String.fromCharCode(A));while(A&&d<l);if(n.flags&512&&n.wrap&4&&(n.check=Oe(n.check,i,d,o)),l-=d,o+=d,A)break e}else n.head&&(n.head.comment=null);n.mode=bi;case bi:if(n.flags&512){for(;f<16;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if(n.wrap&4&&s!==(n.check&65535)){e.msg="header crc mismatch",n.mode=ne;break}s=0,f=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Re;break;case yi:for(;f<32;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}e.adler=n.check=Oi(s),s=0,f=0,n.mode=rt;case rt:if(n.havedict===0)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=l,n.hold=s,n.bits=f,ol;e.adler=n.check=1,n.mode=Re;case Re:if(t===il||t===Nn)break e;case mt:if(n.last){s>>>=f&7,f-=f&7,n.mode=bt;break}for(;f<3;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}switch(n.last=s&1,s>>>=1,f-=1,s&3){case 0:n.mode=Si;break;case 1:if(hl(n),n.mode=Un,t===Nn){s>>>=2,f-=2;break e}break;case 2:n.mode=xi;break;case 3:e.msg="invalid block type",n.mode=ne}s>>>=2,f-=2;break;case Si:for(s>>>=f&7,f-=f&7;f<32;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if((s&65535)!==(s>>>16^65535)){e.msg="invalid stored block lengths",n.mode=ne;break}if(n.length=s&65535,s=0,f=0,n.mode=gt,t===Nn)break e;case gt:n.mode=Fi;case Fi:if(d=n.length,d){if(d>l&&(d=l),d>u&&(d=u),d===0)break e;r.set(i.subarray(o,o+d),a),l-=d,o+=d,u-=d,a+=d,n.length-=d;break}n.mode=Re;break;case xi:for(;f<14;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if(n.nlen=(s&31)+257,s>>>=5,f-=5,n.ndist=(s&31)+1,s>>>=5,f-=5,n.ncode=(s&15)+4,s>>>=4,f-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ne;break}n.have=0,n.mode=ki;case ki:for(;n.have<n.ncode;){for(;f<3;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}n.lens[re[n.have++]]=s&7,s>>>=3,f-=3}for(;n.have<19;)n.lens[re[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,B={bits:n.lenbits},R=Pn(tl,n.lens,0,19,n.lencode,0,n.work,B),n.lenbits=B.bits,R){e.msg="invalid code lengths set",n.mode=ne;break}n.have=0,n.mode=Ii;case Ii:for(;n.have<n.nlen+n.ndist;){for(;F=n.lencode[s&(1<<n.lenbits)-1],b=F>>>24,g=F>>>16&255,y=F&65535,!(b<=f);){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if(y<16)s>>>=b,f-=b,n.lens[n.have++]=y;else{if(y===16){for(z=b+2;f<z;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if(s>>>=b,f-=b,n.have===0){e.msg="invalid bit length repeat",n.mode=ne;break}A=n.lens[n.have-1],d=3+(s&3),s>>>=2,f-=2}else if(y===17){for(z=b+3;f<z;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}s>>>=b,f-=b,A=0,d=3+(s&7),s>>>=3,f-=3}else{for(z=b+7;f<z;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}s>>>=b,f-=b,A=0,d=11+(s&127),s>>>=7,f-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ne;break}for(;d--;)n.lens[n.have++]=A}}if(n.mode===ne)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ne;break}if(n.lenbits=9,B={bits:n.lenbits},R=Pn(Xr,n.lens,0,n.nlen,n.lencode,0,n.work,B),n.lenbits=B.bits,R){e.msg="invalid literal/lengths set",n.mode=ne;break}if(n.distbits=6,n.distcode=n.distdyn,B={bits:n.distbits},R=Pn(Zr,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,B),n.distbits=B.bits,R){e.msg="invalid distances set",n.mode=ne;break}if(n.mode=Un,t===Nn)break e;case Un:n.mode=Gn;case Gn:if(l>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=l,n.hold=s,n.bits=f,$a(e,p),a=e.next_out,r=e.output,u=e.avail_out,o=e.next_in,i=e.input,l=e.avail_in,s=n.hold,f=n.bits,n.mode===Re&&(n.back=-1);break}for(n.back=0;F=n.lencode[s&(1<<n.lenbits)-1],b=F>>>24,g=F>>>16&255,y=F&65535,!(b<=f);){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if(g&&(g&240)===0){for(S=b,C=g,_=y;F=n.lencode[_+((s&(1<<S+C)-1)>>S)],b=F>>>24,g=F>>>16&255,y=F&65535,!(S+b<=f);){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}s>>>=S,f-=S,n.back+=S}if(s>>>=b,f-=b,n.back+=b,n.length=y,g===0){n.mode=Ei;break}if(g&32){n.back=-1,n.mode=Re;break}if(g&64){e.msg="invalid literal/length code",n.mode=ne;break}n.extra=g&15,n.mode=Ci;case Ci:if(n.extra){for(z=n.extra;f<z;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}n.length+=s&(1<<n.extra)-1,s>>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Di;case Di:for(;F=n.distcode[s&(1<<n.distbits)-1],b=F>>>24,g=F>>>16&255,y=F&65535,!(b<=f);){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if((g&240)===0){for(S=b,C=g,_=y;F=n.distcode[_+((s&(1<<S+C)-1)>>S)],b=F>>>24,g=F>>>16&255,y=F&65535,!(S+b<=f);){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}s>>>=S,f-=S,n.back+=S}if(s>>>=b,f-=b,n.back+=b,g&64){e.msg="invalid distance code",n.mode=ne;break}n.offset=y,n.extra=g&15,n.mode=Ai;case Ai:if(n.extra){for(z=n.extra;f<z;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}n.offset+=s&(1<<n.extra)-1,s>>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ne;break}n.mode=Pi;case Pi:if(u===0)break e;if(d=p-u,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ne;break}d>n.wnext?(d-=n.wnext,m=n.wsize-d):m=n.wnext-d,d>n.length&&(d=n.length),v=n.window}else v=r,m=a-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do r[a++]=v[m++];while(--d);n.length===0&&(n.mode=Gn);break;case Ei:if(u===0)break e;r[a++]=n.length,u--,n.mode=Gn;break;case bt:if(n.wrap){for(;f<32;){if(l===0)break e;l--,s|=i[o++]<<f,f+=8}if(p-=u,e.total_out+=p,n.total+=p,n.wrap&4&&p&&(e.adler=n.check=n.flags?Oe(n.check,r,p,a-p):Rt(n.check,r,p,a-p)),p=u,n.wrap&4&&(n.flags?s:Oi(s))!==n.check){e.msg="incorrect data check",n.mode=ne;break}s=0,f=0}n.mode=Ti;case Ti:if(n.wrap&&n.flags){for(;f<32;){if(l===0)break e;l--,s+=i[o++]<<f,f+=8}if(n.wrap&4&&s!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=ne;break}s=0,f=0}n.mode=Li;case Li:R=rl;break e;case ne:R=Yr;break e;case $r:return qr;case Kr:default:return Ce}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=l,n.hold=s,n.bits=f,(n.wsize||p!==e.avail_out&&n.mode<ne&&(n.mode<bt||t!==ui))&&to(e,e.output,e.next_out,p-e.avail_out),h-=e.avail_in,p-=e.avail_out,e.total_in+=h,e.total_out+=p,n.total+=p,n.wrap&4&&p&&(e.adler=n.check=n.flags?Oe(n.check,r,p,e.next_out-p):Rt(n.check,r,p,e.next_out-p)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Re?128:0)+(n.mode===Un||n.mode===gt?256:0),(h===0&&p===0||t===ui)&&R===tn&&(R=al),R},vl=e=>{if(on(e))return Ce;let t=e.state;return t.window&&(t.window=null),e.state=null,tn},ml=(e,t)=>{if(on(e))return Ce;const n=e.state;return(n.wrap&2)===0?Ce:(n.head=t,t.done=!1,tn)},gl=(e,t)=>{const n=t.length;let i,r,o;return on(e)||(i=e.state,i.wrap!==0&&i.mode!==rt)?Ce:i.mode===rt&&(r=1,r=Rt(r,t,n,0),r!==i.check)?Yr:(o=to(e,t,n,n),o?(i.mode=$r,qr):(i.havedict=1,tn))};var bl=Qr,yl=eo,Sl=Jr,Fl=dl,xl=no,kl=pl,Il=vl,Cl=ml,Dl=gl,Al="pako inflate (from Nodeca project)",ze={inflateReset:bl,inflateReset2:yl,inflateResetKeep:Sl,inflateInit:Fl,inflateInit2:xl,inflate:kl,inflateEnd:Il,inflateGetHeader:Cl,inflateSetDictionary:Dl,inflateInfo:Al};function Pl(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var El=Pl;const io=Object.prototype.toString,{Z_NO_FLUSH:Tl,Z_FINISH:Ll,Z_OK:wn,Z_STREAM_END:Ft,Z_NEED_DICT:xt,Z_STREAM_ERROR:Ol,Z_DATA_ERROR:wi,Z_MEM_ERROR:Ml}=jr;function ft(e){this.options=Hr.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ya,this.strm.avail_out=0;let n=ze.inflateInit2(this.strm,t.windowBits);if(n!==wn)throw new Error(Bt[n]);if(this.header=new El,ze.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=_t.string2buf(t.dictionary):io.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=ze.inflateSetDictionary(this.strm,t.dictionary),n!==wn)))throw new Error(Bt[n])}ft.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let o,a,l;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Ll:Tl,io.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),o=ze.inflate(n,a),o===xt&&r&&(o=ze.inflateSetDictionary(n,r),o===wn?o=ze.inflate(n,a):o===wi&&(o=xt));n.avail_in>0&&o===Ft&&n.state.wrap>0&&e[n.next_in]!==0;)ze.inflateReset(n),o=ze.inflate(n,a);switch(o){case Ol:case wi:case xt:case Ml:return this.onEnd(o),this.ended=!0,!1}if(l=n.avail_out,n.next_out&&(n.avail_out===0||o===Ft))if(this.options.to==="string"){let u=_t.utf8border(n.output,n.next_out),s=n.next_out-u,f=_t.buf2string(n.output,u);n.next_out=s,n.avail_out=i-s,s&&n.output.set(n.output.subarray(u,u+s),0),this.onData(f)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===wn&&l===0)){if(o===Ft)return o=ze.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};ft.prototype.onData=function(e){this.chunks.push(e)};ft.prototype.onEnd=function(e){e===wn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Hr.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function wl(e,t){const n=new ft(t);if(n.push(e),n.err)throw n.msg||Bt[n.err];return n.result}var Rl=wl,Bl={inflate:Rl};const{inflate:_l}=Bl;var zl=_l,ro={},gn={pass:"pass through",norm:"normal",diss:"dissolve",dark:"darken","mul ":"multiply",idiv:"color burn",lbrn:"linear burn",dkCl:"darker color",lite:"lighten",scrn:"screen","div ":"color dodge",lddg:"linear dodge",lgCl:"lighter color",over:"overlay",sLit:"soft light",hLit:"hard light",vLit:"vivid light",lLit:"linear light",pLit:"pin light",hMix:"hard mix",diff:"difference",smud:"exclusion",fsub:"subtract",fdiv:"divide","hue ":"hue","sat ":"saturation",colr:"color","lum ":"luminosity"};Object.keys(gn).forEach(function(e){return ro[gn[e]]=e});var Ri=["none","red","orange","yellow","green","blue","violet","gray"],Nl=["LMsk","Lr16","Lr32","Layr","Mt16","Mt32","Mtrn","Alph","FMsk","lnk2","FEid","FXid","PxSD","cinf"];function Ul(e){var t={};return Object.keys(e).forEach(function(n){return t[e[n]]=n}),t}function w(e,t,n){var i=Ul(n),r=function(a){var l=a.split(".")[1];if(l&&!i[l])throw new Error("Unrecognized value for enum: '".concat(a,"'"));return i[l]||t},o=function(a){if(a&&!n[a])throw new Error("Invalid value for enum: '".concat(a,"'"));return"".concat(e,".").concat(n[a]||n[t])};return{decode:r,encode:o}}var Bi;(function(e){e[e.RGB=0]="RGB",e[e.HSB=1]="HSB",e[e.CMYK=2]="CMYK",e[e.Lab=7]="Lab",e[e.Grayscale=8]="Grayscale"})(Bi||(Bi={}));var _i;(function(e){e[e.PositionRelativeToLayer=1]="PositionRelativeToLayer",e[e.LayerMaskDisabled=2]="LayerMaskDisabled",e[e.InvertLayerMaskWhenBlending=4]="InvertLayerMaskWhenBlending",e[e.LayerMaskFromRenderingOtherData=8]="LayerMaskFromRenderingOtherData",e[e.MaskHasParametersAppliedToIt=16]="MaskHasParametersAppliedToIt"})(_i||(_i={}));var zi;(function(e){e[e.UserMaskDensity=1]="UserMaskDensity",e[e.UserMaskFeather=2]="UserMaskFeather",e[e.VectorMaskDensity=4]="VectorMaskDensity",e[e.VectorMaskFeather=8]="VectorMaskFeather"})(zi||(zi={}));var Ni;(function(e){e[e.Color0=0]="Color0",e[e.Color1=1]="Color1",e[e.Color2=2]="Color2",e[e.Color3=3]="Color3",e[e.Transparency=-1]="Transparency",e[e.UserMask=-2]="UserMask",e[e.RealUserMask=-3]="RealUserMask"})(Ni||(Ni={}));var Ui;(function(e){e[e.RawData=0]="RawData",e[e.RleCompressed=1]="RleCompressed",e[e.ZipWithoutPrediction=2]="ZipWithoutPrediction",e[e.ZipWithPrediction=3]="ZipWithPrediction"})(Ui||(Ui={}));function Gl(e,t){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return t?3:e+1;case-1:return t?4:3;default:return e+1}}function oo(e,t,n){return e<t?t:e>n?n:e}function zt(e){for(var t=e.data,n=t instanceof Float32Array?1:t instanceof Uint16Array?65535:255,i=0,r=t.length|0;i<r;i=i+4|0)t[i+0]=0,t[i+1]=0,t[i+2]=0,t[i+3]=n}function Nt(e){var t=Xt(e.width,e.height),n;if(e.data instanceof Uint8ClampedArray)n=e;else{n=Zt(e.width,e.height);var i=e.data,r=n.data;if(i instanceof Float32Array)for(var o=0,a=i.length;o<a;o+=4)r[o+0]=Math.round(Math.pow(i[o+0],1/2.2)*255),r[o+1]=Math.round(Math.pow(i[o+1],1/2.2)*255),r[o+2]=Math.round(Math.pow(i[o+2],1/2.2)*255),r[o+3]=Math.round(i[o+3]*255);else for(var l=i instanceof Uint16Array?8:0,o=0,a=i.length;o<a;o++)r[o]=i[o]>>>l}return t.getContext("2d").putImageData(n,0,0),t}function Vl(e,t,n,i){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("Invalid bit depth");for(var r=0,o=0,a=0;r<i;r++)for(var l=0;l<n;)for(var u=e[a++],s=0;s<8&&l<n;s++,l++,o+=4){var f=u&128?0:255;u=u<<1,t[o+0]=f,t[o+1]=f,t[o+2]=f,t[o+3]=255}}var Xt=function(){throw new Error("Canvas not initialized, use initializeCanvas method to set up createCanvas method")},ao=function(){throw new Error("Canvas not initialized, use initializeCanvas method to set up createCanvasFromData method")},kt=void 0,Zt=function(e,t){return kt||(kt=Xt(1,1)),kt.getContext("2d").createImageData(e,t)};typeof document<"u"&&(Xt=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},ao=function(e){var t=new Image;t.src="data:image/jpeg;base64,"+it.fromByteArray(e);var n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),n});function Ut(e){return(e&4294967168)===0?1:(e&4294965248)===0?2:(e&4294901760)===0?3:4}function jl(e){for(var t=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319){if(n+1<e.length){var r=e.charCodeAt(n+1);(r&64512)===56320&&(n++,t+=Ut(((i&1023)<<10)+(r&1023)+65536))}}else t+=Ut(i)}return t}function Gi(e,t,n){var i=Ut(n);switch(i){case 1:e[t]=n;break;case 2:e[t]=n>>6&31|192,e[t+1]=n&63|128;break;case 3:e[t]=n>>12&15|224,e[t+1]=n>>6&63|128,e[t+2]=n&63|128;break;default:e[t]=n>>18&7|240,e[t+1]=n>>12&63|128,e[t+2]=n>>6&63|128,e[t+3]=n&63|128;break}return i}function Hl(e,t,n){for(var i=0;i<n.length;i++){var r=n.charCodeAt(i);if(r>=55296&&r<=56319){if(i+1<n.length){var o=n.charCodeAt(i+1);if((o&64512)===56320){i++;var a=((r&1023)<<10)+(o&1023)+65536;t+=Gi(e,t,a)}}}else t+=Gi(e,t,r)}return t}function Wl(e){if(e.length>1e3&&typeof TextEncoder<"u")return new TextEncoder().encode(e);var t=new Uint8Array(jl(e));return Hl(t,0,e),t}function un(e,t){if(t>=e.length)throw Error("Invalid byte index");var n=e[t];if((n&192)===128)return n&63;throw Error("Invalid continuation byte")}function Xl(e){if(e.byteLength>1e3&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var t=[],n=0;n<e.length;){var i=e[n++],r=void 0;if((i&128)===0)r=i;else if((i&224)===192){var o=un(e,n++);if(r=(i&31)<<6|o,r<128)throw Error("Invalid continuation byte")}else if((i&240)===224){var o=un(e,n++),a=un(e,n++);if(r=(i&15)<<12|o<<6|a,r<2048)throw Error("Invalid continuation byte");if(r>=55296&&r<=57343)throw Error("Lone surrogate U+".concat(r.toString(16).toUpperCase()," is not a scalar value"))}else if((i&248)===240){var o=un(e,n++),a=un(e,n++),l=un(e,n++);if(r=(i&15)<<18|o<<12|a<<6|l,r<65536||r>1114111)throw Error("Invalid continuation byte")}else throw Error("Invalid UTF-8 detected");r>65535&&(r-=65536,t.push(String.fromCharCode(r>>>10&1023|55296)),r=56320|r&1023),t.push(String.fromCharCode(r))}return t.join("")}var Ne=function(){return Ne=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Ne.apply(this,arguments)};function Zl(e){var t={};return Object.keys(e).forEach(function(n){return t[e[n]]=n}),t}var An={"#Ang":"Angle","#Rsl":"Density","#Rlt":"Distance","#Nne":"None","#Prc":"Percent","#Pxl":"Pixels","#Mlm":"Millimeters","#Pnt":"Points",RrPi:"Picas",RrIn:"Inches",RrCm:"Centimeters"},Vn=Zl(An);function D(e,t){return{name:e,classID:t}}var W=D("","null"),lo={strokeStyleContent:D("","solidColorLayer"),printProofSetup:D("Proof Setup","proofSetup"),patternFill:D("","patternFill"),Grad:D("Gradient","Grdn"),ebbl:D("","ebbl"),SoFi:D("","SoFi"),GrFl:D("","GrFl"),sdwC:D("","RGBC"),hglC:D("","RGBC"),"Clr ":D("","RGBC"),tintColor:D("","RGBC"),Ofst:D("","Pnt "),ChFX:D("","ChFX"),MpgS:D("","ShpC"),DrSh:D("","DrSh"),IrSh:D("","IrSh"),OrGl:D("","OrGl"),IrGl:D("","IrGl"),TrnS:D("","ShpC"),Ptrn:D("","Ptrn"),FrFX:D("","FrFX"),phase:D("","Pnt "),frameStep:W,duration:W,workInTime:W,workOutTime:W,audioClipGroupList:W,bounds:D("","Rctn"),customEnvelopeWarp:D("","customEnvelopeWarp"),warp:D("","warp"),"Sz ":D("","Pnt "),origin:D("","Pnt "),autoExpandOffset:D("","Pnt "),keyOriginShapeBBox:D("","unitRect"),Vrsn:W,psVersion:W,docDefaultNewArtboardBackgroundColor:D("","RGBC"),artboardRect:D("","classFloatRect"),keyOriginRRectRadii:D("","radii"),keyOriginBoxCorners:W,rectangleCornerA:D("","Pnt "),rectangleCornerB:D("","Pnt "),rectangleCornerC:D("","Pnt "),rectangleCornerD:D("","Pnt "),compInfo:W,Trnf:D("Transform","Trnf"),quiltWarp:D("","quiltWarp"),generatorSettings:W,crema:W,FrIn:W,blendOptions:W,FXRf:W,Lefx:W,time:W,animKey:W,timeScope:W,inTime:W,outTime:W,sheetStyle:W,translation:W,Skew:W,boundingBox:D("","boundingBox"),"Lnk ":D("","ExternalFileLink"),frameReader:D("","FrameReader"),effectParams:D("","motionTrackEffectParams"),Impr:D("None","none"),Anch:D("","Pnt "),"Fwd ":D("","Pnt "),"Bwd ":D("","Pnt "),FlrC:D("","Pnt "),meshBoundaryPath:D("","pathClass"),filterFX:D("","filterFXStyle"),Fltr:D("","rigidTransform"),FrgC:D("","RGBC"),BckC:D("","RGBC"),sdwM:D("Parameters","adaptCorrectTones"),hglM:D("Parameters","adaptCorrectTones"),customShape:D("","customShape"),origFXRefPoint:W,FXRefPoint:W},so={"Crv ":D("","CrPt"),Clrs:D("","Clrt"),Trns:D("","TrnS"),keyDescriptorList:W,solidFillMulti:D("","SoFi"),gradientFillMulti:D("","GrFl"),dropShadowMulti:D("","DrSh"),innerShadowMulti:D("","IrSh"),frameFXMulti:D("","FrFX"),FrIn:W,FSts:W,LaSt:W,sheetTimelineOptions:W,trackList:D("","animationTrack"),globalTrackList:D("","animationTrack"),keyList:W,audioClipGroupList:W,audioClipList:W,countObjectList:D("","countObject"),countGroupList:D("","countGroup"),slices:D("","slice"),"Pts ":D("","Pthp"),SbpL:D("","SbpL"),pathComponents:D("","PaCm"),filterFXList:D("","filterFX"),puppetShapeList:D("","puppetShape"),channelDenoise:D("","channelDenoiseParams"),ShrP:D("","Pnt "),layerSettings:W,list:W},Vi={TEXT:["Txt ","printerName","Nm ","Idnt","blackAndWhitePresetFileName","LUT3DFileName","presetFileName","curvesPresetFileName","mixerPresetFileName","placed","description","reason","artboardPresetName","json","clipID","relPath","fullPath","mediaDescriptor","Msge","altTag","url","cellText","preset","KnNm","FPth","comment","originalPath"],tdta:["EngineData","LUT3DFileData","indexArray","originalVertexArray","deformedVertexArray","LqMe"],long:["TextIndex","RndS","Mdpn","Smth","Lctn","strokeStyleVersion","LaID","Vrsn","Cnt ","Brgh","Cntr","means","vibrance","Strt","bwPresetKind","presetKind","comp","compID","originalCompID","curvesPresetKind","mixerPresetKind","uOrder","vOrder","PgNm","totalPages","Crop","numerator","denominator","frameCount","Annt","keyOriginType","unitValueQuadVersion","keyOriginIndex","major","minor","fix","docDefaultNewArtboardBackgroundType","artboardBackgroundType","numModifyingFX","deformNumRows","deformNumCols","FrID","FrDl","FsID","LCnt","AFrm","AFSt","numBefore","numAfter","Spcn","minOpacity","maxOpacity","BlnM","sheetID","gblA","globalAltitude","descVersion","frameReaderType","LyrI","zoomOrigin","fontSize","Rds ","sliceID","topOutset","leftOutset","bottomOutset","rightOutset","filterID","meshQuality","meshExpansion","meshRigidity","VrsM","VrsN","NmbG","WLMn","WLMx","AmMn","AmMx","SclH","SclV","Lvl ","TlNm","TlOf","FlRs","Thsh","ShrS","ShrE","FlRs","Vrnc","Strg","ExtS","ExtD","HrzS","VrtS","NmbR","EdgF","Ang1","Ang2","Ang3","Ang4","lastAppliedComp","capturedInfo"],enum:["textGridding","Ornt","warpStyle","warpRotate","Inte","Bltn","ClrS","BlrQ","bvlT","bvlS","bvlD","Md ","glwS","GrdF","GlwT","RplS","BlrM","SmBM","strokeStyleLineCapType","strokeStyleLineJoinType","strokeStyleLineAlignment","strokeStyleBlendMode","PntT","Styl","lookupType","LUTFormat","dataOrder","tableOrder","enableCompCore","enableCompCoreGPU","compCoreSupport","compCoreGPUSupport","Engn","enableCompCoreThreads","gs99","FrDs","trackID","animInterpStyle","horzAlign","vertAlign","bgColorType","shapeOperation","UndA","Wvtp","Drct","WndM","Edg ","FlCl","IntE","IntC","Cnvr","Fl ","Dstr","MztT","Lns ","ExtT","DspM","ExtR","ZZTy","SphM","SmBQ"],bool:["PstS","printSixteenBit","masterFXSwitch","enab","uglg","antialiasGloss","useShape","useTexture","uglg","antialiasGloss","useShape","Vsbl","useTexture","Algn","Rvrs","Dthr","Invr","VctC","ShTr","layerConceals","strokeEnabled","fillEnabled","strokeStyleScaleLock","strokeStyleStrokeAdjust","hardProof","MpBl","paperWhite","useLegacy","Auto","Lab ","useTint","keyShapeInvalidated","autoExpandEnabled","autoNestEnabled","autoPositionEnabled","shrinkwrapOnSaveEnabled","present","showInDialog","overprint","sheetDisclosed","lightsDisclosed","meshesDisclosed","materialsDisclosed","hasMotion","muted","Effc","selected","autoScope","fillCanvas","cellTextIsHTML","Smoo","Clsp","validAtPosition","rigidType","hasoptions","filterMaskEnable","filterMaskLinked","filterMaskExtendWithWhite","removeJPEGArtifact","Mnch","ExtF","ExtM","moreAccurate","GpuY","LIWy"],doub:["warpValue","warpPerspective","warpPerspectiveOther","Intr","Wdth","Hght","strokeStyleMiterLimit","strokeStyleResolution","layerTime","keyOriginResolution","xx","xy","yx","yy","tx","ty","FrGA","frameRate","audioLevel","rotation","X ","Y ","redFloat","greenFloat","blueFloat","imageResolution","PuX0","PuX1","PuX2","PuX3","PuY0","PuY1","PuY2","PuY3"],UntF:["sdwO","hglO","lagl","Lald","srgR","blur","Sftn","Opct","Dstn","Angl","Ckmt","Nose","Inpr","ShdN","strokeStyleLineWidth","strokeStyleLineDashOffset","strokeStyleOpacity","H ","Top ","Left","Btom","Rght","Rslt","topRight","topLeft","bottomLeft","bottomRight","ClNs","Shrp"],VlLs:["Crv ","Clrs","Mnm ","Mxm ","Trns","pathList","strokeStyleLineDashSet","FrLs","slices","LaSt","Trnf","nonAffineTransform","keyDescriptorList","guideIndeces","gradientFillMulti","solidFillMulti","frameFXMulti","innerShadowMulti","dropShadowMulti","FrIn","FSts","FsFr","sheetTimelineOptions","audioClipList","trackList","globalTrackList","keyList","audioClipList","warpValues","selectedPin","Pts ","SbpL","pathComponents","pinOffsets","posFinalPins","pinVertexIndices","PinP","PnRt","PnOv","PnDp","filterFXList","puppetShapeList","ShrP","channelDenoise","Mtrx","layerSettings","list","compList"],ObAr:["meshPoints","quiltSliceX","quiltSliceY"],"obj ":["null","Chnl"],"Pth ":["DspF"]},Yl=["Rd ","Grn ","Bl ","Yllw","Ylw ","Cyn ","Mgnt","Blck","Gry ","Lmnc","A ","B "],uo={"Mnm ":"long","Mxm ":"long",FrLs:"long",strokeStyleLineDashSet:"UntF",Trnf:"doub",nonAffineTransform:"doub",keyDescriptorList:"Objc",gradientFillMulti:"Objc",solidFillMulti:"Objc",frameFXMulti:"Objc",innerShadowMulti:"Objc",dropShadowMulti:"Objc",LaSt:"Objc",FrIn:"Objc",FSts:"Objc",FsFr:"long",blendOptions:"Objc",sheetTimelineOptions:"Objc",keyList:"Objc",warpValues:"doub",selectedPin:"long","Pts ":"Objc",SbpL:"Objc",pathComponents:"Objc",pinOffsets:"doub",posFinalPins:"doub",pinVertexIndices:"long",PinP:"doub",PnRt:"long",PnOv:"bool",PnDp:"doub",filterFXList:"Objc",puppetShapeList:"Objc",ShrP:"Objc",channelDenoise:"Objc",Mtrx:"long",compList:"long"},ot={};for(var It=0,ji=Object.keys(Vi);It<ji.length;It++)for(var Hi=ji[It],Ct=0,Wi=Vi[Hi];Ct<Wi.length;Ct++){var bn=Wi[Ct];ot[bn]=Hi}for(var Dt=0,Xi=Object.keys(lo);Dt<Xi.length;Dt++){var bn=Xi[Dt];ot[bn]||(ot[bn]="Objc")}for(var At=0,Zi=Object.keys(so);At<Zi.length;At++){var bn=Zi[At];uo[bn]="Objc"}function ql(e,t,n,i){return e==="null"&&n==="slices"?"TEXT":e==="groupID"?n==="slices"?"long":"TEXT":e==="Sz "?"Wdth"in t?"Objc":"units"in t?"UntF":"doub":e==="Type"?typeof t=="string"?"enum":"long":e==="AntA"?typeof t=="string"?"enum":"bool":(e==="Hrzn"||e==="Vrtc")&&i.Type==="keyType.Pstn"?"long":e==="Hrzn"||e==="Vrtc"||e==="Top "||e==="Left"||e==="Btom"||e==="Rght"?n==="slices"?"long":typeof t=="number"?"doub":"UntF":e==="Vrsn"?typeof t=="number"?"long":"Objc":e==="Rd "||e==="Grn "||e==="Bl "?n==="artd"?"long":"doub":e==="Trnf"?Array.isArray(t)?"VlLs":"Objc":ot[e]}function Ue(e){var t=M(e);return Jt(e,t||4)}function Ge(e,t){if(t.length===4&&t!=="warp"&&t!=="time"&&t!=="hold"&&t!=="list")G(e,0),N(e,t);else{G(e,t.length);for(var n=0;n<t.length;n++)T(e,t.charCodeAt(n))}}function fo(e,t){for(var n=Qe(e),i=t?{_name:n.name,_classID:n.classID}:{},r=I(e),o=0;o<r;o++){var a=Ue(e),l=Q(e),u=ho(e,l,t);i[a]=u}return i}function co(e,t,n,i,r){rn(e,t),Ge(e,n);var o=Object.keys(i),a=o.length;"_name"in i&&a--,"_classID"in i&&a--,P(e,a);for(var l=0,u=o;l<u.length;l++){var s=u[l];if(!(s==="_name"||s==="_classID")){var f=ql(s,i[s],r,i),h=lo[s];s==="bounds"&&r==="text"?h=D("","bounds"):s==="origin"?f=r==="slices"?"enum":"Objc":(s==="Cyn "||s==="Mgnt"||s==="Ylw "||s==="Blck")&&i._classID==="CMYC"?f="doub":/^PN[a-z][a-z]$/.test(s)?f="TEXT":/^PT[a-z][a-z]$/.test(s)?f="long":/^PF[a-z][a-z]$/.test(s)?f="doub":s==="ClSz"||s==="Rds "||s==="Amnt"?f=typeof i[s]=="number"?"long":"UntF":(s==="sdwM"||s==="hglM")&&typeof i[s]=="string"||s==="blur"&&typeof i[s]=="string"?f="enum":s==="Angl"&&typeof i[s]=="number"?f="doub":s==="bounds"&&r==="slices"?(f="Objc",h=D("","Rct1")):s==="Scl "?typeof i[s]=="object"&&"Hrzn"in i[s]?(f="Objc",h=W):typeof i[s]=="number"?f="long":f="UntF":s==="audioClipGroupList"&&o.length===1?f="VlLs":(s==="Strt"||s==="Brgh")&&"H "in i?f="doub":s==="Wdth"&&typeof i[s]=="object"?f="UntF":s==="Ofst"&&typeof i[s]=="number"?f="long":s==="Strt"&&typeof i[s]=="object"?(f="Objc",h=W):Yl.indexOf(s)!==-1?f=n==="RGBC"&&r!=="artd"?"doub":"long":s==="profile"?f=n==="printOutput"?"TEXT":"tdta":s==="strokeStyleContent"?i[s]["Clr "]?h=D("","solidColorLayer"):i[s].Grad?h=D("","gradientLayer"):i[s].Ptrn&&(h=D("","patternLayer")):s==="bounds"&&r==="quiltWarp"&&(h=D("","classFloatRect")),h&&h.classID==="RGBC"&&"H "in i[s]&&(h={classID:"HSBC",name:""}),Ge(e,s),N(e,f||"long"),po(e,f||"long",i[s],s,h,r)}}}function ho(e,t,n){switch(t){case"obj ":return Kl(e);case"Objc":case"GlbO":return fo(e,n);case"VlLs":{for(var i=M(e),r=[],o=0;o<i;o++){var a=Q(e);r.push(ho(e,a,n))}return r}case"doub":return Ie(e);case"UntF":{var l=Q(e),u=Ie(e);if(!An[l])throw new Error("Invalid units: ".concat(l));return{units:An[l],value:u}}case"UnFl":{var l=Q(e),u=Pe(e);if(!An[l])throw new Error("Invalid units: ".concat(l));return{units:An[l],value:u}}case"TEXT":return se(e);case"enum":{var s=Ue(e),u=Ue(e);return"".concat(s,".").concat(u)}case"long":return M(e);case"comp":{var f=I(e),h=I(e);return{low:f,high:h}}case"bool":return!!L(e);case"type":case"GlbC":return Qe(e);case"alis":{var p=M(e);return Jt(e,p)}case"tdta":{var d=M(e);return fe(e,d)}case"ObAr":{M(e),se(e),Ue(e);for(var m=M(e),r=[],o=0;o<m;o++){var v=Ue(e);Q(e),Q(e);for(var F=M(e),b=[],g=0;g<F;g++)b.push(Ie(e));r.push({type:v,values:b})}return r}case"Pth ":{M(e);var y=Q(e);Fr(e);var S=Fr(e),C=os(e,S);return{sig:y,path:C}}default:throw new Error("Invalid TySh descriptor OSType: ".concat(t," at ").concat(e.offset.toString(16)))}}var $l={meshPoints:"rationalPoint",quiltSliceX:"UntF",quiltSliceY:"UntF"};function po(e,t,n,i,r,o){switch(t){case"obj ":Jl(e,i,n);break;case"Objc":case"GlbO":{if(typeof n!="object")throw new Error("Invalid struct value: ".concat(JSON.stringify(n),", key: ").concat(i));if(!r)throw new Error("Missing ext type for: '".concat(i,"' (").concat(JSON.stringify(n),")"));var a=n._name||r.name,l=n._classID||r.classID;co(e,a,l,n,o);break}case"VlLs":if(!Array.isArray(n))throw new Error("Invalid list value: ".concat(JSON.stringify(n),", key: ").concat(i));G(e,n.length);for(var u=0;u<n.length;u++){var s=uo[i];N(e,s||"long"),po(e,s||"long",n[u],"".concat(i,"[]"),so[i],o)}break;case"doub":if(typeof n!="number")throw new Error("Invalid number value: ".concat(JSON.stringify(n),", key: ").concat(i));we(e,n);break;case"UntF":if(!Vn[n.units])throw new Error("Invalid units: ".concat(n.units," in ").concat(i));N(e,Vn[n.units]),we(e,n.value);break;case"UnFl":if(!Vn[n.units])throw new Error("Invalid units: ".concat(n.units," in ").concat(i));N(e,Vn[n.units]),Ee(e,n.value);break;case"TEXT":rn(e,n);break;case"enum":{if(typeof n!="string")throw new Error("Invalid enum value: ".concat(JSON.stringify(n),", key: ").concat(i));var f=n.split("."),h=f[0],p=f[1];Ge(e,h),Ge(e,p);break}case"long":if(typeof n!="number")throw new Error("Invalid integer value: ".concat(JSON.stringify(n),", key: ").concat(i));G(e,n);break;case"bool":if(typeof n!="boolean")throw new Error("Invalid boolean value: ".concat(JSON.stringify(n),", key: ").concat(i));T(e,n?1:0);break;case"tdta":G(e,n.byteLength),qe(e,n);break;case"ObAr":{G(e,16),rn(e,"");var d=$l[i];if(!d)throw new Error("Not implemented ObArType for: ".concat(i));Ge(e,d),G(e,n.length);for(var u=0;u<n.length;u++){Ge(e,n[u].type),N(e,"UnFl"),N(e,"#Pxl"),G(e,n[u].values.length);for(var m=0;m<n[u].values.length;m++)we(e,n[u].values[m])}break}case"Pth ":{var v=12+n.path.length*2;G(e,v),N(e,n.sig),_r(e,v),_r(e,n.path.length),zs(e,n.path);break}default:throw new Error("Not implemented descriptor OSType: ".concat(t))}}function Kl(e){for(var t=M(e),n=[],i=0;i<t;i++){var r=Q(e);switch(r){case"prop":{Qe(e);var o=Ue(e);n.push(o);break}case"Clss":n.push(Qe(e));break;case"Enmr":{Qe(e);var a=Ue(e),l=Ue(e);n.push("".concat(a,".").concat(l));break}case"rele":{Qe(e),n.push(I(e));break}case"Idnt":n.push(M(e));break;case"indx":n.push(M(e));break;case"name":{Qe(e),n.push(se(e));break}default:throw new Error("Invalid descriptor reference type: ".concat(r))}}return n}function Jl(e,t,n){G(e,n.length);for(var i=0;i<n.length;i++){var r=n[i],o="unknown";switch(typeof r=="string"&&(/^[a-z]+\.[a-z]+$/i.test(r)?o="Enmr":o="name"),N(e,o),o){case"Enmr":{var a=r.split("."),l=a[0],u=a[1];Yi(e,"\0",l),Ge(e,l),Ge(e,u);break}case"name":{Yi(e,"\0","Lyr "),Se(e,r+"\0");break}default:throw new Error("Invalid descriptor reference type: ".concat(o))}}return n}function Qe(e){var t=se(e),n=Ue(e);return{name:t,classID:n}}function Yi(e,t,n){Se(e,t),Ge(e,n)}function j(e,t){t===void 0&&(t=!1);var n=I(e);if(n!==16)throw new Error("Invalid descriptor version: ".concat(n));var i=fo(e,t);return i}function H(e,t,n,i,r){r===void 0&&(r=""),P(e,16),co(e,t,n,i,r)}function En(e){return{x:e.Hrzn,y:e.Vrtc}}function Tn(e){return{Hrzn:e.x,Vrtc:e.y}}function qi(e){return{top:q(e["Top "]),left:q(e.Left),right:q(e.Rght),bottom:q(e.Btom)}}function $i(e){var t;return t={Left:ee(e.left,"bounds.left")},t["Top "]=ee(e.top,"bounds.top"),t.Rght=ee(e.right,"bounds.right"),t.Btom=ee(e.bottom,"bounds.bottom"),t}function Ki(e){var t={enabled:!!e.enab,position:pt.decode(e.Styl),fillType:Lo.decode(e.PntT),blendMode:ke.decode(e["Md "]),opacity:J(e.Opct),size:q(e["Sz "])};return e.present!==void 0&&(t.present=e.present),e.showInDialog!==void 0&&(t.showInDialog=e.showInDialog),e.overprint!==void 0&&(t.overprint=e.overprint),e["Clr "]&&(t.color=Te(e["Clr "])),e.Grad&&(t.gradient=yo(e)),e.Ptrn&&(t.pattern=So(e)),t}function Ji(e){var t={};return t.enab=!!e.enabled,e.present!==void 0&&(t.present=!!e.present),e.showInDialog!==void 0&&(t.showInDialog=!!e.showInDialog),t.Styl=pt.encode(e.position),t.PntT=Lo.encode(e.fillType),t["Md "]=ke.encode(e.blendMode),t.Opct=ae(e.opacity),t["Sz "]=ee(e.size,"size"),e.color&&(t["Clr "]=Le(e.color)),e.gradient&&(t=Ne(Ne({},t),Fo(e.gradient))),e.pattern&&(t=Ne(Ne({},t),xo(e.pattern))),e.overprint!==void 0&&(t.overprint=!!e.overprint),t}function ct(e,t,n){for(var i,r,o,a=n?{"Scl ":xe((i=e.scale)!==null&&i!==void 0?i:1),masterFXSwitch:!e.disabled}:{masterFXSwitch:!e.disabled,"Scl ":xe((r=e.scale)!==null&&r!==void 0?r:1)},l=["dropShadow","innerShadow","solidFill","gradientOverlay","stroke"],u=0,s=l;u<s.length;u++){var f=s[u];if(e[f]&&!Array.isArray(e[f]))throw new Error("".concat(f," should be an array"))}var h=function(y){return!!y&&y.length>1&&n},p=function(y){return!!y&&y.length>=1&&(!n||y.length===1)};if(p(e.dropShadow)&&(a.DrSh=me(e.dropShadow[0],"dropShadow",t)),h(e.dropShadow)&&(a.dropShadowMulti=e.dropShadow.map(function(y){return me(y,"dropShadow",t)})),p(e.innerShadow)&&(a.IrSh=me(e.innerShadow[0],"innerShadow",t)),h(e.innerShadow)&&(a.innerShadowMulti=e.innerShadow.map(function(y){return me(y,"innerShadow",t)})),e.outerGlow&&(a.OrGl=me(e.outerGlow,"outerGlow",t)),h(e.solidFill)&&(a.solidFillMulti=e.solidFill.map(function(y){return me(y,"solidFill",t)})),h(e.gradientOverlay)&&(a.gradientFillMulti=e.gradientOverlay.map(function(y){return me(y,"gradientOverlay",t)})),h(e.stroke)&&(a.frameFXMulti=e.stroke.map(function(y){return Ji(y)})),e.innerGlow&&(a.IrGl=me(e.innerGlow,"innerGlow",t)),e.bevel&&(a.ebbl=me(e.bevel,"bevel",t)),p(e.solidFill)&&(a.SoFi=me(e.solidFill[0],"solidFill",t)),e.patternOverlay&&(a.patternFill=me(e.patternOverlay,"patternOverlay",t)),p(e.gradientOverlay)&&(a.GrFl=me(e.gradientOverlay[0],"gradientOverlay",t)),e.satin&&(a.ChFX=me(e.satin,"satin",t)),p(e.stroke)&&(a.FrFX=Ji((o=e.stroke)===null||o===void 0?void 0:o[0])),n){a.numModifyingFX=0;for(var d=0,m=Object.keys(e);d<m.length;d++){var f=m[d],v=e[f];if(Array.isArray(v))for(var F=0,b=v;F<b.length;F++){var g=b[F];g.enabled&&a.numModifyingFX++}else v.enabled&&a.numModifyingFX++}}return a}function dt(e,t){var n={};return e.masterFXSwitch||(n.disabled=!0),e["Scl "]&&(n.scale=J(e["Scl "])),e.DrSh&&(n.dropShadow=[ve(e.DrSh,t)]),e.dropShadowMulti&&(n.dropShadow=e.dropShadowMulti.map(function(i){return ve(i,t)})),e.IrSh&&(n.innerShadow=[ve(e.IrSh,t)]),e.innerShadowMulti&&(n.innerShadow=e.innerShadowMulti.map(function(i){return ve(i,t)})),e.OrGl&&(n.outerGlow=ve(e.OrGl,t)),e.IrGl&&(n.innerGlow=ve(e.IrGl,t)),e.ebbl&&(n.bevel=ve(e.ebbl,t)),e.SoFi&&(n.solidFill=[ve(e.SoFi,t)]),e.solidFillMulti&&(n.solidFill=e.solidFillMulti.map(function(i){return ve(i,t)})),e.patternFill&&(n.patternOverlay=ve(e.patternFill,t)),e.GrFl&&(n.gradientOverlay=[ve(e.GrFl,t)]),e.gradientFillMulti&&(n.gradientOverlay=e.gradientFillMulti.map(function(i){return ve(i,t)})),e.ChFX&&(n.satin=ve(e.ChFX,t)),e.FrFX&&(n.stroke=[Ki(e.FrFX)]),e.frameFXMulti&&(n.stroke=e.frameFXMulti.map(function(i){return Ki(i)})),n}function Qi(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i],o=r.time,a=o.denominator,l=o.numerator,u=r.selected,s=r.animKey,f={numerator:l,denominator:a},h=Po.decode(r.animInterpStyle);switch(s.Type){case"keyType.Opct":n.push({interpolation:h,time:f,selected:u,type:"opacity",value:J(s.Opct)});break;case"keyType.Pstn":n.push({interpolation:h,time:f,selected:u,type:"position",x:s.Hrzn,y:s.Vrtc});break;case"keyType.Trnf":n.push({interpolation:h,time:f,selected:u,type:"transform",scale:En(s["Scl "]),skew:En(s.Skew),rotation:s.rotation,translation:En(s.translation)});break;case"keyType.sheetStyle":{var p={interpolation:h,time:f,selected:u,type:"style"};s.sheetStyle.Lefx&&(p.style=dt(s.sheetStyle.Lefx,t)),n.push(p);break}case"keyType.globalLighting":{n.push({interpolation:h,time:f,selected:u,type:"globalLighting",globalAngle:s.gblA,globalAltitude:s.globalAltitude});break}default:throw new Error("Unsupported keyType value")}}return n}function er(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=i.time,o=i.selected,a=o===void 0?!1:o,l=i.interpolation,u=Po.encode(l),s=void 0;switch(i.type){case"opacity":s={Type:"keyType.Opct",Opct:ae(i.value)};break;case"position":s={Type:"keyType.Pstn",Hrzn:i.x,Vrtc:i.y};break;case"transform":s={Type:"keyType.Trnf","Scl ":Tn(i.scale),Skew:Tn(i.skew),rotation:i.rotation,translation:Tn(i.translation)};break;case"style":s={Type:"keyType.sheetStyle",sheetStyle:{Vrsn:1,blendOptions:{}}},i.style&&(s.sheetStyle={Vrsn:1,Lefx:ct(i.style,!1,!1),blendOptions:{}});break;case"globalLighting":{s={Type:"keyType.globalLighting",gblA:i.globalAngle,globalAltitude:i.globalAltitude};break}default:throw new Error("Unsupported keyType value")}t.push({Vrsn:1,animInterpStyle:u,time:r,animKey:s,selected:a})}return t}function vo(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i],o={type:Eo.decode(r.trackID),enabled:r.enab,keys:Qi(r.keyList,t)};r.effectParams&&(o.effectParams={fillCanvas:r.effectParams.fillCanvas,zoomOrigin:r.effectParams.zoomOrigin,keys:Qi(r.effectParams.keyList,t)}),n.push(o)}return n}function mo(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];t.push(Ne(Ne({trackID:Eo.encode(i.type),Vrsn:1,enab:!!i.enabled,Effc:!!i.effectParams},i.effectParams?{effectParams:{keyList:er(i.keys),fillCanvas:i.effectParams.fillCanvas,zoomOrigin:i.effectParams.zoomOrigin}}:{}),{keyList:er(i.keys)}))}return t}function ve(e,t){for(var n={},i=0,r=Object.keys(e);i<r.length;i++){var o=r[i],a=e[o];switch(o){case"enab":n.enabled=!!a;break;case"uglg":n.useGlobalLight=!!a;break;case"AntA":n.antialiased=!!a;break;case"Algn":n.align=!!a;break;case"Dthr":n.dither=!!a;break;case"Invr":n.invert=!!a;break;case"Rvrs":n.reverse=!!a;break;case"Clr ":n.color=Te(a);break;case"hglC":n.highlightColor=Te(a);break;case"sdwC":n.shadowColor=Te(a);break;case"Styl":n.position=pt.decode(a);break;case"Md ":n.blendMode=ke.decode(a);break;case"hglM":n.highlightBlendMode=ke.decode(a);break;case"sdwM":n.shadowBlendMode=ke.decode(a);break;case"bvlS":n.style=ko.decode(a);break;case"bvlD":n.direction=Co.decode(a);break;case"bvlT":n.technique=Io.decode(a);break;case"GlwT":n.technique=Do.decode(a);break;case"glwS":n.source=Ao.decode(a);break;case"Type":n.type=ht.decode(a);break;case"gs99":n.interpolationMethod=To.decode(a);break;case"Opct":n.opacity=J(a);break;case"hglO":n.highlightOpacity=J(a);break;case"sdwO":n.shadowOpacity=J(a);break;case"lagl":n.angle=et(a);break;case"Angl":n.angle=et(a);break;case"Lald":n.altitude=et(a);break;case"Sftn":n.soften=q(a);break;case"srgR":n.strength=J(a);break;case"blur":n.size=q(a);break;case"Nose":n.noise=J(a);break;case"Inpr":n.range=J(a);break;case"Ckmt":n.choke=q(a);break;case"ShdN":n.jitter=J(a);break;case"Dstn":n.distance=q(a);break;case"Scl ":n.scale=J(a);break;case"Ptrn":n.pattern={name:a["Nm "],id:a.Idnt};break;case"phase":n.phase={x:a.Hrzn,y:a.Vrtc};break;case"Ofst":n.offset={x:J(a.Hrzn),y:J(a.Vrtc)};break;case"MpgS":case"TrnS":n.contour={name:a["Nm "],curve:a["Crv "].map(function(l){return{x:l.Hrzn,y:l.Vrtc}})};break;case"Grad":n.gradient=go(a);break;case"useTexture":case"useShape":case"layerConceals":case"present":case"showInDialog":case"antialiasGloss":n[o]=a;break;case"_name":case"_classID":break;default:t&&console.log("Invalid effect key: '".concat(o,"', value:"),a)}}return n}function me(e,t,n){for(var i={},r=0,o=Object.keys(e);r<o.length;r++){var a=o[r],l=a,u=e[l];switch(l){case"enabled":i.enab=!!u;break;case"useGlobalLight":i.uglg=!!u;break;case"antialiased":i.AntA=!!u;break;case"align":i.Algn=!!u;break;case"dither":i.Dthr=!!u;break;case"invert":i.Invr=!!u;break;case"reverse":i.Rvrs=!!u;break;case"color":i["Clr "]=Le(u);break;case"highlightColor":i.hglC=Le(u);break;case"shadowColor":i.sdwC=Le(u);break;case"position":i.Styl=pt.encode(u);break;case"blendMode":i["Md "]=ke.encode(u);break;case"highlightBlendMode":i.hglM=ke.encode(u);break;case"shadowBlendMode":i.sdwM=ke.encode(u);break;case"style":i.bvlS=ko.encode(u);break;case"direction":i.bvlD=Co.encode(u);break;case"technique":t==="bevel"?i.bvlT=Io.encode(u):i.GlwT=Do.encode(u);break;case"source":i.glwS=Ao.encode(u);break;case"type":i.Type=ht.encode(u);break;case"interpolationMethod":i.gs99=To.encode(u);break;case"opacity":i.Opct=ae(u);break;case"highlightOpacity":i.hglO=ae(u);break;case"shadowOpacity":i.sdwO=ae(u);break;case"angle":t==="gradientOverlay"||t==="patternFill"?i.Angl=Ln(u):i.lagl=Ln(u);break;case"altitude":i.Lald=Ln(u);break;case"soften":i.Sftn=ee(u,l);break;case"strength":i.srgR=ae(u);break;case"size":i.blur=ee(u,l);break;case"noise":i.Nose=ae(u);break;case"range":i.Inpr=ae(u);break;case"choke":i.Ckmt=ee(u,l);break;case"jitter":i.ShdN=ae(u);break;case"distance":i.Dstn=ee(u,l);break;case"scale":i["Scl "]=ae(u);break;case"pattern":i.Ptrn={"Nm ":u.name,Idnt:u.id};break;case"phase":i.phase={Hrzn:u.x,Vrtc:u.y};break;case"offset":i.Ofst={Hrzn:ae(u.x),Vrtc:ae(u.y)};break;case"contour":{i[t==="satin"?"MpgS":"TrnS"]={"Nm ":u.name,"Crv ":u.curve.map(function(s){return{Hrzn:s.x,Vrtc:s.y}})};break}case"gradient":i.Grad=bo(u);break;case"useTexture":case"useShape":case"layerConceals":case"present":case"showInDialog":case"antialiasGloss":i[l]=u;break;default:n&&console.log("Invalid effect key: '".concat(l,"', value:"),u)}}return i}function go(e){if(e.GrdF==="GrdF.CstS"){var t=e.Intr||4096;return{type:"solid",name:e["Nm "],smoothness:e.Intr/4096,colorStops:e.Clrs.map(function(n){return{color:Te(n["Clr "]),location:n.Lctn/t,midpoint:n.Mdpn/100}}),opacityStops:e.Trns.map(function(n){return{opacity:J(n.Opct),location:n.Lctn/t,midpoint:n.Mdpn/100}})}}else return{type:"noise",name:e["Nm "],roughness:e.Smth/4096,colorModel:at.decode(e.ClrS),randomSeed:e.RndS,restrictColors:!!e.VctC,addTransparency:!!e.ShTr,min:e["Mnm "].map(function(n){return n/100}),max:e["Mxm "].map(function(n){return n/100})}}function bo(e){var t,n;if(e.type==="solid"){var i=Math.round(((t=e.smoothness)!==null&&t!==void 0?t:1)*4096);return{"Nm ":e.name||"",GrdF:"GrdF.CstS",Intr:i,Clrs:e.colorStops.map(function(r){var o;return{"Clr ":Le(r.color),Type:"Clry.UsrS",Lctn:Math.round(r.location*i),Mdpn:Math.round(((o=r.midpoint)!==null&&o!==void 0?o:.5)*100)}}),Trns:e.opacityStops.map(function(r){var o;return{Opct:ae(r.opacity),Lctn:Math.round(r.location*i),Mdpn:Math.round(((o=r.midpoint)!==null&&o!==void 0?o:.5)*100)}})}}else return{GrdF:"GrdF.ClNs","Nm ":e.name||"",ShTr:!!e.addTransparency,VctC:!!e.restrictColors,ClrS:at.encode(e.colorModel),RndS:e.randomSeed||0,Smth:Math.round(((n=e.roughness)!==null&&n!==void 0?n:1)*4096),"Mnm ":(e.min||[0,0,0,0]).map(function(r){return r*100}),"Mxm ":(e.max||[1,1,1,1]).map(function(r){return r*100})}}function yo(e){var t=go(e.Grad);return t.style=ht.decode(e.Type),e.Dthr!==void 0&&(t.dither=e.Dthr),e.Rvrs!==void 0&&(t.reverse=e.Rvrs),e.Angl!==void 0&&(t.angle=et(e.Angl)),e["Scl "]!==void 0&&(t.scale=J(e["Scl "])),e.Algn!==void 0&&(t.align=e.Algn),e.Ofst!==void 0&&(t.offset={x:J(e.Ofst.Hrzn),y:J(e.Ofst.Vrtc)}),t}function So(e){var t={name:e.Ptrn["Nm "],id:e.Ptrn.Idnt};return e.Lnkd!==void 0&&(t.linked=e.Lnkd),e.phase!==void 0&&(t.phase={x:e.phase.Hrzn,y:e.phase.Vrtc}),t}function Rn(e){if("Grad"in e)return yo(e);if("Ptrn"in e)return Ne({type:"pattern"},So(e));if("Clr "in e)return{type:"color",color:Te(e["Clr "])};throw new Error("Invalid vector content")}function Fo(e){var t={};return e.dither!==void 0&&(t.Dthr=e.dither),e.reverse!==void 0&&(t.Rvrs=e.reverse),e.angle!==void 0&&(t.Angl=Ln(e.angle)),t.Type=ht.encode(e.style),e.align!==void 0&&(t.Algn=e.align),e.scale!==void 0&&(t["Scl "]=ae(e.scale)),e.offset&&(t.Ofst={Hrzn:ae(e.offset.x),Vrtc:ae(e.offset.y)}),t.Grad=bo(e),t}function xo(e){var t={Ptrn:{"Nm ":e.name||"",Idnt:e.id||""}};return e.linked!==void 0&&(t.Lnkd=!!e.linked),e.phase!==void 0&&(t.phase={Hrzn:e.phase.x,Vrtc:e.phase.y}),t}function Bn(e){return e.type==="color"?{key:"SoCo",descriptor:{"Clr ":Le(e.color)}}:e.type==="pattern"?{key:"PtFl",descriptor:xo(e)}:{key:"GdFl",descriptor:Fo(e)}}function Te(e){if("H "in e)return{h:Ql(e["H "]),s:e.Strt,b:e.Brgh};if("Rd "in e)return{r:e["Rd "],g:e["Grn "],b:e["Bl "]};if("Cyn "in e)return{c:e["Cyn "],m:e.Mgnt,y:e["Ylw "],k:e.Blck};if("Gry "in e)return{k:e["Gry "]};if("Lmnc"in e)return{l:e.Lmnc,a:e["A "],b:e["B "]};if("redFloat"in e)return{fr:e.redFloat,fg:e.greenFloat,fb:e.blueFloat};throw new Error("Unsupported color descriptor")}function Le(e){if(e){if("r"in e)return{_name:"",_classID:"RGBC","Rd ":e.r||0,"Grn ":e.g||0,"Bl ":e.b||0};if("fr"in e)return{_name:"",_classID:"RGBC",redFloat:e.fr,greenFloat:e.fg,blueFloat:e.fb};if("h"in e)return{_name:"",_classID:"HSBC","H ":Ln(e.h*360),Strt:e.s||0,Brgh:e.b||0};if("c"in e)return{_name:"",_classID:"CMYC","Cyn ":e.c||0,Mgnt:e.m||0,"Ylw ":e.y||0,Blck:e.k||0};if("l"in e)return{_name:"",_classID:"LABC",Lmnc:e.l||0,"A ":e.a||0,"B ":e.b||0};if("k"in e)return{_name:"",_classID:"GRYC","Gry ":e.k};throw new Error("Invalid color value")}else return{_name:"",_classID:"RGBC","Rd ":0,"Grn ":0,"Bl ":0}}function et(e){if(e===void 0)return 0;if(e.units!=="Angle")throw new Error("Invalid units: ".concat(e.units));return e.value}function J(e){if(e===void 0)return 1;if(e.units!=="Percent")throw new Error("Invalid units: ".concat(e.units));return e.value/100}function Ql(e){if(e===void 0)return 1;if(e.units==="Percent")return e.value/100;if(e.units==="Angle")return e.value/360;throw new Error("Invalid units: ".concat(e.units))}function q(e){var t=e.units,n=e.value;if(t!=="Pixels"&&t!=="Millimeters"&&t!=="Points"&&t!=="None"&&t!=="Picas"&&t!=="Inches"&&t!=="Centimeters"&&t!=="Density")throw new Error("Invalid units: ".concat(JSON.stringify({units:t,value:n})));return{value:n,units:t}}function Ze(e,t){return t===void 0&&(t="Pixels"),typeof e=="number"?{value:e,units:t}:q(e)}function Ln(e){return{units:"Angle",value:e||0}}function ae(e){return{units:"Percent",value:Math.round((e||0)*100)}}function xe(e){return{units:"Percent",value:(e||0)*100}}function ee(e,t){if(e==null)return{units:"Pixels",value:0};if(typeof e!="object")throw new Error("Invalid value: ".concat(JSON.stringify(e)," (key: ").concat(t,") (should have value and units)"));var n=e.units,i=e.value;if(typeof i!="number")throw new Error("Invalid value in ".concat(JSON.stringify(e)," (key: ").concat(t,")"));if(n!=="Pixels"&&n!=="Millimeters"&&n!=="Points"&&n!=="None"&&n!=="Picas"&&n!=="Inches"&&n!=="Centimeters"&&n!=="Density")throw new Error("Invalid units in ".concat(JSON.stringify(e)," (key: ").concat(t,")"));return{units:n,value:i}}function he(e){var t=e.numerator,n=e.denominator;return{numerator:t,denominator:n}}var nr=w("textGridding","none",{none:"None",round:"Rnd "}),On=w("Ornt","horizontal",{horizontal:"Hrzn",vertical:"Vrtc"}),tr=w("Annt","sharp",{none:"Anno",sharp:"antiAliasSharp",crisp:"AnCr",strong:"AnSt",smooth:"AnSm",platform:"antiAliasPlatformGray",platformLCD:"antiAliasPlatformLCD"}),Yt=w("warpStyle","none",{none:"warpNone",arc:"warpArc",arcLower:"warpArcLower",arcUpper:"warpArcUpper",arch:"warpArch",bulge:"warpBulge",shellLower:"warpShellLower",shellUpper:"warpShellUpper",flag:"warpFlag",wave:"warpWave",fish:"warpFish",rise:"warpRise",fisheye:"warpFisheye",inflate:"warpInflate",squeeze:"warpSqueeze",twist:"warpTwist",cylinder:"warpCylinder",custom:"warpCustom"}),ke=w("BlnM","normal",{normal:"Nrml",dissolve:"Dslv",darken:"Drkn",multiply:"Mltp","color burn":"CBrn","linear burn":"linearBurn","darker color":"darkerColor",lighten:"Lghn",screen:"Scrn","color dodge":"CDdg","linear dodge":"linearDodge","lighter color":"lighterColor",overlay:"Ovrl","soft light":"SftL","hard light":"HrdL","vivid light":"vividLight","linear light":"linearLight","pin light":"pinLight","hard mix":"hardMix",difference:"Dfrn",exclusion:"Xclu",subtract:"blendSubtraction",divide:"blendDivide",hue:"H ",saturation:"Strt",color:"Clr ",luminosity:"Lmns","linear height":"linearHeight",height:"Hght",subtraction:"Sbtr"}),ko=w("BESl","inner bevel",{"inner bevel":"InrB","outer bevel":"OtrB",emboss:"Embs","pillow emboss":"PlEb","stroke emboss":"strokeEmboss"}),Io=w("bvlT","smooth",{smooth:"SfBL","chisel hard":"PrBL","chisel soft":"Slmt"}),Co=w("BESs","up",{up:"In ",down:"Out "}),Do=w("BETE","softer",{softer:"SfBL",precise:"PrBL"}),Ao=w("IGSr","edge",{edge:"SrcE",center:"SrcC"}),ht=w("GrdT","linear",{linear:"Lnr ",radial:"Rdl ",angle:"Angl",reflected:"Rflc",diamond:"Dmnd"}),Po=w("animInterpStyle","linear",{linear:"Lnr ",hold:"hold"}),Eo=w("stdTrackID","opacity",{opacity:"opacityTrack",style:"styleTrack",sheetTransform:"sheetTransformTrack",sheetPosition:"sheetPositionTrack",globalLighting:"globalLightingTrack"}),To=w("gradientInterpolationMethodType","perceptual",{perceptual:"Perc",linear:"Lnr",classic:"Gcls",smooth:"Smoo"}),at=w("ClrS","rgb",{rgb:"RGBC",hsb:"HSBl",lab:"LbCl",hsl:"HSLC"}),pt=w("FStl","outside",{outside:"OutF",center:"CtrF",inside:"InsF"}),Lo=w("FrFl","color",{color:"SClr",gradient:"GrFl",pattern:"Ptrn"}),ir=w("ESliceType","image",{image:"Img ",noImage:"noImage"}),rr=w("ESliceHorzAlign","default",{default:"default"}),or=w("ESliceVertAlign","default",{default:"default"}),ar=w("ESliceOrigin","userGenerated",{userGenerated:"userGenerated",autoGenerated:"autoGenerated",layer:"layer"}),lr=w("ESliceBGColorType","none",{none:"None",matte:"matte",color:"Clr "}),sr=w("strokeStyleLineCapType","butt",{butt:"strokeStyleButtCap",round:"strokeStyleRoundCap",square:"strokeStyleSquareCap"}),ur=w("strokeStyleLineJoinType","miter",{miter:"strokeStyleMiterJoin",round:"strokeStyleRoundJoin",bevel:"strokeStyleBevelJoin"}),fr=w("strokeStyleLineAlignment","inside",{inside:"strokeStyleAlignInside",center:"strokeStyleAlignCenter",outside:"strokeStyleAlignOutside"}),Oo=w("BlrM","ispinmage",{spin:"Spn ",zoom:"Zm "}),Mo=w("BlrQ","good",{draft:"Drft",good:"Gd ",best:"Bst "}),wo=w("SmBM","normal",{normal:"SBMN","edge only":"SBME","overlay edge":"SBMO"}),Ro=w("SmBQ","medium",{low:"SBQL",medium:"SBQM",high:"SBQH"}),Bo=w("DspM","stretch to fit",{"stretch to fit":"StrF",tile:"Tile"}),mn=w("UndA","repeat edge pixels",{"wrap around":"WrpA","repeat edge pixels":"RptE"}),_o=w("Cnvr","rectangular to polar",{"rectangular to polar":"RctP","polar to rectangular":"PlrR"}),zo=w("RplS","medium",{small:"Sml ",medium:"Mdm ",large:"Lrg "}),No=w("SphM","normal",{normal:"Nrml","horizontal only":"HrzO","vertical only":"VrtO"}),Uo=w("Wvtp","sine",{sine:"WvSn",triangle:"WvTr",square:"WvSq"}),Go=w("ZZTy","pond ripples",{"around center":"ArnC","out from center":"OtFr","pond ripples":"PndR"}),Vo=w("Dstr","uniform",{uniform:"Unfr",gaussian:"Gsn "}),jo=w("Chnl","composite",{red:"Rd ",green:"Grn ",blue:"Bl ",composite:"Cmps"}),Ho=w("MztT","fine dots",{"fine dots":"FnDt","medium dots":"MdmD","grainy dots":"GrnD","coarse dots":"CrsD","short lines":"ShrL","medium lines":"MdmL","long lines":"LngL","short strokes":"ShSt","medium strokes":"MdmS","long strokes":"LngS"}),Wo=w("Lns ","50-300mm zoom",{"50-300mm zoom":"Zm ","32mm prime":"Nkn ","105mm prime":"Nkn1","movie prime":"PnVs"}),Xo=w("blurType","gaussian blur",{"gaussian blur":"GsnB","lens blur":"lensBlur","motion blur":"MtnB"}),Zo=w("DfsM","normal",{normal:"Nrml","darken only":"DrkO","lighten only":"LghO",anisotropic:"anisotropic"}),Yo=w("ExtT","blocks",{blocks:"Blks",pyramids:"Pyrm"}),qo=w("ExtR","random",{random:"Rndm","level-based":"LvlB"}),$o=w("FlCl","background color",{"background color":"FlBc","foreground color":"FlFr","inverse image":"FlIn","unaltered image":"FlSm"}),Ko=w("CntE","upper",{lower:"Lwr ",upper:"Upr "}),Jo=w("WndM","wind",{wind:"Wnd ",blast:"Blst",stagger:"Stgr"}),Qo=w("Drct","from the right",{left:"Left",right:"Rght"}),ea=w("IntE","odd lines",{"odd lines":"ElmO","even lines":"ElmE"}),na=w("IntC","interpolation",{duplication:"CrtD",interpolation:"CrtI"}),ta=w("FlMd","wrap around",{"set to transparent":"Bckg","repeat edge pixels":"Rpt ","wrap around":"Wrp "});w("prjM","fisheye",{fisheye:"fisP",perspective:"perP",auto:"auto","full spherical":"fusP"});var pn=function(){return pn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},pn.apply(this,arguments)},ia={};function Y(e,t,n,i){var r={key:e,has:t,read:n,write:i};ia[r.key]=r}var jn=[void 0,"PPI","PPCM"],Hn=[void 0,"Inches","Centimeters","Points","Picas","Columns"],cr="0123456789abcdef";function dr(e){return e<=57?e-48:e-87}function es(e,t){return dr(e.charCodeAt(t))<<4|dr(e.charCodeAt(t+1))}function qt(e,t){var n=fe(e,t);return Xl(n)}function $t(e,t){var n=Wl(t);qe(e,n)}Y(1061,function(e){return e.captionDigest!==void 0},function(e,t){for(var n="",i=0;i<16;i++){var r=L(e);n+=cr[r>>4],n+=cr[r&15]}t.captionDigest=n},function(e,t){for(var n=0;n<16;n++)T(e,es(t.captionDigest,n*2))});Y(1060,function(e){return e.xmpMetadata!==void 0},function(e,t,n){t.xmpMetadata=qt(e,n())},function(e,t){$t(e,t.xmpMetadata)});var Wn=w("Inte","perceptual",{perceptual:"Img ",saturation:"Grp ","relative colorimetric":"Clrm","absolute colorimetric":"AClr"});Y(1082,function(e){return e.printInformation!==void 0},function(e,t){var n,i,r=j(e);t.printInformation={printerName:r.printerName||"",renderingIntent:Wn.decode((n=r.Inte)!==null&&n!==void 0?n:"Inte.Img ")};var o=t.printInformation;r.PstS!==void 0&&(o.printerManagesColors=r.PstS),r["Nm "]!==void 0&&(o.printerProfile=r["Nm "]),r.MpBl!==void 0&&(o.blackPointCompensation=r.MpBl),r.printSixteenBit!==void 0&&(o.printSixteenBit=r.printSixteenBit),r.hardProof!==void 0&&(o.hardProof=r.hardProof),r.printProofSetup&&("Bltn"in r.printProofSetup?o.proofSetup={builtin:r.printProofSetup.Bltn.split(".")[1]}:o.proofSetup={profile:r.printProofSetup.profile,renderingIntent:Wn.decode((i=r.printProofSetup.Inte)!==null&&i!==void 0?i:"Inte.Img "),blackPointCompensation:!!r.printProofSetup.MpBl,paperWhite:!!r.printProofSetup.paperWhite})},function(e,t){var n,i,r=t.printInformation,o={};r.printerManagesColors?o.PstS=!0:(r.hardProof!==void 0&&(o.hardProof=!!r.hardProof),o.ClrS="ClrS.RGBC",o["Nm "]=(n=r.printerProfile)!==null&&n!==void 0?n:"CIE RGB"),o.Inte=Wn.encode(r.renderingIntent),r.printerManagesColors||(o.MpBl=!!r.blackPointCompensation),o.printSixteenBit=!!r.printSixteenBit,o.printerName=r.printerName||"",r.proofSetup&&"profile"in r.proofSetup?o.printProofSetup={profile:r.proofSetup.profile||"",Inte:Wn.encode(r.proofSetup.renderingIntent),MpBl:!!r.proofSetup.blackPointCompensation,paperWhite:!!r.proofSetup.paperWhite}:o.printProofSetup={Bltn:!((i=r.proofSetup)===null||i===void 0)&&i.builtin?"builtinProof.".concat(r.proofSetup.builtin):"builtinProof.proofCMYK"},H(e,"","printOutput",o)});Y(1005,function(e){return e.resolutionInfo!==void 0},function(e,t){var n=ge(e),i=k(e),r=k(e),o=ge(e),a=k(e),l=k(e);t.resolutionInfo={horizontalResolution:n,horizontalResolutionUnit:jn[i]||"PPI",widthUnit:Hn[r]||"Inches",verticalResolution:o,verticalResolutionUnit:jn[a]||"PPI",heightUnit:Hn[l]||"Inches"}},function(e,t){var n=t.resolutionInfo;ye(e,n.horizontalResolution||0),x(e,Math.max(1,jn.indexOf(n.horizontalResolutionUnit))),x(e,Math.max(1,Hn.indexOf(n.widthUnit))),ye(e,n.verticalResolution||0),x(e,Math.max(1,jn.indexOf(n.verticalResolutionUnit))),x(e,Math.max(1,Hn.indexOf(n.heightUnit)))});var hr=["centered","size to fit","user defined"];Y(1062,function(e){return e.printScale!==void 0},function(e,t){t.printScale={style:hr[V(e)],x:Pe(e),y:Pe(e),scale:Pe(e)}},function(e,t){var n=t.printScale,i=n.style,r=n.x,o=n.y,a=n.scale;Z(e,Math.max(0,hr.indexOf(i))),Ee(e,r||0),Ee(e,o||0),Ee(e,a||0)});Y(1006,function(e){return e.alphaChannelNames!==void 0},function(e,t,n){for(t.alphaChannelNames=[];n()>0;){var i=Ve(e,1);t.alphaChannelNames.push(i)}},function(e,t){for(var n=0,i=t.alphaChannelNames;n<i.length;n++){var r=i[n];nn(e,r,1)}});Y(1045,function(e){return e.alphaChannelNames!==void 0},function(e,t,n){for(t.alphaChannelNames=[];n()>0;)t.alphaChannelNames.push(se(e))},function(e,t){for(var n=0,i=t.alphaChannelNames;n<i.length;n++){var r=i[n];rn(e,r)}});Y(1053,function(e){return e.alphaIdentifiers!==void 0},function(e,t,n){for(t.alphaIdentifiers=[];n()>=4;)t.alphaIdentifiers.push(I(e))},function(e,t){for(var n=0,i=t.alphaIdentifiers;n<i.length;n++){var r=i[n];P(e,r)}});Y(1010,function(e){return e.backgroundColor!==void 0},function(e,t){return t.backgroundColor=oe(e)},function(e,t){return le(e,t.backgroundColor)});Y(1037,function(e){return e.globalAngle!==void 0},function(e,t){return t.globalAngle=M(e)},function(e,t){return G(e,t.globalAngle)});Y(1049,function(e){return e.globalAltitude!==void 0},function(e,t){return t.globalAltitude=I(e)},function(e,t){return P(e,t.globalAltitude)});Y(1011,function(e){return e.printFlags!==void 0},function(e,t){t.printFlags={labels:!!L(e),cropMarks:!!L(e),colorBars:!!L(e),registrationMarks:!!L(e),negative:!!L(e),flip:!!L(e),interpolate:!!L(e),caption:!!L(e),printFlags:!!L(e)}},function(e,t){var n=t.printFlags;T(e,n.labels?1:0),T(e,n.cropMarks?1:0),T(e,n.colorBars?1:0),T(e,n.registrationMarks?1:0),T(e,n.negative?1:0),T(e,n.flip?1:0),T(e,n.interpolate?1:0),T(e,n.caption?1:0),T(e,n.printFlags?1:0)});Y(1080,function(e){return e.countInformation!==void 0},function(e,t){var n=j(e);t.countInformation=n.countGroupList.map(function(i){return{color:{r:i["Rd "],g:i["Grn "],b:i["Bl "]},name:i["Nm "],size:i["Rds "],fontSize:i.fontSize,visible:i.Vsbl,points:i.countObjectList.map(function(r){return{x:r["X "],y:r["Y "]}})}})},function(e,t){var n={Vrsn:1,countGroupList:t.countInformation.map(function(i){return{"Rd ":i.color.r,"Grn ":i.color.g,"Bl ":i.color.b,"Nm ":i.name,"Rds ":i.size,fontSize:i.fontSize,Vsbl:i.visible,countObjectList:i.points.map(function(r){return{"X ":r.x,"Y ":r.y}})}})};H(e,"","Cnt ",n)});Y(1024,function(e){return e.layerState!==void 0},function(e,t){return t.layerState=k(e)},function(e,t){return x(e,t.layerState)});Y(1026,function(e){return e.layersGroup!==void 0},function(e,t,n){for(t.layersGroup=[];n()>0;)t.layersGroup.push(k(e))},function(e,t){for(var n=0,i=t.layersGroup;n<i.length;n++){var r=i[n];x(e,r)}});Y(1072,function(e){return e.layerGroupsEnabledId!==void 0},function(e,t,n){for(t.layerGroupsEnabledId=[];n()>0;)t.layerGroupsEnabledId.push(L(e))},function(e,t){for(var n=0,i=t.layerGroupsEnabledId;n<i.length;n++){var r=i[n];T(e,r)}});Y(1069,function(e){return e.layerSelectionIds!==void 0},function(e,t){var n=k(e);for(t.layerSelectionIds=[];n--;)t.layerSelectionIds.push(I(e))},function(e,t){x(e,t.layerSelectionIds.length);for(var n=0,i=t.layerSelectionIds;n<i.length;n++){var r=i[n];P(e,r)}});Y(1032,function(e){return e.gridAndGuidesInformation!==void 0},function(e,t){var n=I(e),i=I(e),r=I(e),o=I(e);if(n!==1)throw new Error("Invalid 1032 resource version: ".concat(n));t.gridAndGuidesInformation={grid:{horizontal:i,vertical:r},guides:[]};for(var a=0;a<o;a++)t.gridAndGuidesInformation.guides.push({location:I(e)/32,direction:L(e)?"horizontal":"vertical"})},function(e,t){var n=t.gridAndGuidesInformation,i=n.grid||{horizontal:18*32,vertical:18*32},r=n.guides||[];P(e,1),P(e,i.horizontal),P(e,i.vertical),P(e,r.length);for(var o=0,a=r;o<a.length;o++){var l=a[o];P(e,l.location*32),T(e,l.direction==="horizontal"?1:0)}});Y(1065,function(e){return e.layerComps!==void 0},function(e,t){var n=j(e,!0);t.layerComps={list:[]};for(var i=0,r=n.list;i<r.length;i++){var o=r[i];t.layerComps.list.push({id:o.compID,name:o["Nm "],capturedInfo:o.capturedInfo}),"comment"in o&&(t.layerComps.list[t.layerComps.list.length-1].comment=o.comment)}"lastAppliedComp"in n&&(t.layerComps.lastApplied=n.lastAppliedComp)},function(e,t){for(var n=t.layerComps,i={list:[]},r=0,o=n.list;r<o.length;r++){var a=o[r],l={};l._classID="Comp",l["Nm "]=a.name,"comment"in a&&(l.comment=a.comment),l.compID=a.id,l.capturedInfo=a.capturedInfo,i.list.push(l)}"lastApplied"in n&&(i.lastAppliedComp=n.lastApplied),H(e,"","CompList",i)});var pr=["normal",void 0,void 0,void 0,void 0,void 0,void 0,"multiply","screen",void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"difference"];Y(1078,function(e){return e.onionSkins!==void 0},function(e,t){var n=j(e);t.onionSkins={enabled:n.enab,framesBefore:n.numBefore,framesAfter:n.numAfter,frameSpacing:n.Spcn,minOpacity:n.minOpacity/100,maxOpacity:n.maxOpacity/100,blendMode:pr[n.BlnM]||"normal"}},function(e,t){var n=t.onionSkins,i={Vrsn:1,enab:n.enabled,numBefore:n.framesBefore,numAfter:n.framesAfter,Spcn:n.frameSpacing,minOpacity:n.minOpacity*100|0,maxOpacity:n.maxOpacity*100|0,BlnM:Math.max(0,pr.indexOf(n.blendMode))};H(e,"","null",i)});Y(1075,function(e){return e.timelineInformation!==void 0},function(e,t){var n,i,r=j(e);t.timelineInformation={enabled:r.enab,frameStep:he(r.frameStep),frameRate:r.frameRate,time:he(r.time),duration:he(r.duration),workInTime:he(r.workInTime),workOutTime:he(r.workOutTime),repeats:r.LCnt,hasMotion:r.hasMotion,globalTracks:vo(r.globalTrackList,!!e.logMissingFeatures)},!((i=(n=r.audioClipGroupList)===null||n===void 0?void 0:n.audioClipGroupList)===null||i===void 0)&&i.length&&(t.timelineInformation.audioClipGroups=r.audioClipGroupList.audioClipGroupList.map(function(o){return{id:o.groupID,muted:o.muted,audioClips:o.audioClipList.map(function(a){var l=a.clipID,u=a.timeScope,s=a.muted,f=a.audioLevel,h=a.frameReader;return{id:l,start:he(u.Strt),duration:he(u.duration),inTime:he(u.inTime),outTime:he(u.outTime),muted:s,audioLevel:f,frameReader:{type:h.frameReaderType,mediaDescriptor:h.mediaDescriptor,link:{name:h["Lnk "]["Nm "],fullPath:h["Lnk "].fullPath,relativePath:h["Lnk "].relPath}}}})}}))},function(e,t){var n,i=t.timelineInformation,r={Vrsn:1,enab:i.enabled,frameStep:i.frameStep,frameRate:i.frameRate,time:i.time,duration:i.duration,workInTime:i.workInTime,workOutTime:i.workOutTime,LCnt:i.repeats,globalTrackList:mo(i.globalTracks),audioClipGroupList:{audioClipGroupList:(n=i.audioClipGroups)===null||n===void 0?void 0:n.map(function(o){return{groupID:o.id,muted:o.muted,audioClipList:o.audioClips.map(function(a){return{clipID:a.id,timeScope:{Vrsn:1,Strt:a.start,duration:a.duration,inTime:a.inTime,outTime:a.outTime},frameReader:{frameReaderType:a.frameReader.type,descVersion:1,"Lnk ":{descVersion:1,"Nm ":a.frameReader.link.name,fullPath:a.frameReader.link.fullPath,relPath:a.frameReader.link.relativePath},mediaDescriptor:a.frameReader.mediaDescriptor},muted:a.muted,audioLevel:a.audioLevel}})}})},hasMotion:i.hasMotion};H(e,"","null",r,"anim")});Y(1076,function(e){return e.sheetDisclosure!==void 0},function(e,t){var n=j(e);t.sheetDisclosure={},n.sheetTimelineOptions&&(t.sheetDisclosure.sheetTimelineOptions=n.sheetTimelineOptions.map(function(i){return{sheetID:i.sheetID,sheetDisclosed:i.sheetDisclosed,lightsDisclosed:i.lightsDisclosed,meshesDisclosed:i.meshesDisclosed,materialsDisclosed:i.materialsDisclosed}}))},function(e,t){var n=t.sheetDisclosure,i={Vrsn:1};n.sheetTimelineOptions&&(i.sheetTimelineOptions=n.sheetTimelineOptions.map(function(r){return{Vrsn:2,sheetID:r.sheetID,sheetDisclosed:r.sheetDisclosed,lightsDisclosed:r.lightsDisclosed,meshesDisclosed:r.meshesDisclosed,materialsDisclosed:r.materialsDisclosed}})),H(e,"","null",i)});Y(1054,function(e){return e.urlsList!==void 0},function(e,t){var n=I(e);t.urlsList=[];for(var i=0;i<n;i++){var r=Q(e);if(r!=="slic"&&e.throwForMissingFeatures)throw new Error("Unknown long");var o=I(e),a=se(e);t.urlsList.push({id:o,url:a,ref:"slice"})}},function(e,t){var n=t.urlsList;P(e,n.length);for(var i=0;i<n.length;i++)N(e,"slic"),P(e,n[i].id),Se(e,n[i].url)});function vr(e){return{"Top ":e.top,Left:e.left,Btom:e.bottom,Rght:e.right}}function mr(e){return{top:e["Top "],left:e.Left,bottom:e.Btom,right:e.Rght}}function Xn(e,t){return e[Math.max(0,Math.min(e.length-1,t))]}var gr=["autoGenerated","layer","userGenerated"],br=["noImage","image"],Zn=["default"];Y(1050,function(e){return e.slices?e.slices.length:0},function(e,t){var n=I(e);if(n===6){t.slices||(t.slices=[]);var i=M(e),r=M(e),o=M(e),a=M(e),l=se(e),u=I(e);t.slices.push({bounds:{top:i,left:r,bottom:o,right:a},groupName:l,slices:[]});for(var s=t.slices[t.slices.length-1].slices,f=0;f<u;f++){var h=I(e),p=I(e),d=Xn(gr,I(e)),m=d=="layer"?I(e):0,v=se(e),F=Xn(br,I(e)),b=M(e),g=M(e),y=M(e),S=M(e),C=se(e),_=se(e),A=se(e),R=se(e),U=!!L(e),B=se(e),z=Xn(Zn,I(e)),re=Xn(Zn,I(e)),de=L(e),te=L(e),ue=L(e),He=L(e),$e=de+te+ue+He===0?"none":de===0?"matte":"color";s.push({id:h,groupId:p,origin:d,associatedLayerId:m,name:v,target:_,message:A,altTag:R,cellTextIsHTML:U,cellText:B,horizontalAlignment:z,verticalAlignment:re,type:F,url:C,bounds:{top:g,left:b,bottom:S,right:y},backgroundColorType:$e,backgroundColor:{r:te,g:ue,b:He,a:de}})}var pe=j(e);pe.slices.forEach(function(We){var X=s.find(function(an){return We.sliceID==an.id});X&&(X.topOutset=We.topOutset,X.leftOutset=We.leftOutset,X.bottomOutset=We.bottomOutset,X.rightOutset=We.rightOutset)})}else if(n===7||n===8){var pe=j(e);t.slices||(t.slices=[]),t.slices.push({groupName:pe.baseName,bounds:mr(pe.bounds),slices:pe.slices.map(function(X){return pn(pn({},X["Nm "]?{name:X["Nm "]}:{}),{id:X.sliceID,groupId:X.groupID,associatedLayerId:0,origin:ar.decode(X.origin),type:ir.decode(X.Type),bounds:mr(X.bounds),url:X.url,target:X.null,message:X.Msge,altTag:X.altTag,cellTextIsHTML:X.cellTextIsHTML,cellText:X.cellText,horizontalAlignment:rr.decode(X.horzAlign),verticalAlignment:or.decode(X.vertAlign),backgroundColorType:lr.decode(X.bgColorType),backgroundColor:X.bgColor?{r:X.bgColor["Rd "],g:X.bgColor["Grn "],b:X.bgColor["Bl "],a:X.bgColor.alpha}:{r:0,g:0,b:0,a:0},topOutset:X.topOutset||0,leftOutset:X.leftOutset||0,bottomOutset:X.bottomOutset||0,rightOutset:X.rightOutset||0})})})}else throw new Error("Invalid slices version (".concat(n,")"))},function(e,t,n){var i=t.slices[n],r=i.bounds,o=i.groupName,a=i.slices;P(e,6),G(e,r.top),G(e,r.left),G(e,r.bottom),G(e,r.right),Se(e,o),P(e,a.length);for(var l=0;l<a.length;l++){var u=a[l],s=u.backgroundColor,f=s.a,h=s.r,p=s.g,d=s.b;u.backgroundColorType==="none"?f=h=p=d=0:u.backgroundColorType==="matte"&&(f=0,h=p=d=255),P(e,u.id),P(e,u.groupId),P(e,gr.indexOf(u.origin)),u.origin==="layer"&&P(e,u.associatedLayerId),Se(e,u.name||""),P(e,br.indexOf(u.type)),G(e,u.bounds.left),G(e,u.bounds.top),G(e,u.bounds.right),G(e,u.bounds.bottom),Se(e,u.url),Se(e,u.target),Se(e,u.message),Se(e,u.altTag),T(e,u.cellTextIsHTML?1:0),Se(e,u.cellText),P(e,Zn.indexOf(u.horizontalAlignment)),P(e,Zn.indexOf(u.verticalAlignment)),T(e,f),T(e,h),T(e,p),T(e,d)}var m={bounds:vr(r),slices:[]};a.forEach(function(v){var F=pn(pn({sliceID:v.id,groupID:v.groupId,origin:ar.encode(v.origin),Type:ir.encode(v.type),bounds:vr(v.bounds)},v.name?{"Nm ":v.name}:{}),{url:v.url,null:v.target,Msge:v.message,altTag:v.altTag,cellTextIsHTML:v.cellTextIsHTML,cellText:v.cellText,horzAlign:rr.encode(v.horizontalAlignment),vertAlign:or.encode(v.verticalAlignment),bgColorType:lr.encode(v.backgroundColorType)});if(v.backgroundColorType==="color"){var b=v.backgroundColor,g=b.r,y=b.g,S=b.b,C=b.a;F.bgColor={"Rd ":g,"Grn ":y,"Bl ":S,alpha:C}}F.topOutset=v.topOutset||0,F.leftOutset=v.leftOutset||0,F.bottomOutset=v.bottomOutset||0,F.rightOutset=v.rightOutset||0,m.slices.push(F)}),H(e,"","null",m,"slices")});Y(1064,function(e){return e.pixelAspectRatio!==void 0},function(e,t){if(I(e)>2)throw new Error("Invalid pixelAspectRatio version");t.pixelAspectRatio={aspect:Ie(e)}},function(e,t){P(e,2),we(e,t.pixelAspectRatio.aspect)});Y(1041,function(e){return e.iccUntaggedProfile!==void 0},function(e,t){t.iccUntaggedProfile=!!L(e)},function(e,t){T(e,t.iccUntaggedProfile?1:0)});Y(1044,function(e){return e.idsSeedNumber!==void 0},function(e,t){return t.idsSeedNumber=I(e)},function(e,t){return P(e,t.idsSeedNumber)});Y(1036,function(e){return e.thumbnail!==void 0||e.thumbnailRaw!==void 0},function(e,t,n){var i=I(e),r=I(e),o=I(e);I(e),I(e),I(e);var a=k(e),l=k(e);if(i!==1||a!==24||l!==1){e.logMissingFeatures&&e.log("Invalid thumbnail data (format: ".concat(i,", bitsPerPixel: ").concat(a,", planes: ").concat(l,")")),E(e,n());return}var u=n(),s=fe(e,u);e.useRawThumbnail?t.thumbnailRaw={width:r,height:o,data:s}:s.byteLength&&(t.thumbnail=ao(s))},function(e,t){var n,i=0,r=0,o=new Uint8Array(0);if(t.thumbnailRaw)i=t.thumbnailRaw.width,r=t.thumbnailRaw.height,o=t.thumbnailRaw.data;else try{var a=(n=t.thumbnail.toDataURL("image/jpeg",1))===null||n===void 0?void 0:n.substring(23);a&&(o=it.toByteArray(a),i=t.thumbnail.width,r=t.thumbnail.height)}catch{}var l=24,u=Math.floor((i*l+31)/32)*4,s=1,f=u*r*s,h=o.length;P(e,1),P(e,i),P(e,r),P(e,u),P(e,f),P(e,h),x(e,l),x(e,s),qe(e,o)});Y(1057,function(e){return e.versionInfo!==void 0},function(e,t,n){var i=I(e);if(i!==1)throw new Error("Invalid versionInfo version");t.versionInfo={hasRealMergedData:!!L(e),writerName:se(e),readerName:se(e),fileVersion:I(e)},E(e,n())},function(e,t){var n=t.versionInfo;P(e,1),T(e,n.hasRealMergedData?1:0),Se(e,n.writerName),Se(e,n.readerName),P(e,n.fileVersion)});Y(7e3,function(e){return e.imageReadyVariables!==void 0},function(e,t,n){t.imageReadyVariables=qt(e,n())},function(e,t){$t(e,t.imageReadyVariables)});Y(7001,function(e){return e.imageReadyDataSets!==void 0},function(e,t,n){t.imageReadyDataSets=qt(e,n())},function(e,t){$t(e,t.imageReadyDataSets)});Y(1088,function(e){return e.pathSelectionState!==void 0},function(e,t,n){var i=j(e);t.pathSelectionState=i.null},function(e,t){var n={null:t.pathSelectionState};H(e,"","null",n)});var yr=w("FrmD","",{auto:"Auto",none:"None",dispose:"Disp"});Y(4e3,function(e){return e.animations!==void 0},function(e,t,n){var i=Q(e);if(i==="mani")Ye(e,"IRFR"),Fe(e,1,function(o){for(var a=function(){Ye(e,"8BIM");var l=Q(e);Fe(e,1,function(u){if(l==="AnDs"){var s=j(e);t.animations={frames:s.FrIn.map(function(h){return{id:h.FrID,delay:(h.FrDl||0)/100,dispose:h.FrDs?yr.decode(h.FrDs):"auto"}}),animations:s.FSts.map(function(h){return{id:h.FsID,frames:h.FsFr,repeats:h.LCnt,activeFrame:h.AFrm||0}})}}else if(l==="Roll"){var f=fe(e,u());e.logDevFeatures&&e.log("#4000 Roll",f)}else e.logMissingFeatures&&e.log("Unhandled subsection in #4000",l)})};o()>0;)a()});else if(i==="mopt"){var r=fe(e,n());e.logDevFeatures&&e.log("#4000 mopt",r)}else e.logMissingFeatures&&e.log("Unhandled key in #4000:",i)},function(e,t){t.animations&&(N(e,"mani"),N(e,"IRFR"),en(e,1,function(){N(e,"8BIM"),N(e,"AnDs"),en(e,1,function(){for(var n={FrIn:[],FSts:[]},i=0;i<t.animations.frames.length;i++){var r=t.animations.frames[i],o={FrID:r.id};r.delay&&(o.FrDl=r.delay*100|0),o.FrDs=yr.encode(r.dispose),n.FrIn.push(o)}for(var i=0;i<t.animations.animations.length;i++){var a=t.animations.animations[i],l={FsID:a.id,AFrm:a.activeFrame|0,FsFr:a.frames,LCnt:a.repeats|0};n.FSts.push(l)}H(e,"","null",n)})}))});var ra=[0,1,3],ns=["bitmap","grayscale","indexed","RGB","CMYK","multichannel","duotone","lab"];function Gt(e){for(var t=e.width*e.height*4,n=0;n<t;n+=4)e.data[n+1]=e.data[n],e.data[n+2]=e.data[n]}function Sr(e,t,n){var i=new DataView(e,t,n);return{view:i,offset:0,strict:!1,debug:!1,large:!1,globalAlpha:!1,log:console.log}}function Vt(e,t){if(e.strict)throw new Error(t);e.debug&&e.log(t)}function L(e){return e.offset+=1,e.view.getUint8(e.offset-1)}function ts(e){return e.view.getUint8(e.offset)}function V(e){return e.offset+=2,e.view.getInt16(e.offset-2,!1)}function k(e){return e.offset+=2,e.view.getUint16(e.offset-2,!1)}function is(e){return e.offset+=2,e.view.getUint16(e.offset-2,!0)}function M(e){return e.offset+=4,e.view.getInt32(e.offset-4,!1)}function Fr(e){return e.offset+=4,e.view.getInt32(e.offset-4,!0)}function I(e){return e.offset+=4,e.view.getUint32(e.offset-4,!1)}function Pe(e){return e.offset+=4,e.view.getFloat32(e.offset-4,!1)}function Ie(e){return e.offset+=8,e.view.getFloat64(e.offset-8,!1)}function ge(e){return M(e)/65536}function De(e){return M(e)/(1<<24)}function fe(e,t){var n=e.view.byteOffset+e.offset;if(e.offset+=t,n+t>e.view.buffer.byteLength){if(Vt(e,"Reading bytes exceeding buffer length"),t>100*1024*1024)throw new Error("Reading past end of file");var i=new Uint8Array(t),r=Math.min(t,e.view.byteLength-n);return r>0&&i.set(new Uint8Array(e.view.buffer,n,r)),i}else return new Uint8Array(e.view.buffer,n,t)}function Q(e){return oa(e,4)}function rs(e,t){var n=String.fromCharCode(e.view.getUint8(t))+String.fromCharCode(e.view.getUint8(t+1))+String.fromCharCode(e.view.getUint8(t+2))+String.fromCharCode(e.view.getUint8(t+3));return n=="8BIM"||n=="8B64"}function Ve(e,t){for(var n=L(e),i=n?oa(e,n):"";++n%t;)e.offset++;return i}function se(e){var t=I(e);return Kt(e,t)}function Kt(e,t){for(var n="";t--;){var i=k(e);(i||t>0)&&(n+=String.fromCharCode(i))}return n}function os(e,t){for(var n="";t--;){var i=is(e);(i||t>0)&&(n+=String.fromCharCode(i))}return n}function Jt(e,t){for(var n="";t--;)n+=String.fromCharCode(L(e));return n}function E(e,t){e.offset+=t}function Ye(e,t,n){var i=e.offset,r=Q(e);if(r!==t&&r!==n)throw new Error("Invalid signature: '".concat(r,"' at 0x").concat(i.toString(16)))}function oa(e,t){for(var n=fe(e,t),i="",r=0;r<n.length;r++)i+=String.fromCharCode(n[r]);return i}function xr(e){return e==="8BIM"||e==="MeSa"||e==="AgHg"||e==="PHUT"||e==="DCSR"}function as(e,t){var n;t===void 0&&(t={}),Ye(e,"8BPS");var i=k(e);if(i!==1&&i!==2)throw new Error("Invalid PSD file version: ".concat(i));E(e,6);var r=k(e),o=I(e),a=I(e),l=k(e),u=k(e),s=i===1?3e4:3e5;if(a>s||o>s)throw new Error("Invalid size: ".concat(a,"x").concat(o));if(r>16)throw new Error("Invalid channel count: ".concat(r));if(![1,8,16,32].includes(l))throw new Error("Invalid bitsPerChannel: ".concat(l));if(ra.indexOf(u)===-1)throw new Error("Color mode not supported: ".concat((n=ns[u])!==null&&n!==void 0?n:u));var f={width:a,height:o,channels:r,bitsPerChannel:l,colorMode:u};Object.assign(e,t),e.large=i===2,e.globalAlpha=!1;var h=[0,1,-1,2,-2,3,-3,4,-4];Fe(e,1,function(m){m()&&E(e,m())}),Fe(e,1,function(m){for(var v=function(){for(var F=e.offset,b="",g=0,y=h;g<y.length;g++){var S=y[g];try{e.offset=F+S,b=Q(e)}catch{}if(xr(b))break}if(!xr(b))throw new Error("Invalid signature: '".concat(b,"' at 0x").concat(F.toString(16)));var C=k(e);Ve(e,2),Fe(e,2,function(_){var A=ia[C],R=C===1036&&!!e.skipThumbnail;if(f.imageResources||(f.imageResources={}),A&&!R)try{A.read(e,f.imageResources,_)}catch(U){if(e.throwForMissingFeatures)throw U;E(e,_())}else E(e,_())})};m()>0;)v()}),Fe(e,1,function(m){if(Fe(e,2,function(F){Qt(e,f),E(e,F())},void 0,e.large),m()>0){var v=cs(e);v&&(f.globalLayerMaskInfo=v)}else E(e,m());for(;m()>0;){for(;m()&&ts(e)===0;)E(e,1);m()>=12?aa(e,f,f):E(e,m())}},void 0,e.large);var p=f.children&&f.children.length,d=e.skipCompositeImageData&&(e.skipLayerImageData||p);return d||ds(e,f),f}function Qt(e,t){var n,i,r=V(e);r<0&&(e.globalAlpha=!0,r=-r);for(var o=[],a=[],l=0;l<r;l++){var u=ls(e,t),s=u.layer,f=u.channels;o.push(s),a.push(f)}if(!e.skipLayerImageData)for(var l=0;l<r;l++)fs(e,t,o[l],a[l]);t.children||(t.children=[]);for(var h=[t],l=o.length-1;l>=0;l--){var p=o[l],d=p.sectionDivider?p.sectionDivider.type:0;d===1||d===2?(p.opened=d===1,p.children=[],!((n=p.sectionDivider)===null||n===void 0)&&n.key&&(p.blendMode=(i=gn[p.sectionDivider.key])!==null&&i!==void 0?i:p.blendMode),h[h.length-1].children.unshift(p),h.push(p)):d===3?h.pop():h[h.length-1].children.unshift(p)}}function ls(e,t){var n={};n.top=M(e),n.left=M(e),n.bottom=M(e),n.right=M(e);for(var i=k(e),r=[],o=0;o<i;o++){var a=V(e),l=I(e);if(e.large){if(l!==0)throw new Error("Sizes larger than 4GB are not supported");l=I(e)}r.push({id:a,length:l})}Ye(e,"8BIM");var u=Q(e);if(!gn[u])throw new Error("Invalid blend mode: '".concat(u,"'"));n.blendMode=gn[u],n.opacity=L(e)/255,n.clipping=L(e)===1;var s=L(e);return n.transparencyProtected=(s&1)!==0,n.hidden=(s&2)!==0,s&32&&(n.effectsOpen=!0),E(e,1),Fe(e,1,function(f){var h=ss(e);for(h&&(n.mask=h),us(e),n.name=Ve(e,1);f()>4&&!rs(e,e.offset);)e.offset++;for(;f()>=12;)aa(e,n,t);E(e,f())}),{layer:n,channels:r}}function ss(e){return Fe(e,1,function(t){if(t()){var n={};n.top=M(e),n.left=M(e),n.bottom=M(e),n.right=M(e),n.defaultColor=L(e);var i=L(e);if(n.positionRelativeToLayer=(i&1)!==0,n.disabled=(i&2)!==0,n.fromVectorData=(i&8)!==0,i&16){var r=L(e);r&1&&(n.userMaskDensity=L(e)/255),r&2&&(n.userMaskFeather=Ie(e)),r&4&&(n.vectorMaskDensity=L(e)/255),r&8&&(n.vectorMaskFeather=Ie(e))}return t()>2&&e.logMissingFeatures&&e.log("Unhandled extra real user mask params"),E(e,t()),n}})}function us(e){return Fe(e,1,function(t){for(var n=I(e),i=I(e),r=[];t()>0;){var o=I(e),a=I(e);r.push({sourceRange:o,destRange:a})}return{compositeGrayBlendSource:n,compositeGraphBlendDestinationRange:i,ranges:r}})}function fs(e,t,n,i){var r,o,a,l,u=(n.right||0)-(n.left||0),s=(n.bottom||0)-(n.top||0),f=t.colorMode===4,h;if(u&&s)if(f){if(t.bitsPerChannel!==8)throw new Error("bitsPerChannel Not supproted");h={width:u,height:s,data:new Uint8ClampedArray(u*s*5)};for(var p=4;p<h.data.byteLength;p+=5)h.data[p]=255}else h=jt(u,s,(r=t.bitsPerChannel)!==null&&r!==void 0?r:8),zt(h);for(var d=0,m=i;d<m.length;d++){var v=m[d];if(v.length!==0){if(v.length<2)throw new Error("Invalid channel length");var F=e.offset,b=k(e);if(b>3&&(e.offset-=1,b=k(e)),b>3&&(e.offset-=3,b=k(e)),b>3)throw new Error("Invalid compression: ".concat(b));if(v.id===-2){var g=n.mask;if(!g)throw new Error("Missing layer mask data");var y=(g.right||0)-(g.left||0),S=(g.bottom||0)-(g.top||0);if(y&&S){var C=jt(y,S,(o=t.bitsPerChannel)!==null&&o!==void 0?o:8);zt(C),e.offset,kr(e,v.length,C,b,y,S,(a=t.bitsPerChannel)!==null&&a!==void 0?a:8,0,e.large,4),Gt(C),e.useImageData?g.imageData=C:g.canvas=Nt(C)}}else if(v.id===-3)e.logMissingFeatures&&e.log("RealUserMask not supported"),e.offset=F+v.length;else{var _=Gl(v.id,f),A=h;if(_<0&&(A=void 0,e.throwForMissingFeatures))throw new Error("Channel not supported: ".concat(v.id));kr(e,v.length,A,b,u,s,(l=t.bitsPerChannel)!==null&&l!==void 0?l:8,_,e.large,f?5:4),e.offset=F+v.length,A&&t.colorMode===1&&Gt(A)}}}if(h){if(f){var R=h;h=Zt(R.width,R.height),la(R,h,!1)}e.useImageData?n.imageData=h:n.canvas=Nt(h)}}function kr(e,t,n,i,r,o,a,l,u,s){if(i===0)ua(e,n,r,o,a,s,l);else if(i===1)nt(e,n,r,o,a,s,[l],u);else if(i===2)Ir(e,t,n,r,o,a,s,l,!1);else if(i===3)Ir(e,t,n,r,o,a,s,l,!0);else throw new Error("Invalid Compression type: ".concat(i))}function cs(e){return Fe(e,1,function(t){if(t()){var n=k(e),i=k(e),r=k(e),o=k(e),a=k(e),l=k(e)/255,u=L(e);return E(e,t()),{overlayColorSpace:n,colorSpace1:i,colorSpace2:r,colorSpace3:o,colorSpace4:a,opacity:l,kind:u}}})}function aa(e,t,n){var i=Q(e);if(i!=="8BIM"&&i!=="8B64")throw new Error("Invalid signature: '".concat(i,"' at 0x").concat((e.offset-4).toString(16)));var r=Q(e),o=i==="8B64"||e.large&&Nl.indexOf(r)!==-1;Fe(e,2,function(a){var l=lt[r];if(l)try{l.read(e,t,a,n)}catch(u){if(e.throwForMissingFeatures)throw u}else e.logMissingFeatures&&e.log("Unhandled additional info: ".concat(r)),E(e,a());a()&&(e.logMissingFeatures&&e.log("Unread ".concat(a()," bytes left for additional info: ").concat(r)),E(e,a()))},!1,o)}function jt(e,t,n){if(n===1||n===8)return Zt(e,t);if(n===16)return{width:e,height:t,data:new Uint16Array(e*t*4)};if(n===32)return{width:e,height:t,data:new Float32Array(e*t*4)};throw new Error("Invalid bitDepth (".concat(n,")"))}function ds(e,t){var n,i,r=k(e),o=(n=t.bitsPerChannel)!==null&&n!==void 0?n:8;if(ra.indexOf(t.colorMode)===-1)throw new Error("Color mode not supported: ".concat(t.colorMode));if(r!==0&&r!==1)throw new Error("Compression type not supported: ".concat(r));var a=jt(t.width,t.height,o);switch(zt(a),t.colorMode){case 0:{if(o!==1)throw new Error("Invalid bitsPerChannel for bitmap color mode");var l=void 0;if(r===0)l=fe(e,Math.ceil(t.width/8)*t.height);else if(r===1)l=new Uint8Array(t.width*t.height),nt(e,{data:l,width:t.width,height:t.height},t.width,t.height,8,1,[0],e.large);else throw new Error("Bitmap compression not supported: ".concat(r));Vl(l,a.data,t.width,t.height);break}case 3:case 1:{var u=t.colorMode===1?[0]:[0,1,2];if(t.channels&&t.channels>3)for(var s=3;s<t.channels;s++)u.push(s);else e.globalAlpha&&u.push(3);if(r===0)for(var s=0;s<u.length;s++)ua(e,a,t.width,t.height,o,4,u[s]);else r===1&&(e.offset,nt(e,a,t.width,t.height,o,4,u,e.large));t.colorMode===1&&Gt(a);break}case 4:{if(t.bitsPerChannel!==8)throw new Error("bitsPerChannel Not supproted");if(t.channels!==4)throw new Error("Invalid channel count");var u=[0,1,2,3];if(e.globalAlpha&&u.push(4),r===0)throw new Error("Not implemented");if(r===1){var f={width:a.width,height:a.height,data:new Uint8Array(a.width*a.height*5)};e.offset,nt(e,f,t.width,t.height,(i=t.bitsPerChannel)!==null&&i!==void 0?i:8,5,u,e.large),la(f,a,!0)}break}default:throw new Error("Color mode not supported: ".concat(t.colorMode))}if(e.globalAlpha){if(t.bitsPerChannel!==8)throw new Error("bitsPerChannel Not supproted");for(var h=a.data,p=a.width*a.height*4,s=0;s<p;s+=4){var d=h[s+3];if(d!=0&&d!=255){var m=d/255,v=1/m,F=255*(1-v);h[s+0]=h[s+0]*v+F,h[s+1]=h[s+1]*v+F,h[s+2]=h[s+2]*v+F}}}e.useImageData?t.imageData=a:t.canvas=Nt(a)}function la(e,t,n){for(var i=t.width*t.height*4,r=e.data,o=t.data,a=0,l=0;l<i;a+=5,l+=4){var u=r[a],s=r[a+1],f=r[a+2],h=r[a+3];o[l]=(u*h|0)/255|0,o[l+1]=(s*h|0)/255|0,o[l+2]=(f*h|0)/255|0,o[l+3]=n?255-r[a+4]:r[a+4]}}function hs(e,t){if(e.byteLength/e.length!==t.byteLength/t.length)throw new Error("Invalid array types")}function sa(e,t){if(t===8)return e;if(t===16)if(e.byteOffset%2){var n=new Uint16Array(e.byteLength/2);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength).set(e),n}else return new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);else if(t===32)if(e.byteOffset%4){var n=new Float32Array(e.byteLength/4);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength).set(e),n}else return new Float32Array(e.buffer,e.byteOffset,e.byteLength/4);else throw new Error("Invalid bitDepth (".concat(t,")"))}function Ht(e,t,n,i){hs(e.data,t);for(var r=e.width*e.height,o=e.data,a=0,l=n|0;a<r;a++,l=l+i|0)o[l]=t[a]}function ua(e,t,n,i,r,o,a){var l=fe(e,n*i*Math.floor(r/8));if(r==32)for(var u=0;u<l.byteLength;u+=4){var s=l[u+0],f=l[u+1],h=l[u+2],p=l[u+3];l[u+0]=p,l[u+1]=h,l[u+2]=f,l[u+3]=s}var d=sa(l,r);t&&a<o&&Ht(t,d,a,o)}function Pt(e,t,n,i){for(var r=0;r<n;r++)for(var o=r*t,a=1,l=o+1;a<t;a++,l++)e[l]=(e[l-1]+e[l])%i}function Ir(e,t,n,i,r,o,a,l,u){var s=fe(e,t),f=zl(s);if(n&&l<a){var h=sa(f,o);if(o===8)u&&Pt(f,i,r,256),Ht(n,f,l,a);else if(o===16)u&&Pt(h,i,r,65536),Ht(n,h,l,a);else if(o===32){u&&Pt(f,i*4,r,256);for(var p=l,d=new Uint32Array(n.data.buffer,n.data.byteOffset,n.data.length),m=0;m<r;m++)for(var v=i*4*m,F=0;F<i;F++,v++,p+=a){var b=v+i,g=b+i,y=g+i;d[p]=(f[v]<<24|f[b]<<16|f[g]<<8|f[y])>>>0}}else throw new Error("Invalid bitDepth")}}function nt(e,t,n,i,r,o,a,l){var u=t&&t.data,s;if(l){s=new Uint32Array(a.length*i);for(var f=0,h=0;f<a.length;f++)for(var p=0;p<i;p++,h++)s[h]=I(e)}else{s=new Uint16Array(a.length*i);for(var f=0,h=0;f<a.length;f++)for(var p=0;p<i;p++,h++)s[h]=k(e)}if(r!==1&&r!==8)throw new Error("Invalid bit depth (".concat(r,")"));for(var d=o-1|0,m=0,h=0;m<a.length;m++){var v=a[m]|0,F=m>d||v>d;if(!u||F)for(var p=0;p<i;p++,h++)E(e,s[h]);else for(var p=0,b=v|0;p<i;p++,h++)for(var g=s[h],y=fe(e,g),S=0,C=0;S<g;S++){var _=y[S];if(_>128){var A=y[++S];_=256-_|0;for(var R=0;R<=_&&C<n;R=R+1|0,C=C+1|0)u[b]=A,b=b+o|0}else if(_<128)for(var R=0;R<=_&&C<n;R=R+1|0,C=C+1|0)u[b]=y[++S],b=b+o|0}}}function Fe(e,t,n,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var o=I(e);if(r){if(o!==0)throw new Error("Sizes larger than 4GB are not supported");o=I(e)}if(!(o<=0&&i)){var a=e.offset+o;if(a>e.view.byteLength)throw new Error("Section exceeds file size");var l=n(function(){return a-e.offset});for(e.offset!==a&&(e.offset>a?Vt(e,"Exceeded section limits"):Vt(e,"Unread section data"));a%t;)a++;return e.offset=a,l}}function oe(e){var t=k(e);switch(t){case 0:{var n=k(e)/257,i=k(e)/257,r=k(e)/257;return E(e,2),{r:n,g:i,b:r}}case 1:{var o=k(e)/65535,a=k(e)/65535,r=k(e)/65535;return E(e,2),{h:o,s:a,b:r}}case 2:{var l=k(e)/257,u=k(e)/257,s=k(e)/257,f=k(e)/257;return{c:l,m:u,y:s,k:f}}case 7:{var h=V(e)/1e4,p=V(e),d=V(e),m=p<0?p/12800:p/12700,r=d<0?d/12800:d/12700;return E(e,2),{l:h,a:m,b:r}}case 8:{var f=k(e)*255/1e4;return E(e,6),{k:f}}default:throw new Error("Invalid color space")}}var fa=[void 0,"outer bevel","inner bevel","emboss","pillow emboss","stroke emboss"];function fn(e){return Ye(e,"8BIM"),gn[Q(e)]||"normal"}function dn(e,t){N(e,"8BIM"),N(e,ro[t]||"norm")}function cn(e){return L(e)/255}function hn(e,t){T(e,Math.round(t*255)|0)}function ps(e){var t=k(e);if(t!==0)throw new Error("Invalid effects layer version: ".concat(t));for(var n=k(e),i={},r=0;r<n;r++){Ye(e,"8BIM");var o=Q(e);switch(o){case"cmnS":{var a=I(e),l=I(e),u=!!L(e);if(E(e,2),a!==7||l!==0||!u)throw new Error("Invalid effects common state");break}case"dsdw":case"isdw":{var s=I(e),f=I(e);if(s!==41&&s!==51)throw new Error("Invalid shadow size: ".concat(s));if(f!==0&&f!==2)throw new Error("Invalid shadow version: ".concat(f));var a=ge(e);ge(e);var h=ge(e),p=ge(e),d=oe(e),m=fn(e),v=!!L(e),F=!!L(e),b=cn(e);s>=51&&oe(e);var g={size:{units:"Pixels",value:a},distance:{units:"Pixels",value:p},angle:h,color:d,blendMode:m,enabled:v,useGlobalLight:F,opacity:b};o==="dsdw"?i.dropShadow=[g]:i.innerShadow=[g];break}case"oglw":{var s=I(e),y=I(e);if(s!==32&&s!==42)throw new Error("Invalid outer glow size: ".concat(s));if(y!==0&&y!==2)throw new Error("Invalid outer glow version: ".concat(y));var a=ge(e);ge(e);var d=oe(e),m=fn(e),v=!!L(e),b=cn(e);s>=42&&oe(e),i.outerGlow={size:{units:"Pixels",value:a},color:d,blendMode:m,enabled:v,opacity:b};break}case"iglw":{var s=I(e),S=I(e);if(s!==32&&s!==43)throw new Error("Invalid inner glow size: ".concat(s));if(S!==0&&S!==2)throw new Error("Invalid inner glow version: ".concat(S));var a=ge(e);ge(e);var d=oe(e),m=fn(e),v=!!L(e),b=cn(e);s>=43&&(L(e),oe(e)),i.innerGlow={size:{units:"Pixels",value:a},color:d,blendMode:m,enabled:v,opacity:b};break}case"bevl":{var s=I(e),C=I(e);if(s!==58&&s!==78)throw new Error("Invalid bevel size: ".concat(s));if(C!==0&&C!==2)throw new Error("Invalid bevel version: ".concat(C));var h=ge(e),_=ge(e),a=ge(e),A=fn(e),R=fn(e),U=oe(e),B=oe(e),z=fa[L(e)]||"inner bevel",re=cn(e),de=cn(e),v=!!L(e),F=!!L(e),te=L(e)?"down":"up";s>=78&&(oe(e),oe(e)),i.bevel={size:{units:"Pixels",value:a},angle:h,strength:_,highlightBlendMode:A,shadowBlendMode:R,highlightColor:U,shadowColor:B,style:z,highlightOpacity:re,shadowOpacity:de,enabled:v,useGlobalLight:F,direction:te};break}case"sofi":{var a=I(e),ue=I(e);if(a!==34)throw new Error("Invalid effects solid fill info size: ".concat(a));if(ue!==2)throw new Error("Invalid effects solid fill info version: ".concat(ue));var m=fn(e),d=oe(e),b=cn(e),v=!!L(e);oe(e),i.solidFill=[{blendMode:m,color:d,opacity:b,enabled:v}];break}default:throw new Error("Invalid effect type: '".concat(o,"'"))}}return i}function Cr(e,t){var n;P(e,51),P(e,2),ye(e,t.size&&t.size.value||0),ye(e,0),ye(e,t.angle||0),ye(e,t.distance&&t.distance.value||0),le(e,t.color),dn(e,t.blendMode),T(e,t.enabled?1:0),T(e,t.useGlobalLight?1:0),hn(e,(n=t.opacity)!==null&&n!==void 0?n:1),le(e,t.color)}function vs(e,t){var n,i,r,o,a,l,u=(n=t.dropShadow)===null||n===void 0?void 0:n[0],s=(i=t.innerShadow)===null||i===void 0?void 0:i[0],f=t.outerGlow,h=t.innerGlow,p=t.bevel,d=(r=t.solidFill)===null||r===void 0?void 0:r[0],m=1;if(u&&m++,s&&m++,f&&m++,h&&m++,p&&m++,d&&m++,x(e,0),x(e,m),N(e,"8BIM"),N(e,"cmnS"),P(e,7),P(e,0),T(e,1),$(e,2),u&&(N(e,"8BIM"),N(e,"dsdw"),Cr(e,u)),s&&(N(e,"8BIM"),N(e,"isdw"),Cr(e,s)),f&&(N(e,"8BIM"),N(e,"oglw"),P(e,42),P(e,2),ye(e,((o=f.size)===null||o===void 0?void 0:o.value)||0),ye(e,0),le(e,f.color),dn(e,f.blendMode),T(e,f.enabled?1:0),hn(e,f.opacity||0),le(e,f.color)),h&&(N(e,"8BIM"),N(e,"iglw"),P(e,43),P(e,2),ye(e,((a=h.size)===null||a===void 0?void 0:a.value)||0),ye(e,0),le(e,h.color),dn(e,h.blendMode),T(e,h.enabled?1:0),hn(e,h.opacity||0),T(e,0),le(e,h.color)),p){N(e,"8BIM"),N(e,"bevl"),P(e,78),P(e,2),ye(e,p.angle||0),ye(e,p.strength||0),ye(e,((l=p.size)===null||l===void 0?void 0:l.value)||0),dn(e,p.highlightBlendMode),dn(e,p.shadowBlendMode),le(e,p.highlightColor),le(e,p.shadowColor);var v=fa.indexOf(p.style);T(e,v<=0?1:v),hn(e,p.highlightOpacity||0),hn(e,p.shadowOpacity||0),T(e,p.enabled?1:0),T(e,p.useGlobalLight?1:0),T(e,p.direction==="down"?1:0),le(e,p.highlightColor),le(e,p.shadowColor)}d&&(N(e,"8BIM"),N(e,"sofi"),P(e,34),P(e,2),dn(e,d.blendMode),le(e,d.color),hn(e,d.opacity||0),T(e,d.enabled?1:0),le(e,d.color))}function Dr(e){return e===32||e===10||e===13||e===9}function Ar(e){return e>=48&&e<=57||e===46||e===45}function ms(e){var t=0;function n(){for(;t<e.length&&Dr(e[t]);)t++}function i(){var b=e[t];return t++,b===92&&(b=e[t],t++),b}function r(){var b="";if(e[t]===41)return t++,b;if(e[t]!==254||e[t+1]!==255)throw new Error("Invalid utf-16 BOM");for(t+=2;t<e.length&&e[t]!==41;){var g=i(),y=i(),S=g<<8|y;b+=String.fromCharCode(S)}return t++,b}var o=null,a=[];function l(b){a.length?(u(b),a.push(b)):(a.push(b),o=b)}function u(b){if(!a.length)throw new Error("Invalid data");var g=a[a.length-1];if(typeof g=="string")a[a.length-2][g]=b,f();else if(Array.isArray(g))g.push(b);else throw new Error("Invalid data")}function s(b){a.length||l({});var g=a[a.length-1];if(g&&typeof g=="string")u(b==="nil"?null:"/".concat(b));else if(g&&typeof g=="object")a.push(b);else throw new Error("Invalid data")}function f(){if(!a.length)throw new Error("Invalid data");a.pop()}for(n();t<e.length;){var h=t,p=e[h];if(p===60&&e[h+1]===60)t+=2,l({});else if(p===62&&e[h+1]===62)t+=2,f();else if(p===47){t+=1;for(var d=t;t<e.length&&!Dr(e[t]);)t++;for(var m="",v=d;v<t;v++)m+=String.fromCharCode(e[v]);s(m)}else if(p===40)t+=1,u(r());else if(p===91)t+=1,l([]);else if(p===93)t+=1,f();else if(p===110&&e[h+1]===117&&e[h+2]===108&&e[h+3]===108)t+=4,u(null);else if(p===116&&e[h+1]===114&&e[h+2]===117&&e[h+3]===101)t+=4,u(!0);else if(p===102&&e[h+1]===97&&e[h+2]===108&&e[h+3]===115&&e[h+4]===101)t+=5,u(!1);else if(Ar(p)){for(var F="";t<e.length&&Ar(e[t]);)F+=String.fromCharCode(e[t]),t++;u(parseFloat(F))}else t+=1,console.log("Invalid token ".concat(String.fromCharCode(p)," at ").concat(t));n()}return o}var gs=["Axis","XY","Zone","WordSpacing","FirstLineIndent","GlyphSpacing","StartIndent","EndIndent","SpaceBefore","SpaceAfter","LetterSpacing","Values","GridSize","GridLeading","PointBase","BoxBounds","TransformPoint0","TransformPoint1","TransformPoint2","FontSize","Leading","HorizontalScale","VerticalScale","BaselineShift","Tsume","OutlineWidth","AutoLeading"],bs=["RunLengthArray"];function ys(e,t){t===void 0&&(t=!1);var n=new Uint8Array(1024),i=0,r=0;function o(g){if(i>=n.length){var y=new Uint8Array(n.length*2);y.set(n),n=y}n[i]=g,i++}function a(g){for(var y=0;y<g.length;y++)o(g.charCodeAt(y))}function l(){if(t)a(" ");else for(var g=0;g<r;g++)a(" ")}function u(g,y){l(),a("/".concat(g)),m(y,g,!0),t||a(`
`)}function s(g){return g.toString()}function f(g){return g.toFixed(5).replace(/(\d)0+$/g,"$1").replace(/^0+\.([1-9])/g,".$1").replace(/^-0+\.0(\d)/g,"-.0$1")}function h(g,y){var S=y&&gs.indexOf(y)!==-1||(g|0)!==g;return S?f(g):s(g)}function p(g){var y=Object.keys(g);return y.indexOf("98")!==-1&&y.unshift.apply(y,y.splice(y.indexOf("99"),1)),y.indexOf("99")!==-1&&y.unshift.apply(y,y.splice(y.indexOf("99"),1)),y}function d(g){(g===40||g===41||g===92)&&o(92),o(g)}function m(g,y,S){S===void 0&&(S=!1);function C(){S?a(" "):l()}if(g===null)C(),a(t?"/nil":"null");else if(typeof g=="number")C(),a(h(g,y));else if(typeof g=="boolean")C(),a(g?"true":"false");else if(typeof g=="string")if(C(),(y==="99"||y==="98")&&g.charAt(0)==="/")a(g);else{a("("),o(254),o(255);for(var _=0;_<g.length;_++){var A=g.charCodeAt(_);d(A>>8&255),d(A&255)}a(")")}else if(Array.isArray(g))if(C(),g.every(function($e){return typeof $e=="number"})){a("[");for(var R=bs.indexOf(y)!==-1,U=0,B=g;U<B.length;U++){var z=B[U];a(" "),a(R?h(z):f(z))}a(" ]")}else{a("["),t||a(`
`);for(var re=0,de=g;re<de.length;re++){var z=de[re];m(z,y),t||a(`
`)}l(),a("]")}else if(typeof g=="object"){S&&!t&&a(`
`),l(),a("<<"),t||a(`
`),r++;for(var te=0,ue=p(g);te<ue.length;te++){var He=ue[te];u(He,g[He])}r--,l(),a(">>")}}if(t){if(typeof e=="object")for(var v=0,F=p(e);v<F.length;v++){var b=F[v];u(b,e[b])}}else a(`
`),m(e);return n.slice(0,i)}var ie=function(){return ie=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},ie.apply(this,arguments)},ca={name:"MyriadPro-Regular",script:0,type:0,synthetic:0},Yn={justification:"left",firstLineIndent:0,startIndent:0,endIndent:0,spaceBefore:0,spaceAfter:0,autoHyphenate:!0,hyphenatedWordSize:6,preHyphen:2,postHyphen:2,consecutiveHyphens:8,zone:36,wordSpacing:[.8,1,1.33],letterSpacing:[0,0,0],glyphSpacing:[1,1,1],autoLeading:1.2,leadingType:0,hanging:!1,burasagari:!1,kinsokuOrder:0,everyLineComposer:!1},Ss={font:ca,fontSize:12,fauxBold:!1,fauxItalic:!1,autoLeading:!0,leading:0,horizontalScale:1,verticalScale:1,tracking:0,autoKerning:!0,kerning:0,baselineShift:0,fontCaps:0,fontBaseline:0,underline:!1,strikethrough:!1,ligatures:!0,dLigatures:!1,baselineDirection:2,tsume:0,styleRunAlignment:2,language:0,noBreak:!1,fillColor:{r:0,g:0,b:0},strokeColor:{r:0,g:0,b:0},fillFlag:!0,strokeFlag:!1,fillFirst:!0,yUnderline:1,outlineWidth:1,characterDirection:0,hindiNumbers:!1,kashida:1,diacriticPos:2},Fs={isOn:!1,show:!1,size:18,leading:22,color:{r:0,g:0,b:255},leadingFillColor:{r:0,g:0,b:255},alignLineHeightToGridFlags:!1},ei=["justification","firstLineIndent","startIndent","endIndent","spaceBefore","spaceAfter","autoHyphenate","hyphenatedWordSize","preHyphen","postHyphen","consecutiveHyphens","zone","wordSpacing","letterSpacing","glyphSpacing","autoLeading","leadingType","hanging","burasagari","kinsokuOrder","everyLineComposer"],ni=["font","fontSize","fauxBold","fauxItalic","autoLeading","leading","horizontalScale","verticalScale","tracking","autoKerning","kerning","baselineShift","fontCaps","fontBaseline","underline","strikethrough","ligatures","dLigatures","baselineDirection","tsume","styleRunAlignment","language","noBreak","fillColor","strokeColor","fillFlag","strokeFlag","fillFirst","yUnderline","outlineWidth","characterDirection","hindiNumbers","kashida","diacriticPos"],da=["none","crisp","strong","smooth","sharp"],ha=["left","right","center","justify-left","justify-right","justify-center","justify-all"];function pa(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function xs(e){var t=e.Values;switch(e.Type){case 0:return{k:t[1]*255};case 1:return t[0]===1?{r:t[1]*255,g:t[2]*255,b:t[3]*255}:{r:t[1]*255,g:t[2]*255,b:t[3]*255,a:t[0]*255};case 2:return{c:t[1]*255,m:t[2]*255,y:t[3]*255,k:t[4]*255};default:throw new Error("Unknown color type in text layer")}}function Wt(e){if(e){if("r"in e)return{Type:1,Values:["a"in e?e.a/255:1,e.r/255,e.g/255,e.b/255]};if("c"in e)return{Type:2,Values:[1,e.c/255,e.m/255,e.y/255,e.k/255]};if("k"in e)return{Type:0,Values:[1,e.k/255]};throw new Error("Invalid color type in text layer")}else return{Type:1,Values:[0,0,0,0]}}function Pr(e,t){if(!e||!t||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Er(e,t){if(!e||!t)return!1;for(var n=0,i=Object.keys(e);n<i.length;n++){var r=i[n];if(e[r]!==t[r])return!1}for(var o=0,a=Object.keys(t);o<a.length;o++){var r=a[o];if(e[r]!==t[r])return!1}return!0}function ks(e,t){for(var n=0;n<e.length;n++)if(e[n].name===t.name)return n;return e.push(t),e.length-1}function va(e,t,n){for(var i={},r=0,o=t;r<o.length;r++){var a=o[r],l=pa(a);e[l]!==void 0&&(a==="justification"?i[a]=ha[e[l]]:a==="font"?i[a]=n[e[l]]:a==="fillColor"||a==="strokeColor"?i[a]=xs(e[l]):i[a]=e[l])}return i}function ma(e,t,n){for(var i,r={},o=0,a=t;o<a.length;o++){var l=a[o],u=pa(l);e[l]!==void 0&&(l==="justification"?r[u]=ha.indexOf((i=e[l])!==null&&i!==void 0?i:"left"):l==="font"?r[u]=ks(n,e[l]):l==="fillColor"||l==="strokeColor"?r[u]=Wt(e[l]):r[u]=e[l])}return r}function Is(e,t){return va(e,ei,t)}function Cs(e,t){return va(e,ni,t)}function qn(e,t){return ma(e,ei,t)}function Et(e,t){return ma(e,ni,t)}function Tr(e,t,n){if(t.length){for(var i=function(l){var u=t[0].style[l];if(u!==void 0){var s=!1;Array.isArray(u)?s=t.every(function(v){return Pr(v.style[l],u)}):typeof u=="object"?s=t.every(function(v){return Er(v.style[l],u)}):s=t.every(function(v){return v.style[l]===u}),s&&(e[l]=u)}var f=e[l];if(f!==void 0)for(var h=0,p=t;h<p.length;h++){var d=p[h],m=!1;Array.isArray(u)?m=Pr(d.style[l],u):typeof u=="object"?m=Er(d.style[l],u):m=d.style[l]===u,m&&delete d.style[l]}},r=0,o=n;r<o.length;r++){var a=o[r];i(a)}t.every(function(l){return Object.keys(l.style).length===0})&&(t.length=0)}}function Ds(e){for(var t,n,i,r,o,a,l=e.EngineDict,u=e.ResourceDict,s=u.FontSet.map(function(_){return{name:_.Name,script:_.Script,type:_.FontType,synthetic:_.Synthetic}}),f=l.Editor.Text.replace(/\r/g,`
`),h=0;/\n$/.test(f);)f=f.substring(0,f.length-1),h++;var p={text:f,antiAlias:(t=da[l.AntiAlias])!==null&&t!==void 0?t:"smooth",useFractionalGlyphWidths:!!l.UseFractionalGlyphWidths,superscriptSize:u.SuperscriptSize,superscriptPosition:u.SuperscriptPosition,subscriptSize:u.SubscriptSize,subscriptPosition:u.SubscriptPosition,smallCapSize:u.SmallCapSize},d=(a=(o=(r=(i=(n=l.Rendered)===null||n===void 0?void 0:n.Shapes)===null||i===void 0?void 0:i.Children)===null||r===void 0?void 0:r[0])===null||o===void 0?void 0:o.Cookie)===null||a===void 0?void 0:a.Photoshop;d&&(p.shapeType=d.ShapeType===1?"box":"point",d.PointBase&&(p.pointBase=d.PointBase),d.BoxBounds&&(p.boxBounds=d.BoxBounds));var m=l.ParagraphRun;p.paragraphStyle={},p.paragraphStyleRuns=[];for(var v=0;v<m.RunArray.length;v++){var F=m.RunArray[v],b=m.RunLengthArray[v],g=Is(F.ParagraphSheet.Properties,s);p.paragraphStyleRuns.push({length:b,style:g})}for(var y=h;p.paragraphStyleRuns.length&&y>0;y--)--p.paragraphStyleRuns[p.paragraphStyleRuns.length-1].length===0&&p.paragraphStyleRuns.pop();Tr(p.paragraphStyle,p.paragraphStyleRuns,ei),p.paragraphStyleRuns.length||delete p.paragraphStyleRuns;var S=l.StyleRun;p.style={},p.styleRuns=[];for(var v=0;v<S.RunArray.length;v++){var C=S.RunLengthArray[v],g=Cs(S.RunArray[v].StyleSheet.StyleSheetData,s);g.font||(g.font=s[0]),p.styleRuns.push({length:C,style:g})}for(var y=h;p.styleRuns.length&&y>0;y--)--p.styleRuns[p.styleRuns.length-1].length===0&&p.styleRuns.pop();return Tr(p.style,p.styleRuns,ni),p.styleRuns.length||delete p.styleRuns,p}function As(e){var t,n,i,r,o,a,l,u,s,f,h,p,d="".concat((e.text||"").replace(/\r?\n/g,"\r"),"\r"),m=[{name:"AdobeInvisFont",script:0,type:0,synthetic:0}],v=((t=e.style)===null||t===void 0?void 0:t.font)||((i=(n=e.styleRuns)===null||n===void 0?void 0:n.find(function(ln){return ln.style.font}))===null||i===void 0?void 0:i.style.font)||ca,F=[],b=[],g=e.paragraphStyleRuns;if(g&&g.length){for(var y=d.length,S=0,C=g;S<C.length;S++){var _=C[S],A=Math.min(_.length,y);y-=A,A&&(y===1&&_===g[g.length-1]&&(A++,y--),b.push(A),F.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:qn(ie(ie(ie({},Yn),e.paragraphStyle),_.style),m)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}))}y&&(b.push(y),F.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:qn(ie(ie({},Yn),e.paragraphStyle),m)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}))}else for(var R=0,U=0;R<d.length;R++)d.charCodeAt(R)===13&&(b.push(R-U+1),F.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:qn(ie(ie({},Yn),e.paragraphStyle),m)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}),U=R+1);for(var B=Et(ie(ie({},Ss),{font:v}),m),z=e.styleRuns||[{length:d.length,style:e.style||{}}],re=[],de=[],te=d.length,ue=0,He=z;ue<He.length;ue++){var $e=He[ue],A=Math.min($e.length,te);te-=A,A&&(te===1&&$e===z[z.length-1]&&(A++,te--),de.push(A),re.push({StyleSheet:{StyleSheetData:Et(ie(ie({kerning:0,autoKerning:!0,fillColor:{r:0,g:0,b:0}},e.style),$e.style),m)}}))}te&&z.length&&(de.push(te),re.push({StyleSheet:{StyleSheetData:Et(ie({kerning:0,autoKerning:!0,fillColor:{r:0,g:0,b:0}},e.style),m)}}));var pe=ie(ie({},Fs),e.gridInfo),We=e.orientation==="vertical"?2:0,X=e.orientation==="vertical"?1:0,an=e.shapeType==="box"?1:0,_n={ShapeType:an};an===0?_n.PointBase=e.pointBase||[0,0]:_n.BoxBounds=e.boxBounds||[0,0,0,0],_n.Base={ShapeType:an,TransformPoint0:[1,0],TransformPoint1:[0,1],TransformPoint2:[0,0]};var ii={KinsokuSet:[{Name:"PhotoshopKinsokuHard",NoStart:"、。,.・:;?!ー―’”)〕]}〉》」』】ヽヾゝゞ々ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ゛゜?!)]},.:;℃℉¢%‰",NoEnd:"‘“(〔[{〈《「『【([{¥$£@§〒#",Keep:"―‥",Hanging:"、。.,"},{Name:"PhotoshopKinsokuSoft",NoStart:"、。,.・:;?!’”)〕]}〉》」』】ヽヾゝゞ々",NoEnd:"‘“(〔[{〈《「『【",Keep:"―‥",Hanging:"、。.,"}],MojiKumiSet:[{InternalName:"Photoshop6MojiKumiSet1"},{InternalName:"Photoshop6MojiKumiSet2"},{InternalName:"Photoshop6MojiKumiSet3"},{InternalName:"Photoshop6MojiKumiSet4"}],TheNormalStyleSheet:0,TheNormalParagraphSheet:0,ParagraphSheetSet:[{Name:"Normal RGB",DefaultStyleSheet:0,Properties:qn(ie(ie({},Yn),e.paragraphStyle),m)}],StyleSheetSet:[{Name:"Normal RGB",StyleSheetData:B}],FontSet:m.map(function(ln){return{Name:ln.name,Script:ln.script||0,FontType:ln.type||0,Synthetic:ln.synthetic||0}}),SuperscriptSize:(r=e.superscriptSize)!==null&&r!==void 0?r:.583,SuperscriptPosition:(o=e.superscriptPosition)!==null&&o!==void 0?o:.333,SubscriptSize:(a=e.subscriptSize)!==null&&a!==void 0?a:.583,SubscriptPosition:(l=e.subscriptPosition)!==null&&l!==void 0?l:.333,SmallCapSize:(u=e.smallCapSize)!==null&&u!==void 0?u:.7},ka={EngineDict:{Editor:{Text:d},ParagraphRun:{DefaultRunData:{ParagraphSheet:{DefaultStyleSheet:0,Properties:{}},Adjustments:{Axis:[1,0,1],XY:[0,0]}},RunArray:F,RunLengthArray:b,IsJoinable:1},StyleRun:{DefaultRunData:{StyleSheet:{StyleSheetData:{}}},RunArray:re,RunLengthArray:de,IsJoinable:2},GridInfo:{GridIsOn:!!pe.isOn,ShowGrid:!!pe.show,GridSize:(s=pe.size)!==null&&s!==void 0?s:18,GridLeading:(f=pe.leading)!==null&&f!==void 0?f:22,GridColor:Wt(pe.color),GridLeadingFillColor:Wt(pe.color),AlignLineHeightToGridFlags:!!pe.alignLineHeightToGridFlags},AntiAlias:da.indexOf((h=e.antiAlias)!==null&&h!==void 0?h:"sharp"),UseFractionalGlyphWidths:(p=e.useFractionalGlyphWidths)!==null&&p!==void 0?p:!0,Rendered:{Version:1,Shapes:{WritingDirection:We,Children:[{ShapeType:an,Procession:X,Lines:{WritingDirection:We,Children:[]},Cookie:{Photoshop:_n}}]}}},ResourceDict:ie({},ii),DocumentResources:ie({},ii)};return ka}var c=function(){return c=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},c.apply(this,arguments)},be="abcdefghijklmnopqrstuvwxyz",lt={};function O(e,t,n,i){var r={key:e,has:t,read:n,write:i};lt[r.key]=r}function Sn(e,t){lt[e]=lt[t]}function K(e){return function(t){return t[e]!==void 0}}function Tt(e){if(I(e))throw new Error("Resource size above 4 GB limit at ".concat(e.offset.toString(16)));return I(e)}function Lt(e,t){P(e,0),P(e,t)}O("TySh",K("text"),function(e,t,n){if(V(e)!==1)throw new Error("Invalid TySh version");for(var i=[],r=0;r<6;r++)i.push(Ie(e));if(V(e)!==50)throw new Error("Invalid TySh text version");var o=j(e);if(V(e)!==1)throw new Error("Invalid TySh warp version");var a=j(e);if(t.text={transform:i,left:Pe(e),top:Pe(e),right:Pe(e),bottom:Pe(e),text:o["Txt "].replace(/\r/g,`
`),index:o.TextIndex||0,gridding:nr.decode(o.textGridding),antiAlias:tr.decode(o.AntA),orientation:On.decode(o.Ornt),warp:{style:Yt.decode(a.warpStyle),value:a.warpValue||0,perspective:a.warpPerspective||0,perspectiveOther:a.warpPerspectiveOther||0,rotate:On.decode(a.warpRotate)}},o.bounds&&(t.text.bounds=qi(o.bounds)),o.boundingBox&&(t.text.boundingBox=qi(o.boundingBox)),o.EngineData){var l=ms(o.EngineData),u=Ds(l);t.text=c(c({},t.text),u)}E(e,n())},function(e,t){var n=t.text,i=n.warp||{},r=n.transform||[1,0,0,1,0,0],o=c(c(c({"Txt ":(n.text||"").replace(/\r?\n/g,"\r"),textGridding:nr.encode(n.gridding),Ornt:On.encode(n.orientation),AntA:tr.encode(n.antiAlias)},n.bounds?{bounds:$i(n.bounds)}:{}),n.boundingBox?{boundingBox:$i(n.boundingBox)}:{}),{TextIndex:n.index||0,EngineData:ys(As(n))});Z(e,1);for(var a=0;a<6;a++)we(e,r[a]);Z(e,50),H(e,"","TxLr",o,"text"),Z(e,1),H(e,"","warp",st(i)),Ee(e,n.left),Ee(e,n.top),Ee(e,n.right),Ee(e,n.bottom)});O("SoCo",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type==="color"},function(e,t){var n=j(e);t.vectorFill=Rn(n)},function(e,t){var n=Bn(t.vectorFill).descriptor;H(e,"","null",n)});O("GdFl",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&(e.vectorFill.type==="solid"||e.vectorFill.type==="noise")},function(e,t,n){var i=j(e);t.vectorFill=Rn(i),E(e,n())},function(e,t){var n=Bn(t.vectorFill).descriptor;H(e,"","null",n)});O("PtFl",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type==="pattern"},function(e,t){var n=j(e);t.vectorFill=Rn(n)},function(e,t){var n=Bn(t.vectorFill).descriptor;H(e,"","null",n)});O("vscg",function(e){return e.vectorFill!==void 0&&e.vectorStroke!==void 0},function(e,t,n){Q(e);var i=j(e);t.vectorFill=Rn(i),E(e,n())},function(e,t){var n=Bn(t.vectorFill),i=n.descriptor,r=n.key;N(e,r),H(e,"","null",i)});function Ps(e,t,n){var i=De(e)*n,r=De(e)*t,o=De(e)*n,a=De(e)*t,l=De(e)*n,u=De(e)*t;return[r,i,a,o,u,l]}function Es(e,t,n,i){Ae(e,t[1]/i),Ae(e,t[0]/n),Ae(e,t[3]/i),Ae(e,t[2]/n),Ae(e,t[5]/i),Ae(e,t[4]/n)}var ga=["exclude","combine","subtract","intersect"];function Ts(e,t,n,i,r){for(var o=e.offset+r,a=t.paths,l=void 0;o-e.offset>=26;){var u=k(e);switch(u){case 0:case 3:{k(e);var s=V(e),f=k(e);E(e,18),l={open:u===3,knots:[],fillRule:f===2?"non-zero":"even-odd"},s!==-1&&(l.operation=ga[s]),a.push(l);break}case 1:case 2:case 4:case 5:l.knots.push({linked:u===1||u===4,points:Ps(e,n,i)});break;case 6:E(e,24);break;case 7:{var h=De(e),p=De(e),d=De(e),m=De(e),v=De(e);E(e,4),t.clipboard={top:h,left:p,bottom:d,right:m,resolution:v};break}case 8:t.fillStartsWithAllPixels=!!k(e),E(e,22);break;default:throw new Error("Invalid vmsk section")}}return a}O("vmsk",K("vectorMask"),function(e,t,n,i){var r=i.width,o=i.height;if(I(e)!==3)throw new Error("Invalid vmsk version");t.vectorMask={paths:[]};var a=t.vectorMask,l=I(e);a.invert=(l&1)!==0,a.notLink=(l&2)!==0,a.disable=(l&4)!==0,Ts(e,a,r,o,n()),E(e,n())},function(e,t,n){var i=n.width,r=n.height,o=t.vectorMask,a=(o.invert?1:0)|(o.notLink?2:0)|(o.disable?4:0);P(e,3),P(e,a),x(e,6),$(e,24);var l=o.clipboard;l&&(x(e,7),Ae(e,l.top),Ae(e,l.left),Ae(e,l.bottom),Ae(e,l.right),Ae(e,l.resolution),$(e,4)),o.fillStartsWithAllPixels!==void 0&&(x(e,8),x(e,o.fillStartsWithAllPixels?1:0),$(e,22));for(var u=0,s=o.paths;u<s.length;u++){var f=s[u];x(e,f.open?3:0),x(e,f.knots.length),x(e,f.operation?ga.indexOf(f.operation):-1),x(e,f.fillRule==="non-zero"?2:1),$(e,18);for(var h=f.open?4:1,p=f.open?5:2,d=0,m=f.knots;d<m.length;d++){var v=m[d],F=v.linked,b=v.points;x(e,F?h:p),Es(e,b,i,r)}}});Sn("vsms","vmsk");O("vogk",K("vectorOrigination"),function(e,t,n){if(M(e)!==1)throw new Error("Invalid vogk version");var i=j(e);t.vectorOrigination={keyDescriptorList:[]};for(var r=0,o=i.keyDescriptorList;r<o.length;r++){var a=o[r],l={};a.keyShapeInvalidated!=null&&(l.keyShapeInvalidated=a.keyShapeInvalidated),a.keyOriginType!=null&&(l.keyOriginType=a.keyOriginType),a.keyOriginResolution!=null&&(l.keyOriginResolution=a.keyOriginResolution),a.keyOriginShapeBBox&&(l.keyOriginShapeBoundingBox={top:Ze(a.keyOriginShapeBBox["Top "]),left:Ze(a.keyOriginShapeBBox.Left),bottom:Ze(a.keyOriginShapeBBox.Btom),right:Ze(a.keyOriginShapeBBox.Rght)});var u=a.keyOriginRRectRadii;u&&(l.keyOriginRRectRadii={topRight:q(u.topRight),topLeft:q(u.topLeft),bottomLeft:q(u.bottomLeft),bottomRight:q(u.bottomRight)});var s=a.keyOriginBoxCorners;s&&(l.keyOriginBoxCorners=[{x:s.rectangleCornerA.Hrzn,y:s.rectangleCornerA.Vrtc},{x:s.rectangleCornerB.Hrzn,y:s.rectangleCornerB.Vrtc},{x:s.rectangleCornerC.Hrzn,y:s.rectangleCornerC.Vrtc},{x:s.rectangleCornerD.Hrzn,y:s.rectangleCornerD.Vrtc}]);var f=a.Trnf;f&&(l.transform=[f.xx,f.xy,f.xy,f.yy,f.tx,f.ty]),t.vectorOrigination.keyDescriptorList.push(l)}E(e,n())},function(e,t){for(var n=t.vectorOrigination,i={keyDescriptorList:[]},r=0;r<n.keyDescriptorList.length;r++){var o=n.keyDescriptorList[r];if(o.keyShapeInvalidated)i.keyDescriptorList.push({keyShapeInvalidated:!0,keyOriginIndex:r});else{i.keyDescriptorList.push({});var a=i.keyDescriptorList[i.keyDescriptorList.length-1];o.keyOriginType!=null&&(a.keyOriginType=o.keyOriginType),o.keyOriginResolution!=null&&(a.keyOriginResolution=o.keyOriginResolution);var l=o.keyOriginRRectRadii;l&&(a.keyOriginRRectRadii={unitValueQuadVersion:1,topRight:ee(l.topRight,"topRight"),topLeft:ee(l.topLeft,"topLeft"),bottomLeft:ee(l.bottomLeft,"bottomLeft"),bottomRight:ee(l.bottomRight,"bottomRight")});var u=o.keyOriginShapeBoundingBox;u&&(a.keyOriginShapeBBox={unitValueQuadVersion:1,"Top ":ee(u.top,"top"),Left:ee(u.left,"left"),Btom:ee(u.bottom,"bottom"),Rght:ee(u.right,"right")});var s=o.keyOriginBoxCorners;s&&s.length===4&&(a.keyOriginBoxCorners={rectangleCornerA:{Hrzn:s[0].x,Vrtc:s[0].y},rectangleCornerB:{Hrzn:s[1].x,Vrtc:s[1].y},rectangleCornerC:{Hrzn:s[2].x,Vrtc:s[2].y},rectangleCornerD:{Hrzn:s[3].x,Vrtc:s[3].y}});var f=o.transform;f&&f.length===6&&(a.Trnf={xx:f[0],xy:f[1],yx:f[2],yy:f[3],tx:f[4],ty:f[5]}),a.keyOriginIndex=r}}G(e,1),H(e,"","null",i)});O("lmfx",function(e){return e.effects!==void 0&&Fa(e.effects)},function(e,t,n){var i=I(e);if(i!==0)throw new Error("Invalid lmfx version");var r=j(e);t.effects=dt(r,!!e.logMissingFeatures),E(e,n())},function(e,t,n,i){var r=ct(t.effects,!!i.logMissingFeatures,!0);P(e,0),H(e,"","null",r)});O("lrFX",K("effects"),function(e,t,n){t.effects||(t.effects=ps(e)),E(e,n())},function(e,t){vs(e,t.effects)});O("luni",K("name"),function(e,t,n){if(n()>4){var i=I(e);n()>=i*2?t.name=Kt(e,i):e.logDevFeatures&&e.log("name in luni section is too long")}else e.logDevFeatures&&e.log("empty luni section");E(e,n())},function(e,t){Se(e,t.name)});O("lnsr",K("nameSource"),function(e,t){return t.nameSource=Q(e)},function(e,t){return N(e,t.nameSource)});O("lyid",K("id"),function(e,t){return t.id=I(e)},function(e,t,n,i){for(var r=t.id;i.layerIds.has(r);)r+=100;P(e,r),i.layerIds.add(r),i.layerToId.set(t,r)});O("lsct",K("sectionDivider"),function(e,t,n){t.sectionDivider={type:I(e)},n()&&(Ye(e,"8BIM"),t.sectionDivider.key=Q(e)),n()&&(t.sectionDivider.subType=I(e))},function(e,t){P(e,t.sectionDivider.type),t.sectionDivider.key&&(N(e,"8BIM"),N(e,t.sectionDivider.key),t.sectionDivider.subType!==void 0&&P(e,t.sectionDivider.subType))});Sn("lsdk","lsct");O("clbl",K("blendClippendElements"),function(e,t){t.blendClippendElements=!!L(e),E(e,3)},function(e,t){T(e,t.blendClippendElements?1:0),$(e,3)});O("infx",K("blendInteriorElements"),function(e,t){t.blendInteriorElements=!!L(e),E(e,3)},function(e,t){T(e,t.blendInteriorElements?1:0),$(e,3)});O("knko",K("knockout"),function(e,t){t.knockout=!!L(e),E(e,3)},function(e,t){T(e,t.knockout?1:0),$(e,3)});O("lmgm",K("layerMaskAsGlobalMask"),function(e,t){t.layerMaskAsGlobalMask=!!L(e),E(e,3)},function(e,t){T(e,t.layerMaskAsGlobalMask?1:0),$(e,3)});O("lspf",K("protected"),function(e,t){var n=I(e);t.protected={transparency:(n&1)!==0,composite:(n&2)!==0,position:(n&4)!==0},n&8&&(t.protected.artboards=!0)},function(e,t){var n=(t.protected.transparency?1:0)|(t.protected.composite?2:0)|(t.protected.position?4:0)|(t.protected.artboards?8:0);P(e,n)});O("lclr",K("layerColor"),function(e,t){var n=k(e);E(e,6),t.layerColor=Ri[n]},function(e,t){var n=Ri.indexOf(t.layerColor);x(e,n===-1?0:n),$(e,6)});O("shmd",function(e){return e.timestamp!==void 0||e.animationFrames!==void 0||e.animationFrameFlags!==void 0||e.timeline!==void 0||e.comps!==void 0},function(e,t,n){for(var i=I(e),r=function(a){Ye(e,"8BIM");var l=Q(e);L(e),E(e,3),Fe(e,1,function(u){if(l==="cust"){var s=j(e);s.layerTime!==void 0&&(t.timestamp=s.layerTime)}else if(l==="mlst"){var s=j(e);t.animationFrames=[];for(var f=0;f<s.LaSt.length;f++){var h=s.LaSt[f],p={frames:h.FrLs};h.enab!==void 0&&(p.enable=h.enab),h.Ofst&&(p.offset=En(h.Ofst)),h.FXRf&&(p.referencePoint=En(h.FXRf)),h.Lefx&&(p.effects=dt(h.Lefx,!!e.logMissingFeatures)),h.blendOptions&&h.blendOptions.Opct&&(p.opacity=J(h.blendOptions.Opct)),t.animationFrames.push(p)}}else if(l==="mdyn"){k(e);var d=L(e),m=L(e);t.animationFrameFlags={propagateFrameOne:!d,unifyLayerPosition:(m&1)!==0,unifyLayerStyle:(m&2)!==0,unifyLayerVisibility:(m&4)!==0}}else if(l==="tmln"){var s=j(e),v=s.timeScope,F={start:he(v.Strt),duration:he(v.duration),inTime:he(v.inTime),outTime:he(v.outTime),autoScope:s.autoScope,audioLevel:s.audioLevel};s.trackList&&(F.tracks=vo(s.trackList,!!e.logMissingFeatures)),t.timeline=F}else if(l==="cmls"){var s=j(e);t.comps={settings:[]},s.origFXRefPoint&&(t.comps.originalEffectsReferencePoint={x:s.origFXRefPoint.Hrzn,y:s.origFXRefPoint.Vrtc});for(var b=0,g=s.layerSettings;b<g.length;b++){var y=g[b];t.comps.settings.push({compList:y.compList});var S=t.comps.settings[t.comps.settings.length-1];"enab"in y&&(S.enabled=y.enab),y.Ofst&&(S.offset={x:y.Ofst.Hrzn,y:y.Ofst.Vrtc}),y.FXRefPoint&&(S.effectsReferencePoint={x:y.FXRefPoint.Hrzn,y:y.FXRefPoint.Vrtc})}}else if(l==="extn"){var s=j(e);e.logMissingFeatures&&e.log('Unhandled "shmd" section key',l)}else e.logMissingFeatures&&e.log('Unhandled "shmd" section key',l);E(e,u())})},o=0;o<i;o++)r();E(e,n())},function(e,t,n,i){var r=t.animationFrames,o=t.animationFrameFlags,a=t.timestamp,l=t.timeline,u=t.comps,s=0;r&&s++,o&&s++,l&&s++,a!==void 0&&s++,u&&s++,P(e,s),r&&(N(e,"8BIM"),N(e,"mlst"),T(e,0),$(e,3),en(e,2,function(){for(var f,h={LaID:(f=t.id)!==null&&f!==void 0?f:0,LaSt:[]},p=0;p<r.length;p++){var d=r[p],m={};d.enable!==void 0&&(m.enab=d.enable),m.FrLs=d.frames,d.offset&&(m.Ofst=Tn(d.offset)),d.referencePoint&&(m.FXRf=Tn(d.referencePoint)),d.effects&&(m.Lefx=ct(d.effects,!1,!1)),d.opacity!==void 0&&(m.blendOptions={Opct:ae(d.opacity)}),h.LaSt.push(m)}H(e,"","null",h)},!0)),o&&(N(e,"8BIM"),N(e,"mdyn"),T(e,0),$(e,3),en(e,2,function(){x(e,0),T(e,o.propagateFrameOne?0:15),T(e,(o.unifyLayerPosition?1:0)|(o.unifyLayerStyle?2:0)|(o.unifyLayerVisibility?4:0))})),l&&(N(e,"8BIM"),N(e,"tmln"),T(e,0),$(e,3),en(e,2,function(){var f={Vrsn:1,timeScope:{Vrsn:1,Strt:l.start,duration:l.duration,inTime:l.inTime,outTime:l.outTime},autoScope:l.autoScope,audioLevel:l.audioLevel};l.tracks&&(f.trackList=mo(l.tracks));var h=i.layerToId.get(t)||t.id;if(!h)throw new Error("You need to provide layer.id value whan writing document with animations");f.LyrI=h,H(e,"","null",f,"anim")},!0)),a!==void 0&&(N(e,"8BIM"),N(e,"cust"),T(e,0),$(e,3),en(e,2,function(){var f={layerTime:a};H(e,"","metadata",f)},!0)),u&&(N(e,"8BIM"),N(e,"cmls"),T(e,0),$(e,3),en(e,2,function(){var f=i.layerToId.get(t)||t.id;if(!f)throw new Error("You need to provide layer.id value whan writing document with layer comps");var h={};u.originalEffectsReferencePoint&&(h.origFXRefPoint={Hrzn:u.originalEffectsReferencePoint.x,Vrtc:u.originalEffectsReferencePoint.y}),h.LyrI=f,h.layerSettings=[];for(var p=0,d=u.settings;p<d.length;p++){var m=d[p],v={};m.enabled!==void 0&&(v.enab=m.enabled),m.offset&&(v.Ofst={Hrzn:m.offset.x,Vrtc:m.offset.y}),m.effectsReferencePoint&&(v.FXRefPoint={Hrzn:m.effectsReferencePoint.x,Vrtc:m.effectsReferencePoint.y}),v.compList=m.compList,h.layerSettings.push(v)}H(e,"","null",h)},!0))});O("vstk",K("vectorStroke"),function(e,t,n){var i=j(e);t.vectorStroke={strokeEnabled:i.strokeEnabled,fillEnabled:i.fillEnabled,lineWidth:q(i.strokeStyleLineWidth),lineDashOffset:q(i.strokeStyleLineDashOffset),miterLimit:i.strokeStyleMiterLimit,lineCapType:sr.decode(i.strokeStyleLineCapType),lineJoinType:ur.decode(i.strokeStyleLineJoinType),lineAlignment:fr.decode(i.strokeStyleLineAlignment),scaleLock:i.strokeStyleScaleLock,strokeAdjust:i.strokeStyleStrokeAdjust,lineDashSet:i.strokeStyleLineDashSet.map(q),blendMode:ke.decode(i.strokeStyleBlendMode),opacity:J(i.strokeStyleOpacity),content:Rn(i.strokeStyleContent),resolution:i.strokeStyleResolution},E(e,n())},function(e,t){var n,i,r,o=t.vectorStroke,a={strokeStyleVersion:2,strokeEnabled:!!o.strokeEnabled,fillEnabled:!!o.fillEnabled,strokeStyleLineWidth:o.lineWidth||{value:3,units:"Points"},strokeStyleLineDashOffset:o.lineDashOffset||{value:0,units:"Points"},strokeStyleMiterLimit:(n=o.miterLimit)!==null&&n!==void 0?n:100,strokeStyleLineCapType:sr.encode(o.lineCapType),strokeStyleLineJoinType:ur.encode(o.lineJoinType),strokeStyleLineAlignment:fr.encode(o.lineAlignment),strokeStyleScaleLock:!!o.scaleLock,strokeStyleStrokeAdjust:!!o.strokeAdjust,strokeStyleLineDashSet:o.lineDashSet||[],strokeStyleBlendMode:ke.encode(o.blendMode),strokeStyleOpacity:ae((i=o.opacity)!==null&&i!==void 0?i:1),strokeStyleContent:Bn(o.content||{type:"color",color:{r:0,g:0,b:0}}).descriptor,strokeStyleResolution:(r=o.resolution)!==null&&r!==void 0?r:72};H(e,"","strokeStyle",a)});O("artb",K("artboard"),function(e,t,n){var i=j(e),r=i.artboardRect;t.artboard={rect:{top:r["Top "],left:r.Left,bottom:r.Btom,right:r.Rght},guideIndices:i.guideIndeces,presetName:i.artboardPresetName,color:Te(i["Clr "]),backgroundType:i.artboardBackgroundType},E(e,n())},function(e,t){var n,i=t.artboard,r=i.rect,o={artboardRect:{"Top ":r.top,Left:r.left,Btom:r.bottom,Rght:r.right},guideIndeces:i.guideIndices||[],artboardPresetName:i.presetName||"","Clr ":Le(i.color),artboardBackgroundType:(n=i.backgroundType)!==null&&n!==void 0?n:1};H(e,"","artboard",o)});O("sn2P",K("usingAlignedRendering"),function(e,t){return t.usingAlignedRendering=!!I(e)},function(e,t){return P(e,t.usingAlignedRendering?1:0)});var vn=["unknown","vector","raster","image stack"];function ba(e){var t,n,i,r,o,a,l=c(c({style:Yt.decode(e.warpStyle)},e.warpValues?{values:e.warpValues}:{value:e.warpValue||0}),{perspective:e.warpPerspective||0,perspectiveOther:e.warpPerspectiveOther||0,rotate:On.decode(e.warpRotate),bounds:e.bounds&&{top:Ze(e.bounds["Top "]),left:Ze(e.bounds.Left),bottom:Ze(e.bounds.Btom),right:Ze(e.bounds.Rght)},uOrder:e.uOrder,vOrder:e.vOrder});(e.deformNumRows!=null||e.deformNumCols!=null)&&(l.deformNumRows=e.deformNumRows,l.deformNumCols=e.deformNumCols);var u=e.customEnvelopeWarp;if(u){l.customEnvelopeWarp={meshPoints:[]};for(var s=((t=u.meshPoints.find(function(p){return p.type==="Hrzn"}))===null||t===void 0?void 0:t.values)||[],f=((n=u.meshPoints.find(function(p){return p.type==="Vrtc"}))===null||n===void 0?void 0:n.values)||[],h=0;h<s.length;h++)l.customEnvelopeWarp.meshPoints.push({x:s[h],y:f[h]});(u.quiltSliceX||u.quiltSliceY)&&(l.customEnvelopeWarp.quiltSliceX=((r=(i=u.quiltSliceX)===null||i===void 0?void 0:i[0])===null||r===void 0?void 0:r.values)||[],l.customEnvelopeWarp.quiltSliceY=((a=(o=u.quiltSliceY)===null||o===void 0?void 0:o[0])===null||a===void 0?void 0:a.values)||[])}return l}function ti(e){var t,n;return e.deformNumCols!=null||e.deformNumRows!=null||((t=e.customEnvelopeWarp)===null||t===void 0?void 0:t.quiltSliceX)||((n=e.customEnvelopeWarp)===null||n===void 0?void 0:n.quiltSliceY)}function st(e){var t=e.bounds,n=c(c({warpStyle:Yt.encode(e.style)},e.values?{warpValues:e.values}:{warpValue:e.value||0}),{warpPerspective:e.perspective||0,warpPerspectiveOther:e.perspectiveOther||0,warpRotate:On.encode(e.rotate),bounds:{"Top ":ee(t&&t.top||{units:"Pixels",value:0},"bounds.top"),Left:ee(t&&t.left||{units:"Pixels",value:0},"bounds.left"),Btom:ee(t&&t.bottom||{units:"Pixels",value:0},"bounds.bottom"),Rght:ee(t&&t.right||{units:"Pixels",value:0},"bounds.right")},uOrder:e.uOrder||0,vOrder:e.vOrder||0}),i=ti(e);if(i){var r=n;r.deformNumRows=e.deformNumRows||0,r.deformNumCols=e.deformNumCols||0}var o=e.customEnvelopeWarp;if(o){var a=o.meshPoints||[];if(i){var r=n;r.customEnvelopeWarp={_name:"",_classID:"customEnvelopeWarp",quiltSliceX:[{type:"quiltSliceX",values:o.quiltSliceX||[]}],quiltSliceY:[{type:"quiltSliceY",values:o.quiltSliceY||[]}],meshPoints:[{type:"Hrzn",values:a.map(function(u){return u.x})},{type:"Vrtc",values:a.map(function(u){return u.y})}]}}else n.customEnvelopeWarp={_name:"",_classID:"customEnvelopeWarp",meshPoints:[{type:"Hrzn",values:a.map(function(l){return l.x})},{type:"Vrtc",values:a.map(function(l){return l.y})}]}}return n}O("PlLd",K("placedLayer"),function(e,t,n){if(Q(e)!=="plcL")throw new Error("Invalid PlLd signature");if(M(e)!==3)throw new Error("Invalid PlLd version");var i=Ve(e,1),r=M(e),o=M(e);M(e);var a=M(e);if(!vn[a])throw new Error("Invalid PlLd type");for(var l=[],u=0;u<8;u++)l.push(Ie(e));var s=M(e);if(s!==0)throw new Error("Invalid Warp version ".concat(s));var f=j(e);t.placedLayer=t.placedLayer||{id:i,type:vn[a],pageNumber:r,totalPages:o,transform:l,warp:ba(f)},E(e,n())},function(e,t){var n=t.placedLayer;if(N(e,"plcL"),G(e,3),!n.id||typeof n.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(n.id))throw new Error("Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");if(nn(e,n.id,1),G(e,1),G(e,1),G(e,16),vn.indexOf(n.type)===-1)throw new Error("Invalid placedLayer type");G(e,vn.indexOf(n.type));for(var i=0;i<8;i++)we(e,n.transform[i]);G(e,0);var r=ya(n),o=ti(r),a=o?"quiltWarp":"warp";H(e,"",a,st(r),a)});function Ls(e){return new Float32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function Os(e){return new Uint32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function Ot(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function tt(e){for(var t=[],n=0;n<e.length;n+=2)t.push({x:e[n],y:e[n+1]});return t}function xn(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].x,e[n].y);return t}function Lr(e){return tt(Ls(e))}function kn(e){return{x:q(e.Hrzn),y:q(e.Vrtc)}}function In(e){return{_name:"",_classID:"Pnt ",Hrzn:ee(e.x,"x"),Vrtc:ee(e.y,"y")}}function Ms(e,t){var n={name:e["Nm "],opacity:J(e.blendOptions.Opct),blendMode:ke.decode(e.blendOptions["Md "]),enabled:e.enab,hasOptions:e.hasoptions,foregroundColor:Te(e.FrgC),backgroundColor:Te(e.BckC)};if("Fltr"in e)switch(e.Fltr._classID){case"boxblur":return c(c({},n),{type:"box blur",filter:{radius:q(e.Fltr["Rds "])}});case"GsnB":return c(c({},n),{type:"gaussian blur",filter:{radius:q(e.Fltr["Rds "])}});case"MtnB":return c(c({},n),{type:"motion blur",filter:{angle:e.Fltr.Angl,distance:q(e.Fltr.Dstn)}});case"RdlB":return c(c({},n),{type:"radial blur",filter:{amount:e.Fltr.Amnt,method:Oo.decode(e.Fltr.BlrM),quality:Mo.decode(e.Fltr.BlrQ)}});case"shapeBlur":return c(c({},n),{type:"shape blur",filter:{radius:q(e.Fltr["Rds "]),customShape:{name:e.Fltr.customShape["Nm "],id:e.Fltr.customShape.Idnt}}});case"SmrB":return c(c({},n),{type:"smart blur",filter:{radius:e.Fltr["Rds "],threshold:e.Fltr.Thsh,quality:Ro.decode(e.Fltr.SmBQ),mode:wo.decode(e.Fltr.SmBM)}});case"surfaceBlur":return c(c({},n),{type:"surface blur",filter:{radius:q(e.Fltr["Rds "]),threshold:e.Fltr.Thsh}});case"Dspl":return c(c({},n),{type:"displace",filter:{horizontalScale:e.Fltr.HrzS,verticalScale:e.Fltr.VrtS,displacementMap:Bo.decode(e.Fltr.DspM),undefinedAreas:mn.decode(e.Fltr.UndA),displacementFile:{signature:e.Fltr.DspF.sig,path:e.Fltr.DspF.path}}});case"Pnch":return c(c({},n),{type:"pinch",filter:{amount:e.Fltr.Amnt}});case"Plr ":return c(c({},n),{type:"polar coordinates",filter:{conversion:_o.decode(e.Fltr.Cnvr)}});case"Rple":return c(c({},n),{type:"ripple",filter:{amount:e.Fltr.Amnt,size:zo.decode(e.Fltr.RplS)}});case"Shr ":return c(c({},n),{type:"shear",filter:{shearPoints:e.Fltr.ShrP.map(function(l){return{x:l.Hrzn,y:l.Vrtc}}),shearStart:e.Fltr.ShrS,shearEnd:e.Fltr.ShrE,undefinedAreas:mn.decode(e.Fltr.UndA)}});case"Sphr":return c(c({},n),{type:"spherize",filter:{amount:e.Fltr.Amnt,mode:No.decode(e.Fltr.SphM)}});case"Twrl":return c(c({},n),{type:"twirl",filter:{angle:e.Fltr.Angl}});case"Wave":return c(c({},n),{type:"wave",filter:{numberOfGenerators:e.Fltr.NmbG,type:Uo.decode(e.Fltr.Wvtp),wavelength:{min:e.Fltr.WLMn,max:e.Fltr.WLMx},amplitude:{min:e.Fltr.AmMn,max:e.Fltr.AmMx},scale:{x:e.Fltr.SclH,y:e.Fltr.SclV},randomSeed:e.Fltr.RndS,undefinedAreas:mn.decode(e.Fltr.UndA)}});case"ZgZg":return c(c({},n),{type:"zigzag",filter:{amount:e.Fltr.Amnt,ridges:e.Fltr.NmbR,style:Go.decode(e.Fltr.ZZTy)}});case"AdNs":return c(c({},n),{type:"add noise",filter:{amount:J(e.Fltr.Nose),distribution:Vo.decode(e.Fltr.Dstr),monochromatic:e.Fltr.Mnch,randomSeed:e.Fltr.FlRs}});case"DstS":return c(c({},n),{type:"dust and scratches",filter:{radius:e.Fltr["Rds "],threshold:e.Fltr.Thsh}});case"Mdn ":return c(c({},n),{type:"median",filter:{radius:q(e.Fltr["Rds "])}});case"denoise":return c(c({},n),{type:"reduce noise",filter:{preset:e.Fltr.preset,removeJpegArtifact:e.Fltr.removeJPEGArtifact,reduceColorNoise:J(e.Fltr.ClNs),sharpenDetails:J(e.Fltr.Shrp),channelDenoise:e.Fltr.channelDenoise.map(function(l){return c({channels:l.Chnl.map(function(u){return jo.decode(u)}),amount:l.Amnt},l.EdgF?{preserveDetails:l.EdgF}:{})})}});case"ClrH":return c(c({},n),{type:"color halftone",filter:{radius:e.Fltr["Rds "],angle1:e.Fltr.Ang1,angle2:e.Fltr.Ang2,angle3:e.Fltr.Ang3,angle4:e.Fltr.Ang4}});case"Crst":return c(c({},n),{type:"crystallize",filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case"Mztn":return c(c({},n),{type:"mezzotint",filter:{type:Ho.decode(e.Fltr.MztT),randomSeed:e.Fltr.FlRs}});case"Msc ":return c(c({},n),{type:"mosaic",filter:{cellSize:q(e.Fltr.ClSz)}});case"Pntl":return c(c({},n),{type:"pointillize",filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case"Clds":return c(c({},n),{type:"clouds",filter:{randomSeed:e.Fltr.FlRs}});case"DfrC":return c(c({},n),{type:"difference clouds",filter:{randomSeed:e.Fltr.FlRs}});case"Fbrs":return c(c({},n),{type:"fibers",filter:{variance:e.Fltr.Vrnc,strength:e.Fltr.Strg,randomSeed:e.Fltr.RndS}});case"LnsF":return c(c({},n),{type:"lens flare",filter:{brightness:e.Fltr.Brgh,position:{x:e.Fltr.FlrC.Hrzn,y:e.Fltr.FlrC.Vrtc},lensType:Wo.decode(e.Fltr["Lns "])}});case"smartSharpen":return c(c({},n),{type:"smart sharpen",filter:{amount:J(e.Fltr.Amnt),radius:q(e.Fltr["Rds "]),threshold:e.Fltr.Thsh,angle:e.Fltr.Angl,moreAccurate:e.Fltr.moreAccurate,blur:Xo.decode(e.Fltr.blur),preset:e.Fltr.preset,shadow:{fadeAmount:J(e.Fltr.sdwM.Amnt),tonalWidth:J(e.Fltr.sdwM.Wdth),radius:e.Fltr.sdwM["Rds "]},highlight:{fadeAmount:J(e.Fltr.hglM.Amnt),tonalWidth:J(e.Fltr.hglM.Wdth),radius:e.Fltr.hglM["Rds "]}}});case"UnsM":return c(c({},n),{type:"unsharp mask",filter:{amount:J(e.Fltr.Amnt),radius:q(e.Fltr["Rds "]),threshold:e.Fltr.Thsh}});case"Dfs ":return c(c({},n),{type:"diffuse",filter:{mode:Zo.decode(e.Fltr["Md "]),randomSeed:e.Fltr.FlRs}});case"Embs":return c(c({},n),{type:"emboss",filter:{angle:e.Fltr.Angl,height:e.Fltr.Hght,amount:e.Fltr.Amnt}});case"Extr":return c(c({},n),{type:"extrude",filter:{type:Yo.decode(e.Fltr.ExtT),size:e.Fltr.ExtS,depth:e.Fltr.ExtD,depthMode:qo.decode(e.Fltr.ExtR),randomSeed:e.Fltr.FlRs,solidFrontFaces:e.Fltr.ExtF,maskIncompleteBlocks:e.Fltr.ExtM}});case"Tls ":return c(c({},n),{type:"tiles",filter:{numberOfTiles:e.Fltr.TlNm,maximumOffset:e.Fltr.TlOf,fillEmptyAreaWith:$o.decode(e.Fltr.FlCl),randomSeed:e.Fltr.FlRs}});case"TrcC":return c(c({},n),{type:"trace contour",filter:{level:e.Fltr["Lvl "],edge:Ko.decode(e.Fltr["Edg "])}});case"Wnd ":return c(c({},n),{type:"wind",filter:{method:Jo.decode(e.Fltr.WndM),direction:Qo.decode(e.Fltr.Drct)}});case"Dntr":return c(c({},n),{type:"de-interlace",filter:{eliminate:ea.decode(e.Fltr.IntE),newFieldsBy:na.decode(e.Fltr.IntC)}});case"Cstm":return c(c({},n),{type:"custom",filter:{scale:e.Fltr["Scl "],offset:e.Fltr.Ofst,matrix:e.Fltr.Mtrx}});case"HghP":return c(c({},n),{type:"high pass",filter:{radius:q(e.Fltr["Rds "])}});case"Mxm ":return c(c({},n),{type:"maximum",filter:{radius:q(e.Fltr["Rds "])}});case"Mnm ":return c(c({},n),{type:"minimum",filter:{radius:q(e.Fltr["Rds "])}});case"Ofst":return c(c({},n),{type:"offset",filter:{horizontal:e.Fltr.Hrzn,vertical:e.Fltr.Vrtc,undefinedAreas:ta.decode(e.Fltr["Fl "])}});case"rigidTransform":return c(c({},n),{type:"puppet",filter:{rigidType:e.Fltr.rigidType,bounds:[{x:e.Fltr.PuX0,y:e.Fltr.PuY0},{x:e.Fltr.PuX1,y:e.Fltr.PuY1},{x:e.Fltr.PuX2,y:e.Fltr.PuY2},{x:e.Fltr.PuX3,y:e.Fltr.PuY3}],puppetShapeList:e.Fltr.puppetShapeList.map(function(l){return{rigidType:l.rigidType,originalVertexArray:Lr(l.originalVertexArray),deformedVertexArray:Lr(l.deformedVertexArray),indexArray:Array.from(Os(l.indexArray)),pinOffsets:tt(l.pinOffsets),posFinalPins:tt(l.posFinalPins),pinVertexIndices:l.pinVertexIndices,selectedPin:l.selectedPin,pinPosition:tt(l.PinP),pinRotation:l.PnRt,pinOverlay:l.PnOv,pinDepth:l.PnDp,meshQuality:l.meshQuality,meshExpansion:l.meshExpansion,meshRigidity:l.meshRigidity,imageResolution:l.imageResolution,meshBoundaryPath:{pathComponents:l.meshBoundaryPath.pathComponents.map(function(u){return{shapeOperation:u.shapeOperation.split(".")[1],paths:u.SbpL.map(function(s){return{closed:s.Clsp,points:s["Pts "].map(function(f){return{anchor:kn(f.Anch),forward:kn(f["Fwd "]),backward:kn(f["Bwd "]),smooth:f.Smoo}})}})}})}}})}});case"PbPl":{for(var i=[],r=e.Fltr,o=0;o<be.length&&r["PN".concat(be[o],"a")];o++)for(var a=0;a<be.length&&r["PN".concat(be[o]).concat(be[a])];a++)i.push({name:r["PN".concat(be[o]).concat(be[a])],value:r["PF".concat(be[o]).concat(be[a])]});return c(c({},n),{type:"oil paint plugin",filter:{name:e.Fltr.KnNm,gpu:e.Fltr.GpuY,lighting:e.Fltr.LIWy,parameters:i}})}case"HsbP":return c(c({},n),{type:"hsb/hsl",filter:{inputMode:at.decode(e.Fltr.Inpt),rowOrder:at.decode(e.Fltr.Otpt)}});case"oilPaint":return c(c({},n),{type:"oil paint",filter:{lightingOn:e.Fltr.lightingOn,stylization:e.Fltr.stylization,cleanliness:e.Fltr.cleanliness,brushScale:e.Fltr.brushScale,microBrush:e.Fltr.microBrush,lightDirection:e.Fltr.LghD,specularity:e.Fltr.specularity}});case"LqFy":return c(c({},n),{type:"liquify",filter:{liquifyMesh:e.Fltr.LqMe}});case"perspectiveWarpTransform":return c(c({},n),{type:"perspective warp",filter:{vertices:e.Fltr.vertices.map(kn),warpedVertices:e.Fltr.warpedVertices.map(kn),quads:e.Fltr.quads.map(function(l){return l.indices})}});default:if(t.throwForMissingFeatures)throw new Error("Unknown filter classId: ".concat(e.Fltr._classID));return}else switch(e.filterID){case 1098281575:return c(c({},n),{type:"average"});case 1114403360:return c(c({},n),{type:"blur"});case 1114403405:return c(c({},n),{type:"blur more"});case 1148416099:return c(c({},n),{type:"despeckle"});case 1180922912:return c(c({},n),{type:"facet"});case 1181902701:return c(c({},n),{type:"fragment"});case 1399353968:return c(c({},n),{type:"sharpen"});case 1399353925:return c(c({},n),{type:"sharpen edges"});case 1399353933:return c(c({},n),{type:"sharpen more"});case 1181639749:return c(c({},n),{type:"find edges"});case 1399616122:return c(c({},n),{type:"solarize"});case 1314149187:return c(c({},n),{type:"ntsc colors"});default:if(t.throwForMissingFeatures)throw new Error("Unknown filterID: ".concat(e.filterID))}}function ws(e,t){return{enabled:e.enab,validAtPosition:e.validAtPosition,maskEnabled:e.filterMaskEnable,maskLinked:e.filterMaskLinked,maskExtendWithWhite:e.filterMaskExtendWithWhite,list:e.filterFXList.map(function(n){return Ms(n,t)}).filter(function(n){return!!n})}}function Me(e){return ee(e.radius,"radius")}function Rs(e){var t={_name:"",_classID:"filterFX","Nm ":e.name,blendOptions:{_name:"",_classID:"blendOptions",Opct:xe(e.opacity),"Md ":ke.encode(e.blendMode)},enab:e.enabled,hasoptions:e.hasOptions,FrgC:Le(e.foregroundColor),BckC:Le(e.backgroundColor)};switch(e.type){case"average":return c(c({},t),{filterID:1098281575});case"blur":return c(c({},t),{filterID:1114403360});case"blur more":return c(c({},t),{filterID:1114403405});case"box blur":return c(c({},t),{Fltr:{_name:"Box Blur",_classID:"boxblur","Rds ":Me(e.filter)},filterID:697});case"gaussian blur":return c(c({},t),{Fltr:{_name:"Gaussian Blur",_classID:"GsnB","Rds ":Me(e.filter)},filterID:1198747202});case"motion blur":return c(c({},t),{Fltr:{_name:"Motion Blur",_classID:"MtnB",Angl:e.filter.angle,Dstn:ee(e.filter.distance,"distance")},filterID:1299476034});case"radial blur":return c(c({},t),{Fltr:{_name:"Radial Blur",_classID:"RdlB",Amnt:e.filter.amount,BlrM:Oo.encode(e.filter.method),BlrQ:Mo.encode(e.filter.quality)},filterID:1382313026});case"shape blur":return c(c({},t),{Fltr:{_name:"Shape Blur",_classID:"shapeBlur","Rds ":Me(e.filter),customShape:{_name:"",_classID:"customShape","Nm ":e.filter.customShape.name,Idnt:e.filter.customShape.id}},filterID:702});case"smart blur":return c(c({},t),{Fltr:{_name:"Smart Blur",_classID:"SmrB","Rds ":e.filter.radius,Thsh:e.filter.threshold,SmBQ:Ro.encode(e.filter.quality),SmBM:wo.encode(e.filter.mode)},filterID:1399681602});case"surface blur":return c(c({},t),{Fltr:{_name:"Surface Blur",_classID:"surfaceBlur","Rds ":Me(e.filter),Thsh:e.filter.threshold},filterID:701});case"displace":return c(c({},t),{Fltr:{_name:"Displace",_classID:"Dspl",HrzS:e.filter.horizontalScale,VrtS:e.filter.verticalScale,DspM:Bo.encode(e.filter.displacementMap),UndA:mn.encode(e.filter.undefinedAreas),DspF:{sig:e.filter.displacementFile.signature,path:e.filter.displacementFile.path}},filterID:1148416108});case"pinch":return c(c({},t),{Fltr:{_name:"Pinch",_classID:"Pnch",Amnt:e.filter.amount},filterID:1349411688});case"polar coordinates":return c(c({},t),{Fltr:{_name:"Polar Coordinates",_classID:"Plr ",Cnvr:_o.encode(e.filter.conversion)},filterID:1349284384});case"ripple":return c(c({},t),{Fltr:{_name:"Ripple",_classID:"Rple",Amnt:e.filter.amount,RplS:zo.encode(e.filter.size)},filterID:1383099493});case"shear":return c(c({},t),{Fltr:{_name:"Shear",_classID:"Shr ",ShrP:e.filter.shearPoints.map(function(u){return{_name:"",_classID:"Pnt ",Hrzn:u.x,Vrtc:u.y}}),UndA:mn.encode(e.filter.undefinedAreas),ShrS:e.filter.shearStart,ShrE:e.filter.shearEnd},filterID:1399353888});case"spherize":return c(c({},t),{Fltr:{_name:"Spherize",_classID:"Sphr",Amnt:e.filter.amount,SphM:No.encode(e.filter.mode)},filterID:1399875698});case"twirl":return c(c({},t),{Fltr:{_name:"Twirl",_classID:"Twrl",Angl:e.filter.angle},filterID:1417114220});case"wave":return c(c({},t),{Fltr:{_name:"Wave",_classID:"Wave",Wvtp:Uo.encode(e.filter.type),NmbG:e.filter.numberOfGenerators,WLMn:e.filter.wavelength.min,WLMx:e.filter.wavelength.max,AmMn:e.filter.amplitude.min,AmMx:e.filter.amplitude.max,SclH:e.filter.scale.x,SclV:e.filter.scale.y,UndA:mn.encode(e.filter.undefinedAreas),RndS:e.filter.randomSeed},filterID:1466005093});case"zigzag":return c(c({},t),{Fltr:{_name:"ZigZag",_classID:"ZgZg",Amnt:e.filter.amount,NmbR:e.filter.ridges,ZZTy:Go.encode(e.filter.style)},filterID:1516722791});case"add noise":return c(c({},t),{Fltr:{_name:"Add Noise",_classID:"AdNs",Dstr:Vo.encode(e.filter.distribution),Nose:xe(e.filter.amount),Mnch:e.filter.monochromatic,FlRs:e.filter.randomSeed},filterID:1097092723});case"despeckle":return c(c({},t),{filterID:1148416099});case"dust and scratches":return c(c({},t),{Fltr:{_name:"Dust & Scratches",_classID:"DstS","Rds ":e.filter.radius,Thsh:e.filter.threshold},filterID:1148417107});case"median":return c(c({},t),{Fltr:{_name:"Median",_classID:"Mdn ","Rds ":Me(e.filter)},filterID:1298427424});case"reduce noise":return c(c({},t),{Fltr:{_name:"Reduce Noise",_classID:"denoise",ClNs:xe(e.filter.reduceColorNoise),Shrp:xe(e.filter.sharpenDetails),removeJPEGArtifact:e.filter.removeJpegArtifact,channelDenoise:e.filter.channelDenoise.map(function(u){return c({_name:"",_classID:"channelDenoiseParams",Chnl:u.channels.map(function(s){return jo.encode(s)}),Amnt:u.amount},u.preserveDetails?{EdgF:u.preserveDetails}:{})}),preset:e.filter.preset},filterID:633});case"color halftone":return c(c({},t),{Fltr:{_name:"Color Halftone",_classID:"ClrH","Rds ":e.filter.radius,Ang1:e.filter.angle1,Ang2:e.filter.angle2,Ang3:e.filter.angle3,Ang4:e.filter.angle4},filterID:1131180616});case"crystallize":return c(c({},t),{Fltr:{_name:"Crystallize",_classID:"Crst",ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1131574132});case"facet":return c(c({},t),{filterID:1180922912});case"fragment":return c(c({},t),{filterID:1181902701});case"mezzotint":return c(c({},t),{Fltr:{_name:"Mezzotint",_classID:"Mztn",MztT:Ho.encode(e.filter.type),FlRs:e.filter.randomSeed},filterID:1299870830});case"mosaic":return c(c({},t),{Fltr:{_name:"Mosaic",_classID:"Msc ",ClSz:ee(e.filter.cellSize,"cellSize")},filterID:1299407648});case"pointillize":return c(c({},t),{Fltr:{_name:"Pointillize",_classID:"Pntl",ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1349416044});case"clouds":return c(c({},t),{Fltr:{_name:"Clouds",_classID:"Clds",FlRs:e.filter.randomSeed},filterID:1131177075});case"difference clouds":return c(c({},t),{Fltr:{_name:"Difference Clouds",_classID:"DfrC",FlRs:e.filter.randomSeed},filterID:1147564611});case"fibers":return c(c({},t),{Fltr:{_name:"Fibers",_classID:"Fbrs",Vrnc:e.filter.variance,Strg:e.filter.strength,RndS:e.filter.randomSeed},filterID:1180856947});case"lens flare":return c(c({},t),{Fltr:{_name:"Lens Flare",_classID:"LnsF",Brgh:e.filter.brightness,FlrC:{_name:"",_classID:"Pnt ",Hrzn:e.filter.position.x,Vrtc:e.filter.position.y},"Lns ":Wo.encode(e.filter.lensType)},filterID:1282306886});case"sharpen":return c(c({},t),{filterID:1399353968});case"sharpen edges":return c(c({},t),{filterID:1399353925});case"sharpen more":return c(c({},t),{filterID:1399353933});case"smart sharpen":return c(c({},t),{Fltr:{_name:"Smart Sharpen",_classID:"smartSharpen",Amnt:xe(e.filter.amount),"Rds ":Me(e.filter),Thsh:e.filter.threshold,Angl:e.filter.angle,moreAccurate:e.filter.moreAccurate,blur:Xo.encode(e.filter.blur),preset:e.filter.preset,sdwM:{_name:"Parameters",_classID:"adaptCorrectTones",Amnt:xe(e.filter.shadow.fadeAmount),Wdth:xe(e.filter.shadow.tonalWidth),"Rds ":e.filter.shadow.radius},hglM:{_name:"Parameters",_classID:"adaptCorrectTones",Amnt:xe(e.filter.highlight.fadeAmount),Wdth:xe(e.filter.highlight.tonalWidth),"Rds ":e.filter.highlight.radius}},filterID:698});case"unsharp mask":return c(c({},t),{Fltr:{_name:"Unsharp Mask",_classID:"UnsM",Amnt:xe(e.filter.amount),"Rds ":Me(e.filter),Thsh:e.filter.threshold},filterID:1433301837});case"diffuse":return c(c({},t),{Fltr:{_name:"Diffuse",_classID:"Dfs ","Md ":Zo.encode(e.filter.mode),FlRs:e.filter.randomSeed},filterID:1147564832});case"emboss":return c(c({},t),{Fltr:{_name:"Emboss",_classID:"Embs",Angl:e.filter.angle,Hght:e.filter.height,Amnt:e.filter.amount},filterID:1164796531});case"extrude":return c(c({},t),{Fltr:{_name:"Extrude",_classID:"Extr",ExtS:e.filter.size,ExtD:e.filter.depth,ExtF:e.filter.solidFrontFaces,ExtM:e.filter.maskIncompleteBlocks,ExtT:Yo.encode(e.filter.type),ExtR:qo.encode(e.filter.depthMode),FlRs:e.filter.randomSeed},filterID:1165522034});case"find edges":return c(c({},t),{filterID:1181639749});case"solarize":return c(c({},t),{filterID:1399616122});case"tiles":return c(c({},t),{Fltr:{_name:"Tiles",_classID:"Tls ",TlNm:e.filter.numberOfTiles,TlOf:e.filter.maximumOffset,FlCl:$o.encode(e.filter.fillEmptyAreaWith),FlRs:e.filter.randomSeed},filterID:1416393504});case"trace contour":return c(c({},t),{Fltr:{_name:"Trace Contour",_classID:"TrcC","Lvl ":e.filter.level,"Edg ":Ko.encode(e.filter.edge)},filterID:1416782659});case"wind":return c(c({},t),{Fltr:{_name:"Wind",_classID:"Wnd ",WndM:Jo.encode(e.filter.method),Drct:Qo.encode(e.filter.direction)},filterID:1466852384});case"de-interlace":return c(c({},t),{Fltr:{_name:"De-Interlace",_classID:"Dntr",IntE:ea.encode(e.filter.eliminate),IntC:na.encode(e.filter.newFieldsBy)},filterID:1148089458});case"ntsc colors":return c(c({},t),{filterID:1314149187});case"custom":return c(c({},t),{Fltr:{_name:"Custom",_classID:"Cstm","Scl ":e.filter.scale,Ofst:e.filter.offset,Mtrx:e.filter.matrix},filterID:1131639917});case"high pass":return c(c({},t),{Fltr:{_name:"High Pass",_classID:"HghP","Rds ":Me(e.filter)},filterID:1214736464});case"maximum":return c(c({},t),{Fltr:{_name:"Maximum",_classID:"Mxm ","Rds ":Me(e.filter)},filterID:1299737888});case"minimum":return c(c({},t),{Fltr:{_name:"Minimum",_classID:"Mnm ","Rds ":Me(e.filter)},filterID:1299082528});case"offset":return c(c({},t),{Fltr:{_name:"Offset",_classID:"Ofst",Hrzn:e.filter.horizontal,Vrtc:e.filter.vertical,"Fl ":ta.encode(e.filter.undefinedAreas)},filterID:1332114292});case"puppet":return c(c({},t),{Fltr:{_name:"Rigid Transform",_classID:"rigidTransform",null:["Ordn.Trgt"],rigidType:e.filter.rigidType,puppetShapeList:e.filter.puppetShapeList.map(function(u){return{_name:"",_classID:"puppetShape",rigidType:u.rigidType,VrsM:1,VrsN:0,originalVertexArray:Ot(new Float32Array(xn(u.originalVertexArray))),deformedVertexArray:Ot(new Float32Array(xn(u.deformedVertexArray))),indexArray:Ot(new Uint32Array(u.indexArray)),pinOffsets:xn(u.pinOffsets),posFinalPins:xn(u.posFinalPins),pinVertexIndices:u.pinVertexIndices,PinP:xn(u.pinPosition),PnRt:u.pinRotation,PnOv:u.pinOverlay,PnDp:u.pinDepth,meshQuality:u.meshQuality,meshExpansion:u.meshExpansion,meshRigidity:u.meshRigidity,imageResolution:u.imageResolution,meshBoundaryPath:{_name:"",_classID:"pathClass",pathComponents:u.meshBoundaryPath.pathComponents.map(function(s){return{_name:"",_classID:"PaCm",shapeOperation:"shapeOperation.".concat(s.shapeOperation),SbpL:s.paths.map(function(f){return{_name:"",_classID:"Sbpl",Clsp:f.closed,"Pts ":f.points.map(function(h){return{_name:"",_classID:"Pthp",Anch:In(h.anchor),"Fwd ":In(h.forward),"Bwd ":In(h.backward),Smoo:h.smooth}})}})}})},selectedPin:u.selectedPin}}),PuX0:e.filter.bounds[0].x,PuX1:e.filter.bounds[1].x,PuX2:e.filter.bounds[2].x,PuX3:e.filter.bounds[3].x,PuY0:e.filter.bounds[0].y,PuY1:e.filter.bounds[1].y,PuY2:e.filter.bounds[2].y,PuY3:e.filter.bounds[3].y},filterID:991});case"oil paint plugin":{for(var n={},i=0;i<e.filter.parameters.length;i++){var r=e.filter.parameters[i],o=r.name,a=r.value,l="".concat(be[Math.floor(i/be.length)]).concat(be[i%be.length]);n["PN".concat(l)]=o,n["PT".concat(l)]=0,n["PF".concat(l)]=a}return c(c({},t),{Fltr:c({_name:"Oil Paint Plugin",_classID:"PbPl",KnNm:e.filter.name,GpuY:e.filter.gpu,LIWy:e.filter.lighting,FPth:"1"},n),filterID:1348620396})}case"oil paint":return c(c({},t),{Fltr:{_name:"Oil Paint",_classID:"oilPaint",lightingOn:e.filter.lightingOn,stylization:e.filter.stylization,cleanliness:e.filter.cleanliness,brushScale:e.filter.brushScale,microBrush:e.filter.microBrush,LghD:e.filter.lightDirection,specularity:e.filter.specularity},filterID:1122});case"liquify":return c(c({},t),{Fltr:{_name:"Liquify",_classID:"LqFy",LqMe:e.filter.liquifyMesh},filterID:1282492025});case"perspective warp":return c(c({},t),{Fltr:{_name:"Perspective Warp",_classID:"perspectiveWarpTransform",vertices:e.filter.vertices.map(In),warpedVertices:e.filter.warpedVertices.map(In),quads:e.filter.quads.map(function(u){return{indices:u}})},filterID:442});default:throw new Error("Unknow filter type: ".concat(e.type))}}function ya(e){if(e.warp)return e.warp;if(!e.width||!e.height)throw new Error("You must provide width and height of the linked image in placedLayer");var t=e.width,n=e.height,i=0,r=t/3,o=t*2/3,a=t,l=0,u=n/3,s=n*2/3,f=n;return{style:"custom",value:0,perspective:0,perspectiveOther:0,rotate:"horizontal",bounds:{top:{value:0,units:"Pixels"},left:{value:0,units:"Pixels"},bottom:{value:n,units:"Pixels"},right:{value:t,units:"Pixels"}},uOrder:4,vOrder:4,customEnvelopeWarp:{meshPoints:[{x:i,y:l},{x:r,y:l},{x:o,y:l},{x:a,y:l},{x:i,y:u},{x:r,y:u},{x:o,y:u},{x:a,y:u},{x:i,y:s},{x:r,y:s},{x:o,y:s},{x:a,y:s},{x:i,y:f},{x:r,y:f},{x:o,y:f},{x:a,y:f}]}}}O("SoLd",K("placedLayer"),function(e,t,n){if(Q(e)!=="soLD")throw new Error("Invalid SoLd type");var i=M(e);if(i!==4&&i!==5)throw new Error("Invalid SoLd version");var r=j(e,!0);t.placedLayer={id:r.Idnt,placed:r.placed,type:vn[r.Type],pageNumber:r.PgNm,totalPages:r.totalPages,frameStep:he(r.frameStep),duration:he(r.duration),frameCount:r.frameCount,transform:r.Trnf,width:r["Sz "].Wdth,height:r["Sz "].Hght,resolution:q(r.Rslt),warp:ba(r.quiltWarp||r.warp)},r.nonAffineTransform&&r.nonAffineTransform.some(function(o,a){return o!==r.Trnf[a]})&&(t.placedLayer.nonAffineTransform=r.nonAffineTransform),r.Crop&&(t.placedLayer.crop=r.Crop),r.comp&&(t.placedLayer.comp=r.comp),r.compInfo&&(t.placedLayer.compInfo={compID:r.compInfo.compID,originalCompID:r.compInfo.originalCompID}),r.filterFX&&(t.placedLayer.filter=ws(r.filterFX,e)),E(e,n())},function(e,t){var n,i;N(e,"soLD"),G(e,4);var r=t.placedLayer;if(!r.id||typeof r.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(r.id))throw new Error("Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");var o=c(c({Idnt:r.id,placed:(n=r.placed)!==null&&n!==void 0?n:r.id,PgNm:r.pageNumber||1,totalPages:r.totalPages||1},r.crop?{Crop:r.crop}:{}),{frameStep:r.frameStep||{numerator:0,denominator:600},duration:r.duration||{numerator:0,denominator:600},frameCount:r.frameCount||0,Annt:16,Type:vn.indexOf(r.type),Trnf:r.transform,nonAffineTransform:(i=r.nonAffineTransform)!==null&&i!==void 0?i:r.transform,warp:st(ya(r)),"Sz ":{_name:"",_classID:"Pnt ",Wdth:r.width||0,Hght:r.height||0},Rslt:r.resolution?ee(r.resolution,"resolution"):{units:"Density",value:72}});if(r.filter&&(o.filterFX={_name:"",_classID:"filterFXStyle",enab:r.filter.enabled,validAtPosition:r.filter.validAtPosition,filterMaskEnable:r.filter.maskEnabled,filterMaskLinked:r.filter.maskLinked,filterMaskExtendWithWhite:r.filter.maskExtendWithWhite,filterFXList:r.filter.list.map(function(l){return Rs(l)})}),r.warp&&ti(r.warp)){var a=st(r.warp);o.quiltWarp=a,o.warp={warpStyle:"warpStyle.warpNone",warpValue:a.warpValue,warpPerspective:a.warpPerspective,warpPerspectiveOther:a.warpPerspectiveOther,warpRotate:a.warpRotate,bounds:a.bounds,uOrder:a.uOrder,vOrder:a.vOrder}}else delete o.quiltWarp;r.comp&&(o.comp=r.comp),r.compInfo&&(o.compInfo=r.compInfo),H(e,"","null",o,o.quiltWarp?"quiltWarp":"warp")});Sn("SoLE","SoLd");O("fxrp",K("referencePoint"),function(e,t){t.referencePoint={x:Ie(e),y:Ie(e)}},function(e,t){we(e,t.referencePoint.x),we(e,t.referencePoint.y)});O("Lr16",function(){return!1},function(e,t,n,i){Qt(e,i)},function(e,t){});O("Lr32",function(){return!1},function(e,t,n,i){Qt(e,i)},function(e,t){});O("LMsk",K("userMask"),function(e,t){t.userMask={colorSpace:oe(e),opacity:k(e)/255};var n=L(e);if(n!==128)throw new Error("Invalid flag value");E(e,1)},function(e,t){var n=t.userMask;le(e,n.colorSpace),x(e,oo(n.opacity,0,1)*255),T(e,128),$(e,1)});O("Patt",function(e){return!e},function(e,t,n){n()&&E(e,n())},function(e,t){});function Or(e){var t=M(e),n=M(e),i=M(e),r=M(e);return{top:t,left:n,bottom:i,right:r}}function Mr(e,t){G(e,t.top),G(e,t.left),G(e,t.bottom),G(e,t.right)}O("Anno",function(e){return e.annotations!==void 0},function(e,t,n){var i=k(e),r=k(e);if(i!==2||r!==1)throw new Error("Invalid Anno version");for(var o=I(e),a=[],l=0;l<o;l++){I(e);var u=Q(e),s=!!L(e);L(e),k(e);var f=Or(e),h=Or(e),p=oe(e),d=Ve(e,2),m=Ve(e,2),v=Ve(e,2);I(e),Q(e);var F=I(e),b=void 0;if(u==="txtA")F>=2&&k(e)===65279?b=Kt(e,(F-2)/2):(e.offset-=2,b=Jt(e,F)),b=b.replace(/\r/g,`
`);else if(u==="sndA")b=fe(e,F);else throw new Error("Unknown annotation type");a.push({type:u==="txtA"?"text":"sound",open:s,iconLocation:f,popupLocation:h,color:p,author:d,name:m,date:v,data:b})}t.annotations=a,E(e,n())},function(e,t){var n=t.annotations;x(e,2),x(e,1),P(e,n.length);for(var i=0,r=n;i<r.length;i++){var o=r[i],a=o.type==="sound";if(a&&!(o.data instanceof Uint8Array))throw new Error("Sound annotation data should be Uint8Array");if(!a&&typeof o.data!="string")throw new Error("Text annotation data should be string");var l=e.offset;P(e,0),N(e,a?"sndA":"txtA"),T(e,o.open?1:0),T(e,28),x(e,1),Mr(e,o.iconLocation),Mr(e,o.popupLocation),le(e,o.color),nn(e,o.author||"",2),nn(e,o.name||"",2),nn(e,o.date||"",2);var u=e.offset;P(e,0),N(e,a?"sndM":"txtC"),P(e,0);var s=e.offset;if(a)qe(e,o.data);else{x(e,65279);for(var f=o.data.replace(/\n/g,"\r"),h=0;h<f.length;h++)x(e,f.charCodeAt(h))}e.view.setUint32(l,e.offset-l,!1),e.view.setUint32(u,e.offset-u,!1),e.view.setUint32(s-4,e.offset-s,!1)}});function Sa(e){O(e,function(t){var n=t;return!(!n.linkedFiles||!n.linkedFiles.length||e==="lnkE"&&!n.linkedFiles.some(function(i){return i.linkedFile}))},function(t,n,i,r){var o=n;for(o.linkedFiles=o.linkedFiles||[];i()>8;){var a=Tt(t),l=t.offset,u=Q(t),s=M(t),f=Ve(t,1),h=se(t),p=Q(t).trim(),d=Q(t).trim(),m=Tt(t),v=L(t),F=v?j(t):void 0,b=u==="liFE"?j(t):void 0,g={id:f,name:h};if(p&&(g.type=p),d&&(g.creator=d),F&&(g.descriptor={compInfo:{compID:F.compInfo.compID,originalCompID:F.compInfo.originalCompID}}),u==="liFE"&&s>3){var y=M(t),S=L(t),C=L(t),_=L(t),A=L(t),R=Ie(t),U=Math.floor(R),B=(R-U)*1e3;g.time=new Date(Date.UTC(y,S,C,_,A,U,B)).toISOString()}var z=u==="liFE"?Tt(t):0;for(u==="liFA"&&E(t,8),u==="liFD"&&(g.data=fe(t,m)),s>=5&&(g.childDocumentID=se(t)),s>=6&&(g.assetModTime=Ie(t)),s>=7&&(g.assetLockedState=L(t)),u==="liFE"&&s===2&&(g.data=fe(t,z)),t.skipLinkedFilesData&&(g.data=void 0),e==="lnkE"&&(g.linkedFile={fileSize:z,name:b?.["Nm "]||"",fullPath:b?.fullPath||"",originalPath:b?.originalPath||"",relativePath:b?.relPath||""}),o.linkedFiles.push(g);a%4;)a++;t.offset=l+a}E(t,i())},function(t,n){for(var i,r,o,a,l,u,s,f,h,p=n,d=0,m=p.linkedFiles;d<m.length;d++){var v=m[d];if(e==="lnkE"==!!v.linkedFile){var F=2;v.assetLockedState!=null?F=7:v.assetModTime!=null?F=6:v.childDocumentID!=null?F=5:e=="lnkE"&&(F=3),Lt(t,0);var b=t.offset;if(N(t,e==="lnkE"?"liFE":v.data?"liFD":"liFA"),G(t,F),!v.id||typeof v.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(v.id))throw new Error("Linked file ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");if(nn(t,v.id,1),rn(t,v.name||""),N(t,v.type?"".concat(v.type," ").substring(0,4):" "),N(t,v.creator?"".concat(v.creator," ").substring(0,4):"\0\0\0\0"),Lt(t,v.data?v.data.byteLength:0),v.descriptor&&v.descriptor.compInfo){var g={compInfo:{compID:v.descriptor.compInfo.compID,originalCompID:v.descriptor.compInfo.originalCompID}};T(t,1),H(t,"","null",g)}else T(t,0);if(e==="lnkE"){var g={descVersion:2,"Nm ":(r=(i=v.linkedFile)===null||i===void 0?void 0:i.name)!==null&&r!==void 0?r:"",fullPath:(a=(o=v.linkedFile)===null||o===void 0?void 0:o.fullPath)!==null&&a!==void 0?a:"",originalPath:(u=(l=v.linkedFile)===null||l===void 0?void 0:l.originalPath)!==null&&u!==void 0?u:"",relPath:(f=(s=v.linkedFile)===null||s===void 0?void 0:s.relativePath)!==null&&f!==void 0?f:""};H(t,"","ExternalFileLink",g);var y=v.time?new Date(v.time):new Date;G(t,y.getUTCFullYear()),T(t,y.getUTCMonth()),T(t,y.getUTCDate()),T(t,y.getUTCHours()),T(t,y.getUTCMinutes()),we(t,y.getUTCSeconds()+y.getUTCMilliseconds()/1e3)}v.data?qe(t,v.data):Lt(t,((h=v.linkedFile)===null||h===void 0?void 0:h.fileSize)||0),F>=5&&rn(t,v.childDocumentID||""),F>=6&&we(t,v.assetModTime||0),F>=7&&T(t,v.assetLockedState||0);var S=t.offset-b;for(t.view.setUint32(b-4,S,!1);S%4;)S++,T(t,0)}}})}Sa("lnk2");Sa("lnkE");Sn("lnkD","lnk2");Sn("lnk3","lnk2");O("pths",K("pathList"),function(e,t){j(e,!0),t.pathList=[]},function(e,t){var n={pathList:[]};H(e,"","pathsDataClass",n)});O("lyvr",K("version"),function(e,t){return t.version=I(e)},function(e,t){return P(e,t.version)});function ce(e){return function(t){return!!t.adjustment&&t.adjustment.type===e}}O("brit",ce("brightness/contrast"),function(e,t,n){t.adjustment||(t.adjustment={type:"brightness/contrast",brightness:V(e),contrast:V(e),meanValue:V(e),labColorOnly:!!L(e),useLegacy:!0}),E(e,n())},function(e,t){var n,i=t.adjustment;Z(e,i.brightness||0),Z(e,i.contrast||0),Z(e,(n=i.meanValue)!==null&&n!==void 0?n:127),T(e,i.labColorOnly?1:0),$(e,1)});function $n(e){var t=V(e),n=V(e),i=V(e),r=V(e),o=V(e)/100;return{shadowInput:t,highlightInput:n,shadowOutput:i,highlightOutput:r,midtoneInput:o}}function Cn(e,t){Z(e,t.shadowInput),Z(e,t.highlightInput),Z(e,t.shadowOutput),Z(e,t.highlightOutput),Z(e,Math.round(t.midtoneInput*100))}O("levl",ce("levels"),function(e,t,n){if(k(e)!==2)throw new Error("Invalid levl version");t.adjustment=c(c({},t.adjustment),{type:"levels",rgb:$n(e),red:$n(e),green:$n(e),blue:$n(e)}),E(e,n())},function(e,t){var n=t.adjustment,i={shadowInput:0,highlightInput:255,shadowOutput:0,highlightOutput:255,midtoneInput:1};x(e,2),Cn(e,n.rgb||i),Cn(e,n.red||i),Cn(e,n.blue||i),Cn(e,n.green||i);for(var r=0;r<59;r++)Cn(e,i)});function Kn(e){for(var t=k(e),n=[],i=0;i<t;i++){var r=V(e),o=V(e);n.push({input:o,output:r})}return n}function Xe(e,t){x(e,t.length);for(var n=0,i=t;n<i.length;n++){var r=i[n];x(e,r.output),x(e,r.input)}}O("curv",ce("curves"),function(e,t,n){if(L(e),k(e)!==1)throw new Error("Invalid curv version");k(e);var i=k(e),r={type:"curves"};i&1&&(r.rgb=Kn(e)),i&2&&(r.red=Kn(e)),i&4&&(r.green=Kn(e)),i&8&&(r.blue=Kn(e)),t.adjustment=c(c({},t.adjustment),r),E(e,n())},function(e,t){var n=t.adjustment,i=n.rgb,r=n.red,o=n.green,a=n.blue,l=0,u=0;i&&i.length&&(l|=1,u++),r&&r.length&&(l|=2,u++),o&&o.length&&(l|=4,u++),a&&a.length&&(l|=8,u++),T(e,0),x(e,1),x(e,0),x(e,l),i&&i.length&&Xe(e,i),r&&r.length&&Xe(e,r),o&&o.length&&Xe(e,o),a&&a.length&&Xe(e,a),N(e,"Crv "),x(e,4),x(e,0),x(e,u),i&&i.length&&(x(e,0),Xe(e,i)),r&&r.length&&(x(e,1),Xe(e,r)),o&&o.length&&(x(e,2),Xe(e,o)),a&&a.length&&(x(e,3),Xe(e,a)),$(e,2)});O("expA",ce("exposure"),function(e,t,n){if(k(e)!==1)throw new Error("Invalid expA version");t.adjustment=c(c({},t.adjustment),{type:"exposure",exposure:Pe(e),offset:Pe(e),gamma:Pe(e)}),E(e,n())},function(e,t){var n=t.adjustment;x(e,1),Ee(e,n.exposure),Ee(e,n.offset),Ee(e,n.gamma),$(e,2)});O("vibA",ce("vibrance"),function(e,t,n){var i=j(e);t.adjustment={type:"vibrance"},i.vibrance!==void 0&&(t.adjustment.vibrance=i.vibrance),i.Strt!==void 0&&(t.adjustment.saturation=i.Strt),E(e,n())},function(e,t){var n=t.adjustment,i={};n.vibrance!==void 0&&(i.vibrance=n.vibrance),n.saturation!==void 0&&(i.Strt=n.saturation),H(e,"","null",i)});function Ke(e){return{a:V(e),b:V(e),c:V(e),d:V(e),hue:V(e),saturation:V(e),lightness:V(e)}}function Je(e,t){var n=t||{};Z(e,n.a||0),Z(e,n.b||0),Z(e,n.c||0),Z(e,n.d||0),Z(e,n.hue||0),Z(e,n.saturation||0),Z(e,n.lightness||0)}O("hue2",ce("hue/saturation"),function(e,t,n){if(k(e)!==2)throw new Error("Invalid hue2 version");t.adjustment=c(c({},t.adjustment),{type:"hue/saturation",master:Ke(e),reds:Ke(e),yellows:Ke(e),greens:Ke(e),cyans:Ke(e),blues:Ke(e),magentas:Ke(e)}),E(e,n())},function(e,t){var n=t.adjustment;x(e,2),Je(e,n.master),Je(e,n.reds),Je(e,n.yellows),Je(e,n.greens),Je(e,n.cyans),Je(e,n.blues),Je(e,n.magentas)});function Mt(e){return{cyanRed:V(e),magentaGreen:V(e),yellowBlue:V(e)}}function wt(e,t){Z(e,t.cyanRed||0),Z(e,t.magentaGreen||0),Z(e,t.yellowBlue||0)}O("blnc",ce("color balance"),function(e,t,n){t.adjustment={type:"color balance",shadows:Mt(e),midtones:Mt(e),highlights:Mt(e),preserveLuminosity:!!L(e)},E(e,n())},function(e,t){var n=t.adjustment;wt(e,n.shadows||{}),wt(e,n.midtones||{}),wt(e,n.highlights||{}),T(e,n.preserveLuminosity?1:0),$(e,1)});O("blwh",ce("black & white"),function(e,t,n){var i=j(e);t.adjustment={type:"black & white",reds:i["Rd "],yellows:i.Yllw,greens:i["Grn "],cyans:i["Cyn "],blues:i["Bl "],magentas:i.Mgnt,useTint:!!i.useTint,presetKind:i.bwPresetKind,presetFileName:i.blackAndWhitePresetFileName},i.tintColor!==void 0&&(t.adjustment.tintColor=Te(i.tintColor)),E(e,n())},function(e,t){var n=t.adjustment,i={"Rd ":n.reds||0,Yllw:n.yellows||0,"Grn ":n.greens||0,"Cyn ":n.cyans||0,"Bl ":n.blues||0,Mgnt:n.magentas||0,useTint:!!n.useTint,tintColor:Le(n.tintColor),bwPresetKind:n.presetKind||0,blackAndWhitePresetFileName:n.presetFileName||""};H(e,"","null",i)});O("phfl",ce("photo filter"),function(e,t,n){var i=k(e);if(i!==2&&i!==3)throw new Error("Invalid phfl version");var r;i===2?r=oe(e):r={l:M(e)/100,a:M(e)/100,b:M(e)/100},t.adjustment={type:"photo filter",color:r,density:I(e)/100,preserveLuminosity:!!L(e)},E(e,n())},function(e,t){var n=t.adjustment;x(e,2),le(e,n.color||{l:0,a:0,b:0}),P(e,(n.density||0)*100),T(e,n.preserveLuminosity?1:0),$(e,3)});function Jn(e){var t=V(e),n=V(e),i=V(e);E(e,2);var r=V(e);return{red:t,green:n,blue:i,constant:r}}function Dn(e,t){var n=t||{};Z(e,n.red),Z(e,n.green),Z(e,n.blue),$(e,2),Z(e,n.constant)}O("mixr",ce("channel mixer"),function(e,t,n){if(k(e)!==1)throw new Error("Invalid mixr version");var i=t.adjustment=c(c({},t.adjustment),{type:"channel mixer",monochrome:!!k(e)});i.monochrome||(i.red=Jn(e),i.green=Jn(e),i.blue=Jn(e)),i.gray=Jn(e),E(e,n())},function(e,t){var n=t.adjustment;x(e,1),x(e,n.monochrome?1:0),n.monochrome?(Dn(e,n.gray),$(e,3*5*2)):(Dn(e,n.red),Dn(e,n.green),Dn(e,n.blue),Dn(e,n.gray))});var wr=w("colorLookupType","3DLUT",{"3dlut":"3DLUT",abstractProfile:"abstractProfile",deviceLinkProfile:"deviceLinkProfile"}),Rr=w("LUTFormatType","look",{look:"LUTFormatLOOK",cube:"LUTFormatCUBE","3dl":"LUTFormat3DL"}),Qn=w("colorLookupOrder","rgb",{rgb:"rgbOrder",bgr:"bgrOrder"});O("clrL",ce("color lookup"),function(e,t,n){if(k(e)!==1)throw new Error("Invalid clrL version");var i=j(e);t.adjustment={type:"color lookup"};var r=t.adjustment;i.lookupType!==void 0&&(r.lookupType=wr.decode(i.lookupType)),i["Nm "]!==void 0&&(r.name=i["Nm "]),i.Dthr!==void 0&&(r.dither=i.Dthr),i.profile!==void 0&&(r.profile=i.profile),i.LUTFormat!==void 0&&(r.lutFormat=Rr.decode(i.LUTFormat)),i.dataOrder!==void 0&&(r.dataOrder=Qn.decode(i.dataOrder)),i.tableOrder!==void 0&&(r.tableOrder=Qn.decode(i.tableOrder)),i.LUT3DFileData!==void 0&&(r.lut3DFileData=i.LUT3DFileData),i.LUT3DFileName!==void 0&&(r.lut3DFileName=i.LUT3DFileName),E(e,n())},function(e,t){var n=t.adjustment,i={};n.lookupType!==void 0&&(i.lookupType=wr.encode(n.lookupType)),n.name!==void 0&&(i["Nm "]=n.name),n.dither!==void 0&&(i.Dthr=n.dither),n.profile!==void 0&&(i.profile=n.profile),n.lutFormat!==void 0&&(i.LUTFormat=Rr.encode(n.lutFormat)),n.dataOrder!==void 0&&(i.dataOrder=Qn.encode(n.dataOrder)),n.tableOrder!==void 0&&(i.tableOrder=Qn.encode(n.tableOrder)),n.lut3DFileData!==void 0&&(i.LUT3DFileData=n.lut3DFileData),n.lut3DFileName!==void 0&&(i.LUT3DFileName=n.lut3DFileName),x(e,1),H(e,"","null",i)});O("nvrt",ce("invert"),function(e,t,n){t.adjustment={type:"invert"},E(e,n())},function(){});O("post",ce("posterize"),function(e,t,n){t.adjustment={type:"posterize",levels:k(e)},E(e,n())},function(e,t){var n,i=t.adjustment;x(e,(n=i.levels)!==null&&n!==void 0?n:4),$(e,2)});O("thrs",ce("threshold"),function(e,t,n){t.adjustment={type:"threshold",level:k(e)},E(e,n())},function(e,t){var n,i=t.adjustment;x(e,(n=i.level)!==null&&n!==void 0?n:128),$(e,2)});var Br=["","","","rgb","hsb","","lab"];O("grdm",ce("gradient map"),function(e,t,n){if(k(e)!==1)throw new Error("Invalid grdm version");var i={type:"gradient map",gradientType:"solid"};i.reverse=!!L(e),i.dither=!!L(e),i.name=se(e),i.colorStops=[],i.opacityStops=[];for(var r=k(e),o=0;o<r;o++)i.colorStops.push({location:I(e),midpoint:I(e)/100,color:oe(e)}),E(e,2);for(var a=k(e),o=0;o<a;o++)i.opacityStops.push({location:I(e),midpoint:I(e)/100,opacity:k(e)/255});var l=k(e);if(l!==2)throw new Error("Invalid grdm expansion count");var u=k(e);i.smoothness=u/4096;var s=k(e);if(s!==32)throw new Error("Invalid grdm length");i.gradientType=k(e)?"noise":"solid",i.randomSeed=I(e),i.addTransparency=!!k(e),i.restrictColors=!!k(e),i.roughness=I(e)/4096,i.colorModel=Br[k(e)]||"rgb",i.min=[k(e)/32768,k(e)/32768,k(e)/32768,k(e)/32768],i.max=[k(e)/32768,k(e)/32768,k(e)/32768,k(e)/32768],E(e,n());for(var f=0,h=i.colorStops;f<h.length;f++){var p=h[f];p.location/=u}for(var d=0,m=i.opacityStops;d<m.length;d++){var p=m[d];p.location/=u}t.adjustment=i},function(e,t){var n,i,r,o=t.adjustment;x(e,1),T(e,o.reverse?1:0),T(e,o.dither?1:0),rn(e,o.name||""),x(e,o.colorStops&&o.colorStops.length||0);for(var a=Math.round(((n=o.smoothness)!==null&&n!==void 0?n:1)*4096),l=0,u=o.colorStops||[];l<u.length;l++){var s=u[l];P(e,Math.round(s.location*a)),P(e,Math.round(s.midpoint*100)),le(e,s.color),$(e,2)}x(e,o.opacityStops&&o.opacityStops.length||0);for(var f=0,h=o.opacityStops||[];f<h.length;f++){var s=h[f];P(e,Math.round(s.location*a)),P(e,Math.round(s.midpoint*100)),x(e,Math.round(s.opacity*255))}x(e,2),x(e,a),x(e,32),x(e,o.gradientType==="noise"?1:0),P(e,o.randomSeed||0),x(e,o.addTransparency?1:0),x(e,o.restrictColors?1:0),P(e,Math.round(((i=o.roughness)!==null&&i!==void 0?i:1)*4096));var p=Br.indexOf((r=o.colorModel)!==null&&r!==void 0?r:"rgb");x(e,p===-1?3:p);for(var d=0;d<4;d++)x(e,Math.round((o.min&&o.min[d]||0)*32768));for(var d=0;d<4;d++)x(e,Math.round((o.max&&o.max[d]||0)*32768));$(e,4)});function Be(e){return{c:V(e),m:V(e),y:V(e),k:V(e)}}function _e(e,t){var n=t||{};Z(e,n.c),Z(e,n.m),Z(e,n.y),Z(e,n.k)}O("selc",ce("selective color"),function(e,t){if(k(e)!==1)throw new Error("Invalid selc version");var n=k(e)?"absolute":"relative";E(e,8),t.adjustment={type:"selective color",mode:n,reds:Be(e),yellows:Be(e),greens:Be(e),cyans:Be(e),blues:Be(e),magentas:Be(e),whites:Be(e),neutrals:Be(e),blacks:Be(e)}},function(e,t){var n=t.adjustment;x(e,1),x(e,n.mode==="absolute"?1:0),$(e,8),_e(e,n.reds),_e(e,n.yellows),_e(e,n.greens),_e(e,n.cyans),_e(e,n.blues),_e(e,n.magentas),_e(e,n.whites),_e(e,n.neutrals),_e(e,n.blacks)});O("CgEd",function(e){var t=e.adjustment;return t?t.type==="brightness/contrast"&&!t.useLegacy||(t.type==="levels"||t.type==="curves"||t.type==="exposure"||t.type==="channel mixer"||t.type==="hue/saturation")&&t.presetFileName!==void 0:!1},function(e,t,n){var i=j(e);if(i.Vrsn!==1)throw new Error("Invalid CgEd version");"presetFileName"in i?t.adjustment=c(c({},t.adjustment),{presetKind:i.presetKind,presetFileName:i.presetFileName}):"curvesPresetFileName"in i?t.adjustment=c(c({},t.adjustment),{presetKind:i.curvesPresetKind,presetFileName:i.curvesPresetFileName}):"mixerPresetFileName"in i?t.adjustment=c(c({},t.adjustment),{presetKind:i.mixerPresetKind,presetFileName:i.mixerPresetFileName}):t.adjustment={type:"brightness/contrast",brightness:i.Brgh,contrast:i.Cntr,meanValue:i.means,useLegacy:!!i.useLegacy,labColorOnly:!!i["Lab "],auto:!!i.Auto},E(e,n())},function(e,t){var n,i,r,o,a=t.adjustment;if(a.type==="levels"||a.type==="exposure"||a.type==="hue/saturation"){var l={Vrsn:1,presetKind:(n=a.presetKind)!==null&&n!==void 0?n:1,presetFileName:a.presetFileName||""};H(e,"","null",l)}else if(a.type==="curves"){var l={Vrsn:1,curvesPresetKind:(i=a.presetKind)!==null&&i!==void 0?i:1,curvesPresetFileName:a.presetFileName||""};H(e,"","null",l)}else if(a.type==="channel mixer"){var l={Vrsn:1,mixerPresetKind:(r=a.presetKind)!==null&&r!==void 0?r:1,mixerPresetFileName:a.presetFileName||""};H(e,"","null",l)}else if(a.type==="brightness/contrast"){var l={Vrsn:1,Brgh:a.brightness||0,Cntr:a.contrast||0,means:(o=a.meanValue)!==null&&o!==void 0?o:127,"Lab ":!!a.labColorOnly,useLegacy:!!a.useLegacy,Auto:!!a.auto};H(e,"","null",l)}else throw new Error("Unhandled CgEd case")});O("Txt2",K("engineData"),function(e,t,n){var i=fe(e,n());t.engineData=it.fromByteArray(i)},function(e,t){var n=it.toByteArray(t.engineData);qe(e,n)});O("FEid",K("filterEffectsMasks"),function(e,t,n){var i=M(e);if(i<1||i>3)throw new Error("Invalid filterEffects version ".concat(i));if(I(e))throw new Error("filterEffects: 64 bit length is not supported");var r=I(e),o=e.offset+r;for(t.filterEffectsMasks=[];e.offset<o;){var a=Ve(e,1),l=M(e);if(l!==1)throw new Error("Invalid filterEffect version ".concat(l));if(I(e))throw new Error("filterEffect: 64 bit length is not supported");I(e);for(var u=M(e),s=M(e),f=M(e),h=M(e),p=M(e),d=M(e),m=[],v=0;v<d+2;v++){var F=M(e);if(F){if(I(e))throw new Error("filterEffect: 64 bit length is not supported");var b=I(e),g=k(e),y=fe(e,b-2);m.push({compressionMode:g,data:y})}else m.push(void 0)}if(t.filterEffectsMasks.push({id:a,top:u,left:s,bottom:f,right:h,depth:p,channels:m}),n()&&L(e)){var g=k(e),y=fe(e,n());t.filterEffectsMasks[t.filterEffectsMasks.length-1].extra={compressionMode:g,data:y}}}},function(e,t){var n;G(e,3),P(e,0),P(e,0);for(var i=e.offset,r=0,o=t.filterEffectsMasks;r<o.length;r++){var a=o[r];nn(e,a.id,1),G(e,1),P(e,0),P(e,0);var l=e.offset;G(e,a.top),G(e,a.left),G(e,a.bottom),G(e,a.right),G(e,a.depth);var u=Math.max(0,a.channels.length-2);G(e,u);for(var s=0;s<u+2;s++){var f=a.channels[s];G(e,f?1:0),f&&(P(e,0),P(e,f.data.length+2),x(e,f.compressionMode),qe(e,f.data))}e.view.setUint32(l-4,e.offset-l,!1)}var h=(n=t.filterEffectsMasks[t.filterEffectsMasks.length-1])===null||n===void 0?void 0:n.extra;h&&(T(e,1),x(e,h.compressionMode),qe(e,h.data)),e.view.setUint32(i-4,e.offset-i,!1)});Sn("FXid","FEid");O("FMsk",K("filterMask"),function(e,t){t.filterMask={colorSpace:oe(e),opacity:k(e)/255}},function(e,t){var n;le(e,t.filterMask.colorSpace),x(e,oo((n=t.filterMask.opacity)!==null&&n!==void 0?n:1,0,1)*255)});O("artd",function(e){return e.artboards!==void 0},function(e,t,n){var i=j(e);t.artboards={count:i["Cnt "],autoExpandOffset:{horizontal:i.autoExpandOffset.Hrzn,vertical:i.autoExpandOffset.Vrtc},origin:{horizontal:i.origin.Hrzn,vertical:i.origin.Vrtc},autoExpandEnabled:i.autoExpandEnabled,autoNestEnabled:i.autoNestEnabled,autoPositionEnabled:i.autoPositionEnabled,shrinkwrapOnSaveEnabled:!!i.shrinkwrapOnSaveEnabled,docDefaultNewArtboardBackgroundColor:Te(i.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:i.docDefaultNewArtboardBackgroundType},E(e,n())},function(e,t){var n,i,r,o,a,l=t.artboards,u={"Cnt ":l.count,autoExpandOffset:l.autoExpandOffset?{Hrzn:l.autoExpandOffset.horizontal,Vrtc:l.autoExpandOffset.vertical}:{Hrzn:0,Vrtc:0},origin:l.origin?{Hrzn:l.origin.horizontal,Vrtc:l.origin.vertical}:{Hrzn:0,Vrtc:0},autoExpandEnabled:(n=l.autoExpandEnabled)!==null&&n!==void 0?n:!0,autoNestEnabled:(i=l.autoNestEnabled)!==null&&i!==void 0?i:!0,autoPositionEnabled:(r=l.autoPositionEnabled)!==null&&r!==void 0?r:!0,shrinkwrapOnSaveEnabled:(o=l.shrinkwrapOnSaveEnabled)!==null&&o!==void 0?o:!0,docDefaultNewArtboardBackgroundColor:Le(l.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:(a=l.docDefaultNewArtboardBackgroundType)!==null&&a!==void 0?a:1};H(e,"","null",u,"artd")});function Fa(e){return Object.keys(e).map(function(t){return e[t]}).some(function(t){return Array.isArray(t)&&t.length>1})}O("lfx2",function(e){return e.effects!==void 0&&!Fa(e.effects)},function(e,t,n){var i=I(e);if(i!==0)throw new Error("Invalid lfx2 version");var r=j(e);t.effects=dt(r,!!e.logMissingFeatures),E(e,n())},function(e,t,n,i){var r=ct(t.effects,!!i.logMissingFeatures,!0);P(e,0),H(e,"","null",r)});O("cinf",K("compositorUsed"),function(e,t,n){var i=j(e);function r(o){return o.split(".")[1]}t.compositorUsed={description:i.description,reason:i.reason,engine:r(i.Engn)},i.enableCompCore&&(t.compositorUsed.enableCompCore=r(i.enableCompCore)),i.enableCompCoreGPU&&(t.compositorUsed.enableCompCoreGPU=r(i.enableCompCoreGPU)),i.compCoreSupport&&(t.compositorUsed.compCoreSupport=r(i.compCoreSupport)),i.compCoreGPUSupport&&(t.compositorUsed.compCoreGPUSupport=r(i.compCoreGPUSupport)),E(e,n())},function(e,t){var n=t.compositorUsed,i={Vrsn:{major:1,minor:0,fix:0},description:n.description,reason:n.reason,Engn:"Engn.".concat(n.engine)};n.enableCompCore&&(i.enableCompCore="enable.".concat(n.enableCompCore)),n.enableCompCoreGPU&&(i.enableCompCoreGPU="enable.".concat(n.enableCompCoreGPU)),n.compCoreSupport&&(i.compCoreSupport="reason.".concat(n.compCoreSupport)),n.compCoreGPUSupport&&(i.compCoreGPUSupport="reason.".concat(n.compCoreGPUSupport)),H(e,"","null",i)});O("extn",function(e){return e._extn!==void 0},function(e,t){j(e)},function(e,t){});O("iOpa",K("fillOpacity"),function(e,t){t.fillOpacity=L(e)/255,E(e,3)},function(e,t){T(e,t.fillOpacity*255),$(e,3)});O("brst",K("channelBlendingRestrictions"),function(e,t,n){for(t.channelBlendingRestrictions=[];n()>4;)t.channelBlendingRestrictions.push(M(e))},function(e,t){for(var n=0,i=t.channelBlendingRestrictions;n<i.length;n++){var r=i[n];G(e,r)}});O("tsly",K("transparencyShapesLayer"),function(e,t){t.transparencyShapesLayer=!!L(e),E(e,3)},function(e,t){T(e,t.transparencyShapesLayer?1:0),$(e,3)});function T(e,t){var n=je(e,1);e.view.setUint8(n,t)}function Z(e,t){var n=je(e,2);e.view.setInt16(n,t,!1)}function x(e,t){var n=je(e,2);e.view.setUint16(n,t,!1)}function Bs(e,t){var n=je(e,2);e.view.setUint16(n,t,!0)}function G(e,t){var n=je(e,4);e.view.setInt32(n,t,!1)}function _r(e,t){var n=je(e,4);e.view.setInt32(n,t,!0)}function P(e,t){var n=je(e,4);e.view.setUint32(n,t,!1)}function Ee(e,t){var n=je(e,4);e.view.setFloat32(n,t,!1)}function we(e,t){var n=je(e,8);e.view.setFloat64(n,t,!1)}function ye(e,t){G(e,t*65536)}function Ae(e,t){G(e,t*(1<<24))}function qe(e,t){if(t){xa(e,e.offset+t.length);var n=new Uint8Array(e.buffer);n.set(t,e.offset),e.offset+=t.length}}function $(e,t){for(var n=0;n<t;n++)T(e,0)}function N(e,t){if(t.length!==4)throw new Error("Invalid signature: '".concat(t,"'"));for(var n=0;n<4;n++)T(e,t.charCodeAt(n))}function nn(e,t,n){var i=t.length;if(i>255)throw new Error("String too long");T(e,i);for(var r=0;r<i;r++){var o=t.charCodeAt(r);T(e,o<128?o:63)}for(;++i%n;)T(e,0)}function _s(e,t){for(var n=0;n<t.length;n++)x(e,t.charCodeAt(n))}function zs(e,t){for(var n=0;n<t.length;n++)Bs(e,t.charCodeAt(n))}function Se(e,t){P(e,t.length),_s(e,t)}function rn(e,t){P(e,t.length+1);for(var n=0;n<t.length;n++)x(e,t.charCodeAt(n));x(e,0)}function en(e,t,n,i,r){i===void 0&&(i=!1),r===void 0&&(r=!1),r&&P(e,0);var o=e.offset;P(e,0),n();for(var a=e.offset-o-4,l=a;e.offset%t!==0;)T(e,0),l++;i&&(a=l),e.view.setUint32(o,a,!1)}function Ns(e,t){var n=e.buffer.byteLength;do n*=2;while(t>n);var i=new ArrayBuffer(n),r=new Uint8Array(i),o=new Uint8Array(e.buffer);r.set(o),e.buffer=i,e.view=new DataView(e.buffer)}function xa(e,t){t>e.buffer.byteLength&&Ns(e,t)}function je(e,t){var n=e.offset;return xa(e,e.offset+=t),n}function le(e,t){t?"r"in t?(x(e,0),x(e,Math.round(t.r*257)),x(e,Math.round(t.g*257)),x(e,Math.round(t.b*257)),x(e,0)):"fr"in t?(x(e,0),x(e,Math.round(t.fr*255*257)),x(e,Math.round(t.fg*255*257)),x(e,Math.round(t.fb*255*257)),x(e,0)):"l"in t?(x(e,7),Z(e,Math.round(t.l*1e4)),Z(e,Math.round(t.a<0?t.a*12800:t.a*12700)),Z(e,Math.round(t.b<0?t.b*12800:t.b*12700)),x(e,0)):"h"in t?(x(e,1),x(e,Math.round(t.h*65535)),x(e,Math.round(t.s*65535)),x(e,Math.round(t.b*65535)),x(e,0)):"c"in t?(x(e,2),x(e,Math.round(t.c*257)),x(e,Math.round(t.m*257)),x(e,Math.round(t.y*257)),x(e,Math.round(t.k*257))):(x(e,8),x(e,Math.round(t.k*1e4/255)),$(e,6)):(x(e,0),$(e,8))}var zr;(function(e){e[e.Bitmap=0]="Bitmap",e[e.Grayscale=1]="Grayscale",e[e.Indexed=2]="Indexed",e[e.RGB=3]="RGB",e[e.CMYK=4]="CMYK",e[e.Multichannel=7]="Multichannel",e[e.Duotone=8]="Duotone",e[e.Lab=9]="Lab"})(zr||(zr={}));var Nr;(function(e){e[e.Other=0]="Other",e[e.OpenFolder=1]="OpenFolder",e[e.ClosedFolder=2]="ClosedFolder",e[e.BoundingSectionDivider=3]="BoundingSectionDivider"})(Nr||(Nr={}));var Ur;(function(e){e[e.None=0]="None",e[e.Visibility=1]="Visibility",e[e.Position=2]="Position",e[e.Appearance=4]="Appearance"})(Ur||(Ur={}));function Us(e,t){var n="buffer"in e?Sr(e.buffer,e.byteOffset,e.byteLength):Sr(e);return as(n,t)}export{zr as ColorMode,Ur as LayerCompCapturedInfo,Nr as SectionDividerType,Us as readPsd};