@realsee/five-webgpu 1.0.0-alpha.10 → 1.0.0-alpha.11

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.
Files changed (181) hide show
  1. package/_virtual/_rolldown/runtime.js +2 -2
  2. package/five/index.js +50 -50
  3. package/five/index.mjs +1149 -1186
  4. package/five/renderer/postprocessing/passes/pass.js +2 -2
  5. package/five/renderer/postprocessing/passes/pass.mjs +2 -2
  6. package/five/renderer/tools/full-screen-quad.js +2 -2
  7. package/five/renderer/tools/full-screen-quad.mjs +2 -2
  8. package/five/utils/calculateThreeMouse.js +2 -2
  9. package/five/utils/calculateThreeMouse.mjs +2 -2
  10. package/five/utils/distance.js +2 -2
  11. package/five/utils/distance.mjs +2 -2
  12. package/five/utils/isNil.js +2 -2
  13. package/five/utils/isNil.mjs +2 -2
  14. package/five/utils/uuid.js +2 -2
  15. package/five/utils/uuid.mjs +2 -2
  16. package/gltf-loader/index.js +3 -3
  17. package/gltf-loader/index.mjs +3 -3
  18. package/line/index.js +3 -3
  19. package/line/index.mjs +3 -3
  20. package/package.json +1 -1
  21. package/plugins/BackgroundPlugin/Controller.js +3 -3
  22. package/plugins/BackgroundPlugin/Controller.mjs +3 -3
  23. package/plugins/BackgroundPlugin/index.js +2 -2
  24. package/plugins/BackgroundPlugin/index.mjs +2 -2
  25. package/plugins/BasePlugin/index.js +2 -2
  26. package/plugins/BasePlugin/index.mjs +2 -2
  27. package/plugins/CSS2DPlugin/Controller.js +3 -3
  28. package/plugins/CSS2DPlugin/Controller.mjs +3 -3
  29. package/plugins/CSS2DPlugin/index.js +2 -2
  30. package/plugins/CSS2DPlugin/index.mjs +2 -2
  31. package/plugins/CSS2DPlugin/style.css_raw.js +2 -2
  32. package/plugins/CSS2DPlugin/style.css_raw.mjs +2 -2
  33. package/plugins/CSS3DPlugin/Controller.js +3 -3
  34. package/plugins/CSS3DPlugin/Controller.mjs +3 -3
  35. package/plugins/CSS3DPlugin/index.js +2 -2
  36. package/plugins/CSS3DPlugin/index.mjs +2 -2
  37. package/plugins/CSS3DPlugin/style.css_raw.js +2 -2
  38. package/plugins/CSS3DPlugin/style.css_raw.mjs +2 -2
  39. package/plugins/FloorplanPlugin/Controller.js +3 -3
  40. package/plugins/FloorplanPlugin/Controller.mjs +3 -3
  41. package/plugins/FloorplanPlugin/index.js +2 -2
  42. package/plugins/FloorplanPlugin/index.mjs +2 -2
  43. package/plugins/FloorplanPlugin/render/assets.js +2 -2
  44. package/plugins/FloorplanPlugin/render/assets.mjs +2 -2
  45. package/plugins/FloorplanPlugin/render/index.js +2 -2
  46. package/plugins/FloorplanPlugin/render/index.mjs +2 -2
  47. package/plugins/FloorplanPlugin/render/isPointInPolygon.js +2 -2
  48. package/plugins/FloorplanPlugin/render/isPointInPolygon.mjs +2 -2
  49. package/plugins/FloorplanPlugin/render/renderFloor.js +2 -2
  50. package/plugins/FloorplanPlugin/render/renderFloor.mjs +2 -2
  51. package/plugins/FloorplanPlugin/render/roomLabelVisibility.js +2 -2
  52. package/plugins/FloorplanPlugin/render/roomLabelVisibility.mjs +2 -2
  53. package/plugins/FloorplanPlugin/render/style.css_raw.js +2 -2
  54. package/plugins/FloorplanPlugin/render/style.css_raw.mjs +2 -2
  55. package/plugins/FloorplanPlugin/utils/changeMode.js +3 -3
  56. package/plugins/FloorplanPlugin/utils/changeMode.mjs +3 -3
  57. package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.js +2 -2
  58. package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.mjs +2 -2
  59. package/plugins/FloorplanPlugin/utils/correctFiveState.js +3 -3
  60. package/plugins/FloorplanPlugin/utils/correctFiveState.mjs +3 -3
  61. package/plugins/FloorplanPlugin/utils/equal.js +2 -2
  62. package/plugins/FloorplanPlugin/utils/equal.mjs +2 -2
  63. package/plugins/FloorplanPlugin/utils/filter.js +2 -2
  64. package/plugins/FloorplanPlugin/utils/filter.mjs +2 -2
  65. package/plugins/FloorplanPlugin/utils/fiveModelLoad.js +3 -3
  66. package/plugins/FloorplanPlugin/utils/fiveModelLoad.mjs +3 -3
  67. package/plugins/FloorplanPlugin/utils/formatData.js +3 -3
  68. package/plugins/FloorplanPlugin/utils/formatData.mjs +3 -3
  69. package/plugins/FloorplanPlugin/utils/formatFloorplanJson.js +2 -2
  70. package/plugins/FloorplanPlugin/utils/formatFloorplanJson.mjs +2 -2
  71. package/plugins/FloorplanPlugin/utils/formatPosition.js +2 -2
  72. package/plugins/FloorplanPlugin/utils/formatPosition.mjs +2 -2
  73. package/plugins/FloorplanPlugin/utils/getDistanceFromModel.js +2 -2
  74. package/plugins/FloorplanPlugin/utils/getDistanceFromModel.mjs +2 -2
  75. package/plugins/FloorplanPlugin/utils/getPxmm.js +2 -2
  76. package/plugins/FloorplanPlugin/utils/getPxmm.mjs +2 -2
  77. package/plugins/FloorplanPlugin/utils/isTruelyObject.js +2 -2
  78. package/plugins/FloorplanPlugin/utils/isTruelyObject.mjs +2 -2
  79. package/plugins/FloorplanPlugin/utils/nearlyEqual.js +2 -2
  80. package/plugins/FloorplanPlugin/utils/nearlyEqual.mjs +2 -2
  81. package/plugins/FloorplanPlugin/utils/polylabel.js +2 -2
  82. package/plugins/FloorplanPlugin/utils/polylabel.mjs +2 -2
  83. package/plugins/FloorplanPlugin/utils/to.js +3 -3
  84. package/plugins/FloorplanPlugin/utils/to.mjs +3 -3
  85. package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.js +3 -3
  86. package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.mjs +3 -3
  87. package/plugins/GaussianSplattingEntranceAnimationPlugin/index.js +2 -2
  88. package/plugins/GaussianSplattingEntranceAnimationPlugin/index.mjs +2 -2
  89. package/plugins/Object3DHelperPlugin/Controller.js +3 -3
  90. package/plugins/Object3DHelperPlugin/Controller.mjs +3 -3
  91. package/plugins/Object3DHelperPlugin/Controllers/BaseController.js +2 -2
  92. package/plugins/Object3DHelperPlugin/Controllers/BaseController.mjs +2 -2
  93. package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.js +2 -2
  94. package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.mjs +2 -2
  95. package/plugins/Object3DHelperPlugin/Controllers/MoveController.js +2 -2
  96. package/plugins/Object3DHelperPlugin/Controllers/MoveController.mjs +2 -2
  97. package/plugins/Object3DHelperPlugin/Controllers/RotateController.js +2 -2
  98. package/plugins/Object3DHelperPlugin/Controllers/RotateController.mjs +2 -2
  99. package/plugins/Object3DHelperPlugin/FiveControllerWrapper.js +2 -2
  100. package/plugins/Object3DHelperPlugin/FiveControllerWrapper.mjs +2 -2
  101. package/plugins/Object3DHelperPlugin/Helper/BaseHelper.js +2 -2
  102. package/plugins/Object3DHelperPlugin/Helper/BaseHelper.mjs +2 -2
  103. package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.js +2 -2
  104. package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.mjs +2 -2
  105. package/plugins/Object3DHelperPlugin/Helper/MoveHelper.js +2 -2
  106. package/plugins/Object3DHelperPlugin/Helper/MoveHelper.mjs +2 -2
  107. package/plugins/Object3DHelperPlugin/Helper/RotateHelper.js +2 -2
  108. package/plugins/Object3DHelperPlugin/Helper/RotateHelper.mjs +2 -2
  109. package/plugins/Object3DHelperPlugin/constant.js +2 -2
  110. package/plugins/Object3DHelperPlugin/constant.mjs +2 -2
  111. package/plugins/Object3DHelperPlugin/index.js +2 -2
  112. package/plugins/Object3DHelperPlugin/index.mjs +2 -2
  113. package/plugins/Object3DHelperPlugin/utils/ArrowGroup.js +2 -2
  114. package/plugins/Object3DHelperPlugin/utils/ArrowGroup.mjs +2 -2
  115. package/plugins/Object3DHelperPlugin/utils/CenterHandle.js +2 -2
  116. package/plugins/Object3DHelperPlugin/utils/CenterHandle.mjs +2 -2
  117. package/plugins/Object3DHelperPlugin/utils/PlaneHandle.js +2 -2
  118. package/plugins/Object3DHelperPlugin/utils/PlaneHandle.mjs +2 -2
  119. package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.js +2 -2
  120. package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.mjs +2 -2
  121. package/plugins/Object3DHelperPlugin/utils/cameraHooks.js +2 -2
  122. package/plugins/Object3DHelperPlugin/utils/cameraHooks.mjs +2 -2
  123. package/plugins/Object3DHelperPlugin/utils/direction.js +2 -2
  124. package/plugins/Object3DHelperPlugin/utils/direction.mjs +2 -2
  125. package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.js +2 -2
  126. package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.mjs +2 -2
  127. package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.js +2 -2
  128. package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.mjs +2 -2
  129. package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.js +2 -2
  130. package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.mjs +2 -2
  131. package/plugins/Object3DHelperPlugin/utils/solidGuide.js +2 -2
  132. package/plugins/Object3DHelperPlugin/utils/solidGuide.mjs +2 -2
  133. package/plugins/Object3DHelperPlugin/utils/tipsDom.js +2 -2
  134. package/plugins/Object3DHelperPlugin/utils/tipsDom.mjs +2 -2
  135. package/plugins/PanoAnimePlugin/Controller.js +3 -3
  136. package/plugins/PanoAnimePlugin/Controller.mjs +3 -3
  137. package/plugins/PanoAnimePlugin/index.js +2 -2
  138. package/plugins/PanoAnimePlugin/index.mjs +2 -2
  139. package/plugins/WordPassPlugin/Controller.js +3 -3
  140. package/plugins/WordPassPlugin/Controller.mjs +3 -3
  141. package/plugins/WordPassPlugin/hersheyFont.js +2 -2
  142. package/plugins/WordPassPlugin/hersheyFont.mjs +2 -2
  143. package/plugins/WordPassPlugin/index.js +2 -2
  144. package/plugins/WordPassPlugin/index.mjs +2 -2
  145. package/plugins/WordPassPlugin/textToStrokeOrderStrokes.js +3 -3
  146. package/plugins/WordPassPlugin/textToStrokeOrderStrokes.mjs +4 -4
  147. package/plugins/WordPassPlugin/word-pass.js +3 -3
  148. package/plugins/WordPassPlugin/word-pass.mjs +3 -3
  149. package/plugins/index.js +2 -2
  150. package/plugins/index.mjs +2 -2
  151. package/plugins/thirdParty/CSS2DRenderer.js +2 -2
  152. package/plugins/thirdParty/CSS2DRenderer.mjs +2 -2
  153. package/plugins/thirdParty/CSS3DRenderer.js +2 -2
  154. package/plugins/thirdParty/CSS3DRenderer.mjs +2 -2
  155. package/plugins/thirdParty/doctorstrange-model.js +2 -2
  156. package/plugins/thirdParty/doctorstrange-model.mjs +2 -2
  157. package/plugins/thirdParty/domevents.js +2 -2
  158. package/plugins/thirdParty/domevents.mjs +2 -2
  159. package/plugins/utils/absoluteUrl.js +2 -2
  160. package/plugins/utils/absoluteUrl.mjs +2 -2
  161. package/plugins/utils/calculatePath.js +2 -2
  162. package/plugins/utils/calculatePath.mjs +2 -2
  163. package/plugins/utils/clamp.js +2 -2
  164. package/plugins/utils/clamp.mjs +2 -2
  165. package/plugins/utils/uuid.js +2 -2
  166. package/plugins/utils/uuid.mjs +2 -2
  167. package/react/index.js +2 -2
  168. package/react/index.mjs +2 -2
  169. package/sticker/index.js +3 -3
  170. package/sticker/index.mjs +3 -3
  171. package/umd/five-gltf-loader.js +3 -3
  172. package/umd/five-line.js +3 -3
  173. package/umd/five-plugins.js +2 -2
  174. package/umd/five-react.js +2 -2
  175. package/umd/five-sticker.js +3 -3
  176. package/umd/five-vfx.js +2 -2
  177. package/umd/five.js +3 -3
  178. package/vfx/index.js +2 -2
  179. package/vfx/index.mjs +2 -2
  180. package/work-downloader/index.js +3 -3
  181. package/work-downloader/index.mjs +152 -180
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */const e=require("../../_virtual/_rolldown/runtime.js"),t=require("../../node_modules/tslib/tslib.es6.js"),n=require("../BasePlugin/index.js"),r=require("./utils/formatData.js"),i=require("./utils/to.js"),a=require("./utils/filter.js"),o=require("./utils/correctFiveState.js"),s=require("./utils/changeModelCanvasOpacity.js"),c=require("./utils/getPxmm.js"),l=require("./utils/fiveModelLoad.js"),u=require("./utils/equal.js"),d=require("./render/index.js"),f=require("./render/style.css_raw.js");let p=require("three/webgpu");p=e.__toESM(p,1);var m=500,h=.01;function g(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)>5*Math.PI/180,i=n>Math.PI/180*5&&n<Math.PI/180*355;return r||i}function _(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)<10*Math.PI/180,i=n<Math.PI/180*30||n>Math.PI/180*330;return r&&i}var v=class extends n.BasePlugin.Controller{constructor(e,n){var r,c,u;super(e),this.name=`FloorplanPlugin`,this.renderer=new d.FloorplanRenderer,this.styleSheet=new CSSStyleSheet,this.panoIndex=0,this.floorIndex=0,this.lastPanoramaLongitude=0,this.size={width:0,height:0},this.hasAddedEventListener=!1,this.isHiddenByHideFunc=!1,this.highlightData={},this.store={roomOnMouse:null},this.dispose=()=>{var e,t;this.removeEventListener(),(e=this.resizeObserver)==null||e.disconnect(),(t=this.removeExtraElement)==null||t.call(this),this.removeExtraElement=void 0,this.pendingCameraUpdateFrame!==void 0&&cancelAnimationFrame(this.pendingCameraUpdateFrame),this.pendingResizeFrame!==void 0&&cancelAnimationFrame(this.pendingResizeFrame),this.renderer.dispose(),this.wrapper=void 0,this.data=void 0,this.hooks.emit(`dispose`)},this.show=(...e)=>t.__awaiter(this,[...e],void 0,function*(e={}){var t;if(!this.state.enabled||!this.showPromise&&this.state.visible)return;let n=(t=e.userAction)==null?!0:t;return this.updateState({visible:!0},n),this._show(e)}),this.hide=(...e)=>t.__awaiter(this,[...e],void 0,function*(e={}){var t;this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},(t=e.userAction)==null?!0:t),this._hide(e)))}),this.highlight=e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.renderCurrent())},this.unhighlight=()=>{this.highlightData={},this.renderCurrent()},this.updateShowState=e=>{this.showState=Object.assign(Object.assign({},this.showState),e)},this.onRoomHover=e=>{this.store.roomOnMouse=e},this.handleClick=()=>{if(this.state.visible&&this.hooks.emit(`click`,this.store.roomOnMouse))return!1},this.onFiveModelLoaded=()=>{var e,t,n;this.state.enabled!==!1&&(this.floorIndex=(n=(t=(e=this.five.work)==null?void 0:e.observers[this.panoIndex])==null?void 0:t.floorIndex)==null?0:n,this.renderCurrent())},this.onFiveModeChange=e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))},this.onFiveInertiaPan=(e,t)=>{t&&(this.state.visible||this.state.config.autoShowEnable!==!1&&(this.isHiddenByHideFunc||this.five.currentMode===this.showState.mode&&_(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))))},this.onFivePanoArrived=e=>{var t,n;this.five.work&&(this.panoIndex=e,this.floorIndex=(n=(t=this.five.work.observers[e])==null?void 0:t.floorIndex)==null?this.floorIndex:n)},this.onFiveCameraUpdate=(e,t)=>{this.state.visible&&(this.showPromise||(this.scheduleCameraUpdate(),g(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!1},t),this._hide({userAction:t}))))},this.onFiveWantsPanGesture=(e,t)=>{if(this.five.currentMode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&t&&this.state.visible)return this.five.updateCamera(a.omit(this.showState,[`mode`,`offset`]),0),!1},this.onFiveWantsTapGesture=()=>this.handleClick(),this.onFiveWantsChangeMode=(e,t)=>{t===`Panorama`&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)},this.onModelShownFloorChange=e=>{var t,n,r;if(this.floorIndex!==e){if(e===null){this.floorIndex=(r=(n=(t=this.five.work)==null?void 0:t.observers[this.panoIndex])==null?void 0:n.floorIndex)==null?this.floorIndex:r;return}this.floorIndex=e,this.updateSize(),this.renderCurrent()}},this._show=e=>t.__awaiter(this,void 0,void 0,function*(){var n;if(!this.state.enabled)return;if(!((n=this.five.model)!=null&&n.loaded))throw Error(`ModelNotLoaded`);if(!this.data)throw Error(`DataNotLoaded`);if(this.showPromise)return this.showPromise;let r=Object.assign({floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},e),a=()=>t.__awaiter(this,void 0,void 0,function*(){var e;this.hooks.emit(`show`,{userAction:r.userAction,auto:r.isAutoShow});let t=!1,n;this.showRejection=e=>{t=!0,n=e};let[a]=yield i.default(o.correctFiveState(this.five,this.showState,r.userAction));if(a)throw a;if(t)throw Error(n||`UnknownError`);if(!this.updateSize())throw Error(`UpdateSizeError`);this.updatePosition(),this.floorIndex=r.floorIndex,(e=this.five.model)==null||e.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=a().then(()=>{this.showPromise=void 0,this.showRejection=void 0;let e=r.immediately?0:m;s.changeModelCanvasOpacity(this.five,r.modelOpacity,e),this.renderWithDuration(e),this.hooks.emit(`showAnimationEnded`,{auto:r.isAutoShow,userAction:r.userAction})}).catch(e=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},r.userAction),!r.isAutoShow)throw e}),this.showPromise}),this._hide=e=>{var t;(t=this.showRejection)==null||t.call(this,`BreakOffByHide`),this.showPromise=void 0;let n=Object.assign({userAction:!0,isAutoHide:!1},e);s.changeModelCanvasOpacity(this.five,1,0),this.hooks.emit(`hide`,{auto:n.isAutoHide,userAction:n.userAction}),this.renderCurrent()},this.five=e,this.styleSheet.replaceSync(f.default),typeof document<`u`&&document.adoptedStyleSheets.push(this.styleSheet),this.showState=Object.assign({mode:`Mapview`,longitude:0,latitude:Math.PI/2,fov:80},n==null?void 0:n.showState);let p={northDesc:`北`,modelOpacity:h,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomNameOtherTypeEnable:!0,roomDimensionEnable:!0,cameraImageUrl:void 0,attachedTo:3,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:{imageWidth:200,imageHeight:120,text:`暂无平面图`,textFontSize:14},i18n:e=>e,getRoomAreaText:e=>(e/1e6).toFixed(1)+`㎡`,getRoomDimensionText:(e,t)=>(e/1e3).toFixed(1)+`m × `+(t/1e3).toFixed(1)+`m`,getRuleDistanceText:e=>e.toString()},v=Object.assign(Object.assign(Object.assign({},p),n==null?void 0:n.config),{missingFloorConfig:Object.assign(Object.assign({},p.missingFloorConfig),(r=n==null?void 0:n.config)==null?void 0:r.missingFloorConfig)});this.state={enabled:!0,visible:!1,config:v},Object.assign(this.state,a.omit((c=n==null?void 0:n.initialState)==null?{}:c,[`config`])),this.panoIndex=(u=e.state.panoIndex)==null?0:u,this.initContainer(),l.waitFiveModelLoaded(e).then(this.onFiveModelLoaded),e.once(`dispose`,this.dispose),this.state.enabled?this.addEventListener():this.styleSheet.disabled=!0}load(e,n){return t.__awaiter(this,arguments,void 0,function*(e,t,n=!0){let i=`data`in e?e.data:e,a=this.data;this.data=yield r.default(i),this.hooks.emit(`dataLoaded`,this.data),this.hooks.emit(`dataChange`,this.data,a),t&&this.updateState(t,n),this.updateSize(),this.updatePosition(),this.renderCurrent()})}loadItems(e){this.data&&(this.data.floorDatas.forEach((t,n)=>{t.items=e[n]}),this.renderCurrent())}appendTo(e){this.wrapper=e,this.state.enabled&&(e.appendChild(this.renderer.rootElement),this.observeResize(e),this.registerExtraElement(),this.updateSize(),this.updatePosition(),this.renderCurrent())}enable(e={}){var t;if(this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e={}){var t;if(!this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}setState(e,t={}){var n;let r=this.state,i=(n=t.userAction)==null?!0:n;this.updateState(e,i),e.enabled!==void 0&&r.enabled!==e.enabled&&(e.enabled?this._enable({userAction:i}):this._disable({userAction:i})),e.visible!==void 0&&r.visible!==e.visible&&(e.visible?this._show({userAction:i}):this._hide({userAction:i}))}changeConfigs(e,t=!0){this.updateState({config:Object.assign(Object.assign({},this.state.config),e)},t),this.renderCurrent()}updateSize(){if(!this.data||!this.wrapper)return!1;let{min:e,max:t}=this.data.bounding,n=t.x-e.x,r=t.y-e.y,i=this.getPxmmWithRotation(),a=Math.ceil(n*i),o=Math.ceil(r*i);return this.size.width===a&&this.size.height===o?!0:(this.renderer.rootElement.style.width=a+`px`,this.renderer.rootElement.style.height=o+`px`,this.size={width:a,height:o},!0)}updatePosition(){if(!this.wrapper)return;let e=c.getAttachedY(this.five,this.floorIndex,this.state.config.attachedTo),t=this.five.modelScene.boundingBox.getCenter(new p.Vector3);t.y=e;let n=t.clone().project(this.five.camera),r=(n.x+1)/2,i=-(n.y-1)/2;this.renderer.rootElement.style.position=`absolute`,this.renderer.rootElement.style.left=r*100+`%`,this.renderer.rootElement.style.top=i*100+`%`,this.renderer.rootElement.style.transform=`translate(-50%, -50%)`}getPxmmWithRotation(){if(!this.wrapper)return 0;let e={attachedTo:this.state.config.attachedTo};return c.getPxmm(this.five,this.wrapper,this.floorIndex,e)}updateState(e,t){let n=this.state,r=e.config?Object.assign(Object.assign({},n.config),e.config):n.config;this.state=Object.assign(Object.assign(Object.assign({},this.state),e),{config:r}),!u.equal(this.state,n,{deep:!0})&&this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}initContainer(){this.renderer.rootElement.classList.add(`floorplan-plugin`)}registerExtraElement(){var e;(e=this.removeExtraElement)==null||e.call(this),this.removeExtraElement=this.five.addExtraElement(this.renderer.rootElement)}observeResize(e){var t;(t=this.resizeObserver)==null||t.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.scheduleResizeUpdate()}),this.resizeObserver.observe(e)}scheduleResizeUpdate(){this.pendingResizeFrame===void 0&&(this.pendingResizeFrame=requestAnimationFrame(()=>{this.pendingResizeFrame=void 0,this.updateSize(),this.updatePosition(),this.data&&this.renderer.updateLabelsVisibility(this.data,this.floorIndex,this.state.config.adaptiveRoomLabelVisibleEnable)}))}renderCurrent(){this.data&&this.renderer.render({visible:this.state.visible,duration:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;this.hasAddedEventListener=!0;let e=this.five;e.on(`modeChange`,this.onFiveModeChange),e.on(`interiaPan`,this.onFiveInertiaPan),e.on(`panoArrived`,this.onFivePanoArrived),e.on(`cameraUpdate`,this.onFiveCameraUpdate),e.on(`wantsPanGesture`,this.onFiveWantsPanGesture),e.on(`wantsTapGesture`,this.onFiveWantsTapGesture),e.on(`wantsChangeMode`,this.onFiveWantsChangeMode),e.on(`modelShownFloorChange`,this.onModelShownFloorChange)}removeEventListener(){this.hasAddedEventListener=!1;let e=this.five;e.off(`modeChange`,this.onFiveModeChange),e.off(`interiaPan`,this.onFiveInertiaPan),e.off(`panoArrived`,this.onFivePanoArrived),e.off(`cameraUpdate`,this.onFiveCameraUpdate),e.off(`wantsPanGesture`,this.onFiveWantsPanGesture),e.off(`wantsTapGesture`,this.onFiveWantsTapGesture),e.off(`wantsChangeMode`,this.onFiveWantsChangeMode),e.off(`modelShownFloorChange`,this.onModelShownFloorChange)}scheduleCameraUpdate(){this.pendingCameraUpdateFrame===void 0&&(this.pendingCameraUpdateFrame=requestAnimationFrame(()=>{this.pendingCameraUpdateFrame=void 0,this.updatePosition(),this.updateSize()}))}getRelativePose(e){let t=this.showState.longitude||0,n=((e.longitude-t)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);return{latitude:e.latitude,longitude:n}}_enable(e){this.styleSheet.disabled=!1,this.addEventListener(),this.wrapper&&(this.wrapper.appendChild(this.renderer.rootElement),this.registerExtraElement()),this.hooks.emit(`enable`,{userAction:e.userAction}),this.state.visible&&this._show({userAction:e.userAction})}_disable(e){var t,n;this.styleSheet.disabled=!0,(t=this.showRejection)==null||t.call(this,`BreakOffByDisable`),this.showPromise=void 0,this.renderer.rootElement.remove(),(n=this.removeExtraElement)==null||n.call(this),this.removeExtraElement=void 0,this.removeEventListener(),this.hooks.emit(`disable`,{userAction:e.userAction})}renderWithDuration(e){this.data&&this.renderer.render({visible:this.state.visible,duration:e,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}};exports.Controller=v;
255
+ */const e=require("../../_virtual/_rolldown/runtime.js"),t=require("../BasePlugin/index.js"),n=require("./utils/formatData.js"),r=require("./utils/to.js"),i=require("./utils/filter.js"),a=require("./utils/correctFiveState.js"),o=require("./utils/changeModelCanvasOpacity.js"),s=require("./utils/getPxmm.js"),c=require("./utils/fiveModelLoad.js"),l=require("./utils/equal.js"),u=require("./render/index.js"),d=require("./render/style.css_raw.js");let f=require("tslib"),p=require("three/webgpu");p=e.__toESM(p,1);var m=500,h=.01;function g(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)>5*Math.PI/180,i=n>Math.PI/180*5&&n<Math.PI/180*355;return r||i}function _(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)<10*Math.PI/180,i=n<Math.PI/180*30||n>Math.PI/180*330;return r&&i}var v=class extends t.BasePlugin.Controller{constructor(e,t){var n,s,l;super(e),this.name=`FloorplanPlugin`,this.renderer=new u.FloorplanRenderer,this.styleSheet=new CSSStyleSheet,this.panoIndex=0,this.floorIndex=0,this.lastPanoramaLongitude=0,this.size={width:0,height:0},this.hasAddedEventListener=!1,this.isHiddenByHideFunc=!1,this.highlightData={},this.store={roomOnMouse:null},this.dispose=()=>{var e,t;this.removeEventListener(),(e=this.resizeObserver)==null||e.disconnect(),(t=this.removeExtraElement)==null||t.call(this),this.removeExtraElement=void 0,this.pendingCameraUpdateFrame!==void 0&&cancelAnimationFrame(this.pendingCameraUpdateFrame),this.pendingResizeFrame!==void 0&&cancelAnimationFrame(this.pendingResizeFrame),this.renderer.dispose(),this.wrapper=void 0,this.data=void 0,this.hooks.emit(`dispose`)},this.show=(...e)=>(0,f.__awaiter)(this,[...e],void 0,function*(e={}){var t;if(!this.state.enabled||!this.showPromise&&this.state.visible)return;let n=(t=e.userAction)==null?!0:t;return this.updateState({visible:!0},n),this._show(e)}),this.hide=(...e)=>(0,f.__awaiter)(this,[...e],void 0,function*(e={}){var t;this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},(t=e.userAction)==null?!0:t),this._hide(e)))}),this.highlight=e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.renderCurrent())},this.unhighlight=()=>{this.highlightData={},this.renderCurrent()},this.updateShowState=e=>{this.showState=Object.assign(Object.assign({},this.showState),e)},this.onRoomHover=e=>{this.store.roomOnMouse=e},this.handleClick=()=>{if(this.state.visible&&this.hooks.emit(`click`,this.store.roomOnMouse))return!1},this.onFiveModelLoaded=()=>{var e,t,n;this.state.enabled!==!1&&(this.floorIndex=(n=(t=(e=this.five.work)==null?void 0:e.observers[this.panoIndex])==null?void 0:t.floorIndex)==null?0:n,this.renderCurrent())},this.onFiveModeChange=e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))},this.onFiveInertiaPan=(e,t)=>{t&&(this.state.visible||this.state.config.autoShowEnable!==!1&&(this.isHiddenByHideFunc||this.five.currentMode===this.showState.mode&&_(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))))},this.onFivePanoArrived=e=>{var t,n;this.five.work&&(this.panoIndex=e,this.floorIndex=(n=(t=this.five.work.observers[e])==null?void 0:t.floorIndex)==null?this.floorIndex:n)},this.onFiveCameraUpdate=(e,t)=>{this.state.visible&&(this.showPromise||(this.scheduleCameraUpdate(),g(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!1},t),this._hide({userAction:t}))))},this.onFiveWantsPanGesture=(e,t)=>{if(this.five.currentMode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&t&&this.state.visible)return this.five.updateCamera(i.omit(this.showState,[`mode`,`offset`]),0),!1},this.onFiveWantsTapGesture=()=>this.handleClick(),this.onFiveWantsChangeMode=(e,t)=>{t===`Panorama`&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)},this.onModelShownFloorChange=e=>{var t,n,r;if(this.floorIndex!==e){if(e===null){this.floorIndex=(r=(n=(t=this.five.work)==null?void 0:t.observers[this.panoIndex])==null?void 0:n.floorIndex)==null?this.floorIndex:r;return}this.floorIndex=e,this.updateSize(),this.renderCurrent()}},this._show=e=>(0,f.__awaiter)(this,void 0,void 0,function*(){var t;if(!this.state.enabled)return;if(!((t=this.five.model)!=null&&t.loaded))throw Error(`ModelNotLoaded`);if(!this.data)throw Error(`DataNotLoaded`);if(this.showPromise)return this.showPromise;let n=Object.assign({floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},e),i=()=>(0,f.__awaiter)(this,void 0,void 0,function*(){var e;this.hooks.emit(`show`,{userAction:n.userAction,auto:n.isAutoShow});let t=!1,i;this.showRejection=e=>{t=!0,i=e};let[o]=yield r.default(a.correctFiveState(this.five,this.showState,n.userAction));if(o)throw o;if(t)throw Error(i||`UnknownError`);if(!this.updateSize())throw Error(`UpdateSizeError`);this.updatePosition(),this.floorIndex=n.floorIndex,(e=this.five.model)==null||e.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=i().then(()=>{this.showPromise=void 0,this.showRejection=void 0;let e=n.immediately?0:m;o.changeModelCanvasOpacity(this.five,n.modelOpacity,e),this.renderWithDuration(e),this.hooks.emit(`showAnimationEnded`,{auto:n.isAutoShow,userAction:n.userAction})}).catch(e=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},n.userAction),!n.isAutoShow)throw e}),this.showPromise}),this._hide=e=>{var t;(t=this.showRejection)==null||t.call(this,`BreakOffByHide`),this.showPromise=void 0;let n=Object.assign({userAction:!0,isAutoHide:!1},e);o.changeModelCanvasOpacity(this.five,1,0),this.hooks.emit(`hide`,{auto:n.isAutoHide,userAction:n.userAction}),this.renderCurrent()},this.five=e,this.styleSheet.replaceSync(d.default),typeof document<`u`&&document.adoptedStyleSheets.push(this.styleSheet),this.showState=Object.assign({mode:`Mapview`,longitude:0,latitude:Math.PI/2,fov:80},t==null?void 0:t.showState);let p={northDesc:`北`,modelOpacity:h,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomNameOtherTypeEnable:!0,roomDimensionEnable:!0,cameraImageUrl:void 0,attachedTo:3,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:{imageWidth:200,imageHeight:120,text:`暂无平面图`,textFontSize:14},i18n:e=>e,getRoomAreaText:e=>(e/1e6).toFixed(1)+`㎡`,getRoomDimensionText:(e,t)=>(e/1e3).toFixed(1)+`m × `+(t/1e3).toFixed(1)+`m`,getRuleDistanceText:e=>e.toString()},v=Object.assign(Object.assign(Object.assign({},p),t==null?void 0:t.config),{missingFloorConfig:Object.assign(Object.assign({},p.missingFloorConfig),(n=t==null?void 0:t.config)==null?void 0:n.missingFloorConfig)});this.state={enabled:!0,visible:!1,config:v},Object.assign(this.state,i.omit((s=t==null?void 0:t.initialState)==null?{}:s,[`config`])),this.panoIndex=(l=e.state.panoIndex)==null?0:l,this.initContainer(),c.waitFiveModelLoaded(e).then(this.onFiveModelLoaded),e.once(`dispose`,this.dispose),this.state.enabled?this.addEventListener():this.styleSheet.disabled=!0}load(e,t){return(0,f.__awaiter)(this,arguments,void 0,function*(e,t,r=!0){let i=`data`in e?e.data:e,a=this.data;this.data=yield n.default(i),this.hooks.emit(`dataLoaded`,this.data),this.hooks.emit(`dataChange`,this.data,a),t&&this.updateState(t,r),this.updateSize(),this.updatePosition(),this.renderCurrent()})}loadItems(e){this.data&&(this.data.floorDatas.forEach((t,n)=>{t.items=e[n]}),this.renderCurrent())}appendTo(e){this.wrapper=e,this.state.enabled&&(e.appendChild(this.renderer.rootElement),this.observeResize(e),this.registerExtraElement(),this.updateSize(),this.updatePosition(),this.renderCurrent())}enable(e={}){var t;if(this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e={}){var t;if(!this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}setState(e,t={}){var n;let r=this.state,i=(n=t.userAction)==null?!0:n;this.updateState(e,i),e.enabled!==void 0&&r.enabled!==e.enabled&&(e.enabled?this._enable({userAction:i}):this._disable({userAction:i})),e.visible!==void 0&&r.visible!==e.visible&&(e.visible?this._show({userAction:i}):this._hide({userAction:i}))}changeConfigs(e,t=!0){this.updateState({config:Object.assign(Object.assign({},this.state.config),e)},t),this.renderCurrent()}updateSize(){if(!this.data||!this.wrapper)return!1;let{min:e,max:t}=this.data.bounding,n=t.x-e.x,r=t.y-e.y,i=this.getPxmmWithRotation(),a=Math.ceil(n*i),o=Math.ceil(r*i);return this.size.width===a&&this.size.height===o?!0:(this.renderer.rootElement.style.width=a+`px`,this.renderer.rootElement.style.height=o+`px`,this.size={width:a,height:o},!0)}updatePosition(){if(!this.wrapper)return;let e=s.getAttachedY(this.five,this.floorIndex,this.state.config.attachedTo),t=this.five.modelScene.boundingBox.getCenter(new p.Vector3);t.y=e;let n=t.clone().project(this.five.camera),r=(n.x+1)/2,i=-(n.y-1)/2;this.renderer.rootElement.style.position=`absolute`,this.renderer.rootElement.style.left=r*100+`%`,this.renderer.rootElement.style.top=i*100+`%`,this.renderer.rootElement.style.transform=`translate(-50%, -50%)`}getPxmmWithRotation(){if(!this.wrapper)return 0;let e={attachedTo:this.state.config.attachedTo};return s.getPxmm(this.five,this.wrapper,this.floorIndex,e)}updateState(e,t){let n=this.state,r=e.config?Object.assign(Object.assign({},n.config),e.config):n.config;this.state=Object.assign(Object.assign(Object.assign({},this.state),e),{config:r}),!l.equal(this.state,n,{deep:!0})&&this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}initContainer(){this.renderer.rootElement.classList.add(`floorplan-plugin`)}registerExtraElement(){var e;(e=this.removeExtraElement)==null||e.call(this),this.removeExtraElement=this.five.addExtraElement(this.renderer.rootElement)}observeResize(e){var t;(t=this.resizeObserver)==null||t.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.scheduleResizeUpdate()}),this.resizeObserver.observe(e)}scheduleResizeUpdate(){this.pendingResizeFrame===void 0&&(this.pendingResizeFrame=requestAnimationFrame(()=>{this.pendingResizeFrame=void 0,this.updateSize(),this.updatePosition(),this.data&&this.renderer.updateLabelsVisibility(this.data,this.floorIndex,this.state.config.adaptiveRoomLabelVisibleEnable)}))}renderCurrent(){this.data&&this.renderer.render({visible:this.state.visible,duration:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;this.hasAddedEventListener=!0;let e=this.five;e.on(`modeChange`,this.onFiveModeChange),e.on(`interiaPan`,this.onFiveInertiaPan),e.on(`panoArrived`,this.onFivePanoArrived),e.on(`cameraUpdate`,this.onFiveCameraUpdate),e.on(`wantsPanGesture`,this.onFiveWantsPanGesture),e.on(`wantsTapGesture`,this.onFiveWantsTapGesture),e.on(`wantsChangeMode`,this.onFiveWantsChangeMode),e.on(`modelShownFloorChange`,this.onModelShownFloorChange)}removeEventListener(){this.hasAddedEventListener=!1;let e=this.five;e.off(`modeChange`,this.onFiveModeChange),e.off(`interiaPan`,this.onFiveInertiaPan),e.off(`panoArrived`,this.onFivePanoArrived),e.off(`cameraUpdate`,this.onFiveCameraUpdate),e.off(`wantsPanGesture`,this.onFiveWantsPanGesture),e.off(`wantsTapGesture`,this.onFiveWantsTapGesture),e.off(`wantsChangeMode`,this.onFiveWantsChangeMode),e.off(`modelShownFloorChange`,this.onModelShownFloorChange)}scheduleCameraUpdate(){this.pendingCameraUpdateFrame===void 0&&(this.pendingCameraUpdateFrame=requestAnimationFrame(()=>{this.pendingCameraUpdateFrame=void 0,this.updatePosition(),this.updateSize()}))}getRelativePose(e){let t=this.showState.longitude||0,n=((e.longitude-t)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);return{latitude:e.latitude,longitude:n}}_enable(e){this.styleSheet.disabled=!1,this.addEventListener(),this.wrapper&&(this.wrapper.appendChild(this.renderer.rootElement),this.registerExtraElement()),this.hooks.emit(`enable`,{userAction:e.userAction}),this.state.visible&&this._show({userAction:e.userAction})}_disable(e){var t,n;this.styleSheet.disabled=!0,(t=this.showRejection)==null||t.call(this,`BreakOffByDisable`),this.showPromise=void 0,this.renderer.rootElement.remove(),(n=this.removeExtraElement)==null||n.call(this),this.removeExtraElement=void 0,this.removeEventListener(),this.hooks.emit(`disable`,{userAction:e.userAction})}renderWithDuration(e){this.data&&this.renderer.render({visible:this.state.visible,duration:e,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}};exports.Controller=v;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import{__awaiter as e}from"../../node_modules/tslib/tslib.es6.mjs";import{BasePlugin as t}from"../BasePlugin/index.mjs";import n from"./utils/formatData.mjs";import r from"./utils/to.mjs";import{omit as i}from"./utils/filter.mjs";import{correctFiveState as a}from"./utils/correctFiveState.mjs";import{changeModelCanvasOpacity as o}from"./utils/changeModelCanvasOpacity.mjs";import{getAttachedY as s,getPxmm as c}from"./utils/getPxmm.mjs";import{waitFiveModelLoaded as l}from"./utils/fiveModelLoad.mjs";import{equal as u}from"./utils/equal.mjs";import{FloorplanRenderer as d}from"./render/index.mjs";import f from"./render/style.css_raw.mjs";import*as p from"three/webgpu";var m=500,h=.01;function g(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)>5*Math.PI/180,i=n>Math.PI/180*5&&n<Math.PI/180*355;return r||i}function _(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)<10*Math.PI/180,i=n<Math.PI/180*30||n>Math.PI/180*330;return r&&i}var v=class extends t.Controller{constructor(t,n){var s,c,u;super(t),this.name=`FloorplanPlugin`,this.renderer=new d,this.styleSheet=new CSSStyleSheet,this.panoIndex=0,this.floorIndex=0,this.lastPanoramaLongitude=0,this.size={width:0,height:0},this.hasAddedEventListener=!1,this.isHiddenByHideFunc=!1,this.highlightData={},this.store={roomOnMouse:null},this.dispose=()=>{var e,t;this.removeEventListener(),(e=this.resizeObserver)==null||e.disconnect(),(t=this.removeExtraElement)==null||t.call(this),this.removeExtraElement=void 0,this.pendingCameraUpdateFrame!==void 0&&cancelAnimationFrame(this.pendingCameraUpdateFrame),this.pendingResizeFrame!==void 0&&cancelAnimationFrame(this.pendingResizeFrame),this.renderer.dispose(),this.wrapper=void 0,this.data=void 0,this.hooks.emit(`dispose`)},this.show=(...t)=>e(this,[...t],void 0,function*(e={}){var t;if(!this.state.enabled||!this.showPromise&&this.state.visible)return;let n=(t=e.userAction)==null?!0:t;return this.updateState({visible:!0},n),this._show(e)}),this.hide=(...t)=>e(this,[...t],void 0,function*(e={}){var t;this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},(t=e.userAction)==null?!0:t),this._hide(e)))}),this.highlight=e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.renderCurrent())},this.unhighlight=()=>{this.highlightData={},this.renderCurrent()},this.updateShowState=e=>{this.showState=Object.assign(Object.assign({},this.showState),e)},this.onRoomHover=e=>{this.store.roomOnMouse=e},this.handleClick=()=>{if(this.state.visible&&this.hooks.emit(`click`,this.store.roomOnMouse))return!1},this.onFiveModelLoaded=()=>{var e,t,n;this.state.enabled!==!1&&(this.floorIndex=(n=(t=(e=this.five.work)==null?void 0:e.observers[this.panoIndex])==null?void 0:t.floorIndex)==null?0:n,this.renderCurrent())},this.onFiveModeChange=e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))},this.onFiveInertiaPan=(e,t)=>{t&&(this.state.visible||this.state.config.autoShowEnable!==!1&&(this.isHiddenByHideFunc||this.five.currentMode===this.showState.mode&&_(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))))},this.onFivePanoArrived=e=>{var t,n;this.five.work&&(this.panoIndex=e,this.floorIndex=(n=(t=this.five.work.observers[e])==null?void 0:t.floorIndex)==null?this.floorIndex:n)},this.onFiveCameraUpdate=(e,t)=>{this.state.visible&&(this.showPromise||(this.scheduleCameraUpdate(),g(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!1},t),this._hide({userAction:t}))))},this.onFiveWantsPanGesture=(e,t)=>{if(this.five.currentMode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&t&&this.state.visible)return this.five.updateCamera(i(this.showState,[`mode`,`offset`]),0),!1},this.onFiveWantsTapGesture=()=>this.handleClick(),this.onFiveWantsChangeMode=(e,t)=>{t===`Panorama`&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)},this.onModelShownFloorChange=e=>{var t,n,r;if(this.floorIndex!==e){if(e===null){this.floorIndex=(r=(n=(t=this.five.work)==null?void 0:t.observers[this.panoIndex])==null?void 0:n.floorIndex)==null?this.floorIndex:r;return}this.floorIndex=e,this.updateSize(),this.renderCurrent()}},this._show=t=>e(this,void 0,void 0,function*(){var n;if(!this.state.enabled)return;if(!((n=this.five.model)!=null&&n.loaded))throw Error(`ModelNotLoaded`);if(!this.data)throw Error(`DataNotLoaded`);if(this.showPromise)return this.showPromise;let i=Object.assign({floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},t),s=()=>e(this,void 0,void 0,function*(){var e;this.hooks.emit(`show`,{userAction:i.userAction,auto:i.isAutoShow});let t=!1,n;this.showRejection=e=>{t=!0,n=e};let[o]=yield r(a(this.five,this.showState,i.userAction));if(o)throw o;if(t)throw Error(n||`UnknownError`);if(!this.updateSize())throw Error(`UpdateSizeError`);this.updatePosition(),this.floorIndex=i.floorIndex,(e=this.five.model)==null||e.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=s().then(()=>{this.showPromise=void 0,this.showRejection=void 0;let e=i.immediately?0:m;o(this.five,i.modelOpacity,e),this.renderWithDuration(e),this.hooks.emit(`showAnimationEnded`,{auto:i.isAutoShow,userAction:i.userAction})}).catch(e=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},i.userAction),!i.isAutoShow)throw e}),this.showPromise}),this._hide=e=>{var t;(t=this.showRejection)==null||t.call(this,`BreakOffByHide`),this.showPromise=void 0;let n=Object.assign({userAction:!0,isAutoHide:!1},e);o(this.five,1,0),this.hooks.emit(`hide`,{auto:n.isAutoHide,userAction:n.userAction}),this.renderCurrent()},this.five=t,this.styleSheet.replaceSync(f),typeof document<`u`&&document.adoptedStyleSheets.push(this.styleSheet),this.showState=Object.assign({mode:`Mapview`,longitude:0,latitude:Math.PI/2,fov:80},n==null?void 0:n.showState);let p={northDesc:`北`,modelOpacity:h,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomNameOtherTypeEnable:!0,roomDimensionEnable:!0,cameraImageUrl:void 0,attachedTo:3,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:{imageWidth:200,imageHeight:120,text:`暂无平面图`,textFontSize:14},i18n:e=>e,getRoomAreaText:e=>(e/1e6).toFixed(1)+`㎡`,getRoomDimensionText:(e,t)=>(e/1e3).toFixed(1)+`m × `+(t/1e3).toFixed(1)+`m`,getRuleDistanceText:e=>e.toString()},v=Object.assign(Object.assign(Object.assign({},p),n==null?void 0:n.config),{missingFloorConfig:Object.assign(Object.assign({},p.missingFloorConfig),(s=n==null?void 0:n.config)==null?void 0:s.missingFloorConfig)});this.state={enabled:!0,visible:!1,config:v},Object.assign(this.state,i((c=n==null?void 0:n.initialState)==null?{}:c,[`config`])),this.panoIndex=(u=t.state.panoIndex)==null?0:u,this.initContainer(),l(t).then(this.onFiveModelLoaded),t.once(`dispose`,this.dispose),this.state.enabled?this.addEventListener():this.styleSheet.disabled=!0}load(t,r){return e(this,arguments,void 0,function*(e,t,r=!0){let i=`data`in e?e.data:e,a=this.data;this.data=yield n(i),this.hooks.emit(`dataLoaded`,this.data),this.hooks.emit(`dataChange`,this.data,a),t&&this.updateState(t,r),this.updateSize(),this.updatePosition(),this.renderCurrent()})}loadItems(e){this.data&&(this.data.floorDatas.forEach((t,n)=>{t.items=e[n]}),this.renderCurrent())}appendTo(e){this.wrapper=e,this.state.enabled&&(e.appendChild(this.renderer.rootElement),this.observeResize(e),this.registerExtraElement(),this.updateSize(),this.updatePosition(),this.renderCurrent())}enable(e={}){var t;if(this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e={}){var t;if(!this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}setState(e,t={}){var n;let r=this.state,i=(n=t.userAction)==null?!0:n;this.updateState(e,i),e.enabled!==void 0&&r.enabled!==e.enabled&&(e.enabled?this._enable({userAction:i}):this._disable({userAction:i})),e.visible!==void 0&&r.visible!==e.visible&&(e.visible?this._show({userAction:i}):this._hide({userAction:i}))}changeConfigs(e,t=!0){this.updateState({config:Object.assign(Object.assign({},this.state.config),e)},t),this.renderCurrent()}updateSize(){if(!this.data||!this.wrapper)return!1;let{min:e,max:t}=this.data.bounding,n=t.x-e.x,r=t.y-e.y,i=this.getPxmmWithRotation(),a=Math.ceil(n*i),o=Math.ceil(r*i);return this.size.width===a&&this.size.height===o?!0:(this.renderer.rootElement.style.width=a+`px`,this.renderer.rootElement.style.height=o+`px`,this.size={width:a,height:o},!0)}updatePosition(){if(!this.wrapper)return;let e=s(this.five,this.floorIndex,this.state.config.attachedTo),t=this.five.modelScene.boundingBox.getCenter(new p.Vector3);t.y=e;let n=t.clone().project(this.five.camera),r=(n.x+1)/2,i=-(n.y-1)/2;this.renderer.rootElement.style.position=`absolute`,this.renderer.rootElement.style.left=r*100+`%`,this.renderer.rootElement.style.top=i*100+`%`,this.renderer.rootElement.style.transform=`translate(-50%, -50%)`}getPxmmWithRotation(){if(!this.wrapper)return 0;let e={attachedTo:this.state.config.attachedTo};return c(this.five,this.wrapper,this.floorIndex,e)}updateState(e,t){let n=this.state,r=e.config?Object.assign(Object.assign({},n.config),e.config):n.config;this.state=Object.assign(Object.assign(Object.assign({},this.state),e),{config:r}),!u(this.state,n,{deep:!0})&&this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}initContainer(){this.renderer.rootElement.classList.add(`floorplan-plugin`)}registerExtraElement(){var e;(e=this.removeExtraElement)==null||e.call(this),this.removeExtraElement=this.five.addExtraElement(this.renderer.rootElement)}observeResize(e){var t;(t=this.resizeObserver)==null||t.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.scheduleResizeUpdate()}),this.resizeObserver.observe(e)}scheduleResizeUpdate(){this.pendingResizeFrame===void 0&&(this.pendingResizeFrame=requestAnimationFrame(()=>{this.pendingResizeFrame=void 0,this.updateSize(),this.updatePosition(),this.data&&this.renderer.updateLabelsVisibility(this.data,this.floorIndex,this.state.config.adaptiveRoomLabelVisibleEnable)}))}renderCurrent(){this.data&&this.renderer.render({visible:this.state.visible,duration:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;this.hasAddedEventListener=!0;let e=this.five;e.on(`modeChange`,this.onFiveModeChange),e.on(`interiaPan`,this.onFiveInertiaPan),e.on(`panoArrived`,this.onFivePanoArrived),e.on(`cameraUpdate`,this.onFiveCameraUpdate),e.on(`wantsPanGesture`,this.onFiveWantsPanGesture),e.on(`wantsTapGesture`,this.onFiveWantsTapGesture),e.on(`wantsChangeMode`,this.onFiveWantsChangeMode),e.on(`modelShownFloorChange`,this.onModelShownFloorChange)}removeEventListener(){this.hasAddedEventListener=!1;let e=this.five;e.off(`modeChange`,this.onFiveModeChange),e.off(`interiaPan`,this.onFiveInertiaPan),e.off(`panoArrived`,this.onFivePanoArrived),e.off(`cameraUpdate`,this.onFiveCameraUpdate),e.off(`wantsPanGesture`,this.onFiveWantsPanGesture),e.off(`wantsTapGesture`,this.onFiveWantsTapGesture),e.off(`wantsChangeMode`,this.onFiveWantsChangeMode),e.off(`modelShownFloorChange`,this.onModelShownFloorChange)}scheduleCameraUpdate(){this.pendingCameraUpdateFrame===void 0&&(this.pendingCameraUpdateFrame=requestAnimationFrame(()=>{this.pendingCameraUpdateFrame=void 0,this.updatePosition(),this.updateSize()}))}getRelativePose(e){let t=this.showState.longitude||0,n=((e.longitude-t)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);return{latitude:e.latitude,longitude:n}}_enable(e){this.styleSheet.disabled=!1,this.addEventListener(),this.wrapper&&(this.wrapper.appendChild(this.renderer.rootElement),this.registerExtraElement()),this.hooks.emit(`enable`,{userAction:e.userAction}),this.state.visible&&this._show({userAction:e.userAction})}_disable(e){var t,n;this.styleSheet.disabled=!0,(t=this.showRejection)==null||t.call(this,`BreakOffByDisable`),this.showPromise=void 0,this.renderer.rootElement.remove(),(n=this.removeExtraElement)==null||n.call(this),this.removeExtraElement=void 0,this.removeEventListener(),this.hooks.emit(`disable`,{userAction:e.userAction})}renderWithDuration(e){this.data&&this.renderer.render({visible:this.state.visible,duration:e,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}};export{v as Controller};
255
+ */import{BasePlugin as e}from"../BasePlugin/index.mjs";import t from"./utils/formatData.mjs";import n from"./utils/to.mjs";import{omit as r}from"./utils/filter.mjs";import{correctFiveState as i}from"./utils/correctFiveState.mjs";import{changeModelCanvasOpacity as a}from"./utils/changeModelCanvasOpacity.mjs";import{getAttachedY as o,getPxmm as s}from"./utils/getPxmm.mjs";import{waitFiveModelLoaded as c}from"./utils/fiveModelLoad.mjs";import{equal as l}from"./utils/equal.mjs";import{FloorplanRenderer as u}from"./render/index.mjs";import d from"./render/style.css_raw.mjs";import{__awaiter as f}from"tslib";import*as p from"three/webgpu";var m=500,h=.01;function g(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)>5*Math.PI/180,i=n>Math.PI/180*5&&n<Math.PI/180*355;return r||i}function _(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)<10*Math.PI/180,i=n<Math.PI/180*30||n>Math.PI/180*330;return r&&i}var v=class extends e.Controller{constructor(e,t){var o,s,l;super(e),this.name=`FloorplanPlugin`,this.renderer=new u,this.styleSheet=new CSSStyleSheet,this.panoIndex=0,this.floorIndex=0,this.lastPanoramaLongitude=0,this.size={width:0,height:0},this.hasAddedEventListener=!1,this.isHiddenByHideFunc=!1,this.highlightData={},this.store={roomOnMouse:null},this.dispose=()=>{var e,t;this.removeEventListener(),(e=this.resizeObserver)==null||e.disconnect(),(t=this.removeExtraElement)==null||t.call(this),this.removeExtraElement=void 0,this.pendingCameraUpdateFrame!==void 0&&cancelAnimationFrame(this.pendingCameraUpdateFrame),this.pendingResizeFrame!==void 0&&cancelAnimationFrame(this.pendingResizeFrame),this.renderer.dispose(),this.wrapper=void 0,this.data=void 0,this.hooks.emit(`dispose`)},this.show=(...e)=>f(this,[...e],void 0,function*(e={}){var t;if(!this.state.enabled||!this.showPromise&&this.state.visible)return;let n=(t=e.userAction)==null?!0:t;return this.updateState({visible:!0},n),this._show(e)}),this.hide=(...e)=>f(this,[...e],void 0,function*(e={}){var t;this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},(t=e.userAction)==null?!0:t),this._hide(e)))}),this.highlight=e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.renderCurrent())},this.unhighlight=()=>{this.highlightData={},this.renderCurrent()},this.updateShowState=e=>{this.showState=Object.assign(Object.assign({},this.showState),e)},this.onRoomHover=e=>{this.store.roomOnMouse=e},this.handleClick=()=>{if(this.state.visible&&this.hooks.emit(`click`,this.store.roomOnMouse))return!1},this.onFiveModelLoaded=()=>{var e,t,n;this.state.enabled!==!1&&(this.floorIndex=(n=(t=(e=this.five.work)==null?void 0:e.observers[this.panoIndex])==null?void 0:t.floorIndex)==null?0:n,this.renderCurrent())},this.onFiveModeChange=e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))},this.onFiveInertiaPan=(e,t)=>{t&&(this.state.visible||this.state.config.autoShowEnable!==!1&&(this.isHiddenByHideFunc||this.five.currentMode===this.showState.mode&&_(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))))},this.onFivePanoArrived=e=>{var t,n;this.five.work&&(this.panoIndex=e,this.floorIndex=(n=(t=this.five.work.observers[e])==null?void 0:t.floorIndex)==null?this.floorIndex:n)},this.onFiveCameraUpdate=(e,t)=>{this.state.visible&&(this.showPromise||(this.scheduleCameraUpdate(),g(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!1},t),this._hide({userAction:t}))))},this.onFiveWantsPanGesture=(e,t)=>{if(this.five.currentMode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&t&&this.state.visible)return this.five.updateCamera(r(this.showState,[`mode`,`offset`]),0),!1},this.onFiveWantsTapGesture=()=>this.handleClick(),this.onFiveWantsChangeMode=(e,t)=>{t===`Panorama`&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)},this.onModelShownFloorChange=e=>{var t,n,r;if(this.floorIndex!==e){if(e===null){this.floorIndex=(r=(n=(t=this.five.work)==null?void 0:t.observers[this.panoIndex])==null?void 0:n.floorIndex)==null?this.floorIndex:r;return}this.floorIndex=e,this.updateSize(),this.renderCurrent()}},this._show=e=>f(this,void 0,void 0,function*(){var t;if(!this.state.enabled)return;if(!((t=this.five.model)!=null&&t.loaded))throw Error(`ModelNotLoaded`);if(!this.data)throw Error(`DataNotLoaded`);if(this.showPromise)return this.showPromise;let r=Object.assign({floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},e),o=()=>f(this,void 0,void 0,function*(){var e;this.hooks.emit(`show`,{userAction:r.userAction,auto:r.isAutoShow});let t=!1,a;this.showRejection=e=>{t=!0,a=e};let[o]=yield n(i(this.five,this.showState,r.userAction));if(o)throw o;if(t)throw Error(a||`UnknownError`);if(!this.updateSize())throw Error(`UpdateSizeError`);this.updatePosition(),this.floorIndex=r.floorIndex,(e=this.five.model)==null||e.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;let e=r.immediately?0:m;a(this.five,r.modelOpacity,e),this.renderWithDuration(e),this.hooks.emit(`showAnimationEnded`,{auto:r.isAutoShow,userAction:r.userAction})}).catch(e=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},r.userAction),!r.isAutoShow)throw e}),this.showPromise}),this._hide=e=>{var t;(t=this.showRejection)==null||t.call(this,`BreakOffByHide`),this.showPromise=void 0;let n=Object.assign({userAction:!0,isAutoHide:!1},e);a(this.five,1,0),this.hooks.emit(`hide`,{auto:n.isAutoHide,userAction:n.userAction}),this.renderCurrent()},this.five=e,this.styleSheet.replaceSync(d),typeof document<`u`&&document.adoptedStyleSheets.push(this.styleSheet),this.showState=Object.assign({mode:`Mapview`,longitude:0,latitude:Math.PI/2,fov:80},t==null?void 0:t.showState);let p={northDesc:`北`,modelOpacity:h,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomNameOtherTypeEnable:!0,roomDimensionEnable:!0,cameraImageUrl:void 0,attachedTo:3,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:{imageWidth:200,imageHeight:120,text:`暂无平面图`,textFontSize:14},i18n:e=>e,getRoomAreaText:e=>(e/1e6).toFixed(1)+`㎡`,getRoomDimensionText:(e,t)=>(e/1e3).toFixed(1)+`m × `+(t/1e3).toFixed(1)+`m`,getRuleDistanceText:e=>e.toString()},v=Object.assign(Object.assign(Object.assign({},p),t==null?void 0:t.config),{missingFloorConfig:Object.assign(Object.assign({},p.missingFloorConfig),(o=t==null?void 0:t.config)==null?void 0:o.missingFloorConfig)});this.state={enabled:!0,visible:!1,config:v},Object.assign(this.state,r((s=t==null?void 0:t.initialState)==null?{}:s,[`config`])),this.panoIndex=(l=e.state.panoIndex)==null?0:l,this.initContainer(),c(e).then(this.onFiveModelLoaded),e.once(`dispose`,this.dispose),this.state.enabled?this.addEventListener():this.styleSheet.disabled=!0}load(e,n){return f(this,arguments,void 0,function*(e,n,r=!0){let i=`data`in e?e.data:e,a=this.data;this.data=yield t(i),this.hooks.emit(`dataLoaded`,this.data),this.hooks.emit(`dataChange`,this.data,a),n&&this.updateState(n,r),this.updateSize(),this.updatePosition(),this.renderCurrent()})}loadItems(e){this.data&&(this.data.floorDatas.forEach((t,n)=>{t.items=e[n]}),this.renderCurrent())}appendTo(e){this.wrapper=e,this.state.enabled&&(e.appendChild(this.renderer.rootElement),this.observeResize(e),this.registerExtraElement(),this.updateSize(),this.updatePosition(),this.renderCurrent())}enable(e={}){var t;if(this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e={}){var t;if(!this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}setState(e,t={}){var n;let r=this.state,i=(n=t.userAction)==null?!0:n;this.updateState(e,i),e.enabled!==void 0&&r.enabled!==e.enabled&&(e.enabled?this._enable({userAction:i}):this._disable({userAction:i})),e.visible!==void 0&&r.visible!==e.visible&&(e.visible?this._show({userAction:i}):this._hide({userAction:i}))}changeConfigs(e,t=!0){this.updateState({config:Object.assign(Object.assign({},this.state.config),e)},t),this.renderCurrent()}updateSize(){if(!this.data||!this.wrapper)return!1;let{min:e,max:t}=this.data.bounding,n=t.x-e.x,r=t.y-e.y,i=this.getPxmmWithRotation(),a=Math.ceil(n*i),o=Math.ceil(r*i);return this.size.width===a&&this.size.height===o?!0:(this.renderer.rootElement.style.width=a+`px`,this.renderer.rootElement.style.height=o+`px`,this.size={width:a,height:o},!0)}updatePosition(){if(!this.wrapper)return;let e=o(this.five,this.floorIndex,this.state.config.attachedTo),t=this.five.modelScene.boundingBox.getCenter(new p.Vector3);t.y=e;let n=t.clone().project(this.five.camera),r=(n.x+1)/2,i=-(n.y-1)/2;this.renderer.rootElement.style.position=`absolute`,this.renderer.rootElement.style.left=r*100+`%`,this.renderer.rootElement.style.top=i*100+`%`,this.renderer.rootElement.style.transform=`translate(-50%, -50%)`}getPxmmWithRotation(){if(!this.wrapper)return 0;let e={attachedTo:this.state.config.attachedTo};return s(this.five,this.wrapper,this.floorIndex,e)}updateState(e,t){let n=this.state,r=e.config?Object.assign(Object.assign({},n.config),e.config):n.config;this.state=Object.assign(Object.assign(Object.assign({},this.state),e),{config:r}),!l(this.state,n,{deep:!0})&&this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}initContainer(){this.renderer.rootElement.classList.add(`floorplan-plugin`)}registerExtraElement(){var e;(e=this.removeExtraElement)==null||e.call(this),this.removeExtraElement=this.five.addExtraElement(this.renderer.rootElement)}observeResize(e){var t;(t=this.resizeObserver)==null||t.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.scheduleResizeUpdate()}),this.resizeObserver.observe(e)}scheduleResizeUpdate(){this.pendingResizeFrame===void 0&&(this.pendingResizeFrame=requestAnimationFrame(()=>{this.pendingResizeFrame=void 0,this.updateSize(),this.updatePosition(),this.data&&this.renderer.updateLabelsVisibility(this.data,this.floorIndex,this.state.config.adaptiveRoomLabelVisibleEnable)}))}renderCurrent(){this.data&&this.renderer.render({visible:this.state.visible,duration:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;this.hasAddedEventListener=!0;let e=this.five;e.on(`modeChange`,this.onFiveModeChange),e.on(`interiaPan`,this.onFiveInertiaPan),e.on(`panoArrived`,this.onFivePanoArrived),e.on(`cameraUpdate`,this.onFiveCameraUpdate),e.on(`wantsPanGesture`,this.onFiveWantsPanGesture),e.on(`wantsTapGesture`,this.onFiveWantsTapGesture),e.on(`wantsChangeMode`,this.onFiveWantsChangeMode),e.on(`modelShownFloorChange`,this.onModelShownFloorChange)}removeEventListener(){this.hasAddedEventListener=!1;let e=this.five;e.off(`modeChange`,this.onFiveModeChange),e.off(`interiaPan`,this.onFiveInertiaPan),e.off(`panoArrived`,this.onFivePanoArrived),e.off(`cameraUpdate`,this.onFiveCameraUpdate),e.off(`wantsPanGesture`,this.onFiveWantsPanGesture),e.off(`wantsTapGesture`,this.onFiveWantsTapGesture),e.off(`wantsChangeMode`,this.onFiveWantsChangeMode),e.off(`modelShownFloorChange`,this.onModelShownFloorChange)}scheduleCameraUpdate(){this.pendingCameraUpdateFrame===void 0&&(this.pendingCameraUpdateFrame=requestAnimationFrame(()=>{this.pendingCameraUpdateFrame=void 0,this.updatePosition(),this.updateSize()}))}getRelativePose(e){let t=this.showState.longitude||0,n=((e.longitude-t)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);return{latitude:e.latitude,longitude:n}}_enable(e){this.styleSheet.disabled=!1,this.addEventListener(),this.wrapper&&(this.wrapper.appendChild(this.renderer.rootElement),this.registerExtraElement()),this.hooks.emit(`enable`,{userAction:e.userAction}),this.state.visible&&this._show({userAction:e.userAction})}_disable(e){var t,n;this.styleSheet.disabled=!0,(t=this.showRejection)==null||t.call(this,`BreakOffByDisable`),this.showPromise=void 0,this.renderer.rootElement.remove(),(n=this.removeExtraElement)==null||n.call(this),this.removeExtraElement=void 0,this.removeEventListener(),this.hooks.emit(`disable`,{userAction:e.userAction})}renderWithDuration(e){this.data&&this.renderer.render({visible:this.state.visible,duration:e,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}};export{v as Controller};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */const e=require("../../../node_modules/tslib/tslib.es6.js"),t=require("./nearlyEqual.js"),n=require("./to.js");function r(e){return Object.prototype.toString.call(e)===`[object Object]`&&!!e.isVector3}function i(e,n){return Object.keys(e).every(i=>{let a=n[i],o=e[i];return a===void 0||o===void 0?!0:i===`longitude`||i===`latitude`?t.nearlyEqualRad(a,o,2):typeof a==`number`&&typeof o==`number`?t.nearlyEqual(a,o,2):r(o)&&r(a)?o.distanceTo(a)<.01:a===o})}function a(t,r){return e.__awaiter(this,void 0,void 0,function*(){let[e]=yield n.default(t.changeMode(...r));if(e)throw Error(`change mode canceled`);yield new Promise(e=>{t.once(`initAnimationWillStart`,()=>{t.once(`initAnimationEnded`,()=>e())})});let a=r[1];if(a&&!i(a,t.getCurrentState()))throw Error(`pose 与预期不符`)})}exports.changeMode=a;
255
+ */const e=require("./nearlyEqual.js"),t=require("./to.js");let n=require("tslib");function r(e){return Object.prototype.toString.call(e)===`[object Object]`&&!!e.isVector3}function i(t,n){return Object.keys(t).every(i=>{let a=n[i],o=t[i];return a===void 0||o===void 0?!0:i===`longitude`||i===`latitude`?e.nearlyEqualRad(a,o,2):typeof a==`number`&&typeof o==`number`?e.nearlyEqual(a,o,2):r(o)&&r(a)?o.distanceTo(a)<.01:a===o})}function a(e,r){return(0,n.__awaiter)(this,void 0,void 0,function*(){let[n]=yield t.default(e.changeMode(...r));if(n)throw Error(`change mode canceled`);yield new Promise(t=>{e.once(`initAnimationWillStart`,()=>{e.once(`initAnimationEnded`,()=>t())})});let a=r[1];if(a&&!i(a,e.getCurrentState()))throw Error(`pose 与预期不符`)})}exports.changeMode=a;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import{__awaiter as e}from"../../../node_modules/tslib/tslib.es6.mjs";import{nearlyEqual as t,nearlyEqualRad as n}from"./nearlyEqual.mjs";import r from"./to.mjs";function i(e){return Object.prototype.toString.call(e)===`[object Object]`&&!!e.isVector3}function a(e,r){return Object.keys(e).every(a=>{let o=r[a],s=e[a];return o===void 0||s===void 0?!0:a===`longitude`||a===`latitude`?n(o,s,2):typeof o==`number`&&typeof s==`number`?t(o,s,2):i(s)&&i(o)?s.distanceTo(o)<.01:o===s})}function o(t,n){return e(this,void 0,void 0,function*(){let[e]=yield r(t.changeMode(...n));if(e)throw Error(`change mode canceled`);yield new Promise(e=>{t.once(`initAnimationWillStart`,()=>{t.once(`initAnimationEnded`,()=>e())})});let i=n[1];if(i&&!a(i,t.getCurrentState()))throw Error(`pose 与预期不符`)})}export{o as changeMode};
255
+ */import{nearlyEqual as e,nearlyEqualRad as t}from"./nearlyEqual.mjs";import n from"./to.mjs";import{__awaiter as r}from"tslib";function i(e){return Object.prototype.toString.call(e)===`[object Object]`&&!!e.isVector3}function a(n,r){return Object.keys(n).every(a=>{let o=r[a],s=n[a];return o===void 0||s===void 0?!0:a===`longitude`||a===`latitude`?t(o,s,2):typeof o==`number`&&typeof s==`number`?e(o,s,2):i(s)&&i(o)?s.distanceTo(o)<.01:o===s})}function o(e,t){return r(this,void 0,void 0,function*(){let[r]=yield n(e.changeMode(...t));if(r)throw Error(`change mode canceled`);yield new Promise(t=>{e.once(`initAnimationWillStart`,()=>{e.once(`initAnimationEnded`,()=>t())})});let i=t[1];if(i&&!a(i,e.getCurrentState()))throw Error(`pose 与预期不符`)})}export{o as changeMode};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */const e=require("../../../node_modules/tslib/tslib.es6.js"),t=require("./nearlyEqual.js"),n=require("./to.js"),r=require("./changeMode.js"),i=require("./getDistanceFromModel.js"),a=require("./filter.js");function o(e,n){if(e.currentMode!==n.mode)return!1;let r=e.getCurrentState(),i=e.camera.fov;return!(!t.nearlyEqual(r.latitude,n.latitude,2)||!t.nearlyEqual(r.longitude,n.longitude,2)||n.fov!==void 0&&!t.nearlyEqual(i,n.fov,2)||n.offset&&r.offset.distanceTo(n.offset)>.01)}function s(t,s){return e.__awaiter(this,arguments,void 0,function*(e,t,s=!0){var c;if(o(e,t))return;let l=e.getCurrentState();if(e.currentMode!==t.mode){let a=e.models.find(t=>t.name===e.state.workCode),o=typeof t.fov==`number`?t.fov:80;a&&(t.distance=i.getDistanceFromModel(e,o,e.camera.aspect));let[c]=yield n.default(r.changeMode(e,[t.mode,t,void 0,s]));if(c)throw c;return}let{latitude:u,longitude:d,fov:f}=l,p=(c=t.fov)==null?f:c,m=Math.min(1e3,Math.max(200,Math.abs(u-Math.PI/2)*1e3,(d>Math.PI?Math.PI*2-d:d)*500,Number.isFinite(p)?Math.abs(f-p)*10:1/0)),[h]=yield n.default(e.updateCamera(a.omit(t,[`mode`]),m,s));if(h)throw Error(`UpdateCameraError`)})}exports.correctFiveState=s;
255
+ */const e=require("./nearlyEqual.js"),t=require("./to.js"),n=require("./changeMode.js"),r=require("./getDistanceFromModel.js"),i=require("./filter.js");let a=require("tslib");function o(t,n){if(t.currentMode!==n.mode)return!1;let r=t.getCurrentState(),i=t.camera.fov;return!(!e.nearlyEqual(r.latitude,n.latitude,2)||!e.nearlyEqual(r.longitude,n.longitude,2)||n.fov!==void 0&&!e.nearlyEqual(i,n.fov,2)||n.offset&&r.offset.distanceTo(n.offset)>.01)}function s(e,s){return(0,a.__awaiter)(this,arguments,void 0,function*(e,a,s=!0){var c;if(o(e,a))return;let l=e.getCurrentState();if(e.currentMode!==a.mode){let i=e.models.find(t=>t.name===e.state.workCode),o=typeof a.fov==`number`?a.fov:80;i&&(a.distance=r.getDistanceFromModel(e,o,e.camera.aspect));let[c]=yield t.default(n.changeMode(e,[a.mode,a,void 0,s]));if(c)throw c;return}let{latitude:u,longitude:d,fov:f}=l,p=(c=a.fov)==null?f:c,m=Math.min(1e3,Math.max(200,Math.abs(u-Math.PI/2)*1e3,(d>Math.PI?Math.PI*2-d:d)*500,Number.isFinite(p)?Math.abs(f-p)*10:1/0)),[h]=yield t.default(e.updateCamera(i.omit(a,[`mode`]),m,s));if(h)throw Error(`UpdateCameraError`)})}exports.correctFiveState=s;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import{__awaiter as e}from"../../../node_modules/tslib/tslib.es6.mjs";import{nearlyEqual as t}from"./nearlyEqual.mjs";import n from"./to.mjs";import{changeMode as r}from"./changeMode.mjs";import{getDistanceFromModel as i}from"./getDistanceFromModel.mjs";import{omit as a}from"./filter.mjs";function o(e,n){if(e.currentMode!==n.mode)return!1;let r=e.getCurrentState(),i=e.camera.fov;return!(!t(r.latitude,n.latitude,2)||!t(r.longitude,n.longitude,2)||n.fov!==void 0&&!t(i,n.fov,2)||n.offset&&r.offset.distanceTo(n.offset)>.01)}function s(t,s){return e(this,arguments,void 0,function*(e,t,s=!0){var c;if(o(e,t))return;let l=e.getCurrentState();if(e.currentMode!==t.mode){let a=e.models.find(t=>t.name===e.state.workCode),o=typeof t.fov==`number`?t.fov:80;a&&(t.distance=i(e,o,e.camera.aspect));let[c]=yield n(r(e,[t.mode,t,void 0,s]));if(c)throw c;return}let{latitude:u,longitude:d,fov:f}=l,p=(c=t.fov)==null?f:c,m=Math.min(1e3,Math.max(200,Math.abs(u-Math.PI/2)*1e3,(d>Math.PI?Math.PI*2-d:d)*500,Number.isFinite(p)?Math.abs(f-p)*10:1/0)),[h]=yield n(e.updateCamera(a(t,[`mode`]),m,s));if(h)throw Error(`UpdateCameraError`)})}export{s as correctFiveState};
255
+ */import{nearlyEqual as e}from"./nearlyEqual.mjs";import t from"./to.mjs";import{changeMode as n}from"./changeMode.mjs";import{getDistanceFromModel as r}from"./getDistanceFromModel.mjs";import{omit as i}from"./filter.mjs";import{__awaiter as a}from"tslib";function o(t,n){if(t.currentMode!==n.mode)return!1;let r=t.getCurrentState(),i=t.camera.fov;return!(!e(r.latitude,n.latitude,2)||!e(r.longitude,n.longitude,2)||n.fov!==void 0&&!e(i,n.fov,2)||n.offset&&r.offset.distanceTo(n.offset)>.01)}function s(e,s){return a(this,arguments,void 0,function*(e,a,s=!0){var c;if(o(e,a))return;let l=e.getCurrentState();if(e.currentMode!==a.mode){let i=e.models.find(t=>t.name===e.state.workCode),o=typeof a.fov==`number`?a.fov:80;i&&(a.distance=r(e,o,e.camera.aspect));let[c]=yield t(n(e,[a.mode,a,void 0,s]));if(c)throw c;return}let{latitude:u,longitude:d,fov:f}=l,p=(c=a.fov)==null?f:c,m=Math.min(1e3,Math.max(200,Math.abs(u-Math.PI/2)*1e3,(d>Math.PI?Math.PI*2-d:d)*500,Number.isFinite(p)?Math.abs(f-p)*10:1/0)),[h]=yield t(e.updateCamera(i(a,[`mode`]),m,s));if(h)throw Error(`UpdateCameraError`)})}export{s as correctFiveState};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */const e=require("../../../node_modules/tslib/tslib.es6.js");function t(e){var t;return((t=e.models)==null?void 0:t.filter(t=>t.name===e.state.workCode)[0])||e.model}function n(e){var n;return!!((n=t(e))!=null&&n.loaded)}function r(r){return e.__awaiter(this,void 0,void 0,function*(){return new Promise(e=>{if(n(r)){e();return}let i=n=>{n===t(r)&&(r.off(`modelLoaded`,i),e())};r.on(`modelLoaded`,i)})})}exports.fiveModelIsLoaded=n,exports.getFiveModel=t,exports.waitFiveModelLoaded=r;
255
+ */let e=require("tslib");function t(e){var t;return((t=e.models)==null?void 0:t.filter(t=>t.name===e.state.workCode)[0])||e.model}function n(e){var n;return!!((n=t(e))!=null&&n.loaded)}function r(r){return(0,e.__awaiter)(this,void 0,void 0,function*(){return new Promise(e=>{if(n(r)){e();return}let i=n=>{n===t(r)&&(r.off(`modelLoaded`,i),e())};r.on(`modelLoaded`,i)})})}exports.fiveModelIsLoaded=n,exports.getFiveModel=t,exports.waitFiveModelLoaded=r;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import{__awaiter as e}from"../../../node_modules/tslib/tslib.es6.mjs";function t(e){var t;return((t=e.models)==null?void 0:t.filter(t=>t.name===e.state.workCode)[0])||e.model}function n(e){var n;return!!((n=t(e))!=null&&n.loaded)}function r(r){return e(this,void 0,void 0,function*(){return new Promise(e=>{if(n(r)){e();return}let i=n=>{n===t(r)&&(r.off(`modelLoaded`,i),e())};r.on(`modelLoaded`,i)})})}export{n as fiveModelIsLoaded,t as getFiveModel,r as waitFiveModelLoaded};
255
+ */import{__awaiter as e}from"tslib";function t(e){var t;return((t=e.models)==null?void 0:t.filter(t=>t.name===e.state.workCode)[0])||e.model}function n(e){var n;return!!((n=t(e))!=null&&n.loaded)}function r(r){return e(this,void 0,void 0,function*(){return new Promise(e=>{if(n(r)){e();return}let i=n=>{n===t(r)&&(r.off(`modelLoaded`,i),e())};r.on(`modelLoaded`,i)})})}export{n as fiveModelIsLoaded,t as getFiveModel,r as waitFiveModelLoaded};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */const e=require("../../../node_modules/tslib/tslib.es6.js");function t(t){return e.__awaiter(this,void 0,void 0,function*(){return Promise.all(t.map(t=>e.__awaiter(this,void 0,void 0,function*(){if(!t.svg_url)return{url:t.url,index:t.index};let e=yield fetch(t.svg_url).then(e=>e.text()).catch(()=>void 0);return{url:t.url,index:t.index,svgUrl:t.svg_url,svgContent:e}})))})}function n(t){let{room_type:n,floor_type:r,room_label:i,observer_indexs:a,customized_name:o,dimension:s}=t,c=e.__rest(t,[`room_type`,`floor_type`,`room_label`,`observer_indexs`,`customized_name`,`dimension`]);return Object.assign(Object.assign({},c),{roomType:n,floorType:r,roomLabel:{position:i.position,positionInImage:i.position_in_image},observerIndexs:a,customizedName:o,dimension:s?{width:s.width,height:s.height,vertical:s.vertical,horizontal:s.horizontal}:void 0})}function r(t){let{floor_name:r,floor_index:i,rooms:a}=t,o=e.__rest(t,[`floor_name`,`floor_index`,`rooms`]);return Object.assign(Object.assign({},o),{floorName:r,floorIndex:i,rooms:a.map(n)})}function i(e){return{floorIndex:e.floor_index,positionInImage:e.position_in_image}}function a(e){return{positionInImage:e.position_in_image,northRad:e.north_rad,roomId:e.room_id,floorIndex:e.floor_index}}function o(n){return e.__awaiter(this,void 0,void 0,function*(){var e,o;let{computed_data:s}=n;return{outlines:yield t((e=n.outlines)==null?[]:e),bounding:s.bounding,floorDatas:s.floor_datas.map(r),entrance:s.entrance?a(s.entrance):null,observers:((o=s.observers)==null?[]:o).map(i)}})}exports.default=o,exports.formatData=o;
255
+ */let e=require("tslib");function t(t){return(0,e.__awaiter)(this,void 0,void 0,function*(){return Promise.all(t.map(t=>(0,e.__awaiter)(this,void 0,void 0,function*(){if(!t.svg_url)return{url:t.url,index:t.index};let e=yield fetch(t.svg_url).then(e=>e.text()).catch(()=>void 0);return{url:t.url,index:t.index,svgUrl:t.svg_url,svgContent:e}})))})}function n(t){let{room_type:n,floor_type:r,room_label:i,observer_indexs:a,customized_name:o,dimension:s}=t,c=(0,e.__rest)(t,[`room_type`,`floor_type`,`room_label`,`observer_indexs`,`customized_name`,`dimension`]);return Object.assign(Object.assign({},c),{roomType:n,floorType:r,roomLabel:{position:i.position,positionInImage:i.position_in_image},observerIndexs:a,customizedName:o,dimension:s?{width:s.width,height:s.height,vertical:s.vertical,horizontal:s.horizontal}:void 0})}function r(t){let{floor_name:r,floor_index:i,rooms:a}=t,o=(0,e.__rest)(t,[`floor_name`,`floor_index`,`rooms`]);return Object.assign(Object.assign({},o),{floorName:r,floorIndex:i,rooms:a.map(n)})}function i(e){return{floorIndex:e.floor_index,positionInImage:e.position_in_image}}function a(e){return{positionInImage:e.position_in_image,northRad:e.north_rad,roomId:e.room_id,floorIndex:e.floor_index}}function o(n){return(0,e.__awaiter)(this,void 0,void 0,function*(){var e,o;let{computed_data:s}=n;return{outlines:yield t((e=n.outlines)==null?[]:e),bounding:s.bounding,floorDatas:s.floor_datas.map(r),entrance:s.entrance?a(s.entrance):null,observers:((o=s.observers)==null?[]:o).map(i)}})}exports.default=o,exports.formatData=o;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import{__awaiter as e,__rest as t}from"../../../node_modules/tslib/tslib.es6.mjs";function n(t){return e(this,void 0,void 0,function*(){return Promise.all(t.map(t=>e(this,void 0,void 0,function*(){if(!t.svg_url)return{url:t.url,index:t.index};let e=yield fetch(t.svg_url).then(e=>e.text()).catch(()=>void 0);return{url:t.url,index:t.index,svgUrl:t.svg_url,svgContent:e}})))})}function r(e){let{room_type:n,floor_type:r,room_label:i,observer_indexs:a,customized_name:o,dimension:s}=e,c=t(e,[`room_type`,`floor_type`,`room_label`,`observer_indexs`,`customized_name`,`dimension`]);return Object.assign(Object.assign({},c),{roomType:n,floorType:r,roomLabel:{position:i.position,positionInImage:i.position_in_image},observerIndexs:a,customizedName:o,dimension:s?{width:s.width,height:s.height,vertical:s.vertical,horizontal:s.horizontal}:void 0})}function i(e){let{floor_name:n,floor_index:i,rooms:a}=e,o=t(e,[`floor_name`,`floor_index`,`rooms`]);return Object.assign(Object.assign({},o),{floorName:n,floorIndex:i,rooms:a.map(r)})}function a(e){return{floorIndex:e.floor_index,positionInImage:e.position_in_image}}function o(e){return{positionInImage:e.position_in_image,northRad:e.north_rad,roomId:e.room_id,floorIndex:e.floor_index}}function s(t){return e(this,void 0,void 0,function*(){var e,r;let{computed_data:s}=t;return{outlines:yield n((e=t.outlines)==null?[]:e),bounding:s.bounding,floorDatas:s.floor_datas.map(i),entrance:s.entrance?o(s.entrance):null,observers:((r=s.observers)==null?[]:r).map(a)}})}export{s as default,s as formatData};
255
+ */import{__awaiter as e,__rest as t}from"tslib";function n(t){return e(this,void 0,void 0,function*(){return Promise.all(t.map(t=>e(this,void 0,void 0,function*(){if(!t.svg_url)return{url:t.url,index:t.index};let e=yield fetch(t.svg_url).then(e=>e.text()).catch(()=>void 0);return{url:t.url,index:t.index,svgUrl:t.svg_url,svgContent:e}})))})}function r(e){let{room_type:n,floor_type:r,room_label:i,observer_indexs:a,customized_name:o,dimension:s}=e,c=t(e,[`room_type`,`floor_type`,`room_label`,`observer_indexs`,`customized_name`,`dimension`]);return Object.assign(Object.assign({},c),{roomType:n,floorType:r,roomLabel:{position:i.position,positionInImage:i.position_in_image},observerIndexs:a,customizedName:o,dimension:s?{width:s.width,height:s.height,vertical:s.vertical,horizontal:s.horizontal}:void 0})}function i(e){let{floor_name:n,floor_index:i,rooms:a}=e,o=t(e,[`floor_name`,`floor_index`,`rooms`]);return Object.assign(Object.assign({},o),{floorName:n,floorIndex:i,rooms:a.map(r)})}function a(e){return{floorIndex:e.floor_index,positionInImage:e.position_in_image}}function o(e){return{positionInImage:e.position_in_image,northRad:e.north_rad,roomId:e.room_id,floorIndex:e.floor_index}}function s(t){return e(this,void 0,void 0,function*(){var e,r;let{computed_data:s}=t;return{outlines:yield n((e=t.outlines)==null?[]:e),bounding:s.bounding,floorDatas:s.floor_datas.map(i),entrance:s.entrance?o(s.entrance):null,observers:((r=s.observers)==null?[]:r).map(a)}})}export{s as default,s as formatData};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five-webgpu
4
- * Generated: 10/26/2026
5
- * Version: 1.0.0-alpha.10
4
+ * Generated: 10/27/2026
5
+ * Version: 1.0.0-alpha.11
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021