@realsee/dnalogel 2.0.0-alpha.18 → 2.0.0-alpha.20

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 (177) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/index.js +3 -28
  6. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  7. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  8. package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
  9. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  10. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  11. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  13. package/dist/ModelTVVideoPlugin/index.js +3 -28
  14. package/dist/PanoCompassPlugin/index.js +53 -86
  15. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  16. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  17. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  19. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  21. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  22. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  23. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  25. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  27. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  28. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  33. package/dist/PanoMeasurePlugin/index.js +2 -0
  34. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  35. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  36. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  37. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  38. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  41. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  42. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  43. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  44. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  45. package/dist/PanoRulerPlugin/index.js +3 -28
  46. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  47. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  48. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  49. package/dist/floorplan/ModelFloorplanPlugin/index.js +1253 -1284
  50. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +61 -183
  51. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  52. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  53. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1243 -1235
  54. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  55. package/dist/index.es.js +1431 -1435
  56. package/dist/index.js +1430 -1434
  57. package/dist/index.umd.js +1430 -1434
  58. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  59. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  60. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  61. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  62. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  63. package/docs/assets/search.js +1 -1
  64. package/docs/classes/ModelRoomLabelController.html +6 -6
  65. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  66. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  67. package/docs/interfaces/LineJson.html +1 -1
  68. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  69. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  70. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  71. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  72. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  73. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  74. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  75. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  76. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  77. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  78. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  80. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  81. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  82. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  83. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  84. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  85. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  86. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  87. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  89. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  90. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  91. package/docs/interfaces/PointJson.html +1 -1
  92. package/docs/interfaces/RoomLabel.html +7 -7
  93. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  94. package/docs/modules.html +12 -12
  95. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  96. package/libs/CameraMovementPlugin/index.js +15 -24
  97. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  98. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  99. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  100. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  101. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  102. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  103. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  104. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  105. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  106. package/libs/ModelTVVideoPlugin/index.js +3 -12
  107. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  108. package/libs/PanoCompassPlugin/index.js +49 -64
  109. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  110. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  111. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  112. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  113. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  114. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  115. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  116. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  117. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  118. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  119. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  120. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  121. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  122. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  123. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  124. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  125. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  126. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +2 -0
  128. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  130. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  133. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  135. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  136. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  138. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  139. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  140. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  141. package/libs/PanoRulerPlugin/index.js +3 -12
  142. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  143. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  144. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  145. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  146. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  149. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  150. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  152. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  153. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  154. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  156. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  157. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  158. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  159. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  160. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  161. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  162. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  163. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  164. package/libs/floorplan/utils/formatData.js +28 -43
  165. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  166. package/libs/floorplan/utils/formatPosition.js +2 -2
  167. package/libs/shared-utils/five/changeMode.js +12 -23
  168. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  169. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  170. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  171. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  172. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  173. package/libs/shared-utils/three/loadTexture.js +6 -17
  174. package/libs/shared-utils/to.js +10 -21
  175. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  176. package/package.json +2 -2
  177. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
package/dist/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as THREE from 'three';
2
- import { Vector3, Scene, Group, Raycaster, Vector2, MeshBasicMaterial, CanvasTexture, AnimationMixer, Color, TextureLoader, PlaneGeometry, sRGBEncoding, Mesh, CurvePath, LineCurve3, TubeGeometry, DoubleSide, SphereGeometry } from 'three';
2
+ import { Vector3, Scene, Group, Raycaster, MeshBasicMaterial, CanvasTexture, AnimationMixer, Vector2, Color, TextureLoader, PlaneGeometry, sRGBEncoding, Mesh, CurvePath, LineCurve3, TubeGeometry, DoubleSide, SphereGeometry } from 'three';
3
3
  import { CSS3DRenderer, CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
4
4
  import { Line as Line$1 } from '@realsee/five/line';
5
- import { SvelteComponent, init, safe_not_equal, append_styles, element, text, space, attr, set_style, toggle_class, insert, append, listen, set_data, noop, detach, empty, create_component, mount_component, transition_in, transition_out, destroy_component, add_render_callback, add_resize_listener, group_outros, update_keyed_each, outro_and_destroy_block, check_outros, HtmlTag, get_spread_update, assign, destroy_block, src_url_equal, svg_element, destroy_each, binding_callbacks, create_in_transition, null_to_empty } from 'svelte/internal';
5
+ import { SvelteComponent, init, safe_not_equal, append_styles, element, text, space, attr, set_style, toggle_class, insert, append, listen, set_data, noop, detach, empty, create_component, mount_component, transition_in, transition_out, destroy_component, add_render_callback, add_resize_listener, group_outros, update_keyed_each, outro_and_destroy_block, check_outros, src_url_equal, HtmlTag, get_spread_update, assign, destroy_block, destroy_each, svg_element, null_to_empty, create_in_transition, binding_callbacks } from 'svelte/internal';
6
6
  import { onDestroy, onMount, afterUpdate, beforeUpdate } from 'svelte';
7
7
  import { linear } from 'svelte/easing';
8
8
  import { fade } from 'svelte/transition';
@@ -462,7 +462,7 @@ const ROOM_LABEL_BG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAY
462
462
 
463
463
  /* src/ModelRoomLabelPlugin/RoomLabelItem.svelte generated by Svelte v3.47.0 */
464
464
 
465
- function add_css$l(target) {
465
+ function add_css$m(target) {
466
466
  append_styles(target, "svelte-1ak9fbs", ".room-label-item.svelte-1ak9fbs{position:absolute;font-size:0.41667rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.room-label-item__text.svelte-1ak9fbs{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1ak9fbs{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1ak9fbs{font-size:0.52083rem}");
467
467
  }
468
468
 
@@ -556,24 +556,24 @@ function instance$q($$self, $$props, $$invalidate) {
556
556
  class RoomLabelItem extends SvelteComponent {
557
557
  constructor(options) {
558
558
  super();
559
- init(this, options, instance$q, create_fragment$q, safe_not_equal, { five: 2, roomLabel: 0 }, add_css$l);
559
+ init(this, options, instance$q, create_fragment$q, safe_not_equal, { five: 2, roomLabel: 0 }, add_css$m);
560
560
  }
561
561
  }
562
562
 
563
563
  /* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
564
564
 
565
- function add_css$k(target) {
565
+ function add_css$l(target) {
566
566
  append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
567
567
  }
568
568
 
569
- function get_each_context$8(ctx, list, i) {
569
+ function get_each_context$9(ctx, list, i) {
570
570
  const child_ctx = ctx.slice();
571
571
  child_ctx[9] = list[i];
572
572
  return child_ctx;
573
573
  }
574
574
 
575
575
  // (70:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
576
- function create_each_block$8(key_1, ctx) {
576
+ function create_each_block$9(key_1, ctx) {
577
577
  let first;
578
578
  let roomlabelitem;
579
579
  let current;
@@ -631,9 +631,9 @@ function create_fragment$p(ctx) {
631
631
  const get_key = ctx => /*roomLableItem*/ ctx[9].id;
632
632
 
633
633
  for (let i = 0; i < each_value.length; i += 1) {
634
- let child_ctx = get_each_context$8(ctx, each_value, i);
634
+ let child_ctx = get_each_context$9(ctx, each_value, i);
635
635
  let key = get_key(child_ctx);
636
- each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
636
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$9(key, child_ctx));
637
637
  }
638
638
 
639
639
  return {
@@ -661,7 +661,7 @@ function create_fragment$p(ctx) {
661
661
  if (dirty & /*roomLabels, five*/ 3) {
662
662
  each_value = /*roomLabels*/ ctx[0];
663
663
  group_outros();
664
- each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block$8, null, get_each_context$8);
664
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block$9, null, get_each_context$9);
665
665
  check_outros();
666
666
  }
667
667
  },
@@ -784,7 +784,7 @@ function instance$p($$self, $$props, $$invalidate) {
784
784
  class RoomLabelItems extends SvelteComponent {
785
785
  constructor(options) {
786
786
  super();
787
- init(this, options, instance$p, create_fragment$p, safe_not_equal, { five: 1, roomLabels: 0 }, add_css$k);
787
+ init(this, options, instance$p, create_fragment$p, safe_not_equal, { five: 1, roomLabels: 0 }, add_css$l);
788
788
  }
789
789
  }
790
790
 
@@ -955,37 +955,11 @@ var FLOOR_PLAN_ATTACHED_TO;
955
955
  FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
956
956
  })(FLOOR_PLAN_ATTACHED_TO || (FLOOR_PLAN_ATTACHED_TO = {}));
957
957
 
958
- /*! *****************************************************************************
959
- Copyright (c) Microsoft Corporation.
960
-
961
- Permission to use, copy, modify, and/or distribute this software for any
962
- purpose with or without fee is hereby granted.
963
-
964
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
965
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
966
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
967
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
968
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
969
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
970
- PERFORMANCE OF THIS SOFTWARE.
971
- ***************************************************************************** */
972
-
973
- function __awaiter(thisArg, _arguments, P, generator) {
974
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
975
- return new (P || (P = Promise))(function (resolve, reject) {
976
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
977
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
978
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
979
- step((generator = generator.apply(thisArg, _arguments || [])).next());
980
- });
981
- }
982
-
983
958
  const pluginStyle$1 = {
984
959
  position: 'absolute',
985
960
  left: '50%',
986
961
  top: '50%',
987
962
  transform: 'translate(-50%, -50%)',
988
- pointerEvents: 'none',
989
963
  zIndex: '10',
990
964
  };
991
965
 
@@ -1012,9 +986,9 @@ function pathD(points, options = {}) {
1012
986
  return d + (needZ ? 'Z' : '');
1013
987
  }
1014
988
  /** 把户型图上点点位转换到 SVG 上的点位 */
1015
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
989
+ function formatFloorplanPoint({ x, y }, bounding) {
1016
990
  const { max, min } = bounding;
1017
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
991
+ return { x: x - min.x, y: max.y - y };
1018
992
  }
1019
993
  /** 模型坐标转户型图坐标 */
1020
994
  function modelPosition2FloorplanPosition(position, floorplanData) {
@@ -1042,26 +1016,22 @@ function getFloorIndexFromModelPosition(position, five) {
1042
1016
  return floorIndex;
1043
1017
  }
1044
1018
 
1045
- function formatOutlines(outlines) {
1046
- return __awaiter(this, void 0, void 0, function* () {
1047
- const headers = new Headers({ 'Content-Type': 'text/plain' });
1048
- const getOutlineItem = function (item) {
1049
- return __awaiter(this, void 0, void 0, function* () {
1050
- const outlineItem = {
1051
- index: item.index,
1052
- url: item.url,
1053
- svgUrl: item.svg_url,
1054
- };
1055
- if (item.svg_url) {
1056
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
1057
- outlineItem.svgContent = svgContent;
1058
- }
1059
- return outlineItem;
1060
- });
1019
+ async function formatOutlines(outlines) {
1020
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
1021
+ const getOutlineItem = async function (item) {
1022
+ const outlineItem = {
1023
+ index: item.index,
1024
+ url: item.url,
1025
+ svgUrl: item.svg_url,
1061
1026
  };
1062
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
1063
- return svgOutlineItems;
1064
- });
1027
+ if (item.svg_url) {
1028
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
1029
+ outlineItem.svgContent = svgContent;
1030
+ }
1031
+ return outlineItem;
1032
+ };
1033
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
1034
+ return svgOutlineItems;
1065
1035
  }
1066
1036
  function formatRoom(data) {
1067
1037
  const floorplanRoomItem = {
@@ -1107,21 +1077,19 @@ function formatFloorplanEntrance(data) {
1107
1077
  };
1108
1078
  return floorplanEntrance;
1109
1079
  }
1110
- function formatData(data) {
1111
- return __awaiter(this, void 0, void 0, function* () {
1112
- const outlines = yield formatOutlines(data.outlines);
1113
- const bounding = data.computed_data.bounding;
1114
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1115
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1116
- const floorplanData = {
1117
- outlines,
1118
- entrance,
1119
- bounding,
1120
- floorDatas,
1121
- observers: data.computed_data.observers.map(formateFloorplanObserver),
1122
- };
1123
- return floorplanData;
1124
- });
1080
+ async function formatData(data) {
1081
+ const outlines = await formatOutlines(data.outlines);
1082
+ const bounding = data.computed_data.bounding;
1083
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1084
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1085
+ const floorplanData = {
1086
+ outlines,
1087
+ entrance,
1088
+ bounding,
1089
+ floorDatas,
1090
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
1091
+ };
1092
+ return floorplanData;
1125
1093
  }
1126
1094
  function formatExtraObjects(data, five, floorplanData) {
1127
1095
  const extraObjects = data.map((object) => {
@@ -1141,35 +1109,6 @@ function formatExtraObjects(data, five, floorplanData) {
1141
1109
  return extraObjects;
1142
1110
  }
1143
1111
 
1144
- /**
1145
- * 把第一个参数传入第二个参数(函数)中并执行
1146
- * 一般用于执行函数后返回变量。
1147
- * @param {any} something
1148
- * @param {function} callback
1149
- * @return {any}
1150
- */
1151
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1152
- function tap(something, callback) {
1153
- callback(something);
1154
- return something;
1155
- }
1156
-
1157
- /**
1158
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1159
- * @param object
1160
- * @param props 排除的属性
1161
- * @return
1162
- */
1163
- function omit(object, props) {
1164
- return tap({}, (result) => {
1165
- for (const name in object) {
1166
- if (props.indexOf(name) !== -1)
1167
- continue;
1168
- result[name] = object[name];
1169
- }
1170
- });
1171
- }
1172
-
1173
1112
  /**
1174
1113
  * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
1175
1114
  * @param five five
@@ -1203,15 +1142,44 @@ function getPxmm(five, container, floorIndex, options) {
1203
1142
  return pxmm;
1204
1143
  }
1205
1144
 
1145
+ /**
1146
+ * 把第一个参数传入第二个参数(函数)中并执行
1147
+ * 一般用于执行函数后返回变量。
1148
+ * @param {any} something
1149
+ * @param {function} callback
1150
+ * @return {any}
1151
+ */
1152
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1153
+ function tap(something, callback) {
1154
+ callback(something);
1155
+ return something;
1156
+ }
1157
+
1158
+ /**
1159
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1160
+ * @param object
1161
+ * @param props 排除的属性
1162
+ * @return
1163
+ */
1164
+ function omit(object, props) {
1165
+ return tap({}, (result) => {
1166
+ for (const name in object) {
1167
+ if (props.indexOf(name) !== -1)
1168
+ continue;
1169
+ result[name] = object[name];
1170
+ }
1171
+ });
1172
+ }
1173
+
1206
1174
  const CAMERA_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+Jq/+VvP+Vuv/c4v+Fnf+btP+InP+Blf/3+P6Txf+Jzf+Jyf+NxP+Qwf/t8/6Svv+Tvf/O1f7Czv3T2f6cu/+qvP7a4fvo7v77/v/o9//p9//0+v////+Vy//w9//k8/+B1f/v9/+D0/+UyP/u9v+D0v/i8f+F0v/g7/+G0P+KzP+Hz/////+Lx//s8/+Puf/h7P+Mxv/w9f7q8v/q8f2RwP/r8f6JrP/t8v6RvP/l6f7////j6P6VvP/f5/7q8P7a4P/U2f6au/+ZuP+ewf+auP+iu//n6f2Fn//j6P/h4fn9/v/4/P/3/P/o9v/l9P+F1P+B1f/i8v+UyP+J0f+E0f/h7//r8v6Izf/g7v/q8v6Pv//f7P7f7f/g7f+Lxf+MyP+Mw//k7v6Ow/+Ov//v8/2Pu//t8f+Tvv/p8P6Uu//q7v/i6P2Xvf+WuP/L1vypu//Azv7K0/zy8v/l8v/A4P/o9f/x+f+I0f/j8v+J0P/s9v/h8P+I0P/t9v/r9P6Lyv+Lyf/s9P/g7P+Myv/s8/7j7v+Jrv/q8P2Uwf+Epf+TuP/a3vzh5f3w8P/a4P20v//Nzfzx8f/Pz/Cg0P/f7//u9f/q8v7o8v7s8/7s8v3w9f+Sv/+TuP+Gp//s8fr///8/HFXHAAAA8nRSTlMANUQ/Z2JJXXaKTjCPmVMre3E6gFiylLxsxoVYnk5JwaOFU8utOjrV0KieQS2icWwzMC4Dt7aTQvjfrHprXD0zMyvpvUxGNjH+2sK9raeYkoiAcF5TUi0rKCYY2cy3pIJ/eGpEQDcxLx0S/Pv19PPu7Ovr5+Tk4eDe3NXU09DIsq2opKCViYN9e3V1cmZlXllVTk1GQDs2NTMwJw0K/vn28u/u5+Pj3tjNycjGw8DAua2pqJ6SjYyMf3BvaWNgWk5NSTc3MxT79PHw6efl2trY19PHurWysqWZe2xkXVlUPjo6OSskCO7Qzs6+vKCedmhdN1av0hoAAAV1SURBVEjHjZT3P9RxHMe1nCjcObo4cjpX5w53l7pUbnBGkr2TPZJKmiqVEQlJhGjvvfcm2nvvvXf5C3q/P98bkuR1D7+9n16v1/vzvtPrnAade/ty6anHJfFHOjkfXbe07PGxkuL4oqIjCzoDjHtxurzsRHmFStokjBDG/59JrwurOF2hkkUoIyKEQmFqatG3/xDnXlSGPZcKI5VKiVgsli+vrakpfNAx8UoVlpRWH6mUeMsVcm8vhah6WfXB3A6IlSlVKoE4KjxcgtNGRl1Ayzw9H+Z20DypMVkZZWKiUIi6oHj2PAbPs6Eh/+6/kBUpVUliIEQKGGcwGPbdiBpCQ/O//AMZJ218XW9igoHsGTwY7kopdMmSvTvbz/VGmiyhCARwWJ/Ss5CQ9pl3zVJZJCEwEszb6BtaGxrCn3XIyZP3trW3rybBWTCB1jy0sNGHeWM7+BgzrX4kJu752E57mWA5mIjsMRVxgGkrJpPpRvtJSywt3X2rPUSMuUgqIIzx37vRaLQeqNKEhN03/womg/bYhDJBBzdqvjsqYeHCHdfa1k9BF0QoEyuwoOadWc4sFutoXNzWGW2W3Axd8E3AxAZ6WNGeEoDl7EwPho/T0cDAtswb2Bi6kFx2VkwaDYgRI5zo9EUGRIGHD82e+ufrJ8uo+l31oQogYMJiOdFh2BQ03NTscEDAn8wKgQCeUsRTI8QEMhkYDDc1NTMLMuNwLAP8/a9Pbl0mJQlXhvVtrO2YNLce3Uew6IvAAsYtLS17gvwLCrKR0d3la0DsgdG3NiZVMBZacMh8L9CB2NjsS61eRiCtB4YH/Q21CMQKAgLnh1hYWAyJ3b9/40Qd09woppJhFytAnIPpBmBCCBjvjdrn59eKSU+SRWkZphu40IMBgRpAAMBmO7DZbL/786+s0TIpKqXOhgqGCKcnhOrd28HBlmj+2LFZWia9KjkqnHoa3BmsjG7wKIgDuSzQw9F29Gh+3jDunTseWas1zKtKYbiIsrEjZdAF2iPiYOvIz+Nyuebm5h6+HuvGa2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==';
1207
1175
 
1208
1176
  function rad2Deg$1(rad) {
1209
1177
  return (rad * 180) / Math.PI;
1210
1178
  }
1211
1179
 
1212
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
1180
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
1213
1181
 
1214
- function add_css$j(target) {
1182
+ function add_css$k(target) {
1215
1183
  append_styles(target, "svelte-17cl35n", ".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}");
1216
1184
  }
1217
1185
 
@@ -1307,16 +1275,16 @@ class Camera$1 extends SvelteComponent {
1307
1275
  lastPanoramaLongitude: 7,
1308
1276
  cameraImageUrl: 0
1309
1277
  },
1310
- add_css$j
1278
+ add_css$k
1311
1279
  );
1312
1280
  }
1313
1281
  }
1314
1282
 
1315
1283
  const COMPASS_IMAGE = 'data:image/png;base64,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';
1316
1284
 
1317
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
1285
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
1318
1286
 
1319
- function add_css$i(target) {
1287
+ function add_css$j(target) {
1320
1288
  append_styles(target, "svelte-1q44ru9", ".floorplan-plugin__compass.svelte-1q44ru9{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-1q44ru9{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-1q44ru9{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}");
1321
1289
  }
1322
1290
 
@@ -1409,345 +1377,271 @@ function instance$n($$self, $$props, $$invalidate) {
1409
1377
  class Compass extends SvelteComponent {
1410
1378
  constructor(options) {
1411
1379
  super();
1412
- init(this, options, instance$n, create_fragment$n, safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$i);
1380
+ init(this, options, instance$n, create_fragment$n, safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$j);
1413
1381
  }
1414
1382
  }
1415
1383
 
1416
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1384
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1417
1385
 
1418
- function add_css$h(target) {
1419
- append_styles(target, "svelte-i2nwuk", ".floorplan-plugin__room-label-item.svelte-i2nwuk{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:0.78125rem;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-i2nwuk{opacity:0.45}");
1386
+ function add_css$i(target) {
1387
+ append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1420
1388
  }
1421
1389
 
1422
- // (22:30)
1423
- function create_if_block_1$4(ctx) {
1424
- let html_tag;
1425
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1426
- let html_anchor;
1390
+ function create_fragment$m(ctx) {
1391
+ let img;
1392
+ let img_src_value;
1427
1393
 
1428
1394
  return {
1429
1395
  c() {
1430
- html_tag = new HtmlTag();
1431
- html_anchor = empty();
1432
- html_tag.a = html_anchor;
1396
+ img = element("img");
1397
+ if (!src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) attr(img, "src", img_src_value);
1398
+ attr(img, "alt", "floorplan iamge");
1399
+ attr(img, "class", "svelte-1gfoniz");
1433
1400
  },
1434
1401
  m(target, anchor) {
1435
- html_tag.m(raw_value, target, anchor);
1436
- insert(target, html_anchor, anchor);
1402
+ insert(target, img, anchor);
1437
1403
  },
1438
- p(ctx, dirty) {
1439
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1404
+ p(ctx, [dirty]) {
1405
+ if (dirty & /*url*/ 1 && !src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1406
+ attr(img, "src", img_src_value);
1407
+ }
1440
1408
  },
1409
+ i: noop,
1410
+ o: noop,
1441
1411
  d(detaching) {
1442
- if (detaching) detach(html_anchor);
1443
- if (detaching) html_tag.d();
1412
+ if (detaching) detach(img);
1444
1413
  }
1445
1414
  };
1446
1415
  }
1447
1416
 
1448
- // (16:2) {#if getLabelElement === undefined}
1449
- function create_if_block$7(ctx) {
1450
- let span0;
1451
- let t0_value = /*room*/ ctx[0].name + "";
1452
- let t0;
1453
- let t1;
1454
- let span1;
1417
+ function instance$m($$self, $$props, $$invalidate) {
1418
+ let { url } = $$props;
1455
1419
 
1456
- return {
1457
- c() {
1458
- span0 = element("span");
1459
- t0 = text(t0_value);
1460
- t1 = space();
1461
- span1 = element("span");
1462
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1463
- attr(span0, "class", "floorplan-plugin__room-name");
1464
- attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
1465
- },
1466
- m(target, anchor) {
1467
- insert(target, span0, anchor);
1468
- append(span0, t0);
1469
- insert(target, t1, anchor);
1470
- insert(target, span1, anchor);
1471
- },
1472
- p(ctx, dirty) {
1473
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) set_data(t0, t0_value);
1474
- },
1475
- d(detaching) {
1476
- if (detaching) detach(span0);
1477
- if (detaching) detach(t1);
1478
- if (detaching) detach(span1);
1479
- }
1420
+ $$self.$$set = $$props => {
1421
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
1480
1422
  };
1481
- }
1482
1423
 
1483
- function create_fragment$m(ctx) {
1484
- let div;
1424
+ return [url];
1425
+ }
1485
1426
 
1486
- function select_block_type(ctx, dirty) {
1487
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$7;
1488
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
1427
+ class Normalmage extends SvelteComponent {
1428
+ constructor(options) {
1429
+ super();
1430
+ init(this, options, instance$m, create_fragment$m, safe_not_equal, { url: 0 }, add_css$i);
1489
1431
  }
1432
+ }
1490
1433
 
1491
- let current_block_type = select_block_type(ctx);
1492
- let if_block = current_block_type && current_block_type(ctx);
1434
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1435
+
1436
+ function add_css$h(target) {
1437
+ append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
1438
+ }
1439
+
1440
+ function create_fragment$l(ctx) {
1441
+ let div;
1442
+ let html_tag;
1443
+ let t;
1444
+ let html_tag_1;
1493
1445
 
1494
1446
  return {
1495
1447
  c() {
1496
1448
  div = element("div");
1497
- if (if_block) if_block.c();
1498
- attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
1499
- set_style(div, "left", /*left*/ ctx[4], false);
1500
- set_style(div, "top", /*top*/ ctx[5], false);
1501
- set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1449
+ html_tag = new HtmlTag();
1450
+ t = space();
1451
+ html_tag_1 = new HtmlTag();
1452
+ html_tag.a = t;
1453
+ html_tag_1.a = null;
1454
+ attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
1502
1455
  },
1503
1456
  m(target, anchor) {
1504
1457
  insert(target, div, anchor);
1505
- if (if_block) if_block.m(div, null);
1458
+ html_tag.m(/*svgStyle*/ ctx[1], div);
1459
+ append(div, t);
1460
+ html_tag_1.m(/*content*/ ctx[0], div);
1506
1461
  },
1507
1462
  p(ctx, [dirty]) {
1508
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1509
- if_block.p(ctx, dirty);
1510
- } else {
1511
- if (if_block) if_block.d(1);
1512
- if_block = current_block_type && current_block_type(ctx);
1513
-
1514
- if (if_block) {
1515
- if_block.c();
1516
- if_block.m(div, null);
1517
- }
1518
- }
1463
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1519
1464
  },
1520
1465
  i: noop,
1521
1466
  o: noop,
1522
1467
  d(detaching) {
1523
1468
  if (detaching) detach(div);
1524
-
1525
- if (if_block) {
1526
- if_block.d();
1527
- }
1528
1469
  }
1529
1470
  };
1530
1471
  }
1531
1472
 
1532
- function instance$m($$self, $$props, $$invalidate) {
1533
- let userConfigElement;
1534
- let { room } = $$props;
1535
- let { getLabelElement } = $$props;
1536
-
1537
- // TODO: 统一这里的判断条件,目前写了多处
1538
- const bodyWidth = document.body.clientWidth;
1473
+ function instance$l($$self, $$props, $$invalidate) {
1474
+ let { content } = $$props;
1539
1475
 
1540
- const bodyHeight = document.body.clientHeight;
1541
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1542
- const roomLabel = room.roomLabel;
1543
- const left = roomLabel.positionInImage.x * 100 + '%';
1544
- const top = roomLabel.positionInImage.y * 100 + '%';
1545
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
1476
+ const svgStyle = `
1477
+ <style>
1478
+ svg [type='lineGroup'] path {
1479
+ fill: #ffffff;
1480
+ stroke: #ffffff;
1481
+ }
1482
+ svg [type='lineItemGroup'] g g g g {
1483
+ stroke: #ffffff;
1484
+ }</style>
1485
+ `;
1546
1486
 
1547
1487
  $$self.$$set = $$props => {
1548
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
1549
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
1550
- };
1551
-
1552
- $$self.$$.update = () => {
1553
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1554
- $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1555
- ? void 0
1556
- : getLabelElement(room));
1557
- }
1488
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
1558
1489
  };
1559
1490
 
1560
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
1491
+ return [content, svgStyle];
1561
1492
  }
1562
1493
 
1563
- class RoomLabel extends SvelteComponent {
1494
+ class SvgImage extends SvelteComponent {
1564
1495
  constructor(options) {
1565
1496
  super();
1566
- init(this, options, instance$m, create_fragment$m, safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$h);
1497
+ init(this, options, instance$l, create_fragment$l, safe_not_equal, { content: 0 }, add_css$h);
1567
1498
  }
1568
1499
  }
1569
1500
 
1570
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
1501
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1571
1502
 
1572
1503
  function add_css$g(target) {
1573
- append_styles(target, "svelte-vkeyjz", ".floorplan-plugin__room-labels.svelte-vkeyjz{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
1574
- }
1575
-
1576
- function get_each_context$7(ctx, list, i) {
1577
- const child_ctx = ctx.slice();
1578
- child_ctx[4] = list[i];
1579
- return child_ctx;
1504
+ append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1580
1505
  }
1581
1506
 
1582
- // (8:0) {#if rooms}
1583
- function create_if_block$6(ctx) {
1584
- let div;
1585
- let each_blocks = [];
1586
- let each_1_lookup = new Map();
1507
+ // (13:22)
1508
+ function create_if_block_1$4(ctx) {
1509
+ let normalimage;
1587
1510
  let current;
1588
- let each_value = /*rooms*/ ctx[1];
1589
- const get_key = ctx => /*room*/ ctx[4].id;
1590
-
1591
- for (let i = 0; i < each_value.length; i += 1) {
1592
- let child_ctx = get_each_context$7(ctx, each_value, i);
1593
- let key = get_key(child_ctx);
1594
- each_1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
1595
- }
1511
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1596
1512
 
1597
1513
  return {
1598
1514
  c() {
1599
- div = element("div");
1600
-
1601
- for (let i = 0; i < each_blocks.length; i += 1) {
1602
- each_blocks[i].c();
1603
- }
1604
-
1605
- attr(div, "class", "floorplan-plugin__room-labels svelte-vkeyjz");
1515
+ create_component(normalimage.$$.fragment);
1606
1516
  },
1607
1517
  m(target, anchor) {
1608
- insert(target, div, anchor);
1609
-
1610
- for (let i = 0; i < each_blocks.length; i += 1) {
1611
- each_blocks[i].m(div, null);
1612
- }
1613
-
1518
+ mount_component(normalimage, target, anchor);
1614
1519
  current = true;
1615
1520
  },
1616
1521
  p(ctx, dirty) {
1617
- if (dirty & /*rooms, getLabelElement*/ 3) {
1618
- each_value = /*rooms*/ ctx[1];
1619
- group_outros();
1620
- each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block$7, null, get_each_context$7);
1621
- check_outros();
1622
- }
1522
+ const normalimage_changes = {};
1523
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1524
+ normalimage.$set(normalimage_changes);
1623
1525
  },
1624
1526
  i(local) {
1625
1527
  if (current) return;
1626
-
1627
- for (let i = 0; i < each_value.length; i += 1) {
1628
- transition_in(each_blocks[i]);
1629
- }
1630
-
1528
+ transition_in(normalimage.$$.fragment, local);
1631
1529
  current = true;
1632
1530
  },
1633
1531
  o(local) {
1634
- for (let i = 0; i < each_blocks.length; i += 1) {
1635
- transition_out(each_blocks[i]);
1636
- }
1637
-
1532
+ transition_out(normalimage.$$.fragment, local);
1638
1533
  current = false;
1639
1534
  },
1640
1535
  d(detaching) {
1641
- if (detaching) detach(div);
1642
-
1643
- for (let i = 0; i < each_blocks.length; i += 1) {
1644
- each_blocks[i].d();
1645
- }
1536
+ destroy_component(normalimage, detaching);
1646
1537
  }
1647
1538
  };
1648
1539
  }
1649
1540
 
1650
- // (10:4) {#each rooms as room (room.id)}
1651
- function create_each_block$7(key_1, ctx) {
1652
- let first;
1653
- let roomlabel;
1541
+ // (11:2) {#if svgContent}
1542
+ function create_if_block$7(ctx) {
1543
+ let svgimage;
1654
1544
  let current;
1655
1545
 
1656
- const roomlabel_spread_levels = [
1657
- {
1658
- room: /*room*/ ctx[4],
1659
- getLabelElement: /*getLabelElement*/ ctx[0]
1660
- }
1661
- ];
1662
-
1663
- let roomlabel_props = {};
1664
-
1665
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1666
- roomlabel_props = assign(roomlabel_props, roomlabel_spread_levels[i]);
1667
- }
1668
-
1669
- roomlabel = new RoomLabel({ props: roomlabel_props });
1546
+ svgimage = new SvgImage({
1547
+ props: { content: /*svgContent*/ ctx[0] }
1548
+ });
1670
1549
 
1671
1550
  return {
1672
- key: key_1,
1673
- first: null,
1674
1551
  c() {
1675
- first = empty();
1676
- create_component(roomlabel.$$.fragment);
1677
- this.first = first;
1552
+ create_component(svgimage.$$.fragment);
1678
1553
  },
1679
1554
  m(target, anchor) {
1680
- insert(target, first, anchor);
1681
- mount_component(roomlabel, target, anchor);
1555
+ mount_component(svgimage, target, anchor);
1682
1556
  current = true;
1683
1557
  },
1684
- p(new_ctx, dirty) {
1685
- ctx = new_ctx;
1686
-
1687
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1688
- ? get_spread_update(roomlabel_spread_levels, [
1689
- {
1690
- room: /*room*/ ctx[4],
1691
- getLabelElement: /*getLabelElement*/ ctx[0]
1692
- }
1693
- ])
1694
- : {};
1695
-
1696
- roomlabel.$set(roomlabel_changes);
1558
+ p(ctx, dirty) {
1559
+ const svgimage_changes = {};
1560
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1561
+ svgimage.$set(svgimage_changes);
1697
1562
  },
1698
1563
  i(local) {
1699
1564
  if (current) return;
1700
- transition_in(roomlabel.$$.fragment, local);
1565
+ transition_in(svgimage.$$.fragment, local);
1701
1566
  current = true;
1702
1567
  },
1703
1568
  o(local) {
1704
- transition_out(roomlabel.$$.fragment, local);
1569
+ transition_out(svgimage.$$.fragment, local);
1705
1570
  current = false;
1706
1571
  },
1707
1572
  d(detaching) {
1708
- if (detaching) detach(first);
1709
- destroy_component(roomlabel, detaching);
1573
+ destroy_component(svgimage, detaching);
1710
1574
  }
1711
1575
  };
1712
1576
  }
1713
1577
 
1714
- function create_fragment$l(ctx) {
1715
- let if_block_anchor;
1578
+ function create_fragment$k(ctx) {
1579
+ let div;
1580
+ let current_block_type_index;
1581
+ let if_block;
1716
1582
  let current;
1717
- let if_block = /*rooms*/ ctx[1] && create_if_block$6(ctx);
1583
+ const if_block_creators = [create_if_block$7, create_if_block_1$4];
1584
+ const if_blocks = [];
1585
+
1586
+ function select_block_type(ctx, dirty) {
1587
+ if (/*svgContent*/ ctx[0]) return 0;
1588
+ if (/*imageData*/ ctx[1]) return 1;
1589
+ return -1;
1590
+ }
1591
+
1592
+ if (~(current_block_type_index = select_block_type(ctx))) {
1593
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1594
+ }
1718
1595
 
1719
1596
  return {
1720
1597
  c() {
1598
+ div = element("div");
1721
1599
  if (if_block) if_block.c();
1722
- if_block_anchor = empty();
1600
+ attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
1723
1601
  },
1724
1602
  m(target, anchor) {
1725
- if (if_block) if_block.m(target, anchor);
1726
- insert(target, if_block_anchor, anchor);
1603
+ insert(target, div, anchor);
1604
+
1605
+ if (~current_block_type_index) {
1606
+ if_blocks[current_block_type_index].m(div, null);
1607
+ }
1608
+
1727
1609
  current = true;
1728
1610
  },
1729
1611
  p(ctx, [dirty]) {
1730
- if (/*rooms*/ ctx[1]) {
1612
+ let previous_block_index = current_block_type_index;
1613
+ current_block_type_index = select_block_type(ctx);
1614
+
1615
+ if (current_block_type_index === previous_block_index) {
1616
+ if (~current_block_type_index) {
1617
+ if_blocks[current_block_type_index].p(ctx, dirty);
1618
+ }
1619
+ } else {
1731
1620
  if (if_block) {
1732
- if_block.p(ctx, dirty);
1621
+ group_outros();
1733
1622
 
1734
- if (dirty & /*rooms*/ 2) {
1735
- transition_in(if_block, 1);
1736
- }
1737
- } else {
1738
- if_block = create_if_block$6(ctx);
1739
- if_block.c();
1740
- transition_in(if_block, 1);
1741
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
1623
+ transition_out(if_blocks[previous_block_index], 1, 1, () => {
1624
+ if_blocks[previous_block_index] = null;
1625
+ });
1626
+
1627
+ check_outros();
1742
1628
  }
1743
- } else if (if_block) {
1744
- group_outros();
1745
1629
 
1746
- transition_out(if_block, 1, 1, () => {
1747
- if_block = null;
1748
- });
1630
+ if (~current_block_type_index) {
1631
+ if_block = if_blocks[current_block_type_index];
1749
1632
 
1750
- check_outros();
1633
+ if (!if_block) {
1634
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1635
+ if_block.c();
1636
+ } else {
1637
+ if_block.p(ctx, dirty);
1638
+ }
1639
+
1640
+ transition_in(if_block, 1);
1641
+ if_block.m(div, null);
1642
+ } else {
1643
+ if_block = null;
1644
+ }
1751
1645
  }
1752
1646
  },
1753
1647
  i(local) {
@@ -1760,434 +1654,230 @@ function create_fragment$l(ctx) {
1760
1654
  current = false;
1761
1655
  },
1762
1656
  d(detaching) {
1763
- if (if_block) if_block.d(detaching);
1764
- if (detaching) detach(if_block_anchor);
1657
+ if (detaching) detach(div);
1658
+
1659
+ if (~current_block_type_index) {
1660
+ if_blocks[current_block_type_index].d();
1661
+ }
1765
1662
  }
1766
1663
  };
1767
1664
  }
1768
1665
 
1769
- function instance$l($$self, $$props, $$invalidate) {
1770
- let rooms;
1666
+ function instance$k($$self, $$props, $$invalidate) {
1667
+ let imageData;
1668
+ let svgContent;
1669
+ var _a, _b;
1771
1670
  let { floorIndex } = $$props;
1772
1671
  let { floorplanData } = $$props;
1773
- let { getLabelElement } = $$props;
1774
1672
 
1775
1673
  $$self.$$set = $$props => {
1776
1674
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1777
1675
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1778
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
1779
1676
  };
1780
1677
 
1781
1678
  $$self.$$.update = () => {
1782
1679
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1783
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
1680
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1681
+ }
1682
+
1683
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
1684
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
1685
+ ? void 0
1686
+ : _a[floorIndex]) === null || _b === void 0
1687
+ ? void 0
1688
+ : _b.svgContent);
1784
1689
  }
1785
1690
  };
1786
1691
 
1787
- return [getLabelElement, rooms, floorIndex, floorplanData];
1692
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
1788
1693
  }
1789
1694
 
1790
- class RoomLabels extends SvelteComponent {
1695
+ class BaseImage extends SvelteComponent {
1791
1696
  constructor(options) {
1792
1697
  super();
1793
-
1794
- init(
1795
- this,
1796
- options,
1797
- instance$l,
1798
- create_fragment$l,
1799
- safe_not_equal,
1800
- {
1801
- floorIndex: 2,
1802
- floorplanData: 3,
1803
- getLabelElement: 0
1804
- },
1805
- add_css$g
1806
- );
1698
+ init(this, options, instance$k, create_fragment$k, safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$g);
1807
1699
  }
1808
1700
  }
1809
1701
 
1810
- /**
1811
- * 判断对象是否为`null`或`undefined`。
1812
- * @param
1813
- * @return
1814
- */
1815
- /**
1816
- * 判断对象不为`null`或`undefined`。
1817
- */
1818
- function notNil(value) {
1819
- return value !== null && value !== undefined;
1820
- }
1821
-
1822
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1702
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1823
1703
 
1824
1704
  function add_css$f(target) {
1825
- append_styles(target, "svelte-1d5a0k4", ".floorplan-plugin__rule-labels.svelte-1d5a0k4{position:absolute;height:0.26042rem;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1d5a0k4{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1d5a0k4{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1d5a0k4{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1d5a0k4{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1d5a0k4{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1d5a0k4{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:0.26042rem}.floorplan-plugin__text-wrapper.svelte-1d5a0k4{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1d5a0k4{top:0.52083rem}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1d5a0k4{bottom:0.52083rem}.floorplan-plugin__rule-text.svelte-1d5a0k4{position:absolute;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:0.52083rem;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1d5a0k4{transform:translate(-50%, -50%)}");
1826
- }
1827
-
1828
- function get_each_context$6(ctx, list, i) {
1829
- const child_ctx = ctx.slice();
1830
- child_ctx[24] = list[i];
1831
- child_ctx[26] = i;
1832
- return child_ctx;
1833
- }
1834
-
1835
- function get_each_context_1(ctx, list, i) {
1836
- const child_ctx = ctx.slice();
1837
- child_ctx[27] = list[i];
1838
- child_ctx[29] = i;
1839
- return child_ctx;
1705
+ append_styles(target, "svelte-i2nwuk", ".floorplan-plugin__room-label-item.svelte-i2nwuk{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:0.78125rem;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-i2nwuk{opacity:0.45}");
1840
1706
  }
1841
1707
 
1842
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
1843
- function create_each_block_1(key_1, ctx) {
1844
- let div;
1845
- let style_left = `${/*position*/ ctx[27]}px`;
1708
+ // (22:30)
1709
+ function create_if_block_1$3(ctx) {
1710
+ let html_tag;
1711
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1712
+ let html_anchor;
1846
1713
 
1847
1714
  return {
1848
- key: key_1,
1849
- first: null,
1850
1715
  c() {
1851
- div = element("div");
1852
- attr(div, "class", "floorplan-plugin__rule-scale svelte-1d5a0k4");
1853
- set_style(div, "left", style_left, false);
1854
- this.first = div;
1716
+ html_tag = new HtmlTag();
1717
+ html_anchor = empty();
1718
+ html_tag.a = html_anchor;
1855
1719
  },
1856
1720
  m(target, anchor) {
1857
- insert(target, div, anchor);
1858
- },
1859
- p(new_ctx, dirty) {
1860
- ctx = new_ctx;
1721
+ html_tag.m(raw_value, target, anchor);
1722
+ insert(target, html_anchor, anchor);
1723
+ },
1724
+ p(ctx, dirty) {
1725
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1861
1726
  },
1862
1727
  d(detaching) {
1863
- if (detaching) detach(div);
1728
+ if (detaching) detach(html_anchor);
1729
+ if (detaching) html_tag.d();
1864
1730
  }
1865
1731
  };
1866
1732
  }
1867
1733
 
1868
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
1869
- function create_each_block$6(key_1, ctx) {
1870
- let div;
1871
- let span;
1872
- let t0_value = /*textItem*/ ctx[24].distance + "";
1734
+ // (16:2) {#if getLabelElement === undefined}
1735
+ function create_if_block$6(ctx) {
1736
+ let span0;
1737
+ let t0_value = /*room*/ ctx[0].name + "";
1873
1738
  let t0;
1874
1739
  let t1;
1875
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
1740
+ let span1;
1876
1741
 
1877
1742
  return {
1878
- key: key_1,
1879
- first: null,
1880
1743
  c() {
1881
- div = element("div");
1882
- span = element("span");
1744
+ span0 = element("span");
1883
1745
  t0 = text(t0_value);
1884
1746
  t1 = space();
1885
- attr(span, "class", "floorplan-plugin__rule-text svelte-1d5a0k4");
1886
- toggle_class(span, "is-row", /*isRow*/ ctx[5]);
1887
- attr(div, "class", "floorplan-plugin__text-wrapper svelte-1d5a0k4");
1888
- toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
1889
- toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
1890
- set_style(div, "left", style_left, false);
1891
- this.first = div;
1747
+ span1 = element("span");
1748
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1749
+ attr(span0, "class", "floorplan-plugin__room-name");
1750
+ attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
1892
1751
  },
1893
1752
  m(target, anchor) {
1894
- insert(target, div, anchor);
1895
- append(div, span);
1896
- append(span, t0);
1897
- append(div, t1);
1753
+ insert(target, span0, anchor);
1754
+ append(span0, t0);
1755
+ insert(target, t1, anchor);
1756
+ insert(target, span1, anchor);
1898
1757
  },
1899
- p(new_ctx, dirty) {
1900
- ctx = new_ctx;
1758
+ p(ctx, dirty) {
1759
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) set_data(t0, t0_value);
1901
1760
  },
1902
1761
  d(detaching) {
1903
- if (detaching) detach(div);
1762
+ if (detaching) detach(span0);
1763
+ if (detaching) detach(t1);
1764
+ if (detaching) detach(span1);
1904
1765
  }
1905
1766
  };
1906
1767
  }
1907
1768
 
1908
- function create_fragment$k(ctx) {
1909
- let div1;
1910
- let div0;
1911
- let t0;
1912
- let each_blocks_1 = [];
1913
- let each0_lookup = new Map();
1914
- let t1;
1915
- let each_blocks = [];
1916
- let each1_lookup = new Map();
1917
- let div1_class_value;
1918
- let each_value_1 = /*positionPxArray*/ ctx[6];
1919
- const get_key = ctx => /*positionIndex*/ ctx[29];
1769
+ function create_fragment$j(ctx) {
1770
+ let div;
1920
1771
 
1921
- for (let i = 0; i < each_value_1.length; i += 1) {
1922
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
1923
- let key = get_key(child_ctx);
1924
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
1772
+ function select_block_type(ctx, dirty) {
1773
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$6;
1774
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$3;
1925
1775
  }
1926
1776
 
1927
- let each_value = /*textArray*/ ctx[10];
1928
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
1929
-
1930
- for (let i = 0; i < each_value.length; i += 1) {
1931
- let child_ctx = get_each_context$6(ctx, each_value, i);
1932
- let key = get_key_1(child_ctx);
1933
- each1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
1934
- }
1777
+ let current_block_type = select_block_type(ctx);
1778
+ let if_block = current_block_type && current_block_type(ctx);
1935
1779
 
1936
1780
  return {
1937
1781
  c() {
1938
- div1 = element("div");
1939
- div0 = element("div");
1940
- t0 = space();
1941
-
1942
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1943
- each_blocks_1[i].c();
1944
- }
1945
-
1946
- t1 = space();
1947
-
1948
- for (let i = 0; i < each_blocks.length; i += 1) {
1949
- each_blocks[i].c();
1950
- }
1951
-
1952
- attr(div0, "class", "floorplan-plugin__rule-line svelte-1d5a0k4");
1953
- attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4");
1954
- set_style(div1, "width", /*width*/ ctx[9], false);
1955
- set_style(div1, "transform", /*transform*/ ctx[7], false);
1956
- set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
1782
+ div = element("div");
1783
+ if (if_block) if_block.c();
1784
+ attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
1785
+ set_style(div, "left", /*left*/ ctx[4], false);
1786
+ set_style(div, "top", /*top*/ ctx[5], false);
1787
+ set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1957
1788
  },
1958
1789
  m(target, anchor) {
1959
- insert(target, div1, anchor);
1960
- append(div1, div0);
1961
- append(div1, t0);
1962
-
1963
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1964
- each_blocks_1[i].m(div1, null);
1965
- }
1966
-
1967
- append(div1, t1);
1968
-
1969
- for (let i = 0; i < each_blocks.length; i += 1) {
1970
- each_blocks[i].m(div1, null);
1971
- }
1790
+ insert(target, div, anchor);
1791
+ if (if_block) if_block.m(div, null);
1972
1792
  },
1973
1793
  p(ctx, [dirty]) {
1974
- if (dirty & /*positionPxArray*/ 64) {
1975
- each_value_1 = /*positionPxArray*/ ctx[6];
1976
- each_blocks_1 = update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx, each_value_1, each0_lookup, div1, destroy_block, create_each_block_1, t1, get_each_context_1);
1977
- }
1978
-
1979
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
1980
- each_value = /*textArray*/ ctx[10];
1981
- each_blocks = update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx, each_value, each1_lookup, div1, destroy_block, create_each_block$6, null, get_each_context$6);
1982
- }
1794
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1795
+ if_block.p(ctx, dirty);
1796
+ } else {
1797
+ if (if_block) if_block.d(1);
1798
+ if_block = current_block_type && current_block_type(ctx);
1983
1799
 
1984
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4")) {
1985
- attr(div1, "class", div1_class_value);
1800
+ if (if_block) {
1801
+ if_block.c();
1802
+ if_block.m(div, null);
1803
+ }
1986
1804
  }
1987
1805
  },
1988
1806
  i: noop,
1989
1807
  o: noop,
1990
1808
  d(detaching) {
1991
- if (detaching) detach(div1);
1992
-
1993
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1994
- each_blocks_1[i].d();
1995
- }
1809
+ if (detaching) detach(div);
1996
1810
 
1997
- for (let i = 0; i < each_blocks.length; i += 1) {
1998
- each_blocks[i].d();
1811
+ if (if_block) {
1812
+ if_block.d();
1999
1813
  }
2000
1814
  }
2001
1815
  };
2002
1816
  }
2003
1817
 
2004
- const padding = 1000;
2005
-
2006
- function instance$k($$self, $$props, $$invalidate) {
2007
- let { pxmm } = $$props;
2008
- let { type } = $$props;
2009
- let { data } = $$props;
2010
- let { bounding } = $$props;
2011
- const isTop = type === 'top';
2012
- const isBottom = type === 'bottom';
2013
- const isLeft = type === 'left';
2014
- const isRight = type === 'right';
2015
- const isRow = isTop || isBottom;
1818
+ function instance$j($$self, $$props, $$invalidate) {
1819
+ let userConfigElement;
1820
+ let { room } = $$props;
1821
+ let { getLabelElement } = $$props;
2016
1822
 
2017
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2018
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2019
- if (index === 0) return true;
2020
- return x !== arr[index - 1];
2021
- });
1823
+ // TODO: 统一这里的判断条件,目前写了多处
1824
+ const bodyWidth = document.body.clientWidth;
2022
1825
 
2023
- const minPosition = positionArray[0];
2024
- const maxPosition = positionArray.slice(-1)[0];
2025
- const length = maxPosition - minPosition;
2026
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
2027
- const lengthPx = length * pxmm;
2028
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
2029
-
2030
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
2031
- const translateMain = (minPosition - minBounding) * pxmm;
2032
-
2033
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
2034
- const translateSecond = 27 - padding * pxmm;
2035
-
2036
- const translate = (() => {
2037
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
2038
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
2039
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
2040
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
2041
- })();
2042
-
2043
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
2044
- const transform = `${translate} ${rotate}`;
2045
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
2046
- const width = lengthPx + 'px';
2047
-
2048
- // 把点位的户型图坐标转成距离起始位置的像素值
2049
- const textArray = positionArray.map((position, index, array) => {
2050
- if (index === 0) return null;
2051
- const distance = position - array[index - 1];
2052
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
2053
- return { distance, positionPx };
2054
- }).filter(notNil).filter(item => item.distance / length > 0.12);
1826
+ const bodyHeight = document.body.clientHeight;
1827
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1828
+ const roomLabel = room.roomLabel;
1829
+ const left = roomLabel.positionInImage.x * 100 + '%';
1830
+ const top = roomLabel.positionInImage.y * 100 + '%';
1831
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
2055
1832
 
2056
1833
  $$self.$$set = $$props => {
2057
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
2058
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
2059
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
2060
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
1834
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
1835
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
2061
1836
  };
2062
1837
 
2063
- return [
2064
- type,
2065
- isTop,
2066
- isBottom,
2067
- isLeft,
2068
- isRight,
2069
- isRow,
2070
- positionPxArray,
2071
- transform,
2072
- transformOrigin,
2073
- width,
2074
- textArray,
2075
- pxmm,
2076
- data,
2077
- bounding
2078
- ];
1838
+ $$self.$$.update = () => {
1839
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1840
+ $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1841
+ ? void 0
1842
+ : getLabelElement(room));
1843
+ }
1844
+ };
1845
+
1846
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
2079
1847
  }
2080
1848
 
2081
- class RuleItem extends SvelteComponent {
1849
+ class RoomLabel extends SvelteComponent {
2082
1850
  constructor(options) {
2083
1851
  super();
2084
-
2085
- init(
2086
- this,
2087
- options,
2088
- instance$k,
2089
- create_fragment$k,
2090
- safe_not_equal,
2091
- {
2092
- pxmm: 11,
2093
- type: 0,
2094
- data: 12,
2095
- bounding: 13
2096
- },
2097
- add_css$f
2098
- );
1852
+ init(this, options, instance$j, create_fragment$j, safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$f);
2099
1853
  }
2100
1854
  }
2101
1855
 
2102
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1856
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
2103
1857
 
2104
- function get_each_context$5(ctx, list, i) {
2105
- const child_ctx = ctx.slice();
2106
- child_ctx[7] = list[i][0];
2107
- child_ctx[8] = list[i][1];
2108
- return child_ctx;
1858
+ function add_css$e(target) {
1859
+ append_styles(target, "svelte-13xux0b", ".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}");
2109
1860
  }
2110
1861
 
2111
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
2112
- function create_each_block$5(key_1, ctx) {
2113
- let first;
2114
- let ruleitem;
2115
- let current;
2116
-
2117
- const ruleitem_spread_levels = [
2118
- {
2119
- type: /*type*/ ctx[7],
2120
- data: /*data*/ ctx[8],
2121
- pxmm: /*pxmm*/ ctx[0],
2122
- bounding: /*bounding*/ ctx[2]
2123
- }
2124
- ];
2125
-
2126
- let ruleitem_props = {};
2127
-
2128
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2129
- ruleitem_props = assign(ruleitem_props, ruleitem_spread_levels[i]);
2130
- }
2131
-
2132
- ruleitem = new RuleItem({ props: ruleitem_props });
2133
-
2134
- return {
2135
- key: key_1,
2136
- first: null,
2137
- c() {
2138
- first = empty();
2139
- create_component(ruleitem.$$.fragment);
2140
- this.first = first;
2141
- },
2142
- m(target, anchor) {
2143
- insert(target, first, anchor);
2144
- mount_component(ruleitem, target, anchor);
2145
- current = true;
2146
- },
2147
- p(new_ctx, dirty) {
2148
- ctx = new_ctx;
2149
-
2150
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
2151
- ? get_spread_update(ruleitem_spread_levels, [
2152
- {
2153
- type: /*type*/ ctx[7],
2154
- data: /*data*/ ctx[8],
2155
- pxmm: /*pxmm*/ ctx[0],
2156
- bounding: /*bounding*/ ctx[2]
2157
- }
2158
- ])
2159
- : {};
2160
-
2161
- ruleitem.$set(ruleitem_changes);
2162
- },
2163
- i(local) {
2164
- if (current) return;
2165
- transition_in(ruleitem.$$.fragment, local);
2166
- current = true;
2167
- },
2168
- o(local) {
2169
- transition_out(ruleitem.$$.fragment, local);
2170
- current = false;
2171
- },
2172
- d(detaching) {
2173
- if (detaching) detach(first);
2174
- destroy_component(ruleitem, detaching);
2175
- }
2176
- };
1862
+ function get_each_context$8(ctx, list, i) {
1863
+ const child_ctx = ctx.slice();
1864
+ child_ctx[4] = list[i];
1865
+ return child_ctx;
2177
1866
  }
2178
1867
 
2179
- function create_fragment$j(ctx) {
1868
+ // (8:0) {#if rooms}
1869
+ function create_if_block$5(ctx) {
2180
1870
  let div;
2181
1871
  let each_blocks = [];
2182
1872
  let each_1_lookup = new Map();
2183
1873
  let current;
2184
- let each_value = /*ruleLabelArray*/ ctx[1];
2185
- const get_key = ctx => /*type*/ ctx[7];
1874
+ let each_value = /*rooms*/ ctx[1];
1875
+ const get_key = ctx => /*room*/ ctx[4].id;
2186
1876
 
2187
1877
  for (let i = 0; i < each_value.length; i += 1) {
2188
- let child_ctx = get_each_context$5(ctx, each_value, i);
1878
+ let child_ctx = get_each_context$8(ctx, each_value, i);
2189
1879
  let key = get_key(child_ctx);
2190
- each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
1880
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
2191
1881
  }
2192
1882
 
2193
1883
  return {
@@ -2198,7 +1888,7 @@ function create_fragment$j(ctx) {
2198
1888
  each_blocks[i].c();
2199
1889
  }
2200
1890
 
2201
- attr(div, "class", "floorplan-plugin__rulelabels");
1891
+ attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
2202
1892
  },
2203
1893
  m(target, anchor) {
2204
1894
  insert(target, div, anchor);
@@ -2209,11 +1899,11 @@ function create_fragment$j(ctx) {
2209
1899
 
2210
1900
  current = true;
2211
1901
  },
2212
- p(ctx, [dirty]) {
2213
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
2214
- each_value = /*ruleLabelArray*/ ctx[1];
1902
+ p(ctx, dirty) {
1903
+ if (dirty & /*rooms, getLabelElement*/ 3) {
1904
+ each_value = /*rooms*/ ctx[1];
2215
1905
  group_outros();
2216
- each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block$5, null, get_each_context$5);
1906
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block$8, null, get_each_context$8);
2217
1907
  check_outros();
2218
1908
  }
2219
1909
  },
@@ -2243,372 +1933,670 @@ function create_fragment$j(ctx) {
2243
1933
  };
2244
1934
  }
2245
1935
 
2246
- function instance$j($$self, $$props, $$invalidate) {
2247
- let bounding;
2248
- let ruleLabelData;
2249
- let ruleLabelDataKeys;
2250
- let ruleLabelArray;
2251
- let { pxmm } = $$props;
2252
- let { floorIndex } = $$props;
2253
- let { floorplanData } = $$props;
2254
-
2255
- $$self.$$set = $$props => {
2256
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2257
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2258
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2259
- };
1936
+ // (10:4) {#each rooms as room (room.id)}
1937
+ function create_each_block$8(key_1, ctx) {
1938
+ let first;
1939
+ let roomlabel;
1940
+ let current;
2260
1941
 
2261
- $$self.$$.update = () => {
2262
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
2263
- $$invalidate(2, bounding = floorplanData.bounding);
2264
- }
2265
-
2266
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2267
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1942
+ const roomlabel_spread_levels = [
1943
+ {
1944
+ room: /*room*/ ctx[4],
1945
+ getLabelElement: /*getLabelElement*/ ctx[0]
2268
1946
  }
1947
+ ];
2269
1948
 
2270
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
2271
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
2272
- }
1949
+ let roomlabel_props = {};
2273
1950
 
2274
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
2275
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2276
- }
2277
- };
1951
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1952
+ roomlabel_props = assign(roomlabel_props, roomlabel_spread_levels[i]);
1953
+ }
2278
1954
 
2279
- return [
2280
- pxmm,
2281
- ruleLabelArray,
2282
- bounding,
2283
- floorIndex,
2284
- floorplanData,
2285
- ruleLabelData,
2286
- ruleLabelDataKeys
2287
- ];
2288
- }
1955
+ roomlabel = new RoomLabel({ props: roomlabel_props });
2289
1956
 
2290
- class RuleLabels extends SvelteComponent {
2291
- constructor(options) {
2292
- super();
2293
- init(this, options, instance$j, create_fragment$j, safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
2294
- }
2295
- }
1957
+ return {
1958
+ key: key_1,
1959
+ first: null,
1960
+ c() {
1961
+ first = empty();
1962
+ create_component(roomlabel.$$.fragment);
1963
+ this.first = first;
1964
+ },
1965
+ m(target, anchor) {
1966
+ insert(target, first, anchor);
1967
+ mount_component(roomlabel, target, anchor);
1968
+ current = true;
1969
+ },
1970
+ p(new_ctx, dirty) {
1971
+ ctx = new_ctx;
2296
1972
 
2297
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1973
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1974
+ ? get_spread_update(roomlabel_spread_levels, [
1975
+ {
1976
+ room: /*room*/ ctx[4],
1977
+ getLabelElement: /*getLabelElement*/ ctx[0]
1978
+ }
1979
+ ])
1980
+ : {};
2298
1981
 
2299
- function add_css$e(target) {
2300
- append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1982
+ roomlabel.$set(roomlabel_changes);
1983
+ },
1984
+ i(local) {
1985
+ if (current) return;
1986
+ transition_in(roomlabel.$$.fragment, local);
1987
+ current = true;
1988
+ },
1989
+ o(local) {
1990
+ transition_out(roomlabel.$$.fragment, local);
1991
+ current = false;
1992
+ },
1993
+ d(detaching) {
1994
+ if (detaching) detach(first);
1995
+ destroy_component(roomlabel, detaching);
1996
+ }
1997
+ };
2301
1998
  }
2302
1999
 
2303
2000
  function create_fragment$i(ctx) {
2304
- let img;
2305
- let img_src_value;
2001
+ let if_block_anchor;
2002
+ let current;
2003
+ let if_block = /*rooms*/ ctx[1] && create_if_block$5(ctx);
2306
2004
 
2307
2005
  return {
2308
2006
  c() {
2309
- img = element("img");
2310
- if (!src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) attr(img, "src", img_src_value);
2311
- attr(img, "alt", "floorplan iamge");
2312
- attr(img, "class", "svelte-1gfoniz");
2007
+ if (if_block) if_block.c();
2008
+ if_block_anchor = empty();
2313
2009
  },
2314
2010
  m(target, anchor) {
2315
- insert(target, img, anchor);
2011
+ if (if_block) if_block.m(target, anchor);
2012
+ insert(target, if_block_anchor, anchor);
2013
+ current = true;
2316
2014
  },
2317
2015
  p(ctx, [dirty]) {
2318
- if (dirty & /*url*/ 1 && !src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
2319
- attr(img, "src", img_src_value);
2016
+ if (/*rooms*/ ctx[1]) {
2017
+ if (if_block) {
2018
+ if_block.p(ctx, dirty);
2019
+
2020
+ if (dirty & /*rooms*/ 2) {
2021
+ transition_in(if_block, 1);
2022
+ }
2023
+ } else {
2024
+ if_block = create_if_block$5(ctx);
2025
+ if_block.c();
2026
+ transition_in(if_block, 1);
2027
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2028
+ }
2029
+ } else if (if_block) {
2030
+ group_outros();
2031
+
2032
+ transition_out(if_block, 1, 1, () => {
2033
+ if_block = null;
2034
+ });
2035
+
2036
+ check_outros();
2320
2037
  }
2321
2038
  },
2322
- i: noop,
2323
- o: noop,
2039
+ i(local) {
2040
+ if (current) return;
2041
+ transition_in(if_block);
2042
+ current = true;
2043
+ },
2044
+ o(local) {
2045
+ transition_out(if_block);
2046
+ current = false;
2047
+ },
2324
2048
  d(detaching) {
2325
- if (detaching) detach(img);
2049
+ if (if_block) if_block.d(detaching);
2050
+ if (detaching) detach(if_block_anchor);
2326
2051
  }
2327
2052
  };
2328
2053
  }
2329
2054
 
2330
2055
  function instance$i($$self, $$props, $$invalidate) {
2331
- let { url } = $$props;
2056
+ let rooms;
2057
+ let { floorIndex } = $$props;
2058
+ let { floorplanData } = $$props;
2059
+ let { getLabelElement } = $$props;
2332
2060
 
2333
2061
  $$self.$$set = $$props => {
2334
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
2062
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2063
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2064
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
2335
2065
  };
2336
2066
 
2337
- return [url];
2067
+ $$self.$$.update = () => {
2068
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2069
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
2070
+ }
2071
+ };
2072
+
2073
+ return [getLabelElement, rooms, floorIndex, floorplanData];
2338
2074
  }
2339
2075
 
2340
- class Normalmage extends SvelteComponent {
2076
+ class RoomLabels extends SvelteComponent {
2341
2077
  constructor(options) {
2342
2078
  super();
2343
- init(this, options, instance$i, create_fragment$i, safe_not_equal, { url: 0 }, add_css$e);
2079
+
2080
+ init(
2081
+ this,
2082
+ options,
2083
+ instance$i,
2084
+ create_fragment$i,
2085
+ safe_not_equal,
2086
+ {
2087
+ floorIndex: 2,
2088
+ floorplanData: 3,
2089
+ getLabelElement: 0
2090
+ },
2091
+ add_css$e
2092
+ );
2344
2093
  }
2345
2094
  }
2346
2095
 
2347
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
2096
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
2348
2097
 
2349
2098
  function add_css$d(target) {
2350
- append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
2099
+ append_styles(target, "svelte-xt7p1v", ".floorplan-plugin__rule-labels.svelte-xt7p1v.svelte-xt7p1v{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-xt7p1v.svelte-xt7p1v{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v.svelte-xt7p1v{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v.svelte-xt7p1v{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v.svelte-xt7p1v{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-xt7p1v.svelte-xt7p1v{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-xt7p1v.svelte-xt7p1v{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale.svelte-xt7p1v{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute}.floorplan-plugin__rule-labels--top.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-xt7p1v.svelte-xt7p1v{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-text-item.svelte-xt7p1v{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-xt7p1v.svelte-xt7p1v{width:-webkit-max-content;width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}");
2351
2100
  }
2352
2101
 
2353
- function create_fragment$h(ctx) {
2102
+ function get_each_context$7(ctx, list, i) {
2103
+ const child_ctx = ctx.slice();
2104
+ child_ctx[10] = list[i];
2105
+ child_ctx[12] = i;
2106
+ return child_ctx;
2107
+ }
2108
+
2109
+ function get_each_context_1(ctx, list, i) {
2110
+ const child_ctx = ctx.slice();
2111
+ child_ctx[13] = list[i];
2112
+ return child_ctx;
2113
+ }
2114
+
2115
+ // (53:4) {#each rulerLabels as rulerLabel}
2116
+ function create_each_block_1(ctx) {
2354
2117
  let div;
2355
- let html_tag;
2356
- let t;
2357
- let html_tag_1;
2358
2118
 
2359
2119
  return {
2360
2120
  c() {
2361
2121
  div = element("div");
2362
- html_tag = new HtmlTag();
2363
- t = space();
2364
- html_tag_1 = new HtmlTag();
2365
- html_tag.a = t;
2366
- html_tag_1.a = null;
2367
- attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
2122
+ attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
2123
+ set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
2124
+ set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
2368
2125
  },
2369
2126
  m(target, anchor) {
2370
2127
  insert(target, div, anchor);
2371
- html_tag.m(/*svgStyle*/ ctx[1], div);
2372
- append(div, t);
2373
- html_tag_1.m(/*content*/ ctx[0], div);
2128
+ },
2129
+ p: noop,
2130
+ d(detaching) {
2131
+ if (detaching) detach(div);
2132
+ }
2133
+ };
2134
+ }
2135
+
2136
+ // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
2137
+ function create_each_block$7(key_1, ctx) {
2138
+ let div1;
2139
+ let div0;
2140
+ let t0_value = /*textItem*/ ctx[10].distance + "";
2141
+ let t0;
2142
+ let t1;
2143
+
2144
+ return {
2145
+ key: key_1,
2146
+ first: null,
2147
+ c() {
2148
+ div1 = element("div");
2149
+ div0 = element("div");
2150
+ t0 = text(t0_value);
2151
+ t1 = space();
2152
+ attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
2153
+ toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
2154
+ attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
2155
+ set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
2156
+ set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
2157
+ this.first = div1;
2158
+ },
2159
+ m(target, anchor) {
2160
+ insert(target, div1, anchor);
2161
+ append(div1, div0);
2162
+ append(div0, t0);
2163
+ append(div1, t1);
2164
+ },
2165
+ p(new_ctx, dirty) {
2166
+ ctx = new_ctx;
2167
+ },
2168
+ d(detaching) {
2169
+ if (detaching) detach(div1);
2170
+ }
2171
+ };
2172
+ }
2173
+
2174
+ function create_fragment$h(ctx) {
2175
+ let div3;
2176
+ let div0;
2177
+ let t0;
2178
+ let div1;
2179
+ let t1;
2180
+ let div2;
2181
+ let each_blocks = [];
2182
+ let each1_lookup = new Map();
2183
+ let div3_class_value;
2184
+ let each_value_1 = /*rulerLabels*/ ctx[2];
2185
+ let each_blocks_1 = [];
2186
+
2187
+ for (let i = 0; i < each_value_1.length; i += 1) {
2188
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
2189
+ }
2190
+
2191
+ let each_value = /*rulerTexts*/ ctx[3];
2192
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
2193
+
2194
+ for (let i = 0; i < each_value.length; i += 1) {
2195
+ let child_ctx = get_each_context$7(ctx, each_value, i);
2196
+ let key = get_key(child_ctx);
2197
+ each1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
2198
+ }
2199
+
2200
+ return {
2201
+ c() {
2202
+ div3 = element("div");
2203
+ div0 = element("div");
2204
+ t0 = space();
2205
+ div1 = element("div");
2206
+
2207
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2208
+ each_blocks_1[i].c();
2209
+ }
2210
+
2211
+ t1 = space();
2212
+ div2 = element("div");
2213
+
2214
+ for (let i = 0; i < each_blocks.length; i += 1) {
2215
+ each_blocks[i].c();
2216
+ }
2217
+
2218
+ attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
2219
+ attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
2220
+ toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
2221
+ attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
2222
+ attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
2223
+ toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2224
+ set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2225
+ set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2226
+ },
2227
+ m(target, anchor) {
2228
+ insert(target, div3, anchor);
2229
+ append(div3, div0);
2230
+ append(div3, t0);
2231
+ append(div3, div1);
2232
+
2233
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2234
+ each_blocks_1[i].m(div1, null);
2235
+ }
2236
+
2237
+ append(div3, t1);
2238
+ append(div3, div2);
2239
+
2240
+ for (let i = 0; i < each_blocks.length; i += 1) {
2241
+ each_blocks[i].m(div2, null);
2242
+ }
2374
2243
  },
2375
2244
  p(ctx, [dirty]) {
2376
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
2245
+ if (dirty & /*rulerLabels*/ 4) {
2246
+ each_value_1 = /*rulerLabels*/ ctx[2];
2247
+ let i;
2248
+
2249
+ for (i = 0; i < each_value_1.length; i += 1) {
2250
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
2251
+
2252
+ if (each_blocks_1[i]) {
2253
+ each_blocks_1[i].p(child_ctx, dirty);
2254
+ } else {
2255
+ each_blocks_1[i] = create_each_block_1(child_ctx);
2256
+ each_blocks_1[i].c();
2257
+ each_blocks_1[i].m(div1, null);
2258
+ }
2259
+ }
2260
+
2261
+ for (; i < each_blocks_1.length; i += 1) {
2262
+ each_blocks_1[i].d(1);
2263
+ }
2264
+
2265
+ each_blocks_1.length = each_value_1.length;
2266
+ }
2267
+
2268
+ if (dirty & /*rulerTexts, isRow*/ 10) {
2269
+ each_value = /*rulerTexts*/ ctx[3];
2270
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, destroy_block, create_each_block$7, null, get_each_context$7);
2271
+ }
2272
+
2273
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
2274
+ attr(div3, "class", div3_class_value);
2275
+ }
2276
+
2277
+ if (dirty & /*type, isRow*/ 3) {
2278
+ toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2279
+ }
2377
2280
  },
2378
2281
  i: noop,
2379
2282
  o: noop,
2380
2283
  d(detaching) {
2381
- if (detaching) detach(div);
2284
+ if (detaching) detach(div3);
2285
+ destroy_each(each_blocks_1, detaching);
2286
+
2287
+ for (let i = 0; i < each_blocks.length; i += 1) {
2288
+ each_blocks[i].d();
2289
+ }
2382
2290
  }
2383
2291
  };
2384
2292
  }
2385
2293
 
2294
+ const padding$1 = 1000;
2295
+ const exteriorWallOffset$1 = 180;
2296
+
2386
2297
  function instance$h($$self, $$props, $$invalidate) {
2387
- let { content } = $$props;
2298
+ let { type } = $$props;
2299
+ let { data } = $$props;
2300
+ let { bounding } = $$props;
2301
+ const isRow = type === 'top' || type === 'bottom';
2302
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
2303
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
2388
2304
 
2389
- const svgStyle = `
2390
- <style>
2391
- svg [type='lineGroup'] path {
2392
- fill: #ffffff;
2393
- stroke: #ffffff;
2394
- }
2395
- svg [type='lineItemGroup'] g g g g {
2396
- stroke: #ffffff;
2397
- }</style>
2398
- `;
2305
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2306
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2307
+ // 筛除重复数据
2308
+ if (index === 0) return true;
2309
+
2310
+ return x !== arr[index - 1];
2311
+ });
2312
+
2313
+ const rulerLabels = rulerPoints.map(num => {
2314
+ const left = isRow
2315
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2316
+ : 0;
2317
+
2318
+ const bottom = !isRow
2319
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2320
+ : 0;
2321
+
2322
+ return { left, bottom };
2323
+ });
2324
+
2325
+ rulerLabels.unshift({ left: 0, bottom: 0 });
2326
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
2327
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
2328
+
2329
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
2330
+ const distance = index === 0 ? 0 : num - arr[index - 1];
2331
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
2332
+
2333
+ const left = isRow
2334
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2335
+ : 0;
2336
+
2337
+ const bottom = !isRow
2338
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2339
+ : 0;
2340
+
2341
+ return { left, bottom, distance };
2342
+ }).filter(({ distance }) => distance / length > 0.1);
2399
2343
 
2400
2344
  $$self.$$set = $$props => {
2401
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
2345
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
2346
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
2347
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
2402
2348
  };
2403
2349
 
2404
- return [content, svgStyle];
2350
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
2405
2351
  }
2406
2352
 
2407
- class SvgImage extends SvelteComponent {
2353
+ class RuleItem extends SvelteComponent {
2408
2354
  constructor(options) {
2409
2355
  super();
2410
- init(this, options, instance$h, create_fragment$h, safe_not_equal, { content: 0 }, add_css$d);
2356
+ init(this, options, instance$h, create_fragment$h, safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$d);
2411
2357
  }
2412
2358
  }
2413
2359
 
2414
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
2360
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
2415
2361
 
2416
2362
  function add_css$c(target) {
2417
- append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
2363
+ append_styles(target, "svelte-1mzj9p3", ".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}");
2418
2364
  }
2419
2365
 
2420
- // (13:22)
2421
- function create_if_block_1$3(ctx) {
2422
- let normalimage;
2366
+ function get_each_context$6(ctx, list, i) {
2367
+ const child_ctx = ctx.slice();
2368
+ child_ctx[12] = list[i][0];
2369
+ child_ctx[13] = list[i][1];
2370
+ return child_ctx;
2371
+ }
2372
+
2373
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
2374
+ function create_each_block$6(key_1, ctx) {
2375
+ let first;
2376
+ let ruleitem;
2423
2377
  let current;
2424
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
2425
2378
 
2426
- return {
2427
- c() {
2428
- create_component(normalimage.$$.fragment);
2429
- },
2430
- m(target, anchor) {
2431
- mount_component(normalimage, target, anchor);
2432
- current = true;
2433
- },
2434
- p(ctx, dirty) {
2435
- const normalimage_changes = {};
2436
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
2437
- normalimage.$set(normalimage_changes);
2438
- },
2439
- i(local) {
2440
- if (current) return;
2441
- transition_in(normalimage.$$.fragment, local);
2442
- current = true;
2443
- },
2444
- o(local) {
2445
- transition_out(normalimage.$$.fragment, local);
2446
- current = false;
2447
- },
2448
- d(detaching) {
2449
- destroy_component(normalimage, detaching);
2379
+ const ruleitem_spread_levels = [
2380
+ {
2381
+ type: /*type*/ ctx[12],
2382
+ data: /*data*/ ctx[13],
2383
+ bounding: /*bounding*/ ctx[0]
2450
2384
  }
2451
- };
2452
- }
2385
+ ];
2453
2386
 
2454
- // (11:2) {#if svgContent}
2455
- function create_if_block$5(ctx) {
2456
- let svgimage;
2457
- let current;
2387
+ let ruleitem_props = {};
2458
2388
 
2459
- svgimage = new SvgImage({
2460
- props: { content: /*svgContent*/ ctx[0] }
2461
- });
2389
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2390
+ ruleitem_props = assign(ruleitem_props, ruleitem_spread_levels[i]);
2391
+ }
2392
+
2393
+ ruleitem = new RuleItem({ props: ruleitem_props });
2462
2394
 
2463
2395
  return {
2396
+ key: key_1,
2397
+ first: null,
2464
2398
  c() {
2465
- create_component(svgimage.$$.fragment);
2399
+ first = empty();
2400
+ create_component(ruleitem.$$.fragment);
2401
+ this.first = first;
2466
2402
  },
2467
2403
  m(target, anchor) {
2468
- mount_component(svgimage, target, anchor);
2404
+ insert(target, first, anchor);
2405
+ mount_component(ruleitem, target, anchor);
2469
2406
  current = true;
2470
2407
  },
2471
- p(ctx, dirty) {
2472
- const svgimage_changes = {};
2473
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
2474
- svgimage.$set(svgimage_changes);
2408
+ p(new_ctx, dirty) {
2409
+ ctx = new_ctx;
2410
+
2411
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
2412
+ ? get_spread_update(ruleitem_spread_levels, [
2413
+ {
2414
+ type: /*type*/ ctx[12],
2415
+ data: /*data*/ ctx[13],
2416
+ bounding: /*bounding*/ ctx[0]
2417
+ }
2418
+ ])
2419
+ : {};
2420
+
2421
+ ruleitem.$set(ruleitem_changes);
2475
2422
  },
2476
2423
  i(local) {
2477
2424
  if (current) return;
2478
- transition_in(svgimage.$$.fragment, local);
2425
+ transition_in(ruleitem.$$.fragment, local);
2479
2426
  current = true;
2480
2427
  },
2481
2428
  o(local) {
2482
- transition_out(svgimage.$$.fragment, local);
2429
+ transition_out(ruleitem.$$.fragment, local);
2483
2430
  current = false;
2484
2431
  },
2485
2432
  d(detaching) {
2486
- destroy_component(svgimage, detaching);
2433
+ if (detaching) detach(first);
2434
+ destroy_component(ruleitem, detaching);
2487
2435
  }
2488
2436
  };
2489
2437
  }
2490
2438
 
2491
2439
  function create_fragment$g(ctx) {
2492
2440
  let div;
2493
- let current_block_type_index;
2494
- let if_block;
2441
+ let each_blocks = [];
2442
+ let each_1_lookup = new Map();
2495
2443
  let current;
2496
- const if_block_creators = [create_if_block$5, create_if_block_1$3];
2497
- const if_blocks = [];
2498
-
2499
- function select_block_type(ctx, dirty) {
2500
- if (/*svgContent*/ ctx[0]) return 0;
2501
- if (/*imageData*/ ctx[1]) return 1;
2502
- return -1;
2503
- }
2444
+ let each_value = /*ruleLabelArray*/ ctx[3];
2445
+ const get_key = ctx => /*type*/ ctx[12];
2504
2446
 
2505
- if (~(current_block_type_index = select_block_type(ctx))) {
2506
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2447
+ for (let i = 0; i < each_value.length; i += 1) {
2448
+ let child_ctx = get_each_context$6(ctx, each_value, i);
2449
+ let key = get_key(child_ctx);
2450
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
2507
2451
  }
2508
2452
 
2509
2453
  return {
2510
2454
  c() {
2511
2455
  div = element("div");
2512
- if (if_block) if_block.c();
2513
- attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
2456
+
2457
+ for (let i = 0; i < each_blocks.length; i += 1) {
2458
+ each_blocks[i].c();
2459
+ }
2460
+
2461
+ attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
2462
+ set_style(div, "width", /*width*/ ctx[2], false);
2463
+ set_style(div, "height", /*height*/ ctx[1], false);
2514
2464
  },
2515
2465
  m(target, anchor) {
2516
2466
  insert(target, div, anchor);
2517
2467
 
2518
- if (~current_block_type_index) {
2519
- if_blocks[current_block_type_index].m(div, null);
2468
+ for (let i = 0; i < each_blocks.length; i += 1) {
2469
+ each_blocks[i].m(div, null);
2520
2470
  }
2521
2471
 
2522
2472
  current = true;
2523
2473
  },
2524
2474
  p(ctx, [dirty]) {
2525
- let previous_block_index = current_block_type_index;
2526
- current_block_type_index = select_block_type(ctx);
2527
-
2528
- if (current_block_type_index === previous_block_index) {
2529
- if (~current_block_type_index) {
2530
- if_blocks[current_block_type_index].p(ctx, dirty);
2531
- }
2532
- } else {
2533
- if (if_block) {
2534
- group_outros();
2535
-
2536
- transition_out(if_blocks[previous_block_index], 1, 1, () => {
2537
- if_blocks[previous_block_index] = null;
2538
- });
2539
-
2540
- check_outros();
2541
- }
2542
-
2543
- if (~current_block_type_index) {
2544
- if_block = if_blocks[current_block_type_index];
2475
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
2476
+ each_value = /*ruleLabelArray*/ ctx[3];
2477
+ group_outros();
2478
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block$6, null, get_each_context$6);
2479
+ check_outros();
2480
+ }
2545
2481
 
2546
- if (!if_block) {
2547
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2548
- if_block.c();
2549
- } else {
2550
- if_block.p(ctx, dirty);
2551
- }
2482
+ if (dirty & /*width*/ 4) {
2483
+ set_style(div, "width", /*width*/ ctx[2], false);
2484
+ }
2552
2485
 
2553
- transition_in(if_block, 1);
2554
- if_block.m(div, null);
2555
- } else {
2556
- if_block = null;
2557
- }
2486
+ if (dirty & /*height*/ 2) {
2487
+ set_style(div, "height", /*height*/ ctx[1], false);
2558
2488
  }
2559
2489
  },
2560
2490
  i(local) {
2561
2491
  if (current) return;
2562
- transition_in(if_block);
2492
+
2493
+ for (let i = 0; i < each_value.length; i += 1) {
2494
+ transition_in(each_blocks[i]);
2495
+ }
2496
+
2563
2497
  current = true;
2564
2498
  },
2565
2499
  o(local) {
2566
- transition_out(if_block);
2500
+ for (let i = 0; i < each_blocks.length; i += 1) {
2501
+ transition_out(each_blocks[i]);
2502
+ }
2503
+
2567
2504
  current = false;
2568
2505
  },
2569
2506
  d(detaching) {
2570
2507
  if (detaching) detach(div);
2571
2508
 
2572
- if (~current_block_type_index) {
2573
- if_blocks[current_block_type_index].d();
2509
+ for (let i = 0; i < each_blocks.length; i += 1) {
2510
+ each_blocks[i].d();
2574
2511
  }
2575
2512
  }
2576
2513
  };
2577
2514
  }
2578
2515
 
2516
+ const padding = 1000;
2517
+ const exteriorWallOffset = 180;
2518
+
2579
2519
  function instance$g($$self, $$props, $$invalidate) {
2580
- let imageData;
2581
- let svgContent;
2582
- var _a, _b;
2520
+ let bounding;
2521
+ let ruleLabelData;
2522
+ let ruleLabelDataKeys;
2523
+ let ruleLabelArray;
2524
+ let boundingWidth;
2525
+ let boundingHeight;
2526
+ let contentWidth;
2527
+ let contentHeight;
2528
+ let width;
2529
+ let height;
2583
2530
  let { floorIndex } = $$props;
2584
2531
  let { floorplanData } = $$props;
2585
2532
 
2586
2533
  $$self.$$set = $$props => {
2587
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2588
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2534
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
2535
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
2589
2536
  };
2590
2537
 
2591
2538
  $$self.$$.update = () => {
2592
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2593
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
2539
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
2540
+ $$invalidate(0, bounding = floorplanData.bounding);
2594
2541
  }
2595
2542
 
2596
- if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
2597
- $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
2598
- ? void 0
2599
- : _a[floorIndex]) === null || _b === void 0
2600
- ? void 0
2601
- : _b.svgContent);
2543
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
2544
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
2545
+ }
2546
+
2547
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
2548
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
2549
+ }
2550
+
2551
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
2552
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2553
+ }
2554
+
2555
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2556
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
2557
+ }
2558
+
2559
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2560
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
2561
+ }
2562
+
2563
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2564
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
2565
+ }
2566
+
2567
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2568
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
2569
+ }
2570
+
2571
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
2572
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
2573
+ }
2574
+
2575
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
2576
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
2602
2577
  }
2603
2578
  };
2604
2579
 
2605
- return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
2580
+ return [
2581
+ bounding,
2582
+ height,
2583
+ width,
2584
+ ruleLabelArray,
2585
+ floorIndex,
2586
+ floorplanData,
2587
+ boundingHeight,
2588
+ contentHeight,
2589
+ boundingWidth,
2590
+ contentWidth,
2591
+ ruleLabelData,
2592
+ ruleLabelDataKeys
2593
+ ];
2606
2594
  }
2607
2595
 
2608
- class BaseImage extends SvelteComponent {
2596
+ class RuleLabels extends SvelteComponent {
2609
2597
  constructor(options) {
2610
2598
  super();
2611
- init(this, options, instance$g, create_fragment$g, safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$c);
2599
+ init(this, options, instance$g, create_fragment$g, safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$c);
2612
2600
  }
2613
2601
  }
2614
2602
 
@@ -2882,17 +2870,17 @@ function add_css$b(target) {
2882
2870
  append_styles(target, "svelte-1d4xj70", "svg.svelte-1d4xj70{position:absolute;width:100%;height:100%;overflow:visible}");
2883
2871
  }
2884
2872
 
2885
- function get_each_context$4(ctx, list, i) {
2873
+ function get_each_context$5(ctx, list, i) {
2886
2874
  const child_ctx = ctx.slice();
2887
- child_ctx[4] = list[i];
2875
+ child_ctx[5] = list[i];
2888
2876
  return child_ctx;
2889
2877
  }
2890
2878
 
2891
- // (18:6) {:else}
2879
+ // (19:6) {:else}
2892
2880
  function create_else_block(ctx) {
2893
2881
  let roommaterial_1;
2894
2882
  let current;
2895
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
2883
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
2896
2884
 
2897
2885
  return {
2898
2886
  c() {
@@ -2904,7 +2892,7 @@ function create_else_block(ctx) {
2904
2892
  },
2905
2893
  p(ctx, dirty) {
2906
2894
  const roommaterial_1_changes = {};
2907
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
2895
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
2908
2896
  roommaterial_1.$set(roommaterial_1_changes);
2909
2897
  },
2910
2898
  i(local) {
@@ -2922,11 +2910,11 @@ function create_else_block(ctx) {
2922
2910
  };
2923
2911
  }
2924
2912
 
2925
- // (16:37)
2913
+ // (17:37)
2926
2914
  function create_if_block_1$2(ctx) {
2927
2915
  let roommaterial_2;
2928
2916
  let current;
2929
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
2917
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
2930
2918
 
2931
2919
  return {
2932
2920
  c() {
@@ -2938,7 +2926,7 @@ function create_if_block_1$2(ctx) {
2938
2926
  },
2939
2927
  p(ctx, dirty) {
2940
2928
  const roommaterial_2_changes = {};
2941
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
2929
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
2942
2930
  roommaterial_2.$set(roommaterial_2_changes);
2943
2931
  },
2944
2932
  i(local) {
@@ -2956,11 +2944,11 @@ function create_if_block_1$2(ctx) {
2956
2944
  };
2957
2945
  }
2958
2946
 
2959
- // (14:6) {#if room.floorType === 1}
2947
+ // (15:6) {#if room.floorType === 1}
2960
2948
  function create_if_block$4(ctx) {
2961
2949
  let roommaterial_0;
2962
2950
  let current;
2963
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
2951
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
2964
2952
 
2965
2953
  return {
2966
2954
  c() {
@@ -2972,7 +2960,7 @@ function create_if_block$4(ctx) {
2972
2960
  },
2973
2961
  p(ctx, dirty) {
2974
2962
  const roommaterial_0_changes = {};
2975
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
2963
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
2976
2964
  roommaterial_0.$set(roommaterial_0_changes);
2977
2965
  },
2978
2966
  i(local) {
@@ -2990,18 +2978,19 @@ function create_if_block$4(ctx) {
2990
2978
  };
2991
2979
  }
2992
2980
 
2993
- // (12:2) {#each rooms as room}
2994
- function create_each_block$4(ctx) {
2981
+ // (13:2) {#each rooms as room}
2982
+ function create_each_block$5(ctx) {
2995
2983
  let svg;
2996
2984
  let current_block_type_index;
2997
2985
  let if_block;
2986
+ let svg_viewBox_value;
2998
2987
  let current;
2999
2988
  const if_block_creators = [create_if_block$4, create_if_block_1$2, create_else_block];
3000
2989
  const if_blocks = [];
3001
2990
 
3002
2991
  function select_block_type(ctx, dirty) {
3003
- if (/*room*/ ctx[4].floorType === 1) return 0;
3004
- if (/*room*/ ctx[4].floorType === 0) return 1;
2992
+ if (/*room*/ ctx[5].floorType === 1) return 0;
2993
+ if (/*room*/ ctx[5].floorType === 0) return 1;
3005
2994
  return 2;
3006
2995
  }
3007
2996
 
@@ -3012,6 +3001,9 @@ function create_each_block$4(ctx) {
3012
3001
  c() {
3013
3002
  svg = svg_element("svg");
3014
3003
  if_block.c();
3004
+ attr(svg, "width", "100%");
3005
+ attr(svg, "height", "100%");
3006
+ attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
3015
3007
  attr(svg, "class", "svelte-1d4xj70");
3016
3008
  },
3017
3009
  m(target, anchor) {
@@ -3069,7 +3061,7 @@ function create_fragment$c(ctx) {
3069
3061
  let each_blocks = [];
3070
3062
 
3071
3063
  for (let i = 0; i < each_value.length; i += 1) {
3072
- each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
3064
+ each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
3073
3065
  }
3074
3066
 
3075
3067
  const out = i => transition_out(each_blocks[i], 1, 1, () => {
@@ -3096,18 +3088,18 @@ function create_fragment$c(ctx) {
3096
3088
  current = true;
3097
3089
  },
3098
3090
  p(ctx, [dirty]) {
3099
- if (dirty & /*rooms*/ 1) {
3091
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
3100
3092
  each_value = /*rooms*/ ctx[0];
3101
3093
  let i;
3102
3094
 
3103
3095
  for (i = 0; i < each_value.length; i += 1) {
3104
- const child_ctx = get_each_context$4(ctx, each_value, i);
3096
+ const child_ctx = get_each_context$5(ctx, each_value, i);
3105
3097
 
3106
3098
  if (each_blocks[i]) {
3107
3099
  each_blocks[i].p(child_ctx, dirty);
3108
3100
  transition_in(each_blocks[i], 1);
3109
3101
  } else {
3110
- each_blocks[i] = create_each_block$4(child_ctx);
3102
+ each_blocks[i] = create_each_block$5(child_ctx);
3111
3103
  each_blocks[i].c();
3112
3104
  transition_in(each_blocks[i], 1);
3113
3105
  each_blocks[i].m(div, null);
@@ -3151,30 +3143,30 @@ function create_fragment$c(ctx) {
3151
3143
  function instance$c($$self, $$props, $$invalidate) {
3152
3144
  let rooms;
3153
3145
  let { floorIndex } = $$props;
3154
- let { pxmm } = $$props;
3155
3146
  let { floorplanData } = $$props;
3147
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3148
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3156
3149
 
3157
3150
  $$self.$$set = $$props => {
3158
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3159
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
3160
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3151
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
3152
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
3161
3153
  };
3162
3154
 
3163
3155
  $$self.$$.update = () => {
3164
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
3156
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
3165
3157
  $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
3166
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
3158
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
3167
3159
  })));
3168
3160
  }
3169
3161
  };
3170
3162
 
3171
- return [rooms, floorIndex, pxmm, floorplanData];
3163
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
3172
3164
  }
3173
3165
 
3174
3166
  class RoomMaterial extends SvelteComponent {
3175
3167
  constructor(options) {
3176
3168
  super();
3177
- init(this, options, instance$c, create_fragment$c, safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$b);
3169
+ init(this, options, instance$c, create_fragment$c, safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$b);
3178
3170
  }
3179
3171
  }
3180
3172
 
@@ -3207,55 +3199,52 @@ function create_fragment$b(ctx) {
3207
3199
  }
3208
3200
 
3209
3201
  function instance$b($$self, $$props, $$invalidate) {
3210
- let { pxmm } = $$props;
3211
3202
  let { room } = $$props;
3212
3203
  let { floorplanData } = $$props;
3213
3204
  const { bounding } = floorplanData;
3214
3205
 
3215
3206
  const _pathD = pathD(room.path, {
3216
3207
  needZ: true,
3217
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
3208
+ format: vector => formatFloorplanPoint(vector, bounding)
3218
3209
  });
3219
3210
 
3220
3211
  $$self.$$set = $$props => {
3221
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
3222
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
3223
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3212
+ if ('room' in $$props) $$invalidate(1, room = $$props.room);
3213
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3224
3214
  };
3225
3215
 
3226
- return [_pathD, pxmm, room, floorplanData];
3216
+ return [_pathD, room, floorplanData];
3227
3217
  }
3228
3218
 
3229
3219
  class Room extends SvelteComponent {
3230
3220
  constructor(options) {
3231
3221
  super();
3232
- init(this, options, instance$b, create_fragment$b, safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$a);
3222
+ init(this, options, instance$b, create_fragment$b, safe_not_equal, { room: 1, floorplanData: 2 }, add_css$a);
3233
3223
  }
3234
3224
  }
3235
3225
 
3236
3226
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
3237
3227
 
3238
3228
  function add_css$9(target) {
3239
- append_styles(target, "svelte-klfhwd", ".floorplan-plugin__room-highlight.svelte-klfhwd{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-klfhwd{width:100%;height:100%;overflow:visible}");
3229
+ append_styles(target, "svelte-1kqo6e4", ".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}");
3240
3230
  }
3241
3231
 
3242
- function get_each_context$3(ctx, list, i) {
3232
+ function get_each_context$4(ctx, list, i) {
3243
3233
  const child_ctx = ctx.slice();
3244
- child_ctx[12] = list[i];
3234
+ child_ctx[4] = list[i];
3245
3235
  return child_ctx;
3246
3236
  }
3247
3237
 
3248
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3249
- function create_each_block$3(key_1, ctx) {
3238
+ // (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3239
+ function create_each_block$4(key_1, ctx) {
3250
3240
  let first;
3251
3241
  let room;
3252
3242
  let current;
3253
3243
 
3254
3244
  const room_spread_levels = [
3255
3245
  {
3256
- room: /*room*/ ctx[12],
3257
- floorplanData: /*floorplanData*/ ctx[2],
3258
- pxmm: /*pxmm*/ ctx[0]
3246
+ room: /*room*/ ctx[4],
3247
+ floorplanData: /*floorplanData*/ ctx[1]
3259
3248
  }
3260
3249
  ];
3261
3250
 
@@ -3283,12 +3272,11 @@ function create_each_block$3(key_1, ctx) {
3283
3272
  p(new_ctx, dirty) {
3284
3273
  ctx = new_ctx;
3285
3274
 
3286
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
3275
+ const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
3287
3276
  ? get_spread_update(room_spread_levels, [
3288
3277
  {
3289
- room: /*room*/ ctx[12],
3290
- floorplanData: /*floorplanData*/ ctx[2],
3291
- pxmm: /*pxmm*/ ctx[0]
3278
+ room: /*room*/ ctx[4],
3279
+ floorplanData: /*floorplanData*/ ctx[1]
3292
3280
  }
3293
3281
  ])
3294
3282
  : {};
@@ -3316,17 +3304,14 @@ function create_fragment$a(ctx) {
3316
3304
  let svg;
3317
3305
  let each_blocks = [];
3318
3306
  let each_1_lookup = new Map();
3319
- let div_resize_listener;
3320
3307
  let current;
3321
- let mounted;
3322
- let dispose;
3323
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3324
- const get_key = ctx => /*room*/ ctx[12].id;
3308
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3309
+ const get_key = ctx => /*room*/ ctx[4].id;
3325
3310
 
3326
3311
  for (let i = 0; i < each_value.length; i += 1) {
3327
- let child_ctx = get_each_context$3(ctx, each_value, i);
3312
+ let child_ctx = get_each_context$4(ctx, each_value, i);
3328
3313
  let key = get_key(child_ctx);
3329
- each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
3314
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
3330
3315
  }
3331
3316
 
3332
3317
  return {
@@ -3338,9 +3323,11 @@ function create_fragment$a(ctx) {
3338
3323
  each_blocks[i].c();
3339
3324
  }
3340
3325
 
3341
- attr(svg, "class", "svelte-klfhwd");
3342
- attr(div, "class", "floorplan-plugin__room-highlight svelte-klfhwd");
3343
- add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
3326
+ attr(svg, "width", "100%");
3327
+ attr(svg, "height", "100%");
3328
+ attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
3329
+ attr(svg, "class", "svelte-1kqo6e4");
3330
+ attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
3344
3331
  },
3345
3332
  m(target, anchor) {
3346
3333
  insert(target, div, anchor);
@@ -3350,20 +3337,13 @@ function create_fragment$a(ctx) {
3350
3337
  each_blocks[i].m(svg, null);
3351
3338
  }
3352
3339
 
3353
- /*div_binding*/ ctx[9](div);
3354
- div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
3355
3340
  current = true;
3356
-
3357
- if (!mounted) {
3358
- dispose = listen(div, "click", /*handleClick*/ ctx[6]);
3359
- mounted = true;
3360
- }
3361
3341
  },
3362
3342
  p(ctx, [dirty]) {
3363
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
3364
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3343
+ if (dirty & /*floorplanData, floorIndex*/ 3) {
3344
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3365
3345
  group_outros();
3366
- each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, outro_and_destroy_block, create_each_block$3, null, get_each_context$3);
3346
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, outro_and_destroy_block, create_each_block$4, null, get_each_context$4);
3367
3347
  check_outros();
3368
3348
  }
3369
3349
  },
@@ -3389,127 +3369,46 @@ function create_fragment$a(ctx) {
3389
3369
  for (let i = 0; i < each_blocks.length; i += 1) {
3390
3370
  each_blocks[i].d();
3391
3371
  }
3392
-
3393
- /*div_binding*/ ctx[9](null);
3394
- div_resize_listener();
3395
- mounted = false;
3396
- dispose();
3397
3372
  }
3398
3373
  };
3399
3374
  }
3400
3375
 
3401
3376
  function instance$a($$self, $$props, $$invalidate) {
3402
- let { five } = $$props;
3403
- let { pxmm } = $$props;
3404
3377
  let { floorIndex } = $$props;
3405
3378
  let { floorplanData } = $$props;
3406
- let { onRoomHeightClick } = $$props;
3407
- let clientWidth;
3408
- let clientHeight;
3409
- let highlightContainerDom;
3410
- const { observers: floorplan_observers } = floorplanData;
3411
-
3412
- const handleClick = function (e) {
3413
- if ((onRoomHeightClick === null || onRoomHeightClick === void 0
3414
- ? void 0
3415
- : onRoomHeightClick(e)) === false) return;
3416
-
3417
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
3418
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
3419
-
3420
- const mouseClientVector = new Vector2(e.clientX, e.clientY);
3421
- const domTopLeftVector = new Vector2(boundingClientRect.left, boundingClientRect.top);
3422
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
3423
-
3424
- // px 转换为 百分比
3425
- const mouseOffsetRelativeVector = new Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
3426
-
3427
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
3428
- const position1 = new Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
3429
- const position2 = new Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
3430
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
3431
- })[0];
3432
-
3433
- five.moveToPano(closestPoint.index);
3434
- };
3435
-
3436
- function div_binding($$value) {
3437
- binding_callbacks[$$value ? 'unshift' : 'push'](() => {
3438
- highlightContainerDom = $$value;
3439
- $$invalidate(5, highlightContainerDom);
3440
- });
3441
- }
3442
-
3443
- function div_elementresize_handler() {
3444
- clientWidth = this.clientWidth;
3445
- clientHeight = this.clientHeight;
3446
- $$invalidate(3, clientWidth);
3447
- $$invalidate(4, clientHeight);
3448
- }
3379
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3380
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3449
3381
 
3450
3382
  $$self.$$set = $$props => {
3451
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
3452
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3453
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3454
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3455
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
3383
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
3384
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
3456
3385
  };
3457
3386
 
3458
- return [
3459
- pxmm,
3460
- floorIndex,
3461
- floorplanData,
3462
- clientWidth,
3463
- clientHeight,
3464
- highlightContainerDom,
3465
- handleClick,
3466
- five,
3467
- onRoomHeightClick,
3468
- div_binding,
3469
- div_elementresize_handler
3470
- ];
3387
+ return [floorIndex, floorplanData, boundingWidth, boundingHeight];
3471
3388
  }
3472
3389
 
3473
3390
  class RoomHighlight extends SvelteComponent {
3474
3391
  constructor(options) {
3475
3392
  super();
3476
-
3477
- init(
3478
- this,
3479
- options,
3480
- instance$a,
3481
- create_fragment$a,
3482
- safe_not_equal,
3483
- {
3484
- five: 7,
3485
- pxmm: 0,
3486
- floorIndex: 1,
3487
- floorplanData: 2,
3488
- onRoomHeightClick: 8
3489
- },
3490
- add_css$9
3491
- );
3393
+ init(this, options, instance$a, create_fragment$a, safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$9);
3492
3394
  }
3493
3395
  }
3494
3396
 
3495
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
3397
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
3496
3398
 
3497
3399
  function add_css$8(target) {
3498
- append_styles(target, "svelte-tlo7rk", ".floorplan-current-floor.svelte-tlo7rk{position:relative;width:100%;height:100%}");
3400
+ append_styles(target, "svelte-bl8zrz", ".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}");
3499
3401
  }
3500
3402
 
3501
- // (19:2) {#if hoverEnable}
3403
+ // (17:2) {#if hoverEnable}
3502
3404
  function create_if_block_2(ctx) {
3503
3405
  let roomhighlight;
3504
3406
  let current;
3505
3407
 
3506
3408
  const roomhighlight_spread_levels = [
3507
3409
  {
3508
- five: /*five*/ ctx[1],
3509
- pxmm: /*pxmm*/ ctx[0],
3510
- floorIndex: /*floorIndex*/ ctx[2],
3511
- floorplanData: /*floorplanData*/ ctx[6],
3512
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3410
+ floorIndex: /*floorIndex*/ ctx[1],
3411
+ floorplanData: /*floorplanData*/ ctx[5]
3513
3412
  }
3514
3413
  ];
3515
3414
 
@@ -3530,14 +3429,11 @@ function create_if_block_2(ctx) {
3530
3429
  current = true;
3531
3430
  },
3532
3431
  p(ctx, dirty) {
3533
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
3432
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3534
3433
  ? get_spread_update(roomhighlight_spread_levels, [
3535
3434
  {
3536
- five: /*five*/ ctx[1],
3537
- pxmm: /*pxmm*/ ctx[0],
3538
- floorIndex: /*floorIndex*/ ctx[2],
3539
- floorplanData: /*floorplanData*/ ctx[6],
3540
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3435
+ floorIndex: /*floorIndex*/ ctx[1],
3436
+ floorplanData: /*floorplanData*/ ctx[5]
3541
3437
  }
3542
3438
  ])
3543
3439
  : {};
@@ -3559,16 +3455,16 @@ function create_if_block_2(ctx) {
3559
3455
  };
3560
3456
  }
3561
3457
 
3562
- // (23:2) {#if roomLabelsEnable}
3458
+ // (21:2) {#if roomLabelsEnable}
3563
3459
  function create_if_block_1$1(ctx) {
3564
3460
  let roomlabels;
3565
3461
  let current;
3566
3462
 
3567
3463
  const roomlabels_spread_levels = [
3568
3464
  {
3569
- floorplanData: /*floorplanData*/ ctx[6],
3570
- floorIndex: /*floorIndex*/ ctx[2],
3571
- getLabelElement: /*getLabelElement*/ ctx[8]
3465
+ floorplanData: /*floorplanData*/ ctx[5],
3466
+ floorIndex: /*floorIndex*/ ctx[1],
3467
+ getLabelElement: /*getLabelElement*/ ctx[6]
3572
3468
  }
3573
3469
  ];
3574
3470
 
@@ -3589,12 +3485,12 @@ function create_if_block_1$1(ctx) {
3589
3485
  current = true;
3590
3486
  },
3591
3487
  p(ctx, dirty) {
3592
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
3488
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 98)
3593
3489
  ? get_spread_update(roomlabels_spread_levels, [
3594
3490
  {
3595
- floorplanData: /*floorplanData*/ ctx[6],
3596
- floorIndex: /*floorIndex*/ ctx[2],
3597
- getLabelElement: /*getLabelElement*/ ctx[8]
3491
+ floorplanData: /*floorplanData*/ ctx[5],
3492
+ floorIndex: /*floorIndex*/ ctx[1],
3493
+ getLabelElement: /*getLabelElement*/ ctx[6]
3598
3494
  }
3599
3495
  ])
3600
3496
  : {};
@@ -3616,16 +3512,15 @@ function create_if_block_1$1(ctx) {
3616
3512
  };
3617
3513
  }
3618
3514
 
3619
- // (26:2) {#if ruleLabelsEnable}
3515
+ // (24:2) {#if ruleLabelsEnable}
3620
3516
  function create_if_block$3(ctx) {
3621
3517
  let rulelabels;
3622
3518
  let current;
3623
3519
 
3624
3520
  const rulelabels_spread_levels = [
3625
3521
  {
3626
- floorplanData: /*floorplanData*/ ctx[6],
3627
- floorIndex: /*floorIndex*/ ctx[2],
3628
- pxmm: /*pxmm*/ ctx[0]
3522
+ floorplanData: /*floorplanData*/ ctx[5],
3523
+ floorIndex: /*floorIndex*/ ctx[1]
3629
3524
  }
3630
3525
  ];
3631
3526
 
@@ -3646,12 +3541,11 @@ function create_if_block$3(ctx) {
3646
3541
  current = true;
3647
3542
  },
3648
3543
  p(ctx, dirty) {
3649
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
3544
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3650
3545
  ? get_spread_update(rulelabels_spread_levels, [
3651
3546
  {
3652
- floorplanData: /*floorplanData*/ ctx[6],
3653
- floorIndex: /*floorIndex*/ ctx[2],
3654
- pxmm: /*pxmm*/ ctx[0]
3547
+ floorplanData: /*floorplanData*/ ctx[5],
3548
+ floorIndex: /*floorIndex*/ ctx[1]
3655
3549
  }
3656
3550
  ])
3657
3551
  : {};
@@ -3681,13 +3575,13 @@ function create_fragment$9(ctx) {
3681
3575
  let baseimage;
3682
3576
  let t2;
3683
3577
  let t3;
3578
+ let div_class_value;
3684
3579
  let current;
3685
3580
 
3686
3581
  const roommaterial_spread_levels = [
3687
3582
  {
3688
- floorIndex: /*floorIndex*/ ctx[2],
3689
- floorplanData: /*floorplanData*/ ctx[6],
3690
- pxmm: /*pxmm*/ ctx[0]
3583
+ floorIndex: /*floorIndex*/ ctx[1],
3584
+ floorplanData: /*floorplanData*/ ctx[5]
3691
3585
  }
3692
3586
  ];
3693
3587
 
@@ -3698,12 +3592,12 @@ function create_fragment$9(ctx) {
3698
3592
  }
3699
3593
 
3700
3594
  roommaterial = new RoomMaterial({ props: roommaterial_props });
3701
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
3595
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
3702
3596
 
3703
3597
  const baseimage_spread_levels = [
3704
3598
  {
3705
- floorplanData: /*floorplanData*/ ctx[6],
3706
- floorIndex: /*floorIndex*/ ctx[2]
3599
+ floorplanData: /*floorplanData*/ ctx[5],
3600
+ floorIndex: /*floorIndex*/ ctx[1]
3707
3601
  }
3708
3602
  ];
3709
3603
 
@@ -3714,8 +3608,8 @@ function create_fragment$9(ctx) {
3714
3608
  }
3715
3609
 
3716
3610
  baseimage = new BaseImage({ props: baseimage_props });
3717
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
3718
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$3(ctx);
3611
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
3612
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$3(ctx);
3719
3613
 
3720
3614
  return {
3721
3615
  c() {
@@ -3729,7 +3623,10 @@ function create_fragment$9(ctx) {
3729
3623
  if (if_block1) if_block1.c();
3730
3624
  t3 = space();
3731
3625
  if (if_block2) if_block2.c();
3732
- attr(div, "class", "floorplan-current-floor svelte-tlo7rk");
3626
+
3627
+ attr(div, "class", div_class_value = "" + (null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3628
+ ? ' floorplan-plugin__floor--is-current'
3629
+ : ''}`) + " svelte-bl8zrz"));
3733
3630
  },
3734
3631
  m(target, anchor) {
3735
3632
  insert(target, div, anchor);
@@ -3745,23 +3642,22 @@ function create_fragment$9(ctx) {
3745
3642
  current = true;
3746
3643
  },
3747
3644
  p(ctx, [dirty]) {
3748
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
3645
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3749
3646
  ? get_spread_update(roommaterial_spread_levels, [
3750
3647
  {
3751
- floorIndex: /*floorIndex*/ ctx[2],
3752
- floorplanData: /*floorplanData*/ ctx[6],
3753
- pxmm: /*pxmm*/ ctx[0]
3648
+ floorIndex: /*floorIndex*/ ctx[1],
3649
+ floorplanData: /*floorplanData*/ ctx[5]
3754
3650
  }
3755
3651
  ])
3756
3652
  : {};
3757
3653
 
3758
3654
  roommaterial.$set(roommaterial_changes);
3759
3655
 
3760
- if (/*hoverEnable*/ ctx[3]) {
3656
+ if (/*hoverEnable*/ ctx[2]) {
3761
3657
  if (if_block0) {
3762
3658
  if_block0.p(ctx, dirty);
3763
3659
 
3764
- if (dirty & /*hoverEnable*/ 8) {
3660
+ if (dirty & /*hoverEnable*/ 4) {
3765
3661
  transition_in(if_block0, 1);
3766
3662
  }
3767
3663
  } else {
@@ -3780,22 +3676,22 @@ function create_fragment$9(ctx) {
3780
3676
  check_outros();
3781
3677
  }
3782
3678
 
3783
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
3679
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3784
3680
  ? get_spread_update(baseimage_spread_levels, [
3785
3681
  {
3786
- floorplanData: /*floorplanData*/ ctx[6],
3787
- floorIndex: /*floorIndex*/ ctx[2]
3682
+ floorplanData: /*floorplanData*/ ctx[5],
3683
+ floorIndex: /*floorIndex*/ ctx[1]
3788
3684
  }
3789
3685
  ])
3790
3686
  : {};
3791
3687
 
3792
3688
  baseimage.$set(baseimage_changes);
3793
3689
 
3794
- if (/*roomLabelsEnable*/ ctx[4]) {
3690
+ if (/*roomLabelsEnable*/ ctx[3]) {
3795
3691
  if (if_block1) {
3796
3692
  if_block1.p(ctx, dirty);
3797
3693
 
3798
- if (dirty & /*roomLabelsEnable*/ 16) {
3694
+ if (dirty & /*roomLabelsEnable*/ 8) {
3799
3695
  transition_in(if_block1, 1);
3800
3696
  }
3801
3697
  } else {
@@ -3814,11 +3710,11 @@ function create_fragment$9(ctx) {
3814
3710
  check_outros();
3815
3711
  }
3816
3712
 
3817
- if (/*ruleLabelsEnable*/ ctx[5]) {
3713
+ if (/*ruleLabelsEnable*/ ctx[4]) {
3818
3714
  if (if_block2) {
3819
3715
  if_block2.p(ctx, dirty);
3820
3716
 
3821
- if (dirty & /*ruleLabelsEnable*/ 32) {
3717
+ if (dirty & /*ruleLabelsEnable*/ 16) {
3822
3718
  transition_in(if_block2, 1);
3823
3719
  }
3824
3720
  } else {
@@ -3836,6 +3732,12 @@ function create_fragment$9(ctx) {
3836
3732
 
3837
3733
  check_outros();
3838
3734
  }
3735
+
3736
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3737
+ ? ' floorplan-plugin__floor--is-current'
3738
+ : ''}`) + " svelte-bl8zrz"))) {
3739
+ attr(div, "class", div_class_value);
3740
+ }
3839
3741
  },
3840
3742
  i(local) {
3841
3743
  if (current) return;
@@ -3866,37 +3768,31 @@ function create_fragment$9(ctx) {
3866
3768
  }
3867
3769
 
3868
3770
  function instance$9($$self, $$props, $$invalidate) {
3869
- let { pxmm } = $$props;
3870
- let { five } = $$props;
3771
+ let { isCurrent } = $$props;
3871
3772
  let { floorIndex } = $$props;
3872
3773
  let { hoverEnable } = $$props;
3873
3774
  let { roomLabelsEnable } = $$props;
3874
3775
  let { ruleLabelsEnable } = $$props;
3875
3776
  let { floorplanData } = $$props;
3876
- let { onRoomHeightClick } = $$props;
3877
3777
  let { getLabelElement } = $$props;
3878
3778
 
3879
3779
  $$self.$$set = $$props => {
3880
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3881
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
3882
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
3883
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
3884
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
3885
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
3886
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
3887
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
3888
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
3780
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
3781
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3782
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
3783
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
3784
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
3785
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
3786
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
3889
3787
  };
3890
3788
 
3891
3789
  return [
3892
- pxmm,
3893
- five,
3790
+ isCurrent,
3894
3791
  floorIndex,
3895
3792
  hoverEnable,
3896
3793
  roomLabelsEnable,
3897
3794
  ruleLabelsEnable,
3898
3795
  floorplanData,
3899
- onRoomHeightClick,
3900
3796
  getLabelElement
3901
3797
  ];
3902
3798
  }
@@ -3912,65 +3808,56 @@ class CurrentFloor$1 extends SvelteComponent {
3912
3808
  create_fragment$9,
3913
3809
  safe_not_equal,
3914
3810
  {
3915
- pxmm: 0,
3916
- five: 1,
3917
- floorIndex: 2,
3918
- hoverEnable: 3,
3919
- roomLabelsEnable: 4,
3920
- ruleLabelsEnable: 5,
3921
- floorplanData: 6,
3922
- onRoomHeightClick: 7,
3923
- getLabelElement: 8
3811
+ isCurrent: 0,
3812
+ floorIndex: 1,
3813
+ hoverEnable: 2,
3814
+ roomLabelsEnable: 3,
3815
+ ruleLabelsEnable: 4,
3816
+ floorplanData: 5,
3817
+ getLabelElement: 6
3924
3818
  },
3925
3819
  add_css$8
3926
3820
  );
3927
3821
  }
3928
3822
  }
3929
3823
 
3930
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
3824
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
3931
3825
 
3932
3826
  function add_css$7(target) {
3933
3827
  append_styles(target, "svelte-q5wdnn", ".floorplan-main.svelte-q5wdnn{width:100%;height:100%}");
3934
3828
  }
3935
3829
 
3936
- // (24:0) {#if visible}
3830
+ function get_each_context$3(ctx, list, i) {
3831
+ const child_ctx = ctx.slice();
3832
+ child_ctx[13] = list[i];
3833
+ return child_ctx;
3834
+ }
3835
+
3836
+ // (21:0) {#if visible}
3937
3837
  function create_if_block$2(ctx) {
3938
3838
  let div;
3939
- let currentfloor;
3940
3839
  let t0;
3941
3840
  let camera;
3942
3841
  let t1;
3943
3842
  let div_intro;
3944
3843
  let current;
3844
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
3845
+ let each_blocks = [];
3945
3846
 
3946
- const currentfloor_spread_levels = [
3947
- {
3948
- five: /*five*/ ctx[2],
3949
- pxmm: /*pxmm*/ ctx[1],
3950
- floorIndex: /*floorIndex*/ ctx[6],
3951
- hoverEnable: /*hoverEnable*/ ctx[7],
3952
- floorplanData: /*floorplanData*/ ctx[11],
3953
- getLabelElement: /*getLabelElement*/ ctx[15],
3954
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
3955
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
3956
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3957
- }
3958
- ];
3959
-
3960
- let currentfloor_props = {};
3961
-
3962
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
3963
- currentfloor_props = assign(currentfloor_props, currentfloor_spread_levels[i]);
3847
+ for (let i = 0; i < each_value.length; i += 1) {
3848
+ each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
3964
3849
  }
3965
3850
 
3966
- currentfloor = new CurrentFloor$1({ props: currentfloor_props });
3851
+ const out = i => transition_out(each_blocks[i], 1, 1, () => {
3852
+ each_blocks[i] = null;
3853
+ });
3967
3854
 
3968
3855
  const camera_spread_levels = [
3969
3856
  {
3970
- panoIndex: /*panoIndex*/ ctx[5],
3971
- floorplanData: /*floorplanData*/ ctx[11],
3972
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
3973
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3857
+ panoIndex: /*panoIndex*/ ctx[3],
3858
+ floorplanData: /*floorplanData*/ ctx[9],
3859
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3860
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
3974
3861
  }
3975
3862
  ];
3976
3863
 
@@ -3981,12 +3868,16 @@ function create_if_block$2(ctx) {
3981
3868
  }
3982
3869
 
3983
3870
  camera = new Camera$1({ props: camera_props });
3984
- let if_block = /*compassEnable*/ ctx[8] && create_if_block_1(ctx);
3871
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
3985
3872
 
3986
3873
  return {
3987
3874
  c() {
3988
3875
  div = element("div");
3989
- create_component(currentfloor.$$.fragment);
3876
+
3877
+ for (let i = 0; i < each_blocks.length; i += 1) {
3878
+ each_blocks[i].c();
3879
+ }
3880
+
3990
3881
  t0 = space();
3991
3882
  create_component(camera.$$.fragment);
3992
3883
  t1 = space();
@@ -3995,7 +3886,11 @@ function create_if_block$2(ctx) {
3995
3886
  },
3996
3887
  m(target, anchor) {
3997
3888
  insert(target, div, anchor);
3998
- mount_component(currentfloor, div, null);
3889
+
3890
+ for (let i = 0; i < each_blocks.length; i += 1) {
3891
+ each_blocks[i].m(div, null);
3892
+ }
3893
+
3999
3894
  append(div, t0);
4000
3895
  mount_component(camera, div, null);
4001
3896
  append(div, t1);
@@ -4005,42 +3900,51 @@ function create_if_block$2(ctx) {
4005
3900
  p(new_ctx, dirty) {
4006
3901
  ctx = new_ctx;
4007
3902
 
4008
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 52934)
4009
- ? get_spread_update(currentfloor_spread_levels, [
4010
- {
4011
- five: /*five*/ ctx[2],
4012
- pxmm: /*pxmm*/ ctx[1],
4013
- floorIndex: /*floorIndex*/ ctx[6],
4014
- hoverEnable: /*hoverEnable*/ ctx[7],
4015
- floorplanData: /*floorplanData*/ ctx[11],
4016
- getLabelElement: /*getLabelElement*/ ctx[15],
4017
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
4018
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
4019
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3903
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040) {
3904
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
3905
+ let i;
3906
+
3907
+ for (i = 0; i < each_value.length; i += 1) {
3908
+ const child_ctx = get_each_context$3(ctx, each_value, i);
3909
+
3910
+ if (each_blocks[i]) {
3911
+ each_blocks[i].p(child_ctx, dirty);
3912
+ transition_in(each_blocks[i], 1);
3913
+ } else {
3914
+ each_blocks[i] = create_each_block$3(child_ctx);
3915
+ each_blocks[i].c();
3916
+ transition_in(each_blocks[i], 1);
3917
+ each_blocks[i].m(div, t0);
4020
3918
  }
4021
- ])
4022
- : {};
3919
+ }
4023
3920
 
4024
- currentfloor.$set(currentfloor_changes);
3921
+ group_outros();
3922
+
3923
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
3924
+ out(i);
3925
+ }
3926
+
3927
+ check_outros();
3928
+ }
4025
3929
 
4026
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 14368)
3930
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
4027
3931
  ? get_spread_update(camera_spread_levels, [
4028
3932
  {
4029
- panoIndex: /*panoIndex*/ ctx[5],
4030
- floorplanData: /*floorplanData*/ ctx[11],
4031
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
4032
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3933
+ panoIndex: /*panoIndex*/ ctx[3],
3934
+ floorplanData: /*floorplanData*/ ctx[9],
3935
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3936
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
4033
3937
  }
4034
3938
  ])
4035
3939
  : {};
4036
3940
 
4037
3941
  camera.$set(camera_changes);
4038
3942
 
4039
- if (/*compassEnable*/ ctx[8]) {
3943
+ if (/*compassEnable*/ ctx[6]) {
4040
3944
  if (if_block) {
4041
3945
  if_block.p(ctx, dirty);
4042
3946
 
4043
- if (dirty & /*compassEnable*/ 256) {
3947
+ if (dirty & /*compassEnable*/ 64) {
4044
3948
  transition_in(if_block, 1);
4045
3949
  }
4046
3950
  } else {
@@ -4061,14 +3965,18 @@ function create_if_block$2(ctx) {
4061
3965
  },
4062
3966
  i(local) {
4063
3967
  if (current) return;
4064
- transition_in(currentfloor.$$.fragment, local);
3968
+
3969
+ for (let i = 0; i < each_value.length; i += 1) {
3970
+ transition_in(each_blocks[i]);
3971
+ }
3972
+
4065
3973
  transition_in(camera.$$.fragment, local);
4066
3974
  transition_in(if_block);
4067
3975
 
4068
3976
  if (!div_intro) {
4069
3977
  add_render_callback(() => {
4070
3978
  div_intro = create_in_transition(div, fade, {
4071
- duration: /*duration*/ ctx[3],
3979
+ duration: /*duration*/ ctx[0],
4072
3980
  easing: linear
4073
3981
  });
4074
3982
 
@@ -4079,29 +3987,107 @@ function create_if_block$2(ctx) {
4079
3987
  current = true;
4080
3988
  },
4081
3989
  o(local) {
4082
- transition_out(currentfloor.$$.fragment, local);
3990
+ each_blocks = each_blocks.filter(Boolean);
3991
+
3992
+ for (let i = 0; i < each_blocks.length; i += 1) {
3993
+ transition_out(each_blocks[i]);
3994
+ }
3995
+
4083
3996
  transition_out(camera.$$.fragment, local);
4084
3997
  transition_out(if_block);
4085
3998
  current = false;
4086
3999
  },
4087
4000
  d(detaching) {
4088
4001
  if (detaching) detach(div);
4089
- destroy_component(currentfloor);
4002
+ destroy_each(each_blocks, detaching);
4090
4003
  destroy_component(camera);
4091
4004
  if (if_block) if_block.d();
4092
4005
  }
4093
4006
  };
4094
4007
  }
4095
4008
 
4096
- // (40:4) {#if compassEnable}
4009
+ // (23:4) {#each floorplanData.floorDatas as floorData}
4010
+ function create_each_block$3(ctx) {
4011
+ let currentfloor;
4012
+ let current;
4013
+
4014
+ const currentfloor_spread_levels = [
4015
+ {
4016
+ hoverEnable: /*hoverEnable*/ ctx[5],
4017
+ floorplanData: /*floorplanData*/ ctx[9],
4018
+ getLabelElement: /*getLabelElement*/ ctx[12],
4019
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4020
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4021
+ },
4022
+ {
4023
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4024
+ },
4025
+ {
4026
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4027
+ }
4028
+ ];
4029
+
4030
+ let currentfloor_props = {};
4031
+
4032
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
4033
+ currentfloor_props = assign(currentfloor_props, currentfloor_spread_levels[i]);
4034
+ }
4035
+
4036
+ currentfloor = new CurrentFloor$1({ props: currentfloor_props });
4037
+
4038
+ return {
4039
+ c() {
4040
+ create_component(currentfloor.$$.fragment);
4041
+ },
4042
+ m(target, anchor) {
4043
+ mount_component(currentfloor, target, anchor);
4044
+ current = true;
4045
+ },
4046
+ p(ctx, dirty) {
4047
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040)
4048
+ ? get_spread_update(currentfloor_spread_levels, [
4049
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable*/ 5024 && {
4050
+ hoverEnable: /*hoverEnable*/ ctx[5],
4051
+ floorplanData: /*floorplanData*/ ctx[9],
4052
+ getLabelElement: /*getLabelElement*/ ctx[12],
4053
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4054
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4055
+ },
4056
+ dirty & /*floorplanData*/ 512 && {
4057
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4058
+ },
4059
+ dirty & /*floorplanData, floorIndex*/ 528 && {
4060
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4061
+ }
4062
+ ])
4063
+ : {};
4064
+
4065
+ currentfloor.$set(currentfloor_changes);
4066
+ },
4067
+ i(local) {
4068
+ if (current) return;
4069
+ transition_in(currentfloor.$$.fragment, local);
4070
+ current = true;
4071
+ },
4072
+ o(local) {
4073
+ transition_out(currentfloor.$$.fragment, local);
4074
+ current = false;
4075
+ },
4076
+ d(detaching) {
4077
+ destroy_component(currentfloor, detaching);
4078
+ }
4079
+ };
4080
+ }
4081
+
4082
+ // (37:4) {#if compassEnable}
4097
4083
  function create_if_block_1(ctx) {
4098
4084
  let compass;
4099
4085
  let current;
4100
4086
 
4101
4087
  compass = new Compass({
4102
4088
  props: {
4103
- floorplanData: /*floorplanData*/ ctx[11],
4104
- northDesc: /*northDesc*/ ctx[0]
4089
+ floorplanData: /*floorplanData*/ ctx[9],
4090
+ northDesc: /*northDesc*/ ctx[2]
4105
4091
  }
4106
4092
  });
4107
4093
 
@@ -4115,8 +4101,8 @@ function create_if_block_1(ctx) {
4115
4101
  },
4116
4102
  p(ctx, dirty) {
4117
4103
  const compass_changes = {};
4118
- if (dirty & /*floorplanData*/ 2048) compass_changes.floorplanData = /*floorplanData*/ ctx[11];
4119
- if (dirty & /*northDesc*/ 1) compass_changes.northDesc = /*northDesc*/ ctx[0];
4104
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
4105
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
4120
4106
  compass.$set(compass_changes);
4121
4107
  },
4122
4108
  i(local) {
@@ -4137,7 +4123,7 @@ function create_if_block_1(ctx) {
4137
4123
  function create_fragment$8(ctx) {
4138
4124
  let if_block_anchor;
4139
4125
  let current;
4140
- let if_block = /*visible*/ ctx[4] && create_if_block$2(ctx);
4126
+ let if_block = /*visible*/ ctx[1] && create_if_block$2(ctx);
4141
4127
 
4142
4128
  return {
4143
4129
  c() {
@@ -4150,11 +4136,11 @@ function create_fragment$8(ctx) {
4150
4136
  current = true;
4151
4137
  },
4152
4138
  p(ctx, [dirty]) {
4153
- if (/*visible*/ ctx[4]) {
4139
+ if (/*visible*/ ctx[1]) {
4154
4140
  if (if_block) {
4155
4141
  if_block.p(ctx, dirty);
4156
4142
 
4157
- if (dirty & /*visible*/ 16) {
4143
+ if (dirty & /*visible*/ 2) {
4158
4144
  transition_in(if_block, 1);
4159
4145
  }
4160
4146
  } else {
@@ -4190,11 +4176,9 @@ function create_fragment$8(ctx) {
4190
4176
  }
4191
4177
 
4192
4178
  function instance$8($$self, $$props, $$invalidate) {
4193
- let { northDesc } = $$props;
4194
- let { pxmm } = $$props;
4195
- let { five } = $$props;
4196
4179
  let { duration = 0 } = $$props;
4197
4180
  let { visible } = $$props;
4181
+ let { northDesc } = $$props;
4198
4182
  let { panoIndex } = $$props;
4199
4183
  let { floorIndex } = $$props;
4200
4184
  let { hoverEnable } = $$props;
@@ -4204,34 +4188,28 @@ function instance$8($$self, $$props, $$invalidate) {
4204
4188
  let { floorplanData } = $$props;
4205
4189
  let { lastPanoramaLongitude } = $$props;
4206
4190
  let { cameraImageUrl } = $$props;
4207
- let { onRoomHeightClick } = $$props;
4208
4191
  let { getLabelElement } = $$props;
4209
4192
 
4210
4193
  $$self.$$set = $$props => {
4211
- if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
4212
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
4213
- if ('five' in $$props) $$invalidate(2, five = $$props.five);
4214
- if ('duration' in $$props) $$invalidate(3, duration = $$props.duration);
4215
- if ('visible' in $$props) $$invalidate(4, visible = $$props.visible);
4216
- if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
4217
- if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
4218
- if ('hoverEnable' in $$props) $$invalidate(7, hoverEnable = $$props.hoverEnable);
4219
- if ('compassEnable' in $$props) $$invalidate(8, compassEnable = $$props.compassEnable);
4220
- if ('roomLabelsEnable' in $$props) $$invalidate(9, roomLabelsEnable = $$props.roomLabelsEnable);
4221
- if ('ruleLabelsEnable' in $$props) $$invalidate(10, ruleLabelsEnable = $$props.ruleLabelsEnable);
4222
- if ('floorplanData' in $$props) $$invalidate(11, floorplanData = $$props.floorplanData);
4223
- if ('lastPanoramaLongitude' in $$props) $$invalidate(12, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4224
- if ('cameraImageUrl' in $$props) $$invalidate(13, cameraImageUrl = $$props.cameraImageUrl);
4225
- if ('onRoomHeightClick' in $$props) $$invalidate(14, onRoomHeightClick = $$props.onRoomHeightClick);
4226
- if ('getLabelElement' in $$props) $$invalidate(15, getLabelElement = $$props.getLabelElement);
4194
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
4195
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
4196
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
4197
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
4198
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
4199
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
4200
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
4201
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
4202
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
4203
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
4204
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4205
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
4206
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
4227
4207
  };
4228
4208
 
4229
4209
  return [
4230
- northDesc,
4231
- pxmm,
4232
- five,
4233
4210
  duration,
4234
4211
  visible,
4212
+ northDesc,
4235
4213
  panoIndex,
4236
4214
  floorIndex,
4237
4215
  hoverEnable,
@@ -4241,7 +4219,6 @@ function instance$8($$self, $$props, $$invalidate) {
4241
4219
  floorplanData,
4242
4220
  lastPanoramaLongitude,
4243
4221
  cameraImageUrl,
4244
- onRoomHeightClick,
4245
4222
  getLabelElement
4246
4223
  ];
4247
4224
  }
@@ -4257,22 +4234,19 @@ class Main$1 extends SvelteComponent {
4257
4234
  create_fragment$8,
4258
4235
  safe_not_equal,
4259
4236
  {
4260
- northDesc: 0,
4261
- pxmm: 1,
4262
- five: 2,
4263
- duration: 3,
4264
- visible: 4,
4265
- panoIndex: 5,
4266
- floorIndex: 6,
4267
- hoverEnable: 7,
4268
- compassEnable: 8,
4269
- roomLabelsEnable: 9,
4270
- ruleLabelsEnable: 10,
4271
- floorplanData: 11,
4272
- lastPanoramaLongitude: 12,
4273
- cameraImageUrl: 13,
4274
- onRoomHeightClick: 14,
4275
- getLabelElement: 15
4237
+ duration: 0,
4238
+ visible: 1,
4239
+ northDesc: 2,
4240
+ panoIndex: 3,
4241
+ floorIndex: 4,
4242
+ hoverEnable: 5,
4243
+ compassEnable: 6,
4244
+ roomLabelsEnable: 7,
4245
+ ruleLabelsEnable: 8,
4246
+ floorplanData: 9,
4247
+ lastPanoramaLongitude: 10,
4248
+ cameraImageUrl: 11,
4249
+ getLabelElement: 12
4276
4250
  },
4277
4251
  add_css$7
4278
4252
  );
@@ -4382,32 +4356,58 @@ class TopviewFloorplanPluginController {
4382
4356
  value: () => {
4383
4357
  var _a, _b;
4384
4358
  this.hide();
4385
- (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
4386
- (_b = this.app) === null || _b === void 0 ? void 0 : _b.$destroy();
4387
- this.five.off('modeChange', this.handleModeChange);
4388
- this.five.off('panoArrived', this.handlePanoArrived);
4389
- this.five.off('modelLoaded', this.handleModelLoaded);
4390
- this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
4391
- this.five.off('wantsPanGesture', this.handleWantsPanGesture);
4392
- this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
4359
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
4360
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
4361
+ this.five.off('modeChange', this.onFiveModeChange);
4362
+ this.five.off('panGesture', this.onFivePanGesture);
4363
+ this.five.off('panoArrived', this.onFivePanoArrived);
4364
+ this.five.off('modelLoaded', this.onFiveModelLoaded);
4365
+ this.five.off('pinchGesture', this.onFivePinchGesture);
4366
+ this.five.off('wantsGesture', this.onFiveWantsGesture);
4367
+ this.five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
4368
+ this.five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
4393
4369
  this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
4394
4370
  }
4395
4371
  });
4396
- /** 模型楼层高亮改变时,自动进行楼层切换 */
4372
+ Object.defineProperty(this, "onFiveWantsMoveToPano", {
4373
+ enumerable: true,
4374
+ configurable: true,
4375
+ writable: true,
4376
+ value: () => {
4377
+ if (this.visible && this.configs.preventRoomClick)
4378
+ return false;
4379
+ }
4380
+ });
4381
+ Object.defineProperty(this, "onFiveWantsGesture", {
4382
+ enumerable: true,
4383
+ configurable: true,
4384
+ writable: true,
4385
+ value: (type) => {
4386
+ if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
4387
+ return;
4388
+ if (this.visible && !this.configs.gestureEnable)
4389
+ return false;
4390
+ }
4391
+ });
4397
4392
  Object.defineProperty(this, "onModelShownFloorChange", {
4398
4393
  enumerable: true,
4399
4394
  configurable: true,
4400
4395
  writable: true,
4401
4396
  value: (shownFloor) => {
4402
- if (shownFloor === null)
4397
+ if (this.floorIndex === shownFloor)
4403
4398
  return;
4399
+ if (shownFloor === null) {
4400
+ const panoIndex = this.five.getCurrentState().panoIndex;
4401
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
4402
+ return;
4403
+ }
4404
+ // 模型楼层高亮改变时,自动进行楼层切换
4404
4405
  this.floorIndex = shownFloor;
4405
4406
  this.updateSize();
4406
4407
  this.render();
4407
4408
  }
4408
4409
  });
4409
- /** panoIndex 改变时,更新 floorIndex */
4410
- Object.defineProperty(this, "handlePanoArrived", {
4410
+ Object.defineProperty(this, "onFivePanoArrived", {
4411
4411
  enumerable: true,
4412
4412
  configurable: true,
4413
4413
  writable: true,
@@ -4419,31 +4419,28 @@ class TopviewFloorplanPluginController {
4419
4419
  this.floorIndex = this.five.work.observers[index].floorIndex;
4420
4420
  }
4421
4421
  });
4422
- /** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
4423
- Object.defineProperty(this, "handleWantsMoveToPano", {
4422
+ Object.defineProperty(this, "onFivePanGesture", {
4424
4423
  enumerable: true,
4425
4424
  configurable: true,
4426
4425
  writable: true,
4427
4426
  value: () => {
4428
4427
  if (!this.visible)
4429
4428
  return;
4430
- if (this.configs.preventRoomClick)
4431
- return false;
4432
- return;
4429
+ this.updatePosition();
4433
4430
  }
4434
4431
  });
4435
- /** 在户型图展示时阻止 Five 滑动行为 */
4436
- Object.defineProperty(this, "handleWantsPanGesture", {
4432
+ Object.defineProperty(this, "onFivePinchGesture", {
4437
4433
  enumerable: true,
4438
4434
  configurable: true,
4439
4435
  writable: true,
4440
4436
  value: () => {
4441
4437
  if (!this.visible)
4442
4438
  return;
4443
- return false;
4439
+ this.updatePosition();
4440
+ this.updateSize();
4444
4441
  }
4445
4442
  });
4446
- Object.defineProperty(this, "handleModelLoaded", {
4443
+ Object.defineProperty(this, "onFiveModelLoaded", {
4447
4444
  enumerable: true,
4448
4445
  configurable: true,
4449
4446
  writable: true,
@@ -4460,7 +4457,7 @@ class TopviewFloorplanPluginController {
4460
4457
  }
4461
4458
  });
4462
4459
  /** 非 Topview 态隐藏户型图 */
4463
- Object.defineProperty(this, "handleModeChange", {
4460
+ Object.defineProperty(this, "onFiveModeChange", {
4464
4461
  enumerable: true,
4465
4462
  configurable: true,
4466
4463
  writable: true,
@@ -4470,7 +4467,7 @@ class TopviewFloorplanPluginController {
4470
4467
  }
4471
4468
  });
4472
4469
  /** 动画结束后是 Topview 态就展示户型图 */
4473
- Object.defineProperty(this, "handleInitAnimationEnded", {
4470
+ Object.defineProperty(this, "onFiveInitAnimationEnded", {
4474
4471
  enumerable: true,
4475
4472
  configurable: true,
4476
4473
  writable: true,
@@ -4510,24 +4507,30 @@ class TopviewFloorplanPluginController {
4510
4507
  this.five = five;
4511
4508
  this.selector = params.selector;
4512
4509
  this.configs = omit(params, ['selector']);
4510
+ this.five.addExtraElement(this.container);
4513
4511
  // 设置 container 样式
4514
4512
  this.container.classList.add('floorplan-plugin');
4515
4513
  Object.assign(this.container.style, pluginStyle$1);
4516
4514
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
4517
- this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
4515
+ this.five.model.loaded
4516
+ ? this.onFiveModelLoaded()
4517
+ : five.once('modelLoaded', this.onFiveModelLoaded);
4518
4518
  this.five.once('dispose', this.dispose);
4519
- this.five.on('modeChange', this.handleModeChange);
4520
- this.five.on('panoArrived', this.handlePanoArrived);
4521
- this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
4519
+ this.five.on('modeChange', this.onFiveModeChange);
4520
+ this.five.on('panGesture', this.onFivePanGesture);
4521
+ this.five.on('mouseWheel', this.onFivePinchGesture);
4522
+ this.five.on('panoArrived', this.onFivePanoArrived);
4523
+ this.five.on('pinchGesture', this.onFivePinchGesture);
4524
+ this.five.on('wantsGesture', this.onFiveWantsGesture);
4525
+ this.five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
4526
+ this.five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
4522
4527
  this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
4523
4528
  }
4524
4529
  /** 加载户型图数据 */
4525
- load(data) {
4526
- return __awaiter(this, void 0, void 0, function* () {
4527
- const copyData = JSON.parse(JSON.stringify(data));
4528
- this.floorplanData = yield formatData(copyData);
4529
- this.render();
4530
- });
4530
+ async load(data) {
4531
+ const copyData = JSON.parse(JSON.stringify(data));
4532
+ this.floorplanData = await formatData(copyData);
4533
+ this.render();
4531
4534
  }
4532
4535
  /** 把插件的渲染DOM插入到对应的容器中去 */
4533
4536
  appendTo(wrapper) {
@@ -4538,6 +4541,7 @@ class TopviewFloorplanPluginController {
4538
4541
  show() {
4539
4542
  this.visible = true;
4540
4543
  this.five.model.show(this.floorIndex);
4544
+ this.updatePosition();
4541
4545
  this.updateSize();
4542
4546
  const renderDuration = 500;
4543
4547
  const modelOpacity = this.configs.modelOpacity;
@@ -4545,8 +4549,6 @@ class TopviewFloorplanPluginController {
4545
4549
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4546
4550
  }
4547
4551
  this.render(renderDuration);
4548
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4549
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4550
4552
  }
4551
4553
  hide() {
4552
4554
  const modelOpacity = 1;
@@ -4554,20 +4556,28 @@ class TopviewFloorplanPluginController {
4554
4556
  this.visible = false;
4555
4557
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4556
4558
  this.render();
4557
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4558
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4559
+ }
4560
+ /** 更新户型图位置 */
4561
+ updatePosition() {
4562
+ var _a;
4563
+ const modelCenter = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE.Vector3());
4564
+ if (!modelCenter)
4565
+ return;
4566
+ const ndcModelCenter = modelCenter.clone().project(this.five.camera);
4567
+ const left = (ndcModelCenter.x + 1) / 2;
4568
+ const top = -(ndcModelCenter.y - 1) / 2;
4569
+ this.container.style.left = left * 100 + '%';
4570
+ this.container.style.top = top * 100 + '%';
4559
4571
  }
4560
4572
  render(duration) {
4561
4573
  if (!this.container || !this.floorplanData)
4562
4574
  return;
4563
4575
  if (this.size.width === 0)
4564
4576
  return;
4565
- const { northDesc, getLabelElement, cameraImageUrl, preventRoomClick, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4566
- const handleClick = preventRoomClick ? () => false : undefined;
4577
+ const { northDesc, getLabelElement, cameraImageUrl, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4567
4578
  const props = {
4579
+ getLabelElement,
4568
4580
  northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4569
- five: this.five,
4570
- pxmm: this.pxmm,
4571
4581
  cameraImageUrl,
4572
4582
  visible: this.visible,
4573
4583
  duration: duration !== null && duration !== void 0 ? duration : 0,
@@ -4579,8 +4589,6 @@ class TopviewFloorplanPluginController {
4579
4589
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
4580
4590
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
4581
4591
  lastPanoramaLongitude: this.lastPanoramaLongitude,
4582
- getLabelElement,
4583
- onRoomHeightClick: handleClick,
4584
4592
  };
4585
4593
  if (!this.app) {
4586
4594
  this.app = new Main$1({
@@ -5462,9 +5470,9 @@ class PanoFloorplanRadarPluginController {
5462
5470
  enumerable: true,
5463
5471
  configurable: true,
5464
5472
  writable: true,
5465
- value: (data) => __awaiter(this, void 0, void 0, function* () {
5473
+ value: async (data) => {
5466
5474
  const copyData = JSON.parse(JSON.stringify(data));
5467
- const floorplanData = yield formatData(copyData);
5475
+ const floorplanData = await formatData(copyData);
5468
5476
  this.data = floorplanData;
5469
5477
  // const loadImage = async () => {
5470
5478
  // const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
@@ -5482,7 +5490,7 @@ class PanoFloorplanRadarPluginController {
5482
5490
  // }
5483
5491
  // await loadImage()
5484
5492
  this.render();
5485
- })
5493
+ }
5486
5494
  });
5487
5495
  this.five = five;
5488
5496
  (params === null || params === void 0 ? void 0 : params.configs) && Object.assign(this.configs, params.configs);
@@ -5542,24 +5550,37 @@ const PanoFloorplanRadarPlugin = (five, params) => {
5542
5550
  return new PanoFloorplanRadarPluginController(five, params);
5543
5551
  };
5544
5552
 
5553
+ var FloorplanErrorType;
5554
+ (function (FloorplanErrorType) {
5555
+ FloorplanErrorType["UnknownError"] = "UnknowError";
5556
+ FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5557
+ FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5558
+ FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5559
+ FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5560
+ FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5561
+ FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5562
+ })(FloorplanErrorType || (FloorplanErrorType = {}));
5563
+ /** 户型图展示 & 模型消失的默认时间 */
5564
+ const SHOW_ANIME_DURATION = 500;
5565
+ /** Five camera 默认 fov */
5566
+ const FIVE_CAMERA_DEFAULT_FOV = 80;
5567
+
5545
5568
  /**
5546
5569
  * 传入一个 Promise
5547
5570
  * 无异常,返回 [null, data]
5548
5571
  * 有异常,则返回 [Error, undefined]
5549
5572
  * 用于替代 try&catch 处理 await 异常的方案
5550
5573
  */
5551
- function to(promise) {
5552
- return __awaiter(this, void 0, void 0, function* () {
5553
- try {
5554
- const data = yield promise;
5555
- return [null, data];
5556
- }
5557
- catch (error) {
5558
- if (error instanceof Error)
5559
- return [error, null];
5560
- return [new Error(''), null];
5561
- }
5562
- });
5574
+ async function to(promise) {
5575
+ try {
5576
+ const data = await promise;
5577
+ return [null, data];
5578
+ }
5579
+ catch (error) {
5580
+ if (error instanceof Error)
5581
+ return [error, null];
5582
+ return [new Error(''), null];
5583
+ }
5563
5584
  }
5564
5585
 
5565
5586
  /**
@@ -5667,38 +5688,21 @@ function equal(value, other, opt = { deep: false }) {
5667
5688
  return isDeepEqual(value, other);
5668
5689
  }
5669
5690
 
5670
- function changeMode(five, ...changeModeParams) {
5671
- return __awaiter(this, void 0, void 0, function* () {
5672
- const [changeModeError] = yield to(five.changeMode(...changeModeParams));
5673
- if (changeModeError)
5674
- throw changeModeError;
5675
- yield new Promise((reslove, reject) => {
5676
- five.once('initAnimationEnded', reslove);
5677
- const handleModeChange = (mode) => {
5678
- if (mode !== changeModeParams[0])
5679
- reject('changeMode 被中断');
5680
- five.off('modeChange', handleModeChange);
5681
- };
5682
- five.on('modeChange', handleModeChange);
5683
- });
5691
+ async function changeMode(five, ...changeModeParams) {
5692
+ const [changeModeError] = await to(five.changeMode(...changeModeParams));
5693
+ if (changeModeError)
5694
+ throw changeModeError;
5695
+ await new Promise((reslove, reject) => {
5696
+ five.once('initAnimationEnded', reslove);
5697
+ const handleModeChange = (mode) => {
5698
+ if (mode !== changeModeParams[0])
5699
+ reject('changeMode 被中断');
5700
+ five.off('modeChange', handleModeChange);
5701
+ };
5702
+ five.on('modeChange', handleModeChange);
5684
5703
  });
5685
5704
  }
5686
5705
 
5687
- var FloorplanErrorType;
5688
- (function (FloorplanErrorType) {
5689
- FloorplanErrorType["UnknownError"] = "UnknowError";
5690
- FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5691
- FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5692
- FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5693
- FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5694
- FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5695
- FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5696
- })(FloorplanErrorType || (FloorplanErrorType = {}));
5697
- /** 户型图展示 & 模型消失的默认时间 */
5698
- const SHOW_ANIME_DURATION = 500;
5699
- /** Five camera 默认 fov */
5700
- const FIVE_CAMERA_DEFAULT_FOV = 80;
5701
-
5702
5706
  /**
5703
5707
  * 比较两个数字近似相等
5704
5708
  * @param num1 数字1
@@ -5725,32 +5729,30 @@ function checkShowState(five, showState) {
5725
5729
  * 2. 内置了相应的动画时间计算
5726
5730
  * 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
5727
5731
  */
5728
- function correctFiveState(five, showState, userAction = true) {
5729
- return __awaiter(this, void 0, void 0, function* () {
5730
- // 当前已满足状态,不需要变更
5732
+ async function correctFiveState(five, showState, userAction = true) {
5733
+ // 当前已满足状态,不需要变更
5734
+ const result = checkShowState(five, showState);
5735
+ if (result === true)
5736
+ return;
5737
+ // 纠正 mode
5738
+ if (five.currentMode !== Five.Mode.Floorplan) {
5739
+ const [changeModeError] = await to(changeMode(five, Five.Mode.Floorplan, showState, undefined, userAction));
5740
+ if (changeModeError)
5741
+ throw changeModeError;
5742
+ // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5731
5743
  const result = checkShowState(five, showState);
5732
- if (result === true)
5733
- return;
5734
- // 纠正 mode
5735
- if (five.currentMode !== Five.Mode.Floorplan) {
5736
- const [changeModeError] = yield to(changeMode(five, Five.Mode.Floorplan, showState, undefined, userAction));
5737
- if (changeModeError)
5738
- throw changeModeError;
5739
- // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5740
- const result = checkShowState(five, showState);
5741
- if (result === false)
5742
- throw new Error(FloorplanErrorType.ChangeModeError);
5743
- return;
5744
- }
5745
- // 纠正相机状态
5746
- // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5747
- const { latitude, longitude, fov } = five.getCurrentState();
5748
- const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
5749
- const [updateCameraError] = yield to(five.updateCamera(showState, time, userAction));
5750
- if (updateCameraError)
5751
- throw new Error(FloorplanErrorType.UpdateCameraError);
5744
+ if (result === false)
5745
+ throw new Error(FloorplanErrorType.ChangeModeError);
5752
5746
  return;
5753
- });
5747
+ }
5748
+ // 纠正相机状态
5749
+ // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5750
+ const { latitude, longitude, fov } = five.getCurrentState();
5751
+ const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
5752
+ const [updateCameraError] = await to(five.updateCamera(showState, time, userAction));
5753
+ if (updateCameraError)
5754
+ throw new Error(FloorplanErrorType.UpdateCameraError);
5755
+ return;
5754
5756
  }
5755
5757
 
5756
5758
  const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
@@ -5939,12 +5941,12 @@ class ModelFloorplanPluginController {
5939
5941
  enumerable: true,
5940
5942
  configurable: true,
5941
5943
  writable: true,
5942
- value: (opts) => __awaiter(this, void 0, void 0, function* () {
5943
- var _b, _c;
5944
+ value: async (opts) => {
5945
+ var _a, _b;
5944
5946
  // 已经在展示中了
5945
5947
  if (!this.showPromise && this.visible)
5946
5948
  return true;
5947
- if (!((_b = this.five.model) === null || _b === void 0 ? void 0 : _b.loaded))
5949
+ if (!((_a = this.five.model) === null || _a === void 0 ? void 0 : _a.loaded))
5948
5950
  throw new Error(FloorplanErrorType.ModelNotLoaded);
5949
5951
  if (!this.floorplanData)
5950
5952
  throw new Error(FloorplanErrorType.DataNotLoaded);
@@ -5954,18 +5956,18 @@ class ModelFloorplanPluginController {
5954
5956
  if (!!this.showPromise && sameWithLastOpts)
5955
5957
  return this.showPromise;
5956
5958
  if (!!this.showPromise && !sameWithLastOpts)
5957
- (_c = this.showRejection) === null || _c === void 0 ? void 0 : _c.call(this, FloorplanErrorType.DifferentShowParams);
5959
+ (_b = this.showRejection) === null || _b === void 0 ? void 0 : _b.call(this, FloorplanErrorType.DifferentShowParams);
5958
5960
  }
5959
5961
  this.ModelFloorplanPluginsShowOpts = opts;
5960
- const getShowPromise = () => __awaiter(this, void 0, void 0, function* () {
5961
- var _d, _e;
5962
+ const getShowPromise = async () => {
5963
+ var _a, _b;
5962
5964
  let hasRejected = false;
5963
5965
  let externalErrorMsg;
5964
5966
  this.showRejection = (errorMsg) => {
5965
5967
  hasRejected = true;
5966
5968
  externalErrorMsg = errorMsg;
5967
5969
  };
5968
- const [correctError] = yield to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
5970
+ const [correctError] = await to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
5969
5971
  if (correctError)
5970
5972
  throw correctError;
5971
5973
  // 异步结束要判断当前是不是被中断了,是不是调用了隐藏
@@ -5984,7 +5986,7 @@ class ModelFloorplanPluginController {
5984
5986
  this.floorIndex = opts.floorIndex;
5985
5987
  this.five.model.show(this.floorIndex);
5986
5988
  // 模型消失, 渲染户型图
5987
- const modelOpacity = (_e = (_d = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _d !== void 0 ? _d : this.configs.modelOpacity) !== null && _e !== void 0 ? _e : 1;
5989
+ const modelOpacity = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _a !== void 0 ? _a : this.configs.modelOpacity) !== null && _b !== void 0 ? _b : 1;
5988
5990
  const renderDuration = (opts === null || opts === void 0 ? void 0 : opts.immediately) ? 0 : SHOW_ANIME_DURATION;
5989
5991
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
5990
5992
  this.render(renderDuration);
@@ -5992,7 +5994,7 @@ class ModelFloorplanPluginController {
5992
5994
  this.five.on('wantsGesture', this.handleWantsGesture);
5993
5995
  this.five.on('wantsTapGesture', this.handleWantsTapGesture);
5994
5996
  return true;
5995
- });
5997
+ };
5996
5998
  const showPromise = getShowPromise()
5997
5999
  .then(() => {
5998
6000
  var _a;
@@ -6014,7 +6016,7 @@ class ModelFloorplanPluginController {
6014
6016
  });
6015
6017
  this.showPromise = showPromise;
6016
6018
  return showPromise;
6017
- })
6019
+ }
6018
6020
  });
6019
6021
  /** 隐藏户型图 */
6020
6022
  Object.defineProperty(this, "hide", {
@@ -6044,8 +6046,13 @@ class ModelFloorplanPluginController {
6044
6046
  configurable: true,
6045
6047
  writable: true,
6046
6048
  value: (shownFloor) => {
6047
- if (shownFloor === null)
6049
+ if (this.floorIndex === shownFloor)
6048
6050
  return;
6051
+ if (shownFloor === null) {
6052
+ const panoIndex = this.five.getCurrentState().panoIndex;
6053
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
6054
+ return;
6055
+ }
6049
6056
  this.floorIndex = shownFloor;
6050
6057
  this.updateSize();
6051
6058
  this.render();
@@ -6158,7 +6165,9 @@ class ModelFloorplanPluginController {
6158
6165
  enumerable: true,
6159
6166
  configurable: true,
6160
6167
  writable: true,
6161
- value: ({ latitude, longitude }, isFinal) => __awaiter(this, void 0, void 0, function* () {
6168
+ value: async ({ latitude, longitude }, isFinal) => {
6169
+ if (this.five.getCurrentState().mode !== 'Floorplan')
6170
+ return;
6162
6171
  if (this.configs.autoShowEnable === false)
6163
6172
  return;
6164
6173
  // 如果操作结束后,户型图还在展示中,初始化模型状态
@@ -6179,16 +6188,16 @@ class ModelFloorplanPluginController {
6179
6188
  const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
6180
6189
  if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
6181
6190
  // 当手指离开时需要等惯性结束之后在进行判断
6182
- const handleInteriaPan = (any, isFinal) => __awaiter(this, void 0, void 0, function* () {
6191
+ const handleInteriaPan = async (any, isFinal) => {
6183
6192
  if (!isFinal)
6184
6193
  return;
6185
6194
  this.five.off('interiaPan', handleInteriaPan);
6186
- yield this.show({ isAutoShow: true });
6187
- });
6195
+ await this.show({ isAutoShow: true });
6196
+ };
6188
6197
  this.five.on('interiaPan', handleInteriaPan);
6189
6198
  return;
6190
6199
  }
6191
- })
6200
+ }
6192
6201
  });
6193
6202
  this.five = five;
6194
6203
  this.hooks = new Subscribe();
@@ -6202,9 +6211,9 @@ class ModelFloorplanPluginController {
6202
6211
  left: '50%',
6203
6212
  top: '50%',
6204
6213
  transform: 'translate(-50%, -50%)',
6205
- pointerEvents: 'none',
6206
6214
  zIndex: 10,
6207
6215
  });
6216
+ this.five.addExtraElement(this.container);
6208
6217
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
6209
6218
  this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
6210
6219
  five.once('dispose', this.dispose);
@@ -6215,12 +6224,10 @@ class ModelFloorplanPluginController {
6215
6224
  five.on('modelShownFloorChange', this.onModelShownFloorChange);
6216
6225
  }
6217
6226
  /** 加载户型图数据 */
6218
- load(data) {
6219
- return __awaiter(this, void 0, void 0, function* () {
6220
- const copyData = JSON.parse(JSON.stringify(data));
6221
- this.floorplanData = yield formatData(copyData);
6222
- this.render();
6223
- });
6227
+ async load(data) {
6228
+ const copyData = JSON.parse(JSON.stringify(data));
6229
+ this.floorplanData = await formatData(copyData);
6230
+ this.render();
6224
6231
  }
6225
6232
  /** 把插件的渲染DOM插入到对应的容器中去 */
6226
6233
  appendTo(wrapper) {
@@ -6231,8 +6238,6 @@ class ModelFloorplanPluginController {
6231
6238
  /** 更改户型图楼层 */
6232
6239
  changeFloor(floorIndex) {
6233
6240
  this.five.model.show(floorIndex);
6234
- this.floorIndex = floorIndex;
6235
- this.render();
6236
6241
  }
6237
6242
  changeConfigs(params) {
6238
6243
  Object.assign(this.configs, params);
@@ -6247,10 +6252,9 @@ class ModelFloorplanPluginController {
6247
6252
  return;
6248
6253
  const { northDesc, hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
6249
6254
  const props = {
6250
- northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6251
- five: this.five,
6252
- pxmm: this.pxmm,
6253
6255
  cameraImageUrl,
6256
+ getLabelElement,
6257
+ northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6254
6258
  visible: this.visible,
6255
6259
  duration: duration !== null && duration !== void 0 ? duration : 0,
6256
6260
  panoIndex: this.panoIndex,
@@ -6261,8 +6265,6 @@ class ModelFloorplanPluginController {
6261
6265
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
6262
6266
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
6263
6267
  lastPanoramaLongitude: this.lastPanoramaLongitude,
6264
- getLabelElement,
6265
- onRoomHeightClick: this.handleClick,
6266
6268
  };
6267
6269
  if (!this.app) {
6268
6270
  this.app = new Main$1({
@@ -6332,7 +6334,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6332
6334
  const defaultNorthRad = params.north_rad || undefined;
6333
6335
  // 局部状态
6334
6336
  const state = {};
6335
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6337
+ const load = async (data) => {
6336
6338
  const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
6337
6339
  const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
6338
6340
  if (!northRad) {
@@ -6343,7 +6345,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6343
6345
  const zOffset = bounding.max.z - bounding.min.z;
6344
6346
  const maxOffset = Math.max(xOffset, zOffset);
6345
6347
  const fbxLoader = new FBXLoader();
6346
- const object = yield fbxLoader.loadAsync(fbxUrl);
6348
+ const object = await fbxLoader.loadAsync(fbxUrl);
6347
6349
  transfromToMeshBasicMaterial(object, {
6348
6350
  transparent: true,
6349
6351
  side: THREE.DoubleSide,
@@ -6357,7 +6359,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6357
6359
  bject3d2LocalMatrix(object, { position, rotation, scale });
6358
6360
  state.object = object;
6359
6361
  return true;
6360
- });
6362
+ };
6361
6363
  const onCameraUpdate = ({ latitude }) => {
6362
6364
  if (!state.object)
6363
6365
  return;
@@ -6427,25 +6429,25 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
6427
6429
  const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
6428
6430
  const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
6429
6431
  const mixers = [];
6430
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6431
- var _d, _e, _f, _g, _h, _j, _k;
6432
- const position = (_d = data === null || data === void 0 ? void 0 : data.position) !== null && _d !== void 0 ? _d : defaultModelPosition;
6432
+ const load = async (data) => {
6433
+ var _a, _b, _c, _d, _e, _f, _g;
6434
+ const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
6433
6435
  if (!position)
6434
6436
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
6435
6437
  const modelPosition = transformPositionToVector3(position);
6436
- const rad = (_e = data === null || data === void 0 ? void 0 : data.rad) !== null && _e !== void 0 ? _e : defaultRad;
6437
- const fbxUrl = (_f = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _f !== void 0 ? _f : defaultFbxUrl;
6438
+ const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
6439
+ const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
6438
6440
  state.rad = rad;
6439
6441
  if (rad === undefined)
6440
6442
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
6441
6443
  // 加载模型
6442
- const object = yield new FBXLoader().loadAsync(fbxUrl);
6444
+ const object = await new FBXLoader().loadAsync(fbxUrl);
6443
6445
  // 设置位置
6444
6446
  object.position.copy(modelPosition);
6445
6447
  object.rotation.z = rad;
6446
6448
  object.scale.set(0.8, 0.8, 0.8);
6447
6449
  transfromToMeshBasicMaterial(object, { transparent: true, side: THREE.DoubleSide });
6448
- const textMesh = (_k = (_j = (_h = (_g = object.children) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.children) === null || _j === void 0 ? void 0 : _j[3]) === null || _k === void 0 ? void 0 : _k.clone();
6450
+ const textMesh = (_g = (_f = (_e = (_d = object.children) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.children) === null || _f === void 0 ? void 0 : _f[3]) === null || _g === void 0 ? void 0 : _g.clone();
6449
6451
  if (!textMesh)
6450
6452
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
6451
6453
  textMesh.material = new MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
@@ -6453,7 +6455,7 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
6453
6455
  object.children[0].add(textMesh);
6454
6456
  state.object = object;
6455
6457
  return true;
6456
- });
6458
+ };
6457
6459
  const initAnimation = () => {
6458
6460
  if (state.animation)
6459
6461
  return;
@@ -6690,21 +6692,21 @@ const getLongitudeParams = (from, to, rotation) => {
6690
6692
  */
6691
6693
  const CameraMovementPlugin = (five) => {
6692
6694
  const state = {};
6693
- const move = (args, duration, opts = { preload: true }) => __awaiter(void 0, void 0, void 0, function* () {
6695
+ const move = async (args, duration, opts = { preload: true }) => {
6694
6696
  if (state.interruptCallback) {
6695
6697
  state.interruptCallback(false);
6696
6698
  }
6697
6699
  if (opts.asyncStartCallback) {
6698
- yield opts.asyncStartCallback();
6700
+ await opts.asyncStartCallback();
6699
6701
  }
6700
6702
  if (args.mode && args.mode !== five.currentMode) {
6701
- yield five.changeMode(args.mode);
6703
+ await five.changeMode(args.mode);
6702
6704
  }
6703
6705
  if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
6704
- yield five.preloadPano(args.panoIndex);
6706
+ await five.preloadPano(args.panoIndex);
6705
6707
  }
6706
6708
  if (opts.asyncEndCallback) {
6707
- yield opts.asyncEndCallback();
6709
+ await opts.asyncEndCallback();
6708
6710
  }
6709
6711
  if (args.panoIndex === undefined &&
6710
6712
  args.fov === undefined &&
@@ -6712,7 +6714,7 @@ const CameraMovementPlugin = (five) => {
6712
6714
  args.longitude === undefined) {
6713
6715
  return true;
6714
6716
  }
6715
- return yield new Promise((resolve, reject) => {
6717
+ return await new Promise((resolve, reject) => {
6716
6718
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex;
6717
6719
  if (panoIndex !== undefined) {
6718
6720
  five.moveToPano(panoIndex, Object.assign({
@@ -6725,7 +6727,7 @@ const CameraMovementPlugin = (five) => {
6725
6727
  reject(false);
6726
6728
  }
6727
6729
  });
6728
- });
6730
+ };
6729
6731
  const getAnimeParams = (args) => {
6730
6732
  const currentFiveState = five.state;
6731
6733
  // latitude
@@ -6741,20 +6743,20 @@ const CameraMovementPlugin = (five) => {
6741
6743
  to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
6742
6744
  };
6743
6745
  };
6744
- const rotate = (args, duration, opts = {}) => __awaiter(void 0, void 0, void 0, function* () {
6746
+ const rotate = async (args, duration, opts = {}) => {
6745
6747
  if (state.interruptCallback) {
6746
6748
  state.interruptCallback(false);
6747
6749
  }
6748
6750
  if (opts.asyncStartCallback) {
6749
- yield opts.asyncStartCallback();
6751
+ await opts.asyncStartCallback();
6750
6752
  }
6751
6753
  if (five.currentMode !== Five.Mode.Panorama) {
6752
- yield five.changeMode(Five.Mode.Panorama);
6754
+ await five.changeMode(Five.Mode.Panorama);
6753
6755
  }
6754
6756
  if (args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
6755
6757
  if (opts.preload)
6756
- yield five.preloadPano(args.panoIndex);
6757
- yield new Promise((resolve, reject) => {
6758
+ await five.preloadPano(args.panoIndex);
6759
+ await new Promise((resolve, reject) => {
6758
6760
  if (!args.panoIndex) {
6759
6761
  resolve(true);
6760
6762
  return;
@@ -6766,10 +6768,10 @@ const CameraMovementPlugin = (five) => {
6766
6768
  });
6767
6769
  }
6768
6770
  if (opts.asyncEndCallback) {
6769
- yield opts.asyncEndCallback();
6771
+ await opts.asyncEndCallback();
6770
6772
  }
6771
6773
  const { from, to } = getAnimeParams(args);
6772
- return yield new Promise((resolve) => {
6774
+ return await new Promise((resolve) => {
6773
6775
  const onUpdate = ({ progress }) => {
6774
6776
  const state = {};
6775
6777
  state.longitude = progressNumber(from.longitude, to.longitude, progress);
@@ -6811,7 +6813,7 @@ const CameraMovementPlugin = (five) => {
6811
6813
  state.interruptCallback(true);
6812
6814
  }, duration);
6813
6815
  });
6814
- });
6816
+ };
6815
6817
  return {
6816
6818
  move,
6817
6819
  rotate,
@@ -7170,7 +7172,7 @@ const PanoRulerPlugin = (five, params) => {
7170
7172
  state.loaded = true;
7171
7173
  return true;
7172
7174
  };
7173
- const load = (_roomInfo, _roomRules, options) => __awaiter(void 0, void 0, void 0, function* () {
7175
+ const load = async (_roomInfo, _roomRules, options) => {
7174
7176
  const roomInfo = _roomInfo || params.roomInfo;
7175
7177
  const roomRules = _roomRules || params.roomRules;
7176
7178
  if (!roomInfo || !roomRules) {
@@ -7181,9 +7183,9 @@ const PanoRulerPlugin = (five, params) => {
7181
7183
  return _load(roomInfo, roomRules);
7182
7184
  }
7183
7185
  else {
7184
- return yield new Promise((resolve) => five.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7186
+ return await new Promise((resolve) => five.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7185
7187
  }
7186
- });
7188
+ };
7187
7189
  if (params.roomInfo && params.roomRules) {
7188
7190
  load(params.roomInfo, params.roomRules);
7189
7191
  }
@@ -7448,14 +7450,12 @@ function getRoomInfoInstance() {
7448
7450
  }
7449
7451
 
7450
7452
  const textureLoader = new THREE.TextureLoader();
7451
- function loadTexture(url) {
7452
- return __awaiter(this, void 0, void 0, function* () {
7453
- return new Promise((resolve, reject) => {
7454
- textureLoader.load(url, resolve, undefined, reject);
7455
- }).then((texture) => {
7456
- texture.encoding = THREE.sRGBEncoding;
7457
- return texture;
7458
- });
7453
+ async function loadTexture(url) {
7454
+ return new Promise((resolve, reject) => {
7455
+ textureLoader.load(url, resolve, undefined, reject);
7456
+ }).then((texture) => {
7457
+ texture.encoding = THREE.sRGBEncoding;
7458
+ return texture;
7459
7459
  });
7460
7460
  }
7461
7461
 
@@ -7695,65 +7695,59 @@ class PanoCompassController {
7695
7695
  if (this.modelLoaded)
7696
7696
  this.init();
7697
7697
  }
7698
- init() {
7699
- return __awaiter(this, void 0, void 0, function* () {
7700
- if (!this.data || !this.modelLoaded)
7701
- return;
7702
- const northRad = this.data.north_rad;
7703
- if (northRad != null) {
7704
- this.compassMesh = yield this.loadCompassMesh();
7705
- this.compassMesh.rotateX(-Math.PI / 2);
7706
- this.compassMesh.rotateZ(northRad - Math.PI / 2);
7707
- this.group.add(this.compassMesh);
7708
- }
7709
- if (this.data.entrance != null) {
7710
- this.entryDoorMesh = yield this.loadEntryDoorMesh();
7711
- this.roomInfoWrapperInstance = this.loadRoomInfo();
7712
- this.roomInfoInstance = getRoomInfoInstance();
7713
- this.entryDoorMesh.rotateX(-Math.PI / 2);
7714
- if (this.roomInfoWrapperInstance)
7715
- this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7716
- this.group.add(this.entryDoorMesh);
7717
- }
7718
- this.onFivePanoArrived(this.five.panoIndex || 0);
7719
- this.five.needsRender = true;
7720
- });
7721
- }
7722
- loadCompassMesh() {
7698
+ async init() {
7699
+ if (!this.data || !this.modelLoaded)
7700
+ return;
7701
+ const northRad = this.data.north_rad;
7702
+ if (northRad != null) {
7703
+ this.compassMesh = await this.loadCompassMesh();
7704
+ this.compassMesh.rotateX(-Math.PI / 2);
7705
+ this.compassMesh.rotateZ(northRad - Math.PI / 2);
7706
+ this.group.add(this.compassMesh);
7707
+ }
7708
+ if (this.data.entrance != null) {
7709
+ this.entryDoorMesh = await this.loadEntryDoorMesh();
7710
+ this.roomInfoWrapperInstance = this.loadRoomInfo();
7711
+ this.roomInfoInstance = getRoomInfoInstance();
7712
+ this.entryDoorMesh.rotateX(-Math.PI / 2);
7713
+ if (this.roomInfoWrapperInstance)
7714
+ this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7715
+ this.group.add(this.entryDoorMesh);
7716
+ }
7717
+ this.onFivePanoArrived(this.five.panoIndex || 0);
7718
+ this.five.needsRender = true;
7719
+ }
7720
+ async loadCompassMesh() {
7723
7721
  var _a;
7724
- return __awaiter(this, void 0, void 0, function* () {
7725
- const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7726
- '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7727
- const compassTexture = yield loadTexture(compassImageUrl);
7728
- const compassGeometry = new THREE.CircleGeometry(0.7, 32);
7729
- const compassMaterial = new THREE.MeshBasicMaterial({
7730
- map: compassTexture,
7731
- transparent: true,
7732
- opacity: 0,
7733
- depthTest: false,
7734
- });
7735
- const compassMesh = new THREE.Mesh(compassGeometry, compassMaterial);
7736
- compassMesh.name = 'pano-compass-mesh';
7737
- return compassMesh;
7722
+ const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7723
+ '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7724
+ const compassTexture = await loadTexture(compassImageUrl);
7725
+ const compassGeometry = new THREE.CircleGeometry(0.7, 32);
7726
+ const compassMaterial = new THREE.MeshBasicMaterial({
7727
+ map: compassTexture,
7728
+ transparent: true,
7729
+ opacity: 0,
7730
+ depthTest: false,
7738
7731
  });
7732
+ const compassMesh = new THREE.Mesh(compassGeometry, compassMaterial);
7733
+ compassMesh.name = 'pano-compass-mesh';
7734
+ return compassMesh;
7739
7735
  }
7740
- loadEntryDoorMesh() {
7736
+ async loadEntryDoorMesh() {
7741
7737
  var _a;
7742
- return __awaiter(this, void 0, void 0, function* () {
7743
- const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7744
- '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7745
- const entryDoorTexture = yield loadTexture(entryDoorImageUrl);
7746
- const entryDoorGeometry = new THREE.PlaneGeometry(0.2, 0.16);
7747
- const entryDoorMaterial = new THREE.MeshBasicMaterial({
7748
- map: entryDoorTexture,
7749
- transparent: true,
7750
- opacity: 0.8,
7751
- depthTest: false,
7752
- });
7753
- const entryDoorMesh = new THREE.Mesh(entryDoorGeometry, entryDoorMaterial);
7754
- entryDoorMesh.name = 'pano-compass-entry-door';
7755
- return entryDoorMesh;
7738
+ const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7739
+ '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7740
+ const entryDoorTexture = await loadTexture(entryDoorImageUrl);
7741
+ const entryDoorGeometry = new THREE.PlaneGeometry(0.2, 0.16);
7742
+ const entryDoorMaterial = new THREE.MeshBasicMaterial({
7743
+ map: entryDoorTexture,
7744
+ transparent: true,
7745
+ opacity: 0.8,
7746
+ depthTest: false,
7756
7747
  });
7748
+ const entryDoorMesh = new THREE.Mesh(entryDoorGeometry, entryDoorMaterial);
7749
+ entryDoorMesh.name = 'pano-compass-entry-door';
7750
+ return entryDoorMesh;
7757
7751
  }
7758
7752
  loadRoomInfo() {
7759
7753
  const points = [
@@ -12722,6 +12716,7 @@ class UIController {
12722
12716
  this.container.remove();
12723
12717
  }
12724
12718
  show() {
12719
+ this.container.style.display = 'block';
12725
12720
  this.container.style.opacity = '1';
12726
12721
  this.container.style.transform = 'translate(0, 0)';
12727
12722
  this.revoke = new Revoke(this.measureController, this.container);
@@ -12731,6 +12726,7 @@ class UIController {
12731
12726
  }
12732
12727
  hide() {
12733
12728
  var _a, _b;
12729
+ this.container.style.display = 'none';
12734
12730
  this.container.style.opacity = '0';
12735
12731
  this.container.style.transform = 'translate(0, 10px)';
12736
12732
  (_a = this.revoke) === null || _a === void 0 ? void 0 : _a.dispose();
@@ -15033,7 +15029,7 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
15033
15029
  xhr.send();
15034
15030
  });
15035
15031
  };
15036
- const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
15032
+ const load = async (data, videoElement) => {
15037
15033
  const { video_src, video_poster_src, points } = data;
15038
15034
  state.videoSource = video_src;
15039
15035
  // TODO 存疑,先处理多一次遍历 o(2n)
@@ -15043,11 +15039,11 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
15043
15039
  if (videoElement) {
15044
15040
  state.videoElement = videoElement;
15045
15041
  }
15046
- state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
15042
+ state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
15047
15043
  state.enabled = !!data.enable;
15048
15044
  if (state.enabled)
15049
15045
  enable();
15050
- });
15046
+ };
15051
15047
  const dispose = () => {
15052
15048
  disable();
15053
15049
  state.videoTexture = undefined;