t2-model-skinner/docs/_next/static/chunks/258.53d25aa602c4d686.js
2022-12-02 22:26:17 -08:00

1039 lines
343 KiB
JavaScript

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[258],{258:function(e,t,i){let s,r,n,a,A,o,l,h;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/ let c=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}}:{...t,finisher(i){i.createProperty(t.key,e)}};function u(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):c(e,t)}null!=(null===(I=window.HTMLSlotElement)||void 0===I?void 0:I.prototype.assignedElements)||((e,t)=>e.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE));var g,d,p,m,I,f,E,C,B,y,Q,w,v,S,b,x,M,R,D,T,L,F,k,_,U,N,G,P,O,H,q,K,V,J,Y,j,z,$,W,X,Z,ee,et,ei,es,er,en,ea,eA,eo,el=i(9477);/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/ let eh=window,ec=eh.ShadowRoot&&(void 0===eh.ShadyCSS||eh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,eu=Symbol(),eg=new WeakMap;class ed{constructor(e,t,i){if(this._$cssResult$=!0,i!==eu)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(ec&&void 0===e){let i=void 0!==t&&1===t.length;i&&(e=eg.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&eg.set(t,e))}return e}toString(){return this.cssText}}let ep=e=>new ed("string"==typeof e?e:e+"",void 0,eu),em=(e,t)=>{ec?e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(t=>{let i=document.createElement("style"),s=eh.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=t.cssText,e.appendChild(i)})},eI=ec?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return ep(t)})(e):e,ef=window,eE=ef.trustedTypes,eC=eE?eE.emptyScript:"",eB=ef.reactiveElementPolyfillSupport,ey={toAttribute(e,t){switch(t){case Boolean:e=e?eC:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(s){i=null}}return i}},eQ=(e,t)=>t!==e&&(t==t||e==e),ew={attribute:!0,type:String,converter:ey,reflect:!1,hasChanged:eQ};class ev extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,i)=>{let s=this._$Ep(i,t);void 0!==s&&(this._$Ev.set(s,i),e.push(s))}),e}static createProperty(e,t=ew){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let i="symbol"==typeof e?Symbol():"__"+e,s=this.getPropertyDescriptor(e,i,t);void 0!==s&&Object.defineProperty(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(s){let r=this[e];this[t]=s,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ew}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let s of i)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let s of i)t.unshift(eI(s))}else void 0!==e&&t.push(eI(e));return t}static _$Ep(e,t){let i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach(e=>e(this))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return em(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=ew){var s;let r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){let n=(void 0!==(null===(s=i.converter)||void 0===s?void 0:s.toAttribute)?i.converter:ey).toAttribute(t,i.type);this._$El=e,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(e,t){var i;let s=this.constructor,r=s._$Ev.get(e);if(void 0!==r&&this._$El!==r){let n=s.getPropertyOptions(r),a="function"==typeof n.converter?{fromAttribute:n.converter}:void 0!==(null===(i=n.converter)||void 0===i?void 0:i.fromAttribute)?n.converter:ey;this._$El=r,this[r]=a.fromAttribute(t,n.type),this._$El=null}}requestUpdate(e,t,i){let s=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||eQ)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((e,t)=>this[t]=e),this._$Ei=void 0);let t=!1,i=this._$AL;try{(t=this.shouldUpdate(i))?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(i)):this._$Ek()}catch(s){throw t=!1,this._$Ek(),s}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach((e,t)=>this._$EO(t,this[t],e)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}ev.finalized=!0,ev.elementProperties=new Map,ev.elementStyles=[],ev.shadowRootOptions={mode:"open"},null==eB||eB({ReactiveElement:ev}),(null!==(f=ef.reactiveElementVersions)&&void 0!==f?f:ef.reactiveElementVersions=[]).push("1.4.2");let eS=window,eb=eS.trustedTypes,ex=eb?eb.createPolicy("lit-html",{createHTML:e=>e}):void 0,eM=`lit$${(Math.random()+"").slice(9)}$`,eR="?"+eM,eD=`<${eR}>`,eT=document,eL=(e="")=>eT.createComment(e),eF=e=>null===e||"object"!=typeof e&&"function"!=typeof e,ek=Array.isArray,e_=e=>ek(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),eU=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,eN=/-->/g,eG=/>/g,eP=RegExp(">|[ \n\f\r](?:([^\\s\"'>=/]+)([ \n\f\r]*=[ \n\f\r]*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)","g"),eO=/'/g,eH=/"/g,eq=/^(?:script|style|textarea|title)$/i,eK=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),eV=eK(1),eJ=(eK(2),Symbol.for("lit-noChange")),eY=Symbol.for("lit-nothing"),ej=new WeakMap,ez=eT.createTreeWalker(eT,129,null,!1),e$=(e,t)=>{let i=e.length-1,s=[],r,n=2===t?"<svg>":"",a=eU;for(let A=0;A<i;A++){let o=e[A],l,h,c=-1,u=0;for(;u<o.length&&(a.lastIndex=u,null!==(h=a.exec(o)));)u=a.lastIndex,a===eU?"!--"===h[1]?a=eN:void 0!==h[1]?a=eG:void 0!==h[2]?(eq.test(h[2])&&(r=RegExp("</"+h[2],"g")),a=eP):void 0!==h[3]&&(a=eP):a===eP?">"===h[0]?(a=null!=r?r:eU,c=-1):void 0===h[1]?c=-2:(c=a.lastIndex-h[2].length,l=h[1],a=void 0===h[3]?eP:'"'===h[3]?eH:eO):a===eH||a===eO?a=eP:a===eN||a===eG?a=eU:(a=eP,r=void 0);let g=a===eP&&e[A+1].startsWith("/>")?" ":"";n+=a===eU?o+eD:c>=0?(s.push(l),o.slice(0,c)+"$lit$"+o.slice(c)+eM+g):o+eM+(-2===c?(s.push(void 0),A):g)}let d=n+(e[i]||"<?>")+(2===t?"</svg>":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==ex?ex.createHTML(d):d,s]};class eW{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,n=0,a=e.length-1,A=this.parts,[o,l]=e$(e,t);if(this.el=eW.createElement(o,i),ez.currentNode=this.el.content,2===t){let h=this.el.content,c=h.firstChild;c.remove(),h.append(...c.childNodes)}for(;null!==(s=ez.nextNode())&&A.length<a;){if(1===s.nodeType){if(s.hasAttributes()){let u=[];for(let g of s.getAttributeNames())if(g.endsWith("$lit$")||g.startsWith(eM)){let d=l[n++];if(u.push(g),void 0!==d){let p=s.getAttribute(d.toLowerCase()+"$lit$").split(eM),m=/([.?@])?(.*)/.exec(d);A.push({type:1,index:r,name:m[2],strings:p,ctor:"."===m[1]?e2:"?"===m[1]?e4:"@"===m[1]?e8:e1})}else A.push({type:6,index:r})}for(let I of u)s.removeAttribute(I)}if(eq.test(s.tagName)){let f=s.textContent.split(eM),E=f.length-1;if(E>0){s.textContent=eb?eb.emptyScript:"";for(let C=0;C<E;C++)s.append(f[C],eL()),ez.nextNode(),A.push({type:2,index:++r});s.append(f[E],eL())}}}else if(8===s.nodeType){if(s.data===eR)A.push({type:2,index:r});else{let B=-1;for(;-1!==(B=s.data.indexOf(eM,B+1));)A.push({type:7,index:r}),B+=eM.length-1}}r++}}static createElement(e,t){let i=eT.createElement("template");return i.innerHTML=e,i}}function eX(e,t,i=e,s){var r,n,a,A;if(t===eJ)return t;let o=void 0!==s?null===(r=i._$Co)||void 0===r?void 0:r[s]:i._$Cl,l=eF(t)?void 0:t._$litDirective$;return(null==o?void 0:o.constructor)!==l&&(null===(n=null==o?void 0:o._$AO)||void 0===n||n.call(o,!1),void 0===l?o=void 0:(o=new l(e))._$AT(e,i,s),void 0!==s?(null!==(a=(A=i)._$Co)&&void 0!==a?a:A._$Co=[])[s]=o:i._$Cl=o),void 0!==o&&(t=eX(e,o._$AS(e,t.values),o,s)),t}class eZ{constructor(e,t){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var t;let{el:{content:i},parts:s}=this._$AD,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:eT).importNode(i,!0);ez.currentNode=r;let n=ez.nextNode(),a=0,A=0,o=s[0];for(;void 0!==o;){if(a===o.index){let l;2===o.type?l=new e0(n,n.nextSibling,this,e):1===o.type?l=new o.ctor(n,o.name,o.strings,this,e):6===o.type&&(l=new e5(n,this,e)),this.u.push(l),o=s[++A]}a!==(null==o?void 0:o.index)&&(n=ez.nextNode(),a++)}return r}p(e){let t=0;for(let i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class e0{constructor(e,t,i,s){var r;this.type=2,this._$AH=eY,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cm=null===(r=null==s?void 0:s.isConnected)||void 0===r||r}get _$AU(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cm}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){eF(e=eX(this,e,t))?e===eY||null==e||""===e?(this._$AH!==eY&&this._$AR(),this._$AH=eY):e!==this._$AH&&e!==eJ&&this.g(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):e_(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==eY&&eF(this._$AH)?this._$AA.nextSibling.data=e:this.T(eT.createTextNode(e)),this._$AH=e}$(e){var t;let{values:i,_$litType$:s}=e,r="number"==typeof s?this._$AC(e):(void 0===s.el&&(s.el=eW.createElement(s.h,this.options)),s);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.p(i);else{let n=new eZ(r,this),a=n.v(this.options);n.p(i),this.T(a),this._$AH=n}}_$AC(e){let t=ej.get(e.strings);return void 0===t&&ej.set(e.strings,t=new eW(e)),t}k(e){ek(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,s=0;for(let r of e)s===t.length?t.push(i=new e0(this.O(eL()),this.O(eL()),this,this.options)):i=t[s],i._$AI(r),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,t);e&&e!==this._$AB;){let s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;void 0===this._$AM&&(this._$Cm=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}class e1{constructor(e,t,i,s,r){this.type=1,this._$AH=eY,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=eY}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,s){let r=this.strings,n=!1;if(void 0===r)(n=!eF(e=eX(this,e,t,0))||e!==this._$AH&&e!==eJ)&&(this._$AH=e);else{let a,A;let o=e;for(e=r[0],a=0;a<r.length-1;a++)(A=eX(this,o[i+a],t,a))===eJ&&(A=this._$AH[a]),n||(n=!eF(A)||A!==this._$AH[a]),A===eY?e=eY:e!==eY&&(e+=(null!=A?A:"")+r[a+1]),this._$AH[a]=A}n&&!s&&this.j(e)}j(e){e===eY?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}class e2 extends e1{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===eY?void 0:e}}let e3=eb?eb.emptyScript:"";class e4 extends e1{constructor(){super(...arguments),this.type=4}j(e){e&&e!==eY?this.element.setAttribute(this.name,e3):this.element.removeAttribute(this.name)}}class e8 extends e1{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){var i;if((e=null!==(i=eX(this,e,t,0))&&void 0!==i?i:eY)===eJ)return;let s=this._$AH,r=e===eY&&s!==eY||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==eY&&(s===eY||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==i?i:this.element,e):this._$AH.handleEvent(e)}}class e5{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){eX(this,e)}}let e6=eS.litHtmlPolyfillSupport;null==e6||e6(eW,e0),(null!==(E=eS.litHtmlVersions)&&void 0!==E?E:eS.litHtmlVersions=[]).push("2.4.0");let e9=(e,t,i)=>{var s,r;let n=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:t,a=n._$litPart$;if(void 0===a){let A=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;n._$litPart$=a=new e0(t.insertBefore(eL(),A),A,void 0,null!=i?i:{})}return a._$AI(e),a};class e7 extends ev{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=e9(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return eJ}}e7.finalized=!0,e7._$litElement$=!0,null===(C=globalThis.litElementHydrateSupport)||void 0===C||C.call(globalThis,{LitElement:e7});let te=globalThis.litElementPolyfillSupport;null==te||te({LitElement:e7}),(null!==(B=globalThis.litElementVersions)&&void 0!==B?B:globalThis.litElementVersions=[]).push("3.2.2");/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let tt=null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported,ti=tt&&null!=self.XRSession.prototype.requestHitTestSource,ts=null!=self.ResizeObserver,tr=null!=self.IntersectionObserver;(()=>{let e=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(e)||/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(e.substr(0,4))})(),/\bCrOS\b/.test(navigator.userAgent);let tn=/android/i.test(navigator.userAgent),ta=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;/Safari\//.test(navigator.userAgent);let tA=/firefox/i.test(navigator.userAgent),to=/OculusBrowser/.test(navigator.userAgent);ta&&/CriOS\//.test(navigator.userAgent);let tl=tn&&!tA&&!to,th=Boolean(window.webkit&&window.webkit.messageHandlers),tc=(()=>{if(!ta)return!1;if(th)return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));{let e=document.createElement("a");return Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))}})(),tu=e=>e&&"null"!==e?td(e):null,tg=()=>{if(ti)return;let e=[];throw tt||e.push("WebXR Device API"),ti||e.push("WebXR Hit Test API"),Error(`The following APIs are required for AR, but are missing in this browser: ${e.join(", ")}`)},td=e=>{let t=new URL(e,window.location.toString());return t.toString()},tp=(e,t)=>{let i=null,s=(...s)=>{null==i&&(e(...s),i=self.setTimeout(()=>i=null,t))};return s.flush=()=>{null!=i&&(self.clearTimeout(i),i=null)},s},tm=(e,t)=>{let i=null;return(...s)=>{null!=i&&self.clearTimeout(i),i=self.setTimeout(()=>{i=null,e(...s)},t)}},tI=(e,t,i)=>Math.max(t,Math.min(i,e)),tf=(()=>{let e=(()=>{var e;if(null===(e=document.documentElement.getAttribute("itemtype"))||void 0===e?void 0:e.includes("schema.org/SearchResultsPage"))return!0;let t=null!=document.head?Array.from(document.head.querySelectorAll("meta")):[];for(let i of t)if("viewport"===i.name)return!0;return!1})();return e||console.warn('No <meta name="viewport"> detected; <model-viewer> will cap pixel density at 1.'),()=>e?window.devicePixelRatio:1})(),tE=(()=>{let e=RegExp("[?&]model-viewer-debug-mode(&|$)");return()=>self.ModelViewerElement&&self.ModelViewerElement.debugMode||self.location&&self.location.search&&self.location.search.match(e)})(),tC=(e=0)=>new Promise(t=>setTimeout(t,e)),tB=(e,t,i=null)=>new Promise(s=>{e.addEventListener(t,function r(n){(!i||i(n))&&(s(n),e.removeEventListener(t,r))})});/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var ty=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let tQ=Symbol("currentEnvironmentMap"),tw=Symbol("currentBackground"),tv=Symbol("updateEnvironment"),tS=Symbol("cancelEnvironmentUpdate");/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var tb=eV`
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#000000">
<!-- NOTE(cdata): This SVG filter is a stop-gap until we can implement
support for dynamic re-coloring of UI components -->
<defs>
<filter id="drop-shadow" x="-100%" y="-100%" width="300%" height="300%">
<feGaussianBlur in="SourceAlpha" stdDeviation="1"/>
<feOffset dx="0" dy="0" result="offsetblur"/>
<feFlood flood-color="#000000"/>
<feComposite in2="offsetblur" operator="in"/>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</defs>
<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"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>`,tx=eV`
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="36">
<defs>
<path id="A" d="M.001.232h24.997V36H.001z" />
</defs>
<g transform="translate(-11 -4)" fill="none" fill-rule="evenodd">
<path fill-opacity="0" fill="#fff" d="M0 0h44v44H0z" />
<g transform="translate(11 3)">
<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" />
<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" />
<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" />
<g transform="translate(0 .769)">
<mask id="B" fill="#fff">
<use xlink:href="#A" />
</mask>
<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)" />
</g>
</g>
</g>
</svg>`,tM=eV`
<svg version="1.1" id="view_x5F_in_x5F_AR_x5F_icon"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px"
viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
<rect id="Bounding_Box" x="0" y="0" fill="none" width="24" height="24"/>
<g id="Art_layer">
<path d="M3,4c0-0.55,0.45-1,1-1h2V1H4C2.35,1,1,2.35,1,4v2h2V4z"/>
<path d="M20,3c0.55,0,1,0.45,1,1v2h2V4c0-1.65-1.35-3-3-3h-2v2H20z"/>
<path d="M4,21c-0.55,0-1-0.45-1-1v-2H1v2c0,1.65,1.35,3,3,3h2v-2H4z"/>
<path d="M20,21c0.55,0,1-0.45,1-1v-2h2v2c0,1.65-1.35,3-3,3h-2v-2H20z"/>
<g>
<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
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
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"/>
</g>
</g>
</svg>`;/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let tR=eV`
<style>
:host {
display: block;
position: relative;
contain: strict;
width: 300px;
height: 150px;
}
/* NOTE: This rule set is our integration surface area with the
* :focus-visible polyfill.
*
* @see https://github.com/WICG/focus-visible/pull/196 */
:host([data-js-focus-visible]:focus:not(.focus-visible)),
:host([data-js-focus-visible]) :focus:not(.focus-visible) {
outline: none;
}
.container {
position: relative;
overflow: hidden;
}
.userInput {
width: 100%;
height: 100%;
display: none;
position: relative;
}
canvas {
position: absolute;
display: none;
pointer-events: none;
/* NOTE(cdata): Chrome 76 and below apparently have a bug
* that causes our canvas not to display pixels unless it is
* on its own render layer
* @see https://github.com/google/model-viewer/pull/755#issuecomment-536597893
*/
transform: translateZ(0);
}
.show {
display: block;
}
/* Adapted from HTML5 Boilerplate
*
* @see https://github.com/h5bp/html5-boilerplate/blob/ceb4620c78fc82e13534fc44202a3f168754873f/dist/css/main.css#L122-L133 */
.screen-reader-only {
border: 0;
left: 0;
top: 0;
clip: rect(0, 0, 0, 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
white-space: nowrap;
width: 1px;
pointer-events: none;
}
.slot {
position: absolute;
pointer-events: none;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.slot > * {
pointer-events: initial;
}
.annotation-wrapper ::slotted(*) {
opacity: var(--max-hotspot-opacity, 1);
transition: opacity 0.3s;
}
.pointer-tumbling .annotation-wrapper ::slotted(*) {
pointer-events: none;
}
.annotation-wrapper ::slotted(*) {
pointer-events: initial;
}
.annotation-wrapper.hide ::slotted(*) {
opacity: var(--min-hotspot-opacity, 0.25);
}
.slot.poster {
display: none;
background-color: inherit;
}
.slot.poster.show {
display: inherit;
}
.slot.poster > * {
pointer-events: initial;
}
.slot.poster:not(.show) > * {
pointer-events: none;
}
#default-poster {
width: 100%;
height: 100%;
/* The default poster is a <button> so we need to set display
* to prevent it from being affected by text-align: */
display: block;
position: absolute;
border: none;
padding: 0;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
background-color: #fff0;
}
#default-progress-bar {
display: block;
position: relative;
width: 100%;
height: 100%;
pointer-events: none;
overflow: hidden;
}
#default-progress-bar > .bar {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: var(--progress-bar-height, 5px);
background-color: var(--progress-bar-color, rgba(0, 0, 0, 0.4));
transition: transform 0.09s;
transform-origin: top left;
transform: scaleX(0);
overflow: hidden;
}
#default-progress-bar > .bar.hide {
transition: opacity 0.3s 1s;
opacity: 0;
}
.centered {
align-items: center;
justify-content: center;
}
.cover {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.slot.interaction-prompt {
display: var(--interaction-prompt-display, flex);
overflow: hidden;
opacity: 0;
will-change: opacity;
transition: opacity 0.3s;
}
.slot.interaction-prompt.visible {
opacity: 1;
}
.animated-container {
will-change: transform, opacity;
opacity: 0;
transition: opacity 0.3s;
}
.slot.interaction-prompt > * {
pointer-events: none;
}
.slot.ar-button {
-moz-user-select: none;
-webkit-tap-highlight-color: transparent;
user-select: none;
display: var(--ar-button-display, block);
}
.slot.ar-button:not(.enabled) {
display: none;
}
.fab {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 40px;
height: 40px;
cursor: pointer;
background-color: #fff;
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15);
border-radius: 100px;
}
.fab > * {
opacity: 0.87;
}
#default-ar-button {
position: absolute;
bottom: 16px;
right: 16px;
transform: scale(var(--ar-button-scale, 1));
transform-origin: bottom right;
}
.slot.pan-target {
display: block;
position: absolute;
width: 0;
height: 0;
left: 50%;
top: 50%;
transform: translate3d(-50%, -50%, 0);
background-color: transparent;
opacity: 0;
transition: opacity 0.3s;
}
#default-pan-target {
width: 6px;
height: 6px;
border-radius: 6px;
border: 1px solid white;
box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.8);
}
.slot.default {
pointer-events: none;
}
.slot.progress-bar {
pointer-events: none;
}
.slot.exit-webxr-ar-button {
pointer-events: none;
}
.slot.exit-webxr-ar-button:not(.enabled) {
display: none;
}
#default-exit-webxr-ar-button {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: env(safe-area-inset-top, 16px);
right: 16px;
width: 40px;
height: 40px;
box-sizing: border-box;
}
#default-exit-webxr-ar-button > svg {
fill: #fff;
}
</style>
<div class="container">
<div class="userInput" tabindex="0" role="img"
aria-label="3D model">
<div class="slot canvas">
<slot name="canvas">
<canvas></canvas>
</slot>
</div>
</div>
<!-- NOTE(cdata): We need to wrap slots because browsers without ShadowDOM
will have their <slot> elements removed by ShadyCSS -->
<div class="slot poster">
<slot name="poster">
<button type="button" id="default-poster" aria-hidden="true" aria-label="Loading 3D model"></button>
</slot>
</div>
<div class="slot ar-button">
<slot name="ar-button">
<a id="default-ar-button" part="default-ar-button" class="fab"
tabindex="2"
aria-label="View in your space">
${tM}
</a>
</slot>
</div>
<div class="slot pan-target">
<slot name="pan-target">
<div id="default-pan-target">
</div>
</slot>
</div>
<div class="slot interaction-prompt cover centered">
<div id="prompt" class="animated-container">
<slot name="interaction-prompt" aria-hidden="true">
${tx}
</slot>
</div>
</div>
<div id="finger0" class="animated-container cover">
<slot name="finger0" aria-hidden="true">
</slot>
</div>
<div id="finger1" class="animated-container cover">
<slot name="finger1" aria-hidden="true">
</slot>
</div>
<div class="slot default">
<slot></slot>
<div class="slot progress-bar">
<slot name="progress-bar">
<div id="default-progress-bar" aria-hidden="true">
<div class="bar" part="default-progress-bar"></div>
</div>
</slot>
</div>
<div class="slot exit-webxr-ar-button">
<slot name="exit-webxr-ar-button">
<a id="default-exit-webxr-ar-button" part="default-exit-webxr-ar-button"
tabindex="3"
aria-label="Exit AR"
aria-hidden="true">
${tb}
</a>
</slot>
</div>
</div>
</div>
<div class="screen-reader-only" role="region" aria-label="Live announcements">
<span id="status" role="status"></span>
</div>`,tD=e=>{e9(tR,e)},tT=new WeakMap;class tL extends el.aNw{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,i,s){let r=new el.hH6(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,e=>{this.decodeDracoFile(e,t).catch(s)},i,s)}decodeDracoFile(e,t,i,s){let r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!i};return this.decodeGeometry(e,r).then(t)}decodeGeometry(e,t){let i;let s=JSON.stringify(t);if(tT.has(e)){let r=tT.get(e);if(r.key===s)return r.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,A=this._getWorker(n,a).then(s=>(i=s,new Promise((s,r)=>{i._callbacks[n]={resolve:s,reject:r},i.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return A.catch(()=>!0).then(()=>{i&&n&&this._releaseTask(i,n)}),tT.set(e,{key:s,promise:A}),A}_createGeometry(e){let t=new el.u9r;e.index&&t.setIndex(new el.TlE(e.index.array,1));for(let i=0;i<e.attributes.length;i++){let s=e.attributes[i],r=s.name,n=s.array,a=s.itemSize;t.setAttribute(r,new el.TlE(n,a))}return t}_loadLibrary(e,t){let i=new el.hH6(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((t,s)=>{i.load(e,t,void 0,s)})}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 i=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let s=tF.toString(),r=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(e){let t=e.data;switch(t.type){case"decode":i._callbacks[t.id].resolve(t);break;case"error":i._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let s=this.workerPool[this.workerPool.length-1];return s._taskCosts[e]=t,s._taskLoad+=t,s})}_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}}function tF(){let e,t;onmessage=function(i){let s=i.data;switch(s.type){case"init":e=s.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let r=s.buffer,n=s.taskConfig;t.then(e=>{let t=e.draco,i=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(r),r.byteLength);try{let A=function(e,t,i,s){let r,n;let a=s.attributeIDs,A=s.attributeTypes,o=t.GetEncodedGeometryType(i);if(o===e.TRIANGULAR_MESH)r=new e.Mesh,n=t.DecodeBufferToMesh(i,r);else if(o===e.POINT_CLOUD)r=new e.PointCloud,n=t.DecodeBufferToPointCloud(i,r);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!n.ok()||0===r.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+n.error_msg());let l={index:null,attributes:[]};for(let h in a){let c,u;let g=self[A[h]];if(s.useUniqueIDs)u=a[h],c=t.GetAttributeByUniqueId(r,u);else{if(-1===(u=t.GetAttributeId(r,e[a[h]])))continue;c=t.GetAttribute(r,u)}l.attributes.push(function(e,t,i,s,r,n){let a=n.num_components(),A=i.num_points(),o=A*a,l=o*r.BYTES_PER_ELEMENT,h=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,r),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(i,n,h,l,c);let u=new r(e.HEAPF32.buffer,c,o).slice();return e._free(c),{name:s,array:u,itemSize:a}}(e,t,r,h,g,c))}return o===e.TRIANGULAR_MESH&&(l.index=function(e,t,i){let s=i.num_faces(),r=3*s,n=4*r,a=e._malloc(n);t.GetTrianglesUInt32Array(i,n,a);let A=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:A,itemSize:1}}(e,t,r)),e.destroy(r),l}(t,i,a,n),o=A.attributes.map(e=>e.array.buffer);A.index&&o.push(A.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:A},o)}catch(l){console.error(l),self.postMessage({type:"error",id:s.id,error:l.message})}finally{t.destroy(a),t.destroy(i)}})}}}class tk extends el.aNw{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new tO(e)}),this.register(function(e){return new tj(e)}),this.register(function(e){return new tz(e)}),this.register(function(e){return new tq(e)}),this.register(function(e){return new tK(e)}),this.register(function(e){return new tV(e)}),this.register(function(e){return new tJ(e)}),this.register(function(e){return new tP(e)}),this.register(function(e){return new tY(e)}),this.register(function(e){return new tH(e)}),this.register(function(e){return new tN(e)}),this.register(function(e){return new t$(e)}),this.register(function(e){return new tW(e)})}load(e,t,i,s){let r;let n=this;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:el.Zp0.extractUrlBase(e),this.manager.itemStart(e);let a=function(t){s?s(t):console.error(t),n.manager.itemError(e),n.manager.itemEnd(e)},A=new el.hH6(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(i){try{n.parse(i,r,function(i){t(i),n.manager.itemEnd(e)},a)}catch(s){a(s)}},i,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,s){let r;let n={},a={};if("string"==typeof e)r=JSON.parse(e);else if(e instanceof ArrayBuffer){let A=el.Zp0.decodeText(new Uint8Array(e,0,4));if(A===tX){try{n[tU.KHR_BINARY_GLTF]=new t0(e)}catch(o){s&&s(o);return}r=JSON.parse(n[tU.KHR_BINARY_GLTF].content)}else r=JSON.parse(el.Zp0.decodeText(new Uint8Array(e)))}else r=e;if(void 0===r.asset||r.asset.version[0]<2){s&&s(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let l=new ig(r,{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 h=0;h<this.pluginCallbacks.length;h++){let c=this.pluginCallbacks[h](l);a[c.name]=c,n[c.name]=!0}if(r.extensionsUsed)for(let u=0;u<r.extensionsUsed.length;++u){let g=r.extensionsUsed[u],d=r.extensionsRequired||[];switch(g){case tU.KHR_MATERIALS_UNLIT:n[g]=new tG;break;case tU.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:n[g]=new t4;break;case tU.KHR_DRACO_MESH_COMPRESSION:n[g]=new t1(r,this.dracoLoader);break;case tU.KHR_TEXTURE_TRANSFORM:n[g]=new t2;break;case tU.KHR_MESH_QUANTIZATION:n[g]=new t8;break;default:d.indexOf(g)>=0&&void 0===a[g]&&console.warn('THREE.GLTFLoader: Unknown extension "'+g+'".')}}l.setExtensions(n),l.setPlugins(a),l.parse(i,s)}parseAsync(e,t){let i=this;return new Promise(function(s,r){i.parse(e,t,s,r)})}}function t_(){let e={};return{get:function(t){return e[t]},add:function(t,i){e[t]=i},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let tU={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",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_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_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class tN{constructor(e){this.parser=e,this.name=tU.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let i=0,s=t.length;i<s;i++){let r=t[i];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t;let i=this.parser,s="light:"+e,r=i.cache.get(s);if(r)return r;let n=i.json,a=n.extensions&&n.extensions[this.name]||{},A=a.lights||[],o=A[e],l=new el.Ilk(16777215);void 0!==o.color&&l.fromArray(o.color);let h=void 0!==o.range?o.range:0;switch(o.type){case"directional":(t=new el.Ox3(l)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new el.cek(l)).distance=h;break;case"spot":(t=new el.PMe(l)).distance=h,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,t.angle=o.spot.outerConeAngle,t.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return t.position.set(0,0,0),t.decay=2,void 0!==o.intensity&&(t.intensity=o.intensity),t.name=i.createUniqueName(o.name||"light_"+e),r=Promise.resolve(t),i.cache.add(s,r),r}createNodeAttachment(e){let t=this,i=this.parser,s=i.json,r=s.nodes[e],n=r.extensions&&r.extensions[this.name]||{},a=n.light;return void 0===a?null:this._loadLight(a).then(function(e){return i._getNodeRef(t.cache,a,e)})}}class tG{constructor(){this.name=tU.KHR_MATERIALS_UNLIT}getMaterialType(){return el.vBJ}extendParams(e,t,i){let s=[];e.color=new el.Ilk(1,1,1),e.opacity=1;let r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){let n=r.baseColorFactor;e.color.fromArray(n),e.opacity=n[3]}void 0!==r.baseColorTexture&&s.push(i.assignTexture(e,"map",r.baseColorTexture,el.knz))}return Promise.all(s)}}class tP{constructor(e){this.parser=e,this.name=tU.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class tO{constructor(e){this.parser=e,this.name=tU.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?el.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],n=s.extensions[this.name];if(void 0!==n.clearcoatFactor&&(t.clearcoat=n.clearcoatFactor),void 0!==n.clearcoatTexture&&r.push(i.assignTexture(t,"clearcoatMap",n.clearcoatTexture)),void 0!==n.clearcoatRoughnessFactor&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),void 0!==n.clearcoatRoughnessTexture&&r.push(i.assignTexture(t,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),void 0!==n.clearcoatNormalTexture&&(r.push(i.assignTexture(t,"clearcoatNormalMap",n.clearcoatNormalTexture)),void 0!==n.clearcoatNormalTexture.scale)){let a=n.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new el.FM8(a,a)}return Promise.all(r)}}class tH{constructor(e){this.parser=e,this.name=tU.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?el.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],n=s.extensions[this.name];return void 0!==n.iridescenceFactor&&(t.iridescence=n.iridescenceFactor),void 0!==n.iridescenceTexture&&r.push(i.assignTexture(t,"iridescenceMap",n.iridescenceTexture)),void 0!==n.iridescenceIor&&(t.iridescenceIOR=n.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==n.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),void 0!==n.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),void 0!==n.iridescenceThicknessTexture&&r.push(i.assignTexture(t,"iridescenceThicknessMap",n.iridescenceThicknessTexture)),Promise.all(r)}}class tq{constructor(e){this.parser=e,this.name=tU.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?el.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[];t.sheenColor=new el.Ilk(0,0,0),t.sheenRoughness=0,t.sheen=1;let n=s.extensions[this.name];return void 0!==n.sheenColorFactor&&t.sheenColor.fromArray(n.sheenColorFactor),void 0!==n.sheenRoughnessFactor&&(t.sheenRoughness=n.sheenRoughnessFactor),void 0!==n.sheenColorTexture&&r.push(i.assignTexture(t,"sheenColorMap",n.sheenColorTexture,el.knz)),void 0!==n.sheenRoughnessTexture&&r.push(i.assignTexture(t,"sheenRoughnessMap",n.sheenRoughnessTexture)),Promise.all(r)}}class tK{constructor(e){this.parser=e,this.name=tU.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?el.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],n=s.extensions[this.name];return void 0!==n.transmissionFactor&&(t.transmission=n.transmissionFactor),void 0!==n.transmissionTexture&&r.push(i.assignTexture(t,"transmissionMap",n.transmissionTexture)),Promise.all(r)}}class tV{constructor(e){this.parser=e,this.name=tU.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?el.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],n=s.extensions[this.name];t.thickness=void 0!==n.thicknessFactor?n.thicknessFactor:0,void 0!==n.thicknessTexture&&r.push(i.assignTexture(t,"thicknessMap",n.thicknessTexture)),t.attenuationDistance=n.attenuationDistance||1/0;let a=n.attenuationColor||[1,1,1];return t.attenuationColor=new el.Ilk(a[0],a[1],a[2]),Promise.all(r)}}class tJ{constructor(e){this.parser=e,this.name=tU.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?el.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class tY{constructor(e){this.parser=e,this.name=tU.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?el.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],n=s.extensions[this.name];t.specularIntensity=void 0!==n.specularFactor?n.specularFactor:1,void 0!==n.specularTexture&&r.push(i.assignTexture(t,"specularIntensityMap",n.specularTexture));let a=n.specularColorFactor||[1,1,1];return t.specularColor=new el.Ilk(a[0],a[1],a[2]),void 0!==n.specularColorTexture&&r.push(i.assignTexture(t,"specularColorMap",n.specularColorTexture,el.knz)),Promise.all(r)}}class tj{constructor(e){this.parser=e,this.name=tU.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,i=t.json,s=i.textures[e];if(!s.extensions||!s.extensions[this.name])return null;let r=s.extensions[this.name],n=t.options.ktx2Loader;if(!n){if(!(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0))return null;throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures")}return t.loadTextureImage(e,r.source,n)}}class tz{constructor(e){this.parser=e,this.name=tU.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;let n=r.extensions[t],a=s.images[n.source],A=i.textureLoader;if(a.uri){let o=i.options.manager.getHandler(a.uri);null!==o&&(A=o)}return this.detectSupport().then(function(r){if(r)return i.loadTextureImage(e,n.source,A);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class t${constructor(e){this.name=tU.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,i=t.bufferViews[e];if(!i.extensions||!i.extensions[this.name])return null;{let s=i.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files")}return r.then(function(e){let t=s.byteOffset||0,i=s.byteLength||0,r=s.count,a=s.byteStride,A=new Uint8Array(e,t,i);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(r,a,A,s.mode,s.filter).then(function(e){return e.buffer}):n.ready.then(function(){let e=new ArrayBuffer(r*a);return n.decodeGltfBuffer(new Uint8Array(e),r,a,A,s.mode,s.filter),e})})}}}class tW{constructor(e){this.name=tU.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||void 0===i.mesh)return null;let s=t.meshes[i.mesh];for(let r of s.primitives)if(r.mode!==t7.TRIANGLES&&r.mode!==t7.TRIANGLE_STRIP&&r.mode!==t7.TRIANGLE_FAN&&void 0!==r.mode)return null;let n=i.extensions[this.name],a=n.attributes,A=[],o={};for(let l in a)A.push(this.parser.getDependency("accessor",a[l]).then(e=>(o[l]=e,o[l])));return A.length<1?null:(A.push(this.parser.createNodeMesh(e)),Promise.all(A).then(e=>{let t=e.pop(),i=t.isGroup?t.children:[t],s=e[0].count,r=[];for(let n of i){let a=new el.yGw,A=new el.Pa4,l=new el._fP,h=new el.Pa4(1,1,1),c=new el.SPe(n.geometry,n.material,s);for(let u=0;u<s;u++)o.TRANSLATION&&A.fromBufferAttribute(o.TRANSLATION,u),o.ROTATION&&l.fromBufferAttribute(o.ROTATION,u),o.SCALE&&h.fromBufferAttribute(o.SCALE,u),c.setMatrixAt(u,a.compose(A,l,h));for(let g in o)"TRANSLATION"!==g&&"ROTATION"!==g&&"SCALE"!==g&&n.geometry.setAttribute(g,o[g]);el.Tme.prototype.copy.call(c,n),c.frustumCulled=!1,this.parser.assignFinalMaterial(c),r.push(c)}return t.isGroup?(t.clear(),t.add(...r),t):r[0]}))}}let tX="glTF",tZ={JSON:1313821514,BIN:5130562};class t0{constructor(e){this.name=tU.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,12);if(this.header={magic:el.Zp0.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==tX)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let i=this.header.length-12,s=new DataView(e,12),r=0;for(;r<i;){let n=s.getUint32(r,!0);r+=4;let a=s.getUint32(r,!0);if(r+=4,a===tZ.JSON){let A=new Uint8Array(e,12+r,n);this.content=el.Zp0.decodeText(A)}else if(a===tZ.BIN){let o=12+r;this.body=e.slice(o,o+n)}r+=n}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class t1{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=tU.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let i=this.json,s=this.dracoLoader,r=e.extensions[this.name].bufferView,n=e.extensions[this.name].attributes,a={},A={},o={};for(let l in n){let h=ir[l]||l.toLowerCase();a[h]=n[l]}for(let c in e.attributes){let u=ir[c]||c.toLowerCase();if(void 0!==n[c]){let g=i.accessors[e.attributes[c]],d=ie[g.componentType];o[u]=d.name,A[u]=!0===g.normalized}}return t.getDependency("bufferView",r).then(function(e){return new Promise(function(t){s.decodeDracoFile(e,function(e){for(let i in e.attributes){let s=e.attributes[i],r=A[i];void 0!==r&&(s.normalized=r)}t(e)},a,o)})})}}class t2{constructor(){this.name=tU.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),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 t3 extends el.Wid{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;let t={specular:{value:new el.Ilk().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=t,this.onBeforeCompile=function(e){for(let i in t)e.uniforms[i]=t[i];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>","#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif").replace("#include <metalnessmap_pars_fragment>","#ifdef USE_GLOSSINESSMAP\n uniform sampler2D glossinessMap;\n#endif").replace("#include <roughnessmap_fragment>","vec3 specularFactor = specular;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture\n specularFactor *= texelSpecular.rgb;\n#endif").replace("#include <metalnessmap_fragment>","float glossinessFactor = glossiness;\n#ifdef USE_GLOSSINESSMAP\n vec4 texelGlossiness = texture2D( glossinessMap, vUv );\n // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture\n glossinessFactor *= texelGlossiness.a;\n#endif").replace("#include <lights_physical_fragment>","PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\nmaterial.specularColor = specularFactor;")},Object.defineProperties(this,{specular:{get:function(){return t.specular.value},set:function(e){t.specular.value=e}},specularMap:{get:function(){return t.specularMap.value},set:function(e){t.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return t.glossiness.value},set:function(e){t.glossiness.value=e}},glossinessMap:{get:function(){return t.glossinessMap.value},set:function(e){t.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class t4{constructor(){this.name=tU.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return t3}extendParams(e,t,i){let s=t.extensions[this.name];e.color=new el.Ilk(1,1,1),e.opacity=1;let r=[];if(Array.isArray(s.diffuseFactor)){let n=s.diffuseFactor;e.color.fromArray(n),e.opacity=n[3]}if(void 0!==s.diffuseTexture&&r.push(i.assignTexture(e,"map",s.diffuseTexture,el.knz)),e.emissive=new el.Ilk(0,0,0),e.glossiness=void 0!==s.glossinessFactor?s.glossinessFactor:1,e.specular=new el.Ilk(1,1,1),Array.isArray(s.specularFactor)&&e.specular.fromArray(s.specularFactor),void 0!==s.specularGlossinessTexture){let a=s.specularGlossinessTexture;r.push(i.assignTexture(e,"glossinessMap",a)),r.push(i.assignTexture(e,"specularMap",a,el.knz))}return Promise.all(r)}createMaterial(e){let t=new t3(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=void 0===e.emissiveIntensity?1:e.emissiveIntensity,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=el.IOt,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t}}class t8{constructor(){this.name=tU.KHR_MESH_QUANTIZATION}}class t5 extends el._C8{constructor(e,t,i,s){super(e,t,i,s)}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,s=this.valueSize,r=e*s*3+s;for(let n=0;n!==s;n++)t[n]=i[r+n];return t}interpolate_(e,t,i,s){let r=this.resultBuffer,n=this.sampleValues,a=this.valueSize,A=2*a,o=3*a,l=s-t,h=(i-t)/l,c=h*h,u=c*h,g=e*o,d=g-o,p=-2*u+3*c,m=u-c,I=1-p,f=m-c+h;for(let E=0;E!==a;E++){let C=n[d+E+a],B=n[d+E+A]*l,y=n[g+E+a],Q=n[g+E]*l;r[E]=I*C+f*B+p*y+m*Q}return r}}let t6=new el._fP;class t9 extends t5{interpolate_(e,t,i,s){let r=super.interpolate_(e,t,i,s);return t6.fromArray(r).normalize().toArray(r),r}}let t7={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},ie={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},it={9728:el.TyD,9729:el.wem,9984:el.YLQ,9985:el.qyh,9986:el.aH4,9987:el.D1R},ii={33071:el.uWy,33648:el.OoA,10497:el.rpg},is={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ir={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ia={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},iA={CUBICSPLINE:void 0,LINEAR:el.NMF,STEP:el.Syv},io={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function il(e,t,i){for(let s in i.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=i.extensions[s])}function ih(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 ic(e){let t="",i=Object.keys(e).sort();for(let s=0,r=i.length;s<r;s++)t+=i[s]+":"+e[i[s]]+";";return t}function iu(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.")}}class ig{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new t_,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=navigator.userAgent.indexOf("Firefox")>-1,r=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||i||s&&r<98?this.textureLoader=new el.dpR(this.options.manager):this.textureLoader=new el.QRU(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new el.hH6(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 i=this,s=this.json,r=this.extensions;this.cache.removeAll(),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([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(t){let n={scene:t[0][s.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:s.asset,parser:i,userData:{}};il(r,n,s),ih(n,s),Promise.all(i._invokeAll(function(e){return e.afterRoot&&e.afterRoot(n)})).then(function(){e(n)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let s=0,r=t.length;s<r;s++){let n=t[s].joints;for(let a=0,A=n.length;a<A;a++)e[n[a]].isBone=!0}for(let o=0,l=e.length;o<l;o++){let h=e[o];void 0!==h.mesh&&(this._addNodeRef(this.meshCache,h.mesh),void 0!==h.skin&&(i[h.mesh].isSkinnedMesh=!0)),void 0!==h.camera&&this._addNodeRef(this.cameraCache,h.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,i){if(e.refs[t]<=1)return i;let s=i.clone(),r=(e,t)=>{let i=this.associations.get(e);for(let[s,n]of(null!=i&&this.associations.set(t,i),e.children.entries()))r(n,t.children[s])};return r(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){let s=e(t[i]);if(s)return s}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let i=[];for(let s=0;s<t.length;s++){let r=e(t[s]);r&&i.push(r)}return i}getDependency(e,t){let i=e+":"+t,s=this.cache.get(i);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this.loadNode(t);break;case"mesh":s=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:throw Error("Unknown type: "+e)}this.cache.add(i,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){let i=this,s=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(s.map(function(t,s){return i.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],i=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[tU.KHR_BINARY_GLTF].body);let s=this.options;return new Promise(function(e,r){i.load(el.Zp0.resolveURL(t.uri,s.path),e,void 0,function(){r(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 i=t.byteLength||0,s=t.byteOffset||0;return e.slice(s,s+i)})}loadAccessor(e){let t=this,i=this.json,s=this.json.accessors[e];if(void 0===s.bufferView&&void 0===s.sparse)return Promise.resolve(null);let r=[];return void 0!==s.bufferView?r.push(this.getDependency("bufferView",s.bufferView)):r.push(null),void 0!==s.sparse&&(r.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(r).then(function(e){let r,n;let a=e[0],A=is[s.type],o=ie[s.componentType],l=o.BYTES_PER_ELEMENT,h=s.byteOffset||0,c=void 0!==s.bufferView?i.bufferViews[s.bufferView].byteStride:void 0,u=!0===s.normalized;if(c&&c!==l*A){let g=Math.floor(h/c),d="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+g+":"+s.count,p=t.cache.get(d);p||(r=new o(a,g*c,s.count*c/l),p=new el.vpT(r,c/l),t.cache.add(d,p)),n=new el.kB5(p,A,h%c/l,u)}else r=null===a?new o(s.count*A):new o(a,h,s.count*A),n=new el.TlE(r,A,u);if(void 0!==s.sparse){let m=is.SCALAR,I=ie[s.sparse.indices.componentType],f=s.sparse.indices.byteOffset||0,E=s.sparse.values.byteOffset||0,C=new I(e[1],f,s.sparse.count*m),B=new o(e[2],E,s.sparse.count*A);null!==a&&(n=new el.TlE(n.array.slice(),n.itemSize,n.normalized));for(let y=0,Q=C.length;y<Q;y++){let w=C[y];if(n.setX(w,B[y*A]),A>=2&&n.setY(w,B[y*A+1]),A>=3&&n.setZ(w,B[y*A+2]),A>=4&&n.setW(w,B[y*A+3]),A>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return n})}loadTexture(e){let t=this.json,i=this.options,s=t.textures[e],r=s.source,n=t.images[r],a=this.textureLoader;if(n.uri){let A=i.manager.getHandler(n.uri);null!==A&&(a=A)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,i){let s=this,r=this.json,n=r.textures[e],a=r.images[t],A=(a.uri||a.bufferView)+":"+n.sampler;if(this.textureCache[A])return this.textureCache[A];let o=this.loadImageSource(t,i).then(function(t){t.flipY=!1,t.name=n.name||a.name||"";let i=r.samplers||{},A=i[n.sampler]||{};return t.magFilter=it[A.magFilter]||el.wem,t.minFilter=it[A.minFilter]||el.D1R,t.wrapS=ii[A.wrapS]||el.rpg,t.wrapT=ii[A.wrapT]||el.rpg,s.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[A]=o,o}loadImageSource(e,t){let i=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let r=i.images[e],n=self.URL||self.webkitURL,a=r.uri||"",A=!1;if(void 0!==r.bufferView)a=this.getDependency("bufferView",r.bufferView).then(function(e){A=!0;let t=new Blob([e],{type:r.mimeType});return a=n.createObjectURL(t)});else if(void 0===r.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let o=Promise.resolve(a).then(function(e){return new Promise(function(i,r){let n=i;!0===t.isImageBitmapLoader&&(n=function(e){let t=new el.xEZ(e);t.needsUpdate=!0,i(t)}),t.load(el.Zp0.resolveURL(e,s.path),n,void 0,r)})}).then(function(e){var t;return!0===A&&n.revokeObjectURL(a),e.userData.mimeType=r.mimeType||((t=r.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":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e});return this.sourceCache[e]=o,o}assignTexture(e,t,i,s){let r=this;return this.getDependency("texture",i.index).then(function(n){if(void 0===i.texCoord||0==i.texCoord||"aoMap"===t&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[tU.KHR_TEXTURE_TRANSFORM]){let a=void 0!==i.extensions?i.extensions[tU.KHR_TEXTURE_TRANSFORM]:void 0;if(a){let A=r.associations.get(n);n=r.extensions[tU.KHR_TEXTURE_TRANSFORM].extendTexture(n,a),r.associations.set(n,A)}}return void 0!==s&&(n.encoding=s),e[t]=n,n})}assignFinalMaterial(e){let t=e.geometry,i=e.material,s=void 0===t.attributes.tangent,r=void 0!==t.attributes.color,n=void 0===t.attributes.normal;if(e.isPoints){let a="PointsMaterial:"+i.uuid,A=this.cache.get(a);A||(A=new el.UY4,el.F5T.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,A.sizeAttenuation=!1,this.cache.add(a,A)),i=A}else if(e.isLine){let o="LineBasicMaterial:"+i.uuid,l=this.cache.get(o);l||(l=new el.nls,el.F5T.prototype.copy.call(l,i),l.color.copy(i.color),this.cache.add(o,l)),i=l}if(s||r||n){let h="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(h+="specular-glossiness:"),s&&(h+="derivative-tangents:"),r&&(h+="vertex-colors:"),n&&(h+="flat-shading:");let c=this.cache.get(h);c||(c=i.clone(),r&&(c.vertexColors=!0),n&&(c.flatShading=!0),s&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(h,c),this.associations.set(c,this.associations.get(i))),i=c}i.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return el.Wid}loadMaterial(e){let t;let i=this,s=this.json,r=this.extensions,n=s.materials[e],a={},A=n.extensions||{},o=[];if(A[tU.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let l=r[tU.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=l.getMaterialType(),o.push(l.extendParams(a,n,i))}else if(A[tU.KHR_MATERIALS_UNLIT]){let h=r[tU.KHR_MATERIALS_UNLIT];t=h.getMaterialType(),o.push(h.extendParams(a,n,i))}else{let c=n.pbrMetallicRoughness||{};if(a.color=new el.Ilk(1,1,1),a.opacity=1,Array.isArray(c.baseColorFactor)){let u=c.baseColorFactor;a.color.fromArray(u),a.opacity=u[3]}void 0!==c.baseColorTexture&&o.push(i.assignTexture(a,"map",c.baseColorTexture,el.knz)),a.metalness=void 0!==c.metallicFactor?c.metallicFactor:1,a.roughness=void 0!==c.roughnessFactor?c.roughnessFactor:1,void 0!==c.metallicRoughnessTexture&&(o.push(i.assignTexture(a,"metalnessMap",c.metallicRoughnessTexture)),o.push(i.assignTexture(a,"roughnessMap",c.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),o.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)})))}!0===n.doubleSided&&(a.side=el.ehD);let g=n.alphaMode||io.OPAQUE;if(g===io.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,g===io.MASK&&(a.alphaTest=void 0!==n.alphaCutoff?n.alphaCutoff:.5)),void 0!==n.normalTexture&&t!==el.vBJ&&(o.push(i.assignTexture(a,"normalMap",n.normalTexture)),a.normalScale=new el.FM8(1,1),void 0!==n.normalTexture.scale)){let d=n.normalTexture.scale;a.normalScale.set(d,d)}return void 0!==n.occlusionTexture&&t!==el.vBJ&&(o.push(i.assignTexture(a,"aoMap",n.occlusionTexture)),void 0!==n.occlusionTexture.strength&&(a.aoMapIntensity=n.occlusionTexture.strength)),void 0!==n.emissiveFactor&&t!==el.vBJ&&(a.emissive=new el.Ilk().fromArray(n.emissiveFactor)),void 0!==n.emissiveTexture&&t!==el.vBJ&&o.push(i.assignTexture(a,"emissiveMap",n.emissiveTexture,el.knz)),Promise.all(o).then(function(){let s;return s=t===t3?r[tU.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):new t(a),n.name&&(s.name=n.name),ih(s,n),i.associations.set(s,{materials:e}),n.extensions&&il(r,s,n),s})}createUniqueName(e){let t=el.iUV.sanitizeNodeName(e||""),i=t;for(let s=1;this.nodeNamesUsed[i];++s)i=t+"_"+s;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){let t=this,i=this.extensions,s=this.primitiveCache,r=[];for(let n=0,a=e.length;n<a;n++){let A=e[n],o=function(e){let t=e.extensions&&e.extensions[tU.KHR_DRACO_MESH_COMPRESSION];return t?"draco:"+t.bufferView+":"+t.indices+":"+ic(t.attributes):e.indices+":"+ic(e.attributes)+":"+e.mode}(A),l=s[o];if(l)r.push(l.promise);else{let h;h=A.extensions&&A.extensions[tU.KHR_DRACO_MESH_COMPRESSION]?function(e){return i[tU.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(i){return id(i,e,t)})}(A):id(new el.u9r,A,t),s[o]={primitive:A,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(e){let t=this,i=this.json,s=this.extensions,r=i.meshes[e],n=r.primitives,a=[];for(let A=0,o=n.length;A<o;A++){var l;let h=void 0===n[A].material?(void 0===(l=this.cache).DefaultMaterial&&(l.DefaultMaterial=new el.Wid({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:el.Wl3})),l.DefaultMaterial):this.getDependency("material",n[A].material);a.push(h)}return a.push(t.loadGeometries(n)),Promise.all(a).then(function(i){let a=i.slice(0,i.length-1),A=i[i.length-1],o=[];for(let l=0,h=A.length;l<h;l++){let c;let u=A[l],g=n[l],d=a[l];if(g.mode===t7.TRIANGLES||g.mode===t7.TRIANGLE_STRIP||g.mode===t7.TRIANGLE_FAN||void 0===g.mode)!0!==(c=!0===r.isSkinnedMesh?new el.TUv(u,d):new el.Kj0(u,d)).isSkinnedMesh||c.geometry.attributes.skinWeight.normalized||c.normalizeSkinWeights(),g.mode===t7.TRIANGLE_STRIP?c.geometry=ip(c.geometry,el.UlW):g.mode===t7.TRIANGLE_FAN&&(c.geometry=ip(c.geometry,el.z$h));else if(g.mode===t7.LINES)c=new el.ejS(u,d);else if(g.mode===t7.LINE_STRIP)c=new el.x12(u,d);else if(g.mode===t7.LINE_LOOP)c=new el.blk(u,d);else if(g.mode===t7.POINTS)c=new el.woe(u,d);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+g.mode);Object.keys(c.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let i=0,s=t.weights.length;i<s;i++)e.morphTargetInfluences[i]=t.weights[i];if(t.extras&&Array.isArray(t.extras.targetNames)){let r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(let n=0,a=r.length;n<a;n++)e.morphTargetDictionary[r[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(c,r),c.name=t.createUniqueName(r.name||"mesh_"+e),ih(c,r),g.extensions&&il(s,c,g),t.assignFinalMaterial(c),o.push(c)}for(let p=0,m=o.length;p<m;p++)t.associations.set(o[p],{meshes:e,primitives:p});if(1===o.length)return o[0];let I=new el.ZAu;t.associations.set(I,{meshes:e});for(let f=0,E=o.length;f<E;f++)I.add(o[f]);return I})}loadCamera(e){let t;let i=this.json.cameras[e],s=i[i.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return"perspective"===i.type?t=new el.cPb(el.M8C.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):"orthographic"===i.type&&(t=new el.iKG(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),ih(t,i),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],i={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(e){return i.inverseBindMatrices=e,i})}loadAnimation(e){let t=this.json,i=t.animations[e],s=[],r=[],n=[],a=[],A=[];for(let o=0,l=i.channels.length;o<l;o++){let h=i.channels[o],c=i.samplers[h.sampler],u=h.target,g=u.node,d=void 0!==i.parameters?i.parameters[c.input]:c.input,p=void 0!==i.parameters?i.parameters[c.output]:c.output;s.push(this.getDependency("node",g)),r.push(this.getDependency("accessor",d)),n.push(this.getDependency("accessor",p)),a.push(c),A.push(u)}return Promise.all([Promise.all(s),Promise.all(r),Promise.all(n),Promise.all(a),Promise.all(A)]).then(function(t){let s=t[0],r=t[1],n=t[2],a=t[3],A=t[4],o=[];for(let l=0,h=s.length;l<h;l++){let c;let u=s[l],g=r[l],d=n[l],p=a[l],m=A[l];if(void 0===u)continue;switch(u.updateMatrix(),ia[m.path]){case ia.weights:c=el.dUE;break;case ia.rotation:c=el.iLg;break;case ia.position:case ia.scale:default:c=el.yC1}let I=u.name?u.name:u.uuid,f=void 0!==p.interpolation?iA[p.interpolation]:el.NMF,E=[];ia[m.path]===ia.weights?u.traverse(function(e){e.morphTargetInfluences&&E.push(e.name?e.name:e.uuid)}):E.push(I);let C=d.array;if(d.normalized){let B=iu(C.constructor),y=new Float32Array(C.length);for(let Q=0,w=C.length;Q<w;Q++)y[Q]=C[Q]*B;C=y}for(let v=0,S=E.length;v<S;v++){let b=new c(E[v]+"."+ia[m.path],g.array,C,f);"CUBICSPLINE"===p.interpolation&&(b.createInterpolant=function(e){let t=this instanceof el.iLg?t9:t5;return new t(this.times,this.values,this.getValueSize()/3,e)},b.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),o.push(b)}}let x=i.name?i.name:"animation_"+e;return new el.m7l(x,void 0,o)})}createNodeMesh(e){let t=this.json,i=this,s=t.nodes[e];return void 0===s.mesh?null:i.getDependency("mesh",s.mesh).then(function(e){let t=i._getNodeRef(i.meshCache,s.mesh,e);return void 0!==s.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,i=s.weights.length;t<i;t++)e.morphTargetInfluences[t]=s.weights[t]}),t})}loadNode(e){let t=this.json,i=this.extensions,s=this,r=t.nodes[e],n=r.name?s.createUniqueName(r.name):"";return(function(){let t=[],i=s._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return i&&t.push(i),void 0!==r.camera&&t.push(s.getDependency("camera",r.camera).then(function(e){return s._getNodeRef(s.cameraCache,r.camera,e)})),s._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){t.push(e)}),Promise.all(t)})().then(function(t){let a;if((a=!0===r.isBone?new el.N$j:t.length>1?new el.ZAu:1===t.length?t[0]:new el.Tme)!==t[0])for(let A=0,o=t.length;A<o;A++)a.add(t[A]);if(r.name&&(a.userData.name=r.name,a.name=n),ih(a,r),r.extensions&&il(i,a,r),void 0!==r.matrix){let l=new el.yGw;l.fromArray(r.matrix),a.applyMatrix4(l)}else void 0!==r.translation&&a.position.fromArray(r.translation),void 0!==r.rotation&&a.quaternion.fromArray(r.rotation),void 0!==r.scale&&a.scale.fromArray(r.scale);return s.associations.has(a)||s.associations.set(a,{}),s.associations.get(a).nodes=e,a})}loadScene(e){let t=this.json,i=this.extensions,s=this.json.scenes[e],r=this,n=new el.ZAu;s.name&&(n.name=r.createUniqueName(s.name)),ih(n,s),s.extensions&&il(i,n,s);let a=s.nodes||[],A=[];for(let o=0,l=a.length;o<l;o++)A.push(function e(t,i,s,r){let n=s.nodes[t];return r.getDependency("node",t).then(function(e){let t;return void 0===n.skin?e:r.getDependency("skin",n.skin).then(function(e){t=e;let i=[];for(let s=0,n=t.joints.length;s<n;s++)i.push(r.getDependency("node",t.joints[s]));return Promise.all(i)}).then(function(i){return e.traverse(function(e){if(!e.isMesh)return;let s=[],r=[];for(let n=0,a=i.length;n<a;n++){let A=i[n];if(A){s.push(A);let o=new el.yGw;void 0!==t.inverseBindMatrices&&o.fromArray(t.inverseBindMatrices.array,16*n),r.push(o)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[n])}e.bind(new el.OdW(s,r),e.matrixWorld)}),e})}).then(function(t){i.add(t);let a=[];if(n.children){let A=n.children;for(let o=0,l=A.length;o<l;o++){let h=A[o];a.push(e(h,t,s,r))}}return Promise.all(a)})}(a[o],n,t,r));return Promise.all(A).then(function(){return r.associations=(e=>{let t=new Map;for(let[i,s]of r.associations)(i instanceof el.F5T||i instanceof el.xEZ)&&t.set(i,s);return e.traverse(e=>{let i=r.associations.get(e);null!=i&&t.set(e,i)}),t})(n),n})}}function id(e,t,i){let s=t.attributes,r=[];for(let n in s){let a=ir[n]||n.toLowerCase();a in e.attributes||r.push(function(t,s){return i.getDependency("accessor",t).then(function(t){e.setAttribute(s,t)})}(s[n],a))}if(void 0!==t.indices&&!e.index){let A=i.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});r.push(A)}return ih(e,t),!function(e,t,i){let s=t.attributes,r=new el.ZzF;if(void 0===s.POSITION)return;{let n=i.json.accessors[s.POSITION],a=n.min,A=n.max;if(void 0!==a&&void 0!==A){if(r.set(new el.Pa4(a[0],a[1],a[2]),new el.Pa4(A[0],A[1],A[2])),n.normalized){let o=iu(ie[n.componentType]);r.min.multiplyScalar(o),r.max.multiplyScalar(o)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}let l=t.targets;if(void 0!==l){let h=new el.Pa4,c=new el.Pa4;for(let u=0,g=l.length;u<g;u++){let d=l[u];if(void 0!==d.POSITION){let p=i.json.accessors[d.POSITION],m=p.min,I=p.max;if(void 0!==m&&void 0!==I){if(c.setX(Math.max(Math.abs(m[0]),Math.abs(I[0]))),c.setY(Math.max(Math.abs(m[1]),Math.abs(I[1]))),c.setZ(Math.max(Math.abs(m[2]),Math.abs(I[2]))),p.normalized){let f=iu(ie[p.componentType]);c.multiplyScalar(f)}h.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(h)}e.boundingBox=r;let E=new el.aLr;r.getCenter(E.center),E.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=E}(e,t,i),Promise.all(r).then(function(){return void 0!==t.targets?function(e,t,i){let s=!1,r=!1,n=!1;for(let a=0,A=t.length;a<A;a++){let o=t[a];if(void 0!==o.POSITION&&(s=!0),void 0!==o.NORMAL&&(r=!0),void 0!==o.COLOR_0&&(n=!0),s&&r&&n)break}if(!s&&!r&&!n)return Promise.resolve(e);let l=[],h=[],c=[];for(let u=0,g=t.length;u<g;u++){let d=t[u];if(s){let p=void 0!==d.POSITION?i.getDependency("accessor",d.POSITION):e.attributes.position;l.push(p)}if(r){let m=void 0!==d.NORMAL?i.getDependency("accessor",d.NORMAL):e.attributes.normal;h.push(m)}if(n){let I=void 0!==d.COLOR_0?i.getDependency("accessor",d.COLOR_0):e.attributes.color;c.push(I)}}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(c)]).then(function(t){let i=t[0],a=t[1],A=t[2];return s&&(e.morphAttributes.position=i),r&&(e.morphAttributes.normal=a),n&&(e.morphAttributes.color=A),e.morphTargetsRelative=!0,e})}(e,t.targets,i):e})}function ip(e,t){let i=e.getIndex();if(null===i){let s=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let n=0;n<r.count;n++)s.push(n);e.setIndex(s),i=e.getIndex()}let a=i.count-2,A=[];if(t===el.z$h)for(let o=1;o<=a;o++)A.push(i.getX(0)),A.push(i.getX(o)),A.push(i.getX(o+1));else for(let l=0;l<a;l++)l%2==0?(A.push(i.getX(l)),A.push(i.getX(l+1)),A.push(i.getX(l+2))):(A.push(i.getX(l+2)),A.push(i.getX(l+1)),A.push(i.getX(l)));A.length/3!==a&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let h=e.clone();return h.setIndex(A),h}class im{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_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 i=this.workersResolve[e];if(i&&i(t),this.queue.length){let{resolve:s,msg:r,transfer:n}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(r,n)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{let s=this._getIdleWorker();-1!==s?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=i,this.workers[s].postMessage(e,t)):this.queue.push({resolve:i,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}}var iI=i(1876).Buffer;class iE{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize: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:[]}],this.keyValue={},this.globalData=null}}class iC{constructor(e,t,i,s){this._dataView=new DataView(e.buffer,e.byteOffset+t,i),this._littleEndian=s,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)+4294967296*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}_skip(e){return this._offset+=e,this}_scan(e,t=0){let i=this._offset,s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,s)}}new Uint8Array([0]);let iB=[171,75,84,88,32,50,48,187,13,10,26,10];function iy(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):iI.from(e).toString("utf8")}var iQ=i(1876).Buffer;let iw={env:{emscripten_notify_memory_growth:function(e){n=new Uint8Array(r.exports.memory.buffer)}}};class iv{init(){return s||(s="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+iS).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,iw)).then(this._init):WebAssembly.instantiate(iQ.from(iS,"base64"),iw).then(this._init))}_init(e){r=e.instance,iw.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!r)throw Error("ZSTDDecoder: Await .init() before decoding.");let i=e.byteLength,s=r.exports.malloc(i);n.set(e,s),t=t||Number(r.exports.ZSTD_findDecompressedSize(s,i));let a=r.exports.malloc(t),A=r.exports.ZSTD_decompress(a,t,s,i),o=n.slice(a,a+A);return r.exports.free(s),r.exports.free(a),o}}let iS="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQ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ABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoi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cgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEE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wwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGog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IAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiA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AAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",ib=new WeakMap,ix=0;class iM extends el.aNw{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new im,this.workerSourceURL="",this.workerConfig=null,"undefined"!=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}detectSupport(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),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")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){let e=new el.hH6(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);let t=e.loadAsync("basis_transcoder.js"),i=new el.hH6(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);let s=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([e,t])=>{let i=iM.BasisWorker.toString(),s=["/* constants */","let _EngineFormat = "+JSON.stringify(iM.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(iM.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(iM.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([s])),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})}),ix>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),ix++}return this.transcoderPending}load(e,t,i,s){if(null===this.workerConfig)throw Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");let r=new el.hH6(this.manager);r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials),r.load(e,e=>{if(ib.has(e)){let i=ib.get(e);return i.promise.then(t).catch(s)}this._createTexture(e).then(e=>t?t(e):null).catch(s)},i,s)}_createTextureFrom(e,t){let{mipmaps:i,width:s,height:r,format:n,type:a,error:A,dfdTransferFn:o,dfdFlags:l}=e;if("error"===a)return Promise.reject(A);let h=t.layerCount>1?new el.Z_g(i,s,r,t.layerCount,n,el.ywz):new el.EB7(i,s,r,n,el.ywz);return h.minFilter=1===i.length?el.wem:el.D1R,h.magFilter=el.wem,h.generateMipmaps=!1,h.needsUpdate=!0,h.encoding=2===o?el.knz:el.rnI,h.premultiplyAlpha=!!(1&l),h}async _createTexture(e,t={}){let i=function(e){let t=new Uint8Array(e.buffer,e.byteOffset,iB.length);if(t[0]!==iB[0]||t[1]!==iB[1]||t[2]!==iB[2]||t[3]!==iB[3]||t[4]!==iB[4]||t[5]!==iB[5]||t[6]!==iB[6]||t[7]!==iB[7]||t[8]!==iB[8]||t[9]!==iB[9]||t[10]!==iB[10]||t[11]!==iB[11])throw Error("Missing KTX 2.0 identifier.");let i=new iE,s=17*Uint32Array.BYTES_PER_ELEMENT,r=new iC(e,iB.length,s,!0);i.vkFormat=r._nextUint32(),i.typeSize=r._nextUint32(),i.pixelWidth=r._nextUint32(),i.pixelHeight=r._nextUint32(),i.pixelDepth=r._nextUint32(),i.layerCount=r._nextUint32(),i.faceCount=r._nextUint32();let n=r._nextUint32();i.supercompressionScheme=r._nextUint32();let a=r._nextUint32(),A=r._nextUint32(),o=r._nextUint32(),l=r._nextUint32(),h=r._nextUint64(),c=r._nextUint64(),u=new iC(e,iB.length+s,3*n*8,!0);for(let g=0;g<n;g++)i.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+u._nextUint64(),u._nextUint64()),uncompressedByteLength:u._nextUint64()});let d=new iC(e,a,A,!0),p={vendorId:d._skip(4)._nextUint16(),descriptorType:d._nextUint16(),versionNumber:d._nextUint16(),descriptorBlockSize:d._nextUint16(),colorModel:d._nextUint8(),colorPrimaries:d._nextUint8(),transferFunction:d._nextUint8(),flags:d._nextUint8(),texelBlockDimension:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],bytesPlane:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],samples:[]},m=(p.descriptorBlockSize/4-6)/4;for(let I=0;I<m;I++){let f={bitOffset:d._nextUint16(),bitLength:d._nextUint8(),channelType:d._nextUint8(),samplePosition:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&f.channelType?(f.sampleLower=d._nextInt32(),f.sampleUpper=d._nextInt32()):(f.sampleLower=d._nextUint32(),f.sampleUpper=d._nextUint32()),p.samples[I]=f}i.dataFormatDescriptor.length=0,i.dataFormatDescriptor.push(p);let E=new iC(e,o,l,!0);for(;E._offset<l;){let C=E._nextUint32(),B=E._scan(C),y=iy(B),Q=E._scan(C-B.byteLength);i.keyValue[y]=y.match(/^ktx/i)?iy(Q):Q,E._offset%4&&E._skip(4-E._offset%4)}if(c<=0)return i;let w=new iC(e,h,c,!0),v=w._nextUint16(),S=w._nextUint16(),b=w._nextUint32(),x=w._nextUint32(),M=w._nextUint32(),R=w._nextUint32(),D=[];for(let T=0;T<n;T++)D.push({imageFlags:w._nextUint32(),rgbSliceByteOffset:w._nextUint32(),rgbSliceByteLength:w._nextUint32(),alphaSliceByteOffset:w._nextUint32(),alphaSliceByteLength:w._nextUint32()});let L=h+w._offset,F=L+b,k=F+x,_=new Uint8Array(e.buffer,e.byteOffset+L,b),U=new Uint8Array(e.buffer,e.byteOffset+F,x),N=new Uint8Array(e.buffer,e.byteOffset+k,M),G=new Uint8Array(e.buffer,e.byteOffset+(k+M),R);return i.globalData={endpointCount:v,selectorCount:S,imageDescs:D,endpointsData:_,selectorsData:U,tablesData:N,extendedData:G},i}(new Uint8Array(e));if(0!==i.vkFormat)return iL(i);let s=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:t},[e])).then(e=>this._createTextureFrom(e.data,i));return ib.set(e,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),ix--,this}}iM.BasisFormat={ETC1S:0,UASTC_4x4:1},iM.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},iM.EngineFormat={RGBAFormat:el.wk1,RGBA_ASTC_4x4_Format:el.ptH,RGBA_BPTC_Format:el.bsb,RGBA_ETC2_EAC_Format:el.ekQ,RGBA_PVRTC_4BPPV1_Format:el.eaV,RGBA_S3TC_DXT5_Format:el.ILR,RGB_ETC1_Format:el.fto,RGB_ETC2_Format:el.l0P,RGB_PVRTC_4BPPV1_Format:el._AM,RGB_S3TC_DXT1_Format:el.wuA},iM.BasisWorker=function(){let e,t,i;let s=_EngineFormat,r=_TranscoderFormat,n=_BasisFormat;self.addEventListener("message",function(a){let h=a.data;switch(h.type){case"init":var c;e=h.config,c=h.transcoderBinary,t=new Promise(e=>{i={wasmBinary:c,onRuntimeInitialized:e},BASIS(i)}).then(()=>{i.initializeBasis(),void 0===i.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")});break;case"transcode":t.then(()=>{try{let{width:t,height:a,hasAlpha:c,mipmaps:u,format:g,dfdTransferFn:d,dfdFlags:p}=function(t){let a=new i.KTX2File(new Uint8Array(t));function h(){a.close(),a.delete()}if(!a.isValid())throw h(),Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let c=a.isUASTC()?n.UASTC_4x4:n.ETC1S,u=a.getWidth(),g=a.getHeight(),d=a.getLayers()||1,p=a.getLevels(),m=a.getHasAlpha(),I=a.getDFDTransferFunc(),f=a.getDFDFlags(),{transcoderFormat:E,engineFormat:C}=function(t,i,a,h){let c,u;let g=t===n.ETC1S?A:o;for(let d=0;d<g.length;d++){let p=g[d];if(e[p.if]&&p.basisFormat.includes(t)&&(!h||!(p.transcoderFormat.length<2))&&(!p.needsPowerOfTwo||l(i)&&l(a)))return c=p.transcoderFormat[h?1:0],u=p.engineFormat[h?1:0],{transcoderFormat:c,engineFormat:u}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),c=r.RGBA32,u=s.RGBAFormat,{transcoderFormat:c,engineFormat:u}}(c,u,g,m);if(!u||!g||!p)throw h(),Error("THREE.KTX2Loader: Invalid texture");if(!a.startTranscoding())throw h(),Error("THREE.KTX2Loader: .startTranscoding failed");let B=[];for(let y=0;y<p;y++){let Q,w;let v=[];for(let S=0;S<d;S++){let b=a.getImageLevelInfo(y,S,0);Q=b.origWidth,w=b.origHeight;let x=new Uint8Array(a.getImageTranscodedSizeInBytes(y,S,0,E)),M=a.transcodeImage(x,y,S,0,E,0,-1,-1);if(!M)throw h(),Error("THREE.KTX2Loader: .transcodeImage failed.");v.push(x)}B.push({data:function(e){let t=0;for(let i of e)t+=i.byteLength;let s=new Uint8Array(t),r=0;for(let n of e)s.set(n,r),r+=n.byteLength;return s}(v),width:Q,height:w})}return h(),{width:u,height:g,hasAlpha:m,mipmaps:B,format:C,dfdTransferFn:I,dfdFlags:f}}(h.buffer),m=[];for(let I=0;I<u.length;++I)m.push(u[I].data.buffer);self.postMessage({type:"transcode",id:h.id,width:t,height:a,hasAlpha:c,mipmaps:u,format:g,dfdTransferFn:d,dfdFlags:p},m)}catch(f){console.error(f),self.postMessage({type:"error",id:h.id,error:f.message})}})}});let a=[{if:"astcSupported",basisFormat:[n.UASTC_4x4],transcoderFormat:[r.ASTC_4x4,r.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[n.ETC1S,n.UASTC_4x4],transcoderFormat:[r.BC7_M5,r.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[n.ETC1S,n.UASTC_4x4],transcoderFormat:[r.BC1,r.BC3],engineFormat:[s.RGB_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[n.ETC1S,n.UASTC_4x4],transcoderFormat:[r.ETC1,r.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[n.ETC1S,n.UASTC_4x4],transcoderFormat:[r.ETC1],engineFormat:[s.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[n.ETC1S,n.UASTC_4x4],transcoderFormat:[r.PVRTC1_4_RGB,r.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],A=a.sort(function(e,t){return e.priorityETC1S-t.priorityETC1S}),o=a.sort(function(e,t){return e.priorityUASTC-t.priorityUASTC});function l(e){return e<=2||(e&e-1)==0&&0!==e}};let iR={109:el.wk1,97:el.wk1,37:el.wk1,43:el.wk1,103:el.av9,83:el.av9,16:el.av9,22:el.av9,100:el.hEm,76:el.hEm,15:el.hEm,9:el.hEm},iD={109:el.VzW,97:el.cLu,37:el.ywz,43:el.ywz,103:el.VzW,83:el.cLu,16:el.ywz,22:el.ywz,100:el.VzW,76:el.cLu,15:el.ywz,9:el.ywz},iT={43:el.knz,22:el.knz,15:el.knz};async function iL(e){let t,i;let{vkFormat:s,pixelWidth:r,pixelHeight:n,pixelDepth:A}=e;if(void 0===iR[s])throw Error("THREE.KTX2Loader: Unsupported vkFormat.");let o=e.levels[0];if(0===e.supercompressionScheme)t=o.levelData;else if(2===e.supercompressionScheme)a||(a=new Promise(async e=>{let t=new iv;await t.init(),e(t)})),t=(await a).decode(o.levelData,o.uncompressedByteLength);else throw Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");i=iD[s]===el.VzW?new Float32Array(t.buffer,t.byteOffset,t.byteLength/Float32Array.BYTES_PER_ELEMENT):iD[s]===el.cLu?new Uint16Array(t.buffer,t.byteOffset,t.byteLength/Uint16Array.BYTES_PER_ELEMENT):t;let l=0===A?new el.IEO(i,r,n):new el.JUT(i,r,n,A);return l.type=iD[s],l.format=iR[s],l.encoding=iT[s]||el.rnI,l.needsUpdate=!0,Promise.resolve(l)}let iF=Symbol("retainerCount"),ik=Symbol("recentlyUsed"),i_=Symbol("evict"),iU=Symbol("evictionThreshold"),iN=Symbol("cache");class iG{constructor(e,t=5){this[y]=new Map,this[Q]=[],this[iN]=e,this[iU]=t}set evictionThreshold(e){this[iU]=e,this[i_]()}get evictionThreshold(){return this[iU]}get cache(){return this[iN]}retainerCount(e){return this[iF].get(e)||0}reset(){this[iF].clear(),this[ik]=[]}retain(e){this[iF].has(e)||this[iF].set(e,0),this[iF].set(e,this[iF].get(e)+1);let t=this[ik].indexOf(e);-1!==t&&this[ik].splice(t,1),this[ik].unshift(e),this[i_]()}release(e){this[iF].has(e)&&this[iF].set(e,Math.max(this[iF].get(e)-1,0)),this[i_]()}[(y=iF,Q=ik,i_)](){if(!(this[ik].length<this[iU]))for(let e=this[ik].length-1;e>=this[iU];--e){let t=this[ik][e],i=this[iF].get(t);0===i&&(this[iN].delete(t),this[ik].splice(e,1))}}}/* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let iP=e=>{let t=[],i=new Set;for(let s of e){let r=s,n=0;for(;i.has(r);)r=s+"."+ ++n;i.add(r),t.push(r)}return t},iO=e=>{let t=new Map;for(let i of e.mappings)for(let s of i.variants)t.set(s,{material:null,gltfMaterialIndex:i.material});return t};class iH{constructor(e){this.parser=e,this.name="KHR_materials_variants"}afterRoot(e){let t=this.parser,i=t.json;if(void 0===i.extensions||void 0===i.extensions[this.name])return null;let s=i.extensions[this.name],r=s.variants||[],n=iP(r.map(e=>e.name));for(let a of e.scenes)a.traverse(e=>{let s=e;if(!s.isMesh)return;let r=t.associations.get(s);if(null==r||null==r.meshes||null==r.primitives)return;let n=i.meshes[r.meshes],a=n.primitives,A=a[r.primitives],o=A.extensions;o&&o[this.name]&&(s.userData.variantMaterials=iO(o[this.name]))});return e.userData.variants=n,Promise.resolve()}}let iq=(e,t,i=()=>{})=>{let s=e=>{let t=e.loaded/e.total;i(Math.max(0,Math.min(1,isFinite(t)?t:1)))};return new Promise((i,r)=>{t.load(e,i,s,r)})},iK=e=>new Promise((t,i)=>{let s=document.createElement("script");document.body.appendChild(s),s.onload=t,s.onerror=i,s.async=!0,s.src=e}),iV=new Map,iJ=new Map,iY=new tL,ij=new iM,iz=Symbol("loader"),i$=Symbol("evictionPolicy"),iW=Symbol("GLTFInstance");class iX extends el.pBf{constructor(e){super(),this[v]=new tk().register(e=>new iH(e)),this[iW]=e,this[iz].setDRACOLoader(iY),this[iz].setKTX2Loader(ij)}static setDRACODecoderLocation(e){A=e,iY.setDecoderPath(e)}static getDRACODecoderLocation(){return A}static setKTX2TranscoderLocation(e){o=e,ij.setTranscoderPath(e)}static getKTX2TranscoderLocation(){return o}static setMeshoptDecoderLocation(e){l!==e&&(l=e,h=iK(e).then(()=>MeshoptDecoder.ready).then(()=>MeshoptDecoder))}static getMeshoptDecoderLocation(){return l}static initializeKTX2Loader(e){ij.detectSupport(e)}static get cache(){return iV}static clearCache(){iV.forEach((e,t)=>{this.delete(t)}),this[i$].reset()}static has(e){return iV.has(e)}static async delete(e){if(!this.has(e))return;let t=iV.get(e);iJ.delete(e),iV.delete(e);let i=await t;i.dispose()}static hasFinishedLoading(e){return!!iJ.get(e)}get[(w=i$,v=iz,i$)](){return this.constructor[i$]}async preload(e,t,i=()=>{}){if(this[iz].setWithCredentials(iX.withCredentials),this.dispatchEvent({type:"preload",element:t,src:e}),!iV.has(e)){null!=h&&this[iz].setMeshoptDecoder(await h);let s=iq(e,this[iz],e=>{i(.8*e)}),r=this[iW],n=s.then(e=>r.prepare(e)).then(e=>(i(.9),new r(e))).catch(e=>(console.error(e),new r));iV.set(e,n)}await iV.get(e),iJ.set(e,!0),i&&i(1)}async load(e,t,i=()=>{}){await this.preload(e,t,i);let s=await iV.get(e),r=await s.clone();return this[i$].retain(e),r.dispose=()=>{this[i$].release(e)},r}}iX[w]=new iG(iX);class iZ extends el.Tme{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.addEventListener("removed",function(){this.traverse(function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}}let i0=new el.Pa4,i1=new el.yGw,i2=new el.yGw,i3=new el.Pa4,i4=new el.Pa4;class i8{constructor(e={}){let t,i,s,r;let n=this,a={objects:new WeakMap},A=void 0!==e.element?e.element:document.createElement("div");A.style.overflow="hidden",this.domElement=A,this.getSize=function(){return{width:t,height:i}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),i1.copy(t.matrixWorldInverse),i2.multiplyMatrices(t.projectionMatrix,i1),function e(t,i,o){if(t.isCSS2DObject){i0.setFromMatrixPosition(t.matrixWorld),i0.applyMatrix4(i2);let l=!0===t.visible&&i0.z>=-1&&i0.z<=1&&!0===t.layers.test(o.layers);if(t.element.style.display=!0===l?"":"none",!0===l){t.onBeforeRender(n,i,o);let h=t.element;h.style.transform="translate(-50%,-50%) translate("+(i0.x*s+s)+"px,"+(-i0.y*r+r)+"px)",h.parentNode!==A&&A.appendChild(h),t.onAfterRender(n,i,o)}let c={distanceToCameraSquared:(i3.setFromMatrixPosition(o.matrixWorld),i4.setFromMatrixPosition(t.matrixWorld),i3.distanceToSquared(i4))};a.objects.set(t,c)}for(let u=0,g=t.children.length;u<g;u++)e(t.children[u],i,o)}(e,e,t),function(e){let t=(function(e){let t=[];return e.traverse(function(e){e.isCSS2DObject&&t.push(e)}),t})(e).sort(function(e,t){if(e.renderOrder!==t.renderOrder)return t.renderOrder-e.renderOrder;let i=a.objects.get(e).distanceToCameraSquared,s=a.objects.get(t).distanceToCameraSquared;return i-s}),i=t.length;for(let s=0,r=t.length;s<r;s++)t[s].element.style.zIndex=i-s}(e)},this.setSize=function(e,n){t=e,i=n,s=t/2,r=i/2,A.style.width=e+"px",A.style.height=n+"px"}}}class i5{constructor(){this.pluginCallbacks=[],this.register(function(e){return new sa(e)}),this.register(function(e){return new sA(e)}),this.register(function(e){return new so(e)}),this.register(function(e){return new sc(e)}),this.register(function(e){return new su(e)}),this.register(function(e){return new sl(e)}),this.register(function(e){return new sh(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}parse(e,t,i,s){let r=new sn,n=[];for(let a=0,A=this.pluginCallbacks.length;a<A;a++)n.push(this.pluginCallbacks[a](r));r.setPlugins(n),r.write(e,t,s).catch(i)}parseAsync(e,t){let i=this;return new Promise(function(s,r){i.parse(e,s,r,t)})}}let i6={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},i9={};i9[el.TyD]=i6.NEAREST,i9[el.YLQ]=i6.NEAREST_MIPMAP_NEAREST,i9[el.aH4]=i6.NEAREST_MIPMAP_LINEAR,i9[el.wem]=i6.LINEAR,i9[el.qyh]=i6.LINEAR_MIPMAP_NEAREST,i9[el.D1R]=i6.LINEAR_MIPMAP_LINEAR,i9[el.uWy]=i6.CLAMP_TO_EDGE,i9[el.rpg]=i6.REPEAT,i9[el.OoA]=i6.MIRRORED_REPEAT;let i7={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"};function se(e,t){return e.length===t.length&&e.every(function(e,i){return e===t[i]})}function st(e){return 4*Math.ceil(e/4)}function si(e,t=0){let i=st(e.byteLength);if(i!==e.byteLength){let s=new Uint8Array(i);if(s.set(new Uint8Array(e)),0!==t)for(let r=e.byteLength;r<i;r++)s[r]=t;return s.buffer}return e}function ss(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}function sr(e,t){let i;return void 0!==e.toBlob?new Promise(i=>e.toBlob(i,t)):("image/jpeg"===t?i=.92:"image/webp"===t&&(i=.8),e.convertToBlob({type:t,quality:i}))}class sn{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,i){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let s=this.buffers,r=this.json;i=this.options;let n=this.extensionsUsed,a=new Blob(s,{type:"application/octet-stream"}),A=Object.keys(n);if(A.length>0&&(r.extensionsUsed=A),r.buffers&&r.buffers.length>0&&(r.buffers[0].byteLength=a.size),!0===i.binary){let o=new FileReader;o.readAsArrayBuffer(a),o.onloadend=function(){var e;let i=si(o.result),s=new DataView(new ArrayBuffer(8));s.setUint32(0,i.byteLength,!0),s.setUint32(4,5130562,!0);let n=si((e=JSON.stringify(r),new TextEncoder().encode(e).buffer),32),a=new DataView(new ArrayBuffer(8));a.setUint32(0,n.byteLength,!0),a.setUint32(4,1313821514,!0);let A=new ArrayBuffer(12),l=new DataView(A);l.setUint32(0,1179937895,!0),l.setUint32(4,2,!0);let h=12+a.byteLength+n.byteLength+s.byteLength+i.byteLength;l.setUint32(8,h,!0);let c=new Blob([A,a,n,s,i],{type:"application/octet-stream"}),u=new FileReader;u.readAsArrayBuffer(c),u.onloadend=function(){t(u.result)}}}else if(r.buffers&&r.buffers.length>0){let l=new FileReader;l.readAsDataURL(a),l.onloadend=function(){let e=l.result;r.buffers[0].uri=e,t(r)}}else t(r)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;let i=this.options,s=this.extensionsUsed;try{let r=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&r.gltfExtensions){for(let n in void 0===t.extensions&&(t.extensions={}),r.gltfExtensions)t.extensions[n]=r.gltfExtensions[n],s[n]=!0;delete r.gltfExtensions}Object.keys(r).length>0&&(t.extras=r)}catch(a){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+a.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){let i=new Map;i.set(!0,this.uid++),i.set(!1,this.uid++),this.uids.set(e,i)}let s=this.uids.get(e);return s.get(t)}isNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return!1;let i=new el.Pa4;for(let s=0,r=e.count;s<r;s++)if(Math.abs(i.fromBufferAttribute(e,s).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 i=e.clone(),s=new el.Pa4;for(let r=0,n=i.count;r<n;r++)s.fromBufferAttribute(i,r),0===s.x&&0===s.y&&0===s.z?s.setX(1):s.normalize(),i.setXYZ(r,s.x,s.y,s.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1,s={};(0!==t.offset.x||0!==t.offset.y)&&(s.offset=t.offset.toArray(),i=!0),0!==t.rotation&&(s.rotation=t.rotation,i=!0),(1!==t.repeat.x||1!==t.repeat.y)&&(s.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=s,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function i(e){return e.encoding===el.knz?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.");let s=e?.image,r=t?.image,n=Math.max(s?.width||0,r?.width||0),a=Math.max(s?.height||0,r?.height||0),A=ss();A.width=n,A.height=a;let o=A.getContext("2d");o.fillStyle="#00ffff",o.fillRect(0,0,n,a);let l=o.getImageData(0,0,n,a);if(s){o.drawImage(s,0,0,n,a);let h=i(e),c=o.getImageData(0,0,n,a).data;for(let u=2;u<c.length;u+=4)l.data[u]=256*h(c[u]/256)}if(r){o.drawImage(r,0,0,n,a);let g=i(t),d=o.getImageData(0,0,n,a).data;for(let p=1;p<d.length;p+=4)l.data[p]=256*g(d[p]/256)}o.putImageData(l,0,0);let m=(e||t).clone();return m.source=new el.Hw6(A),m.encoding=el.rnI,m}processBuffer(e){let t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,s,r){let n;let a=this.json;a.bufferViews||(a.bufferViews=[]),n=t===i6.UNSIGNED_BYTE?1:t===i6.UNSIGNED_SHORT?2:4;let A=st(s*e.itemSize*n),o=new DataView(new ArrayBuffer(A)),l=0;for(let h=i;h<i+s;h++)for(let c=0;c<e.itemSize;c++){let u;e.itemSize>4?u=e.array[h*e.itemSize+c]:0===c?u=e.getX(h):1===c?u=e.getY(h):2===c?u=e.getZ(h):3===c&&(u=e.getW(h)),t===i6.FLOAT?o.setFloat32(l,u,!0):t===i6.UNSIGNED_INT?o.setUint32(l,u,!0):t===i6.UNSIGNED_SHORT?o.setUint16(l,u,!0):t===i6.UNSIGNED_BYTE&&o.setUint8(l,u),l+=n}let g={buffer:this.processBuffer(o.buffer),byteOffset:this.byteOffset,byteLength:A};void 0!==r&&(g.target=r),r===i6.ARRAY_BUFFER&&(g.byteStride=e.itemSize*n),this.byteOffset+=A,a.bufferViews.push(g);let d={id:a.bufferViews.length-1,byteLength:0};return d}processBufferViewImage(e){let t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(s){let r=new FileReader;r.readAsArrayBuffer(e),r.onloadend=function(){let e=si(r.result),n={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,s(i.bufferViews.push(n)-1)}})}processAccessor(e,t,i,s){let r,n;let a=this.json;if(e.array.constructor===Float32Array)r=i6.FLOAT;else if(e.array.constructor===Uint32Array)r=i6.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)r=i6.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)r=i6.UNSIGNED_BYTE;else throw Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(void 0===i&&(i=0),void 0===s&&(s=e.count),0===s)return null;let A=function(e,t,i){let s={min:Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let r=t;r<t+i;r++)for(let n=0;n<e.itemSize;n++){let a;e.itemSize>4?a=e.array[r*e.itemSize+n]:0===n?a=e.getX(r):1===n?a=e.getY(r):2===n?a=e.getZ(r):3===n&&(a=e.getW(r)),s.min[n]=Math.min(s.min[n],a),s.max[n]=Math.max(s.max[n],a)}return s}(e,i,s);void 0!==t&&(n=e===t.index?i6.ELEMENT_ARRAY_BUFFER:i6.ARRAY_BUFFER);let o=this.processBufferView(e,r,i,s,n),l={bufferView:o.id,byteOffset:o.byteOffset,componentType:r,count:s,max:A.max,min:A.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(l.normalized=!0),a.accessors||(a.accessors=[]),a.accessors.push(l)-1}processImage(e,t,i,s="image/png"){let r=this,n=r.cache,a=r.json,A=r.options,o=r.pending;n.images.has(e)||n.images.set(e,{});let l=n.images.get(e),h=s+":flipY/"+i.toString();if(void 0!==l[h])return l[h];a.images||(a.images=[]);let c={mimeType:s},u=ss();u.width=Math.min(e.width,A.maxTextureSize),u.height=Math.min(e.height,A.maxTextureSize);let g=u.getContext("2d");if(!0===i&&(g.translate(0,u.height),g.scale(1,-1)),void 0!==e.data){t!==el.wk1&&console.error("GLTFExporter: Only RGBAFormat is supported."),(e.width>A.maxTextureSize||e.height>A.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let d=new Uint8ClampedArray(e.height*e.width*4);for(let p=0;p<d.length;p+=4)d[p+0]=e.data[p+0],d[p+1]=e.data[p+1],d[p+2]=e.data[p+2],d[p+3]=e.data[p+3];g.putImageData(new ImageData(d,e.width,e.height),0,0)}else g.drawImage(e,0,0,u.width,u.height);!0===A.binary?o.push(sr(u,s).then(e=>r.processBufferViewImage(e)).then(e=>{c.bufferView=e})):void 0!==u.toDataURL?c.uri=u.toDataURL(s):o.push(sr(u,s).then(e=>new FileReader().readAsDataURL(e)).then(e=>{c.uri=e}));let m=a.images.push(c)-1;return l[h]=m,m}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let i={magFilter:i9[e.magFilter],minFilter:i9[e.minFilter],wrapS:i9[e.wrapS],wrapT:i9[e.wrapT]};return t.samplers.push(i)-1}processTexture(e){let t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]);let s=e.userData.mimeType;"image/webp"===s&&(s="image/png");let r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,s)};e.name&&(r.name=e.name),this._invokeAll(function(t){t.writeTexture&&t.writeTexture(e,r)});let n=i.textures.push(r)-1;return t.textures.set(e,n),n}processMaterial(e){let t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);let s={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let r=e.color.toArray().concat([e.opacity]);if(se(r,[1,1,1,1])||(s.pbrMetallicRoughness.baseColorFactor=r),e.isMeshStandardMaterial?(s.pbrMetallicRoughness.metallicFactor=e.metalness,s.pbrMetallicRoughness.roughnessFactor=e.roughness):(s.pbrMetallicRoughness.metallicFactor=.5,s.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let n=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),a={index:this.processTexture(n)};this.applyTextureTransform(a,n),s.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let A={index:this.processTexture(e.map)};this.applyTextureTransform(A,e.map),s.pbrMetallicRoughness.baseColorTexture=A}if(e.emissive){let o=e.emissive.clone().multiplyScalar(e.emissiveIntensity),l=Math.max(o.r,o.g,o.b);if(l>1&&(o.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(s.emissiveFactor=o.toArray()),e.emissiveMap){let h={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(h,e.emissiveMap),s.emissiveTexture=h}}if(e.normalMap){let c={index:this.processTexture(e.normalMap)};e.normalScale&&1!==e.normalScale.x&&(c.scale=e.normalScale.x),this.applyTextureTransform(c,e.normalMap),s.normalTexture=c}if(e.aoMap){let u={index:this.processTexture(e.aoMap),texCoord:1};1!==e.aoMapIntensity&&(u.strength=e.aoMapIntensity),this.applyTextureTransform(u,e.aoMap),s.occlusionTexture=u}e.transparent?s.alphaMode="BLEND":e.alphaTest>0&&(s.alphaMode="MASK",s.alphaCutoff=e.alphaTest),e.side===el.ehD&&(s.doubleSided=!0),""!==e.name&&(s.name=e.name),this.serializeUserData(e,s),this._invokeAll(function(t){t.writeMaterial&&t.writeMaterial(e,s)});let g=i.materials.push(s)-1;return t.materials.set(e,g),g}processMesh(e){let t;let i=this.cache,s=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let n=0,a=e.material.length;n<a;n++)r.push(e.material[n].uuid);else r.push(e.material.uuid);let A=r.join(":");if(i.meshes.has(A))return i.meshes.get(A);let o=e.geometry;t=e.isLineSegments?i6.LINES:e.isLineLoop?i6.LINE_LOOP:e.isLine?i6.LINE_STRIP:e.isPoints?i6.POINTS:e.material.wireframe?i6.LINES:i6.TRIANGLES;let l={},h={},c=[],u=[],g={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=o.getAttribute("normal");void 0===d||this.isNormalizedNormalAttribute(d)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),o.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let p=null;for(let m in o.attributes){if("morph"===m.slice(0,5))continue;let I=o.attributes[m];m=g[m]||m.toUpperCase();let f=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(f.test(m)||(m="_"+m),i.attributes.has(this.getUID(I))){h[m]=i.attributes.get(this.getUID(I));continue}p=null;let E=I.array;"JOINTS_0"!==m||E instanceof Uint16Array||E instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),p=new el.TlE(new Uint16Array(E),I.itemSize,I.normalized));let C=this.processAccessor(p||I,o);null!==C&&(h[m]=C,i.attributes.set(this.getUID(I),C))}if(void 0!==d&&o.setAttribute("normal",d),0===Object.keys(h).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){let B=[],y=[],Q={};if(void 0!==e.morphTargetDictionary)for(let w in e.morphTargetDictionary)Q[e.morphTargetDictionary[w]]=w;for(let v=0;v<e.morphTargetInfluences.length;++v){let S={},b=!1;for(let x in o.morphAttributes){if("position"!==x&&"normal"!==x){b||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),b=!0);continue}let M=o.morphAttributes[x][v],R=x.toUpperCase(),D=o.attributes[x];if(i.attributes.has(this.getUID(M,!0))){S[R]=i.attributes.get(this.getUID(M,!0));continue}let T=M.clone();if(!o.morphTargetsRelative)for(let L=0,F=M.count;L<F;L++)T.setXYZ(L,M.getX(L)-D.getX(L),M.getY(L)-D.getY(L),M.getZ(L)-D.getZ(L));S[R]=this.processAccessor(T,o),i.attributes.set(this.getUID(D,!0),S[R])}u.push(S),B.push(e.morphTargetInfluences[v]),void 0!==e.morphTargetDictionary&&y.push(Q[v])}l.weights=B,y.length>0&&(l.extras={},l.extras.targetNames=y)}let k=Array.isArray(e.material);if(k&&0===o.groups.length)return null;let _=k?e.material:[e.material],U=k?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let N=0,G=U.length;N<G;N++){let P={mode:t,attributes:h};if(this.serializeUserData(o,P),u.length>0&&(P.targets=u),null!==o.index){let O=this.getUID(o.index);(void 0!==U[N].start||void 0!==U[N].count)&&(O+=":"+U[N].start+":"+U[N].count),i.attributes.has(O)?P.indices=i.attributes.get(O):(P.indices=this.processAccessor(o.index,o,U[N].start,U[N].count),i.attributes.set(O,P.indices)),null===P.indices&&delete P.indices}let H=this.processMaterial(_[U[N].materialIndex]);null!==H&&(P.material=H),c.push(P)}l.primitives=c,s.meshes||(s.meshes=[]),this._invokeAll(function(t){t.writeMesh&&t.writeMesh(e,l)});let q=s.meshes.push(l)-1;return i.meshes.set(A,q),q}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let i=e.isOrthographicCamera,s={type:i?"orthographic":"perspective"};return i?s.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:s.perspective={aspectRatio:e.aspect,yfov:el.M8C.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(s.name=e.type),t.cameras.push(s)-1}processAnimation(e,t){let i=this.json,s=this.nodeMap;i.animations||(i.animations=[]),e=i5.Utils.mergeMorphTargetTracks(e.clone(),t);let r=e.tracks,n=[],a=[];for(let A=0;A<r.length;++A){let o;let l=r[A],h=el.iUV.parseTrackName(l.name),c=el.iUV.findNode(t,h.nodeName),u=i7[h.propertyName];if("bones"===h.objectName&&(c=!0===c.isSkinnedMesh?c.skeleton.getBoneByName(h.objectIndex):void 0),!c||!u)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',l.name),null;let g=l.values.length/l.times.length;u===i7.morphTargetInfluences&&(g/=c.morphTargetInfluences.length),!0===l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(o="CUBICSPLINE",g/=3):o=l.getInterpolation()===el.Syv?"STEP":"LINEAR",a.push({input:this.processAccessor(new el.TlE(l.times,1)),output:this.processAccessor(new el.TlE(l.values,g)),interpolation:o}),n.push({sampler:a.length-1,target:{node:s.get(c),path:u}})}return i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:a,channels:n}),i.animations.length-1}processSkin(e){let t=this.json,i=this.nodeMap,s=t.nodes[i.get(e)],r=e.skeleton;if(void 0===r)return null;let n=e.skeleton.bones[0];if(void 0===n)return null;let a=[],A=new Float32Array(16*r.bones.length),o=new el.yGw;for(let l=0;l<r.bones.length;++l)a.push(i.get(r.bones[l])),o.copy(r.boneInverses[l]),o.multiply(e.bindMatrix).toArray(A,16*l);void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new el.TlE(A,16)),joints:a,skeleton:i.get(n)});let h=s.skin=t.skins.length-1;return h}processNode(e){let t=this.json,i=this.options,s=this.nodeMap;t.nodes||(t.nodes=[]);let r={};if(i.trs){let n=e.quaternion.toArray(),a=e.position.toArray(),A=e.scale.toArray();se(n,[0,0,0,1])||(r.rotation=n),se(a,[0,0,0])||(r.translation=a),se(A,[1,1,1])||(r.scale=A)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===se(e.matrix.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])&&(r.matrix=e.matrix.elements);if(""!==e.name&&(r.name=String(e.name)),this.serializeUserData(e,r),e.isMesh||e.isLine||e.isPoints){let o=this.processMesh(e);null!==o&&(r.mesh=o)}else e.isCamera&&(r.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let l=[];for(let h=0,c=e.children.length;h<c;h++){let u=e.children[h];if(u.visible||!1===i.onlyVisible){let g=this.processNode(u);null!==g&&l.push(g)}}l.length>0&&(r.children=l)}this._invokeAll(function(t){t.writeNode&&t.writeNode(e,r)});let d=t.nodes.push(r)-1;return s.set(e,d),d}processScene(e){let t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);let s={};""!==e.name&&(s.name=e.name),t.scenes.push(s);let r=[];for(let n=0,a=e.children.length;n<a;n++){let A=e.children[n];if(A.visible||!1===i.onlyVisible){let o=this.processNode(A);null!==o&&r.push(o)}}r.length>0&&(s.nodes=r),this.serializeUserData(e,s)}processObjects(e){let t=new el.xsS;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);this.processScene(t)}processInput(e){let t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(t){t.beforeParse&&t.beforeParse(e)});let i=[];for(let s=0;s<e.length;s++)e[s]instanceof el.xsS?this.processScene(e[s]):i.push(e[s]);i.length>0&&this.processObjects(i);for(let r=0;r<this.skins.length;++r)this.processSkin(this.skins[r]);for(let n=0;n<t.animations.length;++n)this.processAnimation(t.animations[n],e[0]);this._invokeAll(function(t){t.afterParse&&t.afterParse(e)})}_invokeAll(e){for(let t=0,i=this.plugins.length;t<i;t++)e(this.plugins[t])}}class sa{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let i=this.writer,s=i.json,r=i.extensionsUsed,n={};e.name&&(n.name=e.name),n.color=e.color.toArray(),n.intensity=e.intensity,e.isDirectionalLight?n.type="directional":e.isPointLight?(n.type="point",e.distance>0&&(n.range=e.distance)):e.isSpotLight&&(n.type="spot",e.distance>0&&(n.range=e.distance),n.spot={},n.spot.innerConeAngle=-((e.penumbra-1)*e.angle*1),n.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."),r[this.name]||(s.extensions=s.extensions||{},s.extensions[this.name]={lights:[]},r[this.name]=!0);let a=s.extensions[this.name].lights;a.push(n),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}}class sA{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer,s=i.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},s[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class so{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let i=this.writer,s=i.extensionsUsed,r={};t.pbrMetallicRoughness.baseColorFactor&&(r.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let n=[1,1,1];if(e.specular.toArray(n,0),r.specularFactor=n,r.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(r.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:i.processTexture(e.specularMap)};i.applyTextureTransform(a,e.specularMap),r.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}class sl{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;let i=this.writer,s=i.extensionsUsed,r={};if(r.clearcoatFactor=e.clearcoat,e.clearcoatMap){let n={index:i.processTexture(e.clearcoatMap)};i.applyTextureTransform(n,e.clearcoatMap),r.clearcoatTexture=n}if(r.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let a={index:i.processTexture(e.clearcoatRoughnessMap)};i.applyTextureTransform(a,e.clearcoatRoughnessMap),r.clearcoatRoughnessTexture=a}if(e.clearcoatNormalMap){let A={index:i.processTexture(e.clearcoatNormalMap)};i.applyTextureTransform(A,e.clearcoatNormalMap),r.clearcoatNormalTexture=A}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}class sh{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;let i=this.writer,s=i.extensionsUsed,r={};if(r.iridescenceFactor=e.iridescence,e.iridescenceMap){let n={index:i.processTexture(e.iridescenceMap)};i.applyTextureTransform(n,e.iridescenceMap),r.iridescenceTexture=n}if(r.iridescenceIor=e.iridescenceIOR,r.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],r.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let a={index:i.processTexture(e.iridescenceThicknessMap)};i.applyTextureTransform(a,e.iridescenceThicknessMap),r.iridescenceThicknessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}class sc{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let i=this.writer,s=i.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){let n={index:i.processTexture(e.transmissionMap)};i.applyTextureTransform(n,e.transmissionMap),r.transmissionTexture=n}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}class su{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let i=this.writer,s=i.extensionsUsed,r={};if(r.thicknessFactor=e.thickness,e.thicknessMap){let n={index:i.processTexture(e.thicknessMap)};i.applyTextureTransform(n,e.thicknessMap),r.thicknessTexture=n}r.attenuationDistance=e.attenuationDistance,r.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}i5.Utils={insertKeyframe:function(e,t){let i;let s=e.getValueSize(),r=new e.TimeBufferType(e.times.length+1),n=new e.ValueBufferType(e.values.length+s),a=e.createInterpolant(new e.ValueBufferType(s));if(0===e.times.length){r[0]=t;for(let A=0;A<s;A++)n[A]=0;i=0}else if(t<e.times[0]){if(.001>Math.abs(e.times[0]-t))return 0;r[0]=t,r.set(e.times,1),n.set(a.evaluate(t),0),n.set(e.values,s),i=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;r[r.length-1]=t,r.set(e.times,0),n.set(e.values,0),n.set(a.evaluate(t),e.values.length),i=r.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){r.set(e.times.slice(0,o+1),0),r[o+1]=t,r.set(e.times.slice(o+1),o+2),n.set(e.values.slice(0,(o+1)*s),0),n.set(a.evaluate(t),(o+1)*s),n.set(e.values.slice((o+1)*s),(o+2)*s),i=o+1;break}}return e.times=r,e.values=n,i},mergeMorphTargetTracks:function(e,t){let i=[],s={},r=e.tracks;for(let n=0;n<r.length;++n){let a,A=r[n],o=el.iUV.parseTrackName(A.name),l=el.iUV.findNode(t,o.nodeName);if("morphTargetInfluences"!==o.propertyName||void 0===o.propertyIndex){i.push(A);continue}if(A.createInterpolant!==A.InterpolantFactoryMethodDiscrete&&A.createInterpolant!==A.InterpolantFactoryMethodLinear){if(A.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."),(A=A.clone()).setInterpolation(el.NMF)}let h=l.morphTargetInfluences.length,c=l.morphTargetDictionary[o.propertyIndex];if(void 0===c)throw Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);if(void 0===s[l.uuid]){a=A.clone();let u=new a.ValueBufferType(h*a.times.length);for(let g=0;g<a.times.length;g++)u[g*h+c]=a.values[g];a.name=(o.nodeName||"")+".morphTargetInfluences",a.values=u,s[l.uuid]=a,i.push(a);continue}let d=A.createInterpolant(new A.ValueBufferType(1));a=s[l.uuid];for(let p=0;p<a.times.length;p++)a.values[p*h+c]=d.evaluate(a.times[p]);for(let m=0;m<A.times.length;m++){let I=this.insertKeyframe(a,A.times[m]);a.values[I*h+c]=A.values[m]}}return e.tracks=i,e}};/* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let sg=e=>void 0!==e.material&&e.userData&&e.userData.variantMaterials&&!!Array.from(e.userData.variantMaterials.values()).filter(e=>sd(e.material)),sd=e=>e&&e.isMaterial&&!Array.isArray(e);class sp{constructor(e){this.writer=e,this.name="KHR_materials_variants",this.variantNames=[]}beforeParse(e){let t=new Set;for(let i of e)i.traverse(e=>{if(!sg(e))return;let i=e.userData.variantMaterials,s=e.userData.variantData;for(let[r,n]of s){let a=i.get(n.index);a&&sd(a.material)&&t.add(r)}});t.forEach(e=>this.variantNames.push(e))}writeMesh(e,t){if(!sg(e))return;let i=e.userData,s=i.variantMaterials,r=i.variantData,n=new Map,a=new Map,A=Array.from(r.values()).sort((e,t)=>e.index-t.index);for(let[o,l]of A.entries())a.set(l.index,o);for(let h of r.values()){let c=s.get(h.index);if(!c||!sd(c.material))continue;let u=this.writer.processMaterial(c.material);n.has(u)||n.set(u,{material:u,variants:[]}),n.get(u).variants.push(a.get(h.index))}let g=Array.from(n.values()).map(e=>e.variants.sort((e,t)=>e-t)&&e).sort((e,t)=>e.material-t.material);if(0===g.length)return;let d=sd(i.originalMaterial)?this.writer.processMaterial(i.originalMaterial):-1;for(let p of t.primitives)d>=0&&(p.material=d),p.extensions=p.extensions||{},p.extensions[this.name]={mappings:g}}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}}class sm{constructor(e,t,i,s,r){this.xrLight=e,this.renderer=t,this.lightProbe=i,this.xrWebGLBinding=null,this.estimationStartCallback=r,this.frameCallback=this.onXRFrame.bind(this);let n=t.xr.getSession();if(s&&"XRWebGLBinding"in window){let a=new el.oAp(16);e.environment=a.texture;let A=t.getContext();switch(n.preferredReflectionFormat){case"srgba8":A.getExtension("EXT_sRGB");break;case"rgba16f":A.getExtension("OES_texture_half_float")}this.xrWebGLBinding=new XRWebGLBinding(n,A),this.lightProbe.addEventListener("reflectionchange",()=>{this.updateReflection()})}n.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;let i=t.session;i.requestAnimationFrame(this.frameCallback);let s=t.getLightEstimate(this.lightProbe);if(s){this.xrLight.lightProbe.sh.fromArray(s.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;let r=Math.max(1,Math.max(s.primaryLightIntensity.x,Math.max(s.primaryLightIntensity.y,s.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(s.primaryLightIntensity.x/r,s.primaryLightIntensity.y/r,s.primaryLightIntensity.z/r),this.xrLight.directionalLight.intensity=r,this.xrLight.directionalLight.position.copy(s.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class sI extends el.ZAu{constructor(e,t=!0){super(),this.lightProbe=new el.lk7,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new el.Ox3,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let i=null,s=!1;e.xr.addEventListener("sessionstart",()=>{let r=e.xr.getSession();"requestLightProbe"in r&&r.requestLightProbe({reflectionFormat:r.preferredReflectionFormat}).then(r=>{i=new sm(this,e,r,t,()=>{s=!0,this.dispatchEvent({type:"estimationstart"})})})}),e.xr.addEventListener("sessionend",()=>{i&&(i.dispose(),i=null),s&&this.dispatchEvent({type:"estimationend"})}),this.dispose=()=>{i&&(i.dispose(),i=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}class sf{constructor(e=50){this.velocity=0,this.naturalFrequency=0,this.setDecayTime(e)}setDecayTime(e){this.naturalFrequency=1/Math.max(.001,e)}update(e,t,i,s){let r=2e-4*this.naturalFrequency;if(null==e||0===s||e===t&&0===this.velocity)return t;if(i<0)return e;let n=e-t,a=this.velocity+this.naturalFrequency*n,A=n+i*a,o=Math.exp(-this.naturalFrequency*i),l=(a-this.naturalFrequency*A)*o,h=-this.naturalFrequency*(l+a*o);return Math.abs(l)<r*Math.abs(s)&&h*n>=0?(this.velocity=0,t):(this.velocity=l,t+A*o)}}let sE=Math.PI/24,sC=new el.FM8,sB=(e,t,i)=>{let s=t>0?i>0?0:-Math.PI/2:i>0?Math.PI/2:Math.PI;for(let r=0;r<=12;++r)e.push(t+.17*Math.cos(s),i+.17*Math.sin(s),0,t+.2*Math.cos(s),i+.2*Math.sin(s),0),s+=sE};class sy extends el.Kj0{constructor(e,t){let i=new el.u9r,s=[],r=[],{size:n,boundingBox:a}=e,A=n.x/2,o=("back"===t?n.y:n.z)/2;sB(r,A,o),sB(r,-A,o),sB(r,-A,-o),sB(r,A,-o);let l=r.length/3;for(let h=0;h<l-2;h+=2)s.push(h,h+1,h+3,h,h+3,h+2);let c=l-2;s.push(c,c+1,1,c,1,0),i.setAttribute("position",new el.a$l(r,3)),i.setIndex(s),super(i),this.side=t;let u=this.material;switch(u.side=el.ehD,u.transparent=!0,u.opacity=0,this.goalOpacity=0,this.opacityDamper=new sf,this.hitPlane=new el.Kj0(new el._12(2*(A+.2),2*(o+.2))),this.hitPlane.visible=!1,this.hitPlane.material.side=el.ehD,this.add(this.hitPlane),a.getCenter(this.position),t){case"bottom":this.rotateX(-Math.PI/2),this.shadowHeight=a.min.y,this.position.y=this.shadowHeight;break;case"back":this.shadowHeight=a.min.z,this.position.z=this.shadowHeight}e.target.add(this),this.offsetHeight=0}getHit(e,t,i){sC.set(t,-i),this.hitPlane.visible=!0;let s=e.positionAndNormalFromPoint(sC,this.hitPlane);return this.hitPlane.visible=!1,null==s?null:s.position}getExpandedHit(e,t,i){this.hitPlane.scale.set(1e3,1e3,1e3),this.hitPlane.updateMatrixWorld();let s=this.getHit(e,t,i);return this.hitPlane.scale.set(1,1,1),s}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?.75:0}updateOpacity(e){let t=this.material;t.opacity=this.opacityDamper.update(t.opacity,this.goalOpacity,e,1),this.visible=t.opacity>0}dispose(){var e;let{geometry:t,material:i}=this.hitPlane;t.dispose(),i.dispose(),this.geometry.dispose(),this.material.dispose(),null===(e=this.parent)||void 0===e||e.remove(this)}}let sQ={NOT_PRESENTING:"not-presenting",SESSION_STARTED:"session-started",OBJECT_PLACED:"object-placed",FAILED:"failed"},sw={TRACKING:"tracking",NOT_TRACKING:"not-tracking"},sv=new el.Pa4,sS=new el.yGw,sb=new el.Pa4,sx=new el.cPb(45,1,.1,100);class sM extends el.pBf{constructor(e){super(),this.renderer=e,this.currentSession=null,this.placeOnWall=!1,this.placementBox=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.tracking=!0,this.frames=0,this.initialized=!1,this.oldTarget=new el.Pa4,this.placementComplete=!1,this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!1,this.lastDragPosition=new el.Pa4,this.firstRatio=0,this.lastAngle=0,this.goalPosition=new el.Pa4,this.goalYaw=0,this.goalScale=1,this.xDamper=new sf,this.yDamper=new sf,this.zDamper=new sf,this.yawDamper=new sf,this.scaleDamper=new sf,this.onExitWebXRButtonContainerClick=()=>this.stopPresenting(),this.onUpdateScene=()=>{null!=this.placementBox&&this.isPresenting&&(this.placementBox.dispose(),this.placementBox=new sy(this.presentedScene,this.placeOnWall?"back":"bottom"))},this.onSelectStart=e=>{let t=this.transientHitTestSource;if(null==t)return;let i=this.frame.getHitTestResultsForTransientInput(t),s=this.presentedScene,r=this.placementBox;if(1===i.length){this.inputSource=e.inputSource;let{axes:n}=this.inputSource.gamepad,a=r.getHit(this.presentedScene,n[0],n[1]);r.show=!0,null!=a?(this.isTranslating=!0,this.lastDragPosition.copy(a)):!1===this.placeOnWall&&(this.isRotating=!0,this.lastAngle=1.5*n[0])}else if(2===i.length){r.show=!0,this.isTwoFingering=!0;let{separation:A}=this.fingerPolar(i);this.firstRatio=A/s.scale.x}},this.onSelectEnd=()=>{this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!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(){tg();let e=await navigator.xr.requestSession("immersive-ar",{requiredFeatures:["hit-test"],optionalFeatures:["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 tg(),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 i=new Promise((e,t)=>{requestAnimationFrame(()=>e())});e.setHotspotsVisibility(!1),e.queueRender(),await i,this._presentedScene=e,this.overlay=e.element.shadowRoot.querySelector("div.default"),!0===t&&(this.xrLight=new sI(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 s=await this.resolveARSession();s.addEventListener("end",()=>{this.postSessionCleanup()},{once:!0});let r=e.element.shadowRoot.querySelector(".slot.exit-webxr-ar-button");r.classList.add("enabled"),r.addEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=r;let n=await s.requestReferenceSpace("viewer");this.tracking=!0,this.frames=0,this.initialized=!1,this.turntableRotation=e.yaw,this.goalYaw=e.yaw,this.goalScale=1,e.background=null,this.oldShadowIntensity=e.shadowIntensity,e.setShadowIntensity(.01),this.oldTarget.copy(e.getTarget()),e.element.addEventListener("load",this.onUpdateScene);let a=20*Math.PI/180,A=!0===this.placeOnWall?void 0:new XRRay(new DOMPoint(0,0,0),{x:0,y:-Math.sin(a),z:-Math.cos(a)});s.requestHitTestSource({space:n,offsetRay:A}).then(e=>{this.initialHitSource=e}),this.currentSession=s,this.placementBox=new sy(e,this.placeOnWall?"back":"bottom"),this.placementComplete=!1,this.lastTick=performance.now(),this.dispatchEvent({type:"status",status:sQ.SESSION_STARTED})}async stopPresenting(){if(!this.isPresenting)return;let e=new Promise(e=>{this.resolveCleanup=e});try{await this.currentSession.end(),await e}catch(t){console.warn("Error while trying to end WebXR AR session"),console.warn(t),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)}}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:i}=t;null!=this.xrLight&&(t.remove(this.xrLight),this.xrLight.dispose(),this.xrLight=null),t.position.set(0,0,0),t.scale.set(1,1,1),t.setShadowOffset(0);let s=this.turntableRotation;null!=s&&(t.yaw=s);let r=this.oldShadowIntensity;null!=r&&t.setShadowIntensity(r),t.setEnvironmentAndSkybox(i[tQ],i[tw]);let n=this.oldTarget;t.setTarget(n.x,n.y,n.z),t.xrCamera=null,t.element.removeEventListener("load",this.onUpdateScene),t.orientHotspots(0),i.requestUpdate("cameraTarget"),i.requestUpdate("maxCameraOrbit"),i[n7](i.getBoundingClientRect())}this.renderer.height=0;let a=this.exitWebXRButtonContainer;null!=a&&(a.classList.remove("enabled"),a.removeEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=null);let A=this.transientHitTestSource;null!=A&&(A.cancel(),this.transientHitTestSource=null);let o=this.initialHitSource;null!=o&&(o.cancel(),this.initialHitSource=null),null!=this.placementBox&&(this.placementBox.dispose(),this.placementBox=null),this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.inputSource=null,this.overlay=null,null!=this.resolveCleanup&&this.resolveCleanup(),this.dispatchEvent({type:"status",status:sQ.NOT_PRESENTING})}updateView(e){let t=this.presentedScene,i=this.threeRenderer.xr;i.updateCamera(sx),t.xrCamera=i.getCamera();let{elements:s}=t.getCamera().matrixWorld;if(t.orientHotspots(Math.atan2(s[1],s[5])),this.initialized||(this.placeInitially(),this.initialized=!0),e.requestViewportScale&&e.recommendedViewportScale){let r=e.recommendedViewportScale;e.requestViewportScale(Math.max(r,.25))}let n=this.currentSession.renderState.baseLayer,a=n.getViewport(e);this.threeRenderer.setViewport(a.x,a.y,a.width,a.height)}placeInitially(){let e=this.presentedScene,{position:t,element:i}=e,s=e.getCamera(),{width:r,height:n}=this.overlay.getBoundingClientRect();e.setSize(r,n),s.projectionMatrixInverse.copy(s.projectionMatrix).invert();let{theta:a,radius:A}=i.getCameraOrbit(),o=s.getWorldDirection(sv);e.yaw=Math.atan2(-o.x,-o.z)-a,this.goalYaw=e.yaw,t.copy(s.position).add(o.multiplyScalar(A)),this.updateTarget();let l=e.getTarget();t.add(l).sub(this.oldTarget),this.goalPosition.copy(t),e.setHotspotsVisibility(!0);let{session:h}=this.frame;h.addEventListener("selectstart",this.onSelectStart),h.addEventListener("selectend",this.onSelectEnd),h.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&&(sv.copy(t).sub(this.presentedScene.getCamera().position),sv.length()>10)?null:t}getHitPoint(e){let t=this.threeRenderer.xr.getReferenceSpace(),i=e.getPose(t);if(null==i)return null;let s=sS.fromArray(i.transform.matrix);return!0===this.placeOnWall&&(this.goalYaw=Math.atan2(s.elements[4],s.elements[6])),s.elements[5]>.75!==this.placeOnWall?sb.setFromMatrixPosition(s):null}moveToFloor(e){let t=this.initialHitSource;if(null==t)return;let i=e.getHitTestResults(t);if(0==i.length)return;let s=i[0],r=this.getHitPoint(s);null!=r&&(this.placementBox.show=!0,this.isTranslating||(this.placeOnWall?this.goalPosition.copy(r):this.goalPosition.y=r.y),t.cancel(),this.initialHitSource=null,this.dispatchEvent({type:"status",status:sQ.OBJECT_PLACED}))}fingerPolar(e){let t=e[0].inputSource.gamepad.axes,i=e[1].inputSource.gamepad.axes,s=i[0]-t[0],r=i[1]-t[1],n=Math.atan2(r,s),a=this.lastAngle-n;return a>Math.PI?a-=2*Math.PI:a<-Math.PI&&(a+=2*Math.PI),this.lastAngle=n,{separation:Math.sqrt(s*s+r*r),deltaYaw:a}}processInput(e){let t=this.transientHitTestSource;if(null==t||!this.isTranslating&&!this.isTwoFingering&&!this.isRotating)return;let i=e.getHitTestResultsForTransientInput(t),s=this.presentedScene,r=s.scale.x;if(this.isTwoFingering){if(i.length<2)this.isTwoFingering=!1;else{let{separation:n,deltaYaw:a}=this.fingerPolar(i);if(!1===this.placeOnWall&&(this.goalYaw+=a),s.canScale){let A=n/this.firstRatio;this.goalScale=A<1.3&&A>.7692307692307692?1:A}}return}if(2===i.length){this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!0;let{separation:o}=this.fingerPolar(i);this.firstRatio=o/r;return}if(this.isRotating){let l=1.5*this.inputSource.gamepad.axes[0];this.goalYaw+=l-this.lastAngle,this.lastAngle=l}else this.isTranslating&&i.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),!1===this.placeOnWall){let i=t.y-this.lastDragPosition.y;if(i<0){this.placementBox.offsetHeight=i/r,this.presentedScene.setShadowOffset(i);let n=sv.copy(s.getCamera().position),a=-i/(n.y-t.y);n.multiplyScalar(a),t.multiplyScalar(1-a).add(n)}}this.goalPosition.add(t),this.lastDragPosition.copy(t)}})}moveScene(e){let t=this.presentedScene,{position:i,yaw:s}=t,r=t.boundingSphere.radius,n=this.goalPosition,a=t.scale.x,A=this.placementBox;if(!n.equals(i)||this.goalScale!==a){let{x:o,y:l,z:h}=i;o=this.xDamper.update(o,n.x,e,r),l=this.yDamper.update(l,n.y,e,r),h=this.zDamper.update(h,n.z,e,r),i.set(o,l,h);let c=this.scaleDamper.update(a,this.goalScale,e,1);if(t.scale.set(c,c,c),!this.isTranslating){let u=n.y-l;this.placementComplete&&!1===this.placeOnWall?(A.offsetHeight=u/c,t.setShadowOffset(u)):0===u&&(this.placementComplete=!0,A.show=!1,t.setShadowIntensity(.8))}}A.updateOpacity(e),t.updateTarget(e),t.yaw=this.yawDamper.update(s,this.goalYaw,e,Math.PI)}onWebXRFrame(e,t){this.frame=t,++this.frames;let i=this.threeRenderer.xr.getReferenceSpace(),s=t.getViewerPose(i);null==s&&!0===this.tracking&&this.frames>30&&(this.tracking=!1,this.dispatchEvent({type:"tracking",status:sw.NOT_TRACKING}));let r=this.presentedScene;if(null==s||null==r||!r.element.loaded){this.threeRenderer.clear();return}!1===this.tracking&&(this.tracking=!0,this.dispatchEvent({type:"tracking",status:sw.TRACKING}));let n=!0;for(let a of s.views){if(this.updateView(a),n){this.moveToFloor(t),this.processInput(t);let A=e-this.lastTick;this.moveScene(A),this.renderer.preRender(r,e,A),this.lastTick=e,r.renderShadow(this.threeRenderer)}this.threeRenderer.render(r,r.getCamera()),n=!1}}}/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ class sR{constructor(e){e.threeRenderer.debug={checkShaderErrors:!0},Promise.resolve().then(()=>{self.dispatchEvent(new CustomEvent("model-viewer-renderer-debug",{detail:{renderer:e,THREE:{ShaderMaterial:el.jyz,Texture:el.xEZ,Mesh:el.Kj0,Scene:el.xsS,PlaneGeometry:el._12,OrthographicCamera:el.iKG,WebGLRenderTarget:el.dd2}}}))})}addScene(e){self.dispatchEvent(new CustomEvent("model-viewer-scene-added-debug",{detail:{scene:e}}))}removeScene(e){self.dispatchEvent(new CustomEvent("model-viewer-scene-removed-debug",{detail:{scene:e}}))}}/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let sD=Symbol("prepared"),sT=Symbol("prepare"),sL=Symbol("preparedGLTF"),sF=Symbol("clone");class sk{constructor(e){this[sL]=e}static prepare(e){if(null==e.scene)throw Error("Model does not have a scene");if(e[sD])return e;let t=this[sT](e);return t[sD]=!0,t}static[sT](e){let{scene:t}=e;return Object.assign(Object.assign({},e),{scene:t,scenes:[t]})}get parser(){return this[sL].parser}get animations(){return this[sL].animations}get scene(){return this[sL].scene}get scenes(){return this[sL].scenes}get cameras(){return this[sL].cameras}get asset(){return this[sL].asset}get userData(){return this[sL].userData}clone(){let e=this.constructor,t=this[sF]();return new e(t)}dispose(){this.scenes.forEach(e=>{e.traverse(e=>{if(!e.isMesh)return;let t=Array.isArray(e.material)?e.material:[e.material];t.forEach(e=>{for(let t in e){let i=e[t];if(i instanceof el.xEZ){let s=i.source.data;null!=s.close&&s.close(),i.dispose()}}e.dispose()}),e.geometry.dispose()})})}[sF](){let e=this[sL],t=function(e){let t=new Map,i=new Map,s=e.clone();return function e(t,i,s){s(t,i);for(let r=0;r<t.children.length;r++)e(t.children[r],i.children[r],s)}(e,s,function(e,s){t.set(s,e),i.set(e,s)}),s.traverse(function(e){if(!e.isSkinnedMesh)return;let s=e,r=t.get(e),n=r.skeleton.bones;s.skeleton=r.skeleton.clone(),s.bindMatrix.copy(r.bindMatrix),s.skeleton.bones=n.map(function(e){return i.get(e)}),s.bind(s.skeleton,s.bindMatrix)}),s}(this.scene);s_(t,this.scene);let i=e.userData?Object.assign({},e.userData):{};return Object.assign(Object.assign({},e),{scene:t,scenes:[t],userData:i})}}let s_=(e,t)=>{sU(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)})},sU=(e,t,i)=>{i(e,t);for(let s=0;s<e.children.length;s++)sU(e.children[s],t.children[s],i)},sN=Symbol("threeGLTF"),sG=Symbol("gltf"),sP=Symbol("gltfElementMap"),sO=Symbol("threeObjectMap"),sH=Symbol("parallelTraverseThreeScene"),sq=Symbol("correlateOriginalThreeGLTF"),sK=Symbol("correlateCloneThreeGLTF");class sV{constructor(e,t,i,s){this[sN]=e,this[sG]=t,this[sP]=s,this[sO]=i}static from(e,t){return null!=t?this[sK](e,t):this[sq](e)}static[sq](e){let t=e.parser.json,i=e.parser.associations,s=new Map,r={name:"Default"},n={type:"materials",index:-1};for(let a of i.keys())a instanceof el.F5T&&null==i.get(a)&&(n.index<0&&(null==t.materials&&(t.materials=[]),n.index=t.materials.length,t.materials.push(r)),a.name=r.name,i.set(a,{materials:n.index}));for(let[A,o]of i){if(o){let l=A;l.userData=l.userData||{},l.userData.associations=o}for(let h in o)if(null!=h&&"primitives"!==h){let c=h,u=t[c]||[],g=u[o[c]];if(null==g)continue;let d=s.get(g);null==d&&(d=new Set,s.set(g,d)),d.add(A)}}return new sV(e,t,i,s)}static[sK](e,t){let i=t.threeGLTF,s=t.gltf,r=JSON.parse(JSON.stringify(s)),n=new Map,a=new Map;for(let A=0;A<i.scenes.length;A++)this[sH](i.scenes[A],e.scenes[A],(e,i)=>{let s=t.threeObjectMap.get(e);if(null!=s){for(let A in s)if(null!=A&&"primitives"!==A){let o=A,l=s[o],h=r[o][l],c=n.get(i)||{};c[o]=l,n.set(i,c);let u=a.get(h)||new Set;u.add(i),a.set(h,u)}}});return new sV(e,r,n,a)}static[sH](e,t,i){let s=e=>e.isMesh,r=(e,t)=>{if(i(e,t),e.isObject3D){if(s(e)){if(Array.isArray(e.material))for(let n=0;n<e.material.length;++n)r(e.material[n],t.material[n]);else r(e.material,t.material)}for(let a=0;a<e.children.length;++a)r(e.children[a],t.children[a])}};r(e,t)}get threeGLTF(){return this[sN]}get gltf(){return this[sG]}get gltfElementMap(){return this[sP]}get threeObjectMap(){return this[sO]}}/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let sJ=Symbol("correlatedSceneGraph");class sY extends sk{static[sT](e){let t=super[sT](e);null==t[sJ]&&(t[sJ]=sV.from(t));let{scene:i}=t,s=new el.aLr(void 0,1/0);return i.traverse(e=>{e.renderOrder=1e3,e.frustumCulled=!1,e.name||(e.name=e.uuid);let i=e;if(i.isMesh){let{geometry:r}=i;i.castShadow=!0,i.isSkinnedMesh&&(r.boundingSphere=s,r.boundingBox=null);let n=i.material;if(!0===n.isMeshBasicMaterial&&(n.toneMapped=!1),n.shadowSide=el.Wl3,n.aoMap){let{gltf:a,threeObjectMap:A}=t[sJ],o=A.get(n);if(null!=a.materials&&null!=o&&null!=o.materials){let l=a.materials[o.materials];l.occlusionTexture&&0===l.occlusionTexture.texCoord&&null!=r.attributes.uv&&r.setAttribute("uv2",r.attributes.uv)}}}}),t}get correlatedSceneGraph(){return this[sL][sJ]}[sF](){let e=super[sF](),t=new Map;return e.scene.traverse(e=>{if(e.isMesh){let i=e,s=i.material;if(null!=s){if(t.has(s.uuid)){i.material=t.get(s.uuid);return}i.material=s.clone(),t.set(s.uuid,i.material)}}}),e[sJ]=sV.from(e,this.correlatedSceneGraph),e}}class sj extends el.yxD{constructor(e){super(e),this.type=el.cLu}parse(e){let t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:console.error("THREE.RGBELoader: Error: "+(t||""))}return -1},i=function(e,t,i){t=t||1024;let s=e.pos,r=-1,n=0,a="",A=String.fromCharCode.apply(null,new Uint16Array(e.subarray(s,s+128)));for(;0>(r=A.indexOf("\n"))&&n<t&&s<e.byteLength;)a+=A,n+=A.length,s+=128,A+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(s,s+128)));return -1<r&&(!1!==i&&(e.pos+=n+r+1),a+A.slice(0,r))},s=new Uint8Array(e);s.pos=0;let r=function(e){let s,r;let n=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,A=/^\s*FORMAT=(\S+)\s*$/,o=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,l={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};if(e.pos>=e.byteLength||!(s=i(e)))return t(1,"no header found");if(!(r=s.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(l.valid|=1,l.programtype=r[1],l.string+=s+"\n";!1!==(s=i(e));){if(l.string+=s+"\n","#"===s.charAt(0)){l.comments+=s+"\n";continue}if((r=s.match(n))&&(l.gamma=parseFloat(r[1])),(r=s.match(a))&&(l.exposure=parseFloat(r[1])),(r=s.match(A))&&(l.valid|=2,l.format=r[1]),(r=s.match(o))&&(l.valid|=4,l.height=parseInt(r[1],10),l.width=parseInt(r[2],10)),2&l.valid&&4&l.valid)break}return 2&l.valid?4&l.valid?l:t(3,"missing image size specifier"):t(3,"missing format specifier")}(s);if(-1!==r){let n=r.width,a=r.height,A=function(e,i,s){if(i<8||i>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(i!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");let r=new Uint8Array(4*i*s);if(!r.length)return t(4,"unable to allocate buffer space");let n=0,a=0,A=4*i,o=new Uint8Array(4),l=new Uint8Array(A),h=s;for(;h>0&&a<e.byteLength;){if(a+4>e.byteLength)return t(1);if(o[0]=e[a++],o[1]=e[a++],o[2]=e[a++],o[3]=e[a++],2!=o[0]||2!=o[1]||(o[2]<<8|o[3])!=i)return t(3,"bad rgbe scanline format");let c=0,u;for(;c<A&&a<e.byteLength;){u=e[a++];let g=u>128;if(g&&(u-=128),0===u||c+u>A)return t(3,"bad scanline data");if(g){let d=e[a++];for(let p=0;p<u;p++)l[c++]=d}else l.set(e.subarray(a,a+u),c),c+=u,a+=u}for(let m=0;m<i;m++){let I=0;r[n]=l[m+I],I+=i,r[n+1]=l[m+I],I+=i,r[n+2]=l[m+I],I+=i,r[n+3]=l[m+I],n+=4}h--}return r}(s.subarray(s.pos),n,a);if(-1!==A){let o,l,h;switch(this.type){case el.VzW:h=A.length/4;let c=new Float32Array(4*h);for(let u=0;u<h;u++)!function(e,t,i,s){let r=e[t+3],n=Math.pow(2,r-128)/255;i[s+0]=e[t+0]*n,i[s+1]=e[t+1]*n,i[s+2]=e[t+2]*n,i[s+3]=1}(A,4*u,c,4*u);o=c,l=el.VzW;break;case el.cLu:h=A.length/4;let g=new Uint16Array(4*h);for(let d=0;d<h;d++)!function(e,t,i,s){let r=e[t+3],n=Math.pow(2,r-128)/255;i[s+0]=el.A5E.toHalfFloat(Math.min(e[t+0]*n,65504)),i[s+1]=el.A5E.toHalfFloat(Math.min(e[t+1]*n,65504)),i[s+2]=el.A5E.toHalfFloat(Math.min(e[t+2]*n,65504)),i[s+3]=el.A5E.toHalfFloat(1)}(A,4*d,g,4*d);o=g,l=el.cLu;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:n,height:a,data:o,header:r.string,gamma:r.gamma,exposure:r.exposure,type:l}}}return null}setDataType(e){return this.type=e,this}load(e,t,i,s){return super.load(e,function(e,i){switch(e.type){case el.VzW:case el.cLu:e.encoding=el.rnI,e.minFilter=el.wem,e.magFilter=el.wem,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,i)},i,s)}}/* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ class sz extends el.xsS{constructor(){super(),this.position.y=-3.5;let e=new el.DvJ;e.deleteAttribute("uv");let t=new el.Wid({metalness:0,side:el._Li}),i=new el.Wid({metalness:0}),s=new el.cek(16777215,500,28,2);s.position.set(.418,16.199,.3),this.add(s);let r=new el.Kj0(e,t);r.position.set(-.757,13.219,.717),r.scale.set(31.713,28.305,28.591),this.add(r);let n=new el.Kj0(e,i);n.position.set(-10.906,2.009,1.846),n.rotation.set(0,-.195,0),n.scale.set(2.328,7.905,4.651),this.add(n);let a=new el.Kj0(e,i);a.position.set(-5.607,-.754,-.758),a.rotation.set(0,.994,0),a.scale.set(1.97,1.534,3.955),this.add(a);let A=new el.Kj0(e,i);A.position.set(6.167,.857,7.803),A.rotation.set(0,.561,0),A.scale.set(3.927,6.285,3.687),this.add(A);let o=new el.Kj0(e,i);o.position.set(-2.017,.018,6.124),o.rotation.set(0,.333,0),o.scale.set(2.002,4.566,2.064),this.add(o);let l=new el.Kj0(e,i);l.position.set(2.291,-.756,-2.621),l.rotation.set(0,-.286,0),l.scale.set(1.546,1.552,1.496),this.add(l);let h=new el.Kj0(e,i);h.position.set(-2.193,-.369,-5.547),h.rotation.set(0,.516,0),h.scale.set(3.875,3.487,2.986),this.add(h);let c=new el.Kj0(e,this.createAreaLightMaterial(50));c.position.set(-16.116,14.37,8.208),c.scale.set(.1,2.428,2.739),this.add(c);let u=new el.Kj0(e,this.createAreaLightMaterial(50));u.position.set(-16.109,18.021,-8.207),u.scale.set(.1,2.425,2.751),this.add(u);let g=new el.Kj0(e,this.createAreaLightMaterial(17));g.position.set(14.904,12.198,-1.832),g.scale.set(.15,4.265,6.331),this.add(g);let d=new el.Kj0(e,this.createAreaLightMaterial(43));d.position.set(-.462,8.89,14.52),d.scale.set(4.38,5.441,.088),this.add(d);let p=new el.Kj0(e,this.createAreaLightMaterial(20));p.position.set(3.235,11.486,-12.541),p.scale.set(2.5,2,.1),this.add(p);let m=new el.Kj0(e,this.createAreaLightMaterial(100));m.position.set(0,20,0),m.scale.set(1,.1,1),this.add(m)}createAreaLightMaterial(e){let t=new el.vBJ;return t.color.setScalar(e),t}}/* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ class s$ extends el.xsS{constructor(){super(),this.position.y=-3.5;let e=new el.DvJ;e.deleteAttribute("uv");let t=new el.Wid({metalness:0,side:el._Li}),i=new el.Wid({metalness:0}),s=new el.cek(16777215,400,28,2);s.position.set(.5,14,.5),this.add(s);let r=new el.Kj0(e,t);r.position.set(0,13.2,0),r.scale.set(31.5,28.5,31.5),this.add(r);let n=new el.Kj0(e,i);n.position.set(-10.906,-1,1.846),n.rotation.set(0,-.195,0),n.scale.set(2.328,7.905,4.651),this.add(n);let a=new el.Kj0(e,i);a.position.set(-5.607,-.754,-.758),a.rotation.set(0,.994,0),a.scale.set(1.97,1.534,3.955),this.add(a);let A=new el.Kj0(e,i);A.position.set(6.167,-.16,7.803),A.rotation.set(0,.561,0),A.scale.set(3.927,6.285,3.687),this.add(A);let o=new el.Kj0(e,i);o.position.set(-2.017,.018,6.124),o.rotation.set(0,.333,0),o.scale.set(2.002,4.566,2.064),this.add(o);let l=new el.Kj0(e,i);l.position.set(2.291,-.756,-2.621),l.rotation.set(0,-.286,0),l.scale.set(1.546,1.552,1.496),this.add(l);let h=new el.Kj0(e,i);h.position.set(-2.193,-.369,-5.547),h.rotation.set(0,.516,0),h.scale.set(3.875,3.487,2.986),this.add(h);let c=new el.Kj0(e,this.createAreaLightMaterial(80));c.position.set(-14,10,8),c.scale.set(.1,2.5,2.5),this.add(c);let u=new el.Kj0(e,this.createAreaLightMaterial(80));u.position.set(-14,14,-4),u.scale.set(.1,2.5,2.5),this.add(u);let g=new el.Kj0(e,this.createAreaLightMaterial(23));g.position.set(14,12,0),g.scale.set(.1,5,5),this.add(g);let d=new el.Kj0(e,this.createAreaLightMaterial(16));d.position.set(0,9,14),d.scale.set(5,5,.1),this.add(d);let p=new el.Kj0(e,this.createAreaLightMaterial(80));p.position.set(7,8,-14),p.scale.set(2.5,2.5,.1),this.add(p);let m=new el.Kj0(e,this.createAreaLightMaterial(80));m.position.set(-7,16,-14),m.scale.set(2.5,2.5,.1),this.add(m);let I=new el.Kj0(e,this.createAreaLightMaterial(1));I.position.set(0,20,0),I.scale.set(.1,.1,.1),this.add(I)}createAreaLightMaterial(e){let t=new el.vBJ;return t.color.setScalar(e),t}}let sW=/\.hdr(\.js)?$/,sX=new el.dpR,sZ=new sj;sZ.setDataType(el.cLu);class s0 extends el.pBf{constructor(e){super(),this.threeRenderer=e,this.generatedEnvironmentMap=null,this.generatedEnvironmentMapAlt=null,this.skyboxCache=new Map,this.blurMaterial=null,this.blurScene=null}async load(e,t=()=>{}){try{let i=sW.test(e),s=i?sZ:sX,r=await new Promise((i,r)=>s.load(e,i,e=>{t(e.loaded/e.total*.9)},r));return t(1),r.name=e,r.mapping=el.dSO,i||(r.encoding=el.knz),r}finally{t&&t(1)}}async generateEnvironmentMapAndSkybox(e=null,t=null,i=()=>{}){let s;let r="legacy"!==t;("legacy"===t||"neutral"===t)&&(t=null),t=tu(t);let n=Promise.resolve(null);e&&(n=this.loadEquirectFromUrl(e,i)),s=t?this.loadEquirectFromUrl(t,i):e?this.loadEquirectFromUrl(e,i):r?this.loadGeneratedEnvironmentMapAlt():this.loadGeneratedEnvironmentMap();let[a,A]=await Promise.all([s,n]);if(null==a)throw Error("Failed to load environment map.");return{environmentMap:a,skybox:A}}async loadEquirectFromUrl(e,t){if(!this.skyboxCache.has(e)){let i=this.load(e,t);this.skyboxCache.set(e,i)}return this.skyboxCache.get(e)}async GenerateEnvironmentMap(e,t){await tC();let i=this.threeRenderer,s=new el.oAp(256,{generateMipmaps:!1,type:el.cLu,format:el.wk1,encoding:el.rnI,depthBuffer:!0}),r=new el._am(.1,100,s),n=r.renderTarget.texture;n.name=t;let a=i.outputEncoding,A=i.toneMapping;return i.toneMapping=el.uL9,i.outputEncoding=el.rnI,r.update(i,e),this.blurCubemap(s,.04),i.toneMapping=A,i.outputEncoding=a,n}async loadGeneratedEnvironmentMap(){return null==this.generatedEnvironmentMap&&(this.generatedEnvironmentMap=this.GenerateEnvironmentMap(new sz,"legacy")),this.generatedEnvironmentMap}async loadGeneratedEnvironmentMapAlt(){return null==this.generatedEnvironmentMapAlt&&(this.generatedEnvironmentMapAlt=this.GenerateEnvironmentMap(new s$,"neutral")),this.generatedEnvironmentMapAlt}blurCubemap(e,t){if(null==this.blurMaterial){this.blurMaterial=this.getBlurShader(20);let i=new el.DvJ,s=new el.Kj0(i,this.blurMaterial);this.blurScene=new el.xsS,this.blurScene.add(s)}let r=e.clone();this.halfblur(e,r,t,"latitudinal"),this.halfblur(r,e,t,"longitudinal")}halfblur(e,t,i,s){let r=e.width,n=isFinite(i)?Math.PI/(2*r):2*Math.PI/39,a=i/n,A=isFinite(i)?1+Math.floor(3*a):20;A>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${A} samples when the maximum is set to 20`);let o=[],l=0;for(let h=0;h<20;++h){let c=h/a,u=Math.exp(-c*c/2);o.push(u),0==h?l+=u:h<A&&(l+=2*u)}for(let g=0;g<o.length;g++)o[g]=o[g]/l;let d=this.blurMaterial.uniforms;d.envMap.value=e.texture,d.samples.value=A,d.weights.value=o,d.latitudinal.value="latitudinal"===s,d.dTheta.value=n;let p=new el._am(.1,100,t);p.update(this.threeRenderer,this.blurScene)}getBlurShader(e){let t=new Float32Array(e),i=new el.Pa4(0,1,0),s=new el.jyz({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},poleAxis:{value:i}},vertexShader:`
varying vec3 vOutputDirection;
void main() {
vOutputDirection = vec3( position );
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
`,fragmentShader:`
varying vec3 vOutputDirection;
uniform samplerCube envMap;
uniform int samples;
uniform float weights[ n ];
uniform bool latitudinal;
uniform float dTheta;
uniform vec3 poleAxis;
vec3 getSample( float theta, vec3 axis ) {
float cosTheta = cos( theta );
// Rodrigues' axis-angle rotation
vec3 sampleDirection = vOutputDirection * cosTheta
+ cross( axis, vOutputDirection ) * sin( theta )
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
return vec3( textureCube( envMap, sampleDirection ) );
}
void main() {
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
}
axis = normalize( axis );
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
for ( int i = 1; i < n; i++ ) {
if ( i >= samples ) {
break;
}
float theta = dTheta * float( i );
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
}
}
`,blending:el.jFi,depthTest:!1,depthWrite:!1,side:el._Li});return s}async dispose(){for(let[,e]of this.skyboxCache){let t=await e;t.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 s1=[1,.79,.62,.5,.4,.31,.25],s2="high-performance";class s3 extends el.pBf{constructor(e){super(),this.loader=new iX(sY),this.width=0,this.height=0,this.dpr=1,this.debugger=null,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)||void 0===e||e.dispose(),this.textureUtils=new s0(this.threeRenderer),this.scenes))t.element[tv]()},this.dpr=tf(),this.canvas3D=document.createElement("canvas"),this.canvas3D.id="webgl-canvas",this.canvas3D.classList.add("show");try{this.threeRenderer=new el.CP7({canvas:this.canvas3D,alpha:!0,antialias:!0,powerPreference:e.powerPreference,preserveDrawingBuffer:!0}),this.threeRenderer.autoClear=!0,this.threeRenderer.outputEncoding=el.knz,this.threeRenderer.physicallyCorrectLights=!0,this.threeRenderer.setPixelRatio(1),this.debugger=e.debug?new sR(this):null,this.threeRenderer.debug={checkShaderErrors:!!this.debugger},this.threeRenderer.toneMapping=el.LY2}catch(t){console.warn(t)}this.arRenderer=new sM(this),this.textureUtils=this.canRender?new s0(this.threeRenderer):null,iX.initializeKTX2Loader(this.threeRenderer),this.canvas3D.addEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.addEventListener("webglcontextrestored",this.onWebGLContextRestored),this.updateRendererSize()}static get singleton(){return this._singleton}static resetSingleton(){let e=this._singleton.dispose();for(let t of e)t.disconnectedCallback();for(let i of(this._singleton=new s3({powerPreference:(self.ModelViewerElement||{}).powerPreference||s2,debug:tE()}),e))i.connectedCallback()}get canRender(){return null!=this.threeRenderer}get scaleFactor(){return s1[this.scaleStep]}set minScale(e){let t=1;for(;t<s1.length&&!(s1[t]<e);)++t;this.lastStep=t-1}registerScene(e){this.scenes.add(e),e.forceRescale();let t=new el.FM8;this.threeRenderer.getSize(t),e.canvas.width=t.x,e.canvas.height=t.y,this.canRender&&this.scenes.size>0&&this.threeRenderer.setAnimationLoop((e,t)=>this.render(e,t)),null!=this.debugger&&this.debugger.addScene(e)}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),null!=this.debugger&&this.debugger.removeScene(e)}displayCanvas(e){return this.multipleScenesVisible?e.element[n4]:this.canvas3D}countVisibleScenes(){let{canvas3D:e}=this,t=0,i=null;for(let s of this.scenes){let{element:r}=s;r.modelIsVisible&&null==s.externalRenderer&&++t,e.parentElement===s.canvas.parentElement&&(i=s)}let n=t>1;if(null!=i){let a=n&&!this.multipleScenesVisible,A=!i.element.modelIsVisible;if(a||A){let{width:o,height:l}=this.sceneSize(i);this.copyPixels(i,o,l),e.parentElement.removeChild(e)}}this.multipleScenesVisible=n}updateRendererSize(){let e=tf();if(e!==this.dpr)for(let t of this.scenes){let{element:i}=t;i[nV](i.getBoundingClientRect())}let s=0,r=0;for(let n of this.scenes)s=Math.max(s,n.width),r=Math.max(r,n.height);if(s!==this.width||r!==this.height||e!==this.dpr)for(let a of(this.width=s,this.height=r,this.dpr=e,s=Math.ceil(s*e),r=Math.ceil(r*e),this.canRender&&this.threeRenderer.setSize(s,r,!1),this.scenes)){let{canvas:A}=a;A.width=s,A.height=r,a.forceRescale()}}updateRendererScale(e){let t=this.scaleStep;this.avgFrameDuration+=tI(.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=s1[e.scaleStep],i=Math.ceil(this.width/t),s=Math.ceil(this.height/t),{style:r}=e.canvas;r.width=`${i}px`,r.height=`${s}px`,this.canvas3D.style.width=`${i}px`,this.canvas3D.style.height=`${s}px`;let n=this.dpr*t,a=t<1?"GPU throttling":this.dpr!==window.devicePixelRatio?"No meta viewport tag":"";e.element.dispatchEvent(new CustomEvent("render-scale",{detail:{reportedDpr:window.devicePixelRatio,renderedDpr:n,minimumDpr:this.dpr*s1[this.lastStep],pixelWidth:Math.ceil(e.width*n),pixelHeight:Math.ceil(e.height*n),reason:a}}))}sceneSize(e){let{dpr:t}=this,i=s1[e.scaleStep],s=Math.min(Math.ceil(e.width*i*t),this.canvas3D.width),r=Math.min(Math.ceil(e.height*i*t),this.canvas3D.height);return{width:s,height:r}}copyPixels(e,t,i){let s=e.context;if(null==s){console.log("could not acquire 2d context");return}s.clearRect(0,0,t,i),s.drawImage(this.canvas3D,0,0,t,i,0,0,t,i),e.canvas.classList.add("show")}orderedScenes(){let e=[];for(let t of[!1,!0])for(let i of this.scenes)i.element.modelIsVisible===t&&e.push(i);return e}get isPresenting(){return this.arRenderer.isPresenting}preRender(e,t,i){let{element:s,exposure:r}=e;s[n6](t,i);let n="number"==typeof r&&!Number.isNaN(r);this.threeRenderer.toneMappingExposure=n?r:1}render(e,t){if(null!=t){this.arRenderer.onWebXRFrame(e,t);return}let i=e-this.lastTick;if(this.lastTick=e,!this.canRender||this.isPresenting)return;this.countVisibleScenes(),this.updateRendererSize(),this.renderedLastFrame&&(this.updateRendererScale(i),this.renderedLastFrame=!1);let{canvas3D:s}=this;for(let r of this.orderedScenes()){let{element:n}=r;if(!n.loaded||!n.modelIsVisible&&r.renderCount>0||(this.preRender(r,e,i),!this.shouldRender(r)))continue;if(null!=r.externalRenderer){let a=r.getCamera();a.updateMatrix();let{matrix:A,projectionMatrix:o}=a,l=A.elements.slice(),h=r.getTarget();l[12]+=h.x,l[13]+=h.y,l[14]+=h.z,r.externalRenderer.render({viewMatrix:l,projectionMatrix:o.elements});continue}if(!n.modelIsVisible&&!this.multipleScenesVisible)for(let c of this.scenes)c.element.modelIsVisible&&c.queueRender();let{width:u,height:g}=this.sceneSize(r);r.renderShadow(this.threeRenderer),this.threeRenderer.setRenderTarget(null),this.threeRenderer.setViewport(0,Math.ceil(this.height*this.dpr)-g,u,g),this.threeRenderer.render(r,r.camera),this.multipleScenesVisible||0===r.renderCount?this.copyPixels(r,u,g):s.parentElement!==r.canvas.parentElement&&(r.canvas.parentElement.appendChild(s),r.canvas.classList.remove("show")),r.hasRendered(),++r.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}}s3._singleton=new s3({powerPreference:(self.ModelViewerElement||{}).powerPreference||s2,debug:tE()});/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let s4=Symbol("correlatedObjects"),s8=Symbol("sourceObject"),s5=Symbol("onUpdate");class s6{constructor(e,t,i=null){this[s5]=e,this[s8]=t,this[s4]=i}}/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let s9=new el.vBJ,s7=new el._12(2,2),re=0,rt=Symbol("threeTexture");Symbol("applyTexture");class ri extends s6{get[rt](){var e;return console.assert(null!=this[s4]&&this[s4].size>0,"Image correlated object is undefined"),null===(e=this[s4])||void 0===e?void 0:e.values().next().value}constructor(e,t,i){super(e,i=null!=i?i:{name:t&&t.image&&t.image.src?t.image.src.split("/").pop():"adhoc_image",uri:t&&t.image&&t.image.src?t.image.src:"adhoc_image"+re++},new Set(t?[t]:[]))}get name(){return this[s8].name||""}get uri(){return this[s8].uri}get bufferView(){return this[s8].bufferView}get type(){return null!=this.uri?"external":"embedded"}set name(e){this[s8].name=e}async createThumbnail(e,t){let i=new el.xsS;s9.map=this[rt];let s=new el.Kj0(s7,s9);i.add(s);let r=new el.iKG(-1,1,1,-1,0,1),{threeRenderer:n}=s3.singleton,a=new el.dd2(e,t);n.setRenderTarget(a),n.render(i,r),n.setRenderTarget(null);let A=new Uint8Array(e*t*4);n.readRenderTargetPixels(a,0,0,e,t,A),nk.width=e,nk.height=t;let o=nk.getContext("2d"),l=o.createImageData(e,t);return l.data.set(A),o.putImageData(l,0,0),new Promise(async(e,t)=>{nk.toBlob(i=>{if(!i)return t("Failed to capture thumbnail.");e(URL.createObjectURL(i))},"image/png")})}}(g=S||(S={}))[g.Nearest=9728]="Nearest",g[g.Linear=9729]="Linear",g[g.NearestMipmapNearest=9984]="NearestMipmapNearest",g[g.LinearMipmapNearest=9985]="LinearMipmapNearest",g[g.NearestMipmapLinear=9986]="NearestMipmapLinear",g[g.LinearMipmapLinear=9987]="LinearMipmapLinear",(d=b||(b={}))[d.ClampToEdge=33071]="ClampToEdge",d[d.MirroredRepeat=33648]="MirroredRepeat",d[d.Repeat=10497]="Repeat";/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let rs=(()=>{let e=[S.Nearest,S.Linear,S.NearestMipmapNearest,S.LinearMipmapLinear,S.NearestMipmapLinear,S.LinearMipmapLinear];return t=>e.indexOf(t)>-1})(),rr=(()=>{let e=[S.Nearest,S.Linear];return t=>e.indexOf(t)>-1})(),rn=(()=>{let e=[b.ClampToEdge,b.MirroredRepeat,b.Repeat];return t=>e.indexOf(t)>-1})(),ra=(e,t)=>{switch(e){case"minFilter":return rs(t);case"magFilter":return rr(t);case"wrapS":case"wrapT":return rn(t);default:throw Error(`Cannot configure property "${e}" on Sampler`)}},rA=Symbol("threeTextures"),ro=Symbol("setProperty"),rl=Symbol("sourceSampler");class rh extends s6{get[rA](){return console.assert(null!=this[s4]&&this[s4].size>0,"Sampler correlated object is undefined"),this[s4]}get[rl](){return console.assert(null!=this[s8],"Sampler source is undefined"),this[s8]}constructor(e,t,i){null==(i=null!=i?i:{}).minFilter&&(i.minFilter=t?t.minFilter:S.LinearMipmapLinear),null==i.magFilter&&(i.magFilter=t?t.magFilter:S.Linear),null==i.wrapS&&(i.wrapS=t?t.wrapS:b.Repeat),null==i.wrapT&&(i.wrapT=t?t.wrapT:b.Repeat),super(e,i,new Set(t?[t]:[]))}get name(){return this[s8].name||""}get minFilter(){return this[rl].minFilter}get magFilter(){return this[rl].magFilter}get wrapS(){return this[rl].wrapS}get wrapT(){return this[rl].wrapT}setMinFilter(e){this[ro]("minFilter",e)}setMagFilter(e){this[ro]("magFilter",e)}setWrapS(e){this[ro]("wrapS",e)}setWrapT(e){this[ro]("wrapT",e)}[ro](e,t){let i=this[rl];if(null!=i){if(ra(e,t))for(let s of(i[e]=t,this[rA]))s[e]=t,s.needsUpdate=!0;this[s5]()}}}/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let rc=Symbol("image"),ru=Symbol("sampler");class rg extends s6{constructor(e,t,i=null,s=null,r=null){super(e,i||{},new Set(t?[t]:[])),this[ru]=new rh(e,t,s),this[rc]=new ri(e,t,r)}get name(){return this[s8].name||""}set name(e){this[s8].name=e}get sampler(){return this[ru]}get source(){return this[rc]}}let rd=Symbol("texture"),rp=Symbol("transform"),rm=Symbol("materials"),rI=Symbol("usage");(p=R||(R={}))[p.Base=0]="Base",p[p.MetallicRoughness=1]="MetallicRoughness",p[p.Normal=2]="Normal",p[p.Occlusion=3]="Occlusion",p[p.Emissive=4]="Emissive";class rf{constructor(e,t,i,s,r,n){if(this[x]=null,this[M]={rotation:0,scale:new el.FM8(1,1),offset:new el.FM8(0,0)},n&&i){let a=r.textures?r.textures[n.index]:null,A=a&&r.samplers?r.samplers[a.sampler]:null,o=a&&r.images?r.images[a.source]:null;this[rp].rotation=i.rotation,this[rp].scale.copy(i.repeat),this[rp].offset.copy(i.offset),this[rd]=new rg(e,i,a,A,o)}this.onUpdate=e,this[rm]=s,this[rI]=t}get texture(){return this[rd]}setTexture(e){let t=null!=e?e.source[rt]:null,i=el.knz;if(this[rd]=e,this[rm])for(let s of this[rm]){switch(this[rI]){case R.Base:s.map=t;break;case R.MetallicRoughness:i=el.rnI,s.metalnessMap=t,s.roughnessMap=t;break;case R.Normal:i=el.rnI,s.normalMap=t;break;case R.Occlusion:i=el.rnI,s.aoMap=t;break;case R.Emissive:s.emissiveMap=t}s.needsUpdate=!0}t&&(t.encoding=i,t.rotation=this[rp].rotation,t.repeat=this[rp].scale,t.offset=this[rp].offset),this.onUpdate()}}x=rd,M=rp;/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let rE=Symbol("threeMaterials"),rC=Symbol("baseColorTexture"),rB=Symbol("metallicRoughnessTexture");class ry extends s6{constructor(e,t,i,s){super(e,i,s),null==i.baseColorFactor&&(i.baseColorFactor=[1,1,1,1]),null==i.roughnessFactor&&(i.roughnessFactor=1),null==i.metallicFactor&&(i.metallicFactor=1);let{baseColorTexture:r,metallicRoughnessTexture:n}=i,{map:a,metalnessMap:A}=s.values().next().value;this[rC]=new rf(e,R.Base,a,s,t,r||null),this[rB]=new rf(e,R.MetallicRoughness,A,s,t,n||null)}get[rE](){return this[s4]}get baseColorFactor(){return this[s8].baseColorFactor}get metallicFactor(){return this[s8].metallicFactor}get roughnessFactor(){return this[s8].roughnessFactor}get baseColorTexture(){return this[rC]}get metallicRoughnessTexture(){return this[rB]}setBaseColorFactor(e){let t=new el.Ilk;for(let i of(e instanceof Array?t.fromArray(e):t.set(e).convertSRGBToLinear(),this[rE]))i.color.set(t),e instanceof Array?i.opacity=e[3]:(e=[0,0,0,i.opacity],t.toArray(e));let s=this[s8];s.baseColorFactor=e,this[s5]()}setMetallicFactor(e){for(let t of this[rE])t.metalness=e;let i=this[s8];i.metallicFactor=e,this[s5]()}setRoughnessFactor(e){for(let t of this[rE])t.roughness=e;let i=this[s8];i.roughnessFactor=e,this[s5]()}}let rQ=Symbol("pbrMetallicRoughness"),rw=Symbol("normalTexture"),rv=Symbol("occlusionTexture"),rS=Symbol("emissiveTexture"),rb=Symbol("backingThreeMaterial"),rx=Symbol("applyAlphaCutoff"),rM=Symbol("lazyLoadGLTFInfo"),rR=Symbol("initialize"),rD=Symbol("getLoadedMaterial"),rT=Symbol("ensureMaterialIsLoaded"),rL=Symbol("gltfIndex"),rF=Symbol("setActive"),rk=Symbol("variantIndices"),r_=Symbol("isActive"),rU=Symbol("variantSet"),rN=Symbol("modelVariants");class rG extends s6{constructor(e,t,i,s,r,n,a,A){super(e,i,a),this[D]=new Set,this[rL]=s,this[r_]=r,this[rN]=n,null==A?this[rR](t):this[rM]=A}get[(D=rU,rb)](){return this[s4].values().next().value}[rR](e){let t=this[s5],i=this[s8],s=this[s4];i.extensions&&i.extensions.KHR_materials_pbrSpecularGlossiness&&console.warn(`Material ${i.name} uses a deprecated extension
"KHR_materials_pbrSpecularGlossiness", please use
"pbrMetallicRoughness" instead. Specular Glossiness materials are
currently supported for rendering, but not for our scene-graph API,
nor for auto-generation of USDZ for Quick Look.`),null==i.pbrMetallicRoughness&&(i.pbrMetallicRoughness={}),this[rQ]=new ry(t,e,i.pbrMetallicRoughness,s),null==i.emissiveFactor&&(i.emissiveFactor=[0,0,0]),null==i.doubleSided&&(i.doubleSided=!1),null==i.alphaMode&&(i.alphaMode="OPAQUE"),null==i.alphaCutoff&&(i.alphaCutoff=.5);let{normalTexture:r,occlusionTexture:n,emissiveTexture:a}=i,{normalMap:A,aoMap:o,emissiveMap:l}=s.values().next().value;this[rw]=new rf(t,R.Normal,A,s,e,r||null),this[rv]=new rf(t,R.Occlusion,o,s,e,n||null),this[rS]=new rf(t,R.Emissive,l,s,e,a||null)}async [rD](){if(null!=this[rM]){let{set:e,material:t}=await this[rM].doLazyLoad();return this[s4]=e,this[rR](this[rM].gltf),this[rM]=void 0,this.ensureLoaded=async()=>{},t}return this[s4].values().next().value}[rT](){if(null!=this[rM])throw Error(`Material "${this.name}" has not been loaded, call 'await
myMaterial.ensureLoaded()' before using an unloaded material.`)}async ensureLoaded(){await this[rD]()}get isLoaded(){return null==this[rM]}get isActive(){return this[r_]}[rF](e){this[r_]=e}get name(){return this[s8].name}set name(e){let t=this[s8];if(null!=t&&(t.name=e),null!=this[s4])for(let i of this[s4])i.name=e}get pbrMetallicRoughness(){return this[rT](),this[rQ]}get normalTexture(){return this[rT](),this[rw]}get occlusionTexture(){return this[rT](),this[rv]}get emissiveTexture(){return this[rT](),this[rS]}get emissiveFactor(){return this[rT](),this[s8].emissiveFactor}get index(){return this[rL]}[rk](){return this[rU]}hasVariant(e){let t=this[rN].get(e);return null!=t&&this[rU].has(t.index)}setEmissiveFactor(e){this[rT]();let t=new el.Ilk;for(let i of(e instanceof Array?t.fromArray(e):t.set(e).convertSRGBToLinear(),this[s4]))i.emissive.set(t);this[s8].emissiveFactor=t.toArray(),this[s5]()}[rx](){this[rT]();let e=this[s8];for(let t of this[s4])"MASK"===this[s8].alphaMode?t.alphaTest=e.alphaCutoff:t.alphaTest=void 0,t.needsUpdate=!0}setAlphaCutoff(e){this[rT](),this[s8].alphaCutoff=e,this[rx](),this[s5]()}getAlphaCutoff(){return this[rT](),this[s8].alphaCutoff}setDoubleSided(e){for(let t of(this[rT](),this[s4]))t.side=e?el.ehD:el.Wl3,t.needsUpdate=!0;this[s8].doubleSided=e,this[s5]()}getDoubleSided(){return this[rT](),this[s8].doubleSided}setAlphaMode(e){this[rT]();let t=(e,t)=>{e.transparent=t,e.depthWrite=!t};for(let i of(this[s8].alphaMode=e,this[s4]))t(i,"BLEND"===e),this[rx](),i.needsUpdate=!0;this[s5]()}getAlphaMode(){return this[rT](),this[s8].alphaMode}}let rP=Symbol("materials"),rO=Symbol("variantToMaterialMap"),rH=Symbol("modelVariants"),rq=Symbol("mesh");Symbol("primitives"),Symbol("loadVariant"),Symbol("prepareVariantsForExport"),Symbol("switchVariant");let rK=Symbol("children"),rV=Symbol("initialMaterialIdx"),rJ=Symbol("activeMaterialIdx");class rY{constructor(e){this.name="",this[T]=[],this.name=e}}T=rK;class rj extends rY{constructor(e,t,i,s){super(e.name),this[L]=new Map,this[F]=new Map,this[k]=0,this[_]=0,this[rq]=e;let{gltf:r,threeGLTF:n,threeObjectMap:a}=s;this[rH]=i,this.mesh.userData.variantData=i;let A=a.get(e.material);null!=A.materials?this[rV]=this[rJ]=A.materials:console.error(`Primitive (${e.name}) missing initial material reference.`);let o=e.userData.associations||{};if(null==o.meshes){console.error("Mesh is missing primitive index association");return}let l=r.meshes||[],h=l[o.meshes].primitives||[],c=h[o.primitives];if(null==c){console.error("Mesh primitive definition is missing.");return}if(null!=c.material)this[rP].set(c.material,t[c.material]);else{let u=t.findIndex(e=>"Default"===e.name);u>=0?this[rP].set(u,t[u]):console.warn("gltfPrimitive has no material!")}if(c.extensions&&c.extensions.KHR_materials_variants){let g=c.extensions.KHR_materials_variants,d=n.parser.json.extensions,p=d.KHR_materials_variants.variants;for(let m of g.mappings){let I=t[m.material];for(let f of(this[rP].set(m.material,I),m.variants)){let{name:E}=p[f];this[rO].set(f,I),I[rk]().add(f),i.has(E)||i.set(E,{name:E,index:f})}}}}get mesh(){return this[rq]}async setActiveMaterial(e){let t=this[rP].get(e);return null!=t&&(this.mesh.material=await t[rD](),this[rJ]=e),this.mesh.material}getActiveMaterial(){return this[rP].get(this[rJ])}getMaterial(e){return this[rP].get(e)}async enableVariant(e){if(null==e)return this.setActiveMaterial(this[rV]);if(null!=this[rO]&&this[rH].has(e)){let t=this[rH].get(e);return this.enableVariantHelper(t.index)}return null}async enableVariantHelper(e){if(null!=this[rO]&&null!=e){let t=this[rO].get(e);if(null!=t)return this.setActiveMaterial(t.index)}return null}async instantiateVariants(){if(null!=this[rO])for(let e of this[rO].keys()){let t=this.mesh.userData.variantMaterials.get(e);if(null!=t.material)continue;let i=await this.enableVariantHelper(e);null!=i&&(t.material=i)}}get variantInfo(){return this[rO]}addVariant(e,t){if(!this.ensureVariantIsUnused(t))return!1;this[rH].has(t)||this[rH].set(t,{name:t,index:this[rH].size});let i=this[rH].get(t),s=i.index;return e[rk]().add(s),this[rO].set(s,e),this[rP].set(e.index,e),this.updateVariantUserData(s,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[rk]().add(e),this.mesh.userData.variantData=this[rH],this.mesh.userData.variantMaterials=this.mesh.userData.variantMaterials||new Map;let i=this.mesh.userData.variantMaterials;i.set(e,{material:t[s4].values().next().value,gltfMaterialIndex:t.index})}ensureVariantIsUnused(e){let t=this[rH].get(e);return!(null!=t&&this.variantInfo.has(t.index))||(console.warn(`Primitive cannot add variant '${e}' for this material, it already exists.`),!1)}}L=rP,F=rO,k=rV,_=rJ;let rz=Symbol("materials"),r$=Symbol("hierarchy"),rW=Symbol("roots"),rX=Symbol("primitives");Symbol("loadVariant");let rZ=Symbol("correlatedSceneGraph"),r0=Symbol("prepareVariantsForExport"),r1=Symbol("switchVariant"),r2=Symbol("threeScene"),r3=Symbol("materialsFromPoint"),r4=Symbol("materialFromPoint"),r8=Symbol("variantData"),r5=Symbol("availableVariants"),r6=Symbol("modelOnUpdate"),r9=Symbol("cloneMaterial");class r7{constructor(e,t,i,s){this.gltf=e,this.gltfElementMap=t,this.mapKey=i,this.doLazyLoad=s}}class ne{constructor(e,t=()=>{}){this[U]=[],this[N]=[],this[G]=[],this[P]=[],this[O]=()=>{},this[H]=new Map,this[r6]=t,this[rZ]=e;let{gltf:i,threeGLTF:s,gltfElementMap:r}=e;for(let[n,a]of(this[r2]=s.scene,i.materials.entries())){let A=r.get(a);if(null!=A)this[rz].push(new rG(t,i,a,n,!0,this[r8],A));else{let o=i.materials||[],l=o[n],h=n,c=async()=>{let e=await s.parser.getDependency("material",h),t=new Set;return r.set(l,t),t.add(e),{set:t,material:e}};this[rz].push(new rG(t,i,l,n,!1,this[r8],A,new r7(i,r,l,c)))}}let u=new Map,g=[];for(let d of s.scene.children)g.push(d);for(;g.length>0;){let p=g.pop(),m=null;p instanceof el.Kj0?(m=new rj(p,this.materials,this[r8],e),this[rX].push(m)):m=new rY(p.name);let I=u.get(p);for(let f of(null!=I?I[rK].push(m):this[rW].push(m),this[r$].push(m),p.children))g.push(f),u.set(p,m)}}get materials(){return this[rz]}[(U=rz,N=r$,G=rW,P=rX,O=r6,H=r8,r5)](){let e=Array.from(this[r8].values());return e.sort((e,t)=>e.index-t.index),e.map(e=>e.name)}getMaterialByName(e){let t=this[rz].filter(t=>t.name===e);return t.length>0?t[0]:null}[r3](e){let t=e.intersectObject(this[r2],!0);return t.map(e=>{let t=this[r$].find(t=>t instanceof rj&&t.mesh===e.object);return null!=t?t.getActiveMaterial():null})}[r4](e){let t=this[r3](e);return t.length>0?t[0]:null}async [r1](e){for(let t of this[rX])await t.enableVariant(e);for(let i of this.materials)i[rF](!1);for(let s of this[rX])this.materials[s.getActiveMaterial().index][rF](!0)}async [r0](){let e=[];for(let t of this[rX])e.push(t.instantiateVariants());await Promise.all(e)}[r9](e,t){let i=this.materials[e];i.isLoaded||console.error(`Cloning an unloaded material,
call 'material.ensureLoaded() before cloning the material.`);let s=i[s4],r=JSON.parse(JSON.stringify(i[s8]));r.name=t;let n=this[rZ].gltf;n.materials.push(r);let a=new Set;for(let[A,o]of s.entries()){let l=o.clone();l.name=t+(s.size>1?"_inst"+A:""),a.add(l)}let h=new rG(this[r6],this[rZ].gltf,r,this[rz].length,!1,this[r8],a);return this[rz].push(h),h}createMaterialInstanceForVariant(e,t,i,s=!0){let r=null;for(let n of this[rX]){let a=this[r8].get(i);null!=a&&n.variantInfo.has(a.index)||null==n.getMaterial(e)||(this.hasVariant(i)||this.createVariant(i),null==r&&(r=this[r9](e,t)),n.addVariant(r,i))}if(s&&null!=r)for(let A of(r[rF](!0),this.materials[e][rF](!1),this[rX]))A.enableVariant(i);return r}createVariant(e){this[r8].has(e)?console.warn(`Variant '${e}'' already exists`):this[r8].set(e,{name:e,index:this[r8].size})}hasVariant(e){return this[r8].has(e)}setMaterialToVariant(e,t){if(null==this[r5]().find(e=>e===t)){console.warn(`Can't add material to '${t}', the variant does not exist.'`);return}if(e<0||e>=this.materials.length){console.error("setMaterialToVariant(): materialIndex is out of bounds.");return}for(let i of this[rX]){let s=i.getMaterial(e);null!=s&&i.addVariant(s,t)}}updateVariantName(e,t){let i=this[r8].get(e);null!=i&&(i.name=t,this[r8].set(t,i),this[r8].delete(e))}deleteVariant(e){let t=this[r8].get(e);if(null!=t){for(let i of this.materials)i.hasVariant(e)&&i[rU].delete(t.index);for(let s of this[rX])s.deleteVariant(t.index);this[r8].delete(e)}}}/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var nt=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let ni=Symbol("currentGLTF"),ns=Symbol("originalGltfJson"),nr=Symbol("model"),nn=Symbol("getOnUpdateMethod"),na=Symbol("textureLoader"),nA=(e,t)=>({type:"number",number:e,unit:t}),no=(()=>{let e={};return t=>{let i=t;if(i in e)return e[i];let s=[],r=0;for(;t;){if(++r>1e3){t="";break}let n=nl(t),a=n.nodes[0];if(null==a||0===a.terms.length)break;s.push(a),t=n.remainingInput}return e[i]=s}})(),nl=(()=>{let e=/^(\-\-|[a-z\u0240-\uffff])/i,t=/^([\*\+\/]|[\-]\s)/i,i=/^[\),]/;return s=>{let r=[];for(;s.length&&(s=s.trim(),!i.test(s));)if("("===s[0]){let{nodes:n,remainingInput:a}=ng(s);s=a,r.push({type:"function",name:{type:"ident",value:"calc"},arguments:n})}else if(e.test(s)){let A=nh(s),o=A.nodes[0];if("("===(s=A.remainingInput)[0]){let{nodes:l,remainingInput:h}=ng(s);r.push({type:"function",name:o,arguments:l}),s=h}else r.push(o)}else if(t.test(s))r.push({type:"operator",value:s[0]}),s=s.slice(1);else{let{nodes:c,remainingInput:u}="#"===s[0]?nu(s):nc(s);if(0===c.length)break;r.push(c[0]),s=u}return{nodes:[{type:"expression",terms:r}],remainingInput:s}}})(),nh=(()=>{let e=/[^a-z0-9_\-\u0240-\uffff]/i;return t=>{let i=t.match(e),s=null==i?t:t.substr(0,i.index),r=null==i?"":t.substr(i.index);return{nodes:[{type:"ident",value:s}],remainingInput:r}}})(),nc=(()=>{let e=/[\+\-]?(\d+[\.]\d+|\d+|[\.]\d+)([eE][\+\-]?\d+)?/,t=/^[a-z%]+/i,i=/^(m|mm|cm|rad|deg|[%])$/;return s=>{let r=s.match(e),n=null==r?"0":r[0];s=null==n?s:s.slice(n.length);let a=s.match(t),A=null!=a&&""!==a[0]?a[0]:null,o=null==a?s:s.slice(A.length);return null==A||i.test(A)||(A=null),{nodes:[{type:"number",number:parseFloat(n)||0,unit:A}],remainingInput:o}}})(),nu=(()=>{let e=/^[a-f0-9]*/i;return t=>{t=t.slice(1).trim();let i=t.match(e),s=null==i?[]:[{type:"hex",value:i[0]}];return{nodes:s,remainingInput:null==i?t:t.slice(i[0].length)}}})(),ng=e=>{let t=[];for(e=e.slice(1).trim();e.length;){let i=nl(e);if(t.push(i.nodes[0]),","===(e=i.remainingInput.trim())[0])e=e.slice(1).trim();else if(")"===e[0]){e=e.slice(1);break}}return{nodes:t,remainingInput:e}},nd=Symbol("visitedTypes");class np{constructor(e){this[nd]=e}walk(e,t){let i=e.slice();for(;i.length;){let s=i.shift();switch(this[nd].indexOf(s.type)>-1&&t(s),s.type){case"expression":i.unshift(...s.terms);break;case"function":i.unshift(s.name,...s.arguments)}}}}let nm=Object.freeze({type:"number",number:0,unit:null}),nI=(e,t=0)=>{let{number:i,unit:s}=e;if(isFinite(i)){if("rad"===e.unit||null==e.unit)return e}else i=t,s="rad";let r="deg"===s&&null!=i,n=r?i:0;return{type:"number",number:n*Math.PI/180,unit:"rad"}},nf=(e,t=0)=>{let i,{number:s,unit:r}=e;if(isFinite(s)){if("m"===e.unit)return e}else s=t,r="m";switch(r){default:i=1;break;case"cm":i=.01;break;case"mm":i=.001}let n=i*s;return{type:"number",number:n,unit:"m"}},nE=(()=>{let e={rad:e=>e,deg:nI,m:e=>e,mm:nf,cm:nf};return(t,i=nm)=>{isFinite(t.number)||(t.number=i.number,t.unit=i.unit);let{unit:s}=t;if(null==s)return t;let r=e[s];return null==r?i:r(t)}})();/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ class nC extends iZ{constructor(e){super(document.createElement("div")),this.normal=new el.Pa4(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)}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=no(e)[0].terms;for(let i=0;i<3;++i)this.position.setComponent(i,nE(t[i]).number);this.updateMatrixWorld()}updateNormal(e){if(null==e)return;let t=no(e)[0].terms;for(let i=0;i<3;++i)this.normal.setComponent(i,nE(t[i]).number)}orient(e){this.pivot.style.transform=`rotate(${e}rad)`}updateVisibility(e){e?this.element.classList.remove("hide"):this.element.classList.add("hide"),this.slot.assignedNodes().forEach(t=>{if(t.nodeType!==Node.ELEMENT_NODE)return;let i=t.dataset.visibilityAttribute;if(null!=i){let s=`data-${i}`;e?t.setAttribute(s,""):t.removeAttribute(s)}t.dispatchEvent(new CustomEvent("hotspot-visibility",{detail:{visible:e}}))}),this.initialized=!0}}let nB=(e,t,i)=>{let s=i,r=new el.Pa4;return e.traverseVisible(e=>{let i,n;e.updateWorldMatrix(!1,!1);let a=e.geometry;if(void 0!==a){if(a.isGeometry){let A=a.vertices;for(i=0,n=A.length;i<n;i++)r.copy(A[i]),e.isSkinnedMesh?e.boneTransform(i,r):r.applyMatrix4(e.matrixWorld),s=t(s,r)}else if(a.isBufferGeometry){let{position:o}=a.attributes;if(void 0!==o)for(i=0,n=o.count;i<n;i++)r.fromBufferAttribute(o,i),e.isSkinnedMesh?e.boneTransform(i,r):r.applyMatrix4(e.matrixWorld),s=t(s,r)}}}),s},ny={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,fragmentShader:`
uniform sampler2D tDiffuse;
uniform float h;
varying vec2 vUv;
void main() {
vec4 sum = vec4( 0.0 );
sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;
sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;
sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;
sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;
sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;
sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;
sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;
gl_FragColor = sum;
}`},nQ={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,fragmentShader:`
uniform sampler2D tDiffuse;
uniform float v;
varying vec2 vUv;
void main() {
vec4 sum = vec4( 0.0 );
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;
sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;
gl_FragColor = sum;
}`};class nw extends el.Tme{constructor(e,t,i){super(),this.camera=new el.iKG,this.renderTarget=null,this.renderTargetBlur=null,this.depthMaterial=new el.lRF,this.horizontalBlurMaterial=new el.jyz(ny),this.verticalBlurMaterial=new el.jyz(nQ),this.intensity=0,this.softness=1,this.boundingBox=new el.ZzF,this.size=new el.Pa4,this.maxDimension=0,this.isAnimated=!1,this.needsUpdate=!1;let{camera:s}=this;s.rotation.x=Math.PI/2,s.left=-.5,s.right=.5,s.bottom=-.5,s.top=.5,this.add(s);let r=new el._12,n=new el.vBJ({opacity:1,transparent:!0,side:el._Li});this.floor=new el.Kj0(r,n),this.floor.userData.shadow=!0,s.add(this.floor),this.blurPlane=new el.Kj0(r),this.blurPlane.visible=!1,s.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.horizontalBlurMaterial.depthTest=!1,this.verticalBlurMaterial.depthTest=!1,this.setScene(e,t,i)}setScene(e,t,i){let{boundingBox:s,size:r,rotation:n,position:a}=this;if(this.isAnimated=e.animationNames.length>0,this.boundingBox.copy(e.boundingBox),this.size.copy(e.size),this.maxDimension=Math.max(r.x,r.y,r.z)*(this.isAnimated?2:1),this.boundingBox.getCenter(a),"back"===i){let{min:A,max:o}=s;[A.y,A.z]=[A.z,A.y],[o.y,o.z]=[o.z,o.y],[r.y,r.z]=[r.z,r.y],n.x=Math.PI/2,n.y=Math.PI}else n.x=0,n.y=0;if(this.isAnimated){let l=s.min.y,h=s.max.y;r.y=this.maxDimension,s.expandByVector(r.subScalar(this.maxDimension).multiplyScalar(-.5)),s.min.y=l,s.max.y=h,r.set(this.maxDimension,h-l,this.maxDimension)}"bottom"===i?a.y=s.min.y:a.z=s.min.y,this.setSoftness(t)}setSoftness(e){this.softness=e;let{size:t,camera:i}=this,s=this.isAnimated?2:1;this.setMapSize(s*Math.pow(2,9-3*e));let r=t.y/2,n=t.y*s;i.near=0,i.far=(1-e)*n+e*r,this.depthMaterial.opacity=1/e,i.updateProjectionMatrix(),this.setIntensity(this.intensity),this.setOffset(0)}setMapSize(e){let{size:t}=this;this.isAnimated&&(e*=2);let i=Math.floor(t.x>t.z?e:e*t.x/t.z),s=Math.floor(t.x>t.z?e*t.z/t.x:e),r=10+i,n=10+s;if(null!=this.renderTarget&&(this.renderTarget.width!==r||this.renderTarget.height!==n)&&(this.renderTarget.dispose(),this.renderTarget=null,this.renderTargetBlur.dispose(),this.renderTargetBlur=null),null==this.renderTarget){let a={format:el.wk1};this.renderTarget=new el.dd2(r,n,a),this.renderTargetBlur=new el.dd2(r,n,a),this.floor.material.map=this.renderTarget.texture}this.camera.scale.set(t.x*(1+10/i),t.z*(1+10/s),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+1*t)}else this.visible=!1,this.floor.visible=!1}getIntensity(){return this.intensity}setOffset(e){this.floor.position.z=-e+.001*this.maxDimension}render(e,t){t.overrideMaterial=this.depthMaterial;let i=e.getClearAlpha();e.setClearAlpha(0),this.floor.visible=!1;let s=e.xr.enabled;e.xr.enabled=!1;let r=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.render(t,this.camera),t.overrideMaterial=null,this.floor.visible=!0,this.blurShadow(e),e.xr.enabled=s,e.setRenderTarget(r),e.setClearAlpha(i)}blurShadow(e){let{camera:t,horizontalBlurMaterial:i,verticalBlurMaterial:s,renderTarget:r,renderTargetBlur:n,blurPlane:a}=this;a.visible=!0,a.material=i,i.uniforms.h.value=1/this.renderTarget.width,i.uniforms.tDiffuse.value=this.renderTarget.texture,e.setRenderTarget(n),e.render(a,t),a.material=s,s.uniforms.v.value=1/this.renderTarget.height,s.uniforms.tDiffuse.value=this.renderTargetBlur.texture,e.setRenderTarget(r),e.render(a,t),a.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 nv=new el.Pa4,nS=new el.Pa4,nb=new el.Pa4,nx=new el.iMs,nM=new el.Pa4,nR=new el.FM8;class nD extends el.xsS{constructor({canvas:e,element:t,width:i,height:s}){super(),this.annotationRenderer=new i8,this.schemaElement=document.createElement("script"),this.width=1,this.height=1,this.aspect=1,this.scaleStep=0,this.renderCount=0,this.externalRenderer=null,this.camera=new el.cPb(45,1,.1,100),this.xrCamera=null,this.url=null,this.target=new el.Tme,this.animationNames=[],this.boundingBox=new el.ZzF,this.boundingSphere=new el.aLr,this.size=new el.Pa4,this.idealAspect=0,this.framedFoVDeg=0,this.shadow=null,this.shadowIntensity=0,this.shadowSoftness=1,this.bakedShadows=new Set,this.exposure=1,this.canScale=!0,this.isDirty=!1,this.goalTarget=new el.Pa4,this.targetDamperX=new sf,this.targetDamperY=new sf,this.targetDamperZ=new sf,this._currentGLTF=null,this._model=null,this.cancelPendingSourceChange=null,this.animationsByName=new Map,this.currentAnimationAction=null,this.name="ModelScene",this.element=t,this.canvas=e,this.camera=new el.cPb(45,1,.1,100),this.camera.name="MainCamera",this.add(this.target),this.setSize(i,s),this.target.name="Target",this.mixer=new el.Xcj(this.target);let{domElement:r}=this.annotationRenderer,{style:n}=r;n.display="none",n.pointerEvents="none",n.position="absolute",n.top="0",this.element.shadowRoot.querySelector(".default").appendChild(r),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 i;if(!e||e===this.url){t(1);return}if(this.reset(),this.url=e,null!=this.externalRenderer){let s=await this.externalRenderer.load(t);this.boundingSphere.radius=s.framedRadius,this.idealAspect=s.fieldOfViewAspect;return}null!=this.cancelPendingSourceChange&&(this.cancelPendingSourceChange(),this.cancelPendingSourceChange=null);try{i=await new Promise(async(i,s)=>{this.cancelPendingSourceChange=()=>s();try{let r=await this.element[ae].loader.load(e,this.element,t);i(r)}catch(n){s(n)}})}catch(r){if(null==r)return;throw r}this.cancelPendingSourceChange=null,this.reset(),this.url=e,this._currentGLTF=i,null!=i&&(this._model=i.scene,this.target.add(i.scene));let{animations:n}=i,a=new Map,A=[];for(let o of n)a.set(o.name,o),A.push(o.name);this.animations=n,this.animationsByName=a,this.animationNames=A,await this.setupScene()}async setupScene(){this.applyTransform(),this.updateBoundingBox(),await this.updateFraming(),this.updateShadow(),this.setShadowIntensity(this.shadowIntensity)}reset(){this.url=null,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[ni]=null,this.element[ns]=null,this.element[nr]=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 i=tf();this.externalRenderer.resize(e*i,t*i)}this.queueRender()}}markBakedShadow(e){e.userData.shadow=!0,this.bakedShadows.add(e)}unmarkBakedShadow(e){e.userData.shadow=!1,e.visible=!0,this.bakedShadows.delete(e),this.boundingBox.expandByObject(e)}findBakedShadows(e){let t=new el.ZzF;e.traverse(e=>{if(!e.isMesh)return;let i=e.material;if(!i.transparent)return;t.setFromObject(e);let s=t.getSize(nM),r=Math.min(s.x,s.y,s.z),n=Math.max(s.x,s.y,s.z);n<100*r||this.markBakedShadow(e)})}checkBakedShadows(){let{min:e,max:t}=this.boundingBox,i=new el.ZzF;for(let s of(this.boundingBox.getSize(this.size),this.bakedShadows))i.setFromObject(s),i.min.y<e.y+this.size.y/100&&i.min.x<=e.x&&i.max.x>=t.x&&i.min.z<=e.z&&i.max.z>=t.z||i.min.z<e.z+this.size.z/100&&i.min.x<=e.x&&i.max.x>=t.x&&i.min.y<=e.y&&i.max.y>=t.y||this.unmarkBakedShadow(s)}applyTransform(){let{model:e}=this;if(null==e)return;let t=no(this.element.orientation)[0].terms,i=nE(t[0]).number,s=nE(t[1]).number,r=nE(t[2]).number;e.quaternion.setFromEuler(new el.USm(s,r,i,"YXZ"));let n=no(this.element.scale)[0].terms;e.scale.set(n[0].number,n[1].number,n[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=nB(e,t,new el.ZzF),this.boundingBox.isEmpty()&&(this.setBakedShadowVisibility(!0),this.bakedShadows.forEach(e=>this.unmarkBakedShadow(e)),this.boundingBox=nB(e,t,new el.ZzF)),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());let i=(e,i)=>Math.max(e,t.distanceToSquared(i));this.boundingSphere.radius=Math.sqrt(nB(e,i,0));let s=(e,i)=>{i.sub(t);let s=Math.sqrt(i.x*i.x+i.z*i.z);return Math.max(e,s/(this.idealCameraDistance()-Math.abs(i.y)))};this.idealAspect=nB(e,s,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){let t=Math.tan(e/2*Math.PI/180)*Math.max(1,this.idealAspect/this.aspect);return 2*Math.atan(t)*180/Math.PI}getNDC(e,t){if(null!=this.xrCamera)nR.set(e/window.screen.width,t/window.screen.height);else{let i=this.element.getBoundingClientRect();nR.set((e-i.x)/this.width,(t-i.y)/this.height)}return nR.multiplyScalar(2).subScalar(1),nR.y*=-1,nR}getSize(){return{width:this.width,height:this.height}}setEnvironmentAndSkybox(e,t){this.element[ae].arRenderer.presentedScene!==this&&(this.environment=e,this.background=t,this.queueRender())}setTarget(e,t,i){this.goalTarget.set(-e,-t,-i)}setTargetDamperDecayTime(e){this.targetDamperX.setDecayTime(e),this.targetDamperY.setDecayTime(e),this.targetDamperZ.setDecayTime(e)}getTarget(){return this.goalTarget.clone().multiplyScalar(-1)}jumpToGoal(){this.updateTarget(1e4)}updateTarget(e){let t=this.goalTarget,i=this.target.position;if(t.equals(i))return!1;{let s=this.boundingSphere.radius/10,{x:r,y:n,z:a}=i;return r=this.targetDamperX.update(r,t.x,e,s),n=this.targetDamperY.update(n,t.y,e,s),a=this.targetDamperZ.update(a,t.z,e,s),this.target.position.set(r,n,a),this.target.updateMatrixWorld(),this.queueRender(),!0}}pointTowards(e,t){let{x:i,z:s}=this.position;this.yaw=Math.atan2(e-i,t-s)}get model(){return this._model}set yaw(e){this.rotation.y=e,this.queueRender()}get yaw(){return this.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 this.currentAnimationAction.loop===el.uEv&&(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,i=el.YKA,s=1/0){if(null==this._currentGLTF)return;let{animations:r}=this;if(null==r||0===r.length){console.warn("Cannot play animation (model does not have any animations)");return}let n=null;if(null!=e&&null==(n=this.animationsByName.get(e))){let a=parseInt(e);!isNaN(a)&&a>=0&&a<r.length&&(n=r[a])}null==n&&(n=r[0]);try{let{currentAnimationAction:A}=this,o=this.mixer.clipAction(n,this);this.currentAnimationAction=o,this.element.paused?this.mixer.stopAllAction():(o.paused=!1,null!=A&&o!==A?o.crossFadeFrom(A,t,!1):this.animationTimeScale>0&&this.animationTime==this.duration&&(this.animationTime=0)),o.setLoop(i,s),o.enabled=!0,o.clampWhenFinished=!0,o.play()}catch(l){console.error(l)}}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 t="wall"===this.element.arPlacement?"back":"bottom";this.shadow=new nw(this,this.shadowSoftness,t)}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)}get raycaster(){return nx}positionAndNormalFromPoint(e,t=this){this.raycaster.setFromCamera(e,this.getCamera());let i=this.raycaster.intersectObject(t,!0),s=i.find(e=>e.object.visible&&!e.object.userData.shadow);return null==s||null==s.face?null:null==s.uv?{position:s.point,normal:s.face.normal,uv:null}:(s.face.normal.applyNormalMatrix(new el.Vkp().getNormalMatrix(s.object.matrixWorld)),{position:s.point,normal:s.face.normal,uv:s.uv})}addHotspot(e){this.target.add(e),this.annotationRenderer.domElement.appendChild(e.element)}removeHotspot(e){this.target.remove(e)}forHotspots(e){let{children:t}=this.target;for(let i=0,s=t.length;i<s;i++){let r=t[i];r instanceof nC&&e(r)}}updateHotspots(e){this.forHotspots(t=>{nv.copy(e),nS.setFromMatrixPosition(t.matrixWorld),nv.sub(nS),nb.copy(t.normal).transformDirection(this.target.matrixWorld),0>nv.dot(nb)?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:i,element:s}=this,{alt:r,poster:n,iosSrc:a}=s;if(null!=e){let A=[{"@type":"MediaObject",contentUrl:e,encodingFormat:(null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase())==="gltf"?"model/gltf+json":"model/gltf-binary"}];a&&A.push({"@type":"MediaObject",contentUrl:a,encodingFormat:"model/vnd.usdz+zip"}),i.textContent=JSON.stringify({"@context":"http://schema.org/","@type":"3DModel",image:null!=n?n:void 0,name:null!=r?r:void 0,encoding:A}),document.head.appendChild(i)}else null!=i.parentElement&&i.parentElement.removeChild(i)}}/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let nT=async e=>new Promise((t,i)=>{let s=e.match(/data:(.*);/);if(!s)return i(Error(`${e} is not a valid data Url`));let r=s[1],n=e.replace(/data:image\/\w+;base64,/,""),a=atob(n),A=[];for(let o=0;o<a.length;o+=512){let l=a.slice(o,o+512),h=Array(l.length);for(let c=0;c<l.length;c++)h[c]=l.charCodeAt(c);let u=new Uint8Array(h);A.push(u)}t(new Blob(A,{type:r}))});/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ class nL extends EventTarget{constructor(){super(...arguments),this.ongoingActivities=new Set,this.totalProgress=0}get ongoingActivityCount(){return this.ongoingActivities.size}beginActivity(){let e={progress:0,completed:!1};return this.ongoingActivities.add(e),1===this.ongoingActivityCount&&this.announceTotalProgress(e,0),t=>{let i;return(i=Math.max(tI(t,0,1),e.progress))!==e.progress&&this.announceTotalProgress(e,i),e.progress}}announceTotalProgress(e,t){let i=0,s=0;for(let r of(1==t&&(e.completed=!0),this.ongoingActivities)){let{progress:n}=r;i+=1-n,!0===r.completed&&s++}let a=e.progress;e.progress=t,this.totalProgress+=(t-a)*(1-this.totalProgress)/i;let A=s===this.ongoingActivityCount?1:this.totalProgress;this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:A}})),s===this.ongoingActivityCount&&(this.totalProgress=0,this.ongoingActivities.clear())}}/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var nF=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let nk=document.createElement("canvas"),n_=Symbol("fallbackResizeHandler"),nU=Symbol("defaultAriaLabel"),nN=Symbol("resizeObserver"),nG=Symbol("clearModelTimeout"),nP=Symbol("onContextLost"),nO=Symbol("loaded"),nH=Symbol("status"),nq=Symbol("onFocus"),nK=Symbol("onBlur"),nV=Symbol("updateSize"),nJ=Symbol("intersectionObserver"),nY=Symbol("isElementInViewport"),nj=Symbol("announceModelVisibility"),nz=Symbol("ariaLabel"),n$=Symbol("altDefaulted"),nW=Symbol("statusElement"),nX=Symbol("updateStatus"),nZ=Symbol("loadedTime"),n0=Symbol("updateSource"),n1=Symbol("markLoaded"),n2=Symbol("container"),n3=Symbol("input"),n4=Symbol("canvas"),n8=Symbol("scene"),n5=Symbol("needsRender"),n6=Symbol("tick"),n9=Symbol("onModelLoad"),n7=Symbol("onResize"),ae=Symbol("renderer"),at=Symbol("progressTracker"),ai=Symbol("getLoaded"),as=Symbol("getModelIsVisible"),ar=Symbol("shouldAttemptPreload"),an=e=>({x:e.x,y:e.y,z:e.z,toString(){return`${this.x}m ${this.y}m ${this.z}m`}}),aa=e=>({u:e.x,v:e.y,toString(){return`${this.u} ${this.v}`}});class aA extends ev{constructor(){let e,t;super(),this.alt=null,this.src=null,this.withCredentials=!1,this.generateSchema=!1,this[q]=!1,this[K]=!1,this[V]=0,this[J]="",this[Y]=null,this[j]=tm(()=>{let e=this.getBoundingClientRect();this[nV](e)},50),this[z]=tm(e=>{let t=this.modelIsVisible;t!==e&&this.dispatchEvent(new CustomEvent("model-visibility",{detail:{visible:t}}))},0),this[$]=null,this[W]=null,this[X]=new nL,this[Z]=()=>{this[nW].textContent=this[nH]},this[ee]=()=>{this[nW].textContent=""},this[et]=e=>{this.dispatchEvent(new CustomEvent("error",{detail:{type:"webglcontextlost",sourceError:e.sourceEvent}}))},this.attachShadow({mode:"open"});let i=this.shadowRoot;if(tD(i),this[n2]=i.querySelector(".container"),this[n3]=i.querySelector(".userInput"),this[n4]=i.querySelector("canvas"),this[nW]=i.querySelector("#status"),this[nU]=this[n3].getAttribute("aria-label"),this.isConnected){let s=this.getBoundingClientRect();e=s.width,t=s.height}else e=300,t=150;this[n8]=new nD({canvas:this[n4],element:this,width:e,height:t}),Promise.resolve().then(()=>{this[nV](this.getBoundingClientRect())}),ts&&(this[nN]=new ResizeObserver(e=>{if(!this[ae].isPresenting)for(let t of e)t.target===this&&this[nV](t.contentRect)})),tr?this[nJ]=new IntersectionObserver(e=>{for(let t of e)if(t.target===this){let i=this.modelIsVisible;this[nY]=t.isIntersecting,this[nj](i),this[nY]&&!this.loaded&&this[n0]()}},{root:null,rootMargin:"0px",threshold:1e-5}):this[nY]=!0}static get is(){return"model-viewer"}static set modelCacheSize(e){iX[i$].evictionThreshold=e}static get modelCacheSize(){return iX[i$].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."),s3.singleton.minScale=e}static get minimumRenderScale(){return s3.singleton.minScale}get loaded(){return this[ai]()}get[(q=nY,K=nO,V=nZ,J=nH,Y=nG,j=n_,z=nj,$=nN,W=nJ,X=at,ae)](){return s3.singleton}get modelIsVisible(){return this[as]()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),ts?this[nN].observe(this):self.addEventListener("resize",this[n_]),tr&&this[nJ].observe(this),this.addEventListener("focus",this[nq]),this.addEventListener("blur",this[nK]);let e=this[ae];e.addEventListener("contextlost",this[nP]),e.registerScene(this[n8]),null!=this[nG]&&(self.clearTimeout(this[nG]),this[nG]=null,this.requestUpdate("src",null))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),ts?this[nN].unobserve(this):self.removeEventListener("resize",this[n_]),tr&&this[nJ].unobserve(this),this.removeEventListener("focus",this[nq]),this.removeEventListener("blur",this[nK]);let e=this[ae];e.removeEventListener("contextlost",this[nP]),e.unregisterScene(this[n8]),this[nG]=self.setTimeout(()=>{this[n8].dispose(),this[nG]=null},1e3)}updated(e){super.updated(e),e.has("src")&&(null==this.src?(this[nO]=!1,this[nZ]=0,this[n8].reset()):this.src!==this[n8].url&&(this[nO]=!1,this[nZ]=0,this[n0]())),e.has("alt")&&this[n3].setAttribute("aria-label",this[nz]),e.has("withCredentials")&&(iX.withCredentials=this.withCredentials),e.has("generateSchema")&&(this.generateSchema?this[n8].updateSchema(this.src):this[n8].updateSchema(null))}toDataURL(e,t){return this[ae].displayCanvas(this[n8]).toDataURL(e,t)}async toBlob(e){let t=e?e.mimeType:void 0,i=e?e.qualityArgument:void 0,s=e?e.idealAspect:void 0,{width:r,height:n,idealAspect:a,aspect:A}=this[n8],{dpr:o,scaleFactor:l}=this[ae],h=r*l*o,c=n*l*o,u=0,g=0;if(!0===s){if(a>A){let d=c;g=(d-(c=Math.round(h/a)))/2}else{let p=h;u=(p-(h=Math.round(c*a)))/2}}nk.width=h,nk.height=c;try{return new Promise(async(e,s)=>(nk.getContext("2d").drawImage(this[ae].displayCanvas(this[n8]),u,g,h,c,0,0,h,c),nk.msToBlob&&(!t||"image/png"===t))?e(nk.msToBlob()):nk.toBlob?void nk.toBlob(t=>{if(!t)return s(Error("Unable to retrieve canvas blob"));e(t)},t,i):e(await nT(nk.toDataURL(t,i))))}finally{this[nV]({width:r,height:n})}}registerRenderer(e){this[n8].externalRenderer=e}unregisterRenderer(){this[n8].externalRenderer=null}get[nz](){return this[n$]}get[n$](){return null==this.alt||"null"===this.alt?this[nU]:this.alt}[ai](){return this[nO]}[as](){return this.loaded&&this[nY]}[ar](){return!!this.src&&this[nY]}[nV]({width:e,height:t}){this[n2].style.width=`${e}px`,this[n2].style.height=`${t}px`,this[n7]({width:parseFloat(e),height:parseFloat(t)})}[n6](e,t){}[n1](){this[nO]||(this[nO]=!0,this[nZ]=performance.now())}[n5](){this[n8].queueRender()}[n9](){}[nX](e){this[nH]=e;let t=this.getRootNode();null!=t&&t.activeElement===this&&this[nW].textContent!=e&&(this[nW].textContent=e)}[(Z=nq,ee=nK,n7)](e){this[n8].setSize(e.width,e.height)}async [(et=nP,n0)](){let e=this[n8];if(this.loaded||!this[ar]()||this.src===e.url)return;this.generateSchema&&e.updateSchema(this.src),this[nX]("Loading"),e.stopAnimation();let t=this[at].beginActivity(),i=this.src;try{let s=e.setSource(i,e=>t(.95*tI(e,0,1))),r=this[tv]();await Promise.all([s,r]),this[n1](),this[n9](),await new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("load",{detail:{url:i}})),e()})})})}catch(n){this.dispatchEvent(new CustomEvent("error",{detail:{type:"loadfailure",sourceError:n}}))}finally{t(1)}}}nF([u({type:String})],aA.prototype,"alt",void 0),nF([u({type:String})],aA.prototype,"src",void 0),nF([u({type:Boolean,attribute:"with-credentials"})],aA.prototype,"withCredentials",void 0),nF([u({type:Boolean,attribute:"generate-schema"})],aA.prototype,"generateSchema",void 0);/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var ao=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let al=Symbol("changeAnimation"),ah=Symbol("paused"),ac={repetitions:1/0,pingpong:!1},au=Symbol("hotspotMap"),ag=Symbol("mutationCallback"),ad=Symbol("observer"),ap=Symbol("addHotspot"),am=Symbol("removeHotspot"),aI=new el.yGw,af=new el.Vkp;/*!
fflate - fast JavaScript compression/decompression
<https://101arrowz.github.io/fflate>
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
version 0.6.9
*/ var aE={},aC=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},aB=function(e){return new Worker(e)};try{URL.revokeObjectURL(aC(""))}catch(ay){aC=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},aB=function(e){return new Worker(e,{type:"module"})}}var aQ=Uint8Array,aw=Uint16Array,av=Uint32Array,aS=new aQ([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]),ab=new aQ([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]),ax=new aQ([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aM=function(e,t){for(var i=new aw(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];for(var r=new av(i[30]),s=1;s<30;++s)for(var n=i[s];n<i[s+1];++n)r[n]=n-i[s]<<5|s;return[i,r]},aR=aM(aS,2),aD=aR[0],aT=aR[1];aD[28]=258,aT[258]=28;for(var aL=aM(ab,0),aF=aL[0],ak=aL[1],a_=new aw(32768),aU=0;aU<32768;++aU){var aN=(43690&aU)>>>1|(21845&aU)<<1;aN=(61680&(aN=(52428&aN)>>>2|(13107&aN)<<2))>>>4|(3855&aN)<<4,a_[aU]=((65280&aN)>>>8|(255&aN)<<8)>>>1}for(var aG=function(e,t,i){for(var s,r=e.length,n=0,a=new aw(t);n<r;++n)++a[e[n]-1];var A=new aw(t);for(n=0;n<t;++n)A[n]=A[n-1]+a[n-1]<<1;if(i){s=new aw(1<<t);var o=15-t;for(n=0;n<r;++n)if(e[n])for(var l=n<<4|e[n],h=t-e[n],c=A[e[n]-1]++<<h,u=c|(1<<h)-1;c<=u;++c)s[a_[c]>>>o]=l}else for(n=0,s=new aw(r);n<r;++n)e[n]&&(s[n]=a_[A[e[n]-1]++]>>>15-e[n]);return s},aP=new aQ(288),aU=0;aU<144;++aU)aP[aU]=8;for(var aU=144;aU<256;++aU)aP[aU]=9;for(var aU=256;aU<280;++aU)aP[aU]=7;for(var aU=280;aU<288;++aU)aP[aU]=8;for(var aO=new aQ(32),aU=0;aU<32;++aU)aO[aU]=5;var aH=aG(aP,9,0),aq=aG(aO,5,0),aK=function(e){for(var t=e[0],i=1;i<e.length;++i)e[i]>t&&(t=e[i]);return t},aV=function(e,t,i){var s=t/8|0;return(e[s]|e[s+1]<<8)>>(7&t)&i},aJ=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},aY=function(e){return(e/8|0)+(7&e&&1)},aj=function(e,t,i){(null==t||t<0)&&(t=0),(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof aw?aw:e instanceof av?av:aQ)(i-t);return s.set(e.subarray(t,i)),s},az=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},a$=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},aW=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[a4,0];if(1==r){var a=new aQ(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var A=i[0],o=i[1],l=0,h=1,c=2;for(i[0]={s:-1,f:A.f+o.f,l:A,r:o};h!=r-1;)A=i[i[l].f<i[c].f?l++:c++],o=i[l!=h&&i[l].f<i[c].f?l++:c++],i[h++]={s:-1,f:A.f+o.f,l:A,r:o};for(var u=n[0].s,s=1;s<r;++s)n[s].s>u&&(u=n[s].s);var g=new aw(u+1),d=aX(i[h-1],g,0);if(d>t){var s=0,p=0,m=d-t,I=1<<m;for(n.sort(function(e,t){return g[t.s]-g[e.s]||e.f-t.f});s<r;++s){var f=n[s].s;if(g[f]>t)p+=I-(1<<d-g[f]),g[f]=t;else break}for(p>>>=m;p>0;){var E=n[s].s;g[E]<t?p-=1<<t-g[E]++-1:++s}for(;s>=0&&p;--s){var C=n[s].s;g[C]==t&&(--g[C],++p)}d=t}return[new aQ(g),d]},aX=function(e,t,i){return -1==e.s?Math.max(aX(e.l,t,i+1),aX(e.r,t,i+1)):t[e.s]=i},aZ=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new aw(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},A=1;A<=t;++A)if(e[A]==r&&A!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=e[A]}return[i.subarray(0,s),t]},a0=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},a1=function(e,t,i){var s=i.length,r=aY(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;n<s;++n)e[r+n+4]=i[n];return(r+4+s)*8},a2=function(e,t,i,s,r,n,a,A,o,l,h){az(t,h++,i),++r[256];for(var c,u,g,d,p=aW(r,15),m=p[0],I=p[1],f=aW(n,15),E=f[0],C=f[1],B=aZ(m),y=B[0],Q=B[1],w=aZ(E),v=w[0],S=w[1],b=new aw(19),x=0;x<y.length;++x)b[31&y[x]]++;for(var x=0;x<v.length;++x)b[31&v[x]]++;for(var M=aW(b,7),R=M[0],D=M[1],T=19;T>4&&!R[ax[T-1]];--T);var L=l+5<<3,F=a0(r,aP)+a0(n,aO)+a,k=a0(r,m)+a0(n,E)+a+14+3*T+a0(b,R)+(2*b[16]+3*b[17]+7*b[18]);if(L<=F&&L<=k)return a1(t,h,e.subarray(o,o+l));if(az(t,h,1+(k<F)),h+=2,k<F){c=aG(m,I,0),u=m,g=aG(E,C,0),d=E;var _=aG(R,D,0);az(t,h,Q-257),az(t,h+5,S-1),az(t,h+10,T-4),h+=14;for(var x=0;x<T;++x)az(t,h+3*x,R[ax[x]]);h+=3*T;for(var U=[y,v],N=0;N<2;++N)for(var G=U[N],x=0;x<G.length;++x){var P=31&G[x];az(t,h,_[P]),h+=R[P],P>15&&(az(t,h,G[x]>>>5&127),h+=G[x]>>>12)}}else c=aH,u=aP,g=aq,d=aO;for(var x=0;x<A;++x)if(s[x]>255){var P=s[x]>>>18&31;a$(t,h,c[P+257]),h+=u[P+257],P>7&&(az(t,h,s[x]>>>23&31),h+=aS[P]);var O=31&s[x];a$(t,h,g[O]),h+=d[O],O>3&&(a$(t,h,s[x]>>>5&8191),h+=ab[O])}else a$(t,h,c[s[x]]),h+=u[s[x]];return a$(t,h,c[256]),h+u[256]},a3=new av([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),a4=new aQ(0),a8=function(e,t,i,s,r,n){var a=e.length,A=new aQ(s+a+5*(1+Math.ceil(a/7e3))+r),o=A.subarray(s,A.length-r),l=0;if(!t||a<8)for(var h=0;h<=a;h+=65535){var c=h+65535;c<a?l=a1(o,l,e.subarray(h,c)):(o[h]=n,l=a1(o,l,e.subarray(h,a)))}else{for(var u=a3[t-1],g=u>>>13,d=8191&u,p=(1<<i)-1,m=new aw(32768),I=new aw(p+1),f=Math.ceil(i/3),E=2*f,C=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<E)&p},B=new av(25e3),y=new aw(288),Q=new aw(32),w=0,v=0,h=0,S=0,b=0,x=0;h<a;++h){var M=C(h),R=32767&h,D=I[M];if(m[R]=D,I[M]=R,b<=h){var T=a-h;if((w>7e3||S>24576)&&T>423){l=a2(e,o,0,B,y,Q,v,S,x,h-x,l),S=w=v=0,x=h;for(var L=0;L<286;++L)y[L]=0;for(var L=0;L<30;++L)Q[L]=0}var F=2,k=0,_=d,U=R-D&32767;if(T>2&&M==C(h-U))for(var N=Math.min(g,T)-1,G=Math.min(32767,h),P=Math.min(258,T);U<=G&&--_&&R!=D;){if(e[h+F]==e[h+F-U]){for(var O=0;O<P&&e[h+O]==e[h+O-U];++O);if(O>F){if(F=O,k=U,O>N)break;for(var H=Math.min(U,O-2),q=0,L=0;L<H;++L){var K=h-U+L+32768&32767,V=m[K],J=K-V+32768&32767;J>q&&(q=J,D=K)}}}D=m[R=D],U+=R-D+32768&32767}if(k){B[S++]=268435456|aT[F]<<18|ak[k];var Y=31&aT[F],j=31&ak[k];v+=aS[Y]+ab[j],++y[257+Y],++Q[j],b=h+F,++w}else B[S++]=e[h],++y[e[h]]}}l=a2(e,o,n,B,y,Q,v,S,x,h-x,l),!n&&7&l&&(l=a1(o,l+1,a4))}return aj(A,0,s+aY(l)+r)},a5=function(){for(var e=new av(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),a6=function(){var e=-1;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=a5[255&i^t[s]]^i>>>8;e=i},d:function(){return~e}}},a9=function(e,t){var i={};for(var s in e)i[s]=e[s];for(var s in t)i[s]=t[s];return i},a7=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},Ae=function(e,t,i,s){for(var r in e){var n=e[r],a=t+r;n instanceof aQ?i[a]=[n,s]:Array.isArray(n)?i[a]=[n[0],a9(s,n[1])]:Ae(n,a+"/",i,s)}},At="undefined"!=typeof TextEncoder&&new TextEncoder,Ai="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ai.decode(a4,{stream:!0})}catch(As){}function Ar(e,t){if(t){for(var i=new aQ(e.length),s=0;s<e.length;++s)i[s]=e.charCodeAt(s);return i}if(At)return At.encode(e);for(var r=e.length,n=new aQ(e.length+(e.length>>1)),a=0,A=function(e){n[a++]=e},s=0;s<r;++s){if(a+5>n.length){var o=new aQ(a+8+(r-s<<1));o.set(n),n=o}var l=e.charCodeAt(s);l<128||t?A(l):l<2048?(A(192|l>>6),A(128|63&l)):l>55295&&l<57344?(A(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>18),A(128|l>>12&63),A(128|l>>6&63),A(128|63&l)):(A(224|l>>12),A(128|l>>6&63),A(128|63&l))}return aj(n,0,a)}var An=function(e){var t=0;if(e)for(var i in e){var s=e[i].length;if(s>65535)throw"extra field too long";t+=s+4}return t},Aa=function(e,t,i,s,r,n,a,A){var o=s.length,l=i.extra,h=A&&A.length,c=An(l);a7(e,t,null!=a?33639248:67324752),t+=4,null!=a&&(e[t++]=20,e[t++]=i.os),e[t]=20,t+=2,e[t++]=i.flag<<1|(null==n&&8),e[t++]=r&&8,e[t++]=255&i.compression,e[t++]=i.compression>>8;var u=new Date(null==i.mtime?Date.now():i.mtime),g=u.getFullYear()-1980;if(g<0||g>119)throw"date not in range 1980-2099";if(a7(e,t,g<<25|u.getMonth()+1<<21|u.getDate()<<16|u.getHours()<<11|u.getMinutes()<<5|u.getSeconds()>>>1),t+=4,null!=n&&(a7(e,t,i.crc),a7(e,t+4,n),a7(e,t+8,i.size)),a7(e,t+12,o),a7(e,t+14,c),t+=16,null!=a&&(a7(e,t,h),a7(e,t+6,i.attrs),a7(e,t+10,a),t+=14),e.set(s,t),t+=o,c)for(var d in l){var p=l[d],m=p.length;a7(e,t,+d),a7(e,t+2,m),e.set(p,t+4),t+=4+m}return h&&(e.set(A,t),t+=h),t},AA=function(e,t,i,s,r){a7(e,t,101010256),a7(e,t+8,i),a7(e,t+10,i),a7(e,t+12,s),a7(e,t+16,r)};class Ao{async parse(e){let t={},i="model.usda";t[i]=null;let s=Al(),r={},n={};for(let a in e.traverseVisible(e=>{if(e.isMesh){let i=e.geometry,n=e.material;if(n.isMeshStandardMaterial){let a="geometries/Geometry_"+i.id+".usd";if(!(a in t)){var A;let o;let l=function(e){let t=function(e){let t=e.attributes,i=t.position.count;return`
def Mesh "Geometry"
{
int[] faceVertexCounts = [${function(e){let t=null!==e.index?e.index.count:e.attributes.position.count;return Array(t/3).fill(3).join(", ")}(e)}]
int[] faceVertexIndices = [${function(e){let t=e.index,i=[];if(null!==t)for(let s=0;s<t.count;s++)i.push(t.getX(s));else{let r=e.attributes.position.count;for(let n=0;n<r;n++)i.push(n)}return i.join(", ")}(e)}]
normal3f[] normals = [${Au(t.normal,i)}] (
interpolation = "vertex"
)
point3f[] points = [${Au(t.position,i)}]
float2[] primvars:st = [${function(e,t){if(void 0===e)return console.warn("USDZExporter: UVs missing."),Array(t).fill("(0, 0)").join(", ");let i=[];for(let s=0;s<e.count;s++){let r=e.getX(s),n=e.getY(s);i.push(`(${r.toPrecision(7)}, ${1-n.toPrecision(7)})`)}return i.join(", ")}(t.uv,i)}] (
interpolation = "vertex"
)
uniform token subdivisionScheme = "none"
}
`}(e);return`
def "Geometry"
{
${t}
}
`}(i);t[a]=(A=l,Ar(Al()+A))}n.uuid in r||(r[n.uuid]=n),s+=function(e,t,i){let s="Object_"+e.id,r=Ah(e.matrixWorld);return 0>e.matrixWorld.determinant()&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e),`def Xform "${s}" (
prepend references = @./geometries/Geometry_${t.id}.usd@</Geometry>
)
{
matrix4d xformOp:transform = ${r}
uniform token[] xformOpOrder = ["xformOp:transform"]
rel material:binding = </Materials/Material_${i.id}>
}
`}(e,i,n)}else console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",e)}else e.isCamera&&(s+=function(e){let t=e.name?e.name:"Camera_"+e.id,i=Ah(e.matrixWorld);return(0>e.matrixWorld.determinant()&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e),e.isOrthographicCamera)?`def Camera "${t}"
{
matrix4d xformOp:transform = ${i}
uniform token[] xformOpOrder = ["xformOp:transform"]
float2 clippingRange = (${e.near}, ${e.far})
float horizontalAperture = ${(Math.abs(e.left)+Math.abs(e.right))*10}
float verticalAperture = ${(Math.abs(e.top)+Math.abs(e.bottom))*10}
token projection = "orthographic"
}
`:`def Camera "${t}"
{
matrix4d xformOp:transform = ${i}
uniform token[] xformOpOrder = ["xformOp:transform"]
float2 clippingRange = (${e.near}, ${e.far})
float focalLength = ${e.getFocalLength()}
float focusDistance = ${e.focus}
float horizontalAperture = ${e.getFilmWidth()}
token projection = "perspective"
float verticalAperture = ${e.getFilmHeight()}
}
`}(e))}),s+=function(e,t){let i=[];for(let s in e){let r=e[s];i.push(function(e,t){let i=" ",s=[],r=[];function n(i,s,r){let n=i.id+(r?"_"+r.getHexString():""),a=1023===i.format;return t[n]=i,`
def Shader "Transform2d_${s}" (
sdrMetadata = {
string role = "math"
}
)
{
uniform token info:id = "UsdTransform2d"
float2 inputs:in.connect = </Materials/Material_${e.id}/uvReader_st.outputs:result>
float2 inputs:scale = ${Ad(i.repeat)}
float2 inputs:translation = ${Ad(i.offset)}
float2 outputs:result
}
def Shader "Texture_${i.id}_${s}"
{
uniform token info:id = "UsdUVTexture"
asset inputs:file = @textures/Texture_${n}.${a?"png":"jpg"}@
float2 inputs:st.connect = </Materials/Material_${e.id}/Transform2d_${s}.outputs:result>
token inputs:wrapS = "repeat"
token inputs:wrapT = "repeat"
float outputs:r
float outputs:g
float outputs:b
float3 outputs:rgb
${e.transparent||e.alphaTest>0?"float outputs:a":""}
}`}return e.side===el.ehD&&console.warn("THREE.USDZExporter: USDZ does not support double sided materials",e),null!==e.map?(s.push(`${i}color3f inputs:diffuseColor.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:rgb>`),e.transparent?s.push(`${i}float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`):e.alphaTest>0&&(s.push(`${i}float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`),s.push(`${i}float inputs:opacityThreshold = ${e.alphaTest}`)),r.push(n(e.map,"diffuse",e.color))):s.push(`${i}color3f inputs:diffuseColor = ${Ag(e.color)}`),null!==e.emissiveMap?(s.push(`${i}color3f inputs:emissiveColor.connect = </Materials/Material_${e.id}/Texture_${e.emissiveMap.id}_emissive.outputs:rgb>`),r.push(n(e.emissiveMap,"emissive"))):e.emissive.getHex()>0&&s.push(`${i}color3f inputs:emissiveColor = ${Ag(e.emissive)}`),null!==e.normalMap&&(s.push(`${i}normal3f inputs:normal.connect = </Materials/Material_${e.id}/Texture_${e.normalMap.id}_normal.outputs:rgb>`),r.push(n(e.normalMap,"normal"))),null!==e.aoMap&&(s.push(`${i}float inputs:occlusion.connect = </Materials/Material_${e.id}/Texture_${e.aoMap.id}_occlusion.outputs:r>`),r.push(n(e.aoMap,"occlusion"))),null!==e.roughnessMap&&1===e.roughness?(s.push(`${i}float inputs:roughness.connect = </Materials/Material_${e.id}/Texture_${e.roughnessMap.id}_roughness.outputs:g>`),r.push(n(e.roughnessMap,"roughness"))):s.push(`${i}float inputs:roughness = ${e.roughness}`),null!==e.metalnessMap&&1===e.metalness?(s.push(`${i}float inputs:metallic.connect = </Materials/Material_${e.id}/Texture_${e.metalnessMap.id}_metallic.outputs:b>`),r.push(n(e.metalnessMap,"metallic"))):s.push(`${i}float inputs:metallic = ${e.metalness}`),null!==e.alphaMap?(s.push(`${i}float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.alphaMap.id}_opacity.outputs:r>`),s.push(`${i}float inputs:opacityThreshold = 0.0001`),r.push(n(e.alphaMap,"opacity"))):s.push(`${i}float inputs:opacity = ${e.opacity}`),e.isMeshPhysicalMaterial&&(s.push(`${i}float inputs:clearcoat = ${e.clearcoat}`),s.push(`${i}float inputs:clearcoatRoughness = ${e.clearcoatRoughness}`),s.push(`${i}float inputs:ior = ${e.ior}`)),`
def Material "Material_${e.id}"
{
def Shader "PreviewSurface"
{
uniform token info:id = "UsdPreviewSurface"
${s.join("\n")}
int inputs:useSpecularWorkflow = 0
token outputs:surface
}
token outputs:surface.connect = </Materials/Material_${e.id}/PreviewSurface.outputs:surface>
token inputs:frame:stPrimvarName = "st"
def Shader "uvReader_st"
{
uniform token info:id = "UsdPrimvarReader_float2"
token inputs:varname.connect = </Materials/Material_${e.id}.inputs:frame:stPrimvarName>
float2 inputs:fallback = (0.0, 0.0)
float2 outputs:result
}
${r.join("\n")}
}
`}(r,t))}return`def "Materials"
{
${i.join("")}
}
`}(r,n),t[i]=Ar(s),s=null,n){let A=n[a],o=a.split("_")[1],l=1023===A.format,h=function(e,t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let i=1024/Math.max(e.width,e.height),s=document.createElement("canvas");s.width=e.width*Math.min(1,i),s.height=e.height*Math.min(1,i);let r=s.getContext("2d");if(r.drawImage(e,0,0,s.width,s.height),void 0!==t){let n=parseInt(t,16),a=(n>>16&255)/255,A=(n>>8&255)/255,o=(255&n)/255,l=r.getImageData(0,0,s.width,s.height),h=l.data;for(let c=0;c<h.length;c+=4)h[c+0]=h[c+0]*a,h[c+1]=h[c+1]*A,h[c+2]=h[c+2]*o;r.putImageData(l,0,0)}return s}}(A.image,o),c=await new Promise(e=>h.toBlob(e,l?"image/png":"image/jpeg",1));t[`textures/Texture_${a}.${l?"png":"jpg"}`]=new Uint8Array(await c.arrayBuffer())}let u=0;for(let g in t){let d=t[g],p=34+g.length;u+=p;let m=63&u;if(4!==m){let I=64-m,f=new Uint8Array(I);t[g]=[d,{extra:{12345:f}}]}u=d.length}return function(e,t){t||(t={});var i={},s=[];Ae(e,"",i,t);var r=0,n=0;for(var a in i){var A=i[a],o=A[0],l=A[1],h=0==l.level?0:8,c=Ar(a),u=c.length,g=l.comment,d=g&&Ar(g),p=d&&d.length,m=An(l.extra);if(u>65535)throw"filename too long";var I=h?function(e,t){var i;return a8(e,null==(i=t||{}).level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+i.mem,0,0,!0)}(o,l):o,f=I.length,E=a6();E.p(o),s.push(a9(l,{size:o.length,crc:E.d(),c:I,f:c,m:d,u:u!=a.length||d&&g.length!=p,o:r,compression:h})),r+=30+u+m+f,n+=76+2*(u+m)+(p||0)+f}for(var C=new aQ(n+22),B=r,y=n-r,Q=0;Q<s.length;++Q){var c=s[Q];Aa(C,c.o,c,c.f,c.u,c.c.length);var w=30+c.f.length+An(c.extra);C.set(c.c,c.o+w),Aa(C,r,c,c.f,c.u,c.c.length,c.o,c.m),r+=16+w+(c.m?c.m.length:0)}return AA(C,r,s.length,y,B),C}(t,{level:0})}}function Al(){return`#usda 1.0
(
customLayerData = {
string creator = "Three.js USDZExporter"
}
metersPerUnit = 1
upAxis = "Y"
)
`}function Ah(e){let t=e.elements;return`( ${Ac(t,0)}, ${Ac(t,4)}, ${Ac(t,8)}, ${Ac(t,12)} )`}function Ac(e,t){return`(${e[t+0]}, ${e[t+1]}, ${e[t+2]}, ${e[t+3]})`}function Au(e,t){if(void 0===e)return console.warn("USDZExporter: Normals missing."),Array(t).fill("(0, 0, 0)").join(", ");let i=[];for(let s=0;s<e.count;s++){let r=e.getX(s),n=e.getY(s),a=e.getZ(s);i.push(`(${r.toPrecision(7)}, ${n.toPrecision(7)}, ${a.toPrecision(7)})`)}return i.join(", ")}function Ag(e){return`(${e.r}, ${e.g}, ${e.b})`}function Ad(e){return`(${e.x}, ${e.y})`}/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var Ap=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let Am=!1,AI=!1,Af="#model-viewer-no-ar-fallback",AE=(m=["quick-look","scene-viewer","webxr","none"],e=>{try{let t=no(e),i=(t.length?t[0].terms:[]).filter(e=>e&&"ident"===e.type).map(e=>e.value).filter(e=>m.indexOf(e)>-1),s=new Set;for(let r of i)s.add(r);return s}catch(n){}return new Set}),AC={QUICK_LOOK:"quick-look",SCENE_VIEWER:"scene-viewer",WEBXR:"webxr",NONE:"none"},AB=Symbol("arButtonContainer"),Ay=Symbol("enterARWithWebXR"),AQ=Symbol("openSceneViewer"),Aw=Symbol("openIOSARQuickLook"),Av=Symbol("canActivateAR"),AS=Symbol("arMode"),Ab=Symbol("arModes"),Ax=Symbol("arAnchor"),AM=Symbol("preload"),AR=Symbol("onARButtonContainerClick"),AD=Symbol("onARStatus"),AT=Symbol("onARTracking"),AL=Symbol("onARTap"),AF=Symbol("selectARMode"),Ak=Symbol("triggerLoad"),A_=Symbol("evaluate"),AU=Symbol("lastValue");class AN{constructor(){this[ei]=null}static evaluatableFor(e,t=nm){if(e instanceof AN)return e;if("number"===e.type)return"%"===e.unit?new AO(e,t):e;switch(e.name.value){case"calc":return new AJ(e,t);case"env":return new Aq(e)}return nm}static evaluate(e){return e instanceof AN?e.evaluate():e}static isConstant(e){return!(e instanceof AN)||e.isConstant}static applyIntrinsics(e,t){let{basis:i,keywords:s}=t,{auto:r}=s;return i.map((t,i)=>{let n=null==r[i]?t:r[i],a=e[i]?e[i]:n;if("ident"===a.type){let A=a.value;A in s&&(a=s[A][i])}return((null==a||"ident"===a.type)&&(a=n),"%"===a.unit)?nA(a.number/100*t.number,t.unit):(a=nE(a,t)).unit!==t.unit?t:a})}get isConstant(){return!1}evaluate(){return this.isConstant&&null!=this[AU]||(this[AU]=this[A_]()),this[AU]}}ei=AU;let AG=Symbol("percentage"),AP=Symbol("basis");class AO extends AN{constructor(e,t){super(),this[AG]=e,this[AP]=t}get isConstant(){return!0}[A_](){return nA(this[AG].number/100*this[AP].number,this[AP].unit)}}let AH=Symbol("identNode");class Aq extends AN{constructor(e){super(),this[es]=null;let t=e.arguments.length?e.arguments[0].terms[0]:null;null!=t&&"ident"===t.type&&(this[AH]=t)}get isConstant(){return!1}[(es=AH,A_)](){if(null!=this[AH]&&"window-scroll-y"===this[AH].value){let e=window.pageYOffset,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),i=e/(t-window.innerHeight)||0;return{type:"number",number:i,unit:null}}return nm}}let AK=/[\*\/]/,AV=Symbol("evaluator");class AJ extends AN{constructor(e,t=nm){if(super(),this[er]=null,1!==e.arguments.length)return;let i=e.arguments[0].terms.slice(),s=[];for(;i.length;){let r=i.shift();if(s.length>0){let n=s[s.length-1];if("operator"===n.type&&AK.test(n.value)){let a=s.pop(),A=s.pop();if(null==A)return;s.push(new A$(a,AN.evaluatableFor(A,t),AN.evaluatableFor(r,t)));continue}}s.push("operator"===r.type?r:AN.evaluatableFor(r,t))}for(;s.length>2;){let[o,l,h]=s.splice(0,3);if("operator"!==l.type)return;s.unshift(new A$(l,AN.evaluatableFor(o,t),AN.evaluatableFor(h,t)))}1===s.length&&(this[AV]=s[0])}get isConstant(){return null==this[AV]||AN.isConstant(this[AV])}[(er=AV,A_)](){return null!=this[AV]?AN.evaluate(this[AV]):nm}}let AY=Symbol("operator"),Aj=Symbol("left"),Az=Symbol("right");class A$ extends AN{constructor(e,t,i){super(),this[AY]=e,this[Aj]=t,this[Az]=i}get isConstant(){return AN.isConstant(this[Aj])&&AN.isConstant(this[Az])}[A_](){let e;let t=nE(AN.evaluate(this[Aj])),i=nE(AN.evaluate(this[Az])),{number:s,unit:r}=t,{number:n,unit:a}=i;if(null!=a&&null!=r&&a!=r)return nm;switch(this[AY].value){case"+":e=s+n;break;case"-":e=s-n;break;case"/":e=s/n;break;case"*":e=s*n;break;default:return nm}return{type:"number",number:e,unit:r||a}}}let AW=Symbol("evaluatables"),AX=Symbol("intrinsics");class AZ extends AN{constructor(e,t){super(),this[AX]=t;let i=e[0],s=null!=i?i.terms:[];this[AW]=t.basis.map((e,t)=>{let i=s[t];return null==i?{type:"ident",value:"auto"}:"ident"===i.type?i:AN.evaluatableFor(i,e)})}get isConstant(){for(let e of this[AW])if(!AN.isConstant(e))return!1;return!0}[A_](){let e=this[AW].map(e=>AN.evaluate(e));return AN.applyIntrinsics(e,this[AX]).map(e=>e.number)}}let A0=Symbol("instances"),A1=Symbol("activateListener"),A2=Symbol("deactivateListener"),A3=Symbol("notifyInstances"),A4=Symbol("notify"),A8=Symbol("callback");class A5{constructor(e){this[A8]=e}static[A3](){for(let e of A5[A0])e[A4]()}static[(en=A0,A1)](){window.addEventListener("scroll",this[A3],{passive:!0})}static[A2](){window.removeEventListener("scroll",this[A3])}observe(){0===A5[A0].size&&A5[A1](),A5[A0].add(this)}disconnect(){A5[A0].delete(this),0===A5[A0].size&&A5[A2]()}[A4](){this[A8]()}}A5[en]=new Set;let A6=Symbol("computeStyleCallback"),A9=Symbol("astWalker"),A7=Symbol("dependencies"),oe=Symbol("onScroll");class ot{constructor(e){this[ea]={},this[eA]=new np(["function"]),this[eo]=()=>{this[A6]({relatedState:"window-scroll"})},this[A6]=e}observeEffectsFor(e){let t={},i=this[A7];for(let s in this[A9].walk(e,e=>{let{name:s}=e,r=e.arguments[0],n=r.terms[0];if("env"===s.value&&null!=n&&"ident"===n.type&&"window-scroll-y"===n.value&&null==t["window-scroll"]){let a="window-scroll"in i?i["window-scroll"]:new A5(this[oe]);a.observe(),delete i["window-scroll"],t["window-scroll"]=a}}),i){let r=i[s];r.disconnect()}this[A7]=t}dispose(){for(let e in this[A7]){let t=this[A7][e];t.disconnect()}}}ea=A7,eA=A9,eo=oe;/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let oi=e=>{let t=e.observeEffects||!1,i=e.intrinsics instanceof Function?e.intrinsics:()=>e.intrinsics;return(s,r)=>{let n=s.updated,a=s.connectedCallback,A=s.disconnectedCallback,o=Symbol(`${r}StyleEffector`),l=Symbol(`${r}StyleEvaluator`),h=Symbol(`${r}UpdateEvaluator`),c=Symbol(`${r}EvaluateAndSync`);Object.defineProperties(s,{[o]:{value:null,writable:!0},[l]:{value:null,writable:!0},[h]:{value:function(){let e=no(this[r]);this[l]=new AZ(e,i(this)),null==this[o]&&t&&(this[o]=new ot(()=>this[c]())),null!=this[o]&&this[o].observeEffectsFor(e)}},[c]:{value:function(){if(null==this[l])return;let t=this[l].evaluate();this[e.updateHandler](t)}},updated:{value:function(e){e.has(r)&&(this[h](),this[c]()),n.call(this,e)}},connectedCallback:{value:function(){a.call(this),this.requestUpdate(r,this[r])}},disconnectedCallback:{value:function(){A.call(this),null!=this[o]&&(this[o].dispose(),this[o]=null)}}})}},os=new el.FM8,or=new el.Pa4,on=Object.freeze({minimumRadius:0,maximumRadius:1/0,minimumPolarAngle:Math.PI/8,maximumPolarAngle:Math.PI-Math.PI/8,minimumAzimuthalAngle:-1/0,maximumAzimuthalAngle:1/0,minimumFieldOfView:10,maximumFieldOfView:45,touchAction:"none"}),oa=Math.PI/8,oA={USER_INTERACTION:"user-interaction",NONE:"none",AUTOMATIC:"automatic"};class oo extends el.pBf{constructor(e,t,i){super(),this.camera=e,this.element=t,this.scene=i,this.orbitSensitivity=1,this.inputSensitivity=1,this.changeSource=oA.NONE,this._interactionEnabled=!1,this._disableZoom=!1,this.isUserPointing=!1,this.enablePan=!0,this.enableTap=!0,this.panProjection=new el.Vkp,this.panPerPixel=0,this.spherical=new el.$V,this.goalSpherical=new el.$V,this.thetaDamper=new sf,this.phiDamper=new sf,this.radiusDamper=new sf,this.logFov=Math.log(on.maximumFieldOfView),this.goalLogFov=this.logFov,this.fovDamper=new sf,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 t of this.pointers)this.onPointerUp(new PointerEvent("pointercancel",Object.assign(Object.assign({},this.startPointerPosition),{pointerId:t.id})))},this.touchModeZoom=(e,t)=>{if(!this._disableZoom){let i=this.twoTouchDistance(this.pointers[0],this.pointers[1]),s=.04*(this.lastSeparation-i)*50/this.scene.height;this.lastSeparation=i,this.userAdjustOrbit(0,0,s)}this.panPerPixel>0&&this.movePan(e,t)},this.disableScroll=e=>{e.preventDefault()},this.touchModeRotate=(e,t)=>{let{touchAction:i}=this._options;if(!this.touchDecided&&"none"!==i){this.touchDecided=!0;let s=Math.abs(e),r=Math.abs(t);if(this.changeSource===oA.USER_INTERACTION&&("pan-y"===i&&r>s||"pan-x"===i&&s>r)){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(i){}this.pointers.push({clientX:e.clientX,clientY:e.clientY,id:e.pointerId}),this.isUserPointing=!1,"touch"===e.pointerType?(this.changeSource=e.altKey?oA.AUTOMATIC:oA.USER_INTERACTION,this.onTouchChange(e)):(this.changeSource=oA.USER_INTERACTION,this.onMouseDown(e))},this.onPointerMove=e=>{let t=this.pointers.find(t=>t.id===e.pointerId);if(null==t)return;let i=this.pointers.length,s=(e.clientX-t.clientX)/i,r=(e.clientY-t.clientY)/i;(0!==s||0!==r)&&(t.clientX=e.clientX,t.clientY=e.clientY,"touch"===e.pointerType?(this.changeSource=e.altKey?oA.AUTOMATIC:oA.USER_INTERACTION,null!==this.touchMode&&this.touchMode(s,r)):(this.changeSource=oA.USER_INTERACTION,this.panPerPixel>0?this.movePan(s,r):this.handleSinglePointerMove(s,r)))},this.onPointerUp=e=>{let{element:t}=this,i=this.pointers.findIndex(t=>t.id===e.pointerId);-1!==i&&this.pointers.splice(i,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[oL].style.opacity=0,t.style.cursor="grab",this.panPerPixel=0,this.isUserPointing&&this.dispatchEvent({type:"pointer-change-end"})},this.onWheel=e=>{this.changeSource=oA.USER_INTERACTION;let t=e.deltaY*(1==e.deltaMode?18:1)*.04/30;this.userAdjustOrbit(0,0,t),e.preventDefault()},this.onKeyDown=e=>{let{changeSource:t}=this;this.changeSource=oA.USER_INTERACTION;let i=e.shiftKey&&this.enablePan?this.panKeyCodeHandler(e):this.orbitZoomKeyCodeHandler(e);i?e.preventDefault():this.changeSource=t},this._options=Object.assign({},on),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 el.$V){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.near=Math.max(e,t/1e3),this.camera.far=t,this.camera.updateProjectionMatrix()}updateAspect(e){this.camera.aspect=e,this.camera.updateProjectionMatrix()}setOrbit(e=this.goalSpherical.theta,t=this.goalSpherical.phi,i=this.goalSpherical.radius){let{minimumAzimuthalAngle:s,maximumAzimuthalAngle:r,minimumPolarAngle:n,maximumPolarAngle:a,minimumRadius:A,maximumRadius:o}=this._options,{theta:l,phi:h,radius:c}=this.goalSpherical,u=tI(e,s,r);isFinite(s)||isFinite(r)||(this.spherical.theta=this.wrapAngle(this.spherical.theta-u)+u);let g=tI(t,n,a),d=tI(i,A,o);return(u!==l||g!==h||d!==c)&&(this.goalSpherical.theta=u,this.goalSpherical.phi=g,this.goalSpherical.radius=d,this.goalSpherical.makeSafe(),!0)}setRadius(e){this.goalSpherical.radius=e,this.setOrbit()}setFieldOfView(e){let{minimumFieldOfView:t,maximumFieldOfView:i}=this._options;e=tI(e,t,i),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,i){let{theta:s,phi:r,radius:n}=this.goalSpherical,{minimumRadius:a,maximumRadius:A,minimumFieldOfView:o,maximumFieldOfView:l}=this._options,h=this.spherical.theta-s,c=Math.PI-.001,u=s-tI(e,-c-h,c-h),g=0===i?0:((i>0?A:a)-n)/(Math.log(i>0?l:o)-this.goalLogFov),d=n+i*(isFinite(g)?g:(A-a)*2);if(this.setOrbit(u,r-t,d),0!==i){let p=this.goalLogFov+i;this.setFieldOfView(Math.exp(p))}}jumpToGoal(){this.update(0,1e4)}update(e,t){if(this.isStationary())return;let{maximumPolarAngle:i,maximumRadius:s}=this._options,r=this.spherical.theta-this.goalSpherical.theta;!(Math.abs(r)>Math.PI)||isFinite(this._options.minimumAzimuthalAngle)||isFinite(this._options.maximumAzimuthalAngle)||(this.spherical.theta-=2*Math.sign(r)*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,i),this.spherical.radius=this.radiusDamper.update(this.spherical.radius,this.goalSpherical.radius,t,s),this.logFov=this.fovDamper.update(this.logFov,this.goalLogFov,t,1),this.moveCamera()}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}dispatchChange(){this.dispatchEvent({type:"change",source:this.changeSource})}moveCamera(){this.spherical.makeSafe(),this.camera.position.setFromSpherical(this.spherical),this.camera.setRotationFromEuler(new el.USm(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()),this.dispatchChange()}userAdjustOrbit(e,t,i){this.adjustOrbit(e*this.orbitSensitivity*this.inputSensitivity,t*this.orbitSensitivity*this.inputSensitivity,i*this.inputSensitivity),this.dispatchChange()}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.element.clientHeight}twoTouchDistance(e,t){let{clientX:i,clientY:s}=e,{clientX:r,clientY:n}=t,a=r-i,A=n-s;return Math.sqrt(a*a+A*A)}handleSinglePointerMove(e,t){let i=this.pixelLengthToSphericalAngle(e),s=this.pixelLengthToSphericalAngle(t);!1===this.isUserPointing&&(this.isUserPointing=!0,this.dispatchEvent({type:"pointer-change-start"})),this.userAdjustOrbit(i,s,0)}initializePan(){let{theta:e,phi:t}=this.spherical,i=e-this.scene.yaw;this.panPerPixel=.018/this.scene.height,this.panProjection.set(-Math.cos(i),-Math.cos(t)*Math.sin(i),0,0,Math.sin(t),0,Math.sin(i),-Math.cos(t)*Math.cos(i),0)}movePan(e,t){let{scene:i}=this,s=or.set(e,t,0).multiplyScalar(this.inputSensitivity),r=this.spherical.radius*Math.exp(this.logFov)*this.panPerPixel;s.multiplyScalar(r);let n=i.getTarget();n.add(s.applyMatrix3(this.panProjection)),i.boundingSphere.clampPoint(n,n),i.setTarget(n.x,n.y,n.z),this.dispatchChange()}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,i=t.positionAndNormalFromPoint(t.getNDC(e.clientX,e.clientY));if(null==i){let{cameraTarget:s}=t.element;t.element.cameraTarget="",t.element.cameraTarget=s,this.userAdjustOrbit(0,0,1)}else t.target.worldToLocal(i.position),t.setTarget(i.position.x,i.position.y,i.position.z)}resetRadius(){let{scene:e}=this,t=e.positionAndNormalFromPoint(os.set(0,0));if(null==t)return;e.target.worldToLocal(t.position);let i=e.getTarget(),{theta:s,phi:r}=this.spherical,n=s-e.yaw,a=or.set(Math.sin(r)*Math.sin(n),Math.cos(r),Math.sin(r)*Math.cos(n)),A=a.dot(t.position.sub(i));i.add(a.multiplyScalar(A)),e.setTarget(i.x,i.y,i.z),this.setOrbit(void 0,void 0,this.goalSpherical.radius-A)}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[oL].style.opacity=1))}}onMouseDown(e){this.panPerPixel=0,this.enablePan&&(2===e.button||e.ctrlKey||e.metaKey||e.shiftKey)&&(this.initializePan(),this.scene.element[oL].style.opacity=1),this.element.style.cursor="grabbing"}orbitZoomKeyCodeHandler(e){let t=!0;switch(e.key){case"PageUp":this.userAdjustOrbit(0,0,.04);break;case"PageDown":this.userAdjustOrbit(0,0,-.04);break;case"ArrowUp":this.userAdjustOrbit(0,-oa,0);break;case"ArrowDown":this.userAdjustOrbit(0,oa,0);break;case"ArrowLeft":this.userAdjustOrbit(-oa,0,0);break;case"ArrowRight":this.userAdjustOrbit(oa,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}}/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let ol=e=>e<.5?2*e*e:-1+(4-2*e)*e,oh=(e,t,i=ol)=>s=>e+(t-e)*i(s),oc=(e,t)=>{var i;let s=t.map((i=0,e=>i+=e));return t=>{t=tI(t,0,1)*s[s.length-1];let i=s.findIndex(e=>e>=t),r=i<1?0:s[i-1],n=s[i];return e[i]((t-r)/(n-r))}},ou=e=>{let t=[],i=[],s=e.initialValue;for(let r=0;r<e.keyframes.length;++r){let n=e.keyframes[r],{value:a,frames:A}=n,o=n.ease||ol,l=oh(s,a,o);t.push(l),i.push(A),s=a}return oc(t,i)};/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var og=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let od=ou({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}]}),op=ou({initialValue:0,keyframes:[{frames:1,value:1},{frames:5,value:1},{frames:1,value:0},{frames:6,value:0}]}),om="0deg 75deg 105%",oI=["front","right","back","left"],of=["upper-","","lower-"],oE={AUTO:"auto",NONE:"none"},oC={BASIC:"basic",WIGGLE:"wiggle"},oB={PAN_Y:"pan-y",PAN_X:"pan-x",NONE:"none"},oy=()=>({basis:[nI(nA(30,"deg"))],keywords:{auto:[null]}}),oQ=()=>({basis:[nI(nA(12,"deg"))],keywords:{auto:[null]}}),ow=(()=>{let e=no(om)[0].terms,t=nE(e[0]),i=nE(e[1]);return e=>{let s=e[n8].idealCameraDistance();return{basis:[t,i,nA(s,"m")],keywords:{auto:[null,null,nA(105,"%")]}}}})(),ov=e=>{let t=2.2*e[n8].boundingSphere.radius;return{basis:[nA(-1/0,"rad"),nA(Math.PI/8,"rad"),nA(t,"m")],keywords:{auto:[null,null,null]}}},oS=e=>{let t=ow(e),i=new AZ([],t),s=i.evaluate()[2];return{basis:[nA(1/0,"rad"),nA(Math.PI-Math.PI/8,"rad"),nA(s,"m")],keywords:{auto:[null,null,null]}}},ob=e=>{let t=e[n8].boundingBox.getCenter(new el.Pa4);return{basis:[nA(t.x,"m"),nA(t.y,"m"),nA(t.z,"m")],keywords:{auto:[null,null,null]}}},ox=Math.PI/2,oM=Math.PI/3,oR=ox/2,oD=2*Math.PI,oT=Symbol("controls"),oL=Symbol("panElement"),oF=Symbol("promptElement"),ok=Symbol("promptAnimatedContainer"),o_=Symbol("fingerAnimatedContainers"),oU=Symbol("deferInteractionPrompt"),oN=Symbol("updateAria"),oG=Symbol("updateCameraForRadius"),oP=Symbol("onChange"),oO=Symbol("onPointerChange"),oH=Symbol("waitingToPromptUser"),oq=Symbol("userHasInteracted"),oK=Symbol("promptElementVisibleTime"),oV=Symbol("lastPromptOffset"),oJ=Symbol("lastSpherical"),oY=Symbol("jumpCamera"),oj=Symbol("initialized"),oz=Symbol("maintainThetaPhi"),o$=Symbol("syncCameraOrbit"),oW=Symbol("syncFieldOfView"),oX=Symbol("syncCameraTarget"),oZ=Symbol("syncMinCameraOrbit"),o0=Symbol("syncMaxCameraOrbit"),o1=Symbol("syncMinFieldOfView"),o2=Symbol("syncMaxFieldOfView");/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var o3=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let o4={AUTO:"auto",MANUAL:"manual"},o8={AUTO:"auto",LAZY:"lazy",EAGER:"eager"},o5=Symbol("defaultProgressBarElement"),o6=Symbol("posterContainerElement"),o9=Symbol("defaultPosterElement"),o7=Symbol("shouldDismissPoster"),le=Symbol("hidePoster"),lt=Symbol("modelIsRevealed"),li=Symbol("updateProgressBar"),ls=Symbol("ariaLabelCallToAction"),lr=Symbol("onProgress");/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var ln=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let la={basis:[nI(nA(Math.PI/32,"rad"))],keywords:{auto:[null]}},lA=Symbol("autoRotateStartTime"),lo=Symbol("radiansPerSecond"),ll=Symbol("syncRotationRate"),lh=Symbol("onCameraChange"),lc=(e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this[t]=new Map,this[i]=e=>{e.forEach(e=>{e instanceof MutationRecord&&"childList"!==e.type||(e.addedNodes.forEach(e=>{this[ap](e)}),e.removedNodes.forEach(e=>{this[am](e)}),this[n5]())})},this[s]=new MutationObserver(this[ag])}connectedCallback(){super.connectedCallback();for(let e=0;e<this.children.length;++e)this[ap](this.children[e]);let{ShadyDOM:t}=self;null==t?this[ad].observe(this,{childList:!0}):this[ad]=t.observeChildren(this,this[ag])}disconnectedCallback(){super.disconnectedCallback();let{ShadyDOM:e}=self;null==e?this[ad].disconnect():e.unobserveChildren(this[ad])}[(t=au,i=ag,s=ad,n6)](e,t){super[n6](e,t);let i=this[n8],{annotationRenderer:s}=i,r=i.getCamera();i.shouldRender()&&(i.updateHotspots(r.position),s.domElement.style.display="",s.render(i,r))}updateHotspot(e){let t=this[au].get(e.name);null!=t&&(t.updatePosition(e.position),t.updateNormal(e.normal),this[n5]())}queryHotspot(e){let t=this[au].get(e);if(null==t)return null;let i=an(t.position),s=an(t.normal),r=t.facingCamera,n=this[n8],a=n.getCamera(),A=new el.Pa4;A.setFromMatrixPosition(t.matrixWorld),A.project(a);let o=n.width/2,l=n.height/2;A.x=A.x*o+o,A.y=-(A.y*l)+l;let h=an(new el.Pa4(A.x,A.y,A.z));return Number.isFinite(h.x)&&Number.isFinite(h.y)?{position:i,normal:s,canvasPosition:h,facingCamera:r}:null}positionAndNormalFromPoint(e,t){let i=this[n8],s=i.getNDC(e,t),r=i.positionAndNormalFromPoint(s);if(null==r)return null;aI.copy(i.target.matrixWorld).invert();let n=an(r.position.applyMatrix4(aI));af.getNormalMatrix(aI);let a=an(r.normal.applyNormalMatrix(af)),A=null;return null!=r.uv&&(A=aa(r.uv)),{position:n,normal:a,uv:A}}[ap](e){if(!(e instanceof HTMLElement&&0===e.slot.indexOf("hotspot")))return;let t=this[au].get(e.slot);null!=t?t.increment():(t=new nC({name:e.slot,position:e.dataset.position,normal:e.dataset.normal}),this[au].set(e.slot,t),this[n8].addHotspot(t)),this[n8].queueRender()}[am](e){if(!(e instanceof HTMLElement))return;let t=this[au].get(e.slot);t&&(t.decrement()&&(this[n8].removeHotspot(t),this[au].delete(e.slot)),this[n8].queueRender())}}return r})((e=>{var t,i,s,r;class n extends e{constructor(){super(...arguments),this[t]=void 0,this[i]=null,this[s]=new el.dpR,this[r]=null,this.variantName=null,this.orientation="0 0 0",this.scale="1 1 1"}get model(){return this[nr]}get availableVariants(){return this.model?this.model[r5]():[]}get originalGltfJson(){return this[ns]}[(t=nr,i=ni,s=na,r=ns,nn)](){return()=>{this[n5]()}}async createTexture(e,t="image/png"){let i=this[ni],s=await new Promise(t=>this[na].load(e,t));return i&&s?(s.encoding=el.knz,s.wrapS=el.rpg,s.wrapT=el.rpg,s.flipY=!1,s.userData.mimeType=t,new rg(this[nn](),s)):null}async updated(e){if(super.updated(e),e.has("variantName")){let t=this[at].beginActivity();t(.1);let i=this[nr],{variantName:s}=this;null!=i&&(await i[r1](s),this[n5](),this.dispatchEvent(new CustomEvent("variant-applied"))),t(1)}if(e.has("orientation")||e.has("scale")){if(!this.loaded)return;let r=this[n8];r.applyTransform(),r.updateBoundingBox(),r.updateShadow(),this[ae].arRenderer.onUpdateScene(),this[n5]()}}[n9](){super[n9]();let{currentGLTF:e}=this[n8];if(null!=e){let{correlatedSceneGraph:t}=e;null!=t&&e!==this[ni]&&(this[nr]=new ne(t,this[nn]()),this[ns]=JSON.parse(JSON.stringify(t.gltf))),"variants"in e.userData&&this.requestUpdate("variantName")}this[ni]=e}async exportScene(e){let t=this[n8];return new Promise(async(i,s)=>{let r={binary:!0,onlyVisible:!0,maxTextureSize:1/0,includeCustomExtensions:!1,forceIndices:!1};Object.assign(r,e),r.animations=t.animations,r.truncateDrawRange=!0;let n=t.shadow,a=!1;null!=n&&(a=n.visible,n.visible=!1),await this[nr][r0]();let A=new i5().register(e=>new sp(e));A.parse(t.model,e=>i(new Blob([r.binary?e:JSON.stringify(e)],{type:r.binary?"application/octet-stream":"application/json"})),()=>s("glTF export failed"),r),null!=n&&(n.visible=a)})}materialFromPoint(e,t){let i=this[n8],s=i.getNDC(e,t);return i.raycaster.setFromCamera(s,i.getCamera()),this[nr][r4](i.raycaster)}}return nt([u({type:String,attribute:"variant-name"})],n.prototype,"variantName",void 0),nt([u({type:String,attribute:"orientation"})],n.prototype,"orientation",void 0),nt([u({type:String,attribute:"scale"})],n.prototype,"scale",void 0),n})((e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this.autoRotate=!1,this.autoRotateDelay=3e3,this.rotationPerSecond="auto",this[t]=performance.now(),this[i]=0,this[s]=e=>{this.autoRotate&&"user-interaction"===e.detail.source&&(this[lA]=performance.now())}}connectedCallback(){super.connectedCallback(),this.addEventListener("camera-change",this[lh]),this[lA]=performance.now()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("camera-change",this[lh]),this[lA]=performance.now()}updated(e){super.updated(e),e.has("autoRotate")&&(this[lA]=performance.now())}[(t=lA,i=lo,ll)](e){this[lo]=e[0]}[n6](e,t){if(super[n6](e,t),!this.autoRotate||!this[as]()||this[ae].isPresenting)return;let i=Math.min(t,e-this[lA]-this.autoRotateDelay);i>0&&(this[n8].yaw=this.turntableRotation+this[lo]*i*.001)}get turntableRotation(){return this[n8].yaw}resetTurntableRotation(e=0){this[n8].yaw=e}}return s=lh,ln([u({type:Boolean,attribute:"auto-rotate"})],r.prototype,"autoRotate",void 0),ln([u({type:Number,attribute:"auto-rotate-delay"})],r.prototype,"autoRotateDelay",void 0),ln([oi({intrinsics:la,updateHandler:ll}),u({type:String,attribute:"rotation-per-second"})],r.prototype,"rotationPerSecond",void 0),r})((e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this.environmentImage=null,this.skyboxImage=null,this.shadowIntensity=0,this.shadowSoftness=1,this.exposure=1,this[t]=null,this[i]=null,this[s]=null}updated(e){super.updated(e),e.has("shadowIntensity")&&(this[n8].setShadowIntensity(.5*this.shadowIntensity),this[n5]()),e.has("shadowSoftness")&&(this[n8].setShadowSoftness(this.shadowSoftness),this[n5]()),e.has("exposure")&&(this[n8].exposure=this.exposure,this[n5]()),(e.has("environmentImage")||e.has("skyboxImage"))&&this[ar]()&&this[tv]()}hasBakedShadow(){return this[n8].bakedShadows.size>0}async [(t=tQ,i=tw,s=tS,tv)](){let{skyboxImage:e,environmentImage:t}=this;null!=this[tS]&&(this[tS](),this[tS]=null);let{textureUtils:i}=this[ae];if(null==i)return;let s=this[at].beginActivity();try{let{environmentMap:r,skybox:n}=await i.generateEnvironmentMapAndSkybox(tu(e),t,e=>s(tI(e,0,1)));this[tQ]!==r&&(this[tQ]=r,this.dispatchEvent(new CustomEvent("environment-change"))),null!=n?this[tw]=n.name===r.name?r:n:this[tw]=null,this[n8].setEnvironmentAndSkybox(this[tQ],this[tw]),this[n8].dispatchEvent({type:"envmap-update"})}catch(a){if(a instanceof Error)throw this[n8].setEnvironmentAndSkybox(null,null),a}finally{s(1)}}}return ty([u({type:String,attribute:"environment-image"})],r.prototype,"environmentImage",void 0),ty([u({type:String,attribute:"skybox-image"})],r.prototype,"skyboxImage",void 0),ty([u({type:Number,attribute:"shadow-intensity"})],r.prototype,"shadowIntensity",void 0),ty([u({type:Number,attribute:"shadow-softness"})],r.prototype,"shadowSoftness",void 0),ty([u({type:Number})],r.prototype,"exposure",void 0),r})((e=>{var t,i,s,r,n,a,A,o,l,h,c,g,d,p,m;class I extends e{constructor(){super(...arguments),this.cameraControls=!1,this.cameraOrbit=om,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=oE.AUTO,this.interactionPromptStyle=oC.WIGGLE,this.orbitSensitivity=1,this.touchAction=oB.NONE,this.disableZoom=!1,this.disablePan=!1,this.disableTap=!1,this.interpolationDecay=50,this[t]=this.shadowRoot.querySelector(".interaction-prompt"),this[i]=this.shadowRoot.querySelector("#prompt"),this[s]=[this.shadowRoot.querySelector("#finger0"),this.shadowRoot.querySelector("#finger1")],this[r]=this.shadowRoot.querySelector(".pan-target"),this[n]=0,this[a]=1/0,this[A]=!1,this[o]=!1,this[l]=new oo(this[n8].camera,this[n3],this[n8]),this[h]=new el.$V,this[c]=!1,this[g]=!1,this[d]=!1,this[p]=({source:e})=>{this[oN](),this[n5](),e===oA.USER_INTERACTION&&(this[oq]=!0,this[oU]()),this.dispatchEvent(new CustomEvent("camera-change",{detail:{source:e}}))},this[m]=e=>{"pointer-change-start"===e.type?this[n2].classList.add("pointer-tumbling"):this[n2].classList.remove("pointer-tumbling")}}get inputSensitivity(){return this[oT].inputSensitivity}set inputSensitivity(e){this[oT].inputSensitivity=e}getCameraOrbit(){let{theta:e,phi:t,radius:i}=this[oJ];return{theta:e,phi:t,radius:i,toString(){return`${this.theta}rad ${this.phi}rad ${this.radius}m`}}}getCameraTarget(){return an(this[ae].isPresenting?this[ae].arRenderer.target:this[n8].getTarget())}getFieldOfView(){return this[oT].getFieldOfView()}getMinimumFieldOfView(){return this[oT].options.minimumFieldOfView}getMaximumFieldOfView(){return this[oT].options.maximumFieldOfView}getIdealAspect(){return this[n8].idealAspect}jumpCameraToGoal(){this[oY]=!0,this.requestUpdate(oY,!1)}resetInteractionPrompt(){this[oV]=0,this[oK]=1/0,this[oq]=!1,this[oH]=this.interactionPrompt===oE.AUTO&&this.cameraControls}zoom(e){let t=new WheelEvent("wheel",{deltaY:-30*e});this[n3].dispatchEvent(t)}connectedCallback(){super.connectedCallback(),this[oT].addEventListener("change",this[oP]),this[oT].addEventListener("pointer-change-start",this[oO]),this[oT].addEventListener("pointer-change-end",this[oO])}disconnectedCallback(){super.disconnectedCallback(),this[oT].removeEventListener("change",this[oP]),this[oT].removeEventListener("pointer-change-start",this[oO]),this[oT].removeEventListener("pointer-change-end",this[oO])}updated(e){super.updated(e);let t=this[oT],i=this[n8];if(e.has("cameraControls")&&(this.cameraControls?(t.enableInteraction(),this.interactionPrompt===oE.AUTO&&(this[oH]=!0)):(t.disableInteraction(),this[oU]()),this[n3].setAttribute("aria-label",this[nz])),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===oE.AUTO&&this.cameraControls&&!this[oq]?this[oH]=!0:this[oU]()),e.has("interactionPromptStyle")&&(this[ok].style.opacity=this.interactionPromptStyle==oC.BASIC?"1":"0"),e.has("touchAction")){let s=this.touchAction;t.applyOptions({touchAction:s}),t.updateTouchActionStyle()}e.has("orbitSensitivity")&&(t.orbitSensitivity=this.orbitSensitivity),e.has("interpolationDecay")&&(t.setDamperDecayTime(this.interpolationDecay),i.setTargetDamperDecayTime(this.interpolationDecay)),!0===this[oY]&&Promise.resolve().then(()=>{t.jumpToGoal(),i.jumpToGoal(),this[oY]=!1})}async updateFraming(){let e=this[n8],t=e.adjustedFoV(e.framedFoVDeg);await e.updateFraming();let i=e.adjustedFoV(e.framedFoVDeg),s=this[oT].getFieldOfView()/t;this[oT].setFieldOfView(i*s),this[oz]=!0,this.requestUpdate("maxFieldOfView"),this.requestUpdate("fieldOfView"),this.requestUpdate("minCameraOrbit"),this.requestUpdate("maxCameraOrbit"),this.requestUpdate("cameraOrbit"),await this.updateComplete}interact(e,t,i){let s=this[n3],r=this[o_];if("1"===r[0].style.opacity){console.warn("interact() failed because an existing interaction is running.");return}let n=[];n.push({x:ou(t.x),y:ou(t.y)});let a=[{x:n[0].x(0),y:n[0].y(0)}];null!=i&&(n.push({x:ou(i.x),y:ou(i.y)}),a.push({x:n[1].x(0),y:n[1].y(0)}));let A=performance.now(),{width:o,height:l}=this[n8],h=e=>{for(let[t,i]of a.entries()){let{style:n}=r[t];n.transform=`translateX(${o*i.x}px) translateY(${l*i.y}px)`,"pointerdown"===e?n.opacity="1":"pointerup"===e&&(n.opacity="0");let A={pointerId:t-5678,pointerType:"touch",target:s,clientX:o*i.x,clientY:l*i.y,altKey:!0};s.dispatchEvent(new PointerEvent(e,A))}},c=()=>{let{changeSource:t}=this[oT];if(t!==oA.AUTOMATIC||!s.isConnected){for(let i of this[o_])i.style.opacity="0";h("pointercancel"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:t}})),document.removeEventListener("visibilitychange",u);return}let r=Math.min(1,(performance.now()-A)/e);for(let[o,l]of a.entries())l.x=n[o].x(r),l.y=n[o].y(r);h("pointermove"),r<1?requestAnimationFrame(c):(h("pointerup"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:t}})),document.removeEventListener("visibilitychange",u))},u=()=>{let e=0;"hidden"===document.visibilityState?e=performance.now()-A:A=performance.now()-e};document.addEventListener("visibilitychange",u),h("pointerdown"),requestAnimationFrame(c)}[(t=oF,i=ok,s=o_,r=oL,n=oV,a=oK,A=oq,o=oH,l=oT,h=oJ,c=oY,g=oj,d=oz,oW)](e){let t=this[n8];t.framedFoVDeg=180*e[0]/Math.PI,this[oT].setFieldOfView(t.adjustedFoV(t.framedFoVDeg))}[o$](e){let t=this[oT];if(this[oz]){let{theta:i,phi:s}=this.getCameraOrbit();e[0]=i,e[1]=s,this[oz]=!1}t.changeSource=oA.NONE,t.setOrbit(e[0],e[1],e[2])}[oZ](e){this[oT].applyOptions({minimumAzimuthalAngle:e[0],minimumPolarAngle:e[1],minimumRadius:e[2]}),this.jumpCameraToGoal()}[o0](e){this[oT].applyOptions({maximumAzimuthalAngle:e[0],maximumPolarAngle:e[1],maximumRadius:e[2]}),this[oG](e[2]),this.jumpCameraToGoal()}[o1](e){this[oT].applyOptions({minimumFieldOfView:180*e[0]/Math.PI}),this.jumpCameraToGoal()}[o2](e){let t=this[n8].adjustedFoV(180*e[0]/Math.PI);this[oT].applyOptions({maximumFieldOfView:t}),this.jumpCameraToGoal()}[oX](e){let[t,i,s]=e;this[ae].arRenderer.isPresenting||this[n8].setTarget(t,i,s),this[oT].changeSource=oA.NONE,this[ae].arRenderer.updateTarget()}[n6](e,t){if(super[n6](e,t),this[ae].isPresenting||!this[as]())return;let i=this[oT],s=this[n8],r=performance.now();if(this[oH]&&this.loaded&&r>this[nZ]+this.interactionPromptThreshold&&(this[oH]=!1,this[oK]=r,this[oF].classList.add("visible")),isFinite(this[oK])&&this.interactionPromptStyle===oC.WIGGLE){let n=(r-this[oK])/5e3%1,a=od(n),A=op(n);if(this[ok].style.opacity=`${A}`,a!==this[oV]){let o=a*s.width*.05,l=(a-this[oV])*Math.PI/16;this[ok].style.transform=`translateX(${o}px)`,i.changeSource=oA.AUTOMATIC,i.adjustOrbit(l,0,0),this[oV]=a}}i.update(e,t),s.updateTarget(t)&&this[oP]({type:"change",source:i.changeSource})}[oU](){this[oH]=!1,this[oF].classList.remove("visible"),this[oK]=1/0}[oG](e){let t=Math.max(this[n8].boundingSphere.radius,e);this[oT].updateNearFar(0,2*t)}[oN](){let{theta:e,phi:t}=this[oT].getCameraSpherical(this[oJ]),i=oI[(4+Math.floor((e%oD+oR)/ox))%4],s=of[Math.floor(t/oM)];this[nX](`View from stage ${s}${i}`)}get[nz](){return super[nz]+(this.cameraControls?". Use mouse, touch or arrow keys to move.":"")}async [n7](e){let t=this[oT],i=this[n8],s=i.adjustedFoV(i.framedFoVDeg);super[n7](e);let r=i.adjustedFoV(i.framedFoVDeg)/s,n=t.getFieldOfView()*(isFinite(r)?r:1);t.updateAspect(this[n8].aspect),this.requestUpdate("maxFieldOfView",this.maxFieldOfView),await this.updateComplete,this[oT].setFieldOfView(n),this.jumpCameraToGoal()}[n9](){super[n9](),this[oj]?this[oz]=!0:this[oj]=!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()}}return p=oP,m=oO,og([u({type:Boolean,attribute:"camera-controls"})],I.prototype,"cameraControls",void 0),og([oi({intrinsics:ow,observeEffects:!0,updateHandler:o$}),u({type:String,attribute:"camera-orbit",hasChanged:()=>!0})],I.prototype,"cameraOrbit",void 0),og([oi({intrinsics:ob,observeEffects:!0,updateHandler:oX}),u({type:String,attribute:"camera-target",hasChanged:()=>!0})],I.prototype,"cameraTarget",void 0),og([oi({intrinsics:oy,observeEffects:!0,updateHandler:oW}),u({type:String,attribute:"field-of-view",hasChanged:()=>!0})],I.prototype,"fieldOfView",void 0),og([oi({intrinsics:ov,updateHandler:oZ}),u({type:String,attribute:"min-camera-orbit",hasChanged:()=>!0})],I.prototype,"minCameraOrbit",void 0),og([oi({intrinsics:oS,updateHandler:o0}),u({type:String,attribute:"max-camera-orbit",hasChanged:()=>!0})],I.prototype,"maxCameraOrbit",void 0),og([oi({intrinsics:oQ,updateHandler:o1}),u({type:String,attribute:"min-field-of-view",hasChanged:()=>!0})],I.prototype,"minFieldOfView",void 0),og([oi({intrinsics:oy,updateHandler:o2}),u({type:String,attribute:"max-field-of-view",hasChanged:()=>!0})],I.prototype,"maxFieldOfView",void 0),og([u({type:Number,attribute:"interaction-prompt-threshold"})],I.prototype,"interactionPromptThreshold",void 0),og([u({type:String,attribute:"interaction-prompt"})],I.prototype,"interactionPrompt",void 0),og([u({type:String,attribute:"interaction-prompt-style"})],I.prototype,"interactionPromptStyle",void 0),og([u({type:Number,attribute:"orbit-sensitivity"})],I.prototype,"orbitSensitivity",void 0),og([u({type:String,attribute:"touch-action"})],I.prototype,"touchAction",void 0),og([u({type:Boolean,attribute:"disable-zoom"})],I.prototype,"disableZoom",void 0),og([u({type:Boolean,attribute:"disable-pan"})],I.prototype,"disablePan",void 0),og([u({type:Boolean,attribute:"disable-tap"})],I.prototype,"disableTap",void 0),og([u({type:Number,attribute:"interpolation-decay"})],I.prototype,"interpolationDecay",void 0),I})((e=>{var t,i,s,r,n,a,A,o,l,h;class c extends e{constructor(){super(...arguments),this.ar=!1,this.arScale="auto",this.arPlacement="floor",this.arModes="webxr scene-viewer quick-look",this.iosSrc=null,this.xrEnvironment=!1,this[t]=!1,this[i]=this.shadowRoot.querySelector(".ar-button"),this[s]=document.createElement("a"),this[r]=new Set,this[n]=AC.NONE,this[a]=!1,this[A]=e=>{e.preventDefault(),this.activateAR()},this[o]=({status:e})=>{(e===sQ.NOT_PRESENTING||this[ae].arRenderer.presentedScene===this[n8])&&(this.setAttribute("ar-status",e),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:e}})),e===sQ.NOT_PRESENTING?this.removeAttribute("ar-tracking"):e===sQ.SESSION_STARTED&&this.setAttribute("ar-tracking",sw.TRACKING))},this[l]=({status:e})=>{this.setAttribute("ar-tracking",e),this.dispatchEvent(new CustomEvent("ar-tracking",{detail:{status:e}}))},this[h]=e=>{"_apple_ar_quicklook_button_tapped"==e.data&&this.dispatchEvent(new CustomEvent("quick-look-button-tapped"))}}get canActivateAR(){return this[AS]!==AC.NONE}connectedCallback(){super.connectedCallback(),this[ae].arRenderer.addEventListener("status",this[AD]),this.setAttribute("ar-status",sQ.NOT_PRESENTING),this[ae].arRenderer.addEventListener("tracking",this[AT]),this[Ax].addEventListener("message",this[AL])}disconnectedCallback(){super.disconnectedCallback(),this[ae].arRenderer.removeEventListener("status",this[AD]),this[ae].arRenderer.removeEventListener("tracking",this[AT]),this[Ax].removeEventListener("message",this[AL])}update(e){super.update(e),e.has("arScale")&&(this[n8].canScale="fixed"!==this.arScale),e.has("arPlacement")&&(this[n8].updateShadow(),this[n5]()),e.has("arModes")&&(this[Ab]=AE(this.arModes)),(e.has("ar")||e.has("arModes")||e.has("src")||e.has("iosSrc"))&&this[AF]()}async activateAR(){switch(this[AS]){case AC.QUICK_LOOK:this[Aw]();break;case AC.WEBXR:await this[Ay]();break;case AC.SCENE_VIEWER:this[AQ]();break;default:console.warn("No AR Mode can be activated. This is probably due to missing configuration or device capabilities")}}async [(t=Av,i=AB,s=Ax,r=Ab,n=AS,a=AM,A=AR,o=AD,l=AT,h=AL,AF)](){let e=AC.NONE;if(this.ar){if(null!=this.src)for(let t of this[Ab]){if("webxr"===t&&ti&&!Am&&await this[ae].arRenderer.supportsPresentation()){e=AC.WEBXR;break}if("scene-viewer"===t&&tl&&!AI){e=AC.SCENE_VIEWER;break}if("quick-look"===t&&tc){e=AC.QUICK_LOOK;break}}e===AC.NONE&&null!=this.iosSrc&&tc&&(e=AC.QUICK_LOOK)}if(e!==AC.NONE)this[AB].classList.add("enabled"),this[AB].addEventListener("click",this[AR]);else if(this[AB].classList.contains("enabled")){this[AB].removeEventListener("click",this[AR]),this[AB].classList.remove("enabled");let i=sQ.FAILED;this.setAttribute("ar-status",i),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:i}}))}this[AS]=e}async [Ay](){console.log("Attempting to present in AR with WebXR..."),await this[Ak]();try{this[AB].removeEventListener("click",this[AR]);let{arRenderer:e}=this[ae];e.placeOnWall="wall"===this.arPlacement,await e.present(this[n8],this.xrEnvironment)}catch(t){console.warn("Error while trying to present in AR with WebXR"),console.error(t),await this[ae].arRenderer.stopPresenting(),Am=!0,console.warn("Falling back to next ar-mode"),await this[AF](),this.activateAR()}finally{this[AF]()}}async [Ak](){this.loaded||(this[AM]=!0,this[n0](),await tB(this,"load"),this[AM]=!1)}[ar](){return super[ar]()||this[AM]}[AQ](){let e=self.location.toString(),t=new URL(e),i=new URL(this.src,e),s=new URLSearchParams(i.search);if(t.hash=Af,s.set("mode","ar_preferred"),s.has("disable_occlusion")||s.set("disable_occlusion","true"),"fixed"===this.arScale&&s.set("resizable","false"),"wall"===this.arPlacement&&s.set("enable_vertical_placement","true"),s.has("sound")){let r=new URL(s.get("sound"),e);s.set("sound",r.toString())}if(s.has("link")){let n=new URL(s.get("link"),e);s.set("link",n.toString())}let a=`intent://arvr.google.com/scene-viewer/1.0?${s.toString()+"&file="+encodeURIComponent(i.toString())}#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(t.toString())};end;`,A=()=>{self.location.hash===Af&&(AI=!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[AF]())};self.addEventListener("hashchange",A,{once:!0}),this[Ax].setAttribute("href",a),console.log("Attempting to present in AR with Scene Viewer..."),this[Ax].click()}async [Aw](){let e=!this.iosSrc;this[AB].classList.remove("enabled");let t=e?await this.prepareUSDZ():this.iosSrc,i=new URL(t,self.location.toString());if(e){let s=self.location.toString(),r=new URL(s),n=new URL(this.src,r);n.hash&&(i.hash=n.hash)}"fixed"===this.arScale&&(i.hash&&(i.hash+="&"),i.hash+="allowsContentScaling=0");let a=this[Ax];a.setAttribute("rel","ar");let A=document.createElement("img");a.appendChild(A),a.setAttribute("href",i.toString()),e&&a.setAttribute("download","model.usdz"),a.style.display="none",a.isConnected||this.shadowRoot.appendChild(a),console.log("Attempting to present in AR with Quick Look..."),a.click(),a.removeChild(A),e&&URL.revokeObjectURL(t),this[AB].classList.add("enabled")}async prepareUSDZ(){let e=this[at].beginActivity();await this[Ak]();let{model:t,shadow:i}=this[n8];if(null==t)return"";let s=!1;null!=i&&(s=i.visible,i.visible=!1),e(.2);let r=new Ao,n=await r.parse(t),a=new Blob([n],{type:"model/vnd.usdz+zip"}),A=URL.createObjectURL(a);return e(1),null!=i&&(i.visible=s),A}}return Ap([u({type:Boolean,attribute:"ar"})],c.prototype,"ar",void 0),Ap([u({type:String,attribute:"ar-scale"})],c.prototype,"arScale",void 0),Ap([u({type:String,attribute:"ar-placement"})],c.prototype,"arPlacement",void 0),Ap([u({type:String,attribute:"ar-modes"})],c.prototype,"arModes",void 0),Ap([u({type:String,attribute:"ios-src"})],c.prototype,"iosSrc",void 0),Ap([u({type:Boolean,attribute:"xr-environment"})],c.prototype,"xrEnvironment",void 0),c})((e=>{var t,i,s,r,n,a,A,o;class l extends e{constructor(...e){super(...e),this.poster=null,this.reveal=o4.AUTO,this.loading=o8.AUTO,this[t]=!1,this[i]=!1,this[s]=this.shadowRoot.querySelector(".slot.poster"),this[r]=this.shadowRoot.querySelector("#default-poster"),this[n]=this.shadowRoot.querySelector("#default-progress-bar > .bar"),this[a]=this[o9].getAttribute("aria-label"),this[A]=tp(e=>{let t=this[o5].parentNode;requestAnimationFrame(()=>{this[o5].style.transform=`scaleX(${e})`,0===e&&(t.removeChild(this[o5]),t.appendChild(this[o5])),1===e?this[o5].classList.add("hide"):this[o5].classList.remove("hide")})},100),this[o]=e=>{let t=e.detail.totalProgress;1===t&&(this[li].flush(),this.loaded&&(this[o7]||this.reveal===o4.AUTO)&&this[le]()),this[li](t),this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:t}}))};let l=self.ModelViewerElement||{},h=l.dracoDecoderLocation||"https://www.gstatic.com/draco/versioned/decoders/1.4.1/";iX.setDRACODecoderLocation(h);let c=l.ktx2TranscoderLocation||"https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/";iX.setKTX2TranscoderLocation(c),l.meshoptDecoderLocation&&iX.setMeshoptDecoderLocation(l.meshoptDecoderLocation)}static set dracoDecoderLocation(e){iX.setDRACODecoderLocation(e)}static get dracoDecoderLocation(){return iX.getDRACODecoderLocation()}static set ktx2TranscoderLocation(e){iX.setKTX2TranscoderLocation(e)}static get ktx2TranscoderLocation(){return iX.getKTX2TranscoderLocation()}static set meshoptDecoderLocation(e){iX.setMeshoptDecoderLocation(e)}static get meshoptDecoderLocation(){return iX.getMeshoptDecoderLocation()}static mapURLs(e){s3.singleton.loader[iz].manager.setURLModifier(e)}dismissPoster(){this.loaded?this[le]():(this[o7]=!0,this[n0]())}showPoster(){let e=this[o6];if(e.classList.contains("show"))return;e.classList.add("show"),this[n3].classList.remove("show");let t=this[o9];t.removeAttribute("tabindex"),t.removeAttribute("aria-hidden");let i=this.modelIsVisible;this[lt]=!1,this[nj](i)}getDimensions(){return an(this[n8].size)}getBoundingBoxCenter(){return an(this[n8].boundingBox.getCenter(new el.Pa4))}connectedCallback(){super.connectedCallback(),this.showPoster(),this[at].addEventListener("progress",this[lr])}disconnectedCallback(){super.disconnectedCallback(),this[at].removeEventListener("progress",this[lr])}async updated(e){super.updated(e),e.has("poster")&&null!=this.poster&&(this[o9].style.backgroundImage=`url(${this.poster})`),e.has("alt")&&this[o9].setAttribute("aria-label",this[n$]),(e.has("reveal")||e.has("loading"))&&this[n0]()}[(t=lt,i=o7,s=o6,r=o9,n=o5,a=ls,A=li,o=lr,ar)](){return!!this.src&&(this[o7]||this.loading===o8.EAGER||this.reveal===o4.AUTO&&this[nY])}[le](){this[o7]=!1;let e=this[o6];if(!e.classList.contains("show"))return;e.classList.remove("show"),this[n3].classList.add("show");let t=this.modelIsVisible;this[lt]=!0,this[nj](t);let i=this.getRootNode();i&&i.activeElement===this&&this[n3].focus();let s=this[o9];s.setAttribute("aria-hidden","true"),s.tabIndex=-1,this.dispatchEvent(new CustomEvent("poster-dismissed"))}[as](){return super[as]()&&this[lt]}}return o3([u({type:String})],l.prototype,"poster",void 0),o3([u({type:String})],l.prototype,"reveal",void 0),o3([u({type:String})],l.prototype,"loading",void 0),l})((e=>{var t;class i extends e{constructor(...e){super(e),this.autoplay=!1,this.animationName=void 0,this.animationCrossfadeDuration=300,this[t]=!0,this[n8].subscribeMixerEvent("loop",e=>{let t=e.action._loopCount;this.dispatchEvent(new CustomEvent("loop",{detail:{count:t}}))}),this[n8].subscribeMixerEvent("finished",()=>{this[ah]=!0,this.dispatchEvent(new CustomEvent("finished"))})}get availableAnimations(){return this.loaded?this[n8].animationNames:[]}get duration(){return this[n8].duration}get paused(){return this[ah]}get currentTime(){return this[n8].animationTime}set currentTime(e){this[n8].animationTime=e,this[n5]()}get timeScale(){return this[n8].animationTimeScale}set timeScale(e){this[n8].animationTimeScale=e}pause(){this[ah]||(this[ah]=!0,this.dispatchEvent(new CustomEvent("pause")))}play(e){this.availableAnimations.length>0&&(this[ah]=!1,this[al](e),this.dispatchEvent(new CustomEvent("play")))}[(t=ah,n9)](){super[n9](),this[ah]=!0,this.autoplay&&this.play()}[n6](e,t){super[n6](e,t),!this[ah]&&(this[as]()||this[ae].isPresenting)&&(this[n8].updateAnimation(t/1e3),this[n5]())}updated(e){super.updated(e),e.has("autoplay")&&this.autoplay&&this.play(),e.has("animationName")&&this[al]()}[al](e=ac){var t;let i=null!==(t=e.repetitions)&&void 0!==t?t:1/0,s=e.pingpong?el.uEv:1===i?el.jAl:el.YKA;this[n8].playAnimation(this.animationName,this.animationCrossfadeDuration/1e3,s,i),this[ah]&&(this[n8].updateAnimation(0),this[n5]())}}return ao([u({type:Boolean})],i.prototype,"autoplay",void 0),ao([u({type:String,attribute:"animation-name"})],i.prototype,"animationName",void 0),ao([u({type:Number,attribute:"animation-crossfade-duration"})],i.prototype,"animationCrossfadeDuration",void 0),i})((e=>{let t=e=>{if(null==e.shadowRoot||e.hasAttribute("data-js-focus-visible"))return()=>{};if(self.applyFocusVisiblePolyfill)self.applyFocusVisiblePolyfill(e.shadowRoot);else{let t=()=>{self.applyFocusVisiblePolyfill(e.shadowRoot)};return self.addEventListener("focus-visible-polyfill-ready",t,{once:!0}),()=>{self.removeEventListener("focus-visible-polyfill-ready",t)}}return()=>{}},i=Symbol("endPolyfillCoordination");return class extends e{constructor(){super(...arguments),this[i]=null}connectedCallback(){super.connectedCallback&&super.connectedCallback(),null==this[i]&&(this[i]=t(this))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),null!=this[i]&&(this[i](),this[i]=null)}}})(aA)))))))));customElements.define("model-viewer",lc)}}]);
//# sourceMappingURL=258.53d25aa602c4d686.js.map