PageSourceSearch

https://www.kehrerverlag.com/theme/7ad1bab2c6f62bb58fc630f80cf919f…orefront.AssetLoader-CKgwQqPR.mjs.8ca63d.js

js kehrerverlag.com collected 2026-09-24 18:01:13 UTC 82,033 bytes, 10 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[55399],{2108(e,t,r){r.d(t,{F:()=>n,N:()=>s});class n extends Error{constructor(e){super(`Failed to create array buffer from fetched file! (Uri: ${e})`),this.uri=e,this.name="FileContentError"}}class s extends Error{constructor(e,t){super(`Failed to fetch file from ${e}`),this.url=e,this.cause=t,this.name="NetworkError"}}},4808(e,t,r){r.d(t,{a:()=>es,s:()=>en,u:()=>eh,z:()=>ec});/*!
2fflate - fast JavaScript compression/decompression
3<https://101arrowz.github.io/fflate>
4Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
5version 0.8.2
6*/var n=Uint8Array,s=Uint16Array,i=Int32Array,a=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),o=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),l=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u=function(e,t){for(var r=new s(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var a=new i(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)a[o]=o-r[n]<<5|n;return{b:r,r:a}},c=u(a,2),h=c.b,d=c.r;h[28]=258,d[258]=28;for(var f=u(o,0),p=f.b,m=f.r,g=new s(32768),A=0;A<32768;++A){var T=(43690&A)>>1|(21845&A)<<1;T=(61680&(T=(52428&T)>>2|(13107&T)<<2))>>4|(3855&T)<<4,g[A]=((65280&T)>>8|(255&T)<<8)>>1}for(var _=function(e,t,r){for(var n,i=e.length,a=0,o=new s(t);a<i;++a)e[a]&&++o[e[a]-1];var l=new s(t);for(a=1;a<t;++a)l[a]=l[a-1]+o[a-1]<<1;if(r){n=new s(1<<t);var u=15-t;for(a=0;a<i;++a)if(e[a])for(var c=a<<4|e[a],h=t-e[a],d=l[e[a]-1]++<<h,f=d|(1<<h)-1;d<=f;++d)n[g[d]>>u]=c}else for(n=new s(i),a=0;a<i;++a)e[a]&&(n[a]=g[l[e[a]-1]++]>>15-e[a]);return n},w=new n(288),A=0;A<144;++A)w[A]=8;for(var A=144;A<256;++A)w[A]=9;for(var A=256;A<280;++A)w[A]=7;for(var A=280;A<288;++A)w[A]=8;for(var y=new n(32),A=0;A<32;++A)y[A]=5;var v=_(w,9,0),x=_(w,9,1),R=_(y,5,0),S=_(y,5,1),E=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},b=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},L=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},M=function(e){return(e+7)/8|0},I=function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new n(e.subarray(t,r))}
6,C=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],O=function(e,t,r){var n=Error(t||C[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,O),!r)throw n;return n},N=function(e,t,r,s){var i=e.length,u=s?s.length:0;if(!i||t.f&&!t.l)return r||new n(0);var c=!r,d=c||2!=t.i,f=t.i;c&&(r=new n(3*i));var m=function(e){var t=r.length;if(e>t){var s=new n(Math.max(2*t,e));s.set(r),r=s}},g=t.f||0,A=t.p||0,T=t.b||0,w=t.l,y=t.d,v=t.m,R=t.n,C=8*i;do{if(!w){g=b(e,A,1);var N=b(e,A+1,3);if(A+=3,N){if(1==N)w=x,y=S,v=9,R=5;else if(2==N){var P=b(e,A,31)+257,k=b(e,A+10,15)+4,D=P+b(e,A+5,31)+1;A+=14;for(var H=new n(D),U=new n(19),F=0;F<k;++F)U[l[F]]=b(e,A+3*F,7);A+=3*k;for(var B=E(U),G=(1<<B)-1,j=_(U,B,1),F=0;F<D;){var K=j[b(e,A,G)];A+=15&K;var W=K>>4;if(W<16)H[F++]=W;else{var V=0,X=0;for(16==W?(X=3+b(e,A,3),A+=2,V=H[F-1]):17==W?(X=3+b(e,A,7),A+=3):18==W&&(X=11+b(e,A,127),A+=7);X--;)H[F++]=V}}var z=H.subarray(0,P),q=H.subarray(P);v=E(z),R=E(q),w=_(z,v,1),y=_(q,R,1)}else O(1)}else{var W=M(A)+4,Y=e[W-4]|e[W-3]<<8,J=W+Y;if(J>i){f&&O(0);break}d&&m(T+Y),r.set(e.subarray(W,J),T),t.b=T+=Y,t.p=A=8*J,t.f=g;continue}if(A>C){f&&O(0);break}}d&&m(T+131072);for(var $=(1<<v)-1,Z=(1<<R)-1,Q=A;;Q=A){var V=w[L(e,A)&$],ee=V>>4;if((A+=15&V)>C){f&&O(0);break}if(V||O(2),ee<256)r[T++]=ee;else if(256==ee){Q=A,w=null;break}else{var et=ee-254;if(ee>264){var F=ee-257,er=a[F];et=b(e,A,(1<<er)-1)+h[F],A+=er}var en=y[L(e,A)&Z],es=en>>4;en||O(3),A+=15&en;var q=p[es];if(es>3){var er=o[es];q+=L(e,A)&(1<<er)-1,A+=er}if(A>C){f&&O(0);break}d&&m(T+131072);var ei=T+et;if(T<q){var ea=u-q,eo=Math.min(q,ei);for(ea+T<0&&O(3);T<eo;++T)r[T]=s[ea+T]}for(;T<ei;++T)r[T]=r[T-q]}}t.l=w,t.p=Q,t.b=T,t.f=g,w&&(g=1,t.m=v,t.d=y,t.n=R)}while(!g)return T!=r.length&&c?I(r,0,T):r.subarray(0,T)},P=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},k=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},D=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var a=r.length,o=r.slice();if(!a)return{t:K,l:0};if(1==a){var l=new n(r[0].s+1);return l[r[0].s]=1,{t:l,l:1}}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var u=r[0],c=r[1],h=0,d=1,f=2;for(r[0]={s:-1,f:u.f+c.f,l:u,r:c};d!=a-1;)u=r[r[h].f<r[f].f?h++:f++],c=r[h!=d&&r[h].f<r[f].f?h++:f++],r[d++]={s:-1,f:u.f+c.f,l:u,r:c};for(var p=o[0].s,i=1;i<a;++i)o[i].s>p&&(p=o[i].s);var m=new s(p+1),g=H(r[d-1],m,0);if(g>t){var i=0,A=0,T=g-t,_=1<<T;for(o.sort(function(e,t){return m[t.s]-m[e.s]||e.f-t.f});i<a;++i){var w=o[i].s;if(m[w]>t)A+=_-(1<<g-m[w]),m[w]=t;else break}for(A>>=T;A>0;){var y=o[i].s;m[y]<t?A-=1<<t-m[y]++-1:++i}for(;i>=0&&A;--i){var v=o[i].s;m[v]==t&&(--m[v],++A)}g=t}return{t:new n(m),l:g}},H=function(e,t,r){return -1==e.s?Math.max(H(e.l,t,r+1),H(e.r,t,r+1)):t[e.s]=r},U=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new s(++t),n=0,i=e[0],a=1,o=function(e){r[n++]=e},l=1;l<=t;++l)if(e[l]==i&&l!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[l]}return{c:r.subarray(0,n),n:t}},F=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},B=function(e,t,r){var n=r.length,s=M(t+2);e[s]=255&n,e[s+1]=n>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var i=0;i<n;++i)e[s+i+4]=r[i];return(s+4+n)*8},G=function(e,t,r,n,i,u,c,h,d,f,p){P(t,p++,r),++i[256];for(var m,g,A,T,x=D(i,15),S=x.t,E=x.l,b=D(u,15),L=b.t,M=b.l,I=U(S),C=I.c,O=I.n,N=U(L),H=N.c,G=N.n,j=new s(19),K=0;K<C.length;++K)++j[31&C[K]];for(var K=0;K<H.length;++K)++j[31&H[K]];for(var W=D(j,7),V=W.t,X=W.l,z=19;z>4&&!V[l[z-1]];--z);var q=f+5<<3,Y=F(i,w)+F(u,y)+c,J=F(i,S)+F(u,L)+c+14+3*z+F(j,V)+2*j[16]+3*j[17]+7*j[18];if(d>=0&&q<=Y&&q<=J)return B(t,p,e.subarray(d,d+f));if(P(t,p,1+(J<Y)),p+=2,J<Y){m=_(S,E,0),g=S,A=_(L,M,0),T=L;var $=_(V,X,0);P(t,p,O-257),P(t,p+5,G-1),P(t,p+10,z-4),p+=14;for(var K=0;K<z;
6++K)P(t,p+3*K,V[l[K]]);p+=3*z;for(var Z=[C,H],Q=0;Q<2;++Q)for(var ee=Z[Q],K=0;K<ee.length;++K){var et=31&ee[K];P(t,p,$[et]),p+=V[et],et>15&&(P(t,p,ee[K]>>5&127),p+=ee[K]>>12)}}else m=v,g=w,A=R,T=y;for(var K=0;K<h;++K){var er=n[K];if(er>255){var et=er>>18&31;k(t,p,m[et+257]),p+=g[et+257],et>7&&(P(t,p,er>>23&31),p+=a[et]);var en=31&er;k(t,p,A[en]),p+=T[en],en>3&&(k(t,p,er>>5&8191),p+=o[en])}else k(t,p,m[er]),p+=g[er]}return k(t,p,m[256]),p+g[256]},j=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),K=new n(0),W=function(e,t,r,l,u,c){var h=c.z||e.length,f=new n(l+h+5*(1+Math.ceil(h/7e3))+u),p=f.subarray(l,f.length-u),g=c.l,A=7&(c.r||0);if(t){A&&(p[0]=c.r>>3);for(var T=j[t-1],_=T>>13,w=8191&T,y=(1<<r)-1,v=c.p||new s(32768),x=c.h||new s(y+1),R=Math.ceil(r/3),S=2*R,E=function(t){return(e[t]^e[t+1]<<R^e[t+2]<<S)&y},b=new i(25e3),L=new s(288),C=new s(32),O=0,N=0,P=c.i||0,k=0,D=c.w||0,H=0;P+2<h;++P){var U=E(P),F=32767&P,K=x[U];if(v[F]=K,x[U]=F,D<=P){var W=h-P;if((O>7e3||k>24576)&&(W>423||!g)){A=G(e,p,0,b,L,C,N,k,H,P-H,A),k=O=N=0,H=P;for(var V=0;V<286;++V)L[V]=0;for(var V=0;V<30;++V)C[V]=0}var X=2,z=0,q=w,Y=F-K&32767;if(W>2&&U==E(P-Y))for(var J=Math.min(_,W)-1,$=Math.min(32767,P),Z=Math.min(258,W);Y<=$&&--q&&F!=K;){if(e[P+X]==e[P+X-Y]){for(var Q=0;Q<Z&&e[P+Q]==e[P+Q-Y];++Q);if(Q>X){if(X=Q,z=Y,Q>J)break;for(var ee=Math.min(Y,Q-2),et=0,V=0;V<ee;++V){var er=P-Y+V&32767,en=v[er],es=er-en&32767;es>et&&(et=es,K=er)}}}K=v[F=K],Y+=F-K&32767}if(z){b[k++]=0x10000000|d[X]<<18|m[z];var ei=31&d[X],ea=31&m[z];N+=a[ei]+o[ea],++L[257+ei],++C[ea],D=P+X,++O}else b[k++]=e[P],++L[e[P]]}}for(P=Math.max(P,D);P<h;++P)b[k++]=e[P],++L[e[P]];A=G(e,p,g,b,L,C,N,k,H,P-H,A),g||(c.r=7&A|p[A/8|0]<<3,A-=7,c.h=x,c.p=v,c.i=P,c.w=D)}else{for(var P=c.w||0;P<h+g;P+=65535){var eo=P+65535;eo>=h&&(p[A/8|0]=g,eo=h),A=B(p,A+1,e.subarray(P,eo))}c.i=h}return I(f,0,l+M(A)+u)},V=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&-0x12477ce0)^r>>>1;e[t]=r}return e}(),X=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=V[255&r^t[n]]^r>>>8;e=r},d:function(){return~e}}},z=function(e,t,r,s,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new n(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return W(e,null==t.level?6:t.level,null==t.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,r,s,i)},q=function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},Y=function(e,t){return e[t]|e[t+1]<<8},J=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},$=function(e,t){return J(e,t)+0x100000000*J(e,t+4)},Z=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Q=function(e,t,r,s){for(var i in e){var a=e[i],o=t+i,l=s;Array.isArray(a)&&(l=q(s,a[1]),a=a[0]),a instanceof n?r[o]=[a,l]:(r[o+="/"]=[new n(0),l],Q(a,o,r,s))}},ee="u">typeof TextEncoder&&new TextEncoder,et="u">typeof TextDecoder&&new TextDecoder;try{et.decode(K,{stream:!0})}catch{}var er=function(e){for(var t="",r=0;;){var n=e[r++],s=(n>127)+(n>223)+(n>239);if(r+s>e.length)return{s:t,r:I(e,r-1)};s?3==s?t+=String.fromCharCode(55296|(n=((15&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536)>>10,56320|1023&n):1&s?t+=String.fromCharCode((31&n)<<6|63&e[r++]):t+=String.fromCharCode((15&n)<<12|(63&e[r++])<<6|63&e[r++]):t+=String.fromCharCode(n)}};function en(e,t){var r;if(ee)return ee.encode(e);for(var s=e.length,i=new n(e.length+(e.length>>1)),a=0,o=function(e){i[a++]=e},r=0;r<s;++r){if(a+5>i.length){var l=new n(a+8+(s-r<<1));l.set(i),i=l}var u=e.charCodeAt(r);u<128||t?o(u):(u<2048?o(192|u>>6):(u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++r))>>18),o(128|u>>12&63)):o(224|u>>12),o(128|u>>6&63)),o(128|63&u))}return I(i,0,a)}function es(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}if(et)return et.decode(e);var s=er(e),i=s.s,r=s.r;return r.length&&O(8),i}var ei=function(e,t,r){var n=Y(e,t+28),s=es(e.subarray(t+46,t+46+n),!(2048&Y(e,t+8))),i=t+46+n,a=J(e,t+20),o=r&&0xffffffff==a?ea(e,i):[a,J(e,t+24),J(e,t+42)],l=o[0],u=o[1],c=o[2];return[Y(e,t+10),l,u,s,i+Y(e,t+30)+Y(e,t+32),c]},ea=function(e,t){for(;1!=Y(e,t);t+=4+Y(e,t+2));return[$(e,t+12),$(e,t+4),$(e,t+20)]},eo=function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&O(9),t+=n+4}return t},el=function(e,t,r,n,s,i,a,o){var l=n.length,u=r.extra,c=o&&o.length,h=eo(u);Z(e,t,null!=a?0x2014b50:0x4034b50),t+=4,null!=a&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(i<0&&8),e[t++]=s&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var d=new Date(null==r.mtime?Date.now():r.mtime),f=d.getFullYear()-1980;if((f<0||f>119)&&O(10),Z(e,t,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),t+=4,-1!=i&&(Z(e,t,r.crc),Z(e,t+4,i<0?-i-2:i),Z(e,t+8,r.size)),Z(e,t+12,l),Z(e,t+14,h),t+=16,null!=a&&(Z(e,t,c),Z(e,t+6,r.attrs),Z(e,t+10,a),t+=14),e.set(n,t),t+=l,h)for(var p in u){var m=u[p],g=m.length;Z(e,t,+p),Z(e,t+2,g),e.set(m,t+4),t+=4+g}return c&&(e.set(o,t),t+=c),t},eu=function(e,t,r,n,s){Z(e,t,0x6054b50),Z(e,t+8,r),Z(e,t+10,r),Z(e,t+12,n),Z(e,t+16,s)};function ec(e,t){t||(t={});var r={},s=[];Q(e,"",r,t);var i=0,a=0;for(var o in r){var l=r[o],u=l[0],c=l[1],h=8*(0!=c.level),d=en(o),f=d.length,p=c.comment,m=p&&en(p),g=m&&m.length,A=eo(c.extra);f>65535&&O(11);var T=h?z(u,c||{},0,0):u,_=T.length,w=X();w.p(u),s.push(q(c,{size:u.length,crc:w.d(),c:T,f:d,m:m,u:f!=o.length||m&&p.length!=g,o:i,compression:h})),i+=30+f+A+_,a+=76+2*(f+A)+(g||0)+_}for(var y=new n(a+22),v=i,x=a-i,R=0;R<s.length;++R){var d=s[R];el(y,d.o,d,d.f,d.u,d.c.length);var S=30+d.f.length+eo(d.extra);y.set(d.c,d.o+S),el(y,i,d,d.f,d.u,d.c.length,d.o,d.m),i+=16+S+(d.m?d.m.length:0)}return eu(y,i,s.length,x,v),y}function eh(e,t){for(var r={},s=e.length-22;0x6054b50!=J(e,s);--s)(!s||e.length-s>65558)&&O(13);var i=Y(e,s+8);if(!i)return{};var a=J(e,s+16),o=0xffffffff==a||65535==i;if(o){var l=J(e,s-12);(o=0x6064b50==J(e,l))&&(i=J(e,l+32),a=J(e,l+48))}for(var u=0;u<i;++u){var c,h=ei(e,a,o),d=h[0],f=h[1],p=h[2],m=h[3],g=h[4],A=h[5],T=A+30+Y(e,A+26)+Y(e,A+28);a=g,d?8==d?r[m]=N(e.subarray(T,T+f),{i:2},(c={out:new n(p)}).out,c&&c.dictionary):O(14,"unknown compression type "+d):r[m]=I(e,T,T+f)}return r}},5197(e,t,r){r.d(t,{g:()=>s,i:()=>i});var n=r(6179);function s(e){var t;let r=e.split("/").pop()||"";return!r.includes(".")||r.endsWith(".")?"":(null==(t=r.split(".").pop())?void 0:t.toLowerCase().split("?")[0])||""}function i(e){return e.toLowerCase()in n.F}},5349(e,t,r){r.d(t,{F:()=>n,P:()=>s});
6class n extends Error{constructor(e,t){super(e),this.requestedFileType=t,this.name="FileTypeError"}}class s extends Error{constructor(e,t){super(`Failed to parse array buffer from ${e}`),this.uri=e,this.cause=t,this.name="ParseError"}}},5399(e,t,r){r.d(t,{A:()=>ev,D:()=>eg,a:()=>eT});var n=r(9451),s=r(4808),i=r(6179);r(122);var a=r(5197),o=r(5349),l=r(2108),u=Object.defineProperty,c=(e,t,r)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t,r)=>c(e,"symbol"!=typeof t?t+"":t,r);class d{constructor(e){h(this,"_promise"),h(this,"_resolve"),h(this,"_arrayBuffer",null),h(this,"_size",0),h(this,"_createdAt"),h(this,"_updatedAt"),this._uri=e,this._promise=new Promise(e=>{this._resolve=e}),this._createdAt=new Date,this._updatedAt=new Date}get promise(){return this._promise}get size(){return this._size}get createdAt(){return this._createdAt}get updatedAt(){return this._updatedAt}get arrayBuffer(){return this._arrayBuffer}async load(){let e=await fetch(this._uri);if(!e.ok)throw new l.N(this._uri);try{this._arrayBuffer=await e.arrayBuffer(),this._size+=this._arrayBuffer.byteLength,this._updatedAt=new Date}catch{throw new l.F(this._uri)}return this._resolve(this._arrayBuffer),this._arrayBuffer}}let f=Symbol.for("@shopware-ag/dive/assetcache"),p=globalThis;p[f]||(p[f]=new class{constructor(){h(this,"_cache",new Map)}get(){return this._cache}create(e){let t=new d(e);return this._cache.set(e,t),t}write(e,t){this._cache.set(e,t)}read(e){return this._cache.get(e)??null}delete(...e){e.forEach(e=>{this._cache.delete(e)})}clear(){this._cache.clear()}});let m=p[f];var g=Object.defineProperty,A=(e,t,r)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t,r)=>A(e,"symbol"!=typeof t?t+"":t,r);function _(e,t){if(t===n.RJ4)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==n.rYR&&t!==n.O49)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<n.count;e++)t.push(e);e.setIndex(t),r=e.getIndex()}let s=r.count-2,i=[];if(t===n.rYR)for(let e=1;e<=s;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<s;e++)e%2==0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let a=e.clone();return a.setIndex(i),a.clearGroups(),a}}class w extends n.aHM{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new E(e)}),this.register(function(e){return new k(e)}),this.register(function(e){return new D(e)}),this.register(function(e){return new H(e)}),this.register(function(e){return new L(e)}),this.register(function(e){return new M(e)}),this.register(function(e){return new I(e)}),this.register(function(e){return new C(e)}),this.register(function(e){return new S(e)}),this.register(function(e){return new O(e)}),this.register(function(e){return new b(e)}),this.register(function(e){return new P(e)}),this.register(function(e){return new N(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new U(e)}),this.register(function(e){return new F(e)})}load(e,t,r,s){let i;let a=this;if(""!==this.resourcePath)i=this.resourcePath;else if(""!==this.path){let t=n.r6x.extractUrlBase(e);i=n.r6x.resolveURL(t,this.path)}else i=n.r6x.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){s?s(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},l=new n.Y9S(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(r){try{a.parse(r,i,function(r){t(r),a.manager.itemEnd(e)},o)}catch(e){o(e)}},r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,n){let s;let i={},a={},o=new TextDecoder;if("string"==typeof e)s=JSON.parse(e);else if(e instanceof ArrayBuffer){if(o.decode(new Uint8Array(e,0,4))===B){try{i[v.KHR_BINARY_GLTF]=new j(e)}catch(e){n&&n(e);return}s=JSON.parse(i[v.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(e))}else s=e;if(void 0===s.asset||s.asset.version[0]<2){n&&n(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let l=new eu(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](l);t.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[t.name]=t,i[t.name]=!0}if(s.extensionsUsed)for(let e=0;e<s.extensionsUsed.length;++e){let t=s.extensionsUsed[e],r=s.extensionsRequired||[];switch(t){case v.KHR_MATERIALS_UNLIT:i[t]=new R;break;case v.KHR_DRACO_MESH_COMPRESSION:i[t]=new K(s,this.dracoLoader);break;case v.KHR_TEXTURE_TRANSFORM:i[t]=new W;break;case v.KHR_MESH_QUANTIZATION:i[t]=new V;break;default:r.indexOf(t)>=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(i),l.setPlugins(a),l.parse(r,n)}parseAsync(e,t){let r=this;return new Promise(function(n,s){r.parse(e,t,n,s)})}}function y(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let v={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class x{constructor(e){this.parser=e,this.name=v.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r<n;r++){let n=t[r];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){let t;let r=this.parser,s="light:"+e,i=r.cache.get(s);if(i)return i;let a=r.json,o=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e],l=new n.Q1f(0xffffff);
6void 0!==o.color&&l.setRGB(o.color[0],o.color[1],o.color[2],n.Zr2);let u=void 0!==o.range?o.range:0;switch(o.type){case"directional":(t=new n.ZyN(l)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new n.HiM(l)).distance=u;break;case"spot":(t=new n.nCl(l)).distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,t.angle=o.spot.outerConeAngle,t.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return t.position.set(0,0,0),t.decay=2,ei(t,o),void 0!==o.intensity&&(t.intensity=o.intensity),t.name=r.createUniqueName(o.name||"light_"+e),i=Promise.resolve(t),r.cache.add(s,i),i}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,r=this.parser,n=r.json.nodes[e],s=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===s?null:this._loadLight(s).then(function(e){return r._getNodeRef(t.cache,s,e)})}}class R{constructor(){this.name=v.KHR_MATERIALS_UNLIT}getMaterialType(){return n.V9B}extendParams(e,t,r){let s=[];e.color=new n.Q1f(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],n.Zr2),e.opacity=t[3]}void 0!==i.baseColorTexture&&s.push(r.assignTexture(e,"map",i.baseColorTexture,n.er$))}return Promise.all(s)}}class S{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=r.extensions[this.name].emissiveStrength;return void 0!==n&&(t.emissiveIntensity=n),Promise.resolve()}}class E{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let i=[],a=s.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&i.push(r.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&i.push(r.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(i.push(r.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){let e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new n.I9Y(e,e)}return Promise.all(i)}}class b{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return void 0!==i.iridescenceFactor&&(t.iridescence=i.iridescenceFactor),void 0!==i.iridescenceTexture&&s.push(r.assignTexture(t,"iridescenceMap",i.iridescenceTexture)),void 0!==i.iridescenceIor&&(t.iridescenceIOR=i.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==i.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),void 0!==i.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),void 0!==i.iridescenceThicknessTexture&&s.push(r.assignTexture(t,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(s)}}class L{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let i=[];t.sheenColor=new n.Q1f(0,0,0),t.sheenRoughness=0,t.sheen=1;let a=s.extensions[this.name];if(void 0!==a.sheenColorFactor){let e=a.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],n.Zr2)}return void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&i.push(r.assignTexture(t,"sheenColorMap",a.sheenColorTexture,n.er$)),void 0!==a.sheenRoughnessTexture&&i.push(r.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(i)}}class M{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return void 0!==i.transmissionFactor&&(t.transmission=i.transmissionFactor),void 0!==i.transmissionTexture&&s.push(r.assignTexture(t,"transmissionMap",i.transmissionTexture)),Promise.all(s)}}class I{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let i=[],a=s.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&i.push(r.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;let o=a.attenuationColor||[1,1,1];return t.attenuationColor=new n.Q1f().setRGB(o[0],o[1],o[2],n.Zr2),Promise.all(i)}}class C{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=r.extensions[this.name];return t.ior=void 0!==n.ior?n.ior:1.5,Promise.resolve()}}class O{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let i=[],a=s.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&i.push(r.assignTexture(t,"specularIntensityMap",a.specularTexture));let o=a.specularColorFactor||[1,1,1];return t.specularColor=new n.Q1f().setRGB(o[0],o[1],o[2],n.Zr2),void 0!==a.specularColorTexture&&i.push(r.assignTexture(t,"specularColorMap",a.specularColorTexture,n.er$)),Promise.all(i)}}class N{constructor(e){this.parser=e,this.name=v.EXT_MATERIALS_BUMP}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return t.bumpScale=void 0!==i.bumpFactor?i.bumpFactor:1,void 0!==i.bumpTexture&&s.push(r.assignTexture(t,"bumpMap",i.bumpTexture)),Promise.all(s)}}class P{constructor(e){this.parser=e,this.name=v.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return void 0!==i.anisotropyStrength&&(t.anisotropy=i.anisotropyStrength),void 0!==i.anisotropyRotation&&(t.anisotropyRotation=i.anisotropyRotation),void 0!==i.anisotropyTexture&&s.push(r.assignTexture(t,"anisotropyMap",i.anisotropyTexture)),Promise.all(s)}}class k{constructor(e){this.parser=e,this.name=v.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,r=t.json,n=r.textures[e];if(!n.extensions||!n.extensions[this.name])return null;let s=n.extensions[this.name],i=t.options.ktx2Loader;if(!i){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,i)}}class D{constructor(e){this.parser=e,this.name=v.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,n=r.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;let i=s.extensions[t],a=n.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(s){if(s)return r.loadTextureImage(e,i.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class H{constructor(e){this.parser=e,this.name=v.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,n=r.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;let i=s.extensions[t],a=n.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(s){if(s)return r.loadTextureImage(e,i.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdj
6FDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class U{constructor(e){this.name=v.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then(function(t){let r=e.byteOffset||0,n=e.byteLength||0,i=e.count,a=e.byteStride,o=new Uint8Array(t,r,n);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(i,a,o,e.mode,e.filter).then(function(e){return e.buffer}):s.ready.then(function(){let t=new ArrayBuffer(i*a);return s.decodeGltfBuffer(new Uint8Array(t),i,a,o,e.mode,e.filter),t})})}}}class F{constructor(e){this.name=v.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==Y.TRIANGLES&&e.mode!==Y.TRIANGLE_STRIP&&e.mode!==Y.TRIANGLE_FAN&&void 0!==e.mode)return null;let s=r.extensions[this.name].attributes,i=[],a={};for(let e in s)i.push(this.parser.getDependency("accessor",s[e]).then(t=>(a[e]=t,a[e])));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],s=e[0].count,i=[];for(let e of r){let t=new n.kn4,r=new n.Pq0,o=new n.PTz,l=new n.Pq0(1,1,1),u=new n.ZLX(e.geometry,e.material,s);for(let e=0;e<s;e++)a.TRANSLATION&&r.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&o.fromBufferAttribute(a.ROTATION,e),a.SCALE&&l.fromBufferAttribute(a.SCALE,e),u.setMatrixAt(e,t.compose(r,o,l));for(let t in a)if("_COLOR_0"===t){let e=a[t];u.instanceColor=new n.uWO(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);n.B69.prototype.copy.call(u,e),this.parser.assignFinalMaterial(u),i.push(u)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}}let B="glTF",G={JSON:0x4e4f534a,BIN:5130562};class j{constructor(e){this.name=v.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,12),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==B)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-12,s=new DataView(e,12),i=0;for(;i<n;){let t=s.getUint32(i,!0);i+=4;let n=s.getUint32(i,!0);if(i+=4,n===G.JSON){let n=new Uint8Array(e,12+i,t);this.content=r.decode(n)}else if(n===G.BIN){let r=12+i;this.body=e.slice(r,r+t)}i+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class K{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=v.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let r=this.json,s=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},l={},u={};for(let e in a)o[ee[e]||e.toLowerCase()]=a[e];for(let t in e.attributes){let n=ee[t]||t.toLowerCase();if(void 0!==a[t]){let s=r.accessors[e.attributes[t]],i=J[s.componentType];u[n]=i.name,l[n]=!0===s.normalized}}return t.getDependency("bufferView",i).then(function(e){return new Promise(function(t,r){s.decodeDracoFile(e,function(e){for(let t in e.attributes){let r=e.attributes[t],n=l[t];void 0!==n&&(r.normalized=n)}t(e)},o,u,n.Zr2,r)})})}}class W{constructor(){this.name=v.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(void 0===t.texCoord||t.texCoord===e.channel)&&void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class V{constructor(){this.name=v.KHR_MESH_QUANTIZATION}}class X extends n.lGw{constructor(e,t,r,n){super(e,t,r,n)}copySampleValue_(e){let t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=e*n*3+n;for(let e=0;e!==n;e++)t[e]=r[s+e];return t}interpolate_(e,t,r,n){let s=this.resultBuffer,i=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,u=n-t,c=(r-t)/u,h=c*c,d=h*c,f=e*l,p=f-l,m=-2*d+3*h,g=d-h,A=1-m,T=g-h+c;for(let e=0;e!==a;e++){let t=i[p+e+a],r=i[p+e+o]*u,n=i[f+e+a],l=i[f+e]*u;s[e]=A*t+T*r+m*n+g*l}return s}}let z=new n.PTz;class q extends X{interpolate_(e,t,r,n){let s=super.interpolate_(e,t,r,n);return z.fromArray(s).normalize().toArray(s),s}}let Y={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},J={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},$={9728:n.hxR,9729:n.k6q,9984:n.pHI,9985:n.kRr,9986:n.Cfg,9987:n.$_I},Z={33071:n.ghU,33648:n.kTW,10497:n.GJx},Q={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ee={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},et={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},er={CUBICSPLINE:void 0,LINEAR:n.PJ3,STEP:n.ljd},en={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function es(e,t,r){for(let n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function ei(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function ea(e){let t="",r=Object.keys(e).sort();for(let n=0,s=r.length;n<s;n++)t+=r[n]+":"+e[r[n]]+";";return t}function eo(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}let el=new n.kn4;class eu{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new y,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,s=!1,i=-1;"u">typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=(s=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||s&&i<98?this.textureLoader=new n.Tap(this.options.manager):this.textureLoader=new n.Kzg(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.Y9S(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let r=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()}
6)).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let i={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return es(s,i,n),ei(i,n),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(i)})).then(function(){for(let e of i.scenes)e.updateMatrixWorld();e(i)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r<n;r++){let n=t[r].joints;for(let t=0,r=n.length;t<r;t++)e[n[t]].isBone=!0}for(let t=0,n=e.length;t<n;t++){let n=e[t];void 0!==n.mesh&&(this._addNodeRef(this.meshCache,n.mesh),void 0!==n.skin&&(r[n.mesh].isSkinnedMesh=!0)),void 0!==n.camera&&this._addNodeRef(this.cameraCache,n.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;let n=r.clone(),s=(e,t)=>{let r=this.associations.get(e);for(let[n,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))s(i,t.children[n])};return s(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){let n=e(t[r]);if(n)return n}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let r=[];for(let n=0;n<t.length;n++){let s=e(t[n]);s&&r.push(s)}return r}getDependency(e,t){let r=e+":"+t,n=this.cache.get(r);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case"mesh":n=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(!(n=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)})))throw Error("Unknown type: "+e)}this.cache.add(r,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){let r=this;t=Promise.all((this.json[e+("mesh"===e?"es":"s")]||[]).map(function(t,n){return r.getDependency(e,n)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[v.KHR_BINARY_GLTF].body);let s=this.options;return new Promise(function(e,i){r.load(n.r6x.resolveURL(t.uri,s.path),e,void 0,function(){i(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){let r=t.byteLength||0,n=t.byteOffset||0;return e.slice(n,n+r)})}loadAccessor(e){let t=this,r=this.json,s=this.json.accessors[e];if(void 0===s.bufferView&&void 0===s.sparse){let e=Q[s.type],t=J[s.componentType],r=!0===s.normalized,i=new t(s.count*e);return Promise.resolve(new n.THS(i,e,r))}let i=[];return void 0!==s.bufferView?i.push(this.getDependency("bufferView",s.bufferView)):i.push(null),void 0!==s.sparse&&(i.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(i).then(function(e){let i,a;let o=e[0],l=Q[s.type],u=J[s.componentType],c=u.BYTES_PER_ELEMENT,h=c*l,d=s.byteOffset||0,f=void 0!==s.bufferView?r.bufferViews[s.bufferView].byteStride:void 0,p=!0===s.normalized;if(f&&f!==h){let e=Math.floor(d/f),r="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+e+":"+s.count,h=t.cache.get(r);h||(i=new u(o,e*f,s.count*f/c),h=new n.eB$(i,f/c),t.cache.add(r,h)),a=new n.eHs(h,l,d%f/c,p)}else i=null===o?new u(s.count*l):new u(o,d,s.count*l),a=new n.THS(i,l,p);if(void 0!==s.sparse){let t=Q.SCALAR,r=J[s.sparse.indices.componentType],i=s.sparse.indices.byteOffset||0,c=s.sparse.values.byteOffset||0,h=new r(e[1],i,s.sparse.count*t),d=new u(e[2],c,s.sparse.count*l);null!==o&&(a=new n.THS(a.array.slice(),a.itemSize,a.normalized));for(let e=0,t=h.length;e<t;e++){let t=h[e];if(a.setX(t,d[e*l]),l>=2&&a.setY(t,d[e*l+1]),l>=3&&a.setZ(t,d[e*l+2]),l>=4&&a.setW(t,d[e*l+3]),l>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,r=this.options,n=t.textures[e].source,s=t.images[n],i=this.textureLoader;if(s.uri){let e=r.manager.getHandler(s.uri);null!==e&&(i=e)}return this.loadTextureImage(e,n,i)}loadTextureImage(e,t,r){let s=this,i=this.json,a=i.textures[e],o=i.images[t],l=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let u=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(i.samplers||{})[a.sampler]||{};return t.magFilter=$[r.magFilter]||n.k6q,t.minFilter=$[r.minFilter]||n.$_I,t.wrapS=Z[r.wrapS]||n.GJx,t.wrapT=Z[r.wrapT]||n.GJx,s.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){let r=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let i=r.images[e],a=self.URL||self.webkitURL,o=i.uri||"",l=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then(function(e){l=!0;let t=new Blob([e],{type:i.mimeType});return o=a.createObjectURL(t)});else if(void 0===i.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let u=Promise.resolve(o).then(function(e){return new Promise(function(r,i){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new n.gPd(e);t.needsUpdate=!0,r(t)}),t.load(n.r6x.resolveURL(e,s.path),a,void 0,i)})}).then(function(e){var t;return!0===l&&a.revokeObjectURL(o),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>
60||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=u,u}assignTexture(e,t,r,n){let s=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),s.extensions[v.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[v.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=s.associations.get(i);i=s.extensions[v.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),s.associations.set(i,t)}}return void 0!==n&&(i.colorSpace=n),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,s=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new n.BH$,n.imn.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new n.mrM,n.imn.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(s||i||a){let e="ClonedMaterial:"+r.uuid+":";s&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),s&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return n._4j}loadMaterial(e){let t;let r=this,s=this.json,i=this.extensions,a=s.materials[e],o={},l=a.extensions||{},u=[];if(l[v.KHR_MATERIALS_UNLIT]){let e=i[v.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),u.push(e.extendParams(o,a,r))}else{let s=a.pbrMetallicRoughness||{};if(o.color=new n.Q1f(1,1,1),o.opacity=1,Array.isArray(s.baseColorFactor)){let e=s.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],n.Zr2),o.opacity=e[3]}void 0!==s.baseColorTexture&&u.push(r.assignTexture(o,"map",s.baseColorTexture,n.er$)),o.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,o.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(u.push(r.assignTexture(o,"metalnessMap",s.metallicRoughnessTexture)),u.push(r.assignTexture(o,"roughnessMap",s.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===a.doubleSided&&(o.side=n.$EB);let c=a.alphaMode||en.OPAQUE;if(c===en.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===en.MASK&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==n.V9B&&(u.pu
6sh(r.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new n.I9Y(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==n.V9B&&(u.push(r.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==n.V9B){let e=a.emissiveFactor;o.emissive=new n.Q1f().setRGB(e[0],e[1],e[2],n.Zr2)}return void 0!==a.emissiveTexture&&t!==n.V9B&&u.push(r.assignTexture(o,"emissiveMap",a.emissiveTexture,n.er$)),Promise.all(u).then(function(){let n=new t(o);return a.name&&(n.name=a.name),ei(n,a),r.associations.set(n,{materials:e}),a.extensions&&es(i,n,a),n})}createUniqueName(e){let t=n.Nwf.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,s=this.primitiveCache,i=[];for(let a=0,o=e.length;a<o;a++){let o=e[a],l=function(e){let t;let r=e.extensions&&e.extensions[v.KHR_DRACO_MESH_COMPRESSION];if(t=r?"draco:"+r.bufferView+":"+r.indices+":"+ea(r.attributes):e.indices+":"+ea(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,n=e.targets.length;r<n;r++)t+=":"+ea(e.targets[r]);return t}(o),u=s[l];if(u)i.push(u.promise);else{let e;e=o.extensions&&o.extensions[v.KHR_DRACO_MESH_COMPRESSION]?function(e){return r[v.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(r){return ec(r,e,t)})}(o):ec(new n.LoY,o,t),s[l]={primitive:o,promise:e},i.push(e)}}return Promise.all(i)}loadMesh(e){let t=this,r=this.json,s=this.extensions,i=r.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){var l;let t=void 0===a[e].material?(void 0===(l=this.cache).DefaultMaterial&&(l.DefaultMaterial=new n._4j({color:0xffffff,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.hB5})),l.DefaultMaterial):this.getDependency("material",a[e].material);o.push(t)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(r){let o=r.slice(0,r.length-1),l=r[r.length-1],u=[];for(let r=0,c=l.length;r<c;r++){let c;let h=l[r],d=a[r],f=o[r];if(d.mode===Y.TRIANGLES||d.mode===Y.TRIANGLE_STRIP||d.mode===Y.TRIANGLE_FAN||void 0===d.mode)!0===(c=!0===i.isSkinnedMesh?new n.I46(h,f):new n.eaF(h,f)).isSkinnedMesh&&c.normalizeSkinWeights(),d.mode===Y.TRIANGLE_STRIP?c.geometry=_(c.geometry,n.O49):d.mode===Y.TRIANGLE_FAN&&(c.geometry=_(c.geometry,n.rYR));else if(d.mode===Y.LINES)c=new n.DXC(h,f);else if(d.mode===Y.LINE_STRIP)c=new n.N1A(h,f);else if(d.mode===Y.LINE_LOOP)c=new n.FCc(h,f);else if(d.mode===Y.POINTS)c=new n.ONl(h,f);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+d.mode);Object.keys(c.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,n=t.weights.length;r<n;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){let r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(let t=0,n=r.length;t<n;t++)e.morphTargetDictionary[r[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(c,i),c.name=t.createUniqueName(i.name||"mesh_"+e),ei(c,i),d.extensions&&es(s,c,d),t.assignFinalMaterial(c),u.push(c)}for(let r=0,n=u.length;r<n;r++)t.associations.set(u[r],{meshes:e,primitives:r});if(1===u.length)return i.extensions&&es(s,u[0],i),u[0];let c=new n.YJl;i.extensions&&es(s,c,i),t.associations.set(c,{meshes:e});for(let e=0,t=u.length;e<t;e++)c.add(u[e]);return c})}loadCamera(e){let t;let r=this.json.cameras[e],s=r[r.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return"perspective"===r.type?t=new n.ubm(n.cj9.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):"orthographic"===r.type&&(t=new n.qUd(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),ei(t,r),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],r=[];for(let e=0,n=t.joints.length;e<n;e++)r.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(e){let r=e.pop(),s=[],i=[];for(let a=0,o=e.length;a<o;a++){let o=e[a];if(o){s.push(o);let e=new n.kn4;null!==r&&e.fromArray(r.array,16*a),i.push(e)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new n.EAD(s,i)})}loadAnimation(e){let t=this.json,r=this,s=t.animations[e],i=s.name?s.name:"animation_"+e,a=[],o=[],l=[],u=[],c=[];for(let e=0,t=s.channels.length;e<t;
6e++){let t=s.channels[e],r=s.samplers[t.sampler],n=t.target,i=n.node,h=void 0!==s.parameters?s.parameters[r.input]:r.input,d=void 0!==s.parameters?s.parameters[r.output]:r.output;void 0!==n.node&&(a.push(this.getDependency("node",i)),o.push(this.getDependency("accessor",h)),l.push(this.getDependency("accessor",d)),u.push(r),c.push(n))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l),Promise.all(u),Promise.all(c)]).then(function(e){let t=e[0],s=e[1],a=e[2],o=e[3],l=e[4],u=[];for(let e=0,n=t.length;e<n;e++){let n=t[e],i=s[e],c=a[e],h=o[e],d=l[e];if(void 0===n)continue;n.updateMatrix&&n.updateMatrix();let f=r._createAnimationTracks(n,i,c,h,d);if(f)for(let e=0;e<f.length;e++)u.push(f[e])}return new n.tz3(i,void 0,u)})}createNodeMesh(e){let t=this.json,r=this,n=t.nodes[e];return void 0===n.mesh?null:r.getDependency("mesh",n.mesh).then(function(e){let t=r._getNodeRef(r.meshCache,n.mesh,e);return void 0!==n.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,r=n.weights.length;t<r;t++)e.morphTargetInfluences[t]=n.weights[t]}),t})}loadNode(e){let t=this.json.nodes[e],r=this._loadNodeShallow(e),n=[],s=t.children||[];for(let e=0,t=s.length;e<t;e++)n.push(this.getDependency("node",s[e]));let i=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([r,Promise.all(n),i]).then(function(e){let t=e[0],r=e[1],n=e[2];null!==n&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(n,el)});for(let e=0,n=r.length;e<n;e++)t.add(r[e]);return t})}_loadNodeShallow(e){let t=this.json,r=this.extensions,s=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];let i=t.nodes[e],a=i.name?s.createUniqueName(i.name):"",o=[],l=s._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return l&&o.push(l),void 0!==i.camera&&o.push(s.getDependency("camera",i.camera).then(function(e){return s._getNodeRef(s.cameraCache,i.camera,e)})),s._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if((o=!0===i.isBone?new n.$Kf:t.length>1?new n.YJl:1===t.length?t[0]:new n.B69)!==t[0])for(let e=0,r=t.length;e<r;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),ei(o,i),i.extensions&&es(r,o,i),void 0!==i.matrix){let e=new n.kn4;e.fromArray(i.matrix),o.applyMatrix4(e)}else void 0!==i.translation&&o.position.fromArray(i.translation),void 0!==i.rotation&&o.quaternion.fromArray(i.rotation),void 0!==i.scale&&o.scale.fromArray(i.scale);return s.associations.has(o)||s.associations.set(o,{}),s.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,r=this.json.scenes[e],s=this,i=new n.YJl;r.name&&(i.name=s.createUniqueName(r.name)),ei(i,r),r.extensions&&es(t,i,r);let a=r.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(s.getDependency("node",a[e]));return Promise.all(o).then(function(e){for(let t=0,r=e.length;t<r;t++)i.add(e[t]);return s.associations=(e=>{let t=new Map;for(let[e,r]of s.associations)(e instanceof n.imn||e instanceof n.gPd)&&t.set(e,r);return e.traverse(e=>{let r=s.associations.get(e);null!=r&&t.set(e,r)}),t})(i),i})}_createAnimationTracks(e,t,r,s,i){let a;let o=[],l=e.name?e.name:e.uuid,u=[];switch(et[i.path]===et.weights?e.traverse(function(e){e.morphTargetInfluences&&u.push(e.name?e.name:e.uuid)}):u.push(l),et[i.path]){case et.weights:a=n.Hit;break;case et.rotation:a=n.MBL;break;case et.position:case et.scale:a=n.RiT;break;default:a=1===r.itemSize?n.Hit:n.RiT}let c=void 0!==s.interpolation?er[s.interpolation]:n.PJ3,h=this._getArrayFromAccessor(r);for(let e=0,r=u.length;e<r;e++){let r=new a(u[e]+"."+et[i.path],t.array,h,c);"CUBICSPLINE"===s.interpolation&&this._createCubicSplineTrackInterpolant(r),o.push(r)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=eo(t.constructor),r=new Float32Array(t.length);for(let n=0,s=t.length;n<s;n++)r[n]=t[n]*e;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof n.MBL?q:X)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ec(e,t,r){let s=t.attributes,i=[];for(let t in s){let n=ee[t]||t.toLowerCase();n in e.attributes||i.push(function(t,n){return r.getDependency("accessor",t).then(function(t){e.setAttribute(n,t)})}(s[t],n))}if(void 0!==t.indices&&!e.index){let n=r.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});i.push(n)}return n.ppV.workingColorSpace!==n.Zr2&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Convert
6ing vertex colors from "srgb-linear" to "${n.ppV.workingColorSpace}" not supported.`),ei(e,t),function(e,t,r){let s=t.attributes,i=new n.NRn;if(void 0===s.POSITION)return;{let e=r.json.accessors[s.POSITION],t=e.min,a=e.max;if(void 0!==t&&void 0!==a){if(i.set(new n.Pq0(t[0],t[1],t[2]),new n.Pq0(a[0],a[1],a[2])),e.normalized){let t=eo(J[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}let a=t.targets;if(void 0!==a){let e=new n.Pq0,t=new n.Pq0;for(let n=0,s=a.length;n<s;n++){let s=a[n];if(void 0!==s.POSITION){let n=r.json.accessors[s.POSITION],i=n.min,a=n.max;if(void 0!==i&&void 0!==a){if(t.setX(Math.max(Math.abs(i[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(i[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(i[2]),Math.abs(a[2]))),n.normalized){let e=eo(J[n.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;let o=new n.iyt;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}(e,t,r),Promise.all(i).then(function(){return void 0!==t.targets?function(e,t,r){let n=!1,s=!1,i=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(void 0!==r.POSITION&&(n=!0),void 0!==r.NORMAL&&(s=!0),void 0!==r.COLOR_0&&(i=!0),n&&s&&i)break}if(!n&&!s&&!i)return Promise.resolve(e);let a=[],o=[],l=[];for(let u=0,c=t.length;u<c;u++){let c=t[u];if(n){let t=void 0!==c.POSITION?r.getDependency("accessor",c.POSITION):e.attributes.position;a.push(t)}if(s){let t=void 0!==c.NORMAL?r.getDependency("accessor",c.NORMAL):e.attributes.normal;o.push(t)}if(i){let t=void 0!==c.COLOR_0?r.getDependency("accessor",c.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then(function(t){let r=t[0],a=t[1],o=t[2];return n&&(e.morphAttributes.position=r),s&&(e.morphAttributes.normal=a),i&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e})}(e,t.targets,r):e})}class eh{parse(e){let t={},r=e.split(`
7`),n=null,s=t,i=[t];for(let e of r)if(e.includes("=")){let t=e.split("="),r=t[0].trim(),n=t[1].trim();if(n.endsWith("{")){let e={};i.push(e),s[r]=e,s=e}else s[r]=n}else if(e.endsWith("{")){let e=s[n]||{};i.push(e),s[n]=e,s=e}else if(e.endsWith("}")){if(i.pop(),0===i.length)continue;s=i[i.length-1]}else if(e.endsWith("(")){let t={};i.push(t),s[n=e.split("(")[0].trim()||n]=t,s=t}else e.endsWith(")")?(i.pop(),s=i[i.length-1]):n=e.trim();return t}}class ed extends n.aHM{constructor(e){super(e)}load(e,t,r,s){let i=this,a=new n.Y9S(i.manager);a.setPath(i.path),a.setResponseType("arraybuffer"),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(r){try{t(i.parse(r))}catch(t){s?s(t):console.error(t),i.manager.itemError(e)}},r,s)}parse(e){let t=new eh;function r(e){let t=e.slice(0,7),r=new Uint8Array([80,88,82,45,85,83,68,67]);return t.every((e,t)=>e===r[t])}let i=(0,s.u)(new Uint8Array(e)),a=function(e){let i={};for(let a in new n.Y9S().setResponseType("arraybuffer"),e){if(a.endsWith("png")){let t=new Blob([e[a]],{type:{type:"image/png"}});i[a]=URL.createObjectURL(t)}if(a.endsWith("usd")||a.endsWith("usda")){if(r(e[a])){console.warn("THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.");continue}let n=(0,s.a)(e[a]);i[a]=t.parse(n)}}return i}(i),o=function(e){if(e.length<1)return;let t=Object.keys(e)[0],n=!1;if(t.endsWith("usda"))return e[t];if(t.endsWith("usdc"))n=!0;else if(t.endsWith("usd")){if(!r(e[t]))return e[t];n=!0}n&&console.warn("THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.")}(i);if(void 0===o)return console.warn("THREE.USDZLoader: No usda file found."),new n.YJl;let l=(0,s.a)(o),u=t.parse(l);function c(e,t){if(e){if(void 0!==t){let r=`def Mesh "${t}"`;if(r in e)return e[r]}for(let t in e){let r=e[t];if(t.startsWith("def Mesh"))return"point3f[] points"in e&&(r["point3f[] points"]=e["point3f[] points"]),"texCoord2f[] primvars:st"in e&&(r["texCoord2f[] primvars:st"]=e["texCoord2f[] primvars:st"]),"int[] primvars:st:indices"in e&&(r["int[] primvars:st:indices"]=e["int[] primvars:st:indices"]),r;if("object"==typeof r){let e=c(r);if(e)return e}}}}function h(e,t=""){for(let r in e){let n=e[r];if(r.startsWith("def Material"+t))return n;if("object"==typeof n){let e=h(n,t);if(e)return e}}}function d(e,t){t["float inputs:rotation"]&&(e.rotation=parseFloat(t["float inputs:rotation"])),t["float2 inputs:scale"]&&(e.repeat=new n.I9Y().fromArray(JSON.parse("["+t["float2 inputs:scale"].replace(/[()]*/g,"")+"]"))),t["float2 inputs:translation"]&&(e.offset=new n.I9Y().fromArray(JSON.parse("["+t["float2 inputs:translation"].replace(/[()]*/g,"")+"]")))}function f(e,t){for(let r in e){let n=e[r];if(r.startsWith(`def Shader "${t}"`))return n;if("object"==typeof n){let e=f(n,t);if(e)return e}}}function p(e){if("asset inputs:file"in e){let t=e["asset inputs:file"].replace(/@*/g,""),r=new n.Tap().load(a[t]),s={'"clamp"':n.ghU,'"mirror"':n.kTW,'"repeat"':n.GJx};
7return"token inputs:wrapS"in e&&(r.wrapS=s[e["token inputs:wrapS"]]),"token inputs:wrapT"in e&&(r.wrapT=s[e["token inputs:wrapT"]]),r}return null}let m=new n.YJl;return function e(t,r){for(let s in t)if(s.startsWith("def Scope"))e(t[s],r);else if(s.startsWith("def Xform")){let i=function(e){let t=function(e){if(!e)return;let t=new n.LoY;if("int[] faceVertexIndices"in e){let r=JSON.parse(e["int[] faceVertexIndices"]);t.setIndex(r)}if("point3f[] points"in e){let r=JSON.parse(e["point3f[] points"].replace(/[()]*/g,"")),s=new n.THS(new Float32Array(r),3);t.setAttribute("position",s)}if("normal3f[] normals"in e){let r=JSON.parse(e["normal3f[] normals"].replace(/[()]*/g,"")),s=new n.THS(new Float32Array(r),3);t.setAttribute("normal",s)}else t.computeVertexNormals();if("float2[] primvars:st"in e&&(e["texCoord2f[] primvars:st"]=e["float2[] primvars:st"]),"texCoord2f[] primvars:st"in e){let r=JSON.parse(e["texCoord2f[] primvars:st"].replace(/[()]*/g,"")),s=new n.THS(new Float32Array(r),2);if("int[] primvars:st:indices"in e){t=t.toNonIndexed();let r=JSON.parse(e["int[] primvars:st:indices"]);t.setAttribute("uv",function(e,t){let r=e.array,s=e.itemSize,i=new r.constructor(t.length*s),a=0,o=0;for(let e=0,n=t.length;e<n;e++){a=t[e]*s;for(let e=0;e<s;e++)i[o++]=r[a++]}return new n.THS(i,s)}(s,r))}else t.setAttribute("uv",s)}return t}(function(e){if(e){if("prepend references"in e){let t=e["prepend references"].split("@"),r=t[1].replace(/^.\//,""),n=t[2].replace(/^<\//,"").replace(/>$/,"");return c(a[r],n)}return c(e)}}(e)),r=function(e){let t=new n.uSd;if(void 0!==e){if('def Shader "PreviewSurface"'in e){let r=e['def Shader "PreviewSurface"'];if("color3f inputs:diffuseColor.connect"in r){let s=r["color3f inputs:diffuseColor.connect"],i=f(u,/(\w+).output/.exec(s)[1]);
7t.map=p(i),t.map.colorSpace=n.er$,'def Shader "Transform2d_diffuse"'in e&&d(t.map,e['def Shader "Transform2d_diffuse"'])}else if("color3f inputs:diffuseColor"in r){let e=r["color3f inputs:diffuseColor"].replace(/[()]*/g,"");t.color.fromArray(JSON.parse("["+e+"]"))}if("color3f inputs:emissiveColor.connect"in r){let s=r["color3f inputs:emissiveColor.connect"],i=f(u,/(\w+).output/.exec(s)[1]);t.emissiveMap=p(i),t.emissiveMap.colorSpace=n.er$,t.emissive.set(0xffffff),'def Shader "Transform2d_emissive"'in e&&d(t.emissiveMap,e['def Shader "Transform2d_emissive"'])}else if("color3f inputs:emissiveColor"in r){let e=r["color3f inputs:emissiveColor"].replace(/[()]*/g,"");t.emissive.fromArray(JSON.parse("["+e+"]"))}if("normal3f inputs:normal.connect"in r){let s=r["normal3f inputs:normal.connect"],i=f(u,/(\w+).output/.exec(s)[1]);t.normalMap=p(i),t.normalMap.colorSpace=n.jf0,'def Shader "Transform2d_normal"'in e&&d(t.normalMap,e['def Shader "Transform2d_normal"'])}if("float inputs:roughness.connect"in r){let s=r["float inputs:roughness.connect"],i=f(u,/(\w+).output/.exec(s)[1]);
7t.roughness=1,t.roughnessMap=p(i),t.roughnessMap.colorSpace=n.jf0,'def Shader "Transform2d_roughness"'in e&&d(t.roughnessMap,e['def Shader "Transform2d_roughness"'])}else"float inputs:roughness"in r&&(t.roughness=parseFloat(r["float inputs:roughness"]));if("float inputs:metallic.connect"in r){let s=r["float inputs:metallic.connect"],i=f(u,/(\w+).output/.exec(s)[1]);t.metalness=1,t.metalnessMap=p(i),t.metalnessMap.colorSpace=n.jf0,'def Shader "Transform2d_metallic"'in e&&d(t.metalnessMap,e['def Shader "Transform2d_metallic"'])}else"float inputs:metallic"in r&&(t.metalness=parseFloat(r["float inputs:metallic"]));if("float inputs:clearcoat.connect"in r){let s=r["float inputs:clearcoat.connect"],i=f(u,/(\w+).output/.exec(s)[1]);t.clearcoat=1,t.clearcoatMap=p(i),t.clearcoatMap.colorSpace=n.jf0,'def Shader "Transform2d_clearcoat"'in e&&d(t.clearcoatMap,e['def Shader "Transform2d_clearcoat"'])}else"float inputs:clearcoat"in r&&(t.clearcoat=parseFloat(r["float inputs:clearcoat"]));if("float inputs:clearcoatRoughness.connect"in r){let s=r["float inputs:clearcoatRoughness.connect"],i=f(u,/(\w+).output/.exec(s)[1]);t.clearcoatRoughness=1,t.clearcoatRoughnessMap=p(i),t.clearcoatRoughnessMap.colorSpace
7=n.jf0,'def Shader "Transform2d_clearcoatRoughness"'in e&&d(t.clearcoatRoughnessMap,e['def Shader "Transform2d_clearcoatRoughness"'])}else"float inputs:clearcoatRoughness"in r&&(t.clearcoatRoughness=parseFloat(r["float inputs:clearcoatRoughness"]));if("float inputs:ior"in r&&(t.ior=parseFloat(r["float inputs:ior"])),"float inputs:occlusion.connect"in r){let s=r["float inputs:occlusion.connect"],i=f(u,/(\w+).output/.exec(s)[1]);t.aoMap=p(i),t.aoMap.colorSpace=n.jf0,'def Shader "Transform2d_occlusion"'in e&&d(t.aoMap,e['def Shader "Transform2d_occlusion"'])}}if('def Shader "diffuseColor_texture"'in e){let r=e['def Shader "diffuseColor_texture"'];t.map=p(r),t.map.colorSpace=n.er$}if('def Shader "normal_texture"'in e){let r=e['def Shader "normal_texture"'];t.normalMap=p(r),t.normalMap.colorSpace=n.jf0}}return t}(function(e){if(e){if("rel material:binding"in e){let t=e["rel material:binding"].replace(/^<\//,"").replace(/>$/,"").split("/");return h(u,` "${t[1]}"`)}return h(e)}}(e)),s=t?new n.eaF(t,r):new n.B69;if("matrix4d xformOp:transform"in e){let t=JSON.parse("["+e["matrix4d xformOp:transform"].replace(/[()]*/g,"")+"]");s.matrix.fromArray(t),s.matrix.decompose(s.position,s.quaternion,s.scale)}return s}(t[s]);/def Xform "(\w+)"/.test(s)&&(i.name=/def Xform "(\w+)"/.exec(s)[1]),r.add(i),e(t[s],i)}}(u,m),m}}let ef=new WeakMap;class ep extends n.aHM{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,s){let i=new n.Y9S(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{this.parse(e,t,s)},r,s)}parse(e,t,r=()=>{}){this.decodeDracoFile(e,t,null,null,n.er$).catch(r)}decodeDracoFile(e,t,r,s,i=n.Zr2,a=()=>{}){let o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:i};return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){let r;let n=JSON.stringify(t);if(ef.has(e)){let t=ef.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s=this.workerNextTaskID++,i=e.byteLength,a=this._getWorker(s,i).then(n=>(r=n,new Promise((n,i)=>{r._callbacks[s]={resolve:n,reject:i},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),ef.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new n.LoY;e.index&&t.setIndex(new n.THS(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let s=e.attributes[r],i=s.name,a=s.array,o=s.itemSize,l=new n.THS(a,o);"color"===i&&(this._assignVertexColorSpace(l,s.vertexColorSpace),l.normalized=!(a instanceof Float32Array)),t.setAttribute(i,l)}return t}_assignVertexColorSpace(e,t){if(t!==n.er$)return;let r=new n.Q1f;for(let t=0,n=e.count;t<n;t++)r.fromBufferAttribute(e,t).convertSRGBToLinear(),e.setXYZ(t,r.r,r.g,r.b)}_loadLibrary(e,t){let r=new n.Y9S(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((t,n)=>{r.load(e,t,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=em.toString(),s=["/* draco decoder */",r,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join(`
8`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>
8{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let r=t.data;switch(r.type){case"decode":e._callbacks[r.id].resolve(r);break;case"error":e._callbacks[r.id].reject(r);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+r.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}}function em(){let e,t;onmessage=function(r){let n=r.data;switch(n.type){case"init":e=n.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let s=n.buffer,i=n.taskConfig;t.then(e=>{let t=e.draco,r=new t.Decoder;try{let e=function(e,t,r,n){let s,i;let a=n.attributeIDs,o=n.attributeTypes,l=t.GetEncodedGeometryType(r);if(l===e.TRIANGULAR_MESH)s=new e.Mesh,i=t.DecodeArrayToMesh(r,r.byteLength,s);else if(l===e.POINT_CLOUD)s=new e.PointCloud,i=t.DecodeArrayToPointCloud(r,r.byteLength,s);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!i.ok()||0===s.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+i.error_msg());let u={index:null,attributes:[]};for(let r in a){let i,l;let c=self[o[r]];if(n.useUniqueIDs)l=a[r],i=t.GetAttributeByUniqueId(s,l);else{if(-1===(l=t.GetAttributeId(s,e[a[r]])))continue;i=t.GetAttribute(s,l)}let h=function(e,t,r,n,s,i){let a=i.num_components(),o=r.num_points()*a,l=o*s.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,s),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,i,u,l,c);let h=new s(e.HEAPF32.buffer,c,o).slice();return e._free(c),{name:n,array:h,itemSize:a}}(e,t,s,r,c,i);"color"===r&&(h.vertexColorSpace=n.vertexColorSpace),u.attributes.push(h)}return l===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){let n=3*r.num_faces(),s=4*n,i=e._malloc(s);t.GetTrianglesUInt32Array(r,s,i);let a=new Uint32Array(e.HEAPF32.buffer,i,n).slice();return e._free(i),{array:a,itemSize:1}}(e,t,s)),e.destroy(s),u}(t,r,new Int8Array(s),i),a=e.attributes.map(e=>e.array.buffer);e.index&&a.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},a)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(r)}})}}}function eg(){let e,t;onmessage=function(r){let n=r.data;switch(n.type){case"init":e=n.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let s=n.buffer,i=n.taskConfig;t.then(e=>{let t=e.draco,r=new t.Decoder;try{let e=function(e,t,r,n){let s,i;let a=n.attributeIDs,o=n.attributeTypes,l=t.GetEncodedGeometryType(r);if(l===e.TRIANGULAR_MESH)s=new e.Mesh,i=t.DecodeArrayToMesh(r,r.byteLength,s);else if(l===e.POINT_CLOUD)s=new e.PointCloud,i=t.DecodeArrayToPointCloud(r,r.byteLength,s);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!i.ok()||0===s.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+i.error_msg());let u={index:null,attributes:[]};for(let r in a){let i,l;let c=self[o[r]];if(n.useUniqueIDs)l=a[r],i=t.GetAttributeByUniqueId(s,l);else{if(-1===(l=t.GetAttributeId(s,e[a[r]])))continue;i=t.GetAttribute(s,l)}let h=function(e,t,r,n,s,i){let a=i.num_components(),o=r.num_points()*a,l=o*s.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,s),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,i,u,l,c);let h=new s(e.HEAPF32.buffer,c,o).slice();return e._free(c),{name:n,array:h,itemSize:a}}(e,t,s,r,c,i);
8"color"===r&&(h.vertexColorSpace=n.vertexColorSpace),u.attributes.push(h)}return l===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){let n=3*r.num_faces(),s=4*n,i=e._malloc(s);t.GetTrianglesUInt32Array(r,s,i);let a=new Uint32Array(e.HEAPF32.buffer,i,n).slice();return e._free(i),{array:a,itemSize:1}}(e,t,s)),e.destroy(s),u}(t,r,new Int8Array(s),i),a=e.attributes.map(e=>e.array.buffer);e.index&&a.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},a)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(r)}})}}}let eA={LOAD_DRACO_JS_DECODER:async()=>(await r.e(2595).then(r.bind(r,2595))).default,LOAD_DRACO_WASM_WRAPPER:async()=>(await r.e(60414).then(r.bind(r,414))).default,LOAD_DRACO_WASM_DECODER:async()=>{let e=(await r.e(35021).then(r.bind(r,5021))).default;return await (await fetch(e)).arrayBuffer()}};class eT extends ep{constructor(){super(...arguments),T(this,"decoderPending",null),T(this,"decoderConfig",{type:"js",wasmBinary:null}),T(this,"workerSourceURL","")}async _initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(eA.LOAD_DRACO_JS_DECODER()):(t.push(eA.LOAD_DRACO_WASM_WRAPPER()),t.push(eA.LOAD_DRACO_WASM_DECODER())),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=eg.toString(),s=["/* draco decoder */",r,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join(`
9`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}}function e_(){let e=null,t=null,r=[[/'CONFIG_CONTROL_DESIGN'\s*\)/g,"'AP203_CONFIGURATION_CONTROLLED_3D_DESIGN_OF_MECHANICAL_PARTS_AND_ASSEMBLIES_MIM_LF')"],[/'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF\.\s*\{[\s\S]*?\}\s*'/g,"'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF'"]];onmessage=async function(n){var s=n.data;switch(s.type){case"init":t=s.wasmUrl;break;case"parse":try{var i,a=await (e||(e=occtimportjs({locateFile:function(){return t}})),e),o=new Uint8Array(s.buffer),l=s.fileType;if(!(i="step"===l||"stp"===l?function(e,t){var n=function(e){for(var t=new TextDecoder("utf-8",{fatal:!1}),n=new TextEncoder,s=t.decode(e),i=0;i<r.length;i++){var a=r[i][0],o=r[i][1];s=s.replace(a,o)}return new Uint8Array(n.encode(s))}(t);try{var s=e.ReadStepFile(n,null);if(s.success&&s.root)return s}catch{}try{return e.ReadStepFile(t,null)}catch{return{success:!1,root:{meshes:[],children:[]},meshes:[]}}}(a,o):a.ReadIgesFile(o,null)).success||!i.root){self.postMessage({type:"error",id:s.id,error:"Failed to parse CAD file"});return}self.postMessage({type:"result",id:s.id,result:i})}catch(e){self.postMessage({type:"error",id:s.id,error:e instanceof Error?e.message:String(e)})}}}}let ew={LOAD_OCCT_JS:async()=>(await r.e(18012).then(r.bind(r,8012))).default,LOAD_OCCT_WASM_URL:async()=>(await r.e(68915).then(r.bind(r,8915))).default};class ey{constructor(){T(this,"_workerPending",null),T(this,"_worker",null),T(this,"_nextId",0),T(this,"_pending",new Map)}_getWorker(){return this._workerPending||(this._workerPending=(async()=>{let[e,t]=await Promise.all([ew.LOAD_OCCT_JS(),ew.LOAD_OCCT_WASM_URL()]),r=e_.toString(),n=["/* occt-import-js */",e,"","/* step worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
10`),s=new Worker(URL.createObjectURL(new Blob([n]))),i=new URL(t,window.location.href).href;return s.postMessage({type:"init",wasmUrl:i}),s.onmessage=e=>{let{type:t,id:r,result:n,error:s}=e.data,i=this._pending.get(r);if(i){if(this._pending.delete(r),"result"===t)try{i.resolve(this._buildScene(n))}catch(e){i.reject(e instanceof Error?e:Error(String(e)))}else i.reject(Error(s??"Worker error"))}},s.onerror=e=>{for(let[,{reject:t}]of this._pending)t(Error(e.message??"Worker error"));this._pending.clear()},this._worker=s,s})()),this._workerPending}async parseAsync(e,t){let r=this._nextId++,n=await this._getWorker();return new Promise((s,i)=>{this._pending.set(r,{resolve:s,reject:i});let a=e.slice(0);n.postMessage({type:"parse",id:r,buffer:a,fileType:t},[a])})}dispose(){if(this._worker){for(let[,{reject:e}
10]of this._pending)e(Error("STEPLoader disposed"));this._pending.clear(),this._worker.terminate(),this._worker=null,this._workerPending=null}}_buildScene(e){let t=new n.YJl;return t.name=e.root.name??"CAD Model",this._buildNode(e.root,e.meshes,t),t.rotation.x=-Math.PI/2,t.rotation.z=Math.PI/2,t}_buildNode(e,t,r){let s=new n.YJl;for(let r of(s.name=e.name??"Part",e.meshes)){let e=t[r];if(null!=e&&e.attributes){let t=this._createMesh(e);s.add(t)}}for(let r of e.children)this._buildNode(r,t,s);r.add(s)}_createMesh(e){var t,r;let{position:s,normal:i}=e.attributes,a=e.index??e.attributes.index,o=new n.LoY;o.setAttribute("position",new n.THS(new Float32Array(s.array),3)),null!=(t=null==i?void 0:i.array)&&t.length?o.setAttribute("normal",new n.THS(new Float32Array(i.array),3)):o.computeVertexNormals(),null!=(r=null==a?void 0:a.array)&&r.length&&o.setIndex(new n.THS(new Uint32Array(a.array),1));let l=e.color,u=new n._4j({metalness:.3,roughness:.6});l&&l.length>=3?u.color.setRGB(l[0],l[1],l[2]):u.color.setHex(0xcccccc);let c=new n.eaF(o,u);return c.name=e.name??"Mesh",c.castShadow=!0,c.receiveShadow=!0,c}}class ev{constructor(){T(this,"_gltfLoader"),T(this,"_usdzLoader"),T(this,"_stepLoader");let e=new eT;e.setDecoderConfig({type:"wasm"}),this._gltfLoader=new w,this._gltfLoader.setDRACOLoader(e),this._usdzLoader=new ed,this._stepLoader=new ey}async load(e,t){let r;if(t)r=t;else if(0===(r=(0,a.g)(e)).length&&0===(r=await this._detectFileTypeFromContent(e)).length)throw new o.F("No file extension found in URI","");if(!(0,a.i)(r))throw new o.F(`Unsupported file type: ${r}. Supported types: ${i.S.join(", ")}`,r);let n=m.read(e);if(n)return n.arrayBuffer?this._parse(n.arrayBuffer,r):n.promise.then(e=>this._parse(e,r));let s=await m.create(e).load();return this._parse(s,r)}async _detectFileTypeFromContent(e){try{let t;let r=m.read(e);t=r?r.arrayBuffer?r.arrayBuffer:await r.promise:await m.create(e).load();let n=new Uint8Array(t);return n.length>=12&&"glTF"===String.fromCharCode(n[0],n[1],n[2],n[3])?0===n[12]?"glb":"gltf":n.length>=4&&80===n[0]&&75===n[1]&&(3===n[2]||5===n[2])&&(4===n[3]||6===n[3])?"usdz":n.length>=20&&new TextDecoder("ascii").decode(n.subarray(0,20)).startsWith("ISO-10303-21")?"step":n.length>=80&&83===n[72]?"iges":""}catch{return""}}async _parse(e,t){try{switch(t){case"glb":case"gltf":{let t=await this._gltfLoader.parseAsync(e,"");return t.scene.animations=t.animations,t.scene}case"usdz":{let t=this._usdzLoader.parse(e);return t.animations=[],t}case"step":case"stp":case"iges":case"igs":{let r=await this._stepLoader.parseAsync(e,t);return r.animations=[],r}}}catch(e){throw e instanceof Error?new o.P(`Failed to parse ${t} file: ${e.message}`,e):new o.P(`Failed to parse ${t} file`)}}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.