hart-estate-widget 4.9.0 → 4.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -107,7 +107,6 @@ const loadData = async () => {
107
107
  return crmPlanId ? loadCrmWidgetData(crmPlanId) : loadWidgetData(planId);
108
108
  };
109
109
  const loadCreateWidget = async () => (await import('hart-estate-widget/build/createWidget.js')).createWidget;
110
- const loadFovPlugin = async () => (await import('hart-estate-widget/build/plugins/FovPlugin.js')).FovPlugin;
111
110
  const loadLogoUrl = async () => (await import('./logo.png')).default;
112
111
  const loadStyle = async () => (await import('./index.sass')).default;
113
112
  const loadDocument = async () => new Promise((resolve) => (window.onload = resolve));
@@ -115,7 +114,6 @@ const loadDocument = async () => new Promise((resolve) => (window.onload = resol
115
114
  const queue = [
116
115
  loadData(),
117
116
  loadCreateWidget(),
118
- loadFovPlugin(),
119
117
  loadLogoUrl(),
120
118
  loadStyle(),
121
119
  loadDocument(),
@@ -123,18 +121,20 @@ const queue = [
123
121
 
124
122
  const cleanupPreloader = usePreloader();
125
123
 
126
- Promise.all(queue).then(([data, createWidget, FovPlugin, logoUrl]) => {
124
+ Promise.all(queue).then(([data, createWidget, logoUrl]) => {
127
125
  const options = {
128
126
  baseUrl,
129
127
  logoUrl,
130
128
  logoLinkUrl: 'https://getfloorplan.com',
129
+ plugins: [
130
+ {
131
+ name: 'FovPlugin',
132
+ params: { fovSpeed: 2 },
133
+ },
134
+ ],
131
135
  };
132
136
 
133
- const plugins = [
134
- new FovPlugin(2),
135
- ];
136
-
137
- createWidget('#widget', data, options, plugins).then(cleanupPreloader);
137
+ createWidget('#widget', data, options).then(cleanupPreloader);
138
138
  });
139
139
  ```
140
140
 
@@ -533,6 +533,34 @@ Here you can see a list of accessible options and examples of usage. There are a
533
533
  }
534
534
  },
535
535
 
536
+ // Plugins loaded by name as separate chunks. Params are applied before init.
537
+ "plugins": [
538
+ {
539
+ "name": "FovPlugin",
540
+ "params": {
541
+ "fovSpeed": 2
542
+ }
543
+ },
544
+ {
545
+ "name": "GFPVRUIPlugin",
546
+ "params": {
547
+ "pointerMaxDistance": 30
548
+ }
549
+ }
550
+ ],
551
+
552
+ // Vendors loaded by name as separate chunks. Params are applied before init.
553
+ "vendors": [
554
+ {
555
+ "name": "LSRVendor",
556
+ "params": {
557
+ "pulseSpeed": 1,
558
+ "pulseAmplitude": 1,
559
+ "pulseScale": 0.1
560
+ }
561
+ }
562
+ ],
563
+
536
564
  // Query parameters for override, only on custom
537
565
  "query": {
538
566
  "primaryCameraPointId": "CameraPoint123456",
@@ -697,6 +725,25 @@ Here you can see a list of accessible options and examples of usage. There are a
697
725
  }
698
726
  ```
699
727
 
728
+ `plugins` supports `AbsolutePlugin`, `DebugPanelPlugin`, `DebugPlugin`, `DefaultMapPlugin`, `FovPlugin`,
729
+ `GFPVRUIPlugin`, `MRGroupPlugin`, `MultifloorMapPlugin`, and `TopViewMapPlugin`. `vendors` supports
730
+ `LSRVendor` and `TalanVendor`. Plugin instances passed as the fourth `createWidget` argument remain supported.
731
+
732
+ The legacy object form of `vendors` also remains supported. In that form the vendor instance is still passed
733
+ to `createWidget` directly, as before:
734
+
735
+ ```js
736
+ const options = {
737
+ vendors: {
738
+ lsr: {
739
+ pulseSpeed: 1,
740
+ pulseAmplitude: 1,
741
+ pulseScale: 0.1,
742
+ },
743
+ },
744
+ };
745
+ ```
746
+
700
747
  ## Widget object from the REST API
701
748
 
702
749
  JSON object returned from backend
@@ -773,3 +820,18 @@ The project code is licensed under the [GPLv3 license](https://www.gnu.org/licen
773
820
 
774
821
  Project code and documentation copyright [hart-digital.com](https://hart-digital.com).
775
822
  All renders of floor plans copyright [getfloorplan.com](https://getfloorplan.com).
823
+
824
+
825
+ ## Camera direction on entry
826
+
827
+ A v4 `camera_points` entry may contain `ForceCameraRotation: boolean | null`:
828
+
829
+ ```json
830
+ { "ID": "bathroom-camera", "ForceCameraRotation": true }
831
+ ```
832
+
833
+ Omitting the field or using `null` inherits `panoramaTabConfig.panoramaConfig.forceCameraRotation`. `true` applies the target camera's `Rotation.Yaw` on every entry; `false` keeps the user's absolute heading. Pitch is preserved. The first panorama always uses its configured heading. Refreshing furniture or style with the same camera ID and floor preserves the view.
834
+
835
+ Set the branding flag to `false` and mark the bathroom cameras `true` in the editor. Backend v4 must include this field in the response; rebuild the plan's cached widget JSON after deployment and saving the cameras. Existing cached responses without the field continue to inherit branding.
836
+
837
+ Regression check: `bun test tests/cameraRotation.test.ts`.
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[473],{2473:(e,r,t)=>{t.r(r),t.d(r,{AbsolutePlugin:()=>a});var s=t(84770);class a{unsubscribe;provider;constructor(e){null!=e&&(this.provider=new s.S(e))}get id(){return"absolute"}get name(){return"Absolute Analytics Plugin"}get version(){return"1.0.0"}setParams(e){this.provider=new s.S(e.counterId)}init(e){return!!this.provider&&(this.provider.init(),this.unsubscribe=e.analyticsStore.subscribe((e=>this.onEvent(e))),!0)}shutdown(){this.unsubscribe?.()}onEvent(e){const r=this.provider;if(r)switch(e.type){case"roomSelected":r.reachGoal("room_selected",e.params);break;case"tabSelected":r.reachGoal("tab_selected",e.params);break;case"styleSelected":r.reachGoal("style_selected",e.params);break;case"sessionFinished":r.reachGoal("finished",e.params)}}}},84770:(e,r,t)=>{t.d(r,{S:()=>s});class s{counterId;constructor(e){this.counterId=e}init(){"function"==typeof window.ym?window.ym(this.counterId,"init",{ssr:!0,webvisor:!0,clickmap:!0,ecommerce:"dataLayer",accurateTrackBounce:!0,trackLinks:!0}):console.warn("[YandexMetrikaProvider] ym is not defined (loader script not executed?)")}reachGoal(e,r){if("function"==typeof window.ym)try{window.ym(this.counterId,"reachGoal",e,r)}catch(e){console.error("[YandexMetrikaProvider] reachGoal error",e)}else console.warn("[YandexMetrikaProvider] ym is not defined")}}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[501],{9143:(t,e,i)=>{i.d(e,{m:()=>r});var a=i(37458),o=i(29250),s=i(92495);class r extends a.B69{linksPool=[];materialPool=new Map;hoverMaterialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("door","doorHover")}dispose(){}update(t){this.updateData(t);const{apertureStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){const t=this._store,{config:e}=t.configStore;if(t.capabilityStore.isPortalNavigation||e.isOverrideLinks)return;const i=t.domainStore.apertureStore.currentArray;if(null==i)return;const{linksPool:a}=this;for(let e=a.length,o=i.length;e<o;e++){const i=new s.S(t);this.add(i),this.linksPool[e]=i}for(let t=0,e=a.length;t<e;t++){const e=a[t];if(t>=i.length){e.visible=!1,e.isInteractive=!1;continue}const o=i[t];e.setDomain(o);const[s,r]=this.getMaterial(o.icon,o.hoverIcon);e.setMaterials(s,r),e.visible=!0,e.isInteractive=!0}}onRaycastDown=t=>{"Aperture"===t.type&&this.linksPool.some((e=>!(!e.isInteractive||e.domainId!==t.id||(e.onRaycastDown(t),0))))};_prevEvent={id:"",type:""};onRaycastChange=t=>{this._prevEvent.type===t.type&&this._prevEvent.id===t.id||(this._prevEvent.type=t.type,this._prevEvent.id=t.id,this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)})))};cacheMaterial(t,e){if(this.materialPool.has(t))return;const{linkIconStore:i,iconTextureResources:a}=this._store.panoramaTabStore,s=i.get(t),r=new o.g;this.materialPool.set(t,r),a.get(s).then((t=>{t&&(r.map=t,r.needsUpdate=!0)}));const n=i.get(e||t),l=new o.g;this.hoverMaterialPool.set(e,l),a.get(n).then((t=>{if(t)return l.map=t,void(l.needsUpdate=!0);a.get(s).then((t=>{t&&(l.map=t,l.needsUpdate=!0)}))}))}getMaterial(t,e){return this.cacheMaterial(t,e),[this.materialPool.get(t),this.hoverMaterialPool.get(e)]}}},12237:(t,e,i)=>{i.d(e,{M:()=>r});var a=i(37458),o=i(29250),s=i(92495);class r extends a.B69{linksPool=[];materialPool=new Map;hoverMaterialPool=new Map;time=0;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("door","doorHover"),this.cacheMaterial("spot","spotHover")}dispose(){}update(t){this.time+=t,this.updateData(t);const{portalStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&(e.time=this.time,e.update(t))}))}async updatePool(){const t=this._store,{config:e}=t.configStore;if(!t.capabilityStore.isPortalNavigation||e.isOverrideLinks)return;const i=t.domainStore.portalStore.currentArray;if(null==i)return;const{linksPool:a}=this;for(let e=a.length,o=i.length;e<o;e++){const i=new s.S(t);this.add(i),a[e]=i}for(let t=0,e=a.length;t<e;t++){const e=a[t];if(t>=i.length){e.visible=!1,e.isInteractive=!1;continue}const o=i[t];e.setDomain(o);const[s,r]=this.getMaterial(o.icon,o.hoverIcon);e.setMaterials(s,r),e.visible=!0,e.isInteractive=!0}}onRaycastDown=t=>{"Portal"===t.type&&this.linksPool.some((e=>!(!e.isInteractive||e.domainId!==t.id||(e.onRaycastDown(t),0))))};_prevEvent={id:"",type:""};onRaycastChange=t=>{this._prevEvent.type===t.type&&this._prevEvent.id===t.id||(this._prevEvent.type=t.type,this._prevEvent.id=t.id,this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)})))};cacheMaterial(t,e){if(this.materialPool.has(t))return;const{linkIconStore:i,iconTextureResources:a}=this._store.panoramaTabStore,s=i.get(t),r=new o.g;this.materialPool.set(t,r),a.get(s).then((t=>{t&&(r.map=t,r.needsUpdate=!0)}));const n=i.get(e||t),l=new o.g;this.hoverMaterialPool.set(e,l),a.get(n).then((t=>{if(t)return l.map=t,void(l.needsUpdate=!0);a.get(s).then((t=>{t&&(l.map=t,l.needsUpdate=!0)}))}))}getMaterial(t,e){return this.cacheMaterial(t,e),[this.materialPool.get(t),this.hoverMaterialPool.get(e)]}}},34370:(t,e,i)=>{i.d(e,{l:()=>r});var a=i(37458),o=i(29250),s=i(92495);class r extends a.B69{linksPool=[];materialPool=new Map;hoverMaterialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("stairUp","stairUpHover"),this.cacheMaterial("stairDown","stairDownHover")}dispose(){}update(t){this.updateData(t);const{stairStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){const t=this._store,{config:e}=t.configStore;if(e.isOverrideLinks)return;const i=t.domainStore.stairStore.currentArray;if(null==i)return;const{linksPool:a}=this;for(let e=a.length,o=i.length;e<o;e++){const i=new s.S(t);this.add(i),a[e]=i}for(let t=0,e=a.length;t<e;t++){const e=a[t];if(t>=i.length){e.visible=!1,e.isInteractive=!1;continue}const o=i[t];e.setDomain(o);const[s,r]=this.getMaterial(o.icon,o.hoverIcon);e.setMaterials(s,r),e.visible=!0,e.isInteractive=!0}}onRaycastDown=t=>{"Stair"===t.type&&this.linksPool.some((e=>!(!e.isInteractive||t.id!==e.domainId||(e.onRaycastDown(t),0))))};onRaycastChange=t=>{this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)}))};cacheMaterial(t,e){if(this.materialPool.has(t))return;const{linkIconStore:i,iconTextureResources:a}=this._store.panoramaTabStore,s=i.get(t),r=new o.g;this.materialPool.set(t,r),a.get(s).then((t=>{t&&(r.map=t,r.needsUpdate=!0)}));const n=i.get(e||t),l=new o.g;this.hoverMaterialPool.set(e,l),a.get(n).then((t=>{if(t)return l.map=t,void(l.needsUpdate=!0);a.get(s).then((t=>{t&&(l.map=t,l.needsUpdate=!0)}))}))}getMaterial(t,e){return this.cacheMaterial(t,e),[this.materialPool.get(t),this.hoverMaterialPool.get(e)]}}},70568:(t,e,i)=>{i.d(e,{j:()=>r});var a=i(37458),o=i(29250),s=i(92495);class r extends a.B69{linksPool=[];materialPool=new Map;hoverMaterialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("spot","spotHover")}dispose(){}update(t){this.updateData(t);const{cameraPointStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){const t=this._store,{config:e}=t.configStore;if(t.capabilityStore.isPortalNavigation||e.isOverrideLinks)return;const i=t.domainStore.cameraPointStore.currentArray;if(null==i)return;const{linksPool:a}=this;for(let e=a.length,o=i.length;e<o;e++){const i=new s.S(t);this.add(i),this.linksPool[e]=i}for(let t=0,e=a.length;t<e;t++){const e=a[t];if(t>=i.length){e.visible=!1,e.isInteractive=!1;continue}const o=i[t];e.setDomain(o);const[s,r]=this.getMaterial(o.icon,o.hoverIcon);e.setMaterials(s,r),e.visible=!0,e.isInteractive=!0}}onRaycastDown=t=>{"CameraPoint"===t.type&&this.linksPool.forEach((e=>{e.isInteractive&&e.domainId===t.id&&e.onRaycastDown(t)}))};_prevEvent={id:"",type:""};onRaycastChange=t=>{this._prevEvent.type===t.type&&this._prevEvent.id===t.id||(this._prevEvent.type=t.type,this._prevEvent.id=t.id,this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)})))};cacheMaterial(t,e){if(this.materialPool.has(t))return;const{linkIconStore:i,iconTextureResources:a}=this._store.panoramaTabStore,s=i.get(t),r=new o.g;this.materialPool.set(t,r),a.get(s).then((t=>{t&&(r.map=t,r.needsUpdate=!0)}));const n=i.get(e||t),l=new o.g;this.hoverMaterialPool.set(e,l),a.get(n).then((t=>{if(t)return l.map=t,void(l.needsUpdate=!0);a.get(s).then((t=>{t&&(l.map=t,l.needsUpdate=!0)}))}))}getMaterial(t,e){return this.cacheMaterial(t,e),[this.materialPool.get(t),this.hoverMaterialPool.get(e)]}}},83501:(t,e,i)=>{i.r(e),i.d(e,{LSRVendor:()=>n});var a=i(9143),o=i(70568),s=i(12237),r=i(34370);class n{id="lsr";name="LSR Vendor plugin";version="1.0.0";isLate=!1;_store;_config={};get config(){return this._config}setParams(t){this._config={...t}}init(t){this._store=t;const e=t.configStore.config.vendors;!Array.isArray(e)&&e?.lsr&&this.setParams(e.lsr);const{overrideStore:i}=t;if(!i.get("portalRenderer")){const e=new s.M(t),n=new a.m(t),l=new o.j(t),h=new r.l(t);i.set("portalRenderer",e),i.set("apertureRenderer",n),i.set("cameraPointRenderer",l),i.set("stairRenderer",h)}return!0}shutdown(){}}},92495:(t,e,i)=>{i.d(e,{S:()=>r});var a=i(31373),o=i(85479),s=i(37458);class r extends s.kxk{domainType="Aperture";isInteractive=!1;domain;domainId="";defaultMaterial;hoverMaterial;baseSize=.1;scaleSpeed=10;hoverScale=1.1;isHover=!1;targetScale=new s.Pq0(1,1,1);time=0;_store;constructor(t){super(),this._store=t,this.targetScale.setScalar(this.baseSize),this.scale.copy(this.targetScale)}setDomain(t){this.domain=t,this.domainType=t?.type??"Aperture",this.domainId=t?.id??"",this.updateScale()}setMaterials(t,e){this.material=t,this.defaultMaterial=t,this.hoverMaterial=e}update(t){const{domain:e}=this;e&&(this.updateScale(t),this.position.copy(e.position),this.scale.lerp(this.targetScale,(0,a.J$)(t*this.scaleSpeed)))}onRaycastDown(t){if(t.type!==this.domainType||t.id!==this.domainId)return;this.onRaycastChange(t);const{domain:e}=this;return e?"isPortal"in e&&"modal"===e.data.Type?this.onPortalModal(e):this.onTarget(e):void 0}onPortalModal(t){this._store.modalStore.show(t.data.Data)}onTarget(t){const{indexStore:e}=this._store;let{targetVariantId:i,targetFloorIndex:a,targetPanoramaId:o}=t;if(!i&&-1===a){const t=e.resolver.resolveByPanoramaId(o);t&&(i=t.variantId,a=t.floorIndex,o=t.panoramaId)}i||(i=e.variantId),-1===a&&(a=e.floorIndex),o&&e.set(i,a,o)}onRaycastChange(t){this.isHover=t.type===this.domainType&&t.id===this.domainId,this.defaultMaterial&&this.hoverMaterial&&(this.material=this.isHover?this.hoverMaterial:this.defaultMaterial)}updateScale(t=1/60){(0,o.x3)(t);const{domain:e}=this;if(!e)return;if(this.targetScale.set(1,1,1),"isPortal"in e){const{X:t,Y:i,Z:a}=e.data.Scale;this.targetScale.set(t,a,i)}const i="isCameraPoint"in e&&e.isCameraPoint,a="isPortal"in e&&e.isPortal&&e.icon.includes("spot");if(!i&&!a)return void this.targetScale.multiplyScalar(this.baseSize*(this.isHover?this.hoverScale:1));const s=this._store.pluginManager.getById("lsr")?.config,r=s?.pulseAmplitude??1,n=s?.pulseSpeed??1,l=s?.pulseScale??.1,{fov:h}=this._store.panoramaTabStore.cameraStore,c=l*(h.value/h.base),d=1+Math.sin(this.time*Math.PI*2*n)*r;this.targetScale.multiplyScalar(c*d)}}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[552],{1057:(e,t,s)=>{s.d(t,{_c:()=>o});var n=s(37458);function o(e,t){if(t===n.RJ4)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===n.rYR||t===n.O49){let s=e.getIndex();if(null===s){const t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<n.count;e++)t.push(e);e.setIndex(t),s=e.getIndex()}const o=s.count-2,r=[];if(t===n.rYR)for(let e=1;e<=o;e++)r.push(s.getX(0)),r.push(s.getX(e)),r.push(s.getX(e+1));else for(let e=0;e<o;e++)e%2==0?(r.push(s.getX(e)),r.push(s.getX(e+1)),r.push(s.getX(e+2))):(r.push(s.getX(e+2)),r.push(s.getX(e+1)),r.push(s.getX(e)));r.length/3!==o&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=e.clone();return i.setIndex(r),i.clearGroups(),i}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}},17533:(e,t,s)=>{s.d(t,{YM:()=>n,eO:()=>r,j8:()=>l});const n={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function o(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}async function r(e,t,s=null,n=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const r=await async function(e){if(!e)throw new Error("No basePath supplied");return await o(`${e}/profilesList.json`)}(t);let i;if(e.profiles.some((e=>{const s=r[e];return s&&(i={profileId:e,profilePath:`${t}/${s.path}`,deprecated:!!s.deprecated}),!!i})),!i){if(!s)throw new Error("No matching profile name found");const e=r[s];if(!e)throw new Error(`No matching profile name found and default profile "${s}" missing.`);i={profileId:s,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const a=await o(i.profilePath);let c;if(n){let t;if(t="any"===e.handedness?a.layouts[Object.keys(a.layouts)[0]]:a.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${i.profileId}`);t.assetPath&&(c=i.profilePath.replace("profile.json",t.assetPath))}return{profile:a,assetPath:c}}const i={xAxis:0,yAxis:0,button:0,state:n.ComponentState.DEFAULT};class a{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===n.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(i)}updateFromComponent({xAxis:e,yAxis:t,button:s,state:o}){const{normalizedXAxis:r,normalizedYAxis:i}=function(e=0,t=0){let s=e,n=t;if(Math.sqrt(e*e+t*t)>1){const o=Math.atan2(t,e);s=Math.cos(o),n=Math.sin(o)}return{normalizedXAxis:.5*s+.5,normalizedYAxis:.5*n+.5}}(e,t);switch(this.componentProperty){case n.ComponentProperty.X_AXIS:this.value=this.states.includes(o)?r:.5;break;case n.ComponentProperty.Y_AXIS:this.value=this.states.includes(o)?i:.5;break;case n.ComponentProperty.BUTTON:this.value=this.states.includes(o)?s:0;break;case n.ComponentProperty.STATE:this.valueNodeProperty===n.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(o):this.value=this.states.includes(o)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class c{constructor(e,t){if(!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const s=new a(t.visualResponses[e]);this.visualResponses[e]=s})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:n.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=n.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=n.ComponentState.PRESSED:(t.touched||this.values.button>n.ButtonTouchThreshold)&&(this.values.state=n.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===n.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>n.AxisTouchThreshold&&(this.values.state=n.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===n.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>n.AxisTouchThreshold&&(this.values.state=n.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}class l{constructor(e,t,s){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=s,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new c(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}}},52552:(e,t,s)=>{s.d(t,{S:()=>c});var n=s(37458),o=s(95509),r=s(17533);class i extends n.B69{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e||(this.envMap=e,this.traverse((e=>{e.isMesh&&(e.material.envMap=this.envMap,e.material.needsUpdate=!0)}))),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach((e=>{Object.values(e.visualResponses).forEach((e=>{const{valueNode:t,minNode:s,maxNode:n,value:o,valueNodeProperty:i}=e;t&&(i===r.YM.VisualResponseProperty.VISIBILITY?t.visible=o:i===r.YM.VisualResponseProperty.TRANSFORM&&(t.quaternion.slerpQuaternions(s.quaternion,n.quaternion,o),t.position.lerpVectors(s.position,n.position,o)))}))})))}}function a(e,t){!function(e,t){Object.values(e.components).forEach((e=>{const{type:s,touchPointNodeName:o,visualResponses:i}=e;if(s===r.YM.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(o),e.touchPointNode){const t=new n.Gu$(.001),s=new n.V9B({color:255}),o=new n.eaF(t,s);e.touchPointNode.add(o)}else console.warn(`Could not find touch dot, ${e.touchPointNodeName}, in touchpad component ${e.id}`);Object.values(i).forEach((e=>{const{valueNodeName:s,minNodeName:n,maxNodeName:o,valueNodeProperty:i}=e;if(i===r.YM.VisualResponseProperty.TRANSFORM){if(e.minNode=t.getObjectByName(n),e.maxNode=t.getObjectByName(o),!e.minNode)return void console.warn(`Could not find ${n} in the model`);if(!e.maxNode)return void console.warn(`Could not find ${o} in the model`)}e.valueNode=t.getObjectByName(s),e.valueNode||console.warn(`Could not find ${s} in the model`)}))}))}(e.motionController,t),e.envMap&&t.traverse((t=>{t.isMesh&&(t.material.envMap=e.envMap,t.material.needsUpdate=!0)})),e.add(t)}class c{constructor(e=null){this.gltfLoader=e,this.path="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",this._assetCache={},this.gltfLoader||(this.gltfLoader=new o.B)}createControllerModel(e){const t=new i;let s=null;return e.addEventListener("connected",(e=>{const n=e.data;"tracked-pointer"===n.targetRayMode&&n.gamepad&&(0,r.eO)(n,this.path,"generic-trigger").then((({profile:e,assetPath:o})=>{t.motionController=new r.j8(n,e,o);const i=this._assetCache[t.motionController.assetUrl];if(i)s=i.scene.clone(),a(t,s);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,(e=>{this._assetCache[t.motionController.assetUrl]=e,s=e.scene.clone(),a(t,s)}),null,(()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)}))}})).catch((e=>{console.warn(e)}))})),e.addEventListener("disconnected",(()=>{t.motionController=null,t.remove(s),s=null})),t}}},95509:(e,t,s)=>{s.d(t,{B:()=>r});var n=s(37458),o=s(1057);class r extends n.aHM{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new h(e)})),this.register((function(e){return new x(e)})),this.register((function(e){return new v(e)})),this.register((function(e){return new R(e)})),this.register((function(e){return new p(e)})),this.register((function(e){return new m(e)})),this.register((function(e){return new f(e)})),this.register((function(e){return new A(e)})),this.register((function(e){return new u(e)})),this.register((function(e){return new g(e)})),this.register((function(e){return new d(e)})),this.register((function(e){return new T(e)})),this.register((function(e){return new c(e)})),this.register((function(e){return new E(e)})),this.register((function(e){return new w(e)}))}load(e,t,s,o){const r=this;let i;i=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.r6x.extractUrlBase(e),this.manager.itemStart(e);const a=function(t){o?o(t):console.error(t),r.manager.itemError(e),r.manager.itemEnd(e)},c=new n.Y9S(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,(function(s){try{r.parse(s,i,(function(s){t(s),r.manager.itemEnd(e)}),a)}catch(e){a(e)}}),s,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new 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,s,n){let o;const r={},i={},c=new TextDecoder;if("string"==typeof e)o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===y){try{r[a.KHR_BINARY_GLTF]=new _(e)}catch(e){return void(n&&n(e))}o=JSON.parse(r[a.KHR_BINARY_GLTF].content)}else o=JSON.parse(c.decode(e));else o=e;if(void 0===o.asset||o.asset.version[0]<2)return void(n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const u=new Y(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){const t=this.pluginCallbacks[e](u);t.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),i[t.name]=t,r[t.name]=!0}if(o.extensionsUsed)for(let e=0;e<o.extensionsUsed.length;++e){const t=o.extensionsUsed[e],s=o.extensionsRequired||[];switch(t){case a.KHR_MATERIALS_UNLIT:r[t]=new l;break;case a.KHR_DRACO_MESH_COMPRESSION:r[t]=new S(o,this.dracoLoader);break;case a.KHR_TEXTURE_TRANSFORM:r[t]=new I;break;case a.KHR_MESH_QUANTIZATION:r[t]=new N;break;default:s.indexOf(t)>=0&&void 0===i[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}u.setExtensions(r),u.setPlugins(i),u.parse(s,n)}parseAsync(e,t){const s=this;return new Promise((function(n,o){s.parse(e,t,n,o)}))}}function i(){let e={};return{get:function(t){return e[t]},add:function(t,s){e[t]=s},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const a={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class c{constructor(e){this.parser=e,this.name=a.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,n=t.length;s<n;s++){const n=t[s];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let o=t.cache.get(s);if(o)return o;const r=t.json,i=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let a;const c=new n.Q1f(16777215);void 0!==i.color&&c.setRGB(i.color[0],i.color[1],i.color[2],n.Zr2);const l=void 0!==i.range?i.range:0;switch(i.type){case"directional":a=new n.ZyN(c),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new n.HiM(c),a.distance=l;break;case"spot":a=new n.nCl(c),a.distance=l,i.spot=i.spot||{},i.spot.innerConeAngle=void 0!==i.spot.innerConeAngle?i.spot.innerConeAngle:0,i.spot.outerConeAngle=void 0!==i.spot.outerConeAngle?i.spot.outerConeAngle:Math.PI/4,a.angle=i.spot.outerConeAngle,a.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+i.type)}return a.position.set(0,0,0),a.decay=2,j(a,i),void 0!==i.intensity&&(a.intensity=i.intensity),a.name=t.createUniqueName(i.name||"light_"+e),o=Promise.resolve(a),t.cache.add(s,o),o}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){const t=this,s=this.parser,n=s.json.nodes[e],o=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===o?null:this._loadLight(o).then((function(e){return s._getNodeRef(t.cache,o,e)}))}}class l{constructor(){this.name=a.KHR_MATERIALS_UNLIT}getMaterialType(){return n.V9B}extendParams(e,t,s){const o=[];e.color=new n.Q1f(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const t=r.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],n.Zr2),e.opacity=t[3]}void 0!==r.baseColorTexture&&o.push(s.assignTexture(e,"map",r.baseColorTexture,n.er$))}return Promise.all(o)}}class u{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const n=s.extensions[this.name].emissiveStrength;return void 0!==n&&(t.emissiveIntensity=n),Promise.resolve()}}class h{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){const s=this.parser,o=s.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const r=[],i=o.extensions[this.name];if(void 0!==i.clearcoatFactor&&(t.clearcoat=i.clearcoatFactor),void 0!==i.clearcoatTexture&&r.push(s.assignTexture(t,"clearcoatMap",i.clearcoatTexture)),void 0!==i.clearcoatRoughnessFactor&&(t.clearcoatRoughness=i.clearcoatRoughnessFactor),void 0!==i.clearcoatRoughnessTexture&&r.push(s.assignTexture(t,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture)),void 0!==i.clearcoatNormalTexture&&(r.push(s.assignTexture(t,"clearcoatNormalMap",i.clearcoatNormalTexture)),void 0!==i.clearcoatNormalTexture.scale)){const e=i.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new n.I9Y(e,e)}return Promise.all(r)}}class d{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const o=[],r=n.extensions[this.name];return void 0!==r.iridescenceFactor&&(t.iridescence=r.iridescenceFactor),void 0!==r.iridescenceTexture&&o.push(s.assignTexture(t,"iridescenceMap",r.iridescenceTexture)),void 0!==r.iridescenceIor&&(t.iridescenceIOR=r.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==r.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),void 0!==r.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),void 0!==r.iridescenceThicknessTexture&&o.push(s.assignTexture(t,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(o)}}class p{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){const s=this.parser,o=s.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new n.Q1f(0,0,0),t.sheenRoughness=0,t.sheen=1;const i=o.extensions[this.name];if(void 0!==i.sheenColorFactor){const e=i.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],n.Zr2)}return void 0!==i.sheenRoughnessFactor&&(t.sheenRoughness=i.sheenRoughnessFactor),void 0!==i.sheenColorTexture&&r.push(s.assignTexture(t,"sheenColorMap",i.sheenColorTexture,n.er$)),void 0!==i.sheenRoughnessTexture&&r.push(s.assignTexture(t,"sheenRoughnessMap",i.sheenRoughnessTexture)),Promise.all(r)}}class m{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const o=[],r=n.extensions[this.name];return void 0!==r.transmissionFactor&&(t.transmission=r.transmissionFactor),void 0!==r.transmissionTexture&&o.push(s.assignTexture(t,"transmissionMap",r.transmissionTexture)),Promise.all(o)}}class f{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){const s=this.parser,o=s.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const r=[],i=o.extensions[this.name];t.thickness=void 0!==i.thicknessFactor?i.thicknessFactor:0,void 0!==i.thicknessTexture&&r.push(s.assignTexture(t,"thicknessMap",i.thicknessTexture)),t.attenuationDistance=i.attenuationDistance||1/0;const a=i.attenuationColor||[1,1,1];return t.attenuationColor=(new n.Q1f).setRGB(a[0],a[1],a[2],n.Zr2),Promise.all(r)}}class A{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const n=s.extensions[this.name];return t.ior=void 0!==n.ior?n.ior:1.5,Promise.resolve()}}class g{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){const s=this.parser,o=s.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const r=[],i=o.extensions[this.name];t.specularIntensity=void 0!==i.specularFactor?i.specularFactor:1,void 0!==i.specularTexture&&r.push(s.assignTexture(t,"specularIntensityMap",i.specularTexture));const a=i.specularColorFactor||[1,1,1];return t.specularColor=(new n.Q1f).setRGB(a[0],a[1],a[2],n.Zr2),void 0!==i.specularColorTexture&&r.push(s.assignTexture(t,"specularColorMap",i.specularColorTexture,n.er$)),Promise.all(r)}}class T{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const o=[],r=n.extensions[this.name];return void 0!==r.anisotropyStrength&&(t.anisotropy=r.anisotropyStrength),void 0!==r.anisotropyRotation&&(t.anisotropyRotation=r.anisotropyRotation),void 0!==r.anisotropyTexture&&o.push(s.assignTexture(t,"anisotropyMap",r.anisotropyTexture)),Promise.all(o)}}class x{constructor(e){this.parser=e,this.name=a.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,n=s.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const o=n.extensions[this.name],r=t.options.ktx2Loader;if(!r){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,r)}}class v{constructor(e){this.parser=e,this.name=a.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,o=n.textures[e];if(!o.extensions||!o.extensions[t])return null;const r=o.extensions[t],i=n.images[r.source];let a=s.textureLoader;if(i.uri){const e=s.options.manager.getHandler(i.uri);null!==e&&(a=e)}return this.detectSupport().then((function(o){if(o)return s.loadTextureImage(e,r.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class R{constructor(e){this.parser=e,this.name=a.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,o=n.textures[e];if(!o.extensions||!o.extensions[t])return null;const r=o.extensions[t],i=n.images[r.source];let a=s.textureLoader;if(i.uri){const e=s.options.manager.getHandler(i.uri);null!==e&&(a=e)}return this.detectSupport().then((function(o){if(o)return s.loadTextureImage(e,r.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class E{constructor(e){this.name=a.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const e=s.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then((function(t){const s=e.byteOffset||0,n=e.byteLength||0,r=e.count,i=e.byteStride,a=new Uint8Array(t,s,n);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(r,i,a,e.mode,e.filter).then((function(e){return e.buffer})):o.ready.then((function(){const t=new ArrayBuffer(r*i);return o.decodeGltfBuffer(new Uint8Array(t),r,i,a,e.mode,e.filter),t}))}))}return null}}class w{constructor(e){this.name=a.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||void 0===s.mesh)return null;const o=t.meshes[s.mesh];for(const e of o.primitives)if(e.mode!==C.TRIANGLES&&e.mode!==C.TRIANGLE_STRIP&&e.mode!==C.TRIANGLE_FAN&&void 0!==e.mode)return null;const r=s.extensions[this.name].attributes,i=[],a={};for(const e in r)i.push(this.parser.getDependency("accessor",r[e]).then((t=>(a[e]=t,a[e]))));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then((e=>{const t=e.pop(),s=t.isGroup?t.children:[t],o=e[0].count,r=[];for(const e of s){const t=new n.kn4,s=new n.Pq0,i=new n.PTz,c=new n.Pq0(1,1,1),l=new n.ZLX(e.geometry,e.material,o);for(let e=0;e<o;e++)a.TRANSLATION&&s.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&i.fromBufferAttribute(a.ROTATION,e),a.SCALE&&c.fromBufferAttribute(a.SCALE,e),l.setMatrixAt(e,t.compose(s,i,c));for(const t in a)if("_COLOR_0"===t){const e=a[t];l.instanceColor=new n.uWO(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);n.B69.prototype.copy.call(l,e),this.parser.assignFinalMaterial(l),r.push(l)}return t.isGroup?(t.clear(),t.add(...r),t):r[0]})))}}const y="glTF";class _{constructor(e){this.name=a.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==y)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,o=new DataView(e,12);let r=0;for(;r<n;){const t=o.getUint32(r,!0);r+=4;const n=o.getUint32(r,!0);if(r+=4,1313821514===n){const n=new Uint8Array(e,12+r,t);this.content=s.decode(n)}else if(5130562===n){const s=12+r;this.body=e.slice(s,s+t)}r+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class S{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=a.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,n=this.dracoLoader,o=e.extensions[this.name].bufferView,r=e.extensions[this.name].attributes,i={},a={},c={};for(const e in r){const t=F[e]||e.toLowerCase();i[t]=r[e]}for(const t in e.attributes){const n=F[t]||t.toLowerCase();if(void 0!==r[t]){const o=s.accessors[e.attributes[t]],r=O[o.componentType];c[n]=r.name,a[n]=!0===o.normalized}}return t.getDependency("bufferView",o).then((function(e){return new Promise((function(t){n.decodeDracoFile(e,(function(e){for(const t in e.attributes){const s=e.attributes[t],n=a[t];void 0!==n&&(s.normalized=n)}t(e)}),i,c)}))}))}}class I{constructor(){this.name=a.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&t.texCoord!==e.channel||void 0!==t.offset||void 0!==t.rotation||void 0!==t.scale?(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e):e}}class N{constructor(){this.name=a.KHR_MESH_QUANTIZATION}}class b extends n.lGw{constructor(e,t,s,n){super(e,t,s,n)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,n=this.valueSize,o=e*n*3+n;for(let e=0;e!==n;e++)t[e]=s[o+e];return t}interpolate_(e,t,s,n){const o=this.resultBuffer,r=this.sampleValues,i=this.valueSize,a=2*i,c=3*i,l=n-t,u=(s-t)/l,h=u*u,d=h*u,p=e*c,m=p-c,f=-2*d+3*h,A=d-h,g=1-f,T=A-h+u;for(let e=0;e!==i;e++){const t=r[m+e+i],s=r[m+e+a]*l,n=r[p+e+i],c=r[p+e]*l;o[e]=g*t+T*s+f*n+A*c}return o}}const L=new n.PTz;class M extends b{interpolate_(e,t,s,n){const o=super.interpolate_(e,t,s,n);return L.fromArray(o).normalize().toArray(o),o}}const C={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},O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},P={9728:n.hxR,9729:n.k6q,9984:n.pHI,9985:n.kRr,9986:n.Cfg,9987:n.$_I},H={33071:n.ghU,33648:n.kTW,10497:n.GJx},k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},F={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},U={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},B={CUBICSPLINE:void 0,LINEAR:n.PJ3,STEP:n.ljd};function D(e,t,s){for(const n in s.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=s.extensions[n])}function j(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 G(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let s=0,n=t.weights.length;s<n;s++)e.morphTargetInfluences[s]=t.weights[s];if(t.extras&&Array.isArray(t.extras.targetNames)){const s=t.extras.targetNames;if(e.morphTargetInfluences.length===s.length){e.morphTargetDictionary={};for(let t=0,n=s.length;t<n;t++)e.morphTargetDictionary[s[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function K(e){let t;const s=e.extensions&&e.extensions[a.KHR_DRACO_MESH_COMPRESSION];if(t=s?"draco:"+s.bufferView+":"+s.indices+":"+V(s.attributes):e.indices+":"+V(e.attributes)+":"+e.mode,void 0!==e.targets)for(let s=0,n=e.targets.length;s<n;s++)t+=":"+V(e.targets[s]);return t}function V(e){let t="";const s=Object.keys(e).sort();for(let n=0,o=s.length;n<o;n++)t+=s[n]+":"+e[s[n]]+";";return t}function X(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 new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}const q=new n.kn4;class Y{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new i,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,o=!1,r=-1;"undefined"!=typeof navigator&&(s=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o=navigator.userAgent.indexOf("Firefox")>-1,r=o?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||s||o&&r<98?this.textureLoader=new n.Tap(this.options.manager):this.textureLoader=new n.Kzg(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.Y9S(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,n=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])})).then((function(t){const r={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:s,userData:{}};return D(o,r,n),j(r,n),Promise.all(s._invokeAll((function(e){return e.afterRoot&&e.afterRoot(r)}))).then((function(){e(r)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let s=0,n=t.length;s<n;s++){const n=t[s].joints;for(let t=0,s=n.length;t<s;t++)e[n[t]].isBone=!0}for(let t=0,n=e.length;t<n;t++){const n=e[t];void 0!==n.mesh&&(this._addNodeRef(this.meshCache,n.mesh),void 0!==n.skin&&(s[n.mesh].isSkinnedMesh=!0)),void 0!==n.camera&&this._addNodeRef(this.cameraCache,n.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,s){if(e.refs[t]<=1)return s;const n=s.clone(),o=(e,t)=>{const s=this.associations.get(e);null!=s&&this.associations.set(t,s);for(const[s,n]of e.children.entries())o(n,t.children[s])};return o(s,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const n=e(t[s]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let n=0;n<t.length;n++){const o=e(t[n]);o&&s.push(o)}return s}getDependency(e,t){const s=e+":"+t;let n=this.cache.get(s);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":n=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":n=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne((function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)})),!n)throw new Error("Unknown type: "+e)}this.cache.add(s,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,n=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(n.map((function(t,n){return s.getDependency(e,n)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[a.KHR_BINARY_GLTF].body);const o=this.options;return new Promise((function(e,r){s.load(n.r6x.resolveURL(t.uri,o.path),e,void 0,(function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const s=t.byteLength||0,n=t.byteOffset||0;return e.slice(n,n+s)}))}loadAccessor(e){const t=this,s=this.json,o=this.json.accessors[e];if(void 0===o.bufferView&&void 0===o.sparse){const e=k[o.type],t=O[o.componentType],s=!0===o.normalized,r=new t(o.count*e);return Promise.resolve(new n.THS(r,e,s))}const r=[];return void 0!==o.bufferView?r.push(this.getDependency("bufferView",o.bufferView)):r.push(null),void 0!==o.sparse&&(r.push(this.getDependency("bufferView",o.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",o.sparse.values.bufferView))),Promise.all(r).then((function(e){const r=e[0],i=k[o.type],a=O[o.componentType],c=a.BYTES_PER_ELEMENT,l=c*i,u=o.byteOffset||0,h=void 0!==o.bufferView?s.bufferViews[o.bufferView].byteStride:void 0,d=!0===o.normalized;let p,m;if(h&&h!==l){const e=Math.floor(u/h),s="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+e+":"+o.count;let l=t.cache.get(s);l||(p=new a(r,e*h,o.count*h/c),l=new n.eB$(p,h/c),t.cache.add(s,l)),m=new n.eHs(l,i,u%h/c,d)}else p=null===r?new a(o.count*i):new a(r,u,o.count*i),m=new n.THS(p,i,d);if(void 0!==o.sparse){const t=k.SCALAR,s=O[o.sparse.indices.componentType],c=o.sparse.indices.byteOffset||0,l=o.sparse.values.byteOffset||0,u=new s(e[1],c,o.sparse.count*t),h=new a(e[2],l,o.sparse.count*i);null!==r&&(m=new n.THS(m.array.slice(),m.itemSize,m.normalized));for(let e=0,t=u.length;e<t;e++){const t=u[e];if(m.setX(t,h[e*i]),i>=2&&m.setY(t,h[e*i+1]),i>=3&&m.setZ(t,h[e*i+2]),i>=4&&m.setW(t,h[e*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m}))}loadTexture(e){const t=this.json,s=this.options,n=t.textures[e].source,o=t.images[n];let r=this.textureLoader;if(o.uri){const e=s.manager.getHandler(o.uri);null!==e&&(r=e)}return this.loadTextureImage(e,n,r)}loadTextureImage(e,t,s){const o=this,r=this.json,i=r.textures[e],a=r.images[t],c=(a.uri||a.bufferView)+":"+i.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,s).then((function(t){t.flipY=!1,t.name=i.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);const s=(r.samplers||{})[i.sampler]||{};return t.magFilter=P[s.magFilter]||n.k6q,t.minFilter=P[s.minFilter]||n.$_I,t.wrapS=H[s.wrapS]||n.GJx,t.wrapT=H[s.wrapT]||n.GJx,o.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[c]=l,l}loadImageSource(e,t){const s=this.json,o=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const r=s.images[e],i=self.URL||self.webkitURL;let a=r.uri||"",c=!1;if(void 0!==r.bufferView)a=this.getDependency("bufferView",r.bufferView).then((function(e){c=!0;const t=new Blob([e],{type:r.mimeType});return a=i.createObjectURL(t),a}));else if(void 0===r.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(a).then((function(e){return new Promise((function(s,r){let i=s;!0===t.isImageBitmapLoader&&(i=function(e){const t=new n.gPd(e);t.needsUpdate=!0,s(t)}),t.load(n.r6x.resolveURL(e,o.path),i,void 0,r)}))})).then((function(e){var t;return!0===c&&i.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]=l,l}assignTexture(e,t,s,n){const o=this;return this.getDependency("texture",s.index).then((function(r){if(!r)return null;if(void 0!==s.texCoord&&s.texCoord>0&&((r=r.clone()).channel=s.texCoord),o.extensions[a.KHR_TEXTURE_TRANSFORM]){const e=void 0!==s.extensions?s.extensions[a.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=o.associations.get(r);r=o.extensions[a.KHR_TEXTURE_TRANSFORM].extendTexture(r,e),o.associations.set(r,t)}}return void 0!==n&&(r.colorSpace=n),e[t]=r,r}))}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const o=void 0===t.attributes.tangent,r=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new n.BH$,n.imn.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,t.sizeAttenuation=!1,this.cache.add(e,t)),s=t}else if(e.isLine){const e="LineBasicMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new n.mrM,n.imn.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,this.cache.add(e,t)),s=t}if(o||r||i){let e="ClonedMaterial:"+s.uuid+":";o&&(e+="derivative-tangents:"),r&&(e+="vertex-colors:"),i&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=s.clone(),r&&(t.vertexColors=!0),i&&(t.flatShading=!0),o&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(s))),s=t}e.material=s}getMaterialType(){return n._4j}loadMaterial(e){const t=this,s=this.json,o=this.extensions,r=s.materials[e];let i;const c={},l=[];if((r.extensions||{})[a.KHR_MATERIALS_UNLIT]){const e=o[a.KHR_MATERIALS_UNLIT];i=e.getMaterialType(),l.push(e.extendParams(c,r,t))}else{const s=r.pbrMetallicRoughness||{};if(c.color=new n.Q1f(1,1,1),c.opacity=1,Array.isArray(s.baseColorFactor)){const e=s.baseColorFactor;c.color.setRGB(e[0],e[1],e[2],n.Zr2),c.opacity=e[3]}void 0!==s.baseColorTexture&&l.push(t.assignTexture(c,"map",s.baseColorTexture,n.er$)),c.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,c.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(l.push(t.assignTexture(c,"metalnessMap",s.metallicRoughnessTexture)),l.push(t.assignTexture(c,"roughnessMap",s.metallicRoughnessTexture))),i=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,c)}))))}!0===r.doubleSided&&(c.side=n.$EB);const u=r.alphaMode||"OPAQUE";if("BLEND"===u?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,"MASK"===u&&(c.alphaTest=void 0!==r.alphaCutoff?r.alphaCutoff:.5)),void 0!==r.normalTexture&&i!==n.V9B&&(l.push(t.assignTexture(c,"normalMap",r.normalTexture)),c.normalScale=new n.I9Y(1,1),void 0!==r.normalTexture.scale)){const e=r.normalTexture.scale;c.normalScale.set(e,e)}if(void 0!==r.occlusionTexture&&i!==n.V9B&&(l.push(t.assignTexture(c,"aoMap",r.occlusionTexture)),void 0!==r.occlusionTexture.strength&&(c.aoMapIntensity=r.occlusionTexture.strength)),void 0!==r.emissiveFactor&&i!==n.V9B){const e=r.emissiveFactor;c.emissive=(new n.Q1f).setRGB(e[0],e[1],e[2],n.Zr2)}return void 0!==r.emissiveTexture&&i!==n.V9B&&l.push(t.assignTexture(c,"emissiveMap",r.emissiveTexture,n.er$)),Promise.all(l).then((function(){const s=new i(c);return r.name&&(s.name=r.name),j(s,r),t.associations.set(s,{materials:e}),r.extensions&&D(o,s,r),s}))}createUniqueName(e){const t=n.Nwf.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,o=this.primitiveCache;function r(e){return s[a.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(s){return z(s,e,t)}))}const i=[];for(let s=0,c=e.length;s<c;s++){const c=e[s],l=K(c),u=o[l];if(u)i.push(u.promise);else{let e;e=c.extensions&&c.extensions[a.KHR_DRACO_MESH_COMPRESSION]?r(c):z(new n.LoY,c,t),o[l]={primitive:c,promise:e},i.push(e)}}return Promise.all(i)}loadMesh(e){const t=this,s=this.json,r=this.extensions,i=s.meshes[e],a=i.primitives,c=[];for(let e=0,t=a.length;e<t;e++){const t=void 0===a[e].material?(void 0===(l=this.cache).DefaultMaterial&&(l.DefaultMaterial=new n._4j({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.hB5})),l.DefaultMaterial):this.getDependency("material",a[e].material);c.push(t)}var l;return c.push(t.loadGeometries(a)),Promise.all(c).then((function(s){const c=s.slice(0,s.length-1),l=s[s.length-1],u=[];for(let s=0,h=l.length;s<h;s++){const h=l[s],d=a[s];let p;const m=c[s];if(d.mode===C.TRIANGLES||d.mode===C.TRIANGLE_STRIP||d.mode===C.TRIANGLE_FAN||void 0===d.mode)p=!0===i.isSkinnedMesh?new n.I46(h,m):new n.eaF(h,m),!0===p.isSkinnedMesh&&p.normalizeSkinWeights(),d.mode===C.TRIANGLE_STRIP?p.geometry=(0,o._c)(p.geometry,n.O49):d.mode===C.TRIANGLE_FAN&&(p.geometry=(0,o._c)(p.geometry,n.rYR));else if(d.mode===C.LINES)p=new n.DXC(h,m);else if(d.mode===C.LINE_STRIP)p=new n.N1A(h,m);else if(d.mode===C.LINE_LOOP)p=new n.FCc(h,m);else{if(d.mode!==C.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+d.mode);p=new n.ONl(h,m)}Object.keys(p.geometry.morphAttributes).length>0&&G(p,i),p.name=t.createUniqueName(i.name||"mesh_"+e),j(p,i),d.extensions&&D(r,p,d),t.assignFinalMaterial(p),u.push(p)}for(let s=0,n=u.length;s<n;s++)t.associations.set(u[s],{meshes:e,primitives:s});if(1===u.length)return i.extensions&&D(r,u[0],i),u[0];const h=new n.YJl;i.extensions&&D(r,h,i),t.associations.set(h,{meshes:e});for(let e=0,t=u.length;e<t;e++)h.add(u[e]);return h}))}loadCamera(e){let t;const s=this.json.cameras[e],o=s[s.type];if(o)return"perspective"===s.type?t=new n.ubm(n.cj9.radToDeg(o.yfov),o.aspectRatio||1,o.znear||1,o.zfar||2e6):"orthographic"===s.type&&(t=new n.qUd(-o.xmag,o.xmag,o.ymag,-o.ymag,o.znear,o.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),j(t,s),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],s=[];for(let e=0,n=t.joints.length;e<n;e++)s.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then((function(e){const s=e.pop(),o=e,r=[],i=[];for(let e=0,a=o.length;e<a;e++){const a=o[e];if(a){r.push(a);const t=new n.kn4;null!==s&&t.fromArray(s.array,16*e),i.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}return new n.EAD(r,i)}))}loadAnimation(e){const t=this.json,s=this,o=t.animations[e],r=o.name?o.name:"animation_"+e,i=[],a=[],c=[],l=[],u=[];for(let e=0,t=o.channels.length;e<t;e++){const t=o.channels[e],s=o.samplers[t.sampler],n=t.target,r=n.node,h=void 0!==o.parameters?o.parameters[s.input]:s.input,d=void 0!==o.parameters?o.parameters[s.output]:s.output;void 0!==n.node&&(i.push(this.getDependency("node",r)),a.push(this.getDependency("accessor",h)),c.push(this.getDependency("accessor",d)),l.push(s),u.push(n))}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(c),Promise.all(l),Promise.all(u)]).then((function(e){const t=e[0],o=e[1],i=e[2],a=e[3],c=e[4],l=[];for(let e=0,n=t.length;e<n;e++){const n=t[e],r=o[e],u=i[e],h=a[e],d=c[e];if(void 0===n)continue;n.updateMatrix&&n.updateMatrix();const p=s._createAnimationTracks(n,r,u,h,d);if(p)for(let e=0;e<p.length;e++)l.push(p[e])}return new n.tz3(r,void 0,l)}))}createNodeMesh(e){const t=this.json,s=this,n=t.nodes[e];return void 0===n.mesh?null:s.getDependency("mesh",n.mesh).then((function(e){const t=s._getNodeRef(s.meshCache,n.mesh,e);return void 0!==n.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,s=n.weights.length;t<s;t++)e.morphTargetInfluences[t]=n.weights[t]})),t}))}loadNode(e){const t=this,s=this.json.nodes[e],n=t._loadNodeShallow(e),o=[],r=s.children||[];for(let e=0,s=r.length;e<s;e++)o.push(t.getDependency("node",r[e]));const i=void 0===s.skin?Promise.resolve(null):t.getDependency("skin",s.skin);return Promise.all([n,Promise.all(o),i]).then((function(e){const t=e[0],s=e[1],n=e[2];null!==n&&t.traverse((function(e){e.isSkinnedMesh&&e.bind(n,q)}));for(let e=0,n=s.length;e<n;e++)t.add(s[e]);return t}))}_loadNodeShallow(e){const t=this.json,s=this.extensions,o=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];const r=t.nodes[e],i=r.name?o.createUniqueName(r.name):"",a=[],c=o._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return c&&a.push(c),void 0!==r.camera&&a.push(o.getDependency("camera",r.camera).then((function(e){return o._getNodeRef(o.cameraCache,r.camera,e)}))),o._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){a.push(e)})),this.nodeCache[e]=Promise.all(a).then((function(t){let a;if(a=!0===r.isBone?new n.$Kf:t.length>1?new n.YJl:1===t.length?t[0]:new n.B69,a!==t[0])for(let e=0,s=t.length;e<s;e++)a.add(t[e]);if(r.name&&(a.userData.name=r.name,a.name=i),j(a,r),r.extensions&&D(s,a,r),void 0!==r.matrix){const e=new n.kn4;e.fromArray(r.matrix),a.applyMatrix4(e)}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 o.associations.has(a)||o.associations.set(a,{}),o.associations.get(a).nodes=e,a})),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],o=this,r=new n.YJl;s.name&&(r.name=o.createUniqueName(s.name)),j(r,s),s.extensions&&D(t,r,s);const i=s.nodes||[],a=[];for(let e=0,t=i.length;e<t;e++)a.push(o.getDependency("node",i[e]));return Promise.all(a).then((function(e){for(let t=0,s=e.length;t<s;t++)r.add(e[t]);return o.associations=(e=>{const t=new Map;for(const[e,s]of o.associations)(e instanceof n.imn||e instanceof n.gPd)&&t.set(e,s);return e.traverse((e=>{const s=o.associations.get(e);null!=s&&t.set(e,s)})),t})(r),r}))}_createAnimationTracks(e,t,s,o,r){const i=[],a=e.name?e.name:e.uuid,c=[];let l;switch(U[r.path]===U.weights?e.traverse((function(e){e.morphTargetInfluences&&c.push(e.name?e.name:e.uuid)})):c.push(a),U[r.path]){case U.weights:l=n.Hit;break;case U.rotation:l=n.MBL;break;case U.position:case U.scale:l=n.RiT;break;default:l=1===s.itemSize?n.Hit:n.RiT}const u=void 0!==o.interpolation?B[o.interpolation]:n.PJ3,h=this._getArrayFromAccessor(s);for(let e=0,s=c.length;e<s;e++){const s=new l(c[e]+"."+U[r.path],t.array,h,u);"CUBICSPLINE"===o.interpolation&&this._createCubicSplineTrackInterpolant(s),i.push(s)}return i}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const e=X(t.constructor),s=new Float32Array(t.length);for(let n=0,o=t.length;n<o;n++)s[n]=t[n]*e;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof n.MBL?M:b)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function z(e,t,s){const o=t.attributes,r=[];function i(t,n){return s.getDependency("accessor",t).then((function(t){e.setAttribute(n,t)}))}for(const t in o){const s=F[t]||t.toLowerCase();s in e.attributes||r.push(i(o[t],s))}if(void 0!==t.indices&&!e.index){const n=s.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));r.push(n)}return n.ppV.workingColorSpace!==n.Zr2&&"COLOR_0"in o&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${n.ppV.workingColorSpace}" not supported.`),j(e,t),function(e,t,s){const o=t.attributes,r=new n.NRn;if(void 0===o.POSITION)return;{const e=s.json.accessors[o.POSITION],t=e.min,i=e.max;if(void 0===t||void 0===i)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(r.set(new n.Pq0(t[0],t[1],t[2]),new n.Pq0(i[0],i[1],i[2])),e.normalized){const t=X(O[e.componentType]);r.min.multiplyScalar(t),r.max.multiplyScalar(t)}}const i=t.targets;if(void 0!==i){const e=new n.Pq0,t=new n.Pq0;for(let n=0,o=i.length;n<o;n++){const o=i[n];if(void 0!==o.POSITION){const n=s.json.accessors[o.POSITION],r=n.min,i=n.max;if(void 0!==r&&void 0!==i){if(t.setX(Math.max(Math.abs(r[0]),Math.abs(i[0]))),t.setY(Math.max(Math.abs(r[1]),Math.abs(i[1]))),t.setZ(Math.max(Math.abs(r[2]),Math.abs(i[2]))),n.normalized){const e=X(O[n.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(e)}e.boundingBox=r;const a=new n.iyt;r.getCenter(a.center),a.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=a}(e,t,s),Promise.all(r).then((function(){return void 0!==t.targets?function(e,t,s){let n=!1,o=!1,r=!1;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(void 0!==s.POSITION&&(n=!0),void 0!==s.NORMAL&&(o=!0),void 0!==s.COLOR_0&&(r=!0),n&&o&&r)break}if(!n&&!o&&!r)return Promise.resolve(e);const i=[],a=[],c=[];for(let l=0,u=t.length;l<u;l++){const u=t[l];if(n){const t=void 0!==u.POSITION?s.getDependency("accessor",u.POSITION):e.attributes.position;i.push(t)}if(o){const t=void 0!==u.NORMAL?s.getDependency("accessor",u.NORMAL):e.attributes.normal;a.push(t)}if(r){const t=void 0!==u.COLOR_0?s.getDependency("accessor",u.COLOR_0):e.attributes.color;c.push(t)}}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(c)]).then((function(t){const s=t[0],i=t[1],a=t[2];return n&&(e.morphAttributes.position=s),o&&(e.morphAttributes.normal=i),r&&(e.morphAttributes.color=a),e.morphTargetsRelative=!0,e}))}(e,t.targets,s):e}))}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[613],{10613:(e,t,a)=>{a.r(t),a.d(t,{DebugPlugin:()=>o});var n=a(46881),r=a(11193),i=a(51794),s=a(37561);class o{_query;_container;_root;_debugStore;_store;constructor(e=""){this._query=e,this._container=e?document.querySelector(e):null}get id(){return"debug"}get name(){return"Plugin for widget debugging"}get version(){return"1.0.0"}setParams(e){this._query=e.query,this._container=e.query?document.querySelector(e.query):null}init(e){if(!this._container)return console.warn(`DebugPlugin: "${this._query}" element not found!`),!1;if(e.apiStore.isError)return!1;this._store=e;const t=new s.X(e);this._debugStore=t;const a=(0,r.H)(this._container);return a.render((0,n.createElement)(i.Y,{store:e,debugStore:t})),this._root=a,this.addListeners(),console.warn(`DebugPlugin (${this.version}) loaded.`),!0}shutdown(){this._root&&this._root.unmount(),this.removeListeners(),delete this._root,delete this._debugStore,delete this._store}addListeners(){document.addEventListener("keydown",this.onKeyDown)}removeListeners(){document.removeEventListener("keydown",this.onKeyDown)}onKeyDown=e=>{if(this._store)switch(e.key){case"Escape":{e.stopPropagation(),e.preventDefault();const t=this._debugStore;t&&t.setIsVisible(!t.isVisible);break}}}}},37561:(e,t,a)=>{a.d(t,{X:()=>r});var n=a(58426);class r{isVisible;variantId;floorIndex;panoramaId;info;infoVersion;_store;constructor(e){this.isVisible=!1,this.variantId=e.indexStore.variantId,this.floorIndex=e.indexStore.floorIndex,this.panoramaId=e.indexStore.panoramaId,this.infoVersion=0,(0,n.l_)(this),this.info="",this._store=e,this.onTimerUpdate()}get apiVariant(){const{apiStore:e,indexStore:t}=this._store;return e.data.variants.find((e=>e.plan_id===t.variantId))}get apiFloor(){return this.apiVariant?.floors[this.floorIndex]}get apiPanorama(){return this.apiFloor?.camera_points.find((e=>e.ID===this.panoramaId))}setIsVisible(e){this.isVisible=e}setVariantId(e){const t=this.variantId;this.variantId=e;const{apiVariant:a}=this;if(!a)return void(this.variantId=t);const{apiFloor:n}=this;n||(this.floorIndex=a.primary_floor);const{apiPanorama:r}=this;n&&!r&&(this.panoramaId=n.panorama_view.primary_camera_point_id)}setFloorIndex(e){const t=this.floorIndex;this.floorIndex=e;const{apiFloor:a}=this;if(!a)return void(this.floorIndex=t);const{apiPanorama:n}=this;n||(this.panoramaId=a.panorama_view.primary_camera_point_id)}setPanoramaId(e){const t=this.panoramaId;this.panoramaId=e;const{apiPanorama:a}=this;a||(this.panoramaId=t)}updateInfo(){const e=(e="")=>{this.info!==e&&(this.info=e,this.infoVersion=(this.infoVersion+1)%1e4)};if(!this.isVisible)return e();const t=this._store.panoramaTabStore;if(!t.controller.isInit)return e();const a=t.sceneController.widgetScene,{info:n}=a.renderer;if(null==n)return e();const r=[],{cameraStore:i}=this._store.panoramaTabStore;r.push(`[Camera] fov: ${i.fov.value.toFixed(2)}`);const{geometries:s,textures:o}=n.memory;r.push(`[Memory] geometries: ${s}, textures: ${o}`);const{calls:d,triangles:l,points:c,lines:p}=n.render;r.push(`[Render] calls: ${d}, triangles: ${l}, points: ${c}, lines: ${p}`);const{programs:u}=n,h=u?.length??0;if(r.push(`[Programs] count: ${h}`),null!=u)for(let e=0;e<h;e++){const t=u[e],a="type"in t?`${t.type}`:"",{name:n,id:i,usedTimes:s}=t;r.push(`(${i}) ${n} ${a} usedTimes: ${s}`)}e(r.join("\n"))}onTimerUpdate=()=>{requestAnimationFrame(this.onTimerUpdate),this.updateInfo()}}},51794:(e,t,a)=>{a.d(t,{Y:()=>d});var n=a(90405),r=a(64766),i=a(46881),s=a(9053),o=a(86707);a(73500);const d=(0,r.PA)((({store:e,debugStore:t})=>{const a=(0,i.useMemo)((()=>s.R.space("debug-panel",!t.isVisible&&"hidden")),[t.isVisible]),r=(0,i.useMemo)((()=>t.info),[t.infoVersion]);return(0,n.jsxs)("div",{className:a,children:[(0,n.jsx)("h3",{className:"debug-panel__header",children:"Debug panel"}),(0,n.jsx)("pre",{children:r}),(0,n.jsxs)("label",{className:"debug-panel__section pointer",children:["Enable wireframe",(0,n.jsx)("input",{name:"isWireframe",type:"checkbox",onChange:t=>{switch(t.target.name){case"isWireframe":{const{sceneController:t}=e.panoramaTabStore;if(!t)return;t.setWireframe(!t.isWireframe);break}}}})]}),(0,n.jsx)(o.l,{store:e,debugStore:t})]})}))},73500:(e,t,a)=>{var n=a(85072),r=a.n(n),i=a(97825),s=a.n(i),o=a(77659),d=a.n(o),l=a(55056),c=a.n(l),p=a(10540),u=a.n(p),h=a(41113),m=a.n(h),_=a(90971),g={};g.styleTagTransform=m(),g.setAttributes=c(),g.insert=d().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=u(),r()(_.A,g),_.A&&_.A.locals&&_.A.locals},86707:(e,t,a)=>{a.d(t,{l:()=>s});var n=a(90405),r=a(64766),i=a(46881);const s=(0,r.PA)((({store:e,debugStore:t})=>{const a=(0,i.useMemo)((()=>e.apiStore.data.variants),[e.apiStore.data.variants]),r=(0,i.useMemo)((()=>t.apiVariant?.floors??[]),[t.apiVariant]),s=(0,i.useMemo)((()=>t.apiFloor?.camera_points??[]),[t.apiFloor]),o=(0,i.useMemo)((()=>t.variantId),[t.variantId]),d=(0,i.useMemo)((()=>t.floorIndex),[t.floorIndex]),l=(0,i.useMemo)((()=>t.panoramaId),[t.panoramaId]),c=e=>{switch(e.target.name){case"variantId":t.setVariantId(e.target.value);break;case"floorIndex":t.setFloorIndex(Number(e.target.value));break;case"panoramaId":t.setPanoramaId(e.target.value)}};return(0,n.jsxs)("div",{className:"debug-panel__variant-selector",children:[(0,n.jsx)("p",{children:"Panorama selector"}),(0,n.jsx)("select",{className:"variant-selector__select",name:"variantId",onChange:c,value:o,children:a.map((e=>(0,n.jsx)("option",{value:e.plan_id,children:e.plan_id},e.plan_id)))}),(0,n.jsx)("select",{className:"variant-selector__select",name:"floorIndex",onChange:c,value:d,children:r.map(((e,t)=>(0,n.jsx)("option",{value:t,children:t+1},t)))}),(0,n.jsx)("select",{className:"variant-selector__select",name:"panoramaId",onChange:c,value:l,children:s.map((e=>(0,n.jsx)("option",{value:e.ID,children:e.ID},e.ID)))}),(0,n.jsx)("button",{onClick:()=>e.indexStore.set(o,d,l),children:"Set"})]})}))},90971:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(58734),r=a.n(n),i=a(2431),s=a.n(i)()(r());s.push([e.id,".debug-panel{font-family:sans-serif;display:block;position:fixed;left:50px;top:50px;padding:8px;border-radius:8px;background-color:rgba(255,255,255,.5333333333);z-index:1000;max-width:40vw}.debug-panel.hidden{display:none}.debug-panel__header{text-align:center}.debug-panel__section{display:flex;gap:4px;padding:4px}.debug-panel__section.pointer{cursor:pointer}.debug-panel__variant-selector{display:flex;flex-direction:column;gap:4px;padding:4px;border:1px solid #000;border-radius:4px}.variant-selector__select{padding:4px}",""]);const o=s}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[761],{19761:(e,t,o)=>{o.r(t),o.d(t,{FovPlugin:()=>r});class r{_store;_fovSpeed;_touchEvent;_touchStartFov;constructor(e=1){this._fovSpeed=e,this._touchStartFov=75}get id(){return"fov"}get name(){return"Plugin for camera FOV scrolling by mouse"}get version(){return"1.0.0"}setParams(e){this._fovSpeed=e.fovSpeed??1}get isPanoramaTab(){return"panorama"===this._store?.tabStore.tab&&!this._store.panoramaTabStore.instructionsStore.visible}get cameraStore(){return this._store.panoramaTabStore.cameraStore}init=e=>{this._store=e;const{domElement:t}=e.panoramaTabStore.sceneController.widgetScene.renderer;return t.addEventListener("touchstart",this.onTouchStart),t.addEventListener("touchmove",this.onTouchMove),t.addEventListener("wheel",this.onWheel),document.addEventListener("touchend",this.onTouchEnd),!0};shutdown=()=>{const e=this._store;if(!e)return;const t=e.panoramaTabStore.sceneController.widgetScene.renderer.domElement;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("wheel",this.onWheel),document.removeEventListener("touchend",this.onTouchEnd),delete this._store};onWheel=e=>{if(!this.isPanoramaTab)return;e.preventDefault(),e.stopPropagation();const t=Math.sign(e.deltaY)*this._fovSpeed,{cameraStore:o}=this;o.fov.set(o.fov.value+t)};onTouchStart=e=>{this.isPanoramaTab&&(2===e.touches.length?(e.preventDefault(),this._touchEvent=e,this._touchStartFov=this.cameraStore.fov.value):this._touchEvent=void 0)};onTouchMove=e=>{if(!this.isPanoramaTab)return;if(2!==this._touchEvent?.touches.length)return;e.preventDefault();const{touches:t}=e;if(2!==t.length)return;const[o,r]=this._touchEvent.touches,[n,s]=t,a=((r.screenX-o.screenX)**2+(r.screenY-o.screenY)**2)**.5/((s.screenX-n.screenX)**2+(s.screenY-n.screenY)**2)**.5,{cameraStore:h}=this;h.fov.set(this._touchStartFov*a)};onTouchEnd=()=>{this._touchEvent=void 0}}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[822],{822:(t,e,A)=>{A.r(e),A.d(e,{TalanVendor:()=>g});var a=A(29371),o=A(10215),i=A(63222),s=A(51499),n=A(38840),r=A(63705);class g{id="talan";name="Talan vendor plugin";version="1.0.0";isLate=!1;_store;constructor(){}init(t){this._store=t;const{overrideStore:e}=t,A=new i.e(t),g=new s.z(t),l=new n.M(t),c=new r.P(t);return e.set("apertureRenderer",A),e.set("cameraPointRenderer",g),e.set("portalRenderer",l),e.set("stairRenderer",c),e.set("AdditionalFrame",a.b),e.set("LogoWrapper",o.f),!0}shutdown(){const{overrideStore:t}=this._store;t.set("apertureRenderer",void 0),t.set("cameraPointRenderer",void 0),t.set("portalRenderer",void 0),t.set("stairRenderer",void 0),t.set("AdditionalFrame",void 0)}}},10215:(t,e,A)=>{A.d(e,{f:()=>i});var a=A(90405),o=(A(74231),A(89213));const i=({store:t})=>{const{useState:e}=t.reactStore.react,[A,i]=e("talanLogo");return(0,a.jsxs)("div",{className:A,children:[(0,a.jsxs)("div",{className:"talanLogo__logoRow",onClick:()=>{i((t=>"talanLogo"===t?"talanLogo talanLogo--collapse":"talanLogo"))},children:[(0,a.jsx)("div",{className:"talanLogo__arrow"}),(0,a.jsx)("img",{src:o,alt:""})]}),(0,a.jsxs)("div",{className:"talanLogo__row",children:[(0,a.jsx)("b",{children:"Природные кварталы «Сибирия»"}),(0,a.jsx)("a",{href:"https://xn--90absbknhbvge.xn--80aa6ajv.xn--p1ai/",children:"новосибирск.талан.рф"})]}),(0,a.jsxs)("div",{className:"talanLogo__row",children:[(0,a.jsx)("b",{children:"Офис продаж"}),(0,a.jsx)("a",{href:"tel:+73833753751",children:"+ 7 (383) 375-37-51"}),(0,a.jsx)("span",{children:"пн-пт 9:00 — 18:00"})]}),(0,a.jsxs)("div",{className:"talanLogo__row",children:[(0,a.jsx)("span",{children:"Застройщик имеет право внести изменения в проект."}),(0,a.jsx)("span",{children:"Не является публичной офертой."})]})]})}},16460:t=>{t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAAMACAYAAADsZm+OAAAqb0lEQVR42u2dC7AVxZnHycZSk5uYVNbNC1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iOhBlJ1+7r6DfKfS7yAYA+P8/bCZyXY643pKXwCHd4RR0QSQqAGqofaxrMw6HZ+AV74Qi7AmCh7cabj+Ph0hD/Ebg/mi0p/15Q7OPhul/wMwcADEvS8/lKEGEzF67ndzxp8GQXJUGE7hc8gd9kA8A3tBXWo3wCYJMiJlCWjc+Kea9ByuqXfhU9RYzuFwQJeoBwoepfbOriK0nUHCzuRF2/q7OU+a06kb3SyOsiIChykqgZDgCQeq9tHXykibtX677vj7Etq29Dy1W1G+r0MmVIEzfIAQC5SRRZz/MeEAOATXU2MqKGmqInigxzCRQKAB2CRtMul6liVQjKkipW/oarigZACAGTRRdUad6M6eIJwDsXXxhRcQAaXQSghADwpVEVB4AiABQBoAgARQConOj/AZPv6gbpxyJwAAAAAElFTkSuQmCC"},17107:(t,e,A)=>{A.d(e,{A:()=>n});var a=A(58734),o=A.n(a),i=A(2431),s=A.n(i)()(o());s.push([t.id,".widget-application .talanTextRenderer{display:block;width:100%;height:100%;position:absolute;left:0;top:0;z-index:5;pointer-events:none}.widget-application .talanFloatText{display:flex;position:absolute;color:#fff;filter:drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));font-weight:600;transition:opacity .1s}.widget-application .talanFloatText{font-size:48px}@media(max-width: 1024px){.widget-application .talanFloatText{font-size:36px}}@media(max-width: 768px){.widget-application .talanFloatText{font-size:24px}}.widget-application .talanFloatText--hidden{opacity:0}",""]);const n=s},29371:(t,e,A)=>{A.d(e,{b:()=>i});var a=A(90405),o=A(61136);const i=({store:t})=>(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(o.j,{store:t})})},38840:(t,e,A)=>{A.d(e,{M:()=>s});var a=A(37458),o=A(29250),i=A(78944);class s extends a.B69{linksPool=[];materialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("door"),this.cacheMaterial("spot"),this.cacheMaterial("stairUp"),this.cacheMaterial("stairDown")}dispose(){}update(t){this.updateData(t);const{portalStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){const t=this._store;if(!t.capabilityStore.isPortalNavigation)return;const e=t.domainStore.portalStore.currentArray;if(null==e)return;const{linksPool:A}=this;for(let a=A.length,o=e.length;a<o;a++){const e=new i.B(t);this.add(e),A[a]=e}for(let t=0,a=A.length;t<a;t++){const a=A[t];if(t>=e.length){a.visible=!1,a.isInteractive=!1;continue}const o=e[t];a.material=this.getMaterial(o.icon),a.visible=!0,a.isInteractive=!0,a.setDomain(o)}}cacheMaterial(t){if(this.materialPool.has(t))return;const e=this._store.panoramaTabStore.linkIconStore.get(t),A=new a.V9B({transparent:!0,side:a.$EB}),i=new o.g({transparent:!0,side:a.$EB});this.materialPool.set(t,[A,i]),this._store.panoramaTabStore.iconTextureResources.get(e).then((t=>{t&&(A.map=t,A.needsUpdate=!0,i.map=t,i.needsUpdate=!0)}))}onRaycastDown=t=>{"Portal"===t.type&&this.linksPool.some((e=>!(!e.isInteractive||e.domainId!==t.id||(e.onRaycastDown(t),0))))};_prevEvent={id:"",type:""};onRaycastChange=t=>{this._prevEvent.type===t.type&&this._prevEvent.id===t.id||(this._prevEvent.type=t.type,this._prevEvent.id=t.id,this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)})))};getMaterial(t){return this.cacheMaterial(t),this.materialPool.get(t)}}},50214:(t,e,A)=>{A.d(e,{W:()=>i});var a=A(85479),o=A(37458);class i extends o.kxk{domainType="Stair";isInteractive=!1;domain;domainId="";_store;constructor(t){super(),this._store=t,this.scale.setScalar(.1)}setDomain(t){this.domain=t,this.domainId=t?.id??""}update(t){(0,a.x3)(t);const{domain:e}=this;e&&this.position.copy(e.position)}onRaycastDown(t){if(this.domainType!==t.type||this.domainId!==t.id)return;let{targetVariantId:e,targetFloorIndex:A,targetPanoramaId:a}=this.domain;const{indexStore:o}=this._store;if(!e&&-1===A){const t=o.resolver.resolveByPanoramaId(a);t&&(e=t.variantId,A=t.floorIndex,a=t.panoramaId)}e||(e=o.variantId),-1===A&&(A=o.floorIndex),a&&o.set(e,A,a)}onRaycastChange(t){const e=this.domainType===t.type&&this.domainId===t.id;this.scale.setScalar(e?.15:.1)}}},51499:(t,e,A)=>{A.d(e,{z:()=>i});var a=A(37458),o=A(29250);class i extends a.B69{linksPool=[];materialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("spot")}dispose(){}update(t){this.updateData(t);const{cameraPointStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){}onRaycastDown=t=>{"CameraPoint"===t.type&&this.linksPool.forEach((e=>{e.isInteractive&&e.domainId===t.id&&e.onRaycastDown(t)}))};_prevEvent={id:"",type:""};onRaycastChange=t=>{this._prevEvent.type===t.type&&this._prevEvent.id===t.id||(this._prevEvent.type=t.type,this._prevEvent.id=t.id,this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)})))};cacheMaterial(t){if(this.materialPool.has(t))return;const e=this._store.panoramaTabStore.linkIconStore.get(t),A=new o.g({color:4303415});this.materialPool.set(t,A),this._store.panoramaTabStore.iconTextureResources.get(e).then((t=>{t&&(A.map=t,A.needsUpdate=!0)}))}getMaterial(t){return this.cacheMaterial(t),this.materialPool.get(t)}}},61136:(t,e,A)=>{A.d(e,{j:()=>c});var a=A(90405),o=A(63306),i=A(65041),s=A(37458);A(66026);const n=new i.V3,r=new s.Pq0,g=new s.Pq0,l=new o.V2(.5,2),c=({store:t})=>{const{useEffect:e,useRef:A,useState:o}=t.reactStore.react,[i,s]=o(""),c=A(null),d=A(null);e((()=>{let t=window.requestAnimationFrame((function e(){t=window.requestAnimationFrame(e),h()}));return()=>window.cancelAnimationFrame(t)}),[]);const h=()=>{const e=c.current,A=d.current;if(!e||!A)return;if("panorama"!==t.tabStore.tab)return void(e.style.display="none");e.style.display="block";const a=(()=>{const{domainStore:e}=t;if(0===e.selected.length)return;const A=e.selected.find((t=>"Portal"===t.type));if(!A)return;const a=e.portalStore.getById(A.id);return a&&a.data.Hint?a:void 0})();if(!a)return void(A.className="talanFloatText talanFloatText--hidden");const{camera:o}=t.panoramaTabStore.sceneController.widgetScene;o.getWorldPosition(g),n.copy(a.position).rotateY(Math.PI/2),r.copy(n).project(o);const i=r.x+1,h=1-r.y,p=r.z,C=i*(e.offsetWidth/2-A.offsetWidth*l.x)|0,I=h*(e.offsetHeight/2-A.offsetHeight*l.y)|0;p<1?(s(a.data.Hint),A.className="talanFloatText",A.style.transform=`matrix(1,0,0,1,${C},${I})`):A.className="talanFloatText talanFloatText--hidden"};return(0,a.jsx)("div",{className:"talanTextRenderer",ref:c,children:(0,a.jsx)("div",{className:"talanFloatText",ref:d,children:i})})}},62018:(t,e,A)=>{A.d(e,{A:()=>d});var a=A(58734),o=A.n(a),i=A(2431),s=A.n(i),n=A(14502),r=A.n(n),g=new URL(A(16460),A.b),l=s()(o()),c=r()(g);l.push([t.id,`.widget-application .talanLogo{display:flex;flex-direction:column;gap:.75em;width:256px;height:250px;position:absolute;left:0;top:0;z-index:6;padding:4px;transition:height .2s,background-color .2s;overflow:hidden;background-color:rgba(255,255,255,.7)}.widget-application .talanLogo *{font-weight:500;font-size:15px}.widget-application .talanLogo b{font-weight:bold}.widget-application .talanLogo a{color:#58a;text-decoration:underline}.widget-application .talanLogo__logoRow{flex-shrink:0;flex-grow:0;cursor:pointer;display:flex;align-items:center;flex-direction:column;height:48px;gap:.1em}.widget-application .talanLogo__arrow{display:block;width:64px;height:64px;position:absolute;left:-8px;top:-8px;transition:transform .2s;background-image:url(${c});background-repeat:no-repeat;background-size:128px 768px;background-position:0 -256px}.widget-application .talanLogo__logoRow img{object-fit:contain;width:60%;height:100%}.widget-application .talanLogo__row{display:flex;flex-direction:column;gap:.1em}.widget-application .talanLogo--collapse{height:64px;background-color:rgba(255,255,255,0)}.widget-application .talanLogo--collapse .talanLogo__arrow{transform:rotate(-180deg)}`,""]);const d=l},63222:(t,e,A)=>{A.d(e,{e:()=>i});var a=A(37458),o=A(29250);class i extends a.B69{linksPool=[];materialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("door")}dispose(){}update(t){this.updateData(t);const{apertureStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){}onRaycastDown=t=>{"Aperture"===t.type&&this.linksPool.some((e=>!(!e.isInteractive||e.domainId!==t.id||(e.onRaycastDown(t),0))))};_prevEvent={id:"",type:""};onRaycastChange=t=>{this._prevEvent.type===t.type&&this._prevEvent.id===t.id||(this._prevEvent.type=t.type,this._prevEvent.id=t.id,this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)})))};cacheMaterial(t){if(this.materialPool.has(t))return;const e=this._store.panoramaTabStore.linkIconStore.get(t),A=new o.g({color:4303415});this.materialPool.set(t,A),this._store.panoramaTabStore.iconTextureResources.get(e).then((t=>{t&&(A.map=t,A.needsUpdate=!0)}))}getMaterial(t){return this.cacheMaterial(t),this.materialPool.get(t)}}},63705:(t,e,A)=>{A.d(e,{P:()=>s});var a=A(37458),o=A(29250),i=A(50214);class s extends a.B69{linksPool=[];materialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("stairDown"),this.cacheMaterial("stairUp")}dispose(){}update(t){this.updateData(t);const{stairStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){const t=this._store,e=t.domainStore.stairStore.currentArray;if(null==e)return;const{linksPool:A}=this;for(let a=A.length,o=e.length;a<o;a++){const e=new i.W(t);this.add(e),A[a]=e}for(let t=0,a=A.length;t<a;t++){const a=A[t];if(t>=e.length){a.visible=!1,a.isInteractive=!1;continue}const o=e[t];a.material=this.getMaterial(o.icon),a.visible=!0,a.isInteractive=!0,a.setDomain(o)}}onRaycastDown=t=>{"Stair"===t.type&&this.linksPool.some((e=>!(!e.isInteractive||t.id!==e.domainId||(e.onRaycastDown(t),0))))};onRaycastChange=t=>{this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)}))};cacheMaterial(t){if(this.materialPool.has(t))return;const e=this._store.panoramaTabStore.linkIconStore.get(t),A=new o.g({color:4303415});this.materialPool.set(t,A),this._store.panoramaTabStore.iconTextureResources.get(e).then((t=>{t&&(A.map=t,A.needsUpdate=!0)}))}getMaterial(t){return this.cacheMaterial(t),this.materialPool.get(t)}}},66026:(t,e,A)=>{var a=A(85072),o=A.n(a),i=A(97825),s=A.n(i),n=A(77659),r=A.n(n),g=A(55056),l=A.n(g),c=A(10540),d=A.n(c),h=A(41113),p=A.n(h),C=A(17107),I={};I.styleTagTransform=p(),I.setAttributes=l(),I.insert=r().bind(null,"head"),I.domAPI=s(),I.insertStyleElement=d(),o()(C.A,I),C.A&&C.A.locals&&C.A.locals},74231:(t,e,A)=>{var a=A(85072),o=A.n(a),i=A(97825),s=A.n(i),n=A(77659),r=A.n(n),g=A(55056),l=A.n(g),c=A(10540),d=A.n(c),h=A(41113),p=A.n(h),C=A(62018),I={};I.styleTagTransform=p(),I.setAttributes=l(),I.insert=r().bind(null,"head"),I.domAPI=s(),I.insertStyleElement=d(),o()(C.A,I),C.A&&C.A.locals&&C.A.locals},78944:(t,e,A)=>{A.d(e,{B:()=>l});var a=A(65041),o=A(31373),i=A(85479),s=A(37458),n=A(14705);class r extends s.eaF{domainType="Portal";domainId="";isInteractive=!1;constructor(){super(),this.geometry=new n.z,this.visible=!1}}class g extends s.kxk{domainType="Portal";domainId="";isInteractive=!1;constructor(){super(),this.visible=!1}}class l extends s.B69{domainType="Portal";domainId="";domain;sprite;mesh;targetScale=new a.V3(1,1,1);baseScale=.5;hoverScale=.7;_isInteractive=!1;_store;constructor(t){super(),this.sprite=new g,this.mesh=new r,this.add(this.sprite,this.mesh),this._store=t,this.scale.setScalar(this.baseScale)}get material(){return[this.mesh.material,this.sprite.material]}set material(t){this.mesh.material=t[0],this.sprite.material=t[1]}get isInteractive(){return this._isInteractive}set isInteractive(t){const{domain:e}=this,A=!!e?.data.IsMesh;this._isInteractive=t,this.mesh.isInteractive=!!A&&t,this.sprite.isInteractive=!A&&t}setDomain(t){this.domain=t;const e=t?.id??"";this.domainId=e,this.sprite.domainId=e,this.mesh.domainId=e;const A=!!t?.data.IsMesh;this.mesh.visible=A,this.sprite.visible=!A,this.isInteractive=!!t,this.updateScale(!1)}update(t){(0,i.x3)(t);const{domain:e}=this;e&&(e.data.IsMesh&&this.rotation.set(e.data.Rotation.Pitch*o.up,-e.data.Rotation.Yaw*o.up,e.data.Rotation.Roll*o.up,"YXZ"),this.position.copy(e.position),this.scale.lerp(this.targetScale,(0,o.J$)(15*t)))}onRaycastDown(t){if(t.type!==this.domainType||t.id!==this.domainId)return;const{domain:e}=this;return e?"modal"===e.data.Type?this.onPortalModal(e):this.onPortalMove(e):void 0}onPortalModal(t){t.data.Data&&this._store.modalStore.show(t.data.Data)}onPortalMove(t){const{indexStore:e}=this._store;let{targetVariantId:A,targetFloorIndex:a,targetPanoramaId:o}=t;if(!A&&-1===a){const t=e.resolver.resolveByPanoramaId(o);t&&(A=t.variantId,a=t.floorIndex,o=t.panoramaId)}A||(A=e.variantId),-1===a&&(a=e.floorIndex),o&&e.set(A,a,o)}onRaycastChange(t){const e=t.type===this.domainType&&t.id===this.domainId;this.updateScale(e)}updateScale(t=!1){const{domain:e}=this;e?this.targetScale.set(e.data.Scale.X,e.data.Scale.Z,e.data.Scale.Y):this.targetScale.set(1,1,1),this.targetScale.scale(t?this.hoverScale:this.baseScale)}}},89213:t=>{t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbm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NTEtMi40MDQtMS42OS0zLjk0My0xLjY5LTIuNzA0IDAtNC44ODIgMi4xNzgtNC44ODIgNC44NDRabTE0LjM0NCA5LjQ2M0gzNC40bC0uNDUyLTEuMDg5Yy0xLjI3Ni45MzktMy4xMTcgMS41NC01LjEwNyAxLjU0LTUuNTU4IDAtMTAuMDI2LTQuNDctMTAuMDI2LTkuOTE1QzE4LjgxNCA0LjQ3IDIzLjI4NCAwIDI4Ljg0IDBjMS45OSAwIDMuODMuNjM4IDUuMTA3IDEuNTc3bC40NTEtMS4xMjZoNC40MzF2MTguOTYzWm0tMzIuNjExLjAwMVY1LjI5NUguNDM1Vi40NTFoMTcuMTI0djQuODQ0aC01LjgydjE0LjEySDYuMjE3WiIvPjwvc3ZnPg=="}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[827],{9827:(e,a,t)=>{t.r(a),t.d(a,{DebugPanelPlugin:()=>o});var n=t(46881),i=t(11193),r=t(50448),s=t(71427);class o{_query;_container;_root;_debugPanelStore;_store;constructor(e=""){this._query=e,this._container=e?document.querySelector(e):null}get id(){return"debug-panel"}get name(){return"Debug panel plugin for widget"}get version(){return"1.0.0"}setParams(e){this._query=e.query,this._container=e.query?document.querySelector(e.query):null}init(e){if(!this._container)return console.warn(`DebugPanelPlugin: "${this._query}" element not found!`),!1;if(e.apiStore.isError)return!1;this._store=e;const a=new s.x(e);this._debugPanelStore=a;const t=(0,i.H)(this._container);return t.render((0,n.createElement)(r.Y,{store:e,debugPanelStore:a})),this._root=t,this.addListeners(),console.warn(`DebugPanelPlugin (${this.version}) loaded.`),!0}shutdown(){this._root&&this._root.unmount(),this.removeListeners(),delete this._root,delete this._debugPanelStore,delete this._store}addListeners(){document.addEventListener("keydown",this.onKeyDown)}removeListeners(){document.removeEventListener("keydown",this.onKeyDown)}onKeyDown=e=>{const a=this._debugPanelStore;if(!a)return;const t=e.shiftKey,n=e.ctrlKey||e.metaKey;t&&n&&"KeyX"===e.code&&(e.preventDefault(),e.stopPropagation(),a.setIsVisible(!a.isVisible))}}},37973:(e,a,t)=>{t.d(a,{A:()=>o});var n=t(58734),i=t.n(n),r=t(2431),s=t.n(r)()(i());s.push([e.id,'.debug-panel *{font-family:"Roboto Flex",sans-serif}.debug-panel{position:absolute;left:unset;right:8px;top:8px;z-index:99999;pointer-events:all;display:block;min-width:300px;max-width:600px;max-height:600px;background-color:rgba(255,255,255,.6);backdrop-filter:blur(2px);border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.1);overflow:hidden;border:1px solid rgba(255,255,255,.2);transition:all .3s ease}.debug-panel--collapsed{max-height:50px}.debug-panel__header{cursor:pointer;background-color:rgba(240,240,240,.8);padding:12px 16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid rgba(0,0,0,.1);user-select:none}.debug-panel__title{font-weight:600;color:#333;font-size:14px}.debug-panel__controls{display:flex;gap:8px}.debug-panel__control-button{background-color:#666;color:#fff;border:none;border-radius:4px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:12px;transition:background-color .2s ease}.debug-panel__control-button:hover{background-color:#555}.debug-panel__control-button::before{content:"–"}.debug-panel--collapsed .debug-panel__control-button::before{content:"+"}.debug-panel__content{padding:16px;max-height:550px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.3) rgba(0,0,0,0)}.debug-panel__content::-webkit-scrollbar{width:6px}.debug-panel__content::-webkit-scrollbar-track{background-color:rgba(0,0,0,0)}.debug-panel__content::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:3px}.section{margin-bottom:20px}.section:last-child{margin-bottom:0}.section-title{color:#2e7d32;font-weight:600;font-size:13px;margin-bottom:8px;text-transform:uppercase;letter-spacing:.5px}.info-row{display:flex;justify-content:space-between;align-items:center;padding:4px 0;border-bottom:1px solid rgba(0,0,0,.05)}.info-row:last-child{border-bottom:none}.info-label{color:#666;font-size:12px;font-weight:500}.info-value{color:#333;font-size:12px;font-family:"Monaco","Menlo","Ubuntu Mono",monospace;text-align:right;max-width:180px;word-break:break-all}.quality-indicator{display:inline-flex;align-items:center;gap:6px;padding:2px 8px;border-radius:12px;font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.3px}.quality-no-rtx{background-color:rgba(158,158,158,.2);color:#9e9e9e;font-style:italic}.quality-preview{background-color:rgba(96,125,139,.2);color:#607d8b}.quality-low{background-color:rgba(244,67,54,.2);color:#f44336}.quality-medium{background-color:rgba(255,152,0,.2);color:#ff9800}.quality-high{background-color:rgba(76,175,80,.2);color:#4caf50}.quality-ultra{background-color:rgba(46,125,50,.2);color:#2e7d32;font-weight:700}.quality-epic{background-color:rgba(106,27,154,.2);color:#6a1b9a;font-weight:700;text-shadow:0 1px 2px rgba(106,27,154,.3)}.quality-unlit{background-color:rgba(121,85,72,.2);color:#795548}.capability-item{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid rgba(0,0,0,.05)}.capability-item:last-child{border-bottom:none}.capability-status{display:flex;align-items:center;gap:6px}.status-indicator{width:8px;height:8px;border-radius:50%;background-color:#ccc}.status-indicator.enabled{background-color:#4caf50;box-shadow:0 0 4px rgba(76,175,80,.4)}.variant-item{background-color:rgba(0,0,0,.02);border-radius:8px;padding:12px;margin-bottom:8px;border-left:3px solid #2e7d32}.variant-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.variant-name{font-weight:600;color:#333;font-size:13px}.variant-badges{display:flex;gap:4px}.badge{padding:2px 6px;border-radius:4px;font-size:10px;font-weight:500;text-transform:uppercase}.badge-renovation{background-color:#e3f2fd;color:#1976d2}.badge-priority{background-color:#fff3e0;color:#f57c00}.hotkey-hint{position:fixed;top:20px;left:20px;background-color:rgba(0,0,0,.8);color:#fff;padding:8px 12px;border-radius:6px;font-size:12px;font-family:monospace}.collapsed .panel-content{display:none}',""]);const o=s},50448:(e,a,t)=>{t.d(a,{Y:()=>o});var n=t(90405),i=t(64766),r=t(46881),s=t(9053);t(60572);const o=(0,i.PA)((({store:e,debugPanelStore:a})=>{const{localeStore:t}=e,i=(0,r.useMemo)((()=>["header","minimizeMaximize","planInformation","planID","serviceID","lastInvalidation","totalArea","floors","rooms","qualityProcessing","rtxQuality","rtxQualityTopView","processingServer","primaryVariant","variantID","styleVariants","navigation","quality"].reduce(((e,a)=>{var n;return e[a]=(n=a,t.get(`debugPanel.${n}`)),e}),{})),[]);if(!a.isVisible)return null;const o=s.R.space("debug-panel",a.isCollapsed&&"debug-panel--collapsed");return(0,n.jsxs)("div",{className:o,ref:e=>{e?.addEventListener("wheel",(e=>{e.stopPropagation()}))},children:[(0,n.jsxs)("div",{className:"debug-panel__header",onClick:()=>{a.setIsCollapsed(!a.isCollapsed)},children:[(0,n.jsxs)("div",{className:"debug-panel__title",children:["🔧 ",i.header]}),(0,n.jsx)("div",{className:"debug-panel__controls",children:(0,n.jsx)("button",{className:"debug-panel__control-button",title:i.minimizeMaximize,children:(0,n.jsx)("span",{id:"toggleIcon"})})})]}),(0,n.jsxs)("div",{className:"debug-panel__content",children:[(0,n.jsxs)("div",{className:"section",children:[(0,n.jsx)("div",{className:"section-title",children:i.planInformation}),a.crmPlanId&&(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.planID}),(0,n.jsxs)("span",{className:"info-value",children:["CRM: ",a.crmPlanId]})]}),a.planId&&(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.serviceID}),(0,n.jsx)("span",{className:"info-value",children:a.planId})]}),a.planJsonUpdatedAtText&&(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.lastInvalidation}),(0,n.jsx)("span",{className:"info-value",children:a.planJsonUpdatedAtText})]}),a.totalArea&&(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.totalArea}),(0,n.jsx)("span",{className:"info-value",children:a.totalAreaText})]}),(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.floors}),(0,n.jsx)("span",{className:"info-value",children:a.floorsCount})]}),(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.rooms}),(0,n.jsxs)("span",{className:"info-value",children:[a.floorRoomsCount," / ",a.roomsCount]})]})]}),a.primaryVariantId&&(0,n.jsxs)("div",{className:"section",children:[(0,n.jsx)("div",{className:"section-title",children:i.primaryVariant}),(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.variantID}),(0,n.jsx)("span",{className:"info-value",children:a.primaryVariantId})]})]}),(0,n.jsxs)("div",{className:"section",children:[(0,n.jsx)("div",{className:"section-title",children:i.styleVariants}),a.styleVariants.map((e=>(0,n.jsxs)("div",{className:"variant-item",children:[(0,n.jsx)("div",{className:"variant-header",children:(0,n.jsx)("span",{className:"variant-name",children:e.name})}),(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.navigation}),(0,n.jsx)("span",{className:"info-value",children:e.navigation})]}),(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.rtxQuality}),(0,n.jsx)("span",{className:`quality-indicator ${e.rtxQualityClassName}`,children:e.rtxQuality})]}),(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.rtxQualityTopView}),(0,n.jsx)("span",{className:`quality-indicator ${e.rtxQualityTopViewClassName}`,children:e.rtxQualityTopView})]}),(0,n.jsxs)("div",{className:"info-row",children:[(0,n.jsx)("span",{className:"info-label",children:i.processingServer}),(0,n.jsx)("span",{className:"info-value",children:e.processingServer})]}),e.capabilities.map((e=>{const a=s.R.space("status-indicator",e.status&&"enabled");return(0,n.jsxs)("div",{className:"info-row capability-item",children:[(0,n.jsx)("span",{className:"info-label",children:e.label}),(0,n.jsxs)("div",{className:"capability-status",children:[(0,n.jsx)("span",{className:"info-value",children:e.value}),(0,n.jsx)("div",{className:a})]})]},e.label)}))]},e.name)))]})]})]})}))},60572:(e,a,t)=>{var n=t(85072),i=t.n(n),r=t(97825),s=t.n(r),o=t(77659),l=t.n(o),c=t(55056),d=t.n(c),p=t(10540),u=t.n(p),g=t(41113),b=t.n(g),x=t(37973),m={};m.styleTagTransform=b(),m.setAttributes=d(),m.insert=l().bind(null,"head"),m.domAPI=s(),m.insertStyleElement=u(),i()(x.A,m),x.A&&x.A.locals&&x.A.locals},71427:(e,a,t)=>{t.d(a,{x:()=>i});var n=t(58426);class i{isVisible;isCollapsed;_store;constructor(e){this.isVisible=!1,this.isCollapsed=!1,(0,n.l_)(this),this._store=e}get floor(){return this._store.indexStore.cache.current.floor}get variant(){return this._store.indexStore.cache.current.variant}get data(){const{apiStore:e}=this._store;if(!e.isError)return e.data}get crmPlanId(){const{apiStore:e}=this._store;if(!e.isError&&e.data.is_crm)return e.data.crm_plan_id}get planId(){return this._store.indexStore.variantId}get planJsonUpdatedAtText(){const{data:e}=this;if(!e?.updated_at)return;const a=new Date(e.updated_at);return Number.isNaN(a.getTime())?e.updated_at:a.toLocaleString("ru-RU").replace(",","")}get totalArea(){const{floor:e}=this;if(!e)return 0;let a=0;return e.rooms.forEach((e=>{const t="Flipped"===e.WallsState&&"Gap"===e.CeilingState,n="Vent"===e.Type;t?a-=e.Area:n||(a+=e.Area)})),Number.isNaN(a)?0:a}get totalAreaText(){const{localeStore:e}=this._store;return e.get("debugPanel.totalAreaTemplate",this.totalArea.toFixed(1))}get floorRoomsCount(){const{floor:e}=this;return e?this.filterRooms(e.rooms).length:0}get roomsCount(){const{variant:e}=this;if(!e)return 0;let a=0;return e.floors.forEach((e=>{const t=this.filterRooms(e.rooms);a+=t.length})),a}get floorsCount(){const{variant:e}=this;return e?e.floors.length:0}get primaryVariantId(){const{data:e}=this;if(e)return e.primary_variant}get styleVariants(){const{data:e}=this;if(!e)return[];const{localeStore:a}=this._store,t=(e,t)=>a.get(`debugPanel.${e}.${t}`)||`${t}`,n=e=>t("valueNames",e),i=e=>a.get(`debugPanel.qualityNames.${e}`)||a.get("debugPanel.unknown"),r=e=>({"-1":"quality-no-rtx",0:"quality-preview",1:"quality-low",2:"quality-medium",3:"quality-high",4:"quality-ultra",5:"quality-epic",6:"quality-unlit"}[`${e}`]??"quality-no-rtx");return e.variants.map((e=>({name:e.variant_info.style_name,navigation:n(e.capabilities.camera_navigation),rtxQuality:i(e.rendering_settings.rtx_quality),rtxQualityClassName:r(e.rendering_settings.rtx_quality),rtxQualityTopView:i(e.rendering_settings.rtx_quality_top_view),rtxQualityTopViewClassName:r(e.rendering_settings.rtx_quality_top_view),processingServer:e.rendering_settings.processing_server??a.get("debugPanel.unknown"),capabilities:Object.keys(e.capabilities).map((a=>{const i=e.capabilities[a];return{label:t("capabilityNames",a),status:"string"==typeof i||!!i?.enabled,value:n("object"==typeof i&&i?i.enabled:i)}}))})))}setIsVisible(e){this.isVisible=e}setIsCollapsed(e){this.isCollapsed=e}filterRooms(e){return e.filter((e=>{const a="Flipped"===e.WallsState&&"Gap"===e.CeilingState,t="Vent"===e.Type;return!a&&!t}))}}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[852],{56852:(e,r,t)=>{t.r(r),t.d(r,{MRGroupPlugin:()=>i});var s=t(84770);class i{unsubscribe;provider;constructor(e){null!=e&&(this.provider=new s.S(e))}get id(){return"mrgroup"}get name(){return"MRGroup Analytics Plugin"}get version(){return"1.0.0"}setParams(e){this.provider=new s.S(e.counterId)}init(e){return!!this.provider&&(this.provider.init(),this.unsubscribe=e.analyticsStore.subscribe((e=>this.onEvent(e))),!0)}shutdown(){this.unsubscribe?.()}onEvent(e){const r=this.provider;if(r)switch(e.type){case"roomSelected":r.reachGoal("room_selected",e.params);break;case"tabSelected":r.reachGoal("tab_selected",e.params);break;case"styleSelected":r.reachGoal("style_selected",e.params);break;case"sessionFinished":r.reachGoal("finished",e.params)}}}},84770:(e,r,t)=>{t.d(r,{S:()=>s});class s{counterId;constructor(e){this.counterId=e}init(){"function"==typeof window.ym?window.ym(this.counterId,"init",{ssr:!0,webvisor:!0,clickmap:!0,ecommerce:"dataLayer",accurateTrackBounce:!0,trackLinks:!0}):console.warn("[YandexMetrikaProvider] ym is not defined (loader script not executed?)")}reachGoal(e,r){if("function"==typeof window.ym)try{window.ym(this.counterId,"reachGoal",e,r)}catch(e){console.error("[YandexMetrikaProvider] reachGoal error",e)}else console.warn("[YandexMetrikaProvider] ym is not defined")}}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkhart_estate_widget=self.webpackChunkhart_estate_widget||[]).push([[871],{4793:(e,t,s)=>{s.d(t,{M:()=>a});var i=s(37458),r=s(31743),o=s(28204);class a{_raycaster=new i.tBo;_renderer;_navigation;_panelRoots=[];_hits=[];_hovered=new Map;_dragged=new Map;constructor(e,t,s){this._renderer=e,this._navigation=t,this._raycaster.far=s}setPanelRoots(e){this._panelRoots=e}update(e,t,s){this._raycaster.camera=this._renderer.xr.getCamera();const i=this._panelRoots.filter((e=>e.visible&&null!==e.parent));i.forEach((e=>e.updateMatrixWorld(!0)));const a=this._navigation.isAvailable?this._navigation.collectTargets(s):[];let n="",h="";e.forEach((e=>{const{hand:s}=e;if(!s)return this.stopDrag(e),this.setHovered(e,void 0),void e.setHit(void 0);if(this.setRayFromController(e),this.updateDrag(e,t.isPressed(s,"trigger")))return;const d=t.isJustPressed(s,"trigger"),l=this.intersectVisible(i);if(l){const t=(0,o.U)(l.object);return this.setHovered(e,t),e.setHit(l.distance),void(d&&t&&((0,r.S)(t)?this.startDrag(e,t,l.point):t.select(l.point)))}this.setHovered(e,void 0);const c=0!==a.length?this._raycaster.intersectObjects(a,!1)[0]:void 0;if(!c)return void e.setHit(void 0);e.setHit(c.distance);const _=c.object,p=`${_.domainId??""}`,g=`${_.domainType??""}`;p&&g&&(n=p,h=g,d&&this._navigation.select(p,g))})),n?this._navigation.setHover(n,h):this._navigation.clearHover()}dispose(){this._dragged.forEach((e=>e.endDrag())),this._dragged.clear(),this._hovered.forEach((e=>e.setHover(!1))),this._hovered.clear(),this._panelRoots=[]}startDrag(e,t,s){t.beginDrag(this._raycaster.ray,s),this._dragged.set(e,t)}stopDrag(e){const t=this._dragged.get(e);t&&(t.endDrag(),this._dragged.delete(e))}updateDrag(e,t){const s=this._dragged.get(e);return!!s&&(t&&s.isDragging?(e.setHit(s.moveDrag(this._raycaster.ray)),!0):(this.stopDrag(e),!1))}intersectVisible(e){const t=this._hits;if(t.length=0,e.forEach((e=>this.raycastVisible(e))),0!==t.length)return t.sort(((e,t)=>e.distance-t.distance)),t[0]}raycastVisible(e){if(!e.visible)return;e.raycast(this._raycaster,this._hits);const{children:t}=e;for(let e=0,s=t.length;e<s;e++)this.raycastVisible(t[e])}setRayFromController(e){const{ray:t}=this._raycaster,{controller:s}=e;s.updateMatrixWorld(!0);const{matrixWorld:i}=s;t.origin.setFromMatrixPosition(i),t.direction.set(0,0,-1).transformDirection(i)}setHovered(e,t){const s=this._hovered.get(e);s!==t&&(s?.setHover(!1),t?this._hovered.set(e,t):this._hovered.delete(e),t?.setHover(!0))}}},7871:(e,t,s)=>{s.r(t),s.d(t,{GFPVRUIPlugin:()=>l});var i=s(19031),r=s(4793),o=s(99402),a=s(43351),n=s(33836),h=s(47148),d=s(40454);class l{isLate=!0;_options;_input=new i._;_store;_binder;_rig;_navigation;_pointer;_panels;constructor(e={}){this._options={...d.T,...e}}get id(){return"gfpvr-ui"}get name(){return"GFP VR UI plugin"}get version(){return"1.0.0"}setParams(e){this._options={...d.T,...e}}get widgetScene(){return this._store?.panoramaTabStore.sceneController.widgetScene}init=e=>{const t=e.panoramaTabStore.sceneController.widgetScene.renderer;if(!t)return!1;this._store=e;const s=new h.B(t,{onStart:this.onSessionStart,onEnd:this.onSessionEnd});return s.init(),this._binder=s,!0};shutdown=()=>{this.onSessionEnd(),this._binder?.dispose(),this._binder=void 0,this._store=void 0};update=()=>{const e=this._binder;if(!e?.isPresenting)return;const{_rig:t,_panels:s,_pointer:i}=this,r=this.widgetScene?.scene;t&&s&&i&&r&&(this._input.update(e.session),s.update(t,this._input),i.setPanelRoots(s.roots),i.update(t.controllers,this._input,r))};onSessionStart=()=>{const e=this._store,t=this.widgetScene;if(!e||!t)return;const s=this._options;this._input.reset();const i=new a.s(e,t.renderer,t.scene,s);this._panels=i;const h=new n.l(t.renderer,t.scene,s.showControllerModels);this._rig=h;const d=new o.R(e);this._navigation=d,this._pointer=new r.M(t.renderer,d,s.pointerMaxDistance)};onSessionEnd=()=>{this._pointer?.dispose(),this._pointer=void 0,this._panels?.dispose(),this._panels=void 0,this._navigation?.dispose(),this._navigation=void 0,this._rig?.dispose(),this._rig=void 0,this._input.reset()}}},19031:(e,t,s)=>{s.d(t,{_:()=>r});const i={trigger:0,squeeze:1,stick:3,lowerFace:4,upperFace:5};class r{_hands={left:{pressed:{trigger:!1,squeeze:!1,stick:!1,lowerFace:!1,upperFace:!1},justPressed:{trigger:!1,squeeze:!1,stick:!1,lowerFace:!1,upperFace:!1},axisX:0,axisStep:0,isAxisLatched:!1},right:{pressed:{trigger:!1,squeeze:!1,stick:!1,lowerFace:!1,upperFace:!1},justPressed:{trigger:!1,squeeze:!1,stick:!1,lowerFace:!1,upperFace:!1},axisX:0,axisStep:0,isAxisLatched:!1}};update(e){this.resetFrameState(),e&&e.inputSources.forEach((e=>{const t=e.handedness;if("left"!==t&&"right"!==t)return;const s=e.gamepad;s&&this.updateHand(this._hands[t],s)}))}isPressed(e,t){return this._hands[e].pressed[t]}isJustPressed(e,t){return this._hands[e].justPressed[t]}isJustPressedAny(e){return this.isJustPressed("left",e)||this.isJustPressed("right",e)}getAxisStep(e){return this._hands[e].axisStep}reset(){this._hands.left={pressed:{trigger:!1,squeeze:!1,stick:!1,lowerFace:!1,upperFace:!1},justPressed:{trigger:!1,squeeze:!1,stick:!1,lowerFace:!1,upperFace:!1},axisX:0,axisStep:0,isAxisLatched:!1},this._hands.right={pressed:{trigger:!1,squeeze:!1,stick:!1,lowerFace:!1,upperFace:!1},justPressed:{trigger:!1,squeeze:!1,stick:!1,lowerFace:!1,upperFace:!1},axisX:0,axisStep:0,isAxisLatched:!1}}resetFrameState(){Object.keys(this._hands).forEach((e=>{const t=this._hands[e];t.axisStep=0,Object.keys(t.justPressed).forEach((e=>{t.justPressed[e]=!1}))}))}updateHand(e,t){Object.keys(i).forEach((s=>{const r=t.buttons[i[s]],o=!0===r?.pressed;e.justPressed[s]=o&&!e.pressed[s],e.pressed[s]=o}));const s=t.axes[2]??0;e.axisX=s,e.isAxisLatched?Math.abs(s)<.3&&(e.isAxisLatched=!1):Math.abs(s)>=.6&&(e.axisStep=Math.sign(s),e.isAxisLatched=!0)}}},22776:(e,t,s)=>{s.d(t,{t:()=>o});var i=s(37458),r=s(33869);class o extends i.B69{isVRInteractive=!0;isVRDragTarget=!0;_bar;_hitArea;_idleColor;_hoverColor;_drag;_isHover=!1;constructor(e){super();const{width:t,height:s,hitHeight:o,idleColor:a=7041664,hoverColor:n=15395562,drag:h}=e;this._idleColor=a,this._hoverColor=n,this._drag=h,this._bar=new r.S({width:t,height:s,radius:s/2,color:a,opacity:1}),this._bar.renderOrder=11,this.add(this._bar),this._hitArea=new i.eaF(new i.bdM(1.15*t,o),new i.V9B({transparent:!0,opacity:0,depthWrite:!1,depthTest:!1})),this._hitArea.position.z=-2e-4,this._hitArea.renderOrder=9,this.add(this._hitArea)}get isDragging(){return this._drag.isDragging}setHover(e){this._isHover!==e&&(this._isHover=e,this._bar.setColor(e?this._hoverColor:this._idleColor))}select(){}beginDrag(e,t){this._drag.beginDrag(e,t)}moveDrag(e){return this._drag.moveDrag(e)}endDrag(){this._drag.endDrag()}dispose(){this._bar.dispose(),this._hitArea.geometry.dispose(),this._hitArea.material.dispose()}}},23946:(e,t,s)=>{s.d(t,{h:()=>r});var i=s(37458);class r extends i.B69{isVRInteractive=!0;_circle;_bars=[];_idleColor;_hoverColor;_crossColor;_crossHoverColor;_onSelect;_isHover=!1;constructor(e){super();const{radius:t,idleColor:s=15395562,hoverColor:r=16754944,crossColor:o=4275774,crossHoverColor:a=o,onSelect:n}=e;this._idleColor=s,this._hoverColor=r,this._crossColor=o,this._crossHoverColor=a,this._onSelect=n,this._circle=new i.eaF(new i.tcD(t,24),new i.V9B({color:s,transparent:!0,depthTest:!1,toneMapped:!1})),this._circle.renderOrder=10,this.add(this._circle);const h=1.05*t,d=.16*t;[Math.PI/4,-Math.PI/4].forEach((e=>{const t=new i.eaF(new i.bdM(h,d),new i.V9B({color:o,transparent:!0,depthTest:!1,toneMapped:!1,side:i.$EB}));t.rotation.z=e,t.position.z=5e-4,t.renderOrder=11,this._bars.push(t),this.add(t)}))}setHover(e){this._isHover!==e&&(this._isHover=e,this._circle.material.color.setHex(e?this._hoverColor:this._idleColor),this._bars.forEach((t=>t.material.color.setHex(e?this._crossHoverColor:this._crossColor))))}select(){this._onSelect()}dispose(){this._circle.geometry.dispose(),this._circle.material.dispose(),this._bars.forEach((e=>{e.geometry.dispose(),e.material.dispose()}))}}},28204:(e,t,s)=>{s.d(t,{U:()=>i});const i=e=>{let t=e;for(;t;){if("object"==typeof(s=t)&&null!==s&&!0===s.isVRInteractive)return t;t=t.parent}var s}},29887:(e,t,s)=>{s.d(t,{s:()=>o});var i=s(37458),r=s(71136);class o extends i.B69{isVRInteractive=!0;_icon;_hitArea;_background;_idleTexture;_hoverTexture;_backgroundColor;_backgroundHoverColor;_onSelect;_isHover=!1;constructor(e){super();const{size:t,direction:s,backgroundRadius:o,backgroundColor:a=15395562,backgroundHoverColor:n=16754944,backgroundOpacity:h=1,hitScale:d=1.6,iconColor:l="#413e3e",iconHoverColor:c=l,onSelect:_}=e;this._onSelect=_,this._backgroundColor=a,this._backgroundHoverColor=n,o&&(this._background=new i.eaF(new i.tcD(o,28),new i.V9B({color:a,transparent:!0,opacity:h,depthTest:!1,toneMapped:!1})),this._background.renderOrder=11,this.add(this._background)),this._idleTexture=(0,r.L)(s,l),this._hoverTexture=c===l?void 0:(0,r.L)(s,c),this._icon=new i.eaF(new i.bdM(t,t),new i.V9B({map:this._idleTexture??null,transparent:!0,depthTest:!1,toneMapped:!1,side:i.$EB})),this._icon.position.z=5e-4,this._icon.renderOrder=12,this.add(this._icon);const p=Math.max(t*d,2*(o??0));this._hitArea=new i.eaF(new i.bdM(p,p),new i.V9B({transparent:!0,opacity:0,depthWrite:!1,depthTest:!1})),this._hitArea.position.z=-2e-4,this._hitArea.renderOrder=9,this.add(this._hitArea)}setHover(e){this._isHover!==e&&(this._isHover=e,this._background?.material.color.setHex(e?this._backgroundHoverColor:this._backgroundColor),this._hoverTexture&&(this._icon.material.map=e?this._hoverTexture:this._idleTexture??null,this._icon.material.needsUpdate=!0))}select(){this._onSelect()}dispose(){this._idleTexture?.dispose(),this._hoverTexture?.dispose(),this._icon.geometry.dispose(),this._icon.material.dispose(),this._hitArea.geometry.dispose(),this._hitArea.material.dispose();const e=this._background;e&&(e.geometry.dispose(),e.material.dispose())}}},30877:(e,t,s)=>{s.d(t,{A:()=>r});var i=s(37458);class r extends i.eaF{_maxWidth;_maxHeight;constructor(e){super(new i.bdM(1,1),new i.V9B({transparent:!0,depthTest:!1,toneMapped:!1,side:i.$EB})),this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight,this.renderOrder=11,this.visible=!1}setTexture(e){if(!e)return this.material.map=null,this.material.needsUpdate=!0,void(this.visible=!1);this.material.map=e.texture,this.material.needsUpdate=!0;let t=this._maxWidth,s=t/e.aspect;s>this._maxHeight&&(s=this._maxHeight,t=s*e.aspect),this.scale.set(t,s,1),this.visible=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}},31743:(e,t,s)=>{s.d(t,{S:()=>i});const i=e=>"object"==typeof e&&null!==e&&!0===e.isVRDragTarget},33836:(e,t,s)=>{s.d(t,{l:()=>a});var i=s(37458),r=s(52552);class o{controller;grip;hand;_ray;_marker;constructor(e,t){this.controller=e.xr.getController(t),this.grip=e.xr.getControllerGrip(t);const s=new i.LoY;s.setAttribute("position",new i.qtW([0,0,0,0,0,-1],3)),this._ray=new i.N1A(s,new i.mrM({color:16777215,transparent:!0,opacity:.6,depthTest:!1,toneMapped:!1})),this._ray.renderOrder=20,this._ray.scale.z=5,this.controller.add(this._ray),this._marker=new i.eaF(new i.Gu$(.006,10,8),new i.V9B({color:16777215,transparent:!0,depthTest:!1,toneMapped:!1})),this._marker.renderOrder=21,this._marker.visible=!1,this.controller.add(this._marker),this.controller.addEventListener("connected",this.onConnected),this.controller.addEventListener("disconnected",this.onDisconnected)}setHit(e){if(void 0===e)return this._ray.scale.z=5,void(this._marker.visible=!1);this._ray.scale.z=e,this._marker.position.set(0,0,-e),this._marker.visible=!0}dispose(){this.controller.removeEventListener("connected",this.onConnected),this.controller.removeEventListener("disconnected",this.onDisconnected),this.controller.remove(this._ray,this._marker),this._ray.geometry.dispose(),this._ray.material.dispose(),this._marker.geometry.dispose(),this._marker.material.dispose(),this.grip.clear(),this.controller.removeFromParent(),this.grip.removeFromParent()}onConnected=e=>{const t=e.data?.handedness;this.hand="left"===t||"right"===t?t:void 0};onDisconnected=()=>{this.hand=void 0,this.setHit(void 0)}}class a{controllers=[];_parent;_lights=[];constructor(e,t,s){this._parent=t;for(let s=0;s<2;s++){const i=new o(e,s);t.add(i.controller,i.grip),this.controllers.push(i)}s&&(this.addLights(),this.addControllerModels())}getByHand(e){return this.controllers.find((t=>t.hand===e))}dispose(){this.controllers.forEach((e=>e.dispose())),this.controllers.length=0,this._lights.forEach((e=>e.removeFromParent())),this._lights.length=0}addLights(){const e=new i.dth(16777215,5263448,2.5),t=new i.ZyN(16777215,1.5);t.position.set(.5,1,.75),this._lights.push(e,t),this._parent.add(e,t)}addControllerModels(){try{const e=new r.S;this.controllers.forEach((t=>{const s=e.createControllerModel(t.grip);s&&t.grip.add(s)}))}catch(e){console.warn("GFPVRUIPlugin: не удалось создать модели контроллеров",e)}}}},33869:(e,t,s)=>{s.d(t,{S:()=>o});var i=s(37458);const r=(e,t,s)=>{const r=e/2,o=t/2,a=Math.min(s,r,o),n=new i.ypk;return n.moveTo(-r+a,-o),n.lineTo(r-a,-o),n.quadraticCurveTo(r,-o,r,-o+a),n.lineTo(r,o-a),n.quadraticCurveTo(r,o,r-a,o),n.lineTo(-r+a,o),n.quadraticCurveTo(-r,o,-r,o-a),n.lineTo(-r,-o+a),n.quadraticCurveTo(-r,-o,-r+a,-o),n};class o extends i.eaF{constructor(e){const{width:t,height:s,radius:o=.12*Math.min(t,s),color:a=1053207,opacity:n=.88}=e;super(new i.MSw(r(t,s,o),16),new i.V9B({color:a,transparent:!0,opacity:n,depthTest:!1,toneMapped:!1,side:i.$EB}))}setColor(e){this.material.color.setHex(e)}setSize(e,t,s=.12*Math.min(e,t)){this.geometry.dispose(),this.geometry=new i.MSw(r(e,t,s),16)}dispose(){this.geometry.dispose(),this.material.dispose()}}},36179:(e,t,s)=>{s.d(t,{Q:()=>r});var i=s(37458);class r extends i.eaF{isVRInteractive=!0;_panoramas;_boxWidth;_boxHeight;_onSelect;_isHover=!1;constructor(e){const{vertices:t,boxWidth:s,boxHeight:r,color:o}=e,a=new i.ypk;t.forEach(((e,t)=>{const i=(e.x-.5)*s,o=(.5-e.y)*r;0===t?a.moveTo(i,o):a.lineTo(i,o)})),a.closePath(),super(new i.MSw(a),new i.V9B({color:o,transparent:!0,opacity:0,depthTest:!1,depthWrite:!1,toneMapped:!1,side:i.$EB})),this._panoramas=e.panoramas,this._boxWidth=s,this._boxHeight=r,this._onSelect=e.onSelect,this.renderOrder=11}setHover(e){this._isHover!==e&&(this._isHover=e,this.material.opacity=e?.5:0)}select(e){const t=this._panoramas;if(0===t.length)return;const s=this.worldToLocal(e.clone()),i=s.x/this._boxWidth+.5,r=.5-s.y/this._boxHeight;let o=t[0],a=1/0;t.forEach((e=>{const t=(e.position.x-i)**2+(e.position.y-r)**2;t>=a||(a=t,o=e)})),this._onSelect(o.id)}dispose(){this.geometry.dispose(),this.material.dispose()}}},36533:(e,t,s)=>{s.d(t,{u:()=>r});var i=s(37458);class r extends i.B69{_meshes=[];constructor(e){super();const{mapSize:t,color:s}=e,r=t/322,o=new i.eaF(new i.tcD(44*r,20,3*Math.PI/4,Math.PI/2),new i.V9B({color:s,transparent:!0,opacity:.5,depthTest:!1,depthWrite:!1,toneMapped:!1}));o.renderOrder=12,this.addMesh(o),this.addDot(8*r,s,13),this.addDot(6*r,16777215,14),this.addDot(4*r,s,15)}setRotation(e){this.rotation.z=e-Math.PI}dispose(){this._meshes.forEach((e=>{e.geometry.dispose(),e.material.dispose()})),this._meshes.length=0}addDot(e,t,s){const r=new i.eaF(new i.tcD(e,24),new i.V9B({color:t,transparent:!0,depthTest:!1,depthWrite:!1,toneMapped:!1}));r.renderOrder=s,this.addMesh(r)}addMesh(e){this._meshes.push(e),this.add(e)}}},36584:(e,t,s)=>{s.d(t,{t:()=>o});var i=s(37458);const r=document.createElement("canvas"),o=e=>{const{text:t,color:s,fontSize:o,textureHeight:a,fontFamily:n}=e,h=`600 ${o}px ${n}`,d=r.getContext("2d");if(!d)return;d.font=h;const l=d.measureText(t).width,c=.4*o,_=Math.max(1,Math.ceil(l+2*c)),p=document.createElement("canvas");p.width=_,p.height=Math.max(1,Math.ceil(a));const g=p.getContext("2d");if(!g)return;g.clearRect(0,0,p.width,p.height),g.font=h,g.fillStyle=s,g.textAlign="center",g.textBaseline="middle",g.fillText(t,p.width/2,p.height/2);const u=new i.GOR(p);return u.colorSpace=i.er$,u.minFilter=i.k6q,u.magFilter=i.k6q,u.generateMipmaps=!1,u.needsUpdate=!0,{texture:u,aspect:p.width/p.height}}},40454:(e,t,s)=>{s.d(t,{T:()=>i});const i={panelWidth:.62,panelHeight:.46,panelDistance:1.1,labelFontSize:56,labelTextureHeight:128,labelFontFamily:"sans-serif",showControllerModels:!0,pointerMaxDistance:30,labels:{tab2d:"2D",tab3d:"3D",tabMap:"MAP",hint:"Press X"}}},40951:(e,t,s)=>{s.d(t,{m:()=>r});var i=s(37458);class r{_maxSize;_renderer;_entries=new Map;_limit;constructor(e={}){this._limit=Math.max(1,e.limit??12),this._maxSize=Math.max(1,e.maxSize??1024),this._renderer=e.renderer}setLimit(e){this._limit=Math.max(1,e),this.evict()}get(e,t){if(0===t.naturalWidth||0===t.naturalHeight)return;const s=this._entries.get(e);if(s)return this._entries.delete(e),this._entries.set(e,s),s;const r=this.createTexture(t);r.colorSpace=i.er$,r.minFilter=i.k6q,r.magFilter=i.k6q,r.generateMipmaps=!1,r.needsUpdate=!0,this._renderer?.initTexture(r);const o={texture:r,aspect:t.naturalWidth/t.naturalHeight};return this._entries.set(e,o),this.evict(),o}has(e){return this._entries.has(e)}dispose(){this._entries.forEach((e=>e.texture.dispose())),this._entries.clear()}createTexture(e){const{naturalWidth:t,naturalHeight:s}=e,r=this._maxSize/Math.max(t,s);if(r>=1)return new i.gPd(e);const o=document.createElement("canvas");o.width=Math.max(1,Math.round(t*r)),o.height=Math.max(1,Math.round(s*r));const a=o.getContext("2d");return a?(a.drawImage(e,0,0,o.width,o.height),new i.GOR(o)):new i.gPd(e)}evict(){for(;this._entries.size>this._limit;){const e=this._entries.keys().next();if(e.done)return;this._entries.get(e.value)?.texture.dispose(),this._entries.delete(e.value)}}}},43351:(e,t,s)=>{s.d(t,{s:()=>a});var i=s(37458),r=s(95523),o=s(50278);class a{_panel;_hint;_isHintAttached=!1;constructor(e,t,s,a){this._panel=new o.F(e,t,a),this._panel.visible=!1,s.add(this._panel);const{labels:n}=a,{colors:h}=e.configStore.config;this._hint=new r.q({text:e.localeStore.get("vr.hint")||n.hint,height:.075*a.panelHeight,options:a,color:16777215,opacity:.97,textColor:`#${new i.Q1f(h.mainText??"#413E3E").getHexString()}`})}get roots(){return[this._panel]}update(e,t){this.attachHint(e),t.isJustPressed("left","lowerFace")&&this.toggle(),this._panel.update();const s=this._panel.visible;if(this._hint.visible=!s,!s)return;const i=t.getAxisStep("left")||t.getAxisStep("right");0!==i&&this._panel.stepRotation(i)}dispose(){this._panel.dispose(),this._hint.removeFromParent(),this._hint.dispose(),this._isHintAttached=!1}toggle(){this._panel.togglePanelVisible(),this._panel.visible&&this._panel.openInFrontOfHead()}attachHint(e){if(this._isHintAttached)return;const t=e.getByHand("left");t&&(this._hint.position.set(0,.055,-.02),this._hint.rotation.x=-Math.PI/3,t.grip.add(this._hint),this._isHintAttached=!0)}}},47148:(e,t,s)=>{s.d(t,{B:()=>i});class i{_renderer;_params;constructor(e,t){this._renderer=e,this._params=t}get isPresenting(){return this._renderer.xr.isPresenting}get session(){return this._renderer.xr.getSession()}init(){this._renderer.xr.setReferenceSpaceType("local"),this._renderer.xr.addEventListener("sessionstart",this.onSessionStart),this._renderer.xr.addEventListener("sessionend",this.onSessionEnd)}dispose(){this._renderer.xr.removeEventListener("sessionstart",this.onSessionStart),this._renderer.xr.removeEventListener("sessionend",this.onSessionEnd)}onSessionStart=()=>{this._params.onStart()};onSessionEnd=()=>{this._params.onEnd()}}},50278:(e,t,s)=>{s.d(t,{F:()=>v});var i=s(97048),r=s(58426),o=s(37458),a=s(29887),n=s(23946),h=s(22776),d=s(30877),l=s(95523),c=s(33869),_=s(56775),p=s(40951),g=s(59337);const u=["2d","3d","map"],m=15395562;class v extends o.B69{_store;_options;_renderer;_surface;_closeButton;_handle;_tabButtons=new Map;_image2d;_image3d;_arrows=[];_counter;_map;_imageLoader=new i.$;_textures;_disposers=[];_headPosition=new o.Pq0;_forward=new o.Pq0;_dragOffset=new o.Pq0;_dragPoint=new o.Pq0;_dragDistance=0;_isDragging=!1;_warmupQueue=[];_warmupAt=0;_isWarmingUp=!1;_activeTab="2d";_load2dToken=0;_load3dToken=0;constructor(e,t,s){super(),this._store=e,this._options=s,this._renderer=t,this._textures=new p.m({limit:6,maxSize:768,renderer:t});const i=s.panelWidth,v=s.panelHeight,{colors:x}=e.configStore.config,f=new o.Q1f(x.main).getHex(),b=new o.Q1f(x.mainText??"#413E3E").getHex(),w=`#${b.toString(16).padStart(6,"0")}`;this._surface=new c.S({width:i,height:v,color:16777215,opacity:.97}),this.add(this._surface);const S=.026*v,y=.185*i,T=.12*v,H=.02*i,C=v/2-S-T/2,k=y*u.length+H*(u.length-1);u.forEach(((e,t)=>{const i=new _.i({text:this.getTabLabel(e),width:y,height:T,fontSize:s.labelFontSize,textureHeight:s.labelTextureHeight,fontFamily:s.labelFontFamily,idleColor:m,hoverColor:14474460,activeColor:f,textColor:b,activeTextColor:b,onSelect:()=>this.setActiveTab(e)});i.position.set(-k/2+y/2+t*(y+H),C,.001),this._tabButtons.set(e,i),this.add(i)}));const M=.045*v;this._closeButton=new n.h({radius:M,idleColor:m,hoverColor:f,crossColor:b,onSelect:()=>this.setPanelVisible(!1)}),this._closeButton.position.set(i/2-1.6*M,v/2-1.6*M,.001),this.add(this._closeButton);const F=.1*v,P=-v/2+S+F/2;this._counter=new l.q({text:"",height:F,options:s,color:m,opacity:1,textColor:w}),this._counter.position.set(0,P,.002),this.add(this._counter);const D=.075*v,E=i/2-S-D,z=C-T/2-S,A=P+F/2+S,I=(z+A)/2;[-1,1].forEach((e=>{const t=new a.s({size:1.1*D,direction:-1===e?"left":"right",backgroundRadius:D,backgroundColor:m,backgroundHoverColor:f,iconColor:w,onSelect:()=>this.stepRotation(e)});t.position.set(e*E,I,.002),this._arrows.push(t),this.add(t)}));const B=2*(E-D)-2*S,R=z-A;this._image2d=new d.A({maxWidth:i-2*S,maxHeight:R}),this._image2d.position.set(0,I,.001),this.add(this._image2d),this._image3d=new d.A({maxWidth:B,maxHeight:R}),this._image3d.position.set(0,I,.001),this.add(this._image3d),this._map=new g.C(e,Math.min(i-2*S,R)),this._map.position.set(0,I,.001),this.add(this._map);const W=.022*v;this._handle=new h.t({width:.2*i,height:W,hitHeight:.075*v,idleColor:12896724,hoverColor:f,drag:this}),this._handle.position.set(0,-v/2-S-W/2,.001),this.add(this._handle),this.applyTabState();const{planTabStore:V,rotationTabStore:L}=e;this._disposers.push((0,r.mJ)((()=>V.planImage),this.reload2d,{fireImmediately:!0}),(0,r.mJ)((()=>L.planImage),this.reload3d,{fireImmediately:!0}),(0,r.mJ)((()=>L.indexText),this.applyIndexText,{fireImmediately:!0}),(0,r.mJ)((()=>L.images),this.resetWarmup,{fireImmediately:!0}))}get activeTab(){return this._activeTab}get isDragging(){return this._isDragging&&this.visible}update(){this.warmupNextTexture(),this.visible&&this._map.update()}openInFrontOfHead(){this.readHeadPosition();const e=this._renderer.xr.getCamera();this._forward.set(0,0,-1).transformDirection(e.matrixWorld),this._forward.y=0,this._forward.lengthSq()<1e-6&&this._forward.set(0,0,-1),this._forward.normalize(),this.position.copy(this._headPosition).addScaledVector(this._forward,this._options.panelDistance),this.position.y-=.15*this._options.panelHeight,this.faceHead()}beginDrag(e,t){this._dragDistance=Math.min(Math.max(e.origin.distanceTo(t),.35),4),this._dragOffset.copy(this.position).sub(t),this._isDragging=!0}moveDrag(e){return this._isDragging?(this._dragPoint.copy(e.origin).addScaledVector(e.direction,this._dragDistance),this.position.copy(this._dragPoint).add(this._dragOffset),this.faceHead(),this._dragDistance):this._dragDistance}endDrag(){this._isDragging=!1}setActiveTab(e){this._activeTab!==e&&(this._activeTab=e,this.applyTabState())}setPanelVisible(e){this.visible=e,e||this.endDrag()}togglePanelVisible(){this.setPanelVisible(!this.visible)}stepRotation=e=>{if("3d"!==this._activeTab||0===e)return;const{rotationTabStore:t}=this._store;e>0?t.setNextIndex():t.setPrevIndex()};dispose(){this._disposers.forEach((e=>e())),this._disposers.length=0,this._warmupQueue=[],this._surface.dispose(),this._closeButton.dispose(),this._handle.dispose(),this._tabButtons.forEach((e=>e.dispose())),this._tabButtons.clear(),this._arrows.forEach((e=>e.dispose())),this._arrows.length=0,this._counter.dispose(),this._image2d.dispose(),this._image3d.dispose(),this._map.dispose(),this._textures.dispose(),this.clear(),this.removeFromParent()}readHeadPosition(){const e=this._renderer.xr.getCamera();e.updateMatrixWorld(!0),this._headPosition.setFromMatrixPosition(e.matrixWorld)}faceHead(){this.readHeadPosition(),this.lookAt(this._headPosition),this.updateMatrixWorld(!0)}getTabLabel(e){const{localeStore:t}=this._store,{labels:s}=this._options;return"2d"===e?t.get("vr.tab2d")||s.tab2d:"3d"===e?t.get("vr.tab3d")||s.tab3d:t.get("vr.tabMap")||s.tabMap}applyTabState(){const e=this._activeTab;this._tabButtons.forEach(((t,s)=>t.setActive(s===e))),this._image2d.visible="2d"===e&&null!==this._image2d.material.map,this._image3d.visible="3d"===e&&null!==this._image3d.material.map,this._map.visible="map"===e,this._counter.visible="3d"===e,this._arrows.forEach((t=>t.visible="3d"===e))}applyIndexText=e=>{this._counter.setText(e)};resetWarmup=e=>{this._textures.setLimit(e.length+6),this._warmupQueue=e.filter((e=>!!e))};warmupNextTexture(){if(this._isWarmingUp||0===this._warmupQueue.length)return;const e=Date.now();if(e-this._warmupAt<120)return;let t=this._warmupQueue.shift();for(;t&&this._textures.has(t);)t=this._warmupQueue.shift();if(!t)return;this._warmupAt=e,this._isWarmingUp=!0;const s=t;this._imageLoader.get(s).then((e=>e&&this.decode(e).then((()=>this._textures.get(s,e))))).finally((()=>{this._isWarmingUp=!1}))}decode(e){return"function"!=typeof e.decode?Promise.resolve():e.decode().catch((()=>{}))}reload2d=e=>{const t=++this._load2dToken;e?this._imageLoader.get(e).then((s=>{t===this._load2dToken&&s&&(this._image2d.setTexture(this._textures.get(e,s)),this.applyTabState())})):this._image2d.setTexture(void 0)};reload3d=e=>{const t=++this._load3dToken;e?this._imageLoader.get(e).then((s=>{t===this._load3dToken&&s&&(this._image3d.setTexture(this._textures.get(e,s)),this.applyTabState())})):this._image3d.setTexture(void 0)}}},56775:(e,t,s)=>{s.d(t,{i:()=>a});var i=s(37458),r=s(33869),o=s(36584);class a extends i.B69{isVRInteractive=!0;_surface;_label;_labelTexture;_idleColor;_hoverColor;_activeColor;_textColor;_activeTextColor;_onSelect;_isHover=!1;_isActive=!1;constructor(e){super();const{text:t,width:s,height:a,fontSize:n,textureHeight:h,fontFamily:d,idleColor:l=15395562,hoverColor:c=14474460,activeColor:_=16754944,textColor:p=4275774,activeTextColor:g=4275774,onSelect:u}=e;this._idleColor=l,this._hoverColor=c,this._activeColor=_,this._textColor=p,this._activeTextColor=g,this._onSelect=u,this._surface=new r.S({width:s,height:a,color:l,opacity:1}),this._surface.renderOrder=10,this.add(this._surface);const m=(0,o.t)({text:t,color:"#ffffff",fontSize:n,textureHeight:h,fontFamily:d});if(m){const{texture:e,aspect:t}=m,s=a*(n/h)*1.6,r=s*t,o=new i.eaF(new i.bdM(r,s),new i.V9B({map:e,transparent:!0,depthTest:!1,toneMapped:!1,side:i.$EB}));o.position.z=5e-4,o.renderOrder=11,this._labelTexture=e,this._label=o,this.add(o)}this.applyColor()}get isActive(){return this._isActive}setActive(e){this._isActive!==e&&(this._isActive=e,this.applyColor())}setHover(e){this._isHover!==e&&(this._isHover=e,this.applyColor())}select(){this._onSelect()}dispose(){this._surface.dispose();const e=this._label;e&&(e.geometry.dispose(),e.material.dispose()),this._labelTexture?.dispose()}applyColor(){this._isActive?this._surface.setColor(this._activeColor):this._surface.setColor(this._isHover?this._hoverColor:this._idleColor),this._label?.material.color.setHex(this._isActive?this._activeTextColor:this._textColor)}}},59337:(e,t,s)=>{s.d(t,{C:()=>p});var i=s(77476),r=s(7383),o=s(97048),a=s(58426),n=s(37458),h=s(30877),d=s(33869),l=s(40951),c=s(36533),_=s(36179);class p extends n.B69{_store;_size;_color;_background;_plan;_rooms=new n.B69;_marker;_imageLoader=new o.$;_textures=new l.m({limit:2});_disposers=[];_roomMeshes=[];_buildToken=0;constructor(e,t){super(),this._store=e,this._size=t,this._color=new n.Q1f(e.configStore.config.colors.main).getHex(),this._background=new d.S({width:t,height:t,radius:.05*t,color:16119285,opacity:1}),this._background.renderOrder=9,this.add(this._background);const s=.92*t;this._plan=new h.A({maxWidth:s,maxHeight:s}),this._plan.position.z=5e-4,this._plan.renderOrder=10,this.add(this._plan),this._rooms.position.z=.001,this.add(this._rooms),this._marker=new c.u({mapSize:s,color:this._color}),this._marker.position.z=.0015,this._marker.visible=!1,this.add(this._marker);const{indexStore:i,configStore:r,mapStore:o}=e;this._disposers.push((0,a.mJ)((()=>[i.version,r.version,o.planImage]),(()=>this.build()),{fireImmediately:!0}))}update(){this.visible&&this._marker.visible&&this._marker.setRotation(this._store.panoramaTabStore.cameraStore.rotation.y)}dispose(){this._disposers.forEach((e=>e())),this._disposers.length=0,this.clearRooms(),this._background.dispose(),this._plan.dispose(),this._textures.dispose(),this._marker.dispose(),this.clear(),this.removeFromParent()}build(){const e=++this._buildToken,{indexStore:t,mapStore:s}=this._store,{floor:i,panorama:o}=t.cache.current,a=i?.plan_meta,n=s.planImage;if(!(i&&o&&a&&n))return this.clearRooms(),this._plan.setTexture(void 0),void(this._marker.visible=!1);this._imageLoader.get(n).then((t=>{if(e!==this._buildToken)return;if(!t||0===t.naturalWidth)return;const{offsetX:s,offsetY:h,scaleX:d,scaleY:l,planSizeX:c,planSizeY:_,aspect:p}=new r.z(this._store).resolve(t,a);this._plan.setTexture(this._textures.get(n,t));const g=.92*this._size,u=g*d,m=g*l,v=e=>({x:(s+e.Location.X)/c,y:(h+e.Location.Y)*p/_});this.buildRooms(i,o.ID,u,m,v);const x=v(o);this._marker.position.set((x.x-.5)*u,(.5-x.y)*m,.0015),this._marker.visible=!0}))}buildRooms(e,t,s,r,o){this.clearRooms();const{walls:a,vertices:n,camera_points:h,rooms:d}=e,l=h.filter((e=>e.ID!==t));d.forEach((e=>{const t=e.Walls.map((e=>a.find((t=>t.ID===e)))).filter(i.Y.isNotEmpty).map((e=>n.find((t=>t?.ID===e?.Vertices[1])))).filter(i.Y.isNotEmpty).map(o);if(t.length<3)return;const h=l.filter((t=>t.RoomID===e.ID)).map((e=>({id:e.ID,position:o(e)})));if(0===h.length)return;const d=new _.Q({vertices:t,panoramas:h,boxWidth:s,boxHeight:r,color:this._color,onSelect:this.onRoomSelect});this._roomMeshes.push(d),this._rooms.add(d)}))}onRoomSelect=e=>{const{indexStore:t,analyticsStore:s,panoramaTabStore:i,mapStore:r}=this._store;t.set(t.variantId,t.floorIndex,e),s.onRoomSelect("miniplan"),r.setIsExtend(!1),i.setPreserveTransitionOffsetOnce(!0)};clearRooms(){this._roomMeshes.forEach((e=>e.dispose())),this._roomMeshes.length=0,this._rooms.clear()}}},71136:(e,t,s)=>{s.d(t,{L:()=>r});var i=s(37458);const r=(e,t)=>{const s=document.createElement("canvas");s.width=256,s.height=256;const r=s.getContext("2d");if(!r)return;r.scale(8,8),"right"===e&&(r.translate(32,0),r.scale(-1,1)),r.strokeStyle=t,r.lineWidth=2,r.lineCap="round",r.lineJoin="round",r.beginPath(),r.moveTo(27,16),r.lineTo(5,16),r.stroke(),r.beginPath(),r.moveTo(14,7),r.lineTo(5,16),r.lineTo(14,25),r.stroke();const o=new i.GOR(s);return o.colorSpace=i.er$,o.minFilter=i.k6q,o.magFilter=i.k6q,o.generateMipmaps=!1,o.needsUpdate=!0,o}},74017:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(37458),r=s(36584);class o extends i.eaF{_height;_color;_fontSize;_textureHeight;_fontFamily;_texture;_text="";constructor(e){super(new i.bdM(1,1),new i.V9B({transparent:!0,depthTest:!1,toneMapped:!1,side:i.$EB})),this._height=e.height,this._color=e.color??"#ffffff",this._fontSize=e.fontSize??56,this._textureHeight=e.textureHeight??128,this._fontFamily=e.fontFamily??"sans-serif",this.renderOrder=12,this.setText(e.text)}setText(e){if(this._text===e)return;if(this._text=e,this._texture?.dispose(),this._texture=void 0,!e)return this.material.map=null,this.material.needsUpdate=!0,void(this.visible=!1);const t=(0,r.t)({text:e,color:this._color,fontSize:this._fontSize,textureHeight:this._textureHeight,fontFamily:this._fontFamily});if(!t)return void(this.visible=!1);this._texture=t.texture,this.material.map=t.texture,this.material.needsUpdate=!0;const s=this._textureHeight/this._fontSize,i=this._height*s;this.scale.set(i*t.aspect,i,1),this.visible=!0}dispose(){this._texture?.dispose(),this._texture=void 0,this.geometry.dispose(),this.material.dispose()}}},95523:(e,t,s)=>{s.d(t,{q:()=>a});var i=s(37458),r=s(33869),o=s(74017);class a extends i.B69{_surface;_text;_height;constructor(e){super();const{text:t,height:s,options:i,color:a=1053207,opacity:n=.85,textColor:h="#ffffff"}=e;this._height=s,this._text=new o.U({text:t,height:.42*s,color:h,fontSize:i.labelFontSize,textureHeight:i.labelTextureHeight,fontFamily:i.labelFontFamily}),this._surface=new r.S({width:this.getSurfaceWidth(),height:s,radius:s/2,color:a,opacity:n}),this._surface.renderOrder=10,this.add(this._surface),this._text.position.z=.001,this.add(this._text)}setText(e){this._text.setText(e),this._surface.visible=""!==e,this._surface.visible&&this._surface.setSize(this.getSurfaceWidth(),this._height,this._height/2)}dispose(){this._surface.dispose(),this._text.dispose()}getSurfaceWidth(){return this._text.scale.x+.8*this._height}}},99402:(e,t,s)=>{s.d(t,{R:()=>a});var i=s(65658),r=s(16039);const o=new Set(["CameraPoint","Aperture","Portal","Stair"]);class a{_store;_event={id:"",type:"",button:r.w.Left};_hoveredId="";_hoveredType="";constructor(e){this._store=e}get raycastController(){return this._store.panoramaTabStore.cameraStore.raycast.controller}get isAvailable(){return"panorama"===this._store.tabStore.tab}collectTargets(e){const t=[];return e.traverse((e=>{const s=e;!0===s.isInteractive&&o.has(`${s.domainType??""}`)&&(e=>{let t=e;for(;t;){if(!t.visible)return!1;t=t.parent}return!0})(e)&&t.push(e)})),t}setHover(e,t){this._hoveredId===e&&this._hoveredType===t||(this._hoveredId=e,this._hoveredType=t,this.emit(i.y.RaycastChange))}clearHover(){this.setHover("","")}select(e,t){e&&t&&(this.setHover(e,t),this.emit(i.y.RaycastClick))}dispose(){this.clearHover()}emit(e){const t=this._event;t.id=this._hoveredId,t.type=this._hoveredType,t.button=r.w.Left,this.raycastController.emit(e,t)}}}}]);
package/build/api.js CHANGED
@@ -1 +1 @@
1
- var t={134:(t,e,n)=>{n.d(e,{A:()=>r});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)}},180:(t,e,n)=>{let r;n.d(e,{A:()=>i});const a=new Uint8Array(16);function i(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(a)}},255:(t,e,n)=>{n.d(e,{A:()=>s});var r=n(134),a=n(180),i=n(296);const s=function(t,e,n){return!r.A.randomUUID||e||t?function(t,e,n){const r=(t=t||{}).random??t.rng?.()??(0,a.A)();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){if((n=n||0)<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[n+t]=r[t];return e}return(0,i.k)(r)}(t,e,n):r.A.randomUUID()}},296:(t,e,n)=>{n.d(e,{k:()=>a});const r=[];for(let t=0;t<256;++t)r.push((t+256).toString(16).slice(1));function a(t,e=0){return(r[t[e+0]]+r[t[e+1]]+r[t[e+2]]+r[t[e+3]]+"-"+r[t[e+4]]+r[t[e+5]]+"-"+r[t[e+6]]+r[t[e+7]]+"-"+r[t[e+8]]+r[t[e+9]]+"-"+r[t[e+10]]+r[t[e+11]]+r[t[e+12]]+r[t[e+13]]+r[t[e+14]]+r[t[e+15]]).toLowerCase()}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};n.d(r,{j:()=>i});var a=n(255);class i{backendUrl="";bestRoute;fallbackConfig;needCache;needBranding=!0;needDomainBrandingFallback=!0;constructor(t,e,n){this.backendUrl=t.endsWith("/")?t.slice(0,t.length-1):t,this.bestRoute=e,this.fallbackConfig=n,this.needCache=!(!n||!e)}get headers(){return{Accept:"application/json;widget-version=4.9.0"}}get entropySuffix(){return this.bestRoute?.entropy?`?entropy=${(0,a.A)()}`:""}loadCrmWidgetData=async t=>{if(!t)return this.makeError(404,"No crmPlanId!");if(this.bestRoute&&this.fallbackConfig)try{const e=await this.fetchCdn(`/widgets/crm/${t}/v4/plan.json${this.entropySuffix}`);if(e.ok){const n=await e.json();return this.proceedCrmJson(n,t)}}catch{}try{const e=await this.fetchBackend(`/api/crm/plans/${t}/v4/widget?cache=${this.needCache?1:0}`);if(e.ok){const n=await e.json();return this.proceedCrmJson(n,t)}return this.makeErrorFromResponse(e,"Failed to get CRM Plan widget data!")}catch(t){return this.makeError(520,t.message)}};loadWidgetData=async t=>{if(!t)return this.makeError(404,"No planId!");if(this.bestRoute&&this.fallbackConfig)try{const e=await this.fetchCdn(`/widgets/services/${t}/v4/plan.json${this.entropySuffix}`);if(e.ok){const n=await e.json();return this.proceedServiceJson(n,t)}}catch{}try{const e=await this.fetchBackend(`/api/plans/${t}/v4/widget?cache=${this.needCache?1:0}`);if(e.ok){const n=await e.json();return this.proceedServiceJson(n,t)}return this.makeErrorFromResponse(e,"Failed to get Plan widget data!")}catch(t){return this.makeError(520,t.message)}};proceedCrmJson(t,e){return this.proceedJson({...t,is_crm:!0,crm_plan_id:e})}proceedServiceJson(t,e){return this.proceedJson({...t,is_crm:!1,plan_id:e})}async proceedJson(t){return this.checkUnrealAvailability(t)||(await this.replaceCdnUrls(t),await this.proceedBranding(t),t)}checkUnrealAvailability(t){const e=(t.variants??[]).filter((t=>null!=t.availability?.unreal));if(0===e.length)return;if(e.some((t=>t.availability.unreal.ready)))return;const{state:n}=e[0].availability.unreal;return this.makeError(422,`Plan is not processed for the tour widget (${n}).`,n)}async replaceCdnUrls(t){const{bestRoute:e,fallbackConfig:n}=this;if(!e||!n)return t;const r=t=>{if(!t)return"";const r=(t=>{const e=n.keyExtraction?.patterns??[];for(let n=0,r=e.length;n<r;n++){const r=t.match(e[n].re);if(null!=r)return r[1]}return""})(t);return r?e.template.replace(/\{key\}/,r):t??""};t.variants.forEach((t=>{t.assets_path=r(t.assets_path),t.json=r(t.json),t.floors.forEach((t=>{t.original_plan_img=r(t.original_plan_img),t.miniplan_img=r(t.miniplan_img)}))}))}async proceedBranding(t){if(!this.needBranding)return t;const{primary_widget_branding_id:e}=t;if(null!=e){try{const n=await this.fetchCdn(`/widgets/brandings/id/${e}/branding.json${this.entropySuffix}`);n.ok&&(t.widget_branding=await n.json())}catch{}if(null==t.widget_branding)try{const n=await this.fetchBackend(`/api/plans/widget_branding/${e}`);n.ok&&(t.widget_branding=await n.json())}catch{}}if(null==t.widget_branding&&this.needDomainBrandingFallback){const e=window.location.hostname;try{const n=await this.fetchCdn(`/widgets/brandings/domain/${e}/branding.json${this.entropySuffix}`);n.ok&&(t.widget_branding=await n.json())}catch{}if(null==t.widget_branding)try{const e=await this.fetchBackend("/api/plans/widget_branding");e.ok&&(t.widget_branding=await e.json())}catch{}}}fetchCdn=(t,e={headers:this.headers})=>{let n=this.bestRoute?this.bestRoute.template.replace(/\{key\}/,""):"";return n.endsWith("/")&&(n=n.slice(0,n.length-1)),fetch(`${n}${t}`,e)};fetchBackend=(t,e={headers:this.headers})=>fetch(`${this.backendUrl}${t}`,e);makeError(t,e="Unknown error",n){return{error:{status:t,message:e,reason:n}}}async makeErrorFromResponse(t,e){if("application/json"===t.headers.get("Content-Type")){const e=await t.json();if("message"in e&&"string"==typeof e.message)return this.makeError(t.status,e.message)}return this.makeError(t.status,e)}}const s=r.j;export{s as Api};
1
+ var t={134:(t,e,n)=>{n.d(e,{A:()=>r});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)}},180:(t,e,n)=>{let r;n.d(e,{A:()=>i});const a=new Uint8Array(16);function i(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(a)}},255:(t,e,n)=>{n.d(e,{A:()=>s});var r=n(134),a=n(180),i=n(296);const s=function(t,e,n){return!r.A.randomUUID||e||t?function(t,e,n){const r=(t=t||{}).random??t.rng?.()??(0,a.A)();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){if((n=n||0)<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[n+t]=r[t];return e}return(0,i.k)(r)}(t,e,n):r.A.randomUUID()}},296:(t,e,n)=>{n.d(e,{k:()=>a});const r=[];for(let t=0;t<256;++t)r.push((t+256).toString(16).slice(1));function a(t,e=0){return(r[t[e+0]]+r[t[e+1]]+r[t[e+2]]+r[t[e+3]]+"-"+r[t[e+4]]+r[t[e+5]]+"-"+r[t[e+6]]+r[t[e+7]]+"-"+r[t[e+8]]+r[t[e+9]]+"-"+r[t[e+10]]+r[t[e+11]]+r[t[e+12]]+r[t[e+13]]+r[t[e+14]]+r[t[e+15]]).toLowerCase()}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};n.d(r,{j:()=>i});var a=n(255);class i{backendUrl="";bestRoute;fallbackConfig;needCache;needBranding=!0;needDomainBrandingFallback=!0;constructor(t,e,n){this.backendUrl=t.endsWith("/")?t.slice(0,t.length-1):t,this.bestRoute=e,this.fallbackConfig=n,this.needCache=!(!n||!e)}get headers(){return{Accept:"application/json;widget-version=4.9.1"}}get entropySuffix(){return this.bestRoute?.entropy?`?entropy=${(0,a.A)()}`:""}loadCrmWidgetData=async t=>{if(!t)return this.makeError(404,"No crmPlanId!");if(this.bestRoute&&this.fallbackConfig)try{const e=await this.fetchCdn(`/widgets/crm/${t}/v4/plan.json${this.entropySuffix}`);if(e.ok){const n=await e.json();return this.proceedCrmJson(n,t)}}catch{}try{const e=await this.fetchBackend(`/api/crm/plans/${t}/v4/widget?cache=${this.needCache?1:0}`);if(e.ok){const n=await e.json();return this.proceedCrmJson(n,t)}return this.makeErrorFromResponse(e,"Failed to get CRM Plan widget data!")}catch(t){return this.makeError(520,t.message)}};loadWidgetData=async t=>{if(!t)return this.makeError(404,"No planId!");if(this.bestRoute&&this.fallbackConfig)try{const e=await this.fetchCdn(`/widgets/services/${t}/v4/plan.json${this.entropySuffix}`);if(e.ok){const n=await e.json();return this.proceedServiceJson(n,t)}}catch{}try{const e=await this.fetchBackend(`/api/plans/${t}/v4/widget?cache=${this.needCache?1:0}`);if(e.ok){const n=await e.json();return this.proceedServiceJson(n,t)}return this.makeErrorFromResponse(e,"Failed to get Plan widget data!")}catch(t){return this.makeError(520,t.message)}};proceedCrmJson(t,e){return this.proceedJson({...t,is_crm:!0,crm_plan_id:e})}proceedServiceJson(t,e){return this.proceedJson({...t,is_crm:!1,plan_id:e})}async proceedJson(t){return this.checkUnrealAvailability(t)||(await this.replaceCdnUrls(t),await this.proceedBranding(t),t)}checkUnrealAvailability(t){const e=(t.variants??[]).filter((t=>null!=t.availability?.unreal));if(0===e.length)return;if(e.some((t=>t.availability.unreal.ready)))return;const{state:n}=e[0].availability.unreal;return this.makeError(422,`Plan is not processed for the tour widget (${n}).`,n)}async replaceCdnUrls(t){const{bestRoute:e,fallbackConfig:n}=this;if(!e||!n)return t;const r=t=>{if(!t)return"";const r=(t=>{const e=n.keyExtraction?.patterns??[];for(let n=0,r=e.length;n<r;n++){const r=t.match(e[n].re);if(null!=r)return r[1]}return""})(t);return r?e.template.replace(/\{key\}/,r):t??""};t.variants.forEach((t=>{t.assets_path=r(t.assets_path),t.json=r(t.json),t.floors.forEach((t=>{t.original_plan_img=r(t.original_plan_img),t.miniplan_img=r(t.miniplan_img)}))}))}async proceedBranding(t){if(!this.needBranding)return t;const{primary_widget_branding_id:e}=t;if(null!=e){try{const n=await this.fetchCdn(`/widgets/brandings/id/${e}/branding.json${this.entropySuffix}`);n.ok&&(t.widget_branding=await n.json())}catch{}if(null==t.widget_branding)try{const n=await this.fetchBackend(`/api/plans/widget_branding/${e}`);n.ok&&(t.widget_branding=await n.json())}catch{}}if(null==t.widget_branding&&this.needDomainBrandingFallback){const e=window.location.hostname;try{const n=await this.fetchCdn(`/widgets/brandings/domain/${e}/branding.json${this.entropySuffix}`);n.ok&&(t.widget_branding=await n.json())}catch{}if(null==t.widget_branding)try{const e=await this.fetchBackend("/api/plans/widget_branding");e.ok&&(t.widget_branding=await e.json())}catch{}}}fetchCdn=(t,e={headers:this.headers})=>{let n=this.bestRoute?this.bestRoute.template.replace(/\{key\}/,""):"";return n.endsWith("/")&&(n=n.slice(0,n.length-1)),fetch(`${n}${t}`,e)};fetchBackend=(t,e={headers:this.headers})=>fetch(`${this.backendUrl}${t}`,e);makeError(t,e="Unknown error",n){return{error:{status:t,message:e,reason:n}}}async makeErrorFromResponse(t,e){if("application/json"===t.headers.get("Content-Type")){const e=await t.json();if("message"in e&&"string"==typeof e.message)return this.makeError(t.status,e.message)}return this.makeError(t.status,e)}}const s=r.j;export{s as Api};