@neurodyn/core-ar 0.2.10 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,987 @@
1
+ /*! For license information please see core-ar.chunk.09fa4463.min.js.LICENSE.txt */
2
+ (self.webpackChunk_neurodyn_core_ar=self.webpackChunk_neurodyn_core_ar||[]).push([["634"],{4904(e){"use strict";var t={single_source_shortest_paths:function(e,r,i){var n,a,s,o,l,c,h,u={},d={};d[r]=0;var p=t.PriorityQueue.make();for(p.push(r,0);!p.empty();)for(s in a=(n=p.pop()).value,o=n.cost,l=e[a]||{})l.hasOwnProperty(s)&&(c=o+l[s],h=d[s],(void 0===d[s]||h>c)&&(d[s]=c,p.push(s,c),u[s]=a));if(void 0!==i&&void 0===d[i])throw Error("Could not find a path from "+r+" to "+i+".");return u},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],i=t;i;)r.push(i),e[i],i=e[i];return r.reverse(),r},find_path:function(e,r,i){var n=t.single_source_shortest_paths(e,r,i);return t.extract_shortest_path_from_predecessor_list(n,i)},PriorityQueue:{make:function(e){var r,i=t.PriorityQueue,n={};for(r in e=e||{},i)i.hasOwnProperty(r)&&(n[r]=i[r]);return n.queue=[],n.sorter=e.sorter||i.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},8112(e,t,r){"use strict";r.d(t,{A:()=>l});var i=r(9081);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,i.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:l,iconNode:c,...h},u)=>(0,i.createElement)("svg",{ref:u,...s,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:a("lucide",o),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(h)&&{"aria-hidden":"true"},...h},[...c.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(l)?l:[l]])),l=(e,t)=>{let r=(0,i.forwardRef)(({className:r,...s},l)=>(0,i.createElement)(o,{ref:l,iconNode:t,className:a(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...s}));return r.displayName=n(e),r}},2002(e,t,r){"use strict";r.d(t,{A:()=>i});let i=(0,r(8112).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},8428(e,t,r){"use strict";r.d(t,{A:()=>i});let i=(0,r(8112).A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},2838(e,t,r){"use strict";r.d(t,{A:()=>i});let i=(0,r(8112).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},7265(e,t,r){"use strict";var i=r(3034);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,a,s){if(s!==i){var o=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:n};return r.PropTypes=r,r}},5821(e,t,r){e.exports=r(7265)()},3034(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},3946(e,t,r){let i=r(9972),n=r(9908),a=r(7782),s=r(4783);function o(e,t,r,a,s){let o=[].slice.call(arguments,1),l=o.length,c="function"==typeof o[l-1];if(!c&&!i())throw Error("Callback required as last argument");if(c){if(l<2)throw Error("Too few arguments provided");2===l?(s=r,r=t,t=a=void 0):3===l&&(t.getContext&&void 0===s?(s=a,a=void 0):(s=a,a=r,r=t,t=void 0))}else{if(l<1)throw Error("Too few arguments provided");return 1===l?(r=t,t=a=void 0):2!==l||t.getContext||(a=r,r=t,t=void 0),new Promise(function(i,s){try{let s=n.create(r,a);i(e(s,t,a))}catch(e){s(e)}})}try{let i=n.create(r,a);s(null,e(i,t,a))}catch(e){s(e)}}t.create=n.create,t.toCanvas=o.bind(null,a.render),t.toDataURL=o.bind(null,a.renderToDataURL),t.toString=o.bind(null,function(e,t,r){return s.render(e,r)})},9972(e){e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},5734(e,t,r){let i=r(4913).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];let t=Math.floor(e/7)+2,r=i(e),n=145===r?26:2*Math.ceil((r-13)/(2*t-2)),a=[r-7];for(let e=1;e<t-1;e++)a[e]=a[e-1]-n;return a.push(6),a.reverse()},t.getPositions=function(e){let r=[],i=t.getRowColCoords(e),n=i.length;for(let e=0;e<n;e++)for(let t=0;t<n;t++)(0!==e||0!==t)&&(0!==e||t!==n-1)&&(e!==n-1||0!==t)&&r.push([i[e],i[t]]);return r}},8682(e,t,r){let i=r(989),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(e){this.mode=i.ALPHANUMERIC,this.data=e}a.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*n.indexOf(this.data[t]);r+=n.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(n.indexOf(this.data[t]),6)},e.exports=a},3702(e){function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},2165(e){function t(e){if(!e||e<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,i){let n=e*this.size+t;this.data[n]=r,i&&(this.reservedBit[n]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},9481(e,t,r){let i=r(989);function n(e){this.mode=i.BYTE,"string"==typeof e?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}n.getBitsLength=function(e){return 8*e},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},e.exports=n},6781(e,t,r){let i=r(4752),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case i.L:return n[(e-1)*4+0];case i.M:return n[(e-1)*4+1];case i.Q:return n[(e-1)*4+2];case i.H:return n[(e-1)*4+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case i.L:return a[(e-1)*4+0];case i.M:return a[(e-1)*4+1];case i.Q:return a[(e-1)*4+2];case i.H:return a[(e-1)*4+3];default:return}}},4752(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw Error("Unknown EC Level: "+e)}}catch(e){return r}}},9261(e,t,r){let i=r(4913).getSymbolSize;t.getPositions=function(e){let t=i(e);return[[0,0],[t-7,0],[0,t-7]]}},6174(e,t,r){let i=r(4913),n=i.getBCHDigit(1335);t.getEncodedBits=function(e,t){let r=e.bit<<3|t,a=r<<10;for(;i.getBCHDigit(a)-n>=0;)a^=1335<<i.getBCHDigit(a)-n;return(r<<10|a)^21522}},8366(e,t){let r=new Uint8Array(512),i=new Uint8Array(256),n=1;for(let e=0;e<255;e++)r[e]=n,i[n]=e,256&(n<<=1)&&(n^=285);for(let e=255;e<512;e++)r[e]=r[e-255];t.log=function(e){if(e<1)throw Error("log("+e+")");return i[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[i[e]+i[t]]}},9712(e,t,r){let i=r(989),n=r(4913);function a(e){this.mode=i.KANJI,this.data=e}a.getBitsLength=function(e){return 13*e},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=n.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),e.put(r,13)}},e.exports=a},7281(e,t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){let t=e.size,r=0,i=0,n=0,a=null,s=null;for(let o=0;o<t;o++){i=n=0,a=s=null;for(let l=0;l<t;l++){let t=e.get(o,l);t===a?i++:(i>=5&&(r+=3+(i-5)),a=t,i=1),(t=e.get(l,o))===s?n++:(n>=5&&(r+=3+(n-5)),s=t,n=1)}i>=5&&(r+=3+(i-5)),n>=5&&(r+=3+(n-5))}return r},t.getPenaltyN2=function(e){let t=e.size,r=0;for(let i=0;i<t-1;i++)for(let n=0;n<t-1;n++){let t=e.get(i,n)+e.get(i,n+1)+e.get(i+1,n)+e.get(i+1,n+1);(4===t||0===t)&&r++}return 3*r},t.getPenaltyN3=function(e){let t=e.size,r=0,i=0,n=0;for(let a=0;a<t;a++){i=n=0;for(let s=0;s<t;s++)i=i<<1&2047|e.get(a,s),s>=10&&(1488===i||93===i)&&r++,n=n<<1&2047|e.get(s,a),s>=10&&(1488===n||93===n)&&r++}return 40*r},t.getPenaltyN4=function(e){let t=0,r=e.data.length;for(let i=0;i<r;i++)t+=e.data[i];return 10*Math.abs(Math.ceil(100*t/r/5)-10)},t.applyMask=function(e,r){let i=r.size;for(let n=0;n<i;n++)for(let a=0;a<i;a++)r.isReserved(a,n)||r.xor(a,n,function(e,r,i){switch(e){case t.Patterns.PATTERN000:return(r+i)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return i%3==0;case t.Patterns.PATTERN011:return(r+i)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(i/3))%2==0;case t.Patterns.PATTERN101:return r*i%2+r*i%3==0;case t.Patterns.PATTERN110:return(r*i%2+r*i%3)%2==0;case t.Patterns.PATTERN111:return(r*i%3+(r+i)%2)%2==0;default:throw Error("bad maskPattern:"+e)}}(e,a,n))},t.getBestMask=function(e,r){let i=Object.keys(t.Patterns).length,n=0,a=1/0;for(let s=0;s<i;s++){r(s),t.applyMask(s,e);let i=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(s,e),i<a&&(a=i,n=s)}return n}},989(e,t,r){let i=r(3673),n=r(863);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw Error("Invalid mode: "+e);if(!i.isValid(t))throw Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw Error("Unknown mode: "+e)}}catch(e){return r}}},1412(e,t,r){let i=r(989);function n(e){this.mode=i.NUMERIC,this.data=e.toString()}n.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){let t,r;for(t=0;t+3<=this.data.length;t+=3)r=parseInt(this.data.substr(t,3),10),e.put(r,10);let i=this.data.length-t;i>0&&(r=parseInt(this.data.substr(t),10),e.put(r,3*i+1))},e.exports=n},2576(e,t,r){let i=r(8366);t.mul=function(e,t){let r=new Uint8Array(e.length+t.length-1);for(let n=0;n<e.length;n++)for(let a=0;a<t.length;a++)r[n+a]^=i.mul(e[n],t[a]);return r},t.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){let e=r[0];for(let n=0;n<t.length;n++)r[n]^=i.mul(t[n],e);let n=0;for(;n<r.length&&0===r[n];)n++;r=r.slice(n)}return r},t.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let n=0;n<e;n++)r=t.mul(r,new Uint8Array([1,i.exp(n)]));return r}},9908(e,t,r){let i=r(4913),n=r(4752),a=r(3702),s=r(2165),o=r(5734),l=r(9261),c=r(7281),h=r(6781),u=r(3025),d=r(3492),p=r(6174),f=r(989),g=r(8356);function m(e,t,r){let i,n,a=e.size,s=p.getEncodedBits(t,r);for(i=0;i<15;i++)n=(s>>i&1)==1,i<6?e.set(i,8,n,!0):i<8?e.set(i+1,8,n,!0):e.set(a-15+i,8,n,!0),i<8?e.set(8,a-i-1,n,!0):i<9?e.set(8,15-i-1+1,n,!0):e.set(8,15-i-1,n,!0);e.set(a-8,8,1,!0)}t.create=function(e,t){let r,p;if(void 0===e||""===e)throw Error("No input text");let A=n.M;return void 0!==t&&(A=n.from(t.errorCorrectionLevel,n.M),r=d.from(t.version),p=c.from(t.maskPattern),t.toSJISFunc&&i.setToSJISFunction(t.toSJISFunc)),function(e,t,r,n){let p;if(Array.isArray(e))p=g.fromArray(e);else if("string"==typeof e){let i=t;if(!i){let t=g.rawSplit(e);i=d.getBestVersionForData(t,r)}p=g.fromString(e,i||40)}else throw Error("Invalid data");let A=d.getBestVersionForData(p,r);if(!A)throw Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<A)throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+A+".\n")}else t=A;let b=function(e,t,r){let n=new a;r.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(n)});let s=(i.getSymbolTotalCodewords(e)-h.getTotalCodewordsCount(e,t))*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);let o=(s-n.getLengthInBits())/8;for(let e=0;e<o;e++)n.put(e%2?17:236,8);return function(e,t,r){let n,a,s=i.getSymbolTotalCodewords(t),o=s-h.getTotalCodewordsCount(t,r),l=h.getBlocksCount(t,r),c=s%l,d=l-c,p=Math.floor(s/l),f=Math.floor(o/l),g=f+1,m=p-f,A=new u(m),b=0,v=Array(l),y=Array(l),x=0,S=new Uint8Array(e.buffer);for(let e=0;e<l;e++){let t=e<d?f:g;v[e]=S.slice(b,b+t),y[e]=A.encode(v[e]),b+=t,x=Math.max(x,t)}let E=new Uint8Array(s),w=0;for(n=0;n<x;n++)for(a=0;a<l;a++)n<v[a].length&&(E[w++]=v[a][n]);for(n=0;n<m;n++)for(a=0;a<l;a++)E[w++]=y[a][n];return E}(n,e,t)}(t,r,p),v=new s(i.getSymbolSize(t));!function(e,t){let r=e.size,i=l.getPositions(t);for(let t=0;t<i.length;t++){let n=i[t][0],a=i[t][1];for(let t=-1;t<=7;t++)if(!(n+t<=-1)&&!(r<=n+t))for(let i=-1;i<=7;i++)a+i<=-1||r<=a+i||(t>=0&&t<=6&&(0===i||6===i)||i>=0&&i<=6&&(0===t||6===t)||t>=2&&t<=4&&i>=2&&i<=4?e.set(n+t,a+i,!0,!0):e.set(n+t,a+i,!1,!0))}}(v,t);let y=v.size;for(let e=8;e<y-8;e++){let t=e%2==0;v.set(e,6,t,!0),v.set(6,e,t,!0)}return!function(e,t){let r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],n=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(i+t,n+r,!0,!0):e.set(i+t,n+r,!1,!0)}}(v,t),m(v,r,0),t>=7&&function(e,t){let r,i,n,a=e.size,s=d.getEncodedBits(t);for(let t=0;t<18;t++)r=Math.floor(t/3),i=t%3+a-8-3,n=(s>>t&1)==1,e.set(r,i,n,!0),e.set(i,r,n,!0)}(v,t),!function(e,t){let r=e.size,i=-1,n=r-1,a=7,s=0;for(let o=r-1;o>0;o-=2)for(6===o&&o--;;){for(let r=0;r<2;r++)if(!e.isReserved(n,o-r)){let i=!1;s<t.length&&(i=(t[s]>>>a&1)==1),e.set(n,o-r,i),-1==--a&&(s++,a=7)}if((n+=i)<0||r<=n){n-=i,i=-i;break}}}(v,b),isNaN(n)&&(n=c.getBestMask(v,m.bind(null,v,r))),c.applyMask(n,v),m(v,r,n),{modules:v,version:t,errorCorrectionLevel:r,maskPattern:n,segments:p}}(e,r,A,p)}},3025(e,t,r){let i=r(2576);function n(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(e){this.degree=e,this.genPoly=i.generateECPolynomial(this.degree)},n.prototype.encode=function(e){if(!this.genPoly)throw Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let r=i.mod(t,this.genPoly),n=this.degree-r.length;if(n>0){let e=new Uint8Array(this.degree);return e.set(r,n),e}return r},e.exports=n},863(e,t){let r="[0-9]+",i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(i=i.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";t.KANJI=RegExp(i,"g"),t.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=RegExp(n,"g"),t.NUMERIC=RegExp(r,"g"),t.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let a=RegExp("^"+i+"$"),s=RegExp("^"+r+"$"),o=RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return a.test(e)},t.testNumeric=function(e){return s.test(e)},t.testAlphanumeric=function(e){return o.test(e)}},8356(e,t,r){let i=r(989),n=r(1412),a=r(8682),s=r(9481),o=r(9712),l=r(863),c=r(4913),h=r(4904);function u(e){return unescape(encodeURIComponent(e)).length}function d(e,t,r){let i,n=[];for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function p(e){let t,r,n=d(l.NUMERIC,i.NUMERIC,e),a=d(l.ALPHANUMERIC,i.ALPHANUMERIC,e);return c.isKanjiModeEnabled()?(t=d(l.BYTE,i.BYTE,e),r=d(l.KANJI,i.KANJI,e)):(t=d(l.BYTE_KANJI,i.BYTE,e),r=[]),n.concat(a,t,r).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,t){switch(t){case i.NUMERIC:return n.getBitsLength(e);case i.ALPHANUMERIC:return a.getBitsLength(e);case i.KANJI:return o.getBitsLength(e);case i.BYTE:return s.getBitsLength(e)}}function g(e,t){let r,l=i.getBestModeForData(e);if((r=i.from(t,l))!==i.BYTE&&r.bit<l.bit)throw Error('"'+e+'" cannot be encoded with mode '+i.toString(r)+".\n Suggested mode is: "+i.toString(l));switch(r===i.KANJI&&!c.isKanjiModeEnabled()&&(r=i.BYTE),r){case i.NUMERIC:return new n(e);case i.ALPHANUMERIC:return new a(e);case i.KANJI:return new o(e);case i.BYTE:return new s(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},t.fromString=function(e,r){let n=function(e,t){let r={},n={start:{}},a=["start"];for(let s=0;s<e.length;s++){let o=e[s],l=[];for(let e=0;e<o.length;e++){let c=o[e],h=""+s+e;l.push(h),r[h]={node:c,lastCount:0},n[h]={};for(let e=0;e<a.length;e++){let s=a[e];r[s]&&r[s].node.mode===c.mode?(n[s][h]=f(r[s].lastCount+c.length,c.mode)-f(r[s].lastCount,c.mode),r[s].lastCount+=c.length):(r[s]&&(r[s].lastCount=c.length),n[s][h]=f(c.length,c.mode)+4+i.getCharCountIndicator(c.mode,t))}}a=l}for(let e=0;e<a.length;e++)n[a[e]].end=0;return{map:n,table:r}}(function(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r];switch(n.mode){case i.NUMERIC:t.push([n,{data:n.data,mode:i.ALPHANUMERIC,length:n.length},{data:n.data,mode:i.BYTE,length:n.length}]);break;case i.ALPHANUMERIC:t.push([n,{data:n.data,mode:i.BYTE,length:n.length}]);break;case i.KANJI:t.push([n,{data:n.data,mode:i.BYTE,length:u(n.data)}]);break;case i.BYTE:t.push([{data:n.data,mode:i.BYTE,length:u(n.data)}])}}return t}(p(e,c.isKanjiModeEnabled())),r),a=h.find_path(n.map,"start","end"),s=[];for(let e=1;e<a.length-1;e++)s.push(n.table[a[e]].node);return t.fromArray(s.reduce(function(e,t){let r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?e[e.length-1].data+=t.data:e.push(t),e},[]))},t.rawSplit=function(e){return t.fromArray(p(e,c.isKanjiModeEnabled()))}},4913(e,t){let r,i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw Error('"version" cannot be null or undefined');if(e<1||e>40)throw Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return i[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},3673(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},3492(e,t,r){let i=r(4913),n=r(6781),a=r(4752),s=r(989),o=r(3673),l=i.getBCHDigit(7973);function c(e,t){return s.getCharCountIndicator(e,t)+4}t.from=function(e,t){return o.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!o.isValid(e))throw Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);let a=(i.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,t))*8;if(r===s.MIXED)return a;let l=a-c(r,e);switch(r){case s.NUMERIC:return Math.floor(l/10*3);case s.ALPHANUMERIC:return Math.floor(l/11*2);case s.KANJI:return Math.floor(l/13);case s.BYTE:default:return Math.floor(l/8)}},t.getBestVersionForData=function(e,r){let i,n=a.from(r,a.M);if(Array.isArray(e)){if(e.length>1){for(let r=1;r<=40;r++)if(function(e,t){let r=0;return e.forEach(function(e){let i=c(e.mode,t);r+=i+e.getBitsLength()}),r}(e,r)<=t.getCapacity(r,n,s.MIXED))return r;return}if(0===e.length)return 1;i=e[0]}else i=e;return function(e,r,i){for(let n=1;n<=40;n++)if(r<=t.getCapacity(n,i,e))return n}(i.mode,i.getLength(),n)},t.getEncodedBits=function(e){if(!o.isValid(e)||e<7)throw Error("Invalid QR Code version");let t=e<<12;for(;i.getBCHDigit(t)-l>=0;)t^=7973<<i.getBCHDigit(t)-l;return e<<12|t}},7782(e,t,r){let i=r(6277);t.render=function(e,t,r){var n;let a=r,s=t;void 0!==a||t&&t.getContext||(a=t,t=void 0),t||(s=function(){try{return document.createElement("canvas")}catch(e){throw Error("You need to specify a canvas element")}}()),a=i.getOptions(a);let o=i.getImageWidth(e.modules.size,a),l=s.getContext("2d"),c=l.createImageData(o,o);return i.qrToImageData(c.data,e,a),n=s,l.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=o,n.width=o,n.style.height=o+"px",n.style.width=o+"px",l.putImageData(c,0,0),s},t.renderToDataURL=function(e,r,i){let n=i;void 0!==n||r&&r.getContext||(n=r,r=void 0),n||(n={});let a=t.render(e,r,n),s=n.type||"image/png",o=n.rendererOpts||{};return a.toDataURL(s,o.quality)}},4783(e,t,r){let i=r(6277);function n(e,t){let r=e.a/255,i=t+'="'+e.hex+'"';return r<1?i+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function a(e,t,r){let i=e+t;return void 0!==r&&(i+=" "+r),i}t.render=function(e,t,r){let s=i.getOptions(t),o=e.modules.size,l=e.modules.data,c=o+2*s.margin,h=s.color.light.a?"<path "+n(s.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",u="<path "+n(s.color.dark,"stroke")+' d="'+function(e,t,r){let i="",n=0,s=!1,o=0;for(let l=0;l<e.length;l++){let c=Math.floor(l%t),h=Math.floor(l/t);c||s||(s=!0),e[l]?(o++,l>0&&c>0&&e[l-1]||(i+=s?a("M",c+r,.5+h+r):a("m",n,0),n=0,s=!1),c+1<t&&e[l+1]||(i+=a("h",o),o=0)):n++}return i}(l,o,s.margin)+'"/>',d='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+('viewBox="0 0 '+c+" ")+c+'" shape-rendering="crispEdges">'+h+u+"</svg>\n";return"function"==typeof r&&r(null,d),d}},6277(e,t){function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw Error("Invalid hex color: "+e);(3===t.length||4===t.length)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");let r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});let t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,i=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:i,scale:i?4:n,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){let i=t.getScale(e,r);return Math.floor((e+2*r.margin)*i)},t.qrToImageData=function(e,r,i){let n=r.modules.size,a=r.modules.data,s=t.getScale(n,i),o=Math.floor((n+2*i.margin)*s),l=i.margin*s,c=[i.color.light,i.color.dark];for(let t=0;t<o;t++)for(let r=0;r<o;r++){let h=(t*o+r)*4,u=i.color.light;t>=l&&r>=l&&t<o-l&&r<o-l&&(u=c[+!!a[Math.floor((t-l)/s)*n+Math.floor((r-l)/s)]]),e[h++]=u.r,e[h++]=u.g,e[h++]=u.b,e[h]=u.a}}},5364(e,t,r){"use strict";var i=r(9081),n=r(8092);function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),b=Symbol.for("react.scope"),v=Symbol.for("react.activity"),y=Symbol.for("react.legacy_hidden"),x=Symbol.for("react.memo_cache_sentinel"),S=Symbol.for("react.view_transition"),E=Symbol.iterator;function w(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=E&&e[E]||e["@@iterator"])?e:null}var _=Array.isArray;function C(e,t){var r=3&e.length,i=e.length-r,n=t;for(t=0;t<i;){var a=255&e.charCodeAt(t)|(255&e.charCodeAt(++t))<<8|(255&e.charCodeAt(++t))<<16|(255&e.charCodeAt(++t))<<24;++t,n^=a=0x1b873593*(65535&(a=(a=0xcc9e2d51*(65535&a)+((0xcc9e2d51*(a>>>16)&65535)<<16)|0)<<15|a>>>17))+((0x1b873593*(a>>>16)&65535)<<16)|0,n=(65535&(n=5*(65535&(n=n<<13|n>>>19))+((5*(n>>>16)&65535)<<16)|0))+27492+(((n>>>16)+58964&65535)<<16)}switch(a=0,r){case 3:a^=(255&e.charCodeAt(t+2))<<16;case 2:a^=(255&e.charCodeAt(t+1))<<8;case 1:a^=255&e.charCodeAt(t),n^=0x1b873593*(65535&(a=(a=0xcc9e2d51*(65535&a)+((0xcc9e2d51*(a>>>16)&65535)<<16)|0)<<15|a>>>17))+((0x1b873593*(a>>>16)&65535)<<16)}return n^=e.length,n^=n>>>16,n=0x85ebca6b*(65535&n)+((0x85ebca6b*(n>>>16)&65535)<<16)|0,n^=n>>>13,((n=0xc2b2ae35*(65535&n)+((0xc2b2ae35*(n>>>16)&65535)<<16)|0)^n>>>16)>>>0}var M=Object.assign,I=Object.prototype.hasOwnProperty,T=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),R={},B={};function k(e){return!!I.call(B,e)||!I.call(R,e)&&(T.test(e)?B[e]=!0:(R[e]=!0,!1))}var P=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),D=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),L=/["'&<>]/;function F(e){if("boolean"==typeof e||"number"==typeof e||"bigint"==typeof e)return""+e;e=""+e;var t=L.exec(e);if(t){var r,i="",n=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}n!==r&&(i+=e.slice(n,r)),n=r+1,i+=t}e=n!==r?i+e.slice(n,r):i}return e}var N=/([A-Z])/g,U=/^ms-/,O=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Q(e){return O.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var z=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},V=H.d;H.d={f:V.f,r:V.r,D:function(e){var t=tK||null;if(t){var r,i,n=t.resumableState,a=t.renderState;"string"==typeof e&&e&&(n.dnsResources.hasOwnProperty(e)||(n.dnsResources[e]=null,(i=(n=a.headers)&&0<n.remainingCapacity)&&(r="<"+(""+e).replace(eq,eW)+">; rel=dns-prefetch",i=0<=(n.remainingCapacity-=r.length+2)),i?(a.resets.dns[e]=null,n.preconnects&&(n.preconnects+=", "),n.preconnects+=r):(ed(r=[],{href:e,rel:"dns-prefetch"}),a.preconnects.add(r))),rD(t))}else V.D(e)},C:function(e,t){var r=tK||null;if(r){var i=r.resumableState,n=r.renderState;if("string"==typeof e&&e){var a,s,o="use-credentials"===t?"credentials":"string"==typeof t?"anonymous":"default";i.connectResources[o].hasOwnProperty(e)||(i.connectResources[o][e]=null,(s=(i=n.headers)&&0<i.remainingCapacity)&&(s="<"+(""+e).replace(eq,eW)+">; rel=preconnect","string"==typeof t&&(s+='; crossorigin="'+(""+t).replace(eX,eY)+'"'),a=s,s=0<=(i.remainingCapacity-=a.length+2)),s?(n.resets.connect[o][e]=null,i.preconnects&&(i.preconnects+=", "),i.preconnects+=a):(ed(o=[],{rel:"preconnect",href:e,crossOrigin:t}),n.preconnects.add(o))),rD(r)}}else V.C(e,t)},L:function(e,t,r){var i=tK||null;if(i){var n=i.resumableState,a=i.renderState;if(t&&e){switch(t){case"image":if(r)var s,o=r.imageSrcSet,l=r.imageSizes,c=r.fetchPriority;var h=o?o+"\n"+(l||""):e;if(n.imageResources.hasOwnProperty(h))return;n.imageResources[h]=j,(n=a.headers)&&0<n.remainingCapacity&&"string"!=typeof o&&"high"===c&&(s=ej(e,t,r),0<=(n.remainingCapacity-=s.length+2))?(a.resets.image[h]=j,n.highImagePreloads&&(n.highImagePreloads+=", "),n.highImagePreloads+=s):(ed(n=[],M({rel:"preload",href:o?void 0:e,as:t},r)),"high"===c?a.highImagePreloads.add(n):(a.bulkPreloads.add(n),a.preloads.images.set(h,n)));break;case"style":if(n.styleResources.hasOwnProperty(e))return;ed(o=[],M({rel:"preload",href:e,as:t},r)),n.styleResources[e]=r&&("string"==typeof r.crossOrigin||"string"==typeof r.integrity)?[r.crossOrigin,r.integrity]:j,a.preloads.stylesheets.set(e,o),a.bulkPreloads.add(o);break;case"script":if(n.scriptResources.hasOwnProperty(e))return;o=[],a.preloads.scripts.set(e,o),a.bulkPreloads.add(o),ed(o,M({rel:"preload",href:e,as:t},r)),n.scriptResources[e]=r&&("string"==typeof r.crossOrigin||"string"==typeof r.integrity)?[r.crossOrigin,r.integrity]:j;break;default:if(n.unknownResources.hasOwnProperty(t)){if((o=n.unknownResources[t]).hasOwnProperty(e))return}else o={},n.unknownResources[t]=o;o[e]=j,(n=a.headers)&&0<n.remainingCapacity&&"font"===t&&(h=ej(e,t,r),0<=(n.remainingCapacity-=h.length+2))?(a.resets.font[e]=j,n.fontPreloads&&(n.fontPreloads+=", "),n.fontPreloads+=h):(ed(n=[],e=M({rel:"preload",href:e,as:t},r)),"font"===t)?a.fontPreloads.add(n):a.bulkPreloads.add(n)}rD(i)}}else V.L(e,t,r)},m:function(e,t){var r=tK||null;if(r){var i=r.resumableState,n=r.renderState;if(e){var a=t&&"string"==typeof t.as?t.as:"script";if("script"===a){if(i.moduleScriptResources.hasOwnProperty(e))return;a=[],i.moduleScriptResources[e]=t&&("string"==typeof t.crossOrigin||"string"==typeof t.integrity)?[t.crossOrigin,t.integrity]:j,n.preloads.moduleScripts.set(e,a)}else{if(i.moduleUnknownResources.hasOwnProperty(a)){var s=i.unknownResources[a];if(s.hasOwnProperty(e))return}else s={},i.moduleUnknownResources[a]=s;a=[],s[e]=j}ed(a,M({rel:"modulepreload",href:e},t)),n.bulkPreloads.add(a),rD(r)}}else V.m(e,t)},X:function(e,t){var r=tK||null;if(r){var i=r.resumableState,n=r.renderState;if(e){var a=i.scriptResources.hasOwnProperty(e)?i.scriptResources[e]:void 0;null!==a&&(i.scriptResources[e]=null,t=M({src:e,async:!0},t),a&&(2===a.length&&eV(t,a),e=n.preloads.scripts.get(e))&&(e.length=0),e=[],n.scripts.add(e),eA(e,t),rD(r))}}else V.X(e,t)},S:function(e,t,r){var i=tK||null;if(i){var n=i.resumableState,a=i.renderState;if(e){t=t||"default";var s=a.styles.get(t),o=n.styleResources.hasOwnProperty(e)?n.styleResources[e]:void 0;null!==o&&(n.styleResources[e]=null,s||(s={precedence:F(t),rules:[],hrefs:[],sheets:new Map},a.styles.set(t,s)),t={state:0,props:M({rel:"stylesheet",href:e,"data-precedence":t},r)},o&&(2===o.length&&eV(t.props,o),(a=a.preloads.stylesheets.get(e))&&0<a.length?a.length=0:t.state=1),s.sheets.set(e,t),rD(i))}}else V.S(e,t,r)},M:function(e,t){var r=tK||null;if(r){var i=r.resumableState,n=r.renderState;if(e){var a=i.moduleScriptResources.hasOwnProperty(e)?i.moduleScriptResources[e]:void 0;null!==a&&(i.moduleScriptResources[e]=null,t=M({src:e,type:"module",async:!0},t),a&&(2===a.length&&eV(t,a),e=n.preloads.moduleScripts.get(e))&&(e.length=0),e=[],n.scripts.add(e),eA(e,t),rD(r))}}else V.M(e,t)}};var j=[],q=null,W=/(<\/|<)(s)(cript)/gi;function X(e,t,r,i){return""+t+("s"===r?"\\u0073":"\\u0053")+i}function Y(e,t,r,i){return{insertionMode:e,selectedValue:t,tagScope:r,viewTransition:i}}function K(e,t,r){var i=-25&e.tagScope;switch(t){case"noscript":return Y(2,null,1|i,null);case"select":return Y(2,null!=r.value?r.value:r.defaultValue,i,null);case"svg":return Y(4,null,i,null);case"picture":return Y(2,null,2|i,null);case"math":return Y(5,null,i,null);case"foreignObject":return Y(2,null,i,null);case"table":return Y(6,null,i,null);case"thead":case"tbody":case"tfoot":return Y(7,null,i,null);case"colgroup":return Y(9,null,i,null);case"tr":return Y(8,null,i,null);case"head":if(2>e.insertionMode)return Y(3,null,i,null);break;case"html":if(0===e.insertionMode)return Y(1,null,i,null)}return 6<=e.insertionMode||2>e.insertionMode?Y(2,null,i,null):e.tagScope!==i?Y(e.insertionMode,e.selectedValue,i,null):e}function $(e){return null===e?null:{update:e.update,enter:"none",exit:"none",share:e.update,name:e.autoName,autoName:e.autoName,nameIdx:0}}function J(e,t){return 32&t.tagScope&&(e.instructions|=128),Y(t.insertionMode,t.selectedValue,12|t.tagScope,$(t.viewTransition))}function Z(e,t){e=$(t.viewTransition);var r=16|t.tagScope;return null!==e&&"none"!==e.share&&(r|=64),Y(t.insertionMode,t.selectedValue,r,e)}var ee=new Map;function et(e,t){if("object"!=typeof t)throw Error(a(62));var r,i=!0;for(r in t)if(I.call(t,r)){var n=t[r];if(null!=n&&"boolean"!=typeof n&&""!==n){if(0===r.indexOf("--")){var s=F(r);n=F((""+n).trim())}else void 0===(s=ee.get(r))&&(s=F(r.replace(N,"-$1").toLowerCase().replace(U,"-ms-")),ee.set(r,s)),n="number"==typeof n?0===n||P.has(r)?""+n:n+"px":F((""+n).trim());i?(i=!1,e.push(' style="',s,":",n)):e.push(";",s,":",n)}}i||e.push('"')}function er(e,t,r){r&&"function"!=typeof r&&"symbol"!=typeof r&&e.push(" ",t,'=""')}function ei(e,t,r){"function"!=typeof r&&"symbol"!=typeof r&&"boolean"!=typeof r&&e.push(" ",t,'="',F(r),'"')}var en=F("javascript:throw new Error('React form unexpectedly submitted.')");function ea(e,t){this.push('<input type="hidden"'),es(e),ei(this,"name",t),ei(this,"value",e),this.push("/>")}function es(e){if("string"!=typeof e)throw Error(a(480))}function eo(e,t){if("function"==typeof t.$$FORM_ACTION){var r=e.nextFormID++;e=e.idPrefix+r;try{var i=t.$$FORM_ACTION(e);if(i){var n=i.data;null!=n&&n.forEach(es)}return i}catch(e){if("object"==typeof e&&null!==e&&"function"==typeof e.then)throw e}}return null}function el(e,t,r,i,n,a,s,o){var l=null;if("function"==typeof i){var c=eo(t,i);null!==c?(o=c.name,i=c.action||"",n=c.encType,a=c.method,s=c.target,l=c.data):(e.push(" ","formAction",'="',en,'"'),s=a=n=i=o=null,eu(t,r))}return null!=o&&ec(e,"name",o),null!=i&&ec(e,"formAction",i),null!=n&&ec(e,"formEncType",n),null!=a&&ec(e,"formMethod",a),null!=s&&ec(e,"formTarget",s),l}function ec(e,t,r){switch(t){case"className":ei(e,"class",r);break;case"tabIndex":ei(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ei(e,t,r);break;case"style":et(e,r);break;case"src":case"href":if(""===r)break;case"action":case"formAction":if(null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r)break;r=Q(""+r),e.push(" ",t,'="',F(r),'"');break;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"autoFocus":case"multiple":case"muted":er(e,t.toLowerCase(),r);break;case"xlinkHref":if("function"==typeof r||"symbol"==typeof r||"boolean"==typeof r)break;r=Q(""+r),e.push(" ","xlink:href",'="',F(r),'"');break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":"function"!=typeof r&&"symbol"!=typeof r&&e.push(" ",t,'="',F(r),'"');break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!=typeof r&&"symbol"!=typeof r&&e.push(" ",t,'=""');break;case"capture":case"download":!0===r?e.push(" ",t,'=""'):!1!==r&&"function"!=typeof r&&"symbol"!=typeof r&&e.push(" ",t,'="',F(r),'"');break;case"cols":case"rows":case"size":case"span":"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r&&e.push(" ",t,'="',F(r),'"');break;case"rowSpan":case"start":"function"==typeof r||"symbol"==typeof r||isNaN(r)||e.push(" ",t,'="',F(r),'"');break;case"xlinkActuate":ei(e,"xlink:actuate",r);break;case"xlinkArcrole":ei(e,"xlink:arcrole",r);break;case"xlinkRole":ei(e,"xlink:role",r);break;case"xlinkShow":ei(e,"xlink:show",r);break;case"xlinkTitle":ei(e,"xlink:title",r);break;case"xlinkType":ei(e,"xlink:type",r);break;case"xmlBase":ei(e,"xml:base",r);break;case"xmlLang":ei(e,"xml:lang",r);break;case"xmlSpace":ei(e,"xml:space",r);break;default:if((!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&k(t=D.get(t)||t)){switch(typeof r){case"function":case"symbol":return;case"boolean":var i=t.toLowerCase().slice(0,5);if("data-"!==i&&"aria-"!==i)return}e.push(" ",t,'="',F(r),'"')}}}function eh(e,t,r){if(null!=t){if(null!=r)throw Error(a(60));if("object"!=typeof t||!("__html"in t))throw Error(a(61));null!=(t=t.__html)&&e.push(""+t)}}function eu(e,t){if(0==(16&e.instructions)){e.instructions|=16;var r=t.preamble,i=t.bootstrapChunks;(r.htmlChunks||r.headChunks)&&0===i.length?(i.push(t.startInlineScript),eH(i,e),i.push(">",'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});',"<\/script>")):i.unshift(t.startInlineScript,">",'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});',"<\/script>")}}function ed(e,t){for(var r in e.push(eS("link")),t)if(I.call(t,r)){var i=t[r];if(null!=i)switch(r){case"children":case"dangerouslySetInnerHTML":throw Error(a(399,"link"));default:ec(e,r,i)}}return e.push("/>"),null}var ep=/(<\/|<)(s)(tyle)/gi;function ef(e,t,r,i){return""+t+("s"===r?"\\73 ":"\\53 ")+i}function eg(e,t,r){for(var i in e.push(eS(r)),t)if(I.call(t,i)){var n=t[i];if(null!=n)switch(i){case"children":case"dangerouslySetInnerHTML":throw Error(a(399,r));default:ec(e,i,n)}}return e.push("/>"),null}function em(e,t){e.push(eS("title"));var r,i=null,n=null;for(r in t)if(I.call(t,r)){var a=t[r];if(null!=a)switch(r){case"children":i=a;break;case"dangerouslySetInnerHTML":n=a;break;default:ec(e,r,a)}}return e.push(">"),"function"!=typeof(t=Array.isArray(i)?2>i.length?i[0]:null:i)&&"symbol"!=typeof t&&null!=t&&e.push(F(""+t)),eh(e,n,i),e.push(ew("title")),null}function eA(e,t){e.push(eS("script"));var r,i=null,n=null;for(r in t)if(I.call(t,r)){var a=t[r];if(null!=a)switch(r){case"children":i=a;break;case"dangerouslySetInnerHTML":n=a;break;default:ec(e,r,a)}}return e.push(">"),eh(e,n,i),"string"==typeof i&&e.push((""+i).replace(W,X)),e.push(ew("script")),null}function eb(e,t,r){e.push(eS(r));var i,n=r=null;for(i in t)if(I.call(t,i)){var a=t[i];if(null!=a)switch(i){case"children":r=a;break;case"dangerouslySetInnerHTML":n=a;break;default:ec(e,i,a)}}return e.push(">"),eh(e,n,r),r}function ev(e,t,r){e.push(eS(r));var i,n=r=null;for(i in t)if(I.call(t,i)){var a=t[i];if(null!=a)switch(i){case"children":r=a;break;case"dangerouslySetInnerHTML":n=a;break;default:ec(e,i,a)}}return e.push(">"),eh(e,n,r),"string"==typeof r?(e.push(F(r)),null):r}var ey=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ex=new Map;function eS(e){var t=ex.get(e);if(void 0===t){if(!ey.test(e))throw Error(a(65,e));t="<"+e,ex.set(e,t)}return t}var eE=new Map;function ew(e){var t=eE.get(e);return void 0===t&&(t="</"+e+">",eE.set(e,t)),t}function e_(e,t){null===(e=e.preamble).htmlChunks&&t.htmlChunks&&(e.htmlChunks=t.htmlChunks),null===e.headChunks&&t.headChunks&&(e.headChunks=t.headChunks),null===e.bodyChunks&&t.bodyChunks&&(e.bodyChunks=t.bodyChunks)}function eC(e,t){t=t.bootstrapChunks;for(var r=0;r<t.length-1;r++)e.push(t[r]);return!(r<t.length)||(r=t[r],t.length=0,e.push(r))}function eM(e,t,r){if(e.push('\x3c!--$?--\x3e<template id="'),null===r)throw Error(a(395));return e.push(t.boundaryPrefix),t=r.toString(16),e.push(t),e.push('"></template>')}var eI=/[<\u2028\u2029]/g,eT=/[&><\u2028\u2029]/g;function eR(e){return JSON.stringify(e).replace(eT,function(e){switch(e){case"&":return"\\u0026";case">":return"\\u003e";case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var eB=!1,ek=!0;function eP(e){var t=e.rules,r=e.hrefs,i=0;if(r.length){for(this.push(q.startInlineStyle),this.push(' media="not all" data-precedence="'),this.push(e.precedence),this.push('" data-href="');i<r.length-1;i++)this.push(r[i]),this.push(" ");for(this.push(r[i]),this.push('">'),i=0;i<t.length;i++)this.push(t[i]);ek=this.push("</style>"),eB=!0,t.length=0,r.length=0}}function eD(e){return 2!==e.state&&(eB=!0)}function eL(e,t,r){return eB=!1,ek=!0,q=r,t.styles.forEach(eP,e),q=null,t.stylesheets.forEach(eD),eB&&(r.stylesToHoist=!0),ek}function eF(e){for(var t=0;t<e.length;t++)this.push(e[t]);e.length=0}var eN=[];function eU(e){ed(eN,e.props);for(var t=0;t<eN.length;t++)this.push(eN[t]);eN.length=0,e.state=2}function eO(e){var t=0<e.sheets.size;e.sheets.forEach(eU,this),e.sheets.clear();var r=e.rules,i=e.hrefs;if(!t||i.length){if(this.push(q.startInlineStyle),this.push(' data-precedence="'),this.push(e.precedence),e=0,i.length){for(this.push('" data-href="');e<i.length-1;e++)this.push(i[e]),this.push(" ");this.push(i[e])}for(this.push('">'),e=0;e<r.length;e++)this.push(r[e]);this.push("</style>"),r.length=0,i.length=0}}function eQ(e){if(0===e.state){e.state=1;var t=e.props;for(ed(eN,{rel:"preload",as:"style",href:e.props.href,crossOrigin:t.crossOrigin,fetchPriority:t.fetchPriority,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy}),e=0;e<eN.length;e++)this.push(eN[e]);eN.length=0}}function ez(e){e.sheets.forEach(eQ,this),e.sheets.clear()}function eH(e,t){0==(32&t.instructions)&&(t.instructions|=32,e.push(' id="',F("_"+t.idPrefix+"R_"),'"'))}function eG(){return{styles:new Set,stylesheets:new Set,suspenseyImages:!1}}function eV(e,t){null==e.crossOrigin&&(e.crossOrigin=t[0]),null==e.integrity&&(e.integrity=t[1])}function ej(e,t,r){for(var i in t="<"+(e=(""+e).replace(eq,eW))+'>; rel=preload; as="'+(t=(""+t).replace(eX,eY))+'"',r)I.call(r,i)&&"string"==typeof(e=r[i])&&(t+="; "+i.toLowerCase()+'="'+(""+e).replace(eX,eY)+'"');return t}var eq=/[<>\r\n]/g;function eW(e){switch(e){case"<":return"%3C";case">":return"%3E";case"\n":return"%0A";case"\r":return"%0D";default:throw Error("escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}var eX=/["';,\r\n]/g;function eY(e){switch(e){case'"':return"%22";case"'":return"%27";case";":return"%3B";case",":return"%2C";case"\n":return"%0A";case"\r":return"%0D";default:throw Error("escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}function eK(e){this.styles.add(e)}function e$(e){this.stylesheets.add(e)}function eJ(e,t){t.styles.forEach(eK,e),t.stylesheets.forEach(e$,e),t.suspenseyImages&&(e.suspenseyImages=!0)}function eZ(e,t,r,i){return r.generateStaticMarkup?(e.push(F(t)),!1):(""===t?e=i:(i&&e.push("\x3c!-- --\x3e"),e.push(F(t)),e=!0),e)}function e0(e,t,r,i){t.generateStaticMarkup||r&&i&&e.push("\x3c!-- --\x3e")}var e1=Function.prototype.bind,e2=Symbol.for("react.client.reference");function e3(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===e2?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case l:return"Fragment";case h:return"Profiler";case c:return"StrictMode";case f:return"Suspense";case g:return"SuspenseList";case v:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case o:return"Portal";case d:return e.displayName||"Context";case u:return(e._context.displayName||"Context")+".Consumer";case p:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case m:return null!==(t=e.displayName||null)?t:e3(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return e3(e(t))}catch(e){}}return null}var e5={},e4=null;function e8(e,t){if(e!==t){e.context._currentValue2=e.parentValue,e=e.parent;var r=t.parent;if(null===e){if(null!==r)throw Error(a(401))}else{if(null===r)throw Error(a(401));e8(e,r)}t.context._currentValue2=t.value}}function e9(e){var t=e4;t!==e&&(null===t?function e(t){var r=t.parent;null!==r&&e(r),t.context._currentValue2=t.value}(e):null===e?function e(t){t.context._currentValue2=t.parentValue,null!==(t=t.parent)&&e(t)}(t):t.depth===e.depth?e8(t,e):t.depth>e.depth?function e(t,r){if(t.context._currentValue2=t.parentValue,null===(t=t.parent))throw Error(a(402));t.depth===r.depth?e8(t,r):e(t,r)}(t,e):function e(t,r){var i=r.parent;if(null===i)throw Error(a(402));t.depth===i.depth?e8(t,i):e(t,i),r.context._currentValue2=r.value}(t,e),e4=e)}var e6={enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}},e7={id:1,overflow:""};function te(e,t,r){var i=e.id;e=e.overflow;var n=32-tt(i)-1;i&=~(1<<n),r+=1;var a=32-tt(t)+n;if(30<a){var s=n-n%5;return a=(i&(1<<s)-1).toString(32),i>>=s,n-=s,{id:1<<32-tt(t)+n|r<<n|i,overflow:a+e}}return{id:1<<a|r<<n|i,overflow:e}}var tt=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(tr(e)/ti|0)|0},tr=Math.log,ti=Math.LN2;function tn(){}var ta=Error(a(460)),ts=null;function to(){if(null===ts)throw Error(a(459));var e=ts;return ts=null,e}var tl="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},tc=null,th=null,tu=null,td=null,tp=null,tf=null,tg=!1,tm=!1,tA=0,tb=0,tv=-1,ty=0,tx=null,tS=null,tE=0;function tw(){if(null===tc)throw Error(a(321));return tc}function t_(){if(0<tE)throw Error(a(312));return{memoizedState:null,queue:null,next:null}}function tC(){return null===tf?null===tp?(tg=!1,tp=tf=t_()):(tg=!0,tf=tp):null===tf.next?(tg=!1,tf=tf.next=t_()):(tg=!0,tf=tf.next),tf}function tM(){var e=tx;return tx=null,e}function tI(){td=tu=th=tc=null,tm=!1,tp=null,tE=0,tf=tS=null}function tT(e,t){return"function"==typeof t?t(e):t}function tR(e,t,r){if(tc=tw(),tf=tC(),tg){var i=tf.queue;if(t=i.dispatch,null!==tS&&void 0!==(r=tS.get(i))){tS.delete(i),i=tf.memoizedState;do i=e(i,r.action),r=r.next;while(null!==r);return tf.memoizedState=i,[i,t]}return[tf.memoizedState,t]}return e=e===tT?"function"==typeof t?t():t:void 0!==r?r(t):t,tf.memoizedState=e,e=(e=tf.queue={last:null,dispatch:null}).dispatch=tk.bind(null,tc,e),[tf.memoizedState,e]}function tB(e,t){if(tc=tw(),tf=tC(),t=void 0===t?null:t,null!==tf){var r=tf.memoizedState;if(null!==r&&null!==t){var i=r[1];e:if(null===i)i=!1;else{for(var n=0;n<i.length&&n<t.length;n++)if(!tl(t[n],i[n])){i=!1;break e}i=!0}if(i)return r[0]}}return e=e(),tf.memoizedState=[e,t],e}function tk(e,t,r){if(25<=tE)throw Error(a(301));if(e===tc)if(tm=!0,e={action:r,next:null},null===tS&&(tS=new Map),void 0===(r=tS.get(t)))tS.set(t,e);else{for(t=r;null!==t.next;)t=t.next;t.next=e}}function tP(){throw Error(a(440))}function tD(){throw Error(a(394))}function tL(){throw Error(a(479))}function tF(e,t,r){tw();var i=tb++,n=tu;if("function"==typeof e.$$FORM_ACTION){var a=null,s=td;n=n.formState;var o=e.$$IS_SIGNATURE_EQUAL;if(null!==n&&"function"==typeof o){var l=n[1];o.call(e,n[2],n[3])&&l===(a=void 0!==r?"p"+r:"k"+C(JSON.stringify([s,null,i]),0))&&(tv=i,t=n[0])}var c=e.bind(null,t);return e=function(e){c(e)},"function"==typeof c.$$FORM_ACTION&&(e.$$FORM_ACTION=function(e){e=c.$$FORM_ACTION(e),void 0!==r&&(r+="",e.action=r);var t=e.data;return t&&(null===a&&(a=void 0!==r?"p"+r:"k"+C(JSON.stringify([s,null,i]),0)),t.append("$ACTION_KEY",a)),e}),[t,e,!1]}var h=e.bind(null,t);return[t,function(e){h(e)},!1]}function tN(e){var t=ty;ty+=1,null===tx&&(tx=[]);var r=tx,i=e,n=t;switch(void 0===(n=r[n])?r.push(i):n!==i&&(i.then(tn,tn),i=n),i.status){case"fulfilled":return i.value;case"rejected":throw i.reason;default:switch("string"==typeof i.status?i.then(tn,tn):((r=i).status="pending",r.then(function(e){if("pending"===i.status){var t=i;t.status="fulfilled",t.value=e}},function(e){if("pending"===i.status){var t=i;t.status="rejected",t.reason=e}})),i.status){case"fulfilled":return i.value;case"rejected":throw i.reason}throw ts=i,ta}}function tU(){throw Error(a(393))}var tO,tQ,tz={readContext:function(e){return e._currentValue2},use:function(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return tN(e);if(e.$$typeof===d)return e._currentValue2}throw Error(a(438,String(e)))},useContext:function(e){return tw(),e._currentValue2},useMemo:tB,useReducer:tR,useRef:function(e){tc=tw();var t=(tf=tC()).memoizedState;return null===t?(e={current:e},tf.memoizedState=e):t},useState:function(e){return tR(tT,e)},useInsertionEffect:tn,useLayoutEffect:tn,useCallback:function(e,t){return tB(function(){return e},t)},useImperativeHandle:tn,useEffect:tn,useDebugValue:tn,useDeferredValue:function(e,t){return tw(),void 0!==t?t:e},useTransition:function(){return tw(),[!1,tD]},useId:function(){var e=th.treeContext,t=e.overflow;e=((e=e.id)&~(1<<32-tt(e)-1)).toString(32)+t;var r=tH;if(null===r)throw Error(a(404));return t=tA++,e="_"+r.idPrefix+"R_"+e,0<t&&(e+="H"+t.toString(32)),e+"_"},useSyncExternalStore:function(e,t,r){if(void 0===r)throw Error(a(407));return r()},useOptimistic:function(e){return tw(),[e,tL]},useActionState:tF,useFormState:tF,useHostTransitionStatus:function(){return tw(),G},useMemoCache:function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=x;return t},useCacheRefresh:function(){return tU},useEffectEvent:function(){return tP}},tH=null,tG={getCacheForType:function(){throw Error(a(248))},cacheSignal:function(){throw Error(a(248))}};function tV(e){if(void 0===tO)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);tO=t&&t[1]||"",tQ=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+tO+e+tQ}var tj=!1;function tq(e,t){if(!e||tj)return"";tj=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var r=function(){throw Error()};if(Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(r,[])}catch(e){var i=e}Reflect.construct(e,[],r)}else{try{r.call()}catch(e){i=e}e.call(r.prototype)}}else{try{throw Error()}catch(e){i=e}(r=e())&&"function"==typeof r.catch&&r.catch(function(){})}}catch(e){if(e&&i&&"string"==typeof e.stack)return[e.stack,i.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),s=a[0],o=a[1];if(s&&o){var l=s.split("\n"),c=o.split("\n");for(n=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;n<c.length&&!c[n].includes("DetermineComponentFrameRoot");)n++;if(i===l.length||n===c.length)for(i=l.length-1,n=c.length-1;1<=i&&0<=n&&l[i]!==c[n];)n--;for(;1<=i&&0<=n;i--,n--)if(l[i]!==c[n]){if(1!==i||1!==n)do if(i--,n--,0>n||l[i]!==c[n]){var h="\n"+l[i].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=i&&0<=n);break}}}finally{tj=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?tV(r):""}function tW(e,t){return 500<t.byteSize&&null===t.contentPreamble}function tX(e){if("object"==typeof e&&null!==e&&"string"==typeof e.environmentName){var t=e.environmentName;"string"==typeof(e=[e])[0]?e.splice(0,1,"[%s] "+e[0]," "+t+" "):e.splice(0,0,"[%s]"," "+t+" "),e.unshift(console),(t=e1.apply(console.error,e))()}else console.error(e);return null}function tY(e,t,r,i,n,a,s,o,l,c,h){var u=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=e,this.renderState=t,this.rootFormatContext=r,this.progressiveChunkSize=void 0===i?12800:i,this.status=10,this.fatalError=null,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedPreambleSegments=this.completedRootSegment=null,this.byteSize=0,this.abortableTasks=u,this.pingedTasks=[],this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.trackedPostpones=null,this.onError=void 0===n?tX:n,this.onPostpone=void 0===c?tn:c,this.onAllReady=void 0===a?tn:a,this.onShellReady=void 0===s?tn:s,this.onShellError=void 0===o?tn:o,this.onFatalError=void 0===l?tn:l,this.formState=void 0===h?null:h}var tK=null;function t$(e,t){e.pingedTasks.push(t),1===e.pingedTasks.length&&(e.flushScheduled=null!==e.destination,rS(e))}function tJ(e,t,r,i,n){return r={status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,row:t,completedSegments:[],byteSize:0,fallbackAbortableTasks:r,errorDigest:null,contentState:eG(),fallbackState:eG(),contentPreamble:i,fallbackPreamble:n,trackedContentKeyPath:null,trackedFallbackNode:null},null!==t&&(t.pendingTasks++,null!==(i=t.boundaries)&&(e.allPendingTasks++,r.pendingTasks++,i.push(r)),null!==(e=t.inheritedHoistables)&&eJ(r.contentState,e)),r}function tZ(e,t,r,i,n,a,s,o,l,c,h,u,d,p,f){e.allPendingTasks++,null===n?e.pendingRootTasks++:n.pendingTasks++,null!==p&&p.pendingTasks++;var g={replay:null,node:r,childIndex:i,ping:function(){return t$(e,g)},blockedBoundary:n,blockedSegment:a,blockedPreamble:s,hoistableState:o,abortSet:l,keyPath:c,formatContext:h,context:u,treeContext:d,row:p,componentStack:f,thenableState:t};return l.add(g),g}function t0(e,t,r,i,n,a,s,o,l,c,h,u,d,p){e.allPendingTasks++,null===a?e.pendingRootTasks++:a.pendingTasks++,null!==d&&d.pendingTasks++,r.pendingTasks++;var f={replay:r,node:i,childIndex:n,ping:function(){return t$(e,f)},blockedBoundary:a,blockedSegment:null,blockedPreamble:null,hoistableState:s,abortSet:o,keyPath:l,formatContext:c,context:h,treeContext:u,row:d,componentStack:p,thenableState:t};return o.add(f),f}function t1(e,t,r,i,n,a){return{status:0,parentFlushed:!1,id:-1,index:t,chunks:[],children:[],preambleChildren:[],parentFormatContext:i,boundary:r,lastPushedText:n,textEmbedded:a}}function t2(e){var t=e.node;"object"==typeof t&&null!==t&&t.$$typeof===s&&(e.componentStack={parent:e.componentStack,type:t.type})}function t3(e){return null===e?null:{parent:e.parent,type:"Suspense Fallback"}}function t5(e){var t={};return e&&Object.defineProperty(t,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var r="",i=e;do r+=function e(t){if("string"==typeof t)return tV(t);if("function"==typeof t)return t.prototype&&t.prototype.isReactComponent?tq(t,!0):tq(t,!1);if("object"==typeof t&&null!==t){switch(t.$$typeof){case p:return tq(t.render,!1);case m:return tq(t.type,!1);case A:var r=t,i=r._payload;r=r._init;try{t=r(i)}catch(e){return tV("Lazy")}return e(t)}if("string"==typeof t.name){e:{i=t.name,r=t.env;var n=t.debugLocation;if(null!=n&&(t=Error.prepareStackTrace,Error.prepareStackTrace=void 0,n=n.stack,Error.prepareStackTrace=t,n.startsWith("Error: react-stack-top-frame\n")&&(n=n.slice(29)),-1!==(t=n.indexOf("\n"))&&(n=n.slice(t+1)),-1!==(t=n.indexOf("react_stack_bottom_frame"))&&(t=n.lastIndexOf("\n",t)),-1!==(t=-1===(n=(t=-1!==t?n=n.slice(0,t):"").lastIndexOf("\n"))?t:t.slice(n+1)).indexOf(i))){i="\n"+t;break e}i=tV(i+(r?" ["+r+"]":""))}return i}}switch(t){case g:return tV("SuspenseList");case f:return tV("Suspense")}return""}(i.type),i=i.parent;while(i);var n=r}catch(e){n="\nError generating stack: "+e.message+"\n"+e.stack}return Object.defineProperty(t,"componentStack",{value:n}),n}}),t}function t4(e,t,r){if(null==(t=(e=e.onError)(t,r))||"string"==typeof t)return t}function t8(e,t){var r=e.onShellError,i=e.onFatalError;r(t),i(t),null!==e.destination?(e.status=14,e.destination.destroy(t)):(e.status=13,e.fatalError=t)}function t9(e,t){t6(e,t.next,t.hoistables)}function t6(e,t,r){for(;null!==t;){null!==r&&(eJ(t.hoistables,r),t.inheritedHoistables=r);var i=t.boundaries;if(null!==i){t.boundaries=null;for(var n=0;n<i.length;n++){var a=i[n];null!==r&&eJ(a.contentState,r),rx(e,a,null,null)}}if(t.pendingTasks--,0<t.pendingTasks)break;r=t.hoistables,t=t.next}}function t7(e,t){var r=t.boundaries;if(null!==r&&t.pendingTasks===r.length){for(var i=!0,n=0;n<r.length;n++){var a=r[n];if(1!==a.pendingTasks||a.parentFlushed||tW(e,a)){i=!1;break}}i&&t6(e,t,t.hoistables)}}function re(e){var t={pendingTasks:1,boundaries:null,hoistables:eG(),inheritedHoistables:null,together:!1,next:null};return null!==e&&0<e.pendingTasks&&(t.pendingTasks++,t.boundaries=[],e.next=t),t}function rt(e,t,r,i,n){var a=t.keyPath,s=t.treeContext,o=t.row;t.keyPath=r,r=i.length;var l=null;if(null!==t.replay){var c=t.replay.slots;if(null!==c&&"object"==typeof c)for(var h=0;h<r;h++){var u="backwards"!==n&&"unstable_legacy-backwards"!==n?h:r-1-h,d=i[u];t.row=l=re(l),t.treeContext=te(s,r,u);var p=c[u];"number"==typeof p?(ra(e,t,p,d,u),delete c[u]):rf(e,t,d,u),0==--l.pendingTasks&&t9(e,l)}else for(c=0;c<r;c++)u=i[h="backwards"!==n&&"unstable_legacy-backwards"!==n?c:r-1-c],t.row=l=re(l),t.treeContext=te(s,r,h),rf(e,t,u,h),0==--l.pendingTasks&&t9(e,l)}else if("backwards"!==n&&"unstable_legacy-backwards"!==n)for(n=0;n<r;n++)c=i[n],t.row=l=re(l),t.treeContext=te(s,r,n),rf(e,t,c,n),0==--l.pendingTasks&&t9(e,l);else{for(c=(n=t.blockedSegment).children.length,h=n.chunks.length,u=r-1;0<=u;u--){d=i[u],t.row=l=re(l),t.treeContext=te(s,r,u),p=t1(e,h,null,t.formatContext,0!==u||n.lastPushedText,!0),n.children.splice(c,0,p),t.blockedSegment=p;try{rf(e,t,d,u),e0(p.chunks,e.renderState,p.lastPushedText,p.textEmbedded),p.status=1,0==--l.pendingTasks&&t9(e,l)}catch(t){throw p.status=12===e.status?3:4,t}}t.blockedSegment=n,n.lastPushedText=!1}null!==o&&null!==l&&0<l.pendingTasks&&(o.pendingTasks++,l.next=o),t.treeContext=s,t.row=o,t.keyPath=a}function rr(e,t,r,i,n,a){var s=t.thenableState;for(t.thenableState=null,tc={},th=t,tu=e,td=r,tb=tA=0,tv=-1,ty=0,tx=s,e=i(n,a);tm;)tm=!1,tb=tA=0,tv=-1,ty=0,tE+=1,tf=null,e=i(n,a);return tI(),e}function ri(e,t,r,i,n,a,s){var o=!1;if(0!==a&&null!==e.formState){var l=t.blockedSegment;if(null!==l){o=!0,l=l.chunks;for(var c=0;c<a;c++)c===s?l.push("\x3c!--F!--\x3e"):l.push("\x3c!--F--\x3e")}}a=t.keyPath,t.keyPath=r,n?(r=t.treeContext,t.treeContext=te(r,1,0),rf(e,t,i,-1),t.treeContext=r):o?rf(e,t,i,-1):rs(e,t,i,-1),t.keyPath=a}function rn(e,t,r,n,s,o){if("function"==typeof n)if(n.prototype&&n.prototype.isReactComponent){var x=s;if("ref"in s)for(var E in x={},s)"ref"!==E&&(x[E]=s[E]);var C=n.defaultProps;if(C)for(var T in x===s&&(x=M({},x,s)),C)void 0===x[T]&&(x[T]=C[T]);s=x,x=e5,"object"==typeof(C=n.contextType)&&null!==C&&(x=C._currentValue2);var R=void 0!==(x=new n(s,x)).state?x.state:null;if(x.updater=e6,x.props=s,x.state=R,C={queue:[],replace:!1},x._reactInternals=C,o=n.contextType,x.context="object"==typeof o&&null!==o?o._currentValue2:e5,"function"==typeof(o=n.getDerivedStateFromProps)&&(R=null==(o=o(s,R))?R:M({},R,o),x.state=R),"function"!=typeof n.getDerivedStateFromProps&&"function"!=typeof x.getSnapshotBeforeUpdate&&("function"==typeof x.UNSAFE_componentWillMount||"function"==typeof x.componentWillMount))if(n=x.state,"function"==typeof x.componentWillMount&&x.componentWillMount(),"function"==typeof x.UNSAFE_componentWillMount&&x.UNSAFE_componentWillMount(),n!==x.state&&e6.enqueueReplaceState(x,x.state,null),null!==C.queue&&0<C.queue.length)if(n=C.queue,o=C.replace,C.queue=null,C.replace=!1,o&&1===n.length)x.state=n[0];else{for(C=o?n[0]:x.state,R=!0,o=+!!o;o<n.length;o++)null!=(T="function"==typeof(T=n[o])?T.call(x,C,s,void 0):T)&&(R?(R=!1,C=M({},C,T)):M(C,T));x.state=C}else C.queue=null;if(n=x.render(),12===e.status)throw null;s=t.keyPath,t.keyPath=r,rs(e,t,n,-1),t.keyPath=s}else{if(n=rr(e,t,r,n,s,void 0),12===e.status)throw null;ri(e,t,r,n,0!==tA,tb,tv)}else if("string"==typeof n)if(null===(x=t.blockedSegment))x=s.children,C=t.formatContext,R=t.keyPath,t.formatContext=K(C,n,s),t.keyPath=r,rf(e,t,x,-1),t.formatContext=C,t.keyPath=R;else{if(R=function(e,t,r,n,s,o,l,c,h){switch(t){case"div":case"span":case"svg":case"path":case"g":case"p":case"li":case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":break;case"a":e.push(eS("a"));var u,d=null,p=null;for(u in r)if(I.call(r,u)){var f=r[u];if(null!=f)switch(u){case"children":d=f;break;case"dangerouslySetInnerHTML":p=f;break;case"href":""===f?ei(e,"href",""):ec(e,u,f);break;default:ec(e,u,f)}}if(e.push(">"),eh(e,p,d),"string"==typeof d){e.push(F(d));var g=null}else g=d;return g;case"select":e.push(eS("select"));var m,A=null,b=null;for(m in r)if(I.call(r,m)){var v=r[m];if(null!=v)switch(m){case"children":A=v;break;case"dangerouslySetInnerHTML":b=v;break;case"defaultValue":case"value":break;default:ec(e,m,v)}}return e.push(">"),eh(e,b,A),A;case"option":var y=c.selectedValue;e.push(eS("option"));var x,S=null,E=null,w=null,C=null;for(x in r)if(I.call(r,x)){var T=r[x];if(null!=T)switch(x){case"children":S=T;break;case"selected":w=T;break;case"dangerouslySetInnerHTML":C=T;break;case"value":E=T;default:ec(e,x,T)}}if(null!=y){var R,B,P=null!==E?""+E:(R=S,B="",i.Children.forEach(R,function(e){null!=e&&(B+=e)}),B);if(_(y)){for(var D=0;D<y.length;D++)if(""+y[D]===P){e.push(' selected=""');break}}else""+y===P&&e.push(' selected=""')}else w&&e.push(' selected=""');return e.push(">"),eh(e,C,S),S;case"textarea":e.push(eS("textarea"));var L,N=null,U=null,O=null;for(L in r)if(I.call(r,L)){var z=r[L];if(null!=z)switch(L){case"children":O=z;break;case"value":N=z;break;case"defaultValue":U=z;break;case"dangerouslySetInnerHTML":throw Error(a(91));default:ec(e,L,z)}}if(null===N&&null!==U&&(N=U),e.push(">"),null!=O){if(null!=N)throw Error(a(92));if(_(O)){if(1<O.length)throw Error(a(93));N=""+O[0]}N=""+O}return"string"==typeof N&&"\n"===N[0]&&e.push("\n"),null!==N&&e.push(F(""+N)),null;case"input":e.push(eS("input"));var H,G=null,V=null,q=null,W=null,X=null,Y=null,K=null,$=null,J=null;for(H in r)if(I.call(r,H)){var Z=r[H];if(null!=Z)switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(a(399,"input"));case"name":G=Z;break;case"formAction":V=Z;break;case"formEncType":q=Z;break;case"formMethod":W=Z;break;case"formTarget":X=Z;break;case"defaultChecked":J=Z;break;case"defaultValue":K=Z;break;case"checked":$=Z;break;case"value":Y=Z;break;default:ec(e,H,Z)}}var ee=el(e,n,s,V,q,W,X,G);return null!==$?er(e,"checked",$):null!==J&&er(e,"checked",J),null!==Y?ec(e,"value",Y):null!==K&&ec(e,"value",K),e.push("/>"),null!=ee&&ee.forEach(ea,e),null;case"button":e.push(eS("button"));var es,ey=null,ex=null,eE=null,e_=null,eC=null,eM=null,eI=null;for(es in r)if(I.call(r,es)){var eT=r[es];if(null!=eT)switch(es){case"children":ey=eT;break;case"dangerouslySetInnerHTML":ex=eT;break;case"name":eE=eT;break;case"formAction":e_=eT;break;case"formEncType":eC=eT;break;case"formMethod":eM=eT;break;case"formTarget":eI=eT;break;default:ec(e,es,eT)}}var eR=el(e,n,s,e_,eC,eM,eI,eE);if(e.push(">"),null!=eR&&eR.forEach(ea,e),eh(e,ex,ey),"string"==typeof ey){e.push(F(ey));var eB=null}else eB=ey;return eB;case"form":e.push(eS("form"));var ek,eP=null,eD=null,eL=null,eF=null,eN=null,eU=null;for(ek in r)if(I.call(r,ek)){var eO=r[ek];if(null!=eO)switch(ek){case"children":eP=eO;break;case"dangerouslySetInnerHTML":eD=eO;break;case"action":eL=eO;break;case"encType":eF=eO;break;case"method":eN=eO;break;case"target":eU=eO;break;default:ec(e,ek,eO)}}var eQ=null,ez=null;if("function"==typeof eL){var eH=eo(n,eL);null!==eH?(eL=eH.action||"",eF=eH.encType,eN=eH.method,eU=eH.target,eQ=eH.data,ez=eH.name):(e.push(" ","action",'="',en,'"'),eU=eN=eF=eL=null,eu(n,s))}if(null!=eL&&ec(e,"action",eL),null!=eF&&ec(e,"encType",eF),null!=eN&&ec(e,"method",eN),null!=eU&&ec(e,"target",eU),e.push(">"),null!==ez&&(e.push('<input type="hidden"'),ei(e,"name",ez),e.push("/>"),null!=eQ&&eQ.forEach(ea,e)),eh(e,eD,eP),"string"==typeof eP){e.push(F(eP));var eG=null}else eG=eP;return eG;case"menuitem":for(var eq in e.push(eS("menuitem")),r)if(I.call(r,eq)){var eW=r[eq];if(null!=eW)switch(eq){case"children":case"dangerouslySetInnerHTML":throw Error(a(400));default:ec(e,eq,eW)}}return e.push(">"),null;case"object":e.push(eS("object"));var eX,eY=null,eK=null;for(eX in r)if(I.call(r,eX)){var e$=r[eX];if(null!=e$)switch(eX){case"children":eY=e$;break;case"dangerouslySetInnerHTML":eK=e$;break;case"data":var eJ=Q(""+e$);if(""===eJ)break;e.push(" ","data",'="',F(eJ),'"');break;default:ec(e,eX,e$)}}if(e.push(">"),eh(e,eK,eY),"string"==typeof eY){e.push(F(eY));var eZ=null}else eZ=eY;return eZ;case"title":var e0=1&c.tagScope,e1=4&c.tagScope;if(4===c.insertionMode||e0||null!=r.itemProp)var e2=em(e,r);else e1?e2=null:(em(s.hoistableChunks,r),e2=void 0);return e2;case"link":var e3=1&c.tagScope,e5=4&c.tagScope,e4=r.rel,e8=r.href,e9=r.precedence;if(4===c.insertionMode||e3||null!=r.itemProp||"string"!=typeof e4||"string"!=typeof e8||""===e8){ed(e,r);var e6=null}else if("stylesheet"===r.rel)if("string"!=typeof e9||null!=r.disabled||r.onLoad||r.onError)e6=ed(e,r);else{var e7=s.styles.get(e9),te=n.styleResources.hasOwnProperty(e8)?n.styleResources[e8]:void 0;if(null!==te){n.styleResources[e8]=null,e7||(e7={precedence:F(e9),rules:[],hrefs:[],sheets:new Map},s.styles.set(e9,e7));var tt={state:0,props:M({},r,{"data-precedence":r.precedence,precedence:null})};if(te){2===te.length&&eV(tt.props,te);var tr=s.preloads.stylesheets.get(e8);tr&&0<tr.length?tr.length=0:tt.state=1}e7.sheets.set(e8,tt),l&&l.stylesheets.add(tt)}else if(e7){var ti=e7.sheets.get(e8);ti&&l&&l.stylesheets.add(ti)}h&&e.push("\x3c!-- --\x3e"),e6=null}else r.onLoad||r.onError?e6=ed(e,r):(h&&e.push("\x3c!-- --\x3e"),e6=e5?null:ed(s.hoistableChunks,r));return e6;case"script":var tn=1&c.tagScope,ta=r.async;if("string"!=typeof r.src||!r.src||!ta||"function"==typeof ta||"symbol"==typeof ta||r.onLoad||r.onError||4===c.insertionMode||tn||null!=r.itemProp)var ts=eA(e,r);else{var to=r.src;if("module"===r.type)var tl=n.moduleScriptResources,tc=s.preloads.moduleScripts;else tl=n.scriptResources,tc=s.preloads.scripts;var th=tl.hasOwnProperty(to)?tl[to]:void 0;if(null!==th){tl[to]=null;var tu=r;if(th){2===th.length&&eV(tu=M({},r),th);var td=tc.get(to);td&&(td.length=0)}var tp=[];s.scripts.add(tp),eA(tp,tu)}h&&e.push("\x3c!-- --\x3e"),ts=null}return ts;case"style":var tf=1&c.tagScope,tg=r.precedence,tm=r.href,tA=r.nonce;if(4===c.insertionMode||tf||null!=r.itemProp||"string"!=typeof tg||"string"!=typeof tm||""===tm){e.push(eS("style"));var tb,tv=null,ty=null;for(tb in r)if(I.call(r,tb)){var tx=r[tb];if(null!=tx)switch(tb){case"children":tv=tx;break;case"dangerouslySetInnerHTML":ty=tx;break;default:ec(e,tb,tx)}}e.push(">");var tS=Array.isArray(tv)?2>tv.length?tv[0]:null:tv;"function"!=typeof tS&&"symbol"!=typeof tS&&null!=tS&&e.push((""+tS).replace(ep,ef)),eh(e,ty,tv),e.push(ew("style"));var tE=null}else{var tw=s.styles.get(tg);if(null!==(n.styleResources.hasOwnProperty(tm)?n.styleResources[tm]:void 0)){n.styleResources[tm]=null,tw||(tw={precedence:F(tg),rules:[],hrefs:[],sheets:new Map},s.styles.set(tg,tw));var t_=s.nonce.style;if(!t_||t_===tA){tw.hrefs.push(F(tm));var tC,tM=tw.rules,tI=null,tT=null;for(tC in r)if(I.call(r,tC)){var tR=r[tC];if(null!=tR)switch(tC){case"children":tI=tR;break;case"dangerouslySetInnerHTML":tT=tR}}var tB=Array.isArray(tI)?2>tI.length?tI[0]:null:tI;"function"!=typeof tB&&"symbol"!=typeof tB&&null!=tB&&tM.push((""+tB).replace(ep,ef)),eh(tM,tT,tI)}}tw&&l&&l.styles.add(tw),h&&e.push("\x3c!-- --\x3e"),tE=void 0}return tE;case"meta":var tk=1&c.tagScope,tP=4&c.tagScope;if(4===c.insertionMode||tk||null!=r.itemProp)var tD=eg(e,r,"meta");else h&&e.push("\x3c!-- --\x3e"),tD=tP?null:"string"==typeof r.charSet?eg(s.charsetChunks,r,"meta"):"viewport"===r.name?eg(s.viewportChunks,r,"meta"):eg(s.hoistableChunks,r,"meta");return tD;case"listing":case"pre":e.push(eS(t));var tL,tF=null,tN=null;for(tL in r)if(I.call(r,tL)){var tU=r[tL];if(null!=tU)switch(tL){case"children":tF=tU;break;case"dangerouslySetInnerHTML":tN=tU;break;default:ec(e,tL,tU)}}if(e.push(">"),null!=tN){if(null!=tF)throw Error(a(60));if("object"!=typeof tN||!("__html"in tN))throw Error(a(61));var tO=tN.__html;null!=tO&&("string"==typeof tO&&0<tO.length&&"\n"===tO[0]?e.push("\n",tO):e.push(""+tO))}return"string"==typeof tF&&"\n"===tF[0]&&e.push("\n"),tF;case"img":var tQ=3&c.tagScope,tz=r.src,tH=r.srcSet;if(!("lazy"===r.loading||!tz&&!tH||"string"!=typeof tz&&null!=tz||"string"!=typeof tH&&null!=tH||"low"===r.fetchPriority||tQ)&&("string"!=typeof tz||":"!==tz[4]||"d"!==tz[0]&&"D"!==tz[0]||"a"!==tz[1]&&"A"!==tz[1]||"t"!==tz[2]&&"T"!==tz[2]||"a"!==tz[3]&&"A"!==tz[3])&&("string"!=typeof tH||":"!==tH[4]||"d"!==tH[0]&&"D"!==tH[0]||"a"!==tH[1]&&"A"!==tH[1]||"t"!==tH[2]&&"T"!==tH[2]||"a"!==tH[3]&&"A"!==tH[3])){null!==l&&64&c.tagScope&&(l.suspenseyImages=!0);var tG="string"==typeof r.sizes?r.sizes:void 0,tV=tH?tH+"\n"+(tG||""):tz,tj=s.preloads.images,tq=tj.get(tV);if(tq)("high"===r.fetchPriority||10>s.highImagePreloads.size)&&(tj.delete(tV),s.highImagePreloads.add(tq));else if(!n.imageResources.hasOwnProperty(tV)){n.imageResources[tV]=j;var tW,tX=r.crossOrigin,tY="string"==typeof tX?"use-credentials"===tX?tX:"":void 0,tK=s.headers;tK&&0<tK.remainingCapacity&&"string"!=typeof r.srcSet&&("high"===r.fetchPriority||500>tK.highImagePreloads.length)&&(tW=ej(tz,"image",{imageSrcSet:r.srcSet,imageSizes:r.sizes,crossOrigin:tY,integrity:r.integrity,nonce:r.nonce,type:r.type,fetchPriority:r.fetchPriority,referrerPolicy:r.refererPolicy}),0<=(tK.remainingCapacity-=tW.length+2))?(s.resets.image[tV]=j,tK.highImagePreloads&&(tK.highImagePreloads+=", "),tK.highImagePreloads+=tW):(ed(tq=[],{rel:"preload",as:"image",href:tH?void 0:tz,imageSrcSet:tH,imageSizes:tG,crossOrigin:tY,integrity:r.integrity,type:r.type,fetchPriority:r.fetchPriority,referrerPolicy:r.referrerPolicy}),"high"===r.fetchPriority||10>s.highImagePreloads.size?s.highImagePreloads.add(tq):(s.bulkPreloads.add(tq),tj.set(tV,tq)))}}return eg(e,r,"img");case"base":case"area":case"br":case"col":case"embed":case"hr":case"keygen":case"param":case"source":case"track":case"wbr":return eg(e,r,t);case"head":if(2>c.insertionMode){var t$=o||s.preamble;if(t$.headChunks)throw Error(a(545,"`<head>`"));null!==o&&e.push("\x3c!--head--\x3e"),t$.headChunks=[];var tJ=eb(t$.headChunks,r,"head")}else tJ=ev(e,r,"head");return tJ;case"body":if(2>c.insertionMode){var tZ=o||s.preamble;if(tZ.bodyChunks)throw Error(a(545,"`<body>`"));null!==o&&e.push("\x3c!--body--\x3e"),tZ.bodyChunks=[];var t0=eb(tZ.bodyChunks,r,"body")}else t0=ev(e,r,"body");return t0;case"html":if(0===c.insertionMode){var t1=o||s.preamble;if(t1.htmlChunks)throw Error(a(545,"`<html>`"));null!==o&&e.push("\x3c!--html--\x3e"),t1.htmlChunks=[""];var t2=eb(t1.htmlChunks,r,"html")}else t2=ev(e,r,"html");return t2;default:if(-1!==t.indexOf("-")){e.push(eS(t));var t3,t5=null,t4=null;for(t3 in r)if(I.call(r,t3)){var t8=r[t3];if(null!=t8){var t9=t3;switch(t3){case"children":t5=t8;break;case"dangerouslySetInnerHTML":t4=t8;break;case"style":et(e,t8);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"className":t9="class";default:if(k(t3)&&"function"!=typeof t8&&"symbol"!=typeof t8&&!1!==t8){if(!0===t8)t8="";else if("object"==typeof t8)continue;e.push(" ",t9,'="',F(t8),'"')}}}}return e.push(">"),eh(e,t4,t5),t5}}return ev(e,r,t)}(x.chunks,n,s,e.resumableState,e.renderState,t.blockedPreamble,t.hoistableState,t.formatContext,x.lastPushedText),x.lastPushedText=!1,C=t.formatContext,o=t.keyPath,t.keyPath=r,3===(t.formatContext=K(C,n,s)).insertionMode){r=t1(e,0,null,t.formatContext,!1,!1),x.preambleChildren.push(r),t.blockedSegment=r;try{r.status=6,rf(e,t,R,-1),e0(r.chunks,e.renderState,r.lastPushedText,r.textEmbedded),r.status=1}finally{t.blockedSegment=x}}else rf(e,t,R,-1);t.formatContext=C,t.keyPath=o;e:{switch(t=x.chunks,e=e.resumableState,n){case"title":case"style":case"script":case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break e;case"body":if(1>=C.insertionMode){e.hasBody=!0;break e}break;case"html":if(0===C.insertionMode){e.hasHtml=!0;break e}break;case"head":if(1>=C.insertionMode)break e}t.push(ew(n))}x.lastPushedText=!1}else{switch(n){case y:case c:case h:case l:n=t.keyPath,t.keyPath=r,rs(e,t,s.children,-1),t.keyPath=n;return;case v:null===(n=t.blockedSegment)?"hidden"!==s.mode&&(n=t.keyPath,t.keyPath=r,rf(e,t,s.children,-1),t.keyPath=n):"hidden"!==s.mode&&(e.renderState.generateStaticMarkup||n.chunks.push("\x3c!--&--\x3e"),n.lastPushedText=!1,x=t.keyPath,t.keyPath=r,rf(e,t,s.children,-1),t.keyPath=x,e.renderState.generateStaticMarkup||n.chunks.push("\x3c!--/&--\x3e"),n.lastPushedText=!1);return;case g:e:{if(n=s.children,"forwards"===(s=s.revealOrder)||"backwards"===s||"unstable_legacy-backwards"===s){if(_(n)){rt(e,t,r,n,s);break e}if((x=w(n))&&(x=x.call(n))){if(!(C=x.next()).done){do C=x.next();while(!C.done);rt(e,t,r,n,s)}break e}}"together"===s?(s=t.keyPath,x=t.row,(C=t.row=re(null)).boundaries=[],C.together=!0,t.keyPath=r,rs(e,t,n,-1),0==--C.pendingTasks&&t9(e,C),t.keyPath=s,t.row=x,null!==x&&0<C.pendingTasks&&(x.pendingTasks++,C.next=x)):(s=t.keyPath,t.keyPath=r,rs(e,t,n,-1),t.keyPath=s)}return;case S:case b:throw Error(a(343));case f:e:if(null!==t.replay){n=t.keyPath,x=t.formatContext,C=t.row,t.keyPath=r,t.formatContext=Z(e.resumableState,x),t.row=null,r=s.children;try{rf(e,t,r,-1)}finally{t.keyPath=n,t.formatContext=x,t.row=C}}else{n=t.keyPath,o=t.formatContext;var B=t.row,P=t.blockedBoundary;T=t.blockedPreamble;var D=t.hoistableState;E=t.blockedSegment;var L=s.fallback;s=s.children;var N=new Set,U=tJ(e,t.row,N,null,null);null!==e.trackedPostpones&&(U.trackedContentKeyPath=r);var O=t1(e,E.chunks.length,U,t.formatContext,!1,!1);E.children.push(O),E.lastPushedText=!1;var z=t1(e,0,null,t.formatContext,!1,!1);if(z.parentFlushed=!0,null!==e.trackedPostpones){x=t.componentStack,R=[(C=[r[0],"Suspense Fallback",r[2]])[1],C[2],[],null],e.trackedPostpones.workingMap.set(C,R),U.trackedFallbackNode=R,t.blockedSegment=O,t.blockedPreamble=U.fallbackPreamble,t.keyPath=C,t.formatContext=J(e.resumableState,o),t.componentStack=t3(x),O.status=6;try{rf(e,t,L,-1),e0(O.chunks,e.renderState,O.lastPushedText,O.textEmbedded),O.status=1}catch(t){throw O.status=12===e.status?3:4,t}finally{t.blockedSegment=E,t.blockedPreamble=T,t.keyPath=n,t.formatContext=o}t2(t=tZ(e,null,s,-1,U,z,U.contentPreamble,U.contentState,t.abortSet,r,Z(e.resumableState,t.formatContext),t.context,t.treeContext,null,x)),e.pingedTasks.push(t)}else{t.blockedBoundary=U,t.blockedPreamble=U.contentPreamble,t.hoistableState=U.contentState,t.blockedSegment=z,t.keyPath=r,t.formatContext=Z(e.resumableState,o),t.row=null,z.status=6;try{if(rf(e,t,s,-1),e0(z.chunks,e.renderState,z.lastPushedText,z.textEmbedded),z.status=1,ry(U,z),0===U.pendingTasks&&0===U.status){if(U.status=1,!tW(e,U)){null!==B&&0==--B.pendingTasks&&t9(e,B),0===e.pendingRootTasks&&t.blockedPreamble&&r_(e);break e}}else null!==B&&B.together&&t7(e,B)}catch(r){U.status=4,12===e.status?(z.status=3,x=e.fatalError):(z.status=4,x=r),U.errorDigest=R=t4(e,x,C=t5(t.componentStack)),ru(e,U)}finally{t.blockedBoundary=P,t.blockedPreamble=T,t.hoistableState=D,t.blockedSegment=E,t.keyPath=n,t.formatContext=o,t.row=B}t2(t=tZ(e,null,L,-1,P,O,U.fallbackPreamble,U.fallbackState,N,[r[0],"Suspense Fallback",r[2]],J(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,t3(t.componentStack))),e.pingedTasks.push(t)}}return}if("object"==typeof n&&null!==n)switch(n.$$typeof){case p:if("ref"in s)for(L in x={},s)"ref"!==L&&(x[L]=s[L]);else x=s;n=rr(e,t,r,n.render,x,o),ri(e,t,r,n,0!==tA,tb,tv);return;case m:rn(e,t,r,n.type,s,o);return;case d:if(C=s.children,x=t.keyPath,s=s.value,R=n._currentValue2,n._currentValue2=s,e4=n={parent:o=e4,depth:null===o?0:o.depth+1,context:n,parentValue:R,value:s},t.context=n,t.keyPath=r,rs(e,t,C,-1),null===(e=e4))throw Error(a(403));e.context._currentValue2=e.parentValue,e=e4=e.parent,t.context=e,t.keyPath=x;return;case u:n=(s=s.children)(n._context._currentValue2),s=t.keyPath,t.keyPath=r,rs(e,t,n,-1),t.keyPath=s;return;case A:if(n=(x=n._init)(n._payload),12===e.status)throw null;rn(e,t,r,n,s,o);return}throw Error(a(130,null==n?n:typeof n,""))}}function ra(e,t,r,i,n){var a=t.replay,s=t.blockedBoundary,o=t1(e,0,null,t.formatContext,!1,!1);o.id=r,o.parentFlushed=!0;try{t.replay=null,t.blockedSegment=o,rf(e,t,i,n),o.status=1,null===s?e.completedRootSegment=o:(ry(s,o),s.parentFlushed&&e.partialBoundaries.push(s))}finally{t.replay=a,t.blockedSegment=null}}function rs(e,t,r,i){null!==t.replay&&"number"==typeof t.replay.slots?ra(e,t,t.replay.slots,r,i):(t.node=r,t.childIndex=i,r=t.componentStack,t2(t),ro(e,t),t.componentStack=r)}function ro(e,t){var r=t.node,i=t.childIndex;if(null!==r){if("object"==typeof r){switch(r.$$typeof){case s:var n=r.type,l=r.key,c=r.props,h=void 0!==(r=c.ref)?r:null,u=e3(n),p=null==l?-1===i?0:i:l;if(l=[t.keyPath,u,p],null!==t.replay)e:{var g=t.replay;for(r=0,i=g.nodes;r<i.length;r++){var m=i[r];if(p===m[1]){if(4===m.length){if(null!==u&&u!==m[0])throw Error(a(490,m[0],u));var b=m[2];u=m[3],p=t.node,t.replay={nodes:b,slots:u,pendingTasks:1};try{if(rn(e,t,l,n,c,h),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(a(488));t.replay.pendingTasks--}catch(a){if("object"==typeof a&&null!==a&&(a===ta||"function"==typeof a.then))throw t.node===p?t.replay=g:i.splice(r,1),a;t.replay.pendingTasks--,c=t5(t.componentStack),l=e,e=t.blockedBoundary,c=t4(l,n=a,c),rm(l,e,b,u,n,c)}t.replay=g}else{if(n!==f)throw Error(a(490,"Suspense",e3(n)||"Unknown"));t:{g=void 0,n=m[5],h=m[2],u=m[3],p=null===m[4]?[]:m[4][2],m=null===m[4]?null:m[4][3];var v=t.keyPath,y=t.formatContext,x=t.row,S=t.replay,E=t.blockedBoundary,C=t.hoistableState,M=c.children,I=c.fallback,T=new Set;(c=tJ(e,t.row,T,null,null)).parentFlushed=!0,c.rootSegmentID=n,t.blockedBoundary=c,t.hoistableState=c.contentState,t.keyPath=l,t.formatContext=Z(e.resumableState,y),t.row=null,t.replay={nodes:h,slots:u,pendingTasks:1};try{if(rf(e,t,M,-1),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(a(488));if(t.replay.pendingTasks--,0===c.pendingTasks&&0===c.status){c.status=1,e.completedBoundaries.push(c);break t}}catch(r){c.status=4,g=t4(e,r,b=t5(t.componentStack)),c.errorDigest=g,t.replay.pendingTasks--,e.clientRenderedBoundaries.push(c)}finally{t.blockedBoundary=E,t.hoistableState=C,t.replay=S,t.keyPath=v,t.formatContext=y,t.row=x}t2(b=t0(e,null,{nodes:p,slots:m,pendingTasks:0},I,-1,E,c.fallbackState,T,[l[0],"Suspense Fallback",l[2]],J(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,t3(t.componentStack))),e.pingedTasks.push(b)}}i.splice(r,1);break e}}}else rn(e,t,l,n,c,h);return;case o:throw Error(a(257));case A:if(r=(b=r._init)(r._payload),12===e.status)throw null;rs(e,t,r,i);return}if(_(r))return void rl(e,t,r,i);if((b=w(r))&&(b=b.call(r))){if(!(r=b.next()).done){c=[];do c.push(r.value),r=b.next();while(!r.done);rl(e,t,c,i)}return}if("function"==typeof r.then)return t.thenableState=null,rs(e,t,tN(r),i);if(r.$$typeof===d)return rs(e,t,r._currentValue2,i);throw Error(a(31,"[object Object]"===(i=Object.prototype.toString.call(r))?"object with keys {"+Object.keys(r).join(", ")+"}":i))}"string"==typeof r?null!==(i=t.blockedSegment)&&(i.lastPushedText=eZ(i.chunks,r,e.renderState,i.lastPushedText)):("number"==typeof r||"bigint"==typeof r)&&null!==(i=t.blockedSegment)&&(i.lastPushedText=eZ(i.chunks,""+r,e.renderState,i.lastPushedText))}}function rl(e,t,r,i){var n=t.keyPath;if(-1!==i&&(t.keyPath=[t.keyPath,"Fragment",i],null!==t.replay)){for(var s=t.replay,o=s.nodes,l=0;l<o.length;l++){var c=o[l];if(c[1]===i){t.replay={nodes:i=c[2],slots:c=c[3],pendingTasks:1};try{if(rl(e,t,r,-1),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(a(488));t.replay.pendingTasks--}catch(n){if("object"==typeof n&&null!==n&&(n===ta||"function"==typeof n.then))throw n;t.replay.pendingTasks--,r=t5(t.componentStack);var h=t.blockedBoundary;r=t4(e,n,r),rm(e,h,i,c,n,r)}t.replay=s,o.splice(l,1);break}}t.keyPath=n;return}if(s=t.treeContext,o=r.length,null!==t.replay&&null!==(l=t.replay.slots)&&"object"==typeof l){for(i=0;i<o;i++)c=r[i],t.treeContext=te(s,o,i),"number"==typeof(h=l[i])?(ra(e,t,h,c,i),delete l[i]):rf(e,t,c,i);t.treeContext=s,t.keyPath=n;return}for(l=0;l<o;l++)i=r[l],t.treeContext=te(s,o,l),rf(e,t,i,l);t.treeContext=s,t.keyPath=n}function rc(e,t,r){if(r.status=5,r.rootSegmentID=e.nextSegmentId++,null===(e=r.trackedContentKeyPath))throw Error(a(486));var i=r.trackedFallbackNode,n=t.workingMap.get(e);return void 0===n?(r=[e[1],e[2],[],null,i,r.rootSegmentID],t.workingMap.set(e,r),rL(r,e[0],t),r):(n[4]=i,n[5]=r.rootSegmentID,n)}function rh(e,t,r,i){i.status=5;var n=r.keyPath,s=r.blockedBoundary;if(null===s)i.id=e.nextSegmentId++,t.rootSlots=i.id,null!==e.completedRootSegment&&(e.completedRootSegment.status=5);else{if(null!==s&&0===s.status){var o=rc(e,t,s);if(s.trackedContentKeyPath===n&&-1===r.childIndex){-1===i.id&&(i.id=i.parentFlushed?s.rootSegmentID:e.nextSegmentId++),o[3]=i.id;return}}if(-1===i.id&&(i.id=i.parentFlushed&&null!==s?s.rootSegmentID:e.nextSegmentId++),-1===r.childIndex)null===n?t.rootSlots=i.id:void 0===(r=t.workingMap.get(n))?rL(r=[n[1],n[2],[],i.id],n[0],t):r[3]=i.id;else{if(null===n){if(null===(e=t.rootSlots))e=t.rootSlots={};else if("number"==typeof e)throw Error(a(491))}else if(void 0===(o=(s=t.workingMap).get(n)))e={},o=[n[1],n[2],[],e],s.set(n,o),rL(o,n[0],t);else if(null===(e=o[3]))e=o[3]={};else if("number"==typeof e)throw Error(a(491));e[r.childIndex]=i.id}}}function ru(e,t){null!==(e=e.trackedPostpones)&&null!==(t=t.trackedContentKeyPath)&&void 0!==(t=e.workingMap.get(t))&&(t.length=4,t[2]=[],t[3]=null)}function rd(e,t,r){return t0(e,r,t.replay,t.node,t.childIndex,t.blockedBoundary,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function rp(e,t,r){var i=t.blockedSegment,n=t1(e,i.chunks.length,null,t.formatContext,i.lastPushedText,!0);return i.children.push(n),i.lastPushedText=!1,tZ(e,r,t.node,t.childIndex,t.blockedBoundary,n,t.blockedPreamble,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function rf(e,t,r,i){var n=t.formatContext,a=t.context,s=t.keyPath,o=t.treeContext,l=t.componentStack,c=t.blockedSegment;if(null===c){c=t.replay;try{return rs(e,t,r,i)}catch(h){if(tI(),r=h===ta?to():h,12!==e.status&&"object"==typeof r&&null!==r){if("function"==typeof r.then){e=rd(e,t,i=h===ta?tM():null).ping,r.then(e,e),t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,t.componentStack=l,t.replay=c,e9(a);return}if("Maximum call stack size exceeded"===r.message){r=rd(e,t,r=h===ta?tM():null),e.pingedTasks.push(r),t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,t.componentStack=l,t.replay=c,e9(a);return}}}}else{var h=c.children.length,u=c.chunks.length;try{return rs(e,t,r,i)}catch(i){if(tI(),c.children.length=h,c.chunks.length=u,r=i===ta?to():i,12!==e.status&&"object"==typeof r&&null!==r){if("function"==typeof r.then){c=r,e=rp(e,t,r=i===ta?tM():null).ping,c.then(e,e),t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,t.componentStack=l,e9(a);return}if("Maximum call stack size exceeded"===r.message){c=rp(e,t,c=i===ta?tM():null),e.pingedTasks.push(c),t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,t.componentStack=l,e9(a);return}}}}throw t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,e9(a),r}function rg(e){var t=e.blockedBoundary,r=e.blockedSegment;null!==r&&(r.status=3,rx(this,t,e.row,r))}function rm(e,t,r,i,n,s){for(var o=0;o<r.length;o++){var l=r[o];if(4===l.length)rm(e,t,l[2],l[3],n,s);else{l=l[5];var c=tJ(e,null,new Set,null,null);c.parentFlushed=!0,c.rootSegmentID=l,c.status=4,c.errorDigest=s,c.parentFlushed&&e.clientRenderedBoundaries.push(c)}}if(r.length=0,null!==i){if(null===t)throw Error(a(487));if(4!==t.status&&(t.status=4,t.errorDigest=s,t.parentFlushed&&e.clientRenderedBoundaries.push(t)),"object"==typeof i)for(var h in i)delete i[h]}}function rA(e,t){try{var r=e.renderState,i=r.onHeaders;if(i){var n=r.headers;if(n){r.headers=null;var a=n.preconnects;if(n.fontPreloads&&(a&&(a+=", "),a+=n.fontPreloads),n.highImagePreloads&&(a&&(a+=", "),a+=n.highImagePreloads),!t){var s=r.styles.values(),o=s.next();t:for(;0<n.remainingCapacity&&!o.done;o=s.next())for(var l=o.value.sheets.values(),c=l.next();0<n.remainingCapacity&&!c.done;c=l.next()){var h=c.value,u=h.props,d=u.href,p=h.props,f=ej(p.href,"style",{crossOrigin:p.crossOrigin,integrity:p.integrity,nonce:p.nonce,type:p.type,fetchPriority:p.fetchPriority,referrerPolicy:p.referrerPolicy,media:p.media});if(0<=(n.remainingCapacity-=f.length+2))r.resets.style[d]=j,a&&(a+=", "),a+=f,r.resets.style[d]="string"==typeof u.crossOrigin||"string"==typeof u.integrity?[u.crossOrigin,u.integrity]:j;else break t}}i(a?{Link:a}:{})}}}catch(t){t4(e,t,{})}}function rb(e){null===e.trackedPostpones&&rA(e,!0),null===e.trackedPostpones&&r_(e),e.onShellError=tn,(e=e.onShellReady)()}function rv(e){rA(e,null===e.trackedPostpones||null===e.completedRootSegment||5!==e.completedRootSegment.status),r_(e),(e=e.onAllReady)()}function ry(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary&&-1===t.children[0].id){var r=t.children[0];r.id=t.id,r.parentFlushed=!0,1!==r.status&&3!==r.status&&4!==r.status||ry(e,r)}else e.completedSegments.push(t)}function rx(e,t,r,i){if(null!==r&&(0==--r.pendingTasks?t9(e,r):r.together&&t7(e,r)),e.allPendingTasks--,null===t){if(null!==i&&i.parentFlushed){if(null!==e.completedRootSegment)throw Error(a(389));e.completedRootSegment=i}e.pendingRootTasks--,0===e.pendingRootTasks&&rb(e)}else if(t.pendingTasks--,4!==t.status)if(0===t.pendingTasks){if(0===t.status&&(t.status=1),null!==i&&i.parentFlushed&&(1===i.status||3===i.status)&&ry(t,i),t.parentFlushed&&e.completedBoundaries.push(t),1===t.status)null!==(r=t.row)&&eJ(r.hoistables,t.contentState),tW(e,t)||(t.fallbackAbortableTasks.forEach(rg,e),t.fallbackAbortableTasks.clear(),null!==r&&0==--r.pendingTasks&&t9(e,r)),0===e.pendingRootTasks&&null===e.trackedPostpones&&null!==t.contentPreamble&&r_(e);else if(5===t.status&&null!==(t=t.row)){if(null!==e.trackedPostpones){r=e.trackedPostpones;var n=t.next;if(null!==n&&null!==(i=n.boundaries))for(n.boundaries=null,n=0;n<i.length;n++){var s=i[n];rc(e,r,s),rx(e,s,null,null)}}0==--t.pendingTasks&&t9(e,t)}}else null===i||!i.parentFlushed||1!==i.status&&3!==i.status||(ry(t,i),1===t.completedSegments.length&&t.parentFlushed&&e.partialBoundaries.push(t)),null!==(t=t.row)&&t.together&&t7(e,t);0===e.allPendingTasks&&rv(e)}function rS(e){if(14!==e.status&&13!==e.status){var t=e4,r=z.H;z.H=tz;var i=z.A;z.A=tG;var n=tK;tK=e;var s=tH;tH=e.resumableState;try{var o,l=e.pingedTasks;for(o=0;o<l.length;o++){var c=l[o],h=e,u=c.blockedSegment;if(null===u){var d=h;if(0!==c.replay.pendingTasks){e9(c.context);try{if("number"==typeof c.replay.slots?ra(d,c,c.replay.slots,c.node,c.childIndex):ro(d,c),1===c.replay.pendingTasks&&0<c.replay.nodes.length)throw Error(a(488));c.replay.pendingTasks--,c.abortSet.delete(c),rx(d,c.blockedBoundary,c.row,null)}catch(e){tI();var p=e===ta?to():e;if("object"==typeof p&&null!==p&&"function"==typeof p.then){var f=c.ping;p.then(f,f),c.thenableState=e===ta?tM():null}else{c.replay.pendingTasks--,c.abortSet.delete(c);var g=t5(c.componentStack);h=void 0;var m=d,A=c.blockedBoundary,b=12===d.status?d.fatalError:p,v=c.replay.nodes,y=c.replay.slots;h=t4(m,b,g),rm(m,A,v,y,b,h),d.pendingRootTasks--,0===d.pendingRootTasks&&rb(d),d.allPendingTasks--,0===d.allPendingTasks&&rv(d)}}finally{}}}else if(d=void 0,m=u,0===m.status){m.status=6,e9(c.context);var x=m.children.length,S=m.chunks.length;try{ro(h,c),e0(m.chunks,h.renderState,m.lastPushedText,m.textEmbedded),c.abortSet.delete(c),m.status=1,rx(h,c.blockedBoundary,c.row,m)}catch(e){tI(),m.children.length=x,m.chunks.length=S;var E=e===ta?to():12===h.status?h.fatalError:e;if(12===h.status&&null!==h.trackedPostpones){var w=h.trackedPostpones,_=t5(c.componentStack);c.abortSet.delete(c),t4(h,E,_),rh(h,w,c,m),rx(h,c.blockedBoundary,c.row,m)}else if("object"==typeof E&&null!==E&&"function"==typeof E.then){m.status=0,c.thenableState=e===ta?tM():null;var C=c.ping;E.then(C,C)}else{var M=t5(c.componentStack);c.abortSet.delete(c),m.status=4;var I=c.blockedBoundary,T=c.row;if(null!==T&&0==--T.pendingTasks&&t9(h,T),h.allPendingTasks--,d=t4(h,E,M),null===I)t8(h,E);else if(I.pendingTasks--,4!==I.status){I.status=4,I.errorDigest=d,ru(h,I);var R=I.row;null!==R&&0==--R.pendingTasks&&t9(h,R),I.parentFlushed&&h.clientRenderedBoundaries.push(I),0===h.pendingRootTasks&&null===h.trackedPostpones&&null!==I.contentPreamble&&r_(h)}0===h.allPendingTasks&&rv(h)}}finally{}}}l.splice(0,o),null!==e.destination&&rP(e,e.destination)}catch(t){t4(e,t,{}),t8(e,t)}finally{tH=s,z.H=r,z.A=i,r===tz&&e9(t),tK=n}}}function rE(e,t,r){t.preambleChildren.length&&r.push(t.preambleChildren);for(var i=!1,n=0;n<t.children.length;n++)i=rw(e,t.children[n],r)||i;return i}function rw(e,t,r){var i=t.boundary;if(null===i)return rE(e,t,r);var n=i.contentPreamble,s=i.fallbackPreamble;if(null===n||null===s)return!1;switch(i.status){case 1:if(e_(e.renderState,n),e.byteSize+=i.byteSize,!(t=i.completedSegments[0]))throw Error(a(391));return rE(e,t,r);case 5:if(null!==e.trackedPostpones)return!0;case 4:if(1===t.status)return e_(e.renderState,s),rE(e,t,r);default:return!0}}function r_(e){if(e.completedRootSegment&&null===e.completedPreambleSegments){var t=[],r=e.byteSize,i=rw(e,e.completedRootSegment,t),n=e.renderState.preamble;!1===i||n.headChunks&&n.bodyChunks?e.completedPreambleSegments=t:e.byteSize=r}}function rC(e,t,r,i){switch(r.parentFlushed=!0,r.status){case 0:r.id=e.nextSegmentId++;case 5:return i=r.id,r.lastPushedText=!1,r.textEmbedded=!1,e=e.renderState,t.push('<template id="'),t.push(e.placeholderPrefix),e=i.toString(16),t.push(e),t.push('"></template>');case 1:r.status=2;var n=!0,s=r.chunks,o=0;r=r.children;for(var l=0;l<r.length;l++){for(n=r[l];o<n.index;o++)t.push(s[o]);n=rI(e,t,n,i)}for(;o<s.length-1;o++)t.push(s[o]);return o<s.length&&(n=t.push(s[o])),n;case 3:return!0;default:throw Error(a(390))}}var rM=0;function rI(e,t,r,i){var n=r.boundary;if(null===n)return rC(e,t,r,i);if(n.parentFlushed=!0,4===n.status){var s=n.row;return null!==s&&0==--s.pendingTasks&&t9(e,s),e.renderState.generateStaticMarkup||(n=n.errorDigest,t.push("\x3c!--$!--\x3e"),t.push("<template"),n&&(t.push(' data-dgst="'),n=F(n),t.push(n),t.push('"')),t.push("></template>")),rC(e,t,r,i),e=!!e.renderState.generateStaticMarkup||t.push("\x3c!--/$--\x3e")}if(1!==n.status)return 0===n.status&&(n.rootSegmentID=e.nextSegmentId++),0<n.completedSegments.length&&e.partialBoundaries.push(n),eM(t,e.renderState,n.rootSegmentID),i&&eJ(i,n.fallbackState),rC(e,t,r,i),t.push("\x3c!--/$--\x3e");if(!rk&&tW(e,n)&&rM+n.byteSize>e.progressiveChunkSize)return n.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(n),eM(t,e.renderState,n.rootSegmentID),rC(e,t,r,i),t.push("\x3c!--/$--\x3e");if(rM+=n.byteSize,i&&eJ(i,n.contentState),null!==(r=n.row)&&tW(e,n)&&0==--r.pendingTasks&&t9(e,r),e.renderState.generateStaticMarkup||t.push("\x3c!--$--\x3e"),1!==(r=n.completedSegments).length)throw Error(a(391));return rI(e,t,r[0],i),e=!!e.renderState.generateStaticMarkup||t.push("\x3c!--/$--\x3e")}function rT(e,t,r,i){switch(!function(e,t,r,i){switch(r.insertionMode){case 0:case 1:case 3:case 2:return e.push('<div hidden id="'),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push('">');case 4:return e.push('<svg aria-hidden="true" style="display:none" id="'),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push('">');case 5:return e.push('<math aria-hidden="true" style="display:none" id="'),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push('">');case 6:return e.push('<table hidden id="'),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push('">');case 7:return e.push('<table hidden><tbody id="'),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push('">');case 8:return e.push('<table hidden><tr id="'),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push('">');case 9:return e.push('<table hidden><colgroup id="'),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push('">');default:throw Error(a(397))}}(t,e.renderState,r.parentFormatContext,r.id),rI(e,t,r,i),r.parentFormatContext.insertionMode){case 0:case 1:case 3:case 2:return t.push("</div>");case 4:return t.push("</svg>");case 5:return t.push("</math>");case 6:return t.push("</table>");case 7:return t.push("</tbody></table>");case 8:return t.push("</tr></table>");case 9:return t.push("</colgroup></table>");default:throw Error(a(397))}}function rR(e,t,r){rM=r.byteSize;for(var i,n,s=r.completedSegments,o=0;o<s.length;o++)rB(e,t,r,s[o]);s.length=0,null!==(s=r.row)&&tW(e,r)&&0==--s.pendingTasks&&t9(e,s),eL(t,r.contentState,e.renderState),s=e.resumableState,e=e.renderState,o=r.rootSegmentID,r=r.contentState;var l=e.stylesToHoist;return e.stylesToHoist=!1,t.push(e.startInlineScript),t.push(">"),l?(0==(4&s.instructions)&&(s.instructions|=4,t.push('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};')),0==(2&s.instructions)&&(s.instructions|=2,t.push('$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};\n$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};')),0==(8&s.instructions)?(s.instructions|=8,t.push('$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=\n"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=\n"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("')):t.push('$RR("')):(0==(2&s.instructions)&&(s.instructions|=2,t.push('$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};\n$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};')),t.push('$RC("')),s=o.toString(16),t.push(e.boundaryPrefix),t.push(s),t.push('","'),t.push(e.segmentPrefix),t.push(s),l?(t.push('",'),i=r,t.push("["),n="[",i.stylesheets.forEach(function(e){if(2!==e.state)if(3===e.state)t.push(n),e=eR(""+e.props.href),t.push(e),t.push("]"),n=",[";else{t.push(n);var r=e.props["data-precedence"],i=e.props,s=Q(""+e.props.href);for(var o in s=eR(s),t.push(s),r=""+r,t.push(","),r=eR(r),t.push(r),i)if(I.call(i,o)&&null!=(r=i[o]))switch(o){case"href":case"rel":case"precedence":case"data-precedence":break;case"children":case"dangerouslySetInnerHTML":throw Error(a(399,"link"));default:!function(e,t,r){var i=t.toLowerCase();switch(typeof r){case"function":case"symbol":return}switch(t){case"innerHTML":case"dangerouslySetInnerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"style":case"ref":return;case"className":i="class",t=""+r;break;case"hidden":if(!1===r)return;t="";break;case"src":case"href":t=""+(r=Q(r));break;default:if(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])||!k(t))return;t=""+r}e.push(","),i=eR(i),e.push(i),e.push(","),i=eR(t),e.push(i)}(t,o,r)}t.push("]"),n=",[",e.state=3}}),t.push("]")):t.push('"'),r=t.push(")<\/script>"),eC(t,e)&&r}function rB(e,t,r,i){if(2===i.status)return!0;var n=r.contentState,s=i.id;if(-1===s){if(-1===(i.id=r.rootSegmentID))throw Error(a(392));return rT(e,t,i,n)}return s===r.rootSegmentID?rT(e,t,i,n):(rT(e,t,i,n),r=e.resumableState,e=e.renderState,t.push(e.startInlineScript),t.push(">"),0==(1&r.instructions)?(r.instructions|=1,t.push('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')):t.push('$RS("'),t.push(e.segmentPrefix),s=s.toString(16),t.push(s),t.push('","'),t.push(e.placeholderPrefix),t.push(s),t=t.push('")<\/script>'))}var rk=!1;function rP(e,t){try{if(!(0<e.pendingRootTasks)){var r,i=e.completedRootSegment;if(null!==i){if(5===i.status)return;var n=e.completedPreambleSegments;if(null===n)return;rM=e.byteSize;var a,s=e.resumableState,o=e.renderState,l=o.preamble,c=l.htmlChunks,h=l.headChunks;if(c){for(a=0;a<c.length;a++)t.push(c[a]);if(h)for(a=0;a<h.length;a++)t.push(h[a]);else{var u=eS("head");t.push(u),t.push(">")}}else if(h)for(a=0;a<h.length;a++)t.push(h[a]);var d=o.charsetChunks;for(a=0;a<d.length;a++)t.push(d[a]);d.length=0,o.preconnects.forEach(eF,t),o.preconnects.clear();var p=o.viewportChunks;for(a=0;a<p.length;a++)t.push(p[a]);p.length=0,o.fontPreloads.forEach(eF,t),o.fontPreloads.clear(),o.highImagePreloads.forEach(eF,t),o.highImagePreloads.clear(),q=o,o.styles.forEach(eO,t),q=null;var f=o.importMapChunks;for(a=0;a<f.length;a++)t.push(f[a]);f.length=0,o.bootstrapScripts.forEach(eF,t),o.scripts.forEach(eF,t),o.scripts.clear(),o.bulkPreloads.forEach(eF,t),o.bulkPreloads.clear(),s.instructions|=32;var g=o.hoistableChunks;for(a=0;a<g.length;a++)t.push(g[a]);for(s=g.length=0;s<n.length;s++){var m=n[s];for(o=0;o<m.length;o++)rI(e,t,m[o],null)}var A=e.renderState.preamble,b=A.headChunks;if(A.htmlChunks||b){var v=ew("head");t.push(v)}var y=A.bodyChunks;if(y)for(n=0;n<y.length;n++)t.push(y[n]);rI(e,t,i,null),e.completedRootSegment=null;var x=e.renderState;if(0!==e.allPendingTasks||0!==e.clientRenderedBoundaries.length||0!==e.completedBoundaries.length||null!==e.trackedPostpones&&(0!==e.trackedPostpones.rootNodes.length||null!==e.trackedPostpones.rootSlots)){var S=e.resumableState;if(0==(64&S.instructions)){if(S.instructions|=64,t.push(x.startInlineScript),0==(32&S.instructions)){S.instructions|=32;var E="_"+S.idPrefix+"R_";t.push(' id="');var w=F(E);t.push(w),t.push('"')}t.push(">"),t.push("requestAnimationFrame(function(){$RT=performance.now()});"),t.push("<\/script>")}}eC(t,x)}var _=e.renderState;i=0;var C=_.viewportChunks;for(i=0;i<C.length;i++)t.push(C[i]);C.length=0,_.preconnects.forEach(eF,t),_.preconnects.clear(),_.fontPreloads.forEach(eF,t),_.fontPreloads.clear(),_.highImagePreloads.forEach(eF,t),_.highImagePreloads.clear(),_.styles.forEach(ez,t),_.scripts.forEach(eF,t),_.scripts.clear(),_.bulkPreloads.forEach(eF,t),_.bulkPreloads.clear();var M=_.hoistableChunks;for(i=0;i<M.length;i++)t.push(M[i]);M.length=0;var I=e.clientRenderedBoundaries;for(r=0;r<I.length;r++){var T=I[r];_=t;var R=e.resumableState,B=e.renderState,k=T.rootSegmentID,P=T.errorDigest;_.push(B.startInlineScript),_.push(">"),0==(4&R.instructions)?(R.instructions|=4,_.push('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("')):_.push('$RX("'),_.push(B.boundaryPrefix);var D=k.toString(16);if(_.push(D),_.push('"'),P){_.push(",");var L,N=(L=P||"",JSON.stringify(L).replace(eI,function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}));_.push(N)}var U=_.push(")<\/script>");if(!U){e.destination=null,r++,I.splice(0,r);return}}I.splice(0,r);var O=e.completedBoundaries;for(r=0;r<O.length;r++)if(!rR(e,t,O[r])){e.destination=null,r++,O.splice(0,r);return}O.splice(0,r),rk=!0;var Q=e.partialBoundaries;for(r=0;r<Q.length;r++){var z=Q[r];e:{I=e,T=t,rM=z.byteSize;var H=z.completedSegments;for(U=0;U<H.length;U++)if(!rB(I,T,z,H[U])){U++,H.splice(0,U);var G=!1;break e}H.splice(0,U);var V=z.row;null!==V&&V.together&&1===z.pendingTasks&&(1===V.pendingTasks?t6(I,V,V.hoistables):V.pendingTasks--),G=eL(T,z.contentState,I.renderState)}if(!G){e.destination=null,r++,Q.splice(0,r);return}}Q.splice(0,r),rk=!1;var j=e.completedBoundaries;for(r=0;r<j.length;r++)if(!rR(e,t,j[r])){e.destination=null,r++,j.splice(0,r);return}j.splice(0,r)}}finally{rk=!1,0===e.allPendingTasks&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&(e.flushScheduled=!1,(r=e.resumableState).hasBody&&(Q=ew("body"),t.push(Q)),r.hasHtml&&(r=ew("html"),t.push(r)),e.status=14,t.push(null),e.destination=null)}}function rD(e){if(!1===e.flushScheduled&&0===e.pingedTasks.length&&null!==e.destination){e.flushScheduled=!0;var t=e.destination;t?rP(e,t):e.flushScheduled=!1}}function rL(e,t,r){if(null===t)r.rootNodes.push(e);else{var i=r.workingMap,n=i.get(t);void 0===n&&(n=[t[1],t[2],[],null],i.set(t,n),rL(n,t[0],r)),n[2].push(e)}}function rF(){}function rN(e,t,r,i){var n,s,o,l,c,h=!1,u=null,d="",p=!1;t={idPrefix:void 0===(n=t?t.identifierPrefix:void 0)?"":n,nextFormID:0,streamingFormat:0,bootstrapScriptContent:void 0,bootstrapScripts:void 0,bootstrapModules:void 0,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}},s=e,o=t,l=function(e,t){var r=e.idPrefix,i=[],n=e.bootstrapScriptContent,a=e.bootstrapScripts,s=e.bootstrapModules;void 0!==n&&(i.push("<script"),eH(i,e),i.push(">",(""+n).replace(W,X),"<\/script>")),n=r+"P:";var o=r+"S:";r+="B:";var l=new Set,c=new Set,h=new Set,u=new Map,d=new Set,p=new Set,f=new Set,g={images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map};if(void 0!==a)for(var m=0;m<a.length;m++){var A,b=a[m],v=void 0,y=void 0,x={rel:"preload",as:"script",fetchPriority:"low",nonce:void 0};"string"==typeof b?x.href=A=b:(x.href=A=b.src,x.integrity=y="string"==typeof b.integrity?b.integrity:void 0,x.crossOrigin=v="string"==typeof b||null==b.crossOrigin?void 0:"use-credentials"===b.crossOrigin?"use-credentials":"");var S=A;(b=e).scriptResources[S]=null,b.moduleScriptResources[S]=null,ed(b=[],x),d.add(b),i.push('<script src="',F(A),'"'),"string"==typeof y&&i.push(' integrity="',F(y),'"'),"string"==typeof v&&i.push(' crossorigin="',F(v),'"'),eH(i,e),i.push(' async=""><\/script>')}if(void 0!==s)for(a=0;a<s.length;a++)x=s[a],v=A=void 0,y={rel:"modulepreload",fetchPriority:"low",nonce:void 0},"string"==typeof x?y.href=m=x:(y.href=m=x.src,y.integrity=v="string"==typeof x.integrity?x.integrity:void 0,y.crossOrigin=A="string"==typeof x||null==x.crossOrigin?void 0:"use-credentials"===x.crossOrigin?"use-credentials":""),x=e,b=m,x.scriptResources[b]=null,x.moduleScriptResources[b]=null,ed(x=[],y),d.add(x),i.push('<script type="module" src="',F(m),'"'),"string"==typeof v&&i.push(' integrity="',F(v),'"'),"string"==typeof A&&i.push(' crossorigin="',F(A),'"'),eH(i,e),i.push(' async=""><\/script>');return{placeholderPrefix:n,segmentPrefix:o,boundaryPrefix:r,startInlineScript:"<script",startInlineStyle:"<style",preamble:{htmlChunks:null,headChunks:null,bodyChunks:null},externalRuntimeScript:null,bootstrapChunks:i,importMapChunks:[],onHeaders:void 0,headers:null,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:l,fontPreloads:c,highImagePreloads:h,styles:u,bootstrapScripts:d,scripts:p,bulkPreloads:f,preloads:g,nonce:{script:void 0,style:void 0},stylesToHoist:!1,generateStaticMarkup:t}}(t,r),(l=t1(o=new tY(o,l,c=Y(0,null,0,null),1/0,rF,void 0,function(){p=!0},void 0,void 0,void 0,void 0),0,null,c,!1,!1)).parentFlushed=!0,t2(s=tZ(o,null,s,-1,null,l,null,null,o.abortableTasks,null,c,null,e7,null,null)),o.pingedTasks.push(s),(e=o).flushScheduled=null!==e.destination,rS(e),10===e.status&&(e.status=11),null===e.trackedPostpones&&rA(e,0===e.pendingRootTasks);var f=e;(11===f.status||10===f.status)&&(f.status=12);try{var g=f.abortableTasks;if(0<g.size){var m=void 0===i?Error(a(432)):"object"==typeof i&&null!==i&&"function"==typeof i.then?Error(a(530)):i;f.fatalError=m,g.forEach(function(e){return function e(t,r,i){var n=t.blockedBoundary,a=t.blockedSegment;if(null!==a){if(6===a.status)return;a.status=3}var s=t5(t.componentStack);if(null===n){if(13!==r.status&&14!==r.status){if(null===(n=t.replay))return void(null!==r.trackedPostpones&&null!==a?(n=r.trackedPostpones,t4(r,i,s),rh(r,n,t,a),rx(r,null,t.row,a)):(t4(r,i,s),t8(r,i)));n.pendingTasks--,0===n.pendingTasks&&0<n.nodes.length&&(a=t4(r,i,s),rm(r,null,n.nodes,n.slots,i,a)),r.pendingRootTasks--,0===r.pendingRootTasks&&rb(r)}}else{var o=r.trackedPostpones;if(4!==n.status){if(null!==o&&null!==a)return t4(r,i,s),rh(r,o,t,a),n.fallbackAbortableTasks.forEach(function(t){return e(t,r,i)}),n.fallbackAbortableTasks.clear(),rx(r,n,t.row,a);n.status=4,a=t4(r,i,s),n.status=4,n.errorDigest=a,ru(r,n),n.parentFlushed&&r.clientRenderedBoundaries.push(n)}n.pendingTasks--,null!==(a=n.row)&&0==--a.pendingTasks&&t9(r,a),n.fallbackAbortableTasks.forEach(function(t){return e(t,r,i)}),n.fallbackAbortableTasks.clear()}null!==(t=t.row)&&0==--t.pendingTasks&&t9(r,t),r.allPendingTasks--,0===r.allPendingTasks&&rv(r)}(e,f,m)}),g.clear()}null!==f.destination&&rP(f,f.destination)}catch(e){t4(f,e,{}),t8(f,e)}var A=e,b={push:function(e){return null!==e&&(d+=e),!0},destroy:function(e){h=!0,u=e}};if(13===A.status)A.status=14,b.destroy(A.fatalError);else if(14!==A.status&&null===A.destination){A.destination=b;try{rP(A,b)}catch(e){t4(A,e,{}),t8(A,e)}}if(h&&u!==i)throw u;if(!p)throw Error(a(426));return d}t.renderToStaticMarkup=function(e,t){return rN(e,t,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},t.renderToString=function(e,t){return rN(e,t,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},t.version="19.2.3"},9828(e,t,r){"use strict";var i=r(9081),n=r(8092);function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),b=Symbol.for("react.scope"),v=Symbol.for("react.activity"),y=Symbol.for("react.legacy_hidden"),x=Symbol.for("react.memo_cache_sentinel"),S=Symbol.for("react.view_transition"),E=Symbol.iterator;function w(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=E&&e[E]||e["@@iterator"])?e:null}var _=Array.isArray;function C(e,t){var r=3&e.length,i=e.length-r,n=t;for(t=0;t<i;){var a=255&e.charCodeAt(t)|(255&e.charCodeAt(++t))<<8|(255&e.charCodeAt(++t))<<16|(255&e.charCodeAt(++t))<<24;++t,n^=a=0x1b873593*(65535&(a=(a=0xcc9e2d51*(65535&a)+((0xcc9e2d51*(a>>>16)&65535)<<16)|0)<<15|a>>>17))+((0x1b873593*(a>>>16)&65535)<<16)|0,n=(65535&(n=5*(65535&(n=n<<13|n>>>19))+((5*(n>>>16)&65535)<<16)|0))+27492+(((n>>>16)+58964&65535)<<16)}switch(a=0,r){case 3:a^=(255&e.charCodeAt(t+2))<<16;case 2:a^=(255&e.charCodeAt(t+1))<<8;case 1:a^=255&e.charCodeAt(t),n^=0x1b873593*(65535&(a=(a=0xcc9e2d51*(65535&a)+((0xcc9e2d51*(a>>>16)&65535)<<16)|0)<<15|a>>>17))+((0x1b873593*(a>>>16)&65535)<<16)}return n^=e.length,n^=n>>>16,n=0x85ebca6b*(65535&n)+((0x85ebca6b*(n>>>16)&65535)<<16)|0,n^=n>>>13,((n=0xc2b2ae35*(65535&n)+((0xc2b2ae35*(n>>>16)&65535)<<16)|0)^n>>>16)>>>0}var M=new MessageChannel,I=[];function T(e){I.push(e),M.port2.postMessage(null)}function R(e){setTimeout(function(){throw e})}M.port1.onmessage=function(){var e=I.shift();e&&e()};var B=Promise,k="function"==typeof queueMicrotask?queueMicrotask:function(e){B.resolve(null).then(e).catch(R)},P=null,D=0;function L(e,t){if(0!==t.byteLength)if(2048<t.byteLength)0<D&&(e.enqueue(new Uint8Array(P.buffer,0,D)),P=new Uint8Array(2048),D=0),e.enqueue(t);else{var r=P.length-D;r<t.byteLength&&(0===r?e.enqueue(P):(P.set(t.subarray(0,r),D),e.enqueue(P),t=t.subarray(r)),P=new Uint8Array(2048),D=0),P.set(t,D),D+=t.byteLength}}function F(e,t){return L(e,t),!0}function N(e){P&&0<D&&(e.enqueue(new Uint8Array(P.buffer,0,D)),P=null,D=0)}var U=new TextEncoder;function O(e){return U.encode(e)}function Q(e){return U.encode(e)}function z(e){return e.byteLength}function H(e,t){"function"==typeof e.error?e.error(t):e.close()}var G=Object.assign,V=Object.prototype.hasOwnProperty,j=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),q={},W={};function X(e){return!!V.call(W,e)||!V.call(q,e)&&(j.test(e)?W[e]=!0:(q[e]=!0,!1))}var Y=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),K=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$=/["'&<>]/;function J(e){if("boolean"==typeof e||"number"==typeof e||"bigint"==typeof e)return""+e;e=""+e;var t=$.exec(e);if(t){var r,i="",n=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}n!==r&&(i+=e.slice(n,r)),n=r+1,i+=t}e=n!==r?i+e.slice(n,r):i}return e}var Z=/([A-Z])/g,ee=/^ms-/,et=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function er(e){return et.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var ei=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,en=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ea={pending:!1,data:null,method:null,action:null},es=en.d;en.d={f:es.f,r:es.r,D:function(e){var t=iV||null;if(t){var r,i,n=t.resumableState,a=t.renderState;"string"==typeof e&&e&&(n.dnsResources.hasOwnProperty(e)||(n.dnsResources[e]=null,(i=(n=a.headers)&&0<n.remainingCapacity)&&(r="<"+(""+e).replace(rN,rU)+">; rel=dns-prefetch",i=0<=(n.remainingCapacity-=r.length+2)),i?(a.resets.dns[e]=null,n.preconnects&&(n.preconnects+=", "),n.preconnects+=r):(e4(r=[],{href:e,rel:"dns-prefetch"}),a.preconnects.add(r))),nR(t))}else es.D(e)},C:function(e,t){var r=iV||null;if(r){var i=r.resumableState,n=r.renderState;if("string"==typeof e&&e){var a,s,o="use-credentials"===t?"credentials":"string"==typeof t?"anonymous":"default";i.connectResources[o].hasOwnProperty(e)||(i.connectResources[o][e]=null,(s=(i=n.headers)&&0<i.remainingCapacity)&&(s="<"+(""+e).replace(rN,rU)+">; rel=preconnect","string"==typeof t&&(s+='; crossorigin="'+(""+t).replace(rO,rQ)+'"'),a=s,s=0<=(i.remainingCapacity-=a.length+2)),s?(n.resets.connect[o][e]=null,i.preconnects&&(i.preconnects+=", "),i.preconnects+=a):(e4(o=[],{rel:"preconnect",href:e,crossOrigin:t}),n.preconnects.add(o))),nR(r)}}else es.C(e,t)},L:function(e,t,r){var i=iV||null;if(i){var n=i.resumableState,a=i.renderState;if(t&&e){switch(t){case"image":if(r)var s,o=r.imageSrcSet,l=r.imageSizes,c=r.fetchPriority;var h=o?o+"\n"+(l||""):e;if(n.imageResources.hasOwnProperty(h))return;n.imageResources[h]=eo,(n=a.headers)&&0<n.remainingCapacity&&"string"!=typeof o&&"high"===c&&(s=rF(e,t,r),0<=(n.remainingCapacity-=s.length+2))?(a.resets.image[h]=eo,n.highImagePreloads&&(n.highImagePreloads+=", "),n.highImagePreloads+=s):(e4(n=[],G({rel:"preload",href:o?void 0:e,as:t},r)),"high"===c?a.highImagePreloads.add(n):(a.bulkPreloads.add(n),a.preloads.images.set(h,n)));break;case"style":if(n.styleResources.hasOwnProperty(e))return;e4(o=[],G({rel:"preload",href:e,as:t},r)),n.styleResources[e]=r&&("string"==typeof r.crossOrigin||"string"==typeof r.integrity)?[r.crossOrigin,r.integrity]:eo,a.preloads.stylesheets.set(e,o),a.bulkPreloads.add(o);break;case"script":if(n.scriptResources.hasOwnProperty(e))return;o=[],a.preloads.scripts.set(e,o),a.bulkPreloads.add(o),e4(o,G({rel:"preload",href:e,as:t},r)),n.scriptResources[e]=r&&("string"==typeof r.crossOrigin||"string"==typeof r.integrity)?[r.crossOrigin,r.integrity]:eo;break;default:if(n.unknownResources.hasOwnProperty(t)){if((o=n.unknownResources[t]).hasOwnProperty(e))return}else o={},n.unknownResources[t]=o;o[e]=eo,(n=a.headers)&&0<n.remainingCapacity&&"font"===t&&(h=rF(e,t,r),0<=(n.remainingCapacity-=h.length+2))?(a.resets.font[e]=eo,n.fontPreloads&&(n.fontPreloads+=", "),n.fontPreloads+=h):(e4(n=[],e=G({rel:"preload",href:e,as:t},r)),"font"===t)?a.fontPreloads.add(n):a.bulkPreloads.add(n)}nR(i)}}else es.L(e,t,r)},m:function(e,t){var r=iV||null;if(r){var i=r.resumableState,n=r.renderState;if(e){var a=t&&"string"==typeof t.as?t.as:"script";if("script"===a){if(i.moduleScriptResources.hasOwnProperty(e))return;a=[],i.moduleScriptResources[e]=t&&("string"==typeof t.crossOrigin||"string"==typeof t.integrity)?[t.crossOrigin,t.integrity]:eo,n.preloads.moduleScripts.set(e,a)}else{if(i.moduleUnknownResources.hasOwnProperty(a)){var s=i.unknownResources[a];if(s.hasOwnProperty(e))return}else s={},i.moduleUnknownResources[a]=s;a=[],s[e]=eo}e4(a,G({rel:"modulepreload",href:e},t)),n.bulkPreloads.add(a),nR(r)}}else es.m(e,t)},X:function(e,t){var r=iV||null;if(r){var i=r.resumableState,n=r.renderState;if(e){var a=i.scriptResources.hasOwnProperty(e)?i.scriptResources[e]:void 0;null!==a&&(i.scriptResources[e]=null,t=G({src:e,async:!0},t),a&&(2===a.length&&rL(t,a),e=n.preloads.scripts.get(e))&&(e.length=0),e=[],n.scripts.add(e),ti(e,t),nR(r))}}else es.X(e,t)},S:function(e,t,r){var i=iV||null;if(i){var n=i.resumableState,a=i.renderState;if(e){t=t||"default";var s=a.styles.get(t),o=n.styleResources.hasOwnProperty(e)?n.styleResources[e]:void 0;null!==o&&(n.styleResources[e]=null,s||(s={precedence:O(J(t)),rules:[],hrefs:[],sheets:new Map},a.styles.set(t,s)),t={state:0,props:G({rel:"stylesheet",href:e,"data-precedence":t},r)},o&&(2===o.length&&rL(t.props,o),(a=a.preloads.stylesheets.get(e))&&0<a.length?a.length=0:t.state=1),s.sheets.set(e,t),nR(i))}}else es.S(e,t,r)},M:function(e,t){var r=iV||null;if(r){var i=r.resumableState,n=r.renderState;if(e){var a=i.moduleScriptResources.hasOwnProperty(e)?i.moduleScriptResources[e]:void 0;null!==a&&(i.moduleScriptResources[e]=null,t=G({src:e,type:"module",async:!0},t),a&&(2===a.length&&rL(t,a),e=n.preloads.moduleScripts.get(e))&&(e.length=0),e=[],n.scripts.add(e),ti(e,t),nR(r))}}else es.M(e,t)}};var eo=[],el=null;Q('"></template>');var ec=Q("<script"),eh=Q("<\/script>"),eu=Q('<script src="'),ed=Q('<script type="module" src="'),ep=Q(' nonce="'),ef=Q(' integrity="'),eg=Q(' crossorigin="'),em=Q(' async=""><\/script>'),eA=Q("<style"),eb=/(<\/|<)(s)(cript)/gi;function ev(e,t,r,i){return""+t+("s"===r?"\\u0073":"\\u0053")+i}var ey=Q('<script type="importmap">'),ex=Q("<\/script>");function eS(e,t,r,i,n,a){var s=void 0===(r="string"==typeof t?t:t&&t.script)?ec:Q('<script nonce="'+J(r)+'"'),o="string"==typeof t?void 0:t&&t.style,l=void 0===o?eA:Q('<style nonce="'+J(o)+'"'),c=e.idPrefix,h=[],u=e.bootstrapScriptContent,d=e.bootstrapScripts,p=e.bootstrapModules;if(void 0!==u&&(h.push(s),rT(h,e),h.push(e$,O((""+u).replace(eb,ev)),eh)),u=[],void 0!==i&&(u.push(ey),u.push(O((""+JSON.stringify(i)).replace(eb,ev))),u.push(ex)),i=n?{preconnects:"",fontPreloads:"",highImagePreloads:"",remainingCapacity:2+("number"==typeof a?a:2e3)}:null,n={placeholderPrefix:Q(c+"P:"),segmentPrefix:Q(c+"S:"),boundaryPrefix:Q(c+"B:"),startInlineScript:s,startInlineStyle:l,preamble:ew(),externalRuntimeScript:null,bootstrapChunks:h,importMapChunks:u,onHeaders:n,headers:i,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:new Set,fontPreloads:new Set,highImagePreloads:new Set,styles:new Map,bootstrapScripts:new Set,scripts:new Set,bulkPreloads:new Set,preloads:{images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map},nonce:{script:r,style:o},hoistableState:null,stylesToHoist:!1},void 0!==d)for(i=0;i<d.length;i++)c=d[i],o=s=void 0,l={rel:"preload",as:"script",fetchPriority:"low",nonce:t},"string"==typeof c?l.href=a=c:(l.href=a=c.src,l.integrity=o="string"==typeof c.integrity?c.integrity:void 0,l.crossOrigin=s="string"==typeof c||null==c.crossOrigin?void 0:"use-credentials"===c.crossOrigin?"use-credentials":""),c=e,u=a,c.scriptResources[u]=null,c.moduleScriptResources[u]=null,e4(c=[],l),n.bootstrapScripts.add(c),h.push(eu,O(J(a)),eQ),r&&h.push(ep,O(J(r)),eQ),"string"==typeof o&&h.push(ef,O(J(o)),eQ),"string"==typeof s&&h.push(eg,O(J(s)),eQ),rT(h,e),h.push(em);if(void 0!==p)for(t=0;t<p.length;t++)o=p[t],a=i=void 0,s={rel:"modulepreload",fetchPriority:"low",nonce:r},"string"==typeof o?s.href=d=o:(s.href=d=o.src,s.integrity=a="string"==typeof o.integrity?o.integrity:void 0,s.crossOrigin=i="string"==typeof o||null==o.crossOrigin?void 0:"use-credentials"===o.crossOrigin?"use-credentials":""),o=e,l=d,o.scriptResources[l]=null,o.moduleScriptResources[l]=null,e4(o=[],s),n.bootstrapScripts.add(o),h.push(ed,O(J(d)),eQ),r&&h.push(ep,O(J(r)),eQ),"string"==typeof a&&h.push(ef,O(J(a)),eQ),"string"==typeof i&&h.push(eg,O(J(i)),eQ),rT(h,e),h.push(em);return n}function eE(e,t,r,i,n){return{idPrefix:void 0===e?"":e,nextFormID:0,streamingFormat:0,bootstrapScriptContent:r,bootstrapScripts:i,bootstrapModules:n,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function ew(){return{htmlChunks:null,headChunks:null,bodyChunks:null}}function e_(e,t,r,i){return{insertionMode:e,selectedValue:t,tagScope:r,viewTransition:i}}function eC(e){return e_("http://www.w3.org/2000/svg"===e?4:5*("http://www.w3.org/1998/Math/MathML"===e),null,0,null)}function eM(e,t,r){var i=-25&e.tagScope;switch(t){case"noscript":return e_(2,null,1|i,null);case"select":return e_(2,null!=r.value?r.value:r.defaultValue,i,null);case"svg":return e_(4,null,i,null);case"picture":return e_(2,null,2|i,null);case"math":return e_(5,null,i,null);case"foreignObject":return e_(2,null,i,null);case"table":return e_(6,null,i,null);case"thead":case"tbody":case"tfoot":return e_(7,null,i,null);case"colgroup":return e_(9,null,i,null);case"tr":return e_(8,null,i,null);case"head":if(2>e.insertionMode)return e_(3,null,i,null);break;case"html":if(0===e.insertionMode)return e_(1,null,i,null)}return 6<=e.insertionMode||2>e.insertionMode?e_(2,null,i,null):e.tagScope!==i?e_(e.insertionMode,e.selectedValue,i,null):e}function eI(e){return null===e?null:{update:e.update,enter:"none",exit:"none",share:e.update,name:e.autoName,autoName:e.autoName,nameIdx:0}}function eT(e,t){return 32&t.tagScope&&(e.instructions|=128),e_(t.insertionMode,t.selectedValue,12|t.tagScope,eI(t.viewTransition))}function eR(e,t){e=eI(t.viewTransition);var r=16|t.tagScope;return null!==e&&"none"!==e.share&&(r|=64),e_(t.insertionMode,t.selectedValue,r,e)}var eB=Q("\x3c!-- --\x3e");function ek(e,t,r,i){return""===t?i:(i&&e.push(eB),e.push(O(J(t))),!0)}var eP=new Map,eD=Q(' style="'),eL=Q(":"),eF=Q(";");function eN(e,t){if("object"!=typeof t)throw Error(a(62));var r,i=!0;for(r in t)if(V.call(t,r)){var n=t[r];if(null!=n&&"boolean"!=typeof n&&""!==n){if(0===r.indexOf("--")){var s=O(J(r));n=O(J((""+n).trim()))}else void 0===(s=eP.get(r))&&(s=Q(J(r.replace(Z,"-$1").toLowerCase().replace(ee,"-ms-"))),eP.set(r,s)),n="number"==typeof n?0===n||Y.has(r)?O(""+n):O(n+"px"):O(J((""+n).trim()));i?(i=!1,e.push(eD,s,eL,n)):e.push(eF,s,eL,n)}}i||e.push(eQ)}var eU=Q(" "),eO=Q('="'),eQ=Q('"'),ez=Q('=""');function eH(e,t,r){r&&"function"!=typeof r&&"symbol"!=typeof r&&e.push(eU,O(t),ez)}function eG(e,t,r){"function"!=typeof r&&"symbol"!=typeof r&&"boolean"!=typeof r&&e.push(eU,O(t),eO,O(J(r)),eQ)}var eV=Q(J("javascript:throw new Error('React form unexpectedly submitted.')")),ej=Q('<input type="hidden"');function eq(e,t){this.push(ej),eW(e),eG(this,"name",t),eG(this,"value",e),this.push(eJ)}function eW(e){if("string"!=typeof e)throw Error(a(480))}function eX(e,t){if("function"==typeof t.$$FORM_ACTION){var r=e.nextFormID++;e=e.idPrefix+r;try{var i=t.$$FORM_ACTION(e);if(i){var n=i.data;null!=n&&n.forEach(eW)}return i}catch(e){if("object"==typeof e&&null!==e&&"function"==typeof e.then)throw e}}return null}function eY(e,t,r,i,n,a,s,o){var l=null;if("function"==typeof i){var c=eX(t,i);null!==c?(o=c.name,i=c.action||"",n=c.encType,a=c.method,s=c.target,l=c.data):(e.push(eU,O("formAction"),eO,eV,eQ),s=a=n=i=o=null,e2(t,r))}return null!=o&&eK(e,"name",o),null!=i&&eK(e,"formAction",i),null!=n&&eK(e,"formEncType",n),null!=a&&eK(e,"formMethod",a),null!=s&&eK(e,"formTarget",s),l}function eK(e,t,r){switch(t){case"className":eG(e,"class",r);break;case"tabIndex":eG(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":eG(e,t,r);break;case"style":eN(e,r);break;case"src":case"href":if(""===r)break;case"action":case"formAction":if(null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r)break;r=er(""+r),e.push(eU,O(t),eO,O(J(r)),eQ);break;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"autoFocus":case"multiple":case"muted":eH(e,t.toLowerCase(),r);break;case"xlinkHref":if("function"==typeof r||"symbol"==typeof r||"boolean"==typeof r)break;r=er(""+r),e.push(eU,O("xlink:href"),eO,O(J(r)),eQ);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":"function"!=typeof r&&"symbol"!=typeof r&&e.push(eU,O(t),eO,O(J(r)),eQ);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!=typeof r&&"symbol"!=typeof r&&e.push(eU,O(t),ez);break;case"capture":case"download":!0===r?e.push(eU,O(t),ez):!1!==r&&"function"!=typeof r&&"symbol"!=typeof r&&e.push(eU,O(t),eO,O(J(r)),eQ);break;case"cols":case"rows":case"size":case"span":"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r&&e.push(eU,O(t),eO,O(J(r)),eQ);break;case"rowSpan":case"start":"function"==typeof r||"symbol"==typeof r||isNaN(r)||e.push(eU,O(t),eO,O(J(r)),eQ);break;case"xlinkActuate":eG(e,"xlink:actuate",r);break;case"xlinkArcrole":eG(e,"xlink:arcrole",r);break;case"xlinkRole":eG(e,"xlink:role",r);break;case"xlinkShow":eG(e,"xlink:show",r);break;case"xlinkTitle":eG(e,"xlink:title",r);break;case"xlinkType":eG(e,"xlink:type",r);break;case"xmlBase":eG(e,"xml:base",r);break;case"xmlLang":eG(e,"xml:lang",r);break;case"xmlSpace":eG(e,"xml:space",r);break;default:if((!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&X(t=K.get(t)||t)){switch(typeof r){case"function":case"symbol":return;case"boolean":var i=t.toLowerCase().slice(0,5);if("data-"!==i&&"aria-"!==i)return}e.push(eU,O(t),eO,O(J(r)),eQ)}}}var e$=Q(">"),eJ=Q("/>");function eZ(e,t,r){if(null!=t){if(null!=r)throw Error(a(60));if("object"!=typeof t||!("__html"in t))throw Error(a(61));null!=(t=t.__html)&&e.push(O(""+t))}}var e0=Q(' selected=""'),e1=Q('addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});');function e2(e,t){if(0==(16&e.instructions)){e.instructions|=16;var r=t.preamble,i=t.bootstrapChunks;(r.htmlChunks||r.headChunks)&&0===i.length?(i.push(t.startInlineScript),rT(i,e),i.push(e$,e1,eh)):i.unshift(t.startInlineScript,e$,e1,eh)}}var e3=Q("\x3c!--F!--\x3e"),e5=Q("\x3c!--F--\x3e");function e4(e,t){for(var r in e.push(tc("link")),t)if(V.call(t,r)){var i=t[r];if(null!=i)switch(r){case"children":case"dangerouslySetInnerHTML":throw Error(a(399,"link"));default:eK(e,r,i)}}return e.push(eJ),null}var e8=/(<\/|<)(s)(tyle)/gi;function e9(e,t,r,i){return""+t+("s"===r?"\\73 ":"\\53 ")+i}function e6(e,t,r){for(var i in e.push(tc(r)),t)if(V.call(t,i)){var n=t[i];if(null!=n)switch(i){case"children":case"dangerouslySetInnerHTML":throw Error(a(399,r));default:eK(e,i,n)}}return e.push(eJ),null}function e7(e,t){e.push(tc("title"));var r,i=null,n=null;for(r in t)if(V.call(t,r)){var a=t[r];if(null!=a)switch(r){case"children":i=a;break;case"dangerouslySetInnerHTML":n=a;break;default:eK(e,r,a)}}return e.push(e$),"function"!=typeof(t=Array.isArray(i)?2>i.length?i[0]:null:i)&&"symbol"!=typeof t&&null!=t&&e.push(O(J(""+t))),eZ(e,n,i),e.push(td("title")),null}var te=Q("\x3c!--head--\x3e"),tt=Q("\x3c!--body--\x3e"),tr=Q("\x3c!--html--\x3e");function ti(e,t){e.push(tc("script"));var r,i=null,n=null;for(r in t)if(V.call(t,r)){var a=t[r];if(null!=a)switch(r){case"children":i=a;break;case"dangerouslySetInnerHTML":n=a;break;default:eK(e,r,a)}}return e.push(e$),eZ(e,n,i),"string"==typeof i&&e.push(O((""+i).replace(eb,ev))),e.push(td("script")),null}function tn(e,t,r){e.push(tc(r));var i,n=r=null;for(i in t)if(V.call(t,i)){var a=t[i];if(null!=a)switch(i){case"children":r=a;break;case"dangerouslySetInnerHTML":n=a;break;default:eK(e,i,a)}}return e.push(e$),eZ(e,n,r),r}function ta(e,t,r){e.push(tc(r));var i,n=r=null;for(i in t)if(V.call(t,i)){var a=t[i];if(null!=a)switch(i){case"children":r=a;break;case"dangerouslySetInnerHTML":n=a;break;default:eK(e,i,a)}}return e.push(e$),eZ(e,n,r),"string"==typeof r?(e.push(O(J(r))),null):r}var ts=Q("\n"),to=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,tl=new Map;function tc(e){var t=tl.get(e);if(void 0===t){if(!to.test(e))throw Error(a(65,e));t=Q("<"+e),tl.set(e,t)}return t}var th=Q("<!DOCTYPE html>"),tu=new Map;function td(e){var t=tu.get(e);return void 0===t&&(t=Q("</"+e+">"),tu.set(e,t)),t}function tp(e,t){null===(e=e.preamble).htmlChunks&&t.htmlChunks&&(e.htmlChunks=t.htmlChunks),null===e.headChunks&&t.headChunks&&(e.headChunks=t.headChunks),null===e.bodyChunks&&t.bodyChunks&&(e.bodyChunks=t.bodyChunks)}function tf(e,t){t=t.bootstrapChunks;for(var r=0;r<t.length-1;r++)L(e,t[r]);return!(r<t.length)||(r=t[r],t.length=0,F(e,r))}var tg=Q("requestAnimationFrame(function(){$RT=performance.now()});"),tm=Q('<template id="'),tA=Q('"></template>'),tb=Q("\x3c!--&--\x3e"),tv=Q("\x3c!--/&--\x3e"),ty=Q("\x3c!--$--\x3e"),tx=Q('\x3c!--$?--\x3e<template id="'),tS=Q('"></template>'),tE=Q("\x3c!--$!--\x3e"),tw=Q("\x3c!--/$--\x3e"),t_=Q("<template"),tC=Q('"'),tM=Q(' data-dgst="');Q(' data-msg="'),Q(' data-stck="'),Q(' data-cstck="');var tI=Q("></template>");function tT(e,t,r){if(L(e,tx),null===r)throw Error(a(395));return L(e,t.boundaryPrefix),L(e,O(r.toString(16))),F(e,tS)}var tR=Q('<div hidden id="'),tB=Q('">'),tk=Q("</div>"),tP=Q('<svg aria-hidden="true" style="display:none" id="'),tD=Q('">'),tL=Q("</svg>"),tF=Q('<math aria-hidden="true" style="display:none" id="'),tN=Q('">'),tU=Q("</math>"),tO=Q('<table hidden id="'),tQ=Q('">'),tz=Q("</table>"),tH=Q('<table hidden><tbody id="'),tG=Q('">'),tV=Q("</tbody></table>"),tj=Q('<table hidden><tr id="'),tq=Q('">'),tW=Q("</tr></table>"),tX=Q('<table hidden><colgroup id="'),tY=Q('">'),tK=Q("</colgroup></table>"),t$=Q('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),tJ=Q('$RS("'),tZ=Q('","'),t0=Q('")<\/script>');Q('<template data-rsi="" data-sid="'),Q('" data-pid="');var t1=Q('$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};\n$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};');O('$RV=function(A,g){function k(a,b){var e=a.getAttribute(b);e&&(b=a.style,l.push(a,b.viewTransitionName,b.viewTransitionClass),"auto"!==e&&(b.viewTransitionClass=e),(a=a.getAttribute("vt-name"))||(a="_T_"+K++ +"_"),b.viewTransitionName=a,B=!0)}var B=!1,K=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var h=g[f].querySelectorAll("[vt-share]"),d=0;d<h.length;d++){var c=h[d];m.set(c.getAttribute("vt-name"),c)}var u=[];for(h=0;h<g.length;h+=2){var C=g[h],x=C.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){c=C;for(f=0;c;){if(8===c.nodeType){var r=c.data;if("/$"===r)if(0===f)break;else f--;else"$"!==r&&"$?"!==r&&"$~"!==r&&"$!"!==r||f++}else if(1===c.nodeType){d=c;var D=d.getAttribute("vt-name"),y=m.get(D);k(d,y?"vt-share":"vt-exit");y&&(k(y,"vt-share"),m.set(D,null));var E=d.querySelectorAll("[vt-share]");for(d=0;d<E.length;d++){var F=E[d],G=F.getAttribute("vt-name"),\nH=m.get(G);H&&(k(F,"vt-share"),k(H,"vt-share"),m.set(G,null))}}c=c.nextSibling}for(var I=g[h+1],t=I.firstElementChild;t;)null!==m.get(t.getAttribute("vt-name"))&&k(t,"vt-enter"),t=t.nextElementSibling;c=x;do for(var n=c.firstElementChild;n;){var J=n.getAttribute("vt-update");J&&"none"!==J&&!l.includes(n)&&k(n,"vt-update");n=n.nextElementSibling}while((c=c.parentNode)&&1===c.nodeType&&"none"!==c.getAttribute("vt-update"));u.push.apply(u,I.querySelectorAll(\'img[src]:not([loading="lazy"])\'))}}}if(B){var z=\ndocument.__reactViewTransition=document.startViewTransition({update:function(){A(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],b={},e=0;e<u.length;b={g:b.g},e++)if(b.g=u[e],!b.g.complete){var p=b.g.getBoundingClientRect();0<p.bottom&&0<p.right&&p.top<window.innerHeight&&p.left<window.innerWidth&&(p=new Promise(function(w){return function(q){w.g.addEventListener("load",q);w.g.addEventListener("error",q)}}(b)),a.push(p))}return Promise.race([Promise.all(a),new Promise(function(w){var q=\nperformance.now();setTimeout(w,2300>q&&2E3<q?2300-q:500)})])},types:[]});z.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var b=l[a],e=b.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];""===b.getAttribute("style")&&b.removeAttribute("style")}});z.finished.finally(function(){document.__reactViewTransition===z&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}A(g)}.bind(null,$RV);');var t2=Q('$RC("'),t3=Q('$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=\n"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=\n"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("'),t5=Q('$RR("'),t4=Q('","'),t8=Q('",'),t9=Q('"'),t6=Q(")<\/script>");Q('<template data-rci="" data-bid="'),Q('<template data-rri="" data-bid="'),Q('" data-sid="'),Q('" data-sty="');var t7=Q('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'),re=Q('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'),rt=Q('$RX("'),rr=Q('"'),ri=Q(","),rn=Q(")<\/script>");Q('<template data-rxi="" data-bid="'),Q('" data-dgst="'),Q('" data-msg="'),Q('" data-stck="'),Q('" data-cstck="');var ra=/[<\u2028\u2029]/g,rs=/[&><\u2028\u2029]/g;function ro(e){return JSON.stringify(e).replace(rs,function(e){switch(e){case"&":return"\\u0026";case">":return"\\u003e";case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var rl=Q(' media="not all" data-precedence="'),rc=Q('" data-href="'),rh=Q('">'),ru=Q("</style>"),rd=!1,rp=!0;function rf(e){var t=e.rules,r=e.hrefs,i=0;if(r.length){for(L(this,el.startInlineStyle),L(this,rl),L(this,e.precedence),L(this,rc);i<r.length-1;i++)L(this,r[i]),L(this,rS);for(L(this,r[i]),L(this,rh),i=0;i<t.length;i++)L(this,t[i]);rp=F(this,ru),rd=!0,t.length=0,r.length=0}}function rg(e){return 2!==e.state&&(rd=!0)}function rm(e,t,r){return rd=!1,rp=!0,el=r,t.styles.forEach(rf,e),el=null,t.stylesheets.forEach(rg),rd&&(r.stylesToHoist=!0),rp}function rA(e){for(var t=0;t<e.length;t++)L(this,e[t]);e.length=0}var rb=[];function rv(e){e4(rb,e.props);for(var t=0;t<rb.length;t++)L(this,rb[t]);rb.length=0,e.state=2}var ry=Q(' data-precedence="'),rx=Q('" data-href="'),rS=Q(" "),rE=Q('">'),rw=Q("</style>");function r_(e){var t=0<e.sheets.size;e.sheets.forEach(rv,this),e.sheets.clear();var r=e.rules,i=e.hrefs;if(!t||i.length){if(L(this,el.startInlineStyle),L(this,ry),L(this,e.precedence),e=0,i.length){for(L(this,rx);e<i.length-1;e++)L(this,i[e]),L(this,rS);L(this,i[e])}for(L(this,rE),e=0;e<r.length;e++)L(this,r[e]);L(this,rw),r.length=0,i.length=0}}function rC(e){if(0===e.state){e.state=1;var t=e.props;for(e4(rb,{rel:"preload",as:"style",href:e.props.href,crossOrigin:t.crossOrigin,fetchPriority:t.fetchPriority,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy}),e=0;e<rb.length;e++)L(this,rb[e]);rb.length=0}}function rM(e){e.sheets.forEach(rC,this),e.sheets.clear()}Q('<link rel="expect" href="#'),Q('" blocking="render"/>');var rI=Q(' id="');function rT(e,t){0==(32&t.instructions)&&(t.instructions|=32,e.push(rI,O(J("_"+t.idPrefix+"R_")),eQ))}var rR=Q("["),rB=Q(",["),rk=Q(","),rP=Q("]");function rD(){return{styles:new Set,stylesheets:new Set,suspenseyImages:!1}}function rL(e,t){null==e.crossOrigin&&(e.crossOrigin=t[0]),null==e.integrity&&(e.integrity=t[1])}function rF(e,t,r){for(var i in t="<"+(e=(""+e).replace(rN,rU))+'>; rel=preload; as="'+(t=(""+t).replace(rO,rQ))+'"',r)V.call(r,i)&&"string"==typeof(e=r[i])&&(t+="; "+i.toLowerCase()+'="'+(""+e).replace(rO,rQ)+'"');return t}var rN=/[<>\r\n]/g;function rU(e){switch(e){case"<":return"%3C";case">":return"%3E";case"\n":return"%0A";case"\r":return"%0D";default:throw Error("escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}var rO=/["';,\r\n]/g;function rQ(e){switch(e){case'"':return"%22";case"'":return"%27";case";":return"%3B";case",":return"%2C";case"\n":return"%0A";case"\r":return"%0D";default:throw Error("escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}function rz(e){this.styles.add(e)}function rH(e){this.stylesheets.add(e)}function rG(e,t){t.styles.forEach(rz,e),t.stylesheets.forEach(rH,e),t.suspenseyImages&&(e.suspenseyImages=!0)}function rV(e){return 0<e.stylesheets.size||e.suspenseyImages}var rj=Function.prototype.bind,rq=Symbol.for("react.client.reference");function rW(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===rq?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case l:return"Fragment";case h:return"Profiler";case c:return"StrictMode";case f:return"Suspense";case g:return"SuspenseList";case v:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case o:return"Portal";case d:return e.displayName||"Context";case u:return(e._context.displayName||"Context")+".Consumer";case p:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case m:return null!==(t=e.displayName||null)?t:rW(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return rW(e(t))}catch(e){}}return null}var rX={},rY=null;function rK(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var r=t.parent;if(null===e){if(null!==r)throw Error(a(401))}else{if(null===r)throw Error(a(401));rK(e,r)}t.context._currentValue=t.value}}function r$(e){var t=rY;t!==e&&(null===t?function e(t){var r=t.parent;null!==r&&e(r),t.context._currentValue=t.value}(e):null===e?function e(t){t.context._currentValue=t.parentValue,null!==(t=t.parent)&&e(t)}(t):t.depth===e.depth?rK(t,e):t.depth>e.depth?function e(t,r){if(t.context._currentValue=t.parentValue,null===(t=t.parent))throw Error(a(402));t.depth===r.depth?rK(t,r):e(t,r)}(t,e):function e(t,r){var i=r.parent;if(null===i)throw Error(a(402));t.depth===i.depth?rK(t,i):e(t,i),r.context._currentValue=r.value}(t,e),rY=e)}var rJ={enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}},rZ={id:1,overflow:""};function r0(e,t,r){var i=e.id;e=e.overflow;var n=32-r1(i)-1;i&=~(1<<n),r+=1;var a=32-r1(t)+n;if(30<a){var s=n-n%5;return a=(i&(1<<s)-1).toString(32),i>>=s,n-=s,{id:1<<32-r1(t)+n|r<<n|i,overflow:a+e}}return{id:1<<a|r<<n|i,overflow:e}}var r1=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(r2(e)/r3|0)|0},r2=Math.log,r3=Math.LN2;function r5(){}var r4=Error(a(460)),r8=null;function r9(){if(null===r8)throw Error(a(459));var e=r8;return r8=null,e}var r6="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r7=null,ie=null,it=null,ir=null,ii=null,ia=null,is=!1,io=!1,il=0,ic=0,ih=-1,iu=0,id=null,ip=null,ig=0;function im(){if(null===r7)throw Error(a(321));return r7}function iA(){if(0<ig)throw Error(a(312));return{memoizedState:null,queue:null,next:null}}function ib(){return null===ia?null===ii?(is=!1,ii=ia=iA()):(is=!0,ia=ii):null===ia.next?(is=!1,ia=ia.next=iA()):(is=!0,ia=ia.next),ia}function iv(){var e=id;return id=null,e}function iy(){ir=it=ie=r7=null,io=!1,ii=null,ig=0,ia=ip=null}function ix(e,t){return"function"==typeof t?t(e):t}function iS(e,t,r){if(r7=im(),ia=ib(),is){var i=ia.queue;if(t=i.dispatch,null!==ip&&void 0!==(r=ip.get(i))){ip.delete(i),i=ia.memoizedState;do i=e(i,r.action),r=r.next;while(null!==r);return ia.memoizedState=i,[i,t]}return[ia.memoizedState,t]}return e=e===ix?"function"==typeof t?t():t:void 0!==r?r(t):t,ia.memoizedState=e,e=(e=ia.queue={last:null,dispatch:null}).dispatch=iw.bind(null,r7,e),[ia.memoizedState,e]}function iE(e,t){if(r7=im(),ia=ib(),t=void 0===t?null:t,null!==ia){var r=ia.memoizedState;if(null!==r&&null!==t){var i=r[1];e:if(null===i)i=!1;else{for(var n=0;n<i.length&&n<t.length;n++)if(!r6(t[n],i[n])){i=!1;break e}i=!0}if(i)return r[0]}}return e=e(),ia.memoizedState=[e,t],e}function iw(e,t,r){if(25<=ig)throw Error(a(301));if(e===r7)if(io=!0,e={action:r,next:null},null===ip&&(ip=new Map),void 0===(r=ip.get(t)))ip.set(t,e);else{for(t=r;null!==t.next;)t=t.next;t.next=e}}function i_(){throw Error(a(440))}function iC(){throw Error(a(394))}function iM(){throw Error(a(479))}function iI(e,t,r){im();var i=ic++,n=it;if("function"==typeof e.$$FORM_ACTION){var a=null,s=ir;n=n.formState;var o=e.$$IS_SIGNATURE_EQUAL;if(null!==n&&"function"==typeof o){var l=n[1];o.call(e,n[2],n[3])&&l===(a=void 0!==r?"p"+r:"k"+C(JSON.stringify([s,null,i]),0))&&(ih=i,t=n[0])}var c=e.bind(null,t);return e=function(e){c(e)},"function"==typeof c.$$FORM_ACTION&&(e.$$FORM_ACTION=function(e){e=c.$$FORM_ACTION(e),void 0!==r&&(r+="",e.action=r);var t=e.data;return t&&(null===a&&(a=void 0!==r?"p"+r:"k"+C(JSON.stringify([s,null,i]),0)),t.append("$ACTION_KEY",a)),e}),[t,e,!1]}var h=e.bind(null,t);return[t,function(e){h(e)},!1]}function iT(e){var t=iu;iu+=1,null===id&&(id=[]);var r=id,i=e,n=t;switch(void 0===(n=r[n])?r.push(i):n!==i&&(i.then(r5,r5),i=n),i.status){case"fulfilled":return i.value;case"rejected":throw i.reason;default:switch("string"==typeof i.status?i.then(r5,r5):((r=i).status="pending",r.then(function(e){if("pending"===i.status){var t=i;t.status="fulfilled",t.value=e}},function(e){if("pending"===i.status){var t=i;t.status="rejected",t.reason=e}})),i.status){case"fulfilled":return i.value;case"rejected":throw i.reason}throw r8=i,r4}}function iR(){throw Error(a(393))}var iB,ik,iP={readContext:function(e){return e._currentValue},use:function(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return iT(e);if(e.$$typeof===d)return e._currentValue}throw Error(a(438,String(e)))},useContext:function(e){return im(),e._currentValue},useMemo:iE,useReducer:iS,useRef:function(e){r7=im();var t=(ia=ib()).memoizedState;return null===t?(e={current:e},ia.memoizedState=e):t},useState:function(e){return iS(ix,e)},useInsertionEffect:r5,useLayoutEffect:r5,useCallback:function(e,t){return iE(function(){return e},t)},useImperativeHandle:r5,useEffect:r5,useDebugValue:r5,useDeferredValue:function(e,t){return im(),void 0!==t?t:e},useTransition:function(){return im(),[!1,iC]},useId:function(){var e=ie.treeContext,t=e.overflow;e=((e=e.id)&~(1<<32-r1(e)-1)).toString(32)+t;var r=iD;if(null===r)throw Error(a(404));return t=il++,e="_"+r.idPrefix+"R_"+e,0<t&&(e+="H"+t.toString(32)),e+"_"},useSyncExternalStore:function(e,t,r){if(void 0===r)throw Error(a(407));return r()},useOptimistic:function(e){return im(),[e,iM]},useActionState:iI,useFormState:iI,useHostTransitionStatus:function(){return im(),ea},useMemoCache:function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=x;return t},useCacheRefresh:function(){return iR},useEffectEvent:function(){return i_}},iD=null,iL={getCacheForType:function(){throw Error(a(248))},cacheSignal:function(){throw Error(a(248))}};function iF(e){if(void 0===iB)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);iB=t&&t[1]||"",ik=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+iB+e+ik}var iN=!1;function iU(e,t){if(!e||iN)return"";iN=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var r=function(){throw Error()};if(Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(r,[])}catch(e){var i=e}Reflect.construct(e,[],r)}else{try{r.call()}catch(e){i=e}e.call(r.prototype)}}else{try{throw Error()}catch(e){i=e}(r=e())&&"function"==typeof r.catch&&r.catch(function(){})}}catch(e){if(e&&i&&"string"==typeof e.stack)return[e.stack,i.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),s=a[0],o=a[1];if(s&&o){var l=s.split("\n"),c=o.split("\n");for(n=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;n<c.length&&!c[n].includes("DetermineComponentFrameRoot");)n++;if(i===l.length||n===c.length)for(i=l.length-1,n=c.length-1;1<=i&&0<=n&&l[i]!==c[n];)n--;for(;1<=i&&0<=n;i--,n--)if(l[i]!==c[n]){if(1!==i||1!==n)do if(i--,n--,0>n||l[i]!==c[n]){var h="\n"+l[i].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=i&&0<=n);break}}}finally{iN=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?iF(r):""}function iO(e,t){return(500<t.byteSize||rV(t.contentState))&&null===t.contentPreamble}function iQ(e){if("object"==typeof e&&null!==e&&"string"==typeof e.environmentName){var t=e.environmentName;"string"==typeof(e=[e])[0]?e.splice(0,1,"%c%s%c "+e[0],"background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px"," "+t+" ",""):e.splice(0,0,"%c%s%c","background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px"," "+t+" ",""),e.unshift(console),(t=rj.apply(console.error,e))()}else console.error(e);return null}function iz(e,t,r,i,n,a,s,o,l,c,h){var u=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=e,this.renderState=t,this.rootFormatContext=r,this.progressiveChunkSize=void 0===i?12800:i,this.status=10,this.fatalError=null,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedPreambleSegments=this.completedRootSegment=null,this.byteSize=0,this.abortableTasks=u,this.pingedTasks=[],this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.trackedPostpones=null,this.onError=void 0===n?iQ:n,this.onPostpone=void 0===c?r5:c,this.onAllReady=void 0===a?r5:a,this.onShellReady=void 0===s?r5:s,this.onShellError=void 0===o?r5:o,this.onFatalError=void 0===l?r5:l,this.formState=void 0===h?null:h}function iH(e,t,r,i,n,a,s,o,l,c,h,u){return(r=iY(t=new iz(t,r,i,n,a,s,o,l,c,h,u),0,null,i,!1,!1)).parentFlushed=!0,iK(e=iW(t,null,e,-1,null,r,null,null,t.abortableTasks,null,i,null,rZ,null,null)),t.pingedTasks.push(e),t}function iG(e,t,r,i,n,a,s,o,l){return((r=new iz(t.resumableState,r,t.rootFormatContext,t.progressiveChunkSize,i,n,a,s,o,l,null)).nextSegmentId=t.nextSegmentId,"number"==typeof t.replaySlots)?((i=iY(r,0,null,t.rootFormatContext,!1,!1)).parentFlushed=!0,iK(e=iW(r,null,e,-1,null,i,null,null,r.abortableTasks,null,t.rootFormatContext,null,rZ,null,null))):iK(e=iX(r,null,{nodes:t.replayNodes,slots:t.replaySlots,pendingTasks:0},e,-1,null,null,r.abortableTasks,null,t.rootFormatContext,null,rZ,null,null)),r.pingedTasks.push(e),r}var iV=null;function ij(e,t){e.pingedTasks.push(t),1===e.pingedTasks.length&&(e.flushScheduled=null!==e.destination,null!==e.trackedPostpones||10===e.status?k(function(){return nA(e)}):T(function(){return nA(e)}))}function iq(e,t,r,i,n){return r={status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,row:t,completedSegments:[],byteSize:0,fallbackAbortableTasks:r,errorDigest:null,contentState:rD(),fallbackState:rD(),contentPreamble:i,fallbackPreamble:n,trackedContentKeyPath:null,trackedFallbackNode:null},null!==t&&(t.pendingTasks++,null!==(i=t.boundaries)&&(e.allPendingTasks++,r.pendingTasks++,i.push(r)),null!==(e=t.inheritedHoistables)&&rG(r.contentState,e)),r}function iW(e,t,r,i,n,a,s,o,l,c,h,u,d,p,f){e.allPendingTasks++,null===n?e.pendingRootTasks++:n.pendingTasks++,null!==p&&p.pendingTasks++;var g={replay:null,node:r,childIndex:i,ping:function(){return ij(e,g)},blockedBoundary:n,blockedSegment:a,blockedPreamble:s,hoistableState:o,abortSet:l,keyPath:c,formatContext:h,context:u,treeContext:d,row:p,componentStack:f,thenableState:t};return l.add(g),g}function iX(e,t,r,i,n,a,s,o,l,c,h,u,d,p){e.allPendingTasks++,null===a?e.pendingRootTasks++:a.pendingTasks++,null!==d&&d.pendingTasks++,r.pendingTasks++;var f={replay:r,node:i,childIndex:n,ping:function(){return ij(e,f)},blockedBoundary:a,blockedSegment:null,blockedPreamble:null,hoistableState:s,abortSet:o,keyPath:l,formatContext:c,context:h,treeContext:u,row:d,componentStack:p,thenableState:t};return o.add(f),f}function iY(e,t,r,i,n,a){return{status:0,parentFlushed:!1,id:-1,index:t,chunks:[],children:[],preambleChildren:[],parentFormatContext:i,boundary:r,lastPushedText:n,textEmbedded:a}}function iK(e){var t=e.node;"object"==typeof t&&null!==t&&t.$$typeof===s&&(e.componentStack={parent:e.componentStack,type:t.type})}function i$(e){return null===e?null:{parent:e.parent,type:"Suspense Fallback"}}function iJ(e){var t={};return e&&Object.defineProperty(t,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var r="",i=e;do r+=function e(t){if("string"==typeof t)return iF(t);if("function"==typeof t)return t.prototype&&t.prototype.isReactComponent?iU(t,!0):iU(t,!1);if("object"==typeof t&&null!==t){switch(t.$$typeof){case p:return iU(t.render,!1);case m:return iU(t.type,!1);case A:var r=t,i=r._payload;r=r._init;try{t=r(i)}catch(e){return iF("Lazy")}return e(t)}if("string"==typeof t.name){e:{i=t.name,r=t.env;var n=t.debugLocation;if(null!=n&&(t=Error.prepareStackTrace,Error.prepareStackTrace=void 0,n=n.stack,Error.prepareStackTrace=t,n.startsWith("Error: react-stack-top-frame\n")&&(n=n.slice(29)),-1!==(t=n.indexOf("\n"))&&(n=n.slice(t+1)),-1!==(t=n.indexOf("react_stack_bottom_frame"))&&(t=n.lastIndexOf("\n",t)),-1!==(t=-1===(n=(t=-1!==t?n=n.slice(0,t):"").lastIndexOf("\n"))?t:t.slice(n+1)).indexOf(i))){i="\n"+t;break e}i=iF(i+(r?" ["+r+"]":""))}return i}}switch(t){case g:return iF("SuspenseList");case f:return iF("Suspense")}return""}(i.type),i=i.parent;while(i);var n=r}catch(e){n="\nError generating stack: "+e.message+"\n"+e.stack}return Object.defineProperty(t,"componentStack",{value:n}),n}}),t}function iZ(e,t,r){if(null==(t=(e=e.onError)(t,r))||"string"==typeof t)return t}function i0(e,t){var r=e.onShellError,i=e.onFatalError;r(t),i(t),null!==e.destination?(e.status=14,H(e.destination,t)):(e.status=13,e.fatalError=t)}function i1(e,t){i2(e,t.next,t.hoistables)}function i2(e,t,r){for(;null!==t;){null!==r&&(rG(t.hoistables,r),t.inheritedHoistables=r);var i=t.boundaries;if(null!==i){t.boundaries=null;for(var n=0;n<i.length;n++){var a=i[n];null!==r&&rG(a.contentState,r),nm(e,a,null,null)}}if(t.pendingTasks--,0<t.pendingTasks)break;r=t.hoistables,t=t.next}}function i3(e,t){var r=t.boundaries;if(null!==r&&t.pendingTasks===r.length){for(var i=!0,n=0;n<r.length;n++){var a=r[n];if(1!==a.pendingTasks||a.parentFlushed||iO(e,a)){i=!1;break}}i&&i2(e,t,t.hoistables)}}function i5(e){var t={pendingTasks:1,boundaries:null,hoistables:rD(),inheritedHoistables:null,together:!1,next:null};return null!==e&&0<e.pendingTasks&&(t.pendingTasks++,t.boundaries=[],e.next=t),t}function i4(e,t,r,i,n){var a=t.keyPath,s=t.treeContext,o=t.row;t.keyPath=r,r=i.length;var l=null;if(null!==t.replay){var c=t.replay.slots;if(null!==c&&"object"==typeof c)for(var h=0;h<r;h++){var u="backwards"!==n&&"unstable_legacy-backwards"!==n?h:r-1-h,d=i[u];t.row=l=i5(l),t.treeContext=r0(s,r,u);var p=c[u];"number"==typeof p?(i7(e,t,p,d,u),delete c[u]):nl(e,t,d,u),0==--l.pendingTasks&&i1(e,l)}else for(c=0;c<r;c++)u=i[h="backwards"!==n&&"unstable_legacy-backwards"!==n?c:r-1-c],t.row=l=i5(l),t.treeContext=r0(s,r,h),nl(e,t,u,h),0==--l.pendingTasks&&i1(e,l)}else if("backwards"!==n&&"unstable_legacy-backwards"!==n)for(n=0;n<r;n++)c=i[n],t.row=l=i5(l),t.treeContext=r0(s,r,n),nl(e,t,c,n),0==--l.pendingTasks&&i1(e,l);else{for(c=(n=t.blockedSegment).children.length,h=n.chunks.length,u=r-1;0<=u;u--){d=i[u],t.row=l=i5(l),t.treeContext=r0(s,r,u),p=iY(e,h,null,t.formatContext,0!==u||n.lastPushedText,!0),n.children.splice(c,0,p),t.blockedSegment=p;try{nl(e,t,d,u),p.lastPushedText&&p.textEmbedded&&p.chunks.push(eB),p.status=1,ng(e,t.blockedBoundary,p),0==--l.pendingTasks&&i1(e,l)}catch(t){throw p.status=12===e.status?3:4,t}}t.blockedSegment=n,n.lastPushedText=!1}null!==o&&null!==l&&0<l.pendingTasks&&(o.pendingTasks++,l.next=o),t.treeContext=s,t.row=o,t.keyPath=a}function i8(e,t,r,i,n,a){var s=t.thenableState;for(t.thenableState=null,r7={},ie=t,it=e,ir=r,ic=il=0,ih=-1,iu=0,id=s,e=i(n,a);io;)io=!1,ic=il=0,ih=-1,iu=0,ig+=1,ia=null,e=i(n,a);return iy(),e}function i9(e,t,r,i,n,a,s){var o=!1;if(0!==a&&null!==e.formState){var l=t.blockedSegment;if(null!==l){o=!0,l=l.chunks;for(var c=0;c<a;c++)c===s?l.push(e3):l.push(e5)}}a=t.keyPath,t.keyPath=r,n?(r=t.treeContext,t.treeContext=r0(r,1,0),nl(e,t,i,-1),t.treeContext=r):o?nl(e,t,i,-1):ne(e,t,i,-1),t.keyPath=a}function i6(e,t,r,n,s,o){if("function"==typeof n)if(n.prototype&&n.prototype.isReactComponent){var x=s;if("ref"in s)for(var E in x={},s)"ref"!==E&&(x[E]=s[E]);var C=n.defaultProps;if(C)for(var M in x===s&&(x=G({},x,s)),C)void 0===x[M]&&(x[M]=C[M]);s=x,x=rX,"object"==typeof(C=n.contextType)&&null!==C&&(x=C._currentValue);var I=void 0!==(x=new n(s,x)).state?x.state:null;if(x.updater=rJ,x.props=s,x.state=I,C={queue:[],replace:!1},x._reactInternals=C,o=n.contextType,x.context="object"==typeof o&&null!==o?o._currentValue:rX,"function"==typeof(o=n.getDerivedStateFromProps)&&(I=null==(o=o(s,I))?I:G({},I,o),x.state=I),"function"!=typeof n.getDerivedStateFromProps&&"function"!=typeof x.getSnapshotBeforeUpdate&&("function"==typeof x.UNSAFE_componentWillMount||"function"==typeof x.componentWillMount))if(n=x.state,"function"==typeof x.componentWillMount&&x.componentWillMount(),"function"==typeof x.UNSAFE_componentWillMount&&x.UNSAFE_componentWillMount(),n!==x.state&&rJ.enqueueReplaceState(x,x.state,null),null!==C.queue&&0<C.queue.length)if(n=C.queue,o=C.replace,C.queue=null,C.replace=!1,o&&1===n.length)x.state=n[0];else{for(C=o?n[0]:x.state,I=!0,o=+!!o;o<n.length;o++)null!=(M="function"==typeof(M=n[o])?M.call(x,C,s,void 0):M)&&(I?(I=!1,C=G({},C,M)):G(C,M));x.state=C}else C.queue=null;if(n=x.render(),12===e.status)throw null;s=t.keyPath,t.keyPath=r,ne(e,t,n,-1),t.keyPath=s}else{if(n=i8(e,t,r,n,s,void 0),12===e.status)throw null;i9(e,t,r,n,0!==il,ic,ih)}else if("string"==typeof n)if(null===(x=t.blockedSegment))x=s.children,C=t.formatContext,I=t.keyPath,t.formatContext=eM(C,n,s),t.keyPath=r,nl(e,t,x,-1),t.formatContext=C,t.keyPath=I;else{if(I=function(e,t,r,n,s,o,l,c,h){switch(t){case"div":case"span":case"svg":case"path":case"g":case"p":case"li":case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":break;case"a":e.push(tc("a"));var u,d=null,p=null;for(u in r)if(V.call(r,u)){var f=r[u];if(null!=f)switch(u){case"children":d=f;break;case"dangerouslySetInnerHTML":p=f;break;case"href":""===f?eG(e,"href",""):eK(e,u,f);break;default:eK(e,u,f)}}if(e.push(e$),eZ(e,p,d),"string"==typeof d){e.push(O(J(d)));var g=null}else g=d;return g;case"select":e.push(tc("select"));var m,A=null,b=null;for(m in r)if(V.call(r,m)){var v=r[m];if(null!=v)switch(m){case"children":A=v;break;case"dangerouslySetInnerHTML":b=v;break;case"defaultValue":case"value":break;default:eK(e,m,v)}}return e.push(e$),eZ(e,b,A),A;case"option":var y=c.selectedValue;e.push(tc("option"));var x,S=null,E=null,w=null,C=null;for(x in r)if(V.call(r,x)){var M=r[x];if(null!=M)switch(x){case"children":S=M;break;case"selected":w=M;break;case"dangerouslySetInnerHTML":C=M;break;case"value":E=M;default:eK(e,x,M)}}if(null!=y){var I,T,R=null!==E?""+E:(I=S,T="",i.Children.forEach(I,function(e){null!=e&&(T+=e)}),T);if(_(y)){for(var B=0;B<y.length;B++)if(""+y[B]===R){e.push(e0);break}}else""+y===R&&e.push(e0)}else w&&e.push(e0);return e.push(e$),eZ(e,C,S),S;case"textarea":e.push(tc("textarea"));var k,P=null,D=null,L=null;for(k in r)if(V.call(r,k)){var F=r[k];if(null!=F)switch(k){case"children":L=F;break;case"value":P=F;break;case"defaultValue":D=F;break;case"dangerouslySetInnerHTML":throw Error(a(91));default:eK(e,k,F)}}if(null===P&&null!==D&&(P=D),e.push(e$),null!=L){if(null!=P)throw Error(a(92));if(_(L)){if(1<L.length)throw Error(a(93));P=""+L[0]}P=""+L}return"string"==typeof P&&"\n"===P[0]&&e.push(ts),null!==P&&e.push(O(J(""+P))),null;case"input":e.push(tc("input"));var N,U=null,Q=null,z=null,H=null,j=null,q=null,W=null,Y=null,K=null;for(N in r)if(V.call(r,N)){var $=r[N];if(null!=$)switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(a(399,"input"));case"name":U=$;break;case"formAction":Q=$;break;case"formEncType":z=$;break;case"formMethod":H=$;break;case"formTarget":j=$;break;case"defaultChecked":K=$;break;case"defaultValue":W=$;break;case"checked":Y=$;break;case"value":q=$;break;default:eK(e,N,$)}}var Z=eY(e,n,s,Q,z,H,j,U);return null!==Y?eH(e,"checked",Y):null!==K&&eH(e,"checked",K),null!==q?eK(e,"value",q):null!==W&&eK(e,"value",W),e.push(eJ),null!=Z&&Z.forEach(eq,e),null;case"button":e.push(tc("button"));var ee,et=null,ei=null,en=null,ea=null,es=null,el=null,ec=null;for(ee in r)if(V.call(r,ee)){var eh=r[ee];if(null!=eh)switch(ee){case"children":et=eh;break;case"dangerouslySetInnerHTML":ei=eh;break;case"name":en=eh;break;case"formAction":ea=eh;break;case"formEncType":es=eh;break;case"formMethod":el=eh;break;case"formTarget":ec=eh;break;default:eK(e,ee,eh)}}var eu=eY(e,n,s,ea,es,el,ec,en);if(e.push(e$),null!=eu&&eu.forEach(eq,e),eZ(e,ei,et),"string"==typeof et){e.push(O(J(et)));var ed=null}else ed=et;return ed;case"form":e.push(tc("form"));var ep,ef=null,eg=null,em=null,eA=null,eb=null,ev=null;for(ep in r)if(V.call(r,ep)){var ey=r[ep];if(null!=ey)switch(ep){case"children":ef=ey;break;case"dangerouslySetInnerHTML":eg=ey;break;case"action":em=ey;break;case"encType":eA=ey;break;case"method":eb=ey;break;case"target":ev=ey;break;default:eK(e,ep,ey)}}var ex=null,eS=null;if("function"==typeof em){var eE=eX(n,em);null!==eE?(em=eE.action||"",eA=eE.encType,eb=eE.method,ev=eE.target,ex=eE.data,eS=eE.name):(e.push(eU,O("action"),eO,eV,eQ),ev=eb=eA=em=null,e2(n,s))}if(null!=em&&eK(e,"action",em),null!=eA&&eK(e,"encType",eA),null!=eb&&eK(e,"method",eb),null!=ev&&eK(e,"target",ev),e.push(e$),null!==eS&&(e.push(ej),eG(e,"name",eS),e.push(eJ),null!=ex&&ex.forEach(eq,e)),eZ(e,eg,ef),"string"==typeof ef){e.push(O(J(ef)));var ew=null}else ew=ef;return ew;case"menuitem":for(var e_ in e.push(tc("menuitem")),r)if(V.call(r,e_)){var eC=r[e_];if(null!=eC)switch(e_){case"children":case"dangerouslySetInnerHTML":throw Error(a(400));default:eK(e,e_,eC)}}return e.push(e$),null;case"object":e.push(tc("object"));var eM,eI=null,eT=null;for(eM in r)if(V.call(r,eM)){var eR=r[eM];if(null!=eR)switch(eM){case"children":eI=eR;break;case"dangerouslySetInnerHTML":eT=eR;break;case"data":var ek=er(""+eR);if(""===ek)break;e.push(eU,O("data"),eO,O(J(ek)),eQ);break;default:eK(e,eM,eR)}}if(e.push(e$),eZ(e,eT,eI),"string"==typeof eI){e.push(O(J(eI)));var eP=null}else eP=eI;return eP;case"title":var eD=1&c.tagScope,eL=4&c.tagScope;if(4===c.insertionMode||eD||null!=r.itemProp)var eF=e7(e,r);else eL?eF=null:(e7(s.hoistableChunks,r),eF=void 0);return eF;case"link":var ez=1&c.tagScope,eW=4&c.tagScope,e1=r.rel,e3=r.href,e5=r.precedence;if(4===c.insertionMode||ez||null!=r.itemProp||"string"!=typeof e1||"string"!=typeof e3||""===e3){e4(e,r);var to=null}else if("stylesheet"===r.rel)if("string"!=typeof e5||null!=r.disabled||r.onLoad||r.onError)to=e4(e,r);else{var tl=s.styles.get(e5),tu=n.styleResources.hasOwnProperty(e3)?n.styleResources[e3]:void 0;if(null!==tu){n.styleResources[e3]=null,tl||(tl={precedence:O(J(e5)),rules:[],hrefs:[],sheets:new Map},s.styles.set(e5,tl));var tp={state:0,props:G({},r,{"data-precedence":r.precedence,precedence:null})};if(tu){2===tu.length&&rL(tp.props,tu);var tf=s.preloads.stylesheets.get(e3);tf&&0<tf.length?tf.length=0:tp.state=1}tl.sheets.set(e3,tp),l&&l.stylesheets.add(tp)}else if(tl){var tg=tl.sheets.get(e3);tg&&l&&l.stylesheets.add(tg)}h&&e.push(eB),to=null}else r.onLoad||r.onError?to=e4(e,r):(h&&e.push(eB),to=eW?null:e4(s.hoistableChunks,r));return to;case"script":var tm=1&c.tagScope,tA=r.async;if("string"!=typeof r.src||!r.src||!tA||"function"==typeof tA||"symbol"==typeof tA||r.onLoad||r.onError||4===c.insertionMode||tm||null!=r.itemProp)var tb=ti(e,r);else{var tv=r.src;if("module"===r.type)var ty=n.moduleScriptResources,tx=s.preloads.moduleScripts;else ty=n.scriptResources,tx=s.preloads.scripts;var tS=ty.hasOwnProperty(tv)?ty[tv]:void 0;if(null!==tS){ty[tv]=null;var tE=r;if(tS){2===tS.length&&rL(tE=G({},r),tS);var tw=tx.get(tv);tw&&(tw.length=0)}var t_=[];s.scripts.add(t_),ti(t_,tE)}h&&e.push(eB),tb=null}return tb;case"style":var tC=1&c.tagScope,tM=r.precedence,tI=r.href,tT=r.nonce;if(4===c.insertionMode||tC||null!=r.itemProp||"string"!=typeof tM||"string"!=typeof tI||""===tI){e.push(tc("style"));var tR,tB=null,tk=null;for(tR in r)if(V.call(r,tR)){var tP=r[tR];if(null!=tP)switch(tR){case"children":tB=tP;break;case"dangerouslySetInnerHTML":tk=tP;break;default:eK(e,tR,tP)}}e.push(e$);var tD=Array.isArray(tB)?2>tB.length?tB[0]:null:tB;"function"!=typeof tD&&"symbol"!=typeof tD&&null!=tD&&e.push(O((""+tD).replace(e8,e9))),eZ(e,tk,tB),e.push(td("style"));var tL=null}else{var tF=s.styles.get(tM);if(null!==(n.styleResources.hasOwnProperty(tI)?n.styleResources[tI]:void 0)){n.styleResources[tI]=null,tF||(tF={precedence:O(J(tM)),rules:[],hrefs:[],sheets:new Map},s.styles.set(tM,tF));var tN=s.nonce.style;if(!tN||tN===tT){tF.hrefs.push(O(J(tI)));var tU,tO=tF.rules,tQ=null,tz=null;for(tU in r)if(V.call(r,tU)){var tH=r[tU];if(null!=tH)switch(tU){case"children":tQ=tH;break;case"dangerouslySetInnerHTML":tz=tH}}var tG=Array.isArray(tQ)?2>tQ.length?tQ[0]:null:tQ;"function"!=typeof tG&&"symbol"!=typeof tG&&null!=tG&&tO.push(O((""+tG).replace(e8,e9))),eZ(tO,tz,tQ)}}tF&&l&&l.styles.add(tF),h&&e.push(eB),tL=void 0}return tL;case"meta":var tV=1&c.tagScope,tj=4&c.tagScope;if(4===c.insertionMode||tV||null!=r.itemProp)var tq=e6(e,r,"meta");else h&&e.push(eB),tq=tj?null:"string"==typeof r.charSet?e6(s.charsetChunks,r,"meta"):"viewport"===r.name?e6(s.viewportChunks,r,"meta"):e6(s.hoistableChunks,r,"meta");return tq;case"listing":case"pre":e.push(tc(t));var tW,tX=null,tY=null;for(tW in r)if(V.call(r,tW)){var tK=r[tW];if(null!=tK)switch(tW){case"children":tX=tK;break;case"dangerouslySetInnerHTML":tY=tK;break;default:eK(e,tW,tK)}}if(e.push(e$),null!=tY){if(null!=tX)throw Error(a(60));if("object"!=typeof tY||!("__html"in tY))throw Error(a(61));var t$=tY.__html;null!=t$&&("string"==typeof t$&&0<t$.length&&"\n"===t$[0]?e.push(ts,O(t$)):e.push(O(""+t$)))}return"string"==typeof tX&&"\n"===tX[0]&&e.push(ts),tX;case"img":var tJ=3&c.tagScope,tZ=r.src,t0=r.srcSet;if(!("lazy"===r.loading||!tZ&&!t0||"string"!=typeof tZ&&null!=tZ||"string"!=typeof t0&&null!=t0||"low"===r.fetchPriority||tJ)&&("string"!=typeof tZ||":"!==tZ[4]||"d"!==tZ[0]&&"D"!==tZ[0]||"a"!==tZ[1]&&"A"!==tZ[1]||"t"!==tZ[2]&&"T"!==tZ[2]||"a"!==tZ[3]&&"A"!==tZ[3])&&("string"!=typeof t0||":"!==t0[4]||"d"!==t0[0]&&"D"!==t0[0]||"a"!==t0[1]&&"A"!==t0[1]||"t"!==t0[2]&&"T"!==t0[2]||"a"!==t0[3]&&"A"!==t0[3])){null!==l&&64&c.tagScope&&(l.suspenseyImages=!0);var t1="string"==typeof r.sizes?r.sizes:void 0,t2=t0?t0+"\n"+(t1||""):tZ,t3=s.preloads.images,t5=t3.get(t2);if(t5)("high"===r.fetchPriority||10>s.highImagePreloads.size)&&(t3.delete(t2),s.highImagePreloads.add(t5));else if(!n.imageResources.hasOwnProperty(t2)){n.imageResources[t2]=eo;var t4,t8=r.crossOrigin,t9="string"==typeof t8?"use-credentials"===t8?t8:"":void 0,t6=s.headers;t6&&0<t6.remainingCapacity&&"string"!=typeof r.srcSet&&("high"===r.fetchPriority||500>t6.highImagePreloads.length)&&(t4=rF(tZ,"image",{imageSrcSet:r.srcSet,imageSizes:r.sizes,crossOrigin:t9,integrity:r.integrity,nonce:r.nonce,type:r.type,fetchPriority:r.fetchPriority,referrerPolicy:r.refererPolicy}),0<=(t6.remainingCapacity-=t4.length+2))?(s.resets.image[t2]=eo,t6.highImagePreloads&&(t6.highImagePreloads+=", "),t6.highImagePreloads+=t4):(e4(t5=[],{rel:"preload",as:"image",href:t0?void 0:tZ,imageSrcSet:t0,imageSizes:t1,crossOrigin:t9,integrity:r.integrity,type:r.type,fetchPriority:r.fetchPriority,referrerPolicy:r.referrerPolicy}),"high"===r.fetchPriority||10>s.highImagePreloads.size?s.highImagePreloads.add(t5):(s.bulkPreloads.add(t5),t3.set(t2,t5)))}}return e6(e,r,"img");case"base":case"area":case"br":case"col":case"embed":case"hr":case"keygen":case"param":case"source":case"track":case"wbr":return e6(e,r,t);case"head":if(2>c.insertionMode){var t7=o||s.preamble;if(t7.headChunks)throw Error(a(545,"`<head>`"));null!==o&&e.push(te),t7.headChunks=[];var re=tn(t7.headChunks,r,"head")}else re=ta(e,r,"head");return re;case"body":if(2>c.insertionMode){var rt=o||s.preamble;if(rt.bodyChunks)throw Error(a(545,"`<body>`"));null!==o&&e.push(tt),rt.bodyChunks=[];var rr=tn(rt.bodyChunks,r,"body")}else rr=ta(e,r,"body");return rr;case"html":if(0===c.insertionMode){var ri=o||s.preamble;if(ri.htmlChunks)throw Error(a(545,"`<html>`"));null!==o&&e.push(tr),ri.htmlChunks=[th];var rn=tn(ri.htmlChunks,r,"html")}else rn=ta(e,r,"html");return rn;default:if(-1!==t.indexOf("-")){e.push(tc(t));var ra,rs=null,ro=null;for(ra in r)if(V.call(r,ra)){var rl=r[ra];if(null!=rl){var rc=ra;switch(ra){case"children":rs=rl;break;case"dangerouslySetInnerHTML":ro=rl;break;case"style":eN(e,rl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"className":rc="class";default:if(X(ra)&&"function"!=typeof rl&&"symbol"!=typeof rl&&!1!==rl){if(!0===rl)rl="";else if("object"==typeof rl)continue;e.push(eU,O(rc),eO,O(J(rl)),eQ)}}}}return e.push(e$),eZ(e,ro,rs),rs}}return ta(e,r,t)}(x.chunks,n,s,e.resumableState,e.renderState,t.blockedPreamble,t.hoistableState,t.formatContext,x.lastPushedText),x.lastPushedText=!1,C=t.formatContext,o=t.keyPath,t.keyPath=r,3===(t.formatContext=eM(C,n,s)).insertionMode){r=iY(e,0,null,t.formatContext,!1,!1),x.preambleChildren.push(r),t.blockedSegment=r;try{r.status=6,nl(e,t,I,-1),r.lastPushedText&&r.textEmbedded&&r.chunks.push(eB),r.status=1,ng(e,t.blockedBoundary,r)}finally{t.blockedSegment=x}}else nl(e,t,I,-1);t.formatContext=C,t.keyPath=o;e:{switch(t=x.chunks,e=e.resumableState,n){case"title":case"style":case"script":case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break e;case"body":if(1>=C.insertionMode){e.hasBody=!0;break e}break;case"html":if(0===C.insertionMode){e.hasHtml=!0;break e}break;case"head":if(1>=C.insertionMode)break e}t.push(td(n))}x.lastPushedText=!1}else{switch(n){case y:case c:case h:case l:n=t.keyPath,t.keyPath=r,ne(e,t,s.children,-1),t.keyPath=n;return;case v:null===(n=t.blockedSegment)?"hidden"!==s.mode&&(n=t.keyPath,t.keyPath=r,nl(e,t,s.children,-1),t.keyPath=n):"hidden"!==s.mode&&(n.chunks.push(tb),n.lastPushedText=!1,x=t.keyPath,t.keyPath=r,nl(e,t,s.children,-1),t.keyPath=x,n.chunks.push(tv),n.lastPushedText=!1);return;case g:e:{if(n=s.children,"forwards"===(s=s.revealOrder)||"backwards"===s||"unstable_legacy-backwards"===s){if(_(n)){i4(e,t,r,n,s);break e}if((x=w(n))&&(x=x.call(n))){if(!(C=x.next()).done){do C=x.next();while(!C.done);i4(e,t,r,n,s)}break e}}"together"===s?(s=t.keyPath,x=t.row,(C=t.row=i5(null)).boundaries=[],C.together=!0,t.keyPath=r,ne(e,t,n,-1),0==--C.pendingTasks&&i1(e,C),t.keyPath=s,t.row=x,null!==x&&0<C.pendingTasks&&(x.pendingTasks++,C.next=x)):(s=t.keyPath,t.keyPath=r,ne(e,t,n,-1),t.keyPath=s)}return;case S:case b:throw Error(a(343));case f:e:if(null!==t.replay){n=t.keyPath,x=t.formatContext,C=t.row,t.keyPath=r,t.formatContext=eR(e.resumableState,x),t.row=null,r=s.children;try{nl(e,t,r,-1)}finally{t.keyPath=n,t.formatContext=x,t.row=C}}else{n=t.keyPath,o=t.formatContext;var T=t.row;M=t.blockedBoundary,E=t.blockedPreamble;var R=t.hoistableState,B=t.blockedSegment,k=s.fallback;s=s.children;var P=new Set,D=2>t.formatContext.insertionMode?iq(e,t.row,P,ew(),ew()):iq(e,t.row,P,null,null);null!==e.trackedPostpones&&(D.trackedContentKeyPath=r);var L=iY(e,B.chunks.length,D,t.formatContext,!1,!1);B.children.push(L),B.lastPushedText=!1;var F=iY(e,0,null,t.formatContext,!1,!1);if(F.parentFlushed=!0,null!==e.trackedPostpones){x=t.componentStack,I=[(C=[r[0],"Suspense Fallback",r[2]])[1],C[2],[],null],e.trackedPostpones.workingMap.set(C,I),D.trackedFallbackNode=I,t.blockedSegment=L,t.blockedPreamble=D.fallbackPreamble,t.keyPath=C,t.formatContext=eT(e.resumableState,o),t.componentStack=i$(x),L.status=6;try{nl(e,t,k,-1),L.lastPushedText&&L.textEmbedded&&L.chunks.push(eB),L.status=1,ng(e,M,L)}catch(t){throw L.status=12===e.status?3:4,t}finally{t.blockedSegment=B,t.blockedPreamble=E,t.keyPath=n,t.formatContext=o}iK(t=iW(e,null,s,-1,D,F,D.contentPreamble,D.contentState,t.abortSet,r,eR(e.resumableState,t.formatContext),t.context,t.treeContext,null,x)),e.pingedTasks.push(t)}else{t.blockedBoundary=D,t.blockedPreamble=D.contentPreamble,t.hoistableState=D.contentState,t.blockedSegment=F,t.keyPath=r,t.formatContext=eR(e.resumableState,o),t.row=null,F.status=6;try{if(nl(e,t,s,-1),F.lastPushedText&&F.textEmbedded&&F.chunks.push(eB),F.status=1,ng(e,D,F),nf(D,F),0===D.pendingTasks&&0===D.status){if(D.status=1,!iO(e,D)){null!==T&&0==--T.pendingTasks&&i1(e,T),0===e.pendingRootTasks&&t.blockedPreamble&&ny(e);break e}}else null!==T&&T.together&&i3(e,T)}catch(r){D.status=4,12===e.status?(F.status=3,x=e.fatalError):(F.status=4,x=r),D.errorDigest=I=iZ(e,x,C=iJ(t.componentStack)),na(e,D)}finally{t.blockedBoundary=M,t.blockedPreamble=E,t.hoistableState=R,t.blockedSegment=B,t.keyPath=n,t.formatContext=o,t.row=T}iK(t=iW(e,null,k,-1,M,L,D.fallbackPreamble,D.fallbackState,P,[r[0],"Suspense Fallback",r[2]],eT(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,i$(t.componentStack))),e.pingedTasks.push(t)}}return}if("object"==typeof n&&null!==n)switch(n.$$typeof){case p:if("ref"in s)for(B in x={},s)"ref"!==B&&(x[B]=s[B]);else x=s;n=i8(e,t,r,n.render,x,o),i9(e,t,r,n,0!==il,ic,ih);return;case m:i6(e,t,r,n.type,s,o);return;case d:if(C=s.children,x=t.keyPath,s=s.value,I=n._currentValue,n._currentValue=s,rY=n={parent:o=rY,depth:null===o?0:o.depth+1,context:n,parentValue:I,value:s},t.context=n,t.keyPath=r,ne(e,t,C,-1),null===(e=rY))throw Error(a(403));e.context._currentValue=e.parentValue,e=rY=e.parent,t.context=e,t.keyPath=x;return;case u:n=(s=s.children)(n._context._currentValue),s=t.keyPath,t.keyPath=r,ne(e,t,n,-1),t.keyPath=s;return;case A:if(n=(x=n._init)(n._payload),12===e.status)throw null;i6(e,t,r,n,s,o);return}throw Error(a(130,null==n?n:typeof n,""))}}function i7(e,t,r,i,n){var a=t.replay,s=t.blockedBoundary,o=iY(e,0,null,t.formatContext,!1,!1);o.id=r,o.parentFlushed=!0;try{t.replay=null,t.blockedSegment=o,nl(e,t,i,n),o.status=1,ng(e,s,o),null===s?e.completedRootSegment=o:(nf(s,o),s.parentFlushed&&e.partialBoundaries.push(s))}finally{t.replay=a,t.blockedSegment=null}}function ne(e,t,r,i){null!==t.replay&&"number"==typeof t.replay.slots?i7(e,t,t.replay.slots,r,i):(t.node=r,t.childIndex=i,r=t.componentStack,iK(t),nt(e,t),t.componentStack=r)}function nt(e,t){var r=t.node,i=t.childIndex;if(null!==r){if("object"==typeof r){switch(r.$$typeof){case s:var n=r.type,l=r.key,c=r.props,h=void 0!==(r=c.ref)?r:null,u=rW(n),p=null==l?-1===i?0:i:l;if(l=[t.keyPath,u,p],null!==t.replay)e:{var g=t.replay;for(r=0,i=g.nodes;r<i.length;r++){var m=i[r];if(p===m[1]){if(4===m.length){if(null!==u&&u!==m[0])throw Error(a(490,m[0],u));var b=m[2];u=m[3],p=t.node,t.replay={nodes:b,slots:u,pendingTasks:1};try{if(i6(e,t,l,n,c,h),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(a(488));t.replay.pendingTasks--}catch(a){if("object"==typeof a&&null!==a&&(a===r4||"function"==typeof a.then))throw t.node===p?t.replay=g:i.splice(r,1),a;t.replay.pendingTasks--,c=iJ(t.componentStack),l=e,e=t.blockedBoundary,c=iZ(l,n=a,c),nh(l,e,b,u,n,c)}t.replay=g}else{if(n!==f)throw Error(a(490,"Suspense",rW(n)||"Unknown"));t:{g=void 0,n=m[5],h=m[2],u=m[3],p=null===m[4]?[]:m[4][2],m=null===m[4]?null:m[4][3];var v=t.keyPath,y=t.formatContext,x=t.row,S=t.replay,E=t.blockedBoundary,C=t.hoistableState,M=c.children,I=c.fallback,T=new Set;(c=2>t.formatContext.insertionMode?iq(e,t.row,T,ew(),ew()):iq(e,t.row,T,null,null)).parentFlushed=!0,c.rootSegmentID=n,t.blockedBoundary=c,t.hoistableState=c.contentState,t.keyPath=l,t.formatContext=eR(e.resumableState,y),t.row=null,t.replay={nodes:h,slots:u,pendingTasks:1};try{if(nl(e,t,M,-1),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(a(488));if(t.replay.pendingTasks--,0===c.pendingTasks&&0===c.status){c.status=1,e.completedBoundaries.push(c);break t}}catch(r){c.status=4,g=iZ(e,r,b=iJ(t.componentStack)),c.errorDigest=g,t.replay.pendingTasks--,e.clientRenderedBoundaries.push(c)}finally{t.blockedBoundary=E,t.hoistableState=C,t.replay=S,t.keyPath=v,t.formatContext=y,t.row=x}iK(b=iX(e,null,{nodes:p,slots:m,pendingTasks:0},I,-1,E,c.fallbackState,T,[l[0],"Suspense Fallback",l[2]],eT(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,i$(t.componentStack))),e.pingedTasks.push(b)}}i.splice(r,1);break e}}}else i6(e,t,l,n,c,h);return;case o:throw Error(a(257));case A:if(r=(b=r._init)(r._payload),12===e.status)throw null;ne(e,t,r,i);return}if(_(r))return void nr(e,t,r,i);if((b=w(r))&&(b=b.call(r))){if(!(r=b.next()).done){c=[];do c.push(r.value),r=b.next();while(!r.done);nr(e,t,c,i)}return}if("function"==typeof r.then)return t.thenableState=null,ne(e,t,iT(r),i);if(r.$$typeof===d)return ne(e,t,r._currentValue,i);throw Error(a(31,"[object Object]"===(i=Object.prototype.toString.call(r))?"object with keys {"+Object.keys(r).join(", ")+"}":i))}"string"==typeof r?null!==(i=t.blockedSegment)&&(i.lastPushedText=ek(i.chunks,r,e.renderState,i.lastPushedText)):("number"==typeof r||"bigint"==typeof r)&&null!==(i=t.blockedSegment)&&(i.lastPushedText=ek(i.chunks,""+r,e.renderState,i.lastPushedText))}}function nr(e,t,r,i){var n=t.keyPath;if(-1!==i&&(t.keyPath=[t.keyPath,"Fragment",i],null!==t.replay)){for(var s=t.replay,o=s.nodes,l=0;l<o.length;l++){var c=o[l];if(c[1]===i){t.replay={nodes:i=c[2],slots:c=c[3],pendingTasks:1};try{if(nr(e,t,r,-1),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(a(488));t.replay.pendingTasks--}catch(n){if("object"==typeof n&&null!==n&&(n===r4||"function"==typeof n.then))throw n;t.replay.pendingTasks--,r=iJ(t.componentStack);var h=t.blockedBoundary;r=iZ(e,n,r),nh(e,h,i,c,n,r)}t.replay=s,o.splice(l,1);break}}t.keyPath=n;return}if(s=t.treeContext,o=r.length,null!==t.replay&&null!==(l=t.replay.slots)&&"object"==typeof l){for(i=0;i<o;i++)c=r[i],t.treeContext=r0(s,o,i),"number"==typeof(h=l[i])?(i7(e,t,h,c,i),delete l[i]):nl(e,t,c,i);t.treeContext=s,t.keyPath=n;return}for(l=0;l<o;l++)i=r[l],t.treeContext=r0(s,o,l),nl(e,t,i,l);t.treeContext=s,t.keyPath=n}function ni(e,t,r){if(r.status=5,r.rootSegmentID=e.nextSegmentId++,null===(e=r.trackedContentKeyPath))throw Error(a(486));var i=r.trackedFallbackNode,n=t.workingMap.get(e);return void 0===n?(r=[e[1],e[2],[],null,i,r.rootSegmentID],t.workingMap.set(e,r),nP(r,e[0],t),r):(n[4]=i,n[5]=r.rootSegmentID,n)}function nn(e,t,r,i){i.status=5;var n=r.keyPath,s=r.blockedBoundary;if(null===s)i.id=e.nextSegmentId++,t.rootSlots=i.id,null!==e.completedRootSegment&&(e.completedRootSegment.status=5);else{if(null!==s&&0===s.status){var o=ni(e,t,s);if(s.trackedContentKeyPath===n&&-1===r.childIndex){-1===i.id&&(i.id=i.parentFlushed?s.rootSegmentID:e.nextSegmentId++),o[3]=i.id;return}}if(-1===i.id&&(i.id=i.parentFlushed&&null!==s?s.rootSegmentID:e.nextSegmentId++),-1===r.childIndex)null===n?t.rootSlots=i.id:void 0===(r=t.workingMap.get(n))?nP(r=[n[1],n[2],[],i.id],n[0],t):r[3]=i.id;else{if(null===n){if(null===(e=t.rootSlots))e=t.rootSlots={};else if("number"==typeof e)throw Error(a(491))}else if(void 0===(o=(s=t.workingMap).get(n)))e={},o=[n[1],n[2],[],e],s.set(n,o),nP(o,n[0],t);else if(null===(e=o[3]))e=o[3]={};else if("number"==typeof e)throw Error(a(491));e[r.childIndex]=i.id}}}function na(e,t){null!==(e=e.trackedPostpones)&&null!==(t=t.trackedContentKeyPath)&&void 0!==(t=e.workingMap.get(t))&&(t.length=4,t[2]=[],t[3]=null)}function ns(e,t,r){return iX(e,r,t.replay,t.node,t.childIndex,t.blockedBoundary,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function no(e,t,r){var i=t.blockedSegment,n=iY(e,i.chunks.length,null,t.formatContext,i.lastPushedText,!0);return i.children.push(n),i.lastPushedText=!1,iW(e,r,t.node,t.childIndex,t.blockedBoundary,n,t.blockedPreamble,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function nl(e,t,r,i){var n=t.formatContext,a=t.context,s=t.keyPath,o=t.treeContext,l=t.componentStack,c=t.blockedSegment;if(null===c){c=t.replay;try{return ne(e,t,r,i)}catch(h){if(iy(),r=h===r4?r9():h,12!==e.status&&"object"==typeof r&&null!==r){if("function"==typeof r.then){e=ns(e,t,i=h===r4?iv():null).ping,r.then(e,e),t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,t.componentStack=l,t.replay=c,r$(a);return}if("Maximum call stack size exceeded"===r.message){r=ns(e,t,r=h===r4?iv():null),e.pingedTasks.push(r),t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,t.componentStack=l,t.replay=c,r$(a);return}}}}else{var h=c.children.length,u=c.chunks.length;try{return ne(e,t,r,i)}catch(i){if(iy(),c.children.length=h,c.chunks.length=u,r=i===r4?r9():i,12!==e.status&&"object"==typeof r&&null!==r){if("function"==typeof r.then){c=r,e=no(e,t,r=i===r4?iv():null).ping,c.then(e,e),t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,t.componentStack=l,r$(a);return}if("Maximum call stack size exceeded"===r.message){c=no(e,t,c=i===r4?iv():null),e.pingedTasks.push(c),t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,t.componentStack=l,r$(a);return}}}}throw t.formatContext=n,t.context=a,t.keyPath=s,t.treeContext=o,r$(a),r}function nc(e){var t=e.blockedBoundary,r=e.blockedSegment;null!==r&&(r.status=3,nm(this,t,e.row,r))}function nh(e,t,r,i,n,s){for(var o=0;o<r.length;o++){var l=r[o];if(4===l.length)nh(e,t,l[2],l[3],n,s);else{l=l[5];var c=iq(e,null,new Set,null,null);c.parentFlushed=!0,c.rootSegmentID=l,c.status=4,c.errorDigest=s,c.parentFlushed&&e.clientRenderedBoundaries.push(c)}}if(r.length=0,null!==i){if(null===t)throw Error(a(487));if(4!==t.status&&(t.status=4,t.errorDigest=s,t.parentFlushed&&e.clientRenderedBoundaries.push(t)),"object"==typeof i)for(var h in i)delete i[h]}}function nu(e,t){try{var r=e.renderState,i=r.onHeaders;if(i){var n=r.headers;if(n){r.headers=null;var a=n.preconnects;if(n.fontPreloads&&(a&&(a+=", "),a+=n.fontPreloads),n.highImagePreloads&&(a&&(a+=", "),a+=n.highImagePreloads),!t){var s=r.styles.values(),o=s.next();t:for(;0<n.remainingCapacity&&!o.done;o=s.next())for(var l=o.value.sheets.values(),c=l.next();0<n.remainingCapacity&&!c.done;c=l.next()){var h=c.value,u=h.props,d=u.href,p=h.props,f=rF(p.href,"style",{crossOrigin:p.crossOrigin,integrity:p.integrity,nonce:p.nonce,type:p.type,fetchPriority:p.fetchPriority,referrerPolicy:p.referrerPolicy,media:p.media});if(0<=(n.remainingCapacity-=f.length+2))r.resets.style[d]=eo,a&&(a+=", "),a+=f,r.resets.style[d]="string"==typeof u.crossOrigin||"string"==typeof u.integrity?[u.crossOrigin,u.integrity]:eo;else break t}}i(a?{Link:a}:{})}}}catch(t){iZ(e,t,{})}}function nd(e){null===e.trackedPostpones&&nu(e,!0),null===e.trackedPostpones&&ny(e),e.onShellError=r5,(e=e.onShellReady)()}function np(e){nu(e,null===e.trackedPostpones||null===e.completedRootSegment||5!==e.completedRootSegment.status),ny(e),(e=e.onAllReady)()}function nf(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary&&-1===t.children[0].id){var r=t.children[0];r.id=t.id,r.parentFlushed=!0,1!==r.status&&3!==r.status&&4!==r.status||nf(e,r)}else e.completedSegments.push(t)}function ng(e,t,r){if(null!==z){r=r.chunks;for(var i=0,n=0;n<r.length;n++)i+=r[n].byteLength;null===t?e.byteSize+=i:t.byteSize+=i}}function nm(e,t,r,i){if(null!==r&&(0==--r.pendingTasks?i1(e,r):r.together&&i3(e,r)),e.allPendingTasks--,null===t){if(null!==i&&i.parentFlushed){if(null!==e.completedRootSegment)throw Error(a(389));e.completedRootSegment=i}e.pendingRootTasks--,0===e.pendingRootTasks&&nd(e)}else if(t.pendingTasks--,4!==t.status)if(0===t.pendingTasks){if(0===t.status&&(t.status=1),null!==i&&i.parentFlushed&&(1===i.status||3===i.status)&&nf(t,i),t.parentFlushed&&e.completedBoundaries.push(t),1===t.status)null!==(r=t.row)&&rG(r.hoistables,t.contentState),iO(e,t)||(t.fallbackAbortableTasks.forEach(nc,e),t.fallbackAbortableTasks.clear(),null!==r&&0==--r.pendingTasks&&i1(e,r)),0===e.pendingRootTasks&&null===e.trackedPostpones&&null!==t.contentPreamble&&ny(e);else if(5===t.status&&null!==(t=t.row)){if(null!==e.trackedPostpones){r=e.trackedPostpones;var n=t.next;if(null!==n&&null!==(i=n.boundaries))for(n.boundaries=null,n=0;n<i.length;n++){var s=i[n];ni(e,r,s),nm(e,s,null,null)}}0==--t.pendingTasks&&i1(e,t)}}else null===i||!i.parentFlushed||1!==i.status&&3!==i.status||(nf(t,i),1===t.completedSegments.length&&t.parentFlushed&&e.partialBoundaries.push(t)),null!==(t=t.row)&&t.together&&i3(e,t);0===e.allPendingTasks&&np(e)}function nA(e){if(14!==e.status&&13!==e.status){var t=rY,r=ei.H;ei.H=iP;var i=ei.A;ei.A=iL;var n=iV;iV=e;var s=iD;iD=e.resumableState;try{var o,l=e.pingedTasks;for(o=0;o<l.length;o++){var c=l[o],h=e,u=c.blockedSegment;if(null===u){var d=h;if(0!==c.replay.pendingTasks){r$(c.context);try{if("number"==typeof c.replay.slots?i7(d,c,c.replay.slots,c.node,c.childIndex):nt(d,c),1===c.replay.pendingTasks&&0<c.replay.nodes.length)throw Error(a(488));c.replay.pendingTasks--,c.abortSet.delete(c),nm(d,c.blockedBoundary,c.row,null)}catch(e){iy();var p=e===r4?r9():e;if("object"==typeof p&&null!==p&&"function"==typeof p.then){var f=c.ping;p.then(f,f),c.thenableState=e===r4?iv():null}else{c.replay.pendingTasks--,c.abortSet.delete(c);var g=iJ(c.componentStack);h=void 0;var m=d,A=c.blockedBoundary,b=12===d.status?d.fatalError:p,v=c.replay.nodes,y=c.replay.slots;h=iZ(m,b,g),nh(m,A,v,y,b,h),d.pendingRootTasks--,0===d.pendingRootTasks&&nd(d),d.allPendingTasks--,0===d.allPendingTasks&&np(d)}}finally{}}}else if(d=void 0,m=u,0===m.status){m.status=6,r$(c.context);var x=m.children.length,S=m.chunks.length;try{nt(h,c),m.lastPushedText&&m.textEmbedded&&m.chunks.push(eB),c.abortSet.delete(c),m.status=1,ng(h,c.blockedBoundary,m),nm(h,c.blockedBoundary,c.row,m)}catch(e){iy(),m.children.length=x,m.chunks.length=S;var E=e===r4?r9():12===h.status?h.fatalError:e;if(12===h.status&&null!==h.trackedPostpones){var w=h.trackedPostpones,_=iJ(c.componentStack);c.abortSet.delete(c),iZ(h,E,_),nn(h,w,c,m),nm(h,c.blockedBoundary,c.row,m)}else if("object"==typeof E&&null!==E&&"function"==typeof E.then){m.status=0,c.thenableState=e===r4?iv():null;var C=c.ping;E.then(C,C)}else{var M=iJ(c.componentStack);c.abortSet.delete(c),m.status=4;var I=c.blockedBoundary,T=c.row;if(null!==T&&0==--T.pendingTasks&&i1(h,T),h.allPendingTasks--,d=iZ(h,E,M),null===I)i0(h,E);else if(I.pendingTasks--,4!==I.status){I.status=4,I.errorDigest=d,na(h,I);var R=I.row;null!==R&&0==--R.pendingTasks&&i1(h,R),I.parentFlushed&&h.clientRenderedBoundaries.push(I),0===h.pendingRootTasks&&null===h.trackedPostpones&&null!==I.contentPreamble&&ny(h)}0===h.allPendingTasks&&np(h)}}finally{}}}l.splice(0,o),null!==e.destination&&nI(e,e.destination)}catch(t){iZ(e,t,{}),i0(e,t)}finally{iD=s,ei.H=r,ei.A=i,r===iP&&r$(t),iV=n}}}function nb(e,t,r){t.preambleChildren.length&&r.push(t.preambleChildren);for(var i=!1,n=0;n<t.children.length;n++)i=nv(e,t.children[n],r)||i;return i}function nv(e,t,r){var i=t.boundary;if(null===i)return nb(e,t,r);var n=i.contentPreamble,s=i.fallbackPreamble;if(null===n||null===s)return!1;switch(i.status){case 1:if(tp(e.renderState,n),e.byteSize+=i.byteSize,!(t=i.completedSegments[0]))throw Error(a(391));return nb(e,t,r);case 5:if(null!==e.trackedPostpones)return!0;case 4:if(1===t.status)return tp(e.renderState,s),nb(e,t,r);default:return!0}}function ny(e){if(e.completedRootSegment&&null===e.completedPreambleSegments){var t=[],r=e.byteSize,i=nv(e,e.completedRootSegment,t),n=e.renderState.preamble;!1===i||n.headChunks&&n.bodyChunks?e.completedPreambleSegments=t:e.byteSize=r}}function nx(e,t,r,i){switch(r.parentFlushed=!0,r.status){case 0:r.id=e.nextSegmentId++;case 5:return i=r.id,r.lastPushedText=!1,r.textEmbedded=!1,e=e.renderState,L(t,tm),L(t,e.placeholderPrefix),L(t,e=O(i.toString(16))),F(t,tA);case 1:r.status=2;var n=!0,s=r.chunks,o=0;r=r.children;for(var l=0;l<r.length;l++){for(n=r[l];o<n.index;o++)L(t,s[o]);n=nE(e,t,n,i)}for(;o<s.length-1;o++)L(t,s[o]);return o<s.length&&(n=F(t,s[o])),n;case 3:return!0;default:throw Error(a(390))}}var nS=0;function nE(e,t,r,i){var n=r.boundary;if(null===n)return nx(e,t,r,i);if(n.parentFlushed=!0,4===n.status){var s=n.row;null!==s&&0==--s.pendingTasks&&i1(e,s),n=n.errorDigest,F(t,tE),L(t,t_),n&&(L(t,tM),L(t,O(J(n))),L(t,tC)),F(t,tI),nx(e,t,r,i)}else if(1!==n.status)0===n.status&&(n.rootSegmentID=e.nextSegmentId++),0<n.completedSegments.length&&e.partialBoundaries.push(n),tT(t,e.renderState,n.rootSegmentID),i&&rG(i,n.fallbackState),nx(e,t,r,i);else if(!nM&&iO(e,n)&&(nS+n.byteSize>e.progressiveChunkSize||rV(n.contentState)))n.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(n),tT(t,e.renderState,n.rootSegmentID),nx(e,t,r,i);else{if(nS+=n.byteSize,i&&rG(i,n.contentState),null!==(r=n.row)&&iO(e,n)&&0==--r.pendingTasks&&i1(e,r),F(t,ty),1!==(r=n.completedSegments).length)throw Error(a(391));nE(e,t,r[0],i)}return F(t,tw)}function nw(e,t,r,i){switch(!function(e,t,r,i){switch(r.insertionMode){case 0:case 1:case 3:case 2:return L(e,tR),L(e,t.segmentPrefix),L(e,O(i.toString(16))),F(e,tB);case 4:return L(e,tP),L(e,t.segmentPrefix),L(e,O(i.toString(16))),F(e,tD);case 5:return L(e,tF),L(e,t.segmentPrefix),L(e,O(i.toString(16))),F(e,tN);case 6:return L(e,tO),L(e,t.segmentPrefix),L(e,O(i.toString(16))),F(e,tQ);case 7:return L(e,tH),L(e,t.segmentPrefix),L(e,O(i.toString(16))),F(e,tG);case 8:return L(e,tj),L(e,t.segmentPrefix),L(e,O(i.toString(16))),F(e,tq);case 9:return L(e,tX),L(e,t.segmentPrefix),L(e,O(i.toString(16))),F(e,tY);default:throw Error(a(397))}}(t,e.renderState,r.parentFormatContext,r.id),nE(e,t,r,i),r.parentFormatContext.insertionMode){case 0:case 1:case 3:case 2:return F(t,tk);case 4:return F(t,tL);case 5:return F(t,tU);case 6:return F(t,tz);case 7:return F(t,tV);case 8:return F(t,tW);case 9:return F(t,tK);default:throw Error(a(397))}}function n_(e,t,r){nS=r.byteSize;for(var i,n,s=r.completedSegments,o=0;o<s.length;o++)nC(e,t,r,s[o]);s.length=0,null!==(s=r.row)&&iO(e,r)&&0==--s.pendingTasks&&i1(e,s),rm(t,r.contentState,e.renderState),s=e.resumableState,e=e.renderState,o=r.rootSegmentID,r=r.contentState;var l=e.stylesToHoist;return e.stylesToHoist=!1,L(t,e.startInlineScript),L(t,e$),l?(0==(4&s.instructions)&&(s.instructions|=4,L(t,t7)),0==(2&s.instructions)&&(s.instructions|=2,L(t,t1)),0==(8&s.instructions)?(s.instructions|=8,L(t,t3)):L(t,t5)):(0==(2&s.instructions)&&(s.instructions|=2,L(t,t1)),L(t,t2)),s=O(o.toString(16)),L(t,e.boundaryPrefix),L(t,s),L(t,t4),L(t,e.segmentPrefix),L(t,s),l?(L(t,t8),i=r,L(t,rR),n=rR,i.stylesheets.forEach(function(e){if(2!==e.state)if(3===e.state)L(t,n),L(t,O(ro(""+e.props.href))),L(t,rP),n=rB;else{L(t,n);var r=e.props["data-precedence"],i=e.props;for(var s in L(t,O(ro(er(""+e.props.href)))),r=""+r,L(t,rk),L(t,O(ro(r))),i)if(V.call(i,s)&&null!=(r=i[s]))switch(s){case"href":case"rel":case"precedence":case"data-precedence":break;case"children":case"dangerouslySetInnerHTML":throw Error(a(399,"link"));default:!function(e,t,r){var i=t.toLowerCase();switch(typeof r){case"function":case"symbol":return}switch(t){case"innerHTML":case"dangerouslySetInnerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"style":case"ref":return;case"className":i="class",t=""+r;break;case"hidden":if(!1===r)return;t="";break;case"src":case"href":t=""+(r=er(r));break;default:if(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])||!X(t))return;t=""+r}L(e,rk),L(e,O(ro(i))),L(e,rk),L(e,O(ro(t)))}(t,s,r)}L(t,rP),n=rB,e.state=3}}),L(t,rP)):L(t,t9),r=F(t,t6),tf(t,e)&&r}function nC(e,t,r,i){if(2===i.status)return!0;var n=r.contentState,s=i.id;if(-1===s){if(-1===(i.id=r.rootSegmentID))throw Error(a(392));return nw(e,t,i,n)}return s===r.rootSegmentID?nw(e,t,i,n):(nw(e,t,i,n),r=e.resumableState,L(t,(e=e.renderState).startInlineScript),L(t,e$),0==(1&r.instructions)?(r.instructions|=1,L(t,t$)):L(t,tJ),L(t,e.segmentPrefix),L(t,s=O(s.toString(16))),L(t,tZ),L(t,e.placeholderPrefix),L(t,s),t=F(t,t0))}var nM=!1;function nI(e,t){P=new Uint8Array(2048),D=0;try{if(!(0<e.pendingRootTasks)){var r,i=e.completedRootSegment;if(null!==i){if(5===i.status)return;var n=e.completedPreambleSegments;if(null===n)return;nS=e.byteSize;var a,s=e.resumableState,o=e.renderState,l=o.preamble,c=l.htmlChunks,h=l.headChunks;if(c){for(a=0;a<c.length;a++)L(t,c[a]);if(h)for(a=0;a<h.length;a++)L(t,h[a]);else L(t,tc("head")),L(t,e$)}else if(h)for(a=0;a<h.length;a++)L(t,h[a]);var u=o.charsetChunks;for(a=0;a<u.length;a++)L(t,u[a]);u.length=0,o.preconnects.forEach(rA,t),o.preconnects.clear();var d=o.viewportChunks;for(a=0;a<d.length;a++)L(t,d[a]);d.length=0,o.fontPreloads.forEach(rA,t),o.fontPreloads.clear(),o.highImagePreloads.forEach(rA,t),o.highImagePreloads.clear(),el=o,o.styles.forEach(r_,t),el=null;var p=o.importMapChunks;for(a=0;a<p.length;a++)L(t,p[a]);p.length=0,o.bootstrapScripts.forEach(rA,t),o.scripts.forEach(rA,t),o.scripts.clear(),o.bulkPreloads.forEach(rA,t),o.bulkPreloads.clear(),c||h||(s.instructions|=32);var f=o.hoistableChunks;for(a=0;a<f.length;a++)L(t,f[a]);for(s=f.length=0;s<n.length;s++){var g=n[s];for(o=0;o<g.length;o++)nE(e,t,g[o],null)}var m=e.renderState.preamble,A=m.headChunks;(m.htmlChunks||A)&&L(t,td("head"));var b=m.bodyChunks;if(b)for(n=0;n<b.length;n++)L(t,b[n]);nE(e,t,i,null),e.completedRootSegment=null;var v=e.renderState;if(0!==e.allPendingTasks||0!==e.clientRenderedBoundaries.length||0!==e.completedBoundaries.length||null!==e.trackedPostpones&&(0!==e.trackedPostpones.rootNodes.length||null!==e.trackedPostpones.rootSlots)){var y=e.resumableState;if(0==(64&y.instructions)){if(y.instructions|=64,L(t,v.startInlineScript),0==(32&y.instructions)){y.instructions|=32;var x="_"+y.idPrefix+"R_";L(t,rI),L(t,O(J(x))),L(t,eQ)}L(t,e$),L(t,tg),F(t,eh)}}tf(t,v)}var S=e.renderState;i=0;var E=S.viewportChunks;for(i=0;i<E.length;i++)L(t,E[i]);E.length=0,S.preconnects.forEach(rA,t),S.preconnects.clear(),S.fontPreloads.forEach(rA,t),S.fontPreloads.clear(),S.highImagePreloads.forEach(rA,t),S.highImagePreloads.clear(),S.styles.forEach(rM,t),S.scripts.forEach(rA,t),S.scripts.clear(),S.bulkPreloads.forEach(rA,t),S.bulkPreloads.clear();var w=S.hoistableChunks;for(i=0;i<w.length;i++)L(t,w[i]);w.length=0;var _=e.clientRenderedBoundaries;for(r=0;r<_.length;r++){var C,M=_[r];S=t;var I=e.resumableState,T=e.renderState,R=M.rootSegmentID,B=M.errorDigest;L(S,T.startInlineScript),L(S,e$),0==(4&I.instructions)?(I.instructions|=4,L(S,re)):L(S,rt),L(S,T.boundaryPrefix),L(S,O(R.toString(16))),L(S,rr),B&&(L(S,ri),L(S,O((C=B||"",JSON.stringify(C).replace(ra,function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})))));var k=F(S,rn);if(!k){e.destination=null,r++,_.splice(0,r);return}}_.splice(0,r);var U=e.completedBoundaries;for(r=0;r<U.length;r++)if(!n_(e,t,U[r])){e.destination=null,r++,U.splice(0,r);return}U.splice(0,r),N(t),P=new Uint8Array(2048),D=0,nM=!0;var Q=e.partialBoundaries;for(r=0;r<Q.length;r++){var z=Q[r];e:{_=e,M=t,nS=z.byteSize;var H=z.completedSegments;for(k=0;k<H.length;k++)if(!nC(_,M,z,H[k])){k++,H.splice(0,k);var G=!1;break e}H.splice(0,k);var V=z.row;null!==V&&V.together&&1===z.pendingTasks&&(1===V.pendingTasks?i2(_,V,V.hoistables):V.pendingTasks--),G=rm(M,z.contentState,_.renderState)}if(!G){e.destination=null,r++,Q.splice(0,r);return}}Q.splice(0,r),nM=!1;var j=e.completedBoundaries;for(r=0;r<j.length;r++)if(!n_(e,t,j[r])){e.destination=null,r++,j.splice(0,r);return}j.splice(0,r)}}finally{nM=!1,0===e.allPendingTasks&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length?(e.flushScheduled=!1,(r=e.resumableState).hasBody&&L(t,td("body")),r.hasHtml&&L(t,td("html")),N(t),e.status=14,t.close(),e.destination=null):N(t)}}function nT(e){e.flushScheduled=null!==e.destination,k(function(){return nA(e)}),T(function(){10===e.status&&(e.status=11),null===e.trackedPostpones&&nu(e,0===e.pendingRootTasks)})}function nR(e){!1===e.flushScheduled&&0===e.pingedTasks.length&&null!==e.destination&&(e.flushScheduled=!0,T(function(){var t=e.destination;t?nI(e,t):e.flushScheduled=!1}))}function nB(e,t){if(13===e.status)e.status=14,H(t,e.fatalError);else if(14!==e.status&&null===e.destination){e.destination=t;try{nI(e,t)}catch(t){iZ(e,t,{}),i0(e,t)}}}function nk(e,t){(11===e.status||10===e.status)&&(e.status=12);try{var r=e.abortableTasks;if(0<r.size){var i=void 0===t?Error(a(432)):"object"==typeof t&&null!==t&&"function"==typeof t.then?Error(a(530)):t;e.fatalError=i,r.forEach(function(t){return function e(t,r,i){var n=t.blockedBoundary,a=t.blockedSegment;if(null!==a){if(6===a.status)return;a.status=3}var s=iJ(t.componentStack);if(null===n){if(13!==r.status&&14!==r.status){if(null===(n=t.replay))return void(null!==r.trackedPostpones&&null!==a?(n=r.trackedPostpones,iZ(r,i,s),nn(r,n,t,a),nm(r,null,t.row,a)):(iZ(r,i,s),i0(r,i)));n.pendingTasks--,0===n.pendingTasks&&0<n.nodes.length&&(a=iZ(r,i,s),nh(r,null,n.nodes,n.slots,i,a)),r.pendingRootTasks--,0===r.pendingRootTasks&&nd(r)}}else{var o=r.trackedPostpones;if(4!==n.status){if(null!==o&&null!==a)return iZ(r,i,s),nn(r,o,t,a),n.fallbackAbortableTasks.forEach(function(t){return e(t,r,i)}),n.fallbackAbortableTasks.clear(),nm(r,n,t.row,a);n.status=4,a=iZ(r,i,s),n.status=4,n.errorDigest=a,na(r,n),n.parentFlushed&&r.clientRenderedBoundaries.push(n)}n.pendingTasks--,null!==(a=n.row)&&0==--a.pendingTasks&&i1(r,a),n.fallbackAbortableTasks.forEach(function(t){return e(t,r,i)}),n.fallbackAbortableTasks.clear()}null!==(t=t.row)&&0==--t.pendingTasks&&i1(r,t),r.allPendingTasks--,0===r.allPendingTasks&&np(r)}(t,e,i)}),r.clear()}null!==e.destination&&nI(e,e.destination)}catch(t){iZ(e,t,{}),i0(e,t)}}function nP(e,t,r){if(null===t)r.rootNodes.push(e);else{var i=r.workingMap,n=i.get(t);void 0===n&&(n=[t[1],t[2],[],null],i.set(t,n),nP(n,t[0],r)),n[2].push(e)}}function nD(e){var t=e.trackedPostpones;if(null===t||0===t.rootNodes.length&&null===t.rootSlots)return e.trackedPostpones=null;if(null===e.completedRootSegment||5!==e.completedRootSegment.status&&null!==e.completedPreambleSegments){var r=e.nextSegmentId,i=t.rootSlots,n=e.resumableState;n.bootstrapScriptContent=void 0,n.bootstrapScripts=void 0,n.bootstrapModules=void 0}else{r=0,i=-1,n=e.resumableState;var a=e.renderState;n.nextFormID=0,n.hasBody=!1,n.hasHtml=!1,n.unknownResources={font:a.resets.font},n.dnsResources=a.resets.dns,n.connectResources=a.resets.connect,n.imageResources=a.resets.image,n.styleResources=a.resets.style,n.scriptResources={},n.moduleUnknownResources={},n.moduleScriptResources={},n.instructions=0}return{nextSegmentId:r,rootFormatContext:e.rootFormatContext,progressiveChunkSize:e.progressiveChunkSize,resumableState:e.resumableState,replayNodes:t.rootNodes,replaySlots:i}}function nL(){var e=i.version;if("19.2.3"!==e)throw Error(a(527,e,"19.2.3"))}nL(),nL(),t.prerender=function(e,t){return new Promise(function(r,i){var n,a,s,o,l,c=t?t.onHeaders:void 0;c&&(l=function(e){c(new Headers(e))});var h=eE(t?t.identifierPrefix:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),u=(n=e,a=eS(h,void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,l,t?t.maxHeadersLength:void 0),s=eC(t?t.namespaceURI:void 0),o=t?t.progressiveChunkSize:void 0,(n=iH(n,h,a,s,o,t?t.onError:void 0,function(){var e=new ReadableStream({type:"bytes",pull:function(e){nB(u,e)},cancel:function(e){u.destination=null,nk(u,e)}},{highWaterMark:0});r(e={postponed:nD(u),prelude:e})},void 0,void 0,i,t?t.onPostpone:void 0,void 0)).trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},n);if(t&&t.signal){var d=t.signal;if(d.aborted)nk(u,d.reason);else{var p=function(){nk(u,d.reason),d.removeEventListener("abort",p)};d.addEventListener("abort",p)}}nT(u)})},t.renderToReadableStream=function(e,t){return new Promise(function(r,i){var n,a,s,o=new Promise(function(e,t){a=e,n=t}),l=t?t.onHeaders:void 0;l&&(s=function(e){l(new Headers(e))});var c=eE(t?t.identifierPrefix:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),h=iH(e,c,eS(c,t?t.nonce:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,s,t?t.maxHeadersLength:void 0),eC(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,a,function(){var e=new ReadableStream({type:"bytes",pull:function(e){nB(h,e)},cancel:function(e){h.destination=null,nk(h,e)}},{highWaterMark:0});e.allReady=o,r(e)},function(e){o.catch(function(){}),i(e)},n,t?t.onPostpone:void 0,t?t.formState:void 0);if(t&&t.signal){var u=t.signal;if(u.aborted)nk(h,u.reason);else{var d=function(){nk(h,u.reason),u.removeEventListener("abort",d)};u.addEventListener("abort",d)}}nT(h)})},t.resume=function(e,t,r){return new Promise(function(i,n){var a,s,o=new Promise(function(e,t){s=e,a=t}),l=iG(e,t,eS(t.resumableState,r?r.nonce:void 0,void 0,void 0,void 0,void 0),r?r.onError:void 0,s,function(){var e=new ReadableStream({type:"bytes",pull:function(e){nB(l,e)},cancel:function(e){l.destination=null,nk(l,e)}},{highWaterMark:0});e.allReady=o,i(e)},function(e){o.catch(function(){}),n(e)},a,r?r.onPostpone:void 0);if(r&&r.signal){var c=r.signal;if(c.aborted)nk(l,c.reason);else{var h=function(){nk(l,c.reason),c.removeEventListener("abort",h)};c.addEventListener("abort",h)}}nT(l)})},t.resumeAndPrerender=function(e,t,r){return new Promise(function(i,n){var a,s,o=(a=e,s=eS(t.resumableState,void 0,void 0,void 0,void 0,void 0),(a=iG(a,t,s,r?r.onError:void 0,function(){var e=new ReadableStream({type:"bytes",pull:function(e){nB(o,e)},cancel:function(e){o.destination=null,nk(o,e)}},{highWaterMark:0});i(e={postponed:nD(o),prelude:e})},void 0,void 0,n,r?r.onPostpone:void 0)).trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},a);if(r&&r.signal){var l=r.signal;if(l.aborted)nk(o,l.reason);else{var c=function(){nk(o,l.reason),l.removeEventListener("abort",c)};l.addEventListener("abort",c)}}nT(o)})},t.version="19.2.3"},9423(e,t,r){"use strict";var i,n;i=r(5364),n=r(9828),i.version,t.renderToString=i.renderToString,i.renderToStaticMarkup,n.renderToReadableStream,n.resume},3563(e,t,r){"use strict";r.d(t,{Ay:()=>E});var i=r(9081),n=r(8092),a=r(9423),s=r(5821),o=r.n(s),l="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==r.g?r.g:"u">typeof self?self:{};function c(e,t){return e(t={exports:{}},t.exports),t.exports}var h=c(function(e){var t,r,i,n,a,s,o,c,h,u,d,p,f,g;t=function(e,r,i){if(!o(r)||h(r)||u(r)||d(r)||s(r))return r;var n,a=0,l=0;if(c(r))for(n=[],l=r.length;a<l;a++)n.push(t(e,r[a],i));else for(var p in n={},r)Object.prototype.hasOwnProperty.call(r,p)&&(n[e(p,i)]=t(e,r[p],i));return n},r=function(e){return p(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""})).substr(0,1).toLowerCase()+e.substr(1)},i=function(e){var t=r(e);return t.substr(0,1).toUpperCase()+t.substr(1)},n=function(e,t){var r,i,n;return(i=(r=(r=t)||{}).separator||"_",n=r.split||/(?=[A-Z])/,e.split(n).join(i)).toLowerCase()},a=Object.prototype.toString,s=function(e){return"function"==typeof e},o=function(e){return e===Object(e)},c=function(e){return"[object Array]"==a.call(e)},h=function(e){return"[object Date]"==a.call(e)},u=function(e){return"[object RegExp]"==a.call(e)},d=function(e){return"[object Boolean]"==a.call(e)},p=function(e){return(e-=0)==e},f=function(e,t){var r=t&&"process"in t?t.process:t;return"function"!=typeof r?e:function(t,i){return r(t,e,i)}},g={camelize:r,decamelize:n,pascalize:i,depascalize:n,camelizeKeys:function(e,i){return t(f(r,i),e)},decamelizeKeys:function(e,r){return t(f(n,r),e,r)},pascalizeKeys:function(e,r){return t(f(i,r),e)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}},e.exports?e.exports=g:l.humps=g}).decamelize,u=function(e){if(Array.isArray(e))return e},d=function(e,t){if("u">typeof Symbol&&Symbol.iterator in Object(e)){var r=[],i=!0,n=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(i=(s=o.next()).done)&&(r.push(s.value),!t||r.length!==t);i=!0);}catch(e){n=!0,a=e}finally{try{i||null==o.return||o.return()}finally{if(n)throw a}}return r}},p=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i},f=function(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}},g=function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},m=c(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},t.apply(this,arguments)}e.exports=t}),A=function(e,t){if(null==e)return{};var r,i,n={},a=Object.keys(e);for(i=0;i<a.length;i++)r=a[i],t.indexOf(r)>=0||(n[r]=e[r]);return n},b=function(e,t){if(null==e)return{};var r,i,n=A(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n},v=(0,i.createContext)(null);function y(e){var t=e.children,r=void 0===t?"":t,n=b(e,["children"]);return"string"!=typeof r&&(r=(0,a.renderToString)(r)),i.createElement("template",m({},n,{dangerouslySetInnerHTML:{__html:r}}))}function x(e){var t=e.root,r=e.children;return(0,n.createPortal)(void 0===r?null:r,t)}y.propTypes={children:o().oneOfType([o().string,o().node])},x.propTypes={root:o().object.isRequired,children:o().node};var S=new Map;let E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"core",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e.children};return new Proxy(e,{get:function(e,n){var a,s,l=h(n,{separator:"-"}),c="".concat(t,"-").concat(l);return S.has(c)||S.set(c,(a={tag:l,render:r},(s=(0,i.forwardRef)(function(e,t){var r,n,s=e.mode,o=void 0===s?"open":s,l=e.delegatesFocus,c=void 0!==l&&l,h=e.styleSheets,p=void 0===h?[]:h,A=e.ssr,S=void 0!==A&&A,E=e.children,w=b(e,["mode","delegatesFocus","styleSheets","ssr","children"]),_=(n=(0,i.useRef)(t&&t.current),(0,i.useEffect)(function(){t&&(t.current=n.current)},[t]),n),C=u(r=(0,i.useState)(null))||d(r,2)||f(r,2)||g(),M=C[0],I=C[1],T="node_".concat(o).concat(c);return(0,i.useLayoutEffect)(function(){if(_.current)try{if("function"==typeof t&&t(_.current),S){var e=_.current.shadowRoot;return void I(e)}var r=_.current.attachShadow({mode:o,delegatesFocus:c});p.length>0&&(r.adoptedStyleSheets=p),I(r)}catch(e){!function(e){var t=e.error,r=e.styleSheets,i=e.root;if("NotSupportedError"===t.name)r.length>0&&(i.adoptedStyleSheets=r);else throw t}({error:e,styleSheets:p,root:M})}},[t,_,p]),i.createElement(i.Fragment,null,i.createElement(a.tag,m({key:T,ref:_},w),(M||S)&&i.createElement(v.Provider,{value:M},S?i.createElement(y,{shadowroot:o,shadowrootmode:o},a.render({root:M,ssr:S,children:E})):i.createElement(x,{root:M},a.render({root:M,ssr:S,children:E})))))})).propTypes={mode:o().oneOf(["open","closed"]),delegatesFocus:o().bool,styleSheets:o().arrayOf(o().instanceOf(globalThis.CSSStyleSheet)),ssr:o().bool,children:o().node},s)),S.get(c)}})}()},1357(e,t){"use strict";var r=Symbol.for("react.transitional.element");function i(e,t,i){var n=null;if(void 0!==i&&(n=""+i),void 0!==t.key&&(n=""+t.key),"key"in t)for(var a in i={},t)"key"!==a&&(i[a]=t[a]);else i=t;return{$$typeof:r,type:e,key:n,ref:void 0!==(t=i.ref)?t:null,props:i}}t.Fragment=Symbol.for("react.fragment"),t.jsx=i,t.jsxs=i},8525(e,t,r){"use strict";e.exports=r(1357)},322(e,t,r){"use strict";let i;r.d(t,{U7:()=>n,UN:()=>g,WW:()=>a,Xq:()=>s,al:()=>l,k$:()=>o,oU:()=>p});let n=null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported,a=n&&null!=self.XRSession.prototype.requestHitTestSource,s=null!=self.ResizeObserver,o=null!=self.IntersectionObserver,l=a;i=navigator.userAgent||navigator.vendor||self.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)),/\bCrOS\b/.test(navigator.userAgent);let c=/android/i.test(navigator.userAgent),h=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;/Safari\//.test(navigator.userAgent);let u=/firefox/i.test(navigator.userAgent),d=/OculusBrowser/.test(navigator.userAgent);h&&/CriOS\//.test(navigator.userAgent);let p=c&&!u&&!d,f=!!(window.webkit&&window.webkit.messageHandlers),g=(()=>{if(!h)return!1;if(f)return!!/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent);{let e=document.createElement("a");return!!(e.relList&&e.relList.supports&&e.relList.supports("ar"))}})()},6650(e,t,r){"use strict";r.d(t,{i:()=>x});var i,n,a,s,o=r(5978),l=r(1718);let c=Symbol("instances"),h=Symbol("activateListener"),u=Symbol("deactivateListener"),d=Symbol("notifyInstances"),p=Symbol("notify"),f=Symbol("callback");class g{static[d](){for(let e of g[c])e[p]()}static[(i=c,h)](){window.addEventListener("scroll",this[d],{passive:!0})}static[u](){window.removeEventListener("scroll",this[d])}constructor(e){this[f]=e}observe(){0===g[c].size&&g[h](),g[c].add(this)}disconnect(){g[c].delete(this),0===g[c].size&&g[u]()}[p](){this[f]()}}g[i]=new Set;let m=Symbol("computeStyleCallback"),A=Symbol("astWalker"),b=Symbol("dependencies"),v=Symbol("onScroll");class y{constructor(e){this[n]={},this[a]=new l.PV(["function"]),this[s]=()=>{this[m]({relatedState:"window-scroll"})},this[m]=e}observeEffectsFor(e){let t={},r=this[b];for(let i in this[A].walk(e,e=>{let{name:i}=e,n=e.arguments[0].terms[0];if("env"===i.value&&null!=n&&"ident"===n.type&&"window-scroll-y"===n.value&&null==t["window-scroll"]){let e="window-scroll"in r?r["window-scroll"]:new g(this[v]);e.observe(),delete r["window-scroll"],t["window-scroll"]=e}}),r)r[i].disconnect();this[b]=t}dispose(){for(let e in this[b])this[b][e].disconnect()}}n=b,a=A,s=v;let x=e=>{let t=e.observeEffects||!1,r=e.intrinsics instanceof Function?e.intrinsics:()=>e.intrinsics;return(i,n)=>{let a=i.updated,s=i.connectedCallback,c=i.disconnectedCallback,h=Symbol(`${n}StyleEffector`),u=Symbol(`${n}StyleEvaluator`),d=Symbol(`${n}UpdateEvaluator`),p=Symbol(`${n}EvaluateAndSync`);Object.defineProperties(i,{[h]:{value:null,writable:!0},[u]:{value:null,writable:!0},[d]:{value:function(){let e=(0,l.$y)(this[n]);this[u]=new o.bk(e,r(this)),null==this[h]&&t&&(this[h]=new y(()=>this[p]())),null!=this[h]&&this[h].observeEffectsFor(e)}},[p]:{value:function(){if(null==this[u])return;let t=this[u].evaluate();this[e.updateHandler](t)}},updated:{value:function(e){e.has(n)&&(this[d](),this[p]()),a.call(this,e)}},connectedCallback:{value:function(){s.call(this),this.requestUpdate(n,this[n])}},disconnectedCallback:{value:function(){c.call(this),null!=this[h]&&(this[h].dispose(),this[h]=null)}}})}}},7821(e,t,r){"use strict";r.d(t,{Q:()=>p});var i=r(8413),n=r(3520),a=function(e,t,r,i){var n,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,r,s):n(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};let s=Symbol("changeAnimation"),o=Symbol("appendAnimation"),l=Symbol("detachAnimation"),c=Symbol("paused"),h={repetitions:1/0,pingpong:!1},u={pingpong:!1,repetitions:null,weight:1,timeScale:1,fade:!1,warp:!1,relativeWarp:!0,time:null},d={fade:!0},p=e=>{var t;class r extends e{constructor(...e){super(e),this.autoplay=!1,this.animationName=void 0,this.animationCrossfadeDuration=300,this[t]=!0,this[n.lC].subscribeMixerEvent("loop",e=>{let t=e.action._loopCount,r=e.action._clip.name,i=e.action._clip.uuid,a=this[n.lC].markedAnimations.find(e=>e.name===r);if(a){this[n.lC].updateAnimationLoop(a.name,a.loopMode,a.repetitionCount);let e=this[n.lC].markedAnimations.filter(e=>e.name!==r);this[n.lC].markedAnimations=e}this.dispatchEvent(new CustomEvent("loop",{detail:{count:t,name:r,uuid:i}}))}),this[n.lC].subscribeMixerEvent("finished",e=>{if(this[n.lC].appendedAnimations.includes(e.action._clip.name)){let t=this[n.lC].appendedAnimations.filter(t=>t!==e.action._clip.name);this[n.lC].appendedAnimations=t}else this[c]=!0;this.dispatchEvent(new CustomEvent("finished"))})}get availableAnimations(){return this.loaded?this[n.lC].animationNames:[]}get duration(){return this[n.lC].duration}get paused(){return this[c]}get currentTime(){return this[n.lC].animationTime}get appendedAnimations(){return this[n.lC].appendedAnimations}set currentTime(e){this[n.lC].animationTime=e,this[n.ML]()}get timeScale(){return this[n.lC].animationTimeScale}set timeScale(e){this[n.lC].animationTimeScale=e}pause(){this[c]||(this[c]=!0,this.dispatchEvent(new CustomEvent("pause")))}play(e){this.availableAnimations.length>0&&(this[c]=!1,this[s](e),this.dispatchEvent(new CustomEvent("play")))}appendAnimation(e,t){this.availableAnimations.length>0&&(this[c]=!1,this[o](e,t),this.dispatchEvent(new CustomEvent("append-animation")))}detachAnimation(e,t){this.availableAnimations.length>0&&(this[c]=!1,this[l](e,t),this.dispatchEvent(new CustomEvent("detach-animation")))}[(t=c,n.vA)](){super[n.vA](),this[c]=!0,null!=this.animationName&&this[s](),this.autoplay&&this.play()}[n.Ei](e,t){super[n.Ei](e,t),!this[c]&&(this[n.gJ]()||this[n.m8].isPresenting)&&(this[n.lC].updateAnimation(t/1e3),this[n.ML]())}updated(e){super.updated(e),e.has("autoplay")&&this.autoplay&&this.play(),e.has("animationName")&&this[s]()}[s](e=h){var t;let r=null!=(t=e.repetitions)?t:1/0,i=e.pingpong?2202:1===r?2200:2201;this[n.lC].playAnimation(this.animationName,this.animationCrossfadeDuration/1e3,i,r),this[c]&&(this[n.lC].updateAnimation(0),this[n.ML]())}[o](e="",t=u){var r;let i=null!=(r=t.repetitions)?r:1/0,a=t.pingpong?2202:1===i?2200:2201,s=!!t.repetitions||"pingpong"in t;this[n.lC].appendAnimation(e||this.animationName,a,i,t.weight,t.timeScale,t.fade,t.warp,t.relativeWarp,t.time,s),this[c]&&(this[n.lC].updateAnimation(0),this[n.ML]())}[l](e="",t=d){this[n.lC].detachAnimation(e||this.animationName,t.fade),this[c]&&(this[n.lC].updateAnimation(0),this[n.ML]())}}return a([(0,i.MZ)({type:Boolean})],r.prototype,"autoplay",void 0),a([(0,i.MZ)({type:String,attribute:"animation-name"})],r.prototype,"animationName",void 0),a([(0,i.MZ)({type:Number,attribute:"animation-crossfade-duration"})],r.prototype,"animationCrossfadeDuration",void 0),r}},9130(e,t,r){"use strict";r.d(t,{j:()=>d});var i=r(874),n=r(3520),a=r(5112);let s=Symbol("hotspotMap"),o=Symbol("mutationCallback"),l=Symbol("observer"),c=Symbol("addHotspot"),h=Symbol("removeHotspot"),u=new i.kn4,d=e=>{var t,r,d;class p extends e{constructor(){super(...arguments),this[t]=new Map,this[r]=e=>{e.forEach(e=>{e instanceof MutationRecord&&"childList"!==e.type||(e.addedNodes.forEach(e=>{this[c](e)}),e.removedNodes.forEach(e=>{this[h](e)}),this[n.ML]())})},this[d]=new MutationObserver(this[o])}connectedCallback(){super.connectedCallback();for(let e=0;e<this.children.length;++e)this[c](this.children[e]);let{ShadyDOM:e}=self;null==e?this[l].observe(this,{childList:!0}):this[l]=e.observeChildren(this,this[o])}disconnectedCallback(){super.disconnectedCallback();let{ShadyDOM:e}=self;null==e?this[l].disconnect():e.unobserveChildren(this[l])}[(t=s,r=o,d=l,n.vA)](){super[n.vA]();let e=this[n.lC];e.forHotspots(t=>{e.updateSurfaceHotspot(t)})}[n.Ei](e,t){super[n.Ei](e,t);let r=this[n.lC],{annotationRenderer:i}=r,a=r.getCamera();r.shouldRender()&&(r.animateSurfaceHotspots(),r.updateHotspotsVisibility(a.position),i.domElement.style.display="",i.render(r,a))}updateHotspot(e){let t=this[s].get(e.name);null!=t&&(t.updatePosition(e.position),t.updateNormal(e.normal),t.surface=e.surface,this[n.lC].updateSurfaceHotspot(t),this[n.ML]())}queryHotspot(e){let t=this[s].get(e);if(null==t)return null;let r=(0,n.Gw)(t.position),a=(0,n.Gw)(t.normal),o=t.facingCamera,l=this[n.lC],c=l.getCamera(),h=new i.Pq0;h.setFromMatrixPosition(t.matrixWorld),h.project(c);let u=l.width/2,d=l.height/2;h.x=h.x*u+u,h.y=-(h.y*d)+d;let p=(0,n.Gw)(new i.Pq0(h.x,h.y,h.z));return Number.isFinite(p.x)&&Number.isFinite(p.y)?{position:r,normal:a,canvasPosition:p,facingCamera:o}:null}positionAndNormalFromPoint(e,t){let r=this[n.lC],i=r.getNDC(e,t),a=r.positionAndNormalFromPoint(i);if(null==a)return null;u.copy(r.target.matrixWorld).invert();let s=(0,n.Gw)(a.position.applyMatrix4(u)),o=(0,n.Gw)(a.normal.transformDirection(u)),l=null;return null!=a.uv&&(l=(0,n.hC)(a.uv)),{position:s,normal:o,uv:l}}surfaceFromPoint(e,t){let r=this[n.lC],i=r.getNDC(e,t);return r.surfaceFromPoint(i)}[c](e){if(!(e instanceof HTMLElement&&0===e.slot.indexOf("hotspot")))return;let t=this[s].get(e.slot);null!=t?t.increment():(t=new a.Y({name:e.slot,position:e.dataset.position,normal:e.dataset.normal,surface:e.dataset.surface}),this[s].set(e.slot,t),this[n.lC].addHotspot(t)),this[n.lC].queueRender()}[h](e){if(!(e instanceof HTMLElement))return;let t=this[s].get(e.slot);t&&(t.decrement()&&(this[n.lC].removeHotspot(t),this[s].delete(e.slot)),this[n.lC].queueRender())}}return p}},5001(e,t,r){"use strict";let i;r.d(t,{BX:()=>eU});var n=r(8413),a=r(874),s=Uint8Array,o=Uint16Array,l=Int32Array,c=new s([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]),h=new s([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]),u=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(e,t){for(var r=new o(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];for(var n=new l(r[30]),i=1;i<30;++i)for(var a=r[i];a<r[i+1];++a)n[a]=a-r[i]<<5|i;return{b:r,r:n}},p=d(c,2),f=p.b,g=p.r;f[28]=258,g[258]=28;for(var m=d(h,0),A=(m.b,m.r),b=new o(32768),v=0;v<32768;++v){var y=(43690&v)>>1|(21845&v)<<1;y=(61680&(y=(52428&y)>>2|(13107&y)<<2))>>4|(3855&y)<<4,b[v]=((65280&y)>>8|(255&y)<<8)>>1}for(var x=function(e,t,r){for(var i,n=e.length,a=0,s=new o(t);a<n;++a)e[a]&&++s[e[a]-1];var l=new o(t);for(a=1;a<t;++a)l[a]=l[a-1]+s[a-1]<<1;if(r){i=new o(1<<t);var c=15-t;for(a=0;a<n;++a)if(e[a])for(var h=a<<4|e[a],u=t-e[a],d=l[e[a]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)i[b[d]>>c]=h}else for(a=0,i=new o(n);a<n;++a)e[a]&&(i[a]=b[l[e[a]-1]++]>>15-e[a]);return i},S=new s(288),v=0;v<144;++v)S[v]=8;for(var v=144;v<256;++v)S[v]=9;for(var v=256;v<280;++v)S[v]=7;for(var v=280;v<288;++v)S[v]=8;for(var E=new s(32),v=0;v<32;++v)E[v]=5;var w=x(S,9,0),_=x(E,5,0),C=function(e){return(e+7)/8|0},M=function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new s(e.subarray(t,r))},I=["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"],T=function(e,t,r){var i=Error(t||I[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,T),!r)throw i;return i},R=function(e,t,r){r<<=7&t;var i=t/8|0;e[i]|=r,e[i+1]|=r>>8},B=function(e,t,r){r<<=7&t;var i=t/8|0;e[i]|=r,e[i+1]|=r>>8,e[i+2]|=r>>16},k=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,a=r.slice();if(!n)return{t:O,l:0};if(1==n){var l=new s(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 c=r[0],h=r[1],u=0,d=1,p=2;for(r[0]={s:-1,f:c.f+h.f,l:c,r:h};d!=n-1;)c=r[r[u].f<r[p].f?u++:p++],h=r[u!=d&&r[u].f<r[p].f?u++:p++],r[d++]={s:-1,f:c.f+h.f,l:c,r:h};for(var f=a[0].s,i=1;i<n;++i)a[i].s>f&&(f=a[i].s);var g=new o(f+1),m=P(r[d-1],g,0);if(m>t){var i=0,A=0,b=m-t,v=1<<b;for(a.sort(function(e,t){return g[t.s]-g[e.s]||e.f-t.f});i<n;++i){var y=a[i].s;if(g[y]>t)A+=v-(1<<m-g[y]),g[y]=t;else break}for(A>>=b;A>0;){var x=a[i].s;g[x]<t?A-=1<<t-g[x]++-1:++i}for(;i>=0&&A;--i){var S=a[i].s;g[S]==t&&(--g[S],++A)}m=t}return{t:new s(g),l:m}},P=function(e,t,r){return -1==e.s?Math.max(P(e.l,t,r+1),P(e.r,t,r+1)):t[e.s]=r},D=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new o(++t),i=0,n=e[0],a=1,s=function(e){r[i++]=e},l=1;l<=t;++l)if(e[l]==n&&l!=t)++a;else{if(!n&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(n),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(n);a=1,n=e[l]}return{c:r.subarray(0,i),n:t}},L=function(e,t){for(var r=0,i=0;i<t.length;++i)r+=e[i]*t[i];return r},F=function(e,t,r){var i=r.length,n=C(t+2);e[n]=255&i,e[n+1]=i>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var a=0;a<i;++a)e[n+a+4]=r[a];return(n+4+i)*8},N=function(e,t,r,i,n,a,s,l,d,p,f){R(t,f++,r),++n[256];for(var g,m,A,b,v=k(n,15),y=v.t,C=v.l,M=k(a,15),I=M.t,T=M.l,P=D(y),N=P.c,U=P.n,O=D(I),Q=O.c,z=O.n,H=new o(19),G=0;G<N.length;++G)++H[31&N[G]];for(var G=0;G<Q.length;++G)++H[31&Q[G]];for(var V=k(H,7),j=V.t,q=V.l,W=19;W>4&&!j[u[W-1]];--W);var X=p+5<<3,Y=L(n,S)+L(a,E)+s,K=L(n,y)+L(a,I)+s+14+3*W+L(H,j)+2*H[16]+3*H[17]+7*H[18];if(d>=0&&X<=Y&&X<=K)return F(t,f,e.subarray(d,d+p));if(R(t,f,1+(K<Y)),f+=2,K<Y){g=x(y,C,0),m=y,A=x(I,T,0),b=I;var $=x(j,q,0);R(t,f,U-257),R(t,f+5,z-1),R(t,f+10,W-4),f+=14;for(var G=0;G<W;++G)R(t,f+3*G,j[u[G]]);f+=3*W;for(var J=[N,Q],Z=0;Z<2;++Z)for(var ee=J[Z],G=0;G<ee.length;++G){var et=31&ee[G];R(t,f,$[et]),f+=j[et],et>15&&(R(t,f,ee[G]>>5&127),f+=ee[G]>>12)}}else g=w,m=S,A=_,b=E;for(var G=0;G<l;++G){var er=i[G];if(er>255){var et=er>>18&31;B(t,f,g[et+257]),f+=m[et+257],et>7&&(R(t,f,er>>23&31),f+=c[et]);var ei=31&er;B(t,f,A[ei]),f+=b[ei],ei>3&&(B(t,f,er>>5&8191),f+=h[ei])}else B(t,f,g[er]),f+=m[er]}return B(t,f,g[256]),f+m[256]},U=new l([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),O=new s(0),Q=function(e,t,r,i,n,a){var u=a.z||e.length,d=new s(i+u+5*(1+Math.ceil(u/7e3))+n),p=d.subarray(i,d.length-n),f=a.l,m=7&(a.r||0);if(t){m&&(p[0]=a.r>>3);for(var b=U[t-1],v=b>>13,y=8191&b,x=(1<<r)-1,S=a.p||new o(32768),E=a.h||new o(x+1),w=Math.ceil(r/3),_=2*w,I=function(t){return(e[t]^e[t+1]<<w^e[t+2]<<_)&x},T=new l(25e3),R=new o(288),B=new o(32),k=0,P=0,D=a.i||0,L=0,O=a.w||0,Q=0;D+2<u;++D){var z=I(D),H=32767&D,G=E[z];if(S[H]=G,E[z]=H,O<=D){var V=u-D;if((k>7e3||L>24576)&&(V>423||!f)){m=N(e,p,0,T,R,B,P,L,Q,D-Q,m),L=k=P=0,Q=D;for(var j=0;j<286;++j)R[j]=0;for(var j=0;j<30;++j)B[j]=0}var q=2,W=0,X=y,Y=H-G&32767;if(V>2&&z==I(D-Y))for(var K=Math.min(v,V)-1,$=Math.min(32767,D),J=Math.min(258,V);Y<=$&&--X&&H!=G;){if(e[D+q]==e[D+q-Y]){for(var Z=0;Z<J&&e[D+Z]==e[D+Z-Y];++Z);if(Z>q){if(q=Z,W=Y,Z>K)break;for(var ee=Math.min(Y,Z-2),et=0,j=0;j<ee;++j){var er=D-Y+j&32767,ei=S[er],en=er-ei&32767;en>et&&(et=en,G=er)}}}G=S[H=G],Y+=H-G&32767}if(W){T[L++]=0x10000000|g[q]<<18|A[W];var ea=31&g[q],es=31&A[W];P+=c[ea]+h[es],++R[257+ea],++B[es],O=D+q,++k}else T[L++]=e[D],++R[e[D]]}}for(D=Math.max(D,O);D<u;++D)T[L++]=e[D],++R[e[D]];m=N(e,p,f,T,R,B,P,L,Q,D-Q,m),f||(a.r=7&m|p[m/8|0]<<3,m-=7,a.h=E,a.p=S,a.i=D,a.w=O)}else{for(var D=a.w||0;D<u+f;D+=65535){var eo=D+65535;eo>=u&&(p[m/8|0]=f,eo=u),m=F(p,m+1,e.subarray(D,eo))}a.i=u}return M(d,0,i+C(m)+n)},z=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,i=9;--i;)r=(1&r&&-0x12477ce0)^r>>>1;e[t]=r}return e}(),H=function(){var e=-1;return{p:function(t){for(var r=e,i=0;i<t.length;++i)r=z[255&r^t[i]]^r>>>8;e=r},d:function(){return~e}}},G=function(e,t,r,i,n){if(!n&&(n={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new s(a.length+e.length);o.set(a),o.set(e,a.length),e=o,n.w=a.length}return Q(e,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,r,i,n)},V=function(e,t){var r={};for(var i in e)r[i]=e[i];for(var i in t)r[i]=t[i];return r},j=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},q=function(e,t,r,i){for(var n in e){var a=e[n],o=t+n,l=i;Array.isArray(a)&&(l=V(i,a[1]),a=a[0]),a instanceof s?r[o]=[a,l]:(r[o+="/"]=[new s(0),l],q(a,o,r,i))}},W="u">typeof TextEncoder&&new TextEncoder,X="u">typeof TextDecoder&&new TextDecoder;try{X.decode(O,{stream:!0})}catch(e){}function Y(e,t){if(t){for(var r=new s(e.length),i=0;i<e.length;++i)r[i]=e.charCodeAt(i);return r}if(W)return W.encode(e);for(var n=e.length,a=new s(e.length+(e.length>>1)),o=0,l=function(e){a[o++]=e},i=0;i<n;++i){if(o+5>a.length){var c=new s(o+8+(n-i<<1));c.set(a),a=c}var h=e.charCodeAt(i);h<128||t?l(h):(h<2048?l(192|h>>6):(h>55295&&h<57344?(l(240|(h=65536+(1047552&h)|1023&e.charCodeAt(++i))>>18),l(128|h>>12&63)):l(224|h>>12),l(128|h>>6&63)),l(128|63&h))}return M(a,0,o)}var K=function(e){var t=0;if(e)for(var r in e){var i=e[r].length;i>65535&&T(9),t+=i+4}return t},$=function(e,t,r,i,n,a,s,o){var l=i.length,c=r.extra,h=o&&o.length,u=K(c);j(e,t,null!=s?0x2014b50:0x4034b50),t+=4,null!=s&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(a<0&&8),e[t++]=n&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var d=new Date(null==r.mtime?Date.now():r.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&T(10),j(e,t,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),t+=4,-1!=a&&(j(e,t,r.crc),j(e,t+4,a<0?-a-2:a),j(e,t+8,r.size)),j(e,t+12,l),j(e,t+14,u),t+=16,null!=s&&(j(e,t,h),j(e,t+6,r.attrs),j(e,t+10,s),t+=14),e.set(i,t),t+=l,u)for(var f in c){var g=c[f],m=g.length;j(e,t,+f),j(e,t+2,m),e.set(g,t+4),t+=4+m}return h&&(e.set(o,t),t+=h),t},J=function(e,t,r,i,n){j(e,t,0x6054b50),j(e,t+8,r),j(e,t+10,r),j(e,t+12,i),j(e,t+16,n)};"function"==typeof queueMicrotask&&queueMicrotask;class Z{constructor(e,t="",r=[],i=[]){this.name=e,this.type=t,this.metadata=r,this.properties=i,this.children=[]}addMetadata(e,t){this.metadata.push({key:e,value:t})}addProperty(e,t=[]){this.properties.push({property:e,metadata:t})}addChild(e){this.children.push(e)}toString(e=0){let t=" ".repeat(e),r=this.metadata.map(e=>{let r=e.key,i=e.value;if(!Array.isArray(i))return`${r} = ${i}`;{let e=[];return e.push(`${r} = {`),i.forEach(r=>{e.push(`${t} ${r}`)}),e.push(`${t} }`),e.join("\n")}}),i=r.length?` (
3
+ ${r.map(e=>`${t} ${e}`).join("\n")}
4
+ ${t})`:"",n=this.properties.map(e=>{let r=e.property,i=e.metadata.length?` (
5
+ ${e.metadata.map(e=>`${t} ${e}`).join("\n")}
6
+ ${t} )`:"";return`${t} ${r}${i}`}),a=this.children.map(t=>t.toString(e+1)),s=[];if(n.length>0&&s.push(...n),a.length>0){n.length>0&&s.push("");for(let e=0;e<a.length;e++)s.push(a[e]),e<a.length-1&&s.push("")}let o=s.join("\n"),l=this.type?this.type+" ":"";return`${t}def ${l}"${this.name}"${i}
7
+ ${t}{
8
+ ${o}
9
+ ${t}}`}}class ee{constructor(){this.textureUtils=null}setTextureUtils(e){this.textureUtils=e}parse(e,t,r,i){this.parseAsync(e,i).then(t).catch(r)}async parseAsync(e,t={}){let r;t=Object.assign({ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:"horizontal"}},includeAnchoringProperties:!0,onlyVisible:!0,quickLookCompatible:!1,maxTextureSize:1024},t);let i=new Set,n={},o="model.usda";n[o]=null;let l=new Z("Root","Xform"),c=new Z("Scenes","Scope");c.addMetadata("kind",'"sceneLibrary"'),l.addChild(c);let h="Scene",u=new Z(h,"Xform");u.addMetadata("customData",["bool preliminary_collidesWithEnvironment = 0",`string sceneName = "${h}"`]),u.addMetadata("sceneName",`"${h}"`),t.includeAnchoringProperties&&(u.addProperty(`token preliminary:anchoring:type = "${t.ar.anchoring.type}"`),u.addProperty(`token preliminary:planeAnchoring:alignment = "${t.ar.planeAnchoring.alignment}"`)),c.addChild(u);let d={},p={};!function e(t,r,i,n,a,s){for(let o=0,l=t.children.length;o<l;o++){let l,c=t.children[o];if(!1!==c.visible||!0!==s.onlyVisible){if(c.isMesh){let e=c.geometry,t=c.material;if(t.isMeshStandardMaterial){let r="geometries/Geometry_"+e.id+".usda";if(!(r in a)){let t=function(e){let t=new Z("Geometry"),r=function(e){var t;let r=e.attributes,i=r.position.count,n=new Z("Geometry","Mesh");n.addProperty(`int[] faceVertexCounts = [${Array((null!==(t=e).index?t.index.count:t.attributes.position.count)/3).fill(3).join(", ")}]`),n.addProperty(`int[] faceVertexIndices = [${function(e){let t=e.index,r=[];if(null!==t)for(let e=0;e<t.count;e++)r.push(t.getX(e));else{let t=e.attributes.position.count;for(let e=0;e<t;e++)r.push(e)}return r.join(", ")}(e)}]`),n.addProperty(`normal3f[] normals = [${es(r.normal,i)}]`,['interpolation = "vertex"']),n.addProperty(`point3f[] points = [${es(r.position,i)}]`);for(let e=0;e<4;e++){let t=e>0?e:"",i=r["uv"+t];void 0!==i&&n.addProperty(`texCoord2f[] primvars:st${t} = [${function(e){let t=[];for(let r=0;r<e.count;r++){let i=e.getX(r),n=e.getY(r);t.push(`(${i.toPrecision(7)}, ${1-n.toPrecision(7)})`)}return t.join(", ")}(i)}]`,['interpolation = "vertex"'])}let a=r.color;return void 0!==a&&n.addProperty(`color3f[] primvars:displayColor = [${es(a,i)}]`,['interpolation = "vertex"']),n.addProperty('uniform token subdivisionScheme = "none"'),n}(e);return t.addChild(r),t}(e);a[r]=Y(er()+"\n"+t.toString())}t.uuid in i||(i[t.uuid]=t),l=function(e,t,r,i){let n=ei(e,i);return n.addMetadata("prepend references",`@./geometries/Geometry_${t.id}.usda@</Geometry>`),n.addMetadata("prepend apiSchemas",'["MaterialBindingAPI"]'),n.addProperty(`rel material:binding = </Materials/Material_${r.id}>`),n}(c,e,i[t.uuid],n)}else console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",c)}else l=c.isCamera?function(e,t){let r,i,n=et(e,t),a=en(e.matrix);0>e.matrix.determinant()&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e);let s=new Z(n,"Camera");s.addProperty(`matrix4d xformOp:transform = ${a}`),s.addProperty('uniform token[] xformOpOrder = ["xformOp:transform"]');let o=e.isOrthographicCamera?"orthographic":"perspective";s.addProperty(`token projection = "${o}"`);let l=`(${e.near.toPrecision(7)}, ${e.far.toPrecision(7)})`;if(s.addProperty(`float2 clippingRange = ${l}`),r=e.isOrthographicCamera?((Math.abs(e.left)+Math.abs(e.right))*10).toPrecision(7):e.getFilmWidth().toPrecision(7),s.addProperty(`float horizontalAperture = ${r}`),i=e.isOrthographicCamera?((Math.abs(e.top)+Math.abs(e.bottom))*10).toPrecision(7):e.getFilmHeight().toPrecision(7),s.addProperty(`float verticalAperture = ${i}`),e.isPerspectiveCamera){let t=e.getFocalLength().toPrecision(7);s.addProperty(`float focalLength = ${t}`);let r=e.focus.toPrecision(7);s.addProperty(`float focusDistance = ${r}`)}return s}(c,n):ei(c,n);l&&(r.addChild(l),e(c,l,i,n,a,s))}}}(e,u,d,i,n,t);let f=function(e,t,r=!1){let i=new Z("Materials");for(let n in e){let s=e[n];i.addChild(function(e,t,r=!1){let i=new Z(`Material_${e.id}`,"Material");function n(i,n,a){var s;let o=i.source.id+"_"+i.flipY;t[o]=i;let l=i.channel>0?"st"+i.channel:"st",c={1e3:"repeat",1001:"clamp",1002:"mirror"},h=i.repeat.clone(),u=i.offset.clone(),d=i.rotation,p=Math.sin(d),f=Math.cos(d);u.y=1-u.y-h.y,r?(u.x=u.x/h.x,u.y=u.y/h.y,u.x+=p/h.x,u.y+=f-1):(u.x+=p*h.x,u.y+=(1-f)*h.y);let g=new Z(`PrimvarReader_${n}`,"Shader");g.addProperty('uniform token info:id = "UsdPrimvarReader_float2"'),g.addProperty("float2 inputs:fallback = (0.0, 0.0)"),g.addProperty(`string inputs:varname = "${l}"`),g.addProperty("float2 outputs:result");let m=new Z(`Transform2d_${n}`,"Shader");m.addProperty('uniform token info:id = "UsdTransform2d"'),m.addProperty(`float2 inputs:in.connect = </Materials/Material_${e.id}/PrimvarReader_${n}.outputs:result>`),m.addProperty(`float inputs:rotation = ${(180/Math.PI*d).toFixed(7)}`),m.addProperty(`float2 inputs:scale = ${el(h)}`),m.addProperty(`float2 inputs:translation = ${el(u)}`),m.addProperty("float2 outputs:result");let A=new Z(`Texture_${i.id}_${n}`,"Shader");return A.addProperty('uniform token info:id = "UsdUVTexture"'),A.addProperty(`asset inputs:file = @textures/Texture_${o}.png@`),A.addProperty(`float2 inputs:st.connect = </Materials/Material_${e.id}/Transform2d_${n}.outputs:result>`),void 0!==a&&A.addProperty(`float4 inputs:scale = ${(s=a,`(${s.r}, ${s.g}, ${s.b}, 1.0)`)}`),"normal"===n&&(A.addProperty("float4 inputs:scale = (2, 2, 2, 1)"),A.addProperty("float4 inputs:bias = (-1, -1, -1, 0)")),A.addProperty(`token inputs:sourceColorSpace = "${""===i.colorSpace?"raw":"sRGB"}"`),A.addProperty(`token inputs:wrapS = "${c[i.wrapS]}"`),A.addProperty(`token inputs:wrapT = "${c[i.wrapT]}"`),A.addProperty("float outputs:r"),A.addProperty("float outputs:g"),A.addProperty("float outputs:b"),A.addProperty("float3 outputs:rgb"),(e.transparent||e.alphaTest>0)&&A.addProperty("float outputs:a"),[g,m,A]}2===e.side&&console.warn("THREE.USDZExporter: USDZ does not support double sided materials",e);let s=new Z("PreviewSurface","Shader");if(s.addProperty('uniform token info:id = "UsdPreviewSurface"'),null!==e.map?(s.addProperty(`color3f inputs:diffuseColor.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:rgb>`),e.transparent?s.addProperty(`float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`):e.alphaTest>0&&(s.addProperty(`float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`),s.addProperty(`float inputs:opacityThreshold = ${e.alphaTest}`)),n(e.map,"diffuse",e.color).forEach(e=>i.addChild(e))):s.addProperty(`color3f inputs:diffuseColor = ${eo(e.color)}`),null!==e.emissiveMap){s.addProperty(`color3f inputs:emissiveColor.connect = </Materials/Material_${e.id}/Texture_${e.emissiveMap.id}_emissive.outputs:rgb>`);let t=new a.Q1f(e.emissive.r*e.emissiveIntensity,e.emissive.g*e.emissiveIntensity,e.emissive.b*e.emissiveIntensity);n(e.emissiveMap,"emissive",t).forEach(e=>i.addChild(e))}else e.emissive.getHex()>0&&s.addProperty(`color3f inputs:emissiveColor = ${eo(e.emissive)}`);if(null!==e.normalMap&&(s.addProperty(`normal3f inputs:normal.connect = </Materials/Material_${e.id}/Texture_${e.normalMap.id}_normal.outputs:rgb>`),n(e.normalMap,"normal").forEach(e=>i.addChild(e))),null!==e.aoMap){s.addProperty(`float inputs:occlusion.connect = </Materials/Material_${e.id}/Texture_${e.aoMap.id}_occlusion.outputs:r>`);let t=new a.Q1f(e.aoMapIntensity,e.aoMapIntensity,e.aoMapIntensity);n(e.aoMap,"occlusion",t).forEach(e=>i.addChild(e))}if(null!==e.roughnessMap){s.addProperty(`float inputs:roughness.connect = </Materials/Material_${e.id}/Texture_${e.roughnessMap.id}_roughness.outputs:g>`);let t=new a.Q1f(e.roughness,e.roughness,e.roughness);n(e.roughnessMap,"roughness",t).forEach(e=>i.addChild(e))}else s.addProperty(`float inputs:roughness = ${e.roughness}`);if(null!==e.metalnessMap){s.addProperty(`float inputs:metallic.connect = </Materials/Material_${e.id}/Texture_${e.metalnessMap.id}_metallic.outputs:b>`);let t=new a.Q1f(e.metalness,e.metalness,e.metalness);n(e.metalnessMap,"metallic",t).forEach(e=>i.addChild(e))}else s.addProperty(`float inputs:metallic = ${e.metalness}`);if(null!==e.alphaMap?(s.addProperty(`float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.alphaMap.id}_opacity.outputs:r>`),s.addProperty("float inputs:opacityThreshold = 0.0001"),n(e.alphaMap,"opacity").forEach(e=>i.addChild(e))):s.addProperty(`float inputs:opacity = ${e.opacity}`),e.isMeshPhysicalMaterial){if(null!==e.clearcoatMap){s.addProperty(`float inputs:clearcoat.connect = </Materials/Material_${e.id}/Texture_${e.clearcoatMap.id}_clearcoat.outputs:r>`);let t=new a.Q1f(e.clearcoat,e.clearcoat,e.clearcoat);n(e.clearcoatMap,"clearcoat",t).forEach(e=>i.addChild(e))}else s.addProperty(`float inputs:clearcoat = ${e.clearcoat}`);if(null!==e.clearcoatRoughnessMap){s.addProperty(`float inputs:clearcoatRoughness.connect = </Materials/Material_${e.id}/Texture_${e.clearcoatRoughnessMap.id}_clearcoatRoughness.outputs:g>`);let t=new a.Q1f(e.clearcoatRoughness,e.clearcoatRoughness,e.clearcoatRoughness);n(e.clearcoatRoughnessMap,"clearcoatRoughness",t).forEach(e=>i.addChild(e))}else s.addProperty(`float inputs:clearcoatRoughness = ${e.clearcoatRoughness}`);s.addProperty(`float inputs:ior = ${e.ior}`)}return s.addProperty("int inputs:useSpecularWorkflow = 0"),s.addProperty("token outputs:surface"),i.addChild(s),i.addProperty(`token outputs:surface.connect = </Materials/Material_${e.id}/PreviewSurface.outputs:surface>`),i}(s,t,r))}return i}(d,p,t.quickLookCompatible);for(let e in r=er()+"\n"+l.toString()+"\n\n"+f.toString(),n[o]=Y(r),r=null,p){let r=p[e];if(!0===r.isCompressedTexture)if(null===this.textureUtils)throw Error("THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.");else r=await this.textureUtils.decompress(r);let i=function(e,t,r){if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"u">typeof ImageBitmap&&e instanceof ImageBitmap){let i=r/Math.max(e.width,e.height),n=document.createElement("canvas");n.width=e.width*Math.min(1,i),n.height=e.height*Math.min(1,i);let a=n.getContext("2d");return!0===t&&(a.translate(0,n.height),a.scale(1,-1)),a.drawImage(e,0,0,n.width,n.height),n}throw Error("THREE.USDZExporter: No valid image data found. Unable to process texture.")}(r.image,r.flipY,t.maxTextureSize),a=await new Promise(e=>i.toBlob(e,"image/png",1));n[`textures/Texture_${e}.png`]=new Uint8Array(await a.arrayBuffer())}let g=0;for(let e in n){let t=n[e],r=63&(g+=34+e.length);if(4!==r){let i=new Uint8Array(64-r);n[e]=[t,{extra:{12345:i}}]}g=t.length}return function(e,t){t||(t={});var r={},i=[];q(e,"",r,t);var n=0,a=0;for(var o in r){var l=r[o],c=l[0],h=l[1],u=8*(0!=h.level),d=Y(o),p=d.length,f=h.comment,g=f&&Y(f),m=g&&g.length,A=K(h.extra);p>65535&&T(11);var b=u?G(c,h||{},0,0):c,v=b.length,y=H();y.p(c),i.push(V(h,{size:c.length,crc:y.d(),c:b,f:d,m:g,u:p!=o.length||g&&f.length!=m,o:n,compression:u})),n+=30+p+A+v,a+=76+2*(p+A)+(m||0)+v}for(var x=new s(a+22),S=n,E=a-n,w=0;w<i.length;++w){var d=i[w];$(x,d.o,d,d.f,d.u,d.c.length);var _=30+d.f.length+K(d.extra);x.set(d.c,d.o+_),$(x,n,d,d.f,d.u,d.c.length,d.o,d.m),n+=16+_+(d.m?d.m.length:0)}return J(x,n,i.length,E,S),x}(n,{level:0})}}function et(e,t){let r=e.name;return r=r.replace(/[^A-Za-z0-9_]/g,""),/^[0-9]/.test(r)&&(r="_"+r),""===r&&(r=e.isCamera?"Camera":"Object"),t.has(r)&&(r=r+"_"+e.id),t.add(r),r}function er(){return`#usda 1.0
10
+ (
11
+ customLayerData = {
12
+ string creator = "Three.js USDZExporter"
13
+ }
14
+ defaultPrim = "Root"
15
+ metersPerUnit = 1
16
+ upAxis = "Y"
17
+ )
18
+ `}function ei(e,t){let r=et(e,t),i=en(e.matrix);0>e.matrix.determinant()&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e);let n=new Z(r,"Xform");return n.addProperty(`matrix4d xformOp:transform = ${i}`),n.addProperty('uniform token[] xformOpOrder = ["xformOp:transform"]'),n}function en(e){let t=e.elements;return`( ${ea(t,0)}, ${ea(t,4)}, ${ea(t,8)}, ${ea(t,12)} )`}function ea(e,t){return`(${e[t+0]}, ${e[t+1]}, ${e[t+2]}, ${e[t+3]})`}function es(e,t){if(void 0===e)return console.warn("USDZExporter: Normals missing."),Array(t).fill("(0, 0, 0)").join(", ");let r=[];for(let t=0;t<e.count;t++){let i=e.getX(t),n=e.getY(t),a=e.getZ(t);r.push(`(${i.toPrecision(7)}, ${n.toPrecision(7)}, ${a.toPrecision(7)})`)}return r.join(", ")}function eo(e){return`(${e.r}, ${e.g}, ${e.b})`}function el(e){return`(${e.x}, ${e.y})`}var ec=r(322),eh=r(3520),eu=r(1718),ed=r(3418),ep=r(1535),ef=function(e,t,r,i){var n,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,r,s):n(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};let eg=!1,em=!1,eA="#model-viewer-no-ar-fallback",eb=(i=["quick-look","scene-viewer","webxr","none"],e=>{try{let t=(0,eu.$y)(e),r=(t.length?t[0].terms:[]).filter(e=>e&&"ident"===e.type).map(e=>e.value).filter(e=>i.indexOf(e)>-1);return new Set(r)}catch(e){}return new Set}),ev="quick-look",ey="scene-viewer",ex="webxr",eS="none",eE=Symbol("arButtonContainer"),ew=Symbol("enterARWithWebXR"),e_=Symbol("openSceneViewer"),eC=Symbol("openIOSARQuickLook"),eM=Symbol("canActivateAR"),eI=Symbol("arMode"),eT=Symbol("arModes"),eR=Symbol("arAnchor"),eB=Symbol("preload"),ek=Symbol("onARButtonContainerClick"),eP=Symbol("onARStatus"),eD=Symbol("onARTracking"),eL=Symbol("onARTap"),eF=Symbol("selectARMode"),eN=Symbol("triggerLoad"),eU=e=>{var t,r,i,a,s,o,l,c,h,u;class d extends e{constructor(){super(...arguments),this.ar=!1,this.arScale="auto",this.arUsdzMaxTextureSize="auto",this.arPlacement="floor",this.arModes="webxr scene-viewer quick-look",this.iosSrc=null,this.xrEnvironment=!1,this[t]=!1,this[r]=this.shadowRoot.querySelector(".ar-button"),this[i]=document.createElement("a"),this[a]=new Set,this[s]=eS,this[o]=!1,this[l]=e=>{e.preventDefault(),this.activateAR()},this[c]=({status:e})=>{(e===ed.sF.NOT_PRESENTING||this[eh.m8].arRenderer.presentedScene===this[eh.lC])&&(this.setAttribute("ar-status",e),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:e}})),e===ed.sF.NOT_PRESENTING?this.removeAttribute("ar-tracking"):e===ed.sF.SESSION_STARTED&&this.setAttribute("ar-tracking",ed.pH.TRACKING))},this[h]=({status:e})=>{this.setAttribute("ar-tracking",e),this.dispatchEvent(new CustomEvent("ar-tracking",{detail:{status:e}}))},this[u]=e=>{"_apple_ar_quicklook_button_tapped"==e.data&&this.dispatchEvent(new CustomEvent("quick-look-button-tapped"))}}get canActivateAR(){return this[eI]!==eS}connectedCallback(){super.connectedCallback(),null!=this[eh.m8].arRenderer&&(this[eh.m8].arRenderer.addEventListener("status",this[eP]),this.setAttribute("ar-status",ed.sF.NOT_PRESENTING),this[eh.m8].arRenderer.addEventListener("tracking",this[eD])),this[eR].addEventListener("message",this[eL])}disconnectedCallback(){super.disconnectedCallback(),null!=this[eh.m8].arRenderer&&(this[eh.m8].arRenderer.removeEventListener("status",this[eP]),this[eh.m8].arRenderer.removeEventListener("tracking",this[eD])),this[eR].removeEventListener("message",this[eL])}update(e){super.update(e),e.has("arScale")&&(this[eh.lC].canScale="fixed"!==this.arScale),e.has("arPlacement")&&(this[eh.lC].updateShadow(),this[eh.ML]()),e.has("arModes")&&(this[eT]=eb(this.arModes)),(e.has("ar")||e.has("arModes")||e.has("src")||e.has("iosSrc")||e.has("arUsdzMaxTextureSize"))&&this[eF]()}async activateAR(){switch(this[eI]){case ev:await this[eC]();break;case ex:await this[ew]();break;case ey:this[e_]();break;default:console.warn("No AR Mode can be activated. This is probably due to missing configuration or device capabilities")}}async [(t=eM,r=eE,i=eR,a=eT,s=eI,o=eB,l=ek,c=eP,h=eD,u=eL,eF)](){var e;let t=eS;if(this.ar){if(null!=this.src)for(let r of this[eT]){if("webxr"===r&&ec.al&&!eg&&await this[eh.m8].arRenderer.supportsPresentation()){t=ex;break}if("scene-viewer"===r&&!em&&(ec.oU||navigator.userAgentData&&navigator.userAgentData.getHighEntropyValues&&(null==(e=(await navigator.userAgentData.getHighEntropyValues(["formFactor"])).formFactor)?void 0:e.includes("XR")))){t=ey;break}if("quick-look"===r&&ec.UN){t=ev;break}}t===eS&&null!=this.iosSrc&&ec.UN&&(t=ev)}if(t!==eS)this[eE].classList.add("enabled"),this[eE].addEventListener("click",this[ek]);else if(this[eE].classList.contains("enabled")){this[eE].removeEventListener("click",this[ek]),this[eE].classList.remove("enabled");let e=ed.sF.FAILED;this.setAttribute("ar-status",e),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:e}}))}this[eI]=t}async [ew](){console.log("Attempting to present in AR with WebXR..."),await this[eN]();try{this[eE].removeEventListener("click",this[ek]);let{arRenderer:e}=this[eh.m8];e.placeOnWall="wall"===this.arPlacement,await e.present(this[eh.lC],this.xrEnvironment)}catch(e){console.warn("Error while trying to present in AR with WebXR"),console.error(e),await this[eh.m8].arRenderer.stopPresenting(),eg=!0,console.warn("Falling back to next ar-mode"),await this[eF](),this.activateAR()}finally{this[eF]()}}async [eN](){this.loaded||(this[eB]=!0,this[eh.Hc](),await (0,ep.lA)(this,"load"),this[eB]=!1)}[eh.sM](){return super[eh.sM]()||this[eB]}[e_](){let e=self.location.toString(),t=new URL(e),r=new URL(this.src,e);r.hash&&(r.hash="");let i=new URLSearchParams(r.search);if(t.hash=eA,i.set("mode","ar_preferred"),i.has("disable_occlusion")||i.set("disable_occlusion","true"),"fixed"===this.arScale&&i.set("resizable","false"),"wall"===this.arPlacement&&i.set("enable_vertical_placement","true"),i.has("sound")){let t=new URL(i.get("sound"),e);i.set("sound",t.toString())}if(i.has("link")){let t=new URL(i.get("link"),e);i.set("link",t.toString())}let n=`intent://arvr.google.com/scene-viewer/1.2?${i.toString()+"&file="+encodeURIComponent(r.toString())}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(t.toString())};end;`,a=()=>{self.location.hash===eA&&(em=!0,self.history.back(),console.warn("Error while trying to present in AR with Scene Viewer"),console.warn("Falling back to next ar-mode"),this[eF]())};self.addEventListener("hashchange",a,{once:!0}),this[eR].setAttribute("href",n),console.log("Attempting to present in AR with Scene Viewer..."),this[eR].click()}async [eC](){let e=!this.iosSrc;this[eE].classList.remove("enabled");let t=e?await this.prepareUSDZ():this.iosSrc,r=new URL(t,self.location.toString());if(e){let e=new URL(self.location.toString()),t=new URL(this.src,e);t.hash&&(r.hash=t.hash)}"fixed"===this.arScale&&(r.hash&&(r.hash+="&"),r.hash+="allowsContentScaling=0");let i=this[eR];i.setAttribute("rel","ar");let n=document.createElement("img");i.appendChild(n),i.setAttribute("href",r.toString()),e&&i.setAttribute("download","model.usdz"),i.style.display="none",i.isConnected||this.shadowRoot.appendChild(i),console.log("Attempting to present in AR with Quick Look..."),i.click(),i.removeChild(n),e&&URL.revokeObjectURL(t),this[eE].classList.add("enabled")}async prepareUSDZ(){let e=this[eh.OS].beginActivity("usdz-conversion");await this[eN]();let{model:t,shadow:r,target:i}=this[eh.lC];if(null==t)return"";let n=!1;null!=r&&(n=r.visible,r.visible=!1),e(.2);let a=new ee;i.remove(t),t.position.copy(i.position),t.updateWorldMatrix(!1,!0);let s=await a.parseAsync(t,{maxTextureSize:isNaN(this.arUsdzMaxTextureSize)?1/0:Math.max(parseInt(this.arUsdzMaxTextureSize),16)});t.position.set(0,0,0),i.add(t);let o=new Blob([s],{type:"model/vnd.usdz+zip"}),l=URL.createObjectURL(o);return e(1),null!=r&&(r.visible=n),l}}return ef([(0,n.MZ)({type:Boolean,attribute:"ar"})],d.prototype,"ar",void 0),ef([(0,n.MZ)({type:String,attribute:"ar-scale"})],d.prototype,"arScale",void 0),ef([(0,n.MZ)({type:String,attribute:"ar-usdz-max-texture-size"})],d.prototype,"arUsdzMaxTextureSize",void 0),ef([(0,n.MZ)({type:String,attribute:"ar-placement"})],d.prototype,"arPlacement",void 0),ef([(0,n.MZ)({type:String,attribute:"ar-modes"})],d.prototype,"arModes",void 0),ef([(0,n.MZ)({type:String,attribute:"ios-src"})],d.prototype,"iosSrc",void 0),ef([(0,n.MZ)({type:Boolean,attribute:"xr-environment"})],d.prototype,"xrEnvironment",void 0),d}},9051(e,t,r){"use strict";let i,n,a;r.d(t,{av:()=>U,Qg:()=>w,uG:()=>ed});var s=r(8413),o=r(874),l=r(6650),c=r(3520),h=r(3935),u=r(5978),d=r(1718),p=r(119),f=r(1535);let g=e=>e<.5?2*e*e:-1+(4-2*e)*e,m=(e,t,r=g)=>i=>e+(t-e)*r(i),A=e=>{let t,r,i=[],n=[],a=e.initialValue;for(let t=0;t<e.keyframes.length;++t){let r=e.keyframes[t],{value:s,frames:o}=r,l=m(a,s,r.ease||g);i.push(l),n.push(o),a=s}return r=n.map((t=0,e=>t+=e)),e=>{e=(0,f.qE)(e,0,1)*r[r.length-1];let t=r.findIndex(t=>t>=e),n=t<1?0:r[t-1],a=r[t];return i[t]((e-n)/(a-n))}};var b=function(e,t,r,i){var n,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,r,s):n(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};let v=A({initialValue:0,keyframes:[{frames:5,value:-1},{frames:1,value:-1},{frames:8,value:1},{frames:1,value:1},{frames:5,value:0},{frames:18,value:0}]}),y=A({initialValue:0,keyframes:[{frames:1,value:1},{frames:5,value:1},{frames:1,value:0},{frames:6,value:0}]}),x="0deg 75deg 105%",S=["front","right","back","left"],E=["upper-","","lower-"],w=". Use mouse, touch or arrow keys to move.",_="auto",C="wiggle",M=()=>({basis:[(0,h.tR)((0,d.sJ)(30,"deg"))],keywords:{auto:[null]}}),I=()=>({basis:[(0,h.tR)((0,d.sJ)(12,"deg"))],keywords:{auto:[null]}}),T=(i=(0,d.$y)(x)[0].terms,n=(0,h.cg)(i[0]),a=(0,h.cg)(i[1]),e=>{let t=e[c.lC].idealCameraDistance();return{basis:[n,a,(0,d.sJ)(t,"m")],keywords:{auto:[null,null,(0,d.sJ)(105,"%")]}}}),R=e=>{let t=2.2*e[c.lC].boundingSphere.radius;return{basis:[(0,d.sJ)(-1/0,"rad"),(0,d.sJ)(0,"rad"),(0,d.sJ)(t,"m")],keywords:{auto:[null,null,null]}}},B=e=>{let t=T(e),r=new u.bk([],t).evaluate()[2];return{basis:[(0,d.sJ)(1/0,"rad"),(0,d.sJ)(Math.PI,"rad"),(0,d.sJ)(r,"m")],keywords:{auto:[null,null,null]}}},k=e=>{let t=e[c.lC].boundingBox.getCenter(new o.Pq0);return{basis:[(0,d.sJ)(t.x,"m"),(0,d.sJ)(t.y,"m"),(0,d.sJ)(t.z,"m")],keywords:{auto:[null,null,null]}}},P=Math.PI/2,D=Math.PI/3,L=P/2,F=2*Math.PI,N=Symbol("controls"),U=Symbol("panElement"),O=Symbol("promptElement"),Q=Symbol("promptAnimatedContainer"),z=Symbol("fingerAnimatedContainers"),H=Symbol("deferInteractionPrompt"),G=Symbol("updateAria"),V=Symbol("a11y"),j=Symbol("updateA11y"),q=Symbol("updateCameraForRadius"),W=Symbol("cancelPrompts"),X=Symbol("onChange"),Y=Symbol("onPointerChange"),K=Symbol("waitingToPromptUser"),$=Symbol("userHasInteracted"),J=Symbol("promptElementVisibleTime"),Z=Symbol("lastPromptOffset"),ee=Symbol("cancellationSource"),et=Symbol("lastSpherical"),er=Symbol("jumpCamera"),ei=Symbol("initialized"),en=Symbol("maintainThetaPhi"),ea=Symbol("syncCameraOrbit"),es=Symbol("syncFieldOfView"),eo=Symbol("syncCameraTarget"),el=Symbol("syncMinCameraOrbit"),ec=Symbol("syncMaxCameraOrbit"),eh=Symbol("syncMinFieldOfView"),eu=Symbol("syncMaxFieldOfView"),ed=e=>{var t,r,i,n,a,h,u,d,f,g,m,ed,ep,ef,eg,em,eA,eb;class ev extends e{constructor(){super(...arguments),this.cameraControls=!1,this.cameraOrbit=x,this.cameraTarget="auto auto auto",this.fieldOfView="auto",this.minCameraOrbit="auto",this.maxCameraOrbit="auto",this.minFieldOfView="auto",this.maxFieldOfView="auto",this.interactionPromptThreshold=3e3,this.interactionPrompt=_,this.interactionPromptStyle=C,this.orbitSensitivity=1,this.zoomSensitivity=1,this.panSensitivity=1,this.touchAction="none",this.disableZoom=!1,this.disablePan=!1,this.disableTap=!1,this.interpolationDecay=50,this.a11y=null,this[t]=this.shadowRoot.querySelector(".interaction-prompt"),this[r]=this.shadowRoot.querySelector("#prompt"),this[i]=[this.shadowRoot.querySelector("#finger0"),this.shadowRoot.querySelector("#finger1")],this[n]=this.shadowRoot.querySelector(".pan-target"),this[a]=0,this[h]=1/0,this[u]=!1,this[d]=!1,this[f]=p.iC.AUTOMATIC,this[g]=new p.zJ(this[c.lC].camera,this[c.yc],this[c.lC]),this[m]=new o.YHV,this[ed]=!1,this[ep]=!1,this[ef]=!1,this[eg]={},this[em]=()=>{let e=this[N].changeSource;this[ee]=e,e===p.iC.USER_INTERACTION&&(this[$]=!0,this[H]())},this[eA]=()=>{this[G](),this[c.ML]();let e=this[N].changeSource;this.dispatchEvent(new CustomEvent("camera-change",{detail:{source:e}}))},this[eb]=e=>{this[c.SD].classList.toggle("pointer-tumbling","pointer-change-start"===e.type)}}get inputSensitivity(){return this[N].inputSensitivity}set inputSensitivity(e){this[N].inputSensitivity=e}getCameraOrbit(){let{theta:e,phi:t,radius:r}=this[et];return{theta:e,phi:t,radius:r,toString(){return`${this.theta}rad ${this.phi}rad ${this.radius}m`}}}getCameraTarget(){return(0,c.Gw)(this[c.m8].isPresenting?this[c.m8].arRenderer.target:this[c.lC].getDynamicTarget())}getFieldOfView(){return this[N].getFieldOfView()}getMinimumFieldOfView(){return this[N].options.minimumFieldOfView}getMaximumFieldOfView(){return this[N].options.maximumFieldOfView}getIdealAspect(){return this[c.lC].idealAspect}jumpCameraToGoal(){this[er]=!0,this.requestUpdate(er,!1)}resetInteractionPrompt(){this[Z]=0,this[J]=1/0,this[$]=!1,this[K]=this.interactionPrompt===_&&this.cameraControls}zoom(e){let t=new WheelEvent("wheel",{deltaY:-30*e});this[c.yc].dispatchEvent(t)}connectedCallback(){super.connectedCallback(),this[N].addEventListener("user-interaction",this[W]),this[N].addEventListener("pointer-change-start",this[Y]),this[N].addEventListener("pointer-change-end",this[Y])}disconnectedCallback(){super.disconnectedCallback(),this[N].removeEventListener("user-interaction",this[W]),this[N].removeEventListener("pointer-change-start",this[Y]),this[N].removeEventListener("pointer-change-end",this[Y])}updated(e){super.updated(e);let t=this[N],r=this[c.lC];if(e.has("cameraControls")&&(this.cameraControls?(t.enableInteraction(),this.interactionPrompt===_&&(this[K]=!0)):(t.disableInteraction(),this[H]()),this[c.yc].setAttribute("aria-label",this[c.Sw])),e.has("disableZoom")&&(t.disableZoom=this.disableZoom),e.has("disablePan")&&(t.enablePan=!this.disablePan),e.has("disableTap")&&(t.enableTap=!this.disableTap),(e.has("interactionPrompt")||e.has("cameraControls")||e.has("src"))&&(this.interactionPrompt===_&&this.cameraControls&&!this[$]?this[K]=!0:this[H]()),e.has("interactionPromptStyle")&&(this[Q].style.opacity="basic"==this.interactionPromptStyle?"1":"0"),e.has("touchAction")){let e=this.touchAction;t.applyOptions({touchAction:e}),t.updateTouchActionStyle()}e.has("orbitSensitivity")&&(t.orbitSensitivity=this.orbitSensitivity),e.has("zoomSensitivity")&&(t.zoomSensitivity=this.zoomSensitivity),e.has("panSensitivity")&&(t.panSensitivity=this.panSensitivity),e.has("interpolationDecay")&&(t.setDamperDecayTime(this.interpolationDecay),r.setTargetDamperDecayTime(this.interpolationDecay)),e.has("a11y")&&this[j](),!0===this[er]&&Promise.resolve().then(()=>{t.jumpToGoal(),r.jumpToGoal(),this[X](),this[er]=!1})}async updateFraming(){let e=this[c.lC],t=e.adjustedFoV(e.framedFoVDeg);await e.updateFraming();let r=e.adjustedFoV(e.framedFoVDeg),i=this[N].getFieldOfView()/t;this[N].setFieldOfView(r*i),this[en]=!0,this.requestUpdate("maxFieldOfView"),this.requestUpdate("fieldOfView"),this.requestUpdate("minCameraOrbit"),this.requestUpdate("maxCameraOrbit"),this.requestUpdate("cameraOrbit"),await this.updateComplete}interact(e,t,r){let i=this[c.yc],n=this[z];if("1"===n[0].style.opacity)return void console.warn("interact() failed because an existing interaction is running.");let a=[];a.push({x:A(t.x),y:A(t.y)});let s=[{x:a[0].x(0),y:a[0].y(0)}];null!=r&&(a.push({x:A(r.x),y:A(r.y)}),s.push({x:a[1].x(0),y:a[1].y(0)}));let o=performance.now(),{width:l,height:h}=this[c.lC],u=this.getBoundingClientRect(),d=e=>{for(let[t,r]of s.entries()){let{style:a}=n[t];a.transform=`translateX(${l*r.x}px) translateY(${h*r.y}px)`,"pointerdown"===e?a.opacity="1":"pointerup"===e&&(a.opacity="0");let s={pointerId:t-5678,pointerType:"touch",target:i,clientX:l*r.x+u.x,clientY:h*r.y+u.y,altKey:!0};i.dispatchEvent(new PointerEvent(e,s))}},f=()=>{let t=this[ee];if(t!==p.iC.AUTOMATIC||!i.isConnected){for(let e of this[z])e.style.opacity="0";d("pointercancel"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:t}})),document.removeEventListener("visibilitychange",g);return}let r=Math.min(1,(performance.now()-o)/e);for(let[e,t]of s.entries())t.x=a[e].x(r),t.y=a[e].y(r);d("pointermove"),r<1?requestAnimationFrame(f):(d("pointerup"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:p.iC.AUTOMATIC}})),document.removeEventListener("visibilitychange",g))},g=()=>{let e=0;"hidden"===document.visibilityState?e=performance.now()-o:o=performance.now()-e};document.addEventListener("visibilitychange",g),d("pointerdown"),this[ee]=p.iC.AUTOMATIC,requestAnimationFrame(f)}[(t=O,r=Q,i=z,n=U,a=Z,h=J,u=$,d=K,f=ee,g=N,m=et,ed=er,ep=ei,ef=en,eg=V,es)](e){let t=this[N],r=this[c.lC];r.framedFoVDeg=180*e[0]/Math.PI,t.changeSource=p.iC.NONE,t.setFieldOfView(r.adjustedFoV(r.framedFoVDeg)),this[W]()}[ea](e){let t=this[N];if(this[en]){let{theta:t,phi:r}=this.getCameraOrbit();e[0]=t,e[1]=r,this[en]=!1}t.changeSource=p.iC.NONE,t.setOrbit(e[0],e[1],e[2]),this[W]()}[el](e){this[N].applyOptions({minimumAzimuthalAngle:e[0],minimumPolarAngle:e[1],minimumRadius:e[2]}),this.jumpCameraToGoal()}[ec](e){this[N].applyOptions({maximumAzimuthalAngle:e[0],maximumPolarAngle:e[1],maximumRadius:e[2]}),this[q](e[2]),this.jumpCameraToGoal()}[eh](e){this[N].applyOptions({minimumFieldOfView:180*e[0]/Math.PI}),this.jumpCameraToGoal()}[eu](e){let t=this[c.lC].adjustedFoV(180*e[0]/Math.PI);this[N].applyOptions({maximumFieldOfView:t}),this.jumpCameraToGoal()}[eo](e){let[t,r,i]=e;this[c.m8].arRenderer.isPresenting||this[c.lC].setTarget(t,r,i),this[N].changeSource=p.iC.NONE,this[c.m8].arRenderer.updateTarget(),this[W]()}[c.Ei](e,t){if(super[c.Ei](e,t),this[c.m8].isPresenting||!this[c.gJ]())return;let r=this[N],i=this[c.lC],n=performance.now();if(this[K]&&this.loaded&&n>this[c.$M]+this.interactionPromptThreshold&&(this[K]=!1,this[J]=n,this[O].classList.add("visible")),isFinite(this[J])&&this.interactionPromptStyle===C){let e=(n-this[J])/5e3%1,t=v(e),a=y(e);if(this[Q].style.opacity=`${a}`,t!==this[Z]){let e=t*i.width*.05,n=(t-this[Z])*Math.PI/16;this[Q].style.transform=`translateX(${e}px)`,r.changeSource=p.iC.AUTOMATIC,r.adjustOrbit(n,0,0),this[Z]=t}}let a=r.update(e,t),s=i.updateTarget(t);(a||s)&&this[X]()}[H](){this[K]=!1,this[O].classList.remove("visible"),this[J]=1/0}[q](e){let t=Math.abs(2*Math.max(this[c.lC].farRadius(),e));this[N].updateNearFar(0,t)}[G](){let{theta:e,phi:t}=this[N].getCameraSpherical(this[et]),r=Math.floor(t/D),i=S[(4+Math.floor((e%F+L)/P))%4],n=E[r],a=`${n}${i}`;a in this[V]?this[c.Yl](this[V][a]):this[c.Yl](`View from stage ${a}`)}get[c.Sw](){let e=w;return"interaction-prompt"in this[V]&&(e=`. ${this[V]["interaction-prompt"]}`),super[$ariaLabel].replace(/\.$/,"")+(this.cameraControls?e:"")}async [c.if](e){let t=this[N],r=this[c.lC],i=r.adjustedFoV(r.framedFoVDeg);super[c.if](e);let n=r.adjustedFoV(r.framedFoVDeg)/i,a=t.getFieldOfView()*(isFinite(n)?n:1);t.updateAspect(this[c.lC].aspect),this.requestUpdate("maxFieldOfView",this.maxFieldOfView),await this.updateComplete,this[N].setFieldOfView(a),this.jumpCameraToGoal()}[c.vA](){super[c.vA](),this[ei]?this[en]=!0:this[ei]=!0,this.requestUpdate("maxFieldOfView",this.maxFieldOfView),this.requestUpdate("fieldOfView",this.fieldOfView),this.requestUpdate("minCameraOrbit",this.minCameraOrbit),this.requestUpdate("maxCameraOrbit",this.maxCameraOrbit),this.requestUpdate("cameraOrbit",this.cameraOrbit),this.requestUpdate("cameraTarget",this.cameraTarget),this.jumpCameraToGoal()}[(em=W,eA=X,eb=Y,j)](){if("string"==typeof this.a11y)if(this.a11y.startsWith("{"))try{this[V]=JSON.parse(this.a11y)}catch(e){console.warn("Error parsing a11y JSON:",e)}else this.a11y.length>0?console.warn("Error not supported format, should be a JSON string:",this.a11y):this[V]={};else"object"==typeof this.a11y&&null!=this.a11y?this[V]=Object.assign({},this.a11y):this[V]={};this[c.yc].setAttribute("aria-label",this[c.Sw])}}return b([(0,s.MZ)({type:Boolean,attribute:"camera-controls"})],ev.prototype,"cameraControls",void 0),b([(0,l.i)({intrinsics:T,observeEffects:!0,updateHandler:ea}),(0,s.MZ)({type:String,attribute:"camera-orbit",hasChanged:()=>!0})],ev.prototype,"cameraOrbit",void 0),b([(0,l.i)({intrinsics:k,observeEffects:!0,updateHandler:eo}),(0,s.MZ)({type:String,attribute:"camera-target",hasChanged:()=>!0})],ev.prototype,"cameraTarget",void 0),b([(0,l.i)({intrinsics:M,observeEffects:!0,updateHandler:es}),(0,s.MZ)({type:String,attribute:"field-of-view",hasChanged:()=>!0})],ev.prototype,"fieldOfView",void 0),b([(0,l.i)({intrinsics:R,updateHandler:el}),(0,s.MZ)({type:String,attribute:"min-camera-orbit",hasChanged:()=>!0})],ev.prototype,"minCameraOrbit",void 0),b([(0,l.i)({intrinsics:B,updateHandler:ec}),(0,s.MZ)({type:String,attribute:"max-camera-orbit",hasChanged:()=>!0})],ev.prototype,"maxCameraOrbit",void 0),b([(0,l.i)({intrinsics:I,updateHandler:eh}),(0,s.MZ)({type:String,attribute:"min-field-of-view",hasChanged:()=>!0})],ev.prototype,"minFieldOfView",void 0),b([(0,l.i)({intrinsics:M,updateHandler:eu}),(0,s.MZ)({type:String,attribute:"max-field-of-view",hasChanged:()=>!0})],ev.prototype,"maxFieldOfView",void 0),b([(0,s.MZ)({type:Number,attribute:"interaction-prompt-threshold"})],ev.prototype,"interactionPromptThreshold",void 0),b([(0,s.MZ)({type:String,attribute:"interaction-prompt"})],ev.prototype,"interactionPrompt",void 0),b([(0,s.MZ)({type:String,attribute:"interaction-prompt-style"})],ev.prototype,"interactionPromptStyle",void 0),b([(0,s.MZ)({type:Number,attribute:"orbit-sensitivity"})],ev.prototype,"orbitSensitivity",void 0),b([(0,s.MZ)({type:Number,attribute:"zoom-sensitivity"})],ev.prototype,"zoomSensitivity",void 0),b([(0,s.MZ)({type:Number,attribute:"pan-sensitivity"})],ev.prototype,"panSensitivity",void 0),b([(0,s.MZ)({type:String,attribute:"touch-action"})],ev.prototype,"touchAction",void 0),b([(0,s.MZ)({type:Boolean,attribute:"disable-zoom"})],ev.prototype,"disableZoom",void 0),b([(0,s.MZ)({type:Boolean,attribute:"disable-pan"})],ev.prototype,"disablePan",void 0),b([(0,s.MZ)({type:Boolean,attribute:"disable-tap"})],ev.prototype,"disableTap",void 0),b([(0,s.MZ)({type:Number,attribute:"interpolation-decay"})],ev.prototype,"interpolationDecay",void 0),b([(0,s.MZ)()],ev.prototype,"a11y",void 0),ev}},6526(e,t,r){"use strict";r.d(t,{fr:()=>o,hj:()=>c,kT:()=>l,xh:()=>u});var i=r(8413),n=r(3520),a=r(1535),s=function(e,t,r,i){var n,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,r,s):n(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};let o=Symbol("currentEnvironmentMap"),l=Symbol("currentBackground"),c=Symbol("updateEnvironment"),h=Symbol("cancelEnvironmentUpdate"),u=e=>{var t,r,u;class d extends e{constructor(){super(...arguments),this.environmentImage=null,this.skyboxImage=null,this.shadowIntensity=0,this.shadowSoftness=1,this.exposure=1,this.toneMapping="auto",this.skyboxHeight="0",this[t]=null,this[r]=null,this[u]=null}updated(e){var t;if(super.updated(e),e.has("shadowIntensity")&&(this[n.lC].setShadowIntensity(.5*this.shadowIntensity),this[n.ML]()),e.has("shadowSoftness")&&(this[n.lC].setShadowSoftness(this.shadowSoftness),this[n.ML]()),e.has("exposure")&&(this[n.lC].exposure=this.exposure,this[n.ML]()),e.has("toneMapping")){let e=new Map([["aces",4],["agx",6],["reinhard",2],["cineon",3],["linear",1],["none",0]]);this[n.lC].toneMapping=null!=(t=e.get(this.toneMapping))?t:7,this[n.ML]()}(e.has("environmentImage")||e.has("skyboxImage"))&&this[n.sM]()&&this[c](),e.has("skyboxHeight")&&(this[n.lC].setGroundedSkybox(),this[n.ML]())}hasBakedShadow(){return this[n.lC].bakedShadows.size>0}async [(t=o,r=l,u=h,c)](){let{skyboxImage:e,environmentImage:t}=this;null!=this[h]&&(this[h](),this[h]=null);let{textureUtils:r}=this[n.m8];if(null==r)return;let i=this[n.OS].beginActivity("environment-update");try{let{environmentMap:s,skybox:c}=await r.generateEnvironmentMapAndSkybox((0,a.pE)(e),t,e=>i((0,a.qE)(e,0,1)),this.withCredentials);this[o]!==s&&(this[o]=s,this.dispatchEvent(new CustomEvent("environment-change"))),null!=c?this[l]=c.name===s.name?s:c:this[l]=null,this[n.lC].setEnvironmentAndSkybox(this[o],this[l])}catch(e){if(e instanceof Error)throw this[n.lC].setEnvironmentAndSkybox(null,null),e}finally{i(1)}}}return s([(0,i.MZ)({type:String,attribute:"environment-image"})],d.prototype,"environmentImage",void 0),s([(0,i.MZ)({type:String,attribute:"skybox-image"})],d.prototype,"skyboxImage",void 0),s([(0,i.MZ)({type:Number,attribute:"shadow-intensity"})],d.prototype,"shadowIntensity",void 0),s([(0,i.MZ)({type:Number,attribute:"shadow-softness"})],d.prototype,"shadowSoftness",void 0),s([(0,i.MZ)({type:Number})],d.prototype,"exposure",void 0),s([(0,i.MZ)({type:String,attribute:"tone-mapping"})],d.prototype,"toneMapping",void 0),s([(0,i.MZ)({type:String,attribute:"skybox-height"})],d.prototype,"skyboxHeight",void 0),d}},1735(e,t,r){"use strict";r.d(t,{CK:()=>y});var i=r(8413),n=r(874),a=r(3520),s=r(4515),o=r(5827),l=r(1535),c=function(e,t,r,i){var n,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,r,s):n(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};let h="auto",u=Symbol("defaultProgressBarElement"),d=Symbol("posterContainerElement"),p=Symbol("defaultPosterElement"),f=Symbol("shouldDismissPoster"),g=Symbol("hidePoster"),m=Symbol("modelIsRevealed"),A=Symbol("updateProgressBar"),b=Symbol("ariaLabelCallToAction"),v=Symbol("onProgress"),y=e=>{var t,r,y,x,S,E,w,_;class C extends e{static set dracoDecoderLocation(e){s.IZ.setDRACODecoderLocation(e)}static get dracoDecoderLocation(){return s.IZ.getDRACODecoderLocation()}static set ktx2TranscoderLocation(e){s.IZ.setKTX2TranscoderLocation(e)}static get ktx2TranscoderLocation(){return s.IZ.getKTX2TranscoderLocation()}static set meshoptDecoderLocation(e){s.IZ.setMeshoptDecoderLocation(e)}static get meshoptDecoderLocation(){return s.IZ.getMeshoptDecoderLocation()}static set lottieLoaderLocation(e){o.A.singleton.textureUtils.lottieLoaderUrl=e}static get lottieLoaderLocation(){return o.A.singleton.textureUtils.lottieLoaderUrl}static mapURLs(e){o.A.singleton.loader[s.q4].manager.setURLModifier(e)}dismissPoster(){this.loaded?this[g]():(this[f]=!0,this[a.Hc]())}showPoster(){let e=this[d];if(e.classList.contains("show"))return;e.classList.add("show"),this[a.yc].classList.remove("show");let t=this[p];t.removeAttribute("tabindex"),t.removeAttribute("aria-hidden");let r=this.modelIsVisible;this[m]=!1,this[a.T5](r)}getDimensions(){return(0,a.Gw)(this[a.lC].size)}getBoundingBoxCenter(){return(0,a.Gw)(this[a.lC].boundingBox.getCenter(new n.Pq0))}constructor(...e){super(...e),this.poster=null,this.reveal=h,this.loading="auto",this[t]=!1,this[r]=!1,this[y]=this.shadowRoot.querySelector(".slot.poster"),this[x]=this.shadowRoot.querySelector("#default-poster"),this[S]=this.shadowRoot.querySelector("#default-progress-bar > .bar"),this[E]=this[p].getAttribute("aria-label"),this[w]=(0,l.nF)(e=>{let t=this[u].parentNode;requestAnimationFrame(()=>{this[u].style.transform=`scaleX(${e})`,0===e&&(t.removeChild(this[u]),t.appendChild(this[u])),this[u].classList.toggle("hide",1===e)})},100),this[_]=e=>{let t=e.detail.totalProgress,r=e.detail.reason;1===t&&(this[A].flush(),this.loaded&&(this[f]||this.reveal===h)&&this[g]()),this[A](t),this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:t,reason:r}}))};const i=self.ModelViewerElement||{},n=i.dracoDecoderLocation||"https://www.gstatic.com/draco/versioned/decoders/1.5.6/";s.IZ.setDRACODecoderLocation(n);const a=i.ktx2TranscoderLocation||"https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/";s.IZ.setKTX2TranscoderLocation(a),i.meshoptDecoderLocation&&s.IZ.setMeshoptDecoderLocation(i.meshoptDecoderLocation);const c=i.lottieLoaderLocation||"https://cdn.jsdelivr.net/npm/three@0.149.0/examples/jsm/loaders/LottieLoader.js";null!=o.A.singleton.textureUtils&&(o.A.singleton.textureUtils.lottieLoaderUrl=c)}connectedCallback(){super.connectedCallback(),this.loaded||this.showPoster(),this[a.OS].addEventListener("progress",this[v])}disconnectedCallback(){super.disconnectedCallback(),this[a.OS].removeEventListener("progress",this[v])}async updated(e){super.updated(e),e.has("poster")&&null!=this.poster&&(this[p].style.backgroundImage=`url(${this.poster})`),e.has("alt")&&this[p].setAttribute("aria-label",this[a.cM]),(e.has("reveal")||e.has("loading"))&&this[a.Hc]()}[(t=m,r=f,y=d,x=p,S=u,E=b,w=A,_=v,a.sM)](){return!!this.src&&(this[f]||"eager"===this.loading||this.reveal===h&&this[a.cJ])}[g](){this[f]=!1;let e=this[d];if(!e.classList.contains("show"))return;e.classList.remove("show"),this[a.yc].classList.add("show");let t=this.modelIsVisible;this[m]=!0,this[a.T5](t);let r=this.getRootNode();r&&r.activeElement===this&&this[a.yc].focus();let i=this[p];i.setAttribute("aria-hidden","true"),i.tabIndex=-1,this.dispatchEvent(new CustomEvent("poster-dismissed"))}[a.gJ](){return super[a.gJ]()&&this[m]}}return c([(0,i.MZ)({type:String})],C.prototype,"poster",void 0),c([(0,i.MZ)({type:String})],C.prototype,"reveal",void 0),c([(0,i.MZ)({type:String})],C.prototype,"loading",void 0),C}},387(e,t,r){"use strict";r.d(t,{BI:()=>N,o7:()=>O,Z7:()=>U,E_:()=>H});var i=r(8413),n=r(874);let a={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class s{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new m(e)}),this.register(function(e){return new A(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new S(e)}),this.register(function(e){return new E(e)}),this.register(function(e){return new w(e)}),this.register(function(e){return new b(e)}),this.register(function(e){return new v(e)}),this.register(function(e){return new y(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new C(e)}),this.register(function(e){return new M(e)}),this.register(function(e){return new I(e)}),this.register(function(e){return new T(e)})}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}setTextureUtils(e){return this.textureUtils=e,this}parse(e,t,r,i){let n=new g,a=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)a.push(this.pluginCallbacks[e](n));n.setPlugins(a),n.setTextureUtils(this.textureUtils),n.writeAsync(e,t,i).catch(r)}parseAsync(e,t){let r=this;return new Promise(function(i,n){r.parse(e,i,n,t)})}}let o="KHR_mesh_quantization",l={};l[1003]=9728,l[1004]=9984,l[1005]=9986,l[1006]=9729,l[1007]=9985,l[1008]=9987,l[1001]=33071,l[1e3]=10497,l[1002]=33648;let c={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},h=new n.Q1f;function u(e,t){return e.length===t.length&&e.every(function(e,r){return e===t[r]})}function d(e){return 4*Math.ceil(e/4)}function p(e,t=0){let r=d(e.byteLength);if(r!==e.byteLength){let i=new Uint8Array(r);if(i.set(new Uint8Array(e)),0!==t)for(let n=e.byteLength;n<r;n++)i[n]=t;return i.buffer}return e}function f(){return"u"<typeof document&&"u">typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}class g{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r182"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,t,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);let i=this.buffers,n=this.json;r=this.options;let a=this.extensionsUsed,s=this.extensionsRequired,o=new Blob(i,{type:"application/octet-stream"}),l=Object.keys(a),c=Object.keys(s);if(l.length>0&&(n.extensionsUsed=l),c.length>0&&(n.extensionsRequired=c),n.buffers&&n.buffers.length>0&&(n.buffers[0].byteLength=o.size),!0===r.binary){let e=new FileReader;e.readAsArrayBuffer(o),e.onloadend=function(){var r;let i=p(e.result),a=new DataView(new ArrayBuffer(8));a.setUint32(0,i.byteLength,!0),a.setUint32(4,5130562,!0);let s=p((r=JSON.stringify(n),new TextEncoder().encode(r).buffer),32),o=new DataView(new ArrayBuffer(8));o.setUint32(0,s.byteLength,!0),o.setUint32(4,0x4e4f534a,!0);let l=new ArrayBuffer(12),c=new DataView(l);c.setUint32(0,0x46546c67,!0),c.setUint32(4,2,!0);let h=12+o.byteLength+s.byteLength+a.byteLength+i.byteLength;c.setUint32(8,h,!0);let u=new Blob([l,o,s,a,i],{type:"application/octet-stream"}),d=new FileReader;d.readAsArrayBuffer(u),d.onloadend=function(){t(d.result)}}}else if(n.buffers&&n.buffers.length>0){let e=new FileReader;e.readAsDataURL(o),e.onloadend=function(){let r=e.result;n.buffers[0].uri=r,t(n)}}else t(n)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;let r=this.options,i=this.extensionsUsed;try{let n=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&n.gltfExtensions){for(let e in void 0===t.extensions&&(t.extensions={}),n.gltfExtensions)t.extensions[e]=n.gltfExtensions[e],i[e]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}catch(t){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new n.Pq0;for(let r=0,i=e.count;r<i;r++)if(Math.abs(t.fromBufferAttribute(e,r).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let r=e.clone(),i=new n.Pq0;for(let e=0,t=r.count;e<t;e++)i.fromBufferAttribute(r,e),0===i.x&&0===i.y&&0===i.z?i.setX(1):i.normalize(),r.setXYZ(e,i.x,i.y,i.z);return t.attributesNormalized.set(e,r),r}applyTextureTransform(e,t){let r=!1,i={};(0!==t.offset.x||0!==t.offset.y)&&(i.offset=t.offset.toArray(),r=!0),0!==t.rotation&&(i.rotation=t.rotation,r=!0),(1!==t.repeat.x||1!==t.repeat.y)&&(i.scale=t.repeat.toArray(),r=!0),r&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=i,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,t){if(e===t)return e;function r(e){return"srgb"===e.colorSpace?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}e instanceof n.FvD&&(e=await this.decompressTextureAsync(e)),t instanceof n.FvD&&(t=await this.decompressTextureAsync(t));let i=e?e.image:null,a=t?t.image:null,s=Math.max(i?i.width:0,a?a.width:0),o=Math.max(i?i.height:0,a?a.height:0),l=f();l.width=s,l.height=o;let c=l.getContext("2d",{willReadFrequently:!0});c.fillStyle="#00ffff",c.fillRect(0,0,s,o);let h=c.getImageData(0,0,s,o);if(i){c.drawImage(i,0,0,s,o);let t=r(e),n=c.getImageData(0,0,s,o).data;for(let e=2;e<n.length;e+=4)h.data[e]=256*t(n[e]/256)}if(a){c.drawImage(a,0,0,s,o);let e=r(t),i=c.getImageData(0,0,s,o).data;for(let t=1;t<i.length;t+=4)h.data[t]=256*e(i[t]/256)}c.putImageData(h,0,0);let u=(e||t).clone();return u.source=new n.kLi(l),u.colorSpace="",u.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),u}async decompressTextureAsync(e,t=1/0){if(null===this.textureUtils)throw Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,t)}processBuffer(e){let t=this.json,r=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),r.push(e),0}processBufferView(e,t,r,i,a){let s,o=this.json;switch(!o.bufferViews&&(o.bufferViews=[]),t){case 5120:case 5121:s=1;break;case 5122:case 5123:s=2;break;default:s=4}let l=e.itemSize*s;34962===a&&(l=4*Math.ceil(l/4));let c=d(i*l),h=new DataView(new ArrayBuffer(c)),u=0;for(let a=r;a<r+i;a++){for(let r=0;r<e.itemSize;r++){let i;e.itemSize>4?i=e.array[a*e.itemSize+r]:(0===r?i=e.getX(a):1===r?i=e.getY(a):2===r?i=e.getZ(a):3===r&&(i=e.getW(a)),!0===e.normalized&&(i=n.cj9.normalize(i,e.array))),5126===t?h.setFloat32(u,i,!0):5124===t?h.setInt32(u,i,!0):5125===t?h.setUint32(u,i,!0):5122===t?h.setInt16(u,i,!0):5123===t?h.setUint16(u,i,!0):5120===t?h.setInt8(u,i):5121===t&&h.setUint8(u,i),u+=s}u%l!=0&&(u+=l-u%l)}let p={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:c};return void 0!==a&&(p.target=a),34962===a&&(p.byteStride=l),this.byteOffset+=c,o.bufferViews.push(p),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,r=t.json;return r.bufferViews||(r.bufferViews=[]),new Promise(function(i){let n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){let e=p(n.result),a={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,i(r.bufferViews.push(a)-1)}})}processAccessor(e,t,r,i){let a,s,o=this.json;if(e.array.constructor===Float32Array)a=5126;else if(e.array.constructor===Int32Array)a=5124;else if(e.array.constructor===Uint32Array)a=5125;else if(e.array.constructor===Int16Array)a=5122;else if(e.array.constructor===Uint16Array)a=5123;else if(e.array.constructor===Int8Array)a=5120;else if(e.array.constructor===Uint8Array)a=5121;else throw Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(void 0===r&&(r=0),(void 0===i||i===1/0)&&(i=e.count),0===i)return null;let l=function(e,t,r){let i={min:Array(e.itemSize).fill(1/0),max:Array(e.itemSize).fill(-1/0)};for(let a=t;a<t+r;a++)for(let t=0;t<e.itemSize;t++){let r;e.itemSize>4?r=e.array[a*e.itemSize+t]:(0===t?r=e.getX(a):1===t?r=e.getY(a):2===t?r=e.getZ(a):3===t&&(r=e.getW(a)),!0===e.normalized&&(r=n.cj9.normalize(r,e.array))),i.min[t]=Math.min(i.min[t],r),i.max[t]=Math.max(i.max[t],r)}return i}(e,r,i);void 0!==t&&(s=e===t.index?34963:34962);let c=this.processBufferView(e,a,r,i,s),h={bufferView:c.id,byteOffset:c.byteOffset,componentType:a,count:i,max:l.max,min:l.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(h.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(h)-1}processImage(e,t,r,i="image/png"){if(null!==e){let a=this,s=a.cache,o=a.json,l=a.options,c=a.pending;s.images.has(e)||s.images.set(e,{});let h=s.images.get(e),u=i+":flipY/"+r.toString();if(void 0!==h[u])return h[u];o.images||(o.images=[]);let d={mimeType:i},p=f();p.width=Math.min(e.width,l.maxTextureSize),p.height=Math.min(e.height,l.maxTextureSize);let g=p.getContext("2d",{willReadFrequently:!0});if(!0===r&&(g.translate(0,p.height),g.scale(1,-1)),void 0!==e.data){1023!==t&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let r=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<r.length;t+=4)r[t+0]=e.data[t+0],r[t+1]=e.data[t+1],r[t+2]=e.data[t+2],r[t+3]=e.data[t+3];g.putImageData(new ImageData(r,e.width,e.height),0,0)}else if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap||"u">typeof OffscreenCanvas&&e instanceof OffscreenCanvas)g.drawImage(e,0,0,p.width,p.height);else throw Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");!0===l.binary?c.push((function(e,t){if(!("u">typeof OffscreenCanvas&&e instanceof OffscreenCanvas))return new Promise(r=>e.toBlob(r,t));{let r;return"image/jpeg"===t?r=.92:"image/webp"===t&&(r=.8),e.convertToBlob({type:t,quality:r})}})(p,i).then(e=>a.processBufferViewImage(e)).then(e=>{d.bufferView=e})):d.uri=n.HgN.getDataURL(p,i);let m=o.images.push(d)-1;return h[u]=m,m}throw Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let r={magFilter:l[e.magFilter],minFilter:l[e.minFilter],wrapS:l[e.wrapS],wrapT:l[e.wrapT]};return t.samplers.push(r)-1}async processTextureAsync(e){let t=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof n.FvD&&(e=await this.decompressTextureAsync(e,t.maxTextureSize));let a=e.userData.mimeType;"image/webp"===a&&(a="image/png");let s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,a)};e.name&&(s.name=e.name),await this._invokeAllAsync(async function(t){t.writeTexture&&await t.writeTexture(e,s)});let o=i.textures.push(s)-1;return r.textures.set(e,o),o}async processMaterialAsync(e){let t=this.cache,r=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);let i={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let n=e.color.toArray().concat([e.opacity]);if(u(n,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=n),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=0,i.pbrMetallicRoughness.roughnessFactor=1),e.metalnessMap||e.roughnessMap){let t=await this.buildMetalRoughTextureAsync(e.metalnessMap,e.roughnessMap),r={index:await this.processTextureAsync(t),texCoord:t.channel};this.applyTextureTransform(r,t),i.pbrMetallicRoughness.metallicRoughnessTexture=r}if(e.map){let t={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),i.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let t={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),i.emissiveTexture=t}}if(e.normalMap){let t={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),i.normalTexture=t}if(e.aoMap){let t={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),i.occlusionTexture=t}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),2===e.side&&(i.doubleSided=!0),""!==e.name&&(i.name=e.name),this.serializeUserData(e,i),await this._invokeAllAsync(async function(t){t.writeMaterialAsync&&await t.writeMaterialAsync(e,i)});let a=r.materials.push(i)-1;return t.materials.set(e,a),a}async processMeshAsync(e){let t,r=this.cache,i=this.json,a=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,r=e.material.length;t<r;t++)a.push(e.material[t].uuid);else a.push(e.material.uuid);let o=a.join(":");if(r.meshes.has(o))return r.meshes.get(o);let l=e.geometry;t=e.isLineSegments?1:e.isLineLoop?2:e.isLine?3:e.isPoints?0:e.material.wireframe?1:4;let c={},h={},u=[],d=[],p={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=l.getAttribute("normal");void 0===f||this.isNormalizedNormalAttribute(f)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),l.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let g=null;for(let e in l.attributes){if("morph"===e.slice(0,5))continue;let t=l.attributes[e];if(e=p[e]||e.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e="_"+e),r.attributes.has(this.getUID(t))){h[e]=r.attributes.get(this.getUID(t));continue}g=null;let i=t.array;"JOINTS_0"!==e||i instanceof Uint16Array||i instanceof Uint8Array?(i instanceof Uint32Array||i instanceof Int32Array)&&!e.startsWith("_")&&(console.warn(`GLTFExporter: Attribute "${e}" converted to type FLOAT.`),g=s.Utils.toFloat32BufferAttribute(t)):(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),g=new n.THS(new Uint16Array(i),t.itemSize,t.normalized));let a=this.processAccessor(g||t,l);null!==a&&(e.startsWith("_")||this.detectMeshQuantization(e,t),h[e]=a,r.attributes.set(this.getUID(t),a))}if(void 0!==f&&l.setAttribute("normal",f),0===Object.keys(h).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){let t=[],i=[],n={};if(void 0!==e.morphTargetDictionary)for(let t in e.morphTargetDictionary)n[e.morphTargetDictionary[t]]=t;for(let a=0;a<e.morphTargetInfluences.length;++a){let s={},o=!1;for(let e in l.morphAttributes){if("position"!==e&&"normal"!==e){o||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),o=!0);continue}let t=l.morphAttributes[e][a],i=e.toUpperCase(),n=l.attributes[e];if(r.attributes.has(this.getUID(t,!0))){s[i]=r.attributes.get(this.getUID(t,!0));continue}let c=t.clone();if(!l.morphTargetsRelative)for(let e=0,r=t.count;e<r;e++)for(let r=0;r<t.itemSize;r++)0===r&&c.setX(e,t.getX(e)-n.getX(e)),1===r&&c.setY(e,t.getY(e)-n.getY(e)),2===r&&c.setZ(e,t.getZ(e)-n.getZ(e)),3===r&&c.setW(e,t.getW(e)-n.getW(e));s[i]=this.processAccessor(c,l),r.attributes.set(this.getUID(n,!0),s[i])}d.push(s),t.push(e.morphTargetInfluences[a]),void 0!==e.morphTargetDictionary&&i.push(n[a])}c.weights=t,i.length>0&&(c.extras={},c.extras.targetNames=i)}let m=Array.isArray(e.material);if(m&&0===l.groups.length)return null;let A=!1;if(m&&null===l.index){let e=[];for(let t=0,r=l.attributes.position.count;t<r;t++)e[t]=t;l.setIndex(e),A=!0}let b=m?e.material:[e.material],v=m?l.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,i=v.length;e<i;e++){let i={mode:t,attributes:h};if(this.serializeUserData(l,i),d.length>0&&(i.targets=d),null!==l.index){let t=this.getUID(l.index);(void 0!==v[e].start||void 0!==v[e].count)&&(t+=":"+v[e].start+":"+v[e].count),r.attributes.has(t)?i.indices=r.attributes.get(t):(i.indices=this.processAccessor(l.index,l,v[e].start,v[e].count),r.attributes.set(t,i.indices)),null===i.indices&&delete i.indices}let n=await this.processMaterialAsync(b[v[e].materialIndex]);null!==n&&(i.material=n),u.push(i)}!0===A&&l.setIndex(null),c.primitives=u,i.meshes||(i.meshes=[]),await this._invokeAllAsync(function(t){t.writeMesh&&t.writeMesh(e,c)});let y=i.meshes.push(c)-1;return r.meshes.set(o,y),y}detectMeshQuantization(e,t){let r;if(this.extensionsUsed[o])return;switch(t.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}t.normalized&&(r+=" normalized");let i=e.split("_",1)[0];a[i]&&a[i].includes(r)&&(this.extensionsUsed[o]=!0,this.extensionsRequired[o]=!0)}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:n.cj9.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let r=this.json,i=this.nodeMap;r.animations||(r.animations=[]);let a=(e=s.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,o=[],l=[];for(let e=0;e<a.length;++e){let r,s=a[e],h=n.Nwf.parseTrackName(s.name),u=n.Nwf.findNode(t,h.nodeName),d=c[h.propertyName];if("bones"===h.objectName&&(u=!0===u.isSkinnedMesh?u.skeleton.getBoneByName(h.objectIndex):void 0),!u||!d){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',s.name);continue}let p=s.values.length/s.times.length;d===c.morphTargetInfluences&&(p/=u.morphTargetInfluences.length),!0===s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(r="CUBICSPLINE",p/=3):r=2300===s.getInterpolation()?"STEP":"LINEAR",l.push({input:this.processAccessor(new n.THS(s.times,1)),output:this.processAccessor(new n.THS(s.values,p)),interpolation:r}),o.push({sampler:l.length-1,target:{node:i.get(u),path:d}})}let h={name:e.name||"clip_"+r.animations.length,samplers:l,channels:o};return this.serializeUserData(e,h),r.animations.push(h),r.animations.length-1}processSkin(e){let t=this.json,r=this.nodeMap,i=t.nodes[r.get(e)],a=e.skeleton;if(void 0===a)return null;let s=e.skeleton.bones[0];if(void 0===s)return null;let o=[],l=new Float32Array(16*a.bones.length),c=new n.kn4;for(let t=0;t<a.bones.length;++t)o.push(r.get(a.bones[t])),c.copy(a.boneInverses[t]),c.multiply(e.bindMatrix).toArray(l,16*t);return void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new n.THS(l,16)),joints:o,skeleton:r.get(s)}),i.skin=t.skins.length-1}async processNodeAsync(e){let t=this.json,r=this.options,i=this.nodeMap;t.nodes||(t.nodes=[]);let n={};if(r.trs){let t=e.quaternion.toArray(),r=e.position.toArray(),i=e.scale.toArray();u(t,[0,0,0,1])||(n.rotation=t),u(r,[0,0,0])||(n.translation=r),u(i,[1,1,1])||(n.scale=i)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===u(e.matrix.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])&&(n.matrix=e.matrix.elements);if(""!==e.name&&(n.name=String(e.name)),this.serializeUserData(e,n),e.isMesh||e.isLine||e.isPoints){let t=await this.processMeshAsync(e);null!==t&&(n.mesh=t)}else e.isCamera&&(n.camera=this.processCamera(e));e.isSkinnedMesh&&this.skins.push(e);let a=t.nodes.push(n)-1;if(i.set(e,a),e.children.length>0){let t=[];for(let i=0,n=e.children.length;i<n;i++){let n=e.children[i];if(n.visible||!1===r.onlyVisible){let e=await this.processNodeAsync(n);null!==e&&t.push(e)}}t.length>0&&(n.children=t)}return await this._invokeAllAsync(function(t){t.writeNode&&t.writeNode(e,n)}),a}async processSceneAsync(e){let t=this.json,r=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};""!==e.name&&(i.name=e.name),t.scenes.push(i);let n=[];for(let t=0,i=e.children.length;t<i;t++){let i=e.children[t];if(i.visible||!1===r.onlyVisible){let e=await this.processNodeAsync(i);null!==e&&n.push(e)}}n.length>0&&(i.nodes=n),this.serializeUserData(e,i)}async processObjectsAsync(e){let t=new n.Z58;t.name="AuxScene";for(let r=0;r<e.length;r++)t.children.push(e[r]);await this.processSceneAsync(t)}async processInputAsync(e){let t=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(t){t.beforeParse&&t.beforeParse(e)});let r=[];for(let t=0;t<e.length;t++)e[t]instanceof n.Z58?await this.processSceneAsync(e[t]):r.push(e[t]);r.length>0&&await this.processObjectsAsync(r);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let r=0;r<t.animations.length;++r)this.processAnimation(t.animations[r],e[0]);await this._invokeAllAsync(function(t){t.afterParse&&t.afterParse(e)})}async _invokeAllAsync(e){for(let t=0,r=this.plugins.length;t<r;t++)await e(this.plugins[t])}}class m{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);let r=this.writer,i=r.json,n=r.extensionsUsed,a={};e.name&&(a.name=e.name),a.color=e.color.toArray(),a.intensity=e.intensity,e.isDirectionalLight?a.type="directional":e.isPointLight?(a.type="point",e.distance>0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(1-e.penumbra)*e.angle,a.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||0!==e.target.position.x||0!==e.target.position.y||-1!==e.target.position.z)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),n[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},n[this.name]=!0);let s=i.extensions[this.name].lights;s.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:s.length-1}}}class A{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,t){if(!e.isMeshBasicMaterial)return;let r=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},r[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class b{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.clearcoat)return;let r=this.writer,i=r.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:await r.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};r.applyTextureTransform(t,e.clearcoatMap),n.clearcoatTexture=t}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:await r.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};r.applyTextureTransform(t,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:await r.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};1!==e.clearcoatNormalScale.x&&(t.scale=e.clearcoatNormalScale.x),r.applyTextureTransform(t,e.clearcoatNormalMap),n.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}}class v{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.dispersion)return;let r=this.writer.extensionsUsed,i={};i.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class y{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.iridescence)return;let r=this.writer,i=r.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:await r.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};r.applyTextureTransform(t,e.iridescenceMap),n.iridescenceTexture=t}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:await r.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};r.applyTextureTransform(t,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}}class x{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let r=this.writer,i=r.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){let t={index:await r.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};r.applyTextureTransform(t,e.transmissionMap),n.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}}class S{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let r=this.writer,i=r.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){let t={index:await r.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};r.applyTextureTransform(t,e.thicknessMap),n.thicknessTexture=t}e.attenuationDistance!==1/0&&(n.attenuationDistance=e.attenuationDistance),n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}}class E{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||1.5===e.ior)return;let r=this.writer.extensionsUsed,i={};i.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class w{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||1===e.specularIntensity&&e.specularColor.equals(h)&&!e.specularIntensityMap&&!e.specularColorMap)return;let r=this.writer,i=r.extensionsUsed,n={};if(e.specularIntensityMap){let t={index:await r.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};r.applyTextureTransform(t,e.specularIntensityMap),n.specularTexture=t}if(e.specularColorMap){let t={index:await r.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};r.applyTextureTransform(t,e.specularColorMap),n.specularColorTexture=t}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}}class _{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0==e.sheen)return;let r=this.writer,i=r.extensionsUsed,n={};if(e.sheenRoughnessMap){let t={index:await r.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};r.applyTextureTransform(t,e.sheenRoughnessMap),n.sheenRoughnessTexture=t}if(e.sheenColorMap){let t={index:await r.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};r.applyTextureTransform(t,e.sheenColorMap),n.sheenColorTexture=t}n.sheenRoughnessFactor=e.sheenRoughness,n.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}}class C{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0==e.anisotropy)return;let r=this.writer,i=r.extensionsUsed,n={};if(e.anisotropyMap){let t={index:await r.processTextureAsync(e.anisotropyMap)};r.applyTextureTransform(t,e.anisotropyMap),n.anisotropyTexture=t}n.anisotropyStrength=e.anisotropy,n.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}}class M{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||1===e.emissiveIntensity)return;let r=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class I{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||1===e.bumpScale&&!e.bumpMap)return;let r=this.writer,i=r.extensionsUsed,n={};if(e.bumpMap){let t={index:await r.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};r.applyTextureTransform(t,e.bumpMap),n.bumpTexture=t}n.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}}class T{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;let r=this.writer,i=new Float32Array(3*e.count),a=new Float32Array(4*e.count),s=new Float32Array(3*e.count),o=new n.kn4,l=new n.Pq0,c=new n.PTz,h=new n.Pq0;for(let t=0;t<e.count;t++)e.getMatrixAt(t,o),o.decompose(l,c,h),l.toArray(i,3*t),c.toArray(a,4*t),h.toArray(s,3*t);let u={TRANSLATION:r.processAccessor(new n.THS(i,3)),ROTATION:r.processAccessor(new n.THS(a,4)),SCALE:r.processAccessor(new n.THS(s,3))};e.instanceColor&&(u._COLOR_0=r.processAccessor(e.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:u},r.extensionsUsed[this.name]=!0,r.extensionsRequired[this.name]=!0}}s.Utils={insertKeyframe:function(e,t){let r,i=e.getValueSize(),n=new e.TimeBufferType(e.times.length+1),a=new e.ValueBufferType(e.values.length+i),s=e.createInterpolant(new e.ValueBufferType(i));if(0===e.times.length){n[0]=t;for(let e=0;e<i;e++)a[e]=0;r=0}else if(t<e.times[0]){if(.001>Math.abs(e.times[0]-t))return 0;n[0]=t,n.set(e.times,1),a.set(s.evaluate(t),0),a.set(e.values,i),r=0}else if(t>e.times[e.times.length-1]){if(.001>Math.abs(e.times[e.times.length-1]-t))return e.times.length-1;n[n.length-1]=t,n.set(e.times,0),a.set(e.values,0),a.set(s.evaluate(t),e.values.length),r=n.length-1}else for(let o=0;o<e.times.length;o++){if(.001>Math.abs(e.times[o]-t))return o;if(e.times[o]<t&&e.times[o+1]>t){n.set(e.times.slice(0,o+1),0),n[o+1]=t,n.set(e.times.slice(o+1),o+2),a.set(e.values.slice(0,(o+1)*i),0),a.set(s.evaluate(t),(o+1)*i),a.set(e.values.slice((o+1)*i),(o+2)*i),r=o+1;break}}return e.times=n,e.values=a,r},mergeMorphTargetTracks:function(e,t){let r=[],i={},a=e.tracks;for(let e=0;e<a.length;++e){let s,o=a[e],l=n.Nwf.parseTrackName(o.name),c=n.Nwf.findNode(t,l.nodeName);if("morphTargetInfluences"!==l.propertyName||void 0===l.propertyIndex){r.push(o);continue}if(o.createInterpolant!==o.InterpolantFactoryMethodDiscrete&&o.createInterpolant!==o.InterpolantFactoryMethodLinear){if(o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),(o=o.clone()).setInterpolation(2301)}let h=c.morphTargetInfluences.length,u=c.morphTargetDictionary[l.propertyIndex];if(void 0===u)throw Error("THREE.GLTFExporter: Morph target name not found: "+l.propertyIndex);if(void 0===i[c.uuid]){let e=new(s=o.clone()).ValueBufferType(h*s.times.length);for(let t=0;t<s.times.length;t++)e[t*h+u]=s.values[t];s.name=(l.nodeName||"")+".morphTargetInfluences",s.values=e,i[c.uuid]=s,r.push(s);continue}let d=o.createInterpolant(new o.ValueBufferType(1));s=i[c.uuid];for(let e=0;e<s.times.length;e++)s.values[e*h+u]=d.evaluate(s.times[e]);for(let e=0;e<o.times.length;e++){let t=this.insertKeyframe(s,o.times[e]);s.values[t*h+u]=o.values[e]}}return e.tracks=r,e},toFloat32BufferAttribute:function(e){let t=new n.THS(new Float32Array(e.count*e.itemSize),e.itemSize,!1);if(!e.normalized&&!e.isInterleavedBufferAttribute)return t.array.set(e.array),t;for(let r=0,i=e.count;r<i;r++)for(let i=0;i<e.itemSize;i++)t.setComponent(r,i,e.getComponent(r,i));return t}};var R=r(3520);let B=e=>void 0!==e.material&&e.userData&&e.userData.variantMaterials&&!!Array.from(e.userData.variantMaterials.values()).filter(e=>k(e.material)),k=e=>e&&e.isMaterial&&!Array.isArray(e);class P{constructor(e){this.writer=e,this.name="KHR_materials_variants",this.variantNames=[]}beforeParse(e){let t=new Set,r=e=>{if(!B(e))return;let r=e.userData.variantMaterials;for(let[i,n]of e.userData.variantData){let e=r.get(n.index);e&&k(e.material)&&t.add(i)}};if(Array.isArray(e))for(let t of e)t.traverse(r);else e.traverse(r);t.forEach(e=>this.variantNames.push(e))}async writeMesh(e,t){if(!B(e))return;let r=e.userData,i=r.variantMaterials,n=r.variantData,a=new Map,s=new Map;for(let[e,t]of Array.from(n.values()).sort((e,t)=>e.index-t.index).entries())s.set(t.index,e);for(let e of n.values()){let t=i.get(e.index);if(!t||!k(t.material))continue;let r=await this.writer.processMaterialAsync(t.material);a.has(r)||a.set(r,{material:r,variants:[]}),a.get(r).variants.push(s.get(e.index))}let o=Array.from(a.values()).map(e=>e.variants.sort((e,t)=>e-t)&&e).sort((e,t)=>e.material-t.material);if(0===o.length)return;let l=k(r.originalMaterial)?await this.writer.processMaterialAsync(r.originalMaterial):-1;for(let e of t.primitives)l>=0&&(e.material=l),e.extensions=e.extensions||{},e.extensions[this.name]={mappings:o}}afterParse(){if(0===this.variantNames.length)return;let e=this.writer.json;e.extensions=e.extensions||{};let t=this.variantNames.map(e=>({name:e}));e.extensions[this.name]={variants:t},this.writer.extensionsUsed[this.name]=!0}}var D=r(6201),L=r(6886),F=function(e,t,r,i){var n,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,r,s):n(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};let N=Symbol("currentGLTF"),U=Symbol("originalGltfJson"),O=Symbol("model"),Q=Symbol("getOnUpdateMethod"),z=Symbol("buildTexture"),H=e=>{var t,r,a;class o extends e{constructor(){super(...arguments),this[t]=void 0,this[r]=null,this[a]=null,this.variantName=null,this.orientation="0 0 0",this.scale="1 1 1"}get model(){return this[O]}get availableVariants(){return this.model?this.model[D.W8]():[]}get originalGltfJson(){return this[U]}[(t=O,r=N,a=U,Q)](){return()=>{this[R.ML]()}}[z](e){return e.colorSpace="srgb",e.wrapS=1e3,e.wrapT=1e3,new L.g(this[Q](),e)}async createTexture(e,t="image/png"){let{textureUtils:r}=this[R.m8],i=await r.loadImage(e,this.withCredentials);return i.userData.mimeType=t,this[z](i)}async createLottieTexture(e,t=1){let{textureUtils:r}=this[R.m8],i=await r.loadLottie(e,t,this.withCredentials);return this[z](i)}createVideoTexture(e){let t=document.createElement("video");t.crossOrigin=this.withCredentials?"use-credentials":"anonymous",t.src=e,t.muted=!0,t.playsInline=!0,t.loop=!0,t.play();let r=new n.Nv2(t);return this[z](r)}createCanvasTexture(){let e=document.createElement("canvas"),t=new n.GOR(e);return this[z](t)}async updated(e){if(super.updated(e),e.has("variantName")){let e=this[R.OS].beginActivity("variant-update");e(.1);let t=this[O],{variantName:r}=this;null!=t&&(await t[D.qA](r),this[R.ML](),this.dispatchEvent(new CustomEvent("variant-applied"))),e(1)}if(e.has("orientation")||e.has("scale")){if(!this.loaded)return;let e=this[R.lC];e.applyTransform(),e.updateBoundingBox(),e.updateShadow(),this[R.m8].arRenderer.onUpdateScene(),this[R.ML]()}}[R.vA](){super[R.vA]();let{currentGLTF:e}=this[R.lC];if(null!=e){let{correlatedSceneGraph:t}=e;null!=t&&e!==this[N]&&(this[O]=new D.Kx(t,this[Q]()),this[U]=JSON.parse(JSON.stringify(t.gltf))),"variants"in e.userData&&this.requestUpdate("variantName")}this[N]=e}async exportScene(e){let t=this[R.lC];return new Promise(async(r,i)=>{let n={binary:!0,onlyVisible:!0,maxTextureSize:1/0,includeCustomExtensions:!1,forceIndices:!1};Object.assign(n,e),n.animations=t.animations,n.truncateDrawRange=!0;let a=t.shadow,o=!1;null!=a&&(o=a.visible,a.visible=!1),await this[O][D.Zm](),new s().register(e=>new P(e)).parse(t.model,e=>r(new Blob([n.binary?e:JSON.stringify(e)],{type:n.binary?"application/octet-stream":"application/json"})),()=>i("glTF export failed"),n),null!=a&&(a.visible=o)})}materialFromPoint(e,t){let r=this[O];if(null==r)return null;let i=this[R.lC],n=i.getNDC(e,t),a=i.hitFromPoint(n);return null==a||null==a.face?null:r[D.eI](a)}}return F([(0,i.MZ)({type:String,attribute:"variant-name"})],o.prototype,"variantName",void 0),F([(0,i.MZ)({type:String,attribute:"orientation"})],o.prototype,"orientation",void 0),F([(0,i.MZ)({type:String,attribute:"scale"})],o.prototype,"scale",void 0),o}},6580(e,t,r){"use strict";r.d(t,{OC:()=>h,_V:()=>d});var i=r(874),n=r(3520),a=r(5827),s=r(3333);let o=new i.V9B,l=new i.bdM(2,2),c=0,h=Symbol("threeTexture"),u=Symbol("threeTextures");Symbol("applyTexture");class d extends s.vc{get[h](){var e;return null==(e=this[s.oj])?void 0:e.values().next().value}get[u](){return this[s.oj]}constructor(e,t){super(e,new Set(t?[t]:[]));const r=this[h].image;r.src||(r.src=t.name?t.name:"adhoc_image"+c++),r.name||(r.name=t&&r&&r.src?r.src.split("/").pop():"adhoc_image")}get name(){return this[h].image.name||""}get uri(){return this[h].image.src}get bufferView(){return this[h].image.bufferView}get element(){let e=this[h];if(e&&(e.isCanvasTexture||e.isVideoTexture))return e.image}get animation(){let e=this[h];if(e&&e.isCanvasTexture&&e.animation)return e.animation}get type(){return null!=this.uri?"external":"embedded"}set name(e){for(let t of this[u])t.image.name=e}update(){let e=this[h];e&&e.isCanvasTexture&&!e.animation&&(this[h].needsUpdate=!0,this[s.VH]())}async createThumbnail(e,t){let r=new i.Z58;o.map=this[h];let s=new i.eaF(l,o);r.add(s);let c=new i.qUd(-1,1,1,-1,0,1),{threeRenderer:u}=a.A.singleton,d=new i.nWS(e,t);u.setRenderTarget(d),u.render(r,c),u.setRenderTarget(null);let p=new Uint8Array(e*t*4);u.readRenderTargetPixels(d,0,0,e,t,p),n.uz.width=e,n.uz.height=t;let f=n.uz.getContext("2d"),g=f.createImageData(e,t);return g.data.set(p),f.putImageData(g,0,0),new Promise(async(e,t)=>{n.uz.toBlob(r=>{if(!r)return t("Failed to capture thumbnail.");e(URL.createObjectURL(r))},"image/png")})}}},6201(e,t,r){"use strict";r.d(t,{Tt:()=>eo,Kx:()=>ep,eI:()=>ea,jQ:()=>es,Zm:()=>ei,W8:()=>ec,qA:()=>en});var i,n,a,s,o,l,c,h,u,d,p,f,g,m=r(874),A=r(6580),b=r(6886);let v=Symbol("texture"),y=Symbol("transform"),x=Symbol("materials"),S=Symbol("usage"),E=Symbol("onUpdate"),w=Symbol("activeVideo");(i=o||(o={}))[i.Base=0]="Base",i[i.MetallicRoughness=1]="MetallicRoughness",i[i.Normal=2]="Normal",i[i.Occlusion=3]="Occlusion",i[i.Emissive=4]="Emissive",i[i.Clearcoat=5]="Clearcoat",i[i.ClearcoatRoughness=6]="ClearcoatRoughness",i[i.ClearcoatNormal=7]="ClearcoatNormal",i[i.SheenColor=8]="SheenColor",i[i.SheenRoughness=9]="SheenRoughness",i[i.Transmission=10]="Transmission",i[i.Thickness=11]="Thickness",i[i.Specular=12]="Specular",i[i.SpecularColor=13]="SpecularColor",i[i.Iridescence=14]="Iridescence",i[i.IridescenceThickness=15]="IridescenceThickness",i[i.Anisotropy=16]="Anisotropy";class _{constructor(e,t,r,i){this[n]=null,this[a]={rotation:0,scale:new m.I9Y(1,1),offset:new m.I9Y(0,0)},this[s]=!1,r&&(this[y].rotation=r.rotation,this[y].scale.copy(r.repeat),this[y].offset.copy(r.offset),this[v]=new b.g(e,r)),this[E]=e,this[x]=i,this[S]=t}get texture(){return this[v]}setTexture(e){var t,r;let i=null!=e?e.source[A.OC]:null,n=null==(t=this[v])?void 0:t.source[A.OC];if(null!=n&&n.isVideoTexture?this[w]=!1:(null==(r=this[v])?void 0:r.source.animation)&&this[v].source.animation.removeEventListener("enterFrame",this[E]),this[v]=e,null!=i&&i.isVideoTexture){let e=i.image;if(this[w]=!0,null!=e.requestVideoFrameCallback){let t=()=>{this[w]&&(this[E](),e.requestVideoFrameCallback(t))};e.requestVideoFrameCallback(t)}else{let e=()=>{this[w]&&(this[E](),requestAnimationFrame(e))};requestAnimationFrame(e)}}else(null==e?void 0:e.source.animation)!=null&&e.source.animation.addEventListener("enterFrame",this[E]);let a="srgb";if(this[x])for(let e of this[x]){switch(this[S]){case o.Base:e.map=i;break;case o.MetallicRoughness:a=m.Zr2,e.metalnessMap=i,e.roughnessMap=i;break;case o.Normal:a=m.Zr2,e.normalMap=i;break;case o.Occlusion:a=m.Zr2,e.aoMap=i;break;case o.Emissive:e.emissiveMap=i;break;case o.Clearcoat:e.clearcoatMap=i;break;case o.ClearcoatRoughness:e.clearcoatRoughnessMap=i;break;case o.ClearcoatNormal:e.clearcoatNormalMap=i;break;case o.SheenColor:e.sheenColorMap=i;break;case o.SheenRoughness:e.sheenRoughnessMap=i;break;case o.Transmission:e.transmissionMap=i;break;case o.Thickness:e.thicknessMap=i;break;case o.Specular:e.specularIntensityMap=i;break;case o.SpecularColor:e.specularColorMap=i;break;case o.Iridescence:e.iridescenceMap=i;break;case o.IridescenceThickness:e.iridescenceThicknessMap=i;break;case o.Anisotropy:e.anisotropyMap=i}e.needsUpdate=!0}i&&(i.colorSpace=a,i.rotation=this[y].rotation,i.repeat=this[y].scale,i.offset=this[y].offset),this[E]()}}n=v,a=y,s=w;var C=r(3333);let M=Symbol("threeMaterial"),I=Symbol("threeMaterials"),T=Symbol("baseColorTexture"),R=Symbol("metallicRoughnessTexture");class B extends C.vc{get[I](){return this[C.oj]}get[M](){var e;return null==(e=this[C.oj])?void 0:e.values().next().value}constructor(e,t){super(e,t);const{map:r,metalnessMap:i}=t.values().next().value;this[T]=new _(e,o.Base,r,t),this[R]=new _(e,o.MetallicRoughness,i,t)}get baseColorFactor(){let e=[0,0,0,this[M].opacity];return this[M].color.toArray(e),e}get metallicFactor(){return this[M].metalness}get roughnessFactor(){return this[M].roughness}get baseColorTexture(){return this[T]}get metallicRoughnessTexture(){return this[R]}setBaseColorFactor(e){let t=new m.Q1f;for(let r of(e instanceof Array?t.fromArray(e):t.set(e),this[I]))r.color.set(t),e instanceof Array&&e.length>3?r.opacity=e[3]:(e=[0,0,0,r.opacity],t.toArray(e));this[C.VH]()}setMetallicFactor(e){for(let t of this[I])t.metalness=e;this[C.VH]()}setRoughnessFactor(e){for(let t of this[I])t.roughness=e;this[C.VH]()}}let k=Symbol("pbrMetallicRoughness"),P=Symbol("normalTexture"),D=Symbol("occlusionTexture"),L=Symbol("emissiveTexture"),F=Symbol("backingThreeMaterial"),N=Symbol("applyAlphaCutoff"),U=Symbol("getAlphaMode"),O=Symbol("lazyLoadGLTFInfo"),Q=Symbol("initialize"),z=Symbol("getLoadedMaterial"),H=Symbol("ensureMaterialIsLoaded"),G=Symbol("gltfIndex"),V=Symbol("setActive"),j=Symbol("variantIndices"),q=Symbol("isActive"),W=Symbol("modelVariants"),X=Symbol("name"),Y=Symbol("pbrTextures");class K extends C.vc{get[(l=j,c=Y,F)](){return this[C.oj].values().next().value}constructor(e,t,r,i,n,a,s){super(e,n),this[l]=new Set,this[c]=new Map,this[G]=t,this[q]=r,this[W]=i,this[X]=a,null==s?this[Q]():this[O]=s}[Q](){let e=this[C.VH],t=this[C.oj];this[k]=new B(e,t);let{normalMap:r,aoMap:i,emissiveMap:n}=t.values().next().value;this[P]=new _(e,o.Normal,r,t),this[D]=new _(e,o.Occlusion,i,t),this[L]=new _(e,o.Emissive,n,t);let a=r=>{this[Y].set(r,new _(e,r,null,t))};a(o.Clearcoat),a(o.ClearcoatRoughness),a(o.ClearcoatNormal),a(o.SheenColor),a(o.SheenRoughness),a(o.Transmission),a(o.Thickness),a(o.Specular),a(o.SpecularColor),a(o.Iridescence),a(o.IridescenceThickness),a(o.Anisotropy)}async [z](){if(null!=this[O]){let e=await this[O].doLazyLoad();return this[Q](),this[O]=void 0,this.ensureLoaded=async()=>{},e}return null}colorFromRgb(e){let t=new m.Q1f;return e instanceof Array?t.fromArray(e):t.set(e),t}[H](){if(null!=this[O])throw Error(`Material "${this.name}" has not been loaded, call 'await
19
+ myMaterial.ensureLoaded()' before using an unloaded material.`)}async ensureLoaded(){await this[z]()}get isLoaded(){return null==this[O]}get isActive(){return this[q]}[V](e){this[q]=e}get name(){return this[X]||""}set name(e){if(this[X]=e,null!=this[C.oj])for(let t of this[C.oj])t.name=e}get pbrMetallicRoughness(){return this[H](),this[k]}get normalTexture(){return this[H](),this[P]}get occlusionTexture(){return this[H](),this[D]}get emissiveTexture(){return this[H](),this[L]}get emissiveFactor(){return this[H](),this[F].emissive.toArray()}get index(){return this[G]}hasVariant(e){let t=this[W].get(e);return null!=t&&this[j].has(t.index)}setEmissiveFactor(e){this[H]();let t=this.colorFromRgb(e);for(let e of this[C.oj])e.emissive.set(t);this[C.VH]()}[U](){return this[F].transparent?"BLEND":this[F].alphaTest>0?"MASK":"OPAQUE"}[N](){for(let e of(this[H](),this[C.oj]))"MASK"===this[U]()?void 0==e.alphaTest&&(e.alphaTest=.5):e.alphaTest=void 0,e.needsUpdate=!0}setAlphaCutoff(e){for(let t of(this[H](),this[C.oj]))t.alphaTest=e,t.needsUpdate=!0;this[N](),this[C.VH]()}getAlphaCutoff(){return this[H](),this[F].alphaTest}setDoubleSided(e){for(let t of(this[H](),this[C.oj]))t.side=2*!!e,t.needsUpdate=!0;this[C.VH]()}getDoubleSided(){return this[H](),2==this[F].side}setAlphaMode(e){this[H]();let t=(e,t)=>{e.transparent=t,e.depthWrite=!t};for(let r of this[C.oj])t(r,"BLEND"===e),"MASK"===e?r.alphaTest=.5:r.alphaTest=void 0,r.needsUpdate=!0;this[C.VH]()}getAlphaMode(){return this[H](),this[U]()}get emissiveStrength(){return this[H](),this[F].emissiveIntensity}setEmissiveStrength(e){for(let t of(this[H](),this[C.oj]))t.emissiveIntensity=e;this[C.VH]()}get clearcoatFactor(){return this[H](),this[F].clearcoat}get clearcoatRoughnessFactor(){return this[H](),this[F].clearcoatRoughness}get clearcoatTexture(){return this[H](),this[Y].get(o.Clearcoat)}get clearcoatRoughnessTexture(){return this[H](),this[Y].get(o.ClearcoatRoughness)}get clearcoatNormalTexture(){return this[H](),this[Y].get(o.ClearcoatNormal)}get clearcoatNormalScale(){return this[H](),this[F].clearcoatNormalScale.x}setClearcoatFactor(e){for(let t of(this[H](),this[C.oj]))t.clearcoat=e;this[C.VH]()}setClearcoatRoughnessFactor(e){for(let t of(this[H](),this[C.oj]))t.clearcoatRoughness=e;this[C.VH]()}setClearcoatNormalScale(e){for(let t of(this[H](),this[C.oj]))t.clearcoatNormalScale=new m.I9Y(e,e);this[C.VH]()}get ior(){return this[H](),this[F].ior}setIor(e){for(let t of(this[H](),this[C.oj]))t.ior=e;this[C.VH]()}get sheenColorFactor(){return this[H](),this[F].sheenColor.toArray()}get sheenColorTexture(){return this[H](),this[Y].get(o.SheenColor)}get sheenRoughnessFactor(){return this[H](),this[F].sheenRoughness}get sheenRoughnessTexture(){return this[H](),this[Y].get(o.SheenRoughness)}setSheenColorFactor(e){this[H]();let t=this.colorFromRgb(e);for(let e of this[C.oj])e.sheenColor.set(t),e.sheen=1;this[C.VH]()}setSheenRoughnessFactor(e){for(let t of(this[H](),this[C.oj]))t.sheenRoughness=e,t.sheen=1;this[C.VH]()}get transmissionFactor(){return this[H](),this[F].transmission}get transmissionTexture(){return this[H](),this[Y].get(o.Transmission)}setTransmissionFactor(e){for(let t of(this[H](),this[C.oj]))t.transmission=e;this[C.VH]()}get thicknessFactor(){return this[H](),this[F].thickness}get thicknessTexture(){return this[H](),this[Y].get(o.Thickness)}get attenuationDistance(){return this[H](),this[F].attenuationDistance}get attenuationColor(){return this[H](),this[F].attenuationColor.toArray()}setThicknessFactor(e){for(let t of(this[H](),this[C.oj]))t.thickness=e;this[C.VH]()}setAttenuationDistance(e){for(let t of(this[H](),this[C.oj]))t.attenuationDistance=e;this[C.VH]()}setAttenuationColor(e){this[H]();let t=this.colorFromRgb(e);for(let e of this[C.oj])e.attenuationColor.set(t);this[C.VH]()}get specularFactor(){return this[H](),this[F].specularIntensity}get specularTexture(){return this[H](),this[Y].get(o.Specular)}get specularColorFactor(){return this[H](),this[F].specularColor.toArray()}get specularColorTexture(){return this[H](),this[Y].get(o.SheenColor)}setSpecularFactor(e){for(let t of(this[H](),this[C.oj]))t.specularIntensity=e;this[C.VH]()}setSpecularColorFactor(e){this[H]();let t=this.colorFromRgb(e);for(let e of this[C.oj])e.specularColor.set(t);this[C.VH]()}get iridescenceFactor(){return this[H](),this[F].iridescence}get iridescenceTexture(){return this[H](),this[Y].get(o.Iridescence)}get iridescenceIor(){return this[H](),this[F].iridescenceIOR}get iridescenceThicknessMinimum(){return this[H](),this[F].iridescenceThicknessRange[0]}get iridescenceThicknessMaximum(){return this[H](),this[F].iridescenceThicknessRange[1]}get iridescenceThicknessTexture(){return this[H](),this[Y].get(o.IridescenceThickness)}setIridescenceFactor(e){for(let t of(this[H](),this[C.oj]))t.iridescence=e;this[C.VH]()}setIridescenceIor(e){for(let t of(this[H](),this[C.oj]))t.iridescenceIOR=e;this[C.VH]()}setIridescenceThicknessMinimum(e){for(let t of(this[H](),this[C.oj]))t.iridescenceThicknessRange[0]=e;this[C.VH]()}setIridescenceThicknessMaximum(e){for(let t of(this[H](),this[C.oj]))t.iridescenceThicknessRange[1]=e;this[C.VH]()}get anisotropyStrength(){return this[H](),this[F].anisotropy}get anisotropyRotation(){return this[H](),this[F].anisotropyRotation}get anisotropyTexture(){return this[H](),this[Y].get(o.Anisotropy)}setAnisotropyStrength(e){for(let t of(this[H](),this[C.oj]))t.anisotropy=e;this[C.VH]()}setAnisotropyRotation(e){for(let t of(this[H](),this[C.oj]))t.anisotropyRotation=e;this[C.VH]()}}class ${constructor(e){this.name="",this.children=[],this.name=e}}class J extends ${constructor(e,t,r,i){super(e.name),this.materials=new Map,this.variantToMaterialMap=new Map,this.initialMaterialIdx=0,this.activeMaterialIdx=0,this.mesh=e;const{gltf:n,threeGLTF:a,threeObjectMap:s}=i;this.parser=a.parser,this.modelVariants=r,this.mesh.userData.variantData=r;const o=s.get(e.material);null!=o.materials?this.initialMaterialIdx=this.activeMaterialIdx=o.materials:console.error(`Primitive (${e.name}) missing initial material reference.`);const l=e.userData.associations||{};if(null==l.meshes)return void console.error("Mesh is missing primitive index association");const c=((n.meshes||[])[l.meshes].primitives||[])[l.primitives];if(null==c)return void console.error("Mesh primitive definition is missing.");if(null!=c.material)this.materials.set(c.material,t[c.material]);else{const e=t.findIndex(e=>"Default"===e.name);e>=0?this.materials.set(e,t[e]):console.warn("gltfPrimitive has no material!")}if(c.extensions&&c.extensions.KHR_materials_variants){const e=c.extensions.KHR_materials_variants,i=a.parser.json.extensions.KHR_materials_variants.variants;for(const n of e.mappings){const e=t[n.material];for(const t of(this.materials.set(n.material,e),n.variants)){const{name:n}=i[t];this.variantToMaterialMap.set(t,e),e[j].add(t),r.has(n)||r.set(n,{name:n,index:t})}}}}async setActiveMaterial(e){let t=this.materials.get(e);if(e!==this.activeMaterialIdx){let r=t[C.oj],i=await t[z]();null!=i?this.mesh.material=i:this.mesh.material=r.values().next().value,this.parser.assignFinalMaterial(this.mesh),r.add(this.mesh.material),this.activeMaterialIdx=e}return this.mesh.material}getActiveMaterial(){return this.materials.get(this.activeMaterialIdx)}getMaterial(e){return this.materials.get(e)}async enableVariant(e){if(null==e)return this.setActiveMaterial(this.initialMaterialIdx);if(null!=this.variantToMaterialMap&&this.modelVariants.has(e)){let t=this.modelVariants.get(e);return this.enableVariantHelper(t.index)}return null}async enableVariantHelper(e){if(null!=this.variantToMaterialMap&&null!=e){let t=this.variantToMaterialMap.get(e);if(null!=t)return this.setActiveMaterial(t.index)}return null}async instantiateVariants(){if(null!=this.variantToMaterialMap)for(let e of this.variantToMaterialMap.keys()){let t=this.mesh.userData.variantMaterials.get(e);if(null!=t.material)continue;let r=await this.enableVariantHelper(e);null!=r&&(t.material=r)}}get variantInfo(){return this.variantToMaterialMap}addVariant(e,t){if(!this.ensureVariantIsUnused(t))return!1;this.modelVariants.has(t)||this.modelVariants.set(t,{name:t,index:this.modelVariants.size});let r=this.modelVariants.get(t).index;return e[j].add(r),this.variantToMaterialMap.set(r,e),this.materials.set(e.index,e),this.updateVariantUserData(r,e),!0}deleteVariant(e){if(this.variantInfo.has(e)){this.variantInfo.delete(e);let t=this.mesh.userData.variantMaterials;null!=t&&t.delete(e)}}updateVariantUserData(e,t){t[j].add(e),this.mesh.userData.variantData=this.modelVariants,this.mesh.userData.variantMaterials=this.mesh.userData.variantMaterials||new Map,this.mesh.userData.variantMaterials.set(e,{material:t[C.oj].values().next().value,gltfMaterialIndex:t.index})}ensureVariantIsUnused(e){let t=this.modelVariants.get(e);return!(null!=t&&this.variantInfo.has(t.index))||(console.warn(`Primitive cannot add variant '${e}' for this material, it already exists.`),!1)}}let Z=Symbol("materials"),ee=Symbol("hierarchy"),et=Symbol("roots"),er=Symbol("primitives");Symbol("loadVariant");let ei=Symbol("prepareVariantsForExport"),en=Symbol("switchVariant"),ea=Symbol("materialFromPoint"),es=Symbol("nodeFromPoint"),eo=Symbol("nodeFromIndex"),el=Symbol("variantData"),ec=Symbol("availableVariants"),eh=Symbol("modelOnUpdate"),eu=Symbol("cloneMaterial");class ed{constructor(e,t,r,i){this.gltf=e,this.gltfElementMap=t,this.mapKey=r,this.doLazyLoad=i}}class ep{constructor(e,t=()=>{}){this[h]=[],this[u]=[],this[d]=[],this[p]=[],this[f]=()=>{},this[g]=new Map,this[eh]=t;const{gltf:r,threeGLTF:i,gltfElementMap:n}=e;for(const[e,a]of r.materials.entries()){const s=n.get(a);if(null!=s)this[Z].push(new K(t,e,!0,this[el],s,a.name));else{const s=(r.materials||[])[e],o=new Set;n.set(s,o);const l=async()=>{let t=await i.parser.getDependency("material",e);return o.add(t),t};this[Z].push(new K(t,e,!1,this[el],o,a.name,new ed(r,n,s,l)))}}const a=new Map,s=[];for(const e of i.scene.children)s.push(e);for(;s.length>0;){const t=s.pop();let r=null;t instanceof m.eaF?(r=new J(t,this.materials,this[el],e),this[er].push(r)):r=new $(t.name);const i=a.get(t);for(const e of(null!=i?i.children.push(r):this[et].push(r),this[ee].push(r),t.children))s.push(e),a.set(t,r)}}get materials(){return this[Z]}[(h=Z,u=ee,d=et,p=er,f=eh,g=el,ec)](){let e=Array.from(this[el].values());return e.sort((e,t)=>e.index-t.index),e.map(e=>e.name)}getMaterialByName(e){let t=this[Z].filter(t=>t.name===e);return t.length>0?t[0]:null}[eo](e,t){let r=this[ee].find(r=>{if(r instanceof J){let{meshes:i,primitives:n}=r.mesh.userData.associations;if(i==e&&n==t)return!0}return!1});return null==r?null:r}[es](e){return this[ee].find(t=>t instanceof J&&t.mesh===e.object||!1)}[ea](e){return this[es](e).getActiveMaterial()}async [en](e){for(let t of this[er])await t.enableVariant(e);for(let e of this.materials)e[V](!1);for(let e of this[er])this.materials[e.getActiveMaterial().index][V](!0)}async [ei](){let e=[];for(let t of this[er])e.push(t.instantiateVariants());await Promise.all(e)}[eu](e,t){let r=this.materials[e];r.isLoaded||console.error(`Cloning an unloaded material,
20
+ call 'material.ensureLoaded() before cloning the material.`);let i=r[C.oj],n=new Set;for(let[e,r]of i.entries()){let a=r.clone();a.name=t+(i.size>1?"_inst"+e:""),n.add(a)}let a=new K(this[eh],this[Z].length,!1,this[el],n,t);return this[Z].push(a),a}createMaterialInstanceForVariant(e,t,r,i=!0){let n=null;for(let i of this[er]){let a=this[el].get(r);null!=a&&i.variantInfo.has(a.index)||null!=i.getMaterial(e)&&(this.hasVariant(r)||this.createVariant(r),null==n&&(n=this[eu](e,t)),i.addVariant(n,r))}if(i&&null!=n)for(let t of(n[V](!0),this.materials[e][V](!1),this[er]))t.enableVariant(r);return n}createVariant(e){this[el].has(e)?console.warn(`Variant '${e}'' already exists`):this[el].set(e,{name:e,index:this[el].size})}hasVariant(e){return this[el].has(e)}setMaterialToVariant(e,t){if(null==this[ec]().find(e=>e===t))return void console.warn(`Can't add material to '${t}', the variant does not exist.'`);if(e<0||e>=this.materials.length)return void console.error("setMaterialToVariant(): materialIndex is out of bounds.");for(let r of this[er]){let i=r.getMaterial(e);null!=i&&r.addVariant(i,t)}}updateVariantName(e,t){let r=this[el].get(e);null!=r&&(r.name=t,this[el].set(t,r),this[el].delete(e))}deleteVariant(e){let t=this[el].get(e);if(null!=t){for(let r of this.materials)r.hasVariant(e)&&r[j].delete(t.index);for(let e of this[er])e.deleteVariant(t.index);this[el].delete(e)}}}},6886(e,t,r){"use strict";r.d(t,{g:()=>w});var i,n,a,s,o=r(6580),l=r(874),c=r(3520);(i=a||(a={}))[i.Nearest=9728]="Nearest",i[i.Linear=9729]="Linear",i[i.NearestMipmapNearest=9984]="NearestMipmapNearest",i[i.LinearMipmapNearest=9985]="LinearMipmapNearest",i[i.NearestMipmapLinear=9986]="NearestMipmapLinear",i[i.LinearMipmapLinear=9987]="LinearMipmapLinear",(n=s||(s={}))[n.ClampToEdge=33071]="ClampToEdge",n[n.MirroredRepeat=33648]="MirroredRepeat",n[n.Repeat=10497]="Repeat";var h=r(3333);let u=new Map([[s.Repeat,1e3],[s.ClampToEdge,1001],[s.MirroredRepeat,1002]]),d=new Map([[1e3,s.Repeat],[1001,s.ClampToEdge],[1002,s.MirroredRepeat]]),p=new Map([[a.Nearest,1003],[a.Linear,1006],[a.NearestMipmapNearest,1004],[a.LinearMipmapNearest,1007],[a.NearestMipmapLinear,1005],[a.LinearMipmapLinear,1008]]),f=new Map([[1003,a.Nearest],[1006,a.Linear],[1004,a.NearestMipmapNearest],[1007,a.LinearMipmapNearest],[1005,a.NearestMipmapLinear],[1008,a.LinearMipmapLinear]]),g=new Map([[a.Nearest,1003],[a.Linear,1006]]),m=new Map([[1003,a.Nearest],[1006,a.Linear]]),A=Symbol("threeTexture"),b=Symbol("threeTextures"),v=Symbol("setProperty");class y extends h.vc{get[A](){var e;return null==(e=this[h.oj])?void 0:e.values().next().value}get[b](){return this[h.oj]}constructor(e,t){super(e,new Set(t?[t]:[]))}get name(){return this[A].name||""}get minFilter(){return f.get(this[A].minFilter)}get magFilter(){return m.get(this[A].magFilter)}get wrapS(){return d.get(this[A].wrapS)}get wrapT(){return d.get(this[A].wrapT)}get rotation(){return this[A].rotation}get scale(){return(0,c.hC)(this[A].repeat)}get offset(){return(0,c.hC)(this[A].offset)}setMinFilter(e){this[v]("minFilter",p.get(e))}setMagFilter(e){this[v]("magFilter",g.get(e))}setWrapS(e){this[v]("wrapS",u.get(e))}setWrapT(e){this[v]("wrapT",u.get(e))}setRotation(e){null==e&&(e=0),this[v]("rotation",e)}setScale(e){null==e&&(e={u:1,v:1}),this[v]("repeat",new l.I9Y(e.u,e.v))}setOffset(e){null==e&&(e={u:0,v:0}),this[v]("offset",new l.I9Y(e.u,e.v))}[v](e,t){if(((e,t)=>{switch(e){case"minFilter":let r;return r=t,f.has(r);case"magFilter":let i;return i=t,m.has(i);case"wrapS":case"wrapT":let n;return n=t,d.has(n);case"rotation":case"repeat":case"offset":return!0;default:throw Error(`Cannot configure property "${e}" on Sampler`)}})(e,t))for(let r of this[b])r[e]=t,r.needsUpdate=!0;this[h.VH]()}}let x=Symbol("image"),S=Symbol("sampler"),E=Symbol("threeTexture");class w extends h.vc{get[E](){var e;return null==(e=this[h.oj])?void 0:e.values().next().value}constructor(e,t){super(e,new Set(t?[t]:[])),this[S]=new y(e,t),this[x]=new o._V(e,t)}get name(){return this[E].name||""}set name(e){for(let t of this[h.oj])t.name=e}get sampler(){return this[S]}get source(){return this[x]}}},3333(e,t,r){"use strict";r.d(t,{VH:()=>n,oj:()=>i,vc:()=>a});let i=Symbol("correlatedObjects"),n=Symbol("onUpdate");class a{constructor(e,t){this[n]=e,this[i]=t}}},6726(e,t,r){"use strict";r.d(t,{V:()=>g});var i=r(8413),n=r(6650),a=r(3520),s=r(3935),o=r(1718),l=function(e,t,r,i){var n,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,r,s):n(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};let c=Math.PI/32,h={basis:[(0,s.tR)((0,o.sJ)(c,"rad"))],keywords:{auto:[null]}},u=Symbol("autoRotateStartTime"),d=Symbol("radiansPerSecond"),p=Symbol("syncRotationRate"),f=Symbol("onCameraChange"),g=e=>{var t,r,s;class o extends e{constructor(){super(...arguments),this.autoRotate=!1,this.autoRotateDelay=3e3,this.rotationPerSecond="auto",this[t]=performance.now(),this[r]=0,this[s]=e=>{this.autoRotate&&"user-interaction"===e.detail.source&&(this[u]=performance.now())}}connectedCallback(){super.connectedCallback(),this.addEventListener("camera-change",this[f]),this[u]=performance.now()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("camera-change",this[f]),this[u]=performance.now()}updated(e){super.updated(e),e.has("autoRotate")&&(this[u]=performance.now())}[(t=u,r=d,p)](e){this[d]=e[0]}[a.Ei](e,t){if(super[a.Ei](e,t),!this.autoRotate||!this[a.gJ]()||this[a.m8].isPresenting)return;let r=Math.min(t,e-this[u]-this.autoRotateDelay);r>0&&(this[a.lC].yaw=this.turntableRotation+this[d]*r*.001)}get turntableRotation(){return this[a.lC].yaw}resetTurntableRotation(e=0){this[a.lC].yaw=e}}return s=f,l([(0,i.MZ)({type:Boolean,attribute:"auto-rotate"})],o.prototype,"autoRotate",void 0),l([(0,i.MZ)({type:Number,attribute:"auto-rotate-delay"})],o.prototype,"autoRotateDelay",void 0),l([(0,n.i)({intrinsics:h,updateHandler:p}),(0,i.MZ)({type:String,attribute:"rotation-per-second"})],o.prototype,"rotationPerSecond",void 0),o}},3520(e,t,r){"use strict";r.d(t,{yc:()=>e5,cJ:()=>eX,vA:()=>e7,if:()=>te,gJ:()=>tn,T5:()=>eY,$M:()=>e0,uz:()=>eF,hr:()=>e4,Ay:()=>tl,Gw:()=>ts,m8:()=>tt,cM:()=>e$,Yl:()=>eZ,vk:()=>eq,Sw:()=>eK,ML:()=>e9,Ei:()=>e6,Hc:()=>e1,OS:()=>tr,sM:()=>ta,hC:()=>to,SD:()=>e3,lC:()=>e8});var i,n,a,s,o,l,c,h,u,d,p,f,g,m=r(3035);let A=globalThis,b=e=>e,v=A.trustedTypes,y=v?v.createPolicy("lit-html",{createHTML:e=>e}):void 0,x="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,E="?"+S,w=`<${E}>`,_=document,C=()=>_.createComment(""),M=e=>null===e||"object"!=typeof e&&"function"!=typeof e,I=Array.isArray,T="[ \n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,k=/>/g,P=RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^
21
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,L=/"/g,F=/^(?:script|style|textarea|title)$/i,N=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),U=N(1),O=(N(2),N(3),Symbol.for("lit-noChange")),Q=Symbol.for("lit-nothing"),z=new WeakMap,H=_.createTreeWalker(_,129);function G(e,t){if(!I(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==y?y.createHTML(t):t}class V{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let n=0,a=0;const s=e.length-1,o=this.parts,[l,c]=((e,t)=>{let r=e.length-1,i=[],n,a=2===t?"<svg>":3===t?"<math>":"",s=R;for(let t=0;t<r;t++){let r=e[t],o,l,c=-1,h=0;for(;h<r.length&&(s.lastIndex=h,null!==(l=s.exec(r)));)h=s.lastIndex,s===R?"!--"===l[1]?s=B:void 0!==l[1]?s=k:void 0!==l[2]?(F.test(l[2])&&(n=RegExp("</"+l[2],"g")),s=P):void 0!==l[3]&&(s=P):s===P?">"===l[0]?(s=n??R,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,o=l[1],s=void 0===l[3]?P:'"'===l[3]?L:D):s===L||s===D?s=P:s===B||s===k?s=R:(s=P,n=void 0);let u=s===P&&e[t+1].startsWith("/>")?" ":"";a+=s===R?r+w:c>=0?(i.push(o),r.slice(0,c)+x+r.slice(c)+S+u):r+S+(-2===c?t:u)}return[G(e,a+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]})(e,t);if(this.el=V.createElement(l,r),H.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=H.nextNode())&&o.length<s;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(x)){const t=c[a++],r=i.getAttribute(e).split(S),s=/([.?@])?(.*)/.exec(t);o.push({type:1,index:n,name:s[2],strings:r,ctor:"."===s[1]?Y:"?"===s[1]?K:"@"===s[1]?$:X}),i.removeAttribute(e)}else e.startsWith(S)&&(o.push({type:6,index:n}),i.removeAttribute(e));if(F.test(i.tagName)){const e=i.textContent.split(S),t=e.length-1;if(t>0){i.textContent=v?v.emptyScript:"";for(let r=0;r<t;r++)i.append(e[r],C()),H.nextNode(),o.push({type:2,index:++n});i.append(e[t],C())}}}else if(8===i.nodeType)if(i.data===E)o.push({type:2,index:n});else{let e=-1;for(;-1!==(e=i.data.indexOf(S,e+1));)o.push({type:7,index:n}),e+=S.length-1}n++}}static createElement(e,t){let r=_.createElement("template");return r.innerHTML=e,r}}function j(e,t,r=e,i){if(t===O)return t;let n=void 0!==i?r._$Co?.[i]:r._$Cl,a=M(t)?void 0:t._$litDirective$;return n?.constructor!==a&&(n?._$AO?.(!1),void 0===a?n=void 0:(n=new a(e))._$AT(e,r,i),void 0!==i?(r._$Co??=[])[i]=n:r._$Cl=n),void 0!==n&&(t=j(e,n._$AS(e,t.values),n,i)),t}class q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??_).importNode(t,!0);H.currentNode=i;let n=H.nextNode(),a=0,s=0,o=r[0];for(;void 0!==o;){if(a===o.index){let t;2===o.type?t=new W(n,n.nextSibling,this,e):1===o.type?t=new o.ctor(n,o.name,o.strings,this,e):6===o.type&&(t=new J(n,this,e)),this._$AV.push(t),o=r[++s]}a!==o?.index&&(n=H.nextNode(),a++)}return H.currentNode=_,i}p(e){let t=0;for(let r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class W{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=Q,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){let r;M(e=j(this,e,t))?e===Q||null==e||""===e?(this._$AH!==Q&&this._$AR(),this._$AH=Q):e!==this._$AH&&e!==O&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):I(r=e)||"function"==typeof r?.[Symbol.iterator]?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Q&&M(this._$AH)?this._$AA.nextSibling.data=e:this.T(_.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=V.createElement(G(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let e=new q(i,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=z.get(e.strings);return void 0===t&&z.set(e.strings,t=new V(e)),t}k(e){I(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let n of e)i===t.length?t.push(r=new W(this.O(C()),this.O(C()),this,this.options)):r=t[i],r._$AI(n),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=b(e).nextSibling;b(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class X{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,n){this.type=1,this._$AH=Q,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Q}_$AI(e,t=this,r,i){let n=this.strings,a=!1;if(void 0===n)(a=!M(e=j(this,e,t,0))||e!==this._$AH&&e!==O)&&(this._$AH=e);else{let i,s,o=e;for(e=n[0],i=0;i<n.length-1;i++)(s=j(this,o[r+i],t,i))===O&&(s=this._$AH[i]),a||=!M(s)||s!==this._$AH[i],s===Q?e=Q:e!==Q&&(e+=(s??"")+n[i+1]),this._$AH[i]=s}a&&!i&&this.j(e)}j(e){e===Q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Y extends X{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Q?void 0:e}}class K extends X{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Q)}}class $ extends X{constructor(e,t,r,i,n){super(e,t,r,i,n),this.type=5}_$AI(e,t=this){if((e=j(this,e,t,0)??Q)===O)return;let r=this._$AH,i=e===Q&&r!==Q||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==Q&&(r===Q||i);i&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class J{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){j(this,e)}}let Z=A.litHtmlPolyfillSupport;Z?.(V,W),(A.litHtmlVersions??=[]).push("3.3.2");let ee=(e,t,r)=>{let i=r?.renderBefore??t,n=i._$litPart$;if(void 0===n){let e=r?.renderBefore??null;i._$litPart$=n=new W(t.insertBefore(C(),e),e,void 0,r??{})}return n._$AI(e),n},et=globalThis;class er extends m.mN{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ee(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}}er._$litElement$=!0,er.finalized=!0,et.litElementHydrateSupport?.({LitElement:er});let ei=et.litElementPolyfillSupport;ei?.({LitElement:er}),(et.litElementVersions??=[]).push("4.2.2");var en=r(8413),ea=r(322),es=r(6526);let eo=U`
22
+ <svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#000000">
23
+ <!-- NOTE(cdata): This SVG filter is a stop-gap until we can implement
24
+ support for dynamic re-coloring of UI components -->
25
+ <defs>
26
+ <filter id="drop-shadow" x="-100%" y="-100%" width="300%" height="300%">
27
+ <feGaussianBlur in="SourceAlpha" stdDeviation="1"/>
28
+ <feOffset dx="0" dy="0" result="offsetblur"/>
29
+ <feFlood flood-color="#000000"/>
30
+ <feComposite in2="offsetblur" operator="in"/>
31
+ <feMerge>
32
+ <feMergeNode/>
33
+ <feMergeNode in="SourceGraphic"/>
34
+ </feMerge>
35
+ </filter>
36
+ </defs>
37
+ <path filter="url(#drop-shadow)" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
38
+ <path d="M0 0h24v24H0z" fill="none"/>
39
+ </svg>`,el=U`
40
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="36">
41
+ <defs>
42
+ <path id="A" d="M.001.232h24.997V36H.001z" />
43
+ </defs>
44
+ <g transform="translate(-11 -4)" fill="none" fill-rule="evenodd">
45
+ <path fill-opacity="0" fill="#fff" d="M0 0h44v44H0z" />
46
+ <g transform="translate(11 3)">
47
+ <path d="M8.733 11.165c.04-1.108.766-2.027 1.743-2.307a2.54 2.54 0 0 1 .628-.089c.16 0 .314.017.463.044 1.088.2 1.9 1.092 1.9 2.16v8.88h1.26c2.943-1.39 5-4.45 5-8.025a9.01 9.01 0 0 0-1.9-5.56l-.43-.5c-.765-.838-1.683-1.522-2.712-2-1.057-.49-2.226-.77-3.46-.77s-2.4.278-3.46.77c-1.03.478-1.947 1.162-2.71 2l-.43.5a9.01 9.01 0 0 0-1.9 5.56 9.04 9.04 0 0 0 .094 1.305c.03.21.088.41.13.617l.136.624c.083.286.196.56.305.832l.124.333a8.78 8.78 0 0 0 .509.953l.065.122a8.69 8.69 0 0 0 3.521 3.191l1.11.537v-9.178z" fill-opacity=".5" fill="#e4e4e4" />
48
+ <path d="M22.94 26.218l-2.76 7.74c-.172.485-.676.8-1.253.8H12.24c-1.606 0-3.092-.68-3.98-1.82-1.592-2.048-3.647-3.822-6.11-5.27-.095-.055-.15-.137-.152-.23-.004-.1.046-.196.193-.297.56-.393 1.234-.6 1.926-.6a3.43 3.43 0 0 1 .691.069l4.922.994V10.972c0-.663.615-1.203 1.37-1.203s1.373.54 1.373 1.203v9.882h2.953c.273 0 .533.073.757.21l6.257 3.874c.027.017.045.042.07.06.41.296.586.77.426 1.22M4.1 16.614c-.024-.04-.042-.083-.065-.122a8.69 8.69 0 0 1-.509-.953c-.048-.107-.08-.223-.124-.333l-.305-.832c-.058-.202-.09-.416-.136-.624l-.13-.617a9.03 9.03 0 0 1-.094-1.305c0-2.107.714-4.04 1.9-5.56l.43-.5c.764-.84 1.682-1.523 2.71-2 1.058-.49 2.226-.77 3.46-.77s2.402.28 3.46.77c1.03.477 1.947 1.16 2.712 2l.428.5a9 9 0 0 1 1.901 5.559c0 3.577-2.056 6.636-5 8.026h-1.26v-8.882c0-1.067-.822-1.96-1.9-2.16-.15-.028-.304-.044-.463-.044-.22 0-.427.037-.628.09-.977.28-1.703 1.198-1.743 2.306v9.178l-1.11-.537C6.18 19.098 4.96 18 4.1 16.614M22.97 24.09l-6.256-3.874c-.102-.063-.218-.098-.33-.144 2.683-1.8 4.354-4.855 4.354-8.243 0-.486-.037-.964-.104-1.43a9.97 9.97 0 0 0-1.57-4.128l-.295-.408-.066-.092a10.05 10.05 0 0 0-.949-1.078c-.342-.334-.708-.643-1.094-.922-1.155-.834-2.492-1.412-3.94-1.65l-.732-.088-.748-.03a9.29 9.29 0 0 0-1.482.119c-1.447.238-2.786.816-3.94 1.65a9.33 9.33 0 0 0-.813.686 9.59 9.59 0 0 0-.845.877l-.385.437-.36.5-.288.468-.418.778-.04.09c-.593 1.28-.93 2.71-.93 4.222 0 3.832 2.182 7.342 5.56 8.938l1.437.68v4.946L5 25.64a4.44 4.44 0 0 0-.888-.086c-.017 0-.034.003-.05.003-.252.004-.503.033-.75.08a5.08 5.08 0 0 0-.237.056c-.193.046-.382.107-.568.18-.075.03-.15.057-.225.1-.25.114-.494.244-.723.405a1.31 1.31 0 0 0-.566 1.122 1.28 1.28 0 0 0 .645 1.051C4 29.925 5.96 31.614 7.473 33.563a5.06 5.06 0 0 0 .434.491c1.086 1.082 2.656 1.713 4.326 1.715h6.697c.748-.001 1.43-.333 1.858-.872.142-.18.256-.38.336-.602l2.757-7.74c.094-.26.13-.53.112-.794s-.088-.52-.203-.76a2.19 2.19 0 0 0-.821-.91" fill-opacity=".6" fill="#000" />
49
+ <path d="M22.444 24.94l-6.257-3.874a1.45 1.45 0 0 0-.757-.211h-2.953v-9.88c0-.663-.616-1.203-1.373-1.203s-1.37.54-1.37 1.203v16.643l-4.922-.994a3.44 3.44 0 0 0-.692-.069 3.35 3.35 0 0 0-1.925.598c-.147.102-.198.198-.194.298.004.094.058.176.153.23 2.462 1.448 4.517 3.22 6.11 5.27.887 1.14 2.373 1.82 3.98 1.82h6.686c.577 0 1.08-.326 1.253-.8l2.76-7.74c.16-.448-.017-.923-.426-1.22-.025-.02-.043-.043-.07-.06z" fill="#fff" />
50
+ <g transform="translate(0 .769)">
51
+ <mask id="B" fill="#fff">
52
+ <use xlink:href="#A" />
53
+ </mask>
54
+ <path d="M23.993 24.992a1.96 1.96 0 0 1-.111.794l-2.758 7.74c-.08.22-.194.423-.336.602-.427.54-1.11.87-1.857.872h-6.698c-1.67-.002-3.24-.633-4.326-1.715-.154-.154-.3-.318-.434-.49C5.96 30.846 4 29.157 1.646 27.773c-.385-.225-.626-.618-.645-1.05a1.31 1.31 0 0 1 .566-1.122 4.56 4.56 0 0 1 .723-.405l.225-.1a4.3 4.3 0 0 1 .568-.18l.237-.056c.248-.046.5-.075.75-.08.018 0 .034-.003.05-.003.303-.001.597.027.89.086l3.722.752V20.68l-1.436-.68c-3.377-1.596-5.56-5.106-5.56-8.938 0-1.51.336-2.94.93-4.222.015-.03.025-.06.04-.09.127-.267.268-.525.418-.778.093-.16.186-.316.288-.468.063-.095.133-.186.2-.277L3.773 5c.118-.155.26-.29.385-.437.266-.3.544-.604.845-.877a9.33 9.33 0 0 1 .813-.686C6.97 2.167 8.31 1.59 9.757 1.35a9.27 9.27 0 0 1 1.481-.119 8.82 8.82 0 0 1 .748.031c.247.02.49.05.733.088 1.448.238 2.786.816 3.94 1.65.387.28.752.588 1.094.922a9.94 9.94 0 0 1 .949 1.078l.066.092c.102.133.203.268.295.408a9.97 9.97 0 0 1 1.571 4.128c.066.467.103.945.103 1.43 0 3.388-1.67 6.453-4.353 8.243.11.046.227.08.33.144l6.256 3.874c.37.23.645.55.82.9.115.24.185.498.203.76m.697-1.195c-.265-.55-.677-1.007-1.194-1.326l-5.323-3.297c2.255-2.037 3.564-4.97 3.564-8.114 0-2.19-.637-4.304-1.84-6.114-.126-.188-.26-.37-.4-.552-.645-.848-1.402-1.6-2.252-2.204C15.472.91 13.393.232 11.238.232A10.21 10.21 0 0 0 5.23 2.19c-.848.614-1.606 1.356-2.253 2.205-.136.18-.272.363-.398.55C1.374 6.756.737 8.87.737 11.06c0 4.218 2.407 8.08 6.133 9.842l.863.41v3.092l-2.525-.51c-.356-.07-.717-.106-1.076-.106a5.45 5.45 0 0 0-3.14.996c-.653.46-1.022 1.202-.99 1.983a2.28 2.28 0 0 0 1.138 1.872c2.24 1.318 4.106 2.923 5.543 4.772 1.26 1.62 3.333 2.59 5.55 2.592h6.698c1.42-.001 2.68-.86 3.134-2.138l2.76-7.74c.272-.757.224-1.584-.134-2.325" fill-opacity=".05" fill="#000" mask="url(#B)" />
55
+ </g>
56
+ </g>
57
+ </g>
58
+ </svg>`,ec=U`
59
+ <svg version="1.1" id="view_x5F_in_x5F_AR_x5F_icon"
60
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px"
61
+ viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
62
+ <rect id="Bounding_Box" x="0" y="0" fill="none" width="24" height="24"/>
63
+ <g id="Art_layer">
64
+ <path d="M3,4c0-0.55,0.45-1,1-1h2V1H4C2.35,1,1,2.35,1,4v2h2V4z"/>
65
+ <path d="M20,3c0.55,0,1,0.45,1,1v2h2V4c0-1.65-1.35-3-3-3h-2v2H20z"/>
66
+ <path d="M4,21c-0.55,0-1-0.45-1-1v-2H1v2c0,1.65,1.35,3,3,3h2v-2H4z"/>
67
+ <path d="M20,21c0.55,0,1-0.45,1-1v-2h2v2c0,1.65-1.35,3-3,3h-2v-2H20z"/>
68
+ <g>
69
+ <path d="M18.25,7.6l-5.5-3.18c-0.46-0.27-1.04-0.27-1.5,0L5.75,7.6C5.29,7.87,5,8.36,5,8.9v6.35c0,0.54,0.29,1.03,0.75,1.3
70
+ l5.5,3.18c0.46,0.27,1.04,0.27,1.5,0l5.5-3.18c0.46-0.27,0.75-0.76,0.75-1.3V8.9C19,8.36,18.71,7.87,18.25,7.6z M7,14.96v-4.62
71
+ l4,2.32v4.61L7,14.96z M12,10.93L8,8.61l4-2.31l4,2.31L12,10.93z M13,17.27v-4.61l4-2.32v4.62L13,17.27z"/>
72
+ </g>
73
+ </g>
74
+ </svg>`,eh=U`
75
+ <style>
76
+ :host {
77
+ display: block;
78
+ position: relative;
79
+ contain: strict;
80
+ width: 300px;
81
+ height: 150px;
82
+ }
83
+
84
+ .container {
85
+ position: relative;
86
+ overflow: hidden;
87
+ }
88
+
89
+ .userInput {
90
+ width: 100%;
91
+ height: 100%;
92
+ display: none;
93
+ position: relative;
94
+ outline-offset: -1px;
95
+ outline-width: 1px;
96
+ }
97
+
98
+ canvas {
99
+ position: absolute;
100
+ display: none;
101
+ pointer-events: none;
102
+ /* NOTE(cdata): Chrome 76 and below apparently have a bug
103
+ * that causes our canvas not to display pixels unless it is
104
+ * on its own render layer
105
+ * @see https://github.com/google/model-viewer/pull/755#issuecomment-536597893
106
+ */
107
+ transform: translateZ(0);
108
+ }
109
+
110
+ .show {
111
+ display: block;
112
+ }
113
+
114
+ /* Adapted from HTML5 Boilerplate
115
+ *
116
+ * @see https://github.com/h5bp/html5-boilerplate/blob/ceb4620c78fc82e13534fc44202a3f168754873f/dist/css/main.css#L122-L133 */
117
+ .screen-reader-only {
118
+ border: 0;
119
+ left: 0;
120
+ top: 0;
121
+ clip: rect(0, 0, 0, 0);
122
+ height: 1px;
123
+ margin: -1px;
124
+ overflow: hidden;
125
+ padding: 0;
126
+ position: absolute;
127
+ white-space: nowrap;
128
+ width: 1px;
129
+ pointer-events: none;
130
+ }
131
+
132
+ .slot {
133
+ position: absolute;
134
+ pointer-events: none;
135
+ top: 0;
136
+ left: 0;
137
+ width: 100%;
138
+ height: 100%;
139
+ }
140
+
141
+ .slot > * {
142
+ pointer-events: initial;
143
+ }
144
+
145
+ .annotation-wrapper ::slotted(*) {
146
+ opacity: var(--max-hotspot-opacity, 1);
147
+ transition: opacity 0.3s;
148
+ }
149
+
150
+ .pointer-tumbling .annotation-wrapper ::slotted(*) {
151
+ pointer-events: none;
152
+ }
153
+
154
+ .annotation-wrapper ::slotted(*) {
155
+ pointer-events: initial;
156
+ }
157
+
158
+ .annotation-wrapper.hide ::slotted(*) {
159
+ opacity: var(--min-hotspot-opacity, 0.25);
160
+ }
161
+
162
+ .slot.poster {
163
+ display: none;
164
+ background-color: inherit;
165
+ }
166
+
167
+ .slot.poster.show {
168
+ display: inherit;
169
+ }
170
+
171
+ .slot.poster > * {
172
+ pointer-events: initial;
173
+ }
174
+
175
+ .slot.poster:not(.show) > * {
176
+ pointer-events: none;
177
+ }
178
+
179
+ #default-poster {
180
+ width: 100%;
181
+ height: 100%;
182
+ /* The default poster is a <button> so we need to set display
183
+ * to prevent it from being affected by text-align: */
184
+ display: block;
185
+ position: absolute;
186
+ border: none;
187
+ padding: 0;
188
+ background-size: contain;
189
+ background-repeat: no-repeat;
190
+ background-position: center;
191
+ background-color: #fff0;
192
+ }
193
+
194
+ #default-progress-bar {
195
+ display: block;
196
+ position: relative;
197
+ width: 100%;
198
+ height: 100%;
199
+ pointer-events: none;
200
+ overflow: hidden;
201
+ }
202
+
203
+ #default-progress-bar > .bar {
204
+ position: absolute;
205
+ top: 0;
206
+ left: 0;
207
+ width: 100%;
208
+ height: var(--progress-bar-height, 5px);
209
+ background-color: var(--progress-bar-color, rgba(0, 0, 0, 0.4));
210
+ transition: transform 0.09s;
211
+ transform-origin: top left;
212
+ transform: scaleX(0);
213
+ overflow: hidden;
214
+ }
215
+
216
+ #default-progress-bar > .bar.hide {
217
+ transition: opacity 0.3s 1s;
218
+ opacity: 0;
219
+ }
220
+
221
+ .centered {
222
+ align-items: center;
223
+ justify-content: center;
224
+ }
225
+
226
+ .cover {
227
+ position: absolute;
228
+ top: 0;
229
+ left: 0;
230
+ width: 100%;
231
+ height: 100%;
232
+ pointer-events: none;
233
+ }
234
+
235
+ .slot.interaction-prompt {
236
+ display: var(--interaction-prompt-display, flex);
237
+ overflow: hidden;
238
+ opacity: 0;
239
+ will-change: opacity;
240
+ transition: opacity 0.3s;
241
+ }
242
+
243
+ .slot.interaction-prompt.visible {
244
+ opacity: 1;
245
+ }
246
+
247
+ .animated-container {
248
+ will-change: transform, opacity;
249
+ opacity: 0;
250
+ transition: opacity 0.3s;
251
+ }
252
+
253
+ .slot.interaction-prompt > * {
254
+ pointer-events: none;
255
+ }
256
+
257
+ .slot.ar-button {
258
+ -moz-user-select: none;
259
+ -webkit-tap-highlight-color: transparent;
260
+ user-select: none;
261
+
262
+ display: var(--ar-button-display, block);
263
+ }
264
+
265
+ .slot.ar-button:not(.enabled) {
266
+ display: none;
267
+ }
268
+
269
+ .fab {
270
+ display: flex;
271
+ align-items: center;
272
+ justify-content: center;
273
+ box-sizing: border-box;
274
+ width: 40px;
275
+ height: 40px;
276
+ cursor: pointer;
277
+ background-color: #fff;
278
+ box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15);
279
+ border-radius: 100px;
280
+ }
281
+
282
+ .fab > * {
283
+ opacity: 0.87;
284
+ }
285
+
286
+ #default-ar-button {
287
+ position: absolute;
288
+ bottom: 16px;
289
+ right: 16px;
290
+ transform: scale(var(--ar-button-scale, 1));
291
+ transform-origin: bottom right;
292
+ }
293
+
294
+ .slot.pan-target {
295
+ display: block;
296
+ position: absolute;
297
+ width: 0;
298
+ height: 0;
299
+ left: 50%;
300
+ top: 50%;
301
+ transform: translate3d(-50%, -50%, 0);
302
+ background-color: transparent;
303
+ opacity: 0;
304
+ transition: opacity 0.3s;
305
+ }
306
+
307
+ #default-pan-target {
308
+ width: 6px;
309
+ height: 6px;
310
+ border-radius: 6px;
311
+ border: 1px solid white;
312
+ box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.8);
313
+ }
314
+
315
+ .slot.default {
316
+ pointer-events: none;
317
+ }
318
+
319
+ .slot.progress-bar {
320
+ pointer-events: none;
321
+ }
322
+
323
+ .slot.exit-webxr-ar-button {
324
+ pointer-events: none;
325
+ }
326
+
327
+ .slot.exit-webxr-ar-button:not(.enabled) {
328
+ display: none;
329
+ }
330
+
331
+ #default-exit-webxr-ar-button {
332
+ display: flex;
333
+ align-items: center;
334
+ justify-content: center;
335
+ position: absolute;
336
+ top: env(safe-area-inset-top, 16px);
337
+ right: 16px;
338
+ width: 40px;
339
+ height: 40px;
340
+ box-sizing: border-box;
341
+ }
342
+
343
+ #default-exit-webxr-ar-button > svg {
344
+ fill: #fff;
345
+ }
346
+ </style>
347
+ <div class="container">
348
+ <div class="userInput" tabindex="0" role="img"
349
+ aria-label="3D model">
350
+ <div class="slot canvas">
351
+ <slot name="canvas">
352
+ <canvas></canvas>
353
+ </slot>
354
+ </div>
355
+
356
+ </div>
357
+
358
+ <!-- NOTE(cdata): We need to wrap slots because browsers without ShadowDOM
359
+ will have their <slot> elements removed by ShadyCSS -->
360
+ <div class="slot poster">
361
+ <slot name="poster">
362
+ <button type="button" id="default-poster" aria-hidden="true" aria-label="Loading 3D model"></button>
363
+ </slot>
364
+ </div>
365
+
366
+ <div class="slot ar-button">
367
+ <slot name="ar-button">
368
+ <a id="default-ar-button" part="default-ar-button" class="fab"
369
+ tabindex="2"
370
+ role="button"
371
+ href="javascript:void(0);"
372
+ aria-label="View in your space">
373
+ ${ec}
374
+ </a>
375
+ </slot>
376
+ </div>
377
+
378
+ <div class="slot pan-target">
379
+ <slot name="pan-target">
380
+ <div id="default-pan-target">
381
+ </div>
382
+ </slot>
383
+ </div>
384
+
385
+ <div class="slot interaction-prompt cover centered">
386
+ <div id="prompt" class="animated-container">
387
+ <slot name="interaction-prompt" aria-hidden="true">
388
+ ${el}
389
+ </slot>
390
+ </div>
391
+ </div>
392
+
393
+ <div id="finger0" class="animated-container cover">
394
+ <slot name="finger0" aria-hidden="true">
395
+ </slot>
396
+ </div>
397
+ <div id="finger1" class="animated-container cover">
398
+ <slot name="finger1" aria-hidden="true">
399
+ </slot>
400
+ </div>
401
+
402
+ <div class="slot default">
403
+ <slot></slot>
404
+
405
+ <div class="slot progress-bar">
406
+ <slot name="progress-bar">
407
+ <div id="default-progress-bar" aria-hidden="true">
408
+ <div class="bar" part="default-progress-bar"></div>
409
+ </div>
410
+ </slot>
411
+ </div>
412
+
413
+ <div class="slot exit-webxr-ar-button">
414
+ <slot name="exit-webxr-ar-button">
415
+ <a id="default-exit-webxr-ar-button" part="default-exit-webxr-ar-button"
416
+ tabindex="3"
417
+ aria-label="Exit AR"
418
+ aria-hidden="true">
419
+ ${eo}
420
+ </a>
421
+ </slot>
422
+ </div>
423
+ </div>
424
+ </div>
425
+ <div class="screen-reader-only" role="region" aria-label="Live announcements">
426
+ <span id="status" role="status"></span>
427
+ </div>`;var eu=r(4515),ed=r(874),ep=r(3770);function ef(e,t,r){let i=r,n=new ed.Pq0;return e.updateWorldMatrix(!0,!0),e.traverseVisible(e=>{let{geometry:r}=e;if(void 0!==r){let{position:a}=r.attributes;if(void 0!==a)for(let r=0,s=a.count;r<s;r++)e.isMesh?e.getVertexPosition(r,n):n.fromBufferAttribute(a,r),e.isSkinnedMesh||n.applyMatrix4(e.matrixWorld),i=t(i,n)}}),i}var eg=r(387),em=r(6201),eA=r(3935),eb=r(1718),ev=r(8150);class ey extends ed.eaF{constructor(){super(void 0,new ed.V9B({depthWrite:!1})),this.height=0,this.radius=0,this.resolution=0,this.userData.noHit=!0}get map(){return this.material.map}set map(e){this.material.map=e}isUsable(){return this.height>0&&this.radius>0&&null!=this.geometry&&null!=this.map}updateGeometry(e=this.height,t=this.radius,r=128){(e!=this.height||t!=this.radius||r!=this.resolution)&&(this.height=e,this.radius=t,this.resolution=r,e>0&&t>0&&(this.geometry.dispose(),this.geometry=function(e,t,r){let i=new ed.Gu$(t,2*r,r);i.scale(1,1,-1);let n=i.getAttribute("position"),a=new ed.Pq0;for(let t=0;t<n.count;++t)if(a.fromBufferAttribute(n,t),a.y<0){let r=-(3*e)/2,i=a.y<r?-e/a.y:1-a.y*a.y/(3*r*r);a.multiplyScalar(i),a.toArray(n.array,3*t)}return n.needsUpdate=!0,i}(e,t,r)))}}var ex=r(5112);let eS={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
428
+
429
+ varying vec2 vUv;
430
+
431
+ void main() {
432
+
433
+ vUv = uv;
434
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
435
+
436
+ }`,fragmentShader:`
437
+
438
+ uniform sampler2D tDiffuse;
439
+ uniform float h;
440
+
441
+ varying vec2 vUv;
442
+
443
+ void main() {
444
+
445
+ vec4 sum = vec4( 0.0 );
446
+
447
+ sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;
448
+ sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;
449
+ sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;
450
+ sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;
451
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
452
+ sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;
453
+ sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;
454
+ sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;
455
+ sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;
456
+
457
+ gl_FragColor = sum;
458
+
459
+ }`},eE={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
460
+
461
+ varying vec2 vUv;
462
+
463
+ void main() {
464
+
465
+ vUv = uv;
466
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
467
+
468
+ }`,fragmentShader:`
469
+
470
+ uniform sampler2D tDiffuse;
471
+ uniform float v;
472
+
473
+ varying vec2 vUv;
474
+
475
+ void main() {
476
+
477
+ vec4 sum = vec4( 0.0 );
478
+
479
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;
480
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;
481
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;
482
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;
483
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
484
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;
485
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;
486
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;
487
+ sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;
488
+
489
+ gl_FragColor = sum;
490
+
491
+ }`};class ew extends ed.B69{constructor(e,t,r){super(),this.camera=new ed.qUd,this.renderTarget=null,this.renderTargetBlur=null,this.depthMaterial=new ed.CSG,this.horizontalBlurMaterial=new ed.BKk(eS),this.verticalBlurMaterial=new ed.BKk(eE),this.intensity=0,this.softness=1,this.boundingBox=new ed.NRn,this.size=new ed.Pq0,this.maxDimension=0,this.isAnimated=!1,this.needsUpdate=!1;const{camera:i}=this;i.rotation.x=Math.PI/2,i.left=-.5,i.right=.5,i.bottom=-.5,i.top=.5,this.add(i);const n=new ed.bdM,a=new ed.V9B({opacity:1,transparent:!0,side:1});this.floor=new ed.eaF(n,a),this.floor.userData.noHit=!0,i.add(this.floor),this.blurPlane=new ed.eaF(n),this.blurPlane.visible=!1,i.add(this.blurPlane),e.target.add(this),this.depthMaterial.onBeforeCompile=function(e){e.fragmentShader=e.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * opacity );")},this.depthMaterial.side=2,this.horizontalBlurMaterial.depthTest=!1,this.verticalBlurMaterial.depthTest=!1,this.setScene(e,t,r)}setScene(e,t,r){let{boundingBox:i,size:n,rotation:a,position:s}=this;if(this.isAnimated=e.animationNames.length>0,this.boundingBox.copy(e.boundingBox),this.size.copy(e.size),this.maxDimension=Math.max(n.x,n.y,n.z)*(this.isAnimated?2:1),this.boundingBox.getCenter(s),"back"===r){let{min:e,max:t}=i;[e.y,e.z]=[e.z,e.y],[t.y,t.z]=[t.z,t.y],[n.y,n.z]=[n.z,n.y],a.x=Math.PI/2,a.y=Math.PI}else a.x=0,a.y=0;if(this.isAnimated){let e=i.min.y,t=i.max.y;n.y=this.maxDimension,i.expandByVector(n.subScalar(this.maxDimension).multiplyScalar(-.5)),i.min.y=e,i.max.y=t,n.set(this.maxDimension,t-e,this.maxDimension)}"bottom"===r?s.y=i.min.y:s.z=i.min.y,this.setSoftness(t)}setSoftness(e){this.softness=e;let{size:t,camera:r}=this,i=this.isAnimated?2:1,n=i*Math.pow(2,9-3*e);this.setMapSize(n);let a=t.y/2,s=t.y*i;r.near=0,r.far=(1-e)*s+e*a,this.depthMaterial.opacity=1/e,r.updateProjectionMatrix(),this.setIntensity(this.intensity),this.setOffset(0)}setMapSize(e){let{size:t}=this;this.isAnimated&&(e*=2);let r=Math.floor(t.x>t.z?e:e*t.x/t.z),i=Math.floor(t.x>t.z?e*t.z/t.x:e),n=10+r,a=10+i;if(null!=this.renderTarget&&(this.renderTarget.width!==n||this.renderTarget.height!==a)&&(this.renderTarget.dispose(),this.renderTarget=null,this.renderTargetBlur.dispose(),this.renderTargetBlur=null),null==this.renderTarget){let e={format:1023};this.renderTarget=new ed.nWS(n,a,e),this.renderTargetBlur=new ed.nWS(n,a,e),this.floor.material.map=this.renderTarget.texture}this.camera.scale.set(t.x*(1+10/r),t.z*(1+10/i),1),this.needsUpdate=!0}setIntensity(e){if(this.intensity=e,e>0){var t;this.visible=!0,this.floor.visible=!0,this.floor.material.opacity=e*((1-(t=this.softness*this.softness))*.3+ +t)}else this.visible=!1,this.floor.visible=!1}getIntensity(){return this.intensity}setOffset(e){this.floor.position.z=-e+this.gap()}gap(){return .001*this.maxDimension}render(e,t){t.overrideMaterial=this.depthMaterial;let r=e.getClearAlpha();e.setClearAlpha(0),this.floor.visible=!1;let i=e.xr.enabled;e.xr.enabled=!1;let n=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.render(t,this.camera),t.overrideMaterial=null,this.floor.visible=!0,this.blurShadow(e),e.xr.enabled=i,e.setRenderTarget(n),e.setClearAlpha(r)}blurShadow(e){let{camera:t,horizontalBlurMaterial:r,verticalBlurMaterial:i,renderTarget:n,renderTargetBlur:a,blurPlane:s}=this;s.visible=!0,s.material=r,r.uniforms.h.value=1/this.renderTarget.width,r.uniforms.tDiffuse.value=this.renderTarget.texture,e.setRenderTarget(a),e.render(s,t),s.material=i,i.uniforms.v.value=1/this.renderTarget.height,i.uniforms.tDiffuse.value=this.renderTargetBlur.texture,e.setRenderTarget(n),e.render(s,t),s.visible=!1}dispose(){null!=this.renderTarget&&this.renderTarget.dispose(),null!=this.renderTargetBlur&&this.renderTargetBlur.dispose(),this.depthMaterial.dispose(),this.horizontalBlurMaterial.dispose(),this.verticalBlurMaterial.dispose(),this.floor.material.dispose(),this.floor.geometry.dispose(),this.blurPlane.geometry.dispose(),this.removeFromParent()}}let e_=new ed.Pq0,eC=new ed.Pq0,eM=new ed.Pq0,eI=new ed.tBo,eT=new ed.Pq0,eR=new ed.I9Y;class eB extends ed.Z58{constructor({canvas:e,element:t,width:r,height:i}){super(),this.annotationRenderer=new ep.B,this.effectRenderer=null,this.schemaElement=document.createElement("script"),this.width=1,this.height=1,this.aspect=1,this.scaleStep=0,this.renderCount=0,this.externalRenderer=null,this.appendedAnimations=[],this.markedAnimations=[],this.camera=new ed.ubm(45,1,.1,100),this.xrCamera=null,this.url=null,this.pivot=new ed.B69,this.target=new ed.B69,this.animationNames=[],this.boundingBox=new ed.NRn,this.boundingSphere=new ed.iyt,this.size=new ed.Pq0,this.idealAspect=0,this.framedFoVDeg=0,this.shadow=null,this.shadowIntensity=0,this.shadowSoftness=1,this.bakedShadows=new Set,this.exposure=1,this.toneMapping=7,this.canScale=!0,this.isDirty=!1,this.goalTarget=new ed.Pq0,this.targetDamperX=new ev.A,this.targetDamperY=new ev.A,this.targetDamperZ=new ev.A,this._currentGLTF=null,this._model=null,this.cancelPendingSourceChange=null,this.animationsByName=new Map,this.currentAnimationAction=null,this.groundedSkybox=new ey,this.name="ModelScene",this.element=t,this.canvas=e,this.camera=new ed.ubm(45,1,.1,100),this.camera.name="MainCamera",this.add(this.pivot),this.pivot.name="Pivot",this.pivot.add(this.target),this.setSize(r,i),this.target.name="Target",this.mixer=new ed.Iw4(this.target);const{domElement:n}=this.annotationRenderer,{style:a}=n;a.display="none",a.pointerEvents="none",a.position="absolute",a.top="0",this.element.shadowRoot.querySelector(".default").appendChild(n),this.schemaElement.setAttribute("type","application/ld+json")}get context(){return this.canvas.getContext("2d")}getCamera(){return null!=this.xrCamera?this.xrCamera:this.camera}queueRender(){this.isDirty=!0}shouldRender(){return this.isDirty}hasRendered(){this.isDirty=!1}forceRescale(){this.scaleStep=-1,this.queueRender()}async setObject(e){this.reset(),this._model=e,this.target.add(e),await this.setupScene()}async setSource(e,t=()=>{}){let r;if(!e||e===this.url)return void t(1);if(this.reset(),this.url=e,null!=this.externalRenderer){let e=await this.externalRenderer.load(t);this.boundingSphere.radius=e.framedRadius,this.idealAspect=e.fieldOfViewAspect;return}null!=this.cancelPendingSourceChange&&(this.cancelPendingSourceChange(),this.cancelPendingSourceChange=null);try{r=await new Promise((r,i)=>{this.cancelPendingSourceChange=()=>i(),(async()=>{try{let i=await this.element[tt].loader.load(e,this.element,t);r(i)}catch(e){i(e)}})()})}catch(e){if(null==e)return;throw e}this.cancelPendingSourceChange=null,this.reset(),this.url=e,this._currentGLTF=r,null!=r&&(this._model=r.scene,this.target.add(r.scene));let{animations:i}=r,n=new Map,a=[];for(let e of i)n.set(e.name,e),a.push(e.name);this.animations=i,this.animationsByName=n,this.animationNames=a,await this.setupScene()}async setupScene(){this.applyTransform(),this.updateBoundingBox(),await this.updateFraming(),this.updateShadow(),this.setShadowIntensity(this.shadowIntensity),this.setGroundedSkybox()}reset(){this.url=null,this.renderCount=0,this.queueRender(),null!=this.shadow&&this.shadow.setIntensity(0),this.bakedShadows.clear();let{_model:e}=this;null!=e&&(e.removeFromParent(),this._model=null);let t=this._currentGLTF;null!=t&&(t.dispose(),this._currentGLTF=null),null!=this.currentAnimationAction&&(this.currentAnimationAction.stop(),this.currentAnimationAction=null),this.mixer.stopAllAction(),this.mixer.uncacheRoot(this)}dispose(){this.reset(),null!=this.shadow&&(this.shadow.dispose(),this.shadow=null),this.element[eg.BI]=null,this.element[eg.Z7]=null,this.element[eg.o7]=null}get currentGLTF(){return this._currentGLTF}setSize(e,t){if(this.width!==e||this.height!==t){if(this.width=Math.max(e,1),this.height=Math.max(t,1),this.annotationRenderer.setSize(e,t),this.aspect=this.width/this.height,null!=this.externalRenderer){let r=window.devicePixelRatio;this.externalRenderer.resize(e*r,t*r)}this.queueRender()}}markBakedShadow(e){e.userData.noHit=!0,this.bakedShadows.add(e)}unmarkBakedShadow(e){e.userData.noHit=!1,e.visible=!0,this.bakedShadows.delete(e),this.boundingBox.expandByObject(e)}findBakedShadows(e){let t=new ed.NRn;e.traverse(e=>{if(!e.material||!e.material.transparent)return;t.setFromObject(e);let r=t.getSize(eT),i=Math.min(r.x,r.y,r.z);Math.max(r.x,r.y,r.z)<100*i||this.markBakedShadow(e)})}checkBakedShadows(){let{min:e,max:t}=this.boundingBox,r=new ed.NRn;for(let i of(this.boundingBox.getSize(this.size),this.bakedShadows))r.setFromObject(i),(!(r.min.y<e.y+this.size.y/100)||!(r.min.x<=e.x)||!(r.max.x>=t.x)||!(r.min.z<=e.z)||!(r.max.z>=t.z))&&(r.min.z<e.z+this.size.z/100&&r.min.x<=e.x&&r.max.x>=t.x&&r.min.y<=e.y&&r.max.y>=t.y||this.unmarkBakedShadow(i))}applyTransform(){let{model:e}=this;if(null==e)return;let t=(0,eb.$y)(this.element.orientation)[0].terms,r=(0,eA.cg)(t[0]).number,i=(0,eA.cg)(t[1]).number,n=(0,eA.cg)(t[2]).number;e.quaternion.setFromEuler(new ed.O9p(i,n,r,"YXZ"));let a=(0,eb.$y)(this.element.scale)[0].terms;e.scale.set(a[0].number,a[1].number,a[2].number)}updateBoundingBox(){let{model:e}=this;if(null==e)return;this.target.remove(e),this.findBakedShadows(e);let t=(e,t)=>e.expandByPoint(t);this.setBakedShadowVisibility(!1),this.boundingBox=ef(e,t,new ed.NRn),this.boundingBox.isEmpty()&&(this.setBakedShadowVisibility(!0),this.bakedShadows.forEach(e=>this.unmarkBakedShadow(e)),this.boundingBox=ef(e,t,new ed.NRn)),this.checkBakedShadows(),this.setBakedShadowVisibility(),this.boundingBox.getSize(this.size),this.target.add(e)}async updateFraming(){let{model:e}=this;if(null==e)return;this.target.remove(e),this.setBakedShadowVisibility(!1);let{center:t}=this.boundingSphere;this.element.requestUpdate("cameraTarget"),await this.element.updateComplete,t.copy(this.getTarget()),this.boundingSphere.radius=Math.sqrt(ef(e,(e,r)=>Math.max(e,t.distanceToSquared(r)),0));let r=(e,r)=>(r.sub(t),Math.max(e,Math.sqrt(r.x*r.x+r.z*r.z)/(this.idealCameraDistance()-Math.abs(r.y))));this.idealAspect=ef(e,r,0)/Math.tan(this.framedFoVDeg/2*Math.PI/180),this.setBakedShadowVisibility(),this.target.add(e)}setBakedShadowVisibility(e=this.shadowIntensity<=0){for(let t of this.bakedShadows)t.visible=e}idealCameraDistance(){let e=this.framedFoVDeg/2*Math.PI/180;return this.boundingSphere.radius/Math.sin(e)}adjustedFoV(e){return 2*Math.atan(Math.tan(e/2*Math.PI/180)*Math.max(1,this.idealAspect/this.aspect))*180/Math.PI}getNDC(e,t){if(null!=this.xrCamera)eR.set(e/window.screen.width,t/window.screen.height);else{let r=this.element.getBoundingClientRect();eR.set((e-r.x)/this.width,(t-r.y)/this.height)}return eR.multiplyScalar(2).subScalar(1),eR.y*=-1,eR}getSize(){return{width:this.width,height:this.height}}setEnvironmentAndSkybox(e,t){this.element[tt].arRenderer.presentedScene!==this&&(this.environment=e,this.setBackground(t),this.queueRender())}setBackground(e){this.groundedSkybox.map=e,this.groundedSkybox.isUsable()?(this.target.add(this.groundedSkybox),this.background=null):(this.target.remove(this.groundedSkybox),this.background=e)}farRadius(){return this.boundingSphere.radius*(null!=this.groundedSkybox.parent?10:1)}setGroundedSkybox(){let e=(0,eb.$y)(this.element.skyboxHeight)[0].terms[0],t=(0,eA.cg)(e).number,r=10*this.boundingSphere.radius;this.groundedSkybox.updateGeometry(t,r),this.groundedSkybox.position.y=t-(this.shadow?2*this.shadow.gap():0),this.setBackground(this.groundedSkybox.map)}setTarget(e,t,r){this.goalTarget.set(-e,-t,-r)}setTargetDamperDecayTime(e){this.targetDamperX.setDecayTime(e),this.targetDamperY.setDecayTime(e),this.targetDamperZ.setDecayTime(e)}getTarget(){return this.goalTarget.clone().multiplyScalar(-1)}getDynamicTarget(){return this.target.position.clone().multiplyScalar(-1)}jumpToGoal(){this.updateTarget(1e4)}updateTarget(e){let t=this.goalTarget,r=this.target.position;if(t.equals(r))return!1;{let i=this.boundingSphere.radius/10,{x:n,y:a,z:s}=r;return n=this.targetDamperX.update(n,t.x,e,i),a=this.targetDamperY.update(a,t.y,e,i),s=this.targetDamperZ.update(s,t.z,e,i),this.groundedSkybox.position.x=-n,this.groundedSkybox.position.z=-s,this.target.position.set(n,a,s),this.target.updateMatrixWorld(),this.queueRender(),!0}}pointTowards(e,t){let{x:r,z:i}=this.position;this.yaw=Math.atan2(e-r,t-i)}get model(){return this._model}set yaw(e){this.pivot.rotation.y=e,this.groundedSkybox.rotation.y=-e,this.queueRender()}get yaw(){return this.pivot.rotation.y}set animationTime(e){this.mixer.setTime(e),this.queueShadowRender()}get animationTime(){if(null!=this.currentAnimationAction){let e=Math.max(this.currentAnimationAction._loopCount,0);return 2202===this.currentAnimationAction.loop&&(1&e)==1?this.duration-this.currentAnimationAction.time:this.currentAnimationAction.time}return 0}set animationTimeScale(e){this.mixer.timeScale=e}get animationTimeScale(){return this.mixer.timeScale}get duration(){return null!=this.currentAnimationAction&&this.currentAnimationAction.getClip()?this.currentAnimationAction.getClip().duration:0}get hasActiveAnimation(){return null!=this.currentAnimationAction}playAnimation(e=null,t=0,r=2201,i=1/0){if(null==this._currentGLTF)return;let{animations:n}=this;if(null==n||0===n.length)return;let a=null;if(null!=e&&null==(a=this.animationsByName.get(e))){let t=parseInt(e);!isNaN(t)&&t>=0&&t<n.length&&(a=n[t])}null==a&&(a=n[0]);try{let{currentAnimationAction:e}=this,n=this.mixer.clipAction(a,this);this.currentAnimationAction=n,this.element.paused?this.mixer.stopAllAction():(n.paused=!1,null!=e&&n!==e?n.crossFadeFrom(e,t,!1):this.animationTimeScale>0&&this.animationTime==this.duration&&(this.animationTime=0)),n.setLoop(r,i),n.enabled=!0,n.clampWhenFinished=!0,n.play()}catch(e){console.error(e)}}appendAnimation(e="",t=2201,r=1/0,i=1,n=1,a=!1,s=!1,o=!0,l=null,c=!1){if(null==this._currentGLTF||e===this.element.animationName)return;let{animations:h}=this;if(null==h||0===h.length)return;let u=e?this.animationsByName.get(e):null;if(null==u)return;if("string"==typeof r?isNaN(parseFloat(r))?(r=1/0,console.warn(`Invalid repetitionCount value: ${r}. Using default: Infinity`)):(1>parseInt(r)&&console.warn(`Invalid repetitionCount value: ${r}. Using 1 as minimum.`),r=Math.max(parseInt(r),1)):"number"==typeof r&&r<1?(r=1,console.warn(`Invalid repetitionCount value: ${r}. Using 1 value as minimum.`)):console.warn(`Invalid repetitionCount value: ${r}. Using default: Infinity`),1===r&&2200!==t&&(t=2200),"string"==typeof i){let e=parseFloat(i);isNaN(e)||e<0||e>1?(i=1,console.warn(`Invalid weight value: ${i}. Using default: 1`)):i=e}if("string"==typeof n){let e=parseFloat(n);isNaN(e)||e<0?(n=1,console.warn(`Invalid timeScale value: ${n}. Using default: 1`)):n=e}if("string"==typeof l){let e=parseFloat(l);isNaN(e)?(l=null,console.warn(`Invalid time value: ${l}. Using default: 0 or previous time`)):l=e}let{shouldFade:d,duration:p}=this.parseFadeValue(a,!1,1.25),f=!1,g=0;"boolean"==typeof s?(f=s,g=1.25*!!s):"number"==typeof s?(f=s>0,g=Math.max(s,0),s<0&&console.warn(`Invalid warp value: ${s}. Using default: false`)):"string"==typeof s&&("true"===s.toLowerCase().trim()?(f=!0,g=1.25):"false"===s.toLowerCase().trim()?f=!1:isNaN(parseFloat(s))?console.warn(`Invalid warp value: ${s}. Using default: false`):(f=(g=Math.max(parseFloat(s),0))>0,g<=0&&console.warn(`Invalid warp value: ${s}. Using default: false`)));try{let a=this.mixer.existingAction(u)||this.mixer.clipAction(u,this),s=a.timeScale;c&&this.appendedAnimations.includes(e)&&!this.markedAnimations.map(e=>e.name).includes(e)&&this.markedAnimations.push({name:e,loopMode:t,repetitionCount:r}),"number"==typeof l&&(a.time=Math.min(Math.max(l,0),u.duration)),d?a.fadeIn(p):i>=0&&(a.weight=Math.min(Math.max(i,0),1)),f?a.warp(o?s:0,n,g):a.timeScale=n,a.isRunning()||(a.time==u.duration&&a.stop(),a.setLoop(t,r),a.paused=!1,a.enabled=!0,a.clampWhenFinished=!0,a.play()),this.appendedAnimations.includes(e)||this.element[e8].appendedAnimations.push(e)}catch(e){console.error(e)}}parseFadeValue(e,t=!0,r=1.5){if("boolean"==typeof e)return{shouldFade:e,duration:e?r:0};if("number"==typeof e){let t=Math.max(e,0);return{shouldFade:t>0,duration:t}}if("string"==typeof e){let t=e.toLowerCase().trim();if("true"===t)return{shouldFade:!0,duration:r};if("false"===t)return{shouldFade:!1,duration:0};let i=parseFloat(t);if(!isNaN(i)){let e=Math.max(i,0);return{shouldFade:e>0,duration:e}}}return console.warn(`Invalid fade value: ${e}. Using default: ${t}`),{shouldFade:t,duration:t?r:0}}detachAnimation(e="",t=!0){if(null==this._currentGLTF||e===this.element.animationName)return;let{animations:r}=this;if(null==r||0===r.length)return;let i=e?this.animationsByName.get(e):null;if(null==i)return;let{shouldFade:n,duration:a}=this.parseFadeValue(t,!0,1.5);try{let t=this.mixer.existingAction(i)||this.mixer.clipAction(i,this);n?t.fadeOut(a):t.stop(),this.element[e8].appendedAnimations=this.element[e8].appendedAnimations.filter(t=>t!==e)}catch(e){console.error(e)}}updateAnimationLoop(e="",t=2201,r=1/0){if(null==this._currentGLTF||e===this.element.animationName)return;let{animations:i}=this;if(null==i||0===i.length)return;let n=null;if(e&&(n=this.animationsByName.get(e)),null!=n)try{let e=this.mixer.existingAction(n)||this.mixer.clipAction(n,this);e.stop(),e.setLoop(t,r),e.play()}catch(e){console.error(e)}}stopAnimation(){this.currentAnimationAction=null,this.mixer.stopAllAction()}updateAnimation(e){this.mixer.update(e),this.queueShadowRender()}subscribeMixerEvent(e,t){this.mixer.addEventListener(e,t)}updateShadow(){let e=this.shadow;if(null!=e){let t="wall"===this.element.arPlacement?"back":"bottom";e.setScene(this,this.shadowSoftness,t),e.needsUpdate=!0}}renderShadow(e){let t=this.shadow;null!=t&&!0==t.needsUpdate&&(t.render(e,this),t.needsUpdate=!1)}queueShadowRender(){null!=this.shadow&&(this.shadow.needsUpdate=!0)}setShadowIntensity(e){if((this.shadowIntensity=e,null!=this._currentGLTF)&&(this.setBakedShadowVisibility(),!(e<=0)||null!=this.shadow)){if(null==this.shadow){let e="wall"===this.element.arPlacement?"back":"bottom";this.shadow=new ew(this,this.shadowSoftness,e)}this.shadow.setIntensity(e)}}setShadowSoftness(e){this.shadowSoftness=e;let t=this.shadow;null!=t&&t.setSoftness(e)}setShadowOffset(e){let t=this.shadow;null!=t&&t.setOffset(e)}getHit(e=this){return eI.intersectObject(e,!0).find(e=>e.object.visible&&!e.object.userData.noHit)}hitFromController(e,t=this){return eI.setFromXRController(e),this.getHit(t)}hitFromPoint(e,t=this){return eI.setFromCamera(e,this.getCamera()),this.getHit(t)}positionAndNormalFromPoint(e,t=this){var r;let i=this.hitFromPoint(e,t);if(null==i)return null;let n=i.point;return{position:n,normal:null!=i.face?i.face.normal.clone().applyNormalMatrix(new ed.dwI().getNormalMatrix(i.object.matrixWorld)):eI.ray.direction.clone().multiplyScalar(-1),uv:null!=(r=i.uv)?r:null}}surfaceFromPoint(e,t=this){let r=this.element.model;if(null==r)return null;let i=this.hitFromPoint(e,t);if(null==i||null==i.face)return null;let{meshes:n,primitives:a}=r[em.jQ](i).mesh.userData.associations,s=new ed.Pq0,o=new ed.Pq0,l=new ed.Pq0,{a:c,b:h,c:u}=i.face,d=i.object;d.getVertexPosition(c,s),d.getVertexPosition(h,o),d.getVertexPosition(u,l);let p=new ed.lMl(s,o,l),f=new ed.Pq0;return p.getBarycoord(d.worldToLocal(i.point),f),`${n} ${a} ${c} ${h} ${u} ${f.x.toFixed(3)} ${f.y.toFixed(3)} ${f.z.toFixed(3)}`}addHotspot(e){this.target.add(e),this.annotationRenderer.domElement.appendChild(e.element),this.updateSurfaceHotspot(e)}removeHotspot(e){this.target.remove(e)}forHotspots(e){let{children:t}=this.target;for(let r=0,i=t.length;r<i;r++){let i=t[r];i instanceof ex.Y&&e(i)}}updateSurfaceHotspot(e){if(null==e.surface||null==this.element.model)return;let t=(0,eb.$y)(e.surface)[0].terms;if(8!=t.length)return void console.warn(e.surface+" does not have exactly 8 numbers.");let r=this.element.model[em.Tt](t[0].number,t[1].number);if(null==r)return void console.warn(e.surface+" does not match a node/primitive in this glTF! Skipping this hotspot.");let i=r.mesh.geometry.attributes.position.count,n=new ed.Pq0(t[2].number,t[3].number,t[4].number);if(n.x>=i||n.y>=i||n.z>=i)return void console.warn(e.surface+" vertex indices out of range in this glTF! Skipping this hotspot.");let a=new ed.Pq0(t[5].number,t[6].number,t[7].number);e.mesh=r.mesh,e.tri=n,e.bary=a,e.updateSurface()}animateSurfaceHotspots(){this.element.paused||this.forHotspots(e=>{e.updateSurface()})}updateHotspotsVisibility(e){this.forHotspots(t=>{e_.copy(e),eC.setFromMatrixPosition(t.matrixWorld),e_.sub(eC),eM.copy(t.normal).transformDirection(this.target.matrixWorld),0>e_.dot(eM)?t.hide():t.show()})}orientHotspots(e){this.forHotspots(t=>{t.orient(e)})}setHotspotsVisibility(e){this.forHotspots(t=>{t.visible=e})}updateSchema(e){var t;let{schemaElement:r,element:i}=this,{alt:n,poster:a,iosSrc:s}=i;if(null!=e){let i=[{"@type":"MediaObject",contentUrl:e,encodingFormat:(null==(t=e.split(".").pop())?void 0:t.toLowerCase())==="gltf"?"model/gltf+json":"model/gltf-binary"}];s&&i.push({"@type":"MediaObject",contentUrl:s,encodingFormat:"model/vnd.usdz+zip"}),r.textContent=JSON.stringify({"@context":"http://schema.org/","@type":"3DModel",image:null!=a?a:void 0,name:null!=n?n:void 0,encoding:i}),document.head.appendChild(r)}else null!=r.parentElement&&r.parentElement.removeChild(r)}}var ek=r(5827),eP=r(1535);class eD extends EventTarget{constructor(){super(...arguments),this.ongoingActivities=new Set,this.totalProgress=0}get ongoingActivityCount(){return this.ongoingActivities.size}beginActivity(e){let t={progress:0,completed:!1};return this.ongoingActivities.add(t),1===this.ongoingActivityCount&&this.announceTotalProgress(t,0,e),r=>{let i;return(i=Math.max((0,eP.qE)(r,0,1),t.progress))!==t.progress&&this.announceTotalProgress(t,i,e),t.progress}}announceTotalProgress(e,t,r){let i=0,n=0;for(let r of(1==t&&(e.completed=!0),this.ongoingActivities)){let{progress:e}=r;i+=1-e,r.completed&&n++}let a=e.progress;e.progress=t,this.totalProgress+=(t-a)*(1-this.totalProgress)/i;let s=n===this.ongoingActivityCount?1:this.totalProgress;this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:s,reason:r}})),n===this.ongoingActivityCount&&(this.totalProgress=0,this.ongoingActivities.clear())}}var eL=function(e,t,r,i){var n,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,r,s):n(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};let eF=document.createElement("canvas"),eN=Symbol("fallbackResizeHandler"),eU=Symbol("defaultAriaLabel"),eO=Symbol("resizeObserver"),eQ=Symbol("clearModelTimeout"),ez=Symbol("onContextLost"),eH=Symbol("loaded"),eG=Symbol("status"),eV=Symbol("onFocus"),ej=Symbol("onBlur"),eq=Symbol("updateSize"),eW=Symbol("intersectionObserver"),eX=Symbol("isElementInViewport"),eY=Symbol("announceModelVisibility"),eK=Symbol("ariaLabel"),e$=Symbol("altDefaulted"),eJ=Symbol("statusElement"),eZ=Symbol("updateStatus"),e0=Symbol("loadedTime"),e1=Symbol("updateSource"),e2=Symbol("markLoaded"),e3=Symbol("container"),e5=Symbol("input"),e4=Symbol("canvas"),e8=Symbol("scene"),e9=Symbol("needsRender"),e6=Symbol("tick"),e7=Symbol("onModelLoad"),te=Symbol("onResize"),tt=Symbol("renderer"),tr=Symbol("progressTracker"),ti=Symbol("getLoaded"),tn=Symbol("getModelIsVisible"),ta=Symbol("shouldAttemptPreload"),ts=e=>({x:e.x,y:e.y,z:e.z,toString(){return`${this.x}m ${this.y}m ${this.z}m`}}),to=e=>({u:e.x,v:e.y,toString(){return`${this.u} ${this.v}`}});class tl extends m.mN{static get is(){return"model-viewer"}static set modelCacheSize(e){eu.IZ[eu.UV].evictionThreshold=e}static get modelCacheSize(){return eu.IZ[eu.UV].evictionThreshold}static set minimumRenderScale(e){e>1&&console.warn("<model-viewer> minimumRenderScale has been clamped to a maximum value of 1."),e<=0&&console.warn("<model-viewer> minimumRenderScale has been clamped to a minimum value of 0.25."),ek.A.singleton.minScale=e}static get minimumRenderScale(){return ek.A.singleton.minScale}get loaded(){return this[ti]()}get[(i=eX,n=eH,a=e0,s=eG,o=eQ,l=eN,c=eY,h=eO,u=eW,d=tr,tt)](){return ek.A.singleton}get modelIsVisible(){return this[tn]()}constructor(){let e,t;super(),this.alt=null,this.src=null,this.withCredentials=!1,this.generateSchema=!1,this[i]=!1,this[n]=!1,this[a]=0,this[s]="",this[o]=null,this[l]=(0,eP.sg)(()=>{let e=this.getBoundingClientRect();this[eq](e)},50),this[c]=(0,eP.sg)(e=>{let t=this.modelIsVisible;t!==e&&this.dispatchEvent(new CustomEvent("model-visibility",{detail:{visible:t}}))},0),this[h]=null,this[u]=null,this[d]=new eD,this[p]=()=>{this[eJ].textContent=this[eG]},this[f]=()=>{this[eJ].textContent=""},this[g]=e=>{this.dispatchEvent(new CustomEvent("error",{detail:{type:"webglcontextlost",sourceError:e.sourceEvent}}))},this.attachShadow({mode:"open"});const r=this.shadowRoot;if((e=>{ee(eh,e)})(r),this[e3]=r.querySelector(".container"),this[e5]=r.querySelector(".userInput"),this[e4]=r.querySelector("canvas"),this[eJ]=r.querySelector("#status"),this[eU]=this[e5].getAttribute("aria-label"),this.isConnected){const r=this.getBoundingClientRect();e=r.width,t=r.height}else e=300,t=150;this[e8]=new eB({canvas:this[e4],element:this,width:e,height:t}),Promise.resolve().then(()=>{this[eq](this.getBoundingClientRect())}),ea.Xq&&(this[eO]=new ResizeObserver(e=>{if(!this[tt].isPresenting)for(let t of e)t.target===this&&this[eq](t.contentRect)})),ea.k$?this[eW]=new IntersectionObserver(e=>{for(let t of e)if(t.target===this){let e=this.modelIsVisible;this[eX]=t.isIntersecting,this[eY](e),this[eX]&&!this.loaded&&this[e1]()}},{root:null,rootMargin:"0px",threshold:1e-5}):this[eX]=!0}connectedCallback(){super.connectedCallback&&super.connectedCallback(),ea.Xq?this[eO].observe(this):self.addEventListener("resize",this[eN]),ea.k$&&this[eW].observe(this),this.addEventListener("focus",this[eV]),this.addEventListener("blur",this[ej]);let e=this[tt];e.addEventListener("contextlost",this[ez]),e.registerScene(this[e8]),null!=this[eQ]&&(self.clearTimeout(this[eQ]),this[eQ]=null,this.requestUpdate("src",null))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),ea.Xq?this[eO].unobserve(this):self.removeEventListener("resize",this[eN]),ea.k$&&this[eW].unobserve(this),this.removeEventListener("focus",this[eV]),this.removeEventListener("blur",this[ej]);let e=this[tt];e.removeEventListener("contextlost",this[ez]),e.unregisterScene(this[e8]),this[eQ]=self.setTimeout(()=>{this[e8].dispose(),this[eQ]=null},10)}updated(e){super.updated(e),e.has("src")&&(null==this.src?(this[eH]=!1,this[e0]=0,this[e8].reset()):this.src!==this[e8].url&&(this[eH]=!1,this[e0]=0,this[e1]())),e.has("alt")&&this[e5].setAttribute("aria-label",this[eK]),e.has("generateSchema")&&(this.generateSchema?this[e8].updateSchema(this.src):this[e8].updateSchema(null))}toDataURL(e,t){return this[tt].displayCanvas(this[e8]).toDataURL(e,t)}async toBlob(e){let t=e?e.mimeType:void 0,r=e?e.qualityArgument:void 0,i=e?e.idealAspect:void 0,{width:n,height:a,idealAspect:s,aspect:o}=this[e8],{dpr:l,scaleFactor:c}=this[tt],h=n*c*l,u=a*c*l,d=0,p=0;!0===i&&(s>o?p=(u-(u=Math.round(h/s)))/2:d=(h-(h=Math.round(u*s)))/2),eF.width=h,eF.height=u;try{return new Promise(async(e,i)=>{eF.getContext("2d").drawImage(this[tt].displayCanvas(this[e8]),d,p,h,u,0,0,h,u),eF.toBlob(t=>{if(!t)return i(Error("Unable to retrieve canvas blob"));e(t)},t,r)})}finally{this[eq]({width:n,height:a})}}registerEffectComposer(e){e.setRenderer(this[tt].threeRenderer),e.setMainCamera(this[e8].getCamera()),e.setMainScene(this[e8]),this[e8].effectRenderer=e}unregisterEffectComposer(){this[e8].effectRenderer=null}registerRenderer(e){this[e8].externalRenderer=e}unregisterRenderer(){this[e8].externalRenderer=null}get[eK](){return this[e$]}get[e$](){return null==this.alt||"null"===this.alt?this[eU]:this.alt}[ti](){return this[eH]}[tn](){return this.loaded&&this[eX]}[ta](){return!!this.src&&this[eX]}[eq]({width:e,height:t}){0!==e&&0!==t&&(this[e3].style.width=`${e}px`,this[e3].style.height=`${t}px`,this[te]({width:e,height:t}))}[e6](e,t){var r;null==(r=this[e8].effectRenderer)||r.beforeRender(e,t)}[e2](){this[eH]||(this[eH]=!0,this[e0]=performance.now())}[e9](){this[e8].queueRender()}[e7](){}[eZ](e){this[eG]=e;let t=this.getRootNode();null!=t&&t.activeElement===this&&this[eJ].textContent!=e&&(this[eJ].textContent=e)}[(p=eV,f=ej,te)](e){this[e8].setSize(e.width,e.height)}async [(g=ez,e1)](){let e=this[e8];if(this.loaded||!this[ta]()||this.src===e.url)return;this.generateSchema&&e.updateSchema(this.src),this[eZ]("Loading"),e.stopAnimation();let t=this[tr].beginActivity("model-load"),r=this.src;try{let i=e.setSource(r,e=>t(.95*(0,eP.qE)(e,0,1))),n=this[es.hj]();await Promise.all([i,n]),this[e2](),this[e7](),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("before-render"))}),await new Promise(e=>{let t=setTimeout(()=>{console.warn("rAF timed out in updateSource"),e()},500);requestAnimationFrame(()=>{requestAnimationFrame(()=>{clearTimeout(t),e()})})}),this.dispatchEvent(new CustomEvent("load",{detail:{url:r}}))}catch(e){this.dispatchEvent(new CustomEvent("error",{detail:{type:"loadfailure",sourceError:e}}))}finally{t(1)}}}eL([(0,en.MZ)({type:String})],tl.prototype,"alt",void 0),eL([(0,en.MZ)({type:String})],tl.prototype,"src",void 0),eL([(0,en.MZ)({type:Boolean,attribute:"with-credentials"})],tl.prototype,"withCredentials",void 0),eL([(0,en.MZ)({type:Boolean,attribute:"generate-schema"})],tl.prototype,"generateSchema",void 0)},3935(e,t,r){"use strict";let i,n;r.d(t,{cg:()=>l,tR:()=>s});var a=r(1718);let s=(e,t=0)=>{let{number:r,unit:i}=e;if(isFinite(r)){if("rad"===e.unit||null==e.unit)return e}else r=t,i="rad";return{type:"number",number:("deg"===i&&null!=r?r:0)*Math.PI/180,unit:"rad"}},o=(e,t=0)=>{let r,{number:i,unit:n}=e;if(isFinite(i)){if("m"===e.unit)return e}else i=t,n="m";switch(n){default:r=1;break;case"cm":r=.01;break;case"mm":r=.001}return{type:"number",number:r*i,unit:"m"}},l=(n={rad:i=e=>e,deg:s,m:i,mm:o,cm:o},(e,t=a.f2)=>{isFinite(e.number)||(e.number=t.number,e.unit=t.unit);let{unit:r}=e;if(null==r)return e;let i=n[r];return null==i?t:i(e)})},5978(e,t,r){"use strict";r.d(t,{bk:()=>_});var i,n,a,s=r(3935),o=r(1718);let l=Symbol("evaluate"),c=Symbol("lastValue");class h{constructor(){this[i]=null}static evaluatableFor(e,t=o.f2){if(e instanceof h)return e;if("number"===e.type)return"%"===e.unit?new p(e,t):e;switch(e.name.value){case"calc":return new b(e,t);case"env":return new g(e)}return o.f2}static evaluate(e){return e instanceof h?e.evaluate():e}static isConstant(e){return!(e instanceof h)||e.isConstant}static applyIntrinsics(e,t){let{basis:r,keywords:i}=t,{auto:n}=i;return r.map((t,r)=>{let a=null==n[r]?t:n[r],l=e[r]?e[r]:a;if("ident"===l.type){let e=l.value;e in i&&(l=i[e][r])}return((null==l||"ident"===l.type)&&(l=a),"%"===l.unit)?(0,o.sJ)(l.number/100*t.number,t.unit):(l=(0,s.cg)(l,t)).unit!==t.unit?t:l})}get isConstant(){return!1}evaluate(){return this.isConstant&&null!=this[c]||(this[c]=this[l]()),this[c]}}i=c;let u=Symbol("percentage"),d=Symbol("basis");class p extends h{constructor(e,t){super(),this[u]=e,this[d]=t}get isConstant(){return!0}[l](){return(0,o.sJ)(this[u].number/100*this[d].number,this[d].unit)}}let f=Symbol("identNode");class g extends h{constructor(e){super(),this[n]=null;const t=e.arguments.length?e.arguments[0].terms[0]:null;null!=t&&"ident"===t.type&&(this[f]=t)}get isConstant(){return!1}[(n=f,l)](){return null!=this[f]&&"window-scroll-y"===this[f].value?{type:"number",number:window.pageYOffset/(Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)-window.innerHeight)||0,unit:null}:o.f2}}let m=/[\*\/]/,A=Symbol("evaluator");class b extends h{constructor(e,t=o.f2){if(super(),this[a]=null,1!==e.arguments.length)return;const r=e.arguments[0].terms.slice(),i=[];for(;r.length;){const e=r.shift();if(i.length>0){const r=i[i.length-1];if("operator"===r.type&&m.test(r.value)){const r=i.pop(),n=i.pop();if(null==n)return;i.push(new S(r,h.evaluatableFor(n,t),h.evaluatableFor(e,t)));continue}}i.push("operator"===e.type?e:h.evaluatableFor(e,t))}for(;i.length>2;){const[e,r,n]=i.splice(0,3);if("operator"!==r.type)return;i.unshift(new S(r,h.evaluatableFor(e,t),h.evaluatableFor(n,t)))}1===i.length&&(this[A]=i[0])}get isConstant(){return null==this[A]||h.isConstant(this[A])}[(a=A,l)](){return null!=this[A]?h.evaluate(this[A]):o.f2}}let v=Symbol("operator"),y=Symbol("left"),x=Symbol("right");class S extends h{constructor(e,t,r){super(),this[v]=e,this[y]=t,this[x]=r}get isConstant(){return h.isConstant(this[y])&&h.isConstant(this[x])}[l](){let e,t=(0,s.cg)(h.evaluate(this[y])),r=(0,s.cg)(h.evaluate(this[x])),{number:i,unit:n}=t,{number:a,unit:l}=r;if(null!=l&&null!=n&&l!=n)return o.f2;switch(this[v].value){case"+":e=i+a;break;case"-":e=i-a;break;case"/":e=i/a;break;case"*":e=i*a;break;default:return o.f2}return{type:"number",number:e,unit:n||l}}}let E=Symbol("evaluatables"),w=Symbol("intrinsics");class _ extends h{constructor(e,t){super(),this[w]=t;const r=e[0],i=null!=r?r.terms:[];this[E]=t.basis.map((e,t)=>{let r=i[t];return null==r?{type:"ident",value:"auto"}:"ident"===r.type?r:h.evaluatableFor(r,e)})}get isConstant(){for(let e of this[E])if(!h.isConstant(e))return!1;return!0}[l](){let e=this[E].map(e=>h.evaluate(e));return h.applyIntrinsics(e,this[w]).map(e=>e.number)}}},1718(e,t,r){"use strict";let i,n,a,s,o,l,c,h,u;r.d(t,{$y:()=>p,PV:()=>y,f2:()=>x,sJ:()=>d});let d=(e,t)=>({type:"number",number:e,unit:t}),p=(i={},e=>{let t=e;if(t in i)return i[t];let r=[],n=0;for(;e;){if(++n>1e3){e="";break}let t=f(e),i=t.nodes[0];if(null==i||0===i.terms.length)break;r.push(i),e=t.remainingInput}return i[t]=r}),f=(n=/^(\-\-|[a-z\u0240-\uffff])/i,a=/^([\*\+\/]|[\-]\s)/i,s=/^[\),]/,e=>{let t=[];for(;e.length&&(e=e.trim(),!s.test(e));)if("("===e[0]){let{nodes:r,remainingInput:i}=b(e);e=i,t.push({type:"function",name:{type:"ident",value:"calc"},arguments:r})}else if(n.test(e)){let r=g(e),i=r.nodes[0];if("("===(e=r.remainingInput)[0]){let{nodes:r,remainingInput:n}=b(e);t.push({type:"function",name:i,arguments:r}),e=n}else t.push(i)}else if(a.test(e))t.push({type:"operator",value:e[0]}),e=e.slice(1);else{let{nodes:r,remainingInput:i}="#"===e[0]?A(e):m(e);if(0===r.length)break;t.push(r[0]),e=i}return{nodes:[{type:"expression",terms:t}],remainingInput:e}}),g=(o=/[^a-z0-9_\-\u0240-\uffff]/i,e=>{let t=e.match(o);return{nodes:[{type:"ident",value:null==t?e:e.substr(0,t.index)}],remainingInput:null==t?"":e.substr(t.index)}}),m=(l=/[\+\-]?(\d+[\.]\d+|\d+|[\.]\d+)([eE][\+\-]?\d+)?/,c=/^[a-z%]+/i,h=/^(m|mm|cm|rad|deg|[%])$/,e=>{let t=e.match(l),r=null==t?"0":t[0],i=(e=null==r?e:e.slice(r.length)).match(c),n=null!=i&&""!==i[0]?i[0]:null,a=null==i?e:e.slice(n.length);return null==n||h.test(n)||(n=null),{nodes:[{type:"number",number:parseFloat(r)||0,unit:n}],remainingInput:a}}),A=(u=/^[a-f0-9]*/i,e=>{let t=(e=e.slice(1).trim()).match(u);return{nodes:null==t?[]:[{type:"hex",value:t[0]}],remainingInput:null==t?e:e.slice(t[0].length)}}),b=e=>{let t=[];for(e=e.slice(1).trim();e.length;){let r=f(e);if(t.push(r.nodes[0]),","===(e=r.remainingInput.trim())[0])e=e.slice(1).trim();else if(")"===e[0]){e=e.slice(1);break}}return{nodes:t,remainingInput:e}},v=Symbol("visitedTypes");class y{constructor(e){this[v]=e}walk(e,t){let r=e.slice();for(;r.length;){let e=r.shift();switch(this[v].indexOf(e.type)>-1&&t(e),e.type){case"expression":r.unshift(...e.terms);break;case"function":r.unshift(e.name,...e.arguments)}}}}let x=Object.freeze({type:"number",number:0,unit:null})},3418(e,t,r){"use strict";r.d(t,{sF:()=>y,tu:()=>R,pH:()=>x});var i=r(874);class n{constructor(e,t,r,n,a){this.xrLight=e,this.renderer=t,this.lightProbe=r,this.xrWebGLBinding=null,this.estimationStartCallback=a,this.frameCallback=this.onXRFrame.bind(this);const s=t.xr.getSession();if(n&&"XRWebGLBinding"in window){e.environment=new i.o6l(16).texture;const r=t.getContext();switch(s.preferredReflectionFormat){case"srgba8":r.getExtension("EXT_sRGB");break;case"rgba16f":r.getExtension("OES_texture_half_float")}this.xrWebGLBinding=new XRWebGLBinding(s,r),this.lightProbe.addEventListener("reflectionchange",()=>{this.updateReflection()})}s.requestAnimationFrame(this.frameCallback)}updateReflection(){let e=this.renderer.properties.get(this.xrLight.environment);if(e){let t=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);t&&(e.__webglTexture=t,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(e,t){if(!this.xrLight)return;t.session.requestAnimationFrame(this.frameCallback);let r=t.getLightEstimate(this.lightProbe);if(r){this.xrLight.lightProbe.sh.fromArray(r.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;let e=Math.max(1,Math.max(r.primaryLightIntensity.x,Math.max(r.primaryLightIntensity.y,r.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(r.primaryLightIntensity.x/e,r.primaryLightIntensity.y/e,r.primaryLightIntensity.z/e),this.xrLight.directionalLight.intensity=e,this.xrLight.directionalLight.position.copy(r.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class a extends i.YJl{constructor(e,t=!0){super(),this.lightProbe=new i.FZo,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new i.ZyN,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let r=null,a=!1;e.xr.addEventListener("sessionstart",()=>{let i=e.xr.getSession();"requestLightProbe"in i&&i.requestLightProbe({reflectionFormat:i.preferredReflectionFormat}).then(i=>{r=new n(this,e,i,t,()=>{a=!0,this.dispatchEvent({type:"estimationstart"})})})}),e.xr.addEventListener("sessionend",()=>{r&&(r.dispose(),r=null),a&&this.dispatchEvent({type:"estimationend"})}),this.dispose=()=>{r&&(r.dispose(),r=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}var s=r(6526),o=r(1535),l=r(8150);let c={MIN_TOUCH_AREA:.05,BASE_RADIUS:.15,LINE_WIDTH:.02,SEGMENTS:16,DELTA_PHI:Math.PI/32,COLORS:{EDGE_FALLOFF:new i.Q1f(.98,.98,.98),EDGE_CUTOFF:new i.Q1f(.8,.8,.8),FILL_FALLOFF:new i.Q1f(.4,.4,.4),FILL_CUTOFF:new i.Q1f(.4,.4,.4),ACTIVE_EDGE:new i.Q1f(1,1,1),ACTIVE_FILL:new i.Q1f(.6,.6,.6)},MAX_OPACITY:.75,ACTIVE_OPACITY:.9,FILL_OPACITY_MULTIPLIER:.5,INTERACTIVE_OPACITY_MULTIPLIER:1.2,MIN_DISTANCE:.5,MAX_DISTANCE:10,BASE_SCALE:1,DISTANCE_SCALE_FACTOR:.3,FADE_IN_DURATION:.12,FADE_OUT_DURATION:.12,SIZE_UPDATE_DURATION:.05,COLOR_LERP_FACTOR:.15,SCREEN_SPACE_SCALE:1.2,SIZE_UPDATE_THRESHOLD:.001,GEOMETRY_UPDATE_DEBOUNCE:100},h=new i.I9Y,u=(e,t,r,i,n)=>{let a=t>0?r>0?0:-Math.PI/2:r>0?Math.PI/2:Math.PI;for(let s=0;s<=c.SEGMENTS;++s)e.push(t+(i-n)*Math.cos(a),r+(i-n)*Math.sin(a),0,t+i*Math.cos(a),r+i*Math.sin(a),0),a+=c.DELTA_PHI};class d extends i.eaF{constructor(e,t){super(new i.LoY),this.shadowHeight=0,this.isActive=!1,this.isHovered=!1,this.lastGeometryUpdateTime=0,this.needsGeometryUpdate=!1,this.scene=e,this.side=t,this.currentSize=new i.Pq0,this.goalSize=new i.Pq0,this.sizeDamper=new l.A,this.updateSizeFromScene(),this.edgeMaterial=new i.V9B({color:c.COLORS.EDGE_FALLOFF,transparent:!0,opacity:0,side:2,depthWrite:!1,blending:2}),this.fillMaterial=new i.V9B({color:c.COLORS.FILL_FALLOFF,transparent:!0,opacity:0,side:2,depthWrite:!1,blending:1}),this.material=this.edgeMaterial,this.goalOpacity=0,this.opacityDamper=new l.A,this.createHitMeshes(),this.updatePositionFromScene(),e.target.add(this),e.target.add(this.hitBox),this.offsetHeight=0}updateSizeFromScene(){let{size:e}=this.scene;this.goalSize.copy(e);let t=Math.sqrt(e.x*e.x+e.z*e.z),r=Math.max(c.MIN_TOUCH_AREA,.4*t);this.goalSize.x<r&&(this.goalSize.x=r),this.goalSize.z<r&&(this.goalSize.z=r),this.updateGeometry()}updateGeometry(){let e=this.geometry,t=[],r=[],n=this.goalSize.x/2,a=("back"===this.side?this.goalSize.y:this.goalSize.z)/2,s=Math.min(n,a),o=Math.max(.7*c.BASE_RADIUS,.2*s),l=Math.max(.7*c.LINE_WIDTH,.025*s);u(r,n,a,o,l),u(r,-n,a,o,l),u(r,-n,-a,o,l),u(r,n,-a,o,l);let h=r.length/3;for(let e=0;e<h-2;e+=2)t.push(e,e+1,e+3,e,e+3,e+2);let d=h-2;t.push(d,d+1,1,d,1,0),e.setAttribute("position",new i.qtW(r,3)),e.setIndex(t),e.computeBoundingSphere()}createHitMeshes(){let e=this.goalSize.x/2,t=("back"===this.side?this.goalSize.y:this.goalSize.z)/2,r=Math.min(e,t),n=Math.max(.7*c.BASE_RADIUS,.2*r);this.hitPlane=new i.eaF(new i.bdM(2*(e+n),2*(t+n))),this.hitPlane.visible=!1,this.hitPlane.material.side=2,this.add(this.hitPlane),this.hitBox=new i.eaF(new i.iNn(this.goalSize.x+2*n,this.goalSize.y+n,this.goalSize.z+2*n)),this.hitBox.visible=!1,this.hitBox.material.side=2,this.add(this.hitBox)}updatePositionFromScene(){let{boundingBox:e}=this.scene;switch(e.getCenter(this.position),this.rotation.set(0,0,0),this.side){case"bottom":this.rotateX(-Math.PI/2),this.shadowHeight=e.min.y,this.position.y=this.shadowHeight;break;case"back":this.shadowHeight=e.min.z,this.position.z=this.shadowHeight}if(this.hitBox){let t=(this.side,(this.goalSize.y+c.BASE_RADIUS)/2);this.hitBox.position.y=t+e.min.y}}updateFromModelChanges(){this.updateSizeFromScene(),this.updatePositionFromScene(),this.updateGeometry(),this.updateHitMeshes(),this.ensureProperOrientation(),this.needsGeometryUpdate=!1,this.lastGeometryUpdateTime=performance.now()}ensureProperOrientation(){"bottom"===this.side?(this.rotation.x=-Math.PI/2,this.rotation.y=0,this.rotation.z=0):"back"===this.side&&(this.rotation.x=0,this.rotation.y=0,this.rotation.z=0)}setScreenSpaceMode(e){e?this.scale.set(c.SCREEN_SPACE_SCALE,c.SCREEN_SPACE_SCALE,c.SCREEN_SPACE_SCALE):this.scale.set(1,1,1)}updateHitMeshes(){if(this.hitPlane&&this.hitBox){let e=this.goalSize.x/2,t=("back"===this.side?this.goalSize.y:this.goalSize.z)/2,r=Math.min(e,t),n=Math.max(.7*c.BASE_RADIUS,.2*r),a=new i.bdM(2*(e+n),2*(t+n));this.hitPlane.geometry.dispose(),this.hitPlane.geometry=a;let s=new i.iNn(this.goalSize.x+2*n,this.goalSize.y+n,this.goalSize.z+2*n);this.hitBox.geometry.dispose(),this.hitBox.geometry=s}}setInteractionState(e,t=!1){this.isActive=e,this.isHovered=t,this.updateVisualState()}updateVisualState(){let e,t;this.isActive?(e=c.COLORS.ACTIVE_EDGE,t=c.COLORS.ACTIVE_FILL):this.isHovered?(e=c.COLORS.EDGE_FALLOFF,t=c.COLORS.FILL_FALLOFF):(e=c.COLORS.EDGE_CUTOFF,t=c.COLORS.FILL_CUTOFF),this.edgeMaterial.color.lerp(e,c.COLOR_LERP_FACTOR),this.fillMaterial.color.lerp(t,c.COLOR_LERP_FACTOR)}applyDistanceScaling(e){let t=e.distanceTo(this.position),r=Math.max(c.MIN_DISTANCE,Math.min(c.MAX_DISTANCE,t)),i=c.BASE_SCALE+(r-c.MIN_DISTANCE)*c.DISTANCE_SCALE_FACTOR;this.scale.set(i,i,i)}getHit(e,t,r){h.set(t,-r),this.hitPlane.visible=!0;let i=e.positionAndNormalFromPoint(h,this.hitPlane);return this.hitPlane.visible=!1,null==i?null:i.position}getExpandedHit(e,t,r){this.hitPlane.scale.set(1e3,1e3,1e3),this.hitPlane.updateMatrixWorld();let i=this.getHit(e,t,r);return this.hitPlane.scale.set(1,1,1),i}controllerIntersection(e,t){this.hitBox.visible=!0;let r=e.hitFromController(t,this.hitBox);return this.hitBox.visible=!1,r}set offsetHeight(e){e-=.001,"back"===this.side?this.position.z=this.shadowHeight+e:this.position.y=this.shadowHeight+e}get offsetHeight(){return"back"===this.side?this.position.z-this.shadowHeight:this.position.y-this.shadowHeight}set show(e){this.goalOpacity=e?c.MAX_OPACITY:0}updateOpacity(e){let t=this.material,r=this.opacityDamper.update(t.opacity,this.goalOpacity,e,1);this.edgeMaterial.opacity=r,this.fillMaterial.opacity=r*c.FILL_OPACITY_MULTIPLIER,(this.isActive||this.isHovered)&&(this.edgeMaterial.opacity=r*c.INTERACTIVE_OPACITY_MULTIPLIER),this.visible=r>0}update(e,t){if(this.updateOpacity(e),!this.currentSize.equals(this.goalSize)){let t=new i.Pq0;t.x=this.sizeDamper.update(this.currentSize.x,this.goalSize.x,e,1),t.y=this.sizeDamper.update(this.currentSize.y,this.goalSize.y,e,1),t.z=this.sizeDamper.update(this.currentSize.z,this.goalSize.z,e,1),t.distanceTo(this.currentSize)>c.SIZE_UPDATE_THRESHOLD&&(this.currentSize.copy(t),this.needsGeometryUpdate=!0)}let r=performance.now();this.needsGeometryUpdate&&r-this.lastGeometryUpdateTime>c.GEOMETRY_UPDATE_DEBOUNCE&&(this.updateGeometry(),this.updateHitMeshes(),this.needsGeometryUpdate=!1,this.lastGeometryUpdateTime=r),t&&this.applyDistanceScaling(t),this.updateVisualState()}getSize(){return this.goalSize.clone()}dispose(){let{geometry:e,material:t}=this.hitPlane;e.dispose(),t.dispose(),this.hitBox.geometry.dispose(),this.hitBox.material.dispose(),this.geometry.dispose(),this.edgeMaterial.dispose(),this.fillMaterial.dispose(),this.hitBox.removeFromParent(),this.removeFromParent()}}var p=r(119);let f=`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#e8eaed">
492
+ <path d="M6.4,19L5,17.6L10.6,12L5,6.4L6.4,5L12,10.6L17.6,5L19,6.4L13.4,12L19,17.6L17.6,19L12,13.4L6.4,19Z"/>
493
+ </svg>`,g=`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#e8eaed">
494
+ <path d="M7,17V9H5V7H9V17H7ZM11,17V15H13V17H11ZM16,17V9H14V7H18V17H16ZM11,13V11H13V13H11Z"/>
495
+ </svg>`,m=`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#E1E2E8">
496
+ <defs>
497
+ <clipPath id="clip0">
498
+ <path d="M0,0h24v24h-24z"/>
499
+ </clipPath>
500
+ </defs>
501
+ <g clip-path="url(#clip0)">
502
+ <path d="M12,22C10.75,22 9.575,21.767 8.475,21.3C7.392,20.817 6.442,20.175 5.625,19.375C4.825,18.558 4.183,17.608 3.7,16.525C3.233,15.425 3,14.25 3,13H5C5,14.95 5.675,16.608 7.025,17.975C8.392,19.325 10.05,20 12,20C13.95,20 15.6,19.325 16.95,17.975C18.317,16.608 19,14.95 19,13C19,11.05 18.317,9.4 16.95,8.05C15.6,6.683 13.95,6 12,6H11.85L13.4,7.55L12,9L8,5L12,1L13.4,2.45L11.85,4H12C13.25,4 14.417,4.242 15.5,4.725C16.6,5.192 17.55,5.833 18.35,6.65C19.167,7.45 19.808,8.4 20.275,9.5C20.758,10.583 21,11.75 21,13C21,14.25 20.758,15.425 20.275,16.525C19.808,17.608 19.167,18.558 18.35,19.375C17.55,20.175 16.6,20.817 15.5,21.3C14.417,21.767 13.25,22 12,22Z"/>
503
+ </g>
504
+ </svg>`,A={width:.16,height:.07,cornerRadius:.03,opacity:1,color:0,minDistance:.5,maxDistance:10,baseScale:1,distanceScaleFactor:.3};class b extends i.B69{constructor(){super(),this.isActualSize=!1,this.preRenderIcons(),this.createPanel(),this.createButtons(),this.opacityDamper=new l.A,this.goalOpacity=A.opacity}createPanel(){let e=this.createPanelShape(),t=new i.MSw(e),r=new i.V9B({color:A.color,opacity:A.opacity,transparent:!0});this.panelMesh=new i.eaF(t,r),this.panelMesh.name="MenuPanel",this.add(this.panelMesh)}createButtons(){this.exitButton=this.createButton("close"),this.exitButton.name="ExitButton",this.exitButton.position.set(.035,0,.01),this.add(this.exitButton),this.toggleButton=this.createButton("view-real-size"),this.toggleButton.name="ToggleButton",this.toggleButton.position.set(-.035,0,.01),this.add(this.toggleButton)}createPanelShape(){let e=new i.ypk,{width:t,height:r,cornerRadius:n}=A;return e.moveTo(-t/2+n,-r/2),e.lineTo(t/2-n,-r/2),e.quadraticCurveTo(t/2,-r/2,t/2,-r/2+n),e.lineTo(t/2,r/2-n),e.quadraticCurveTo(t/2,r/2,t/2-n,r/2),e.lineTo(-t/2+n,r/2),e.quadraticCurveTo(-t/2,r/2,-t/2,r/2-n),e.lineTo(-t/2,-r/2+n),e.quadraticCurveTo(-t/2,-r/2,-t/2+n,-r/2),e}preRenderIcons(){[{key:"close",svg:f},{key:"view-real-size",svg:g},{key:"replay",svg:m}].forEach(({key:e,svg:t})=>{b.iconTextures.has(e)||this.createTextureFromSvg(t,e)})}createTextureFromSvg(e,t){let r=document.createElement("canvas");r.width=128,r.height=128;let n=r.getContext("2d"),a=new Image,s=new Blob([e],{type:"image/svg+xml"}),o=URL.createObjectURL(s);a.onload=()=>{n.drawImage(a,0,0,128,128);let e=new i.GOR(r);e.needsUpdate=!0,e.minFilter=1006,b.iconTextures.set(t,e),URL.revokeObjectURL(o)},a.src=o}createButton(e){let t=new i.V9B({transparent:!0}),r=new i.bdM(.05,.05),n=new i.eaF(r,t),a=b.iconTextures.get(e);if(a)n.material.map=a,n.material.needsUpdate=!0;else{this.createTextureFromSvg("close"===e?f:"view-real-size"===e?g:m,e);let t=()=>{let r=b.iconTextures.get(e);r?(n.material.map=r,n.material.needsUpdate=!0):setTimeout(t,10)};t()}return n}exitButtonControllerIntersection(e,t){return e.hitFromController(t,this.exitButton)}scaleModeButtonControllerIntersection(e,t){return e.hitFromController(t,this.toggleButton)}handleScaleToggle(e,t,r,i){if(!e)return null;this.isActualSize=!this.isActualSize;let n=this.isActualSize?"replay":"view-real-size";return this.updateScaleModeButtonLabel(n),Math.max(r,Math.min(i,this.isActualSize?1:t))}updateScaleModeButtonLabel(e){let t=b.iconTextures.get(e);t&&(this.toggleButton.material.map=t,this.toggleButton.material.needsUpdate=!0)}updatePosition(e,t){if(!t)return;let r=new i.Pq0;t.getWorldPosition(r);let n=t.getSize(),a=Math.max(.5,Math.min(2,Math.min(n.x,n.z)/1)),s=new i.Pq0().copy(e.position).sub(r);s.y=0,s.normalize();let o=new i.Pq0().copy(r).add(new i.Pq0(0,-.2*a,0)).add(s.multiplyScalar(.9*a));this.position.copy(o);let l=e.position.distanceTo(o),c=Math.max(A.minDistance,Math.min(A.maxDistance,l)),h=A.baseScale+(c-A.minDistance)*A.distanceScaleFactor;this.scale.set(h,h,h),this.lookAt(e.position)}set show(e){this.goalOpacity=e?A.opacity:0}updateOpacity(e){let t=this.panelMesh.material.opacity,r=this.opacityDamper.update(t,this.goalOpacity,e,1);this.traverse(e=>{if(e instanceof i.eaF){let t=e.material;t.transparent&&(t.opacity=r)}}),this.visible=r>0}dispose(){var e;this.children.forEach(e=>{e instanceof i.eaF&&(e.geometry&&e.geometry.dispose(),(Array.isArray(e.material)?e.material:[e.material]).forEach(e=>{e&&("map"in e&&e.map instanceof i.GOR&&e.map.dispose(),e.dispose())}))}),null==(e=this.parent)||e.remove(this)}}b.iconTextures=new Map;let v=new i.Pq0(0,1,0),y={NOT_PRESENTING:"not-presenting",SESSION_STARTED:"session-started",OBJECT_PLACED:"object-placed",FAILED:"failed"},x={TRACKING:"tracking",NOT_TRACKING:"not-tracking"},S=new i.Pq0,E=new i.PTz,w=new i.kn4,_=new i.Pq0,C=new i.ubm(45,1,.1,100),M=new i.LoY().setFromPoints([new i.Pq0(0,0,0),new i.Pq0(0,0,-1)]),I="screen-space",T="world-space";class R extends i.Qev{isWorldSpaceReady(){return this.xrMode===T&&this.worldSpaceInitialPlacementDone}constructor(e){super(),this.renderer=e,this.currentSession=null,this.placeOnWall=!1,this.placementBox=null,this.menuPanel=null,this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.initialHitSource=null,this.transientHitTestSource=null,this.inputSource=null,this._presentedScene=null,this.resolveCleanup=null,this.exitWebXRButtonContainer=null,this.overlay=null,this.xrLight=null,this.xrMode=null,this.xrController1=null,this.xrController2=null,this.selectedXRController=null,this.tracking=!0,this.frames=0,this.initialized=!1,this.oldTarget=new i.Pq0,this.placementComplete=!1,this.isTranslating=!1,this.isRotating=!1,this.isTwoHandInteraction=!1,this.lastDragPosition=new i.Pq0,this.deltaRotation=new i.PTz,this.scaleLine=new i.N1A(M),this.firstRatio=0,this.lastAngle=0,this.goalPosition=new i.Pq0,this.goalYaw=0,this.goalScale=1,this.xDamper=new l.A,this.yDamper=new l.A,this.zDamper=new l.A,this.yawDamper=new l.A,this.pitchDamper=new l.A,this.rollDamper=new l.A,this.scaleDamper=new l.A,this.wasTwoFingering=!1,this.worldSpaceInitialPlacementDone=!1,this.initialModelScale=1,this.minScale=1,this.maxScale=1,this.onExitWebXRButtonContainerClick=()=>this.stopPresenting(),this.onControllerSelectStart=e=>{var t,r,n;let a=this.presentedScene,s=e.target,o=this.menuPanel;if(null!=this.menuPanel.exitButtonControllerIntersection(a,s)){null==(t=this.menuPanel)||t.dispose(),this.stopPresenting();return}if(null!=this.menuPanel.scaleModeButtonControllerIntersection(a,s)){let e=this.menuPanel.handleScaleToggle(this.worldSpaceInitialPlacementDone,this.initialModelScale,this.minScale,this.maxScale);null!==e&&(this.goalScale=e);return}o&&(o.show=!1);let l=this.placementBox.controllerIntersection(a,s);if(null!=l){let e=new i.NRn().setFromObject(a.pivot).min.y+.2;if(l.point.y<=e)null!=this.selectedXRController?(this.selectedXRController.userData.line.visible=!1,a.canScale&&this.isWorldSpaceReady()&&(this.isTwoHandInteraction=!0,this.firstRatio=this.controllerSeparation()/a.pivot.scale.x,this.scaleLine.visible=!0)):s.attach(a.pivot),this.selectedXRController=s,a.setShadowIntensity(.01);else if(s==this.xrController1?this.xrController1.userData.isSelected=!0:s==this.xrController2&&(this.xrController2.userData.isSelected=!0),(null==(r=this.xrController1)?void 0:r.userData.isSelected)&&(null==(n=this.xrController2)?void 0:n.userData.isSelected))a.canScale&&this.isWorldSpaceReady()&&(this.isTwoHandInteraction=!0,this.firstRatio=this.controllerSeparation()/a.pivot.scale.x,this.scaleLine.visible=!0);else{let e=s===this.xrController1?this.xrController2:this.xrController1;s.userData.initialX=s.position.x,e.userData.turning=!1,s.userData.turning=!0,s.userData.line.visible=!1}}},this.onControllerSelectEnd=e=>{let t=e.target;if(t.userData.turning=!1,t.userData.line.visible=!0,this.isTwoHandInteraction=!1,this.scaleLine.visible=!1,t==this.xrController1?this.xrController1.userData.isSelected=!1:t==this.xrController2&&(this.xrController2.userData.isSelected=!1),null!=this.selectedXRController&&this.selectedXRController!=t)return;let r=this.presentedScene;r.attach(r.pivot),this.selectedXRController=null,this.goalYaw=Math.atan2(r.pivot.matrix.elements[8],r.pivot.matrix.elements[10]),this.goalPosition.x=r.pivot.position.x,this.goalPosition.z=r.pivot.position.z,this.isWorldSpaceReady()&&(this.goalPosition.y=r.pivot.position.y),this.menuPanel.show=!0},this.onUpdateScene=()=>{null!=this.placementBox&&this.isPresenting&&(this.placementBox.updateFromModelChanges(),this.placementBox.setScreenSpaceMode(this.xrMode===I)),this.xrMode!==I&&(this.menuPanel&&(this.menuPanel.dispose(),this.menuPanel=null),this.menuPanel=new b,this.presentedScene.add(this.menuPanel),this.menuPanel.updatePosition(this.presentedScene.getCamera(),this.placementBox))},this.onSelectStart=e=>{let t=this.transientHitTestSource;if(null==t)return;let r=this.frame.getHitTestResultsForTransientInput(t),i=this.presentedScene,n=this.placementBox;if(1===r.length){this.inputSource=e.inputSource;let{axes:t}=this.inputSource.gamepad,r=n.getHit(this.presentedScene,t[0],t[1]);n.show=!0,null!=r?(this.isTranslating=!0,this.lastDragPosition.copy(r)):!1===this.placeOnWall&&(this.isRotating=!0,this.lastAngle=1.5*t[0])}else if(2===r.length){n.show=!0,this.isTwoHandInteraction=!0;let{separation:e,angle:t}=this.fingerPolar(r);this.lastAngle=t,0===this.firstRatio&&(this.firstRatio=e/i.pivot.scale.x),i.canScale&&this.setScale(e);return}},this.onSelectEnd=()=>{this.isTranslating=!1,this.isRotating=!1,this.isTwoHandInteraction=!1,this.inputSource=null,this.goalPosition.y+=this.placementBox.offsetHeight*this.presentedScene.scale.x,this.placementBox.show=!1},this.threeRenderer=e.threeRenderer,this.threeRenderer.xr.enabled=!0}async resolveARSession(){(0,o.f3)();let e=await navigator.xr.requestSession("immersive-ar",{requiredFeatures:[],optionalFeatures:["hit-test","dom-overlay","light-estimation"],domOverlay:this.overlay?{root:this.overlay}:void 0});return this.threeRenderer.xr.setReferenceSpaceType("local"),await this.threeRenderer.xr.setSession(e),this.threeRenderer.xr.cameraAutoUpdate=!1,e}get presentedScene(){return this._presentedScene}async supportsPresentation(){try{return(0,o.f3)(),await navigator.xr.isSessionSupported("immersive-ar")}catch(e){return console.warn("Request to present in WebXR denied:"),console.warn(e),console.warn("Falling back to next ar-mode"),!1}}async present(e,t=!1){this.isPresenting&&console.warn("Cannot present while a model is already presenting");let r=new Promise((e,t)=>{requestAnimationFrame(()=>e())});e.setHotspotsVisibility(!1),e.queueRender(),await r,this._presentedScene=e,this.overlay=e.element.shadowRoot.querySelector("div.default"),!0===t&&(this.xrLight=new a(this.threeRenderer),this.xrLight.addEventListener("estimationstart",()=>{if(!this.isPresenting||null==this.xrLight)return;let e=this.presentedScene;e.add(this.xrLight),e.environment=this.xrLight.environment}));let i=await this.resolveARSession();i.addEventListener("end",()=>{this.postSessionCleanup()},{once:!0});let n=e.element.shadowRoot.querySelector(".slot.exit-webxr-ar-button");n.classList.add("enabled"),n.addEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=n;let s=await i.requestReferenceSpace("viewer");this.xrMode=i.interactionMode,this.tracking=!0,this.frames=0,this.initialized=!1,this.turntableRotation=e.yaw,this.goalYaw=e.yaw,this.goalScale=1,e.setBackground(null),this.oldShadowIntensity=e.shadowIntensity,e.setShadowIntensity(.01),this.oldTarget.copy(e.getTarget()),e.element.addEventListener("load",this.onUpdateScene);let o=20*Math.PI/180,l=!0===this.placeOnWall?void 0:new XRRay(new DOMPoint(0,0,0),{x:0,y:-Math.sin(o),z:-Math.cos(o)});i.requestHitTestSource({space:s,offsetRay:l}).then(e=>{this.initialHitSource=e}),this.xrMode!==I&&(this.setupXRControllers(),this.xDamper.setDecayTime(150),this.yDamper.setDecayTime(150),this.zDamper.setDecayTime(150),this.yawDamper.setDecayTime(150),this.pitchDamper.setDecayTime(150),this.rollDamper.setDecayTime(150),this.scaleDamper.setDecayTime(150)),this.currentSession=i,this.placementBox=new d(e,this.placeOnWall?"back":"bottom"),this.placementBox&&this.placementBox.setScreenSpaceMode(this.xrMode===I),this.placementComplete=!1,this.xrMode!==I&&(this.menuPanel=new b,e.add(this.menuPanel),this.menuPanel.updatePosition(e.getCamera(),this.placementBox)),this.lastTick=performance.now(),this.dispatchEvent({type:"status",status:y.SESSION_STARTED})}setupXRControllerLine(e){if(!e.userData.line){let t=new i.N1A(M);t.name="line",t.scale.z=5,e.userData.turning=!1,e.userData.line=t,e.add(t)}}setupController(e){this.setupXRControllerLine(e),e.addEventListener("selectstart",this.onControllerSelectStart),e.addEventListener("selectend",this.onControllerSelectEnd)}setupXRControllers(){this.xrController1=this.threeRenderer.xr.getController(0),this.xrController2=this.threeRenderer.xr.getController(1),this.setupController(this.xrController1),this.setupController(this.xrController2),this.scaleLine.name="scale line",this.scaleLine.visible=!1,this.xrController1.add(this.scaleLine);let e=this.presentedScene;e.add(this.xrController1),e.add(this.xrController2)}hover(e){if(this.xrMode===I||this.selectedXRController==e)return!1;let t=this.presentedScene,r=this.placementBox.controllerIntersection(t,e);return e.userData.line.scale.z=null==r?5:r.distance,null!=r}controllerSeparation(){return this.xrController1.position.distanceTo(this.xrController2.position)}async stopPresenting(){if(!this.isPresenting)return;let e=new Promise(e=>{this.resolveCleanup=e});try{await this.currentSession.end(),await e}catch(e){console.warn("Error while trying to end WebXR AR session"),console.warn(e),this.postSessionCleanup()}}get isPresenting(){return null!=this.presentedScene}get target(){return this.oldTarget}updateTarget(){let e=this.presentedScene;if(null!=e){let t=e.getTarget();this.oldTarget.copy(t),this.placeOnWall?t.z=e.boundingBox.min.z:t.y=e.boundingBox.min.y,e.setTarget(t.x,t.y,t.z)}}cleanupXRController(e){e.userData.turning=!1,e.userData.line.visible=!0,e.removeEventListener("selectstart",this.onControllerSelectStart),e.removeEventListener("selectend",this.onControllerSelectEnd),e.removeFromParent()}postSessionCleanup(){let e=this.currentSession;null!=e&&(e.removeEventListener("selectstart",this.onSelectStart),e.removeEventListener("selectend",this.onSelectEnd),this.currentSession=null);let t=this.presentedScene;if(this._presentedScene=null,null!=t){let{element:e}=t;null!=this.xrLight&&(t.remove(this.xrLight),this.xrLight.dispose(),this.xrLight=null),null!=this.menuPanel&&(this.menuPanel.dispose(),this.menuPanel=null),t.add(t.pivot),t.pivot.quaternion.set(0,0,0,1),t.pivot.position.set(0,0,0),t.pivot.scale.set(1,1,1),t.setShadowOffset(0);let r=this.turntableRotation;null!=r&&(t.yaw=r);let i=this.oldShadowIntensity;null!=i&&t.setShadowIntensity(i),t.setEnvironmentAndSkybox(e[s.fr],e[s.kT]);let n=this.oldTarget;t.setTarget(n.x,n.y,n.z),t.xrCamera=null,t.element.removeEventListener("load",this.onUpdateScene),t.orientHotspots(0);let{width:a,height:o}=e.getBoundingClientRect();t.setSize(a,o),requestAnimationFrame(()=>{t.element.dispatchEvent(new CustomEvent("camera-change",{detail:{source:p.iC.NONE}}))})}this.renderer.height=0;let r=this.exitWebXRButtonContainer;null!=r&&(r.classList.remove("enabled"),r.removeEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=null);let i=this.transientHitTestSource;null!=i&&(i.cancel(),this.transientHitTestSource=null);let n=this.initialHitSource;null!=n&&(n.cancel(),this.initialHitSource=null),null!=this.placementBox&&(this.placementBox.dispose(),this.placementBox=null),this.xrMode!==I&&(null!=this.xrController1&&(this.cleanupXRController(this.xrController1),this.xrController1=null),null!=this.xrController2&&(this.cleanupXRController(this.xrController2),this.xrController2=null),this.selectedXRController=null,this.scaleLine.visible=!1),this.isTranslating=!1,this.isRotating=!1,this.isTwoHandInteraction=!1,this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.inputSource=null,this.overlay=null,this.worldSpaceInitialPlacementDone=!1,null!=this.resolveCleanup&&this.resolveCleanup(),this.dispatchEvent({type:"status",status:y.NOT_PRESENTING})}updateView(e){let t=this.presentedScene,r=this.threeRenderer.xr;r.updateCamera(C),t.xrCamera=r.getCamera();let{elements:i}=t.getCamera().matrixWorld;if(t.orientHotspots(Math.atan2(i[1],i[5])),this.initialized||(this.placeInitially(),this.initialized=!0),e.requestViewportScale&&e.recommendedViewportScale){let t=e.recommendedViewportScale;e.requestViewportScale(Math.max(t,.25))}let n=r.getBaseLayer();if(null!=n){let t=n instanceof XRWebGLLayer?n.getViewport(e):r.getBinding().getViewSubImage(n,e).viewport;this.threeRenderer.setViewport(t.x,t.y,t.width,t.height)}}placeInitially(){let e=this.presentedScene,{pivot:t,element:r}=e,{position:i}=t,n=e.getCamera(),{width:a,height:s}=this.overlay.getBoundingClientRect();e.setSize(a,s),n.projectionMatrixInverse.copy(n.projectionMatrix).invert();let{theta:o}=r.getCameraOrbit(),l=n.getWorldDirection(S);if(e.yaw=Math.atan2(-l.x,-l.z)-o,this.goalYaw=e.yaw,this.xrMode!==T||this.worldSpaceInitialPlacementDone){if(this.xrMode===I){let t=Math.max(1,2*e.boundingSphere.radius);i.copy(n.position).add(l.multiplyScalar(t)),this.updateTarget();let r=e.getTarget();i.add(r).sub(this.oldTarget),this.goalPosition.copy(i)}}else{let{position:r,scale:a}=this.calculateWorldSpaceOptimalPlacement(e,n);this.goalPosition.copy(r),this.goalScale=a,this.initialModelScale=a,i.copy(r),t.scale.set(a,a,a),this.worldSpaceInitialPlacementDone=!0,this.calculateWorldSpaceScaleLimits(e),this.enableWorldSpaceUserInteraction()}if(e.setHotspotsVisibility(!0),this.xrMode===I){let{session:e}=this.frame;e.addEventListener("selectstart",this.onSelectStart),e.addEventListener("selectend",this.onSelectEnd),e.requestHitTestSourceForTransientInput({profile:"generic-touchscreen"}).then(e=>{this.transientHitTestSource=e})}}getTouchLocation(){let{axes:e}=this.inputSource.gamepad,t=this.placementBox.getExpandedHit(this.presentedScene,e[0],e[1]);return null!=t&&(S.copy(t).sub(this.presentedScene.getCamera().position),S.length()>10)?null:t}getHitPoint(e){let t=this.threeRenderer.xr.getReferenceSpace(),r=e.getPose(t);if(null==r)return null;let i=w.fromArray(r.transform.matrix);return!0===this.placeOnWall&&(this.goalYaw=Math.atan2(i.elements[4],i.elements[6])),i.elements[5]>.75!==this.placeOnWall?_.setFromMatrixPosition(i):null}moveToFloor(e){if(this.xrMode===T&&!this.worldSpaceInitialPlacementDone){this.placementBox.show=!1,this.dispatchEvent({type:"status",status:y.OBJECT_PLACED});return}let t=this.initialHitSource;if(null==t)return;let r=e.getHitTestResults(t);if(0==r.length)return;let i=r[0],n=this.getHitPoint(i);null!=n&&(this.placementBox.show=!0,this.isTranslating||(this.placeOnWall?this.goalPosition.copy(n):this.goalPosition.y=n.y),t.cancel(),this.initialHitSource=null,this.dispatchEvent({type:"status",status:y.OBJECT_PLACED}))}fingerPolar(e){let t=e[0].inputSource.gamepad.axes,r=e[1].inputSource.gamepad.axes,i=r[0]-t[0],n=r[1]-t[1],a=Math.atan2(n,i),s=this.lastAngle-a;return s>Math.PI?s-=2*Math.PI:s<-Math.PI&&(s+=2*Math.PI),{separation:Math.sqrt(i*i+n*n),deltaYaw:s,angle:a}}setScale(e){let t=e/this.firstRatio;t=.2>Math.abs(t-1)?1:t,this.isWorldSpaceReady()&&(t=Math.max(this.minScale,Math.min(this.maxScale,t))),this.goalScale=t}processInput(e){let t=this.transientHitTestSource;if(null==t)return;let r=e.getHitTestResultsForTransientInput(t),i=this.presentedScene,n=i.pivot.scale.x;if(2===r.length){if(!this.wasTwoFingering){let{separation:e,angle:t}=this.fingerPolar(r);this.firstRatio=e/n,this.lastAngle=t,this.wasTwoFingering=!0,this.isTwoHandInteraction=!0;return}let{separation:e,deltaYaw:t,angle:a}=this.fingerPolar(r);this.goalYaw+=t,this.lastAngle=a,i.canScale&&this.setScale(e),this.isTwoHandInteraction=!0;return}if(this.wasTwoFingering&&(this.wasTwoFingering=!1,this.isTwoHandInteraction=!1,this.firstRatio=0),this.isTranslating||this.isTwoHandInteraction||this.isRotating)if(this.isRotating){let e=1.5*this.inputSource.gamepad.axes[0];this.goalYaw+=e-this.lastAngle,this.lastAngle=e}else this.isTranslating&&r.forEach(e=>{if(e.inputSource!==this.inputSource)return;let t=null;if(e.results.length>0&&(t=this.getHitPoint(e.results[0])),null==t&&(t=this.getTouchLocation()),null!=t){if(this.goalPosition.sub(this.lastDragPosition),this.isWorldSpaceReady())console.log("[processInput] Setting goalPosition.y to hit.y:",t.y),this.goalPosition.add(t);else if(!1===this.placeOnWall){let e=t.y-this.lastDragPosition.y;if(e<0){this.placementBox.offsetHeight=e/n,this.presentedScene.setShadowOffset(e);let r=S.copy(i.getCamera().position),a=-e/(r.y-t.y);r.multiplyScalar(a),t.multiplyScalar(1-a).add(r)}this.goalPosition.add(t)}else this.goalPosition.add(t);this.lastDragPosition.copy(t)}})}applyXRControllerRotation(e,t){if(!e.userData.turning)return;let r=(e.position.x-e.userData.initialX)*.3;this.deltaRotation.setFromAxisAngle(v,r),t.quaternion.multiplyQuaternions(this.deltaRotation,t.quaternion)}handleScalingInXR(e,t){if(this.xrMode===T&&!this.worldSpaceInitialPlacementDone)return;if(this.xrController1&&this.xrController2&&this.isTwoHandInteraction){let e=this.controllerSeparation();this.setScale(e),this.scaleLine.scale.z=-e,this.scaleLine.lookAt(this.xrController2.position)}let r=e.pivot.scale.x;if(this.goalScale!==r){let i=this.scaleDamper.update(r,this.goalScale,t,1);e.pivot.scale.set(i,i,i)}}updatePivotPosition(e,t){let{pivot:r}=e,i=this.placementBox,n=e.boundingSphere.radius,a=this.goalPosition,s=r.position,o=p.iC.NONE;if(!a.equals(s)){o=p.iC.USER_INTERACTION;let{x:r,y:l,z:c}=s;if(r=this.xDamper.update(r,a.x,t,n),l=this.yDamper.update(l,a.y,t,n),c=this.zDamper.update(c,a.z,t,n),s.set(r,l,c),this.xrMode===I&&!this.isTranslating){let t=a.y-l;this.placementComplete&&!1===this.placeOnWall?(i.offsetHeight=t/e.pivot.scale.x,e.setShadowOffset(t)):0===t&&(this.placementComplete=!0,i.show=!1,e.setShadowIntensity(.8))}this.xrMode!==I&&a.equals(s)&&e.setShadowIntensity(.8),this.isWorldSpaceReady()&&e.setShadowIntensity(.8)}if(this.xrMode===T&&!this.worldSpaceInitialPlacementDone&&this.goalScale!==r.scale.x){let e=this.scaleDamper.update(r.scale.x,this.goalScale,t,1);r.scale.set(e,e,e)}return e.updateTarget(t),o}updateYaw(e,t){E.setFromAxisAngle(S.set(0,1,0),this.goalYaw);let r=e.pivot.quaternion.angleTo(E),i=r-this.yawDamper.update(r,0,t,Math.PI);e.pivot.quaternion.rotateTowards(E,i)}updateMenuPanel(e,t,r){this.menuPanel&&(this.menuPanel.updateOpacity(r),this.menuPanel.updatePosition(e.getCamera(),t))}applyXRInputToScene(e){let t=this.presentedScene,r=t.pivot,i=this.placementBox;if(this.updatePlacementBoxOpacity(i,e),this.updateTwoHandInteractionState(),this.applyXRControllerRotations(r),this.handleScalingInXR(t,e),r.parent!==t)return void this.updateMenuPanel(t,i,e);let n=this.updatePivotPosition(t,e);this.updateYaw(t,e),this.dispatchCameraChangeEvent(t,n),this.updateMenuPanel(t,i,e)}updatePlacementBoxOpacity(e,t){let r=this.presentedScene.getCamera();e.update(t,r.position);let i=this.hover(this.xrController1),n=this.hover(this.xrController2),a=(i||n)&&!this.isTwoHandInteraction;e.setInteractionState(this.isTranslating||this.isRotating,a)}updateTwoHandInteractionState(){var e,t;let r=(null==(e=this.xrController1)?void 0:e.userData.isSelected)&&(null==(t=this.xrController2)?void 0:t.userData.isSelected);this.isTwoHandInteraction=!!r}applyXRControllerRotations(e){!this.isTwoHandInteraction&&(this.xrController1&&this.applyXRControllerRotation(this.xrController1,e),this.xrController2&&this.applyXRControllerRotation(this.xrController2,e))}dispatchCameraChangeEvent(e,t){e.element.dispatchEvent(new CustomEvent("camera-change",{detail:{source:t}}))}updateXRControllerHover(){let e=this.hover(this.xrController1),t=this.hover(this.xrController2),r=(e||t)&&!this.isTwoHandInteraction;this.placementBox&&(this.placementBox.setInteractionState(this.isTranslating||this.isRotating,r),this.placementBox.show=r)}enableWorldSpaceUserInteraction(){this.placementBox&&(this.placementBox.show=!0),this.presentedScene&&this.presentedScene.setShadowIntensity(.8)}handleFirstView(e,t){this.xrMode===T&&this.worldSpaceInitialPlacementDone||this.moveToFloor(e),this.processInput(e);let r=t-this.lastTick;this.applyXRInputToScene(r),this.renderer.preRender(this.presentedScene,t,r),this.lastTick=t,this.presentedScene.renderShadow(this.threeRenderer)}onWebXRFrame(e,t){this.xrMode!==I&&this.updateXRControllerHover(),this.frame=t,++this.frames;let r=this.threeRenderer.xr.getReferenceSpace(),i=t.getViewerPose(r);null==i&&!0===this.tracking&&this.frames>30&&(this.tracking=!1,this.dispatchEvent({type:"tracking",status:x.NOT_TRACKING}));let n=this.presentedScene;if(null==i||null==n||!n.element.loaded)return void this.threeRenderer.clear();!1===this.tracking&&(this.tracking=!0,this.dispatchEvent({type:"tracking",status:x.TRACKING}));let a=!0;for(let r of i.views)this.updateView(r),a&&(this.handleFirstView(t,e),a=!1),this.threeRenderer.render(n,n.getCamera())}calculateWorldSpaceOptimalPlacement(e,t){let r=e.boundingBox,n={x:(r.max.x-r.min.x)/2,y:(r.max.y-r.min.y)/2,z:(r.max.z-r.min.z)/2},a=Math.max(1.65,2*Math.max(n.x,n.z)+.15),s=15*Math.PI/180,o=new i.Pq0(0,-a*Math.sin(s),-a*Math.cos(s)),l=t.matrixWorld,c=o.clone().applyMatrix4(l),h=Math.max(n.x,n.z)+.15,u=Math.min(.3*a/Math.max(n.y,.01),.3*a/Math.max(h,.01));return{position:c.clone().sub(new i.Pq0(0,u*n.y,0)),scale:u}}calculateWorldSpaceScaleLimits(e){let t=e.size,r=Math.max(t.x,t.y,t.z),i=Math.max(Math.min(t.x,t.y,t.z),.001),n=.01/Math.max(r,.001),a=70/Math.max(i,.001);this.minScale=Math.min(n,a,this.goalScale),this.maxScale=Math.max(n,a,this.goalScale)}}},4515(e,t,r){"use strict";let i,n,a,s,o,l,c,h;r.d(t,{IZ:()=>ez,UV:()=>eO,q4:()=>eU});var u,d,p,f,g=r(874),m=function(){var e,t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var i=WebAssembly.validate(t)?a("b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb"):a("b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb"),n=WebAssembly.instantiate(i,{}).then(function(t){(e=t.instance).exports.__wasm_call_ctors()});function a(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;++i){var n=e.charCodeAt(i);t[i]=n>96?n-97:n>64?n-39:n+4}for(var a=0,i=0;i<e.length;++i)t[a++]=t[i]<60?r[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,a)}function s(e,t,r,i,n,a,s){var o=e.exports.sbrk,l=i+3&-4,c=o(l*n),h=o(a.length),u=new Uint8Array(e.exports.memory.buffer);u.set(a,h);var d=t(c,i,n,h,a.length);if(0==d&&s&&s(c,l,n),r.set(u.subarray(c,c+i*n)),o(c-o(0)),0!=d)throw Error("Malformed buffer data: "+d)}var o={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},c=[],h=0;function u(e){var t=e.data;if(!t.id)return self.close();self.ready.then(function(e){try{var r=new Uint8Array(t.count*t.size);s(e,e.exports[t.mode],r,t.count,t.size,t.source,e.exports[t.filter]),self.postMessage({id:t.id,count:t.count,action:"resolve",value:r},[r.buffer])}catch(e){self.postMessage({id:t.id,count:t.count,action:"reject",value:e})}})}return{ready:n,supported:!0,useWorkers:function(e){for(var t=new Blob(["self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(i)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+u.name+";"+s.toString()+u.toString()],{type:"text/javascript"}),r=URL.createObjectURL(t),n=c.length;n<e;++n)c[n]=function(e){var t={object:new Worker(e),pending:0,requests:{}};return t.object.onmessage=function(e){var r=e.data;t.pending-=r.count,t.requests[r.id][r.action](r.value),delete t.requests[r.id]},t}(r);for(var n=e;n<c.length;++n)c[n].object.postMessage({});c.length=e,URL.revokeObjectURL(r)},decodeVertexBuffer:function(t,r,i,n,a){s(e,e.exports.meshopt_decodeVertexBuffer,t,r,i,n,e.exports[o[a]])},decodeIndexBuffer:function(t,r,i,n){s(e,e.exports.meshopt_decodeIndexBuffer,t,r,i,n)},decodeIndexSequence:function(t,r,i,n){s(e,e.exports.meshopt_decodeIndexSequence,t,r,i,n)},decodeGltfBuffer:function(t,r,i,n,a,c){s(e,e.exports[l[a]],t,r,i,n,e.exports[o[c]])},decodeGltfBufferAsync:function(t,r,i,a,u){return c.length>0?function(e,t,r,i,n){for(var a=c[0],s=1;s<c.length;++s)c[s].pending<a.pending&&(a=c[s]);return new Promise(function(s,o){var l=new Uint8Array(r),c=++h;a.pending+=e,a.requests[c]={resolve:s,reject:o},a.object.postMessage({id:c,count:e,size:t,source:l,mode:i,filter:n},[l.buffer])})}(t,r,i,l[a],o[u]):n.then(function(){var n=new Uint8Array(t*r);return s(e,e.exports[l[a]],n,t,r,i,e.exports[o[u]]),n})}}}();let A=new WeakMap;class b extends g.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,i){let n=new g.Y9S(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,e=>{this.parse(e,t,i)},r,i)}parse(e,t,r=()=>{}){this.decodeDracoFile(e,t,null,null,"srgb",r).catch(r)}decodeDracoFile(e,t,r,i,n=g.Zr2,a=()=>{}){let s={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:n};return this.decodeGeometry(e,s).then(t).catch(a)}decodeGeometry(e,t){let r,i=JSON.stringify(t);if(A.has(e)){let t=A.get(e);if(t.key===i)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 n=this.workerNextTaskID++,a=e.byteLength,s=this._getWorker(n,a).then(i=>(r=i,new Promise((i,a)=>{r._callbacks[n]={resolve:i,reject:a},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return s.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),A.set(e,{key:i,promise:s}),s}_createGeometry(e){let t=new g.LoY;e.index&&t.setIndex(new g.THS(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let i,{name:n,array:a,itemSize:s,stride:o,vertexColorSpace:l}=e.attributes[r];if(s===o)i=new g.THS(a,s);else{let e=new g.eB$(a,o);i=new g.eHs(e,s,0)}"color"===n&&(this._assignVertexColorSpace(i,l),i.normalized=a instanceof Float32Array==!1),t.setAttribute(n,i)}return t}_assignVertexColorSpace(e,t){if("srgb"!==t)return;let r=new g.Q1f;for(let t=0,i=e.count;t<i;t++)r.fromBufferAttribute(e,t),g.ppV.colorSpaceToWorking(r,"srgb"),e.setXYZ(t,r.r,r.g,r.b)}_loadLibrary(e,t){let r=new g.Y9S(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((t,i)=>{r.load(e,t,void 0,i)})}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 i=v.toString(),n=["/* draco decoder */",r,"\n/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{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 v(){let e,t;onmessage=function(r){let i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let n=i.buffer,a=i.taskConfig;t.then(e=>{let t=e.draco,r=new t.Decoder;try{let e=function(e,t,r,i){var n,a,s;let o,l,c,h,u,d,p=i.attributeIDs,f=i.attributeTypes,g=t.GetEncodedGeometryType(r);if(g===e.TRIANGULAR_MESH)u=new e.Mesh,d=t.DecodeArrayToMesh(r,r.byteLength,u);else if(g===e.POINT_CLOUD)u=new e.PointCloud,d=t.DecodeArrayToPointCloud(r,r.byteLength,u);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||0===u.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());let m={index:null,attributes:[]};for(let r in p){let n,a,s=self[f[r]];if(i.useUniqueIDs)a=p[r],n=t.GetAttributeByUniqueId(u,a);else{if(-1===(a=t.GetAttributeId(u,e[p[r]])))continue;n=t.GetAttribute(u,a)}let o=function(e,t,r,i,n,a){let s,o=r.num_points(),l=a.num_components(),c=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,n),h=l*n.BYTES_PER_ELEMENT,u=4*Math.ceil(h/4),d=u/n.BYTES_PER_ELEMENT,p=o*h,f=e._malloc(p);t.GetAttributeDataArrayForAllPoints(r,a,c,p,f);let g=new n(e.HEAPF32.buffer,f,p/n.BYTES_PER_ELEMENT);if(h===u)s=g.slice();else{s=new n(o*u/n.BYTES_PER_ELEMENT);let e=0;for(let t=0,r=g.length;t<r;t++){for(let r=0;r<l;r++)s[e+r]=g[t*l+r];e+=d}}return e._free(f),{name:i,count:o,itemSize:l,array:s,stride:d}}(e,t,u,r,s,n);"color"===r&&(o.vertexColorSpace=i.vertexColorSpace),m.attributes.push(o)}return g===e.TRIANGULAR_MESH&&(n=e,a=t,s=u,o=3*s.num_faces(),l=4*o,c=n._malloc(l),a.GetTrianglesUInt32Array(s,l,c),h=new Uint32Array(n.HEAPF32.buffer,c,o).slice(),n._free(c),m.index={array:h,itemSize:1}),e.destroy(u),m}(t,r,new Int8Array(n),a),s=e.attributes.map(e=>e.array.buffer);e.index&&s.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},s)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(r)}})}}}function y(e,t){if(0===t)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(2!==t&&1!==t)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],i=e.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<i.count;e++)t.push(e);e.setIndex(t),r=e.getIndex()}let i=r.count-2,n=[];if(2===t)for(let e=1;e<=i;e++)n.push(r.getX(0)),n.push(r.getX(e)),n.push(r.getX(e+1));else for(let e=0;e<i;e++)e%2==0?(n.push(r.getX(e)),n.push(r.getX(e+1)),n.push(r.getX(e+2))):(n.push(r.getX(e+2)),n.push(r.getX(e+1)),n.push(r.getX(e)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let a=e.clone();return a.setIndex(n),a.clearGroups(),a}}class x extends g.aHM{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new M(e)}),this.register(function(e){return new I(e)}),this.register(function(e){return new N(e)}),this.register(function(e){return new U(e)}),this.register(function(e){return new O(e)}),this.register(function(e){return new R(e)}),this.register(function(e){return new B(e)}),this.register(function(e){return new k(e)}),this.register(function(e){return new P(e)}),this.register(function(e){return new C(e)}),this.register(function(e){return new D(e)}),this.register(function(e){return new T(e)}),this.register(function(e){return new F(e)}),this.register(function(e){return new L(e)}),this.register(function(e){return new w(e)}),this.register(function(e){return new Q(e)}),this.register(function(e){return new z(e)})}load(e,t,r,i){let n,a=this;if(""!==this.resourcePath)n=this.resourcePath;else if(""!==this.path){let t=g.r6x.extractUrlBase(e);n=g.r6x.resolveURL(t,this.path)}else n=g.r6x.extractUrlBase(e);this.manager.itemStart(e);let s=function(t){i?i(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},o=new g.Y9S(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(r){try{a.parse(r,n,function(r){t(r),a.manager.itemEnd(e)},s)}catch(e){s(e)}},r,s)}setDRACOLoader(e){return this.dracoLoader=e,this}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,i){let n,a={},s={},o=new TextDecoder;if("string"==typeof e)n=JSON.parse(e);else if(e instanceof ArrayBuffer)if(o.decode(new Uint8Array(e,0,4))===H){try{a[E.KHR_BINARY_GLTF]=new G(e)}catch(e){i&&i(e);return}n=JSON.parse(a[E.KHR_BINARY_GLTF].content)}else n=JSON.parse(o.decode(e));else n=e;if(void 0===n.asset||n.asset.version[0]<2){i&&i(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let l=new ec(n,{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"),s[t.name]=t,a[t.name]=!0}if(n.extensionsUsed)for(let e=0;e<n.extensionsUsed.length;++e){let t=n.extensionsUsed[e],r=n.extensionsRequired||[];switch(t){case E.KHR_MATERIALS_UNLIT:a[t]=new _;break;case E.KHR_DRACO_MESH_COMPRESSION:a[t]=new V(n,this.dracoLoader);break;case E.KHR_TEXTURE_TRANSFORM:a[t]=new j;break;case E.KHR_MESH_QUANTIZATION:a[t]=new q;break;default:r.indexOf(t)>=0&&void 0===s[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(a),l.setPlugins(s),l.parse(r,i)}parseAsync(e,t){let r=this;return new Promise(function(i,n){r.parse(e,t,i,n)})}}function S(){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 E={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_DISPERSION:"KHR_materials_dispersion",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 w{constructor(e){this.parser=e,this.name=E.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,i=t.length;r<i;r++){let i=t[r];i.extensions&&i.extensions[this.name]&&void 0!==i.extensions[this.name].light&&e._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(e){let t,r=this.parser,i="light:"+e,n=r.cache.get(i);if(n)return n;let a=r.json,s=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e],o=new g.Q1f(0xffffff);void 0!==s.color&&o.setRGB(s.color[0],s.color[1],s.color[2],g.Zr2);let l=void 0!==s.range?s.range:0;switch(s.type){case"directional":(t=new g.ZyN(o)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new g.HiM(o)).distance=l;break;case"spot":(t=new g.nCl(o)).distance=l,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,t.angle=s.spot.outerConeAngle,t.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return t.position.set(0,0,0),ea(t,s),void 0!==s.intensity&&(t.intensity=s.intensity),t.name=r.createUniqueName(s.name||"light_"+e),n=Promise.resolve(t),r.cache.add(i,n),n}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,r=this.parser,i=r.json.nodes[e],n=(i.extensions&&i.extensions[this.name]||{}).light;return void 0===n?null:this._loadLight(n).then(function(e){return r._getNodeRef(t.cache,n,e)})}}class _{constructor(){this.name=E.KHR_MATERIALS_UNLIT}getMaterialType(){return g.V9B}extendParams(e,t,r){let i=[];e.color=new g.Q1f(1,1,1),e.opacity=1;let n=t.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){let t=n.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],g.Zr2),e.opacity=t[3]}void 0!==n.baseColorTexture&&i.push(r.assignTexture(e,"map",n.baseColorTexture,"srgb"))}return Promise.all(i)}}class C{constructor(e){this.parser=e,this.name=E.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 i=r.extensions[this.name].emissiveStrength;return void 0!==i&&(t.emissiveIntensity=i),Promise.resolve()}}class M{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&n.push(r.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&n.push(r.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(n.push(r.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){let e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new g.I9Y(e,e)}return Promise.all(n)}}class I{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_DISPERSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=r.extensions[this.name];return t.dispersion=void 0!==i.dispersion?i.dispersion:0,Promise.resolve()}}class T{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];return void 0!==a.iridescenceFactor&&(t.iridescence=a.iridescenceFactor),void 0!==a.iridescenceTexture&&n.push(r.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),void 0!==a.iridescenceIor&&(t.iridescenceIOR=a.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==a.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),void 0!==a.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),void 0!==a.iridescenceThicknessTexture&&n.push(r.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(n)}}class R{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[];t.sheenColor=new g.Q1f(0,0,0),t.sheenRoughness=0,t.sheen=1;let a=i.extensions[this.name];if(void 0!==a.sheenColorFactor){let e=a.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],g.Zr2)}return void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&n.push(r.assignTexture(t,"sheenColorMap",a.sheenColorTexture,"srgb")),void 0!==a.sheenRoughnessTexture&&n.push(r.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(n)}}class B{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];return void 0!==a.transmissionFactor&&(t.transmission=a.transmissionFactor),void 0!==a.transmissionTexture&&n.push(r.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(n)}}class k{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&n.push(r.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;let s=a.attenuationColor||[1,1,1];return t.attenuationColor=new g.Q1f().setRGB(s[0],s[1],s[2],g.Zr2),Promise.all(n)}}class P{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=r.extensions[this.name];return t.ior=void 0!==i.ior?i.ior:1.5,Promise.resolve()}}class D{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&n.push(r.assignTexture(t,"specularIntensityMap",a.specularTexture));let s=a.specularColorFactor||[1,1,1];return t.specularColor=new g.Q1f().setRGB(s[0],s[1],s[2],g.Zr2),void 0!==a.specularColorTexture&&n.push(r.assignTexture(t,"specularColorMap",a.specularColorTexture,"srgb")),Promise.all(n)}}class L{constructor(e){this.parser=e,this.name=E.EXT_MATERIALS_BUMP}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];return t.bumpScale=void 0!==a.bumpFactor?a.bumpFactor:1,void 0!==a.bumpTexture&&n.push(r.assignTexture(t,"bumpMap",a.bumpTexture)),Promise.all(n)}}class F{constructor(e){this.parser=e,this.name=E.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?g.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];return void 0!==a.anisotropyStrength&&(t.anisotropy=a.anisotropyStrength),void 0!==a.anisotropyRotation&&(t.anisotropyRotation=a.anisotropyRotation),void 0!==a.anisotropyTexture&&n.push(r.assignTexture(t,"anisotropyMap",a.anisotropyTexture)),Promise.all(n)}}class N{constructor(e){this.parser=e,this.name=E.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,r=t.json,i=r.textures[e];if(!i.extensions||!i.extensions[this.name])return null;let n=i.extensions[this.name],a=t.options.ktx2Loader;if(!a)if(!(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,a)}}class U{constructor(e){this.parser=e,this.name=E.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,r=this.parser,i=r.json,n=i.textures[e];if(!n.extensions||!n.extensions[t])return null;let a=n.extensions[t],s=i.images[a.source],o=r.textureLoader;if(s.uri){let e=r.options.manager.getHandler(s.uri);null!==e&&(o=e)}return r.loadTextureImage(e,a.source,o)}}class O{constructor(e){this.parser=e,this.name=E.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,r=this.parser,i=r.json,n=i.textures[e];if(!n.extensions||!n.extensions[t])return null;let a=n.extensions[t],s=i.images[a.source],o=r.textureLoader;if(s.uri){let e=r.options.manager.getHandler(s.uri);null!==e&&(o=e)}return r.loadTextureImage(e,a.source,o)}}class Q{constructor(e){this.name=E.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],i=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return i.then(function(t){let r=e.byteOffset||0,i=e.byteLength||0,a=e.count,s=e.byteStride,o=new Uint8Array(t,r,i);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(a,s,o,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(a*s);return n.decodeGltfBuffer(new Uint8Array(t),a,s,o,e.mode,e.filter),t})})}}}class z{constructor(e){this.name=E.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!==K.TRIANGLES&&e.mode!==K.TRIANGLE_STRIP&&e.mode!==K.TRIANGLE_FAN&&void 0!==e.mode)return null;let i=r.extensions[this.name].attributes,n=[],a={};for(let e in i)n.push(this.parser.getDependency("accessor",i[e]).then(t=>(a[e]=t,a[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],i=e[0].count,n=[];for(let e of r){let t=new g.kn4,r=new g.Pq0,s=new g.PTz,o=new g.Pq0(1,1,1),l=new g.ZLX(e.geometry,e.material,i);for(let e=0;e<i;e++)a.TRANSLATION&&r.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&s.fromBufferAttribute(a.ROTATION,e),a.SCALE&&o.fromBufferAttribute(a.SCALE,e),l.setMatrixAt(e,t.compose(r,s,o));for(let t in a)if("_COLOR_0"===t){let e=a[t];l.instanceColor=new g.uWO(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);g.B69.prototype.copy.call(l,e),this.parser.assignFinalMaterial(l),n.push(l)}return t.isGroup?(t.clear(),t.add(...n),t):n[0]}))}}let H="glTF";class G{constructor(e){this.name=E.KHR_BINARY_GLTF,this.content=null,this.body=null;const 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!==H)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-12,n=new DataView(e,12);let a=0;for(;a<i;){const t=n.getUint32(a,!0);a+=4;const i=n.getUint32(a,!0);if(a+=4,0x4e4f534a===i){const i=new Uint8Array(e,12+a,t);this.content=r.decode(i)}else if(5130562===i){const r=12+a;this.body=e.slice(r,r+t)}a+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class V{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=E.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let r=this.json,i=this.dracoLoader,n=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,s={},o={},l={};for(let e in a)s[et[e]||e.toLowerCase()]=a[e];for(let t in e.attributes){let i=et[t]||t.toLowerCase();if(void 0!==a[t]){let n=r.accessors[e.attributes[t]],a=$[n.componentType];l[i]=a.name,o[i]=!0===n.normalized}}return t.getDependency("bufferView",n).then(function(e){return new Promise(function(t,r){i.decodeDracoFile(e,function(e){for(let t in e.attributes){let r=e.attributes[t],i=o[t];void 0!==i&&(r.normalized=i)}t(e)},s,l,g.Zr2,r)})})}}class j{constructor(){this.name=E.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 q{constructor(){this.name=E.KHR_MESH_QUANTIZATION}}class W extends g.lGw{constructor(e,t,r,i){super(e,t,r,i)}copySampleValue_(e){let t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,n=e*i*3+i;for(let e=0;e!==i;e++)t[e]=r[n+e];return t}interpolate_(e,t,r,i){let n=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=2*s,l=3*s,c=i-t,h=(r-t)/c,u=h*h,d=u*h,p=e*l,f=p-l,g=-2*d+3*u,m=d-u,A=1-g,b=m-u+h;for(let e=0;e!==s;e++){let t=a[f+e+s],r=a[f+e+o]*c,i=a[p+e+s],l=a[p+e]*c;n[e]=A*t+b*r+g*i+m*l}return n}}let X=new g.PTz;class Y extends W{interpolate_(e,t,r,i){let n=super.interpolate_(e,t,r,i);return X.fromArray(n).normalize().toArray(n),n}}let K={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},$={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},J={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},Z={33071:1001,33648:1002,10497:1e3},ee={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},et={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"},er={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ei={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300};function en(e,t,r){for(let i in r.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=r.extensions[i])}function ea(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 es(e){let t="",r=Object.keys(e).sort();for(let i=0,n=r.length;i<n;i++)t+=r[i]+":"+e[r[i]]+";";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 g.kn4;class ec{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new S,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,i=-1,n=!1,a=-1;if("u">typeof navigator){const e=navigator.userAgent;r=!0===/^((?!chrome|android).)*safari/i.test(e);const t=e.match(/Version\/(\d+)/);i=r&&t?parseInt(t[1],10):-1,a=(n=e.indexOf("Firefox")>-1)?e.match(/Firefox\/([0-9]+)\./)[1]:-1}"u"<typeof createImageBitmap||r&&i<17||n&&a<98?this.textureLoader=new g.Tap(this.options.manager):this.textureLoader=new g.Kzg(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new g.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,i=this.json,n=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()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let a={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:r,userData:{}};return en(n,a,i),ea(a,i),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,i=t.length;r<i;r++){let i=t[r].joints;for(let t=0,r=i.length;t<r;t++)e[i[t]].isBone=!0}for(let t=0,i=e.length;t<i;t++){let i=e[t];void 0!==i.mesh&&(this._addNodeRef(this.meshCache,i.mesh),void 0!==i.skin&&(r[i.mesh].isSkinnedMesh=!0)),void 0!==i.camera&&this._addNodeRef(this.cameraCache,i.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 i=r.clone(),n=(e,t)=>{let r=this.associations.get(e);for(let[i,a]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(a,t.children[i])};return n(r,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){let i=e(t[r]);if(i)return i}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let r=[];for(let i=0;i<t.length;i++){let n=e(t[i]);n&&r.push(n)}return r}getDependency(e,t){let r=e+":"+t,i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case"mesh":i=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(!(i=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)})))throw Error("Unknown type: "+e)}this.cache.add(r,i)}return i}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,i){return r.getDependency(e,i)})),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[E.KHR_BINARY_GLTF].body);let i=this.options;return new Promise(function(e,n){r.load(g.r6x.resolveURL(t.uri,i.path),e,void 0,function(){n(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,i=t.byteOffset||0;return e.slice(i,i+r)})}loadAccessor(e){let t=this,r=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse){let e=ee[i.type],t=$[i.componentType],r=!0===i.normalized,n=new t(i.count*e);return Promise.resolve(new g.THS(n,e,r))}let n=[];return void 0!==i.bufferView?n.push(this.getDependency("bufferView",i.bufferView)):n.push(null),void 0!==i.sparse&&(n.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(n).then(function(e){let n,a,s=e[0],o=ee[i.type],l=$[i.componentType],c=l.BYTES_PER_ELEMENT,h=c*o,u=i.byteOffset||0,d=void 0!==i.bufferView?r.bufferViews[i.bufferView].byteStride:void 0,p=!0===i.normalized;if(d&&d!==h){let e=Math.floor(u/d),r="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+e+":"+i.count,h=t.cache.get(r);h||(n=new l(s,e*d,i.count*d/c),h=new g.eB$(n,d/c),t.cache.add(r,h)),a=new g.eHs(h,o,u%d/c,p)}else n=null===s?new l(i.count*o):new l(s,u,i.count*o),a=new g.THS(n,o,p);if(void 0!==i.sparse){let t=ee.SCALAR,r=$[i.sparse.indices.componentType],n=i.sparse.indices.byteOffset||0,c=i.sparse.values.byteOffset||0,h=new r(e[1],n,i.sparse.count*t),u=new l(e[2],c,i.sparse.count*o);null!==s&&(a=new g.THS(a.array.slice(),a.itemSize,a.normalized)),a.normalized=!1;for(let e=0,t=h.length;e<t;e++){let t=h[e];if(a.setX(t,u[e*o]),o>=2&&a.setY(t,u[e*o+1]),o>=3&&a.setZ(t,u[e*o+2]),o>=4&&a.setW(t,u[e*o+3]),o>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}a.normalized=p}return a})}loadTexture(e){let t=this.json,r=this.options,i=t.textures[e].source,n=t.images[i],a=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(a=e)}return this.loadTextureImage(e,i,a)}loadTextureImage(e,t,r){let i=this,n=this.json,a=n.textures[e],s=n.images[t],o=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[o])return this.textureCache[o];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||s.name||"",""===t.name&&"string"==typeof s.uri&&!1===s.uri.startsWith("data:image/")&&(t.name=s.uri);let r=(n.samplers||{})[a.sampler]||{};return t.magFilter=J[r.magFilter]||1006,t.minFilter=J[r.minFilter]||1008,t.wrapS=Z[r.wrapS]||1e3,t.wrapT=Z[r.wrapT]||1e3,t.generateMipmaps=!t.isCompressedTexture&&1003!==t.minFilter&&1006!==t.minFilter,i.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[o]=l,l}loadImageSource(e,t){let r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let n=r.images[e],a=self.URL||self.webkitURL,s=n.uri||"",o=!1;if(void 0!==n.bufferView)s=this.getDependency("bufferView",n.bufferView).then(function(e){o=!0;let t=new Blob([e],{type:n.mimeType});return s=a.createObjectURL(t)});else if(void 0===n.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(s).then(function(e){return new Promise(function(r,n){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new g.gPd(e);t.needsUpdate=!0,r(t)}),t.load(g.r6x.resolveURL(e,i.path),a,void 0,n)})}).then(function(e){var t;return!0===o&&a.revokeObjectURL(s),ea(e,n),e.userData.mimeType=n.mimeType||((t=n.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":t.search(/\.ktx2($|\?)/i)>0||0===t.search(/^data\:image\/ktx2/)?"image/ktx2":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,i){let n=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((a=a.clone()).channel=r.texCoord),n.extensions[E.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[E.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(a);a=n.extensions[E.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),n.associations.set(a,t)}}return void 0!==i&&(a.colorSpace=i),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,r=e.material,i=void 0===t.attributes.tangent,n=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 g.BH$,g.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 g.mrM,g.imn.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(i||n||a){let e="ClonedMaterial:"+r.uuid+":";i&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),a&&(t.flatShading=!0),i&&(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 g._4j}loadMaterial(e){let t,r=this,i=this.json,n=this.extensions,a=i.materials[e],s={},o=a.extensions||{},l=[];if(o[E.KHR_MATERIALS_UNLIT]){let e=n[E.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(s,a,r))}else{let i=a.pbrMetallicRoughness||{};if(s.color=new g.Q1f(1,1,1),s.opacity=1,Array.isArray(i.baseColorFactor)){let e=i.baseColorFactor;s.color.setRGB(e[0],e[1],e[2],g.Zr2),s.opacity=e[3]}void 0!==i.baseColorTexture&&l.push(r.assignTexture(s,"map",i.baseColorTexture,"srgb")),s.metalness=void 0!==i.metallicFactor?i.metallicFactor:1,s.roughness=void 0!==i.roughnessFactor?i.roughnessFactor:1,void 0!==i.metallicRoughnessTexture&&(l.push(r.assignTexture(s,"metalnessMap",i.metallicRoughnessTexture)),l.push(r.assignTexture(s,"roughnessMap",i.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,s)})))}!0===a.doubleSided&&(s.side=2);let c=a.alphaMode||"OPAQUE";if("BLEND"===c?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,"MASK"===c&&(s.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==g.V9B&&(l.push(r.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new g.I9Y(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;s.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==g.V9B&&(l.push(r.assignTexture(s,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(s.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==g.V9B){let e=a.emissiveFactor;s.emissive=new g.Q1f().setRGB(e[0],e[1],e[2],g.Zr2)}return void 0!==a.emissiveTexture&&t!==g.V9B&&l.push(r.assignTexture(s,"emissiveMap",a.emissiveTexture,"srgb")),Promise.all(l).then(function(){let i=new t(s);return a.name&&(i.name=a.name),ea(i,a),r.associations.set(i,{materials:e}),a.extensions&&en(n,i,a),i})}createUniqueName(e){let t=g.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,i=this.primitiveCache,n=[];for(let a=0,s=e.length;a<s;a++){let s=e[a],o=function(e){let t,r=e.extensions&&e.extensions[E.KHR_DRACO_MESH_COMPRESSION];if(t=r?"draco:"+r.bufferView+":"+r.indices+":"+es(r.attributes):e.indices+":"+es(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,i=e.targets.length;r<i;r++)t+=":"+es(e.targets[r]);return t}(s),l=i[o];if(l)n.push(l.promise);else{let e;e=s.extensions&&s.extensions[E.KHR_DRACO_MESH_COMPRESSION]?function(e){return r[E.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(r){return eh(r,e,t)})}(s):eh(new g.LoY,s,t),i[o]={primitive:s,promise:e},n.push(e)}}return Promise.all(n)}loadMesh(e){let t=this,r=this.json,i=this.extensions,n=r.meshes[e],a=n.primitives,s=[];for(let e=0,t=a.length;e<t;e++){var o;let t=void 0===a[e].material?(void 0===(o=this.cache).DefaultMaterial&&(o.DefaultMaterial=new g._4j({color:0xffffff,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),o.DefaultMaterial):this.getDependency("material",a[e].material);s.push(t)}return s.push(t.loadGeometries(a)),Promise.all(s).then(function(r){let s=r.slice(0,r.length-1),o=r[r.length-1],l=[];for(let r=0,c=o.length;r<c;r++){let c,h=o[r],u=a[r],d=s[r];if(u.mode===K.TRIANGLES||u.mode===K.TRIANGLE_STRIP||u.mode===K.TRIANGLE_FAN||void 0===u.mode)!0===(c=!0===n.isSkinnedMesh?new g.I46(h,d):new g.eaF(h,d)).isSkinnedMesh&&c.normalizeSkinWeights(),u.mode===K.TRIANGLE_STRIP?c.geometry=y(c.geometry,1):u.mode===K.TRIANGLE_FAN&&(c.geometry=y(c.geometry,2));else if(u.mode===K.LINES)c=new g.DXC(h,d);else if(u.mode===K.LINE_STRIP)c=new g.N1A(h,d);else if(u.mode===K.LINE_LOOP)c=new g.FCc(h,d);else if(u.mode===K.POINTS)c=new g.ONl(h,d);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);Object.keys(c.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,i=t.weights.length;r<i;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,i=r.length;t<i;t++)e.morphTargetDictionary[r[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(c,n),c.name=t.createUniqueName(n.name||"mesh_"+e),ea(c,n),u.extensions&&en(i,c,u),t.assignFinalMaterial(c),l.push(c)}for(let r=0,i=l.length;r<i;r++)t.associations.set(l[r],{meshes:e,primitives:r});if(1===l.length)return n.extensions&&en(i,l[0],n),l[0];let c=new g.YJl;n.extensions&&en(i,c,n),t.associations.set(c,{meshes:e});for(let e=0,t=l.length;e<t;e++)c.add(l[e]);return c})}loadCamera(e){let t,r=this.json.cameras[e],i=r[r.type];return i?("perspective"===r.type?t=new g.ubm(g.cj9.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===r.type&&(t=new g.qUd(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),ea(t,r),Promise.resolve(t)):void console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){let t=this.json.skins[e],r=[];for(let e=0,i=t.joints.length;e<i;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(),i=[],n=[];for(let a=0,s=e.length;a<s;a++){let s=e[a];if(s){i.push(s);let e=new g.kn4;null!==r&&e.fromArray(r.array,16*a),n.push(e)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new g.EAD(i,n)})}loadAnimation(e){let t=this.json,r=this,i=t.animations[e],n=i.name?i.name:"animation_"+e,a=[],s=[],o=[],l=[],c=[];for(let e=0,t=i.channels.length;e<t;e++){let t=i.channels[e],r=i.samplers[t.sampler],n=t.target,h=n.node,u=void 0!==i.parameters?i.parameters[r.input]:r.input,d=void 0!==i.parameters?i.parameters[r.output]:r.output;void 0!==n.node&&(a.push(this.getDependency("node",h)),s.push(this.getDependency("accessor",u)),o.push(this.getDependency("accessor",d)),l.push(r),c.push(n))}return Promise.all([Promise.all(a),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(c)]).then(function(e){let t=e[0],a=e[1],s=e[2],o=e[3],l=e[4],c=[];for(let e=0,i=t.length;e<i;e++){let i=t[e],n=a[e],h=s[e],u=o[e],d=l[e];if(void 0===i)continue;i.updateMatrix&&i.updateMatrix();let p=r._createAnimationTracks(i,n,h,u,d);if(p)for(let e=0;e<p.length;e++)c.push(p[e])}let h=new g.tz3(n,void 0,c);return ea(h,i),h})}createNodeMesh(e){let t=this.json,r=this,i=t.nodes[e];return void 0===i.mesh?null:r.getDependency("mesh",i.mesh).then(function(e){let t=r._getNodeRef(r.meshCache,i.mesh,e);return void 0!==i.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,r=i.weights.length;t<r;t++)e.morphTargetInfluences[t]=i.weights[t]}),t})}loadNode(e){let t=this.json.nodes[e],r=this._loadNodeShallow(e),i=[],n=t.children||[];for(let e=0,t=n.length;e<t;e++)i.push(this.getDependency("node",n[e]));let a=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([r,Promise.all(i),a]).then(function(e){let t=e[0],r=e[1],i=e[2];null!==i&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(i,el)});for(let e=0,i=r.length;e<i;e++)t.add(r[e]);return t})}_loadNodeShallow(e){let t=this.json,r=this.extensions,i=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];let n=t.nodes[e],a=n.name?i.createUniqueName(n.name):"",s=[],o=i._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return o&&s.push(o),void 0!==n.camera&&s.push(i.getDependency("camera",n.camera).then(function(e){return i._getNodeRef(i.cameraCache,n.camera,e)})),i._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){s.push(e)}),this.nodeCache[e]=Promise.all(s).then(function(t){let s;if((s=!0===n.isBone?new g.$Kf:t.length>1?new g.YJl:1===t.length?t[0]:new g.B69)!==t[0])for(let e=0,r=t.length;e<r;e++)s.add(t[e]);if(n.name&&(s.userData.name=n.name,s.name=a),ea(s,n),n.extensions&&en(r,s,n),void 0!==n.matrix){let e=new g.kn4;e.fromArray(n.matrix),s.applyMatrix4(e)}else void 0!==n.translation&&s.position.fromArray(n.translation),void 0!==n.rotation&&s.quaternion.fromArray(n.rotation),void 0!==n.scale&&s.scale.fromArray(n.scale);if(i.associations.has(s)){if(void 0!==n.mesh&&i.meshCache.refs[n.mesh]>1){let e=i.associations.get(s);i.associations.set(s,{...e})}}else i.associations.set(s,{});return i.associations.get(s).nodes=e,s}),this.nodeCache[e]}loadScene(e){let t=this.extensions,r=this.json.scenes[e],i=this,n=new g.YJl;r.name&&(n.name=i.createUniqueName(r.name)),ea(n,r),r.extensions&&en(t,n,r);let a=r.nodes||[],s=[];for(let e=0,t=a.length;e<t;e++)s.push(i.getDependency("node",a[e]));return Promise.all(s).then(function(e){for(let t=0,r=e.length;t<r;t++)n.add(e[t]);return i.associations=(e=>{let t=new Map;for(let[e,r]of i.associations)(e instanceof g.imn||e instanceof g.gPd)&&t.set(e,r);return e.traverse(e=>{let r=i.associations.get(e);null!=r&&t.set(e,r)}),t})(n),n})}_createAnimationTracks(e,t,r,i,n){let a,s=[],o=e.name?e.name:e.uuid,l=[];switch(er[n.path]===er.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(o),er[n.path]){case er.weights:a=g.Hit;break;case er.rotation:a=g.MBL;break;case er.translation:case er.scale:a=g.RiT;break;default:a=1===r.itemSize?g.Hit:g.RiT}let c=void 0!==i.interpolation?ei[i.interpolation]:2301,h=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e<r;e++){let r=new a(l[e]+"."+er[n.path],t.array,h,c);"CUBICSPLINE"===i.interpolation&&this._createCubicSplineTrackInterpolant(r),s.push(r)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=eo(t.constructor),r=new Float32Array(t.length);for(let i=0,n=t.length;i<n;i++)r[i]=t[i]*e;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof g.MBL?Y:W)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function eh(e,t,r){let i=t.attributes,n=[];for(let t in i){let a=et[t]||t.toLowerCase();a in e.attributes||n.push(function(t,i){return r.getDependency("accessor",t).then(function(t){e.setAttribute(i,t)})}(i[t],a))}if(void 0!==t.indices&&!e.index){let i=r.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});n.push(i)}return g.ppV.workingColorSpace!==g.Zr2&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${g.ppV.workingColorSpace}" not supported.`),ea(e,t),!function(e,t,r){let i=t.attributes,n=new g.NRn;if(void 0===i.POSITION)return;{let e=r.json.accessors[i.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(n.set(new g.Pq0(t[0],t[1],t[2]),new g.Pq0(a[0],a[1],a[2])),e.normalized){let t=eo($[e.componentType]);n.min.multiplyScalar(t),n.max.multiplyScalar(t)}}let a=t.targets;if(void 0!==a){let e=new g.Pq0,t=new g.Pq0;for(let i=0,n=a.length;i<n;i++){let n=a[i];if(void 0!==n.POSITION){let i=r.json.accessors[n.POSITION],a=i.min,s=i.max;if(void 0!==a&&void 0!==s){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(s[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(s[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(s[2]))),i.normalized){let e=eo($[i.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(e)}e.boundingBox=n;let s=new g.iyt;n.getCenter(s.center),s.radius=n.min.distanceTo(n.max)/2,e.boundingSphere=s}(e,t,r),Promise.all(n).then(function(){return void 0!==t.targets?function(e,t,r){let i=!1,n=!1,a=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(void 0!==r.POSITION&&(i=!0),void 0!==r.NORMAL&&(n=!0),void 0!==r.COLOR_0&&(a=!0),i&&n&&a)break}if(!i&&!n&&!a)return Promise.resolve(e);let s=[],o=[],l=[];for(let c=0,h=t.length;c<h;c++){let h=t[c];if(i){let t=void 0!==h.POSITION?r.getDependency("accessor",h.POSITION):e.attributes.position;s.push(t)}if(n){let t=void 0!==h.NORMAL?r.getDependency("accessor",h.NORMAL):e.attributes.normal;o.push(t)}if(a){let t=void 0!==h.COLOR_0?r.getDependency("accessor",h.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(l)]).then(function(t){let r=t[0],s=t[1],o=t[2];return i&&(e.morphAttributes.position=r),n&&(e.morphAttributes.normal=s),a&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e})}(e,t.targets,r):e})}class eu{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){let t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return -1}_onMessage(e,t){let r=this.workersResolve[e];if(r&&r(t),this.queue.length){let{resolve:t,msg:r,transfer:i}=this.queue.shift();this.workersResolve[e]=t,this.workers[e].postMessage(r,i)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(r=>{let i=this._getIdleWorker();-1!==i?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=r,this.workers[i].postMessage(e,t)):this.queue.push({resolve:r,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class ed{constructor(e,t,r,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,r),this._littleEndian=i,this._offset=0}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian)+0x100000000*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){let r=this._offset,i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+r,i)}}new Uint8Array([0]);let ep=[171,75,84,88,32,50,48,187,13,10,26,10];function ef(e){return(new TextDecoder).decode(e)}let eg={env:{emscripten_notify_memory_growth:function(e){a=new Uint8Array(n.exports.memory.buffer)}}};class em{init(){return i||(i="u">typeof fetch?fetch("data:application/wasm;base64,"+eA).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,eg)).then(this._init):WebAssembly.instantiate(Buffer.from(eA,"base64"),eg).then(this._init))}_init(e){n=e.instance,eg.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!n)throw Error("ZSTDDecoder: Await .init() before decoding.");let r=e.byteLength,i=n.exports.malloc(r);a.set(e,i),t=t||Number(n.exports.ZSTD_findDecompressedSize(i,r));let s=n.exports.malloc(t),o=n.exports.ZSTD_decompress(s,t,i,r),l=a.slice(s,s+o);return n.exports.free(i),n.exports.free(s),l}}let eA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ";({...g.ppV.spaces.srgb,outputColorSpaceConfig:{drawingBufferColorSpace:"srgb",toneMappingMode:"extended"}});let eb=new WeakMap,ev=0;class ey extends g.aHM{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new eu,this.workerSourceURL="",this.workerConfig=null,"u">typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return console.warn('KTX2Loader: "detectSupportAsync()" has been deprecated. Use "detectSupport()" and "await renderer.init();" when creating the renderer.'),await e.init(),this.detectSupport(e)}detectSupport(e){return!0===e.isWebGPURenderer?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-s3tc"),bptcSupported:e.hasFeature("texture-compression-bc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},"u">typeof navigator&&navigator.platform.indexOf("Linux")>=0&&navigator.userAgent.indexOf("Firefox")>=0&&this.workerConfig.astcSupported&&this.workerConfig.etc2Supported&&this.workerConfig.bptcSupported&&this.workerConfig.dxtSupported&&(this.workerConfig.astcSupported=!1,this.workerConfig.etc2Supported=!1)),this}init(){if(!this.transcoderPending){let e=new g.Y9S(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);let t=e.loadAsync("basis_transcoder.js"),r=new g.Y9S(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);let i=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([e,t])=>{let r=ey.BasisWorker.toString(),i=["/* constants */","let _EngineFormat = "+JSON.stringify(ey.EngineFormat),"let _EngineType = "+JSON.stringify(ey.EngineType),"let _TranscoderFormat = "+JSON.stringify(ey.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(ey.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i])),this.transcoderBinary=t,this.workerPool.setWorkerCreator(()=>{let e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:t},[t]),e})}),ev>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),ev++}return this.transcoderPending}load(e,t,r,i){if(null===this.workerConfig)throw Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");let n=new g.Y9S(this.manager);n.setPath(this.path),n.setCrossOrigin(this.crossOrigin),n.setWithCredentials(this.withCredentials),n.setRequestHeader(this.requestHeader),n.setResponseType("arraybuffer"),n.load(e,e=>{this.parse(e,t,i)},r,i)}parse(e,t,r){if(null===this.workerConfig)throw Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(eb.has(e))return eb.get(e).promise.then(t).catch(r);this._createTexture(e).then(e=>t?t(e):null).catch(r)}_createTextureFrom(e,t){let r,{type:i,error:n,data:{faces:a,width:s,height:o,format:l,type:c,dfdFlags:h}}=e;if("error"===i)return Promise.reject(n);if(6===t.faceCount)r=new g.c5h(a,l,c);else{let e=a[0].mipmaps;r=t.layerCount>1?new g.iOZ(e,s,o,t.layerCount,l,c):new g.FvD(e,s,o,l,c)}return r.minFilter=1===a[0].mipmaps.length?1006:1008,r.magFilter=1006,r.generateMipmaps=!1,r.needsUpdate=!0,r.colorSpace=e_(t),r.premultiplyAlpha=!!(1&h),r}async _createTexture(e,t={}){let r=function(e){let t=new Uint8Array(e.buffer,e.byteOffset,ep.length);if(t[0]!==ep[0]||t[1]!==ep[1]||t[2]!==ep[2]||t[3]!==ep[3]||t[4]!==ep[4]||t[5]!==ep[5]||t[6]!==ep[6]||t[7]!==ep[7]||t[8]!==ep[8]||t[9]!==ep[9]||t[10]!==ep[10]||t[11]!==ep[11])throw Error("Missing KTX 2.0 identifier.");let r={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},i=17*Uint32Array.BYTES_PER_ELEMENT,n=new ed(e,ep.length,i,!0);r.vkFormat=n._nextUint32(),r.typeSize=n._nextUint32(),r.pixelWidth=n._nextUint32(),r.pixelHeight=n._nextUint32(),r.pixelDepth=n._nextUint32(),r.layerCount=n._nextUint32(),r.faceCount=n._nextUint32(),r.levelCount=n._nextUint32(),r.supercompressionScheme=n._nextUint32();let a=n._nextUint32(),s=n._nextUint32(),o=n._nextUint32(),l=n._nextUint32(),c=n._nextUint64(),h=n._nextUint64(),u=3*Math.max(r.levelCount,1)*8,d=new ed(e,ep.length+i,u,!0);for(let t=0,i=Math.max(r.levelCount,1);t<i;t++)r.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});let p=new ed(e,a,s,!0);p._skip(4);let f=p._nextUint16(),g=p._nextUint16(),m=p._nextUint16(),A=p._nextUint16(),b={vendorId:f,descriptorType:g,versionNumber:m,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},v=(A/4-6)/4;for(let e=0;e<v;e++){let t={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&t.channelType?(t.sampleLower=p._nextInt32(),t.sampleUpper=p._nextInt32()):(t.sampleLower=p._nextUint32(),t.sampleUpper=p._nextUint32()),b.samples[e]=t}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(b);let y=new ed(e,o,l,!0);for(;y._offset<l;){let e=y._nextUint32(),t=y._scan(e),i=ef(t);if(r.keyValue[i]=y._nextUint8Array(e-t.byteLength-1),i.match(/^ktx/i)){let e=ef(r.keyValue[i]);r.keyValue[i]=e.substring(0,e.lastIndexOf("\0"))}y._skip(e%4?4-e%4:0)}if(h<=0)return r;let x=new ed(e,c,h,!0),S=x._nextUint16(),E=x._nextUint16(),w=x._nextUint32(),_=x._nextUint32(),C=x._nextUint32(),M=x._nextUint32(),I=[];for(let e=0,t=Math.max(r.levelCount,1);e<t;e++)I.push({imageFlags:x._nextUint32(),rgbSliceByteOffset:x._nextUint32(),rgbSliceByteLength:x._nextUint32(),alphaSliceByteOffset:x._nextUint32(),alphaSliceByteLength:x._nextUint32()});let T=c+x._offset,R=T+w,B=R+_,k=B+C;return r.globalData={endpointCount:S,selectorCount:E,imageDescs:I,endpointsData:new Uint8Array(e.buffer,e.byteOffset+T,w),selectorsData:new Uint8Array(e.buffer,e.byteOffset+R,_),tablesData:new Uint8Array(e.buffer,e.byteOffset+B,C),extendedData:new Uint8Array(e.buffer,e.byteOffset+k,M)},r}(new Uint8Array(e)),i=1000066e3===r.vkFormat&&167===r.dataFormatDescriptor[0].colorModel;if(!(0===r.vkFormat||i&&!this.workerConfig.astcHDRSupported))return ew(r);let n=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:t},[e])).then(e=>this._createTextureFrom(e.data,r));return eb.set(e,{promise:n}),n}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),ev--}}ey.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},ey.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},ey.EngineFormat={RGBAFormat:1023,RGBA_ASTC_4x4_Format:37808,RGB_BPTC_UNSIGNED_Format:36495,RGBA_BPTC_Format:36492,RGBA_ETC2_EAC_Format:37496,RGBA_PVRTC_4BPPV1_Format:35842,RGBA_S3TC_DXT5_Format:33779,RGB_ETC1_Format:36196,RGB_ETC2_Format:37492,RGB_PVRTC_4BPPV1_Format:35840,RGBA_S3TC_DXT1_Format:33777},ey.EngineType={UnsignedByteType:1009,HalfFloatType:1016,FloatType:1015},ey.BasisWorker=function(){let e,t,r,i=_EngineFormat,n=_EngineType,a=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(i){let a=i.data;switch(a.type){case"init":var o;e=a.config,o=a.transcoderBinary,t=new Promise(e=>{BASIS(r={wasmBinary:o,onRuntimeInitialized:e})}).then(()=>{r.initializeBasis(),void 0===r.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")});break;case"transcode":t.then(()=>{try{let{faces:t,buffers:i,width:o,height:h,hasAlpha:u,format:d,type:p,dfdFlags:f}=function(t){let i,a=new r.KTX2File(new Uint8Array(t));function o(){a.close(),a.delete()}if(!a.isValid())throw o(),Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");if(a.isUASTC())i=s.UASTC;else if(a.isETC1S())i=s.ETC1S;else if(a.isHDR())i=s.UASTC_HDR;else throw Error("THREE.KTX2Loader: Unknown Basis encoding");let h=a.getWidth(),u=a.getHeight(),d=a.getLayers()||1,p=a.getLevels(),f=a.getFaces(),g=a.getHasAlpha(),m=a.getDFDFlags(),{transcoderFormat:A,engineFormat:b,engineType:v}=function(t,r,i,n){let a=l[t];for(let s=0;s<a.length;s++){let o=a[s];if(o.if&&!e[o.if]||!o.basisFormat.includes(t)||n&&o.transcoderFormat.length<2||o.needsPowerOfTwo&&!(c(r)&&c(i)))continue;let l=o.transcoderFormat[+!!n],h=o.engineFormat[+!!n];return{transcoderFormat:l,engineFormat:h,engineType:o.engineType[0]}}throw Error("THREE.KTX2Loader: Failed to identify transcoding target.")}(i,h,u,g);if(!h||!u||!p)throw o(),Error("THREE.KTX2Loader: Invalid texture");if(!a.startTranscoding())throw o(),Error("THREE.KTX2Loader: .startTranscoding failed");let y=[],x=[];for(let e=0;e<f;e++){let t=[];for(let r=0;r<p;r++){let i,s,l=[];for(let t=0;t<d;t++){let c=a.getImageLevelInfo(r,t,e);0===e&&0===r&&0===t&&(c.origWidth%4!=0||c.origHeight%4!=0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),p>1?(i=c.origWidth,s=c.origHeight):(i=c.width,s=c.height);let h=new Uint8Array(a.getImageTranscodedSizeInBytes(r,t,0,A)),u=a.transcodeImage(h,r,t,e,A,0,-1,-1);if(v===n.HalfFloatType&&(h=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!u)throw o(),Error("THREE.KTX2Loader: .transcodeImage failed.");l.push(h)}let c=function(e){if(1===e.length)return e[0];let t=0;for(let r=0;r<e.length;r++)t+=e[r].byteLength;let r=new Uint8Array(t),i=0;for(let t=0;t<e.length;t++){let n=e[t];r.set(n,i),i+=n.byteLength}return r}(l);t.push({data:c,width:i,height:s}),x.push(c.buffer)}y.push({mipmaps:t,width:h,height:u,format:b,type:v})}return o(),{faces:y,buffers:x,width:h,height:u,hasAlpha:g,dfdFlags:m,format:b,type:v}}(a.buffer);self.postMessage({type:"transcode",id:a.id,data:{faces:t,width:o,height:h,hasAlpha:u,format:d,type:p,dfdFlags:f}},i)}catch(e){console.error(e),self.postMessage({type:"error",id:a.id,error:e.message})}})}});let o=[{if:"astcSupported",basisFormat:[s.UASTC],transcoderFormat:[a.ASTC_4x4,a.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],engineType:[n.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[a.BC7_M5,a.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],engineType:[n.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[a.BC1,a.BC3],engineFormat:[i.RGBA_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],engineType:[n.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[a.ETC1,a.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],engineType:[n.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[a.ETC1],engineFormat:[i.RGB_ETC1_Format],engineType:[n.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[a.PVRTC1_4_RGB,a.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],engineType:[n.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[s.UASTC_HDR],transcoderFormat:[a.BC6H],engineFormat:[i.RGB_BPTC_UNSIGNED_Format],engineType:[n.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[a.RGBA32,a.RGBA32],engineFormat:[i.RGBAFormat,i.RGBAFormat],engineType:[n.UnsignedByteType,n.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[s.UASTC_HDR],transcoderFormat:[a.RGBA_HALF],engineFormat:[i.RGBAFormat],engineType:[n.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],l={[s.ETC1S]:o.filter(e=>e.basisFormat.includes(s.ETC1S)).sort((e,t)=>e.priorityETC1S-t.priorityETC1S),[s.UASTC]:o.filter(e=>e.basisFormat.includes(s.UASTC)).sort((e,t)=>e.priorityUASTC-t.priorityUASTC),[s.UASTC_HDR]:o.filter(e=>e.basisFormat.includes(s.UASTC_HDR)).sort((e,t)=>e.priorityHDR-t.priorityHDR)};function c(e){return e<=2||(e&e-1)==0&&0!==e}};let ex=new Set([1023,1022,1030,1028]),eS={109:1023,103:1030,100:1028,97:1023,83:1030,76:1028,43:1023,37:1023,22:1030,16:1030,15:1028,9:1028,123:1022,122:1022,152:37496,148:37492,153:37488,154:37489,155:37490,156:37491,1000066e3:37808,158:37808,157:37808,0x3b9bcbd4:37812,166:37812,165:37812,134:33777,133:33777,132:33776,131:33776,138:33778,137:33778,140:36284,139:36283,142:36286,141:36285,146:36492,145:36492,0x3b9b9cf5:35842,0x3b9b9cf1:35842,0x3b9b9cf4:35843,1000054e3:35843},eE={109:1015,103:1015,100:1015,97:1016,83:1016,76:1016,43:1009,37:1009,22:1009,16:1009,15:1009,9:1009,123:35902,122:35899,152:1009,148:1009,153:1009,153:1009,155:1009,155:1009,1000066e3:1016,158:1009,157:1009,0x3b9bcbd4:1016,166:1009,165:1009,134:1009,133:1009,132:1009,131:1009,138:1009,137:1009,140:1009,139:1009,142:1009,141:1009,146:1009,145:1009,0x3b9b9cf5:1009,0x3b9b9cf1:1009,0x3b9b9cf4:1009,1000054e3:1009};async function ew(e){let t,r,{vkFormat:i}=e;if(void 0===eS[i])throw Error("THREE.KTX2Loader: Unsupported vkFormat: "+i);void 0===eE[i]&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+i),2===e.supercompressionScheme&&(s||(s=new Promise(async e=>{let t=new em;await t.init(),e(t)})),t=await s);let n=[];for(let r=0;r<e.levels.length;r++){let a,s,o=Math.max(1,e.pixelWidth>>r),l=Math.max(1,e.pixelHeight>>r),c=e.pixelDepth?Math.max(1,e.pixelDepth>>r):0,h=e.levels[r];if(0===e.supercompressionScheme)a=h.levelData;else if(2===e.supercompressionScheme)a=t.decode(h.levelData,h.uncompressedByteLength);else throw Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");s=1015===eE[i]?new Float32Array(a.buffer,a.byteOffset,a.byteLength/Float32Array.BYTES_PER_ELEMENT):1016===eE[i]?new Uint16Array(a.buffer,a.byteOffset,a.byteLength/Uint16Array.BYTES_PER_ELEMENT):35902===eE[i]||35899===eE[i]?new Uint32Array(a.buffer,a.byteOffset,a.byteLength/Uint32Array.BYTES_PER_ELEMENT):a,n.push({data:s,width:o,height:l,depth:c})}let a=0===e.levelCount||n.length>1;if(ex.has(eS[i]))(r=0===e.pixelDepth?new g.GYF(n[0].data,e.pixelWidth,e.pixelHeight):new g.dYF(n[0].data,e.pixelWidth,e.pixelHeight,e.pixelDepth)).minFilter=a?1004:1003,r.magFilter=1003,r.generateMipmaps=0===e.levelCount;else{if(e.pixelDepth>0)throw Error("THREE.KTX2Loader: Unsupported pixelDepth.");(r=new g.FvD(n,e.pixelWidth,e.pixelHeight)).minFilter=a?1008:1006,r.magFilter=1006}return r.mipmaps=n,r.type=eE[i],r.format=eS[i],r.colorSpace=e_(e),r.needsUpdate=!0,Promise.resolve(r)}function e_(e){let t=e.dataFormatDescriptor[0];return 1===t.colorPrimaries?2===t.transferFunction?"srgb":g.Zr2:10===t.colorPrimaries?2===t.transferFunction?"display-p3":"display-p3-linear":(0===t.colorPrimaries||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${t.colorPrimaries}"`),"")}let eC=Symbol("retainerCount"),eM=Symbol("recentlyUsed"),eI=Symbol("evict"),eT=Symbol("evictionThreshold"),eR=Symbol("cache");class eB{constructor(e,t=5){this[u]=new Map,this[d]=[],this[eR]=e,this[eT]=t}set evictionThreshold(e){this[eT]=e,this[eI]()}get evictionThreshold(){return this[eT]}get cache(){return this[eR]}retainerCount(e){return this[eC].get(e)||0}reset(){this[eC].clear(),this[eM]=[]}retain(e){this[eC].has(e)||this[eC].set(e,0),this[eC].set(e,this[eC].get(e)+1);let t=this[eM].indexOf(e);-1!==t&&this[eM].splice(t,1),this[eM].unshift(e),this[eI]()}release(e){this[eC].has(e)&&this[eC].set(e,Math.max(this[eC].get(e)-1,0)),this[eI]()}[(u=eC,d=eM,eI)](){if(!(this[eM].length<this[eT]))for(let e=this[eM].length-1;e>=this[eT];--e){let t=this[eM][e];0===this[eC].get(t)&&(this[eR].delete(t),this[eM].splice(e,1))}}}let ek=e=>{let t=new Map;for(let r of e.mappings)for(let e of r.variants)t.set(e,{material:null,gltfMaterialIndex:r.material});return t};class eP{constructor(e){this.parser=e,this.name="KHR_materials_variants"}afterRoot(e){let t=this.parser,r=t.json;if(void 0===r.extensions||void 0===r.extensions[this.name])return null;let i=(e=>{let t=[],r=new Set;for(let i of e){let e=i,n=0;for(;r.has(e);)e=i+"."+ ++n;r.add(e),t.push(e)}return t})((r.extensions[this.name].variants||[]).map(e=>e.name));for(let i of e.scenes)i.traverse(e=>{if(!e.material)return;let i=t.associations.get(e);if(null==i||null==i.meshes||null==i.primitives)return;let n=r.meshes[i.meshes].primitives[i.primitives].extensions;n&&n[this.name]&&(e.userData.variantMaterials=ek(n[this.name]))});return e.userData.variants=i,Promise.resolve()}}g.gPd.DEFAULT_ANISOTROPY=4;let eD=new Map,eL=new Map,eF=new b,eN=new ey,eU=Symbol("loader"),eO=Symbol("evictionPolicy"),eQ=Symbol("GLTFInstance");class ez extends g.Qev{static setDRACODecoderLocation(e){o=e,eF.setDecoderPath(e)}static getDRACODecoderLocation(){return o}static setKTX2TranscoderLocation(e){l=e,eN.setTranscoderPath(e)}static getKTX2TranscoderLocation(){return l}static setMeshoptDecoderLocation(e){c!==e&&(c=e,h=new Promise((t,r)=>{let i=document.createElement("script");document.body.appendChild(i),i.onload=t,i.onerror=r,i.async=!0,i.src=e}).then(()=>m.ready).then(()=>m))}static getMeshoptDecoderLocation(){return c}static initializeKTX2Loader(e){eN.detectSupport(e)}static get cache(){return eD}static clearCache(){eD.forEach((e,t)=>{this.delete(t)}),this[eO].reset()}static has(e){return eD.has(e)}static async delete(e){if(!this.has(e))return;let t=eD.get(e);eL.delete(e),eD.delete(e),(await t).dispose()}static hasFinishedLoading(e){return!!eL.get(e)}constructor(e){super(),this[f]=new x().register(e=>new eP(e)),this[eQ]=e,this[eU].setDRACOLoader(eF),this[eU].setKTX2Loader(eN)}get[(p=eO,f=eU,eO)](){return this.constructor[eO]}async preload(e,t,r=()=>{}){if(this[eU].setWithCredentials(t.withCredentials),this.dispatchEvent({type:"preload",element:t,src:e}),!eD.has(e)){null!=h&&this[eU].setMeshoptDecoder(await h);let t=((e,t,r=()=>{})=>{let i=e=>{let t=e.loaded/e.total;r(Math.max(0,Math.min(1,isFinite(t)?t:1)))};return new Promise((r,n)=>{t.load(e,r,i,n)})})(e,this[eU],e=>{r(.8*e)}),i=this[eQ],n=t.then(e=>i.prepare(e)).then(e=>(r(.9),new i(e))).catch(e=>(console.error(e),new i));eD.set(e,n)}await eD.get(e),eL.set(e,!0),r&&r(1)}async load(e,t,r=()=>{}){await this.preload(e,t,r);let i=await eD.get(e),n=await i.clone();return this[eO].retain(e),n.dispose=()=>{this[eO].release(e)},n}}ez[p]=new eB(ez)},8150(e,t,r){"use strict";r.d(t,{A:()=>i});class i{constructor(e=50){this.velocity=0,this.naturalFrequency=0,this.setDecayTime(e)}setDecayTime(e){this.naturalFrequency=1/Math.max(.001,e)}update(e,t,r,i){let n=2e-4*this.naturalFrequency;if(null==e||0===i||e===t&&0===this.velocity)return t;if(r<0)return e;let a=e-t,s=this.velocity+this.naturalFrequency*a,o=a+r*s,l=Math.exp(-this.naturalFrequency*r),c=(s-this.naturalFrequency*o)*l,h=-this.naturalFrequency*(c+s*l);return Math.abs(c)<n*Math.abs(i)&&h*a>=0?(this.velocity=0,t):(this.velocity=c,t+o*l)}}},5112(e,t,r){"use strict";r.d(t,{Y:()=>p});var i=r(874),n=r(3770),a=r(3935),s=r(1718);let o=new i.Pq0,l=new i.Pq0,c=new i.Pq0,h=new i.dwI,u=new i.lMl,d=new i.PTz;class p extends n.v{constructor(e){super(document.createElement("div")),this.normal=new i.Pq0(0,1,0),this.initialized=!1,this.referenceCount=1,this.pivot=document.createElement("div"),this.slot=document.createElement("slot"),this.element.classList.add("annotation-wrapper"),this.slot.name=e.name,this.element.appendChild(this.pivot),this.pivot.appendChild(this.slot),this.updatePosition(e.position),this.updateNormal(e.normal),this.surface=e.surface}get facingCamera(){return!this.element.classList.contains("hide")}show(){this.facingCamera&&this.initialized||this.updateVisibility(!0)}hide(){(this.facingCamera||!this.initialized)&&this.updateVisibility(!1)}increment(){this.referenceCount++}decrement(){return this.referenceCount>0&&--this.referenceCount,0===this.referenceCount}updatePosition(e){if(null==e)return;let t=(0,s.$y)(e)[0].terms;for(let e=0;e<3;++e)this.position.setComponent(e,(0,a.cg)(t[e]).number);this.updateMatrixWorld()}updateNormal(e){if(null==e)return;let t=(0,s.$y)(e)[0].terms;for(let e=0;e<3;++e)this.normal.setComponent(e,t[e].number)}updateSurface(){let{mesh:e,tri:t,bary:r}=this;if(null==e||null==t||null==r)return;e.getVertexPosition(t.x,o),e.getVertexPosition(t.y,l),e.getVertexPosition(t.z,c),o.toArray(h.elements,0),l.toArray(h.elements,3),c.toArray(h.elements,6),this.position.copy(r).applyMatrix3(h);let i=this.parent;i.worldToLocal(e.localToWorld(this.position)),u.set(o,l,c),u.getNormal(this.normal).transformDirection(e.matrixWorld);let n=i.parent;d.setFromAxisAngle(o.set(0,1,0),-n.rotation.y),this.normal.applyQuaternion(d)}orient(e){this.pivot.style.transform=`rotate(${e}rad)`}updateVisibility(e){this.element.classList.toggle("hide",!e),this.slot.assignedNodes().forEach(t=>{if(t.nodeType!==Node.ELEMENT_NODE)return;let r=t.dataset.visibilityAttribute;if(null!=r){let i=`data-${r}`;t.toggleAttribute(i,e)}t.dispatchEvent(new CustomEvent("hotspot-visibility",{detail:{visible:e}}))}),this.initialized=!0}}},5827(e,t,r){"use strict";let i;r.d(t,{A:()=>rx});var n=r(874);function a(){let e=null,t=!1,r=null,i=null;function n(t,a){r(t,a),i=e.requestAnimationFrame(n)}return{start:function(){!0===t||null!==r&&(i=e.requestAnimationFrame(n),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function s(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(r){r.isInterleavedBufferAttribute&&(r=r.data);let i=t.get(r);i&&(e.deleteBuffer(i.buffer),t.delete(r))},update:function(r,i){if(r.isInterleavedBufferAttribute&&(r=r.data),r.isGLBufferAttribute){let e=t.get(r);(!e||e.version<r.version)&&t.set(r,{buffer:r.buffer,type:r.type,bytesPerElement:r.elementSize,version:r.version});return}let n=t.get(r);if(void 0===n)t.set(r,function(t,r){let i,n=t.array,a=t.usage,s=n.byteLength,o=e.createBuffer();if(e.bindBuffer(r,o),e.bufferData(r,n,a),t.onUploadCallback(),n instanceof Float32Array)i=e.FLOAT;else if("u">typeof Float16Array&&n instanceof Float16Array)i=e.HALF_FLOAT;else if(n instanceof Uint16Array)i=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(n instanceof Int16Array)i=e.SHORT;else if(n instanceof Uint32Array)i=e.UNSIGNED_INT;else if(n instanceof Int32Array)i=e.INT;else if(n instanceof Int8Array)i=e.BYTE;else if(n instanceof Uint8Array)i=e.UNSIGNED_BYTE;else if(n instanceof Uint8ClampedArray)i=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+n);return{buffer:o,type:i,bytesPerElement:n.BYTES_PER_ELEMENT,version:t.version,size:s}}(r,i));else if(n.version<r.version){if(n.size!==r.array.byteLength)throw Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,r,i){let n=r.array,a=r.updateRanges;if(e.bindBuffer(i,t),0===a.length)e.bufferSubData(i,0,n);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let r=a[t],i=a[e];i.start<=r.start+r.count+1?r.count=Math.max(r.count,i.start+i.count-r.start):a[++t]=i}a.length=t+1;for(let t=0,r=a.length;t<r;t++){let r=a[t];e.bufferSubData(i,r.start*n.BYTES_PER_ELEMENT,n,r.start,r.count)}r.clearUpdateRanges()}r.onUploadCallback()}(n.buffer,r,i),n.version=r.version}}}}let o={alphahash_fragment:"#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif",batching_vertex:"#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",fog_vertex:"#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.metalness = metalnessFactor;\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = vec3( 0.04 );\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n vec3 diffuseColor;\n vec3 diffuseContribution;\n vec3 specularColor;\n vec3 specularColorBlended;\n float roughness;\n float metalness;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n vec3 iridescenceFresnelDielectric;\n vec3 iridescenceFresnelMetallic;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return v;\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColorBlended;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float rInv = 1.0 / ( roughness + 0.1 );\n float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n float DG = exp( a * dotNV + b );\n return saturate( DG );\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\n vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\n vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\n vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\n float Ess_V = dfgV.x + dfgV.y;\n float Ess_L = dfgL.x + dfgL.y;\n float Ems_V = 1.0 - Ess_V;\n float Ems_L = 1.0 - Ess_L;\n vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\n vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\n float compensationFactor = Ems_V * Ems_L;\n vec3 multiScatter = Fms * compensationFactor;\n return singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColorBlended * t2.x + ( vec3( 1.0 ) - material.specularColorBlended ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n \n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n \n float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\n \n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\n \n irradiance *= sheenEnergyComp;\n \n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n diffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectDiffuse += diffuse;\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\n #endif\n vec3 singleScatteringDielectric = vec3( 0.0 );\n vec3 multiScatteringDielectric = vec3( 0.0 );\n vec3 singleScatteringMetallic = vec3( 0.0 );\n vec3 multiScatteringMetallic = vec3( 0.0 );\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #endif\n vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\n vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\n vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\n vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n vec3 indirectSpecular = radiance * singleScattering;\n indirectSpecular += multiScattering * cosineWeightedIrradiance;\n vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n indirectSpecular *= sheenEnergyComp;\n indirectDiffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectSpecular += indirectSpecular;\n reflectedLight.indirectDiffuse += indirectDiffuse;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\n material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #else\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #else\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #elif defined( SHADOWMAP_TYPE_BASIC )\n uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float interleavedGradientNoise( vec2 position ) {\n return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );\n }\n vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\n const float goldenAngle = 2.399963229728653;\n float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\n float theta = float( sampleIndex ) * goldenAngle + phi;\n return vec2( cos( theta ), sin( theta ) ) * r;\n }\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float radius = shadowRadius * texelSize.x;\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718;\n shadow = (\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_VSM )\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\n float mean = distribution.x;\n float variance = distribution.y * distribution.y;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float hard_shadow = step( mean, shadowCoord.z );\n #else\n float hard_shadow = step( shadowCoord.z, mean );\n #endif\n if ( hard_shadow == 1.0 ) {\n shadow = 1.0;\n } else {\n variance = max( variance, 0.0000001 );\n float d = shadowCoord.z - mean;\n float p_max = variance / ( variance + d * d );\n p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\n shadow = max( hard_shadow, p_max );\n }\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #else\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n float depth = texture2D( shadowMap, shadowCoord.xy ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, shadowCoord.z );\n #else\n shadow = step( shadowCoord.z, depth );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 bd3D = normalize( lightToPosition );\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n float texelSize = shadowRadius / shadowMapSize.x;\n vec3 absDir = abs( bd3D );\n vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\n tangent = normalize( cross( bd3D, tangent ) );\n vec3 bitangent = cross( bd3D, tangent );\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718;\n shadow = (\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 0, 5, phi ).x + bitangent * vogelDiskSample( 0, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 1, 5, phi ).x + bitangent * vogelDiskSample( 1, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 2, 5, phi ).x + bitangent * vogelDiskSample( 2, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 3, 5, phi ).x + bitangent * vogelDiskSample( 3, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 4, 5, phi ).x + bitangent * vogelDiskSample( 4, 5, phi ).y ) * texelSize, dp ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_BASIC )\n float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 bd3D = normalize( lightToPosition );\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n float depth = textureCube( shadowMap, bd3D ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, dp );\n #else\n shadow = step( dp, depth );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #endif\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n #else\n float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n #endif\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",distance_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",distance_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n \n outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;\n \n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}"},l={common:{diffuse:{value:new n.Q1f(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new n.dwI},alphaMap:{value:null},alphaMapTransform:{value:new n.dwI},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new n.dwI}},envmap:{envMap:{value:null},envMapRotation:{value:new n.dwI},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new n.dwI}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new n.dwI}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new n.dwI},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new n.dwI},normalScale:{value:new n.I9Y(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new n.dwI},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new n.dwI}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new n.dwI}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new n.dwI}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new n.Q1f(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new n.Q1f(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new n.dwI},alphaTest:{value:0},uvTransform:{value:new n.dwI}},sprite:{diffuse:{value:new n.Q1f(0xffffff)},opacity:{value:1},center:{value:new n.I9Y(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new n.dwI},alphaMap:{value:null},alphaMapTransform:{value:new n.dwI},alphaTest:{value:0}}},c={basic:{uniforms:(0,n.Iit)([l.common,l.specularmap,l.envmap,l.aomap,l.lightmap,l.fog]),vertexShader:o.meshbasic_vert,fragmentShader:o.meshbasic_frag},lambert:{uniforms:(0,n.Iit)([l.common,l.specularmap,l.envmap,l.aomap,l.lightmap,l.emissivemap,l.bumpmap,l.normalmap,l.displacementmap,l.fog,l.lights,{emissive:{value:new n.Q1f(0)}}]),vertexShader:o.meshlambert_vert,fragmentShader:o.meshlambert_frag},phong:{uniforms:(0,n.Iit)([l.common,l.specularmap,l.envmap,l.aomap,l.lightmap,l.emissivemap,l.bumpmap,l.normalmap,l.displacementmap,l.fog,l.lights,{emissive:{value:new n.Q1f(0)},specular:{value:new n.Q1f(1118481)},shininess:{value:30}}]),vertexShader:o.meshphong_vert,fragmentShader:o.meshphong_frag},standard:{uniforms:(0,n.Iit)([l.common,l.envmap,l.aomap,l.lightmap,l.emissivemap,l.bumpmap,l.normalmap,l.displacementmap,l.roughnessmap,l.metalnessmap,l.fog,l.lights,{emissive:{value:new n.Q1f(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:o.meshphysical_vert,fragmentShader:o.meshphysical_frag},toon:{uniforms:(0,n.Iit)([l.common,l.aomap,l.lightmap,l.emissivemap,l.bumpmap,l.normalmap,l.displacementmap,l.gradientmap,l.fog,l.lights,{emissive:{value:new n.Q1f(0)}}]),vertexShader:o.meshtoon_vert,fragmentShader:o.meshtoon_frag},matcap:{uniforms:(0,n.Iit)([l.common,l.bumpmap,l.normalmap,l.displacementmap,l.fog,{matcap:{value:null}}]),vertexShader:o.meshmatcap_vert,fragmentShader:o.meshmatcap_frag},points:{uniforms:(0,n.Iit)([l.points,l.fog]),vertexShader:o.points_vert,fragmentShader:o.points_frag},dashed:{uniforms:(0,n.Iit)([l.common,l.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:o.linedashed_vert,fragmentShader:o.linedashed_frag},depth:{uniforms:(0,n.Iit)([l.common,l.displacementmap]),vertexShader:o.depth_vert,fragmentShader:o.depth_frag},normal:{uniforms:(0,n.Iit)([l.common,l.bumpmap,l.normalmap,l.displacementmap,{opacity:{value:1}}]),vertexShader:o.meshnormal_vert,fragmentShader:o.meshnormal_frag},sprite:{uniforms:(0,n.Iit)([l.sprite,l.fog]),vertexShader:o.sprite_vert,fragmentShader:o.sprite_frag},background:{uniforms:{uvTransform:{value:new n.dwI},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:o.background_vert,fragmentShader:o.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new n.dwI}},vertexShader:o.backgroundCube_vert,fragmentShader:o.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:o.cube_vert,fragmentShader:o.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:o.equirect_vert,fragmentShader:o.equirect_frag},distance:{uniforms:(0,n.Iit)([l.common,l.displacementmap,{referencePosition:{value:new n.Pq0},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:o.distance_vert,fragmentShader:o.distance_frag},shadow:{uniforms:(0,n.Iit)([l.lights,l.fog,{color:{value:new n.Q1f(0)},opacity:{value:1}}]),vertexShader:o.shadow_vert,fragmentShader:o.shadow_frag}};c.physical={uniforms:(0,n.Iit)([c.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new n.dwI},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new n.dwI},clearcoatNormalScale:{value:new n.I9Y(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new n.dwI},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new n.dwI},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new n.dwI},sheen:{value:0},sheenColor:{value:new n.Q1f(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new n.dwI},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new n.dwI},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new n.dwI},transmissionSamplerSize:{value:new n.I9Y},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new n.dwI},attenuationDistance:{value:0},attenuationColor:{value:new n.Q1f(0)},specularColor:{value:new n.Q1f(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new n.dwI},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new n.dwI},anisotropyVector:{value:new n.I9Y},anisotropyMap:{value:null},anisotropyMapTransform:{value:new n.dwI}}]),vertexShader:o.meshphysical_vert,fragmentShader:o.meshphysical_frag};let h={r:0,b:0,g:0},u=new n.O9p,d=new n.kn4;function p(e,t,r,i,a,s,o){let l,p,f=new n.Q1f(0),g=+(!0!==s),m=null,A=0,b=null;function v(e){let i=!0===e.isScene?e.background:null;return i&&i.isTexture&&(i=(e.backgroundBlurriness>0?r:t).get(i)),i}function y(t,r){t.getRGB(h,(0,n._Ut)(e)),i.buffers.color.setClear(h.r,h.g,h.b,r,o)}return{getClearColor:function(){return f},setClearColor:function(e,t=1){f.set(e),y(f,g=t)},getClearAlpha:function(){return g},setClearAlpha:function(e){y(f,g=e)},render:function(t){let r=!1,n=v(t);null===n?y(f,g):n&&n.isColor&&(y(n,1),r=!0);let a=e.xr.getEnvironmentBlendMode();"additive"===a?i.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===a&&i.buffers.color.setClear(0,0,0,0,o),(e.autoClear||r)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,r){let i=v(r);i&&(i.isCubeTexture||306===i.mapping)?(void 0===p&&((p=new n.eaF(new n.iNn(1,1,1),new n.BKk({name:"BackgroundCubeMaterial",uniforms:(0,n.lxW)(c.backgroundCube.uniforms),vertexShader:c.backgroundCube.vertexShader,fragmentShader:c.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(p)),u.copy(r.backgroundRotation),u.x*=-1,u.y*=-1,u.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(u.y*=-1,u.z*=-1),p.material.uniforms.envMap.value=i,p.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,p.material.uniforms.backgroundBlurriness.value=r.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=r.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(d.makeRotationFromEuler(u)),p.material.toneMapped="srgb"!==n.ppV.getTransfer(i.colorSpace),(m!==i||A!==i.version||b!==e.toneMapping)&&(p.material.needsUpdate=!0,m=i,A=i.version,b=e.toneMapping),p.layers.enableAll(),t.unshift(p,p.geometry,p.material,0,0,null)):i&&i.isTexture&&(void 0===l&&((l=new n.eaF(new n.bdM(2,2),new n.BKk({name:"BackgroundMaterial",uniforms:(0,n.lxW)(c.background.uniforms),vertexShader:c.background.vertexShader,fragmentShader:c.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(l)),l.material.uniforms.t2D.value=i,l.material.uniforms.backgroundIntensity.value=r.backgroundIntensity,l.material.toneMapped="srgb"!==n.ppV.getTransfer(i.colorSpace),!0===i.matrixAutoUpdate&&i.updateMatrix(),l.material.uniforms.uvTransform.value.copy(i.matrix),(m!==i||A!==i.version||b!==e.toneMapping)&&(l.material.needsUpdate=!0,m=i,A=i.version,b=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))},dispose:function(){void 0!==p&&(p.geometry.dispose(),p.material.dispose(),p=void 0),void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}}}function f(e,t){let r=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},n=c(null),a=n,s=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){let t=[],i=[],n=[];for(let e=0;e<r;e++)t[e]=0,i[e]=0,n[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:n,object:e,attributes:{},index:null}}function h(){let e=a.newAttributes;for(let t=0,r=e.length;t<r;t++)e[t]=0}function u(e){d(e,0)}function d(t,r){let i=a.newAttributes,n=a.enabledAttributes,s=a.attributeDivisors;i[t]=1,0===n[t]&&(e.enableVertexAttribArray(t),n[t]=1),s[t]!==r&&(e.vertexAttribDivisor(t,r),s[t]=r)}function p(){let t=a.newAttributes,r=a.enabledAttributes;for(let i=0,n=r.length;i<n;i++)r[i]!==t[i]&&(e.disableVertexAttribArray(i),r[i]=0)}function f(t,r,i,n,a,s,o){!0===o?e.vertexAttribIPointer(t,r,i,a,s):e.vertexAttribPointer(t,r,i,n,a,s)}function g(){m(),s=!0,a!==n&&o((a=n).object)}function m(){n.geometry=null,n.program=null,n.wireframe=!1}return{setup:function(r,n,l,g,m){var A,b;let v,y,x,S,E=!1,w=(A=g,b=l,v=!0===n.wireframe,void 0===(y=i[A.id])&&(y={},i[A.id]=y),void 0===(x=y[b.id])&&(x={},y[b.id]=x),void 0===(S=x[v])&&(S=c(e.createVertexArray()),x[v]=S),S);a!==w&&o((a=w).object),(E=function(e,t,r,i){let n=a.attributes,s=t.attributes,o=0,l=r.getAttributes();for(let t in l)if(l[t].location>=0){let r=n[t],i=s[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===r||r.attribute!==i||i&&r.data!==i.data)return!0;o++}return a.attributesNum!==o||a.index!==i}(r,g,l,m))&&function(e,t,r,i){let n={},s=t.attributes,o=0,l=r.getAttributes();for(let t in l)if(l[t].location>=0){let r=s[t];void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor));let i={};i.attribute=r,r&&r.data&&(i.data=r.data),n[t]=i,o++}a.attributes=n,a.attributesNum=o,a.index=i}(r,g,l,m),null!==m&&t.update(m,e.ELEMENT_ARRAY_BUFFER),(E||s)&&(s=!1,function(r,i,n,a){h();let s=a.attributes,o=n.getAttributes(),l=i.defaultAttributeValues;for(let i in o){let n=o[i];if(n.location>=0){let o=s[i];if(void 0===o&&("instanceMatrix"===i&&r.instanceMatrix&&(o=r.instanceMatrix),"instanceColor"===i&&r.instanceColor&&(o=r.instanceColor)),void 0!==o){let i=o.normalized,s=o.itemSize,l=t.get(o);if(void 0===l)continue;let c=l.buffer,h=l.type,p=l.bytesPerElement,g=h===e.INT||h===e.UNSIGNED_INT||1013===o.gpuType;if(o.isInterleavedBufferAttribute){let t=o.data,l=t.stride,m=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<n.locationSize;e++)d(n.location+e,t.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<n.locationSize;e++)u(n.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<n.locationSize;e++)f(n.location+e,s/n.locationSize,h,i,l*p,(m+s/n.locationSize*e)*p,g)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<n.locationSize;e++)d(n.location+e,o.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let e=0;e<n.locationSize;e++)u(n.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<n.locationSize;e++)f(n.location+e,s/n.locationSize,h,i,s*p,s/n.locationSize*e*p,g)}}else if(void 0!==l){let t=l[i];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(n.location,t);break;case 3:e.vertexAttrib3fv(n.location,t);break;case 4:e.vertexAttrib4fv(n.location,t);break;default:e.vertexAttrib1fv(n.location,t)}}}}p()}(r,n,l,g),null!==m&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(m).buffer))},reset:g,resetDefaultState:m,dispose:function(){for(let e in g(),i){let t=i[e];for(let e in t){let r=t[e];for(let e in r)l(r[e].object),delete r[e];delete t[e]}delete i[e]}},releaseStatesOfGeometry:function(e){if(void 0===i[e.id])return;let t=i[e.id];for(let e in t){let r=t[e];for(let e in r)l(r[e].object),delete r[e];delete t[e]}delete i[e.id]},releaseStatesOfProgram:function(e){for(let t in i){let r=i[t];if(void 0===r[e.id])continue;let n=r[e.id];for(let e in n)l(n[e].object),delete n[e];delete r[e.id]}},initAttributes:h,enableAttribute:u,disableUnusedAttributes:p}}function g(e,t,r){let i;function n(t,n,a){0!==a&&(e.drawArraysInstanced(i,t,n,a),r.update(n,i,a))}this.setMode=function(e){i=e},this.render=function(t,n){e.drawArrays(i,t,n),r.update(n,i,1)},this.renderInstances=n,this.renderMultiDraw=function(e,n,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,e,0,n,0,a);let s=0;for(let e=0;e<a;e++)s+=n[e];r.update(s,i,1)},this.renderMultiDrawInstances=function(e,a,s,o){if(0===s)return;let l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)n(e[t],a[t],o[t]);else{l.multiDrawArraysInstancedWEBGL(i,e,0,a,0,o,0,s);let t=0;for(let e=0;e<s;e++)t+=a[e]*o[e];r.update(t,i,1)}}}function m(e,t,r,i){let a;function s(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==r.precision?r.precision:"highp",l=s(o);return l!==o&&((0,n.R8M)("WebGLRenderer:",o,"not supported, using",l,"instead."),o=l),{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==a)return a;if(!0===t.has("EXT_texture_filter_anisotropic")){let r=t.get("EXT_texture_filter_anisotropic");a=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else a=0;return a},getMaxPrecision:s,textureFormatReadable:function(t){return 1023===t||i.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(r){let n=1016===r&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return 1009===r||i.convert(r)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||1015===r||!!n},precision:o,logarithmicDepthBuffer:!0===r.logarithmicDepthBuffer,reversedDepthBuffer:!0===r.reversedDepthBuffer&&t.has("EXT_clip_control"),maxTextures:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures:e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),maxSamples:e.getParameter(e.MAX_SAMPLES),samples:e.getParameter(e.SAMPLES)}}function A(e){let t=this,r=null,i=0,a=!1,s=!1,o=new n.Zcv,l=new n.dwI,c={value:null,needsUpdate:!1};function h(e,r,i,n){let a=null!==e?e.length:0,s=null;if(0!==a){if(s=c.value,!0!==n||null===s){let t=i+4*a,n=r.matrixWorldInverse;l.getNormalMatrix(n),(null===s||s.length<t)&&(s=new Float32Array(t));for(let t=0,r=i;t!==a;++t,r+=4)o.copy(e[t]).applyMatrix4(n,l),o.normal.toArray(s,r),s[r+3]=o.constant}c.value=s,c.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,s}this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let r=0!==e.length||t||0!==i||a;return a=t,i=e.length,r},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(e,t){r=h(e,t,0)},this.setState=function(n,o,l){let u=n.clippingPlanes,d=n.clipIntersection,p=n.clipShadows,f=e.get(n);if(a&&null!==u&&0!==u.length&&(!s||p)){let e=s?0:i,t=4*e,n=f.clippingState||null;c.value=n,n=h(u,o,t,l);for(let e=0;e!==t;++e)n[e]=r[e];f.clippingState=n,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}else s?h(null):(c.value!==r&&(c.value=r,c.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0)}}function b(e){let t=new WeakMap;function r(e,t){return 303===t?e.mapping=301:304===t&&(e.mapping=302),e}function i(e){let r=e.target;r.removeEventListener("dispose",i);let n=t.get(r);void 0!==n&&(t.delete(r),n.dispose())}return{get:function(a){if(a&&a.isTexture){let s=a.mapping;if(303===s||304===s)if(t.has(a))return r(t.get(a).texture,a.mapping);else{let s=a.image;if(!s||!(s.height>0))return null;{let o=new n.o6l(s.height);return o.fromEquirectangularTexture(e,a),t.set(a,o),a.addEventListener("dispose",i),r(o.texture,a.mapping)}}}return a},dispose:function(){t=new WeakMap}}}let v=[.125,.215,.35,.446,.526,.582],y=new n.qUd,x=new n.Q1f,S=null,E=0,w=0,_=!1,C=new n.Pq0;class M{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,r=.1,i=100,n={}){let{size:a=256,position:s=C}=n;S=this._renderer.getRenderTarget(),E=this._renderer.getActiveCubeFace(),w=this._renderer.getActiveMipmapLevel(),_=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o,s),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=B(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=R(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._ggxMaterial&&this._ggxMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(S,E,w),this._renderer.xr.enabled=_,e.scissorTest=!1,T(e,0,0,e.width,e.height)}_fromTexture(e,t){301===e.mapping||302===e.mapping?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),S=this._renderer.getRenderTarget(),E=this._renderer.getActiveCubeFace(),w=this._renderer.getActiveMipmapLevel(),_=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:1006,minFilter:1006,generateMipmaps:!1,type:1016,format:1023,colorSpace:n.Zr2,depthBuffer:!1},i=I(e,t,r);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){var a,s,o,l,c,h;let i,u;null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=I(e,t,r);let{_lodMax:d}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=function(e){let t=[],r=[],i=[],a=e,s=e-4+1+v.length;for(let o=0;o<s;o++){let s=Math.pow(2,a);t.push(s);let l=1/s;o>e-4?l=v[o-e+4-1]:0===o&&(l=0),r.push(l);let c=1/(s-2),h=-c,u=1+c,d=[h,h,u,h,u,u,h,h,u,u,h,u],p=new Float32Array(108),f=new Float32Array(72),g=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,r=e>2?0:-1,i=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0];p.set(i,18*e),f.set(d,12*e);let n=[e,e,e,e,e,e];g.set(n,6*e)}let m=new n.LoY;m.setAttribute("position",new n.THS(p,3)),m.setAttribute("uv",new n.THS(f,2)),m.setAttribute("faceIndex",new n.THS(g,1)),i.push(new n.eaF(m,null)),a>4&&a--}return{lodMeshes:i,sizeLods:t,sigmas:r}}(d)),this._blurMaterial=(a=d,s=e,o=t,i=new Float32Array(20),u=new n.Pq0(0,1,0),new n.BKk({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/s,CUBEUV_TEXEL_HEIGHT:1/o,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:u}},vertexShader:k(),fragmentShader:`
505
+
506
+ precision mediump float;
507
+ precision mediump int;
508
+
509
+ varying vec3 vOutputDirection;
510
+
511
+ uniform sampler2D envMap;
512
+ uniform int samples;
513
+ uniform float weights[ n ];
514
+ uniform bool latitudinal;
515
+ uniform float dTheta;
516
+ uniform float mipInt;
517
+ uniform vec3 poleAxis;
518
+
519
+ #define ENVMAP_TYPE_CUBE_UV
520
+ #include <cube_uv_reflection_fragment>
521
+
522
+ vec3 getSample( float theta, vec3 axis ) {
523
+
524
+ float cosTheta = cos( theta );
525
+ // Rodrigues' axis-angle rotation
526
+ vec3 sampleDirection = vOutputDirection * cosTheta
527
+ + cross( axis, vOutputDirection ) * sin( theta )
528
+ + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
529
+
530
+ return bilinearCubeUV( envMap, sampleDirection, mipInt );
531
+
532
+ }
533
+
534
+ void main() {
535
+
536
+ vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
537
+
538
+ if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
539
+
540
+ axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
541
+
542
+ }
543
+
544
+ axis = normalize( axis );
545
+
546
+ gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
547
+ gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
548
+
549
+ for ( int i = 1; i < n; i++ ) {
550
+
551
+ if ( i >= samples ) {
552
+
553
+ break;
554
+
555
+ }
556
+
557
+ float theta = dTheta * float( i );
558
+ gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
559
+ gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
560
+
561
+ }
562
+
563
+ }
564
+ `,blending:0,depthTest:!1,depthWrite:!1})),this._ggxMaterial=(l=d,c=e,h=t,new n.BKk({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/c,CUBEUV_TEXEL_HEIGHT:1/h,CUBEUV_MAX_MIP:`${l}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:k(),fragmentShader:`
565
+
566
+ precision highp float;
567
+ precision highp int;
568
+
569
+ varying vec3 vOutputDirection;
570
+
571
+ uniform sampler2D envMap;
572
+ uniform float roughness;
573
+ uniform float mipInt;
574
+
575
+ #define ENVMAP_TYPE_CUBE_UV
576
+ #include <cube_uv_reflection_fragment>
577
+
578
+ #define PI 3.14159265359
579
+
580
+ // Van der Corput radical inverse
581
+ float radicalInverse_VdC(uint bits) {
582
+ bits = (bits << 16u) | (bits >> 16u);
583
+ bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
584
+ bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
585
+ bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
586
+ bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
587
+ return float(bits) * 2.3283064365386963e-10; // / 0x100000000
588
+ }
589
+
590
+ // Hammersley sequence
591
+ vec2 hammersley(uint i, uint N) {
592
+ return vec2(float(i) / float(N), radicalInverse_VdC(i));
593
+ }
594
+
595
+ // GGX VNDF importance sampling (Eric Heitz 2018)
596
+ // "Sampling the GGX Distribution of Visible Normals"
597
+ // https://jcgt.org/published/0007/04/01/
598
+ vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
599
+ float alpha = roughness * roughness;
600
+
601
+ // Section 3.2: Transform view direction to hemisphere configuration
602
+ vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z));
603
+
604
+ // Section 4.1: Orthonormal basis
605
+ float lensq = Vh.x * Vh.x + Vh.y * Vh.y;
606
+ vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0);
607
+ vec3 T2 = cross(Vh, T1);
608
+
609
+ // Section 4.2: Parameterization of projected area
610
+ float r = sqrt(Xi.x);
611
+ float phi = 2.0 * PI * Xi.y;
612
+ float t1 = r * cos(phi);
613
+ float t2 = r * sin(phi);
614
+ float s = 0.5 * (1.0 + Vh.z);
615
+ t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
616
+
617
+ // Section 4.3: Reprojection onto hemisphere
618
+ vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh;
619
+
620
+ // Section 3.4: Transform back to ellipsoid configuration
621
+ return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
622
+ }
623
+
624
+ void main() {
625
+ vec3 N = normalize(vOutputDirection);
626
+ vec3 V = N; // Assume view direction equals normal for pre-filtering
627
+
628
+ vec3 prefilteredColor = vec3(0.0);
629
+ float totalWeight = 0.0;
630
+
631
+ // For very low roughness, just sample the environment directly
632
+ if (roughness < 0.001) {
633
+ gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
634
+ return;
635
+ }
636
+
637
+ // Tangent space basis for VNDF sampling
638
+ vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
639
+ vec3 tangent = normalize(cross(up, N));
640
+ vec3 bitangent = cross(N, tangent);
641
+
642
+ for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
643
+ vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
644
+
645
+ // For PMREM, V = N, so in tangent space V is always (0, 0, 1)
646
+ vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
647
+
648
+ // Transform H back to world space
649
+ vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
650
+ vec3 L = normalize(2.0 * dot(V, H) * H - V);
651
+
652
+ float NdotL = max(dot(N, L), 0.0);
653
+
654
+ if(NdotL > 0.0) {
655
+ // Sample environment at fixed mip level
656
+ // VNDF importance sampling handles the distribution filtering
657
+ vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
658
+
659
+ // Weight by NdotL for the split-sum approximation
660
+ // VNDF PDF naturally accounts for the visible microfacet distribution
661
+ prefilteredColor += sampleColor * NdotL;
662
+ totalWeight += NdotL;
663
+ }
664
+ }
665
+
666
+ if (totalWeight > 0.0) {
667
+ prefilteredColor = prefilteredColor / totalWeight;
668
+ }
669
+
670
+ gl_FragColor = vec4(prefilteredColor, 1.0);
671
+ }
672
+ `,blending:0,depthTest:!1,depthWrite:!1}))}return i}_compileMaterial(e){let t=new n.eaF(new n.LoY,e);this._renderer.compile(t,y)}_sceneToCubeUV(e,t,r,i,a){let s=new n.ubm(90,1,t,r),o=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],c=this._renderer,h=c.autoClear,u=c.toneMapping;c.getClearColor(x),c.toneMapping=0,c.autoClear=!1,c.state.buffers.depth.getReversed()&&(c.setRenderTarget(i),c.clearDepth(),c.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new n.eaF(new n.iNn,new n.V9B({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,p=d.material,f=!1,g=e.background;g?g.isColor&&(p.color.copy(g),e.background=null,f=!0):(p.color.copy(x),f=!0);for(let t=0;t<6;t++){let r=t%3;0===r?(s.up.set(0,o[t],0),s.position.set(a.x,a.y,a.z),s.lookAt(a.x+l[t],a.y,a.z)):1===r?(s.up.set(0,0,o[t]),s.position.set(a.x,a.y,a.z),s.lookAt(a.x,a.y+l[t],a.z)):(s.up.set(0,o[t],0),s.position.set(a.x,a.y,a.z),s.lookAt(a.x,a.y,a.z+l[t]));let n=this._cubeSize;T(i,r*n,t>2?n:0,n,n),c.setRenderTarget(i),f&&c.render(d,s),c.render(e,s)}c.toneMapping=u,c.autoClear=h,e.background=g}_textureToCubeUV(e,t){let r=this._renderer,i=301===e.mapping||302===e.mapping;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=B()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=R());let n=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=n,n.uniforms.envMap.value=e;let s=this._cubeSize;T(t,0,0,3*s,2*s),r.setRenderTarget(t),r.render(a,y)}_applyPMREM(e){let t=this._renderer,r=t.autoClear;t.autoClear=!1;let i=this._lodMeshes.length;for(let t=1;t<i;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=r}_applyGGXFilter(e,t,r){let i=this._renderer,n=this._pingPongRenderTarget,a=this._ggxMaterial,s=this._lodMeshes[r];s.material=a;let o=a.uniforms,l=r/(this._lodMeshes.length-1),c=t/(this._lodMeshes.length-1),h=Math.sqrt(l*l-c*c),{_lodMax:u}=this,d=this._sizeLods[r],p=3*d*(r>u-4?r-u+4:0),f=4*(this._cubeSize-d);o.envMap.value=e.texture,o.roughness.value=h*(0+1.25*l),o.mipInt.value=u-t,T(n,p,f,3*d,2*d),i.setRenderTarget(n),i.render(s,y),o.envMap.value=n.texture,o.roughness.value=0,o.mipInt.value=u-r,T(e,p,f,3*d,2*d),i.setRenderTarget(e),i.render(s,y)}_blur(e,t,r,i,n){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,r,i,"latitudinal",n),this._halfBlur(a,e,r,r,i,"longitudinal",n)}_halfBlur(e,t,r,i,a,s,o){let l=this._renderer,c=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&(0,n.z3S)("blur direction must be either latitudinal or longitudinal!");let h=this._lodMeshes[i];h.material=c;let u=c.uniforms,d=this._sizeLods[r]-1,p=isFinite(a)?Math.PI/(2*d):2*Math.PI/39,f=a/p,g=isFinite(a)?1+Math.floor(3*f):20;g>20&&(0,n.R8M)(`sigmaRadians, ${a}, is too large and will clip, as it requested ${g} samples when the maximum is set to 20`);let m=[],A=0;for(let e=0;e<20;++e){let t=e/f,r=Math.exp(-t*t/2);m.push(r),0===e?A+=r:e<g&&(A+=2*r)}for(let e=0;e<m.length;e++)m[e]=m[e]/A;u.envMap.value=e.texture,u.samples.value=g,u.weights.value=m,u.latitudinal.value="latitudinal"===s,o&&(u.poleAxis.value=o);let{_lodMax:b}=this;u.dTheta.value=p,u.mipInt.value=b-r;let v=this._sizeLods[i],x=4*(this._cubeSize-v);T(t,3*v*(i>b-4?i-b+4:0),x,3*v,2*v),l.setRenderTarget(t),l.render(h,y)}}function I(e,t,r){let i=new n.nWS(e,t,r);return i.texture.mapping=306,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function T(e,t,r,i,n){e.viewport.set(t,r,i,n),e.scissor.set(t,r,i,n)}function R(){return new n.BKk({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:k(),fragmentShader:`
673
+
674
+ precision mediump float;
675
+ precision mediump int;
676
+
677
+ varying vec3 vOutputDirection;
678
+
679
+ uniform sampler2D envMap;
680
+
681
+ #include <common>
682
+
683
+ void main() {
684
+
685
+ vec3 outputDirection = normalize( vOutputDirection );
686
+ vec2 uv = equirectUv( outputDirection );
687
+
688
+ gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
689
+
690
+ }
691
+ `,blending:0,depthTest:!1,depthWrite:!1})}function B(){return new n.BKk({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:k(),fragmentShader:`
692
+
693
+ precision mediump float;
694
+ precision mediump int;
695
+
696
+ uniform float flipEnvMap;
697
+
698
+ varying vec3 vOutputDirection;
699
+
700
+ uniform samplerCube envMap;
701
+
702
+ void main() {
703
+
704
+ gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
705
+
706
+ }
707
+ `,blending:0,depthTest:!1,depthWrite:!1})}function k(){return`
708
+
709
+ precision mediump float;
710
+ precision mediump int;
711
+
712
+ attribute float faceIndex;
713
+
714
+ varying vec3 vOutputDirection;
715
+
716
+ // RH coordinate system; PMREM face-indexing convention
717
+ vec3 getDirection( vec2 uv, float face ) {
718
+
719
+ uv = 2.0 * uv - 1.0;
720
+
721
+ vec3 direction = vec3( uv, 1.0 );
722
+
723
+ if ( face == 0.0 ) {
724
+
725
+ direction = direction.zyx; // ( 1, v, u ) pos x
726
+
727
+ } else if ( face == 1.0 ) {
728
+
729
+ direction = direction.xzy;
730
+ direction.xz *= -1.0; // ( -u, 1, -v ) pos y
731
+
732
+ } else if ( face == 2.0 ) {
733
+
734
+ direction.x *= -1.0; // ( -u, v, 1 ) pos z
735
+
736
+ } else if ( face == 3.0 ) {
737
+
738
+ direction = direction.zyx;
739
+ direction.xz *= -1.0; // ( -1, v, -u ) neg x
740
+
741
+ } else if ( face == 4.0 ) {
742
+
743
+ direction = direction.xzy;
744
+ direction.xy *= -1.0; // ( -u, -1, v ) neg y
745
+
746
+ } else if ( face == 5.0 ) {
747
+
748
+ direction.z *= -1.0; // ( u, v, -1 ) neg z
749
+
750
+ }
751
+
752
+ return direction;
753
+
754
+ }
755
+
756
+ void main() {
757
+
758
+ vOutputDirection = getDirection( uv, faceIndex );
759
+ gl_Position = vec4( position, 1.0 );
760
+
761
+ }
762
+ `}function P(e){let t=new WeakMap,r=null;function i(e){let r=e.target;r.removeEventListener("dispose",i);let n=t.get(r);void 0!==n&&(t.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){let a=n.mapping,s=303===a||304===a,o=301===a||302===a;if(s||o){let a=t.get(n),l=void 0!==a?a.texture.pmremVersion:0;if(n.isRenderTargetTexture&&n.pmremVersion!==l)return null===r&&(r=new M(e)),(a=s?r.fromEquirectangular(n,a):r.fromCubemap(n,a)).texture.pmremVersion=n.pmremVersion,t.set(n,a),a.texture;{if(void 0!==a)return a.texture;let l=n.image;return s&&l&&l.height>0||o&&l&&function(e){let t=0;for(let r=0;r<6;r++)void 0!==e[r]&&t++;return 6===t}(l)?(null===r&&(r=new M(e)),(a=s?r.fromEquirectangular(n):r.fromCubemap(n)).texture.pmremVersion=n.pmremVersion,t.set(n,a),n.addEventListener("dispose",i),a.texture):null}}}return n},dispose:function(){t=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function D(e){let t={};function r(r){if(void 0!==t[r])return t[r];let i=e.getExtension(r);return t[r]=i,i}return{has:function(e){return null!==r(e)},init:function(){r("EXT_color_buffer_float"),r("WEBGL_clip_cull_distance"),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture"),r("WEBGL_render_shared_exponent")},get:function(e){let t=r(e);return null===t&&(0,n.mcG)("WebGLRenderer: "+e+" extension not supported."),t}}}function L(e,t,r,i){let a={},s=new WeakMap;function o(e){let n=e.target;for(let e in null!==n.index&&t.remove(n.index),n.attributes)t.remove(n.attributes[e]);n.removeEventListener("dispose",o),delete a[n.id];let l=s.get(n);l&&(t.remove(l),s.delete(n)),i.releaseStatesOfGeometry(n),!0===n.isInstancedBufferGeometry&&delete n._maxInstanceCount,r.memory.geometries--}function l(e){let r=[],i=e.index,a=e.attributes.position,o=0;if(null!==i){let e=i.array;o=i.version;for(let t=0,i=e.length;t<i;t+=3){let i=e[t+0],n=e[t+1],a=e[t+2];r.push(i,n,n,a,a,i)}}else{if(void 0===a)return;let e=a.array;o=a.version;for(let t=0,i=e.length/3-1;t<i;t+=3){let e=t+0,i=t+1,n=t+2;r.push(e,i,i,n,n,e)}}let l=new((0,n.AQS)(r)?n.MW4:n.A$4)(r,1);l.version=o;let c=s.get(e);c&&t.remove(c),s.set(e,l)}return{get:function(e,t){return!0===a[t.id]||(t.addEventListener("dispose",o),a[t.id]=!0,r.memory.geometries++),t},update:function(r){let i=r.attributes;for(let r in i)t.update(i[r],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){let t=s.get(e);if(t){let r=e.index;null!==r&&t.version<r.version&&l(e)}else l(e);return s.get(e)}}}function F(e,t,r){let i,n,a;function s(t,s,o){0!==o&&(e.drawElementsInstanced(i,s,n,t*a,o),r.update(s,i,o))}this.setMode=function(e){i=e},this.setIndex=function(e){n=e.type,a=e.bytesPerElement},this.render=function(t,s){e.drawElements(i,s,n,t*a),r.update(s,i,1)},this.renderInstances=s,this.renderMultiDraw=function(e,a,s){if(0===s)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,a,0,n,e,0,s);let o=0;for(let e=0;e<s;e++)o+=a[e];r.update(o,i,1)},this.renderMultiDrawInstances=function(e,o,l,c){if(0===l)return;let h=t.get("WEBGL_multi_draw");if(null===h)for(let t=0;t<e.length;t++)s(e[t]/a,o[t],c[t]);else{h.multiDrawElementsInstancedWEBGL(i,o,0,n,e,0,c,0,l);let t=0;for(let e=0;e<l;e++)t+=o[e]*c[e];r.update(t,i,1)}}}function N(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(r,i,a){switch(t.calls++,i){case e.TRIANGLES:t.triangles+=r/3*a;break;case e.LINES:t.lines+=r/2*a;break;case e.LINE_STRIP:t.lines+=a*(r-1);break;case e.LINE_LOOP:t.lines+=a*r;break;case e.POINTS:t.points+=a*r;break;default:(0,n.z3S)("WebGLInfo: Unknown draw mode:",i)}}}}function U(e,t,r){let i=new WeakMap,a=new n.IUQ;return{update:function(s,o,l){let c=s.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=void 0!==h?h.length:0,d=i.get(o);if(void 0===d||d.count!==u){void 0!==d&&d.texture.dispose();let e=void 0!==o.morphAttributes.position,r=void 0!==o.morphAttributes.normal,s=void 0!==o.morphAttributes.color,l=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],h=o.morphAttributes.color||[],p=0;!0===e&&(p=1),!0===r&&(p=2),!0===s&&(p=3);let f=o.attributes.position.count*p,g=1;f>t.maxTextureSize&&(g=Math.ceil(f/t.maxTextureSize),f=t.maxTextureSize);let m=new Float32Array(f*g*4*u),A=new n.rFo(m,f,g,u);A.type=1015,A.needsUpdate=!0;let b=4*p;for(let t=0;t<u;t++){let i=l[t],n=c[t],o=h[t],u=f*g*4*t;for(let t=0;t<i.count;t++){let l=t*b;!0===e&&(a.fromBufferAttribute(i,t),m[u+l+0]=a.x,m[u+l+1]=a.y,m[u+l+2]=a.z,m[u+l+3]=0),!0===r&&(a.fromBufferAttribute(n,t),m[u+l+4]=a.x,m[u+l+5]=a.y,m[u+l+6]=a.z,m[u+l+7]=0),!0===s&&(a.fromBufferAttribute(o,t),m[u+l+8]=a.x,m[u+l+9]=a.y,m[u+l+10]=a.z,m[u+l+11]=4===o.itemSize?a.w:1)}}d={count:u,texture:A,size:new n.I9Y(f,g)},i.set(o,d),o.addEventListener("dispose",function e(){A.dispose(),i.delete(o),o.removeEventListener("dispose",e)})}if(!0===s.isInstancedMesh&&null!==s.morphTexture)l.getUniforms().setValue(e,"morphTexture",s.morphTexture,r);else{let t=0;for(let e=0;e<c.length;e++)t+=c[e];let r=o.morphTargetsRelative?1:1-t;l.getUniforms().setValue(e,"morphTargetBaseInfluence",r),l.getUniforms().setValue(e,"morphTargetInfluences",c)}l.getUniforms().setValue(e,"morphTargetsTexture",d.texture,r),l.getUniforms().setValue(e,"morphTargetsTextureSize",d.size)}}}function O(e,t,r,i){let n=new WeakMap;function a(e){let t=e.target;t.removeEventListener("dispose",a),r.remove(t.instanceMatrix),null!==t.instanceColor&&r.remove(t.instanceColor)}return{update:function(s){let o=i.render.frame,l=s.geometry,c=t.get(s,l);if(n.get(c)!==o&&(t.update(c),n.set(c,o)),s.isInstancedMesh&&(!1===s.hasEventListener("dispose",a)&&s.addEventListener("dispose",a),n.get(s)!==o&&(r.update(s.instanceMatrix,e.ARRAY_BUFFER),null!==s.instanceColor&&r.update(s.instanceColor,e.ARRAY_BUFFER),n.set(s,o))),s.isSkinnedMesh){let e=s.skeleton;n.get(e)!==o&&(e.update(),n.set(e,o))}return c},dispose:function(){n=new WeakMap}}}let Q={1:"LINEAR_TONE_MAPPING",2:"REINHARD_TONE_MAPPING",3:"CINEON_TONE_MAPPING",4:"ACES_FILMIC_TONE_MAPPING",6:"AGX_TONE_MAPPING",7:"NEUTRAL_TONE_MAPPING",5:"CUSTOM_TONE_MAPPING"};function z(e,t,r,i,a){let s,o=new n.nWS(t,r,{type:e,depthBuffer:i,stencilBuffer:a}),l=new n.nWS(t,r,{type:1016,depthBuffer:!1,stencilBuffer:!1}),c=new n.LoY;c.setAttribute("position",new n.qtW([-1,3,0,-1,-1,0,3,-1,0],3)),c.setAttribute("uv",new n.qtW([0,2,0,0,2,0],2));let h=new n.D$Q({uniforms:{tDiffuse:{value:null}},vertexShader:`
763
+ precision highp float;
764
+
765
+ uniform mat4 modelViewMatrix;
766
+ uniform mat4 projectionMatrix;
767
+
768
+ attribute vec3 position;
769
+ attribute vec2 uv;
770
+
771
+ varying vec2 vUv;
772
+
773
+ void main() {
774
+ vUv = uv;
775
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
776
+ }`,fragmentShader:`
777
+ precision highp float;
778
+
779
+ uniform sampler2D tDiffuse;
780
+
781
+ varying vec2 vUv;
782
+
783
+ #include <tonemapping_pars_fragment>
784
+ #include <colorspace_pars_fragment>
785
+
786
+ void main() {
787
+ gl_FragColor = texture2D( tDiffuse, vUv );
788
+
789
+ #ifdef LINEAR_TONE_MAPPING
790
+ gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
791
+ #elif defined( REINHARD_TONE_MAPPING )
792
+ gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
793
+ #elif defined( CINEON_TONE_MAPPING )
794
+ gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
795
+ #elif defined( ACES_FILMIC_TONE_MAPPING )
796
+ gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
797
+ #elif defined( AGX_TONE_MAPPING )
798
+ gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
799
+ #elif defined( NEUTRAL_TONE_MAPPING )
800
+ gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
801
+ #elif defined( CUSTOM_TONE_MAPPING )
802
+ gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
803
+ #endif
804
+
805
+ #ifdef SRGB_TRANSFER
806
+ gl_FragColor = sRGBTransferOETF( gl_FragColor );
807
+ #endif
808
+ }`,depthTest:!1,depthWrite:!1}),u=new n.eaF(c,h),d=new n.qUd(-1,1,1,-1,0,1),p=null,f=null,g=!1,m=null,A=[],b=!1;this.setSize=function(e,t){o.setSize(e,t),l.setSize(e,t);for(let r=0;r<A.length;r++){let i=A[r];i.setSize&&i.setSize(e,t)}},this.setEffects=function(e){b=(A=e).length>0&&!0===A[0].isRenderPass;let t=o.width,r=o.height;for(let e=0;e<A.length;e++){let i=A[e];i.setSize&&i.setSize(t,r)}},this.begin=function(e,t){if(g||0===e.toneMapping&&0===A.length)return!1;if(m=t,null!==t){let e=t.width,r=t.height;(o.width!==e||o.height!==r)&&this.setSize(e,r)}return!1===b&&e.setRenderTarget(o),s=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return b},this.end=function(e,t){e.toneMapping=s,g=!0;let r=o,i=l;for(let n=0;n<A.length;n++){let a=A[n];if(!1!==a.enabled&&(a.render(e,i,r,t),!1!==a.needsSwap)){let e=r;r=i,i=e}}if(p!==e.outputColorSpace||f!==e.toneMapping){p=e.outputColorSpace,f=e.toneMapping,h.defines={},"srgb"===n.ppV.getTransfer(p)&&(h.defines.SRGB_TRANSFER="");let t=Q[f];t&&(h.defines[t]=""),h.needsUpdate=!0}h.uniforms.tDiffuse.value=r.texture,e.setRenderTarget(m),e.render(u,d),m=null,g=!1},this.isCompositing=function(){return g},this.dispose=function(){o.dispose(),l.dispose(),c.dispose(),h.dispose()}}let H=new n.gPd,G=new n.VCu(1,1),V=new n.rFo,j=new n.dYF,q=new n.b4q,W=[],X=[],Y=new Float32Array(16),K=new Float32Array(9),$=new Float32Array(4);function J(e,t,r){let i=e[0];if(i<=0||i>0)return e;let n=t*r,a=W[n];if(void 0===a&&(a=new Float32Array(n),W[n]=a),0!==t){i.toArray(a,0);for(let i=1,n=0;i!==t;++i)n+=r,e[i].toArray(a,n)}return a}function Z(e,t){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(e[r]!==t[r])return!1;return!0}function ee(e,t){for(let r=0,i=t.length;r<i;r++)e[r]=t[r]}function et(e,t){let r=X[t];void 0===r&&(r=new Int32Array(t),X[t]=r);for(let i=0;i!==t;++i)r[i]=e.allocateTextureUnit();return r}function er(e,t){let r=this.cache;r[0]!==t&&(e.uniform1f(this.addr,t),r[0]=t)}function ei(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Z(r,t))return;e.uniform2fv(this.addr,t),ee(r,t)}}function en(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y||r[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else if(void 0!==t.r)(r[0]!==t.r||r[1]!==t.g||r[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),r[0]=t.r,r[1]=t.g,r[2]=t.b);else{if(Z(r,t))return;e.uniform3fv(this.addr,t),ee(r,t)}}function ea(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y||r[2]!==t.z||r[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Z(r,t))return;e.uniform4fv(this.addr,t),ee(r,t)}}function es(e,t){let r=this.cache,i=t.elements;if(void 0===i){if(Z(r,t))return;e.uniformMatrix2fv(this.addr,!1,t),ee(r,t)}else{if(Z(r,i))return;$.set(i),e.uniformMatrix2fv(this.addr,!1,$),ee(r,i)}}function eo(e,t){let r=this.cache,i=t.elements;if(void 0===i){if(Z(r,t))return;e.uniformMatrix3fv(this.addr,!1,t),ee(r,t)}else{if(Z(r,i))return;K.set(i),e.uniformMatrix3fv(this.addr,!1,K),ee(r,i)}}function el(e,t){let r=this.cache,i=t.elements;if(void 0===i){if(Z(r,t))return;e.uniformMatrix4fv(this.addr,!1,t),ee(r,t)}else{if(Z(r,i))return;Y.set(i),e.uniformMatrix4fv(this.addr,!1,Y),ee(r,i)}}function ec(e,t){let r=this.cache;r[0]!==t&&(e.uniform1i(this.addr,t),r[0]=t)}function eh(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Z(r,t))return;e.uniform2iv(this.addr,t),ee(r,t)}}function eu(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y||r[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else{if(Z(r,t))return;e.uniform3iv(this.addr,t),ee(r,t)}}function ed(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y||r[2]!==t.z||r[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Z(r,t))return;e.uniform4iv(this.addr,t),ee(r,t)}}function ep(e,t){let r=this.cache;r[0]!==t&&(e.uniform1ui(this.addr,t),r[0]=t)}function ef(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Z(r,t))return;e.uniform2uiv(this.addr,t),ee(r,t)}}function eg(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y||r[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else{if(Z(r,t))return;e.uniform3uiv(this.addr,t),ee(r,t)}}function em(e,t){let r=this.cache;if(void 0!==t.x)(r[0]!==t.x||r[1]!==t.y||r[2]!==t.z||r[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Z(r,t))return;e.uniform4uiv(this.addr,t),ee(r,t)}}function eA(e,t,r){let i,n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(e.uniform1i(this.addr,a),n[0]=a),this.type===e.SAMPLER_2D_SHADOW?(G.compareFunction=r.isReversedDepthBuffer()?518:515,i=G):i=H,r.setTexture2D(t||i,a)}function eb(e,t,r){let i=this.cache,n=r.allocateTextureUnit();i[0]!==n&&(e.uniform1i(this.addr,n),i[0]=n),r.setTexture3D(t||j,n)}function ev(e,t,r){let i=this.cache,n=r.allocateTextureUnit();i[0]!==n&&(e.uniform1i(this.addr,n),i[0]=n),r.setTextureCube(t||q,n)}function ey(e,t,r){let i=this.cache,n=r.allocateTextureUnit();i[0]!==n&&(e.uniform1i(this.addr,n),i[0]=n),r.setTexture2DArray(t||V,n)}function ex(e,t){e.uniform1fv(this.addr,t)}function eS(e,t){let r=J(t,this.size,2);e.uniform2fv(this.addr,r)}function eE(e,t){let r=J(t,this.size,3);e.uniform3fv(this.addr,r)}function ew(e,t){let r=J(t,this.size,4);e.uniform4fv(this.addr,r)}function e_(e,t){let r=J(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,r)}function eC(e,t){let r=J(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,r)}function eM(e,t){let r=J(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,r)}function eI(e,t){e.uniform1iv(this.addr,t)}function eT(e,t){e.uniform2iv(this.addr,t)}function eR(e,t){e.uniform3iv(this.addr,t)}function eB(e,t){e.uniform4iv(this.addr,t)}function ek(e,t){e.uniform1uiv(this.addr,t)}function eP(e,t){e.uniform2uiv(this.addr,t)}function eD(e,t){e.uniform3uiv(this.addr,t)}function eL(e,t){e.uniform4uiv(this.addr,t)}function eF(e,t,r){let i,n=this.cache,a=t.length,s=et(r,a);Z(n,s)||(e.uniform1iv(this.addr,s),ee(n,s)),i=this.type===e.SAMPLER_2D_SHADOW?G:H;for(let e=0;e!==a;++e)r.setTexture2D(t[e]||i,s[e])}function eN(e,t,r){let i=this.cache,n=t.length,a=et(r,n);Z(i,a)||(e.uniform1iv(this.addr,a),ee(i,a));for(let e=0;e!==n;++e)r.setTexture3D(t[e]||j,a[e])}function eU(e,t,r){let i=this.cache,n=t.length,a=et(r,n);Z(i,a)||(e.uniform1iv(this.addr,a),ee(i,a));for(let e=0;e!==n;++e)r.setTextureCube(t[e]||q,a[e])}function eO(e,t,r){let i=this.cache,n=t.length,a=et(r,n);Z(i,a)||(e.uniform1iv(this.addr,a),ee(i,a));for(let e=0;e!==n;++e)r.setTexture2DArray(t[e]||V,a[e])}class eQ{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return er;case 35664:return ei;case 35665:return en;case 35666:return ea;case 35674:return es;case 35675:return eo;case 35676:return el;case 5124:case 35670:return ec;case 35667:case 35671:return eh;case 35668:case 35672:return eu;case 35669:case 35673:return ed;case 5125:return ep;case 36294:return ef;case 36295:return eg;case 36296:return em;case 35678:case 36198:case 36298:case 36306:case 35682:return eA;case 35679:case 36299:case 36307:return eb;case 35680:case 36300:case 36308:case 36293:return ev;case 36289:case 36303:case 36311:case 36292:return ey}}(t.type)}}class ez{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return ex;case 35664:return eS;case 35665:return eE;case 35666:return ew;case 35674:return e_;case 35675:return eC;case 35676:return eM;case 5124:case 35670:return eI;case 35667:case 35671:return eT;case 35668:case 35672:return eR;case 35669:case 35673:return eB;case 5125:return ek;case 36294:return eP;case 36295:return eD;case 36296:return eL;case 35678:case 36198:case 36298:case 36306:case 35682:return eF;case 35679:case 36299:case 36307:return eN;case 35680:case 36300:case 36308:case 36293:return eU;case 36289:case 36303:case 36311:case 36292:return eO}}(t.type)}}class eH{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){let i=this.seq;for(let n=0,a=i.length;n!==a;++n){let a=i[n];a.setValue(e,t[a.id],r)}}}let eG=/(\w+)(\])?(\[|\.)?/g;function eV(e,t){e.seq.push(t),e.map[t.id]=t}class ej{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<r;++i){const r=e.getActiveUniform(t,i),n=e.getUniformLocation(t,r.name);!function(e,t,r){let i=e.name,n=i.length;for(eG.lastIndex=0;;){let a=eG.exec(i),s=eG.lastIndex,o=a[1],l="]"===a[2],c=a[3];if(l&&(o|=0),void 0===c||"["===c&&s+2===n){eV(r,void 0===c?new eQ(o,e,t):new ez(o,e,t));break}{let e=r.map[o];void 0===e&&eV(r,e=new eH(o)),r=e}}}(r,n,this)}const i=[],n=[];for(const t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(t):n.push(t);i.length>0&&(this.seq=i.concat(n))}setValue(e,t,r,i){let n=this.map[t];void 0!==n&&n.setValue(e,r,i)}setOptional(e,t,r){let i=t[r];void 0!==i&&this.setValue(e,r,i)}static upload(e,t,r,i){for(let n=0,a=t.length;n!==a;++n){let a=t[n],s=r[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,i)}}static seqWithValue(e,t){let r=[];for(let i=0,n=e.length;i!==n;++i){let n=e[i];n.id in t&&r.push(n)}return r}}function eq(e,t,r){let i=e.createShader(t);return e.shaderSource(i,r),e.compileShader(i),i}let eW=0,eX=new n.dwI;function eY(e,t,r){let i=e.getShaderParameter(t,e.COMPILE_STATUS),n=(e.getShaderInfoLog(t)||"").trim();if(i&&""===n)return"";let a=/ERROR: 0:(\d+)/.exec(n);if(!a)return n;{let i=parseInt(a[1]);return r.toUpperCase()+"\n\n"+n+"\n\n"+function(e,t){let r=e.split("\n"),i=[],n=Math.max(t-6,0),a=Math.min(t+6,r.length);for(let e=n;e<a;e++){let n=e+1;i.push(`${n===t?">":" "} ${n}: ${r[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}}let eK={1:"Linear",2:"Reinhard",3:"Cineon",4:"ACESFilmic",6:"AgX",7:"Neutral",5:"Custom"},e$=new n.Pq0;function eJ(e){return""!==e}function eZ(e,t){let r=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,r).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function e0(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let e1=/^[ \t]*#include +<([\w\d./]+)>/gm;function e2(e){return e.replace(e1,e5)}let e3=new Map;function e5(e,t){let r=o[t];if(void 0===r){let e=e3.get(t);if(void 0!==e)r=o[e],(0,n.R8M)('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e);else throw Error("Can not resolve #include <"+t+">")}return e2(r)}let e4=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function e8(e){return e.replace(e4,e9)}function e9(e,t,r,i){let n="";for(let e=parseInt(t);e<parseInt(r);e++)n+=i.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return n}function e6(e){let t=`precision ${e.precision} float;
809
+ precision ${e.precision} int;
810
+ precision ${e.precision} sampler2D;
811
+ precision ${e.precision} samplerCube;
812
+ precision ${e.precision} sampler3D;
813
+ precision ${e.precision} sampler2DArray;
814
+ precision ${e.precision} sampler2DShadow;
815
+ precision ${e.precision} samplerCubeShadow;
816
+ precision ${e.precision} sampler2DArrayShadow;
817
+ precision ${e.precision} isampler2D;
818
+ precision ${e.precision} isampler3D;
819
+ precision ${e.precision} isamplerCube;
820
+ precision ${e.precision} isampler2DArray;
821
+ precision ${e.precision} usampler2D;
822
+ precision ${e.precision} usampler3D;
823
+ precision ${e.precision} usamplerCube;
824
+ precision ${e.precision} usampler2DArray;
825
+ `;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}let e7={1:"SHADOWMAP_TYPE_PCF",3:"SHADOWMAP_TYPE_VSM"},te={301:"ENVMAP_TYPE_CUBE",302:"ENVMAP_TYPE_CUBE",306:"ENVMAP_TYPE_CUBE_UV"},tt={302:"ENVMAP_MODE_REFRACTION"},tr={0:"ENVMAP_BLENDING_MULTIPLY",1:"ENVMAP_BLENDING_MIX",2:"ENVMAP_BLENDING_ADD"};function ti(e,t,r,i){var a,s;let l,c,h,u,d=e.getContext(),p=r.defines,f=r.vertexShader,g=r.fragmentShader,m=e7[r.shadowMapType]||"SHADOWMAP_TYPE_BASIC",A=!1===r.envMap?"ENVMAP_TYPE_CUBE":te[r.envMapMode]||"ENVMAP_TYPE_CUBE",b=!1===r.envMap?"ENVMAP_MODE_REFLECTION":tt[r.envMapMode]||"ENVMAP_MODE_REFLECTION",v=!1===r.envMap?"ENVMAP_BLENDING_NONE":tr[r.combine]||"ENVMAP_BLENDING_NONE",y=function(e){let t=e.envMapCubeUVHeight;if(null===t)return null;let r=Math.log2(t)-2;return{texelWidth:1/(3*Math.max(Math.pow(2,r),112)),texelHeight:1/t,maxMip:r}}(r),x=[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(eJ).join("\n"),S=function(e){let t=[];for(let r in e){let i=e[r];!1!==i&&t.push("#define "+r+" "+i)}return t.join("\n")}(p),E=d.createProgram(),w=r.glslVersion?"#version "+r.glslVersion+"\n":"";if(r.isRawShaderMaterial)(l=["#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,S].filter(eJ).join("\n")).length>0&&(l+="\n"),(c=["#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,S].filter(eJ).join("\n")).length>0&&(c+="\n");else{let e,t,i,h,u;l=[e6(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,S,r.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",r.batching?"#define USE_BATCHING":"",r.batchingColor?"#define USE_BATCHING_COLOR":"",r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.instancingMorph?"#define USE_INSTANCING_MORPH":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+b:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+m:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",r.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(eJ).join("\n"),c=[e6(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,S,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+A:"",r.envMap?"#define "+b:"",r.envMap?"#define "+v:"",y?"#define CUBEUV_TEXEL_WIDTH "+y.texelWidth:"",y?"#define CUBEUV_TEXEL_HEIGHT "+y.texelHeight:"",y?"#define CUBEUV_MAX_MIP "+y.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.dispersion?"#define USE_DISPERSION":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor||r.batchingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+m:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",r.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",r.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==r.toneMapping?"#define TONE_MAPPING":"",0!==r.toneMapping?o.tonemapping_pars_fragment:"",0!==r.toneMapping?(a="toneMapping",void 0===(e=eK[s=r.toneMapping])?((0,n.R8M)("WebGLProgram: Unsupported toneMapping:",s),"vec3 "+a+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+a+"( vec3 color ) { return "+e+"ToneMapping( color ); }"):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",o.colorspace_pars_fragment,(t=function(e){n.ppV._getMatrix(eX,n.ppV.workingColorSpace,e);let t=`mat3( ${eX.elements.map(e=>e.toFixed(4))} )`;switch(n.ppV.getTransfer(e)){case"linear":return[t,"LinearTransferOETF"];case"srgb":return[t,"sRGBTransferOETF"];default:return(0,n.R8M)("WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(r.outputColorSpace),`vec4 linearToOutputTexel( vec4 value ) {
826
+ return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );
827
+ }`),(n.ppV.getLuminanceCoefficients(e$),i=e$.x.toFixed(4),h=e$.y.toFixed(4),u=e$.z.toFixed(4),`float luminance( const in vec3 rgb ) {
828
+ const vec3 weights = vec3( ${i}, ${h}, ${u} );
829
+ return dot( weights, rgb );
830
+ }`),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(eJ).join("\n")}f=e0(f=eZ(f=e2(f),r),r),g=e0(g=eZ(g=e2(g),r),r),f=e8(f),g=e8(g),!0!==r.isRawShaderMaterial&&(w="#version 300 es\n",l=[x,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+l,c=["#define varying in","300 es"===r.glslVersion?"":"layout(location = 0) out highp vec4 pc_fragColor;","300 es"===r.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+c);let _=w+l+f,C=w+c+g,M=eq(d,d.VERTEX_SHADER,_),I=eq(d,d.FRAGMENT_SHADER,C);function T(t){if(e.debug.checkShaderErrors){let r=d.getProgramInfoLog(E)||"",i=d.getShaderInfoLog(M)||"",a=d.getShaderInfoLog(I)||"",s=r.trim(),o=i.trim(),h=a.trim(),u=!0,p=!0;if(!1===d.getProgramParameter(E,d.LINK_STATUS))if(u=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(d,E,M,I);else{let e=eY(d,M,"vertex"),r=eY(d,I,"fragment");(0,n.z3S)("THREE.WebGLProgram: Shader Error "+d.getError()+" - VALIDATE_STATUS "+d.getProgramParameter(E,d.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+s+"\n"+e+"\n"+r)}else""!==s?(0,n.R8M)("WebGLProgram: Program Info Log:",s):(""===o||""===h)&&(p=!1);p&&(t.diagnostics={runnable:u,programLog:s,vertexShader:{log:o,prefix:l},fragmentShader:{log:h,prefix:c}})}d.deleteShader(M),d.deleteShader(I),h=new ej(d,E),u=function(e,t){let r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let n=0;n<i;n++){let i=e.getActiveAttrib(t,n),a=i.name,s=1;i.type===e.FLOAT_MAT2&&(s=2),i.type===e.FLOAT_MAT3&&(s=3),i.type===e.FLOAT_MAT4&&(s=4),r[a]={type:i.type,location:e.getAttribLocation(t,a),locationSize:s}}return r}(d,E)}d.attachShader(E,M),d.attachShader(E,I),void 0!==r.index0AttributeName?d.bindAttribLocation(E,0,r.index0AttributeName):!0===r.morphTargets&&d.bindAttribLocation(E,0,"position"),d.linkProgram(E),this.getUniforms=function(){return void 0===h&&T(this),h},this.getAttributes=function(){return void 0===u&&T(this),u};let R=!1===r.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===R&&(R=d.getProgramParameter(E,37297)),R},this.destroy=function(){i.releaseStatesOfProgram(this),d.deleteProgram(E),this.program=void 0},this.type=r.shaderType,this.name=r.shaderName,this.id=eW++,this.cacheKey=t,this.usedTimes=1,this.program=E,this.vertexShader=M,this.fragmentShader=I,this}let tn=0;class ta{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),n=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(n)&&(a.add(n),n.usedTimes++),this}remove(e){for(let t of this.materialCache.get(e))t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,r=t.get(e);return void 0===r&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){let t=this.shaderCache,r=t.get(e);return void 0===r&&(r=new ts(e),t.set(e,r)),r}}class ts{constructor(e){this.id=tn++,this.code=e,this.usedTimes=0}}function to(e,t,r,i,a,s,o){let l=new n.zgK,h=new ta,u=new Set,d=[],p=new Map,f=a.logarithmicDepthBuffer,g=a.precision,m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function A(e){return(u.add(e),0===e)?"uv":`uv${e}`}return{getParameters:function(s,l,d,p,b){let v,y,x,S,E=p.fog,w=b.geometry,_=s.isMeshStandardMaterial?p.environment:null,C=(s.isMeshStandardMaterial?r:t).get(s.envMap||_),M=C&&306===C.mapping?C.image.height:null,I=m[s.type];null!==s.precision&&(g=a.getMaxPrecision(s.precision))!==s.precision&&(0,n.R8M)("WebGLProgram.getParameters:",s.precision,"not supported, using",g,"instead.");let T=w.morphAttributes.position||w.morphAttributes.normal||w.morphAttributes.color,R=void 0!==T?T.length:0,B=0;if(void 0!==w.morphAttributes.position&&(B=1),void 0!==w.morphAttributes.normal&&(B=2),void 0!==w.morphAttributes.color&&(B=3),I){let e=c[I];v=e.vertexShader,y=e.fragmentShader}else v=s.vertexShader,y=s.fragmentShader,h.update(s),x=h.getVertexShaderID(s),S=h.getFragmentShaderID(s);let k=e.getRenderTarget(),P=e.state.buffers.depth.getReversed(),D=!0===b.isInstancedMesh,L=!0===b.isBatchedMesh,F=!!s.map,N=!!s.matcap,U=!!C,O=!!s.aoMap,Q=!!s.lightMap,z=!!s.bumpMap,H=!!s.normalMap,G=!!s.displacementMap,V=!!s.emissiveMap,j=!!s.metalnessMap,q=!!s.roughnessMap,W=s.anisotropy>0,X=s.clearcoat>0,Y=s.dispersion>0,K=s.iridescence>0,$=s.sheen>0,J=s.transmission>0,Z=W&&!!s.anisotropyMap,ee=X&&!!s.clearcoatMap,et=X&&!!s.clearcoatNormalMap,er=X&&!!s.clearcoatRoughnessMap,ei=K&&!!s.iridescenceMap,en=K&&!!s.iridescenceThicknessMap,ea=$&&!!s.sheenColorMap,es=$&&!!s.sheenRoughnessMap,eo=!!s.specularMap,el=!!s.specularColorMap,ec=!!s.specularIntensityMap,eh=J&&!!s.transmissionMap,eu=J&&!!s.thicknessMap,ed=!!s.gradientMap,ep=!!s.alphaMap,ef=s.alphaTest>0,eg=!!s.alphaHash,em=!!s.extensions,eA=0;s.toneMapped&&(null===k||!0===k.isXRRenderTarget)&&(eA=e.toneMapping);let eb={shaderID:I,shaderType:s.type,shaderName:s.name,vertexShader:v,fragmentShader:y,defines:s.defines,customVertexShaderID:x,customFragmentShaderID:S,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:g,batching:L,batchingColor:L&&null!==b._colorsTexture,instancing:D,instancingColor:D&&null!==b.instanceColor,instancingMorph:D&&null!==b.morphTexture,outputColorSpace:null===k?e.outputColorSpace:!0===k.isXRRenderTarget?k.texture.colorSpace:n.Zr2,alphaToCoverage:!!s.alphaToCoverage,map:F,matcap:N,envMap:U,envMapMode:U&&C.mapping,envMapCubeUVHeight:M,aoMap:O,lightMap:Q,bumpMap:z,normalMap:H,displacementMap:G,emissiveMap:V,normalMapObjectSpace:H&&1===s.normalMapType,normalMapTangentSpace:H&&0===s.normalMapType,metalnessMap:j,roughnessMap:q,anisotropy:W,anisotropyMap:Z,clearcoat:X,clearcoatMap:ee,clearcoatNormalMap:et,clearcoatRoughnessMap:er,dispersion:Y,iridescence:K,iridescenceMap:ei,iridescenceThicknessMap:en,sheen:$,sheenColorMap:ea,sheenRoughnessMap:es,specularMap:eo,specularColorMap:el,specularIntensityMap:ec,transmission:J,transmissionMap:eh,thicknessMap:eu,gradientMap:ed,opaque:!1===s.transparent&&1===s.blending&&!1===s.alphaToCoverage,alphaMap:ep,alphaTest:ef,alphaHash:eg,combine:s.combine,mapUv:F&&A(s.map.channel),aoMapUv:O&&A(s.aoMap.channel),lightMapUv:Q&&A(s.lightMap.channel),bumpMapUv:z&&A(s.bumpMap.channel),normalMapUv:H&&A(s.normalMap.channel),displacementMapUv:G&&A(s.displacementMap.channel),emissiveMapUv:V&&A(s.emissiveMap.channel),metalnessMapUv:j&&A(s.metalnessMap.channel),roughnessMapUv:q&&A(s.roughnessMap.channel),anisotropyMapUv:Z&&A(s.anisotropyMap.channel),clearcoatMapUv:ee&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:et&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:er&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:ei&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:en&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:ea&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:es&&A(s.sheenRoughnessMap.channel),specularMapUv:eo&&A(s.specularMap.channel),specularColorMapUv:el&&A(s.specularColorMap.channel),specularIntensityMapUv:ec&&A(s.specularIntensityMap.channel),transmissionMapUv:eh&&A(s.transmissionMap.channel),thicknessMapUv:eu&&A(s.thicknessMap.channel),alphaMapUv:ep&&A(s.alphaMap.channel),vertexTangents:!!w.attributes.tangent&&(H||W),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!w.attributes.color&&4===w.attributes.color.itemSize,pointsUvs:!0===b.isPoints&&!!w.attributes.uv&&(F||ep),fog:!!E,useFog:!0===s.fog,fogExp2:!!E&&E.isFogExp2,flatShading:!0===s.flatShading&&!1===s.wireframe,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:f,reversedDepthBuffer:P,skinning:!0===b.isSkinnedMesh,morphTargets:void 0!==w.morphAttributes.position,morphNormals:void 0!==w.morphAttributes.normal,morphColors:void 0!==w.morphAttributes.color,morphTargetsCount:R,morphTextureStride:B,numDirLights:l.directional.length,numPointLights:l.point.length,numSpotLights:l.spot.length,numSpotLightMaps:l.spotLightMap.length,numRectAreaLights:l.rectArea.length,numHemiLights:l.hemi.length,numDirLightShadows:l.directionalShadowMap.length,numPointLightShadows:l.pointShadowMap.length,numSpotLightShadows:l.spotShadowMap.length,numSpotLightShadowsWithMaps:l.numSpotLightShadowsWithMaps,numLightProbes:l.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:eA,decodeVideoTexture:F&&!0===s.map.isVideoTexture&&"srgb"===n.ppV.getTransfer(s.map.colorSpace),decodeVideoTextureEmissive:V&&!0===s.emissiveMap.isVideoTexture&&"srgb"===n.ppV.getTransfer(s.emissiveMap.colorSpace),premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionClipCullDistance:em&&!0===s.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(em&&!0===s.extensions.multiDraw||L)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return eb.vertexUv1s=u.has(1),eb.vertexUv2s=u.has(2),eb.vertexUv3s=u.has(3),u.clear(),eb},getProgramCacheKey:function(t){var r,i,n,a;let s=[];if(t.shaderID?s.push(t.shaderID):(s.push(t.customVertexShaderID),s.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)s.push(e),s.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(r=s,i=t,r.push(i.precision),r.push(i.outputColorSpace),r.push(i.envMapMode),r.push(i.envMapCubeUVHeight),r.push(i.mapUv),r.push(i.alphaMapUv),r.push(i.lightMapUv),r.push(i.aoMapUv),r.push(i.bumpMapUv),r.push(i.normalMapUv),r.push(i.displacementMapUv),r.push(i.emissiveMapUv),r.push(i.metalnessMapUv),r.push(i.roughnessMapUv),r.push(i.anisotropyMapUv),r.push(i.clearcoatMapUv),r.push(i.clearcoatNormalMapUv),r.push(i.clearcoatRoughnessMapUv),r.push(i.iridescenceMapUv),r.push(i.iridescenceThicknessMapUv),r.push(i.sheenColorMapUv),r.push(i.sheenRoughnessMapUv),r.push(i.specularMapUv),r.push(i.specularColorMapUv),r.push(i.specularIntensityMapUv),r.push(i.transmissionMapUv),r.push(i.thicknessMapUv),r.push(i.combine),r.push(i.fogExp2),r.push(i.sizeAttenuation),r.push(i.morphTargetsCount),r.push(i.morphAttributeCount),r.push(i.numDirLights),r.push(i.numPointLights),r.push(i.numSpotLights),r.push(i.numSpotLightMaps),r.push(i.numHemiLights),r.push(i.numRectAreaLights),r.push(i.numDirLightShadows),r.push(i.numPointLightShadows),r.push(i.numSpotLightShadows),r.push(i.numSpotLightShadowsWithMaps),r.push(i.numLightProbes),r.push(i.shadowMapType),r.push(i.toneMapping),r.push(i.numClippingPlanes),r.push(i.numClipIntersection),r.push(i.depthPacking),n=s,a=t,l.disableAll(),a.instancing&&l.enable(0),a.instancingColor&&l.enable(1),a.instancingMorph&&l.enable(2),a.matcap&&l.enable(3),a.envMap&&l.enable(4),a.normalMapObjectSpace&&l.enable(5),a.normalMapTangentSpace&&l.enable(6),a.clearcoat&&l.enable(7),a.iridescence&&l.enable(8),a.alphaTest&&l.enable(9),a.vertexColors&&l.enable(10),a.vertexAlphas&&l.enable(11),a.vertexUv1s&&l.enable(12),a.vertexUv2s&&l.enable(13),a.vertexUv3s&&l.enable(14),a.vertexTangents&&l.enable(15),a.anisotropy&&l.enable(16),a.alphaHash&&l.enable(17),a.batching&&l.enable(18),a.dispersion&&l.enable(19),a.batchingColor&&l.enable(20),a.gradientMap&&l.enable(21),n.push(l.mask),l.disableAll(),a.fog&&l.enable(0),a.useFog&&l.enable(1),a.flatShading&&l.enable(2),a.logarithmicDepthBuffer&&l.enable(3),a.reversedDepthBuffer&&l.enable(4),a.skinning&&l.enable(5),a.morphTargets&&l.enable(6),a.morphNormals&&l.enable(7),a.morphColors&&l.enable(8),a.premultipliedAlpha&&l.enable(9),a.shadowMapEnabled&&l.enable(10),a.doubleSided&&l.enable(11),a.flipSided&&l.enable(12),a.useDepthPacking&&l.enable(13),a.dithering&&l.enable(14),a.transmission&&l.enable(15),a.sheen&&l.enable(16),a.opaque&&l.enable(17),a.pointsUvs&&l.enable(18),a.decodeVideoTexture&&l.enable(19),a.decodeVideoTextureEmissive&&l.enable(20),a.alphaToCoverage&&l.enable(21),n.push(l.mask),s.push(e.outputColorSpace)),s.push(t.customProgramCacheKey),s.join()},getUniforms:function(e){let t,r=m[e.type];if(r){let e=c[r];t=n.LlO.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,r){let i=p.get(r);return void 0!==i?++i.usedTimes:(i=new ti(e,r,t,s),d.push(i),p.set(r,i)),i},releaseProgram:function(e){if(0==--e.usedTimes){let t=d.indexOf(e);d[t]=d[d.length-1],d.pop(),p.delete(e.cacheKey),e.destroy()}},releaseShaderCache:function(e){h.remove(e)},programs:d,dispose:function(){h.dispose()}}}function tl(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let r=e.get(t);return void 0===r&&(r={},e.set(t,r)),r},remove:function(t){e.delete(t)},update:function(t,r,i){e.get(t)[r]=i},dispose:function(){e=new WeakMap}}}function tc(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function th(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function tu(){let e=[],t=0,r=[],i=[],n=[];function a(r,i,n,a,s,o){let l=e[t];return void 0===l?(l={id:r.id,object:r,geometry:i,material:n,groupOrder:a,renderOrder:r.renderOrder,z:s,group:o},e[t]=l):(l.id=r.id,l.object=r,l.geometry=i,l.material=n,l.groupOrder=a,l.renderOrder=r.renderOrder,l.z=s,l.group=o),t++,l}return{opaque:r,transmissive:i,transparent:n,init:function(){t=0,r.length=0,i.length=0,n.length=0},push:function(e,t,s,o,l,c){let h=a(e,t,s,o,l,c);s.transmission>0?i.push(h):!0===s.transparent?n.push(h):r.push(h)},unshift:function(e,t,s,o,l,c){let h=a(e,t,s,o,l,c);s.transmission>0?i.unshift(h):!0===s.transparent?n.unshift(h):r.unshift(h)},finish:function(){for(let r=t,i=e.length;r<i;r++){let t=e[r];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){r.length>1&&r.sort(e||tc),i.length>1&&i.sort(t||th),n.length>1&&n.sort(t||th)}}}function td(){let e=new WeakMap;return{get:function(t,r){let i,n=e.get(t);return void 0===n?(i=new tu,e.set(t,[i])):r>=n.length?(i=new tu,n.push(i)):i=n[r],i},dispose:function(){e=new WeakMap}}}function tp(){let e={};return{get:function(t){let r;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":r={direction:new n.Pq0,color:new n.Q1f};break;case"SpotLight":r={position:new n.Pq0,direction:new n.Pq0,color:new n.Q1f,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new n.Pq0,color:new n.Q1f,distance:0,decay:0};break;case"HemisphereLight":r={direction:new n.Pq0,skyColor:new n.Q1f,groundColor:new n.Q1f};break;case"RectAreaLight":r={color:new n.Q1f,position:new n.Pq0,halfWidth:new n.Pq0,halfHeight:new n.Pq0}}return e[t.id]=r,r}}}let tf=0;function tg(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function tm(e){let t,r=new tp,i=(t={},{get:function(e){let r;if(void 0!==t[e.id])return t[e.id];switch(e.type){case"DirectionalLight":case"SpotLight":r={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new n.I9Y};break;case"PointLight":r={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new n.I9Y,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=r,r}}),a={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)a.probe.push(new n.Pq0);let s=new n.Pq0,o=new n.kn4,c=new n.kn4;return{setup:function(t){let n=0,s=0,o=0;for(let e=0;e<9;e++)a.probe[e].set(0,0,0);let c=0,h=0,u=0,d=0,p=0,f=0,g=0,m=0,A=0,b=0,v=0;t.sort(tg);for(let e=0,l=t.length;e<l;e++){let l=t[e],y=l.color,x=l.intensity,S=l.distance,E=null;if(l.shadow&&l.shadow.map&&(E=1030===l.shadow.map.texture.format?l.shadow.map.texture:l.shadow.map.depthTexture||l.shadow.map.texture),l.isAmbientLight)n+=y.r*x,s+=y.g*x,o+=y.b*x;else if(l.isLightProbe){for(let e=0;e<9;e++)a.probe[e].addScaledVector(l.sh.coefficients[e],x);v++}else if(l.isDirectionalLight){let e=r.get(l);if(e.color.copy(l.color).multiplyScalar(l.intensity),l.castShadow){let e=l.shadow,t=i.get(l);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,a.directionalShadow[c]=t,a.directionalShadowMap[c]=E,a.directionalShadowMatrix[c]=l.shadow.matrix,f++}a.directional[c]=e,c++}else if(l.isSpotLight){let e=r.get(l);e.position.setFromMatrixPosition(l.matrixWorld),e.color.copy(y).multiplyScalar(x),e.distance=S,e.coneCos=Math.cos(l.angle),e.penumbraCos=Math.cos(l.angle*(1-l.penumbra)),e.decay=l.decay,a.spot[u]=e;let t=l.shadow;if(l.map&&(a.spotLightMap[A]=l.map,A++,t.updateMatrices(l),l.castShadow&&b++),a.spotLightMatrix[u]=t.matrix,l.castShadow){let e=i.get(l);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,a.spotShadow[u]=e,a.spotShadowMap[u]=E,m++}u++}else if(l.isRectAreaLight){let e=r.get(l);e.color.copy(y).multiplyScalar(x),e.halfWidth.set(.5*l.width,0,0),e.halfHeight.set(0,.5*l.height,0),a.rectArea[d]=e,d++}else if(l.isPointLight){let e=r.get(l);if(e.color.copy(l.color).multiplyScalar(l.intensity),e.distance=l.distance,e.decay=l.decay,l.castShadow){let e=l.shadow,t=i.get(l);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,a.pointShadow[h]=t,a.pointShadowMap[h]=E,a.pointShadowMatrix[h]=l.shadow.matrix,g++}a.point[h]=e,h++}else if(l.isHemisphereLight){let e=r.get(l);e.skyColor.copy(l.color).multiplyScalar(x),e.groundColor.copy(l.groundColor).multiplyScalar(x),a.hemi[p]=e,p++}}d>0&&(!0===e.has("OES_texture_float_linear")?(a.rectAreaLTC1=l.LTC_FLOAT_1,a.rectAreaLTC2=l.LTC_FLOAT_2):(a.rectAreaLTC1=l.LTC_HALF_1,a.rectAreaLTC2=l.LTC_HALF_2)),a.ambient[0]=n,a.ambient[1]=s,a.ambient[2]=o;let y=a.hash;(y.directionalLength!==c||y.pointLength!==h||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==p||y.numDirectionalShadows!==f||y.numPointShadows!==g||y.numSpotShadows!==m||y.numSpotMaps!==A||y.numLightProbes!==v)&&(a.directional.length=c,a.spot.length=u,a.rectArea.length=d,a.point.length=h,a.hemi.length=p,a.directionalShadow.length=f,a.directionalShadowMap.length=f,a.pointShadow.length=g,a.pointShadowMap.length=g,a.spotShadow.length=m,a.spotShadowMap.length=m,a.directionalShadowMatrix.length=f,a.pointShadowMatrix.length=g,a.spotLightMatrix.length=m+A-b,a.spotLightMap.length=A,a.numSpotLightShadowsWithMaps=b,a.numLightProbes=v,y.directionalLength=c,y.pointLength=h,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=p,y.numDirectionalShadows=f,y.numPointShadows=g,y.numSpotShadows=m,y.numSpotMaps=A,y.numLightProbes=v,a.version=tf++)},setupView:function(e,t){let r=0,i=0,n=0,l=0,h=0,u=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){let d=e[t];if(d.isDirectionalLight){let e=a.directional[r];e.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),r++}else if(d.isSpotLight){let e=a.spot[n];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),e.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),n++}else if(d.isRectAreaLight){let e=a.rectArea[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),c.identity(),o.copy(d.matrixWorld),o.premultiply(u),c.extractRotation(o),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(c),e.halfHeight.applyMatrix4(c),l++}else if(d.isPointLight){let e=a.point[i];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),i++}else if(d.isHemisphereLight){let e=a.hemi[h];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(u),h++}}},state:a}}function tA(e){let t=new tm(e),r=[],i=[],n={lightsArray:r,shadowsArray:i,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){n.camera=e,r.length=0,i.length=0},state:n,setupLights:function(){t.setup(r)},setupLightsView:function(e){t.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function tb(e){let t=new WeakMap;return{get:function(r,i=0){let n,a=t.get(r);return void 0===a?(n=new tA(e),t.set(r,[n])):i>=a.length?(n=new tA(e),a.push(n)):n=a[i],n},dispose:function(){t=new WeakMap}}}let tv=[new n.Pq0(1,0,0),new n.Pq0(-1,0,0),new n.Pq0(0,1,0),new n.Pq0(0,-1,0),new n.Pq0(0,0,1),new n.Pq0(0,0,-1)],ty=[new n.Pq0(0,-1,0),new n.Pq0(0,-1,0),new n.Pq0(0,0,1),new n.Pq0(0,0,-1),new n.Pq0(0,-1,0),new n.Pq0(0,-1,0)],tx=new n.kn4,tS=new n.Pq0,tE=new n.Pq0;function tw(e,t,r){let i=new n.PPD,a=new n.I9Y,s=new n.I9Y,o=new n.IUQ,l=new n.CSG,c=new n.aVO,h={},u=r.maxTextureSize,d={0:1,1:0,2:2},p=new n.BKk({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new n.I9Y},radius:{value:4}},vertexShader:"void main() {\n gl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}"}),f=p.clone();f.defines.HORIZONTAL_PASS=1;let g=new n.LoY;g.setAttribute("position",new n.THS(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new n.eaF(g,p),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let b=this.type;function v(t,r,i,n){let a=null,s=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===i.isPointLight?c:l,e.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0||!0===r.alphaToCoverage){let e=a.uuid,t=r.uuid,i=h[e];void 0===i&&(i={},h[e]=i);let n=i[t];void 0===n&&(n=a.clone(),i[t]=n,r.addEventListener("dispose",y)),a=n}return a.visible=r.visible,a.wireframe=r.wireframe,3===n?a.side=null!==r.shadowSide?r.shadowSide:r.side:a.side=null!==r.shadowSide?r.shadowSide:d[r.side],a.alphaMap=r.alphaMap,a.alphaTest=!0===r.alphaToCoverage?.5:r.alphaTest,a.map=r.map,a.clipShadows=r.clipShadows,a.clippingPlanes=r.clippingPlanes,a.clipIntersection=r.clipIntersection,a.displacementMap=r.displacementMap,a.displacementScale=r.displacementScale,a.displacementBias=r.displacementBias,a.wireframeLinewidth=r.wireframeLinewidth,a.linewidth=r.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=i),a}function y(e){for(let t in e.target.removeEventListener("dispose",y),h){let r=h[t],i=e.target.uuid;i in r&&(r[i].dispose(),delete r[i])}}this.render=function(r,l,c){if(!1===A.enabled||!1===A.autoUpdate&&!1===A.needsUpdate||0===r.length)return;2===r.type&&((0,n.R8M)("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),r.type=1);let h=e.getRenderTarget(),d=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),y=e.state;y.setBlending(0),!0===y.buffers.depth.getReversed()?y.buffers.color.setClear(0,0,0,0):y.buffers.color.setClear(1,1,1,1),y.buffers.depth.setTest(!0),y.setScissorTest(!1);let x=b!==this.type;x&&l.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let h=0,d=r.length;h<d;h++){let d=r[h],g=d.shadow;if(void 0===g){(0,n.R8M)("WebGLShadowMap:",d,"has no shadow.");continue}if(!1===g.autoUpdate&&!1===g.needsUpdate)continue;a.copy(g.mapSize);let A=g.getFrameExtents();if(a.multiply(A),s.copy(g.mapSize),(a.x>u||a.y>u)&&(a.x>u&&(s.x=Math.floor(u/A.x),a.x=s.x*A.x,g.mapSize.x=s.x),a.y>u&&(s.y=Math.floor(u/A.y),a.y=s.y*A.y,g.mapSize.y=s.y)),null===g.map||!0===x){if(null!==g.map&&(null!==g.map.depthTexture&&(g.map.depthTexture.dispose(),g.map.depthTexture=null),g.map.dispose()),3===this.type){if(d.isPointLight){(0,n.R8M)("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}g.map=new n.nWS(a.x,a.y,{format:1030,type:1016,minFilter:1006,magFilter:1006,generateMipmaps:!1}),g.map.texture.name=d.name+".shadowMap",g.map.depthTexture=new n.VCu(a.x,a.y,1015),g.map.depthTexture.name=d.name+".shadowMapDepth",g.map.depthTexture.format=1026,g.map.depthTexture.compareFunction=null,g.map.depthTexture.minFilter=1003,g.map.depthTexture.magFilter=1003}else{d.isPointLight?(g.map=new n.o6l(a.x),g.map.depthTexture=new n.Gc6(a.x,1014)):(g.map=new n.nWS(a.x,a.y),g.map.depthTexture=new n.VCu(a.x,a.y,1014)),g.map.depthTexture.name=d.name+".shadowMap",g.map.depthTexture.format=1026;let t=e.state.buffers.depth.getReversed();1===this.type?(g.map.depthTexture.compareFunction=t?518:515,g.map.depthTexture.minFilter=1006,g.map.depthTexture.magFilter=1006):(g.map.depthTexture.compareFunction=null,g.map.depthTexture.minFilter=1003,g.map.depthTexture.magFilter=1003)}g.camera.updateProjectionMatrix()}let b=g.map.isWebGLCubeRenderTarget?6:1;for(let r=0;r<b;r++){if(g.map.isWebGLCubeRenderTarget)e.setRenderTarget(g.map,r),e.clear();else{0===r&&(e.setRenderTarget(g.map),e.clear());let t=g.getViewport(r);o.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),y.viewport(o)}if(d.isPointLight){let e=g.camera,t=g.matrix,i=d.distance||e.far;i!==e.far&&(e.far=i,e.updateProjectionMatrix()),tS.setFromMatrixPosition(d.matrixWorld),e.position.copy(tS),tE.copy(e.position),tE.add(tv[r]),e.up.copy(ty[r]),e.lookAt(tE),e.updateMatrixWorld(),t.makeTranslation(-tS.x,-tS.y,-tS.z),tx.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),g._frustum.setFromProjectionMatrix(tx,e.coordinateSystem,e.reversedDepth)}else g.updateMatrices(d);i=g.getFrustum(),function r(n,a,s,o,l){if(!1===n.visible)return;if(n.layers.test(a.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===l)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);let r=t.update(n),i=n.material;if(Array.isArray(i)){let t=r.groups;for(let c=0,h=t.length;c<h;c++){let h=t[c],u=i[h.materialIndex];if(u&&u.visible){let t=v(n,u,o,l);n.onBeforeShadow(e,n,a,s,r,t,h),e.renderBufferDirect(s,null,r,t,n,h),n.onAfterShadow(e,n,a,s,r,t,h)}}}else if(i.visible){let t=v(n,i,o,l);n.onBeforeShadow(e,n,a,s,r,t,null),e.renderBufferDirect(s,null,r,t,n,null),n.onAfterShadow(e,n,a,s,r,t,null)}}let c=n.children;for(let e=0,t=c.length;e<t;e++)r(c[e],a,s,o,l)}(l,c,g.camera,d,this.type)}!0!==g.isPointLightShadow&&3===this.type&&function(r,i){let s=t.update(m);p.defines.VSM_SAMPLES!==r.blurSamples&&(p.defines.VSM_SAMPLES=r.blurSamples,f.defines.VSM_SAMPLES=r.blurSamples,p.needsUpdate=!0,f.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new n.nWS(a.x,a.y,{format:1030,type:1016})),p.uniforms.shadow_pass.value=r.map.depthTexture,p.uniforms.resolution.value=r.mapSize,p.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(i,null,s,p,m,null),f.uniforms.shadow_pass.value=r.mapPass.texture,f.uniforms.resolution.value=r.mapSize,f.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(i,null,s,f,m,null)}(g,c),g.needsUpdate=!1}b=this.type,A.needsUpdate=!1,e.setRenderTarget(h,d,g)}}let t_={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};function tC(e,t){let r=new function(){let t=!1,r=new n.IUQ,i=null,a=new n.IUQ(0,0,0,0);return{setMask:function(r){i===r||t||(e.colorMask(r,r,r,r),i=r)},setLocked:function(e){t=e},setClear:function(t,i,n,s,o){!0===o&&(t*=s,i*=s,n*=s),r.set(t,i,n,s),!1===a.equals(r)&&(e.clearColor(t,i,n,s),a.copy(r))},reset:function(){t=!1,i=null,a.set(-1,0,0,0)}}},i=new function(){let r=!1,i=!1,n=null,a=null,s=null;return{setReversed:function(e){if(i!==e){let r=t.get("EXT_clip_control");e?r.clipControlEXT(r.LOWER_LEFT_EXT,r.ZERO_TO_ONE_EXT):r.clipControlEXT(r.LOWER_LEFT_EXT,r.NEGATIVE_ONE_TO_ONE_EXT),i=e;let n=s;s=null,this.setClear(n)}},getReversed:function(){return i},setTest:function(t){t?Q(e.DEPTH_TEST):z(e.DEPTH_TEST)},setMask:function(t){n===t||r||(e.depthMask(t),n=t)},setFunc:function(t){if(i&&(t=t_[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}a=t}},setLocked:function(e){r=e},setClear:function(t){s!==t&&(i&&(t=1-t),e.clearDepth(t),s=t)},reset:function(){r=!1,n=null,a=null,s=null,i=!1}}},a=new function(){let t=!1,r=null,i=null,n=null,a=null,s=null,o=null,l=null,c=null;return{setTest:function(r){t||(r?Q(e.STENCIL_TEST):z(e.STENCIL_TEST))},setMask:function(i){r===i||t||(e.stencilMask(i),r=i)},setFunc:function(t,r,s){(i!==t||n!==r||a!==s)&&(e.stencilFunc(t,r,s),i=t,n=r,a=s)},setOp:function(t,r,i){(s!==t||o!==r||l!==i)&&(e.stencilOp(t,r,i),s=t,o=r,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,r=null,i=null,n=null,a=null,s=null,o=null,l=null,c=null}}},s=new WeakMap,o=new WeakMap,l={},c={},h=new WeakMap,u=[],d=null,p=!1,f=null,g=null,m=null,A=null,b=null,v=null,y=null,x=new n.Q1f(0,0,0),S=0,E=!1,w=null,_=null,C=null,M=null,I=null,T=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),R=!1,B=e.getParameter(e.VERSION);-1!==B.indexOf("WebGL")?R=parseFloat(/^WebGL (\d)/.exec(B)[1])>=1:-1!==B.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL ES (\d)/.exec(B)[1])>=2);let k=null,P={},D=e.getParameter(e.SCISSOR_BOX),L=e.getParameter(e.VIEWPORT),F=new n.IUQ().fromArray(D),N=new n.IUQ().fromArray(L);function U(t,r,i,n){let a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;s<i;s++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(r,0,e.RGBA,1,1,n,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(r+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return s}let O={};function Q(t){!0!==l[t]&&(e.enable(t),l[t]=!0)}function z(t){!1!==l[t]&&(e.disable(t),l[t]=!1)}O[e.TEXTURE_2D]=U(e.TEXTURE_2D,e.TEXTURE_2D,1),O[e.TEXTURE_CUBE_MAP]=U(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),O[e.TEXTURE_2D_ARRAY]=U(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),O[e.TEXTURE_3D]=U(e.TEXTURE_3D,e.TEXTURE_3D,1,1),r.setClear(0,0,0,1),i.setClear(1),a.setClear(0),Q(e.DEPTH_TEST),i.setFunc(3),j(!1),q(1),Q(e.CULL_FACE),V(0);let H={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};H[103]=e.MIN,H[104]=e.MAX;let G={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function V(t,r,i,a,s,o,l,c,h,u){if(0===t){!0===p&&(z(e.BLEND),p=!1);return}if(!1===p&&(Q(e.BLEND),p=!0),5!==t){if(t!==f||u!==E){if((100!==g||100!==b)&&(e.blendEquation(e.FUNC_ADD),g=100,b=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:(0,n.z3S)("WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:(0,n.z3S)("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case 4:(0,n.z3S)("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:(0,n.z3S)("WebGLState: Invalid blending: ",t)}m=null,A=null,v=null,y=null,x.set(0,0,0),S=0,f=t,E=u}return}s=s||r,o=o||i,l=l||a,(r!==g||s!==b)&&(e.blendEquationSeparate(H[r],H[s]),g=r,b=s),(i!==m||a!==A||o!==v||l!==y)&&(e.blendFuncSeparate(G[i],G[a],G[o],G[l]),m=i,A=a,v=o,y=l),(!1===c.equals(x)||h!==S)&&(e.blendColor(c.r,c.g,c.b,h),x.copy(c),S=h),f=t,E=!1}function j(t){w!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),w=t)}function q(t){0!==t?(Q(e.CULL_FACE),t!==_&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):z(e.CULL_FACE),_=t}function W(t,r,i){t?(Q(e.POLYGON_OFFSET_FILL),(M!==r||I!==i)&&(e.polygonOffset(r,i),M=r,I=i)):z(e.POLYGON_OFFSET_FILL)}return{buffers:{color:r,depth:i,stencil:a},enable:Q,disable:z,bindFramebuffer:function(t,r){return c[t]!==r&&(e.bindFramebuffer(t,r),c[t]=r,t===e.DRAW_FRAMEBUFFER&&(c[e.FRAMEBUFFER]=r),t===e.FRAMEBUFFER&&(c[e.DRAW_FRAMEBUFFER]=r),!0)},drawBuffers:function(t,r){let i=u,n=!1;if(t){void 0===(i=h.get(r))&&(i=[],h.set(r,i));let a=t.textures;if(i.length!==a.length||i[0]!==e.COLOR_ATTACHMENT0){for(let t=0,r=a.length;t<r;t++)i[t]=e.COLOR_ATTACHMENT0+t;i.length=a.length,n=!0}}else i[0]!==e.BACK&&(i[0]=e.BACK,n=!0);n&&e.drawBuffers(i)},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:V,setMaterial:function(t,n){2===t.side?z(e.CULL_FACE):Q(e.CULL_FACE);let s=1===t.side;n&&(s=!s),j(s),1===t.blending&&!1===t.transparent?V(0):V(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),r.setMask(t.colorWrite);let o=t.stencilWrite;a.setTest(o),o&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),W(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?Q(e.SAMPLE_ALPHA_TO_COVERAGE):z(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:j,setCullFace:q,setLineWidth:function(t){t!==C&&(R&&e.lineWidth(t),C=t)},setPolygonOffset:W,setScissorTest:function(t){t?Q(e.SCISSOR_TEST):z(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+T-1),k!==t&&(e.activeTexture(t),k=t)},bindTexture:function(t,r,i){void 0===i&&(i=null===k?e.TEXTURE0+T-1:k);let n=P[i];void 0===n&&(n={type:void 0,texture:void 0},P[i]=n),(n.type!==t||n.texture!==r)&&(k!==i&&(e.activeTexture(i),k=i),e.bindTexture(t,r||O[t]),n.type=t,n.texture=r)},unbindTexture:function(){let t=P[k];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},texImage2D:function(){try{e.texImage2D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},texImage3D:function(){try{e.texImage3D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},updateUBOMapping:function(t,r){let i=o.get(r);void 0===i&&(i=new WeakMap,o.set(r,i));let n=i.get(t);void 0===n&&(n=e.getUniformBlockIndex(r,t.name),i.set(t,n))},uniformBlockBinding:function(t,r){let i=o.get(r).get(t);s.get(r)!==i&&(e.uniformBlockBinding(r,i,t.__bindingPointIndex),s.set(r,i))},texStorage2D:function(){try{e.texStorage2D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D(...arguments)}catch(e){(0,n.z3S)("WebGLState:",e)}},scissor:function(t){!1===F.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),F.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),i.setReversed(!1),e.clearDepth(1),e.stencilMask(0xffffffff),e.stencilFunc(e.ALWAYS,0,0xffffffff),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),l={},k=null,P={},c={},h=new WeakMap,u=[],d=null,p=!1,f=null,g=null,m=null,A=null,b=null,v=null,y=null,x=new n.Q1f(0,0,0),S=0,E=!1,w=null,_=null,C=null,M=null,I=null,F.set(0,0,e.canvas.width,e.canvas.height),N.set(0,0,e.canvas.width,e.canvas.height),r.reset(),i.reset(),a.reset()}}}function tM(e,t,r,i,a,s,o){let l,c=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,h="u">typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),u=new n.I9Y,d=new WeakMap,p=new WeakMap,f=!1;try{f="u">typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function g(e,t){return f?new OffscreenCanvas(e,t):(0,n.qq$)("canvas")}function m(e,t,r){let i=1,a=G(e);if((a.width>r||a.height>r)&&(i=r/Math.max(a.width,a.height)),i<1)if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap||"u">typeof VideoFrame&&e instanceof VideoFrame){let r=Math.floor(i*a.width),s=Math.floor(i*a.height);void 0===l&&(l=g(r,s));let o=t?g(r,s):l;return o.width=r,o.height=s,o.getContext("2d").drawImage(e,0,0,r,s),(0,n.R8M)("WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+r+"x"+s+")."),o}else"data"in e&&(0,n.R8M)("WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").");return e}function A(e){return e.generateMipmaps}function b(t){e.generateMipmap(t)}function v(r,i,a,s,o=!1){if(null!==r){if(void 0!==e[r])return e[r];(0,n.R8M)("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let l=i;if(i===e.RED&&(a===e.FLOAT&&(l=e.R32F),a===e.HALF_FLOAT&&(l=e.R16F),a===e.UNSIGNED_BYTE&&(l=e.R8)),i===e.RED_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.R8UI),a===e.UNSIGNED_SHORT&&(l=e.R16UI),a===e.UNSIGNED_INT&&(l=e.R32UI),a===e.BYTE&&(l=e.R8I),a===e.SHORT&&(l=e.R16I),a===e.INT&&(l=e.R32I)),i===e.RG&&(a===e.FLOAT&&(l=e.RG32F),a===e.HALF_FLOAT&&(l=e.RG16F),a===e.UNSIGNED_BYTE&&(l=e.RG8)),i===e.RG_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.RG8UI),a===e.UNSIGNED_SHORT&&(l=e.RG16UI),a===e.UNSIGNED_INT&&(l=e.RG32UI),a===e.BYTE&&(l=e.RG8I),a===e.SHORT&&(l=e.RG16I),a===e.INT&&(l=e.RG32I)),i===e.RGB_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.RGB8UI),a===e.UNSIGNED_SHORT&&(l=e.RGB16UI),a===e.UNSIGNED_INT&&(l=e.RGB32UI),a===e.BYTE&&(l=e.RGB8I),a===e.SHORT&&(l=e.RGB16I),a===e.INT&&(l=e.RGB32I)),i===e.RGBA_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),a===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),a===e.UNSIGNED_INT&&(l=e.RGBA32UI),a===e.BYTE&&(l=e.RGBA8I),a===e.SHORT&&(l=e.RGBA16I),a===e.INT&&(l=e.RGBA32I)),i===e.RGB&&(a===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),a===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),i===e.RGBA){let t=o?"linear":n.ppV.getTransfer(s);a===e.FLOAT&&(l=e.RGBA32F),a===e.HALF_FLOAT&&(l=e.RGBA16F),a===e.UNSIGNED_BYTE&&(l="srgb"===t?e.SRGB8_ALPHA8:e.RGBA8),a===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),a===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get("EXT_color_buffer_float"),l}function y(t,r){let i;return t?null===r||1014===r||1020===r?i=e.DEPTH24_STENCIL8:1015===r?i=e.DEPTH32F_STENCIL8:1012===r&&(i=e.DEPTH24_STENCIL8,(0,n.R8M)("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===r||1014===r||1020===r?i=e.DEPTH_COMPONENT24:1015===r?i=e.DEPTH_COMPONENT32F:1012===r&&(i=e.DEPTH_COMPONENT16),i}function x(e,t){return!0===A(e)||e.isFramebufferTexture&&1003!==e.minFilter&&1006!==e.minFilter?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){let t=e.target;t.removeEventListener("dispose",S),function(e){let t=i.get(e);if(void 0===t.__webglInit)return;let r=e.source,n=p.get(r);if(n){let i=n[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&w(e),0===Object.keys(n).length&&p.delete(r)}i.remove(e)}(t),t.isVideoTexture&&d.delete(t)}function E(t){let r=t.target;r.removeEventListener("dispose",E),function(t){let r=i.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),i.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(r.__webglFramebuffer[t]))for(let i=0;i<r.__webglFramebuffer[t].length;i++)e.deleteFramebuffer(r.__webglFramebuffer[t][i]);else e.deleteFramebuffer(r.__webglFramebuffer[t]);r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[t])}else{if(Array.isArray(r.__webglFramebuffer))for(let t=0;t<r.__webglFramebuffer.length;t++)e.deleteFramebuffer(r.__webglFramebuffer[t]);else e.deleteFramebuffer(r.__webglFramebuffer);if(r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let t=0;t<r.__webglColorRenderbuffer.length;t++)r.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(r.__webglColorRenderbuffer[t]);r.__webglDepthRenderbuffer&&e.deleteRenderbuffer(r.__webglDepthRenderbuffer)}let n=t.textures;for(let t=0,r=n.length;t<r;t++){let r=i.get(n[t]);r.__webglTexture&&(e.deleteTexture(r.__webglTexture),o.memory.textures--),i.remove(n[t])}i.remove(t)}(r)}function w(t){let r=i.get(t);e.deleteTexture(r.__webglTexture);let n=t.source,a=p.get(n);delete a[r.__cacheKey],o.memory.textures--}let _=0;function C(t,a){var s;let l,c=i.get(t);if(t.isVideoTexture&&(s=t,l=o.render.frame,d.get(s)!==l&&(d.set(s,l),s.update())),!1===t.isRenderTargetTexture&&!0!==t.isExternalTexture&&t.version>0&&c.__version!==t.version){let e=t.image;if(null===e)(0,n.R8M)("WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void P(c,t,a);(0,n.R8M)("WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(c.__webglTexture=t.sourceTexture?t.sourceTexture:null);r.bindTexture(e.TEXTURE_2D,c.__webglTexture,e.TEXTURE0+a)}let M={1e3:e.REPEAT,1001:e.CLAMP_TO_EDGE,1002:e.MIRRORED_REPEAT},I={1003:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,1005:e.NEAREST_MIPMAP_LINEAR,1006:e.LINEAR,1007:e.LINEAR_MIPMAP_NEAREST,1008:e.LINEAR_MIPMAP_LINEAR},T={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function R(r,s){if((1015===s.type&&!1===t.has("OES_texture_float_linear")&&(1006===s.magFilter||1007===s.magFilter||1005===s.magFilter||1008===s.magFilter||1006===s.minFilter||1007===s.minFilter||1005===s.minFilter||1008===s.minFilter)&&(0,n.R8M)("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(r,e.TEXTURE_WRAP_S,M[s.wrapS]),e.texParameteri(r,e.TEXTURE_WRAP_T,M[s.wrapT]),(r===e.TEXTURE_3D||r===e.TEXTURE_2D_ARRAY)&&e.texParameteri(r,e.TEXTURE_WRAP_R,M[s.wrapR]),e.texParameteri(r,e.TEXTURE_MAG_FILTER,I[s.magFilter]),e.texParameteri(r,e.TEXTURE_MIN_FILTER,I[s.minFilter]),s.compareFunction&&(e.texParameteri(r,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(r,e.TEXTURE_COMPARE_FUNC,T[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&1003!==s.magFilter&&(1005===s.minFilter||1008===s.minFilter)&&(1015!==s.type||!1!==t.has("OES_texture_float_linear"))&&(s.anisotropy>1||i.get(s).__currentAnisotropy)){let n=t.get("EXT_texture_filter_anisotropic");e.texParameterf(r,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,a.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy}}function B(t,r){let i,n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",S));let a=r.source,s=p.get(a);void 0===s&&(s={},p.set(a,s));let l=((i=[]).push(r.wrapS),i.push(r.wrapT),i.push(r.wrapR||0),i.push(r.magFilter),i.push(r.minFilter),i.push(r.anisotropy),i.push(r.internalFormat),i.push(r.format),i.push(r.type),i.push(r.generateMipmaps),i.push(r.premultiplyAlpha),i.push(r.flipY),i.push(r.unpackAlignment),i.push(r.colorSpace),i.join());if(l!==t.__cacheKey){void 0===s[l]&&(s[l]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,n=!0),s[l].usedTimes++;let i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&w(r)),t.__cacheKey=l,t.__webglTexture=s[l].texture}return n}function k(e,t,r){return Math.floor(Math.floor(e/r)/t)}function P(t,o,l){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);let h=B(t,o),u=o.source;r.bindTexture(c,t.__webglTexture,e.TEXTURE0+l);let d=i.get(u);if(u.version!==d.__version||!0===h){let t;r.activeTexture(e.TEXTURE0+l);let i=n.ppV.getPrimaries(n.ppV.workingColorSpace),p=""===o.colorSpace?null:n.ppV.getPrimaries(o.colorSpace),f=""===o.colorSpace||i===p?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);let g=m(o.image,!1,a.maxTextureSize);g=H(o,g);let S=s.convert(o.format,o.colorSpace),E=s.convert(o.type),w=v(o.internalFormat,S,E,o.colorSpace,o.isVideoTexture);R(c,o);let _=o.mipmaps,C=!0!==o.isVideoTexture,M=void 0===d.__version||!0===h,I=u.dataReady,T=x(o,g);if(o.isDepthTexture)w=y(1027===o.format,o.type),M&&(C?r.texStorage2D(e.TEXTURE_2D,1,w,g.width,g.height):r.texImage2D(e.TEXTURE_2D,0,w,g.width,g.height,0,S,E,null));else if(o.isDataTexture)if(_.length>0){C&&M&&r.texStorage2D(e.TEXTURE_2D,T,w,_[0].width,_[0].height);for(let i=0,n=_.length;i<n;i++)t=_[i],C?I&&r.texSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,S,E,t.data):r.texImage2D(e.TEXTURE_2D,i,w,t.width,t.height,0,S,E,t.data);o.generateMipmaps=!1}else C?(M&&r.texStorage2D(e.TEXTURE_2D,T,w,g.width,g.height),I&&function(t,i,n,a){let s=t.updateRanges;if(0===s.length)r.texSubImage2D(e.TEXTURE_2D,0,0,0,i.width,i.height,n,a,i.data);else{s.sort((e,t)=>e.start-t.start);let o=0;for(let e=1;e<s.length;e++){let t=s[o],r=s[e],n=t.start+t.count,a=k(r.start,i.width,4),l=k(t.start,i.width,4);r.start<=n+1&&a===l&&k(r.start+r.count-1,i.width,4)===a?t.count=Math.max(t.count,r.start+r.count-t.start):s[++o]=r}s.length=o+1;let l=e.getParameter(e.UNPACK_ROW_LENGTH),c=e.getParameter(e.UNPACK_SKIP_PIXELS),h=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,i.width);for(let t=0,o=s.length;t<o;t++){let o=s[t],l=Math.floor(o.start/4),c=Math.ceil(o.count/4),h=l%i.width,u=Math.floor(l/i.width);e.pixelStorei(e.UNPACK_SKIP_PIXELS,h),e.pixelStorei(e.UNPACK_SKIP_ROWS,u),r.texSubImage2D(e.TEXTURE_2D,0,h,u,c,1,n,a,i.data)}t.clearUpdateRanges(),e.pixelStorei(e.UNPACK_ROW_LENGTH,l),e.pixelStorei(e.UNPACK_SKIP_PIXELS,c),e.pixelStorei(e.UNPACK_SKIP_ROWS,h)}}(o,g,S,E)):r.texImage2D(e.TEXTURE_2D,0,w,g.width,g.height,0,S,E,g.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){C&&M&&r.texStorage3D(e.TEXTURE_2D_ARRAY,T,w,_[0].width,_[0].height,g.depth);for(let i=0,a=_.length;i<a;i++)if(t=_[i],1023!==o.format)if(null!==S)if(C){if(I)if(o.layerUpdates.size>0){let a=(0,n.Nex)(t.width,t.height,o.format,o.type);for(let n of o.layerUpdates){let s=t.data.subarray(n*a/t.data.BYTES_PER_ELEMENT,(n+1)*a/t.data.BYTES_PER_ELEMENT);r.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,n,t.width,t.height,1,S,s)}o.clearLayerUpdates()}else r.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,g.depth,S,t.data)}else r.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,w,t.width,t.height,g.depth,0,t.data,0,0);else(0,n.R8M)("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else C?I&&r.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,g.depth,S,E,t.data):r.texImage3D(e.TEXTURE_2D_ARRAY,i,w,t.width,t.height,g.depth,0,S,E,t.data)}else{C&&M&&r.texStorage2D(e.TEXTURE_2D,T,w,_[0].width,_[0].height);for(let i=0,a=_.length;i<a;i++)t=_[i],1023!==o.format?null!==S?C?I&&r.compressedTexSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,S,t.data):r.compressedTexImage2D(e.TEXTURE_2D,i,w,t.width,t.height,0,t.data):(0,n.R8M)("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?I&&r.texSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,S,E,t.data):r.texImage2D(e.TEXTURE_2D,i,w,t.width,t.height,0,S,E,t.data)}else if(o.isDataArrayTexture)if(C){if(M&&r.texStorage3D(e.TEXTURE_2D_ARRAY,T,w,g.width,g.height,g.depth),I)if(o.layerUpdates.size>0){let t=(0,n.Nex)(g.width,g.height,o.format,o.type);for(let i of o.layerUpdates){let n=g.data.subarray(i*t/g.data.BYTES_PER_ELEMENT,(i+1)*t/g.data.BYTES_PER_ELEMENT);r.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,i,g.width,g.height,1,S,E,n)}o.clearLayerUpdates()}else r.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,g.width,g.height,g.depth,S,E,g.data)}else r.texImage3D(e.TEXTURE_2D_ARRAY,0,w,g.width,g.height,g.depth,0,S,E,g.data);else if(o.isData3DTexture)C?(M&&r.texStorage3D(e.TEXTURE_3D,T,w,g.width,g.height,g.depth),I&&r.texSubImage3D(e.TEXTURE_3D,0,0,0,0,g.width,g.height,g.depth,S,E,g.data)):r.texImage3D(e.TEXTURE_3D,0,w,g.width,g.height,g.depth,0,S,E,g.data);else if(o.isFramebufferTexture){if(M)if(C)r.texStorage2D(e.TEXTURE_2D,T,w,g.width,g.height);else{let t=g.width,i=g.height;for(let n=0;n<T;n++)r.texImage2D(e.TEXTURE_2D,n,w,t,i,0,S,E,null),t>>=1,i>>=1}}else if(_.length>0){if(C&&M){let t=G(_[0]);r.texStorage2D(e.TEXTURE_2D,T,w,t.width,t.height)}for(let i=0,n=_.length;i<n;i++)t=_[i],C?I&&r.texSubImage2D(e.TEXTURE_2D,i,0,0,S,E,t):r.texImage2D(e.TEXTURE_2D,i,w,S,E,t);o.generateMipmaps=!1}else if(C){if(M){let t=G(g);r.texStorage2D(e.TEXTURE_2D,T,w,t.width,t.height)}I&&r.texSubImage2D(e.TEXTURE_2D,0,0,0,S,E,g)}else r.texImage2D(e.TEXTURE_2D,0,w,S,E,g);A(o)&&b(c),d.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function D(t,n,a,o,l,h){let u=s.convert(a.format,a.colorSpace),d=s.convert(a.type),p=v(a.internalFormat,u,d,a.colorSpace),f=i.get(n),g=i.get(a);if(g.__renderTarget=n,!f.__hasExternalTextures){let t=Math.max(1,n.width>>h),i=Math.max(1,n.height>>h);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?r.texImage3D(l,h,p,t,i,n.depth,0,u,d,null):r.texImage2D(l,h,p,t,i,0,u,d,null)}r.bindFramebuffer(e.FRAMEBUFFER,t),z(n)?c.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,l,g.__webglTexture,0,Q(n)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,l,g.__webglTexture,h),r.bindFramebuffer(e.FRAMEBUFFER,null)}function L(t,r,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),r.depthBuffer){let n=r.depthTexture,a=n&&n.isDepthTexture?n.type:null,s=y(r.stencilBuffer,a),o=r.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;z(r)?c.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,Q(r),s,r.width,r.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,Q(r),s,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,s,r.width,r.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,e.RENDERBUFFER,t)}else{let t=r.textures;for(let n=0;n<t.length;n++){let a=t[n],o=s.convert(a.format,a.colorSpace),l=s.convert(a.type),h=v(a.internalFormat,o,l,a.colorSpace);z(r)?c.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,Q(r),h,r.width,r.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,Q(r),h,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,h,r.width,r.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function F(t,n,a){let o=!0===n.isWebGLCubeRenderTarget;if(r.bindFramebuffer(e.FRAMEBUFFER,t),!(n.depthTexture&&n.depthTexture.isDepthTexture))throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");let l=i.get(n.depthTexture);if(l.__renderTarget=n,l.__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),o){if(void 0===l.__webglInit&&(l.__webglInit=!0,n.depthTexture.addEventListener("dispose",S)),void 0===l.__webglTexture){let t;l.__webglTexture=e.createTexture(),r.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),R(e.TEXTURE_CUBE_MAP,n.depthTexture);let i=s.convert(n.depthTexture.format),a=s.convert(n.depthTexture.type);1026===n.depthTexture.format?t=e.DEPTH_COMPONENT24:1027===n.depthTexture.format&&(t=e.DEPTH24_STENCIL8);for(let r=0;r<6;r++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,t,n.width,n.height,0,i,a,null)}}else C(n.depthTexture,0);let h=l.__webglTexture,u=Q(n),d=o?e.TEXTURE_CUBE_MAP_POSITIVE_X+a:e.TEXTURE_2D,p=1027===n.depthTexture.format?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(1026===n.depthTexture.format)z(n)?c.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,d,h,0,u):e.framebufferTexture2D(e.FRAMEBUFFER,p,d,h,0);else if(1027===n.depthTexture.format)z(n)?c.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,d,h,0,u):e.framebufferTexture2D(e.FRAMEBUFFER,p,d,h,0);else throw Error("Unknown depthTexture format")}function N(t){let n=i.get(t),a=!0===t.isWebGLCubeRenderTarget;if(n.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(n.__depthDisposeCallback&&n.__depthDisposeCallback(),e){let t=()=>{delete n.__boundDepthTexture,delete n.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),n.__depthDisposeCallback=t}n.__boundDepthTexture=e}if(t.depthTexture&&!n.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)F(n.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?F(n.__webglFramebuffer[0],t,0):F(n.__webglFramebuffer,t,0)}else if(a){n.__webglDepthbuffer=[];for(let i=0;i<6;i++)if(r.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[i]),void 0===n.__webglDepthbuffer[i])n.__webglDepthbuffer[i]=e.createRenderbuffer(),L(n.__webglDepthbuffer[i],t,!1);else{let r=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=n.__webglDepthbuffer[i];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,r,e.RENDERBUFFER,a)}}else{let i=t.texture.mipmaps;if(i&&i.length>0?r.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[0]):r.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),void 0===n.__webglDepthbuffer)n.__webglDepthbuffer=e.createRenderbuffer(),L(n.__webglDepthbuffer,t,!1);else{let r=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,i=n.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,i),e.framebufferRenderbuffer(e.FRAMEBUFFER,r,e.RENDERBUFFER,i)}}r.bindFramebuffer(e.FRAMEBUFFER,null)}let U=[],O=[];function Q(e){return Math.min(a.maxSamples,e.samples)}function z(e){let r=i.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function H(e,t){let r=e.colorSpace,i=e.format,a=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||r!==n.Zr2&&""!==r&&("srgb"===n.ppV.getTransfer(r)?(1023!==i||1009!==a)&&(0,n.R8M)("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):(0,n.z3S)("WebGLTextures: Unsupported texture color space:",r)),t}function G(e){return"u">typeof HTMLImageElement&&e instanceof HTMLImageElement?(u.width=e.naturalWidth||e.width,u.height=e.naturalHeight||e.height):"u">typeof VideoFrame&&e instanceof VideoFrame?(u.width=e.displayWidth,u.height=e.displayHeight):(u.width=e.width,u.height=e.height),u}this.allocateTextureUnit=function(){let e=_;return e>=a.maxTextures&&(0,n.R8M)("WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+a.maxTextures),_+=1,e},this.resetTextureUnits=function(){_=0},this.setTexture2D=C,this.setTexture2DArray=function(t,n){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?P(a,t,n):(t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),r.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+n))},this.setTexture3D=function(t,n){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?P(a,t,n):r.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+n)},this.setTextureCube=function(t,o){let l=i.get(t);!0!==t.isCubeDepthTexture&&t.version>0&&l.__version!==t.version?function(t,o,l){if(6!==o.image.length)return;let c=B(t,o),h=o.source;r.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+l);let u=i.get(h);if(h.version!==u.__version||!0===c){let t;r.activeTexture(e.TEXTURE0+l);let i=n.ppV.getPrimaries(n.ppV.workingColorSpace),d=""===o.colorSpace?null:n.ppV.getPrimaries(o.colorSpace),p=""===o.colorSpace||i===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let f=o.isCompressedTexture||o.image[0].isCompressedTexture,g=o.image[0]&&o.image[0].isDataTexture,y=[];for(let e=0;e<6;e++)f||g?y[e]=g?o.image[e].image:o.image[e]:y[e]=m(o.image[e],!0,a.maxCubemapSize),y[e]=H(o,y[e]);let S=y[0],E=s.convert(o.format,o.colorSpace),w=s.convert(o.type),_=v(o.internalFormat,E,w,o.colorSpace),C=!0!==o.isVideoTexture,M=void 0===u.__version||!0===c,I=h.dataReady,T=x(o,S);if(R(e.TEXTURE_CUBE_MAP,o),f){C&&M&&r.texStorage2D(e.TEXTURE_CUBE_MAP,T,_,S.width,S.height);for(let i=0;i<6;i++){t=y[i].mipmaps;for(let a=0;a<t.length;a++){let s=t[a];1023!==o.format?null!==E?C?I&&r.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,a,0,0,s.width,s.height,E,s.data):r.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,a,_,s.width,s.height,0,s.data):(0,n.R8M)("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):C?I&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,a,0,0,s.width,s.height,E,w,s.data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,a,_,s.width,s.height,0,E,w,s.data)}}}else{if(t=o.mipmaps,C&&M){t.length>0&&T++;let i=G(y[0]);r.texStorage2D(e.TEXTURE_CUBE_MAP,T,_,i.width,i.height)}for(let i=0;i<6;i++)if(g){C?I&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,y[i].width,y[i].height,E,w,y[i].data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,_,y[i].width,y[i].height,0,E,w,y[i].data);for(let n=0;n<t.length;n++){let a=t[n].image[i].image;C?I&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,n+1,0,0,a.width,a.height,E,w,a.data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,n+1,_,a.width,a.height,0,E,w,a.data)}}else{C?I&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,E,w,y[i]):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,_,E,w,y[i]);for(let n=0;n<t.length;n++){let a=t[n];C?I&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,n+1,0,0,E,w,a.image[i]):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,n+1,_,E,w,a.image[i])}}}A(o)&&b(e.TEXTURE_CUBE_MAP),u.__version=h.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(l,t,o):r.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,r,n){let a=i.get(t);void 0!==r&&D(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==n&&N(t)},this.setupRenderTarget=function(t){let n=t.texture,a=i.get(t),l=i.get(n);t.addEventListener("dispose",E);let c=t.textures,h=!0===t.isWebGLCubeRenderTarget,u=c.length>1;if(!u&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=n.version,o.memory.textures++),h){a.__webglFramebuffer=[];for(let t=0;t<6;t++)if(n.mipmaps&&n.mipmaps.length>0){a.__webglFramebuffer[t]=[];for(let r=0;r<n.mipmaps.length;r++)a.__webglFramebuffer[t][r]=e.createFramebuffer()}else a.__webglFramebuffer[t]=e.createFramebuffer()}else{if(n.mipmaps&&n.mipmaps.length>0){a.__webglFramebuffer=[];for(let t=0;t<n.mipmaps.length;t++)a.__webglFramebuffer[t]=e.createFramebuffer()}else a.__webglFramebuffer=e.createFramebuffer();if(u)for(let t=0,r=c.length;t<r;t++){let r=i.get(c[t]);void 0===r.__webglTexture&&(r.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===z(t)){a.__webglMultisampledFramebuffer=e.createFramebuffer(),a.__webglColorRenderbuffer=[],r.bindFramebuffer(e.FRAMEBUFFER,a.__webglMultisampledFramebuffer);for(let r=0;r<c.length;r++){let i=c[r];a.__webglColorRenderbuffer[r]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,a.__webglColorRenderbuffer[r]);let n=s.convert(i.format,i.colorSpace),o=s.convert(i.type),l=v(i.internalFormat,n,o,i.colorSpace,!0===t.isXRRenderTarget),h=Q(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,h,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+r,e.RENDERBUFFER,a.__webglColorRenderbuffer[r])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(a.__webglDepthRenderbuffer=e.createRenderbuffer(),L(a.__webglDepthRenderbuffer,t,!0)),r.bindFramebuffer(e.FRAMEBUFFER,null)}}if(h){r.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),R(e.TEXTURE_CUBE_MAP,n);for(let r=0;r<6;r++)if(n.mipmaps&&n.mipmaps.length>0)for(let i=0;i<n.mipmaps.length;i++)D(a.__webglFramebuffer[r][i],t,n,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i);else D(a.__webglFramebuffer[r],t,n,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0);A(n)&&b(e.TEXTURE_CUBE_MAP),r.unbindTexture()}else if(u){for(let n=0,s=c.length;n<s;n++){let s=c[n],o=i.get(s),l=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(l=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),r.bindTexture(l,o.__webglTexture),R(l,s),D(a.__webglFramebuffer,t,s,e.COLOR_ATTACHMENT0+n,l,0),A(s)&&b(l)}r.unbindTexture()}else{let i=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(i=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),r.bindTexture(i,l.__webglTexture),R(i,n),n.mipmaps&&n.mipmaps.length>0)for(let r=0;r<n.mipmaps.length;r++)D(a.__webglFramebuffer[r],t,n,e.COLOR_ATTACHMENT0,i,r);else D(a.__webglFramebuffer,t,n,e.COLOR_ATTACHMENT0,i,0);A(n)&&b(i),r.unbindTexture()}t.depthBuffer&&N(t)},this.updateRenderTargetMipmap=function(t){let n=t.textures;for(let a=0,s=n.length;a<s;a++){let s=n[a];if(A(s)){let n=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D,a=i.get(s).__webglTexture;r.bindTexture(n,a),b(n),r.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0){if(!1===z(t)){let n=t.textures,a=t.width,s=t.height,o=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=i.get(t),u=n.length>1;if(u)for(let t=0;t<n.length;t++)r.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),r.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);r.bindFramebuffer(e.READ_FRAMEBUFFER,c.__webglMultisampledFramebuffer);let d=t.texture.mipmaps;d&&d.length>0?r.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):r.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let r=0;r<n.length;r++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),u){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,c.__webglColorRenderbuffer[r]);let t=i.get(n[r]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,s,0,0,a,s,o,e.NEAREST),!0===h&&(U.length=0,O.length=0,U.push(e.COLOR_ATTACHMENT0+r),t.depthBuffer&&!1===t.resolveDepthBuffer&&(U.push(l),O.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,O)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,U))}if(r.bindFramebuffer(e.READ_FRAMEBUFFER,null),r.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),u)for(let t=0;t<n.length;t++){r.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,c.__webglColorRenderbuffer[t]);let a=i.get(n[t]).__webglTexture;r.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}r.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&h){let r=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[r])}}},this.setupDepthRenderbuffer=N,this.setupFrameBufferTexture=D,this.useMultisampledRTT=z,this.isReversedDepthBuffer=function(){return r.buffers.depth.getReversed()}}function tI(e,t){return{convert:function(r,i=""){let a,s=n.ppV.getTransfer(i);if(1009===r)return e.UNSIGNED_BYTE;if(1017===r)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===r)return e.UNSIGNED_SHORT_5_5_5_1;if(35902===r)return e.UNSIGNED_INT_5_9_9_9_REV;if(35899===r)return e.UNSIGNED_INT_10F_11F_11F_REV;if(1010===r)return e.BYTE;if(1011===r)return e.SHORT;if(1012===r)return e.UNSIGNED_SHORT;if(1013===r)return e.INT;if(1014===r)return e.UNSIGNED_INT;if(1015===r)return e.FLOAT;if(1016===r)return e.HALF_FLOAT;if(1021===r)return e.ALPHA;if(1022===r)return e.RGB;if(1023===r)return e.RGBA;if(1026===r)return e.DEPTH_COMPONENT;if(1027===r)return e.DEPTH_STENCIL;if(1028===r)return e.RED;if(1029===r)return e.RED_INTEGER;if(1030===r)return e.RG;if(1031===r)return e.RG_INTEGER;if(1033===r)return e.RGBA_INTEGER;if(33776===r||33777===r||33778===r||33779===r)if("srgb"===s){if(null===(a=t.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(33776===r)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(33777===r)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(33778===r)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(33779===r)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(a=t.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===r)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===r)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===r)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===r)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===r||35841===r||35842===r||35843===r){if(null===(a=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===r)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===r)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===r)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===r)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===r||37492===r||37496===r||37488===r||37489===r||37490===r||37491===r){if(null===(a=t.get("WEBGL_compressed_texture_etc")))return null;if(36196===r||37492===r)return"srgb"===s?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(37496===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC;if(37488===r)return a.COMPRESSED_R11_EAC;if(37489===r)return a.COMPRESSED_SIGNED_R11_EAC;if(37490===r)return a.COMPRESSED_RG11_EAC;if(37491===r)return a.COMPRESSED_SIGNED_RG11_EAC}if(37808===r||37809===r||37810===r||37811===r||37812===r||37813===r||37814===r||37815===r||37816===r||37817===r||37818===r||37819===r||37820===r||37821===r){if(null===(a=t.get("WEBGL_compressed_texture_astc")))return null;if(37808===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===r)return"srgb"===s?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(36492===r||36494===r||36495===r){if(null===(a=t.get("EXT_texture_compression_bptc")))return null;if(36492===r)return"srgb"===s?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===r)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===r)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===r||36284===r||36285===r||36286===r){if(null===(a=t.get("EXT_texture_compression_rgtc")))return null;if(36283===r)return a.COMPRESSED_RED_RGTC1_EXT;if(36284===r)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===r)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===r)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return 1020===r?e.UNSIGNED_INT_24_8:void 0!==e[r]?e[r]:null}}}let tT=`
831
+ void main() {
832
+
833
+ gl_Position = vec4( position, 1.0 );
834
+
835
+ }`,tR=`
836
+ uniform sampler2DArray depthColor;
837
+ uniform float depthWidth;
838
+ uniform float depthHeight;
839
+
840
+ void main() {
841
+
842
+ vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
843
+
844
+ if ( coord.x >= 1.0 ) {
845
+
846
+ gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
847
+
848
+ } else {
849
+
850
+ gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
851
+
852
+ }
853
+
854
+ }`;class tB{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(null===this.texture){let r=new n.rjZ(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,r=new n.BKk({vertexShader:tT,fragmentShader:tR,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new n.eaF(new n.bdM(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class tk extends n.Qev{constructor(e,t){super();const r=this;let i=null,s=1,o=null,l="local-floor",c=1,h=null,u=null,d=null,p=null,f=null,g=null;const m="u">typeof XRWebGLBinding,A=new tB,b={},v=t.getContextAttributes();let y=null,x=null;const S=[],E=[],w=new n.I9Y;let _=null;const C=new n.ubm;C.viewport=new n.IUQ;const M=new n.ubm;M.viewport=new n.IUQ;const I=[C,M],T=new n.nZQ;let R=null,B=null;function k(e){let t=E.indexOf(e.inputSource);if(-1===t)return;let r=S[t];void 0!==r&&(r.update(e.inputSource,e.frame,h||o),r.dispatchEvent({type:e.type,data:e.inputSource}))}function P(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",P),i.removeEventListener("inputsourceschange",D);for(let e=0;e<S.length;e++){let t=E[e];null!==t&&(E[e]=null,S[e].disconnect(t))}for(let e in R=null,B=null,A.reset(),b)delete b[e];e.setRenderTarget(y),f=null,p=null,d=null,i=null,x=null,O.stop(),r.isPresenting=!1,e.setPixelRatio(_),e.setSize(w.width,w.height,!1),r.dispatchEvent({type:"sessionend"})}function D(e){for(let t=0;t<e.removed.length;t++){let r=e.removed[t],i=E.indexOf(r);i>=0&&(E[i]=null,S[i].disconnect(r))}for(let t=0;t<e.added.length;t++){let r=e.added[t],i=E.indexOf(r);if(-1===i){for(let e=0;e<S.length;e++)if(e>=E.length){E.push(r),i=e;break}else if(null===E[e]){E[e]=r,i=e;break}if(-1===i)break}let n=S[i];n&&n.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=S[e];return void 0===t&&(t=new n.R3r,S[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=S[e];return void 0===t&&(t=new n.R3r,S[e]=t),t.getGripSpace()},this.getHand=function(e){let t=S[e];return void 0===t&&(t=new n.R3r,S[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){s=e,!0===r.isPresenting&&(0,n.R8M)("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){l=e,!0===r.isPresenting&&(0,n.R8M)("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||o},this.setReferenceSpace=function(e){h=e},this.getBaseLayer=function(){return null!==p?p:f},this.getBinding=function(){return null===d&&m&&(d=new XRWebGLBinding(i,t)),d},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(a){if(null!==(i=a)){if(y=e.getRenderTarget(),i.addEventListener("select",k),i.addEventListener("selectstart",k),i.addEventListener("selectend",k),i.addEventListener("squeeze",k),i.addEventListener("squeezestart",k),i.addEventListener("squeezeend",k),i.addEventListener("end",P),i.addEventListener("inputsourceschange",D),!0!==v.xrCompatible&&await t.makeXRCompatible(),_=e.getPixelRatio(),e.getSize(w),m&&"createProjectionLayer"in XRWebGLBinding.prototype){let r=null,a=null,o=null;v.depth&&(o=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,r=v.stencil?1027:1026,a=v.stencil?1020:1014);let l={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:s};p=(d=this.getBinding()).createProjectionLayer(l),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),x=new n.nWS(p.textureWidth,p.textureHeight,{format:1023,type:1009,depthTexture:new n.VCu(p.textureWidth,p.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:4*!!v.antialias,resolveDepthBuffer:!1===p.ignoreDepthValues,resolveStencilBuffer:!1===p.ignoreDepthValues})}else{let r={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,t,r),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),x=new n.nWS(f.framebufferWidth,f.framebufferHeight,{format:1023,type:1009,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:!1===f.ignoreDepthValues,resolveStencilBuffer:!1===f.ignoreDepthValues})}x.isXRRenderTarget=!0,this.setFoveation(c),h=null,o=await i.requestReferenceSpace(l),O.setContext(i),O.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return A.getDepthTexture()};const L=new n.Pq0,F=new n.Pq0;function N(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var t,r,a;if(null===i)return;let s=e.near,o=e.far;null!==A.texture&&(A.depthNear>0&&(s=A.depthNear),A.depthFar>0&&(o=A.depthFar)),T.near=M.near=C.near=s,T.far=M.far=C.far=o,(R!==T.near||B!==T.far)&&(i.updateRenderState({depthNear:T.near,depthFar:T.far}),R=T.near,B=T.far),T.layers.mask=6|e.layers.mask,C.layers.mask=3&T.layers.mask,M.layers.mask=5&T.layers.mask;let l=e.parent,c=T.cameras;N(T,l);for(let e=0;e<c.length;e++)N(c[e],l);2===c.length?function(e,t,r){L.setFromMatrixPosition(t.matrixWorld),F.setFromMatrixPosition(r.matrixWorld);let i=L.distanceTo(F),n=t.projectionMatrix.elements,a=r.projectionMatrix.elements,s=n[14]/(n[10]-1),o=n[14]/(n[10]+1),l=(n[9]+1)/n[5],c=(n[9]-1)/n[5],h=(n[8]-1)/n[0],u=(a[8]+1)/a[0],d=i/(-h+u),p=-(d*h);if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(p),e.translateZ(d),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===n[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=s+d,r=o+d;e.projectionMatrix.makePerspective(s*h-p,s*u+(i-p),l*o/r*t,c*o/r*t,t,r),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(T,C,M):T.projectionMatrix.copy(C.projectionMatrix),t=e,r=T,null===(a=l)?t.matrix.copy(r.matrixWorld):(t.matrix.copy(a.matrixWorld),t.matrix.invert(),t.matrix.multiply(r.matrixWorld)),t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(r.projectionMatrix),t.projectionMatrixInverse.copy(r.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*n.a55*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)},this.getCamera=function(){return T},this.getFoveation=function(){if(null!==p||null!==f)return c},this.setFoveation=function(e){c=e,null!==p&&(p.fixedFoveation=e),null!==f&&void 0!==f.fixedFoveation&&(f.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==A.texture},this.getDepthSensingMesh=function(){return A.getMesh(T)},this.getCameraTexture=function(e){return b[e]};let U=null;const O=new a;O.setAnimationLoop(function(t,a){if(u=a.getViewerPose(h||o),g=a,null!==u){let t=u.views;null!==f&&(e.setRenderTargetFramebuffer(x,f.framebuffer),e.setRenderTarget(x));let a=!1;t.length!==T.cameras.length&&(T.cameras.length=0,a=!0);for(let r=0;r<t.length;r++){let i=t[r],s=null;if(null!==f)s=f.getViewport(i);else{let t=d.getViewSubImage(p,i);s=t.viewport,0===r&&(e.setRenderTargetTextures(x,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(x))}let o=I[r];void 0===o&&((o=new n.ubm).layers.enable(r),o.viewport=new n.IUQ,I[r]=o),o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(i.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(s.x,s.y,s.width,s.height),0===r&&(T.matrix.copy(o.matrix),T.matrix.decompose(T.position,T.quaternion,T.scale)),!0===a&&T.cameras.push(o)}let s=i.enabledFeatures;if(s&&s.includes("depth-sensing")&&"gpu-optimized"==i.depthUsage&&m){let e=(d=r.getBinding()).getDepthInformation(t[0]);e&&e.isValid&&e.texture&&A.init(e,i.renderState)}if(s&&s.includes("camera-access")&&m){e.state.unbindTexture(),d=r.getBinding();for(let e=0;e<t.length;e++){let r=t[e].camera;if(r){let e=b[r];e||(e=new n.rjZ,b[r]=e);let t=d.getCameraImage(r);e.sourceTexture=t}}}}for(let e=0;e<S.length;e++){let t=E[e],r=S[e];null!==t&&void 0!==r&&r.update(t,a,h||o)}U&&U(t,a),a.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:a}),g=null}),this.setAnimationLoop=function(e){U=e},this.dispose=function(){}}}let tP=new n.O9p,tD=new n.kn4;function tL(e,t){function r(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function i(e,i){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map,r(i.map,e.mapTransform)),i.alphaMap&&(e.alphaMap.value=i.alphaMap,r(i.alphaMap,e.alphaMapTransform)),i.bumpMap&&(e.bumpMap.value=i.bumpMap,r(i.bumpMap,e.bumpMapTransform),e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,r(i.normalMap,e.normalMapTransform),e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,r(i.displacementMap,e.displacementMapTransform),e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap,r(i.emissiveMap,e.emissiveMapTransform)),i.specularMap&&(e.specularMap.value=i.specularMap,r(i.specularMap,e.specularMapTransform)),i.alphaTest>0&&(e.alphaTest.value=i.alphaTest);let n=t.get(i),a=n.envMap,s=n.envMapRotation;a&&(e.envMap.value=a,tP.copy(s),tP.x*=-1,tP.y*=-1,tP.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(tP.y*=-1,tP.z*=-1),e.envMapRotation.value.setFromMatrix4(tD.makeRotationFromEuler(tP)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity,r(i.lightMap,e.lightMapTransform)),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity,r(i.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,r){r.color.getRGB(t.fogColor.value,(0,n._Ut)(e)),r.isFog?(t.fogNear.value=r.near,t.fogFar.value=r.far):r.isFogExp2&&(t.fogDensity.value=r.density)},refreshMaterialUniforms:function(e,n,a,s,o){var l,c,h,u,d,p,f,g,m,A,b,v,y,x,S,E,w,_,C,M,I,T,R;let B;n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(e,n):n.isMeshToonMaterial?(i(e,n),l=e,(c=n).gradientMap&&(l.gradientMap.value=c.gradientMap)):n.isMeshPhongMaterial?(i(e,n),h=e,u=n,h.specular.value.copy(u.specular),h.shininess.value=Math.max(u.shininess,1e-4)):n.isMeshStandardMaterial?(i(e,n),d=e,p=n,d.metalness.value=p.metalness,p.metalnessMap&&(d.metalnessMap.value=p.metalnessMap,r(p.metalnessMap,d.metalnessMapTransform)),d.roughness.value=p.roughness,p.roughnessMap&&(d.roughnessMap.value=p.roughnessMap,r(p.roughnessMap,d.roughnessMapTransform)),p.envMap&&(d.envMapIntensity.value=p.envMapIntensity),n.isMeshPhysicalMaterial&&(f=e,g=n,m=o,f.ior.value=g.ior,g.sheen>0&&(f.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),f.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(f.sheenColorMap.value=g.sheenColorMap,r(g.sheenColorMap,f.sheenColorMapTransform)),g.sheenRoughnessMap&&(f.sheenRoughnessMap.value=g.sheenRoughnessMap,r(g.sheenRoughnessMap,f.sheenRoughnessMapTransform))),g.clearcoat>0&&(f.clearcoat.value=g.clearcoat,f.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(f.clearcoatMap.value=g.clearcoatMap,r(g.clearcoatMap,f.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,r(g.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(f.clearcoatNormalMap.value=g.clearcoatNormalMap,r(g.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),1===g.side&&f.clearcoatNormalScale.value.negate())),g.dispersion>0&&(f.dispersion.value=g.dispersion),g.iridescence>0&&(f.iridescence.value=g.iridescence,f.iridescenceIOR.value=g.iridescenceIOR,f.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(f.iridescenceMap.value=g.iridescenceMap,r(g.iridescenceMap,f.iridescenceMapTransform)),g.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=g.iridescenceThicknessMap,r(g.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),g.transmission>0&&(f.transmission.value=g.transmission,f.transmissionSamplerMap.value=m.texture,f.transmissionSamplerSize.value.set(m.width,m.height),g.transmissionMap&&(f.transmissionMap.value=g.transmissionMap,r(g.transmissionMap,f.transmissionMapTransform)),f.thickness.value=g.thickness,g.thicknessMap&&(f.thicknessMap.value=g.thicknessMap,r(g.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=g.attenuationDistance,f.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(f.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(f.anisotropyMap.value=g.anisotropyMap,r(g.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=g.specularIntensity,f.specularColor.value.copy(g.specularColor),g.specularColorMap&&(f.specularColorMap.value=g.specularColorMap,r(g.specularColorMap,f.specularColorMapTransform)),g.specularIntensityMap&&(f.specularIntensityMap.value=g.specularIntensityMap,r(g.specularIntensityMap,f.specularIntensityMapTransform)))):n.isMeshMatcapMaterial?(i(e,n),A=e,(b=n).matcap&&(A.matcap.value=b.matcap)):n.isMeshDepthMaterial?i(e,n):n.isMeshDistanceMaterial?(i(e,n),v=e,y=n,B=t.get(y).light,v.referencePosition.value.setFromMatrixPosition(B.matrixWorld),v.nearDistance.value=B.shadow.camera.near,v.farDistance.value=B.shadow.camera.far):n.isMeshNormalMaterial?i(e,n):n.isLineBasicMaterial?(x=e,S=n,x.diffuse.value.copy(S.color),x.opacity.value=S.opacity,S.map&&(x.map.value=S.map,r(S.map,x.mapTransform)),n.isLineDashedMaterial&&(E=e,w=n,E.dashSize.value=w.dashSize,E.totalSize.value=w.dashSize+w.gapSize,E.scale.value=w.scale)):n.isPointsMaterial?(_=e,C=n,M=a,I=s,_.diffuse.value.copy(C.color),_.opacity.value=C.opacity,_.size.value=C.size*M,_.scale.value=.5*I,C.map&&(_.map.value=C.map,r(C.map,_.uvTransform)),C.alphaMap&&(_.alphaMap.value=C.alphaMap,r(C.alphaMap,_.alphaMapTransform)),C.alphaTest>0&&(_.alphaTest.value=C.alphaTest)):n.isSpriteMaterial?(T=e,R=n,T.diffuse.value.copy(R.color),T.opacity.value=R.opacity,T.rotation.value=R.rotation,R.map&&(T.map.value=R.map,r(R.map,T.mapTransform)),R.alphaMap&&(T.alphaMap.value=R.alphaMap,r(R.alphaMap,T.alphaMapTransform)),R.alphaTest>0&&(T.alphaTest.value=R.alphaTest)):n.isShadowMaterial?(e.color.value.copy(n.color),e.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function tF(e,t,r,i){let a={},s={},o=[],l=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e){let t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?(0,n.R8M)("WebGLRenderer: Texture samplers can not be part of an uniforms group."):(0,n.R8M)("WebGLRenderer: Unsupported uniform value type.",e),t}function h(t){let r=t.target;r.removeEventListener("dispose",h);let i=o.indexOf(r.__bindingPointIndex);o.splice(i,1),e.deleteBuffer(a[r.id]),delete a[r.id],delete s[r.id]}return{bind:function(e,t){let r=t.program;i.uniformBlockBinding(e,r)},update:function(r,u){var d;let p,f,g,m,A=a[r.id];void 0===A&&(function(e){let t=e.uniforms,r=0;for(let e=0,i=t.length;e<i;e++){let i=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=i.length;e<t;e++){let t=i[e],n=Array.isArray(t.value)?t.value:[t.value];for(let e=0,i=n.length;e<i;e++){let i=c(n[e]),a=r%16,s=a%i.boundary,o=a+s;r+=s,0!==o&&16-o<i.storage&&(r+=16-o),t.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=r,r+=i.storage}}}let i=r%16;i>0&&(r+=16-i),e.__size=r,e.__cache={}}(r),(d=r).__bindingPointIndex=p=function(){for(let e=0;e<l;e++)if(-1===o.indexOf(e))return o.push(e),e;return(0,n.z3S)("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}(),f=e.createBuffer(),g=d.__size,m=d.usage,e.bindBuffer(e.UNIFORM_BUFFER,f),e.bufferData(e.UNIFORM_BUFFER,g,m),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,p,f),A=f,a[r.id]=A,r.addEventListener("dispose",h));let b=u.program;i.updateUBOMapping(r,b);let v=t.render.frame;s[r.id]!==v&&(function(t){let r=a[t.id],i=t.uniforms,n=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,r);for(let t=0,r=i.length;t<r;t++){let r=Array.isArray(i[t])?i[t]:[i[t]];for(let i=0,a=r.length;i<a;i++){let a=r[i];if(!0===function(e,t,r,i){let n=e.value,a=t+"_"+r;if(void 0===i[a])return"number"==typeof n||"boolean"==typeof n?i[a]=n:i[a]=n.clone(),!0;{let e=i[a];if("number"==typeof n||"boolean"==typeof n){if(e!==n)return i[a]=n,!0}else if(!1===e.equals(n))return e.copy(n),!0}return!1}(a,t,i,n)){let t=a.__offset,r=Array.isArray(a.value)?a.value:[a.value],i=0;for(let n=0;n<r.length;n++){let s=r[n],o=c(s);"number"==typeof s||"boolean"==typeof s?(a.__data[0]=s,e.bufferSubData(e.UNIFORM_BUFFER,t+i,a.__data)):s.isMatrix3?(a.__data[0]=s.elements[0],a.__data[1]=s.elements[1],a.__data[2]=s.elements[2],a.__data[3]=0,a.__data[4]=s.elements[3],a.__data[5]=s.elements[4],a.__data[6]=s.elements[5],a.__data[7]=0,a.__data[8]=s.elements[6],a.__data[9]=s.elements[7],a.__data[10]=s.elements[8],a.__data[11]=0):(s.toArray(a.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,a.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(r),s[r.id]=v)},dispose:function(){for(let t in a)e.deleteBuffer(a[t]);o=[],a={},s={}}}}let tN=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),tU=null;class tO{constructor(e={}){let t,r,i,o,l,c,h,u,d,v,y,x,S,E,w,_,C,M,I,T,R,B,k,Q,H;const{canvas:G=(0,n.lPF)(),context:V=null,depth:j=!0,stencil:q=!1,alpha:W=!1,antialias:X=!1,premultipliedAlpha:Y=!0,preserveDrawingBuffer:K=!1,powerPreference:$="default",failIfMajorPerformanceCaveat:J=!1,reversedDepthBuffer:Z=!1,outputBufferType:ee=1009}=e;if(this.isWebGLRenderer=!0,null!==V){if("u">typeof WebGLRenderingContext&&V instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");t=V.getContextAttributes().alpha}else t=W;const et=new Set([1033,1031,1029]),er=new Set([1009,1014,1012,1020,1017,1018]),ei=new Uint32Array(4),en=new Int32Array(4);let ea=null,es=null;const eo=[],el=[];let ec=null;this.domElement=G,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const eh=this;let eu=!1;this._outputColorSpace="srgb";let ed=0,ep=0,ef=null,eg=-1,em=null;const eA=new n.IUQ,eb=new n.IUQ;let ev=null;const ey=new n.Q1f(0);let ex=0,eS=G.width,eE=G.height,ew=1,e_=null,eC=null;const eM=new n.IUQ(0,0,eS,eE),eI=new n.IUQ(0,0,eS,eE);let eT=!1;const eR=new n.PPD;let eB=!1,ek=!1;const eP=new n.kn4,eD=new n.Pq0,eL=new n.IUQ,eF={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let eN=!1;function eU(){return null===ef?ew:1}let eO=V;function eQ(e,t){return G.getContext(e,t)}try{if("setAttribute"in G&&G.setAttribute("data-engine","three.js r182"),G.addEventListener("webglcontextlost",eG,!1),G.addEventListener("webglcontextrestored",eV,!1),G.addEventListener("webglcontextcreationerror",eq,!1),null===eO){const e="webgl2";if(eO=eQ(e,{alpha:!0,depth:j,stencil:q,antialias:X,premultipliedAlpha:Y,preserveDrawingBuffer:K,powerPreference:$,failIfMajorPerformanceCaveat:J}),null===eO)if(eQ(e))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(e){throw(0,n.z3S)("WebGLRenderer: "+e.message),e}function ez(){(r=new D(eO)).init(),k=new tI(eO,r),i=new m(eO,r,e,k),o=new tC(eO,r),i.reversedDepthBuffer&&Z&&o.buffers.depth.setReversed(!0),l=new N(eO),c=new tl,h=new tM(eO,r,o,c,i,k,l),u=new b(eh),d=new P(eh),v=new s(eO),Q=new f(eO,v),y=new L(eO,v,l,Q),x=new O(eO,y,v,l),T=new U(eO,i,h),C=new A(c),S=new to(eh,u,d,r,i,Q,C),E=new tL(eh,c),w=new td,_=new tb(r),I=new p(eh,u,d,o,x,t,Y),M=new tw(eh,x,i),H=new tF(eO,l,i,o),R=new g(eO,r,l),B=new F(eO,r,l),l.programs=S.programs,eh.capabilities=i,eh.extensions=r,eh.properties=c,eh.renderLists=w,eh.shadowMap=M,eh.state=o,eh.info=l}ez(),1009!==ee&&(ec=new z(ee,G.width,G.height,j,q));const eH=new tk(eh,eO);function eG(e){e.preventDefault(),(0,n.Rm2)("WebGLRenderer: Context Lost."),eu=!0}function eV(){(0,n.Rm2)("WebGLRenderer: Context Restored."),eu=!1;let e=l.autoReset,t=M.enabled,r=M.autoUpdate,i=M.needsUpdate,a=M.type;ez(),l.autoReset=e,M.enabled=t,M.autoUpdate=r,M.needsUpdate=i,M.type=a}function eq(e){(0,n.z3S)("WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function eW(e){var t,r;let i,n=e.target;n.removeEventListener("dispose",eW),r=t=n,void 0!==(i=c.get(r).programs)&&(i.forEach(function(e){S.releaseProgram(e)}),r.isShaderMaterial&&S.releaseShaderCache(r)),c.remove(t)}function eX(e,t,r){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,e5(e,t,r),e.side=0,e.needsUpdate=!0,e5(e,t,r),e.side=2):e5(e,t,r)}this.xr=eH,this.getContext=function(){return eO},this.getContextAttributes=function(){return eO.getContextAttributes()},this.forceContextLoss=function(){let e=r.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=r.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return ew},this.setPixelRatio=function(e){void 0!==e&&(ew=e,this.setSize(eS,eE,!1))},this.getSize=function(e){return e.set(eS,eE)},this.setSize=function(e,t,r=!0){eH.isPresenting?(0,n.R8M)("WebGLRenderer: Can't change size while VR device is presenting."):(eS=e,eE=t,G.width=Math.floor(e*ew),G.height=Math.floor(t*ew),!0===r&&(G.style.width=e+"px",G.style.height=t+"px"),null!==ec&&ec.setSize(G.width,G.height),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(eS*ew,eE*ew).floor()},this.setDrawingBufferSize=function(e,t,r){eS=e,eE=t,ew=r,G.width=Math.floor(e*r),G.height=Math.floor(t*r),this.setViewport(0,0,e,t)},this.setEffects=function(e){if(1009===ee)return void console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");if(e){for(let t=0;t<e.length;t++)if(!0===e[t].isOutputPass){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}ec.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(eA)},this.getViewport=function(e){return e.copy(eM)},this.setViewport=function(e,t,r,i){e.isVector4?eM.set(e.x,e.y,e.z,e.w):eM.set(e,t,r,i),o.viewport(eA.copy(eM).multiplyScalar(ew).round())},this.getScissor=function(e){return e.copy(eI)},this.setScissor=function(e,t,r,i){e.isVector4?eI.set(e.x,e.y,e.z,e.w):eI.set(e,t,r,i),o.scissor(eb.copy(eI).multiplyScalar(ew).round())},this.getScissorTest=function(){return eT},this.setScissorTest=function(e){o.setScissorTest(eT=e)},this.setOpaqueSort=function(e){e_=e},this.setTransparentSort=function(e){eC=e},this.getClearColor=function(e){return e.copy(I.getClearColor())},this.setClearColor=function(){I.setClearColor(...arguments)},this.getClearAlpha=function(){return I.getClearAlpha()},this.setClearAlpha=function(){I.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,r=!0){let i=0;if(e){let e=!1;if(null!==ef){let t=ef.texture.format;e=et.has(t)}if(e){let e=ef.texture.type,t=er.has(e),r=I.getClearColor(),i=I.getClearAlpha(),n=r.r,a=r.g,s=r.b;t?(ei[0]=n,ei[1]=a,ei[2]=s,ei[3]=i,eO.clearBufferuiv(eO.COLOR,0,ei)):(en[0]=n,en[1]=a,en[2]=s,en[3]=i,eO.clearBufferiv(eO.COLOR,0,en))}else i|=eO.COLOR_BUFFER_BIT}t&&(i|=eO.DEPTH_BUFFER_BIT),r&&(i|=eO.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(0xffffffff)),eO.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){G.removeEventListener("webglcontextlost",eG,!1),G.removeEventListener("webglcontextrestored",eV,!1),G.removeEventListener("webglcontextcreationerror",eq,!1),I.dispose(),w.dispose(),_.dispose(),c.dispose(),u.dispose(),d.dispose(),x.dispose(),Q.dispose(),H.dispose(),S.dispose(),eH.dispose(),eH.removeEventListener("sessionstart",eK),eH.removeEventListener("sessionend",e$),eJ.stop()},this.renderBufferDirect=function(e,t,a,s,l,p){let f;null===t&&(t=eF);let g=l.isMesh&&0>l.matrixWorld.determinant(),m=function(e,t,r,a,s){var l,p;!0!==t.isScene&&(t=eF),h.resetTextureUnits();let f=t.fog,g=a.isMeshStandardMaterial?t.environment:null,m=null===ef?eh.outputColorSpace:!0===ef.isXRRenderTarget?ef.texture.colorSpace:n.Zr2,A=(a.isMeshStandardMaterial?d:u).get(a.envMap||g),b=!0===a.vertexColors&&!!r.attributes.color&&4===r.attributes.color.itemSize,v=!!r.attributes.tangent&&(!!a.normalMap||a.anisotropy>0),y=!!r.morphAttributes.position,x=!!r.morphAttributes.normal,S=!!r.morphAttributes.color,w=0;a.toneMapped&&(null===ef||!0===ef.isXRRenderTarget)&&(w=eh.toneMapping);let _=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,M=void 0!==_?_.length:0,I=c.get(a),R=es.state.lights;if(!0===eB&&(!0===ek||e!==em)){let t=e===em&&a.id===eg;C.setState(a,e,t)}let B=!1;a.version===I.__version?I.needsLights&&I.lightsStateVersion!==R.state.version||I.outputColorSpace!==m||s.isBatchedMesh&&!1===I.batching?B=!0:s.isBatchedMesh||!0!==I.batching?s.isBatchedMesh&&!0===I.batchingColor&&null===s.colorTexture||s.isBatchedMesh&&!1===I.batchingColor&&null!==s.colorTexture||s.isInstancedMesh&&!1===I.instancing?B=!0:s.isInstancedMesh||!0!==I.instancing?s.isSkinnedMesh&&!1===I.skinning?B=!0:s.isSkinnedMesh||!0!==I.skinning?s.isInstancedMesh&&!0===I.instancingColor&&null===s.instanceColor||s.isInstancedMesh&&!1===I.instancingColor&&null!==s.instanceColor||s.isInstancedMesh&&!0===I.instancingMorph&&null===s.morphTexture||s.isInstancedMesh&&!1===I.instancingMorph&&null!==s.morphTexture||I.envMap!==A||!0===a.fog&&I.fog!==f||void 0!==I.numClippingPlanes&&(I.numClippingPlanes!==C.numPlanes||I.numIntersection!==C.numIntersection)||I.vertexAlphas!==b||I.vertexTangents!==v||I.morphTargets!==y||I.morphNormals!==x||I.morphColors!==S||I.toneMapping!==w?B=!0:I.morphTargetsCount!==M&&(B=!0):B=!0:B=!0:B=!0:(B=!0,I.__version=a.version);let k=I.currentProgram;!0===B&&(k=e5(a,t,s));let P=!1,D=!1,L=!1,F=k.getUniforms(),N=I.uniforms;if(o.useProgram(k.program)&&(P=!0,D=!0,L=!0),a.id!==eg&&(eg=a.id,D=!0),P||em!==e){o.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),F.setValue(eO,"projectionMatrix",e.projectionMatrix),F.setValue(eO,"viewMatrix",e.matrixWorldInverse);let t=F.map.cameraPosition;void 0!==t&&t.setValue(eO,eD.setFromMatrixPosition(e.matrixWorld)),i.logarithmicDepthBuffer&&F.setValue(eO,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(a.isMeshPhongMaterial||a.isMeshToonMaterial||a.isMeshLambertMaterial||a.isMeshBasicMaterial||a.isMeshStandardMaterial||a.isShaderMaterial)&&F.setValue(eO,"isOrthographic",!0===e.isOrthographicCamera),em!==e&&(em=e,D=!0,L=!0)}if(I.needsLights&&(R.state.directionalShadowMap.length>0&&F.setValue(eO,"directionalShadowMap",R.state.directionalShadowMap,h),R.state.spotShadowMap.length>0&&F.setValue(eO,"spotShadowMap",R.state.spotShadowMap,h),R.state.pointShadowMap.length>0&&F.setValue(eO,"pointShadowMap",R.state.pointShadowMap,h)),s.isSkinnedMesh){F.setOptional(eO,s,"bindMatrix"),F.setOptional(eO,s,"bindMatrixInverse");let e=s.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),F.setValue(eO,"boneTexture",e.boneTexture,h))}s.isBatchedMesh&&(F.setOptional(eO,s,"batchingTexture"),F.setValue(eO,"batchingTexture",s._matricesTexture,h),F.setOptional(eO,s,"batchingIdTexture"),F.setValue(eO,"batchingIdTexture",s._indirectTexture,h),F.setOptional(eO,s,"batchingColorTexture"),null!==s._colorsTexture&&F.setValue(eO,"batchingColorTexture",s._colorsTexture,h));let U=r.morphAttributes;if((void 0!==U.position||void 0!==U.normal||void 0!==U.color)&&T.update(s,r,k),(D||I.receiveShadow!==s.receiveShadow)&&(I.receiveShadow=s.receiveShadow,F.setValue(eO,"receiveShadow",s.receiveShadow)),a.isMeshGouraudMaterial&&null!==a.envMap&&(N.envMap.value=A,N.flipEnvMap.value=A.isCubeTexture&&!1===A.isRenderTargetTexture?-1:1),a.isMeshStandardMaterial&&null===a.envMap&&null!==t.environment&&(N.envMapIntensity.value=t.environmentIntensity),void 0!==N.dfgLUT&&(N.dfgLUT.value=(null===tU&&((tU=new n.GYF(tN,16,16,1030,1016)).name="DFG_LUT",tU.minFilter=1006,tU.magFilter=1006,tU.wrapS=1001,tU.wrapT=1001,tU.generateMipmaps=!1,tU.needsUpdate=!0),tU)),D&&(F.setValue(eO,"toneMappingExposure",eh.toneMappingExposure),I.needsLights&&(l=N,p=L,l.ambientLightColor.needsUpdate=p,l.lightProbe.needsUpdate=p,l.directionalLights.needsUpdate=p,l.directionalLightShadows.needsUpdate=p,l.pointLights.needsUpdate=p,l.pointLightShadows.needsUpdate=p,l.spotLights.needsUpdate=p,l.spotLightShadows.needsUpdate=p,l.rectAreaLights.needsUpdate=p,l.hemisphereLights.needsUpdate=p),f&&!0===a.fog&&E.refreshFogUniforms(N,f),E.refreshMaterialUniforms(N,a,ew,eE,es.state.transmissionRenderTarget[e.id]),ej.upload(eO,e4(I),N,h)),a.isShaderMaterial&&!0===a.uniformsNeedUpdate&&(ej.upload(eO,e4(I),N,h),a.uniformsNeedUpdate=!1),a.isSpriteMaterial&&F.setValue(eO,"center",s.center),F.setValue(eO,"modelViewMatrix",s.modelViewMatrix),F.setValue(eO,"normalMatrix",s.normalMatrix),F.setValue(eO,"modelMatrix",s.matrixWorld),a.isShaderMaterial||a.isRawShaderMaterial){let e=a.uniformsGroups;for(let t=0,r=e.length;t<r;t++){let r=e[t];H.update(r,k),H.bind(r,k)}}return k}(e,t,a,s,l);o.setMaterial(s,g);let A=a.index,b=1;if(!0===s.wireframe){if(void 0===(A=y.getWireframeAttribute(a)))return;b=2}let x=a.drawRange,S=a.attributes.position,w=x.start*b,_=(x.start+x.count)*b;null!==p&&(w=Math.max(w,p.start*b),_=Math.min(_,(p.start+p.count)*b)),null!==A?(w=Math.max(w,0),_=Math.min(_,A.count)):null!=S&&(w=Math.max(w,0),_=Math.min(_,S.count));let M=_-w;if(M<0||M===1/0)return;Q.setup(l,s,m,a,A);let I=R;if(null!==A&&(f=v.get(A),(I=B).setIndex(f)),l.isMesh)!0===s.wireframe?(o.setLineWidth(s.wireframeLinewidth*eU()),I.setMode(eO.LINES)):I.setMode(eO.TRIANGLES);else if(l.isLine){let e=s.linewidth;void 0===e&&(e=1),o.setLineWidth(e*eU()),l.isLineSegments?I.setMode(eO.LINES):l.isLineLoop?I.setMode(eO.LINE_LOOP):I.setMode(eO.LINE_STRIP)}else l.isPoints?I.setMode(eO.POINTS):l.isSprite&&I.setMode(eO.TRIANGLES);if(l.isBatchedMesh)if(null!==l._multiDrawInstances)(0,n.mcG)("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),I.renderMultiDrawInstances(l._multiDrawStarts,l._multiDrawCounts,l._multiDrawCount,l._multiDrawInstances);else if(r.get("WEBGL_multi_draw"))I.renderMultiDraw(l._multiDrawStarts,l._multiDrawCounts,l._multiDrawCount);else{let e=l._multiDrawStarts,t=l._multiDrawCounts,r=l._multiDrawCount,i=A?v.get(A).bytesPerElement:1,n=c.get(s).currentProgram.getUniforms();for(let a=0;a<r;a++)n.setValue(eO,"_gl_DrawID",a),I.render(e[a]/i,t[a])}else if(l.isInstancedMesh)I.renderInstances(w,M,l.count);else if(a.isInstancedBufferGeometry){let e=void 0!==a._maxInstanceCount?a._maxInstanceCount:1/0,t=Math.min(a.instanceCount,e);I.renderInstances(w,M,t)}else I.render(w,M)},this.compile=function(e,t,r=null){null===r&&(r=e),(es=_.get(r)).init(t),el.push(es),r.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(es.pushLight(e),e.castShadow&&es.pushShadow(e))}),e!==r&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(es.pushLight(e),e.castShadow&&es.pushShadow(e))}),es.setupLights();let i=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t)if(Array.isArray(t))for(let n=0;n<t.length;n++){let a=t[n];eX(a,r,e),i.add(a)}else eX(t,r,e),i.add(t)}),es=el.pop(),i},this.compileAsync=function(e,t,i=null){let n=this.compile(e,t,i);return new Promise(t=>{function i(){(n.forEach(function(e){c.get(e).currentProgram.isReady()&&n.delete(e)}),0===n.size)?t(e):setTimeout(i,10)}null!==r.get("KHR_parallel_shader_compile")?i():setTimeout(i,10)})};let eY=null;function eK(){eJ.stop()}function e$(){eJ.start()}const eJ=new a;function eZ(e,t,r,i){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)r=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)es.pushLight(e),e.castShadow&&es.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||eR.intersectsSprite(e)){i&&eL.setFromMatrixPosition(e.matrixWorld).applyMatrix4(eP);let t=x.update(e),n=e.material;n.visible&&ea.push(e,t,n,r,eL.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||eR.intersectsObject(e))){let t=x.update(e),n=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),eL.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),eL.copy(t.boundingSphere.center)),eL.applyMatrix4(e.matrixWorld).applyMatrix4(eP)),Array.isArray(n)){let i=t.groups;for(let a=0,s=i.length;a<s;a++){let s=i[a],o=n[s.materialIndex];o&&o.visible&&ea.push(e,t,o,r,eL.z,s)}}else n.visible&&ea.push(e,t,n,r,eL.z,null)}}let n=e.children;for(let e=0,a=n.length;e<a;e++)eZ(n[e],t,r,i)}function e0(e,t,r,i){let{opaque:n,transmissive:a,transparent:s}=e;es.setupLightsView(r),!0===eB&&C.setGlobalState(eh.clippingPlanes,r),i&&o.viewport(eA.copy(i)),n.length>0&&e2(n,t,r),a.length>0&&e2(a,t,r),s.length>0&&e2(s,t,r),o.buffers.depth.setTest(!0),o.buffers.depth.setMask(!0),o.buffers.color.setMask(!0),o.setPolygonOffset(!1)}function e1(e,t,a,s){if(null!==(!0===a.isScene?a.overrideMaterial:null))return;if(void 0===es.state.transmissionRenderTarget[s.id]){let e=r.has("EXT_color_buffer_half_float")||r.has("EXT_color_buffer_float");es.state.transmissionRenderTarget[s.id]=new n.nWS(1,1,{generateMipmaps:!0,type:e?1016:1009,minFilter:1008,samples:i.samples,stencilBuffer:q,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:n.ppV.workingColorSpace})}let o=es.state.transmissionRenderTarget[s.id],l=s.viewport||eA;o.setSize(l.z*eh.transmissionResolutionScale,l.w*eh.transmissionResolutionScale);let c=eh.getRenderTarget(),u=eh.getActiveCubeFace(),d=eh.getActiveMipmapLevel();eh.setRenderTarget(o),eh.getClearColor(ey),(ex=eh.getClearAlpha())<1&&eh.setClearColor(0xffffff,.5),eh.clear(),eN&&I.render(a);let p=eh.toneMapping;eh.toneMapping=0;let f=s.viewport;if(void 0!==s.viewport&&(s.viewport=void 0),es.setupLightsView(s),!0===eB&&C.setGlobalState(eh.clippingPlanes,s),e2(e,a,s),h.updateMultisampleRenderTarget(o),h.updateRenderTargetMipmap(o),!1===r.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let r=0,i=t.length;r<i;r++){let{object:i,geometry:n,material:o,group:l}=t[r];if(2===o.side&&i.layers.test(s.layers)){let t=o.side;o.side=1,o.needsUpdate=!0,e3(i,a,s,n,o,l),o.side=t,o.needsUpdate=!0,e=!0}}!0===e&&(h.updateMultisampleRenderTarget(o),h.updateRenderTargetMipmap(o))}eh.setRenderTarget(c,u,d),eh.setClearColor(ey,ex),void 0!==f&&(s.viewport=f),eh.toneMapping=p}function e2(e,t,r){let i=!0===t.isScene?t.overrideMaterial:null;for(let n=0,a=e.length;n<a;n++){let a=e[n],{object:s,geometry:o,group:l}=a,c=a.material;!0===c.allowOverride&&null!==i&&(c=i),s.layers.test(r.layers)&&e3(s,t,r,o,c,l)}}function e3(e,t,r,i,n,a){e.onBeforeRender(eh,t,r,i,n,a),e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),n.onBeforeRender(eh,t,r,i,e,a),!0===n.transparent&&2===n.side&&!1===n.forceSinglePass?(n.side=1,n.needsUpdate=!0,eh.renderBufferDirect(r,t,i,n,e,a),n.side=0,n.needsUpdate=!0,eh.renderBufferDirect(r,t,i,n,e,a),n.side=2):eh.renderBufferDirect(r,t,i,n,e,a),e.onAfterRender(eh,t,r,i,n,a)}function e5(e,t,r){var i;!0!==t.isScene&&(t=eF);let n=c.get(e),a=es.state.lights,s=es.state.shadowsArray,o=a.state.version,l=S.getParameters(e,a.state,s,t,r),h=S.getProgramCacheKey(l),p=n.programs;n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?d:u).get(e.envMap||n.environment),n.envMapRotation=null!==n.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===p&&(e.addEventListener("dispose",eW),n.programs=p=new Map);let f=p.get(h);if(void 0!==f){if(n.currentProgram===f&&n.lightsStateVersion===o)return e8(e,l),f}else l.uniforms=S.getUniforms(e),e.onBeforeCompile(l,eh),f=S.acquireProgram(l,h),p.set(h,f),n.uniforms=l.uniforms;let g=n.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(g.clippingPlanes=C.uniform),e8(e,l),n.needsLights=(i=e).isMeshLambertMaterial||i.isMeshToonMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isShadowMaterial||i.isShaderMaterial&&!0===i.lights,n.lightsStateVersion=o,n.needsLights&&(g.ambientLightColor.value=a.state.ambient,g.lightProbe.value=a.state.probe,g.directionalLights.value=a.state.directional,g.directionalLightShadows.value=a.state.directionalShadow,g.spotLights.value=a.state.spot,g.spotLightShadows.value=a.state.spotShadow,g.rectAreaLights.value=a.state.rectArea,g.ltc_1.value=a.state.rectAreaLTC1,g.ltc_2.value=a.state.rectAreaLTC2,g.pointLights.value=a.state.point,g.pointLightShadows.value=a.state.pointShadow,g.hemisphereLights.value=a.state.hemi,g.directionalShadowMap.value=a.state.directionalShadowMap,g.directionalShadowMatrix.value=a.state.directionalShadowMatrix,g.spotShadowMap.value=a.state.spotShadowMap,g.spotLightMatrix.value=a.state.spotLightMatrix,g.spotLightMap.value=a.state.spotLightMap,g.pointShadowMap.value=a.state.pointShadowMap,g.pointShadowMatrix.value=a.state.pointShadowMatrix),n.currentProgram=f,n.uniformsList=null,f}function e4(e){if(null===e.uniformsList){let t=e.currentProgram.getUniforms();e.uniformsList=ej.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function e8(e,t){let r=c.get(e);r.outputColorSpace=t.outputColorSpace,r.batching=t.batching,r.batchingColor=t.batchingColor,r.instancing=t.instancing,r.instancingColor=t.instancingColor,r.instancingMorph=t.instancingMorph,r.skinning=t.skinning,r.morphTargets=t.morphTargets,r.morphNormals=t.morphNormals,r.morphColors=t.morphColors,r.morphTargetsCount=t.morphTargetsCount,r.numClippingPlanes=t.numClippingPlanes,r.numIntersection=t.numClipIntersection,r.vertexAlphas=t.vertexAlphas,r.vertexTangents=t.vertexTangents,r.toneMapping=t.toneMapping}eJ.setAnimationLoop(function(e){eY&&eY(e)}),"u">typeof self&&eJ.setContext(self),this.setAnimationLoop=function(e){eY=e,eH.setAnimationLoop(e),null===e?eJ.stop():eJ.start()},eH.addEventListener("sessionstart",eK),eH.addEventListener("sessionend",e$),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void(0,n.z3S)("WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===eu)return;let r=!0===eH.enabled&&!0===eH.isPresenting,i=null!==ec&&(null===ef||r)&&ec.begin(eh,ef);if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===eH.enabled&&!0===eH.isPresenting&&(null===ec||!1===ec.isCompositing())&&(!0===eH.cameraAutoUpdate&&eH.updateCamera(t),t=eH.getCamera()),!0===e.isScene&&e.onBeforeRender(eh,e,t,ef),(es=_.get(e,el.length)).init(t),el.push(es),eP.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),eR.setFromProjectionMatrix(eP,2e3,t.reversedDepth),ek=this.localClippingEnabled,eB=C.init(this.clippingPlanes,ek),(ea=w.get(e,eo.length)).init(),eo.push(ea),!0===eH.enabled&&!0===eH.isPresenting){let e=eh.xr.getDepthSensingMesh();null!==e&&eZ(e,t,-1/0,eh.sortObjects)}eZ(e,t,0,eh.sortObjects),ea.finish(),!0===eh.sortObjects&&ea.sort(e_,eC),(eN=!1===eH.enabled||!1===eH.isPresenting||!1===eH.hasDepthSensing())&&I.addToRenderList(ea,e),this.info.render.frame++,!0===eB&&C.beginShadows();let a=es.state.shadowsArray;if(M.render(a,e,t),!0===eB&&C.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1===(i&&ec.hasRenderPass())){let r=ea.opaque,i=ea.transmissive;if(es.setupLights(),t.isArrayCamera){let n=t.cameras;if(i.length>0)for(let t=0,a=n.length;t<a;t++)e1(r,i,e,n[t]);eN&&I.render(e);for(let t=0,r=n.length;t<r;t++){let r=n[t];e0(ea,e,r,r.viewport)}}else i.length>0&&e1(r,i,e,t),eN&&I.render(e),e0(ea,e,t)}null!==ef&&0===ep&&(h.updateMultisampleRenderTarget(ef),h.updateRenderTargetMipmap(ef)),i&&ec.end(eh),!0===e.isScene&&e.onAfterRender(eh,e,t),Q.resetDefaultState(),eg=-1,em=null,el.pop(),el.length>0?(es=el[el.length-1],!0===eB&&C.setGlobalState(eh.clippingPlanes,es.state.camera)):es=null,eo.pop(),ea=eo.length>0?eo[eo.length-1]:null},this.getActiveCubeFace=function(){return ed},this.getActiveMipmapLevel=function(){return ep},this.getRenderTarget=function(){return ef},this.setRenderTargetTextures=function(e,t,r){let i=c.get(e);i.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===i.__autoAllocateDepthBuffer&&(i.__useRenderToTexture=!1),c.get(e.texture).__webglTexture=t,c.get(e.depthTexture).__webglTexture=i.__autoAllocateDepthBuffer?void 0:r,i.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let r=c.get(e);r.__webglFramebuffer=t,r.__useDefaultFramebuffer=void 0===t};const e9=eO.createFramebuffer();this.setRenderTarget=function(e,t=0,r=0){ef=e,ed=t,ep=r;let i=null,n=!1,a=!1;if(e){let s=c.get(e);if(void 0!==s.__useDefaultFramebuffer){o.bindFramebuffer(eO.FRAMEBUFFER,s.__webglFramebuffer),eA.copy(e.viewport),eb.copy(e.scissor),ev=e.scissorTest,o.viewport(eA),o.scissor(eb),o.setScissorTest(ev),eg=-1;return}if(void 0===s.__webglFramebuffer)h.setupRenderTarget(e);else if(s.__hasExternalTextures)h.rebindTextures(e,c.get(e.texture).__webglTexture,c.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(s.__boundDepthTexture!==t){if(null!==t&&c.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");h.setupDepthRenderbuffer(e)}}let l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(a=!0);let u=c.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(u[t])?u[t][r]:u[t],n=!0):i=e.samples>0&&!1===h.useMultisampledRTT(e)?c.get(e).__webglMultisampledFramebuffer:Array.isArray(u)?u[r]:u,eA.copy(e.viewport),eb.copy(e.scissor),ev=e.scissorTest}else eA.copy(eM).multiplyScalar(ew).floor(),eb.copy(eI).multiplyScalar(ew).floor(),ev=eT;if(0!==r&&(i=e9),o.bindFramebuffer(eO.FRAMEBUFFER,i)&&o.drawBuffers(e,i),o.viewport(eA),o.scissor(eb),o.setScissorTest(ev),n){let i=c.get(e.texture);eO.framebufferTexture2D(eO.FRAMEBUFFER,eO.COLOR_ATTACHMENT0,eO.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,r)}else if(a)for(let i=0;i<e.textures.length;i++){let n=c.get(e.textures[i]);eO.framebufferTextureLayer(eO.FRAMEBUFFER,eO.COLOR_ATTACHMENT0+i,n.__webglTexture,r,t)}else if(null!==e&&0!==r){let t=c.get(e.texture);eO.framebufferTexture2D(eO.FRAMEBUFFER,eO.COLOR_ATTACHMENT0,eO.TEXTURE_2D,t.__webglTexture,r)}eg=-1},this.readRenderTargetPixels=function(e,t,r,a,s,l,h,u=0){if(!(e&&e.isWebGLRenderTarget))return void(0,n.z3S)("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let d=c.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==h&&(d=d[h]),d){o.bindFramebuffer(eO.FRAMEBUFFER,d);try{let o=e.textures[u],c=o.format,h=o.type;if(!i.textureFormatReadable(c))return void(0,n.z3S)("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!i.textureTypeReadable(h))return void(0,n.z3S)("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-a&&r>=0&&r<=e.height-s&&(e.textures.length>1&&eO.readBuffer(eO.COLOR_ATTACHMENT0+u),eO.readPixels(t,r,a,s,k.convert(c),k.convert(h),l))}finally{let e=null!==ef?c.get(ef).__webglFramebuffer:null;o.bindFramebuffer(eO.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,r,a,s,l,h,u=0){if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let d=c.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==h&&(d=d[h]),d)if(t>=0&&t<=e.width-a&&r>=0&&r<=e.height-s){o.bindFramebuffer(eO.FRAMEBUFFER,d);let h=e.textures[u],p=h.format,f=h.type;if(!i.textureFormatReadable(p))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!i.textureTypeReadable(f))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let g=eO.createBuffer();eO.bindBuffer(eO.PIXEL_PACK_BUFFER,g),eO.bufferData(eO.PIXEL_PACK_BUFFER,l.byteLength,eO.STREAM_READ),e.textures.length>1&&eO.readBuffer(eO.COLOR_ATTACHMENT0+u),eO.readPixels(t,r,a,s,k.convert(p),k.convert(f),0);let m=null!==ef?c.get(ef).__webglFramebuffer:null;o.bindFramebuffer(eO.FRAMEBUFFER,m);let A=eO.fenceSync(eO.SYNC_GPU_COMMANDS_COMPLETE,0);return eO.flush(),await (0,n.jej)(eO,A,4),eO.bindBuffer(eO.PIXEL_PACK_BUFFER,g),eO.getBufferSubData(eO.PIXEL_PACK_BUFFER,0,l),eO.deleteBuffer(g),eO.deleteSync(A),l}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e,t=null,r=0){let i=Math.pow(2,-r),n=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i),s=null!==t?t.x:0,l=null!==t?t.y:0;h.setTexture2D(e,0),eO.copyTexSubImage2D(eO.TEXTURE_2D,r,0,0,s,l,n,a),o.unbindTexture()};const e6=eO.createFramebuffer(),e7=eO.createFramebuffer();this.copyTextureToTexture=function(e,t,r=null,i=null,a=0,s=null){let l,u,d,p,f,g,m,A,b,v;null===s&&(0!==a?((0,n.mcG)("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),s=a,a=0):s=0);let y=e.isCompressedTexture?e.mipmaps[s]:e.image;if(null!==r)l=r.max.x-r.min.x,u=r.max.y-r.min.y,d=r.isBox3?r.max.z-r.min.z:1,p=r.min.x,f=r.min.y,g=r.isBox3?r.min.z:0;else{let t=Math.pow(2,-a);l=Math.floor(y.width*t),u=Math.floor(y.height*t),d=e.isDataArrayTexture?y.depth:e.isData3DTexture?Math.floor(y.depth*t):1,p=0,f=0,g=0}null!==i?(m=i.x,A=i.y,b=i.z):(m=0,A=0,b=0);let x=k.convert(t.format),S=k.convert(t.type);t.isData3DTexture?(h.setTexture3D(t,0),v=eO.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(h.setTexture2DArray(t,0),v=eO.TEXTURE_2D_ARRAY):(h.setTexture2D(t,0),v=eO.TEXTURE_2D),eO.pixelStorei(eO.UNPACK_FLIP_Y_WEBGL,t.flipY),eO.pixelStorei(eO.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eO.pixelStorei(eO.UNPACK_ALIGNMENT,t.unpackAlignment);let E=eO.getParameter(eO.UNPACK_ROW_LENGTH),w=eO.getParameter(eO.UNPACK_IMAGE_HEIGHT),_=eO.getParameter(eO.UNPACK_SKIP_PIXELS),C=eO.getParameter(eO.UNPACK_SKIP_ROWS),M=eO.getParameter(eO.UNPACK_SKIP_IMAGES);eO.pixelStorei(eO.UNPACK_ROW_LENGTH,y.width),eO.pixelStorei(eO.UNPACK_IMAGE_HEIGHT,y.height),eO.pixelStorei(eO.UNPACK_SKIP_PIXELS,p),eO.pixelStorei(eO.UNPACK_SKIP_ROWS,f),eO.pixelStorei(eO.UNPACK_SKIP_IMAGES,g);let I=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let r=c.get(e),i=c.get(t),n=c.get(r.__renderTarget),h=c.get(i.__renderTarget);o.bindFramebuffer(eO.READ_FRAMEBUFFER,n.__webglFramebuffer),o.bindFramebuffer(eO.DRAW_FRAMEBUFFER,h.__webglFramebuffer);for(let r=0;r<d;r++)I&&(eO.framebufferTextureLayer(eO.READ_FRAMEBUFFER,eO.COLOR_ATTACHMENT0,c.get(e).__webglTexture,a,g+r),eO.framebufferTextureLayer(eO.DRAW_FRAMEBUFFER,eO.COLOR_ATTACHMENT0,c.get(t).__webglTexture,s,b+r)),eO.blitFramebuffer(p,f,l,u,m,A,l,u,eO.DEPTH_BUFFER_BIT,eO.NEAREST);o.bindFramebuffer(eO.READ_FRAMEBUFFER,null),o.bindFramebuffer(eO.DRAW_FRAMEBUFFER,null)}else if(0!==a||e.isRenderTargetTexture||c.has(e)){let r=c.get(e),i=c.get(t);o.bindFramebuffer(eO.READ_FRAMEBUFFER,e6),o.bindFramebuffer(eO.DRAW_FRAMEBUFFER,e7);for(let e=0;e<d;e++)I?eO.framebufferTextureLayer(eO.READ_FRAMEBUFFER,eO.COLOR_ATTACHMENT0,r.__webglTexture,a,g+e):eO.framebufferTexture2D(eO.READ_FRAMEBUFFER,eO.COLOR_ATTACHMENT0,eO.TEXTURE_2D,r.__webglTexture,a),T?eO.framebufferTextureLayer(eO.DRAW_FRAMEBUFFER,eO.COLOR_ATTACHMENT0,i.__webglTexture,s,b+e):eO.framebufferTexture2D(eO.DRAW_FRAMEBUFFER,eO.COLOR_ATTACHMENT0,eO.TEXTURE_2D,i.__webglTexture,s),0!==a?eO.blitFramebuffer(p,f,l,u,m,A,l,u,eO.COLOR_BUFFER_BIT,eO.NEAREST):T?eO.copyTexSubImage3D(v,s,m,A,b+e,p,f,l,u):eO.copyTexSubImage2D(v,s,m,A,p,f,l,u);o.bindFramebuffer(eO.READ_FRAMEBUFFER,null),o.bindFramebuffer(eO.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?eO.texSubImage3D(v,s,m,A,b,l,u,d,x,S,y.data):t.isCompressedArrayTexture?eO.compressedTexSubImage3D(v,s,m,A,b,l,u,d,x,y.data):eO.texSubImage3D(v,s,m,A,b,l,u,d,x,S,y):e.isDataTexture?eO.texSubImage2D(eO.TEXTURE_2D,s,m,A,l,u,x,S,y.data):e.isCompressedTexture?eO.compressedTexSubImage2D(eO.TEXTURE_2D,s,m,A,y.width,y.height,x,y.data):eO.texSubImage2D(eO.TEXTURE_2D,s,m,A,l,u,x,S,y);eO.pixelStorei(eO.UNPACK_ROW_LENGTH,E),eO.pixelStorei(eO.UNPACK_IMAGE_HEIGHT,w),eO.pixelStorei(eO.UNPACK_SKIP_PIXELS,_),eO.pixelStorei(eO.UNPACK_SKIP_ROWS,C),eO.pixelStorei(eO.UNPACK_SKIP_IMAGES,M),0===s&&t.generateMipmaps&&eO.generateMipmap(v),o.unbindTexture()},this.initRenderTarget=function(e){void 0===c.get(e).__webglFramebuffer&&h.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?h.setTextureCube(e,0):e.isData3DTexture?h.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?h.setTexture2DArray(e,0):h.setTexture2D(e,0),o.unbindTexture()},this.resetState=function(){ed=0,ep=0,ef=null,o.reset(),Q.reset()},"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2e3}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=n.ppV._getDrawingBufferColorSpace(e),t.unpackColorSpace=n.ppV._getUnpackColorSpace()}}var tQ=r(6526),tz=r(3520),tH=r(1535),tG=r(3418),tV=r(4515);let tj=Symbol("prepared"),tq=Symbol("prepare"),tW=Symbol("preparedGLTF"),tX=Symbol("clone");class tY{static prepare(e){if(null==e.scene)throw Error("Model does not have a scene");if(e[tj])return e;let t=this[tq](e);return t[tj]=!0,t}static[tq](e){let{scene:t}=e,r=[t];return Object.assign(Object.assign({},e),{scene:t,scenes:r})}get parser(){return this[tW].parser}get animations(){return this[tW].animations}get scene(){return this[tW].scene}get scenes(){return this[tW].scenes}get cameras(){return this[tW].cameras}get asset(){return this[tW].asset}get userData(){return this[tW].userData}constructor(e){this[tW]=e}clone(){return new this.constructor(this[tX]())}dispose(){this.scenes.forEach(e=>{e.traverse(e=>{e.material&&((Array.isArray(e.material)?e.material:[e.material]).forEach(e=>{for(let t in e){let r=e[t];if(r instanceof n.gPd){let e=r.source.data;null!=e.close&&e.close(),r.dispose()}}e.dispose()}),e.geometry.dispose())})})}[tX](){var e;let t,r,i,n=this[tW],a=(e=this.scene,t=new Map,r=new Map,i=e.clone(),function e(t,r,i){i(t,r);for(let n=0;n<t.children.length;n++)e(t.children[n],r.children[n],i)}(e,i,function(e,i){t.set(i,e),r.set(e,i)}),i.traverse(function(e){if(!e.isSkinnedMesh)return;let i=t.get(e),n=i.skeleton.bones;e.skeleton=i.skeleton.clone(),e.bindMatrix.copy(i.bindMatrix),e.skeleton.bones=n.map(function(e){return r.get(e)}),e.bind(e.skeleton,e.bindMatrix)}),i);tK(a,this.scene);let s=[a],o=n.userData?Object.assign({},n.userData):{};return Object.assign(Object.assign({},n),{scene:a,scenes:s,userData:o})}}let tK=(e,t)=>{t$(e,t,(e,t)=>{void 0!==t.userData.variantMaterials&&(e.userData.variantMaterials=new Map(t.userData.variantMaterials)),void 0!==t.userData.variantData&&(e.userData.variantData=t.userData.variantData),void 0!==t.userData.originalMaterial&&(e.userData.originalMaterial=t.userData.originalMaterial)})},t$=(e,t,r)=>{r(e,t);for(let i=0;i<e.children.length;i++)t$(e.children[i],t.children[i],r)},tJ=Symbol("threeGLTF"),tZ=Symbol("gltf"),t0=Symbol("gltfElementMap"),t1=Symbol("threeObjectMap"),t2=Symbol("parallelTraverseThreeScene"),t3=Symbol("correlateOriginalThreeGLTF"),t5=Symbol("correlateCloneThreeGLTF");class t4{static from(e,t){return null!=t?this[t5](e,t):this[t3](e)}static[t3](e){let t=e.parser.json,r=e.parser.associations,i=new Map,a={name:"Default"},s={index:-1};for(let e of r.keys())e instanceof n.imn&&null==r.get(e)&&(s.index<0&&(null==t.materials&&(t.materials=[]),s.index=t.materials.length,t.materials.push(a)),e.name=a.name,r.set(e,{materials:s.index}));for(let[e,n]of r)for(let r in n&&(e.userData=e.userData||{},e.userData.associations=n),n)if(null!=r&&"primitives"!==r){let a=(t[r]||[])[n[r]];if(null==a)continue;let s=i.get(a);null==s&&(s=new Set,i.set(a,s)),s.add(e)}return new t4(e,t,r,i)}static[t5](e,t){let r=t.threeGLTF,i=JSON.parse(JSON.stringify(t.gltf)),n=new Map,a=new Map;for(let s=0;s<r.scenes.length;s++)this[t2](r.scenes[s],e.scenes[s],(e,r)=>{let s=t.threeObjectMap.get(e);if(null!=s){for(let e in s)if(null!=e&&"primitives"!==e){let t=s[e],o=i[e][t],l=n.get(r)||{};l[e]=t,n.set(r,l);let c=a.get(o)||new Set;c.add(r),a.set(o,c)}}});return new t4(e,i,n,a)}static[t2](e,t,r){let i=(e,t)=>{if(r(e,t),e.isObject3D){if(e.material)if(Array.isArray(e.material))for(let i=0;i<e.material.length;++i)r(e.material[i],t.material[i]);else r(e.material,t.material);for(let r=0;r<e.children.length;++r)i(e.children[r],t.children[r])}};i(e,t)}get threeGLTF(){return this[tJ]}get gltf(){return this[tZ]}get gltfElementMap(){return this[t0]}get threeObjectMap(){return this[t1]}constructor(e,t,r,i){this[tJ]=e,this[tZ]=t,this[t0]=i,this[t1]=r}}let t8=Symbol("correlatedSceneGraph");class t9 extends tY{static[tq](e){let t=super[tq](e);null==t[t8]&&(t[t8]=t4.from(t));let{scene:r}=t,i=new n.iyt(void 0,1/0);return r.traverse(e=>{if(e.renderOrder=1e3,e.frustumCulled=!1,e.name||(e.name=e.uuid),e.material){let{geometry:r}=e;e.castShadow=!0,e.isSkinnedMesh&&(r.boundingSphere=i,r.boundingBox=null);let n=e.material;if(!0===n.isMeshBasicMaterial&&(n.toneMapped=!1),n.shadowSide=0,n.aoMap){let{gltf:e,threeObjectMap:i}=t[t8],a=i.get(n);if(null!=e.materials&&null!=a&&null!=a.materials){let t=e.materials[a.materials];t.occlusionTexture&&0===t.occlusionTexture.texCoord&&null!=r.attributes.uv&&r.setAttribute("uv2",r.attributes.uv)}}}}),t}get correlatedSceneGraph(){return this[tW][t8]}[tX](){let e=super[tX](),t=new Map;return e.scene.traverse(e=>{if(e.material){let r=e.material;if(null!=r){if(t.has(r.uuid)){e.material=t.get(r.uuid);return}e.material=r.clone(),t.set(r.uuid,e.material)}}void 0!==e.target&&e.add(e.target)}),e[t8]=t4.from(e,this.correlatedSceneGraph),e}}let t6=(e,t,r)=>{let i;switch(e){case 1009:i=new Uint8ClampedArray(t*r*4);break;case 1016:i=new Uint16Array(t*r*4);break;case 1014:i=new Uint32Array(t*r*4);break;case 1010:i=new Int8Array(t*r*4);break;case 1011:i=new Int16Array(t*r*4);break;case 1013:i=new Int32Array(t*r*4);break;case 1015:i=new Float32Array(t*r*4);break;default:throw Error("Unsupported data type")}return i};class t7{_renderer;_rendererIsDisposable=!1;_material;_scene;_camera;_quad;_renderTarget;_width;_height;_type;_colorSpace;_supportsReadPixels=!0;constructor(e){this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const t={format:1023,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:e.renderTargetOptions?.anisotropy!==void 0?e.renderTargetOptions?.anisotropy:1,generateMipmaps:e.renderTargetOptions?.generateMipmaps!==void 0&&e.renderTargetOptions?.generateMipmaps,magFilter:e.renderTargetOptions?.magFilter!==void 0?e.renderTargetOptions?.magFilter:1006,minFilter:e.renderTargetOptions?.minFilter!==void 0?e.renderTargetOptions?.minFilter:1006,samples:e.renderTargetOptions?.samples!==void 0?e.renderTargetOptions?.samples:void 0,wrapS:e.renderTargetOptions?.wrapS!==void 0?e.renderTargetOptions?.wrapS:1001,wrapT:e.renderTargetOptions?.wrapT!==void 0?e.renderTargetOptions?.wrapT:1001};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=t7.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new n.Z58,this._camera=new n.qUd,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!((e,t,r,a)=>{if(void 0!==i)return i;let s=new n.nWS(1,1,a);t.setRenderTarget(s);let o=new n.eaF(new n.bdM,new n.V9B({color:0xffffff}));t.render(o,r),t.setRenderTarget(null);let l=t6(e,s.width,s.height);return t.readRenderTargetPixels(s,0,0,s.width,s.height,l),s.dispose(),o.geometry.dispose(),o.material.dispose(),i=0!==l[0]})(this._type,this._renderer,this._camera,t)){let e;1016===this._type&&(e=this._renderer.extensions.has("EXT_color_buffer_float")?1015:void 0),void 0!==e?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to 1015`),this._type=e):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new n.eaF(new n.bdM,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new n.nWS(this.width,this.height,t),this._renderTarget.texture.mapping=e.renderTargetOptions?.mapping!==void 0?e.renderTargetOptions?.mapping:300}static instantiateRenderer(){let e=new tO;return e.setSize(128,128),e}render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)};toArray(){if(!this._supportsReadPixels)throw Error("Can't read pixels in this browser");let e=t6(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){let t=new n.GYF(this.toArray(),this.width,this.height,1023,this._type,e?.mapping||300,e?.wrapS||1001,e?.wrapT||1001,e?.magFilter||1006,e?.minFilter||1006,e?.anisotropy||1,n.Zr2);return t.generateMipmaps=e?.generateMipmaps!==void 0&&e?.generateMipmaps,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof n.BKk&&Object.values(this.material.uniforms).forEach(e=>{e.value instanceof n.gPd&&e.value.dispose()}),Object.values(this.material).forEach(e=>{e instanceof n.gPd&&e.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}class re extends Error{}class rt extends Error{}let rr=(e,t,r)=>{let i=RegExp(`${t}="([^"]*)"`,"i").exec(e);if(i)return i[1];let n=RegExp(`<${t}[^>]*>([\\s\\S]*?)</${t}>`,"i").exec(e);if(n){let e=n[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return e&&3===e.length?e.map(e=>e.replace(/<\/?rdf:li>/g,"")):n[1].trim()}if(void 0!==r)return r;throw Error(`Can't find ${t} in gainmap metadata`)};class ri{options;constructor(e){this.options={debug:!!e&&void 0!==e.debug&&e.debug,extractFII:!e||void 0===e.extractFII||e.extractFII,extractNonFII:!e||void 0===e.extractNonFII||e.extractNonFII}}extract(e){return new Promise((t,r)=>{let i,n=this.options.debug,a=new DataView(e.buffer);if(65496!==a.getUint16(0))return void r(Error("Not a valid jpeg"));let s=a.byteLength,o=2,l=0;for(;o<s;){if(++l>250)return void r(Error(`Found no marker after ${l} loops 😵`));if(255!==a.getUint8(o))return void r(Error(`Not a valid marker at offset 0x${o.toString(16)}, found: 0x${a.getUint8(o).toString(16)}`));if(i=a.getUint8(o+1),n&&console.log(`Marker: ${i.toString(16)}`),226===i){n&&console.log("Found APP2 marker (0xffe2)");let e=o+4;if(0x4d504600===a.getUint32(e)){let i,n=e+4;if(18761===a.getUint16(n))i=!1;else{if(19789!==a.getUint16(n))return void r(Error("No valid endianness marker found in TIFF header"));i=!0}if(42!==a.getUint16(n+2,!i))return void r(Error("Not valid TIFF data! (no 0x002A marker)"));let s=a.getUint32(n+4,!i);if(s<8)return void r(Error("Not valid TIFF data! (First offset less than 8)"));let o=n+s,l=a.getUint16(o,!i),c=o+2,h=0;for(let e=c;e<c+12*l;e+=12)45057===a.getUint16(e,!i)&&(h=a.getUint32(e+8,!i));let u=o+2+12*l+4,d=[];for(let e=u;e<u+16*h;e+=16){let t={MPType:a.getUint32(e,!i),size:a.getUint32(e+4,!i),dataOffset:a.getUint32(e+8,!i),dependantImages:a.getUint32(e+12,!i),start:-1,end:-1,isFII:!1};t.dataOffset?(t.start=n+t.dataOffset,t.isFII=!1):(t.start=0,t.isFII=!0),t.end=t.start+t.size,d.push(t)}if(this.options.extractNonFII&&d.length){let e=new Blob([a]),r=[];for(let t of d){if(t.isFII&&!this.options.extractFII)continue;let i=e.slice(t.start,t.end+1,"image/jpeg");r.push(i)}t(r)}}}o+=2+a.getUint16(o+2)}})}}let rn=async e=>{let t=(e=>{let t,r=(t="u">typeof TextDecoder?new TextDecoder().decode(e):e.toString()).indexOf("<x:xmpmeta");for(;-1!==r;){let e=t.indexOf("x:xmpmeta>",r),i=t.slice(r,e+10);try{let e=rr(i,"hdrgm:GainMapMin","0"),t=rr(i,"hdrgm:GainMapMax"),r=rr(i,"hdrgm:Gamma","1"),n=rr(i,"hdrgm:OffsetSDR","0.015625"),a=rr(i,"hdrgm:OffsetHDR","0.015625"),s=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(i),o=s?s[1]:"0",l=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(i);if(!l)throw Error("Incomplete gainmap metadata");let c=l[1];return{gainMapMin:Array.isArray(e)?e.map(e=>parseFloat(e)):[parseFloat(e),parseFloat(e),parseFloat(e)],gainMapMax:Array.isArray(t)?t.map(e=>parseFloat(e)):[parseFloat(t),parseFloat(t),parseFloat(t)],gamma:Array.isArray(r)?r.map(e=>parseFloat(e)):[parseFloat(r),parseFloat(r),parseFloat(r)],offsetSdr:Array.isArray(n)?n.map(e=>parseFloat(e)):[parseFloat(n),parseFloat(n),parseFloat(n)],offsetHdr:Array.isArray(a)?a.map(e=>parseFloat(e)):[parseFloat(a),parseFloat(a),parseFloat(a)],hdrCapacityMin:parseFloat(o),hdrCapacityMax:parseFloat(c)}}catch(e){}r=t.indexOf("<x:xmpmeta",e)}})(e);if(!t)throw new rt("Gain map XMP metadata not found");let r=new ri({extractFII:!0,extractNonFII:!0}),i=await r.extract(e);if(2!==i.length)throw new re("Gain map recovery image not found");return{sdr:new Uint8Array(await i[0].arrayBuffer()),gainMap:new Uint8Array(await i[1].arrayBuffer()),metadata:t}},ra=e=>new Promise((t,r)=>{let i=document.createElement("img");i.onload=()=>{t(i)},i.onerror=e=>{r(e)},i.src=URL.createObjectURL(e)});class rs extends n.aHM{_renderer;_renderTargetOptions;_internalLoadingManager;_config;constructor(e,t){super(t),this._config=e,e.renderer&&(this._renderer=e.renderer),this._internalLoadingManager=new n.KPJ}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");let e=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new n.gPd,sdr:new n.gPd});return this._config.createQuadRenderer({width:16,height:16,type:1016,colorSpace:n.Zr2,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(e,t,r){let i,n,a=t?new Blob([t],{type:"image/jpeg"}):void 0,s=new Blob([e],{type:"image/jpeg"}),o=!1;if("u"<typeof createImageBitmap){let e=await Promise.all([a?ra(a):Promise.resolve(void 0),ra(s)]);n=e[0],i=e[1],o="flipY"===r}else{let e=await Promise.all([a?createImageBitmap(a,{imageOrientation:r||"flipY"}):Promise.resolve(void 0),createImageBitmap(s,{imageOrientation:r||"flipY"})]);n=e[0],i=e[1]}return{sdrImage:i,gainMapImage:n,needsFlip:o}}createTextures(e,t,r){let i=new n.gPd(t||new ImageData(2,2),300,1001,1001,1006,1008,1023,1009,1,n.Zr2);i.flipY=r,i.needsUpdate=!0;let a=new n.gPd(e,300,1001,1001,1006,1008,1023,1009,1,"srgb");return a.flipY=r,a.needsUpdate=!0,{gainMap:i,sdr:a}}updateQuadRenderer(e,t,r,i,n){e.width=t.width,e.height=t.height,e.material.gainMap=r,e.material.sdr=i,e.material.gainMapMin=n.gainMapMin,e.material.gainMapMax=n.gainMapMax,e.material.offsetHdr=n.offsetHdr,e.material.offsetSdr=n.offsetSdr,e.material.gamma=n.gamma,e.material.hdrCapacityMin=n.hdrCapacityMin,e.material.hdrCapacityMax=n.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,n.hdrCapacityMax),e.material.needsUpdate=!0}}let ro=`
855
+ varying vec2 vUv;
856
+
857
+ void main() {
858
+ vUv = uv;
859
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
860
+ }
861
+ `,rl=`
862
+ // min half float value
863
+ #define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 )
864
+ // max half float value
865
+ #define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 )
866
+
867
+ uniform sampler2D sdr;
868
+ uniform sampler2D gainMap;
869
+ uniform vec3 gamma;
870
+ uniform vec3 offsetHdr;
871
+ uniform vec3 offsetSdr;
872
+ uniform vec3 gainMapMin;
873
+ uniform vec3 gainMapMax;
874
+ uniform float weightFactor;
875
+
876
+ varying vec2 vUv;
877
+
878
+ void main() {
879
+ vec3 rgb = texture2D( sdr, vUv ).rgb;
880
+ vec3 recovery = texture2D( gainMap, vUv ).rgb;
881
+ vec3 logRecovery = pow( recovery, gamma );
882
+ vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery;
883
+ vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr;
884
+ vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
885
+ gl_FragColor = vec4( clampedHdrColor , 1.0 );
886
+ }
887
+ `;class rc extends n.BKk{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:r,gainMapMin:i,gainMapMax:a,maxDisplayBoost:s,hdrCapacityMin:o,hdrCapacityMax:l,sdr:c,gainMap:h}){super({name:"GainMapDecoderMaterial",vertexShader:ro,fragmentShader:rl,uniforms:{sdr:{value:c},gainMap:{value:h},gamma:{value:new n.Pq0(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new n.Pq0().fromArray(t)},offsetSdr:{value:new n.Pq0().fromArray(r)},gainMapMin:{value:new n.Pq0().fromArray(i)},gainMapMax:{value:new n.Pq0().fromArray(a)},weightFactor:{value:(Math.log2(s)-o)/(l-o)}},blending:0,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=s,this._hdrCapacityMin=o,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){let e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){let t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){let e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class rh extends rs{constructor(e,t){super({renderer:e,createMaterial:e=>new rc(e),createQuadRenderer:e=>new t7(e)},t)}async render(e,t,r,i){let{sdrImage:n,gainMapImage:a,needsFlip:s}=await this.processImages(r,i,"flipY"),{gainMap:o,sdr:l}=this.createTextures(n,a,s);this.updateQuadRenderer(e,n,o,l,t),e.render()}}class ru extends rh{load(e,t,r,i){let a=this.prepareQuadRenderer(),s=new n.Y9S(this._internalLoadingManager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(this.withCredentials),this.manager.itemStart(e),s.load(e,async r=>{let n,s,o;if("string"==typeof r)throw Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");let l=new Uint8Array(r);try{let e=await rn(l);n=e.sdr,s=e.gainMap,o=e.metadata}catch(t){if(t instanceof rt||t instanceof re)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),o={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},n=l;else throw t}try{await this.render(a,o,n.buffer,s?.buffer)}catch(t){this.manager.itemError(e),"function"==typeof i&&i(t),a.disposeOnDemandRenderer();return}"function"==typeof t&&t(a),this.manager.itemEnd(e),a.disposeOnDemandRenderer()},r,t=>{this.manager.itemError(e),"function"==typeof i&&i(t)}),a}}class rd extends n.BRH{constructor(e){super(e),this.type=1016}parse(e){let t,r,i,a=function(e,t){switch(e){case 1:throw Error("THREE.HDRLoader: Read Error: "+(t||""));case 2:throw Error("THREE.HDRLoader: Write Error: "+(t||""));case 3:throw Error("THREE.HDRLoader: Bad File Format: "+(t||""));default:throw Error("THREE.HDRLoader: Memory Error: "+(t||""))}},s=function(e,t,r){t=t||1024;let i=e.pos,n=-1,a=0,s="",o=String.fromCharCode.apply(null,new Uint16Array(e.subarray(i,i+128)));for(;0>(n=o.indexOf("\n"))&&a<t&&i<e.byteLength;)s+=o,a+=o.length,i+=128,o+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(i,i+128)));return -1<n&&(!1!==r&&(e.pos+=a+n+1),s+o.slice(0,n))},o=new Uint8Array(e);o.pos=0;let l=function(e){let t,r,i=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,n=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*FORMAT=(\S+)\s*$/,l=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,c={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};for(!(e.pos>=e.byteLength)&&(t=s(e))||a(1,"no header found"),(r=t.match(/^#\?(\S+)/))||a(3,"bad initial token"),c.valid|=1,c.programtype=r[1],c.string+=t+"\n";!1!==(t=s(e));){if(c.string+=t+"\n","#"===t.charAt(0)){c.comments+=t+"\n";continue}if((r=t.match(i))&&(c.gamma=parseFloat(r[1])),(r=t.match(n))&&(c.exposure=parseFloat(r[1])),(r=t.match(o))&&(c.valid|=2,c.format=r[1]),(r=t.match(l))&&(c.valid|=4,c.height=parseInt(r[1],10),c.width=parseInt(r[2],10)),2&c.valid&&4&c.valid)break}return 2&c.valid||a(3,"missing format specifier"),4&c.valid||a(3,"missing image size specifier"),c}(o),c=l.width,h=l.height,u=function(e,t,r){if(t<8||t>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);t!==(e[2]<<8|e[3])&&a(3,"wrong scanline width");let i=new Uint8Array(4*t*r);i.length||a(4,"unable to allocate buffer space");let n=0,s=0,o=4*t,l=new Uint8Array(4),c=new Uint8Array(o),h=r;for(;h>0&&s<e.byteLength;){s+4>e.byteLength&&a(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(2!=l[0]||2!=l[1]||(l[2]<<8|l[3])!=t)&&a(3,"bad rgbe scanline format");let r=0,u;for(;r<o&&s<e.byteLength;){let t=(u=e[s++])>128;if(t&&(u-=128),(0===u||r+u>o)&&a(3,"bad scanline data"),t){let t=e[s++];for(let e=0;e<u;e++)c[r++]=t}else c.set(e.subarray(s,s+u),r),r+=u,s+=u}for(let e=0;e<t;e++){let r=0;i[n]=c[e+r],r+=t,i[n+1]=c[e+r],r+=t,i[n+2]=c[e+r],r+=t,i[n+3]=c[e+r],n+=4}h--}return i}(o.subarray(o.pos),c,h);switch(this.type){case 1015:let d=new Float32Array(4*(i=u.length/4));for(let e=0;e<i;e++)!function(e,t,r,i){let n=Math.pow(2,e[t+3]-128)/255;r[i+0]=e[t+0]*n,r[i+1]=e[t+1]*n,r[i+2]=e[t+2]*n,r[i+3]=1}(u,4*e,d,4*e);t=d,r=1015;break;case 1016:let p=new Uint16Array(4*(i=u.length/4));for(let e=0;e<i;e++)!function(e,t,r,i){let a=Math.pow(2,e[t+3]-128)/255;r[i+0]=n.GxU.toHalfFloat(Math.min(e[t+0]*a,65504)),r[i+1]=n.GxU.toHalfFloat(Math.min(e[t+1]*a,65504)),r[i+2]=n.GxU.toHalfFloat(Math.min(e[t+2]*a,65504)),r[i+3]=n.GxU.toHalfFloat(1)}(u,4*e,p,4*e);t=p,r=1016;break;default:throw Error("THREE.HDRLoader: Unsupported type: "+this.type)}return{width:c,height:h,data:t,header:l.string,gamma:l.gamma,exposure:l.exposure,type:r}}setDataType(e){return this.type=e,this}load(e,t,r,i){return super.load(e,function(e,r){switch(e.type){case 1015:case 1016:e.colorSpace=n.Zr2,e.minFilter=1006,e.magFilter=1006,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,r)},r,i)}}class rp extends rd{constructor(e){console.warn("RGBELoader has been deprecated. Please use HDRLoader instead."),super(e)}}let rf={topLight:{intensity:500,position:[.418,16.199,.3]},room:{position:[-.757,13.219,.717],scale:[31.713,28.305,28.591]},boxes:[{position:[-10.906,2.009,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,.857,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:50,position:[-16.116,14.37,8.208],scale:[.1,2.428,2.739]},{intensity:50,position:[-16.109,18.021,-8.207],scale:[.1,2.425,2.751]},{intensity:17,position:[14.904,12.198,-1.832],scale:[.15,4.265,6.331]},{intensity:43,position:[-.462,8.89,14.52],scale:[4.38,5.441,.088]},{intensity:20,position:[3.235,11.486,-12.541],scale:[2.5,2,.1]},{intensity:100,position:[0,20,0],scale:[1,.1,1]}]},rg={topLight:{intensity:400,position:[.5,14,.5]},room:{position:[0,13.2,0],scale:[31.5,28.5,31.5]},boxes:[{position:[-10.906,-1,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,-.16,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:80,position:[-14,10,8],scale:[.1,2.5,2.5]},{intensity:80,position:[-14,14,-4],scale:[.1,2.5,2.5]},{intensity:23,position:[14,12,0],scale:[.1,5,5]},{intensity:16,position:[0,9,14],scale:[5,5,.1]},{intensity:80,position:[7,8,-14],scale:[2.5,2.5,.1]},{intensity:80,position:[-7,16,-14],scale:[2.5,2.5,.1]},{intensity:1,position:[0,20,0],scale:[.1,.1,.1]}]};class rm extends n.Z58{constructor(e){super(),this.position.y=-3.5;const t=new n.iNn;t.deleteAttribute("uv");const r=new n._4j({metalness:0,side:1}),i=new n._4j({metalness:0}),a="legacy"==e?rf:rg,s=new n.HiM(0xffffff,a.topLight.intensity,28,2);s.position.set(...a.topLight.position),this.add(s);const o=new n.eaF(t,r);for(const e of(o.position.set(...a.room.position),o.scale.set(...a.room.scale),this.add(o),a.boxes)){const r=new n.eaF(t,i);r.position.set(...e.position),r.rotation.set(0,e.rotation,0),r.scale.set(...e.scale),this.add(r)}for(const e of a.lights){const r=new n.eaF(t,this.createAreaLightMaterial(e.intensity));r.position.set(...e.position),r.scale.set(...e.scale),this.add(r)}}createAreaLightMaterial(e){let t=new n.V9B;return t.color.setScalar(e),t}}let rA=/\.hdr(\.js)?$/;class rb{constructor(e){this.threeRenderer=e,this.lottieLoaderUrl="",this._ldrLoader=null,this._imageLoader=null,this._hdrLoader=null,this._lottieLoader=null,this.generatedEnvironmentMap=null,this.generatedEnvironmentMapAlt=null,this.skyboxCache=new Map,this.blurMaterial=null,this.blurScene=null}ldrLoader(e){return null==this._ldrLoader&&(this._ldrLoader=new n.Tap),this._ldrLoader.setWithCredentials(e),this._ldrLoader}imageLoader(e){return null==this._imageLoader&&(this._imageLoader=new ru(this.threeRenderer)),this._imageLoader.setWithCredentials(e),this._imageLoader}hdrLoader(e){return null==this._hdrLoader&&(this._hdrLoader=new rp,this._hdrLoader.setDataType(1016)),this._hdrLoader.setWithCredentials(e),this._hdrLoader}async getLottieLoader(e){if(null==this._lottieLoader){let{LottieLoader:e}=await import(this.lottieLoaderUrl);this._lottieLoader=new e}return this._lottieLoader.setWithCredentials(e),this._lottieLoader}async loadImage(e,t){let r=await new Promise((r,i)=>this.ldrLoader(t).load(e,r,()=>{},i));return r.name=e,r.flipY=!1,r}async loadLottie(e,t,r){let i=await this.getLottieLoader(r);i.setQuality(t);let n=await new Promise((t,r)=>i.load(e,t,()=>{},r));return n.name=e,n}async loadEquirect(e,t=!1,r=()=>{}){try{let i=rA.test(e),n=i?this.hdrLoader(t):this.imageLoader(t),a=await new Promise((t,i)=>n.load(e,e=>{let{renderTarget:r}=e;if(null!=r){let{texture:i}=r;e.dispose(!1),t(i)}else t(e)},e=>{r(e.loaded/e.total*.9)},i));return r(1),a.name=e,a.mapping=303,i||(a.colorSpace="srgb"),a}finally{r&&r(1)}}async generateEnvironmentMapAndSkybox(e=null,t=null,r=()=>{},i=!1){let n,a="legacy"!==t;("legacy"===t||"neutral"===t)&&(t=null),t=(0,tH.pE)(t);let s=Promise.resolve(null);e&&(s=this.loadEquirectFromUrl(e,i,r)),n=t?this.loadEquirectFromUrl(t,i,r):e?this.loadEquirectFromUrl(e,i,r):a?this.loadGeneratedEnvironmentMapAlt():this.loadGeneratedEnvironmentMap();let[o,l]=await Promise.all([n,s]);if(null==o)throw Error("Failed to load environment map.");return{environmentMap:o,skybox:l}}async loadEquirectFromUrl(e,t,r){if(!this.skyboxCache.has(e)){let i=this.loadEquirect(e,t,r);this.skyboxCache.set(e,i)}return this.skyboxCache.get(e)}async GenerateEnvironmentMap(e,t){await (0,tH.lu)();let r=this.threeRenderer,i=new n.o6l(256,{generateMipmaps:!1,type:1016,format:1023,colorSpace:n.Zr2,depthBuffer:!0}),a=new n.F1T(.1,100,i),s=a.renderTarget.texture;s.name=t;let o=r.outputColorSpace,l=r.toneMapping;return r.toneMapping=0,r.outputColorSpace=n.Zr2,a.update(r,e),this.blurCubemap(i,.04),r.toneMapping=l,r.outputColorSpace=o,s}async loadGeneratedEnvironmentMap(){return null==this.generatedEnvironmentMap&&(this.generatedEnvironmentMap=this.GenerateEnvironmentMap(new rm("legacy"),"legacy")),this.generatedEnvironmentMap}async loadGeneratedEnvironmentMapAlt(){return null==this.generatedEnvironmentMapAlt&&(this.generatedEnvironmentMapAlt=this.GenerateEnvironmentMap(new rm("neutral"),"neutral")),this.generatedEnvironmentMapAlt}blurCubemap(e,t){if(null==this.blurMaterial){this.blurMaterial=this.getBlurShader(20);let e=new n.iNn,t=new n.eaF(e,this.blurMaterial);this.blurScene=new n.Z58,this.blurScene.add(t)}let r=e.clone();this.halfblur(e,r,t,"latitudinal"),this.halfblur(r,e,t,"longitudinal")}halfblur(e,t,r,i){let a=e.width,s=isFinite(r)?Math.PI/(2*a):2*Math.PI/39,o=r/s,l=isFinite(r)?1+Math.floor(3*o):20;l>20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${l} samples when the maximum is set to 20`);let c=[],h=0;for(let e=0;e<20;++e){let t=e/o,r=Math.exp(-t*t/2);c.push(r),0==e?h+=r:e<l&&(h+=2*r)}for(let e=0;e<c.length;e++)c[e]=c[e]/h;let u=this.blurMaterial.uniforms;u.envMap.value=e.texture,u.samples.value=l,u.weights.value=c,u.latitudinal.value="latitudinal"===i,u.dTheta.value=s,new n.F1T(.1,100,t).update(this.threeRenderer,this.blurScene)}getBlurShader(e){let t=new Float32Array(e),r=new n.Pq0(0,1,0);return new n.BKk({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},poleAxis:{value:r}},vertexShader:`
888
+
889
+ varying vec3 vOutputDirection;
890
+
891
+ void main() {
892
+
893
+ vOutputDirection = vec3( position );
894
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
895
+
896
+ }
897
+ `,fragmentShader:`
898
+ varying vec3 vOutputDirection;
899
+
900
+ uniform samplerCube envMap;
901
+ uniform int samples;
902
+ uniform float weights[ n ];
903
+ uniform bool latitudinal;
904
+ uniform float dTheta;
905
+ uniform vec3 poleAxis;
906
+
907
+ vec3 getSample( float theta, vec3 axis ) {
908
+
909
+ float cosTheta = cos( theta );
910
+ // Rodrigues' axis-angle rotation
911
+ vec3 sampleDirection = vOutputDirection * cosTheta
912
+ + cross( axis, vOutputDirection ) * sin( theta )
913
+ + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
914
+
915
+ return vec3( textureCube( envMap, sampleDirection ) );
916
+
917
+ }
918
+
919
+ void main() {
920
+
921
+ vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
922
+
923
+ if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
924
+
925
+ axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
926
+
927
+ }
928
+
929
+ axis = normalize( axis );
930
+
931
+ gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
932
+ gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
933
+
934
+ for ( int i = 1; i < n; i++ ) {
935
+
936
+ if ( i >= samples ) {
937
+
938
+ break;
939
+
940
+ }
941
+
942
+ float theta = dTheta * float( i );
943
+ gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
944
+ gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
945
+
946
+ }
947
+ }
948
+ `,blending:0,depthTest:!1,depthWrite:!1,side:1})}async dispose(){for(let[,e]of this.skyboxCache)(await e).dispose();null!=this.generatedEnvironmentMap&&((await this.generatedEnvironmentMap).dispose(),this.generatedEnvironmentMap=null),null!=this.generatedEnvironmentMapAlt&&((await this.generatedEnvironmentMapAlt).dispose(),this.generatedEnvironmentMapAlt=null),null!=this.blurMaterial&&this.blurMaterial.dispose()}}let rv=[1,.79,.62,.5,.4,.31,.25],ry="high-performance";class rx extends n.Qev{static get singleton(){return this._singleton||(this._singleton=new rx({powerPreference:(self.ModelViewerElement||{}).powerPreference||ry,debug:(0,tH.Bb)()})),this._singleton}static resetSingleton(){let e=this._singleton.dispose();for(let t of e)t.disconnectedCallback();for(let t of(this._singleton=new rx({powerPreference:(self.ModelViewerElement||{}).powerPreference||ry,debug:(0,tH.Bb)()}),e))t.connectedCallback()}get canRender(){return null!=this.threeRenderer}get scaleFactor(){return rv[this.scaleStep]}set minScale(e){let t=1;for(;t<rv.length&&!(rv[t]<e);)++t;this.lastStep=t-1}constructor(e){super(),this.loader=new tV.IZ(t9),this.width=0,this.height=0,this.dpr=1,this.scenes=new Set,this.multipleScenesVisible=!1,this.lastTick=performance.now(),this.renderedLastFrame=!1,this.scaleStep=0,this.lastStep=3,this.avgFrameDuration=50,this.onWebGLContextLost=e=>{this.dispatchEvent({type:"contextlost",sourceEvent:e})},this.onWebGLContextRestored=()=>{var e;for(let t of(null==(e=this.textureUtils)||e.dispose(),this.textureUtils=this.canRender?new rb(this.threeRenderer):null,this.scenes))t.element[tQ.hj]()},this.dpr=window.devicePixelRatio,this.canvas3D=document.createElement("canvas"),this.canvas3D.id="webgl-canvas",this.canvas3D.classList.add("show");try{this.threeRenderer=new tO({canvas:this.canvas3D,alpha:!0,antialias:!0,powerPreference:e.powerPreference,preserveDrawingBuffer:!0}),this.threeRenderer.autoClear=!0,this.threeRenderer.setPixelRatio(1),this.threeRenderer.debug={checkShaderErrors:!!e.debug,onShaderError:null},this.threeRenderer.toneMapping=7}catch(e){console.warn(e)}this.arRenderer=this.canRender?new tG.tu(this):null,this.textureUtils=this.canRender?new rb(this.threeRenderer):null,this.canRender&&tV.IZ.initializeKTX2Loader(this.threeRenderer),this.canvas3D.addEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.addEventListener("webglcontextrestored",this.onWebGLContextRestored),this.updateRendererSize()}registerScene(e){if(this.scenes.add(e),e.forceRescale(),this.canRender){let t=new n.I9Y;this.threeRenderer.getSize(t),e.canvas.width=t.x,e.canvas.height=t.y,this.scenes.size>0&&this.threeRenderer.setAnimationLoop((e,t)=>this.render(e,t))}}unregisterScene(e){this.scenes.delete(e),this.canvas3D.parentElement===e.canvas.parentElement&&e.canvas.parentElement.removeChild(this.canvas3D),this.canRender&&0===this.scenes.size&&this.threeRenderer.setAnimationLoop(null)}displayCanvas(e){return e.element.modelIsVisible&&!this.multipleScenesVisible?this.canvas3D:e.element[tz.hr]}countVisibleScenes(){let{canvas3D:e}=this,t=0,r=null;for(let i of this.scenes){let{element:n}=i;n.modelIsVisible&&null==i.externalRenderer&&++t,e.parentElement===i.canvas.parentElement&&(r=i)}let i=t>1;if(null!=r){let t=i&&!this.multipleScenesVisible,n=!r.element.modelIsVisible;if(t||n){let{width:t,height:i}=this.sceneSize(r);this.copyPixels(r,t,i),e.parentElement.removeChild(e)}}this.multipleScenesVisible=i}updateRendererSize(){var e;let t=window.devicePixelRatio;if(t!==this.dpr)for(let e of this.scenes){let{element:t}=e;t[tz.vk](t.getBoundingClientRect())}let r=0,i=0;for(let e of this.scenes)r=Math.max(r,e.width),i=Math.max(i,e.height);if(r!==this.width||i!==this.height||t!==this.dpr)for(let n of(this.width=r,this.height=i,this.dpr=t,r=Math.ceil(r*t),i=Math.ceil(i*t),this.canRender&&this.threeRenderer.setSize(r,i,!1),this.scenes)){let{canvas:t}=n;t.width=r,t.height=i,n.forceRescale(),null==(e=n.effectRenderer)||e.setSize(r,i)}}updateRendererScale(e){let t=this.scaleStep;this.avgFrameDuration+=(0,tH.qE)(.2*(e-this.avgFrameDuration),-5,5),this.avgFrameDuration>60?++this.scaleStep:this.avgFrameDuration<40&&this.scaleStep>0&&--this.scaleStep,this.scaleStep=Math.min(this.scaleStep,this.lastStep),t!==this.scaleStep&&(this.avgFrameDuration=50)}shouldRender(e){if(e.shouldRender())e.scaleStep!=this.scaleStep&&(e.scaleStep=this.scaleStep,this.rescaleCanvas(e));else{if(0==e.scaleStep)return!1;e.scaleStep=0,this.rescaleCanvas(e)}return!0}rescaleCanvas(e){let t=rv[e.scaleStep],r=Math.ceil(this.width/t),i=Math.ceil(this.height/t),{style:n}=e.canvas;n.width=`${r}px`,n.height=`${i}px`,this.canvas3D.style.width=`${r}px`,this.canvas3D.style.height=`${i}px`;let a=this.dpr*t,s=t<1?"GPU throttling":this.dpr!==window.devicePixelRatio?"No meta viewport tag":"";e.element.dispatchEvent(new CustomEvent("render-scale",{detail:{reportedDpr:window.devicePixelRatio,renderedDpr:a,minimumDpr:this.dpr*rv[this.lastStep],pixelWidth:Math.ceil(e.width*a),pixelHeight:Math.ceil(e.height*a),reason:s}}))}sceneSize(e){let{dpr:t}=this,r=rv[e.scaleStep];return{width:Math.min(Math.ceil(e.width*r*t),this.canvas3D.width),height:Math.min(Math.ceil(e.height*r*t),this.canvas3D.height)}}copyPixels(e,t,r){let i=e.context;null==i?console.log("could not acquire 2d context"):(i.clearRect(0,0,t,r),i.drawImage(this.canvas3D,0,0,t,r,0,0,t,r),e.canvas.classList.add("show"))}orderedScenes(){let e=[];for(let t of[!1,!0])for(let r of this.scenes)r.element.modelIsVisible===t&&e.push(r);return e}get isPresenting(){var e;return(null==(e=this.arRenderer)?void 0:e.isPresenting)===!0}preRender(e,t,r){let{element:i,exposure:n,toneMapping:a}=e;i[tz.Ei](t,r);let s="number"==typeof n&&!Number.isNaN(n),o=i.environmentImage,l=i.skyboxImage;this.threeRenderer.toneMappingExposure=(s?n:1)*(7!==a||"neutral"!==o&&"legacy"!==o&&(o||l)?1:1.3)}render(e,t){if(null!=t){null!=this.arRenderer&&this.arRenderer.onWebXRFrame(e,t);return}let r=e-this.lastTick;if(this.lastTick=e,!this.canRender||this.isPresenting)return;this.countVisibleScenes(),this.updateRendererSize(),this.renderedLastFrame&&(this.updateRendererScale(r),this.renderedLastFrame=!1);let{canvas3D:i}=this;for(let t of this.orderedScenes()){let{element:n}=t;if(!n.loaded||!n.modelIsVisible&&t.renderCount>0||(this.preRender(t,e,r),!this.shouldRender(t)))continue;if(null!=t.externalRenderer){let e=t.getCamera();e.updateMatrix();let{matrix:r,projectionMatrix:i}=e,n=r.elements.slice(),a=t.getTarget();n[12]+=a.x,n[13]+=a.y,n[14]+=a.z,t.externalRenderer.render({viewMatrix:n,projectionMatrix:i.elements});continue}if(!n.modelIsVisible&&!this.multipleScenesVisible)for(let e of this.scenes)e.element.modelIsVisible&&e.queueRender();let{width:a,height:s}=this.sceneSize(t);t.renderShadow(this.threeRenderer),this.threeRenderer.setRenderTarget(null),this.threeRenderer.setViewport(0,Math.ceil(this.height*this.dpr)-s,a,s),null!=t.effectRenderer?t.effectRenderer.render(r):(this.threeRenderer.autoClear=!0,this.threeRenderer.toneMapping=t.toneMapping,this.threeRenderer.render(t,t.camera)),this.multipleScenesVisible||!t.element.modelIsVisible&&0===t.renderCount?this.copyPixels(t,a,s):i.parentElement!==t.canvas.parentElement&&(t.canvas.parentElement.appendChild(i),t.canvas.classList.remove("show")),t.hasRendered(),++t.renderCount,this.renderedLastFrame=!0}}dispose(){null!=this.textureUtils&&this.textureUtils.dispose(),null!=this.threeRenderer&&this.threeRenderer.dispose(),this.textureUtils=null,this.threeRenderer=null;let e=[];for(let t of this.scenes)e.push(t.element);return this.canvas3D.removeEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.removeEventListener("webglcontextrestored",this.onWebGLContextRestored),e}}},119(e,t,r){"use strict";r.d(t,{iC:()=>u,zJ:()=>d});var i=r(874),n=r(9051),a=r(1535),s=r(8150);let o=new i.I9Y,l=new i.Pq0,c=Object.freeze({minimumRadius:0,maximumRadius:1/0,minimumPolarAngle:0,maximumPolarAngle:Math.PI,minimumAzimuthalAngle:-1/0,maximumAzimuthalAngle:1/0,minimumFieldOfView:10,maximumFieldOfView:45,touchAction:"none"}),h=Math.PI/8,u={USER_INTERACTION:"user-interaction",NONE:"none",AUTOMATIC:"automatic"};class d extends i.Qev{constructor(e,t,r){super(),this.camera=e,this.element=t,this.scene=r,this.orbitSensitivity=1,this.zoomSensitivity=1,this.panSensitivity=1,this.inputSensitivity=1,this.changeSource=u.NONE,this._interactionEnabled=!1,this._disableZoom=!1,this.isUserPointing=!1,this.enablePan=!0,this.enableTap=!0,this.panProjection=new i.dwI,this.panPerPixel=0,this.spherical=new i.YHV,this.goalSpherical=new i.YHV,this.thetaDamper=new s.A,this.phiDamper=new s.A,this.radiusDamper=new s.A,this.logFov=Math.log(c.maximumFieldOfView),this.goalLogFov=this.logFov,this.fovDamper=new s.A,this.touchMode=null,this.pointers=[],this.startTime=0,this.startPointerPosition={clientX:0,clientY:0},this.lastSeparation=0,this.touchDecided=!1,this.onContext=e=>{if(this.enablePan)e.preventDefault();else for(let e of this.pointers)this.onPointerUp(new PointerEvent("pointercancel",Object.assign(Object.assign({},this.startPointerPosition),{pointerId:e.id})))},this.touchModeZoom=(e,t)=>{if(!this._disableZoom){let e=this.twoTouchDistance(this.pointers[0],this.pointers[1]),t=.04*this.zoomSensitivity*(this.lastSeparation-e)*50/this.scene.height;this.lastSeparation=e,this.userAdjustOrbit(0,0,t)}this.panPerPixel>0&&this.movePan(e,t)},this.disableScroll=e=>{e.preventDefault()},this.touchModeRotate=(e,t)=>{let{touchAction:r}=this._options;if(!this.touchDecided&&"none"!==r){this.touchDecided=!0;let i=Math.abs(e),n=Math.abs(t);if(this.changeSource===u.USER_INTERACTION&&("pan-y"===r&&n>i||"pan-x"===r&&i>n)){this.touchMode=null;return}this.element.addEventListener("touchmove",this.disableScroll,{passive:!1})}this.handleSinglePointerMove(e,t)},this.onPointerDown=e=>{if(this.pointers.length>2)return;let{element:t}=this;0===this.pointers.length&&(t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),this.touchMode=null,this.touchDecided=!1,this.startPointerPosition.clientX=e.clientX,this.startPointerPosition.clientY=e.clientY,this.startTime=performance.now());try{t.setPointerCapture(e.pointerId)}catch(e){}this.pointers.push({clientX:e.clientX,clientY:e.clientY,id:e.pointerId}),this.isUserPointing=!1,"touch"===e.pointerType?(this.changeSource=e.altKey?u.AUTOMATIC:u.USER_INTERACTION,this.onTouchChange(e)):(this.changeSource=u.USER_INTERACTION,this.onMouseDown(e)),this.changeSource===u.USER_INTERACTION&&this.dispatchEvent({type:"user-interaction"})},this.onPointerMove=e=>{let t=this.pointers.find(t=>t.id===e.pointerId);if(null==t)return;if("mouse"===e.pointerType&&0===e.buttons)return void this.onPointerUp(e);let r=this.pointers.length,i=(e.clientX-t.clientX)/r,n=(e.clientY-t.clientY)/r;(0!==i||0!==n)&&(t.clientX=e.clientX,t.clientY=e.clientY,"touch"===e.pointerType?(this.changeSource=e.altKey?u.AUTOMATIC:u.USER_INTERACTION,null!==this.touchMode&&this.touchMode(i,n)):(this.changeSource=u.USER_INTERACTION,this.panPerPixel>0?this.movePan(i,n):this.handleSinglePointerMove(i,n)))},this.onPointerUp=e=>{let{element:t}=this,r=this.pointers.findIndex(t=>t.id===e.pointerId);-1!==r&&this.pointers.splice(r,1),this.panPerPixel>0&&!e.altKey&&this.resetRadius(),0===this.pointers.length?(t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("touchmove",this.disableScroll),this.enablePan&&this.enableTap&&this.recenter(e)):null!==this.touchMode&&this.onTouchChange(e),this.scene.element[n.av].style.opacity=0,t.style.cursor="grab",this.panPerPixel=0,this.isUserPointing&&this.dispatchEvent({type:"pointer-change-end"})},this.onWheel=e=>{this.changeSource=u.USER_INTERACTION;let t=e.deltaY*(1==e.deltaMode?18:1)*.04*this.zoomSensitivity/30;this.userAdjustOrbit(0,0,t),e.preventDefault(),this.dispatchEvent({type:"user-interaction"})},this.onKeyDown=e=>{let{changeSource:t}=this;this.changeSource=u.USER_INTERACTION,(e.shiftKey&&this.enablePan?this.panKeyCodeHandler(e):this.orbitZoomKeyCodeHandler(e))?(e.preventDefault(),this.dispatchEvent({type:"user-interaction"})):this.changeSource=t},this._options=Object.assign({},c),this.setOrbit(0,Math.PI/2,1),this.setFieldOfView(100),this.jumpToGoal()}get interactionEnabled(){return this._interactionEnabled}enableInteraction(){if(!1===this._interactionEnabled){let{element:e}=this;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointercancel",this.onPointerUp),this._disableZoom||e.addEventListener("wheel",this.onWheel),e.addEventListener("keydown",this.onKeyDown),e.addEventListener("touchmove",()=>{},{passive:!1}),e.addEventListener("contextmenu",this.onContext),this.element.style.cursor="grab",this._interactionEnabled=!0,this.updateTouchActionStyle()}}disableInteraction(){if(!0===this._interactionEnabled){let{element:e}=this;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown),e.removeEventListener("contextmenu",this.onContext),e.style.cursor="",this.touchMode=null,this._interactionEnabled=!1,this.updateTouchActionStyle()}}get options(){return this._options}set disableZoom(e){this._disableZoom!=e&&(this._disableZoom=e,!0===e?this.element.removeEventListener("wheel",this.onWheel):this.element.addEventListener("wheel",this.onWheel),this.updateTouchActionStyle())}getCameraSpherical(e=new i.YHV){return e.copy(this.spherical)}getFieldOfView(){return this.camera.fov}applyOptions(e){Object.assign(this._options,e),this.setOrbit(),this.setFieldOfView(Math.exp(this.goalLogFov))}updateNearFar(e,t){this.camera.far=0===t?2:t,this.camera.near=Math.max(e,this.camera.far/1e3),this.camera.updateProjectionMatrix()}updateAspect(e){this.camera.aspect=e,this.camera.updateProjectionMatrix()}setOrbit(e=this.goalSpherical.theta,t=this.goalSpherical.phi,r=this.goalSpherical.radius){let{minimumAzimuthalAngle:i,maximumAzimuthalAngle:n,minimumPolarAngle:s,maximumPolarAngle:o,minimumRadius:l,maximumRadius:c}=this._options,{theta:h,phi:u,radius:d}=this.goalSpherical,p=(0,a.qE)(e,i,n);isFinite(i)||isFinite(n)||(this.spherical.theta=this.wrapAngle(this.spherical.theta-p)+p);let f=(0,a.qE)(t,s,o),g=(0,a.qE)(r,l,c);return(p!==h||f!==u||g!==d)&&!!isFinite(p)&&!!isFinite(f)&&!!isFinite(g)&&(this.goalSpherical.theta=p,this.goalSpherical.phi=f,this.goalSpherical.radius=g,this.goalSpherical.makeSafe(),!0)}setRadius(e){this.goalSpherical.radius=e,this.setOrbit()}setFieldOfView(e){let{minimumFieldOfView:t,maximumFieldOfView:r}=this._options;e=(0,a.qE)(e,t,r),this.goalLogFov=Math.log(e)}setDamperDecayTime(e){this.thetaDamper.setDecayTime(e),this.phiDamper.setDecayTime(e),this.radiusDamper.setDecayTime(e),this.fovDamper.setDecayTime(e)}adjustOrbit(e,t,r){let{theta:i,phi:n,radius:s}=this.goalSpherical,{minimumRadius:o,maximumRadius:l,minimumFieldOfView:c,maximumFieldOfView:h}=this._options,u=this.spherical.theta-i,d=Math.PI-.001,p=i-(0,a.qE)(e,-d-u,d-u),f=0===r?0:((r>0?l:o)-s)/(Math.log(r>0?h:c)-this.goalLogFov),g=s+r*(isFinite(f)?f:(l-o)*2);if(this.setOrbit(p,n-t,g),0!==r){let e=this.goalLogFov+r;this.setFieldOfView(Math.exp(e))}}jumpToGoal(){this.update(0,1e4)}update(e,t){if(this.isStationary())return!1;let{maximumPolarAngle:r,maximumRadius:i}=this._options,n=this.spherical.theta-this.goalSpherical.theta;return!(Math.abs(n)>Math.PI)||isFinite(this._options.minimumAzimuthalAngle)||isFinite(this._options.maximumAzimuthalAngle)||(this.spherical.theta-=2*Math.sign(n)*Math.PI),this.spherical.theta=this.thetaDamper.update(this.spherical.theta,this.goalSpherical.theta,t,Math.PI),this.spherical.phi=this.phiDamper.update(this.spherical.phi,this.goalSpherical.phi,t,r),this.spherical.radius=this.radiusDamper.update(this.spherical.radius,this.goalSpherical.radius,t,i),this.logFov=this.fovDamper.update(this.logFov,this.goalLogFov,t,1),this.moveCamera(),!0}updateTouchActionStyle(){let{style:e}=this.element;if(this._interactionEnabled){let{touchAction:t}=this._options;this._disableZoom&&"none"!==t?e.touchAction="manipulation":e.touchAction=t}else e.touchAction=""}isStationary(){return this.goalSpherical.theta===this.spherical.theta&&this.goalSpherical.phi===this.spherical.phi&&this.goalSpherical.radius===this.spherical.radius&&this.goalLogFov===this.logFov}moveCamera(){this.spherical.makeSafe(),this.camera.position.setFromSpherical(this.spherical),this.camera.setRotationFromEuler(new i.O9p(this.spherical.phi-Math.PI/2,this.spherical.theta,0,"YXZ")),this.camera.fov!==Math.exp(this.logFov)&&(this.camera.fov=Math.exp(this.logFov),this.camera.updateProjectionMatrix())}userAdjustOrbit(e,t,r){this.adjustOrbit(e*this.orbitSensitivity*this.inputSensitivity,t*this.orbitSensitivity*this.inputSensitivity,r*this.inputSensitivity)}wrapAngle(e){let t=(e+Math.PI)/(2*Math.PI);return 2*(t-Math.floor(t))*Math.PI-Math.PI}pixelLengthToSphericalAngle(e){return 2*Math.PI*e/this.scene.height}twoTouchDistance(e,t){let{clientX:r,clientY:i}=e,{clientX:n,clientY:a}=t,s=n-r,o=a-i;return Math.sqrt(s*s+o*o)}handleSinglePointerMove(e,t){let r=this.pixelLengthToSphericalAngle(e),i=this.pixelLengthToSphericalAngle(t);!1===this.isUserPointing&&(this.isUserPointing=!0,this.dispatchEvent({type:"pointer-change-start"})),this.userAdjustOrbit(r,i,0)}initializePan(){let{theta:e,phi:t}=this.spherical,r=e-this.scene.yaw;this.panPerPixel=.018*this.panSensitivity/this.scene.height,this.panProjection.set(-Math.cos(r),-Math.cos(t)*Math.sin(r),0,0,Math.sin(t),0,Math.sin(r),-Math.cos(t)*Math.cos(r),0)}movePan(e,t){let{scene:r}=this,i=l.set(e,t,0).multiplyScalar(this.inputSensitivity),n=this.spherical.radius*Math.exp(this.logFov)*this.panPerPixel;i.multiplyScalar(n);let a=r.getTarget();a.add(i.applyMatrix3(this.panProjection)),r.boundingSphere.clampPoint(a,a),r.setTarget(a.x,a.y,a.z)}recenter(e){if(performance.now()>this.startTime+300||Math.abs(e.clientX-this.startPointerPosition.clientX)>2||Math.abs(e.clientY-this.startPointerPosition.clientY)>2)return;let{scene:t}=this,r=t.positionAndNormalFromPoint(t.getNDC(e.clientX,e.clientY));if(null==r){let{cameraTarget:e}=t.element;t.element.cameraTarget="",t.element.cameraTarget=e,this.userAdjustOrbit(0,0,1)}else t.target.worldToLocal(r.position),t.setTarget(r.position.x,r.position.y,r.position.z)}resetRadius(){let{scene:e}=this,t=e.positionAndNormalFromPoint(o.set(0,0));if(null==t)return;e.target.worldToLocal(t.position);let r=e.getTarget(),{theta:i,phi:n}=this.spherical,a=i-e.yaw,s=l.set(Math.sin(n)*Math.sin(a),Math.cos(n),Math.sin(n)*Math.cos(a)),c=s.dot(t.position.sub(r));r.add(s.multiplyScalar(c)),e.setTarget(r.x,r.y,r.z),this.setOrbit(void 0,void 0,this.goalSpherical.radius-c)}onTouchChange(e){if(1===this.pointers.length)this.touchMode=this.touchModeRotate;else{if(this._disableZoom){this.touchMode=null,this.element.removeEventListener("touchmove",this.disableScroll);return}this.touchMode=this.touchDecided&&null===this.touchMode?null:this.touchModeZoom,this.touchDecided=!0,this.element.addEventListener("touchmove",this.disableScroll,{passive:!1}),this.lastSeparation=this.twoTouchDistance(this.pointers[0],this.pointers[1]),this.enablePan&&null!=this.touchMode&&(this.initializePan(),e.altKey||(this.scene.element[n.av].style.opacity=1))}}onMouseDown(e){this.panPerPixel=0,this.enablePan&&(2===e.button||e.ctrlKey||e.metaKey||e.shiftKey)&&(this.initializePan(),this.scene.element[n.av].style.opacity=1),this.element.style.cursor="grabbing"}orbitZoomKeyCodeHandler(e){let t=!0;switch(e.key){case"PageUp":this.userAdjustOrbit(0,0,.04*this.zoomSensitivity);break;case"PageDown":this.userAdjustOrbit(0,0,-.04*this.zoomSensitivity);break;case"ArrowUp":this.userAdjustOrbit(0,-h,0);break;case"ArrowDown":this.userAdjustOrbit(0,h,0);break;case"ArrowLeft":this.userAdjustOrbit(-h,0,0);break;case"ArrowRight":this.userAdjustOrbit(h,0,0);break;default:t=!1}return t}panKeyCodeHandler(e){this.initializePan();let t=!0;switch(e.key){case"ArrowUp":this.movePan(0,-10);break;case"ArrowDown":this.movePan(0,10);break;case"ArrowLeft":this.movePan(-10,0);break;case"ArrowRight":this.movePan(10,0);break;default:t=!1}return t}}},1535(e,t,r){"use strict";let i;r.d(t,{Bb:()=>u,f3:()=>s,lA:()=>p,lu:()=>d,nF:()=>l,pE:()=>a,qE:()=>h,sg:()=>c});var n=r(322);let a=e=>e&&"null"!==e?o(e):null,s=()=>{if(n.al)return;let e=[];throw n.U7||e.push("WebXR Device API"),n.WW||e.push("WebXR Hit Test API"),Error(`The following APIs are required for AR, but are missing in this browser: ${e.join(", ")}`)},o=e=>new URL(e,window.location.toString()).toString(),l=(e,t)=>{let r=null,i=(...i)=>{null==r&&(e(...i),r=self.setTimeout(()=>r=null,t))};return i.flush=()=>{null!=r&&(self.clearTimeout(r),r=null)},i},c=(e,t)=>{let r=null;return(...i)=>{null!=r&&self.clearTimeout(r),r=self.setTimeout(()=>{r=null,e(...i)},t)}},h=(e,t,r)=>Math.max(t,Math.min(r,e)),u=(i=RegExp("[?&]model-viewer-debug-mode(&|$)"),()=>self.ModelViewerElement&&self.ModelViewerElement.debugMode||self.location&&self.location.search&&self.location.search.match(i)),d=(e=0)=>new Promise(t=>setTimeout(t,e)),p=(e,t,r=null)=>new Promise(i=>{e.addEventListener(t,function n(a){(!r||r(a))&&(i(a),e.removeEventListener(t,n))})})},3035(e,t,r){"use strict";r.d(t,{Ec:()=>y,W3:()=>v,mN:()=>S});let i=globalThis,n=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),s=new WeakMap;class o{constructor(e,t,r){if(this._$cssResult$=!0,r!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(n&&void 0===e){let r=void 0!==t&&1===t.length;r&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&s.set(t,e))}return e}toString(){return this.cssText}}let l=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t,r="";for(let t of e.cssRules)r+=t.cssText;return new o("string"==typeof(t=r)?t:t+"",void 0,a)})(e):e,{is:c,defineProperty:h,getOwnPropertyDescriptor:u,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:f}=Object,g=globalThis,m=g.trustedTypes,A=m?m.emptyScript:"",b=g.reactiveElementPolyfillSupport,v={toAttribute(e,t){switch(t){case Boolean:e=e?A:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},y=(e,t)=>!c(e,t),x={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;class S extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=x){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);void 0!==i&&h(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:n}=u(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){let a=i?.call(this);n?.call(this,t),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??x}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=f(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...d(e),...p(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,r]of t)this.elementProperties.set(e,r)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let r of new Set(e.flat(1/0).reverse()))t.unshift(l(r));else void 0!==e&&t.push(l(e));return t}static _$Eu(e,t){let r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(n)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let r of t){let t=document.createElement("style"),n=i.litNonce;void 0!==n&&t.setAttribute("nonce",n),t.textContent=r.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(void 0!==i&&!0===r.reflect){let n=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(t,r.type);this._$Em=e,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){let r=this.constructor,i=r._$Eh.get(e);if(void 0!==i&&this._$Em!==i){let e=r.getPropertyOptions(i),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:v;this._$Em=i;let a=n.fromAttribute(t,e.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,t,r,i=!1,n){if(void 0!==e){let a=this.constructor;if(!1===i&&(n=this[e]),!(((r??=a.getPropertyOptions(e)).hasChanged??y)(n,t)||r.useDefault&&r.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:n},a){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==n||void 0!==a)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,r]of e){let{wrapped:e}=r,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,r,i)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S.elementProperties=new Map,S.finalized=new Map,b?.({ReactiveElement:S}),(g.reactiveElementVersions??=[]).push("2.1.2")},6478(e,t,r){"use strict";function i(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e?.(i),!1===r||!i.defaultPrevented)return t?.(i)}}r.d(t,{mK:()=>i}),"u">typeof window&&window.document&&window.document.createElement},3577(e,t,r){"use strict";r.d(t,{s:()=>s,t:()=>a});var i=r(9081);function n(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function a(...e){return t=>{let r=!1,i=e.map(e=>{let i=n(e,t);return r||"function"!=typeof i||(r=!0),i});if(r)return()=>{for(let t=0;t<i.length;t++){let r=i[t];"function"==typeof r?r():n(e[t],null)}}}}function s(...e){return i.useCallback(a(...e),e)}},7463(e,t,r){"use strict";r.d(t,{A:()=>s,q:()=>a});var i=r(9081),n=r(8525);function a(e,t){let r=i.createContext(t),a=e=>{let{children:t,...a}=e,s=i.useMemo(()=>a,Object.values(a));return(0,n.jsx)(r.Provider,{value:s,children:t})};return a.displayName=e+"Provider",[a,function(n){let a=i.useContext(r);if(a)return a;if(void 0!==t)return t;throw Error(`\`${n}\` must be used within \`${e}\``)}]}function s(e,t=[]){let r=[],a=()=>{let t=r.map(e=>i.createContext(e));return function(r){let n=r?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return a.scopeName=e,[function(t,a){let s=i.createContext(a),o=r.length;r=[...r,a];let l=t=>{let{scope:r,children:a,...l}=t,c=r?.[e]?.[o]||s,h=i.useMemo(()=>l,Object.values(l));return(0,n.jsx)(c.Provider,{value:h,children:a})};return l.displayName=t+"Provider",[l,function(r,n){let l=n?.[e]?.[o]||s,c=i.useContext(l);if(c)return c;if(void 0!==a)return a;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:i})=>{let n=r(e)[`__scope${i}`];return{...t,...n}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(a,...t)]}},3285(e,t,r){"use strict";let i;r.d(t,{ZL:()=>tt,bL:()=>te,UC:()=>ti,hJ:()=>tr,bm:()=>tn});var n,a,s,o,l,c,h,u,d=r(9081),p=r(6478),f=r(3577),g=r(7463),m=r(4798),A=r(8794),b=r(4253),v=r(2274),y=r(8525),x="dismissableLayer.update",S=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),E=d.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:n,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...l}=e,c=d.useContext(S),[u,g]=d.useState(null),m=u?.ownerDocument??globalThis?.document,[,A]=d.useState({}),E=(0,f.s)(t,e=>g(e)),C=Array.from(c.layers),[M]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),I=C.indexOf(M),T=u?C.indexOf(u):-1,R=c.layersWithOutsidePointerEventsDisabled.size>0,B=T>=I,k=function(e,t=globalThis?.document){let r=(0,v.c)(e),i=d.useRef(!1),n=d.useRef(()=>{});return d.useEffect(()=>{let e=e=>{if(e.target&&!i.current){let i=function(){_("dismissableLayer.pointerDownOutside",r,a,{discrete:!0})},a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",n.current),n.current=i,t.addEventListener("click",n.current,{once:!0})):i()}else t.removeEventListener("click",n.current);i.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>i.current=!0}}(e=>{let t=e.target,r=[...c.branches].some(e=>e.contains(t));B&&!r&&(n?.(e),s?.(e),e.defaultPrevented||o?.())},m),P=function(e,t=globalThis?.document){let r=(0,v.c)(e),i=d.useRef(!1);return d.useEffect(()=>{let e=e=>{e.target&&!i.current&&_("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}(e=>{let t=e.target;![...c.branches].some(e=>e.contains(t))&&(a?.(e),s?.(e),e.defaultPrevented||o?.())},m);return!function(e,t=globalThis?.document){let r=(0,v.c)(e);d.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{T===c.layers.size-1&&(i?.(e),!e.defaultPrevented&&o&&(e.preventDefault(),o()))},m),d.useEffect(()=>{if(u)return r&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(h=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),w(),()=>{r&&1===c.layersWithOutsidePointerEventsDisabled.size&&(m.body.style.pointerEvents=h)}},[u,m,r,c]),d.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),w())},[u,c]),d.useEffect(()=>{let e=()=>A({});return document.addEventListener(x,e),()=>document.removeEventListener(x,e)},[]),(0,y.jsx)(b.sG.div,{...l,ref:E,style:{pointerEvents:R?B?"auto":"none":void 0,...e.style},onFocusCapture:(0,p.mK)(e.onFocusCapture,P.onFocusCapture),onBlurCapture:(0,p.mK)(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:(0,p.mK)(e.onPointerDownCapture,k.onPointerDownCapture)})});function w(){let e=new CustomEvent(x);document.dispatchEvent(e)}function _(e,t,r,{discrete:i}){let n=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),i?(0,b.hO)(n,a):n.dispatchEvent(a)}E.displayName="DismissableLayer",d.forwardRef((e,t)=>{let r=d.useContext(S),i=d.useRef(null),n=(0,f.s)(t,i);return d.useEffect(()=>{let e=i.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,y.jsx)(b.sG.div,{...e,ref:n})}).displayName="DismissableLayerBranch";var C="focusScope.autoFocusOnMount",M="focusScope.autoFocusOnUnmount",I={bubbles:!1,cancelable:!0},T=d.forwardRef((e,t)=>{let{loop:r=!1,trapped:i=!1,onMountAutoFocus:n,onUnmountAutoFocus:a,...s}=e,[o,l]=d.useState(null),c=(0,v.c)(n),h=(0,v.c)(a),u=d.useRef(null),p=(0,f.s)(t,e=>l(e)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(i){let e=function(e){if(g.paused||!o)return;let t=e.target;o.contains(t)?u.current=t:k(u.current,{select:!0})},t=function(e){if(g.paused||!o)return;let t=e.relatedTarget;null!==t&&(o.contains(t)||k(u.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&k(o)});return o&&r.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[i,o,g.paused]),d.useEffect(()=>{if(o){P.add(g);let e=document.activeElement;if(!o.contains(e)){let t=new CustomEvent(C,I);o.addEventListener(C,c),o.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let i of e)if(k(i,{select:t}),document.activeElement!==r)return}(R(o).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&k(o))}return()=>{o.removeEventListener(C,c),setTimeout(()=>{let t=new CustomEvent(M,I);o.addEventListener(M,h),o.dispatchEvent(t),t.defaultPrevented||k(e??document.body,{select:!0}),o.removeEventListener(M,h),P.remove(g)},0)}}},[o,c,h,g]);let m=d.useCallback(e=>{if(!r&&!i||g.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){var a;let t,i=e.currentTarget,[s,o]=[B(t=R(a=i),a),B(t.reverse(),a)];s&&o?e.shiftKey||n!==o?e.shiftKey&&n===s&&(e.preventDefault(),r&&k(o,{select:!0})):(e.preventDefault(),r&&k(s,{select:!0})):n===i&&e.preventDefault()}},[r,i,g.paused]);return(0,y.jsx)(b.sG.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});function R(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function B(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function k(e,{select:t=!1}={}){if(e&&e.focus){var r;let i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}T.displayName="FocusScope";var P=(i=[],{add(e){let t=i[0];e!==t&&t?.pause(),(i=D(i,e)).unshift(e)},remove(e){i=D(i,e),i[0]?.resume()}});function D(e,t){let r=[...e],i=r.indexOf(t);return -1!==i&&r.splice(i,1),r}var L=r(8092),F=r(6026),N=d.forwardRef((e,t)=>{let{container:r,...i}=e,[n,a]=d.useState(!1);(0,F.N)(()=>a(!0),[]);let s=r||n&&globalThis?.document?.body;return s?L.createPortal((0,y.jsx)(b.sG.div,{...i,ref:t}),s):null});N.displayName="Portal";var U=r(7537),O=0;function Q(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var z=function(){return(z=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function H(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)0>t.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}var G="right-scroll-bar-position",V="width-before-scroll-bar";function j(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var q="u">typeof window?d.useLayoutEffect:d.useEffect,W=new WeakMap,X=(void 0===n&&(n={}),(void 0===a&&(a=function(e){return e}),s=[],o=!1,l={read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:null},useMedium:function(e){var t=a(e,o);return s.push(t),function(){s=s.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(o=!0;s.length;){var t=s;s=[],t.forEach(e)}s={push:function(t){return e(t)},filter:function(){return s}}},assignMedium:function(e){o=!0;var t=[];if(s.length){var r=s;s=[],r.forEach(e),t=s}var i=function(){var r=t;t=[],r.forEach(e)},n=function(){return Promise.resolve().then(i)};n(),s={push:function(e){t.push(e),n()},filter:function(e){return t=t.filter(e),s}}}}).options=z({async:!0,ssr:!1},n),l),Y=function(){},K=d.forwardRef(function(e,t){var r,i,n,a,s=d.useRef(null),o=d.useState({onScrollCapture:Y,onWheelCapture:Y,onTouchMoveCapture:Y}),l=o[0],c=o[1],h=e.forwardProps,u=e.children,p=e.className,f=e.removeScrollBar,g=e.enabled,m=e.shards,A=e.sideCar,b=e.noRelative,v=e.noIsolation,y=e.inert,x=e.allowPinchZoom,S=e.as,E=e.gapMode,w=H(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=(r=[s,t],i=function(e){return r.forEach(function(t){return j(t,e)})},(n=(0,d.useState)(function(){return{value:null,callback:i,facade:{get current(){return n.value},set current(value){var e=n.value;e!==value&&(n.value=value,n.callback(value,e))}}}})[0]).callback=i,a=n.facade,q(function(){var e=W.get(a);if(e){var t=new Set(e),i=new Set(r),n=a.current;t.forEach(function(e){i.has(e)||j(e,null)}),i.forEach(function(e){t.has(e)||j(e,n)})}W.set(a,r)},[r]),a),C=z(z({},w),l);return d.createElement(d.Fragment,null,g&&d.createElement(A,{sideCar:X,removeScrollBar:f,shards:m,noRelative:b,noIsolation:v,inert:y,setCallbacks:c,allowPinchZoom:!!x,lockRef:s,gapMode:E}),h?d.cloneElement(d.Children.only(u),z(z({},C),{ref:_})):d.createElement(void 0===S?"div":S,z({},C,{className:p,ref:_}),u))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},K.classNames={fullWidth:V,zeroRight:G};var $=function(e){var t=e.sideCar,r=H(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw Error("Sidecar medium not found");return d.createElement(i,z({},r))};$.isSideCarExport=!0;var J=function(){var e=0,t=null;return{add:function(i){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=u||r.nc;return t&&e.setAttribute("nonce",t),e}())){var n,a;(n=t).styleSheet?n.styleSheet.cssText=i:n.appendChild(document.createTextNode(i)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Z=function(){var e=J();return function(t,r){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ee=function(){var e=Z();return function(t){return e(t.styles,t.dynamic),null}},et={left:0,top:0,right:0,gap:0},er=function(e){return parseInt(e||"",10)||0},ei=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],i=t["padding"===e?"paddingTop":"marginTop"],n=t["padding"===e?"paddingRight":"marginRight"];return[er(r),er(i),er(n)]},en=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return et;var t=ei(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-r+t[2]-t[0])}},ea=ee(),es="data-scroll-locked",eo=function(e,t,r,i){var n=e.left,a=e.top,s=e.right,o=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(i,";\n padding-right: ").concat(o,"px ").concat(i,";\n }\n body[").concat(es,"] {\n overflow: hidden ").concat(i,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(i,";"),"margin"===r&&"\n padding-left: ".concat(n,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(i,";\n "),"padding"===r&&"padding-right: ".concat(o,"px ").concat(i,";")].filter(Boolean).join(""),"\n }\n \n .").concat(G," {\n right: ").concat(o,"px ").concat(i,";\n }\n \n .").concat(V," {\n margin-right: ").concat(o,"px ").concat(i,";\n }\n \n .").concat(G," .").concat(G," {\n right: 0 ").concat(i,";\n }\n \n .").concat(V," .").concat(V," {\n margin-right: 0 ").concat(i,";\n }\n \n body[").concat(es,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},el=function(){var e=parseInt(document.body.getAttribute(es)||"0",10);return isFinite(e)?e:0},ec=function(){d.useEffect(function(){return document.body.setAttribute(es,(el()+1).toString()),function(){var e=el()-1;e<=0?document.body.removeAttribute(es):document.body.setAttribute(es,e.toString())}},[])},eh=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,n=void 0===i?"margin":i;ec();var a=d.useMemo(function(){return en(n)},[n]);return d.createElement(ea,{styles:eo(a,!t,n,r?"":"!important")})},eu=!1;if("u">typeof window)try{var ed=Object.defineProperty({},"passive",{get:function(){return eu=!0,!0}});window.addEventListener("test",ed,ed),window.removeEventListener("test",ed,ed)}catch(e){eu=!1}var ep=!!eu&&{passive:!1},ef=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},eg=function(e,t){var r=t.ownerDocument,i=t;do{if("u">typeof ShadowRoot&&i instanceof ShadowRoot&&(i=i.host),em(e,i)){var n=eA(e,i);if(n[1]>n[2])return!0}i=i.parentNode}while(i&&i!==r.body);return!1},em=function(e,t){return"v"===e?ef(t,"overflowY"):ef(t,"overflowX")},eA=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eb=function(e,t,r,i,n){var a,s=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),o=s*i,l=r.target,c=t.contains(l),h=!1,u=o>0,d=0,p=0;do{if(!l)break;var f=eA(e,l),g=f[0],m=f[1]-f[2]-s*g;(g||m)&&em(e,l)&&(d+=m,p+=g);var A=l.parentNode;l=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return u&&(n&&1>Math.abs(d)||!n&&o>d)?h=!0:!u&&(n&&1>Math.abs(p)||!n&&-o>p)&&(h=!0),h},ev=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ey=function(e){return[e.deltaX,e.deltaY]},ex=function(e){return e&&"current"in e?e.current:e},eS=0,eE=[];let ew=(c=function(e){var t=d.useRef([]),r=d.useRef([0,0]),i=d.useRef(),n=d.useState(eS++)[0],a=d.useState(ee)[0],s=d.useRef(e);d.useEffect(function(){s.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(n));var t=(function(e,t,r){if(r||2==arguments.length)for(var i,n=0,a=t.length;n<a;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(ex),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(n))})}}},[e.inert,e.lockRef.current,e.shards]);var o=d.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,a=ev(e),o=r.current,l="deltaX"in e?e.deltaX:o[0]-a[0],c="deltaY"in e?e.deltaY:o[1]-a[1],h=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===h.type)return!1;var d=window.getSelection(),p=d&&d.anchorNode;if(p&&(p===h||p.contains(h)))return!1;var f=eg(u,h);if(!f)return!0;if(f?n=u:(n="v"===u?"h":"v",f=eg(u,h)),!f)return!1;if(!i.current&&"changedTouches"in e&&(l||c)&&(i.current=n),!n)return!0;var g=i.current||n;return eb(g,t,e,"h"===g?l:c,!0)},[]),l=d.useCallback(function(e){if(eE.length&&eE[eE.length-1]===a){var r="deltaY"in e?ey(e):ev(e),i=t.current.filter(function(t){var i;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(i=t.delta,i[0]===r[0]&&i[1]===r[1])})[0];if(i&&i.should){e.cancelable&&e.preventDefault();return}if(!i){var n=(s.current.shards||[]).map(ex).filter(Boolean).filter(function(t){return t.contains(e.target)});(n.length>0?o(e,n[0]):!s.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=d.useCallback(function(e,r,i,n){var a={name:e,delta:r,target:i,should:n,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(i)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),h=d.useCallback(function(e){r.current=ev(e),i.current=void 0},[]),u=d.useCallback(function(t){c(t.type,ey(t),t.target,o(t,e.lockRef.current))},[]),p=d.useCallback(function(t){c(t.type,ev(t),t.target,o(t,e.lockRef.current))},[]);d.useEffect(function(){return eE.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ep),document.addEventListener("touchmove",l,ep),document.addEventListener("touchstart",h,ep),function(){eE=eE.filter(function(e){return e!==a}),document.removeEventListener("wheel",l,ep),document.removeEventListener("touchmove",l,ep),document.removeEventListener("touchstart",h,ep)}},[]);var f=e.removeScrollBar,g=e.inert;return d.createElement(d.Fragment,null,g?d.createElement(a,{styles:"\n .block-interactivity-".concat(n," {pointer-events: none;}\n .allow-interactivity-").concat(n," {pointer-events: all;}\n")}):null,f?d.createElement(eh,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},X.useMedium(c),$);var e_=d.forwardRef(function(e,t){return d.createElement(K,z({},e,{ref:t,sideCar:ew}))});e_.classNames=K.classNames;var eC=new WeakMap,eM=new WeakMap,eI={},eT=0,eR=function(e){return e&&(e.host||eR(e.parentNode))},eB=function(e,t,r,i){var n=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=eR(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});eI[r]||(eI[r]=new WeakMap);var a=eI[r],s=[],o=new Set,l=new Set(n),c=function(e){!e||o.has(e)||(o.add(e),c(e.parentNode))};n.forEach(c);var h=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(o.has(e))h(e);else try{var t=e.getAttribute(i),n=null!==t&&"false"!==t,l=(eC.get(e)||0)+1,c=(a.get(e)||0)+1;eC.set(e,l),a.set(e,c),s.push(e),1===l&&n&&eM.set(e,!0),1===c&&e.setAttribute(r,"true"),n||e.setAttribute(i,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return h(t),o.clear(),eT++,function(){s.forEach(function(e){var t=eC.get(e)-1,n=a.get(e)-1;eC.set(e,t),a.set(e,n),t||(eM.has(e)||e.removeAttribute(i),eM.delete(e)),n||e.removeAttribute(r)}),--eT||(eC=new WeakMap,eC=new WeakMap,eM=new WeakMap,eI={})}},ek=function(e,t,r){void 0===r&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),n=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return n?(i.push.apply(i,Array.from(n.querySelectorAll("[aria-live], script"))),eB(i,n,r,"aria-hidden")):function(){return null}},eP=r(2849),eD="Dialog",[eL,eF]=(0,g.A)(eD),[eN,eU]=eL(eD),eO=e=>{let{__scopeDialog:t,children:r,open:i,defaultOpen:n,onOpenChange:a,modal:s=!0}=e,o=d.useRef(null),l=d.useRef(null),[c,h]=(0,A.i)({prop:i,defaultProp:n??!1,onChange:a,caller:eD});return(0,y.jsx)(eN,{scope:t,triggerRef:o,contentRef:l,contentId:(0,m.B)(),titleId:(0,m.B)(),descriptionId:(0,m.B)(),open:c,onOpenChange:h,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),modal:s,children:r})};eO.displayName=eD;var eQ="DialogTrigger";d.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,n=eU(eQ,r),a=(0,f.s)(t,n.triggerRef);return(0,y.jsx)(b.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":e5(n.open),...i,ref:a,onClick:(0,p.mK)(e.onClick,n.onOpenToggle)})}).displayName=eQ;var ez="DialogPortal",[eH,eG]=eL(ez,{forceMount:void 0}),eV=e=>{let{__scopeDialog:t,forceMount:r,children:i,container:n}=e,a=eU(ez,t);return(0,y.jsx)(eH,{scope:t,forceMount:r,children:d.Children.map(i,e=>(0,y.jsx)(U.C,{present:r||a.open,children:(0,y.jsx)(N,{asChild:!0,container:n,children:e})}))})};eV.displayName=ez;var ej="DialogOverlay",eq=d.forwardRef((e,t)=>{let r=eG(ej,e.__scopeDialog),{forceMount:i=r.forceMount,...n}=e,a=eU(ej,e.__scopeDialog);return a.modal?(0,y.jsx)(U.C,{present:i||a.open,children:(0,y.jsx)(eX,{...n,ref:t})}):null});eq.displayName=ej;var eW=(0,eP.TL)("DialogOverlay.RemoveScroll"),eX=d.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,n=eU(ej,r);return(0,y.jsx)(e_,{as:eW,allowPinchZoom:!0,shards:[n.contentRef],children:(0,y.jsx)(b.sG.div,{"data-state":e5(n.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),eY="DialogContent",eK=d.forwardRef((e,t)=>{let r=eG(eY,e.__scopeDialog),{forceMount:i=r.forceMount,...n}=e,a=eU(eY,e.__scopeDialog);return(0,y.jsx)(U.C,{present:i||a.open,children:a.modal?(0,y.jsx)(e$,{...n,ref:t}):(0,y.jsx)(eJ,{...n,ref:t})})});eK.displayName=eY;var e$=d.forwardRef((e,t)=>{let r=eU(eY,e.__scopeDialog),i=d.useRef(null),n=(0,f.s)(t,r.contentRef,i);return d.useEffect(()=>{let e=i.current;if(e)return ek(e)},[]),(0,y.jsx)(eZ,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,p.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,p.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,p.mK)(e.onFocusOutside,e=>e.preventDefault())})}),eJ=d.forwardRef((e,t)=>{let r=eU(eY,e.__scopeDialog),i=d.useRef(!1),n=d.useRef(!1);return(0,y.jsx)(eZ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let a=t.target;r.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),eZ=d.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:n,onCloseAutoFocus:a,...s}=e,o=eU(eY,r),l=d.useRef(null),c=(0,f.s)(t,l);return d.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Q()),document.body.insertAdjacentElement("beforeend",e[1]??Q()),O++,()=>{1===O&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),O--}},[]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(T,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:n,onUnmountAutoFocus:a,children:(0,y.jsx)(E,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":e5(o.open),...s,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(e6,{titleId:o.titleId}),(0,y.jsx)(e7,{contentRef:l,descriptionId:o.descriptionId})]})]})}),e0="DialogTitle";d.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,n=eU(e0,r);return(0,y.jsx)(b.sG.h2,{id:n.titleId,...i,ref:t})}).displayName=e0;var e1="DialogDescription";d.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,n=eU(e1,r);return(0,y.jsx)(b.sG.p,{id:n.descriptionId,...i,ref:t})}).displayName=e1;var e2="DialogClose",e3=d.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,n=eU(e2,r);return(0,y.jsx)(b.sG.button,{type:"button",...i,ref:t,onClick:(0,p.mK)(e.onClick,()=>n.onOpenChange(!1))})});function e5(e){return e?"open":"closed"}e3.displayName=e2;var e4="DialogTitleWarning",[e8,e9]=(0,g.q)(e4,{contentName:eY,titleName:e0,docsSlug:"dialog"}),e6=({titleId:e})=>{let t=e9(e4),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
949
+
950
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
951
+
952
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},e7=({contentRef:e,descriptionId:t})=>{let r=e9("DialogDescriptionWarning"),i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return d.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},te=eO,tt=eV,tr=eq,ti=eK,tn=e3},4798(e,t,r){"use strict";r.d(t,{B:()=>l});var i,n=r(9081),a=r(6026),s=(i||(i=r.t(n,2)))[" useId ".trim().toString()]||(()=>void 0),o=0;function l(e){let[t,r]=n.useState(s());return(0,a.N)(()=>{e||r(e=>e??String(o++))},[e]),e||(t?`radix-${t}`:"")}},4525(e,t,r){"use strict";r.d(t,{b:()=>o});var i=r(9081),n=r(4253),a=r(8525),s=i.forwardRef((e,t)=>(0,a.jsx)(n.sG.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));s.displayName="Label";var o=s},7537(e,t,r){"use strict";r.d(t,{C:()=>s});var i=r(9081),n=r(3577),a=r(6026),s=e=>{var t;let r,s,{present:l,children:c}=e,h=function(e){var t,r;let[n,s]=i.useState(),l=i.useRef(null),c=i.useRef(e),h=i.useRef("none"),[u,d]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},i.useReducer((e,t)=>r[e][t]??e,t));return i.useEffect(()=>{let e=o(l.current);h.current="mounted"===u?e:"none"},[u]),(0,a.N)(()=>{let t=l.current,r=c.current;if(r!==e){let i=h.current,n=o(t);e?d("MOUNT"):"none"===n||t?.display==="none"?d("UNMOUNT"):r&&i!==n?d("ANIMATION_OUT"):d("UNMOUNT"),c.current=e}},[e,d]),(0,a.N)(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let i=o(l.current).includes(CSS.escape(r.animationName));if(r.target===n&&i&&(d("ANIMATION_END"),!c.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},i=e=>{e.target===n&&(h.current=o(l.current))};return n.addEventListener("animationstart",i),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",i),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}d("ANIMATION_END")},[n,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:i.useCallback(e=>{l.current=e?getComputedStyle(e):null,s(e)},[])}}(l),u="function"==typeof c?c({present:h.isPresent}):i.Children.only(c),d=(0,n.s)(h.ref,(t=u,(s=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(s=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof c||h.isPresent?i.cloneElement(u,{ref:d}):null};function o(e){return e?.animationName||"none"}s.displayName="Presence"},4253(e,t,r){"use strict";r.d(t,{hO:()=>l,sG:()=>o});var i=r(9081),n=r(8092),a=r(2849),s=r(8525),o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,a.TL)(`Primitive.${t}`),n=i.forwardRef((e,i)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(n?r:t,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function l(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}},6448(e,t,r){"use strict";r.d(t,{C1:()=>ei,bL:()=>et,q7:()=>er});var i=r(9081),n=r(6478),a=r(3577),s=r(7463),o=r(4253),l=r(2849),c=r(8525),h=r(4798),u=r(2274),d=r(8794),p=i.createContext(void 0);function f(e){let t=i.useContext(p);return e||t||"ltr"}var g="rovingFocusGroup.onEntryFocus",m={bubbles:!1,cancelable:!0},A="RovingFocusGroup",[b,v,y]=function(e){let t=e+"CollectionProvider",[r,n]=(0,s.A)(t),[o,h]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:t,children:r}=e,n=i.useRef(null),a=i.useRef(new Map).current;return(0,c.jsx)(o,{scope:t,itemMap:a,collectionRef:n,children:r})};u.displayName=t;let d=e+"CollectionSlot",p=(0,l.TL)(d),f=i.forwardRef((e,t)=>{let{scope:r,children:i}=e,n=h(d,r),s=(0,a.s)(t,n.collectionRef);return(0,c.jsx)(p,{ref:s,children:i})});f.displayName=d;let g=e+"CollectionItemSlot",m="data-radix-collection-item",A=(0,l.TL)(g),b=i.forwardRef((e,t)=>{let{scope:r,children:n,...s}=e,o=i.useRef(null),l=(0,a.s)(t,o),u=h(g,r);return i.useEffect(()=>(u.itemMap.set(o,{ref:o,...s}),()=>void u.itemMap.delete(o))),(0,c.jsx)(A,{...{[m]:""},ref:l,children:n})});return b.displayName=g,[{Provider:u,Slot:f,ItemSlot:b},function(t){let r=h(e+"CollectionConsumer",t);return i.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}(A),[x,S]=(0,s.A)(A,[y]),[E,w]=x(A),_=i.forwardRef((e,t)=>(0,c.jsx)(b.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,c.jsx)(b.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,c.jsx)(C,{...e,ref:t})})}));_.displayName=A;var C=i.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:s,loop:l=!1,dir:h,currentTabStopId:p,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:y,onEntryFocus:x,preventScrollOnEntryFocus:S=!1,...w}=e,_=i.useRef(null),C=(0,a.s)(t,_),M=f(h),[I,T]=(0,d.i)({prop:p,defaultProp:b??null,onChange:y,caller:A}),[B,k]=i.useState(!1),P=(0,u.c)(x),D=v(r),L=i.useRef(!1),[F,N]=i.useState(0);return i.useEffect(()=>{let e=_.current;if(e)return e.addEventListener(g,P),()=>e.removeEventListener(g,P)},[P]),(0,c.jsx)(E,{scope:r,orientation:s,dir:M,loop:l,currentTabStopId:I,onItemFocus:i.useCallback(e=>T(e),[T]),onItemShiftTab:i.useCallback(()=>k(!0),[]),onFocusableItemAdd:i.useCallback(()=>N(e=>e+1),[]),onFocusableItemRemove:i.useCallback(()=>N(e=>e-1),[]),children:(0,c.jsx)(o.sG.div,{tabIndex:B||0===F?-1:0,"data-orientation":s,...w,ref:C,style:{outline:"none",...e.style},onMouseDown:(0,n.mK)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,n.mK)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!B){let t=new CustomEvent(g,m);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);R([e.find(e=>e.active),e.find(e=>e.id===I),...e].filter(Boolean).map(e=>e.ref.current),S)}}L.current=!1}),onBlur:(0,n.mK)(e.onBlur,()=>k(!1))})})}),M="RovingFocusGroupItem",I=i.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:a=!0,active:s=!1,tabStopId:l,children:u,...d}=e,p=(0,h.B)(),f=l||p,g=w(M,r),m=g.currentTabStopId===f,A=v(r),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:S}=g;return i.useEffect(()=>{if(a)return y(),()=>x()},[a,y,x]),(0,c.jsx)(b.ItemSlot,{scope:r,id:f,focusable:a,active:s,children:(0,c.jsx)(o.sG.span,{tabIndex:m?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:(0,n.mK)(e.onMouseDown,e=>{a?g.onItemFocus(f):e.preventDefault()}),onFocus:(0,n.mK)(e.onFocus,()=>g.onItemFocus(f)),onKeyDown:(0,n.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void g.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var i;let n=(i=e.key,"rtl"!==r?i:"ArrowLeft"===i?"ArrowRight":"ArrowRight"===i?"ArrowLeft":i);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return T[n]}(e,g.orientation,g.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=A().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){var r,i;"prev"===t&&n.reverse();let a=n.indexOf(e.currentTarget);n=g.loop?(r=n,i=a+1,r.map((e,t)=>r[(i+t)%r.length])):n.slice(a+1)}setTimeout(()=>R(n))}}),children:"function"==typeof u?u({isCurrentTabStop:m,hasTabStop:null!=S}):u})})});I.displayName=M;var T={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e,t=!1){let r=document.activeElement;for(let i of e)if(i===r||(i.focus({preventScroll:t}),document.activeElement!==r))return}var B=r(6026),k=r(7537),P="Radio",[D,L]=(0,s.A)(P),[F,N]=D(P),U=i.forwardRef((e,t)=>{let{__scopeRadio:r,name:s,checked:l=!1,required:h,disabled:u,value:d="on",onCheck:p,form:f,...g}=e,[m,A]=i.useState(null),b=(0,a.s)(t,e=>A(e)),v=i.useRef(!1),y=!m||f||!!m.closest("form");return(0,c.jsxs)(F,{scope:r,checked:l,disabled:u,children:[(0,c.jsx)(o.sG.button,{type:"button",role:"radio","aria-checked":l,"data-state":H(l),"data-disabled":u?"":void 0,disabled:u,value:d,...g,ref:b,onClick:(0,n.mK)(e.onClick,e=>{l||p?.(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&(0,c.jsx)(z,{control:m,bubbles:!v.current,name:s,value:d,checked:l,required:h,disabled:u,form:f,style:{transform:"translateX(-100%)"}})]})});U.displayName=P;var O="RadioIndicator",Q=i.forwardRef((e,t)=>{let{__scopeRadio:r,forceMount:i,...n}=e,a=N(O,r);return(0,c.jsx)(k.C,{present:i||a.checked,children:(0,c.jsx)(o.sG.span,{"data-state":H(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})})});Q.displayName=O;var z=i.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:n=!0,...s},l)=>{let h,u=i.useRef(null),d=(0,a.s)(u,l),p=(h=i.useRef({value:r,previous:r}),i.useMemo(()=>(h.current.value!==r&&(h.current.previous=h.current.value,h.current.value=r),h.current.previous),[r])),f=function(e){let[t,r]=i.useState(void 0);return(0,B.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let i,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,n=t.blockSize}else i=e.offsetWidth,n=e.offsetHeight;r({width:i,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return i.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(p!==r&&t){let i=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(i)}},[p,r,n]),(0,c.jsx)(o.sG.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:d,style:{...s.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function H(e){return e?"checked":"unchecked"}z.displayName="RadioBubbleInput";var G=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],V="RadioGroup",[j,q]=(0,s.A)(V,[S,L]),W=S(),X=L(),[Y,K]=j(V),$=i.forwardRef((e,t)=>{let{__scopeRadioGroup:r,name:i,defaultValue:n,value:a,required:s=!1,disabled:l=!1,orientation:h,dir:u,loop:p=!0,onValueChange:g,...m}=e,A=W(r),b=f(u),[v,y]=(0,d.i)({prop:a,defaultProp:n??null,onChange:g,caller:V});return(0,c.jsx)(Y,{scope:r,name:i,required:s,disabled:l,value:v,onValueChange:y,children:(0,c.jsx)(_,{asChild:!0,...A,orientation:h,dir:b,loop:p,children:(0,c.jsx)(o.sG.div,{role:"radiogroup","aria-required":s,"aria-orientation":h,"data-disabled":l?"":void 0,dir:b,...m,ref:t})})})});$.displayName=V;var J="RadioGroupItem",Z=i.forwardRef((e,t)=>{let{__scopeRadioGroup:r,disabled:s,...o}=e,l=K(J,r),h=l.disabled||s,u=W(r),d=X(r),p=i.useRef(null),f=(0,a.s)(t,p),g=l.value===o.value,m=i.useRef(!1);return i.useEffect(()=>{let e=e=>{G.includes(e.key)&&(m.current=!0)},t=()=>m.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,c.jsx)(I,{asChild:!0,...u,focusable:!h,active:g,children:(0,c.jsx)(U,{disabled:h,required:l.required,checked:g,...d,...o,name:l.name,ref:f,onCheck:()=>l.onValueChange(o.value),onKeyDown:(0,n.mK)(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:(0,n.mK)(o.onFocus,()=>{m.current&&p.current?.click()})})})});Z.displayName=J;var ee=i.forwardRef((e,t)=>{let{__scopeRadioGroup:r,...i}=e,n=X(r);return(0,c.jsx)(Q,{...n,...i,ref:t})});ee.displayName="RadioGroupIndicator";var et=$,er=Z,ei=ee},2849(e,t,r){"use strict";r.d(t,{TL:()=>s});var i=r(9081),n=r(3577),a=r(8525);function s(e){var t;let r,s=(t=e,(r=i.forwardRef((e,t)=>{let{children:r,...a}=e;if(i.isValidElement(r)){var s;let e,o,l=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),c=function(e,t){let r={...t};for(let i in t){let n=e[i],a=t[i];/^on[A-Z]/.test(i)?n&&a?r[i]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[i]=n):"style"===i?r[i]={...n,...a}:"className"===i&&(r[i]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==i.Fragment&&(c.ref=t?(0,n.t)(t,l):l),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null})).displayName=`${t}.SlotClone`,r),o=i.forwardRef((e,t)=>{let{children:r,...n}=e,o=i.Children.toArray(r),c=o.find(l);if(c){let e=c.props.children,r=o.map(t=>t!==c?t:i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null);return(0,a.jsx)(s,{...n,ref:t,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return(0,a.jsx)(s,{...n,ref:t,children:r})});return o.displayName=`${e}.Slot`,o}var o=Symbol("radix.slottable");function l(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===o}},6218(e,t,r){"use strict";let i,n,a;r.d(t,{DX:()=>p});var s,o=r(9081),l=r(3577),c=r(8525),h=Symbol.for("react.lazy"),u=(s||(s=r.t(o,2)))[" use ".trim().toString()];function d(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===h&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var p=((a=o.forwardRef((e,t)=>{let{children:r,...i}=e;if(d(r)&&"function"==typeof u&&(r=u(r._payload)),o.isValidElement(r)){var n;let e,a,s=(n=r,(a=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.ref:(a=(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.props.ref:n.props.ref||n.ref),c=function(e,t){let r={...t};for(let i in t){let n=e[i],a=t[i];/^on[A-Z]/.test(i)?n&&a?r[i]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[i]=n):"style"===i?r[i]={...n,...a}:"className"===i&&(r[i]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}(i,r.props);return r.type!==o.Fragment&&(c.ref=t?(0,l.t)(t,s):s),o.cloneElement(r,c)}return o.Children.count(r)>1?o.Children.only(null):null})).displayName="Slot.SlotClone",i=a,(n=o.forwardRef((e,t)=>{let{children:r,...n}=e;d(r)&&"function"==typeof u&&(r=u(r._payload));let a=o.Children.toArray(r),s=a.find(g);if(s){let e=s.props.children,r=a.map(t=>t!==s?t:o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null);return(0,c.jsx)(i,{...n,ref:t,children:o.isValidElement(e)?o.cloneElement(e,void 0,r):null})}return(0,c.jsx)(i,{...n,ref:t,children:r})})).displayName="Slot.Slot",n),f=Symbol("radix.slottable");function g(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}},2274(e,t,r){"use strict";r.d(t,{c:()=>n});var i=r(9081);function n(e){let t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...e)=>t.current?.(...e),[])}},8794(e,t,r){"use strict";r.d(t,{i:()=>o});var i,n=r(9081),a=r(6026),s=(i||(i=r.t(n,2)))[" useInsertionEffect ".trim().toString()]||a.N;function o({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){let[a,o,l]=function({defaultProp:e,onChange:t}){let[r,i]=n.useState(e),a=n.useRef(r),o=n.useRef(t);return s(()=>{o.current=t},[t]),n.useEffect(()=>{a.current!==r&&(o.current?.(r),a.current=r)},[r,a]),[r,i,o]}({defaultProp:t,onChange:r}),c=void 0!==e,h=c?e:a;{let t=n.useRef(void 0!==e);n.useEffect(()=>{let e=t.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=c},[c,i])}return[h,n.useCallback(t=>{if(c){let r="function"==typeof t?t(e):t;r!==e&&l.current?.(r)}else o(t)},[c,e,o,l])]}Symbol("RADIX:SYNC_STATE")},6026(e,t,r){"use strict";r.d(t,{N:()=>n});var i=r(9081),n=globalThis?.document?i.useLayoutEffect:()=>{}},8228(e,t,r){"use strict";r.d(t,{m:()=>a});var i=r(1230),n=r(6198),a=new class extends i.Q{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!n.S$&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}}},1367(e,t,r){"use strict";let i,n,a,s,o,l;r.d(t,{jG:()=>h});var c=r(8877).Zq,h=(i=[],n=0,a=e=>{e()},s=e=>{e()},o=c,{batch:e=>{let t;n++;try{t=e()}finally{let e;--n||(e=i,i=[],e.length&&o(()=>{s(()=>{e.forEach(e=>{a(e)})})}))}return t},batchCalls:e=>(...t)=>{l(()=>{e(...t)})},schedule:l=e=>{n?i.push(e):o(()=>{a(e)})},setNotifyFunction:e=>{a=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{o=e}})},8749(e,t,r){"use strict";r.d(t,{t:()=>a});var i=r(1230),n=r(6198),a=new class extends i.Q{#i=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!n.S$&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#i!==e&&(this.#i=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#i}}},1531(e,t,r){"use strict";r.d(t,{X:()=>o,k:()=>l});var i=r(6198),n=r(1367),a=r(3678),s=r(8782),o=class extends s.k{#n;#a;#s;#o;#l;#c;#h;constructor(e){super(),this.#h=!1,this.#c=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#s=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#n=h(this.options),this.state=e.state??this.#n,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){if(this.options={...this.#c,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=h(this.options);void 0!==e.data&&(this.setState(c(e.data,e.dataUpdatedAt)),this.#n=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#s.remove(this)}setData(e,t){let r=(0,i.pl)(this.state.data,e,this.options);return this.#u({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#u({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(i.lQ).catch(i.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#n)}isActive(){return this.observers.some(e=>!1!==(0,i.Eh)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===i.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,i.d2)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,i.j3)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#l&&(this.#h?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#u({type:"invalidate"})}async fetch(e,t){let r;if("idle"!==this.state.fetchStatus&&this.#l?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},o=()=>{let e,r=(0,i.ZM)(this.options,t),n=(s(e={client:this.#o,queryKey:this.queryKey,meta:this.meta}),e);return(this.#h=!1,this.options.persister)?this.options.persister(r,n,this):r(n)},l=(s(r={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o}),r);this.options.behavior?.onFetch(l,this),this.#a=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#u({type:"fetch",meta:l.fetchOptions?.meta}),this.#l=(0,a.II)({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:e=>{e instanceof a.cc&&e.revert&&this.setState({...this.#a,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#u({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#u({type:"pause"})},onContinue:()=>{this.#u({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{let e=await this.#l.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#s.config.onSuccess?.(e,this),this.#s.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof a.cc){if(e.silent)return this.#l.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#u({type:"error",error:e}),this.#s.config.onError?.(e,this),this.#s.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#u(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...l(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...c(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#a=e.manual?r:void 0,r;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),n.jG.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function l(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,a.v_)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function c(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function h(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},4046(e,t,r){"use strict";r.d(t,{E:()=>A});var i=r(6198),n=r(1531),a=r(1367),s=r(1230),o=class extends s.Q{constructor(e={}){super(),this.config=e,this.#d=new Map}#d;build(e,t,r){let a=t.queryKey,s=t.queryHash??(0,i.F$)(a,t),o=this.get(s);return o||(o=new n.X({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(o)),o}add(e){this.#d.has(e.queryHash)||(this.#d.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#d.get(e.queryHash);t&&(e.destroy(),t===e&&this.#d.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){a.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#d.get(e)}getAll(){return[...this.#d.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,i.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,i.MK)(e,t)):t}notify(e){a.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){a.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){a.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},l=r(8782),c=r(3678),h=class extends l.k{#o;#p;#f;#l;constructor(e){super(),this.#o=e.client,this.mutationId=e.mutationId,this.#f=e.mutationCache,this.#p=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#p.includes(e)||(this.#p.push(e),this.clearGcTimeout(),this.#f.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#p=this.#p.filter(t=>t!==e),this.scheduleGc(),this.#f.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#p.length||("pending"===this.state.status?this.scheduleGc():this.#f.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#u({type:"continue"})},r={client:this.#o,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=(0,c.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#u({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#u({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#f.canRun(this)});let i="pending"===this.state.status,n=!this.#l.canStart();try{if(i)t();else{this.#u({type:"pending",variables:e,isPaused:n}),await this.#f.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#u({type:"pending",context:t,variables:e,isPaused:n})}let a=await this.#l.start();return await this.#f.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#f.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#u({type:"success",data:a}),a}catch(t){try{throw await this.#f.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#f.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#u({type:"error",error:t})}}finally{this.#f.runNext(this)}}#u(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),a.jG.batch(()=>{this.#p.forEach(t=>{t.onMutationUpdate(e)}),this.#f.notify({mutation:this,type:"updated",action:e})})}},u=class extends s.Q{constructor(e={}){super(),this.config=e,this.#g=new Set,this.#m=new Map,this.#A=0}#g;#m;#A;build(e,t,r){let i=new h({client:e,mutationCache:this,mutationId:++this.#A,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){this.#g.add(e);let t=d(e);if("string"==typeof t){let r=this.#m.get(t);r?r.push(e):this.#m.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#g.delete(e)){let t=d(e);if("string"==typeof t){let r=this.#m.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#m.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let r=this.#m.get(t),i=r?.find(e=>"pending"===e.state.status);return!i||i===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#m.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){a.jG.batch(()=>{this.#g.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#g.clear(),this.#m.clear()})}getAll(){return Array.from(this.#g)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,i.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,i.nJ)(e,t))}notify(e){a.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return a.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(i.lQ))))}};function d(e){return e.options.scope?.id}var p=r(8228),f=r(8749);function g(e){return{onFetch:(t,r)=>{let n=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},c=0,h=async()=>{let r=!1,h=(0,i.ZM)(t.options,t.fetchOptions),u=async(e,n,a)=>{let s;if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);let o=(Object.defineProperty(s={client:t.client,queryKey:t.queryKey,pageParam:n,direction:a?"backward":"forward",meta:t.options.meta},"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),s),l=await h(o),{maxPages:c}=t.options,u=a?i.ZZ:i.y9;return{pages:u(e.pages,l,c),pageParams:u(e.pageParams,n,c)}};if(a&&s.length){let e="backward"===a,t={pages:s,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:m)(n,t);l=await u(t,r,e)}else{let t=e??s.length;do{let e=0===c?o[0]??n.initialPageParam:m(n,l);if(c>0&&null==e)break;l=await u(l,e),c++}while(c<t)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=h}}}function m(e,{pages:t,pageParams:r}){let i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}var A=class{#b;#f;#c;#v;#y;#x;#S;#E;constructor(e={}){this.#b=e.queryCache||new o,this.#f=e.mutationCache||new u,this.#c=e.defaultOptions||{},this.#v=new Map,this.#y=new Map,this.#x=0}mount(){this.#x++,1===this.#x&&(this.#S=p.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#b.onFocus())}),this.#E=f.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#b.onOnline())}))}unmount(){this.#x--,0===this.#x&&(this.#S?.(),this.#S=void 0,this.#E?.(),this.#E=void 0)}isFetching(e){return this.#b.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#f.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#b.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#b.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,i.d2)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#b.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),a=this.#b.get(n.queryHash),s=a?.state.data,o=(0,i.Zw)(t,s);if(void 0!==o)return this.#b.build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return a.jG.batch(()=>this.#b.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#b.get(t.queryHash)?.state}removeQueries(e){let t=this.#b;a.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#b;return a.jG.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(a.jG.batch(()=>this.#b.findAll(e).map(e=>e.cancel(r)))).then(i.lQ).catch(i.lQ)}invalidateQueries(e,t={}){return a.jG.batch(()=>(this.#b.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(a.jG.batch(()=>this.#b.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(i.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(i.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#b.build(this,t);return r.isStaleByTime((0,i.d2)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i.lQ).catch(i.lQ)}fetchInfiniteQuery(e){return e.behavior=g(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i.lQ).catch(i.lQ)}ensureInfiniteQueryData(e){return e.behavior=g(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.t.isOnline()?this.#f.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#b}getMutationCache(){return this.#f}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#v.set((0,i.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#v.values()],r={};return t.forEach(t=>{(0,i.Cp)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#y.set((0,i.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#y.values()],r={};return t.forEach(t=>{(0,i.Cp)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,i.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===i.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#b.clear(),this.#f.clear()}}},8782(e,t,r){"use strict";r.d(t,{k:()=>a});var i=r(8877),n=r(6198),a=class{#w;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.gn)(this.gcTime)&&(this.#w=i.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.S$?1/0:3e5))}clearGcTimeout(){this.#w&&(i.zs.clearTimeout(this.#w),this.#w=void 0)}}},3678(e,t,r){"use strict";r.d(t,{II:()=>h,cc:()=>c,v_:()=>l});var i=r(8228),n=r(8749),a=r(9216),s=r(6198);function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||n.t.isOnline()}var c=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function h(e){let t,r=!1,h=0,u=(0,a.T)(),d=()=>i.m.isFocused()&&("always"===e.networkMode||n.t.isOnline())&&e.canRun(),p=()=>l(e.networkMode)&&e.canRun(),f=e=>{"pending"===u.status&&(t?.(),u.resolve(e))},g=e=>{"pending"===u.status&&(t?.(),u.reject(e))},m=()=>new Promise(r=>{t=e=>{("pending"!==u.status||d())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===u.status&&e.onContinue?.()}),A=()=>{let t;if("pending"!==u.status)return;let i=0===h?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(f).catch(t=>{if("pending"!==u.status)return;let i=e.retry??3*!s.S$,n=e.retryDelay??o,a="function"==typeof n?n(h,t):n,l=!0===i||"number"==typeof i&&h<i||"function"==typeof i&&i(h,t);r||!l?g(t):(h++,e.onFail?.(h,t),(0,s.yy)(a).then(()=>d()?void 0:m()).then(()=>{r?g(t):A()}))})};return{promise:u,status:()=>u.status,cancel:t=>{if("pending"===u.status){let r=new c(t);g(r),e.onCancel?.(r)}},continue:()=>(t?.(),u),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:p,start:()=>(p()?A():m().then(A),u)}}},1230(e,t,r){"use strict";r.d(t,{Q:()=>i});var i=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},9216(e,t,r){"use strict";function i(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}r.d(t,{T:()=>i})},8877(e,t,r){"use strict";r.d(t,{Zq:()=>a,zs:()=>n});var i={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},n=new class{#_=i;#C=!1;setTimeoutProvider(e){this.#_=e}setTimeout(e,t){return this.#_.setTimeout(e,t)}clearTimeout(e){this.#_.clearTimeout(e)}setInterval(e,t){return this.#_.setInterval(e,t)}clearInterval(e){this.#_.clearInterval(e)}};function a(e){setTimeout(e,0)}},6198(e,t,r){"use strict";r.d(t,{Cp:()=>g,EN:()=>f,Eh:()=>h,F$:()=>p,GU:()=>M,MK:()=>u,S$:()=>n,ZM:()=>C,ZZ:()=>w,Zw:()=>s,d2:()=>c,f8:()=>A,gn:()=>o,hT:()=>_,j3:()=>l,lQ:()=>a,nJ:()=>d,pl:()=>S,y9:()=>E,yy:()=>x});var i=r(8877),n="u"<typeof window||"Deno"in globalThis;function a(){}function s(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){return"function"==typeof e?e(t):e}function u(e,t){let{type:r="all",exact:i,fetchStatus:n,predicate:a,queryKey:s,stale:o}=e;if(s){if(i){if(t.queryHash!==p(s,t.options))return!1}else if(!g(t.queryKey,s))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!n||n===t.state.fetchStatus)&&(!a||!!a(t))}function d(e,t){let{exact:r,status:i,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(f(t.options.mutationKey)!==f(a))return!1}else if(!g(t.options.mutationKey,a))return!1}return(!i||t.state.status===i)&&(!n||!!n(t))}function p(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>g(e[r],t[r]))}var m=Object.prototype.hasOwnProperty;function A(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!y(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){return new Promise(t=>{i.zs.setTimeout(t,e)})}function S(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let i=b(t)&&b(r);if(!i&&!(v(t)&&v(r)))return r;let n=(i?t:Object.keys(t)).length,a=i?r:Object.keys(r),s=a.length,o=i?Array(s):{},l=0;for(let c=0;c<s;c++){let s=i?c:a[c],h=t[s],u=r[s];if(h===u){o[s]=h,(i?c<n:m.call(t,s))&&l++;continue}if(null===h||null===u||"object"!=typeof h||"object"!=typeof u){o[s]=u;continue}let d=e(h,u);o[s]=d,d===h&&l++}return n===s&&l===n?t:o}(e,t):t}function E(e,t,r=0){let i=[...e,t];return r&&i.length>r?i.slice(1):i}function w(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var _=Symbol();function C(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==_?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function M(e,t){return"function"==typeof e?e(...t):!!e}},6514(e,t,r){"use strict";r.d(t,{Ht:()=>o,jE:()=>s});var i=r(9081),n=r(8525),a=i.createContext(void 0),s=e=>{let t=i.useContext(a);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},o=({client:e,children:t})=>(i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,n.jsx)(a.Provider,{value:e,children:t}))},7350(e,t,r){"use strict";let i;r.d(t,{I:()=>x});var n=r(8228),a=r(1367),s=r(1531),o=r(1230),l=r(9216),c=r(6198),h=r(8877),u=class extends o.Q{constructor(e,t){super(),this.options=t,this.#o=e,this.#M=null,this.#I=(0,l.T)(),this.bindMethods(),this.setOptions(t)}#o;#T=void 0;#R=void 0;#B=void 0;#k;#P;#I;#M;#D;#L;#F;#N;#U;#O;#Q=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#T.addObserver(this),d(this.#T,this.options)?this.#z():this.updateResult(),this.#H())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return p(this.#T,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return p(this.#T,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#G(),this.#V(),this.#T.removeObserver(this)}setOptions(e){let t=this.options,r=this.#T;if(this.options=this.#o.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,c.Eh)(this.options.enabled,this.#T))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#T.setOptions(this.options),t._defaulted&&!(0,c.f8)(this.options,t)&&this.#o.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#T,observer:this});let i=this.hasListeners();i&&f(this.#T,r,this.options,t)&&this.#z(),this.updateResult(),i&&(this.#T!==r||(0,c.Eh)(this.options.enabled,this.#T)!==(0,c.Eh)(t.enabled,this.#T)||(0,c.d2)(this.options.staleTime,this.#T)!==(0,c.d2)(t.staleTime,this.#T))&&this.#q();let n=this.#W();i&&(this.#T!==r||(0,c.Eh)(this.options.enabled,this.#T)!==(0,c.Eh)(t.enabled,this.#T)||n!==this.#O)&&this.#X(n)}getOptimisticResult(e){var t,r;let i=this.#o.getQueryCache().build(this.#o,e),n=this.createResult(i,e);return t=this,r=n,(0,c.f8)(t.getCurrentResult(),r)||(this.#B=n,this.#P=this.options,this.#k=this.#T.state),n}getCurrentResult(){return this.#B}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#I.status||this.#I.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#Q.add(e)}getCurrentQuery(){return this.#T}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#o.defaultQueryOptions(e),r=this.#o.getQueryCache().build(this.#o,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#z({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#B))}#z(e){this.#j();let t=this.#T.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c.lQ)),t}#q(){this.#G();let e=(0,c.d2)(this.options.staleTime,this.#T);if(c.S$||this.#B.isStale||!(0,c.gn)(e))return;let t=(0,c.j3)(this.#B.dataUpdatedAt,e);this.#N=h.zs.setTimeout(()=>{this.#B.isStale||this.updateResult()},t+1)}#W(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#T):this.options.refetchInterval)??!1}#X(e){this.#V(),this.#O=e,!c.S$&&!1!==(0,c.Eh)(this.options.enabled,this.#T)&&(0,c.gn)(this.#O)&&0!==this.#O&&(this.#U=h.zs.setInterval(()=>{(this.options.refetchIntervalInBackground||n.m.isFocused())&&this.#z()},this.#O))}#H(){this.#q(),this.#X(this.#W())}#G(){this.#N&&(h.zs.clearTimeout(this.#N),this.#N=void 0)}#V(){this.#U&&(h.zs.clearInterval(this.#U),this.#U=void 0)}createResult(e,t){let r,i=this.#T,n=this.options,a=this.#B,o=this.#k,h=this.#P,u=e!==i?e.state:this.#R,{state:p}=e,m={...p},A=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&d(e,t),o=r&&f(e,i,t,n);(a||o)&&(m={...m,...(0,s.k)(p.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:y}=m;r=m.data;let x=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===y){let e;a?.isPlaceholderData&&t.placeholderData===h?.placeholderData?(e=a.data,x=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#F?.state.data,this.#F):t.placeholderData,void 0!==e&&(y="success",r=(0,c.pl)(a?.data,e,t),A=!0)}if(t.select&&void 0!==r&&!x)if(a&&r===o?.data&&t.select===this.#D)r=this.#L;else try{this.#D=t.select,r=t.select(r),r=(0,c.pl)(a?.data,r,t),this.#L=r,this.#M=null}catch(e){this.#M=e}this.#M&&(b=this.#M,r=this.#L,v=Date.now(),y="error");let S="fetching"===m.fetchStatus,E="pending"===y,w="error"===y,_=E&&S,C=void 0!==r,M={status:y,fetchStatus:m.fetchStatus,isPending:E,isSuccess:"success"===y,isError:w,isInitialLoading:_,isLoading:_,data:r,dataUpdatedAt:m.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>u.dataUpdateCount||m.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!E,isLoadingError:w&&!C,isPaused:"paused"===m.fetchStatus,isPlaceholderData:A,isRefetchError:w&&C,isStale:g(e,t),refetch:this.refetch,promise:this.#I,isEnabled:!1!==(0,c.Eh)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===M.status?e.reject(M.error):void 0!==M.data&&e.resolve(M.data)},r=()=>{t(this.#I=M.promise=(0,l.T)())},n=this.#I;switch(n.status){case"pending":e.queryHash===i.queryHash&&t(n);break;case"fulfilled":("error"===M.status||M.data!==n.value)&&r();break;case"rejected":("error"!==M.status||M.error!==n.reason)&&r()}}return M}updateResult(){let e=this.#B,t=this.createResult(this.#T,this.options);if(this.#k=this.#T.state,this.#P=this.options,void 0!==this.#k.data&&(this.#F=this.#T),(0,c.f8)(t,e))return;this.#B=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#Q.size)return!0;let i=new Set(r??this.#Q);return this.options.throwOnError&&i.add("error"),Object.keys(this.#B).some(t=>this.#B[t]!==e[t]&&i.has(t))};this.#Y({listeners:r()})}#j(){let e=this.#o.getQueryCache().build(this.#o,this.options);if(e===this.#T)return;let t=this.#T;this.#T=e,this.#R=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#H()}#Y(e){a.jG.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#B)}),this.#o.getQueryCache().notify({query:this.#T,type:"observerResultsUpdated"})})}};function d(e,t){return!1!==(0,c.Eh)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&p(e,t,t.refetchOnMount)}function p(e,t,r){if(!1!==(0,c.Eh)(t.enabled,e)&&"static"!==(0,c.d2)(t.staleTime,e)){let i="function"==typeof r?r(e):r;return"always"===i||!1!==i&&g(e,t)}return!1}function f(e,t,r,i){return(e!==t||!1===(0,c.Eh)(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&g(e,r)}function g(e,t){return!1!==(0,c.Eh)(t.enabled,e)&&e.isStaleByTime((0,c.d2)(t.staleTime,e))}var m=r(9081),A=r(6514);r(8525);var b=m.createContext((i=!1,{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i})),v=m.createContext(!1);v.Provider;var y=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function x(e,t){return function(e,t,r){let i=m.useContext(v),n=m.useContext(b),s=(0,A.jE)(r),o=s.defaultQueryOptions(e);if(s.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=i?"isRestoring":"optimistic",o.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=o.staleTime;o.staleTime="function"==typeof t?(...r)=>e(t(...r)):e(t),"number"==typeof o.gcTime&&(o.gcTime=Math.max(o.gcTime,1e3))}(o.suspense||o.throwOnError||o.experimental_prefetchInRender)&&!n.isReset()&&(o.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let l=!s.getQueryCache().get(o.queryHash),[h]=m.useState(()=>new t(s,o)),u=h.getOptimisticResult(o),d=!i&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=d?h.subscribe(a.jG.batchCalls(e)):c.lQ;return h.updateResult(),t},[h,d]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),m.useEffect(()=>{h.setOptions(o)},[o,h]),o?.suspense&&u.isPending)throw y(o,h,n);if((({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(n&&void 0===e.data||(0,c.GU)(r,[e.error,i])))({result:u,errorResetBoundary:n,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if(s.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!c.S$&&u.isLoading&&u.isFetching&&!i){let e=l?y(o,h,n):s.getQueryCache().get(o.queryHash)?.promise;e?.catch(c.lQ).finally(()=>{h.updateResult()})}return o.notifyOnChangeProps?u:h.trackResult(u)}(e,u,t)}},7284(e,t,r){"use strict";r.d(t,{$t:()=>f,F0:()=>u});let{Axios:i,AxiosError:n,CanceledError:a,isCancel:s,CancelToken:o,VERSION:l,all:c,Cancel:h,isAxiosError:u,spread:d,toFormData:p,AxiosHeaders:f,HttpStatusCode:g,formToJSON:m,getAdapter:A,mergeConfig:b}=r(5436).A},5436(e,t,r){"use strict";let i,n,a,s;r.d(t,{A:()=>ts});var o,l,c,h,u={};function d(e,t){return function(){return e.apply(t,arguments)}}r.r(u),r.d(u,{hasBrowserEnv:()=>eg,hasStandardBrowserEnv:()=>eA,hasStandardBrowserWebWorkerEnv:()=>eb,navigator:()=>em,origin:()=>ev});let{toString:p}=Object.prototype,{getPrototypeOf:f}=Object,{iterator:g,toStringTag:m}=Symbol,A=(i=Object.create(null),e=>{let t=p.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())}),b=e=>(e=e.toLowerCase(),t=>A(t)===e),v=e=>t=>typeof t===e,{isArray:y}=Array,x=v("undefined");function S(e){return null!==e&&!x(e)&&null!==e.constructor&&!x(e.constructor)&&_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let E=b("ArrayBuffer"),w=v("string"),_=v("function"),C=v("number"),M=e=>null!==e&&"object"==typeof e,I=e=>{if("object"!==A(e))return!1;let t=f(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(m in e)&&!(g in e)},T=b("Date"),R=b("File"),B=b("Blob"),k=b("FileList"),P=b("URLSearchParams"),[D,L,F,N]=["ReadableStream","Request","Response","Headers"].map(b);function U(e,t,{allOwnKeys:r=!1}={}){let i,n;if(null!=e)if("object"!=typeof e&&(e=[e]),y(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{let n;if(S(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),s=a.length;for(i=0;i<s;i++)n=a[i],t.call(null,e[n],n,e)}}function O(e,t){let r;if(S(e))return null;t=t.toLowerCase();let i=Object.keys(e),n=i.length;for(;n-- >0;)if(t===(r=i[n]).toLowerCase())return r;return null}let Q="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,z=e=>!x(e)&&e!==Q,H=(n="u">typeof Uint8Array&&f(Uint8Array),e=>n&&e instanceof n),G=b("HTMLFormElement"),V=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),j=b("RegExp"),q=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};U(r,(r,n)=>{let a;!1!==(a=t(r,n,e))&&(i[n]=a||r)}),Object.defineProperties(e,i)},W=b("AsyncFunction"),X=(o="function"==typeof setImmediate,l=_(Q.postMessage),o?setImmediate:l?(c=`axios@${Math.random()}`,h=[],Q.addEventListener("message",({source:e,data:t})=>{e===Q&&t===c&&h.length&&h.shift()()},!1),e=>{h.push(e),Q.postMessage(c,"*")}):e=>setTimeout(e)),Y="u">typeof queueMicrotask?queueMicrotask.bind(Q):"u">typeof process&&process.nextTick||X,K={isArray:y,isArrayBuffer:E,isBuffer:S,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||_(e.append)&&("formdata"===(t=A(e))||"object"===t&&_(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&E(e.buffer)},isString:w,isNumber:C,isBoolean:e=>!0===e||!1===e,isObject:M,isPlainObject:I,isEmptyObject:e=>{if(!M(e)||S(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:D,isRequest:L,isResponse:F,isHeaders:N,isUndefined:x,isDate:T,isFile:R,isBlob:B,isRegExp:j,isFunction:_,isStream:e=>M(e)&&_(e.pipe),isURLSearchParams:P,isTypedArray:H,isFileList:k,forEach:U,merge:function e(){let{caseless:t,skipUndefined:r}=z(this)&&this||{},i={},n=(n,a)=>{let s=t&&O(i,a)||a;I(i[s])&&I(n)?i[s]=e(i[s],n):I(n)?i[s]=e({},n):y(n)?i[s]=n.slice():r&&x(n)||(i[s]=n)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&U(arguments[e],n);return i},extend:(e,t,r,{allOwnKeys:i}={})=>(U(t,(t,i)=>{r&&_(t)?e[i]=d(t,r):e[i]=t},{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,i)=>{let n,a,s,o={};if(t=t||{},null==e)return t;do{for(a=(n=Object.getOwnPropertyNames(e)).length;a-- >0;)s=n[a],(!i||i(s,e,t))&&!o[s]&&(t[s]=e[s],o[s]=!0);e=!1!==r&&f(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:A,kindOfTest:b,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return -1!==i&&i===r},toArray:e=>{if(!e)return null;if(y(e))return e;let t=e.length;if(!C(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r,i=(e&&e[g]).call(e);for(;(r=i.next())&&!r.done;){let i=r.value;t.call(e,i[0],i[1])}},matchAll:(e,t)=>{let r,i=[];for(;null!==(r=e.exec(t));)i.push(r);return i},isHTMLForm:G,hasOwnProperty:V,hasOwnProp:V,reduceDescriptors:q,freezeMethods:e=>{q(e,(t,r)=>{if(_(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;if(_(e[r])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{let r={};return(y(e)?e:String(e).split(t)).forEach(e=>{r[e]=!0}),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:O,global:Q,isContextDefined:z,isSpecCompliantForm:function(e){return!!(e&&_(e.append)&&"FormData"===e[m]&&e[g])},toJSONObject:e=>{let t=Array(10),r=(e,i)=>{if(M(e)){if(t.indexOf(e)>=0)return;if(S(e))return e;if(!("toJSON"in e)){t[i]=e;let n=y(e)?[]:{};return U(e,(e,t)=>{let a=r(e,i+1);x(a)||(n[t]=a)}),t[i]=void 0,n}}return e};return r(e,0)},isAsyncFn:W,isThenable:e=>e&&(M(e)||_(e))&&_(e.then)&&_(e.catch),setImmediate:X,asap:Y,isIterable:e=>null!=e&&_(e[g])};function $(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}K.inherits($,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}});let J=$.prototype,Z={};function ee(e){return K.isPlainObject(e)||K.isArray(e)}function et(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function er(e,t,r){return e?e.concat(t).map(function(e,t){return e=et(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Z[e]={value:e}}),Object.defineProperties($,Z),Object.defineProperty(J,"isAxiosError",{value:!0}),$.from=(e,t,r,i,n,a)=>{let s=Object.create(J);K.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);let o=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return $.call(s,o,l,r,i,n),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",a&&Object.assign(s,a),s};let ei=K.toFlatObject(K,{},null,function(e){return/^is[A-Z]/.test(e)}),en=function(e,t,r){if(!K.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let i=(r=K.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!K.isUndefined(t[e])})).metaTokens,n=r.visitor||c,a=r.dots,s=r.indexes,o=(r.Blob||"u">typeof Blob&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(n))throw TypeError("visitor must be a function");function l(e){if(null===e)return"";if(K.isDate(e))return e.toISOString();if(K.isBoolean(e))return e.toString();if(!o&&K.isBlob(e))throw new $("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(e)||K.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,n){let o=e;if(e&&!n&&"object"==typeof e)if(K.endsWith(r,"{}"))r=i?r:r.slice(0,-2),e=JSON.stringify(e);else{var c;if(K.isArray(e)&&(c=e,K.isArray(c)&&!c.some(ee))||(K.isFileList(e)||K.endsWith(r,"[]"))&&(o=K.toArray(e)))return r=et(r),o.forEach(function(e,i){K.isUndefined(e)||null===e||t.append(!0===s?er([r],i,a):null===s?r:r+"[]",l(e))}),!1}return!!ee(e)||(t.append(er(n,r,a),l(e)),!1)}let h=[],u=Object.assign(ei,{defaultVisitor:c,convertValue:l,isVisitable:ee});if(!K.isObject(e))throw TypeError("data must be an object");return!function e(r,i){if(!K.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+i.join("."));h.push(r),K.forEach(r,function(r,a){!0===(!(K.isUndefined(r)||null===r)&&n.call(t,r,K.isString(a)?a.trim():a,i,u))&&e(r,i?i.concat(a):[a])}),h.pop()}}(e),t};function ea(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function es(e,t){this._pairs=[],e&&en(e,this,t)}let eo=es.prototype;function el(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ec(e,t,r){let i;if(!t)return e;let n=r&&r.encode||el;K.isFunction(r)&&(r={serialize:r});let a=r&&r.serialize;if(i=a?a(t,r):K.isURLSearchParams(t)?t.toString():new es(t,r).toString(n)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}eo.append=function(e,t){this._pairs.push([e,t])},eo.toString=function(e){let t=e?function(t){return e.call(this,t,ea)}:ea;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let eh=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,function(t){null!==t&&e(t)})}},eu={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ed="u">typeof URLSearchParams?URLSearchParams:es,ep="u">typeof FormData?FormData:null,ef="u">typeof Blob?Blob:null,eg="u">typeof window&&"u">typeof document,em="object"==typeof navigator&&navigator||void 0,eA=eg&&(!em||0>["ReactNative","NativeScript","NS"].indexOf(em.product)),eb="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ev=eg&&window.location.href||"http://localhost",ey={...u,isBrowser:!0,classes:{URLSearchParams:ed,FormData:ep,Blob:ef},protocols:["http","https","file","blob","url","data"]},ex=function(e){if(K.isFormData(e)&&K.isFunction(e.entries)){let t={};return K.forEachEntry(e,(e,r)=>{!function e(t,r,i,n){let a=t[n++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),o=n>=t.length;return(a=!a&&K.isArray(i)?i.length:a,o)?K.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r:(i[a]&&K.isObject(i[a])||(i[a]=[]),e(t,r,i[a],n)&&K.isArray(i[a])&&(i[a]=function(e){let t,r,i={},n=Object.keys(e),a=n.length;for(t=0;t<a;t++)i[r=n[t]]=e[r];return i}(i[a]))),!s}(K.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),r,t,0)}),t}return null},eS={transitional:eu,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r,i=t.getContentType()||"",n=i.indexOf("application/json")>-1,a=K.isObject(e);if(a&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return n?JSON.stringify(ex(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)||K.isReadableStream(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1){var s,o;return(s=e,o=this.formSerializer,en(s,new ey.classes.URLSearchParams,{visitor:function(e,t,r,i){return ey.isNode&&K.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...o})).toString()}if((r=K.isFileList(e))||i.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return en(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(a||n){t.setContentType("application/json",!1);var l=e;if(K.isString(l))try{return(0,JSON.parse)(l),K.trim(l)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(l)}return e}],transformResponse:[function(e){let t=this.transitional||eS.transitional,r=t&&t.forcedJSONParsing,i="json"===this.responseType;if(K.isResponse(e)||K.isReadableStream(e))return e;if(e&&K.isString(e)&&(r&&!this.responseType||i)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e,this.parseReviver)}catch(e){if(!r&&i){if("SyntaxError"===e.name)throw $.from(e,$.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ey.classes.FormData,Blob:ey.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],e=>{eS.headers[e]={}});let eE=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ew=Symbol("internals");function e_(e){return e&&String(e).trim().toLowerCase()}function eC(e){return!1===e||null==e?e:K.isArray(e)?e.map(eC):String(e)}function eM(e,t,r,i,n){if(K.isFunction(i))return i.call(this,t,r);if(n&&(t=r),K.isString(t)){if(K.isString(i))return -1!==t.indexOf(i);if(K.isRegExp(i))return i.test(t)}}class eI{constructor(e){e&&this.set(e)}set(e,t,r){let i=this;function n(e,t,r){let n=e_(t);if(!n)throw Error("header name must be a non-empty string");let a=K.findKey(i,n);a&&void 0!==i[a]&&!0!==r&&(void 0!==r||!1===i[a])||(i[a||t]=eC(e))}let a=(e,t)=>K.forEach(e,(e,r)=>n(e,r,t));if(K.isPlainObject(e)||e instanceof this.constructor)a(e,t);else{let i;if(K.isString(e)&&(e=e.trim())&&(i=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim()))){var s;let r,i,n,o;a((o={},(s=e)&&s.split("\n").forEach(function(e){n=e.indexOf(":"),r=e.substring(0,n).trim().toLowerCase(),i=e.substring(n+1).trim(),!r||o[r]&&eE[r]||("set-cookie"===r?o[r]?o[r].push(i):o[r]=[i]:o[r]=o[r]?o[r]+", "+i:i)}),o),t)}else if(K.isObject(e)&&K.isIterable(e)){let r={},i,n;for(let t of e){if(!K.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[n=t[0]]=(i=r[n])?K.isArray(i)?[...i,t[1]]:[i,t[1]]:t[1]}a(r,t)}else null!=e&&n(t,e,r)}return this}get(e,t){if(e=e_(e)){let r=K.findKey(this,e);if(r){let e=this[r];if(!t)return e;if(!0===t){let t,r=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=i.exec(e);)r[t[1]]=t[2];return r}if(K.isFunction(t))return t.call(this,e,r);if(K.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=e_(e)){let r=K.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||eM(this,this[r],r,t)))}return!1}delete(e,t){let r=this,i=!1;function n(e){if(e=e_(e)){let n=K.findKey(r,e);n&&(!t||eM(r,r[n],n,t))&&(delete r[n],i=!0)}}return K.isArray(e)?e.forEach(n):n(e),i}clear(e){let t=Object.keys(this),r=t.length,i=!1;for(;r--;){let n=t[r];(!e||eM(this,this[n],n,e,!0))&&(delete this[n],i=!0)}return i}normalize(e){let t=this,r={};return K.forEach(this,(i,n)=>{let a=K.findKey(r,n);if(a){t[a]=eC(i),delete t[n];return}let s=e?n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r):String(n).trim();s!==n&&delete t[n],t[s]=eC(i),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return K.forEach(this,(r,i)=>{null!=r&&!1!==r&&(t[i]=e&&K.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){let t=(this[ew]=this[ew]={accessors:{}}).accessors,r=this.prototype;function i(e){let i=e_(e);if(!t[i]){let n;n=K.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(r,t+n,{value:function(r,i,n){return this[t].call(this,e,r,i,n)},configurable:!0})}),t[i]=!0}}return K.isArray(e)?e.forEach(i):i(e),this}}function eT(e,t){let r=this||eS,i=t||r,n=eI.from(i.headers),a=i.data;return K.forEach(e,function(e){a=e.call(r,a,n.normalize(),t?t.status:void 0)}),n.normalize(),a}function eR(e){return!!(e&&e.__CANCEL__)}function eB(e,t,r){$.call(this,null==e?"canceled":e,$.ERR_CANCELED,t,r),this.name="CanceledError"}function ek(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new $("Request failed with status code "+r.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}eI.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(eI.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),K.freezeMethods(eI),K.inherits(eB,$,{__CANCEL__:!0});let eP=function(e,t){let r,i=Array(e=e||10),n=Array(e),a=0,s=0;return t=void 0!==t?t:1e3,function(o){let l=Date.now(),c=n[s];r||(r=l),i[a]=o,n[a]=l;let h=s,u=0;for(;h!==a;)u+=i[h++],h%=e;if((a=(a+1)%e)===s&&(s=(s+1)%e),l-r<t)return;let d=c&&l-c;return d?Math.round(1e3*u/d):void 0}},eD=function(e,t){let r,i,n=0,a=1e3/t,s=(t,a=Date.now())=>{n=a,r=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{let t=Date.now(),o=t-n;o>=a?s(e,t):(r=e,i||(i=setTimeout(()=>{i=null,s(r)},a-o)))},()=>r&&s(r)]},eL=(e,t,r=3)=>{let i=0,n=eP(50,250);return eD(r=>{let a=r.loaded,s=r.lengthComputable?r.total:void 0,o=a-i,l=n(o);i=a,e({loaded:a,total:s,progress:s?a/s:void 0,bytes:o,rate:l||void 0,estimated:l&&s&&a<=s?(s-a)/l:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})},r)},eF=(e,t)=>{let r=null!=e;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},eN=e=>(...t)=>K.asap(()=>e(...t)),eU=ey.hasStandardBrowserEnv?(a=new URL(ey.origin),s=ey.navigator&&/(msie|trident)/i.test(ey.navigator.userAgent),e=>(e=new URL(e,ey.origin),a.protocol===e.protocol&&a.host===e.host&&(s||a.port===e.port))):()=>!0,eO=ey.hasStandardBrowserEnv?{write(e,t,r,i,n,a,s){if("u"<typeof document)return;let o=[`${e}=${encodeURIComponent(t)}`];K.isNumber(r)&&o.push(`expires=${new Date(r).toUTCString()}`),K.isString(i)&&o.push(`path=${i}`),K.isString(n)&&o.push(`domain=${n}`),!0===a&&o.push("secure"),K.isString(s)&&o.push(`SameSite=${s}`),document.cookie=o.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.match(RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function eQ(e,t,r){let i=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(i||!1==r)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let ez=e=>e instanceof eI?{...e}:e;function eH(e,t){t=t||{};let r={};function i(e,t,r,i){return K.isPlainObject(e)&&K.isPlainObject(t)?K.merge.call({caseless:i},e,t):K.isPlainObject(t)?K.merge({},t):K.isArray(t)?t.slice():t}function n(e,t,r,n){return K.isUndefined(t)?K.isUndefined(e)?void 0:i(void 0,e,r,n):i(e,t,r,n)}function a(e,t){if(!K.isUndefined(t))return i(void 0,t)}function s(e,t){return K.isUndefined(t)?K.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function o(r,n,a){return a in t?i(r,n):a in e?i(void 0,r):void 0}let l={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:o,headers:(e,t,r)=>n(ez(e),ez(t),r,!0)};return K.forEach(Object.keys({...e,...t}),function(i){let a=l[i]||n,s=a(e[i],t[i],i);K.isUndefined(s)&&a!==o||(r[i]=s)}),r}let eG=e=>{let t=eH({},e),{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:a,headers:s,auth:o}=t;if(t.headers=s=eI.from(s),t.url=ec(eQ(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&s.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),K.isFormData(r)){if(ey.hasStandardBrowserEnv||ey.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(K.isFunction(r.getHeaders)){let e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&s.set(e,r)})}}if(ey.hasStandardBrowserEnv&&(i&&K.isFunction(i)&&(i=i(t)),i||!1!==i&&eU(t.url))){let e=n&&a&&eO.read(a);e&&s.set(n,e)}return t},eV="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){var i;let n,a,s,o,l,c,h=eG(e),u=h.data,d=eI.from(h.headers).normalize(),{responseType:p,onUploadProgress:f,onDownloadProgress:g}=h;function m(){o&&o(),l&&l(),h.cancelToken&&h.cancelToken.unsubscribe(n),h.signal&&h.signal.removeEventListener("abort",n)}let A=new XMLHttpRequest;function b(){if(!A)return;let i=eI.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders());ek(function(e){t(e),m()},function(e){r(e),m()},{data:p&&"text"!==p&&"json"!==p?A.response:A.responseText,status:A.status,statusText:A.statusText,headers:i,config:e,request:A}),A=null}A.open(h.method.toUpperCase(),h.url,!0),A.timeout=h.timeout,"onloadend"in A?A.onloadend=b:A.onreadystatechange=function(){!A||4!==A.readyState||(0!==A.status||A.responseURL&&0===A.responseURL.indexOf("file:"))&&setTimeout(b)},A.onabort=function(){A&&(r(new $("Request aborted",$.ECONNABORTED,e,A)),A=null)},A.onerror=function(t){let i=new $(t&&t.message?t.message:"Network Error",$.ERR_NETWORK,e,A);i.event=t||null,r(i),A=null},A.ontimeout=function(){let t=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",i=h.transitional||eu;h.timeoutErrorMessage&&(t=h.timeoutErrorMessage),r(new $(t,i.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,e,A)),A=null},void 0===u&&d.setContentType(null),"setRequestHeader"in A&&K.forEach(d.toJSON(),function(e,t){A.setRequestHeader(t,e)}),K.isUndefined(h.withCredentials)||(A.withCredentials=!!h.withCredentials),p&&"json"!==p&&(A.responseType=h.responseType),g&&([s,l]=eL(g,!0),A.addEventListener("progress",s)),f&&A.upload&&([a,o]=eL(f),A.upload.addEventListener("progress",a),A.upload.addEventListener("loadend",o)),(h.cancelToken||h.signal)&&(n=t=>{A&&(r(!t||t.type?new eB(null,e,A):t),A.abort(),A=null)},h.cancelToken&&h.cancelToken.subscribe(n),h.signal&&(h.signal.aborted?n():h.signal.addEventListener("abort",n)));let v=(i=h.url,(c=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i))&&c[1]||"");v&&-1===ey.protocols.indexOf(v)?r(new $("Unsupported protocol "+v+":",$.ERR_BAD_REQUEST,e)):A.send(u||null)})},ej=function*(e,t){let r,i=e.byteLength;if(!t||i<t)return void(yield e);let n=0;for(;n<i;)r=n+t,yield e.slice(n,r),n=r},eq=async function*(e,t){for await(let r of eW(e))yield*ej(r,t)},eW=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},eX=(e,t,r,i)=>{let n,a=eq(e,t),s=0,o=e=>{!n&&(n=!0,i&&i(e))};return new ReadableStream({async pull(e){try{let{done:t,value:i}=await a.next();if(t){o(),e.close();return}let n=i.byteLength;if(r){let e=s+=n;r(e)}e.enqueue(new Uint8Array(i))}catch(e){throw o(e),e}},cancel:e=>(o(e),a.return())},{highWaterMark:2})},{isFunction:eY}=K,eK=(({Request:e,Response:t})=>({Request:e,Response:t}))(K.global),{ReadableStream:e$,TextEncoder:eJ}=K.global,eZ=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},e0=e=>{let t,{fetch:r,Request:i,Response:n}=e=K.merge.call({skipUndefined:!0},eK,e),a=r?eY(r):"function"==typeof fetch,s=eY(i),o=eY(n);if(!a)return!1;let l=a&&eY(e$),c=a&&("function"==typeof eJ?(t=new eJ,e=>t.encode(e)):async e=>new Uint8Array(await new i(e).arrayBuffer())),h=s&&l&&eZ(()=>{let e=!1,t=new i(ey.origin,{body:new e$,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=o&&l&&eZ(()=>K.isReadableStream(new n("").body)),d={stream:u&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{d[e]||(d[e]=(t,r)=>{let i=t&&t[e];if(i)return i.call(t);throw new $(`Response type '${e}' is not supported`,$.ERR_NOT_SUPPORT,r)})});let p=async e=>{if(null==e)return 0;if(K.isBlob(e))return e.size;if(K.isSpecCompliantForm(e)){let t=new i(ey.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return K.isArrayBufferView(e)||K.isArrayBuffer(e)?e.byteLength:(K.isURLSearchParams(e)&&(e+=""),K.isString(e))?(await c(e)).byteLength:void 0},f=async(e,t)=>{let r=K.toFiniteNumber(e.getContentLength());return null==r?p(t):r};return async e=>{let t,{url:a,method:o,data:l,signal:c,cancelToken:p,timeout:g,onDownloadProgress:m,onUploadProgress:A,responseType:b,headers:v,withCredentials:y="same-origin",fetchOptions:x}=eG(e),S=r||fetch;b=b?(b+"").toLowerCase():"text";let E=((e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,i=new AbortController,n=function(e){if(!r){r=!0,s();let t=e instanceof Error?e:this.reason;i.abort(t instanceof $?t:new eB(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,n(new $(`timeout ${t} of ms exceeded`,$.ETIMEDOUT))},t),s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)}),e=null)};e.forEach(e=>e.addEventListener("abort",n));let{signal:o}=i;return o.unsubscribe=()=>K.asap(s),o}})([c,p&&p.toAbortSignal()],g),w=null,_=E&&E.unsubscribe&&(()=>{E.unsubscribe()});try{if(A&&h&&"get"!==o&&"head"!==o&&0!==(t=await f(v,l))){let e,r=new i(a,{method:"POST",body:l,duplex:"half"});if(K.isFormData(l)&&(e=r.headers.get("content-type"))&&v.setContentType(e),r.body){let[e,i]=eF(t,eL(eN(A)));l=eX(r.body,65536,e,i)}}K.isString(y)||(y=y?"include":"omit");let r=s&&"credentials"in i.prototype,c={...x,signal:E,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:l,duplex:"half",credentials:r?y:void 0};w=s&&new i(a,c);let p=await (s?S(w,x):S(a,c)),g=u&&("stream"===b||"response"===b);if(u&&(m||g&&_)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});let t=K.toFiniteNumber(p.headers.get("content-length")),[r,i]=m&&eF(t,eL(eN(m),!0))||[];p=new n(eX(p.body,65536,r,()=>{i&&i(),_&&_()}),e)}b=b||"text";let C=await d[K.findKey(d,b)||"text"](p,e);return!g&&_&&_(),await new Promise((t,r)=>{ek(t,r,{data:C,headers:eI.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:w})})}catch(t){if(_&&_(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new $("Network Error",$.ERR_NETWORK,e,w),{cause:t.cause||t});throw $.from(t,t&&t.code,e,w)}}},e1=new Map,e2=e=>{let t=e&&e.env||{},{fetch:r,Request:i,Response:n}=t,a=[i,n,r],s=a.length,o,l,c=e1;for(;s--;)o=a[s],void 0===(l=c.get(o))&&c.set(o,l=s?new Map:e0(t)),c=l;return l};e2();let e3={http:null,xhr:eV,fetch:{get:e2}};K.forEach(e3,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let e5=e=>`- ${e}`,e4=e=>K.isFunction(e)||null===e||!1===e,e8=function(e,t){let r,i,{length:n}=e=K.isArray(e)?e:[e],a={};for(let s=0;s<n;s++){let n;if(i=r=e[s],!e4(r)&&void 0===(i=e3[(n=String(r)).toLowerCase()]))throw new $(`Unknown adapter '${n}'`);if(i&&(K.isFunction(i)||(i=i.get(t))))break;a[n||"#"+s]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new $("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(e5).join("\n"):" "+e5(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function e9(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eB(null,e)}function e6(e){return e9(e),e.headers=eI.from(e.headers),e.data=eT.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),e8(e.adapter||eS.adapter,e)(e).then(function(t){return e9(e),t.data=eT.call(e,e.transformResponse,t),t.headers=eI.from(t.headers),t},function(t){return!eR(t)&&(e9(e),t&&t.response&&(t.response.data=eT.call(e,e.transformResponse,t.response),t.response.headers=eI.from(t.response.headers))),Promise.reject(t)})}let e7={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{e7[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let te={};e7.transitional=function(e,t,r){function i(e,t){return"[Axios v1.13.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,n,a)=>{if(!1===e)throw new $(i(n," has been removed"+(t?" in "+t:"")),$.ERR_DEPRECATED);return t&&!te[n]&&(te[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,a)}},e7.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};let tt=function(e,t,r){if("object"!=typeof e)throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);let i=Object.keys(e),n=i.length;for(;n-- >0;){let a=i[n],s=t[a];if(s){let t=e[a],r=void 0===t||s(t,a,e);if(!0!==r)throw new $("option "+a+" must be "+r,$.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new $("Unknown option "+a,$.ERR_BAD_OPTION)}};class tr{constructor(e){this.defaults=e||{},this.interceptors={request:new eh,response:new eh}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){let r,i;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:n,paramsSerializer:a,headers:s}=t=eH(this.defaults,t);void 0!==n&&tt(n,{silentJSONParsing:e7.transitional(e7.boolean),forcedJSONParsing:e7.transitional(e7.boolean),clarifyTimeoutError:e7.transitional(e7.boolean)},!1),null!=a&&(K.isFunction(a)?t.paramsSerializer={serialize:a}:tt(a,{encode:e7.function,serialize:e7.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),tt(t,{baseUrl:e7.spelling("baseURL"),withXsrfToken:e7.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&K.merge(s.common,s[t.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=eI.concat(o,s);let l=[],c=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(c=c&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let h=[];this.interceptors.response.forEach(function(e){h.push(e.fulfilled,e.rejected)});let u=0;if(!c){let e=[e6.bind(this),void 0];for(e.unshift(...l),e.push(...h),i=e.length,r=Promise.resolve(t);u<i;)r=r.then(e[u++],e[u++]);return r}i=l.length;let d=t;for(;u<i;){let e=l[u++],t=l[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{r=e6.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,i=h.length;u<i;)r=r.then(h[u++],h[u++]);return r}getUri(e){return ec(eQ((e=eH(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}K.forEach(["delete","get","head","options"],function(e){tr.prototype[e]=function(t,r){return this.request(eH(r||{},{method:e,url:t,data:(r||{}).data}))}}),K.forEach(["post","put","patch"],function(e){function t(t){return function(r,i,n){return this.request(eH(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}tr.prototype[e]=t(),tr.prototype[e+"Form"]=t(!0)});class ti{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t,i=new Promise(e=>{r.subscribe(e),t=e}).then(e);return i.cancel=function(){r.unsubscribe(t)},i},e(function(e,i,n){r.reason||(r.reason=new eB(e,i,n),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ti(function(t){e=t}),cancel:e}}}let tn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tn).forEach(([e,t])=>{tn[t]=e});let ta=function e(t){let r=new tr(t),i=d(tr.prototype.request,r);return K.extend(i,tr.prototype,r,{allOwnKeys:!0}),K.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(eH(t,r))},i}(eS);ta.Axios=tr,ta.CanceledError=eB,ta.CancelToken=ti,ta.isCancel=eR,ta.VERSION="1.13.2",ta.toFormData=en,ta.AxiosError=$,ta.Cancel=ta.CanceledError,ta.all=function(e){return Promise.all(e)},ta.spread=function(e){return function(t){return e.apply(null,t)}},ta.isAxiosError=function(e){return K.isObject(e)&&!0===e.isAxiosError},ta.mergeConfig=eH,ta.AxiosHeaders=eI,ta.formToJSON=e=>ex(K.isHTMLForm(e)?new FormData(e):e),ta.getAdapter=e8,ta.HttpStatusCode=tn,ta.default=ta;let ts=ta},5445(e,t,r){"use strict";r.d(t,{F:()=>s});var i=r(851);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=i.$,s=(e,t)=>r=>{var i;if((null==t?void 0:t.variants)==null)return a(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(e=>{let t=null==r?void 0:r[e],i=null==o?void 0:o[e];if(null===t)return null;let a=n(t)||n(i);return s[e][a]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,i]=t;return void 0===i||(e[r]=i),e},{});return a(e,l,null==t||null==(i=t.compoundVariants)?void 0:i.reduce((e,t)=>{let{class:r,className:i,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...c}[t]):({...o,...c})[t]===r})?[...e,r,i]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},851(e,t,r){"use strict";function i(){for(var e,t,r=0,i="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=function e(t){var r,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var a=t.length;for(r=0;r<a;r++)t[r]&&(i=e(t[r]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}(e))&&(i&&(i+=" "),i+=t);return i}r.d(t,{$:()=>i})},2608(e,t,r){"use strict";let i,n,a,s;r.d(t,{NNP:()=>tY,yLC:()=>tK});let o=(e,t)=>{if("number"==typeof e){if(3===t)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|240&e)/255,b:(15&e|e<<4&240)/255};if(4===t)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|240&e)/255,alpha:(15&e|e<<4&240)/255};if(6===t)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255};if(8===t)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(255&e)/255}}},l={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},c=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,h="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",u=`${h}%`,d=`(?:${h}%|${h})`,p=`(?:${h}%|${h}|none)`,f=`(?:${h}(deg|grad|rad|turn)|${h})`,g="\\s*,\\s*";RegExp("^"+p+"$");let m=RegExp(`^rgba?\\(\\s*${h}${g}${h}${g}${h}\\s*(?:,\\s*${d}\\s*)?\\)$`),A=RegExp(`^rgba?\\(\\s*${u}${g}${u}${g}${u}\\s*(?:,\\s*${d}\\s*)?\\)$`),b=(e="rgb")=>t=>{let r;return void 0!==(t=void 0===(r=t)?void 0:"object"!=typeof r?H(r):void 0!==r.mode?r:e?{...r,mode:e}:void 0)?t.mode===e?t:v[t.mode][e]?v[t.mode][e](t):"rgb"===e?v[t.mode].rgb(t):v.rgb[e](v[t.mode].rgb(t)):void 0},v={},y={},x=[],S={},E=e=>e,w=e=>(v[e.mode]={...v[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{v[t]||(v[t]={}),v[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(void 0===e.ranges[t]&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw Error(`Missing interpolator for: ${t}`);"function"==typeof e.interpolate[t]&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=E)}),y[e.mode]=e,(e.parse||[]).forEach(t=>{_(t,e.mode)}),b(e.mode)),_=(e,t)=>{if("string"==typeof e){if(!t)throw Error("'mode' required when 'parser' is a string");S[e]=t}else"function"==typeof e&&0>x.indexOf(e)&&x.push(e)},C=/[^\x00-\x7F]|[a-zA-Z_]/,M=/[^\x00-\x7F]|[-\w]/,I="function",T="ident",R="number",B="percentage",k="none",P="alpha",D=0;function L(e){let t=e[D],r=e[D+1];return"-"===t||"+"===t?/\d/.test(r)||"."===r&&/\d/.test(e[D+2]):"."===t?/\d/.test(r):/\d/.test(t)}function F(e){if(D>=e.length)return!1;let t=e[D];if(C.test(t))return!0;if("-"===t){if(e.length-D<2)return!1;let t=e[D+1];if("-"===t||C.test(t))return!0}return!1}let N={deg:1,rad:180/Math.PI,grad:.9,turn:360};function U(e){let t="";if(("-"===e[D]||"+"===e[D])&&(t+=e[D++]),t+=O(e),"."===e[D]&&/\d/.test(e[D+1])&&(t+=e[D++]+O(e)),("e"===e[D]||"E"===e[D])&&(("-"===e[D+1]||"+"===e[D+1])&&/\d/.test(e[D+2])?t+=e[D++]+e[D++]+O(e):/\d/.test(e[D+1])&&(t+=e[D++]+O(e))),F(e)){let r=Q(e);return"deg"===r||"rad"===r||"turn"===r||"grad"===r?{type:"hue",value:t*N[r]}:void 0}return"%"===e[D]?(D++,{type:B,value:+t}):{type:R,value:+t}}function O(e){let t="";for(;/\d/.test(e[D]);)t+=e[D++];return t}function Q(e){let t="";for(;D<e.length&&M.test(e[D]);)t+=e[D++];return t}function z(e,t){let r,i=[];for(;e._i<e.length;){if((r=e[e._i++]).type===k||r.type===R||r.type===P||r.type===B||t&&"hue"===r.type){i.push(r);continue}if(")"===r.type){if(e._i<e.length)return;continue}return}if(!(i.length<3)&&!(i.length>4)){if(4===i.length){if(i[3].type!==P)return;i[3]=i[3].value}return 3===i.length&&i.push({type:k,value:void 0}),i.every(e=>e.type!==P)?i:void 0}}let H=e=>{let t;if("string"!=typeof e)return;let r=function(e=""){let t,r=e.trim(),i=[];for(D=0;D<r.length;){if("\n"===(t=r[D++])||" "===t||" "===t){for(;D<r.length&&("\n"===r[D]||" "===r[D]||" "===r[D]);)D++;continue}if(","===t)return;if(")"===t){i.push({type:")"});continue}if("+"===t){if(D--,L(r)){i.push(U(r));continue}return}if("-"===t){if(D--,L(r)){i.push(U(r));continue}if(F(r)){i.push({type:T,value:Q(r)});continue}return}if("."===t){if(D--,L(r)){i.push(U(r));continue}return}if("/"===t){let e;for(;D<r.length&&("\n"===r[D]||" "===r[D]||" "===r[D]);)D++;if(L(r)&&"hue"!==(e=U(r)).type){i.push({type:P,value:e});continue}if(F(r)&&"none"===Q(r)){i.push({type:P,value:{type:k,value:void 0}});continue}return}if(/\d/.test(t)){D--,i.push(U(r));continue}if(C.test(t)){D--,i.push(function(e){let t=Q(e);return"("===e[D]?(D++,{type:I,value:t}):"none"===t?{type:k,value:void 0}:{type:T,value:t}}(r));continue}return}return i}(e),i=r?function(e,t){e._i=0;let r=e[e._i++];if(!r||r.type!==I)return;let i=z(e,t);if(i)return i.unshift(r.value),i}(r,!0):void 0,n=0,a=x.length;for(;n<a;)if(void 0!==(t=x[n++](e,i)))return t;return r?function(e){e._i=0;let t=e[e._i++];if(!t||t.type!==I||"color"!==t.value||(t=e[e._i++]).type!==T)return;let r=S[t.value];if(!r)return;let i={mode:r},n=z(e,!1);if(!n)return;let a=y[r].channels;for(let e=0,t,r;e<a.length;e++)t=n[e],r=a[e],t.type!==k&&(i[r]=t.type===R?t.value:t.value/100,"alpha"===r&&(i[r]=Math.max(0,Math.min(1,i[r]))));return i}(r):void 0},G=(i=(e,t,r)=>e+r*(t-e),e=>{let t=(e=>{let t=[];for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1];void 0===i&&void 0===n?t.push(void 0):void 0!==i&&void 0!==n?t.push([i,n]):t.push(void 0!==i?[i,i]:[n,n])}return t})(e);return e=>{let r=e*t.length,n=e>=1?t.length-1:Math.max(Math.floor(r),0),a=t[n];return void 0===a?void 0:i(a[0],a[1],r-n)}}),V=e=>{let t=!1,r=e.map(e=>void 0!==e?(t=!0,e):1);return t?r:e},j={mode:"rgb",channels:["r","g","b","alpha"],parse:[function(e,t){if(!t||"rgb"!==t[0]&&"rgba"!==t[0])return;let r={mode:"rgb"},[,i,n,a,s]=t;if("hue"!==i.type&&"hue"!==n.type&&"hue"!==a.type)return i.type!==k&&(r.r=i.type===R?i.value/255:i.value/100),n.type!==k&&(r.g=n.type===R?n.value/255:n.value/100),a.type!==k&&(r.b=a.type===R?a.value/255:a.value/100),s.type!==k&&(r.alpha=Math.min(1,Math.max(0,s.type===R?s.value:s.value/100))),r},e=>{let t;return(t=e.match(c))?o(parseInt(t[1],16),t[1].length):void 0},e=>{let t,r={mode:"rgb"};if(t=e.match(m))void 0!==t[1]&&(r.r=t[1]/255),void 0!==t[2]&&(r.g=t[2]/255),void 0!==t[3]&&(r.b=t[3]/255);else{if(!(t=e.match(A)))return;void 0!==t[1]&&(r.r=t[1]/100),void 0!==t[2]&&(r.g=t[2]/100),void 0!==t[3]&&(r.b=t[3]/100)}return void 0!==t[4]?r.alpha=Math.max(0,Math.min(1,t[4]/100)):void 0!==t[5]&&(r.alpha=Math.max(0,Math.min(1,+t[5]))),r},e=>o(l[e.toLowerCase()],6),e=>"transparent"===e?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,"srgb"],serialize:"srgb",interpolate:{r:G,g:G,b:G,alpha:{use:G,fixup:V}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},q=(e=0)=>Math.pow(Math.abs(e),563/256)*Math.sign(e),W=e=>{let t=q(e.r),r=q(e.g),i=q(e.b),n={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*r+.1882286462349947*i,y:.297344975250536*t+.6273635662554661*r+.0752914584939979*i,z:.0270313613864123*t+.0706888525358272*r+.9913375368376386*i};return void 0!==e.alpha&&(n.alpha=e.alpha),n},X=e=>Math.pow(Math.abs(e),256/563)*Math.sign(e),Y=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"a98",r:X(2.0415879038107465*e-.5650069742788597*t-.3447313507783297*r),g:X(-.9692436362808798*e+1.8759675015077206*t+.0415550574071756*r),b:X(.0134442806320312*e-.1183623922310184*t+1.0151749943912058*r)};return void 0!==i&&(n.alpha=i),n},K=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},$=({r:e,g:t,b:r,alpha:i})=>{let n={mode:"lrgb",r:K(e),g:K(t),b:K(r)};return void 0!==i&&(n.alpha=i),n},J=e=>{let{r:t,g:r,b:i,alpha:n}=$(e),a={mode:"xyz65",x:.4123907992659593*t+.357584339383878*r+.1804807884018343*i,y:.2126390058715102*t+.715168678767756*r+.0721923153607337*i,z:.0193308187155918*t+.119194779794626*r+.9505321522496607*i};return void 0!==n&&(a.alpha=n),a},Z=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,1/2.4)-.055):12.92*e},ee=({r:e,g:t,b:r,alpha:i},n="rgb")=>{let a={mode:n,r:Z(e),g:Z(t),b:Z(r)};return void 0!==i&&(a.alpha=i),a},et=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=ee({r:3.2409699419045226*e-1.537383177570094*t-.4986107602930034*r,g:-.9692436362808796*e+1.8759675015077204*t+.0415550574071756*r,b:.0556300796969936*e-.2039769588889765*t+1.0569715142428784*r});return void 0!==i&&(n.alpha=i),n},er={...j,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Y(J(e)),xyz65:Y},toMode:{rgb:e=>et(W(e)),xyz65:W}},ei=e=>(e%=360)<0?e+360:e,en=e=>{let t;return t=e=>180>=Math.abs(e)?e:e-360*Math.sign(e),e.map((r,i,n)=>{if(void 0===r)return r;let a=ei(r);return 0===i||void 0===e[i-1]?a:t(a-ei(n[i-1]))}).reduce((e,t)=>(e.length&&void 0!==t&&void 0!==e[e.length-1]?e.push(t+e[e.length-1]):e.push(t),e),[])},ea=[-.14861,1.78277,-.29227,-.90649,1.97294,0],es=Math.PI/180,eo=180/Math.PI,el=ea["3"]*ea["4"],ec=ea["1"]*ea["4"],eh=ea["1"]*ea["2"]-ea["0"]*ea["3"],eu=(e,t)=>{if(void 0===e.h||void 0===t.h||!e.s||!t.s)return 0;let r=ei(e.h),i=Math.sin((ei(t.h)-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*i},ed=(e,t)=>{if(void 0===e.h||void 0===t.h||!e.c||!t.c)return 0;let r=ei(e.h),i=Math.sin((ei(t.h)-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*i},ep=e=>{let t=e.reduce((e,t)=>{if(void 0!==t){let r=t*Math.PI/180;e.sin+=Math.sin(r),e.cos+=Math.cos(r)}return e},{sin:0,cos:0}),r=180*Math.atan2(t.sin,t.cos)/Math.PI;return r<0?360+r:r},ef={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:({r:e,g:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=(eh*r+e*el-t*ec)/(eh+el-ec),a=r-n,s=(ea["4"]*(t-n)-ea["2"]*a)/ea["3"],o={mode:"cubehelix",l:n,s:0===n||1===n?void 0:Math.sqrt(a*a+s*s)/(ea["4"]*n*(1-n))};return o.s&&(o.h=Math.atan2(s,a)*eo-120),void 0!==i&&(o.alpha=i),o}},toMode:{rgb:({h:e,s:t,l:r,alpha:i})=>{let n={mode:"rgb"};void 0===r&&(r=0);let a=void 0===t?0:t*r*(1-r),s=Math.cos(e=(void 0===e?0:e+120)*es),o=Math.sin(e);return n.r=r+a*(ea["0"]*s+ea["1"]*o),n.g=r+a*(ea["2"]*s+ea["3"]*o),n.b=r+a*(ea["4"]*s+ea["5"]*o),void 0!==i&&(n.alpha=i),n}},interpolate:{h:{use:G,fixup:en},s:G,l:G,alpha:{use:G,fixup:V}},difference:{h:eu},average:{h:ep}},eg=({l:e,a:t,b:r,alpha:i},n="lch")=>{void 0===t&&(t=0),void 0===r&&(r=0);let a=Math.sqrt(t*t+r*r),s={mode:n,l:e,c:a};return a&&(s.h=ei(180*Math.atan2(r,t)/Math.PI)),void 0!==i&&(s.alpha=i),s},em=({l:e,c:t,h:r,alpha:i},n="lab")=>{void 0===r&&(r=0);let a={mode:n,l:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return void 0!==i&&(a.alpha=i),a},eA={X:.3457/.3585,Y:1,Z:.8251046025104602},eb={X:.3127/.329,Y:1,Z:1.0890577507598784},ev=e=>Math.pow(e,3)>.008856451679035631?Math.pow(e,3):(116*e-16)/903.2962962962963,ey=({l:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=(e+16)/116,a=t/500+n,s=n-r/200,o={mode:"xyz65",x:ev(a)*eb.X,y:ev(n)*eb.Y,z:ev(s)*eb.Z};return void 0!==i&&(o.alpha=i),o},ex=e=>et(ey(e)),eS=e=>e>.008856451679035631?Math.cbrt(e):(903.2962962962963*e+16)/116,eE=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=eS(e/eb.X),a=eS(t/eb.Y),s={mode:"lab65",l:116*a-16,a:500*(n-a),b:200*(a-eS(r/eb.Z))};return void 0!==i&&(s.alpha=i),s},ew=e=>{let t=eE(J(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},e_=26/180*Math.PI,eC=Math.cos(e_),eM=Math.sin(e_),eI=100/Math.log(1.39),eT=({l:e,c:t,h:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"lab65",l:(Math.exp(e/eI)-1)/.0039},a=(Math.exp(.0435*t*1)-1)/.075,s=a*Math.cos(r/180*Math.PI-e_),o=a*Math.sin(r/180*Math.PI-e_);return n.a=s*eC-o/.83*eM,n.b=s*eM+o/.83*eC,void 0!==i&&(n.alpha=i),n},eR=({l:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=t*eC+r*eM,a=.83*(r*eC-t*eM),s={mode:"dlch",l:eI/1*Math.log(1+.0039*e),c:Math.log(1+.075*Math.sqrt(n*n+a*a))/.0435};return s.c&&(s.h=ei((Math.atan2(a,n)+e_)/Math.PI*180)),void 0!==i&&(s.alpha=i),s},eB=e=>eT(eg(e,"dlch")),ek=e=>em(eR(e),"dlab"),eP=RegExp(`^hsla?\\(\\s*${f}${g}${u}${g}${u}\\s*(?:,\\s*${d}\\s*)?\\)$`),eD={mode:"hsl",toMode:{rgb:function({h:e,s:t,l:r,alpha:i}){let n;e=ei(void 0!==e?e:0),void 0===t&&(t=0),void 0===r&&(r=0);let a=r+t*(r<.5?r:1-r),s=a-(a-r)*2*Math.abs(e/60%2-1);switch(Math.floor(e/60)){case 0:n={r:a,g:s,b:2*r-a};break;case 1:n={r:s,g:a,b:2*r-a};break;case 2:n={r:2*r-a,g:a,b:s};break;case 3:n={r:2*r-a,g:s,b:a};break;case 4:n={r:s,g:2*r-a,b:a};break;case 5:n={r:a,g:2*r-a,b:s};break;default:n={r:2*r-a,g:2*r-a,b:2*r-a}}return n.mode="rgb",void 0!==i&&(n.alpha=i),n}},fromMode:{rgb:function({r:e,g:t,b:r,alpha:i}){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.max(e,t,r),a=Math.min(e,t,r),s={mode:"hsl",s:n===a?0:(n-a)/(1-Math.abs(n+a-1)),l:.5*(n+a)};return n-a!=0&&(s.h=(n===e?(t-r)/(n-a)+(t<r)*6:n===t?(r-e)/(n-a)+2:(e-t)/(n-a)+4)*60),void 0!==i&&(s.alpha=i),s}},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[function(e,t){if(!t||"hsl"!==t[0]&&"hsla"!==t[0])return;let r={mode:"hsl"},[,i,n,a,s]=t;if(i.type!==k){if(i.type===B)return;r.h=i.value}if(n.type!==k){if("hue"===n.type)return;r.s=n.value/100}if(a.type!==k){if("hue"===a.type)return;r.l=a.value/100}return s.type!==k&&(r.alpha=Math.min(1,Math.max(0,s.type===R?s.value:s.value/100))),r},e=>{let t=e.match(eP);if(!t)return;let r={mode:"hsl"};return void 0!==t[3]?r.h=+t[3]:void 0!==t[1]&&void 0!==t[2]&&(r.h=((e,t)=>{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return 360*e}})(t[1],t[2])),void 0!==t[4]&&(r.s=Math.min(Math.max(0,t[4]/100),1)),void 0!==t[5]&&(r.l=Math.min(Math.max(0,t[5]/100),1)),void 0!==t[6]?r.alpha=Math.max(0,Math.min(1,t[6]/100)):void 0!==t[7]&&(r.alpha=Math.max(0,Math.min(1,+t[7]))),r}],serialize:e=>`hsl(${void 0!==e.h?e.h:"none"} ${void 0!==e.s?100*e.s+"%":"none"} ${void 0!==e.l?100*e.l+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:G,fixup:en},s:G,l:G,alpha:{use:G,fixup:V}},difference:{h:eu},average:{h:ep}};function eL({h:e,s:t,v:r,alpha:i}){let n;e=ei(void 0!==e?e:0),void 0===t&&(t=0),void 0===r&&(r=0);let a=Math.abs(e/60%2-1);switch(Math.floor(e/60)){case 0:n={r:r,g:r*(1-t*a),b:r*(1-t)};break;case 1:n={r:r*(1-t*a),g:r,b:r*(1-t)};break;case 2:n={r:r*(1-t),g:r,b:r*(1-t*a)};break;case 3:n={r:r*(1-t),g:r*(1-t*a),b:r};break;case 4:n={r:r*(1-t*a),g:r*(1-t),b:r};break;case 5:n={r:r,g:r*(1-t),b:r*(1-t*a)};break;default:n={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return n.mode="rgb",void 0!==i&&(n.alpha=i),n}function eF({r:e,g:t,b:r,alpha:i}){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.max(e,t,r),a=Math.min(e,t,r),s={mode:"hsv",s:0===n?0:1-a/n,v:n};return n-a!=0&&(s.h=(n===e?(t-r)/(n-a)+(t<r)*6:n===t?(r-e)/(n-a)+2:(e-t)/(n-a)+4)*60),void 0!==i&&(s.alpha=i),s}let eN={mode:"hsv",toMode:{rgb:eL},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:eF},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:G,fixup:en},s:G,v:G,alpha:{use:G,fixup:V}},difference:{h:eu},average:{h:ep}};function eU(e){if(e<0)return 0;let t=Math.pow(e,.012683313515655966);return 1e4*Math.pow(Math.max(0,t-.8359375)/(18.8515625-18.6875*t),6.277394636015326)}function eO(e){if(e<0)return 0;let t=Math.pow(e/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*t)/(1+18.6875*t),78.84375)}let eQ=e=>Math.max(e/203,0),ez=({i:e,t,p:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=eU(e+.008609037037932761*t+.11102962500302593*r),a=eU(e-.00860903703793275*t-.11102962500302599*r),s=eU(e+.5600313357106791*t-.32062717498731885*r),o={mode:"xyz65",x:eQ(2.070152218389422*n-1.3263473389671556*a+.2066510476294051*s),y:eQ(.3647385209748074*n+.680566024947227*a-.0453045459220346*s),z:eQ(-.049747207535812*n-.0492609666966138*a+1.1880659249923042*s)};return void 0!==i&&(o.alpha=i),o},eH=(e=0)=>Math.max(203*e,0),eG=({x:e,y:t,z:r,alpha:i})=>{let n=eH(e),a=eH(t),s=eH(r),o=eO(.3592832590121217*n+.6976051147779502*a-.0358915932320289*s),l=eO(-.1920808463704995*n+1.1004767970374323*a+.0753748658519118*s),c=eO(.0070797844607477*n+.0748396662186366*a+.8433265453898765*s),h={mode:"itp",i:.5*o+.5*l,t:1.61376953125*o-3.323486328125*l+1.709716796875*c,p:4.378173828125*o-4.24560546875*l-.132568359375*c};return void 0!==i&&(h.alpha=i),h},eV=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*t)/(1+18.6875*t),134.03437499999998)},ej=(e=0)=>Math.max(203*e,0),eq=({x:e,y:t,z:r,alpha:i})=>{e=ej(e),t=ej(t);let n=1.15*e-.15*(r=ej(r)),a=.66*t+.34*e,s=eV(.41478972*n+.579999*a+.014648*r),o=eV(-.20151*n+1.120649*a+.0531008*r),l=eV(-.0166008*n+.2648*a+.6684799*r),c=(s+o)/2,h={mode:"jab",j:.44*c/(1-.56*c)-16295499532821565e-27,a:3.524*s-4.066708*o+.542708*l,b:.199076*s+1.096799*o-1.295875*l};return void 0!==i&&(h.alpha=i),h},eW=e=>{if(e<0)return 0;let t=Math.pow(e,.007460772656268216);return 1e4*Math.pow((.8359375-t)/(18.6875*t-18.8515625),6.277394636015326)},eX=({j:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=(e+16295499532821565e-27)/(.44+.56*(e+16295499532821565e-27)),a=eW(n+.13860504*t+.058047316*r),s=eW(n-.13860504*t-.058047316*r),o=eW(n-.096019242*t-.8118919*r),l={mode:"xyz65",x:(1.661373024652174*a-.914523081304348*s+.23136208173913045*o)/203,y:(-.3250758611844533*a+1.571847026732543*s-.21825383453227928*o)/203,z:(-.090982811*a-.31272829*s+1.5227666*o)/203};return void 0!==i&&(l.alpha=i),l},eY=e=>{let t=eq(J(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},eK=e=>et(eX(e)),e$=({j:e,a:t,b:r,alpha:i})=>{void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.sqrt(t*t+r*r),a={mode:"jch",j:e,c:n};return n&&(a.h=ei(180*Math.atan2(r,t)/Math.PI)),void 0!==i&&(a.alpha=i),a},eJ=({j:e,c:t,h:r,alpha:i})=>{void 0===r&&(r=0);let n={mode:"jab",j:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return void 0!==i&&(n.alpha=i),n},eZ=e=>Math.pow(e,3)>.008856451679035631?Math.pow(e,3):(116*e-16)/903.2962962962963,e0=({l:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=(e+16)/116,a=t/500+n,s=n-r/200,o={mode:"xyz50",x:eZ(a)*eA.X,y:eZ(n)*eA.Y,z:eZ(s)*eA.Z};return void 0!==i&&(o.alpha=i),o},e1=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=ee({r:3.1341359569958707*e-1.6173863321612538*t-.4906619460083532*r,g:-.978795502912089*e+1.916254567259524*t+.03344273116131949*r,b:.07195537988411677*e-.2289768264158322*t+1.405386058324125*r});return void 0!==i&&(n.alpha=i),n},e2=e=>e1(e0(e)),e3=e=>{let{r:t,g:r,b:i,alpha:n}=$(e),a={mode:"xyz50",x:.436065742824811*t+.3851514688337912*r+.14307845442264197*i,y:.22249319175623702*t+.7168870538238823*r+.06061979053616537*i,z:.013923904500943465*t+.09708128566574634*r+.7140993584005155*i};return void 0!==n&&(a.alpha=n),a},e5=e=>e>.008856451679035631?Math.cbrt(e):(903.2962962962963*e+16)/116,e4=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=e5(e/eA.X),a=e5(t/eA.Y),s={mode:"lab",l:116*a-16,a:500*(n-a),b:200*(a-e5(r/eA.Z))};return void 0!==i&&(s.alpha=i),s},e8=e=>{let t=e4(e3(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},e9={mode:"lab",toMode:{xyz50:e0,rgb:e2},fromMode:{xyz50:e4,rgb:e8},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[function(e,t){if(!t||"lab"!==t[0])return;let r={mode:"lab"},[,i,n,a,s]=t;if("hue"!==i.type&&"hue"!==n.type&&"hue"!==a.type)return i.type!==k&&(r.l=Math.min(Math.max(0,i.value),100)),n.type!==k&&(r.a=n.type===R?n.value:125*n.value/100),a.type!==k&&(r.b=a.type===R?a.value:125*a.value/100),s.type!==k&&(r.alpha=Math.min(1,Math.max(0,s.type===R?s.value:s.value/100))),r}],serialize:e=>`lab(${void 0!==e.l?e.l:"none"} ${void 0!==e.a?e.a:"none"} ${void 0!==e.b?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:G,a:G,b:G,alpha:{use:G,fixup:V}}},e6={...e9,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:ey,rgb:ex},fromMode:{xyz65:eE,rgb:ew},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},e7={mode:"lch",toMode:{lab:em,rgb:e=>e2(em(e))},fromMode:{rgb:e=>eg(e8(e)),lab:eg},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[function(e,t){if(!t||"lch"!==t[0])return;let r={mode:"lch"},[,i,n,a,s]=t;if(i.type!==k){if("hue"===i.type)return;r.l=Math.min(Math.max(0,i.value),100)}if(n.type!==k&&(r.c=Math.max(0,n.type===R?n.value:150*n.value/100)),a.type!==k){if(a.type===B)return;r.h=a.value}return s.type!==k&&(r.alpha=Math.min(1,Math.max(0,s.type===R?s.value:s.value/100))),r}],serialize:e=>`lch(${void 0!==e.l?e.l:"none"} ${void 0!==e.c?e.c:"none"} ${void 0!==e.h?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:G,fixup:en},c:G,l:G,alpha:{use:G,fixup:V}},difference:{h:ed},average:{h:ep}},te={...e7,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>em(e,"lab65"),rgb:e=>ex(em(e,"lab65"))},fromMode:{rgb:e=>eg(ew(e),"lch65"),lab65:e=>eg(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},tt=({l:e,u:t,v:r,alpha:i})=>{void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.sqrt(t*t+r*r),a={mode:"lchuv",l:e,c:n};return n&&(a.h=ei(180*Math.atan2(r,t)/Math.PI)),void 0!==i&&(a.alpha=i),a},tr=({l:e,c:t,h:r,alpha:i})=>{void 0===r&&(r=0);let n={mode:"luv",l:e,u:t?t*Math.cos(r/180*Math.PI):0,v:t?t*Math.sin(r/180*Math.PI):0};return void 0!==i&&(n.alpha=i),n},ti=(e,t,r)=>4*e/(e+15*t+3*r),tn=(e,t,r)=>9*t/(e+15*t+3*r),ta=ti(eA.X,eA.Y,eA.Z),ts=tn(eA.X,eA.Y,eA.Z),to=({x:e,y:t,z:r,alpha:i})=>{let n;void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let a=(n=t/eA.Y)<=.008856451679035631?903.2962962962963*n:116*Math.cbrt(n)-16,s=ti(e,t,r),o=tn(e,t,r);isFinite(s)&&isFinite(o)?(s=13*a*(s-ta),o=13*a*(o-ts)):a=s=o=0;let l={mode:"luv",l:a,u:s,v:o};return void 0!==i&&(l.alpha=i),l},tl=(n=eA.X,4*n/(n+15*eA.Y+3*eA.Z)),tc=(a=eA.X,9*(s=eA.Y)/(a+15*s+3*eA.Z)),th=({l:e,u:t,v:r,alpha:i})=>{if(void 0===e&&(e=0),0===e)return{mode:"xyz50",x:0,y:0,z:0};void 0===t&&(t=0),void 0===r&&(r=0);let n=t/(13*e)+tl,a=r/(13*e)+tc,s=eA.Y*(e<=8?e/903.2962962962963:Math.pow((e+16)/116,3)),o={mode:"xyz50",x:9*n*s/(4*a),y:s,z:s*(12-3*n-20*a)/(4*a)};return void 0!==i&&(o.alpha=i),o},tu={...j,mode:"lrgb",toMode:{rgb:ee},fromMode:{rgb:$},parse:["srgb-linear"],serialize:"srgb-linear"},td=({r:e,g:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*r),a=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*r),s=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*r),o={mode:"oklab",l:.210454268309314*n+.7936177747023054*a-.0040720430116193*s,a:1.9779985324311684*n-2.42859224204858*a+.450593709617411*s,b:.0259040424655478*n+.7827717124575296*a-.8086757549230774*s};return void 0!==i&&(o.alpha=i),o},tp=e=>{let t=td($(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},tf=({l:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.pow(e+.3963377773761749*t+.2158037573099136*r,3),a=Math.pow(e-.1055613458156586*t-.0638541728258133*r,3),s=Math.pow(e-.0894841775298119*t-1.2914855480194092*r,3),o={mode:"lrgb",r:4.076741636075957*n-3.3077115392580616*a+.2309699031821044*s,g:-1.2684379732850317*n+2.6097573492876887*a-.3413193760026573*s,b:-.0041960761386756*n-.7034186179359362*a+1.7076146940746117*s};return void 0!==i&&(o.alpha=i),o},tg=e=>ee(tf(e));function tm(e){return .5*(1.206/1.03*e-.206+Math.sqrt((1.206/1.03*e-.206)*(1.206/1.03*e-.206)+1.206/1.03*.12*e))}function tA(e){return(e*e+.206*e)/(1.206/1.03*(e+.03))}function tb(e,t){let r,i,n,a,s,o,l,c,h,u,d,p,f,g,m,A,b,v=(-1.88170328*e-.80936493*t>1?(r=1.19086277,i=1.76576728,n=.59662641,a=.75515197,s=.56771245,o=4.0767416621,l=-3.3077115913,c=.2309699292):1.81444104*e-1.19445276*t>1?(r=.73956515,i=-.45954404,n=.08285427,a=.1254107,s=.14503204,o=-1.2684380046,l=2.6097574011,c=-.3413193965):(r=1.35733652,i=-.00915799,n=-1.1513021,a=-.50559606,s=.00692167,o=-.0041960863,l=-.7034186147,c=1.707614701),h=r+i*e+n*t+a*e*e+s*e*t,u=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,p=-.0894841775*e-1.291485548*t,A=o*((f=1+h*u)*f*f)+l*((g=1+h*d)*g*g)+c*((m=1+h*p)*m*m),h-=A*(b=3*u*f*f*o+3*d*g*g*l+3*p*m*m*c)/(b*b-.5*A*(6*u*u*f*o+6*d*d*g*l+6*p*p*m*c))),y=tf({l:1,a:v*e,b:v*t}),x=Math.cbrt(1/Math.max(y.r,y.g,y.b));return[x,x*v]}function tv(e,t,r=null){r||(r=tb(e,t));let i=r[0],n=r[1];return[n/i,n/(1-i)]}function ty(e,t,r){let i=tb(t,r),n=function(e,t,r,i,n,a=null){let s;if(a||(a=tb(e,t)),(r-n)*a[1]-(a[0]-n)*1<=0)s=a[1]*n/(+a[0]+a[1]*(n-r));else{s=a[1]*(n-1)/(+(a[0]-1)+a[1]*(n-r));{let i=r-n,a=.3963377774*e+.2158037573*t,o=-.1055613458*e-.0638541728*t,l=-.0894841775*e-1.291485548*t,c=i+ +a,h=i+ +o,u=i+ +l;{let e=n*(1-s)+s*r,t=+s,i=e+t*a,d=e+t*o,p=e+t*l,f=i*i*i,g=d*d*d,m=p*p*p,A=3*c*i*i,b=3*h*d*d,v=3*u*p*p,y=6*c*c*i,x=6*h*h*d,S=6*u*u*p,E=4.0767416621*f-3.3077115913*g+.2309699292*m-1,w=4.0767416621*A-3.3077115913*b+.2309699292*v,_=w/(w*w-.5*E*(4.0767416621*y-3.3077115913*x+.2309699292*S)),C=-E*_,M=-1.2684380046*f+2.6097574011*g-.3413193965*m-1,I=-1.2684380046*A+2.6097574011*b-.3413193965*v,T=I/(I*I-.5*M*(-1.2684380046*y+2.6097574011*x-.3413193965*S)),R=-M*T,B=-.0041960863*f-.7034186147*g+1.707614701*m-1,k=-.0041960863*A-.7034186147*b+1.707614701*v,P=k/(k*k-.5*B*(-.0041960863*y-.7034186147*x+1.707614701*S)),D=-B*P;s+=Math.min(C=_>=0?C:1e6,Math.min(R=T>=0?R:1e6,D=P>=0?D:1e6))}}}return s}(t,r,e,0,e,i),a=tv(t,r,i),s=.11516993+1/(7.4477897+4.1590124*r+t*(-2.19557347+1.75198401*r+t*(-2.13704948-10.02301043*r+t*(-4.24894561+5.38770819*r+4.69891013*t)))),o=.11239642+1/(1.6132032-.68124379*r+t*(.40370612+.90148123*r+t*(-.27087943+.6122399*r+t*(.00299215-.45399568*r-.14661872*t)))),l=n/Math.min(e*a[0],(1-e)*a[1]),c=e*s,h=(1-e)*o,u=.9*l*Math.sqrt(Math.sqrt(1/(1/(c*c*c*c)+1/(h*h*h*h))));return[Math.sqrt(1/(1/((c=.4*e)*c)+1/((h=(1-e)*.8)*h))),u,n]}function tx(e){let t,r=void 0!==e.l?e.l:0,i=void 0!==e.a?e.a:0,n=void 0!==e.b?e.b:0,a={mode:"okhsl",l:tm(r)};void 0!==e.alpha&&(a.alpha=e.alpha);let s=Math.sqrt(i*i+n*n);if(!s)return a.s=0,a;let[o,l,c]=ty(r,i/s,n/s);if(s<l){let e=.8*o;t=(s-0)/(e+(1-e/l)*(s-0))*.8}else{let e=.2*l*l*1.5625/o;t=.8+.2*((s-l)/(e+(1-e/(c-l))*(s-l)))}return t&&(a.s=t,a.h=ei(180*Math.atan2(n,i)/Math.PI)),a}function tS(e){let t,r,i,n,a=void 0!==e.h?e.h:0,s=void 0!==e.s?e.s:0,o=void 0!==e.l?e.l:0,l={mode:"oklab",l:tA(o)};if(void 0!==e.alpha&&(l.alpha=e.alpha),!s||1===o)return l.a=l.b=0,l;let c=Math.cos(a/180*Math.PI),h=Math.sin(a/180*Math.PI),[u,d,p]=ty(l.l,c,h);s<.8?(t=1.25*s,r=0,n=1-(i=.8*u)/d):(t=5*(s-.8),r=d,n=1-(i=.2*d*d*1.5625/u)/(p-d));let f=r+t*i/(1-n*t);return l.a=f*c,l.b=f*h,l}let tE={...eD,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:tx,rgb:e=>tx(tp(e))},toMode:{oklab:tS,rgb:e=>tg(tS(e))}};function tw(e){let t=void 0!==e.l?e.l:0,r=void 0!==e.a?e.a:0,i=void 0!==e.b?e.b:0,n=Math.sqrt(r*r+i*i),a=n?r/n:1,s=n?i/n:1,[o,l]=tv(a,s),c=l/(n+t*l),h=c*t,u=c*n,d=tA(h),p=u*d/h,f=tf({l:d,a:a*p,b:s*p}),g=Math.cbrt(1/Math.max(f.r,f.g,f.b,0));t/=g;let m={mode:"okhsv",s:(n=n/g*tm(t)/t)?(.5+l)*u/(.5*l+l*(1-.5/o)*u):0,v:(t=tm(t))?t/h:0};return m.s&&(m.h=ei(180*Math.atan2(i,r)/Math.PI)),void 0!==e.alpha&&(m.alpha=e.alpha),m}function t_(e){let t={mode:"oklab"};void 0!==e.alpha&&(t.alpha=e.alpha);let r=void 0!==e.h?e.h:0,i=void 0!==e.s?e.s:0,n=void 0!==e.v?e.v:0,a=Math.cos(r/180*Math.PI),s=Math.sin(r/180*Math.PI),[o,l]=tv(a,s),c=1-.5/o,h=1-.5*i/(.5+l-l*c*i),u=i*l*.5/(.5+l-l*c*i),d=tA(h),p=u*d/h,f=tf({l:d,a:a*p,b:s*p}),g=Math.cbrt(1/Math.max(f.r,f.g,f.b,0)),m=tA(n*h),A=u*m/h;return t.l=m*g,t.a=A*a*g,t.b=A*s*g,t}let tC={...eN,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:tw,rgb:e=>tw(tp(e))},toMode:{oklab:t_,rgb:e=>tg(t_(e))}},tM={...e9,mode:"oklab",toMode:{lrgb:tf,rgb:tg},fromMode:{lrgb:td,rgb:tp},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[function(e,t){if(!t||"oklab"!==t[0])return;let r={mode:"oklab"},[,i,n,a,s]=t;if("hue"!==i.type&&"hue"!==n.type&&"hue"!==a.type)return i.type!==k&&(r.l=Math.min(Math.max(0,i.type===R?i.value:i.value/100),1)),n.type!==k&&(r.a=n.type===R?n.value:.4*n.value/100),a.type!==k&&(r.b=a.type===R?a.value:.4*a.value/100),s.type!==k&&(r.alpha=Math.min(1,Math.max(0,s.type===R?s.value:s.value/100))),r}],serialize:e=>`oklab(${void 0!==e.l?e.l:"none"} ${void 0!==e.a?e.a:"none"} ${void 0!==e.b?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`},tI={...e7,mode:"oklch",toMode:{oklab:e=>em(e,"oklab"),rgb:e=>tg(em(e,"oklab"))},fromMode:{rgb:e=>eg(tp(e),"oklch"),oklab:e=>eg(e,"oklch")},parse:[function(e,t){if(!t||"oklch"!==t[0])return;let r={mode:"oklch"},[,i,n,a,s]=t;if(i.type!==k){if("hue"===i.type)return;r.l=Math.min(Math.max(0,i.type===R?i.value:i.value/100),1)}if(n.type!==k&&(r.c=Math.max(0,n.type===R?n.value:.4*n.value/100)),a.type!==k){if(a.type===B)return;r.h=a.value}return s.type!==k&&(r.alpha=Math.min(1,Math.max(0,s.type===R?s.value:s.value/100))),r}],serialize:e=>`oklch(${void 0!==e.l?e.l:"none"} ${void 0!==e.c?e.c:"none"} ${void 0!==e.h?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},tT=e=>{let{r:t,g:r,b:i,alpha:n}=$(e),a={mode:"xyz65",x:.486570948648216*t+.265667693169093*r+.1982172852343625*i,y:.2289745640697487*t+.6917385218365062*r+.079286914093745*i,z:0*t+.0451133818589026*r+1.043944368900976*i};return void 0!==n&&(a.alpha=n),a},tR=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=ee({r:2.4934969119414263*e-.9313836179191242*t-.402710784450717*r,g:-.8294889695615749*e+1.7626640603183465*t+.0236246858419436*r,b:.0358458302437845*e-.0761723892680418*t+.9568845240076871*r},"p3");return void 0!==i&&(n.alpha=i),n},tB={...j,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>tR(J(e)),xyz65:tR},toMode:{rgb:e=>et(tT(e)),xyz65:tT}},tk=e=>{let t=Math.abs(e);return t>=1/512?Math.sign(e)*Math.pow(t,1/1.8):16*e},tP=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"prophoto",r:tk(1.3457868816471585*e-.2555720873797946*t-.0511018649755453*r),g:tk(-.5446307051249019*e+1.5082477428451466*t+.0205274474364214*r),b:tk(0*e+0*t+1.2119675456389452*r)};return void 0!==i&&(n.alpha=i),n},tD=(e=0)=>{let t=Math.abs(e);return t>=16/512?Math.sign(e)*Math.pow(t,1.8):e/16},tL=e=>{let t=tD(e.r),r=tD(e.g),i=tD(e.b),n={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*r+.0313477341283922*i,y:.2880748288194013*t+.7118352342418731*r+899369387256e-16*i,z:0*t+0*r+.8251046025104602*i};return void 0!==e.alpha&&(n.alpha=e.alpha),n},tF={...j,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:tP,rgb:e=>tP(e3(e))},toMode:{xyz50:tL,rgb:e=>e1(tL(e))}},tN=e=>{let t=Math.abs(e);return t>.018053968510807?(Math.sign(e)||1)*(1.09929682680944*Math.pow(t,.45)-(1.09929682680944-1)):4.5*e},tU=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"rec2020",r:tN(1.7166511879712683*e-.3556707837763925*t-.2533662813736599*r),g:tN(-.6666843518324893*e+1.6164812366349395*t+.0157685458139111*r),b:tN(.0176398574453108*e-.0427706132578085*t+.9421031212354739*r)};return void 0!==i&&(n.alpha=i),n},tO=(e=0)=>{let t=Math.abs(e);return t<.08124285829863151?e/4.5:(Math.sign(e)||1)*Math.pow((t+1.09929682680944-1)/1.09929682680944,1/.45)},tQ=e=>{let t=tO(e.r),r=tO(e.g),i=tO(e.b),n={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*r+.1688809751641721*i,y:.262700212011267*t+.6779980715188708*r+.059301716469862*i,z:0*t+.0280726930490874*r+1.0609850577107909*i};return void 0!==e.alpha&&(n.alpha=e.alpha),n},tz={...j,mode:"rec2020",fromMode:{xyz65:tU,rgb:e=>tU(J(e))},toMode:{xyz65:tQ,rgb:e=>et(tQ(e))},parse:["rec2020"],serialize:"rec2020"},tH=Math.cbrt(.0037930732552754493),tG=e=>Math.cbrt(e)-tH,tV=e=>Math.pow(e+tH,3),tj={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:({x:e,y:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=tV(e+t)-.0037930732552754493,a=tV(t-e)-.0037930732552754493,s=tV(r+t)-.0037930732552754493,o=ee({r:11.031566904639861*n-9.866943908131562*a-.16462299650829934*s,g:-3.2541473810744237*n+4.418770377582723*a-.16462299650829934*s,b:-3.6588512867136815*n+2.7129230459360922*a+1.9459282407775895*s});return void 0!==i&&(o.alpha=i),o}},fromMode:{rgb:e=>{let{r:t,g:r,b:i,alpha:n}=$(e),a=tG(.3*t+.622*r+.078*i+.0037930732552754493),s=tG(.23*t+.692*r+.078*i+.0037930732552754493),o={mode:"xyb",x:(a-s)/2,y:(a+s)/2,b:tG(.2434226892454782*t+.2047674442449682*r+.5518098665095535*i+.0037930732552754493)-(a+s)/2};return void 0!==n&&(o.alpha=n),o}},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:G,y:G,b:G,alpha:{use:G,fixup:V}}},tq={mode:"yiq",toMode:{rgb:({y:e,i:t,q:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"rgb",r:e+.95608445*t+.6208885*r,g:e-.27137664*t-.6486059*r,b:e-1.10561724*t+1.70250126*r};return void 0!==i&&(n.alpha=i),n}},fromMode:{rgb:({r:e,g:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*r,i:.59597799*e-.2741761*t-.32180189*r,q:.21147017*e-.52261711*t+.31114694*r};return void 0!==i&&(n.alpha=i),n}},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:G,i:G,q:G,alpha:{use:G,fixup:V}}};((e=4)=>t=>{let r;return"number"==typeof t?Math.round(t*(r=Math.pow(10,r=e)))/r:t})(2);let tW=e=>Math.round(255*Math.max(0,Math.min(1,e||0))),tX=b("rgb");b("hsl");let tY=e=>(e=>{if(void 0!==e)return"#"+(0x1000000|tW(e.r)<<16|tW(e.g)<<8|tW(e.b)).toString(16).slice(1)})(tX(e));w(er),w(ef),w({mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:eB,rgb:e=>ex(eB(e))},fromMode:{lab65:ek,rgb:e=>ek(ew(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:G,a:G,b:G,alpha:{use:G,fixup:V}}}),w({mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:eT,dlab:e=>em(e,"dlab"),rgb:e=>ex(eT(e))},fromMode:{lab65:eR,dlab:e=>eg(e,"dlch"),rgb:e=>eR(ew(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:G,c:G,h:{use:G,fixup:en},alpha:{use:G,fixup:V}},difference:{h:ed},average:{h:ep}}),w({mode:"hsi",toMode:{rgb:function({h:e,s:t,i:r,alpha:i}){let n;e=ei(void 0!==e?e:0),void 0===t&&(t=0),void 0===r&&(r=0);let a=Math.abs(e/60%2-1);switch(Math.floor(e/60)){case 0:n={r:r*(1+t*(3/(2-a)-1)),g:r*(1+t*(3*(1-a)/(2-a)-1)),b:r*(1-t)};break;case 1:n={r:r*(1+t*(3*(1-a)/(2-a)-1)),g:r*(1+t*(3/(2-a)-1)),b:r*(1-t)};break;case 2:n={r:r*(1-t),g:r*(1+t*(3/(2-a)-1)),b:r*(1+t*(3*(1-a)/(2-a)-1))};break;case 3:n={r:r*(1-t),g:r*(1+t*(3*(1-a)/(2-a)-1)),b:r*(1+t*(3/(2-a)-1))};break;case 4:n={r:r*(1+t*(3*(1-a)/(2-a)-1)),g:r*(1-t),b:r*(1+t*(3/(2-a)-1))};break;case 5:n={r:r*(1+t*(3/(2-a)-1)),g:r*(1-t),b:r*(1+t*(3*(1-a)/(2-a)-1))};break;default:n={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return n.mode="rgb",void 0!==i&&(n.alpha=i),n}},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:function({r:e,g:t,b:r,alpha:i}){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.max(e,t,r),a=Math.min(e,t,r),s={mode:"hsi",s:e+t+r===0?0:1-3*a/(e+t+r),i:(e+t+r)/3};return n-a!=0&&(s.h=(n===e?(t-r)/(n-a)+(t<r)*6:n===t?(r-e)/(n-a)+2:(e-t)/(n-a)+4)*60),void 0!==i&&(s.alpha=i),s}},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:G,fixup:en},s:G,i:G,alpha:{use:G,fixup:V}},difference:{h:eu},average:{h:ep}}),w(eD),w(eN),w({mode:"hwb",toMode:{rgb:function({h:e,w:t,b:r,alpha:i}){if(void 0===t&&(t=0),void 0===r&&(r=0),t+r>1){let e=t+r;t/=e,r/=e}return eL({h:e,s:1===r?1:1-t/(1-r),v:1-r,alpha:i})}},fromMode:{rgb:function(e){let t=eF(e);if(void 0===t)return;let r=void 0!==t.s?t.s:0,i=void 0!==t.v?t.v:0,n={mode:"hwb",w:(1-r)*i,b:1-i};return void 0!==t.h&&(n.h=t.h),void 0!==t.alpha&&(n.alpha=t.alpha),n}},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[function(e,t){if(!t||"hwb"!==t[0])return;let r={mode:"hwb"},[,i,n,a,s]=t;if(i.type!==k){if(i.type===B)return;r.h=i.value}if(n.type!==k){if("hue"===n.type)return;r.w=n.value/100}if(a.type!==k){if("hue"===a.type)return;r.b=a.value/100}return s.type!==k&&(r.alpha=Math.min(1,Math.max(0,s.type===R?s.value:s.value/100))),r}],serialize:e=>`hwb(${void 0!==e.h?e.h:"none"} ${void 0!==e.w?100*e.w+"%":"none"} ${void 0!==e.b?100*e.b+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:G,fixup:en},w:G,b:G,alpha:{use:G,fixup:V}},difference:{h:(e,t)=>{if(void 0===e.h||void 0===t.h)return 0;let r=ei(e.h),i=ei(t.h);return Math.abs(i-r)>180?r-(i-360*Math.sign(i-r)):i-r}},average:{h:ep}}),w({mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:ez,rgb:e=>et(ez(e))},fromMode:{xyz65:eG,rgb:e=>eG(J(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:G,t:G,p:G,alpha:{use:G,fixup:V}}}),w({mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:eY,xyz65:eq},toMode:{rgb:eK,xyz65:eX},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:G,a:G,b:G,alpha:{use:G,fixup:V}}}),w({mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:eJ,rgb:e=>eK(eJ(e))},fromMode:{rgb:e=>e$(eY(e)),jab:e$},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:G,fixup:en},c:G,j:G,alpha:{use:G,fixup:V}},difference:{h:ed},average:{h:ep}}),w(e9),w(e6),w(e7),w(te),w({mode:"lchuv",toMode:{luv:tr,rgb:e=>e1(th(tr(e)))},fromMode:{rgb:e=>tt(to(e3(e))),luv:tt},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:G,fixup:en},c:G,l:G,alpha:{use:G,fixup:V}},difference:{h:ed},average:{h:ep}}),w(tu),w({mode:"luv",toMode:{xyz50:th,rgb:e=>e1(th(e))},fromMode:{xyz50:to,rgb:e=>to(e3(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:G,u:G,v:G,alpha:{use:G,fixup:V}}}),w(tE),w(tC),w(tM);let tK=w(tI);w(tB),w(tF),w(tz),w(j),w(tj),w({mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:e1,lab:e4},fromMode:{rgb:e3,lab:e0},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:G,y:G,z:G,alpha:{use:G,fixup:V}}}),w({mode:"xyz65",toMode:{rgb:et,xyz50:e=>{let{x:t,y:r,z:i,alpha:n}=e;void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*r-.0501922295431356*i,y:.0296278156881593*t+.990434484573249*r-.0170738250293851*i,z:-.0092430581525912*t+.0150551448965779*r+.7518742899580008*i};return void 0!==n&&(a.alpha=n),a}},fromMode:{rgb:J,xyz50:e=>{let{x:t,y:r,z:i,alpha:n}=e;void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*r+.0632593086610217*i,y:-.0283697069632081*t+1.0099954580058226*r+.021041398966943*i,z:.0123140016883199*t-.0205076964334779*r+1.3303659366080753*i};return void 0!==n&&(a.alpha=n),a}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:G,y:G,z:G,alpha:{use:G,fixup:V}}}),w(tq)},8413(e,t,r){"use strict";r.d(t,{MZ:()=>a});var i=r(3035);let n={attribute:!0,type:String,converter:i.W3,reflect:!1,hasChanged:i.Ec};function a(e){return(t,r)=>{let i;return"object"==typeof r?((e=n,t,r)=>{let{kind:i,metadata:a}=r,s=globalThis.litPropertyMetadata.get(a);if(void 0===s&&globalThis.litPropertyMetadata.set(a,s=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),s.set(r.name,e),"accessor"===i){let{name:i}=r;return{set(r){let n=t.get.call(this);t.set.call(this,r),this.requestUpdate(i,n,e,!0,r)},init(t){return void 0!==t&&this.C(i,void 0,e,t),t}}}if("setter"===i){let{name:i}=r;return function(r){let n=this[i];t.call(this,r),this.requestUpdate(i,n,e,!0,r)}}throw Error("Unsupported decorator location: "+i)})(e,t,r):(i=t.hasOwnProperty(r),t.constructor.createProperty(r,e),i?Object.getOwnPropertyDescriptor(t,r):void 0)}}},1137(e,t,r){"use strict";r.d(t,{QP:()=>el});let i=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),n=[],a=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let i=e[t],n=r.nextPart.get(i);if(n){let r=a(e,t+1,n);if(r)return r}let s=r.validators;if(null===s)return;let o=0===t?e.join("-"):e.slice(t).join("-"),l=s.length;for(let e=0;e<l;e++){let t=s[e];if(t.validator(o))return t.classGroupId}},s=(e,t)=>{let r=i();for(let i in e)o(e[i],r,i,t);return r},o=(e,t,r,i)=>{let n=e.length;for(let a=0;a<n;a++)l(e[a],t,r,i)},l=(e,t,r,i)=>{"string"==typeof e?c(e,t,r):"function"==typeof e?h(e,t,r,i):u(e,t,r,i)},c=(e,t,r)=>{(""===e?t:d(t,e)).classGroupId=r},h=(e,t,r,i)=>{p(e)?o(e(i),t,r,i):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},u=(e,t,r,i)=>{let n=Object.entries(e),a=n.length;for(let e=0;e<a;e++){let[a,s]=n[e];o(s,d(t,a),r,i)}},d=(e,t)=>{let r=e,n=t.split("-"),a=n.length;for(let e=0;e<a;e++){let t=n[e],a=r.nextPart.get(t);a||(a=i(),r.nextPart.set(t,a)),r=a}return r},p=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,f=[],g=(e,t,r,i,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:i,isExternal:n}),m=/\s+/,A=e=>{let t;if("string"==typeof e)return e;let r="";for(let i=0;i<e.length;i++)e[i]&&(t=A(e[i]))&&(r&&(r+=" "),r+=t);return r},b=[],v=e=>{let t=t=>t[e]||b;return t.isThemeGetter=!0,t},y=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,x=/^\((?:(\w[\w-]*):)?(.+)\)$/i,S=/^\d+\/\d+$/,E=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,w=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,C=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,M=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=e=>S.test(e),T=e=>!!e&&!Number.isNaN(Number(e)),R=e=>!!e&&Number.isInteger(Number(e)),B=e=>e.endsWith("%")&&T(e.slice(0,-1)),k=e=>E.test(e),P=()=>!0,D=e=>w.test(e)&&!_.test(e),L=()=>!1,F=e=>C.test(e),N=e=>M.test(e),U=e=>!Q(e)&&!q(e),O=e=>Z(e,ei,L),Q=e=>y.test(e),z=e=>Z(e,en,D),H=e=>Z(e,ea,T),G=e=>Z(e,et,L),V=e=>Z(e,er,N),j=e=>Z(e,eo,F),q=e=>x.test(e),W=e=>ee(e,en),X=e=>ee(e,es),Y=e=>ee(e,et),K=e=>ee(e,ei),$=e=>ee(e,er),J=e=>ee(e,eo,!0),Z=(e,t,r)=>{let i=y.exec(e);return!!i&&(i[1]?t(i[1]):r(i[2]))},ee=(e,t,r=!1)=>{let i=x.exec(e);return!!i&&(i[1]?t(i[1]):r)},et=e=>"position"===e||"percentage"===e,er=e=>"image"===e||"url"===e,ei=e=>"length"===e||"size"===e||"bg-size"===e,en=e=>"length"===e,ea=e=>"number"===e,es=e=>"family-name"===e,eo=e=>"shadow"===e,el=((e,...t)=>{let r,i,o,l,c=e=>{let t=i(e);if(t)return t;let n=((e,t)=>{let{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:n,sortModifiers:a}=t,s=[],o=e.trim().split(m),l="";for(let e=o.length-1;e>=0;e-=1){let t=o[e],{isExternal:c,modifiers:h,hasImportantModifier:u,baseClassName:d,maybePostfixModifierPosition:p}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let f=!!p,g=i(f?d.substring(0,p):d);if(!g){if(!f||!(g=i(d))){l=t+(l.length>0?" "+l:l);continue}f=!1}let m=0===h.length?"":1===h.length?h[0]:a(h).join(":"),A=u?m+"!":m,b=A+g;if(s.indexOf(b)>-1)continue;s.push(b);let v=n(g,f);for(let e=0;e<v.length;++e){let t=v[e];s.push(A+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return o(e,n),n};return l=h=>{var u;let d;return i=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),i=Object.create(null),n=(n,a)=>{r[n]=a,++t>e&&(t=0,i=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=i[e])?(n(e,t),t):void 0},set(e,t){e in r?r[e]=t:n(e,t)}}})((u=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,i=e=>{let t,r=[],i=0,n=0,a=0,s=e.length;for(let o=0;o<s;o++){let s=e[o];if(0===i&&0===n){if(":"===s){r.push(e.slice(a,o)),a=o+1;continue}if("/"===s){t=o;continue}}"["===s?i++:"]"===s?i--:"("===s?n++:")"===s&&n--}let o=0===r.length?e:e.slice(a),l=o,c=!1;return o.endsWith("!")?(l=o.slice(0,-1),c=!0):o.startsWith("!")&&(l=o.slice(1),c=!0),g(r,c,l,t&&t>a?t-a:void 0)};if(t){let e=t+":",r=i;i=t=>t.startsWith(e)?r(t.slice(e.length)):g(f,!1,t,void 0,!0)}if(r){let e=i;i=t=>r({className:t,parseClassName:e})}return i})(u),sortModifiers:(d=new Map,u.orderSensitiveModifiers.forEach((e,t)=>{d.set(e,1e6+t)}),e=>{let t=[],r=[];for(let i=0;i<e.length;i++){let n=e[i],a="["===n[0],s=d.has(n);a||s?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(n)):r.push(n)}return r.length>0&&(r.sort(),t.push(...r)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return s(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,i,n;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(i=(t=r.slice(1,-1)).indexOf(":"),(n=t.slice(0,i))?"arbitrary.."+n:void 0)}let i=e.split("-"),n=+(""===i[0]&&i.length>1);return a(i,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=i[e],a=r[e];if(t){if(a){let e=Array(a.length+t.length);for(let t=0;t<a.length;t++)e[t]=a[t];for(let r=0;r<t.length;r++)e[a.length+r]=t[r];return e}return t}return a||n}return r[e]||n}}})(u)}).cache.get,o=r.cache.set,l=c,c(h)},(...e)=>l(((...e)=>{let t,r,i=0,n="";for(;i<e.length;)(t=e[i++])&&(r=A(t))&&(n&&(n+=" "),n+=r);return n})(...e))})(()=>{let e=v("color"),t=v("font"),r=v("text"),i=v("font-weight"),n=v("tracking"),a=v("leading"),s=v("breakpoint"),o=v("container"),l=v("spacing"),c=v("radius"),h=v("shadow"),u=v("inset-shadow"),d=v("text-shadow"),p=v("drop-shadow"),f=v("blur"),g=v("perspective"),m=v("aspect"),A=v("ease"),b=v("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...x(),q,Q],E=()=>["auto","hidden","clip","visible","scroll"],w=()=>["auto","contain","none"],_=()=>[q,Q,l],C=()=>[I,"full","auto",..._()],M=()=>[R,"none","subgrid",q,Q],D=()=>["auto",{span:["full",R,q,Q]},R,q,Q],L=()=>[R,"auto",q,Q],F=()=>["auto","min","max","fr",q,Q],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",..._()],et=()=>[I,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],er=()=>[e,q,Q],ei=()=>[...x(),Y,G,{position:[q,Q]}],en=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ea=()=>["auto","cover","contain",K,O,{size:[q,Q]}],es=()=>[B,W,z],eo=()=>["","none","full",c,q,Q],el=()=>["",T,W,z],ec=()=>["solid","dashed","dotted","double"],eh=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],eu=()=>[T,B,Y,G],ed=()=>["","none",f,q,Q],ep=()=>["none",T,q,Q],ef=()=>["none",T,q,Q],eg=()=>[T,q,Q],em=()=>[I,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[k],breakpoint:[k],color:[P],container:[k],"drop-shadow":[k],ease:["in","out","in-out"],font:[U],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[k],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[k],shadow:[k],spacing:["px",T],text:[k],"text-shadow":[k],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",I,Q,q,m]}],container:["container"],columns:[{columns:[T,Q,q,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[R,"auto",q,Q]}],basis:[{basis:[I,"full","auto",o,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[T,I,"auto","initial","none",Q]}],grow:[{grow:["",T,q,Q]}],shrink:[{shrink:["",T,q,Q]}],order:[{order:[R,"first","last","none",q,Q]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:et()}],w:[{w:[o,"screen",...et()]}],"min-w":[{"min-w":[o,"screen","none",...et()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...et()]}],h:[{h:["screen","lh",...et()]}],"min-h":[{"min-h":["screen","lh","none",...et()]}],"max-h":[{"max-h":["screen","lh",...et()]}],"font-size":[{text:["base",r,W,z]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,q,H]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",B,Q]}],"font-family":[{font:[X,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,q,Q]}],"line-clamp":[{"line-clamp":[T,"none",q,H]}],leading:[{leading:[a,..._()]}],"list-image":[{"list-image":["none",q,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:er()}],"text-color":[{text:er()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ec(),"wavy"]}],"text-decoration-thickness":[{decoration:[T,"from-font","auto",q,z]}],"text-decoration-color":[{decoration:er()}],"underline-offset":[{"underline-offset":[T,"auto",q,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ei()}],"bg-repeat":[{bg:en()}],"bg-size":[{bg:ea()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},R,q,Q],radial:["",q,Q],conic:[R,q,Q]},$,V]}],"bg-color":[{bg:er()}],"gradient-from-pos":[{from:es()}],"gradient-via-pos":[{via:es()}],"gradient-to-pos":[{to:es()}],"gradient-from":[{from:er()}],"gradient-via":[{via:er()}],"gradient-to":[{to:er()}],rounded:[{rounded:eo()}],"rounded-s":[{"rounded-s":eo()}],"rounded-e":[{"rounded-e":eo()}],"rounded-t":[{"rounded-t":eo()}],"rounded-r":[{"rounded-r":eo()}],"rounded-b":[{"rounded-b":eo()}],"rounded-l":[{"rounded-l":eo()}],"rounded-ss":[{"rounded-ss":eo()}],"rounded-se":[{"rounded-se":eo()}],"rounded-ee":[{"rounded-ee":eo()}],"rounded-es":[{"rounded-es":eo()}],"rounded-tl":[{"rounded-tl":eo()}],"rounded-tr":[{"rounded-tr":eo()}],"rounded-br":[{"rounded-br":eo()}],"rounded-bl":[{"rounded-bl":eo()}],"border-w":[{border:el()}],"border-w-x":[{"border-x":el()}],"border-w-y":[{"border-y":el()}],"border-w-s":[{"border-s":el()}],"border-w-e":[{"border-e":el()}],"border-w-t":[{"border-t":el()}],"border-w-r":[{"border-r":el()}],"border-w-b":[{"border-b":el()}],"border-w-l":[{"border-l":el()}],"divide-x":[{"divide-x":el()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":el()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ec(),"hidden","none"]}],"divide-style":[{divide:[...ec(),"hidden","none"]}],"border-color":[{border:er()}],"border-color-x":[{"border-x":er()}],"border-color-y":[{"border-y":er()}],"border-color-s":[{"border-s":er()}],"border-color-e":[{"border-e":er()}],"border-color-t":[{"border-t":er()}],"border-color-r":[{"border-r":er()}],"border-color-b":[{"border-b":er()}],"border-color-l":[{"border-l":er()}],"divide-color":[{divide:er()}],"outline-style":[{outline:[...ec(),"none","hidden"]}],"outline-offset":[{"outline-offset":[T,q,Q]}],"outline-w":[{outline:["",T,W,z]}],"outline-color":[{outline:er()}],shadow:[{shadow:["","none",h,J,j]}],"shadow-color":[{shadow:er()}],"inset-shadow":[{"inset-shadow":["none",u,J,j]}],"inset-shadow-color":[{"inset-shadow":er()}],"ring-w":[{ring:el()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:er()}],"ring-offset-w":[{"ring-offset":[T,z]}],"ring-offset-color":[{"ring-offset":er()}],"inset-ring-w":[{"inset-ring":el()}],"inset-ring-color":[{"inset-ring":er()}],"text-shadow":[{"text-shadow":["none",d,J,j]}],"text-shadow-color":[{"text-shadow":er()}],opacity:[{opacity:[T,q,Q]}],"mix-blend":[{"mix-blend":[...eh(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":eh()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[T]}],"mask-image-linear-from-pos":[{"mask-linear-from":eu()}],"mask-image-linear-to-pos":[{"mask-linear-to":eu()}],"mask-image-linear-from-color":[{"mask-linear-from":er()}],"mask-image-linear-to-color":[{"mask-linear-to":er()}],"mask-image-t-from-pos":[{"mask-t-from":eu()}],"mask-image-t-to-pos":[{"mask-t-to":eu()}],"mask-image-t-from-color":[{"mask-t-from":er()}],"mask-image-t-to-color":[{"mask-t-to":er()}],"mask-image-r-from-pos":[{"mask-r-from":eu()}],"mask-image-r-to-pos":[{"mask-r-to":eu()}],"mask-image-r-from-color":[{"mask-r-from":er()}],"mask-image-r-to-color":[{"mask-r-to":er()}],"mask-image-b-from-pos":[{"mask-b-from":eu()}],"mask-image-b-to-pos":[{"mask-b-to":eu()}],"mask-image-b-from-color":[{"mask-b-from":er()}],"mask-image-b-to-color":[{"mask-b-to":er()}],"mask-image-l-from-pos":[{"mask-l-from":eu()}],"mask-image-l-to-pos":[{"mask-l-to":eu()}],"mask-image-l-from-color":[{"mask-l-from":er()}],"mask-image-l-to-color":[{"mask-l-to":er()}],"mask-image-x-from-pos":[{"mask-x-from":eu()}],"mask-image-x-to-pos":[{"mask-x-to":eu()}],"mask-image-x-from-color":[{"mask-x-from":er()}],"mask-image-x-to-color":[{"mask-x-to":er()}],"mask-image-y-from-pos":[{"mask-y-from":eu()}],"mask-image-y-to-pos":[{"mask-y-to":eu()}],"mask-image-y-from-color":[{"mask-y-from":er()}],"mask-image-y-to-color":[{"mask-y-to":er()}],"mask-image-radial":[{"mask-radial":[q,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":eu()}],"mask-image-radial-to-pos":[{"mask-radial-to":eu()}],"mask-image-radial-from-color":[{"mask-radial-from":er()}],"mask-image-radial-to-color":[{"mask-radial-to":er()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[T]}],"mask-image-conic-from-pos":[{"mask-conic-from":eu()}],"mask-image-conic-to-pos":[{"mask-conic-to":eu()}],"mask-image-conic-from-color":[{"mask-conic-from":er()}],"mask-image-conic-to-color":[{"mask-conic-to":er()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ei()}],"mask-repeat":[{mask:en()}],"mask-size":[{mask:ea()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,Q]}],filter:[{filter:["","none",q,Q]}],blur:[{blur:ed()}],brightness:[{brightness:[T,q,Q]}],contrast:[{contrast:[T,q,Q]}],"drop-shadow":[{"drop-shadow":["","none",p,J,j]}],"drop-shadow-color":[{"drop-shadow":er()}],grayscale:[{grayscale:["",T,q,Q]}],"hue-rotate":[{"hue-rotate":[T,q,Q]}],invert:[{invert:["",T,q,Q]}],saturate:[{saturate:[T,q,Q]}],sepia:[{sepia:["",T,q,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",q,Q]}],"backdrop-blur":[{"backdrop-blur":ed()}],"backdrop-brightness":[{"backdrop-brightness":[T,q,Q]}],"backdrop-contrast":[{"backdrop-contrast":[T,q,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",T,q,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[T,q,Q]}],"backdrop-invert":[{"backdrop-invert":["",T,q,Q]}],"backdrop-opacity":[{"backdrop-opacity":[T,q,Q]}],"backdrop-saturate":[{"backdrop-saturate":[T,q,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",T,q,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[T,"initial",q,Q]}],ease:[{ease:["linear","initial",A,q,Q]}],delay:[{delay:[T,q,Q]}],animate:[{animate:["none",b,q,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,q,Q]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ep()}],"rotate-x":[{"rotate-x":ep()}],"rotate-y":[{"rotate-y":ep()}],"rotate-z":[{"rotate-z":ep()}],scale:[{scale:ef()}],"scale-x":[{"scale-x":ef()}],"scale-y":[{"scale-y":ef()}],"scale-z":[{"scale-z":ef()}],"scale-3d":["scale-3d"],skew:[{skew:eg()}],"skew-x":[{"skew-x":eg()}],"skew-y":[{"skew-y":eg()}],transform:[{transform:[q,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:em()}],"translate-x":[{"translate-x":em()}],"translate-y":[{"translate-y":em()}],"translate-z":[{"translate-z":em()}],"translate-none":["translate-none"],accent:[{accent:er()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:er()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q,Q]}],fill:[{fill:["none",...er()]}],"stroke-w":[{stroke:[T,W,z,H]}],stroke:[{stroke:["none",...er()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})},874(e,t,r){"use strict";let i,n,a,s,o;r.d(t,{$Kf:()=>rg,A$4:()=>tw,AQS:()=>p,B69:()=>e5,BH$:()=>r$,BKk:()=>tZ,BRH:()=>nd,CSG:()=>iY,D$Q:()=>iq,DXC:()=>rY,EAD:()=>rv,F1T:()=>t4,FCc:()=>rK,FZo:()=>nM,FvD:()=>r4,GOR:()=>r6,GYF:()=>rm,Gc6:()=>ie,Gu$:()=>ij,GxU:()=>tv,HgN:()=>q,HiM:()=>nS,Hit:()=>i9,I46:()=>rf,I9Y:()=>D,IUQ:()=>Z,Iit:()=>tK,Iw4:()=>nH,KPJ:()=>nn,Kzg:()=>nR,LlO:()=>tJ,LoY:()=>tD,MBL:()=>i7,MSw:()=>iV,MW4:()=>t_,N1A:()=>rj,NRn:()=>en,Nex:()=>nX,Nv2:()=>r5,Nwf:()=>nO,O9p:()=>ez,ONl:()=>r2,PPD:()=>rF,PTz:()=>L,Pq0:()=>F,Q1f:()=>tp,Qev:()=>S,R3r:()=>re,R8M:()=>b,RiT:()=>nt,Rm2:()=>A,THS:()=>tE,Tap:()=>np,V9B:()=>tA,VCu:()=>r7,Y9S:()=>nc,YHV:()=>nW,YJl:()=>t6,Z58:()=>rt,ZLX:()=>rI,Zcv:()=>rk,Zr2:()=>h,ZyN:()=>n_,_4j:()=>iW,_Ut:()=>t$,a55:()=>C,aHM:()=>ns,aVO:()=>iK,b4q:()=>t8,bdM:()=>iG,c5h:()=>r9,cj9:()=>P,dYF:()=>ei,dwI:()=>O,eB$:()=>rr,eHs:()=>rn,eaF:()=>tq,gPd:()=>J,iNn:()=>tX,iOZ:()=>r8,imn:()=>tm,iyt:()=>eS,jej:()=>x,kLi:()=>X,kn4:()=>eB,lGw:()=>i0,lMl:()=>tl,lPF:()=>g,lxW:()=>tY,mcG:()=>y,mrM:()=>rN,nCl:()=>ny,nWS:()=>et,nZQ:()=>nB,o6l:()=>t9,ppV:()=>G,qUd:()=>nE,qq$:()=>f,qtW:()=>tC,r6x:()=>nI,rFo:()=>er,rjZ:()=>it,tBo:()=>nV,tz3:()=>nr,uSd:()=>iX,uWO:()=>ry,ubm:()=>t5,ypk:()=>iS,z3S:()=>v,zgK:()=>eH});let l="attached",c="srgb",h="srgb-linear",u="linear",d="srgb";function p(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function f(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function g(){let e=f("canvas");return e.style.display="block",e}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let m={};function A(...e){console.log("THREE."+e.shift(),...e)}function b(...e){console.warn("THREE."+e.shift(),...e)}function v(...e){console.error("THREE."+e.shift(),...e)}function y(...e){let t=e.join(" ");t in m||(m[t]=!0,b(...e))}function x(e,t,r){return new Promise(function(i,n){setTimeout(function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:n();break;case e.TIMEOUT_EXPIRED:setTimeout(a,r);break;default:i()}},r)})}class S{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){let r=this._listeners;return void 0!==r&&void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){let r=this._listeners;if(void 0===r)return;let i=r[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let r=t[e.type];if(void 0!==r){e.target=this;let t=r.slice(0);for(let r=0,i=t.length;r<i;r++)t[r].call(this,e);e.target=null}}}let E=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],w=1234567,_=Math.PI/180,C=180/Math.PI;function M(){let e=0xffffffff*Math.random()|0,t=0xffffffff*Math.random()|0,r=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0;return(E[255&e]+E[e>>8&255]+E[e>>16&255]+E[e>>24&255]+"-"+E[255&t]+E[t>>8&255]+"-"+E[t>>16&15|64]+E[t>>24&255]+"-"+E[63&r|128]+E[r>>8&255]+"-"+E[r>>16&255]+E[r>>24&255]+E[255&i]+E[i>>8&255]+E[i>>16&255]+E[i>>24&255]).toLowerCase()}function I(e,t,r){return Math.max(t,Math.min(r,e))}function T(e,t){return(e%t+t)%t}function R(e,t,r){return(1-r)*e+r*t}function B(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function k(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let P={DEG2RAD:_,RAD2DEG:C,generateUUID:M,clamp:I,euclideanModulo:T,mapLinear:function(e,t,r,i,n){return i+(e-t)*(n-i)/(r-t)},inverseLerp:function(e,t,r){return e!==t?(r-e)/(t-e):0},lerp:R,damp:function(e,t,r,i){return R(e,t,1-Math.exp(-r*i))},pingpong:function(e,t=1){return t-Math.abs(T(e,2*t)-t)},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(w=e);let t=w+=0x6d2b79f5;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/0x100000000},degToRad:function(e){return e*_},radToDeg:function(e){return e*C},isPowerOfTwo:function(e){return(e&e-1)==0&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,r,i,n){let a=Math.cos,s=Math.sin,o=a(r/2),l=s(r/2),c=a((t+i)/2),h=s((t+i)/2),u=a((t-i)/2),d=s((t-i)/2),p=a((i-t)/2),f=s((i-t)/2);switch(n){case"XYX":e.set(o*h,l*u,l*d,o*c);break;case"YZY":e.set(l*d,o*h,l*u,o*c);break;case"ZXZ":e.set(l*u,l*d,o*h,o*c);break;case"XZX":e.set(o*h,l*f,l*p,o*c);break;case"YXY":e.set(l*p,o*h,l*f,o*c);break;case"ZYZ":e.set(l*f,l*p,o*h,o*c);break;default:b("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}},normalize:k,denormalize:B};class D{constructor(e=0,t=0){D.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=I(this.x,e.x,t.x),this.y=I(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=I(this.x,e,t),this.y=I(this.y,e,t),this}clampLength(e,t){let r=this.length();return this.divideScalar(r||1).multiplyScalar(I(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(I(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let r=Math.cos(t),i=Math.sin(t),n=this.x-e.x,a=this.y-e.y;return this.x=n*r-a*i+e.x,this.y=n*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class L{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,n,a,s){let o=r[i+0],l=r[i+1],c=r[i+2],h=r[i+3],u=n[a+0],d=n[a+1],p=n[a+2],f=n[a+3];if(s<=0){e[t+0]=o,e[t+1]=l,e[t+2]=c,e[t+3]=h;return}if(s>=1){e[t+0]=u,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(h!==f||o!==u||l!==d||c!==p){let e=o*u+l*d+c*p+h*f;e<0&&(u=-u,d=-d,p=-p,f=-f,e=-e);let t=1-s;if(e<.9995){let r=Math.acos(e),i=Math.sin(r);o=o*(t=Math.sin(t*r)/i)+u*(s=Math.sin(s*r)/i),l=l*t+d*s,c=c*t+p*s,h=h*t+f*s}else{let e=1/Math.sqrt((o=o*t+u*s)*o+(l=l*t+d*s)*l+(c=c*t+p*s)*c+(h=h*t+f*s)*h);o*=e,l*=e,c*=e,h*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,r,i,n,a){let s=r[i],o=r[i+1],l=r[i+2],c=r[i+3],h=n[a],u=n[a+1],d=n[a+2],p=n[a+3];return e[t]=s*p+c*h+o*d-l*u,e[t+1]=o*p+c*u+l*h-s*d,e[t+2]=l*p+c*d+s*u-o*h,e[t+3]=c*p-s*h-o*u-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let r=e._x,i=e._y,n=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(r/2),c=s(i/2),h=s(n/2),u=o(r/2),d=o(i/2),p=o(n/2);switch(a){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:b("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,r=t[0],i=t[4],n=t[8],a=t[1],s=t[5],o=t[9],l=t[2],c=t[6],h=t[10],u=r+s+h;if(u>0){let e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-o)*e,this._y=(n-l)*e,this._z=(a-i)*e}else if(r>s&&r>h){let e=2*Math.sqrt(1+r-s-h);this._w=(c-o)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(n+l)/e}else if(s>h){let e=2*Math.sqrt(1+s-r-h);this._w=(n-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(o+c)/e}else{let e=2*Math.sqrt(1+h-r-s);this._w=(a-i)/e,this._x=(n+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<1e-8?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=r,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(I(this.dot(e),-1,1)))}rotateTowards(e,t){let r=this.angleTo(e);if(0===r)return this;let i=Math.min(1,t/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let r=e._x,i=e._y,n=e._z,a=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=r*c+a*s+i*l-n*o,this._y=i*c+a*o+n*s-r*l,this._z=n*c+a*l+r*o-i*s,this._w=a*c-r*s-i*o-n*l,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let r=e._x,i=e._y,n=e._z,a=e._w,s=this.dot(e);s<0&&(r=-r,i=-i,n=-n,a=-a,s=-s);let o=1-t;if(s<.9995){let e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+r*t,this._y=this._y*o+i*t,this._z=this._z*o+n*t,this._w=this._w*o+a*t,this._onChangeCallback()}else this._x=this._x*o+r*t,this._y=this._y*o+i*t,this._z=this._z*o+n*t,this._w=this._w*o+a*t,this.normalize();return this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),n=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),n*Math.sin(t),n*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,r=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(U.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(U.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,r=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6]*i,this.y=n[1]*t+n[4]*r+n[7]*i,this.z=n[2]*t+n[5]*r+n[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,r=this.y,i=this.z,n=e.elements,a=1/(n[3]*t+n[7]*r+n[11]*i+n[15]);return this.x=(n[0]*t+n[4]*r+n[8]*i+n[12])*a,this.y=(n[1]*t+n[5]*r+n[9]*i+n[13])*a,this.z=(n[2]*t+n[6]*r+n[10]*i+n[14])*a,this}applyQuaternion(e){let t=this.x,r=this.y,i=this.z,n=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*i-s*r),c=2*(s*t-n*i),h=2*(n*r-a*t);return this.x=t+o*l+a*h-s*c,this.y=r+o*c+s*l-n*h,this.z=i+o*h+n*c-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,r=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[4]*r+n[8]*i,this.y=n[1]*t+n[5]*r+n[9]*i,this.z=n[2]*t+n[6]*r+n[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=I(this.x,e.x,t.x),this.y=I(this.y,e.y,t.y),this.z=I(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=I(this.x,e,t),this.y=I(this.y,e,t),this.z=I(this.z,e,t),this}clampLength(e,t){let r=this.length();return this.divideScalar(r||1).multiplyScalar(I(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let r=e.x,i=e.y,n=e.z,a=t.x,s=t.y,o=t.z;return this.x=i*o-n*s,this.y=n*a-r*o,this.z=r*s-i*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return N.copy(this).projectOnVector(e),this.sub(N)}reflect(e){return this.sub(N.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(I(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){let i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let N=new F,U=new L;class O{constructor(e,t,r,i,n,a,s,o,l){O.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,r,i,n,a,s,o,l)}set(e,t,r,i,n,a,s,o,l){let c=this.elements;return c[0]=e,c[1]=i,c[2]=s,c[3]=t,c[4]=n,c[5]=o,c[6]=r,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let r=e.elements,i=t.elements,n=this.elements,a=r[0],s=r[3],o=r[6],l=r[1],c=r[4],h=r[7],u=r[2],d=r[5],p=r[8],f=i[0],g=i[3],m=i[6],A=i[1],b=i[4],v=i[7],y=i[2],x=i[5],S=i[8];return n[0]=a*f+s*A+o*y,n[3]=a*g+s*b+o*x,n[6]=a*m+s*v+o*S,n[1]=l*f+c*A+h*y,n[4]=l*g+c*b+h*x,n[7]=l*m+c*v+h*S,n[2]=u*f+d*A+p*y,n[5]=u*g+d*b+p*x,n[8]=u*m+d*v+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*a*c-t*s*l-r*n*c+r*s*o+i*n*l-i*a*o}invert(){let e=this.elements,t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],h=c*a-s*l,u=s*o-c*n,d=l*n-a*o,p=t*h+r*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=h*f,e[1]=(i*l-c*r)*f,e[2]=(s*r-i*a)*f,e[3]=u*f,e[4]=(c*t-i*o)*f,e[5]=(i*n-s*t)*f,e[6]=d*f,e[7]=(r*o-l*t)*f,e[8]=(a*t-r*n)*f,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,n,a,s){let o=Math.cos(n),l=Math.sin(n);return this.set(r*o,r*l,-r*(o*a+l*s)+a+e,-i*l,i*o,-i*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(Q.makeScale(e,t)),this}rotate(e){return this.premultiply(Q.makeRotation(-e)),this}translate(e,t){return this.premultiply(Q.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,r=e.elements;for(let e=0;e<9;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){let r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let Q=new O,z=new O().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),H=new O().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),G=(a=[.64,.33,.3,.6,.15,.06],s=[.2126,.7152,.0722],o=[.3127,.329],(n={enabled:!0,workingColorSpace:h,spaces:{},convert:function(e,t,r){return!1!==this.enabled&&t!==r&&t&&r&&(this.spaces[t].transfer===d&&(e.r=V(e.r),e.g=V(e.g),e.b=V(e.b)),this.spaces[t].primaries!==this.spaces[r].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[r].fromXYZ)),this.spaces[r].transfer===d&&(e.r=j(e.r),e.g=j(e.g),e.b=j(e.b))),e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return""===e?u:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,r){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[r].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,t){return y("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(e,t)},toWorkingColorSpace:function(e,t){return y("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(e,t)}}).define({[h]:{primaries:a,whitePoint:o,transfer:u,toXYZ:z,fromXYZ:H,luminanceCoefficients:s,workingColorSpaceConfig:{unpackColorSpace:c},outputColorSpaceConfig:{drawingBufferColorSpace:c}},[c]:{primaries:a,whitePoint:o,transfer:d,toXYZ:z,fromXYZ:H,luminanceCoefficients:s,outputColorSpaceConfig:{drawingBufferColorSpace:c}}}),n);function V(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function j(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class q{static getDataURL(e,t="image/png"){let r;if(/^data:/i.test(e.src)||"u"<typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)r=e;else{void 0===i&&(i=f("canvas")),i.width=e.width,i.height=e.height;let t=i.getContext("2d");e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),r=i}return r.toDataURL(t)}static sRGBToLinear(e){if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap){let t=f("canvas");t.width=e.width,t.height=e.height;let r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);let i=r.getImageData(0,0,e.width,e.height),n=i.data;for(let e=0;e<n.length;e++)n[e]=255*V(n[e]/255);return r.putImageData(i,0,0),t}if(!e.data)return b("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e;{let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*V(t[e]/255)):t[e]=V(t[e]);return{data:t,width:e.width,height:e.height}}}}let W=0;class X{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:W++}),this.uuid=M(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return"u">typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"u">typeof VideoFrame&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let r={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,r=i.length;t<r;t++)i[t].isDataTexture?e.push(Y(i[t].image)):e.push(Y(i[t]))}else e=Y(i);r.url=e}return t||(e.images[this.uuid]=r),r}}function Y(e){return"u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap?q.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(b("Texture: Unable to serialize Texture."),{})}let K=0,$=new F;class J extends S{constructor(e=J.DEFAULT_IMAGE,t=J.DEFAULT_MAPPING,r=1001,i=1001,n=1006,a=1008,s=1023,o=1009,l=J.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:K++}),this.uuid=M(),this.name="",this.source=new X(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=n,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new D(0,0),this.repeat=new D(1,1),this.center=new D(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new O,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!e&&!!e.depth&&e.depth>1,this.pmremVersion=0}get width(){return this.source.getSize($).x}get height(){return this.source.getSize($).y}get depth(){return this.source.getSize($).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let r=e[t];if(void 0===r){b(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){b(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[t]=r}}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}J.DEFAULT_IMAGE=null,J.DEFAULT_MAPPING=300,J.DEFAULT_ANISOTROPY=1;class Z{constructor(e=0,t=0,r=0,i=1){Z.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,r=this.y,i=this.z,n=this.w,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*i+a[12]*n,this.y=a[1]*t+a[5]*r+a[9]*i+a[13]*n,this.z=a[2]*t+a[6]*r+a[10]*i+a[14]*n,this.w=a[3]*t+a[7]*r+a[11]*i+a[15]*n,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,n,a=e.elements,s=a[0],o=a[4],l=a[8],c=a[1],h=a[5],u=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-c)&&.01>Math.abs(l-d)&&.01>Math.abs(u-p)){if(.1>Math.abs(o+c)&&.1>Math.abs(l+d)&&.1>Math.abs(u+p)&&.1>Math.abs(s+h+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(h+1)/2,g=(f+1)/2,m=(o+c)/4,A=(l+d)/4,b=(u+p)/4;return e>a&&e>g?e<.01?(r=0,i=.707106781,n=.707106781):(i=m/(r=Math.sqrt(e)),n=A/r):a>g?a<.01?(r=.707106781,i=0,n=.707106781):(r=m/(i=Math.sqrt(a)),n=b/i):g<.01?(r=.707106781,i=.707106781,n=0):(r=A/(n=Math.sqrt(g)),i=b/n),this.set(r,i,n,t),this}let g=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(c-o)*(c-o));return .001>Math.abs(g)&&(g=1),this.x=(p-u)/g,this.y=(l-d)/g,this.z=(c-o)/g,this.w=Math.acos((s+h+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=I(this.x,e.x,t.x),this.y=I(this.y,e.y,t.y),this.z=I(this.z,e.z,t.z),this.w=I(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=I(this.x,e,t),this.y=I(this.y,e,t),this.z=I(this.z,e,t),this.w=I(this.w,e,t),this}clampLength(e,t){let r=this.length();return this.divideScalar(r||1).multiplyScalar(I(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class ee extends S{constructor(e=1,t=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},r),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=r.depth,this.scissor=new Z(0,0,e,t),this.scissorTest=!1,this.viewport=new Z(0,0,e,t);const i=new J({width:e,height:t,depth:r.depth});this.textures=[];const n=r.count;for(let e=0;e<n;e++)this.textures[e]=i.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(r),this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.resolveDepthBuffer=r.resolveDepthBuffer,this.resolveStencilBuffer=r.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=r.depthTexture,this.samples=r.samples,this.multiview=r.multiview}_setTextureOptions(e={}){let t={minFilter:1006,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let i=0,n=this.textures.length;i<n;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=r,!0!==this.textures[i].isData3DTexture&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,r=e.textures.length;t<r;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let r=Object.assign({},e.textures[t].image);this.textures[t].source=new X(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class et extends ee{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class er extends J{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ei extends J{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class en{constructor(e=new F(Infinity,Infinity,Infinity),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(es.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,r=e.count;t<r;t++)this.expandByPoint(es.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let r=es.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let r=e.geometry;if(void 0!==r){let i=r.getAttribute("position");if(!0===t&&void 0!==i&&!0!==e.isInstancedMesh)for(let t=0,r=i.count;t<r;t++)!0===e.isMesh?e.getVertexPosition(t,es):es.fromBufferAttribute(i,t),es.applyMatrix4(e.matrixWorld),this.expandByPoint(es);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),eo.copy(e.boundingBox)):(null===r.boundingBox&&r.computeBoundingBox(),eo.copy(r.boundingBox)),eo.applyMatrix4(e.matrixWorld),this.union(eo)}let i=e.children;for(let e=0,r=i.length;e<r;e++)this.expandByObject(i[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,es),es.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ef),eg.subVectors(this.max,ef),el.subVectors(e.a,ef),ec.subVectors(e.b,ef),eh.subVectors(e.c,ef),eu.subVectors(ec,el),ed.subVectors(eh,ec),ep.subVectors(el,eh);let t=[0,-eu.z,eu.y,0,-ed.z,ed.y,0,-ep.z,ep.y,eu.z,0,-eu.x,ed.z,0,-ed.x,ep.z,0,-ep.x,-eu.y,eu.x,0,-ed.y,ed.x,0,-ep.y,ep.x,0];return!!eb(t,el,ec,eh,eg)&&!!eb(t=[1,0,0,0,1,0,0,0,1],el,ec,eh,eg)&&(em.crossVectors(eu,ed),eb(t=[em.x,em.y,em.z],el,ec,eh,eg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,es).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(es).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(ea[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ea[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ea[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ea[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ea[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ea[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ea[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ea[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ea)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}let ea=[new F,new F,new F,new F,new F,new F,new F,new F],es=new F,eo=new en,el=new F,ec=new F,eh=new F,eu=new F,ed=new F,ep=new F,ef=new F,eg=new F,em=new F,eA=new F;function eb(e,t,r,i,n){for(let a=0,s=e.length-3;a<=s;a+=3){eA.fromArray(e,a);let s=n.x*Math.abs(eA.x)+n.y*Math.abs(eA.y)+n.z*Math.abs(eA.z),o=t.dot(eA),l=r.dot(eA),c=i.dot(eA);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}let ev=new en,ey=new F,ex=new F;class eS{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let r=this.center;void 0!==t?r.copy(t):ev.setFromPoints(e).getCenter(r);let i=0;for(let t=0,n=e.length;t<n;t++)i=Math.max(i,r.distanceToSquared(e[t]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ey.subVectors(e,this.center);let t=ey.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),r=(e-this.radius)*.5;this.center.addScaledVector(ey,r/e),this.radius+=r}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(ex.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ey.copy(e.center).add(ex)),this.expandByPoint(ey.copy(e.center).sub(ex)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let eE=new F,ew=new F,e_=new F,eC=new F,eM=new F,eI=new F,eT=new F;class eR{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,eE)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=eE.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(eE.copy(this.origin).addScaledVector(this.direction,t),eE.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){let n,a,s,o;ew.copy(e).add(t).multiplyScalar(.5),e_.copy(t).sub(e).normalize(),eC.copy(this.origin).sub(ew);let l=.5*e.distanceTo(t),c=-this.direction.dot(e_),h=eC.dot(this.direction),u=-eC.dot(e_),d=eC.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(n=c*u-h,a=c*h-u,o=l*p,n>=0)if(a>=-o)if(a<=o){let e=1/p;n*=e,a*=e,s=n*(n+c*a+2*h)+a*(c*n+a+2*u)+d}else s=-(n=Math.max(0,-(c*(a=l)+h)))*n+a*(a+2*u)+d;else s=-(n=Math.max(0,-(c*(a=-l)+h)))*n+a*(a+2*u)+d;else a<=-o?(a=(n=Math.max(0,-(-c*l+h)))>0?-l:Math.min(Math.max(-l,-u),l),s=-n*n+a*(a+2*u)+d):a<=o?(n=0,s=(a=Math.min(Math.max(-l,-u),l))*(a+2*u)+d):(a=(n=Math.max(0,-(c*l+h)))>0?l:Math.min(Math.max(-l,-u),l),s=-n*n+a*(a+2*u)+d);else a=c>0?-l:l,s=-(n=Math.max(0,-(c*a+h)))*n+a*(a+2*u)+d;return r&&r.copy(this.origin).addScaledVector(this.direction,n),i&&i.copy(ew).addScaledVector(e_,a),s}intersectSphere(e,t){eE.subVectors(e.center,this.origin);let r=eE.dot(this.direction),i=eE.dot(eE)-r*r,n=e.radius*e.radius;if(i>n)return null;let a=Math.sqrt(n-i),s=r-a,o=r+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){let r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let r,i,n,a,s,o,l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return(l>=0?(r=(e.min.x-u.x)*l,i=(e.max.x-u.x)*l):(r=(e.max.x-u.x)*l,i=(e.min.x-u.x)*l),c>=0?(n=(e.min.y-u.y)*c,a=(e.max.y-u.y)*c):(n=(e.max.y-u.y)*c,a=(e.min.y-u.y)*c),r>a||n>i||((n>r||isNaN(r))&&(r=n),(a<i||isNaN(i))&&(i=a),h>=0?(s=(e.min.z-u.z)*h,o=(e.max.z-u.z)*h):(s=(e.max.z-u.z)*h,o=(e.min.z-u.z)*h),r>o||s>i||((s>r||r!=r)&&(r=s),(o<i||i!=i)&&(i=o),i<0)))?null:this.at(r>=0?r:i,t)}intersectsBox(e){return null!==this.intersectBox(e,eE)}intersectTriangle(e,t,r,i,n){let a;eM.subVectors(t,e),eI.subVectors(r,e),eT.crossVectors(eM,eI);let s=this.direction.dot(eT);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}eC.subVectors(this.origin,e);let o=a*this.direction.dot(eI.crossVectors(eC,eI));if(o<0)return null;let l=a*this.direction.dot(eM.cross(eC));if(l<0||o+l>s)return null;let c=-a*eC.dot(eT);return c<0?null:this.at(c/s,n)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class eB{constructor(e,t,r,i,n,a,s,o,l,c,h,u,d,p,f,g){eB.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,r,i,n,a,s,o,l,c,h,u,d,p,f,g)}set(e,t,r,i,n,a,s,o,l,c,h,u,d,p,f,g){let m=this.elements;return m[0]=e,m[4]=t,m[8]=r,m[12]=i,m[1]=n,m[5]=a,m[9]=s,m[13]=o,m[2]=l,m[6]=c,m[10]=h,m[14]=u,m[3]=d,m[7]=p,m[11]=f,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new eB().fromArray(this.elements)}copy(e){let t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){let t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return 0===this.determinant()?(e.set(1,0,0),t.set(0,1,0),r.set(0,0,1)):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2)),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinant())return this.identity();let t=this.elements,r=e.elements,i=1/ek.setFromMatrixColumn(e,0).length(),n=1/ek.setFromMatrixColumn(e,1).length(),a=1/ek.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*n,t[5]=r[5]*n,t[6]=r[6]*n,t[7]=0,t[8]=r[8]*a,t[9]=r[9]*a,t[10]=r[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,r=e.x,i=e.y,n=e.z,a=Math.cos(r),s=Math.sin(r),o=Math.cos(i),l=Math.sin(i),c=Math.cos(n),h=Math.sin(n);if("XYZ"===e.order){let e=a*c,r=a*h,i=s*c,n=s*h;t[0]=o*c,t[4]=-o*h,t[8]=l,t[1]=r+i*l,t[5]=e-n*l,t[9]=-s*o,t[2]=n-e*l,t[6]=i+r*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*c,r=o*h,i=l*c,n=l*h;t[0]=e+n*s,t[4]=i*s-r,t[8]=a*l,t[1]=a*h,t[5]=a*c,t[9]=-s,t[2]=r*s-i,t[6]=n+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*c,r=o*h,i=l*c,n=l*h;t[0]=e-n*s,t[4]=-a*h,t[8]=i+r*s,t[1]=r+i*s,t[5]=a*c,t[9]=n-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*c,r=a*h,i=s*c,n=s*h;t[0]=o*c,t[4]=i*l-r,t[8]=e*l+n,t[1]=o*h,t[5]=n*l+e,t[9]=r*l-i,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,r=a*l,i=s*o,n=s*l;t[0]=o*c,t[4]=n-e*h,t[8]=i*h+r,t[1]=h,t[5]=a*c,t[9]=-s*c,t[2]=-l*c,t[6]=r*h+i,t[10]=e-n*h}else if("XZY"===e.order){let e=a*o,r=a*l,i=s*o,n=s*l;t[0]=o*c,t[4]=-h,t[8]=l*c,t[1]=e*h+n,t[5]=a*c,t[9]=r*h-i,t[2]=i*h-r,t[6]=s*c,t[10]=n*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(eD,e,eL)}lookAt(e,t,r){let i=this.elements;return eU.subVectors(e,t),0===eU.lengthSq()&&(eU.z=1),eU.normalize(),eF.crossVectors(r,eU),0===eF.lengthSq()&&(1===Math.abs(r.z)?eU.x+=1e-4:eU.z+=1e-4,eU.normalize(),eF.crossVectors(r,eU)),eF.normalize(),eN.crossVectors(eU,eF),i[0]=eF.x,i[4]=eN.x,i[8]=eU.x,i[1]=eF.y,i[5]=eN.y,i[9]=eU.y,i[2]=eF.z,i[6]=eN.z,i[10]=eU.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let r=e.elements,i=t.elements,n=this.elements,a=r[0],s=r[4],o=r[8],l=r[12],c=r[1],h=r[5],u=r[9],d=r[13],p=r[2],f=r[6],g=r[10],m=r[14],A=r[3],b=r[7],v=r[11],y=r[15],x=i[0],S=i[4],E=i[8],w=i[12],_=i[1],C=i[5],M=i[9],I=i[13],T=i[2],R=i[6],B=i[10],k=i[14],P=i[3],D=i[7],L=i[11],F=i[15];return n[0]=a*x+s*_+o*T+l*P,n[4]=a*S+s*C+o*R+l*D,n[8]=a*E+s*M+o*B+l*L,n[12]=a*w+s*I+o*k+l*F,n[1]=c*x+h*_+u*T+d*P,n[5]=c*S+h*C+u*R+d*D,n[9]=c*E+h*M+u*B+d*L,n[13]=c*w+h*I+u*k+d*F,n[2]=p*x+f*_+g*T+m*P,n[6]=p*S+f*C+g*R+m*D,n[10]=p*E+f*M+g*B+m*L,n[14]=p*w+f*I+g*k+m*F,n[3]=A*x+b*_+v*T+y*P,n[7]=A*S+b*C+v*R+y*D,n[11]=A*E+b*M+v*B+y*L,n[15]=A*w+b*I+v*k+y*F,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],r=e[4],i=e[8],n=e[12],a=e[1],s=e[5],o=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14],p=e[3],f=e[7],g=e[11],m=e[15],A=o*d-l*u,b=s*d-l*h,v=s*u-o*h,y=a*d-l*c,x=a*u-o*c,S=a*h-s*c;return t*(f*A-g*b+m*v)-r*(p*A-g*y+m*x)+i*(p*b-f*y+m*S)-n*(p*v-f*x+g*S)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,r){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){let e=this.elements,t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],g=e[14],m=e[15],A=h*g*l-f*u*l+f*o*d-s*g*d-h*o*m+s*u*m,b=p*u*l-c*g*l-p*o*d+a*g*d+c*o*m-a*u*m,v=c*f*l-p*h*l+p*s*d-a*f*d-c*s*m+a*h*m,y=p*h*o-c*f*o-p*s*u+a*f*u+c*s*g-a*h*g,x=t*A+r*b+i*v+n*y;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=A*S,e[1]=(f*u*n-h*g*n-f*i*d+r*g*d+h*i*m-r*u*m)*S,e[2]=(s*g*n-f*o*n+f*i*l-r*g*l-s*i*m+r*o*m)*S,e[3]=(h*o*n-s*u*n-h*i*l+r*u*l+s*i*d-r*o*d)*S,e[4]=b*S,e[5]=(c*g*n-p*u*n+p*i*d-t*g*d-c*i*m+t*u*m)*S,e[6]=(p*o*n-a*g*n-p*i*l+t*g*l+a*i*m-t*o*m)*S,e[7]=(a*u*n-c*o*n+c*i*l-t*u*l-a*i*d+t*o*d)*S,e[8]=v*S,e[9]=(p*h*n-c*f*n-p*r*d+t*f*d+c*r*m-t*h*m)*S,e[10]=(a*f*n-p*s*n+p*r*l-t*f*l-a*r*m+t*s*m)*S,e[11]=(c*s*n-a*h*n-c*r*l+t*h*l+a*r*d-t*s*d)*S,e[12]=y*S,e[13]=(c*f*i-p*h*i+p*r*u-t*f*u-c*r*g+t*h*g)*S,e[14]=(p*s*i-a*f*i-p*r*o+t*f*o+a*r*g-t*s*g)*S,e[15]=(a*h*i-c*s*i+c*r*o-t*h*o-a*r*u+t*s*u)*S,this}scale(e){let t=this.elements,r=e.x,i=e.y,n=e.z;return t[0]*=r,t[4]*=i,t[8]*=n,t[1]*=r,t[5]*=i,t[9]*=n,t[2]*=r,t[6]*=i,t[10]*=n,t[3]*=r,t[7]*=i,t[11]*=n,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let r=Math.cos(t),i=Math.sin(t),n=1-r,a=e.x,s=e.y,o=e.z,l=n*a,c=n*s;return this.set(l*a+r,l*s-i*o,l*o+i*s,0,l*s+i*o,c*s+r,c*o-i*a,0,l*o-i*s,c*o+i*a,n*o*o+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,n,a){return this.set(1,r,n,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){let i=this.elements,n=t._x,a=t._y,s=t._z,o=t._w,l=n+n,c=a+a,h=s+s,u=n*l,d=n*c,p=n*h,f=a*c,g=a*h,m=s*h,A=o*l,b=o*c,v=o*h,y=r.x,x=r.y,S=r.z;return i[0]=(1-(f+m))*y,i[1]=(d+v)*y,i[2]=(p-b)*y,i[3]=0,i[4]=(d-v)*x,i[5]=(1-(u+m))*x,i[6]=(g+A)*x,i[7]=0,i[8]=(p+b)*S,i[9]=(g-A)*S,i[10]=(1-(u+f))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){let i=this.elements;if(e.x=i[12],e.y=i[13],e.z=i[14],0===this.determinant())return r.set(1,1,1),t.identity(),this;let n=ek.set(i[0],i[1],i[2]).length(),a=ek.set(i[4],i[5],i[6]).length(),s=ek.set(i[8],i[9],i[10]).length();0>this.determinant()&&(n=-n),eP.copy(this);let o=1/n,l=1/a,c=1/s;return eP.elements[0]*=o,eP.elements[1]*=o,eP.elements[2]*=o,eP.elements[4]*=l,eP.elements[5]*=l,eP.elements[6]*=l,eP.elements[8]*=c,eP.elements[9]*=c,eP.elements[10]*=c,t.setFromRotationMatrix(eP),r.x=n,r.y=a,r.z=s,this}makePerspective(e,t,r,i,n,a,s=2e3,o=!1){let l,c,h=this.elements;if(o)l=n/(a-n),c=a*n/(a-n);else if(2e3===s)l=-(a+n)/(a-n),c=-2*a*n/(a-n);else if(2001===s)l=-a/(a-n),c=-a*n/(a-n);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return h[0]=2*n/(t-e),h[4]=0,h[8]=(t+e)/(t-e),h[12]=0,h[1]=0,h[5]=2*n/(r-i),h[9]=(r+i)/(r-i),h[13]=0,h[2]=0,h[6]=0,h[10]=l,h[14]=c,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,r,i,n,a,s=2e3,o=!1){let l,c,h=this.elements;if(o)l=1/(a-n),c=a/(a-n);else if(2e3===s)l=-2/(a-n),c=-(a+n)/(a-n);else if(2001===s)l=-1/(a-n),c=-n/(a-n);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return h[0]=2/(t-e),h[4]=0,h[8]=0,h[12]=-(t+e)/(t-e),h[1]=0,h[5]=2/(r-i),h[9]=0,h[13]=-(r+i)/(r-i),h[2]=0,h[6]=0,h[10]=l,h[14]=c,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){let t=this.elements,r=e.elements;for(let e=0;e<16;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){let r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}let ek=new F,eP=new eB,eD=new F(0,0,0),eL=new F(1,1,1),eF=new F,eN=new F,eU=new F,eO=new eB,eQ=new L;class ez{constructor(e=0,t=0,r=0,i=ez.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){let i=e.elements,n=i[0],a=i[4],s=i[8],o=i[1],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(I(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,n)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-I(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,n),this._z=0);break;case"ZXY":this._x=Math.asin(I(u,-1,1)),.9999999>Math.abs(u)?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,n));break;case"ZYX":this._y=Math.asin(-I(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,n)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(I(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,n)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-I(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(u,l),this._y=Math.atan2(s,n)):(this._x=Math.atan2(-c,d),this._y=0);break;default:b("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return eO.makeRotationFromQuaternion(e),this.setFromRotationMatrix(eO,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return eQ.setFromEuler(this),this.setFromQuaternion(eQ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ez.DEFAULT_ORDER="XYZ";class eH{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!=0}isEnabled(e){return(this.mask&1<<e)!=0}}let eG=0,eV=new F,ej=new L,eq=new eB,eW=new F,eX=new F,eY=new F,eK=new L,e$=new F(1,0,0),eJ=new F(0,1,0),eZ=new F(0,0,1),e0={type:"added"},e1={type:"removed"},e2={type:"childadded",child:null},e3={type:"childremoved",child:null};class e5 extends S{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:eG++}),this.uuid=M(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=e5.DEFAULT_UP.clone();const e=new F,t=new ez,r=new L,i=new F(1,1,1);t._onChange(function(){r.setFromEuler(t,!1)}),r._onChange(function(){t.setFromQuaternion(r,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new eB},normalMatrix:{value:new O}}),this.matrix=new eB,this.matrixWorld=new eB,this.matrixAutoUpdate=e5.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e5.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new eH,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ej.setFromAxisAngle(e,t),this.quaternion.multiply(ej),this}rotateOnWorldAxis(e,t){return ej.setFromAxisAngle(e,t),this.quaternion.premultiply(ej),this}rotateX(e){return this.rotateOnAxis(e$,e)}rotateY(e){return this.rotateOnAxis(eJ,e)}rotateZ(e){return this.rotateOnAxis(eZ,e)}translateOnAxis(e,t){return eV.copy(e).applyQuaternion(this.quaternion),this.position.add(eV.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(e$,e)}translateY(e){return this.translateOnAxis(eJ,e)}translateZ(e){return this.translateOnAxis(eZ,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(eq.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?eW.copy(e):eW.set(e,t,r);let i=this.parent;this.updateWorldMatrix(!0,!1),eX.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?eq.lookAt(eX,eW,this.up):eq.lookAt(eW,eX,this.up),this.quaternion.setFromRotationMatrix(eq),i&&(eq.extractRotation(i.matrixWorld),ej.setFromRotationMatrix(eq),this.quaternion.premultiply(ej.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?v("Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(e0),e2.child=e,this.dispatchEvent(e2),e2.child=null):v("Object3D.add: object not an instance of THREE.Object3D.",e),this}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return -1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(e1),e3.child=e,this.dispatchEvent(e3),e3.child=null),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),eq.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),eq.multiply(e.parent.matrixWorld)),e.applyMatrix4(eq),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(e0),e2.child=e,this.dispatchEvent(e2),e2.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,i=this.children.length;r<i;r++){let i=this.children[r].getObjectByProperty(e,t);if(void 0!==i)return i}}getObjectsByProperty(e,t,r=[]){this[e]===t&&r.push(this);let i=this.children;for(let n=0,a=i.length;n<a;n++)i[n].getObjectsByProperty(e,t,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(eX,e,eY),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(eX,eK,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].updateMatrixWorld(e)}updateWorldMatrix(e,t){let r=this.parent;if(!0===e&&null!==r&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=void 0===e||"string"==typeof e,r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let i={};function n(t,r){return void 0===t[r.uuid]&&(t[r.uuid]=r.toJSON(e)),r.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(e=>({...e})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=n(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let r=t.shapes;if(Array.isArray(r))for(let t=0,i=r.length;t<i;t++){let i=r[t];n(e.shapes,i)}else n(e.shapes,r)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(n(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let t=[];for(let r=0,i=this.material.length;r<i;r++)t.push(n(e.materials,this.material[r]));i.material=t}else i.material=n(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){let r=this.animations[t];i.animations.push(n(e.animations,r))}}if(t){let t=a(e.geometries),i=a(e.materials),n=a(e.textures),s=a(e.images),o=a(e.shapes),l=a(e.skeletons),c=a(e.animations),h=a(e.nodes);t.length>0&&(r.geometries=t),i.length>0&&(r.materials=i),n.length>0&&(r.textures=n),s.length>0&&(r.images=s),o.length>0&&(r.shapes=o),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),h.length>0&&(r.nodes=h)}return r.object=i,r;function a(e){let t=[];for(let r in e){let i=e[r];delete i.metadata,t.push(i)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){let r=e.children[t];this.add(r.clone())}return this}}e5.DEFAULT_UP=new F(0,1,0),e5.DEFAULT_MATRIX_AUTO_UPDATE=!0,e5.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let e4=new F,e8=new F,e9=new F,e6=new F,e7=new F,te=new F,tt=new F,tr=new F,ti=new F,tn=new F,ta=new Z,ts=new Z,to=new Z;class tl{constructor(e=new F,t=new F,r=new F){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,i){i.subVectors(r,t),e4.subVectors(e,t),i.cross(e4);let n=i.lengthSq();return n>0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(e,t,r,i,n){e4.subVectors(i,t),e8.subVectors(r,t),e9.subVectors(e,t);let a=e4.dot(e4),s=e4.dot(e8),o=e4.dot(e9),l=e8.dot(e8),c=e8.dot(e9),h=a*l-s*s;if(0===h)return n.set(0,0,0),null;let u=1/h,d=(l*o-s*c)*u,p=(a*c-s*o)*u;return n.set(1-d-p,p,d)}static containsPoint(e,t,r,i){return null!==this.getBarycoord(e,t,r,i,e6)&&e6.x>=0&&e6.y>=0&&e6.x+e6.y<=1}static getInterpolation(e,t,r,i,n,a,s,o){return null===this.getBarycoord(e,t,r,i,e6)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(n,e6.x),o.addScaledVector(a,e6.y),o.addScaledVector(s,e6.z),o)}static getInterpolatedAttribute(e,t,r,i,n,a){return ta.setScalar(0),ts.setScalar(0),to.setScalar(0),ta.fromBufferAttribute(e,t),ts.fromBufferAttribute(e,r),to.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(ta,n.x),a.addScaledVector(ts,n.y),a.addScaledVector(to,n.z),a}static isFrontFacing(e,t,r,i){return e4.subVectors(r,t),e8.subVectors(e,t),0>e4.cross(e8).dot(i)}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return e4.subVectors(this.c,this.b),e8.subVectors(this.a,this.b),.5*e4.cross(e8).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return tl.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return tl.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,i,n){return tl.getInterpolation(e,this.a,this.b,this.c,t,r,i,n)}containsPoint(e){return tl.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return tl.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let r,i,n=this.a,a=this.b,s=this.c;e7.subVectors(a,n),te.subVectors(s,n),tr.subVectors(e,n);let o=e7.dot(tr),l=te.dot(tr);if(o<=0&&l<=0)return t.copy(n);ti.subVectors(e,a);let c=e7.dot(ti),h=te.dot(ti);if(c>=0&&h<=c)return t.copy(a);let u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return r=o/(o-c),t.copy(n).addScaledVector(e7,r);tn.subVectors(e,s);let d=e7.dot(tn),p=te.dot(tn);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return i=l/(l-p),t.copy(n).addScaledVector(te,i);let g=c*p-d*h;if(g<=0&&h-c>=0&&d-p>=0)return tt.subVectors(s,a),i=(h-c)/(h-c+(d-p)),t.copy(a).addScaledVector(tt,i);let m=1/(g+f+u);return r=f*m,i=u*m,t.copy(n).addScaledVector(e7,r).addScaledVector(te,i)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let tc={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},th={h:0,s:0,l:0},tu={h:0,s:0,l:0};function td(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*6*(2/3-r):e}class tp{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){return void 0===t&&void 0===r?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,r),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=c){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,G.colorSpaceToWorking(this,t),this}setRGB(e,t,r,i=G.workingColorSpace){return this.r=e,this.g=t,this.b=r,G.colorSpaceToWorking(this,i),this}setHSL(e,t,r,i=G.workingColorSpace){if(e=T(e,1),t=I(t,0,1),r=I(r,0,1),0===t)this.r=this.g=this.b=r;else{let i=r<=.5?r*(1+t):r+t-r*t,n=2*r-i;this.r=td(n,i,e+1/3),this.g=td(n,i,e),this.b=td(n,i,e-1/3)}return G.colorSpaceToWorking(this,i),this}setStyle(e,t=c){let r;function i(t){void 0!==t&&1>parseFloat(t)&&b("Color: Alpha component of "+e+" will be ignored.")}if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let n,a=r[1],s=r[2];switch(a){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,t);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,t);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,t);break;default:b("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=r[1],n=i.length;if(3===n)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(6===n)return this.setHex(parseInt(i,16),t);b("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=c){let r=tc[e.toLowerCase()];return void 0!==r?this.setHex(r,t):b("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=V(e.r),this.g=V(e.g),this.b=V(e.b),this}copyLinearToSRGB(e){return this.r=j(e.r),this.g=j(e.g),this.b=j(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=c){return G.workingToColorSpace(tf.copy(this),e),65536*Math.round(I(255*tf.r,0,255))+256*Math.round(I(255*tf.g,0,255))+Math.round(I(255*tf.b,0,255))}getHexString(e=c){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=G.workingColorSpace){let r,i;G.workingToColorSpace(tf.copy(this),t);let n=tf.r,a=tf.g,s=tf.b,o=Math.max(n,a,s),l=Math.min(n,a,s),c=(l+o)/2;if(l===o)r=0,i=0;else{let e=o-l;switch(i=c<=.5?e/(o+l):e/(2-o-l),o){case n:r=(a-s)/e+6*(a<s);break;case a:r=(s-n)/e+2;break;case s:r=(n-a)/e+4}r/=6}return e.h=r,e.s=i,e.l=c,e}getRGB(e,t=G.workingColorSpace){return G.workingToColorSpace(tf.copy(this),t),e.r=tf.r,e.g=tf.g,e.b=tf.b,e}getStyle(e=c){G.workingToColorSpace(tf.copy(this),e);let t=tf.r,r=tf.g,i=tf.b;return e!==c?`color(${e} ${t.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*r)},${Math.round(255*i)})`}offsetHSL(e,t,r){return this.getHSL(th),this.setHSL(th.h+e,th.s+t,th.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(th),e.getHSL(tu);let r=R(th.h,tu.h,t),i=R(th.s,tu.s,t),n=R(th.l,tu.l,t);return this.setHSL(r,i,n),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,r=this.g,i=this.b,n=e.elements;return this.r=n[0]*t+n[3]*r+n[6]*i,this.g=n[1]*t+n[4]*r+n[7]*i,this.b=n[2]*t+n[5]*r+n[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let tf=new tp;tp.NAMES=tc;let tg=0;class tm extends S{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:tg++}),this.uuid=M(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tp(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let r=e[t];if(void 0===r){b(`Material: parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){b(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(e){let t=[];for(let r in e){let i=e[r];delete i.metadata,t.push(i)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(r.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(r.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(r.dispersion=this.dispersion),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapRotation&&(r.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(r.blending=this.blending),0!==this.side&&(r.side=this.side),!0===this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=!0),204!==this.blendSrc&&(r.blendSrc=this.blendSrc),205!==this.blendDst&&(r.blendDst=this.blendDst),100!==this.blendEquation&&(r.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(r.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(r.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(r.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(r.depthFunc=this.depthFunc),!1===this.depthTest&&(r.depthTest=this.depthTest),!1===this.depthWrite&&(r.depthWrite=this.depthWrite),!1===this.colorWrite&&(r.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(r.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(r.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(r.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(r.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(r.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(r.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(r.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(r.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaHash&&(r.alphaHash=!0),!0===this.alphaToCoverage&&(r.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=!0),!0===this.forceSinglePass&&(r.forceSinglePass=!0),!1===this.allowOverride&&(r.allowOverride=!1),!0===this.wireframe&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),t){let t=i(e.textures),n=i(e.images);t.length>0&&(r.textures=t),n.length>0&&(r.images=n)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,r=null;if(null!==t){let e=t.length;r=Array(e);for(let i=0;i!==e;++i)r[i]=t[i].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class tA extends tm{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tp(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ez,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let tb=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),r=new Uint32Array(e),i=new Uint32Array(512),n=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(i[e]=0,i[256|e]=32768,n[e]=24,n[256|e]=24):t<-14?(i[e]=1024>>-t-14,i[256|e]=1024>>-t-14|32768,n[e]=-t-1,n[256|e]=-t-1):t<=15?(i[e]=t+15<<10,i[256|e]=t+15<<10|32768,n[e]=13,n[256|e]=13):t<128?(i[e]=31744,i[256|e]=64512,n[e]=24,n[256|e]=24):(i[e]=31744,i[256|e]=64512,n[e]=13,n[256|e]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;(8388608&t)==0;)t<<=1,r-=8388608;t&=-8388609,r+=0x38800000,a[e]=t|r}for(let e=1024;e<2048;++e)a[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=0x47800000,s[32]=0x80000000;for(let e=33;e<63;++e)s[e]=0x80000000+(e-32<<23);s[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:r,baseTable:i,shiftTable:n,mantissaTable:a,exponentTable:s,offsetTable:o}}();class tv{static toHalfFloat(e){var t;let r,i;return Math.abs(t=e)>65504&&b("DataUtils.toHalfFloat(): Value out of range."),t=I(t,-65504,65504),tb.floatView[0]=t,i=(r=tb.uint32View[0])>>23&511,tb.baseTable[i]+((8388607&r)>>tb.shiftTable[i])}static fromHalfFloat(e){let t;return t=e>>10,tb.uint32View[0]=tb.mantissaTable[tb.offsetTable[t]+(1023&e)]+tb.exponentTable[t],tb.floatView[0]}}let ty=new F,tx=new D,tS=0;class tE{constructor(e,t,r=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:tS++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=r,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,n=this.itemSize;i<n;i++)this.array[e+i]=t.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,r=this.count;t<r;t++)tx.fromBufferAttribute(this,t),tx.applyMatrix3(e),this.setXY(t,tx.x,tx.y);else if(3===this.itemSize)for(let t=0,r=this.count;t<r;t++)ty.fromBufferAttribute(this,t),ty.applyMatrix3(e),this.setXYZ(t,ty.x,ty.y,ty.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)ty.fromBufferAttribute(this,t),ty.applyMatrix4(e),this.setXYZ(t,ty.x,ty.y,ty.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)ty.fromBufferAttribute(this,t),ty.applyNormalMatrix(e),this.setXYZ(t,ty.x,ty.y,ty.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)ty.fromBufferAttribute(this,t),ty.transformDirection(e),this.setXYZ(t,ty.x,ty.y,ty.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let r=this.array[e*this.itemSize+t];return this.normalized&&(r=B(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=k(r,this.array)),this.array[e*this.itemSize+t]=r,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=B(t,this.array)),t}setX(e,t){return this.normalized&&(t=k(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=B(t,this.array)),t}setY(e,t){return this.normalized&&(t=k(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=B(t,this.array)),t}setZ(e,t){return this.normalized&&(t=k(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=B(t,this.array)),t}setW(e,t){return this.normalized&&(t=k(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=k(t,this.array),r=k(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=k(t,this.array),r=k(r,this.array),i=k(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,t,r,i,n){return e*=this.itemSize,this.normalized&&(t=k(t,this.array),r=k(r,this.array),i=k(i,this.array),n=k(n,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=n,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),e}}class tw extends tE{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class t_ extends tE{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class tC extends tE{constructor(e,t,r){super(new Float32Array(e),t,r)}}let tM=0,tI=new eB,tT=new e5,tR=new F,tB=new en,tk=new en,tP=new F;class tD extends S{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:tM++}),this.uuid=M(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(p(e)?t_:tw)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let r=this.attributes.normal;if(void 0!==r){let t=new O().getNormalMatrix(e);r.applyNormalMatrix(t),r.needsUpdate=!0}let i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return tI.makeRotationFromQuaternion(e),this.applyMatrix4(tI),this}rotateX(e){return tI.makeRotationX(e),this.applyMatrix4(tI),this}rotateY(e){return tI.makeRotationY(e),this.applyMatrix4(tI),this}rotateZ(e){return tI.makeRotationZ(e),this.applyMatrix4(tI),this}translate(e,t,r){return tI.makeTranslation(e,t,r),this.applyMatrix4(tI),this}scale(e,t,r){return tI.makeScale(e,t,r),this.applyMatrix4(tI),this}lookAt(e){return tT.lookAt(e),tT.updateMatrix(),this.applyMatrix4(tT.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(tR).negate(),this.translate(tR.x,tR.y,tR.z),this}setFromPoints(e){let t=this.getAttribute("position");if(void 0===t){let t=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];t.push(i.x,i.y,i.z||0)}this.setAttribute("position",new tC(t,3))}else{let r=Math.min(e.length,t.count);for(let i=0;i<r;i++){let r=e[i];t.setXYZ(i,r.x,r.y,r.z||0)}e.length>t.count&&b("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new en);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){v("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,r=t.length;e<r;e++){let r=t[e];tB.setFromBufferAttribute(r),this.morphTargetsRelative?(tP.addVectors(this.boundingBox.min,tB.min),this.boundingBox.expandByPoint(tP),tP.addVectors(this.boundingBox.max,tB.max),this.boundingBox.expandByPoint(tP)):(this.boundingBox.expandByPoint(tB.min),this.boundingBox.expandByPoint(tB.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&v('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new eS);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){v("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new F,1/0);return}if(e){let r=this.boundingSphere.center;if(tB.setFromBufferAttribute(e),t)for(let e=0,r=t.length;e<r;e++){let r=t[e];tk.setFromBufferAttribute(r),this.morphTargetsRelative?(tP.addVectors(tB.min,tk.min),tB.expandByPoint(tP),tP.addVectors(tB.max,tk.max),tB.expandByPoint(tP)):(tB.expandByPoint(tk.min),tB.expandByPoint(tk.max))}tB.getCenter(r);let i=0;for(let t=0,n=e.count;t<n;t++)tP.fromBufferAttribute(e,t),i=Math.max(i,r.distanceToSquared(tP));if(t)for(let n=0,a=t.length;n<a;n++){let a=t[n],s=this.morphTargetsRelative;for(let t=0,n=a.count;t<n;t++)tP.fromBufferAttribute(a,t),s&&(tR.fromBufferAttribute(e,t),tP.add(tR)),i=Math.max(i,r.distanceToSquared(tP))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&v('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void v("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let r=t.position,i=t.normal,n=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new tE(new Float32Array(4*r.count),4));let a=this.getAttribute("tangent"),s=[],o=[];for(let e=0;e<r.count;e++)s[e]=new F,o[e]=new F;let l=new F,c=new F,h=new F,u=new D,d=new D,p=new D,f=new F,g=new F,m=this.groups;0===m.length&&(m=[{start:0,count:e.count}]);for(let t=0,i=m.length;t<i;++t){let i=m[t],a=i.start,A=i.count;for(let t=a,i=a+A;t<i;t+=3)!function(e,t,i){l.fromBufferAttribute(r,e),c.fromBufferAttribute(r,t),h.fromBufferAttribute(r,i),u.fromBufferAttribute(n,e),d.fromBufferAttribute(n,t),p.fromBufferAttribute(n,i),c.sub(l),h.sub(l),d.sub(u),p.sub(u);let a=1/(d.x*p.y-p.x*d.y);isFinite(a)&&(f.copy(c).multiplyScalar(p.y).addScaledVector(h,-d.y).multiplyScalar(a),g.copy(h).multiplyScalar(d.x).addScaledVector(c,-p.x).multiplyScalar(a),s[e].add(f),s[t].add(f),s[i].add(f),o[e].add(g),o[t].add(g),o[i].add(g))}(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let A=new F,b=new F,y=new F,x=new F;function S(e){y.fromBufferAttribute(i,e),x.copy(y);let t=s[e];A.copy(t),A.sub(y.multiplyScalar(y.dot(t))).normalize(),b.crossVectors(x,t);let r=b.dot(o[e]);a.setXYZW(e,A.x,A.y,A.z,r<0?-1:1)}for(let t=0,r=m.length;t<r;++t){let r=m[t],i=r.start,n=r.count;for(let t=i,r=i+n;t<r;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let r=this.getAttribute("normal");if(void 0===r)r=new tE(new Float32Array(3*t.count),3),this.setAttribute("normal",r);else for(let e=0,t=r.count;e<t;e++)r.setXYZ(e,0,0,0);let i=new F,n=new F,a=new F,s=new F,o=new F,l=new F,c=new F,h=new F;if(e)for(let u=0,d=e.count;u<d;u+=3){let d=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);i.fromBufferAttribute(t,d),n.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),c.subVectors(a,n),h.subVectors(i,n),c.cross(h),s.fromBufferAttribute(r,d),o.fromBufferAttribute(r,p),l.fromBufferAttribute(r,f),s.add(c),o.add(c),l.add(c),r.setXYZ(d,s.x,s.y,s.z),r.setXYZ(p,o.x,o.y,o.z),r.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)i.fromBufferAttribute(t,e+0),n.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,n),h.subVectors(i,n),c.cross(h),r.setXYZ(e+0,c.x,c.y,c.z),r.setXYZ(e+1,c.x,c.y,c.z),r.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)tP.fromBufferAttribute(e,t),tP.normalize(),e.setXYZ(t,tP.x,tP.y,tP.z)}toNonIndexed(){function e(e,t){let r=e.array,i=e.itemSize,n=e.normalized,a=new r.constructor(t.length*i),s=0,o=0;for(let n=0,l=t.length;n<l;n++){s=e.isInterleavedBufferAttribute?t[n]*e.data.stride+e.offset:t[n]*i;for(let e=0;e<i;e++)a[o++]=r[s++]}return new tE(a,i,n)}if(null===this.index)return b("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new tD,r=this.index.array,i=this.attributes;for(let n in i){let a=e(i[n],r);t.setAttribute(n,a)}let n=this.morphAttributes;for(let i in n){let a=[],s=n[i];for(let t=0,i=s.length;t<i;t++){let i=e(s[t],r);a.push(i)}t.morphAttributes[i]=a}t.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let e=0,r=a.length;e<r;e++){let r=a[e];t.addGroup(r.start,r.count,r.materialIndex)}return t}toJSON(){let e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let r=this.attributes;for(let t in r){let i=r[t];e.data.attributes[t]=i.toJSON(e.data)}let i={},n=!1;for(let t in this.morphAttributes){let r=this.morphAttributes[t],a=[];for(let t=0,i=r.length;t<i;t++){let i=r[t];a.push(i.toJSON(e.data))}a.length>0&&(i[t]=a,n=!0)}n&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let r=e.index;null!==r&&this.setIndex(r.clone());let i=e.attributes;for(let e in i){let r=i[e];this.setAttribute(e,r.clone(t))}let n=e.morphAttributes;for(let e in n){let r=[],i=n[e];for(let e=0,n=i.length;e<n;e++)r.push(i[e].clone(t));this.morphAttributes[e]=r}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());let o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let tL=new eB,tF=new eR,tN=new eS,tU=new F,tO=new F,tQ=new F,tz=new F,tH=new F,tG=new F,tV=new F,tj=new F;class tq extends e5{constructor(e=new tD,t=new tA){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){let t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let r=this.geometry,i=r.attributes.position,n=r.morphAttributes.position,a=r.morphTargetsRelative;t.fromBufferAttribute(i,e);let s=this.morphTargetInfluences;if(n&&s){tG.set(0,0,0);for(let r=0,i=n.length;r<i;r++){let i=s[r],o=n[r];0!==i&&(tH.fromBufferAttribute(o,e),a?tG.addScaledVector(tH,i):tG.addScaledVector(tH.sub(t),i))}t.add(tG)}return t}raycast(e,t){let r=this.geometry,i=this.material,n=this.matrixWorld;void 0===i||(null===r.boundingSphere&&r.computeBoundingSphere(),tN.copy(r.boundingSphere),tN.applyMatrix4(n),tF.copy(e.ray).recast(e.near),!1===tN.containsPoint(tF.origin)&&(null===tF.intersectSphere(tN,tU)||tF.origin.distanceToSquared(tU)>(e.far-e.near)**2)||(tL.copy(n).invert(),tF.copy(e.ray).applyMatrix4(tL),(null===r.boundingBox||!1!==tF.intersectsBox(r.boundingBox))&&this._computeIntersections(e,t,tF)))}_computeIntersections(e,t,r){let i,n=this.geometry,a=this.material,s=n.index,o=n.attributes.position,l=n.attributes.uv,c=n.attributes.uv1,h=n.attributes.normal,u=n.groups,d=n.drawRange;if(null!==s)if(Array.isArray(a))for(let n=0,o=u.length;n<o;n++){let o=u[n],p=a[o.materialIndex],f=Math.max(o.start,d.start),g=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));for(let n=f;n<g;n+=3)(i=tW(this,p,e,r,l,c,h,s.getX(n),s.getX(n+1),s.getX(n+2)))&&(i.faceIndex=Math.floor(n/3),i.face.materialIndex=o.materialIndex,t.push(i))}else{let n=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);for(let u=n;u<o;u+=3)(i=tW(this,a,e,r,l,c,h,s.getX(u),s.getX(u+1),s.getX(u+2)))&&(i.faceIndex=Math.floor(u/3),t.push(i))}else if(void 0!==o)if(Array.isArray(a))for(let n=0,s=u.length;n<s;n++){let s=u[n],p=a[s.materialIndex],f=Math.max(s.start,d.start),g=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));for(let n=f;n<g;n+=3)(i=tW(this,p,e,r,l,c,h,n,n+1,n+2))&&(i.faceIndex=Math.floor(n/3),i.face.materialIndex=s.materialIndex,t.push(i))}else{let n=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);for(let o=n;o<s;o+=3)(i=tW(this,a,e,r,l,c,h,o,o+1,o+2))&&(i.faceIndex=Math.floor(o/3),t.push(i))}}}function tW(e,t,r,i,n,a,s,o,l,c){e.getVertexPosition(o,tO),e.getVertexPosition(l,tQ),e.getVertexPosition(c,tz);let h=function(e,t,r,i,n,a,s,o){if(null===(1===t.side?i.intersectTriangle(s,a,n,!0,o):i.intersectTriangle(n,a,s,0===t.side,o)))return null;tj.copy(o),tj.applyMatrix4(e.matrixWorld);let l=r.ray.origin.distanceTo(tj);return l<r.near||l>r.far?null:{distance:l,point:tj.clone(),object:e}}(e,t,r,i,tO,tQ,tz,tV);if(h){let e=new F;tl.getBarycoord(tV,tO,tQ,tz,e),n&&(h.uv=tl.getInterpolatedAttribute(n,o,l,c,e,new D)),a&&(h.uv1=tl.getInterpolatedAttribute(a,o,l,c,e,new D)),s&&(h.normal=tl.getInterpolatedAttribute(s,o,l,c,e,new F),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));let t={a:o,b:l,c:c,normal:new F,materialIndex:0};tl.getNormal(tO,tQ,tz,t.normal),h.face=t,h.barycoord=e}return h}class tX extends tD{constructor(e=1,t=1,r=1,i=1,n=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:n,depthSegments:a};const s=this;i=Math.floor(i),n=Math.floor(n);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(e,t,r,i,n,a,p,f,g,m,A){let b=a/g,v=p/m,y=a/2,x=p/2,S=f/2,E=g+1,w=m+1,_=0,C=0,M=new F;for(let a=0;a<w;a++){let s=a*v-x;for(let o=0;o<E;o++){let u=o*b-y;M[e]=u*i,M[t]=s*n,M[r]=S,l.push(M.x,M.y,M.z),M[e]=0,M[t]=0,M[r]=f>0?1:-1,c.push(M.x,M.y,M.z),h.push(o/g),h.push(1-a/m),_+=1}}for(let e=0;e<m;e++)for(let t=0;t<g;t++){let r=u+t+E*e,i=u+t+E*(e+1),n=u+(t+1)+E*(e+1),a=u+(t+1)+E*e;o.push(r,i,a),o.push(i,n,a),C+=6}s.addGroup(d,C,A),d+=C,u+=_}p("z","y","x",-1,-1,r,t,e,a=Math.floor(a),n,0),p("z","y","x",1,-1,r,t,-e,a,n,1),p("x","z","y",1,1,e,r,t,i,a,2),p("x","z","y",1,-1,e,r,-t,i,a,3),p("x","y","z",1,-1,e,t,r,i,n,4),p("x","y","z",-1,-1,e,t,-r,i,n,5),this.setIndex(o),this.setAttribute("position",new tC(l,3)),this.setAttribute("normal",new tC(c,3)),this.setAttribute("uv",new tC(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new tX(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function tY(e){let t={};for(let r in e)for(let i in t[r]={},e[r]){let n=e[r][i];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)?n.isRenderTargetTexture?(b("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[r][i]=null):t[r][i]=n.clone():Array.isArray(n)?t[r][i]=n.slice():t[r][i]=n}return t}function tK(e){let t={};for(let r=0;r<e.length;r++){let i=tY(e[r]);for(let e in i)t[e]=i[e]}return t}function t$(e){let t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:G.workingColorSpace}let tJ={clone:tY,merge:tK};class tZ extends tm{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=tY(e.uniforms),this.uniformsGroups=function(e){let t=[];for(let r=0;r<e.length;r++)t.push(e[r].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);for(let r in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let i=this.uniforms[r].value;i&&i.isTexture?t.uniforms[r]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[r]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[r]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[r]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[r]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[r]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[r]={type:"m4",value:i.toArray()}:t.uniforms[r]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let r={};for(let e in this.extensions)!0===this.extensions[e]&&(r[e]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class t0 extends e5{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new eB,this.projectionMatrix=new eB,this.projectionMatrixInverse=new eB,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let t1=new F,t2=new D,t3=new D;class t5 extends t0{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*C*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*_*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*C*Math.atan(Math.tan(.5*_*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){t1.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(t1.x,t1.y).multiplyScalar(-e/t1.z),t1.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(t1.x,t1.y).multiplyScalar(-e/t1.z)}getViewSize(e,t){return this.getViewBounds(e,t2,t3),t.subVectors(t3,t2)}setViewOffset(e,t,r,i,n,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*_*this.fov)/this.zoom,r=2*t,i=this.aspect*r,n=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;n+=a.offsetX*i/e,t-=a.offsetY*r/s,i*=a.width/e,r*=a.height/s}let s=this.filmOffset;0!==s&&(n+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,t,t-r,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class t4 extends e5{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new t5(-90,1,e,t);i.layers=this.layers,this.add(i);const n=new t5(-90,1,e,t);n.layers=this.layers,this.add(n);const a=new t5(-90,1,e,t);a.layers=this.layers,this.add(a);const s=new t5(-90,1,e,t);s.layers=this.layers,this.add(s);const o=new t5(-90,1,e,t);o.layers=this.layers,this.add(o);const l=new t5(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[r,i,n,a,s,o]=t;for(let e of t)this.remove(e);if(2e3===e)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===e)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[n,a,s,o,l,c]=this.children,h=e.getRenderTarget(),u=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(t,n),e.setRenderTarget(r,1,i),e.render(t,a),e.setRenderTarget(r,2,i),e.render(t,s),e.setRenderTarget(r,3,i),e.render(t,o),e.setRenderTarget(r,4,i),e.render(t,l),r.texture.generateMipmaps=f,e.setRenderTarget(r,5,i),e.render(t,c),e.setRenderTarget(h,u,d),e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class t8 extends J{constructor(e=[],t=301,r,i,n,a,s,o,l,c){super(e,t,r,i,n,a,s,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class t9 extends et{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1};this.texture=new t8([r,r,r,r,r,r]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let r={uniforms:{tEquirect:{value:null}},vertexShader:`
953
+
954
+ varying vec3 vWorldDirection;
955
+
956
+ vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
957
+
958
+ return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
959
+
960
+ }
961
+
962
+ void main() {
963
+
964
+ vWorldDirection = transformDirection( position, modelMatrix );
965
+
966
+ #include <begin_vertex>
967
+ #include <project_vertex>
968
+
969
+ }
970
+ `,fragmentShader:`
971
+
972
+ uniform sampler2D tEquirect;
973
+
974
+ varying vec3 vWorldDirection;
975
+
976
+ #include <common>
977
+
978
+ void main() {
979
+
980
+ vec3 direction = normalize( vWorldDirection );
981
+
982
+ vec2 sampleUV = equirectUv( direction );
983
+
984
+ gl_FragColor = texture2D( tEquirect, sampleUV );
985
+
986
+ }
987
+ `},i=new tX(5,5,5),n=new tZ({name:"CubemapFromEquirect",uniforms:tY(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:1,blending:0});n.uniforms.tEquirect.value=t;let a=new tq(i,n),s=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new t4(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,r=!0,i=!0){let n=e.getRenderTarget();for(let n=0;n<6;n++)e.setRenderTarget(this,n),e.clear(t,r,i);e.setRenderTarget(n)}}class t6 extends e5{constructor(){super(),this.isGroup=!0,this.type="Group"}}let t7={type:"move"};class re{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new t6,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new t6,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new t6,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let r of e.hand.values())this._getHandJoint(t,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,r){let i=null,n=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let i of(a=!0,e.hand.values())){let e=t.getJointPose(i,r),n=this._getHandJoint(l,i);null!==e&&(n.matrix.fromArray(e.transform.matrix),n.matrix.decompose(n.position,n.rotation,n.scale),n.matrixWorldNeedsUpdate=!0,n.jointRadius=e.radius),n.visible=null!==e}let i=l.joints["index-finger-tip"],n=l.joints["thumb-tip"],s=i.position.distanceTo(n.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(n=t.getPose(e.gripSpace,r))&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1);null!==s&&(null===(i=t.getPose(e.targetRaySpace,r))&&null!==n&&(i=n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(t7)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==n),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let r=new t6;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class rt extends e5{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ez,this.environmentIntensity=1,this.environmentRotation=new ez,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class rr{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=M()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,n=this.stride;i<n;i++)this.array[e+i]=t.array[r+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=M()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=M()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}let ri=new F;class rn{constructor(e,t,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)ri.fromBufferAttribute(this,t),ri.applyMatrix4(e),this.setXYZ(t,ri.x,ri.y,ri.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)ri.fromBufferAttribute(this,t),ri.applyNormalMatrix(e),this.setXYZ(t,ri.x,ri.y,ri.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)ri.fromBufferAttribute(this,t),ri.transformDirection(e),this.setXYZ(t,ri.x,ri.y,ri.z);return this}getComponent(e,t){let r=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(r=B(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=k(r,this.array)),this.data.array[e*this.data.stride+this.offset+t]=r,this}setX(e,t){return this.normalized&&(t=k(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=k(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=k(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=k(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=B(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=B(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=B(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=B(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=k(t,this.array),r=k(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=k(t,this.array),r=k(r,this.array),i=k(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,t,r,i,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=k(t,this.array),r=k(r,this.array),i=k(i,this.array),n=k(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=n,this}clone(e){if(void 0!==e)return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new rn(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{A("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let r=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[r+t])}return new tE(new this.array.constructor(e),this.itemSize,this.normalized)}}toJSON(e){if(void 0!==e)return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{A("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let r=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[r+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}}}let ra=new F,rs=new Z,ro=new Z,rl=new F,rc=new eB,rh=new F,ru=new eS,rd=new eB,rp=new eR;class rf extends tq{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=l,this.bindMatrix=new eB,this.bindMatrixInverse=new eB,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;null===this.boundingBox&&(this.boundingBox=new en),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,rh),this.boundingBox.expandByPoint(rh)}computeBoundingSphere(){let e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new eS),this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,rh),this.boundingSphere.expandByPoint(rh)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let r=this.material,i=this.matrixWorld;void 0===r||(null===this.boundingSphere&&this.computeBoundingSphere(),ru.copy(this.boundingSphere),ru.applyMatrix4(i),!1===e.ray.intersectsSphere(ru)||(rd.copy(i).invert(),rp.copy(e.ray).applyMatrix4(rd),(null===this.boundingBox||!1!==rp.intersectsBox(this.boundingBox))&&this._computeIntersections(e,t,rp)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new Z,t=this.geometry.attributes.skinWeight;for(let r=0,i=t.count;r<i;r++){e.fromBufferAttribute(t,r);let i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===l?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():b("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let r=this.skeleton,i=this.geometry;rs.fromBufferAttribute(i.attributes.skinIndex,e),ro.fromBufferAttribute(i.attributes.skinWeight,e),ra.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){let i=ro.getComponent(e);if(0!==i){let n=rs.getComponent(e);rc.multiplyMatrices(r.bones[n].matrixWorld,r.boneInverses[n]),t.addScaledVector(rl.copy(ra).applyMatrix4(rc),i)}}return t.applyMatrix4(this.bindMatrixInverse)}}class rg extends e5{constructor(){super(),this.isBone=!0,this.type="Bone"}}class rm extends J{constructor(e=null,t=1,r=1,i,n,a,s,o,l=1003,c=1003,h,u){super(null,a,s,o,l,c,i,n,h,u),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let rA=new eB,rb=new eB;class rv{constructor(e=[],t=[]){this.uuid=M(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){b("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new eB)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new eB;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let i=0,n=e.length;i<n;i++){let n=e[i]?e[i].matrixWorld:rb;rA.multiplyMatrices(n,t[i]),rA.toArray(r,16*i)}null!==i&&(i.needsUpdate=!0)}clone(){return new rv(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length),t=new Float32Array((e=Math.max(e=4*Math.ceil(e/4),4))*e*4);t.set(this.boneMatrices);let r=new rm(t,e,e,1023,1015);return r.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=r,this}getBoneByName(e){for(let t=0,r=this.bones.length;t<r;t++){let r=this.bones[t];if(r.name===e)return r}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let r=0,i=e.bones.length;r<i;r++){let i=e.bones[r],n=t[i];void 0===n&&(b("Skeleton: No bone found with UUID:",i),n=new rg),this.bones.push(n),this.boneInverses.push(new eB().fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){let e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,r=this.boneInverses;for(let i=0,n=t.length;i<n;i++){let n=t[i];e.bones.push(n.uuid);let a=r[i];e.boneInverses.push(a.toArray())}return e}}class ry extends tE{constructor(e,t,r,i=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}let rx=new eB,rS=new eB,rE=[],rw=new en,r_=new eB,rC=new tq,rM=new eS;class rI extends tq{constructor(e,t,r){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new ry(new Float32Array(16*r),16),this.instanceColor=null,this.morphTexture=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<r;e++)this.setMatrixAt(e,r_)}computeBoundingBox(){let e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new en),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,rx),rw.copy(e.boundingBox).applyMatrix4(rx),this.boundingBox.union(rw)}computeBoundingSphere(){let e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new eS),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,rx),rM.copy(e.boundingSphere).applyMatrix4(rx),this.boundingSphere.union(rM)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.morphTexture&&(this.morphTexture=e.morphTexture.clone()),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}getMorphAt(e,t){let r=t.morphTargetInfluences,i=this.morphTexture.source.data.data,n=e*(r.length+1)+1;for(let e=0;e<r.length;e++)r[e]=i[n+e]}raycast(e,t){let r=this.matrixWorld,i=this.count;if((rC.geometry=this.geometry,rC.material=this.material,void 0!==rC.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),rM.copy(this.boundingSphere),rM.applyMatrix4(r),!1!==e.ray.intersectsSphere(rM)))for(let n=0;n<i;n++){this.getMatrixAt(n,rx),rS.multiplyMatrices(r,rx),rC.matrixWorld=rS,rC.raycast(e,rE);for(let e=0,r=rE.length;e<r;e++){let r=rE[e];r.instanceId=n,r.object=this,t.push(r)}rE.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new ry(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}setMorphAt(e,t){let r=t.morphTargetInfluences,i=r.length+1;null===this.morphTexture&&(this.morphTexture=new rm(new Float32Array(i*this.count),i,this.count,1028,1015));let n=this.morphTexture.source.data.data,a=0;for(let e=0;e<r.length;e++)a+=r[e];let s=this.geometry.morphTargetsRelative?1:1-a,o=i*e;n[o]=s,n.set(r,o+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}let rT=new F,rR=new F,rB=new O;class rk{constructor(e=new F(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){let i=rT.subVectors(r,t).cross(rR.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let r=e.delta(rT),i=this.normal.dot(r);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;let n=-(e.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:t.copy(e.start).addScaledVector(r,n)}intersectsLine(e){let t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let r=t||rB.getNormalMatrix(e),i=this.coplanarPoint(rT).applyMatrix4(e),n=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(n),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}let rP=new eS,rD=new D(.5,.5),rL=new F;class rF{constructor(e=new rk,t=new rk,r=new rk,i=new rk,n=new rk,a=new rk){this.planes=[e,t,r,i,n,a]}set(e,t,r,i,n,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(r),s[3].copy(i),s[4].copy(n),s[5].copy(a),this}copy(e){let t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=2e3,r=!1){let i=this.planes,n=e.elements,a=n[0],s=n[1],o=n[2],l=n[3],c=n[4],h=n[5],u=n[6],d=n[7],p=n[8],f=n[9],g=n[10],m=n[11],A=n[12],b=n[13],v=n[14],y=n[15];if(i[0].setComponents(l-a,d-c,m-p,y-A).normalize(),i[1].setComponents(l+a,d+c,m+p,y+A).normalize(),i[2].setComponents(l+s,d+h,m+f,y+b).normalize(),i[3].setComponents(l-s,d-h,m-f,y-b).normalize(),r)i[4].setComponents(o,u,g,v).normalize(),i[5].setComponents(l-o,d-u,m-g,y-v).normalize();else if(i[4].setComponents(l-o,d-u,m-g,y-v).normalize(),2e3===t)i[5].setComponents(l+o,d+u,m+g,y+v).normalize();else if(2001===t)i[5].setComponents(o,u,g,v).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),rP.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),rP.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(rP)}intersectsSprite(e){return rP.center.set(0,0,0),rP.radius=.7071067811865476+rD.distanceTo(e.center),rP.applyMatrix4(e.matrixWorld),this.intersectsSphere(rP)}intersectsSphere(e){let t=this.planes,r=e.center,i=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){let t=this.planes;for(let r=0;r<6;r++){let i=t[r];if(rL.x=i.normal.x>0?e.max.x:e.min.x,rL.y=i.normal.y>0?e.max.y:e.min.y,rL.z=i.normal.z>0?e.max.z:e.min.z,0>i.distanceToPoint(rL))return!1}return!0}containsPoint(e){let t=this.planes;for(let r=0;r<6;r++)if(0>t[r].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}}class rN extends tm{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tp(0xffffff),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}let rU=new F,rO=new F,rQ=new eB,rz=new eR,rH=new eS,rG=new F,rV=new F;class rj extends e5{constructor(e=new tD,t=new rN){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,r=[0];for(let e=1,i=t.count;e<i;e++)rU.fromBufferAttribute(t,e-1),rO.fromBufferAttribute(t,e),r[e]=r[e-1],r[e]+=rU.distanceTo(rO);e.setAttribute("lineDistance",new tC(r,1))}else b("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let r=this.geometry,i=this.matrixWorld,n=e.params.Line.threshold,a=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),rH.copy(r.boundingSphere),rH.applyMatrix4(i),rH.radius+=n,!1===e.ray.intersectsSphere(rH))return;rQ.copy(i).invert(),rz.copy(e.ray).applyMatrix4(rQ);let s=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=this.isLineSegments?2:1,c=r.index,h=r.attributes.position;if(null!==c){let r=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let n=r,a=i-1;n<a;n+=l){let r=rq(this,e,rz,o,c.getX(n),c.getX(n+1),n);r&&t.push(r)}if(this.isLineLoop){let n=rq(this,e,rz,o,c.getX(i-1),c.getX(r),i-1);n&&t.push(n)}}else{let r=Math.max(0,a.start),i=Math.min(h.count,a.start+a.count);for(let n=r,a=i-1;n<a;n+=l){let r=rq(this,e,rz,o,n,n+1,n);r&&t.push(r)}if(this.isLineLoop){let n=rq(this,e,rz,o,i-1,r,i-1);n&&t.push(n)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){let t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function rq(e,t,r,i,n,a,s){let o=e.geometry.attributes.position;if(rU.fromBufferAttribute(o,n),rO.fromBufferAttribute(o,a),r.distanceSqToSegment(rU,rO,rG,rV)>i)return;rG.applyMatrix4(e.matrixWorld);let l=t.ray.origin.distanceTo(rG);if(!(l<t.near)&&!(l>t.far))return{distance:l,point:rV.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}let rW=new F,rX=new F;class rY extends rj{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,r=[];for(let e=0,i=t.count;e<i;e+=2)rW.fromBufferAttribute(t,e),rX.fromBufferAttribute(t,e+1),r[e]=0===e?0:r[e-1],r[e+1]=r[e]+rW.distanceTo(rX);e.setAttribute("lineDistance",new tC(r,1))}else b("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class rK extends rj{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class r$ extends tm{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tp(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let rJ=new eB,rZ=new eR,r0=new eS,r1=new F;class r2 extends e5{constructor(e=new tD,t=new r$){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let r=this.geometry,i=this.matrixWorld,n=e.params.Points.threshold,a=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),r0.copy(r.boundingSphere),r0.applyMatrix4(i),r0.radius+=n,!1===e.ray.intersectsSphere(r0))return;rJ.copy(i).invert(),rZ.copy(e.ray).applyMatrix4(rJ);let s=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=r.index,c=r.attributes.position;if(null!==l){let r=Math.max(0,a.start),n=Math.min(l.count,a.start+a.count);for(let a=r;a<n;a++){let r=l.getX(a);r1.fromBufferAttribute(c,r),r3(r1,r,o,i,e,t,this)}}else{let r=Math.max(0,a.start),n=Math.min(c.count,a.start+a.count);for(let a=r;a<n;a++)r1.fromBufferAttribute(c,a),r3(r1,a,o,i,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){let t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function r3(e,t,r,i,n,a,s){let o=rZ.distanceSqToPoint(e);if(o<r){let r=new F;rZ.closestPointToPoint(e,r),r.applyMatrix4(i);let l=n.ray.origin.distanceTo(r);if(l<n.near||l>n.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:r,index:t,face:null,faceIndex:null,barycoord:null,object:s})}}class r5 extends J{constructor(e,t,r,i,n=1006,a=1006,s,o,l){super(e,t,r,i,n,a,s,o,l),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const c=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){c.needsUpdate=!0,c._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class r4 extends J{constructor(e,t,r,i,n,a,s,o,l,c,h,u){super(null,a,s,o,l,c,i,n,h,u),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class r8 extends r4{constructor(e,t,r,i,n,a){super(e,t,r,n,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=1001,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class r9 extends r4{constructor(e,t,r){super(void 0,e[0].width,e[0].height,t,r,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class r6 extends J{constructor(e,t,r,i,n,a,s,o,l){super(e,t,r,i,n,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class r7 extends J{constructor(e,t,r=1014,i,n,a,s=1003,o=1003,l,c=1026,h=1){if(1026!==c&&1027!==c)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:h},i,n,a,s,o,c,r,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new X(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class ie extends r7{constructor(e,t=1014,r=301,i,n,a=1003,s=1003,o,l=1026){const c={width:e,height:e,depth:1};super(e,e,t,r,i,n,a,s,o,l),this.image=[c,c,c,c,c,c],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class it extends J{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class ir{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){b("Curve: .getPoint() not implemented.")}getPointAt(e,t){let r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],r,i=this.getPoint(0),n=0;t.push(0);for(let a=1;a<=e;a++)t.push(n+=(r=this.getPoint(a/e)).distanceTo(i)),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){let r,i=this.getLengths(),n=0,a=i.length;r=t||e*i[a-1];let s=0,o=a-1,l;for(;s<=o;)if((l=i[n=Math.floor(s+(o-s)/2)]-r)<0)s=n+1;else if(l>0)o=n-1;else{o=n;break}if(i[n=o]===r)return n/(a-1);let c=i[n],h=i[n+1];return(n+(r-c)/(h-c))/(a-1)}getTangent(e,t){let r=e-1e-4,i=e+1e-4;r<0&&(r=0),i>1&&(i=1);let n=this.getPoint(r),a=this.getPoint(i),s=t||(n.isVector2?new D:new F);return s.copy(a).sub(n).normalize(),s}getTangentAt(e,t){let r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t=!1){let r=new F,i=[],n=[],a=[],s=new F,o=new eB;for(let t=0;t<=e;t++){let r=t/e;i[t]=this.getTangentAt(r,new F)}n[0]=new F,a[0]=new F;let l=Number.MAX_VALUE,c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,r.set(1,0,0)),h<=l&&(l=h,r.set(0,1,0)),u<=l&&r.set(0,0,1),s.crossVectors(i[0],r).normalize(),n[0].crossVectors(i[0],s),a[0].crossVectors(i[0],n[0]);for(let t=1;t<=e;t++){if(n[t]=n[t-1].clone(),a[t]=a[t-1].clone(),s.crossVectors(i[t-1],i[t]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(I(i[t-1].dot(i[t]),-1,1));n[t].applyMatrix4(o.makeRotationAxis(s,e))}a[t].crossVectors(i[t],n[t])}if(!0===t){let t=Math.acos(I(n[0].dot(n[e]),-1,1));t/=e,i[0].dot(s.crossVectors(n[0],n[e]))>0&&(t=-t);for(let r=1;r<=e;r++)n[r].applyMatrix4(o.makeRotationAxis(i[r],t*r)),a[r].crossVectors(i[r],n[r])}return{tangents:i,normals:n,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ii extends ir{constructor(e=0,t=0,r=1,i=1,n=0,a=2*Math.PI,s=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e,t=new D){let r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,n=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=n?0:r),!0!==this.aClockwise||n||(i===r?i=-r:i-=r);let a=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(a),o=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),r=s-this.aX,i=o-this.aY;s=r*e-i*t+this.aX,o=r*t+i*e+this.aY}return t.set(s,o)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}function ia(){let e=0,t=0,r=0,i=0;function n(n,a,s,o){e=n,t=s,r=-3*n+3*a-2*s-o,i=2*n-2*a+s+o}return{initCatmullRom:function(e,t,r,i,a){n(t,r,a*(r-e),a*(i-t))},initNonuniformCatmullRom:function(e,t,r,i,a,s,o){let l=(t-e)/a-(r-e)/(a+s)+(r-t)/s,c=(r-t)/s-(i-t)/(s+o)+(i-r)/o;n(t,r,l*=s,c*=s)},calc:function(n){let a=n*n;return e+t*n+r*a+a*n*i}}}let is=new F,io=new ia,il=new ia,ic=new ia;function ih(e,t,r,i,n){let a=(i-t)*.5,s=(n-r)*.5,o=e*e;return e*o*(2*r-2*i+a+s)+(-3*r+3*i-2*a-s)*o+a*e+r}function iu(e,t,r,i){let n;return(n=1-e)*n*t+2*(1-e)*e*r+e*e*i}function id(e,t,r,i,n){let a,s;return(a=1-e)*a*a*t+3*(s=1-e)*s*e*r+3*(1-e)*e*e*i+e*e*e*n}class ip extends ir{constructor(e=new D,t=new D,r=new D,i=new D){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new D){let r=this.v0,i=this.v1,n=this.v2,a=this.v3;return t.set(id(e,r.x,i.x,n.x,a.x),id(e,r.y,i.y,n.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class ig extends ir{constructor(e=new D,t=new D){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new D){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new D){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class im extends ir{constructor(e=new D,t=new D,r=new D){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new D){let r=this.v0,i=this.v1,n=this.v2;return t.set(iu(e,r.x,i.x,n.x),iu(e,r.y,i.y,n.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class iA extends ir{constructor(e=new F,t=new F,r=new F){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new F){let r=this.v0,i=this.v1,n=this.v2;return t.set(iu(e,r.x,i.x,n.x),iu(e,r.y,i.y,n.y),iu(e,r.z,i.z,n.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ib extends ir{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new D){let r=this.points,i=(r.length-1)*e,n=Math.floor(i),a=i-n,s=r[0===n?n:n-1],o=r[n],l=r[n>r.length-2?r.length-1:n+1],c=r[n>r.length-3?r.length-1:n+2];return t.set(ih(a,s.x,o.x,l.x,c.x),ih(a,s.y,o.y,l.y,c.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let r=e.points[t];this.points.push(r.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){let r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let r=e.points[t];this.points.push(new D().fromArray(r))}return this}}var iv=Object.freeze({__proto__:null,ArcCurve:class extends ii{constructor(e,t,r,i,n,a){super(e,t,r,r,i,n,a),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends ir{constructor(e=[],t=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=i}getPoint(e,t=new F){let r,i,n=this.points,a=n.length,s=(a-!this.closed)*e,o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:0===l&&o===a-1&&(o=a-2,l=1),this.closed||o>0?r=n[(o-1)%a]:(is.subVectors(n[0],n[1]).add(n[0]),r=is);let c=n[o%a],h=n[(o+1)%a];if(this.closed||o+2<a?i=n[(o+2)%a]:(is.subVectors(n[a-1],n[a-2]).add(n[a-1]),i=is),"centripetal"===this.curveType||"chordal"===this.curveType){let e="chordal"===this.curveType?.5:.25,t=Math.pow(r.distanceToSquared(c),e),n=Math.pow(c.distanceToSquared(h),e),a=Math.pow(h.distanceToSquared(i),e);n<1e-4&&(n=1),t<1e-4&&(t=n),a<1e-4&&(a=n),io.initNonuniformCatmullRom(r.x,c.x,h.x,i.x,t,n,a),il.initNonuniformCatmullRom(r.y,c.y,h.y,i.y,t,n,a),ic.initNonuniformCatmullRom(r.z,c.z,h.z,i.z,t,n,a)}else"catmullrom"===this.curveType&&(io.initCatmullRom(r.x,c.x,h.x,i.x,this.tension),il.initCatmullRom(r.y,c.y,h.y,i.y,this.tension),ic.initCatmullRom(r.z,c.z,h.z,i.z,this.tension));return t.set(io.calc(l),il.calc(l),ic.calc(l)),t}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){let r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let r=e.points[t];this.points.push(new F().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},CubicBezierCurve:ip,CubicBezierCurve3:class extends ir{constructor(e=new F,t=new F,r=new F,i=new F){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new F){let r=this.v0,i=this.v1,n=this.v2,a=this.v3;return t.set(id(e,r.x,i.x,n.x,a.x),id(e,r.y,i.y,n.y,a.y),id(e,r.z,i.z,n.z,a.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},EllipseCurve:ii,LineCurve:ig,LineCurve3:class extends ir{constructor(e=new F,t=new F){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new F){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new F){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},QuadraticBezierCurve:im,QuadraticBezierCurve3:iA,SplineCurve:ib});class iy extends ir{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let r=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new iv[r](t,e))}return this}getPoint(e,t){let r=e*this.getLength(),i=this.getCurveLengths(),n=0;for(;n<i.length;){if(i[n]>=r){let e=i[n]-r,a=this.curves[n],s=a.getLength(),o=0===s?0:1-e/s;return a.getPointAt(o,t)}n++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let r=0,i=this.curves.length;r<i;r++)e.push(t+=this.curves[r].getLength());return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t,r=[];for(let i=0,n=this.curves;i<n.length;i++){let a=n[i],s=a.isEllipseCurve?2*e:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,o=a.getPoints(s);for(let e=0;e<o.length;e++){let i=o[e];t&&t.equals(i)||(r.push(i),t=i)}}return this.autoClose&&r.length>1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){let r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){let r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){let r=e.curves[t];this.curves.push(new iv[r.type]().fromJSON(r))}return this}}class ix extends iy{constructor(e){super(),this.type="Path",this.currentPoint=new D,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let r=new ig(this.currentPoint.clone(),new D(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,i){let n=new im(this.currentPoint.clone(),new D(e,t),new D(r,i));return this.curves.push(n),this.currentPoint.set(r,i),this}bezierCurveTo(e,t,r,i,n,a){let s=new ip(this.currentPoint.clone(),new D(e,t),new D(r,i),new D(n,a));return this.curves.push(s),this.currentPoint.set(n,a),this}splineThru(e){let t=new ib([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,i,n,a){let s=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+s,t+o,r,i,n,a),this}absarc(e,t,r,i,n,a){return this.absellipse(e,t,r,r,i,n,a),this}ellipse(e,t,r,i,n,a,s,o){let l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,r,i,n,a,s,o),this}absellipse(e,t,r,i,n,a,s,o){let l=new ii(e,t,r,i,n,a,s,o);if(this.curves.length>0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class iS extends ix{constructor(e){super(e),this.uuid=M(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let r=0,i=this.holes.length;r<i;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){let r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){let r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){let r=e.holes[t];this.holes.push(new ix().fromJSON(r))}return this}}function iE(e,t,r,i,n){let a;if(n===function(e,t,r,i){let n=0;for(let a=t,s=r-i;a<r;a+=i)n+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return n}(e,t,r,i)>0)for(let n=t;n<r;n+=i)a=iF(n/i|0,e[n],e[n+1],a);else for(let n=r-i;n>=t;n-=i)a=iF(n/i|0,e[n],e[n+1],a);return a&&iR(a,a.next)&&(iN(a),a=a.next),a}function iw(e,t){if(!e)return e;t||(t=e);let r=e,i;do if(i=!1,!r.steiner&&(iR(r,r.next)||0===iT(r.prev,r,r.next))){if(iN(r),(r=t=r.prev)===r.next)break;i=!0}else r=r.next;while(i||r!==t);return t}function i_(e,t){let r=e.x-t.x;return 0===r&&0==(r=e.y-t.y)&&(r=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),r}function iC(e,t,r,i,n){return(e=((e=((e=((e=((e=(e-r)*n|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-i)*n|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function iM(e,t,r,i,n,a,s,o){return(n-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function iI(e,t,r,i,n,a,s,o){return(e!==s||t!==o)&&iM(e,t,r,i,n,a,s,o)}function iT(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function iR(e,t){return e.x===t.x&&e.y===t.y}function iB(e,t,r,i){let n=iP(iT(e,t,r)),a=iP(iT(e,t,i)),s=iP(iT(r,i,e)),o=iP(iT(r,i,t));return!!(n!==a&&s!==o||0===n&&ik(e,r,t)||0===a&&ik(e,i,t)||0===s&&ik(r,e,i)||0===o&&ik(r,t,i))}function ik(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function iP(e){return e>0?1:e<0?-1:0}function iD(e,t){return 0>iT(e.prev,e,e.next)?iT(e,t,e.next)>=0&&iT(e,e.prev,t)>=0:0>iT(e,t,e.prev)||0>iT(e,e.next,t)}function iL(e,t){let r=iU(e.i,e.x,e.y),i=iU(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function iF(e,t,r,i){let n=iU(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function iN(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function iU(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class iO{static triangulate(e,t,r=2){return function(e,t,r=2){let i,n,a,s=t&&t.length,o=s?t[0]*r:e.length,l=iE(e,0,o,r,!0),c=[];if(!l||l.next===l.prev)return c;if(s&&(l=function(e,t,r,i){let n=[];for(let r=0,a=t.length;r<a;r++){let s=t[r]*i,o=r<a-1?t[r+1]*i:e.length,l=iE(e,s,o,i,!1);l===l.next&&(l.steiner=!0),n.push(function(e){let t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}(l))}n.sort(i_);for(let e=0;e<n.length;e++)r=function(e,t){let r=function(e,t){let r,i=t,n=e.x,a=e.y,s=-1/0;if(iR(e,i))return i;do{if(iR(e,i.next))return i.next;if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){let e=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>s&&(s=e,r=i.x<i.next.x?i:i.next,e===n))return r}i=i.next}while(i!==t);if(!r)return null;let o=r,l=r.x,c=r.y,h=1/0;i=r;do{if(n>=i.x&&i.x>=l&&n!==i.x&&iM(a<c?n:s,a,l,c,a<c?s:n,a,i.x,i.y)){var u,d;let t=Math.abs(a-i.y)/(n-i.x);iD(i,e)&&(t<h||t===h&&(i.x>r.x||i.x===r.x&&(u=r,d=i,0>iT(u.prev,u,d.prev)&&0>iT(d.next,u,u.next))))&&(r=i,h=t)}i=i.next}while(i!==o);return r}(e,t);if(!r)return t;let i=iL(r,e);return iw(i,i.next),iw(r,r.next)}(n[e],r);return r}(e,t,l,r)),e.length>80*r){i=e[0],n=e[1];let t=i,s=n;for(let a=r;a<o;a+=r){let r=e[a],o=e[a+1];r<i&&(i=r),o<n&&(n=o),r>t&&(t=r),o>s&&(s=o)}a=0!==(a=Math.max(t-i,s-n))?32767/a:0}return function e(t,r,i,n,a,s,o){if(!t)return;!o&&s&&function(e,t,r,i){let n=e;do 0===n.z&&(n.z=iC(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){let t,r=1;do{let i,n=e;e=null;let a=null;for(t=0;n;){t++;let s=n,o=0;for(let e=0;e<r&&(o++,s=s.nextZ);e++);let l=r;for(;o>0||l>0&&s;)0!==o&&(0===l||!s||n.z<=s.z)?(i=n,n=n.nextZ,o--):(i=s,s=s.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=s}a.nextZ=null,r*=2}while(t>1)}(n)}(t,n,a,s);let l=t;for(;t.prev!==t.next;){let c=t.prev,h=t.next;if(s?function(e,t,r,i){let n=e.prev,a=e.next;if(iT(n,e,a)>=0)return!1;let s=n.x,o=e.x,l=a.x,c=n.y,h=e.y,u=a.y,d=Math.min(s,o,l),p=Math.min(c,h,u),f=Math.max(s,o,l),g=Math.max(c,h,u),m=iC(d,p,t,r,i),A=iC(f,g,t,r,i),b=e.prevZ,v=e.nextZ;for(;b&&b.z>=m&&v&&v.z<=A;){if(b.x>=d&&b.x<=f&&b.y>=p&&b.y<=g&&b!==n&&b!==a&&iI(s,c,o,h,l,u,b.x,b.y)&&iT(b.prev,b,b.next)>=0||(b=b.prevZ,v.x>=d&&v.x<=f&&v.y>=p&&v.y<=g&&v!==n&&v!==a&&iI(s,c,o,h,l,u,v.x,v.y)&&iT(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;b&&b.z>=m;){if(b.x>=d&&b.x<=f&&b.y>=p&&b.y<=g&&b!==n&&b!==a&&iI(s,c,o,h,l,u,b.x,b.y)&&iT(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;v&&v.z<=A;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=g&&v!==n&&v!==a&&iI(s,c,o,h,l,u,v.x,v.y)&&iT(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}(t,n,a,s):function(e){let t=e.prev,r=e.next;if(iT(t,e,r)>=0)return!1;let i=t.x,n=e.x,a=r.x,s=t.y,o=e.y,l=r.y,c=Math.min(i,n,a),h=Math.min(s,o,l),u=Math.max(i,n,a),d=Math.max(s,o,l),p=r.next;for(;p!==t;){if(p.x>=c&&p.x<=u&&p.y>=h&&p.y<=d&&iI(i,s,n,o,a,l,p.x,p.y)&&iT(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(t)){r.push(c.i,t.i,h.i),iN(t),t=h.next,l=h.next;continue}if((t=h)===l){o?1===o?e(t=function(e,t){let r=e;do{let i=r.prev,n=r.next.next;!iR(i,n)&&iB(i,r,r.next,n)&&iD(i,n)&&iD(n,i)&&(t.push(i.i,r.i,n.i),iN(r),iN(r.next),r=e=n),r=r.next}while(r!==e);return iw(r)}(iw(t),r),r,i,n,a,s,2):2===o&&function(t,r,i,n,a,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){var l,c;if(o.i!==t.i&&(l=o,c=t,l.next.i!==c.i&&l.prev.i!==c.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&iB(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(l,c)&&(iD(l,c)&&iD(c,l)&&function(e,t){let r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==e);return i}(l,c)&&(iT(l.prev,l,c.prev)||iT(l,c.prev,c))||iR(l,c)&&iT(l.prev,l,l.next)>0&&iT(c.prev,c,c.next)>0))){let l=iL(o,t);o=iw(o,o.next),l=iw(l,l.next),e(o,r,i,n,a,s,0),e(l,r,i,n,a,s,0);return}t=t.next}o=o.next}while(o!==t)}(t,r,i,n,a,s):e(iw(t),r,i,n,a,s,1);break}}}(l,c,r,i,n,a,0),c}(e,t,r)}}class iQ{static area(e){let t=e.length,r=0;for(let i=t-1,n=0;n<t;i=n++)r+=e[i].x*e[n].y-e[n].x*e[i].y;return .5*r}static isClockWise(e){return 0>iQ.area(e)}static triangulateShape(e,t){let r=[],i=[],n=[];iz(e),iH(r,e);let a=e.length;t.forEach(iz);for(let e=0;e<t.length;e++)i.push(a),a+=t[e].length,iH(r,t[e]);let s=iO.triangulate(r,i);for(let e=0;e<s.length;e+=3)n.push(s.slice(e,e+3));return n}}function iz(e){let t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function iH(e,t){for(let r=0;r<t.length;r++)e.push(t[r].x),e.push(t[r].y)}class iG extends tD{constructor(e=1,t=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};const n=e/2,a=t/2,s=Math.floor(r),o=Math.floor(i),l=s+1,c=o+1,h=e/s,u=t/o,d=[],p=[],f=[],g=[];for(let e=0;e<c;e++){const t=e*u-a;for(let r=0;r<l;r++){const i=r*h-n;p.push(i,-t,0),f.push(0,0,1),g.push(r/s),g.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<s;t++){const r=t+l*e,i=t+l*(e+1),n=t+1+l*(e+1),a=t+1+l*e;d.push(r,i,a),d.push(i,n,a)}this.setIndex(d),this.setAttribute("position",new tC(p,3)),this.setAttribute("normal",new tC(f,3)),this.setAttribute("uv",new tC(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new iG(e.width,e.height,e.widthSegments,e.heightSegments)}}class iV extends tD{constructor(e=new iS([new D(0,.5),new D(-.5,-.5),new D(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const r=[],i=[],n=[],a=[];let s=0,o=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(s,o,t),s+=o,o=0;function l(e){let s=i.length/3,l=e.extractPoints(t),c=l.shape,h=l.holes;!1===iQ.isClockWise(c)&&(c=c.reverse());for(let e=0,t=h.length;e<t;e++){let t=h[e];!0===iQ.isClockWise(t)&&(h[e]=t.reverse())}let u=iQ.triangulateShape(c,h);for(let e=0,t=h.length;e<t;e++){let t=h[e];c=c.concat(t)}for(let e=0,t=c.length;e<t;e++){let t=c[e];i.push(t.x,t.y,0),n.push(0,0,1),a.push(t.x,t.y)}for(let e=0,t=u.length;e<t;e++){let t=u[e],i=t[0]+s,n=t[1]+s,a=t[2]+s;r.push(i,n,a),o+=3}}this.setIndex(r),this.setAttribute("position",new tC(i,3)),this.setAttribute("normal",new tC(n,3)),this.setAttribute("uv",new tC(a,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let r=0,i=e.length;r<i;r++){let i=e[r];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){let r=[];for(let i=0,n=e.shapes.length;i<n;i++){let n=t[e.shapes[i]];r.push(n)}return new iV(r,e.curveSegments)}}class ij extends tD{constructor(e=1,t=32,r=16,i=0,n=2*Math.PI,a=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:i,phiLength:n,thetaStart:a,thetaLength:s},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));const o=Math.min(a+s,Math.PI);let l=0;const c=[],h=new F,u=new F,d=[],p=[],f=[],g=[];for(let d=0;d<=r;d++){const m=[],A=d/r;let b=0;0===d&&0===a?b=.5/t:d===r&&o===Math.PI&&(b=-.5/t);for(let r=0;r<=t;r++){const o=r/t;h.x=-e*Math.cos(i+o*n)*Math.sin(a+A*s),h.y=e*Math.cos(a+A*s),h.z=e*Math.sin(i+o*n)*Math.sin(a+A*s),p.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),g.push(o+b,1-A),m.push(l++)}c.push(m)}for(let e=0;e<r;e++)for(let i=0;i<t;i++){const t=c[e][i+1],n=c[e][i],s=c[e+1][i],l=c[e+1][i+1];(0!==e||a>0)&&d.push(t,n,l),(e!==r-1||o<Math.PI)&&d.push(n,s,l)}this.setIndex(d),this.setAttribute("position",new tC(p,3)),this.setAttribute("normal",new tC(f,3)),this.setAttribute("uv",new tC(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ij(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class iq extends tZ{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class iW extends tm{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new tp(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tp(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new D(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ez,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class iX extends iW{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new D(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return I(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new tp(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new tp(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new tp(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class iY extends tm{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class iK extends tm{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function i$(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function iJ(e,t,r){let i=e.length,n=new e.constructor(i);for(let a=0,s=0;s!==i;++a){let i=r[a]*t;for(let r=0;r!==t;++r)n[s++]=e[i+r]}return n}function iZ(e,t,r,i){let n=1,a=e[0];for(;void 0!==a&&void 0===a[i];)a=e[n++];if(void 0===a)return;let s=a[i];if(void 0!==s)if(Array.isArray(s))do void 0!==(s=a[i])&&(t.push(a.time),r.push(...s)),a=e[n++];while(void 0!==a);else if(void 0!==s.toArray)do void 0!==(s=a[i])&&(t.push(a.time),s.toArray(r,r.length)),a=e[n++];while(void 0!==a);else do void 0!==(s=a[i])&&(t.push(a.time),r.push(s)),a=e[n++];while(void 0!==a)}class i0{constructor(e,t,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,r=this._cachedIndex,i=t[r],n=t[r-1];r:{i:{let a;n:{a:if(!(e<i)){for(let a=r+2;;){if(void 0===i){if(e<n)break a;return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===a)break;if(n=i,e<(i=t[++r]))break i}a=t.length;break n}if(!(e>=n)){let s=t[1];e<s&&(r=2,n=s);for(let a=r-2;;){if(void 0===n)return this._cachedIndex=0,this.copySampleValue_(0);if(r===a)break;if(i=n,e>=(n=t[--r-1]))break i}a=r,r=0;break n}break r}for(;r<a;){let i=r+a>>>1;e<t[i]?a=i:r=i+1}if(i=t[r],void 0===(n=t[r-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,n,i)}return this.interpolate_(r,n,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,n=e*i;for(let e=0;e!==i;++e)t[e]=r[n+e];return t}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class i1 extends i0{constructor(e,t,r,i){super(e,t,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,r){let i=this.parameterPositions,n=e-2,a=e+1,s=i[n],o=i[a];if(void 0===s)switch(this.getSettings_().endingStart){case 2401:n=e,s=2*t-r;break;case 2402:n=i.length-2,s=t+i[n]-i[n+1];break;default:n=e,s=r}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:a=e,o=2*r-t;break;case 2402:a=1,o=r+i[1]-i[0];break;default:a=e-1,o=t}let l=(r-t)*.5,c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(o-r),this._offsetPrev=n*c,this._offsetNext=a*c}interpolate_(e,t,r,i){let n=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(r-t)/(i-t),f=p*p,g=f*p,m=-u*g+2*u*f-u*p,A=(1+u)*g+(-1.5-2*u)*f+(-.5+u)*p+1,b=(-1-d)*g+(1.5+d)*f+.5*p,v=d*g-d*f;for(let e=0;e!==s;++e)n[e]=m*a[c+e]+A*a[l+e]+b*a[o+e]+v*a[h+e];return n}}class i2 extends i0{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){let n=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=(r-t)/(i-t),h=1-c;for(let e=0;e!==s;++e)n[e]=a[l+e]*h+a[o+e]*c;return n}}class i3 extends i0{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class i5{constructor(e,t,r,i){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=i$(t,this.TimeBufferType),this.values=i$(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){let t,r=e.constructor;if(r.toJSON!==this.toJSON)t=r.toJSON(e);else{t={name:e.name,times:i$(e.times,Array),values:i$(e.values,Array)};let r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}InterpolantFactoryMethodDiscrete(e){return new i3(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new i2(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new i1(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){let t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t);return b("KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){let t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]+=e}return this}scale(e){if(1!==e){let t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]*=e}return this}trim(e,t){let r=this.times,i=r.length,n=0,a=i-1;for(;n!==i&&r[n]<e;)++n;for(;-1!==a&&r[a]>t;)--a;if(++a,0!==n||a!==i){n>=a&&(n=(a=Math.max(a,1))-1);let e=this.getValueSize();this.times=r.slice(n,a),this.values=this.values.slice(n*e,a*e)}return this}validate(){var e;let t=!0,r=this.getValueSize();r-Math.floor(r)!=0&&(v("KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,n=this.values,a=i.length;0===a&&(v("KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==a;e++){let r=i[e];if("number"==typeof r&&isNaN(r)){v("KeyframeTrack: Time is not a valid number.",this,e,r),t=!1;break}if(null!==s&&s>r){v("KeyframeTrack: Out of order keys.",this,e,r,s),t=!1;break}s=r}if(void 0!==n&&ArrayBuffer.isView(e=n)&&!(e instanceof DataView))for(let e=0,r=n.length;e!==r;++e){let r=n[e];if(isNaN(r)){v("KeyframeTrack: Value is not a valid number.",this,e,r),t=!1;break}}return t}optimize(){let e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),i=2302===this.getInterpolation(),n=e.length-1,a=1;for(let s=1;s<n;++s){let n=!1,o=e[s];if(o!==e[s+1]&&(1!==s||o!==e[0]))if(i)n=!0;else{let e=s*r,i=e-r,a=e+r;for(let s=0;s!==r;++s){let r=t[e+s];if(r!==t[i+s]||r!==t[a+s]){n=!0;break}}}if(n){if(s!==a){e[a]=e[s];let i=s*r,n=a*r;for(let e=0;e!==r;++e)t[n+e]=t[i+e]}++a}}if(n>0){e[a]=e[n];for(let e=n*r,i=a*r,s=0;s!==r;++s)t[i+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*r)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),r=new this.constructor(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}i5.prototype.ValueTypeName="",i5.prototype.TimeBufferType=Float32Array,i5.prototype.ValueBufferType=Float32Array,i5.prototype.DefaultInterpolation=2301;class i4 extends i5{constructor(e,t,r){super(e,t,r)}}i4.prototype.ValueTypeName="bool",i4.prototype.ValueBufferType=Array,i4.prototype.DefaultInterpolation=2300,i4.prototype.InterpolantFactoryMethodLinear=void 0,i4.prototype.InterpolantFactoryMethodSmooth=void 0;class i8 extends i5{constructor(e,t,r,i){super(e,t,r,i)}}i8.prototype.ValueTypeName="color";class i9 extends i5{constructor(e,t,r,i){super(e,t,r,i)}}i9.prototype.ValueTypeName="number";class i6 extends i0{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){let n=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(r-t)/(i-t),l=e*s;for(let e=l+s;l!==e;l+=4)L.slerpFlat(n,0,a,l-s,a,l,o);return n}}class i7 extends i5{constructor(e,t,r,i){super(e,t,r,i)}InterpolantFactoryMethodLinear(e){return new i6(this.times,this.values,this.getValueSize(),e)}}i7.prototype.ValueTypeName="quaternion",i7.prototype.InterpolantFactoryMethodSmooth=void 0;class ne extends i5{constructor(e,t,r){super(e,t,r)}}ne.prototype.ValueTypeName="string",ne.prototype.ValueBufferType=Array,ne.prototype.DefaultInterpolation=2300,ne.prototype.InterpolantFactoryMethodLinear=void 0,ne.prototype.InterpolantFactoryMethodSmooth=void 0;class nt extends i5{constructor(e,t,r,i){super(e,t,r,i)}}nt.prototype.ValueTypeName="vector";class nr{constructor(e="",t=-1,r=[],i=2500){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=M(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],r=e.tracks,i=1/(e.fps||1);for(let e=0,n=r.length;e!==n;++e)t.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return i9;case"vector":case"vector2":case"vector3":case"vector4":return nt;case"color":return i8;case"quaternion":return i7;case"bool":case"boolean":return i4;case"string":return ne}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],r=[];iZ(e.keys,t,r,"value"),e.times=t,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)})(r[e]).scale(i));let n=new this(e.name,e.duration,t,e.blendMode);return n.uuid=e.uuid,n.userData=JSON.parse(e.userData||"{}"),n}static toJSON(e){let t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,i=r.length;e!==i;++e)t.push(i5.toJSON(r[e]));return i}static CreateFromMorphTargetSequence(e,t,r,i){let n=t.length,a=[];for(let e=0;e<n;e++){let s=[],o=[];s.push((e+n-1)%n,e,(e+1)%n),o.push(0,1,0);let l=function(e){let t=e.length,r=Array(t);for(let e=0;e!==t;++e)r[e]=e;return r.sort(function(t,r){return e[t]-e[r]}),r}(s);s=iJ(s,1,l),o=iJ(o,1,l),i||0!==s[0]||(s.push(n),o.push(o[0])),a.push(new i9(".morphTargetInfluences["+t[e].name+"]",s,o).scale(1/r))}return new this(e,-1,a)}static findByName(e,t){let r=e;Array.isArray(e)||(r=e.geometry&&e.geometry.animations||e.animations);for(let e=0;e<r.length;e++)if(r[e].name===t)return r[e];return null}static CreateClipsFromMorphTargetSequences(e,t,r){let i={},n=/^([\w-]*?)([\d]+)$/;for(let t=0,r=e.length;t<r;t++){let r=e[t],a=r.name.match(n);if(a&&a.length>1){let e=a[1],t=i[e];t||(i[e]=t=[]),t.push(r)}}let a=[];for(let e in i)a.push(this.CreateFromMorphTargetSequence(e,i[e],t,r));return a}static parseAnimation(e,t){if(b("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return v("AnimationClip: No animation in JSONLoader data."),null;let r=function(e,t,r,i,n){if(0!==r.length){let a=[],s=[];iZ(r,a,s,i),0!==a.length&&n.push(new e(t,a,s))}},i=[],n=e.name||"default",a=e.fps||30,s=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let e=0;e<l.length;e++){let n=l[e].keys;if(n&&0!==n.length)if(n[0].morphTargets){let e,t={};for(e=0;e<n.length;e++)if(n[e].morphTargets)for(let r=0;r<n[e].morphTargets.length;r++)t[n[e].morphTargets[r]]=-1;for(let r in t){let t=[],a=[];for(let i=0;i!==n[e].morphTargets.length;++i){let i=n[e];t.push(i.time),a.push(+(i.morphTarget===r))}i.push(new i9(".morphTargetInfluence["+r+"]",t,a))}o=t.length*a}else{let a=".bones["+t[e].name+"]";r(nt,a+".position",n,"pos",i),r(i7,a+".quaternion",n,"rot",i),r(nt,a+".scale",n,"scl",i)}}return 0===i.length?null:new this(n,o,i,s)}resetDuration(){let e=this.tracks,t=0;for(let r=0,i=e.length;r!==i;++r){let e=this.tracks[r];t=Math.max(t,e.times[e.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());let t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}let ni={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class nn{constructor(e,t,r){let i;const n=this;let a=!1,s=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this._abortController=null,this.itemStart=function(e){o++,!1===a&&void 0!==n.onStart&&n.onStart(e,s,o),a=!0},this.itemEnd=function(e){s++,void 0!==n.onProgress&&n.onProgress(e,s,o),s===o&&(a=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){let t=l.indexOf(e);return -1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,r=l.length;t<r;t+=2){let r=l[t],i=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}let na=new nn;class ns{constructor(e){this.manager=void 0!==e?e:na,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let r=this;return new Promise(function(i,n){r.load(e,i,t,n)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}ns.DEFAULT_MATERIAL_NAME="__DEFAULT";let no={};class nl extends Error{constructor(e,t){super(e),this.response=t}}class nc extends ns{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,r,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let n=ni.get(`file:${e}`);if(void 0!==n)return this.manager.itemStart(e),setTimeout(()=>{t&&t(n),this.manager.itemEnd(e)},0),n;if(void 0!==no[e])return void no[e].push({onLoad:t,onProgress:r,onError:i});no[e]=[],no[e].push({onLoad:t,onProgress:r,onError:i});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),s=this.mimeType,o=this.responseType;fetch(a).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&b("FileLoader: HTTP Status 0 received."),"u"<typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;let r=no[e],i=t.body.getReader(),n=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),a=n?parseInt(n):0,s=0!==a,o=0;return new Response(new ReadableStream({start(e){!function t(){i.read().then(({done:i,value:n})=>{if(i)e.close();else{let i=new ProgressEvent("progress",{lengthComputable:s,loaded:o+=n.byteLength,total:a});for(let e=0,t=r.length;e<t;e++){let t=r[e];t.onProgress&&t.onProgress(i)}e.enqueue(n),t()}},t=>{e.error(t)})}()}}))}throw new nl(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>new DOMParser().parseFromString(e,s));case"json":return e.json();default:if(""===s)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(s),r=new TextDecoder(t&&t[1]?t[1].toLowerCase():void 0);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{ni.add(`file:${e}`,t);let r=no[e];delete no[e];for(let e=0,i=r.length;e<i;e++){let i=r[e];i.onLoad&&i.onLoad(t)}}).catch(t=>{let r=no[e];if(void 0===r)throw this.manager.itemError(e),t;delete no[e];for(let e=0,i=r.length;e<i;e++){let i=r[e];i.onError&&i.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let nh=new WeakMap;class nu extends ns{constructor(e){super(e)}load(e,t,r,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let n=this,a=ni.get(`image:${e}`);if(void 0!==a){if(!0===a.complete)n.manager.itemStart(e),setTimeout(function(){t&&t(a),n.manager.itemEnd(e)},0);else{let e=nh.get(a);void 0===e&&(e=[],nh.set(a,e)),e.push({onLoad:t,onError:i})}return a}let s=f("img");function o(){c(),t&&t(this);let r=nh.get(this)||[];for(let e=0;e<r.length;e++){let t=r[e];t.onLoad&&t.onLoad(this)}nh.delete(this),n.manager.itemEnd(e)}function l(t){c(),i&&i(t),ni.remove(`image:${e}`);let r=nh.get(this)||[];for(let e=0;e<r.length;e++){let i=r[e];i.onError&&i.onError(t)}nh.delete(this),n.manager.itemError(e),n.manager.itemEnd(e)}function c(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),ni.add(`image:${e}`,s),n.manager.itemStart(e),s.src=e,s}}class nd extends ns{constructor(e){super(e)}load(e,t,r,i){let n=this,a=new rm,s=new nc(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(n.withCredentials),s.load(e,function(e){let r;try{r=n.parse(e)}catch(e){if(void 0===i)return void e(e);i(e)}void 0!==r.image?a.image=r.image:void 0!==r.data&&(a.image.width=r.width,a.image.height=r.height,a.image.data=r.data),a.wrapS=void 0!==r.wrapS?r.wrapS:1001,a.wrapT=void 0!==r.wrapT?r.wrapT:1001,a.magFilter=void 0!==r.magFilter?r.magFilter:1006,a.minFilter=void 0!==r.minFilter?r.minFilter:1006,a.anisotropy=void 0!==r.anisotropy?r.anisotropy:1,void 0!==r.colorSpace&&(a.colorSpace=r.colorSpace),void 0!==r.flipY&&(a.flipY=r.flipY),void 0!==r.format&&(a.format=r.format),void 0!==r.type&&(a.type=r.type),void 0!==r.mipmaps&&(a.mipmaps=r.mipmaps,a.minFilter=1008),1===r.mipmapCount&&(a.minFilter=1006),void 0!==r.generateMipmaps&&(a.generateMipmaps=r.generateMipmaps),a.needsUpdate=!0,t&&t(a,r)},r,i),a}}class np extends ns{constructor(e){super(e)}load(e,t,r,i){let n=new J,a=new nu(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){n.image=e,n.needsUpdate=!0,void 0!==t&&t(n)},r,i),n}}class nf extends e5{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new tp(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}let ng=new eB,nm=new F,nA=new F;class nb{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new D(512,512),this.mapType=1009,this.map=null,this.mapPass=null,this.matrix=new eB,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new rF,this._frameExtents=new D(1,1),this._viewportCount=1,this._viewports=[new Z(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,r=this.matrix;nm.setFromMatrixPosition(e.matrixWorld),t.position.copy(nm),nA.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(nA),t.updateMatrixWorld(),ng.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ng,t.coordinateSystem,t.reversedDepth),t.reversedDepth?r.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(ng)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class nv extends nb{constructor(){super(new t5(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,r=2*C*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,n=e.distance||t.far;(r!==t.fov||i!==t.aspect||n!==t.far)&&(t.fov=r,t.aspect=i,t.far=n,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class ny extends nf{constructor(e,t,r=0,i=Math.PI/3,n=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(e5.DEFAULT_UP),this.updateMatrix(),this.target=new e5,this.distance=r,this.angle=i,this.penumbra=n,this.decay=a,this.map=null,this.shadow=new nv}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class nx extends nb{constructor(){super(new t5(90,1,.5,500)),this.isPointLightShadow=!0}}class nS extends nf{constructor(e,t,r=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new nx}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class nE extends t0{constructor(e=-1,t=1,r=1,i=-1,n=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=n,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,r,i,n,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2,n=r-e,a=r+e,s=i+t,o=i-t;if(null!==this.view&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=e*this.view.offsetX,a=n+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(n,a,s,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}class nw extends nb{constructor(){super(new nE(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class n_ extends nf{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(e5.DEFAULT_UP),this.updateMatrix(),this.target=new e5,this.shadow=new nw}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class nC{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new F)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let r=e.x,i=e.y,n=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*i),t.addScaledVector(a[2],.488603*n),t.addScaledVector(a[3],.488603*r),t.addScaledVector(a[4],r*i*1.092548),t.addScaledVector(a[5],i*n*1.092548),t.addScaledVector(a[6],.315392*(3*n*n-1)),t.addScaledVector(a[7],r*n*1.092548),t.addScaledVector(a[8],.546274*(r*r-i*i)),t}getIrradianceAt(e,t){let r=e.x,i=e.y,n=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*i),t.addScaledVector(a[2],1.023328*n),t.addScaledVector(a[3],1.023328*r),t.addScaledVector(a[4],.858086*r*i),t.addScaledVector(a[5],.858086*i*n),t.addScaledVector(a[6],.743125*n*n-.247708),t.addScaledVector(a[7],.858086*r*n),t.addScaledVector(a[8],.429043*(r*r-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){let r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(e,t+3*i);return this}toArray(e=[],t=0){let r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(e,t+3*i);return e}static getBasisAt(e,t){let r=e.x,i=e.y,n=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*n,t[3]=.488603*r,t[4]=1.092548*r*i,t[5]=1.092548*i*n,t[6]=.315392*(3*n*n-1),t[7]=1.092548*r*n,t[8]=.546274*(r*r-i*i)}}class nM extends nf{constructor(e=new nC,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class nI{static extractUrlBase(e){let t=e.lastIndexOf("/");return -1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e))?e:t+e}}let nT=new WeakMap;class nR extends ns{constructor(e){super(e),this.isImageBitmapLoader=!0,"u"<typeof createImageBitmap&&b("ImageBitmapLoader: createImageBitmap() not supported."),"u"<typeof fetch&&b("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,r,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let n=this,a=ni.get(`image-bitmap:${e}`);if(void 0!==a)return(n.manager.itemStart(e),a.then)?void a.then(r=>{if(!0!==nT.has(a))return t&&t(r),n.manager.itemEnd(e),r;i&&i(nT.get(a)),n.manager.itemError(e),n.manager.itemEnd(e)}):(setTimeout(function(){t&&t(a),n.manager.itemEnd(e)},0),a);let s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,s.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(e,s).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(n.options,{colorSpaceConversion:"none"}))}).then(function(r){return ni.add(`image-bitmap:${e}`,r),t&&t(r),n.manager.itemEnd(e),r}).catch(function(t){i&&i(t),nT.set(o,t),ni.remove(`image-bitmap:${e}`),n.manager.itemError(e),n.manager.itemEnd(e)});ni.add(`image-bitmap:${e}`,o),n.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class nB extends t5{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class nk{constructor(e,t,r){let i,n,a;switch(this.binding=e,this.valueSize=r,t){case"quaternion":i=this._slerp,n=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*r),this._workIndex=5;break;case"string":case"bool":i=this._select,n=this._select,a=this._setAdditiveIdentityOther,this.buffer=Array(5*r);break;default:i=this._lerp,n=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*r)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=n,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){let r=this.buffer,i=this.valueSize,n=e*i+i,a=this.cumulativeWeight;if(0===a){for(let e=0;e!==i;++e)r[n+e]=r[e];a=t}else{a+=t;let e=t/a;this._mixBufferRegion(r,n,0,e,i)}this.cumulativeWeight=a}accumulateAdditive(e){let t=this.buffer,r=this.valueSize,i=r*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,r=this.buffer,i=e*t+t,n=this.cumulativeWeight,a=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,n<1){let e=t*this._origIndex;this._mixBufferRegion(r,i,e,1-n,t)}a>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let e=t,n=t+t;e!==n;++e)if(r[e]!==r[e+t]){s.setValue(r,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let e=r;e!==i;++e)t[e]=t[i+e%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,i,n){if(i>=.5)for(let i=0;i!==n;++i)e[t+i]=e[r+i]}_slerp(e,t,r,i){L.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,n){let a=this._workIndex*n;L.multiplyQuaternionsFlat(e,a,e,t,e,r),L.slerpFlat(e,t,e,t,e,a,i)}_lerp(e,t,r,i,n){let a=1-i;for(let s=0;s!==n;++s){let n=t+s;e[n]=e[n]*a+e[r+s]*i}}_lerpAdditive(e,t,r,i,n){for(let a=0;a!==n;++a){let n=t+a;e[n]=e[n]+e[r+a]*i}}}let nP="\\[\\]\\.:\\/",nD=RegExp("["+nP+"]","g"),nL="[^"+nP+"]",nF="[^"+nP.replace("\\.","")+"]",nN=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",nL)+/(WCOD+)?/.source.replace("WCOD",nF)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",nL)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",nL)+"$"),nU=["material","materials","bones","map"];class nO{constructor(e,t,r){this.path=t,this.parsedPath=r||nO.parseTrackName(t),this.node=nO.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new nO.Composite(e,t,r):new nO(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(nD,"")}static parseTrackName(e){let t=nN.exec(e);if(null===t)throw Error("PropertyBinding: Cannot parse trackName: "+e);let r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){let e=r.nodeName.substring(i+1);-1!==nU.indexOf(e)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=e)}if(null===r.propertyName||0===r.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let r=e.skeleton.getBoneByName(t);if(void 0!==r)return r}if(e.children){let r=function(e){for(let i=0;i<e.length;i++){let n=e[i];if(n.name===t||n.uuid===t)return n;let a=r(n.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)e[t++]=r[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,r=t.objectName,i=t.propertyName,n=t.propertyIndex;if(e||(e=nO.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void b("PropertyBinding: No target node found for track: "+this.path+".");if(r){let i=t.objectIndex;switch(r){case"materials":if(!e.material)return void v("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void v("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void v("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===i){i=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void v("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void v("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[r])return void v("PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[r]}if(void 0!==i){if(void 0===e[i])return void v("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[i]}}let a=e[i];if(void 0===a)return void v("PropertyBinding: Trying to update property for track: "+t.nodeName+"."+i+" but it wasn't found.",e);let s=this.Versioning.None;this.targetObject=e,!0===e.isMaterial?s=this.Versioning.NeedsUpdate:!0===e.isObject3D&&(s=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==n){if("morphTargetInfluences"===i){if(!e.geometry)return void v("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void v("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[n]&&(n=e.morphTargetDictionary[n])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=n}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}nO.Composite=class{constructor(e,t,r){const i=r||nO.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let r=this._targetGroup.nCachedObjects_,i=this._bindings[r];void 0!==i&&i.getValue(e,t)}setValue(e,t){let r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=r.length;i!==n;++i)r[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},nO.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},nO.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},nO.prototype.GetterByBindingType=[nO.prototype._getValue_direct,nO.prototype._getValue_array,nO.prototype._getValue_arrayElement,nO.prototype._getValue_toArray],nO.prototype.SetterByBindingTypeAndVersioning=[[nO.prototype._setValue_direct,nO.prototype._setValue_direct_setNeedsUpdate,nO.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[nO.prototype._setValue_array,nO.prototype._setValue_array_setNeedsUpdate,nO.prototype._setValue_array_setMatrixWorldNeedsUpdate],[nO.prototype._setValue_arrayElement,nO.prototype._setValue_arrayElement_setNeedsUpdate,nO.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[nO.prototype._setValue_fromArray,nO.prototype._setValue_fromArray_setNeedsUpdate,nO.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class nQ{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const n=t.tracks,a=n.length,s=Array(a),o={endingStart:2400,endingEnd:2400};for(let e=0;e!==a;++e){const t=n[e].createInterpolant(null);s[e]=t,t.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r=!1){if(e.fadeOut(t),this.fadeIn(t),!0===r){let r=this._clip.duration,i=e._clip.duration;e.warp(1,i/r,t),this.warp(r/i,1,t)}return this}crossFadeTo(e,t,r=!1){return e.crossFadeFrom(this,t,r)}stopFading(){let e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){let i=this._mixer,n=i.time,a=this.timeScale,s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);let o=s.parameterPositions,l=s.sampleValues;return o[0]=n,o[1]=n+r,l[0]=e/a,l[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,i){if(!this.enabled)return void this._updateWeight(e);let n=this._startTime;if(null!==n){let i=(e-n)*r;i<0||0===r?t=0:(this._startTime=null,t=r*i)}t*=this._updateTimeScale(e);let a=this._updateTime(t),s=this._updateWeight(e);if(s>0){let e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let r=0,i=e.length;r!==i;++r)e[r].evaluate(a),t[r].accumulateAdditive(s);else for(let r=0,n=e.length;r!==n;++r)e[r].evaluate(a),t[r].accumulate(i,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let r=this._weightInterpolant;if(null!==r){let i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let r=this._timeScaleInterpolant;null!==r&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,r=this.loop,i=this.time+e,n=this._loopCount,a=2202===r;if(0===e)return -1===n?i:a&&(1&n)==1?t-i:i;if(2200===r){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));s:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break s}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===n&&(e>=0?(n=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),i>=t||i<0){let r=Math.floor(i/t);i-=t*r,n+=Math.abs(r);let s=this.repetitions-n;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=n,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=i;if(a&&(1&n)==1)return t-i}return i}_setEndings(e,t,r){let i=this._interpolantSettings;r?(i.endingStart=2401,i.endingEnd=2401):(e?i.endingStart=this.zeroSlopeAtStart?2401:2400:i.endingStart=2402,t?i.endingEnd=this.zeroSlopeAtEnd?2401:2400:i.endingEnd=2402)}_scheduleFading(e,t,r){let i=this._mixer,n=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);let s=a.parameterPositions,o=a.sampleValues;return s[0]=n,o[0]=t,s[1]=n+e,o[1]=r,this}}let nz=new Float32Array(1);class nH extends S{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let r=e._localRoot||this._root,i=e._clip.tracks,n=i.length,a=e._propertyBindings,s=e._interpolants,o=r.uuid,l=this._bindingsByRootAndName,c=l[o];void 0===c&&(c={},l[o]=c);for(let e=0;e!==n;++e){let n=i[e],l=n.name,h=c[l];if(void 0!==h)++h.referenceCount,a[e]=h;else{if(void 0!==(h=a[e])){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,o,l));continue}let i=t&&t._propertyBindings[e].binding.parsedPath;h=new nk(nO.create(r,l,i),n.ValueTypeName,n.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,o,l),a[e]=h}s[e].resultBuffer=h.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,r=e._clip.uuid,i=this._actionsByClip[r];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,r,t)}let t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){let r=t[e];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){let r=t[e];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,r){let i=this._actions,n=this._actionsByClip,a=n[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,n[t]=a;else{let t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=i.length,i.push(e),a.actionByRoot[r]=e}_removeInactiveAction(e){let t=this._actions,r=t[t.length-1],i=e._cacheIndex;r._cacheIndex=i,t[i]=r,t.pop(),e._cacheIndex=null;let n=e._clip.uuid,a=this._actionsByClip,s=a[n],o=s.knownActions,l=o[o.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,o[c]=l,o.pop(),e._byClipCacheIndex=null;let h=s.actionByRoot,u=(e._localRoot||this._root).uuid;delete h[u],0===o.length&&delete a[n],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){let r=t[e];0==--r.referenceCount&&this._removeInactiveBinding(r)}}_lendAction(e){let t=this._actions,r=e._cacheIndex,i=this._nActiveActions++,n=t[i];e._cacheIndex=i,t[i]=e,n._cacheIndex=r,t[r]=n}_takeBackAction(e){let t=this._actions,r=e._cacheIndex,i=--this._nActiveActions,n=t[i];e._cacheIndex=i,t[i]=e,n._cacheIndex=r,t[r]=n}_addInactiveBinding(e,t,r){let i=this._bindingsByRootAndName,n=this._bindings,a=i[t];void 0===a&&(a={},i[t]=a),a[r]=e,e._cacheIndex=n.length,n.push(e)}_removeInactiveBinding(e){let t=this._bindings,r=e.binding,i=r.rootNode.uuid,n=r.path,a=this._bindingsByRootAndName,s=a[i],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete s[n],0===Object.keys(s).length&&delete a[i]}_lendBinding(e){let t=this._bindings,r=e._cacheIndex,i=this._nActiveBindings++,n=t[i];e._cacheIndex=i,t[i]=e,n._cacheIndex=r,t[r]=n}_takeBackBinding(e){let t=this._bindings,r=e._cacheIndex,i=--this._nActiveBindings,n=t[i];e._cacheIndex=i,t[i]=e,n._cacheIndex=r,t[r]=n}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,r=e[t];return void 0===r&&((r=new i2(new Float32Array(2),new Float32Array(2),1,nz)).__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){let t=this._controlInterpolants,r=e.__cacheIndex,i=--this._nActiveControlInterpolants,n=t[i];e.__cacheIndex=i,t[i]=e,n.__cacheIndex=r,t[r]=n}clipAction(e,t,r){let i=t||this._root,n=i.uuid,a="string"==typeof e?nr.findByName(i,e):e,s=null!==a?a.uuid:e,o=this._actionsByClip[s],l=null;if(void 0===r&&(r=null!==a?a.blendMode:2500),void 0!==o){let e=o.actionByRoot[n];if(void 0!==e&&e.blendMode===r)return e;l=o.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;let c=new nQ(this,a,t,r);return this._bindAction(c,l),this._addInactiveAction(c,s,n),c}existingAction(e,t){let r=t||this._root,i=r.uuid,n="string"==typeof e?nr.findByName(r,e):e,a=n?n.uuid:e,s=this._actionsByClip[a];return void 0!==s&&s.actionByRoot[i]||null}stopAllAction(){let e=this._actions,t=this._nActiveActions;for(let r=t-1;r>=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;let t=this._actions,r=this._nActiveActions,i=this.time+=e,n=Math.sign(e),a=this._accuIndex^=1;for(let s=0;s!==r;++s)t[s]._update(i,e,n,a);let s=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)s[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,r=e.uuid,i=this._actionsByClip,n=i[r];if(void 0!==n){let e=n.knownActions;for(let r=0,i=e.length;r!==i;++r){let i=e[r];this._deactivateAction(i);let n=i._cacheIndex,a=t[t.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,a._cacheIndex=n,t[n]=a,t.pop(),this._removeInactiveBindingsForAction(i)}delete i[r]}}uncacheRoot(e){let t=e.uuid,r=this._actionsByClip;for(let e in r){let i=r[e].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}let i=this._bindingsByRootAndName[t];if(void 0!==i)for(let e in i){let t=i[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){let r=this.existingAction(e,t);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}}let nG=new eB;class nV{constructor(e,t,r=0,i=1/0){this.ray=new eR(e,t),this.near=r,this.far=i,this.camera=null,this.layers=new eH,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):v("Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return nG.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(nG),this}intersectObject(e,t=!0,r=[]){return nq(e,this,r,t),r.sort(nj),r}intersectObjects(e,t=!0,r=[]){for(let i=0,n=e.length;i<n;i++)nq(e[i],this,r,t);return r.sort(nj),r}}function nj(e,t){return e.distance-t.distance}function nq(e,t,r,i){let n=!0;if(e.layers.test(t.layers)&&!1===e.raycast(t,r)&&(n=!1),!0===n&&!0===i){let i=e.children;for(let e=0,n=i.length;e<n;e++)nq(i[e],t,r,!0)}}class nW{constructor(e=1,t=0,r=0){this.radius=e,this.phi=t,this.theta=r}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=I(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(I(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}function nX(e,t,r,i){let n=function(e){switch(e){case 1009:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case 1014:case 1013:case 1015:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${e}.`)}(i);switch(r){case 1021:return e*t;case 1028:case 1029:return e*t/n.components*n.byteLength;case 1030:case 1031:return e*t*2/n.components*n.byteLength;case 1022:return e*t*3/n.components*n.byteLength;case 1023:case 1033:return e*t*4/n.components*n.byteLength;case 33776:case 33777:case 36196:case 37492:case 37488:case 37489:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case 33778:case 33779:case 37496:case 37490:case 37491:case 37808:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 35841:case 35843:return Math.max(e,16)*Math.max(t,8)/4;case 35840:case 35842:return Math.max(e,8)*Math.max(t,8)/2;case 37809:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case 37810:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case 37811:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case 37812:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case 37813:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case 37814:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case 37815:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case 37816:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case 37817:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case 37818:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case 37819:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case 37820:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case 37821:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case 36492:case 36494:case 36495:case 36285:case 36286:return Math.ceil(e/4)*Math.ceil(t/4)*16;case 36283:case 36284:return Math.ceil(e/4)*Math.ceil(t/4)*8}throw Error(`Unable to determine texture byte length for ${r} format.`)}"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"182"}})),"u">typeof window&&(window.__THREE__?b("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="182")},3770(e,t,r){"use strict";r.d(t,{B:()=>h,v:()=>n});var i=r(874);class n extends i.B69{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new i.I9Y(.5,.5),this.addEventListener("removed",function(){this.traverse(function(e){e.element&&e.element instanceof e.element.ownerDocument.defaultView.Element&&null!==e.element.parentNode&&e.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}let a=new i.Pq0,s=new i.kn4,o=new i.kn4,l=new i.Pq0,c=new i.Pq0;class h{constructor(e={}){let t,r,i,n;const h=this,u={objects:new WeakMap},d=void 0!==e.element?e.element:document.createElement("div");d.style.overflow="hidden",this.domElement=d,this.sortObjects=!0,this.getSize=function(){return{width:t,height:r}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),s.copy(t.matrixWorldInverse),o.multiplyMatrices(t.projectionMatrix,s),function e(t,r,s){if(!1===t.visible)return void function e(t){t.isCSS2DObject&&(t.element.style.display="none");for(let r=0,i=t.children.length;r<i;r++)e(t.children[r])}(t);if(t.isCSS2DObject){var p,f;a.setFromMatrixPosition(t.matrixWorld),a.applyMatrix4(o);let e=a.z>=-1&&a.z<=1&&!0===t.layers.test(s.layers),g=t.element;g.style.display=!0===e?"":"none",!0===e&&(t.onBeforeRender(h,r,s),g.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(a.x*i+i)+"px,"+(-a.y*n+n)+"px)",g.parentNode!==d&&d.appendChild(g),t.onAfterRender(h,r,s));let m={distanceToCameraSquared:(p=s,f=t,l.setFromMatrixPosition(p.matrixWorld),c.setFromMatrixPosition(f.matrixWorld),l.distanceToSquared(c))};u.objects.set(t,m)}for(let i=0,n=t.children.length;i<n;i++)e(t.children[i],r,s)}(e,e,t),this.sortObjects&&function(e){let t,r=(t=[],e.traverseVisible(function(e){e.isCSS2DObject&&t.push(e)}),t).sort(function(e,t){return e.renderOrder!==t.renderOrder?t.renderOrder-e.renderOrder:u.objects.get(e).distanceToCameraSquared-u.objects.get(t).distanceToCameraSquared}),i=r.length;for(let e=0,t=r.length;e<t;e++)r[e].element.style.zIndex=i-e}(e)},this.setSize=function(e,a){t=e,r=a,i=t/2,n=r/2,d.style.width=e+"px",d.style.height=a+"px"}}}}}]);