@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.umd.js CHANGED
@@ -478,7 +478,7 @@
478
478
 
479
479
  /* src/ModelRoomLabelPlugin/RoomLabelItem.svelte generated by Svelte v3.47.0 */
480
480
 
481
- function add_css$l(target) {
481
+ function add_css$m(target) {
482
482
  internal.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}");
483
483
  }
484
484
 
@@ -572,24 +572,24 @@
572
572
  class RoomLabelItem extends internal.SvelteComponent {
573
573
  constructor(options) {
574
574
  super();
575
- internal.init(this, options, instance$q, create_fragment$q, internal.safe_not_equal, { five: 2, roomLabel: 0 }, add_css$l);
575
+ internal.init(this, options, instance$q, create_fragment$q, internal.safe_not_equal, { five: 2, roomLabel: 0 }, add_css$m);
576
576
  }
577
577
  }
578
578
 
579
579
  /* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
580
580
 
581
- function add_css$k(target) {
581
+ function add_css$l(target) {
582
582
  internal.append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
583
583
  }
584
584
 
585
- function get_each_context$8(ctx, list, i) {
585
+ function get_each_context$9(ctx, list, i) {
586
586
  const child_ctx = ctx.slice();
587
587
  child_ctx[9] = list[i];
588
588
  return child_ctx;
589
589
  }
590
590
 
591
591
  // (70:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
592
- function create_each_block$8(key_1, ctx) {
592
+ function create_each_block$9(key_1, ctx) {
593
593
  let first;
594
594
  let roomlabelitem;
595
595
  let current;
@@ -647,9 +647,9 @@
647
647
  const get_key = ctx => /*roomLableItem*/ ctx[9].id;
648
648
 
649
649
  for (let i = 0; i < each_value.length; i += 1) {
650
- let child_ctx = get_each_context$8(ctx, each_value, i);
650
+ let child_ctx = get_each_context$9(ctx, each_value, i);
651
651
  let key = get_key(child_ctx);
652
- each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
652
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$9(key, child_ctx));
653
653
  }
654
654
 
655
655
  return {
@@ -677,7 +677,7 @@
677
677
  if (dirty & /*roomLabels, five*/ 3) {
678
678
  each_value = /*roomLabels*/ ctx[0];
679
679
  internal.group_outros();
680
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$8, null, get_each_context$8);
680
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$9, null, get_each_context$9);
681
681
  internal.check_outros();
682
682
  }
683
683
  },
@@ -800,7 +800,7 @@
800
800
  class RoomLabelItems extends internal.SvelteComponent {
801
801
  constructor(options) {
802
802
  super();
803
- internal.init(this, options, instance$p, create_fragment$p, internal.safe_not_equal, { five: 1, roomLabels: 0 }, add_css$k);
803
+ internal.init(this, options, instance$p, create_fragment$p, internal.safe_not_equal, { five: 1, roomLabels: 0 }, add_css$l);
804
804
  }
805
805
  }
806
806
 
@@ -971,37 +971,11 @@
971
971
  FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
972
972
  })(exports.FLOOR_PLAN_ATTACHED_TO || (exports.FLOOR_PLAN_ATTACHED_TO = {}));
973
973
 
974
- /*! *****************************************************************************
975
- Copyright (c) Microsoft Corporation.
976
-
977
- Permission to use, copy, modify, and/or distribute this software for any
978
- purpose with or without fee is hereby granted.
979
-
980
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
981
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
982
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
983
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
984
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
985
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
986
- PERFORMANCE OF THIS SOFTWARE.
987
- ***************************************************************************** */
988
-
989
- function __awaiter(thisArg, _arguments, P, generator) {
990
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
991
- return new (P || (P = Promise))(function (resolve, reject) {
992
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
993
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
994
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
995
- step((generator = generator.apply(thisArg, _arguments || [])).next());
996
- });
997
- }
998
-
999
974
  const pluginStyle$1 = {
1000
975
  position: 'absolute',
1001
976
  left: '50%',
1002
977
  top: '50%',
1003
978
  transform: 'translate(-50%, -50%)',
1004
- pointerEvents: 'none',
1005
979
  zIndex: '10',
1006
980
  };
1007
981
 
@@ -1028,9 +1002,9 @@
1028
1002
  return d + (needZ ? 'Z' : '');
1029
1003
  }
1030
1004
  /** 把户型图上点点位转换到 SVG 上的点位 */
1031
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
1005
+ function formatFloorplanPoint({ x, y }, bounding) {
1032
1006
  const { max, min } = bounding;
1033
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
1007
+ return { x: x - min.x, y: max.y - y };
1034
1008
  }
1035
1009
  /** 模型坐标转户型图坐标 */
1036
1010
  function modelPosition2FloorplanPosition(position, floorplanData) {
@@ -1058,26 +1032,22 @@
1058
1032
  return floorIndex;
1059
1033
  }
1060
1034
 
1061
- function formatOutlines(outlines) {
1062
- return __awaiter(this, void 0, void 0, function* () {
1063
- const headers = new Headers({ 'Content-Type': 'text/plain' });
1064
- const getOutlineItem = function (item) {
1065
- return __awaiter(this, void 0, void 0, function* () {
1066
- const outlineItem = {
1067
- index: item.index,
1068
- url: item.url,
1069
- svgUrl: item.svg_url,
1070
- };
1071
- if (item.svg_url) {
1072
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
1073
- outlineItem.svgContent = svgContent;
1074
- }
1075
- return outlineItem;
1076
- });
1035
+ async function formatOutlines(outlines) {
1036
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
1037
+ const getOutlineItem = async function (item) {
1038
+ const outlineItem = {
1039
+ index: item.index,
1040
+ url: item.url,
1041
+ svgUrl: item.svg_url,
1077
1042
  };
1078
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
1079
- return svgOutlineItems;
1080
- });
1043
+ if (item.svg_url) {
1044
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
1045
+ outlineItem.svgContent = svgContent;
1046
+ }
1047
+ return outlineItem;
1048
+ };
1049
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
1050
+ return svgOutlineItems;
1081
1051
  }
1082
1052
  function formatRoom(data) {
1083
1053
  const floorplanRoomItem = {
@@ -1123,21 +1093,19 @@
1123
1093
  };
1124
1094
  return floorplanEntrance;
1125
1095
  }
1126
- function formatData(data) {
1127
- return __awaiter(this, void 0, void 0, function* () {
1128
- const outlines = yield formatOutlines(data.outlines);
1129
- const bounding = data.computed_data.bounding;
1130
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1131
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1132
- const floorplanData = {
1133
- outlines,
1134
- entrance,
1135
- bounding,
1136
- floorDatas,
1137
- observers: data.computed_data.observers.map(formateFloorplanObserver),
1138
- };
1139
- return floorplanData;
1140
- });
1096
+ async function formatData(data) {
1097
+ const outlines = await formatOutlines(data.outlines);
1098
+ const bounding = data.computed_data.bounding;
1099
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1100
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1101
+ const floorplanData = {
1102
+ outlines,
1103
+ entrance,
1104
+ bounding,
1105
+ floorDatas,
1106
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
1107
+ };
1108
+ return floorplanData;
1141
1109
  }
1142
1110
  function formatExtraObjects(data, five, floorplanData) {
1143
1111
  const extraObjects = data.map((object) => {
@@ -1157,35 +1125,6 @@
1157
1125
  return extraObjects;
1158
1126
  }
1159
1127
 
1160
- /**
1161
- * 把第一个参数传入第二个参数(函数)中并执行
1162
- * 一般用于执行函数后返回变量。
1163
- * @param {any} something
1164
- * @param {function} callback
1165
- * @return {any}
1166
- */
1167
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1168
- function tap(something, callback) {
1169
- callback(something);
1170
- return something;
1171
- }
1172
-
1173
- /**
1174
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1175
- * @param object
1176
- * @param props 排除的属性
1177
- * @return
1178
- */
1179
- function omit(object, props) {
1180
- return tap({}, (result) => {
1181
- for (const name in object) {
1182
- if (props.indexOf(name) !== -1)
1183
- continue;
1184
- result[name] = object[name];
1185
- }
1186
- });
1187
- }
1188
-
1189
1128
  /**
1190
1129
  * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
1191
1130
  * @param five five
@@ -1219,15 +1158,44 @@
1219
1158
  return pxmm;
1220
1159
  }
1221
1160
 
1161
+ /**
1162
+ * 把第一个参数传入第二个参数(函数)中并执行
1163
+ * 一般用于执行函数后返回变量。
1164
+ * @param {any} something
1165
+ * @param {function} callback
1166
+ * @return {any}
1167
+ */
1168
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1169
+ function tap(something, callback) {
1170
+ callback(something);
1171
+ return something;
1172
+ }
1173
+
1174
+ /**
1175
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1176
+ * @param object
1177
+ * @param props 排除的属性
1178
+ * @return
1179
+ */
1180
+ function omit(object, props) {
1181
+ return tap({}, (result) => {
1182
+ for (const name in object) {
1183
+ if (props.indexOf(name) !== -1)
1184
+ continue;
1185
+ result[name] = object[name];
1186
+ }
1187
+ });
1188
+ }
1189
+
1222
1190
  const CAMERA_IMAGE = 'data:image/png;base64,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';
1223
1191
 
1224
1192
  function rad2Deg$1(rad) {
1225
1193
  return (rad * 180) / Math.PI;
1226
1194
  }
1227
1195
 
1228
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
1196
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
1229
1197
 
1230
- function add_css$j(target) {
1198
+ function add_css$k(target) {
1231
1199
  internal.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%}");
1232
1200
  }
1233
1201
 
@@ -1323,16 +1291,16 @@
1323
1291
  lastPanoramaLongitude: 7,
1324
1292
  cameraImageUrl: 0
1325
1293
  },
1326
- add_css$j
1294
+ add_css$k
1327
1295
  );
1328
1296
  }
1329
1297
  }
1330
1298
 
1331
1299
  const COMPASS_IMAGE = 'data:image/png;base64,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';
1332
1300
 
1333
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
1301
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
1334
1302
 
1335
- function add_css$i(target) {
1303
+ function add_css$j(target) {
1336
1304
  internal.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}");
1337
1305
  }
1338
1306
 
@@ -1425,345 +1393,271 @@
1425
1393
  class Compass extends internal.SvelteComponent {
1426
1394
  constructor(options) {
1427
1395
  super();
1428
- internal.init(this, options, instance$n, create_fragment$n, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$i);
1396
+ internal.init(this, options, instance$n, create_fragment$n, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$j);
1429
1397
  }
1430
1398
  }
1431
1399
 
1432
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1400
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1433
1401
 
1434
- function add_css$h(target) {
1435
- internal.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}");
1402
+ function add_css$i(target) {
1403
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1436
1404
  }
1437
1405
 
1438
- // (22:30)
1439
- function create_if_block_1$4(ctx) {
1440
- let html_tag;
1441
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1442
- let html_anchor;
1406
+ function create_fragment$m(ctx) {
1407
+ let img;
1408
+ let img_src_value;
1443
1409
 
1444
1410
  return {
1445
1411
  c() {
1446
- html_tag = new internal.HtmlTag();
1447
- html_anchor = internal.empty();
1448
- html_tag.a = html_anchor;
1412
+ img = internal.element("img");
1413
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1414
+ internal.attr(img, "alt", "floorplan iamge");
1415
+ internal.attr(img, "class", "svelte-1gfoniz");
1449
1416
  },
1450
1417
  m(target, anchor) {
1451
- html_tag.m(raw_value, target, anchor);
1452
- internal.insert(target, html_anchor, anchor);
1418
+ internal.insert(target, img, anchor);
1453
1419
  },
1454
- p(ctx, dirty) {
1455
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1420
+ p(ctx, [dirty]) {
1421
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1422
+ internal.attr(img, "src", img_src_value);
1423
+ }
1456
1424
  },
1425
+ i: internal.noop,
1426
+ o: internal.noop,
1457
1427
  d(detaching) {
1458
- if (detaching) internal.detach(html_anchor);
1459
- if (detaching) html_tag.d();
1428
+ if (detaching) internal.detach(img);
1460
1429
  }
1461
1430
  };
1462
1431
  }
1463
1432
 
1464
- // (16:2) {#if getLabelElement === undefined}
1465
- function create_if_block$7(ctx) {
1466
- let span0;
1467
- let t0_value = /*room*/ ctx[0].name + "";
1468
- let t0;
1469
- let t1;
1470
- let span1;
1433
+ function instance$m($$self, $$props, $$invalidate) {
1434
+ let { url } = $$props;
1471
1435
 
1472
- return {
1473
- c() {
1474
- span0 = internal.element("span");
1475
- t0 = internal.text(t0_value);
1476
- t1 = internal.space();
1477
- span1 = internal.element("span");
1478
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1479
- internal.attr(span0, "class", "floorplan-plugin__room-name");
1480
- internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
1481
- },
1482
- m(target, anchor) {
1483
- internal.insert(target, span0, anchor);
1484
- internal.append(span0, t0);
1485
- internal.insert(target, t1, anchor);
1486
- internal.insert(target, span1, anchor);
1487
- },
1488
- p(ctx, dirty) {
1489
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
1490
- },
1491
- d(detaching) {
1492
- if (detaching) internal.detach(span0);
1493
- if (detaching) internal.detach(t1);
1494
- if (detaching) internal.detach(span1);
1495
- }
1436
+ $$self.$$set = $$props => {
1437
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
1496
1438
  };
1497
- }
1498
1439
 
1499
- function create_fragment$m(ctx) {
1500
- let div;
1440
+ return [url];
1441
+ }
1501
1442
 
1502
- function select_block_type(ctx, dirty) {
1503
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$7;
1504
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
1443
+ class Normalmage extends internal.SvelteComponent {
1444
+ constructor(options) {
1445
+ super();
1446
+ internal.init(this, options, instance$m, create_fragment$m, internal.safe_not_equal, { url: 0 }, add_css$i);
1505
1447
  }
1448
+ }
1506
1449
 
1507
- let current_block_type = select_block_type(ctx);
1508
- let if_block = current_block_type && current_block_type(ctx);
1450
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1451
+
1452
+ function add_css$h(target) {
1453
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
1454
+ }
1455
+
1456
+ function create_fragment$l(ctx) {
1457
+ let div;
1458
+ let html_tag;
1459
+ let t;
1460
+ let html_tag_1;
1509
1461
 
1510
1462
  return {
1511
1463
  c() {
1512
1464
  div = internal.element("div");
1513
- if (if_block) if_block.c();
1514
- internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
1515
- internal.set_style(div, "left", /*left*/ ctx[4], false);
1516
- internal.set_style(div, "top", /*top*/ ctx[5], false);
1517
- internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1465
+ html_tag = new internal.HtmlTag();
1466
+ t = internal.space();
1467
+ html_tag_1 = new internal.HtmlTag();
1468
+ html_tag.a = t;
1469
+ html_tag_1.a = null;
1470
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
1518
1471
  },
1519
1472
  m(target, anchor) {
1520
1473
  internal.insert(target, div, anchor);
1521
- if (if_block) if_block.m(div, null);
1474
+ html_tag.m(/*svgStyle*/ ctx[1], div);
1475
+ internal.append(div, t);
1476
+ html_tag_1.m(/*content*/ ctx[0], div);
1522
1477
  },
1523
1478
  p(ctx, [dirty]) {
1524
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1525
- if_block.p(ctx, dirty);
1526
- } else {
1527
- if (if_block) if_block.d(1);
1528
- if_block = current_block_type && current_block_type(ctx);
1529
-
1530
- if (if_block) {
1531
- if_block.c();
1532
- if_block.m(div, null);
1533
- }
1534
- }
1479
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1535
1480
  },
1536
1481
  i: internal.noop,
1537
1482
  o: internal.noop,
1538
1483
  d(detaching) {
1539
1484
  if (detaching) internal.detach(div);
1540
-
1541
- if (if_block) {
1542
- if_block.d();
1543
- }
1544
1485
  }
1545
1486
  };
1546
1487
  }
1547
1488
 
1548
- function instance$m($$self, $$props, $$invalidate) {
1549
- let userConfigElement;
1550
- let { room } = $$props;
1551
- let { getLabelElement } = $$props;
1552
-
1553
- // TODO: 统一这里的判断条件,目前写了多处
1554
- const bodyWidth = document.body.clientWidth;
1489
+ function instance$l($$self, $$props, $$invalidate) {
1490
+ let { content } = $$props;
1555
1491
 
1556
- const bodyHeight = document.body.clientHeight;
1557
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1558
- const roomLabel = room.roomLabel;
1559
- const left = roomLabel.positionInImage.x * 100 + '%';
1560
- const top = roomLabel.positionInImage.y * 100 + '%';
1561
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
1492
+ const svgStyle = `
1493
+ <style>
1494
+ svg [type='lineGroup'] path {
1495
+ fill: #ffffff;
1496
+ stroke: #ffffff;
1497
+ }
1498
+ svg [type='lineItemGroup'] g g g g {
1499
+ stroke: #ffffff;
1500
+ }</style>
1501
+ `;
1562
1502
 
1563
1503
  $$self.$$set = $$props => {
1564
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
1565
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
1566
- };
1567
-
1568
- $$self.$$.update = () => {
1569
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1570
- $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1571
- ? void 0
1572
- : getLabelElement(room));
1573
- }
1504
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
1574
1505
  };
1575
1506
 
1576
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
1507
+ return [content, svgStyle];
1577
1508
  }
1578
1509
 
1579
- class RoomLabel extends internal.SvelteComponent {
1510
+ class SvgImage extends internal.SvelteComponent {
1580
1511
  constructor(options) {
1581
1512
  super();
1582
- internal.init(this, options, instance$m, create_fragment$m, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$h);
1513
+ internal.init(this, options, instance$l, create_fragment$l, internal.safe_not_equal, { content: 0 }, add_css$h);
1583
1514
  }
1584
1515
  }
1585
1516
 
1586
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
1517
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1587
1518
 
1588
1519
  function add_css$g(target) {
1589
- internal.append_styles(target, "svelte-vkeyjz", ".floorplan-plugin__room-labels.svelte-vkeyjz{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
1590
- }
1591
-
1592
- function get_each_context$7(ctx, list, i) {
1593
- const child_ctx = ctx.slice();
1594
- child_ctx[4] = list[i];
1595
- return child_ctx;
1520
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1596
1521
  }
1597
1522
 
1598
- // (8:0) {#if rooms}
1599
- function create_if_block$6(ctx) {
1600
- let div;
1601
- let each_blocks = [];
1602
- let each_1_lookup = new Map();
1523
+ // (13:22)
1524
+ function create_if_block_1$4(ctx) {
1525
+ let normalimage;
1603
1526
  let current;
1604
- let each_value = /*rooms*/ ctx[1];
1605
- const get_key = ctx => /*room*/ ctx[4].id;
1606
-
1607
- for (let i = 0; i < each_value.length; i += 1) {
1608
- let child_ctx = get_each_context$7(ctx, each_value, i);
1609
- let key = get_key(child_ctx);
1610
- each_1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
1611
- }
1527
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1612
1528
 
1613
1529
  return {
1614
1530
  c() {
1615
- div = internal.element("div");
1616
-
1617
- for (let i = 0; i < each_blocks.length; i += 1) {
1618
- each_blocks[i].c();
1619
- }
1620
-
1621
- internal.attr(div, "class", "floorplan-plugin__room-labels svelte-vkeyjz");
1531
+ internal.create_component(normalimage.$$.fragment);
1622
1532
  },
1623
1533
  m(target, anchor) {
1624
- internal.insert(target, div, anchor);
1625
-
1626
- for (let i = 0; i < each_blocks.length; i += 1) {
1627
- each_blocks[i].m(div, null);
1628
- }
1629
-
1534
+ internal.mount_component(normalimage, target, anchor);
1630
1535
  current = true;
1631
1536
  },
1632
1537
  p(ctx, dirty) {
1633
- if (dirty & /*rooms, getLabelElement*/ 3) {
1634
- each_value = /*rooms*/ ctx[1];
1635
- internal.group_outros();
1636
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$7, null, get_each_context$7);
1637
- internal.check_outros();
1638
- }
1538
+ const normalimage_changes = {};
1539
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1540
+ normalimage.$set(normalimage_changes);
1639
1541
  },
1640
1542
  i(local) {
1641
1543
  if (current) return;
1642
-
1643
- for (let i = 0; i < each_value.length; i += 1) {
1644
- internal.transition_in(each_blocks[i]);
1645
- }
1646
-
1544
+ internal.transition_in(normalimage.$$.fragment, local);
1647
1545
  current = true;
1648
1546
  },
1649
1547
  o(local) {
1650
- for (let i = 0; i < each_blocks.length; i += 1) {
1651
- internal.transition_out(each_blocks[i]);
1652
- }
1653
-
1548
+ internal.transition_out(normalimage.$$.fragment, local);
1654
1549
  current = false;
1655
1550
  },
1656
1551
  d(detaching) {
1657
- if (detaching) internal.detach(div);
1658
-
1659
- for (let i = 0; i < each_blocks.length; i += 1) {
1660
- each_blocks[i].d();
1661
- }
1552
+ internal.destroy_component(normalimage, detaching);
1662
1553
  }
1663
1554
  };
1664
1555
  }
1665
1556
 
1666
- // (10:4) {#each rooms as room (room.id)}
1667
- function create_each_block$7(key_1, ctx) {
1668
- let first;
1669
- let roomlabel;
1557
+ // (11:2) {#if svgContent}
1558
+ function create_if_block$7(ctx) {
1559
+ let svgimage;
1670
1560
  let current;
1671
1561
 
1672
- const roomlabel_spread_levels = [
1673
- {
1674
- room: /*room*/ ctx[4],
1675
- getLabelElement: /*getLabelElement*/ ctx[0]
1676
- }
1677
- ];
1678
-
1679
- let roomlabel_props = {};
1680
-
1681
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1682
- roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1683
- }
1684
-
1685
- roomlabel = new RoomLabel({ props: roomlabel_props });
1562
+ svgimage = new SvgImage({
1563
+ props: { content: /*svgContent*/ ctx[0] }
1564
+ });
1686
1565
 
1687
1566
  return {
1688
- key: key_1,
1689
- first: null,
1690
1567
  c() {
1691
- first = internal.empty();
1692
- internal.create_component(roomlabel.$$.fragment);
1693
- this.first = first;
1568
+ internal.create_component(svgimage.$$.fragment);
1694
1569
  },
1695
1570
  m(target, anchor) {
1696
- internal.insert(target, first, anchor);
1697
- internal.mount_component(roomlabel, target, anchor);
1571
+ internal.mount_component(svgimage, target, anchor);
1698
1572
  current = true;
1699
1573
  },
1700
- p(new_ctx, dirty) {
1701
- ctx = new_ctx;
1702
-
1703
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1704
- ? internal.get_spread_update(roomlabel_spread_levels, [
1705
- {
1706
- room: /*room*/ ctx[4],
1707
- getLabelElement: /*getLabelElement*/ ctx[0]
1708
- }
1709
- ])
1710
- : {};
1711
-
1712
- roomlabel.$set(roomlabel_changes);
1574
+ p(ctx, dirty) {
1575
+ const svgimage_changes = {};
1576
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1577
+ svgimage.$set(svgimage_changes);
1713
1578
  },
1714
1579
  i(local) {
1715
1580
  if (current) return;
1716
- internal.transition_in(roomlabel.$$.fragment, local);
1581
+ internal.transition_in(svgimage.$$.fragment, local);
1717
1582
  current = true;
1718
1583
  },
1719
1584
  o(local) {
1720
- internal.transition_out(roomlabel.$$.fragment, local);
1585
+ internal.transition_out(svgimage.$$.fragment, local);
1721
1586
  current = false;
1722
1587
  },
1723
1588
  d(detaching) {
1724
- if (detaching) internal.detach(first);
1725
- internal.destroy_component(roomlabel, detaching);
1589
+ internal.destroy_component(svgimage, detaching);
1726
1590
  }
1727
1591
  };
1728
1592
  }
1729
1593
 
1730
- function create_fragment$l(ctx) {
1731
- let if_block_anchor;
1594
+ function create_fragment$k(ctx) {
1595
+ let div;
1596
+ let current_block_type_index;
1597
+ let if_block;
1732
1598
  let current;
1733
- let if_block = /*rooms*/ ctx[1] && create_if_block$6(ctx);
1599
+ const if_block_creators = [create_if_block$7, create_if_block_1$4];
1600
+ const if_blocks = [];
1601
+
1602
+ function select_block_type(ctx, dirty) {
1603
+ if (/*svgContent*/ ctx[0]) return 0;
1604
+ if (/*imageData*/ ctx[1]) return 1;
1605
+ return -1;
1606
+ }
1607
+
1608
+ if (~(current_block_type_index = select_block_type(ctx))) {
1609
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1610
+ }
1734
1611
 
1735
1612
  return {
1736
1613
  c() {
1614
+ div = internal.element("div");
1737
1615
  if (if_block) if_block.c();
1738
- if_block_anchor = internal.empty();
1616
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
1739
1617
  },
1740
1618
  m(target, anchor) {
1741
- if (if_block) if_block.m(target, anchor);
1742
- internal.insert(target, if_block_anchor, anchor);
1619
+ internal.insert(target, div, anchor);
1620
+
1621
+ if (~current_block_type_index) {
1622
+ if_blocks[current_block_type_index].m(div, null);
1623
+ }
1624
+
1743
1625
  current = true;
1744
1626
  },
1745
1627
  p(ctx, [dirty]) {
1746
- if (/*rooms*/ ctx[1]) {
1628
+ let previous_block_index = current_block_type_index;
1629
+ current_block_type_index = select_block_type(ctx);
1630
+
1631
+ if (current_block_type_index === previous_block_index) {
1632
+ if (~current_block_type_index) {
1633
+ if_blocks[current_block_type_index].p(ctx, dirty);
1634
+ }
1635
+ } else {
1747
1636
  if (if_block) {
1748
- if_block.p(ctx, dirty);
1637
+ internal.group_outros();
1749
1638
 
1750
- if (dirty & /*rooms*/ 2) {
1751
- internal.transition_in(if_block, 1);
1752
- }
1753
- } else {
1754
- if_block = create_if_block$6(ctx);
1755
- if_block.c();
1756
- internal.transition_in(if_block, 1);
1757
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
1639
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1640
+ if_blocks[previous_block_index] = null;
1641
+ });
1642
+
1643
+ internal.check_outros();
1758
1644
  }
1759
- } else if (if_block) {
1760
- internal.group_outros();
1761
1645
 
1762
- internal.transition_out(if_block, 1, 1, () => {
1763
- if_block = null;
1764
- });
1646
+ if (~current_block_type_index) {
1647
+ if_block = if_blocks[current_block_type_index];
1765
1648
 
1766
- internal.check_outros();
1649
+ if (!if_block) {
1650
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1651
+ if_block.c();
1652
+ } else {
1653
+ if_block.p(ctx, dirty);
1654
+ }
1655
+
1656
+ internal.transition_in(if_block, 1);
1657
+ if_block.m(div, null);
1658
+ } else {
1659
+ if_block = null;
1660
+ }
1767
1661
  }
1768
1662
  },
1769
1663
  i(local) {
@@ -1776,434 +1670,230 @@
1776
1670
  current = false;
1777
1671
  },
1778
1672
  d(detaching) {
1779
- if (if_block) if_block.d(detaching);
1780
- if (detaching) internal.detach(if_block_anchor);
1673
+ if (detaching) internal.detach(div);
1674
+
1675
+ if (~current_block_type_index) {
1676
+ if_blocks[current_block_type_index].d();
1677
+ }
1781
1678
  }
1782
1679
  };
1783
1680
  }
1784
1681
 
1785
- function instance$l($$self, $$props, $$invalidate) {
1786
- let rooms;
1682
+ function instance$k($$self, $$props, $$invalidate) {
1683
+ let imageData;
1684
+ let svgContent;
1685
+ var _a, _b;
1787
1686
  let { floorIndex } = $$props;
1788
1687
  let { floorplanData } = $$props;
1789
- let { getLabelElement } = $$props;
1790
1688
 
1791
1689
  $$self.$$set = $$props => {
1792
1690
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1793
1691
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1794
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
1795
1692
  };
1796
1693
 
1797
1694
  $$self.$$.update = () => {
1798
1695
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1799
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
1696
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1697
+ }
1698
+
1699
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
1700
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
1701
+ ? void 0
1702
+ : _a[floorIndex]) === null || _b === void 0
1703
+ ? void 0
1704
+ : _b.svgContent);
1800
1705
  }
1801
1706
  };
1802
1707
 
1803
- return [getLabelElement, rooms, floorIndex, floorplanData];
1708
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
1804
1709
  }
1805
1710
 
1806
- class RoomLabels extends internal.SvelteComponent {
1711
+ class BaseImage extends internal.SvelteComponent {
1807
1712
  constructor(options) {
1808
1713
  super();
1809
-
1810
- internal.init(
1811
- this,
1812
- options,
1813
- instance$l,
1814
- create_fragment$l,
1815
- internal.safe_not_equal,
1816
- {
1817
- floorIndex: 2,
1818
- floorplanData: 3,
1819
- getLabelElement: 0
1820
- },
1821
- add_css$g
1822
- );
1714
+ internal.init(this, options, instance$k, create_fragment$k, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$g);
1823
1715
  }
1824
1716
  }
1825
1717
 
1826
- /**
1827
- * 判断对象是否为`null`或`undefined`。
1828
- * @param
1829
- * @return
1830
- */
1831
- /**
1832
- * 判断对象不为`null`或`undefined`。
1833
- */
1834
- function notNil(value) {
1835
- return value !== null && value !== undefined;
1836
- }
1837
-
1838
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1718
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1839
1719
 
1840
1720
  function add_css$f(target) {
1841
- internal.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%)}");
1842
- }
1843
-
1844
- function get_each_context$6(ctx, list, i) {
1845
- const child_ctx = ctx.slice();
1846
- child_ctx[24] = list[i];
1847
- child_ctx[26] = i;
1848
- return child_ctx;
1849
- }
1850
-
1851
- function get_each_context_1(ctx, list, i) {
1852
- const child_ctx = ctx.slice();
1853
- child_ctx[27] = list[i];
1854
- child_ctx[29] = i;
1855
- return child_ctx;
1721
+ internal.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}");
1856
1722
  }
1857
1723
 
1858
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
1859
- function create_each_block_1(key_1, ctx) {
1860
- let div;
1861
- let style_left = `${/*position*/ ctx[27]}px`;
1724
+ // (22:30)
1725
+ function create_if_block_1$3(ctx) {
1726
+ let html_tag;
1727
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1728
+ let html_anchor;
1862
1729
 
1863
1730
  return {
1864
- key: key_1,
1865
- first: null,
1866
1731
  c() {
1867
- div = internal.element("div");
1868
- internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1d5a0k4");
1869
- internal.set_style(div, "left", style_left, false);
1870
- this.first = div;
1732
+ html_tag = new internal.HtmlTag();
1733
+ html_anchor = internal.empty();
1734
+ html_tag.a = html_anchor;
1871
1735
  },
1872
1736
  m(target, anchor) {
1873
- internal.insert(target, div, anchor);
1874
- },
1875
- p(new_ctx, dirty) {
1876
- ctx = new_ctx;
1737
+ html_tag.m(raw_value, target, anchor);
1738
+ internal.insert(target, html_anchor, anchor);
1739
+ },
1740
+ p(ctx, dirty) {
1741
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1877
1742
  },
1878
1743
  d(detaching) {
1879
- if (detaching) internal.detach(div);
1744
+ if (detaching) internal.detach(html_anchor);
1745
+ if (detaching) html_tag.d();
1880
1746
  }
1881
1747
  };
1882
1748
  }
1883
1749
 
1884
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
1885
- function create_each_block$6(key_1, ctx) {
1886
- let div;
1887
- let span;
1888
- let t0_value = /*textItem*/ ctx[24].distance + "";
1750
+ // (16:2) {#if getLabelElement === undefined}
1751
+ function create_if_block$6(ctx) {
1752
+ let span0;
1753
+ let t0_value = /*room*/ ctx[0].name + "";
1889
1754
  let t0;
1890
1755
  let t1;
1891
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
1756
+ let span1;
1892
1757
 
1893
1758
  return {
1894
- key: key_1,
1895
- first: null,
1896
1759
  c() {
1897
- div = internal.element("div");
1898
- span = internal.element("span");
1760
+ span0 = internal.element("span");
1899
1761
  t0 = internal.text(t0_value);
1900
1762
  t1 = internal.space();
1901
- internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1d5a0k4");
1902
- internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
1903
- internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1d5a0k4");
1904
- internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
1905
- internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
1906
- internal.set_style(div, "left", style_left, false);
1907
- this.first = div;
1763
+ span1 = internal.element("span");
1764
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1765
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
1766
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
1908
1767
  },
1909
1768
  m(target, anchor) {
1910
- internal.insert(target, div, anchor);
1911
- internal.append(div, span);
1912
- internal.append(span, t0);
1913
- internal.append(div, t1);
1769
+ internal.insert(target, span0, anchor);
1770
+ internal.append(span0, t0);
1771
+ internal.insert(target, t1, anchor);
1772
+ internal.insert(target, span1, anchor);
1914
1773
  },
1915
- p(new_ctx, dirty) {
1916
- ctx = new_ctx;
1774
+ p(ctx, dirty) {
1775
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
1917
1776
  },
1918
1777
  d(detaching) {
1919
- if (detaching) internal.detach(div);
1778
+ if (detaching) internal.detach(span0);
1779
+ if (detaching) internal.detach(t1);
1780
+ if (detaching) internal.detach(span1);
1920
1781
  }
1921
1782
  };
1922
1783
  }
1923
1784
 
1924
- function create_fragment$k(ctx) {
1925
- let div1;
1926
- let div0;
1927
- let t0;
1928
- let each_blocks_1 = [];
1929
- let each0_lookup = new Map();
1930
- let t1;
1931
- let each_blocks = [];
1932
- let each1_lookup = new Map();
1933
- let div1_class_value;
1934
- let each_value_1 = /*positionPxArray*/ ctx[6];
1935
- const get_key = ctx => /*positionIndex*/ ctx[29];
1785
+ function create_fragment$j(ctx) {
1786
+ let div;
1936
1787
 
1937
- for (let i = 0; i < each_value_1.length; i += 1) {
1938
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
1939
- let key = get_key(child_ctx);
1940
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
1788
+ function select_block_type(ctx, dirty) {
1789
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$6;
1790
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$3;
1941
1791
  }
1942
1792
 
1943
- let each_value = /*textArray*/ ctx[10];
1944
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
1945
-
1946
- for (let i = 0; i < each_value.length; i += 1) {
1947
- let child_ctx = get_each_context$6(ctx, each_value, i);
1948
- let key = get_key_1(child_ctx);
1949
- each1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
1950
- }
1793
+ let current_block_type = select_block_type(ctx);
1794
+ let if_block = current_block_type && current_block_type(ctx);
1951
1795
 
1952
1796
  return {
1953
1797
  c() {
1954
- div1 = internal.element("div");
1955
- div0 = internal.element("div");
1956
- t0 = internal.space();
1957
-
1958
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1959
- each_blocks_1[i].c();
1960
- }
1961
-
1962
- t1 = internal.space();
1963
-
1964
- for (let i = 0; i < each_blocks.length; i += 1) {
1965
- each_blocks[i].c();
1966
- }
1967
-
1968
- internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1d5a0k4");
1969
- internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4");
1970
- internal.set_style(div1, "width", /*width*/ ctx[9], false);
1971
- internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
1972
- internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
1798
+ div = internal.element("div");
1799
+ if (if_block) if_block.c();
1800
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
1801
+ internal.set_style(div, "left", /*left*/ ctx[4], false);
1802
+ internal.set_style(div, "top", /*top*/ ctx[5], false);
1803
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1973
1804
  },
1974
1805
  m(target, anchor) {
1975
- internal.insert(target, div1, anchor);
1976
- internal.append(div1, div0);
1977
- internal.append(div1, t0);
1978
-
1979
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1980
- each_blocks_1[i].m(div1, null);
1981
- }
1982
-
1983
- internal.append(div1, t1);
1984
-
1985
- for (let i = 0; i < each_blocks.length; i += 1) {
1986
- each_blocks[i].m(div1, null);
1987
- }
1806
+ internal.insert(target, div, anchor);
1807
+ if (if_block) if_block.m(div, null);
1988
1808
  },
1989
1809
  p(ctx, [dirty]) {
1990
- if (dirty & /*positionPxArray*/ 64) {
1991
- each_value_1 = /*positionPxArray*/ ctx[6];
1992
- each_blocks_1 = internal.update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx, each_value_1, each0_lookup, div1, internal.destroy_block, create_each_block_1, t1, get_each_context_1);
1993
- }
1994
-
1995
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
1996
- each_value = /*textArray*/ ctx[10];
1997
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx, each_value, each1_lookup, div1, internal.destroy_block, create_each_block$6, null, get_each_context$6);
1998
- }
1810
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1811
+ if_block.p(ctx, dirty);
1812
+ } else {
1813
+ if (if_block) if_block.d(1);
1814
+ if_block = current_block_type && current_block_type(ctx);
1999
1815
 
2000
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4")) {
2001
- internal.attr(div1, "class", div1_class_value);
1816
+ if (if_block) {
1817
+ if_block.c();
1818
+ if_block.m(div, null);
1819
+ }
2002
1820
  }
2003
1821
  },
2004
1822
  i: internal.noop,
2005
1823
  o: internal.noop,
2006
1824
  d(detaching) {
2007
- if (detaching) internal.detach(div1);
2008
-
2009
- for (let i = 0; i < each_blocks_1.length; i += 1) {
2010
- each_blocks_1[i].d();
2011
- }
1825
+ if (detaching) internal.detach(div);
2012
1826
 
2013
- for (let i = 0; i < each_blocks.length; i += 1) {
2014
- each_blocks[i].d();
1827
+ if (if_block) {
1828
+ if_block.d();
2015
1829
  }
2016
1830
  }
2017
1831
  };
2018
1832
  }
2019
1833
 
2020
- const padding = 1000;
2021
-
2022
- function instance$k($$self, $$props, $$invalidate) {
2023
- let { pxmm } = $$props;
2024
- let { type } = $$props;
2025
- let { data } = $$props;
2026
- let { bounding } = $$props;
2027
- const isTop = type === 'top';
2028
- const isBottom = type === 'bottom';
2029
- const isLeft = type === 'left';
2030
- const isRight = type === 'right';
2031
- const isRow = isTop || isBottom;
1834
+ function instance$j($$self, $$props, $$invalidate) {
1835
+ let userConfigElement;
1836
+ let { room } = $$props;
1837
+ let { getLabelElement } = $$props;
2032
1838
 
2033
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2034
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2035
- if (index === 0) return true;
2036
- return x !== arr[index - 1];
2037
- });
1839
+ // TODO: 统一这里的判断条件,目前写了多处
1840
+ const bodyWidth = document.body.clientWidth;
2038
1841
 
2039
- const minPosition = positionArray[0];
2040
- const maxPosition = positionArray.slice(-1)[0];
2041
- const length = maxPosition - minPosition;
2042
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
2043
- const lengthPx = length * pxmm;
2044
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
2045
-
2046
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
2047
- const translateMain = (minPosition - minBounding) * pxmm;
2048
-
2049
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
2050
- const translateSecond = 27 - padding * pxmm;
2051
-
2052
- const translate = (() => {
2053
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
2054
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
2055
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
2056
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
2057
- })();
2058
-
2059
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
2060
- const transform = `${translate} ${rotate}`;
2061
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
2062
- const width = lengthPx + 'px';
2063
-
2064
- // 把点位的户型图坐标转成距离起始位置的像素值
2065
- const textArray = positionArray.map((position, index, array) => {
2066
- if (index === 0) return null;
2067
- const distance = position - array[index - 1];
2068
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
2069
- return { distance, positionPx };
2070
- }).filter(notNil).filter(item => item.distance / length > 0.12);
1842
+ const bodyHeight = document.body.clientHeight;
1843
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1844
+ const roomLabel = room.roomLabel;
1845
+ const left = roomLabel.positionInImage.x * 100 + '%';
1846
+ const top = roomLabel.positionInImage.y * 100 + '%';
1847
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
2071
1848
 
2072
1849
  $$self.$$set = $$props => {
2073
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
2074
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
2075
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
2076
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
1850
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
1851
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
2077
1852
  };
2078
1853
 
2079
- return [
2080
- type,
2081
- isTop,
2082
- isBottom,
2083
- isLeft,
2084
- isRight,
2085
- isRow,
2086
- positionPxArray,
2087
- transform,
2088
- transformOrigin,
2089
- width,
2090
- textArray,
2091
- pxmm,
2092
- data,
2093
- bounding
2094
- ];
1854
+ $$self.$$.update = () => {
1855
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1856
+ $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1857
+ ? void 0
1858
+ : getLabelElement(room));
1859
+ }
1860
+ };
1861
+
1862
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
2095
1863
  }
2096
1864
 
2097
- class RuleItem extends internal.SvelteComponent {
1865
+ class RoomLabel extends internal.SvelteComponent {
2098
1866
  constructor(options) {
2099
1867
  super();
2100
-
2101
- internal.init(
2102
- this,
2103
- options,
2104
- instance$k,
2105
- create_fragment$k,
2106
- internal.safe_not_equal,
2107
- {
2108
- pxmm: 11,
2109
- type: 0,
2110
- data: 12,
2111
- bounding: 13
2112
- },
2113
- add_css$f
2114
- );
1868
+ internal.init(this, options, instance$j, create_fragment$j, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$f);
2115
1869
  }
2116
1870
  }
2117
1871
 
2118
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1872
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
2119
1873
 
2120
- function get_each_context$5(ctx, list, i) {
2121
- const child_ctx = ctx.slice();
2122
- child_ctx[7] = list[i][0];
2123
- child_ctx[8] = list[i][1];
2124
- return child_ctx;
1874
+ function add_css$e(target) {
1875
+ internal.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}");
2125
1876
  }
2126
1877
 
2127
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
2128
- function create_each_block$5(key_1, ctx) {
2129
- let first;
2130
- let ruleitem;
2131
- let current;
2132
-
2133
- const ruleitem_spread_levels = [
2134
- {
2135
- type: /*type*/ ctx[7],
2136
- data: /*data*/ ctx[8],
2137
- pxmm: /*pxmm*/ ctx[0],
2138
- bounding: /*bounding*/ ctx[2]
2139
- }
2140
- ];
2141
-
2142
- let ruleitem_props = {};
2143
-
2144
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2145
- ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
2146
- }
2147
-
2148
- ruleitem = new RuleItem({ props: ruleitem_props });
2149
-
2150
- return {
2151
- key: key_1,
2152
- first: null,
2153
- c() {
2154
- first = internal.empty();
2155
- internal.create_component(ruleitem.$$.fragment);
2156
- this.first = first;
2157
- },
2158
- m(target, anchor) {
2159
- internal.insert(target, first, anchor);
2160
- internal.mount_component(ruleitem, target, anchor);
2161
- current = true;
2162
- },
2163
- p(new_ctx, dirty) {
2164
- ctx = new_ctx;
2165
-
2166
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
2167
- ? internal.get_spread_update(ruleitem_spread_levels, [
2168
- {
2169
- type: /*type*/ ctx[7],
2170
- data: /*data*/ ctx[8],
2171
- pxmm: /*pxmm*/ ctx[0],
2172
- bounding: /*bounding*/ ctx[2]
2173
- }
2174
- ])
2175
- : {};
2176
-
2177
- ruleitem.$set(ruleitem_changes);
2178
- },
2179
- i(local) {
2180
- if (current) return;
2181
- internal.transition_in(ruleitem.$$.fragment, local);
2182
- current = true;
2183
- },
2184
- o(local) {
2185
- internal.transition_out(ruleitem.$$.fragment, local);
2186
- current = false;
2187
- },
2188
- d(detaching) {
2189
- if (detaching) internal.detach(first);
2190
- internal.destroy_component(ruleitem, detaching);
2191
- }
2192
- };
1878
+ function get_each_context$8(ctx, list, i) {
1879
+ const child_ctx = ctx.slice();
1880
+ child_ctx[4] = list[i];
1881
+ return child_ctx;
2193
1882
  }
2194
1883
 
2195
- function create_fragment$j(ctx) {
1884
+ // (8:0) {#if rooms}
1885
+ function create_if_block$5(ctx) {
2196
1886
  let div;
2197
1887
  let each_blocks = [];
2198
1888
  let each_1_lookup = new Map();
2199
1889
  let current;
2200
- let each_value = /*ruleLabelArray*/ ctx[1];
2201
- const get_key = ctx => /*type*/ ctx[7];
1890
+ let each_value = /*rooms*/ ctx[1];
1891
+ const get_key = ctx => /*room*/ ctx[4].id;
2202
1892
 
2203
1893
  for (let i = 0; i < each_value.length; i += 1) {
2204
- let child_ctx = get_each_context$5(ctx, each_value, i);
1894
+ let child_ctx = get_each_context$8(ctx, each_value, i);
2205
1895
  let key = get_key(child_ctx);
2206
- each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
1896
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
2207
1897
  }
2208
1898
 
2209
1899
  return {
@@ -2214,7 +1904,7 @@
2214
1904
  each_blocks[i].c();
2215
1905
  }
2216
1906
 
2217
- internal.attr(div, "class", "floorplan-plugin__rulelabels");
1907
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
2218
1908
  },
2219
1909
  m(target, anchor) {
2220
1910
  internal.insert(target, div, anchor);
@@ -2225,11 +1915,11 @@
2225
1915
 
2226
1916
  current = true;
2227
1917
  },
2228
- p(ctx, [dirty]) {
2229
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
2230
- each_value = /*ruleLabelArray*/ ctx[1];
1918
+ p(ctx, dirty) {
1919
+ if (dirty & /*rooms, getLabelElement*/ 3) {
1920
+ each_value = /*rooms*/ ctx[1];
2231
1921
  internal.group_outros();
2232
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$5, null, get_each_context$5);
1922
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$8, null, get_each_context$8);
2233
1923
  internal.check_outros();
2234
1924
  }
2235
1925
  },
@@ -2259,372 +1949,670 @@
2259
1949
  };
2260
1950
  }
2261
1951
 
2262
- function instance$j($$self, $$props, $$invalidate) {
2263
- let bounding;
2264
- let ruleLabelData;
2265
- let ruleLabelDataKeys;
2266
- let ruleLabelArray;
2267
- let { pxmm } = $$props;
2268
- let { floorIndex } = $$props;
2269
- let { floorplanData } = $$props;
2270
-
2271
- $$self.$$set = $$props => {
2272
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2273
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2274
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2275
- };
1952
+ // (10:4) {#each rooms as room (room.id)}
1953
+ function create_each_block$8(key_1, ctx) {
1954
+ let first;
1955
+ let roomlabel;
1956
+ let current;
2276
1957
 
2277
- $$self.$$.update = () => {
2278
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
2279
- $$invalidate(2, bounding = floorplanData.bounding);
2280
- }
2281
-
2282
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2283
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1958
+ const roomlabel_spread_levels = [
1959
+ {
1960
+ room: /*room*/ ctx[4],
1961
+ getLabelElement: /*getLabelElement*/ ctx[0]
2284
1962
  }
1963
+ ];
2285
1964
 
2286
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
2287
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
2288
- }
1965
+ let roomlabel_props = {};
2289
1966
 
2290
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
2291
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2292
- }
2293
- };
1967
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1968
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1969
+ }
2294
1970
 
2295
- return [
2296
- pxmm,
2297
- ruleLabelArray,
2298
- bounding,
2299
- floorIndex,
2300
- floorplanData,
2301
- ruleLabelData,
2302
- ruleLabelDataKeys
2303
- ];
2304
- }
1971
+ roomlabel = new RoomLabel({ props: roomlabel_props });
2305
1972
 
2306
- class RuleLabels extends internal.SvelteComponent {
2307
- constructor(options) {
2308
- super();
2309
- internal.init(this, options, instance$j, create_fragment$j, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
2310
- }
2311
- }
1973
+ return {
1974
+ key: key_1,
1975
+ first: null,
1976
+ c() {
1977
+ first = internal.empty();
1978
+ internal.create_component(roomlabel.$$.fragment);
1979
+ this.first = first;
1980
+ },
1981
+ m(target, anchor) {
1982
+ internal.insert(target, first, anchor);
1983
+ internal.mount_component(roomlabel, target, anchor);
1984
+ current = true;
1985
+ },
1986
+ p(new_ctx, dirty) {
1987
+ ctx = new_ctx;
2312
1988
 
2313
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1989
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1990
+ ? internal.get_spread_update(roomlabel_spread_levels, [
1991
+ {
1992
+ room: /*room*/ ctx[4],
1993
+ getLabelElement: /*getLabelElement*/ ctx[0]
1994
+ }
1995
+ ])
1996
+ : {};
2314
1997
 
2315
- function add_css$e(target) {
2316
- internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1998
+ roomlabel.$set(roomlabel_changes);
1999
+ },
2000
+ i(local) {
2001
+ if (current) return;
2002
+ internal.transition_in(roomlabel.$$.fragment, local);
2003
+ current = true;
2004
+ },
2005
+ o(local) {
2006
+ internal.transition_out(roomlabel.$$.fragment, local);
2007
+ current = false;
2008
+ },
2009
+ d(detaching) {
2010
+ if (detaching) internal.detach(first);
2011
+ internal.destroy_component(roomlabel, detaching);
2012
+ }
2013
+ };
2317
2014
  }
2318
2015
 
2319
2016
  function create_fragment$i(ctx) {
2320
- let img;
2321
- let img_src_value;
2017
+ let if_block_anchor;
2018
+ let current;
2019
+ let if_block = /*rooms*/ ctx[1] && create_if_block$5(ctx);
2322
2020
 
2323
2021
  return {
2324
2022
  c() {
2325
- img = internal.element("img");
2326
- if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
2327
- internal.attr(img, "alt", "floorplan iamge");
2328
- internal.attr(img, "class", "svelte-1gfoniz");
2023
+ if (if_block) if_block.c();
2024
+ if_block_anchor = internal.empty();
2329
2025
  },
2330
2026
  m(target, anchor) {
2331
- internal.insert(target, img, anchor);
2027
+ if (if_block) if_block.m(target, anchor);
2028
+ internal.insert(target, if_block_anchor, anchor);
2029
+ current = true;
2332
2030
  },
2333
2031
  p(ctx, [dirty]) {
2334
- if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
2335
- internal.attr(img, "src", img_src_value);
2032
+ if (/*rooms*/ ctx[1]) {
2033
+ if (if_block) {
2034
+ if_block.p(ctx, dirty);
2035
+
2036
+ if (dirty & /*rooms*/ 2) {
2037
+ internal.transition_in(if_block, 1);
2038
+ }
2039
+ } else {
2040
+ if_block = create_if_block$5(ctx);
2041
+ if_block.c();
2042
+ internal.transition_in(if_block, 1);
2043
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2044
+ }
2045
+ } else if (if_block) {
2046
+ internal.group_outros();
2047
+
2048
+ internal.transition_out(if_block, 1, 1, () => {
2049
+ if_block = null;
2050
+ });
2051
+
2052
+ internal.check_outros();
2336
2053
  }
2337
2054
  },
2338
- i: internal.noop,
2339
- o: internal.noop,
2055
+ i(local) {
2056
+ if (current) return;
2057
+ internal.transition_in(if_block);
2058
+ current = true;
2059
+ },
2060
+ o(local) {
2061
+ internal.transition_out(if_block);
2062
+ current = false;
2063
+ },
2340
2064
  d(detaching) {
2341
- if (detaching) internal.detach(img);
2065
+ if (if_block) if_block.d(detaching);
2066
+ if (detaching) internal.detach(if_block_anchor);
2342
2067
  }
2343
2068
  };
2344
2069
  }
2345
2070
 
2346
2071
  function instance$i($$self, $$props, $$invalidate) {
2347
- let { url } = $$props;
2072
+ let rooms;
2073
+ let { floorIndex } = $$props;
2074
+ let { floorplanData } = $$props;
2075
+ let { getLabelElement } = $$props;
2348
2076
 
2349
2077
  $$self.$$set = $$props => {
2350
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
2078
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2079
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2080
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
2351
2081
  };
2352
2082
 
2353
- return [url];
2083
+ $$self.$$.update = () => {
2084
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2085
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
2086
+ }
2087
+ };
2088
+
2089
+ return [getLabelElement, rooms, floorIndex, floorplanData];
2354
2090
  }
2355
2091
 
2356
- class Normalmage extends internal.SvelteComponent {
2092
+ class RoomLabels extends internal.SvelteComponent {
2357
2093
  constructor(options) {
2358
2094
  super();
2359
- internal.init(this, options, instance$i, create_fragment$i, internal.safe_not_equal, { url: 0 }, add_css$e);
2095
+
2096
+ internal.init(
2097
+ this,
2098
+ options,
2099
+ instance$i,
2100
+ create_fragment$i,
2101
+ internal.safe_not_equal,
2102
+ {
2103
+ floorIndex: 2,
2104
+ floorplanData: 3,
2105
+ getLabelElement: 0
2106
+ },
2107
+ add_css$e
2108
+ );
2360
2109
  }
2361
2110
  }
2362
2111
 
2363
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
2112
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
2364
2113
 
2365
2114
  function add_css$d(target) {
2366
- internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
2115
+ internal.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}");
2367
2116
  }
2368
2117
 
2369
- function create_fragment$h(ctx) {
2118
+ function get_each_context$7(ctx, list, i) {
2119
+ const child_ctx = ctx.slice();
2120
+ child_ctx[10] = list[i];
2121
+ child_ctx[12] = i;
2122
+ return child_ctx;
2123
+ }
2124
+
2125
+ function get_each_context_1(ctx, list, i) {
2126
+ const child_ctx = ctx.slice();
2127
+ child_ctx[13] = list[i];
2128
+ return child_ctx;
2129
+ }
2130
+
2131
+ // (53:4) {#each rulerLabels as rulerLabel}
2132
+ function create_each_block_1(ctx) {
2370
2133
  let div;
2371
- let html_tag;
2372
- let t;
2373
- let html_tag_1;
2374
2134
 
2375
2135
  return {
2376
2136
  c() {
2377
2137
  div = internal.element("div");
2378
- html_tag = new internal.HtmlTag();
2379
- t = internal.space();
2380
- html_tag_1 = new internal.HtmlTag();
2381
- html_tag.a = t;
2382
- html_tag_1.a = null;
2383
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
2138
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
2139
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
2140
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
2384
2141
  },
2385
2142
  m(target, anchor) {
2386
2143
  internal.insert(target, div, anchor);
2387
- html_tag.m(/*svgStyle*/ ctx[1], div);
2388
- internal.append(div, t);
2389
- html_tag_1.m(/*content*/ ctx[0], div);
2144
+ },
2145
+ p: internal.noop,
2146
+ d(detaching) {
2147
+ if (detaching) internal.detach(div);
2148
+ }
2149
+ };
2150
+ }
2151
+
2152
+ // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
2153
+ function create_each_block$7(key_1, ctx) {
2154
+ let div1;
2155
+ let div0;
2156
+ let t0_value = /*textItem*/ ctx[10].distance + "";
2157
+ let t0;
2158
+ let t1;
2159
+
2160
+ return {
2161
+ key: key_1,
2162
+ first: null,
2163
+ c() {
2164
+ div1 = internal.element("div");
2165
+ div0 = internal.element("div");
2166
+ t0 = internal.text(t0_value);
2167
+ t1 = internal.space();
2168
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
2169
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
2170
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
2171
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
2172
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
2173
+ this.first = div1;
2174
+ },
2175
+ m(target, anchor) {
2176
+ internal.insert(target, div1, anchor);
2177
+ internal.append(div1, div0);
2178
+ internal.append(div0, t0);
2179
+ internal.append(div1, t1);
2180
+ },
2181
+ p(new_ctx, dirty) {
2182
+ ctx = new_ctx;
2183
+ },
2184
+ d(detaching) {
2185
+ if (detaching) internal.detach(div1);
2186
+ }
2187
+ };
2188
+ }
2189
+
2190
+ function create_fragment$h(ctx) {
2191
+ let div3;
2192
+ let div0;
2193
+ let t0;
2194
+ let div1;
2195
+ let t1;
2196
+ let div2;
2197
+ let each_blocks = [];
2198
+ let each1_lookup = new Map();
2199
+ let div3_class_value;
2200
+ let each_value_1 = /*rulerLabels*/ ctx[2];
2201
+ let each_blocks_1 = [];
2202
+
2203
+ for (let i = 0; i < each_value_1.length; i += 1) {
2204
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
2205
+ }
2206
+
2207
+ let each_value = /*rulerTexts*/ ctx[3];
2208
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
2209
+
2210
+ for (let i = 0; i < each_value.length; i += 1) {
2211
+ let child_ctx = get_each_context$7(ctx, each_value, i);
2212
+ let key = get_key(child_ctx);
2213
+ each1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
2214
+ }
2215
+
2216
+ return {
2217
+ c() {
2218
+ div3 = internal.element("div");
2219
+ div0 = internal.element("div");
2220
+ t0 = internal.space();
2221
+ div1 = internal.element("div");
2222
+
2223
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2224
+ each_blocks_1[i].c();
2225
+ }
2226
+
2227
+ t1 = internal.space();
2228
+ div2 = internal.element("div");
2229
+
2230
+ for (let i = 0; i < each_blocks.length; i += 1) {
2231
+ each_blocks[i].c();
2232
+ }
2233
+
2234
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
2235
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
2236
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
2237
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
2238
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
2239
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2240
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2241
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2242
+ },
2243
+ m(target, anchor) {
2244
+ internal.insert(target, div3, anchor);
2245
+ internal.append(div3, div0);
2246
+ internal.append(div3, t0);
2247
+ internal.append(div3, div1);
2248
+
2249
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2250
+ each_blocks_1[i].m(div1, null);
2251
+ }
2252
+
2253
+ internal.append(div3, t1);
2254
+ internal.append(div3, div2);
2255
+
2256
+ for (let i = 0; i < each_blocks.length; i += 1) {
2257
+ each_blocks[i].m(div2, null);
2258
+ }
2390
2259
  },
2391
2260
  p(ctx, [dirty]) {
2392
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
2261
+ if (dirty & /*rulerLabels*/ 4) {
2262
+ each_value_1 = /*rulerLabels*/ ctx[2];
2263
+ let i;
2264
+
2265
+ for (i = 0; i < each_value_1.length; i += 1) {
2266
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
2267
+
2268
+ if (each_blocks_1[i]) {
2269
+ each_blocks_1[i].p(child_ctx, dirty);
2270
+ } else {
2271
+ each_blocks_1[i] = create_each_block_1(child_ctx);
2272
+ each_blocks_1[i].c();
2273
+ each_blocks_1[i].m(div1, null);
2274
+ }
2275
+ }
2276
+
2277
+ for (; i < each_blocks_1.length; i += 1) {
2278
+ each_blocks_1[i].d(1);
2279
+ }
2280
+
2281
+ each_blocks_1.length = each_value_1.length;
2282
+ }
2283
+
2284
+ if (dirty & /*rulerTexts, isRow*/ 10) {
2285
+ each_value = /*rulerTexts*/ ctx[3];
2286
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, internal.destroy_block, create_each_block$7, null, get_each_context$7);
2287
+ }
2288
+
2289
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
2290
+ internal.attr(div3, "class", div3_class_value);
2291
+ }
2292
+
2293
+ if (dirty & /*type, isRow*/ 3) {
2294
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2295
+ }
2393
2296
  },
2394
2297
  i: internal.noop,
2395
2298
  o: internal.noop,
2396
2299
  d(detaching) {
2397
- if (detaching) internal.detach(div);
2300
+ if (detaching) internal.detach(div3);
2301
+ internal.destroy_each(each_blocks_1, detaching);
2302
+
2303
+ for (let i = 0; i < each_blocks.length; i += 1) {
2304
+ each_blocks[i].d();
2305
+ }
2398
2306
  }
2399
2307
  };
2400
2308
  }
2401
2309
 
2310
+ const padding$1 = 1000;
2311
+ const exteriorWallOffset$1 = 180;
2312
+
2402
2313
  function instance$h($$self, $$props, $$invalidate) {
2403
- let { content } = $$props;
2314
+ let { type } = $$props;
2315
+ let { data } = $$props;
2316
+ let { bounding } = $$props;
2317
+ const isRow = type === 'top' || type === 'bottom';
2318
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
2319
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
2404
2320
 
2405
- const svgStyle = `
2406
- <style>
2407
- svg [type='lineGroup'] path {
2408
- fill: #ffffff;
2409
- stroke: #ffffff;
2410
- }
2411
- svg [type='lineItemGroup'] g g g g {
2412
- stroke: #ffffff;
2413
- }</style>
2414
- `;
2321
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2322
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2323
+ // 筛除重复数据
2324
+ if (index === 0) return true;
2325
+
2326
+ return x !== arr[index - 1];
2327
+ });
2328
+
2329
+ const rulerLabels = rulerPoints.map(num => {
2330
+ const left = isRow
2331
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2332
+ : 0;
2333
+
2334
+ const bottom = !isRow
2335
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2336
+ : 0;
2337
+
2338
+ return { left, bottom };
2339
+ });
2340
+
2341
+ rulerLabels.unshift({ left: 0, bottom: 0 });
2342
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
2343
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
2344
+
2345
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
2346
+ const distance = index === 0 ? 0 : num - arr[index - 1];
2347
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
2348
+
2349
+ const left = isRow
2350
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2351
+ : 0;
2352
+
2353
+ const bottom = !isRow
2354
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2355
+ : 0;
2356
+
2357
+ return { left, bottom, distance };
2358
+ }).filter(({ distance }) => distance / length > 0.1);
2415
2359
 
2416
2360
  $$self.$$set = $$props => {
2417
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
2361
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
2362
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
2363
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
2418
2364
  };
2419
2365
 
2420
- return [content, svgStyle];
2366
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
2421
2367
  }
2422
2368
 
2423
- class SvgImage extends internal.SvelteComponent {
2369
+ class RuleItem extends internal.SvelteComponent {
2424
2370
  constructor(options) {
2425
2371
  super();
2426
- internal.init(this, options, instance$h, create_fragment$h, internal.safe_not_equal, { content: 0 }, add_css$d);
2372
+ internal.init(this, options, instance$h, create_fragment$h, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$d);
2427
2373
  }
2428
2374
  }
2429
2375
 
2430
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
2376
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
2431
2377
 
2432
2378
  function add_css$c(target) {
2433
- internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
2379
+ internal.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}");
2434
2380
  }
2435
2381
 
2436
- // (13:22)
2437
- function create_if_block_1$3(ctx) {
2438
- let normalimage;
2382
+ function get_each_context$6(ctx, list, i) {
2383
+ const child_ctx = ctx.slice();
2384
+ child_ctx[12] = list[i][0];
2385
+ child_ctx[13] = list[i][1];
2386
+ return child_ctx;
2387
+ }
2388
+
2389
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
2390
+ function create_each_block$6(key_1, ctx) {
2391
+ let first;
2392
+ let ruleitem;
2439
2393
  let current;
2440
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
2441
2394
 
2442
- return {
2443
- c() {
2444
- internal.create_component(normalimage.$$.fragment);
2445
- },
2446
- m(target, anchor) {
2447
- internal.mount_component(normalimage, target, anchor);
2448
- current = true;
2449
- },
2450
- p(ctx, dirty) {
2451
- const normalimage_changes = {};
2452
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
2453
- normalimage.$set(normalimage_changes);
2454
- },
2455
- i(local) {
2456
- if (current) return;
2457
- internal.transition_in(normalimage.$$.fragment, local);
2458
- current = true;
2459
- },
2460
- o(local) {
2461
- internal.transition_out(normalimage.$$.fragment, local);
2462
- current = false;
2463
- },
2464
- d(detaching) {
2465
- internal.destroy_component(normalimage, detaching);
2395
+ const ruleitem_spread_levels = [
2396
+ {
2397
+ type: /*type*/ ctx[12],
2398
+ data: /*data*/ ctx[13],
2399
+ bounding: /*bounding*/ ctx[0]
2466
2400
  }
2467
- };
2468
- }
2401
+ ];
2469
2402
 
2470
- // (11:2) {#if svgContent}
2471
- function create_if_block$5(ctx) {
2472
- let svgimage;
2473
- let current;
2403
+ let ruleitem_props = {};
2474
2404
 
2475
- svgimage = new SvgImage({
2476
- props: { content: /*svgContent*/ ctx[0] }
2477
- });
2405
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2406
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
2407
+ }
2408
+
2409
+ ruleitem = new RuleItem({ props: ruleitem_props });
2478
2410
 
2479
2411
  return {
2412
+ key: key_1,
2413
+ first: null,
2480
2414
  c() {
2481
- internal.create_component(svgimage.$$.fragment);
2415
+ first = internal.empty();
2416
+ internal.create_component(ruleitem.$$.fragment);
2417
+ this.first = first;
2482
2418
  },
2483
2419
  m(target, anchor) {
2484
- internal.mount_component(svgimage, target, anchor);
2420
+ internal.insert(target, first, anchor);
2421
+ internal.mount_component(ruleitem, target, anchor);
2485
2422
  current = true;
2486
2423
  },
2487
- p(ctx, dirty) {
2488
- const svgimage_changes = {};
2489
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
2490
- svgimage.$set(svgimage_changes);
2424
+ p(new_ctx, dirty) {
2425
+ ctx = new_ctx;
2426
+
2427
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
2428
+ ? internal.get_spread_update(ruleitem_spread_levels, [
2429
+ {
2430
+ type: /*type*/ ctx[12],
2431
+ data: /*data*/ ctx[13],
2432
+ bounding: /*bounding*/ ctx[0]
2433
+ }
2434
+ ])
2435
+ : {};
2436
+
2437
+ ruleitem.$set(ruleitem_changes);
2491
2438
  },
2492
2439
  i(local) {
2493
2440
  if (current) return;
2494
- internal.transition_in(svgimage.$$.fragment, local);
2441
+ internal.transition_in(ruleitem.$$.fragment, local);
2495
2442
  current = true;
2496
2443
  },
2497
2444
  o(local) {
2498
- internal.transition_out(svgimage.$$.fragment, local);
2445
+ internal.transition_out(ruleitem.$$.fragment, local);
2499
2446
  current = false;
2500
2447
  },
2501
2448
  d(detaching) {
2502
- internal.destroy_component(svgimage, detaching);
2449
+ if (detaching) internal.detach(first);
2450
+ internal.destroy_component(ruleitem, detaching);
2503
2451
  }
2504
2452
  };
2505
2453
  }
2506
2454
 
2507
2455
  function create_fragment$g(ctx) {
2508
2456
  let div;
2509
- let current_block_type_index;
2510
- let if_block;
2457
+ let each_blocks = [];
2458
+ let each_1_lookup = new Map();
2511
2459
  let current;
2512
- const if_block_creators = [create_if_block$5, create_if_block_1$3];
2513
- const if_blocks = [];
2514
-
2515
- function select_block_type(ctx, dirty) {
2516
- if (/*svgContent*/ ctx[0]) return 0;
2517
- if (/*imageData*/ ctx[1]) return 1;
2518
- return -1;
2519
- }
2460
+ let each_value = /*ruleLabelArray*/ ctx[3];
2461
+ const get_key = ctx => /*type*/ ctx[12];
2520
2462
 
2521
- if (~(current_block_type_index = select_block_type(ctx))) {
2522
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2463
+ for (let i = 0; i < each_value.length; i += 1) {
2464
+ let child_ctx = get_each_context$6(ctx, each_value, i);
2465
+ let key = get_key(child_ctx);
2466
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
2523
2467
  }
2524
2468
 
2525
2469
  return {
2526
2470
  c() {
2527
2471
  div = internal.element("div");
2528
- if (if_block) if_block.c();
2529
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
2472
+
2473
+ for (let i = 0; i < each_blocks.length; i += 1) {
2474
+ each_blocks[i].c();
2475
+ }
2476
+
2477
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
2478
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
2479
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
2530
2480
  },
2531
2481
  m(target, anchor) {
2532
2482
  internal.insert(target, div, anchor);
2533
2483
 
2534
- if (~current_block_type_index) {
2535
- if_blocks[current_block_type_index].m(div, null);
2484
+ for (let i = 0; i < each_blocks.length; i += 1) {
2485
+ each_blocks[i].m(div, null);
2536
2486
  }
2537
2487
 
2538
2488
  current = true;
2539
2489
  },
2540
2490
  p(ctx, [dirty]) {
2541
- let previous_block_index = current_block_type_index;
2542
- current_block_type_index = select_block_type(ctx);
2543
-
2544
- if (current_block_type_index === previous_block_index) {
2545
- if (~current_block_type_index) {
2546
- if_blocks[current_block_type_index].p(ctx, dirty);
2547
- }
2548
- } else {
2549
- if (if_block) {
2550
- internal.group_outros();
2551
-
2552
- internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
2553
- if_blocks[previous_block_index] = null;
2554
- });
2555
-
2556
- internal.check_outros();
2557
- }
2558
-
2559
- if (~current_block_type_index) {
2560
- if_block = if_blocks[current_block_type_index];
2491
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
2492
+ each_value = /*ruleLabelArray*/ ctx[3];
2493
+ internal.group_outros();
2494
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$6, null, get_each_context$6);
2495
+ internal.check_outros();
2496
+ }
2561
2497
 
2562
- if (!if_block) {
2563
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2564
- if_block.c();
2565
- } else {
2566
- if_block.p(ctx, dirty);
2567
- }
2498
+ if (dirty & /*width*/ 4) {
2499
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
2500
+ }
2568
2501
 
2569
- internal.transition_in(if_block, 1);
2570
- if_block.m(div, null);
2571
- } else {
2572
- if_block = null;
2573
- }
2502
+ if (dirty & /*height*/ 2) {
2503
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
2574
2504
  }
2575
2505
  },
2576
2506
  i(local) {
2577
2507
  if (current) return;
2578
- internal.transition_in(if_block);
2508
+
2509
+ for (let i = 0; i < each_value.length; i += 1) {
2510
+ internal.transition_in(each_blocks[i]);
2511
+ }
2512
+
2579
2513
  current = true;
2580
2514
  },
2581
2515
  o(local) {
2582
- internal.transition_out(if_block);
2516
+ for (let i = 0; i < each_blocks.length; i += 1) {
2517
+ internal.transition_out(each_blocks[i]);
2518
+ }
2519
+
2583
2520
  current = false;
2584
2521
  },
2585
2522
  d(detaching) {
2586
2523
  if (detaching) internal.detach(div);
2587
2524
 
2588
- if (~current_block_type_index) {
2589
- if_blocks[current_block_type_index].d();
2525
+ for (let i = 0; i < each_blocks.length; i += 1) {
2526
+ each_blocks[i].d();
2590
2527
  }
2591
2528
  }
2592
2529
  };
2593
2530
  }
2594
2531
 
2532
+ const padding = 1000;
2533
+ const exteriorWallOffset = 180;
2534
+
2595
2535
  function instance$g($$self, $$props, $$invalidate) {
2596
- let imageData;
2597
- let svgContent;
2598
- var _a, _b;
2536
+ let bounding;
2537
+ let ruleLabelData;
2538
+ let ruleLabelDataKeys;
2539
+ let ruleLabelArray;
2540
+ let boundingWidth;
2541
+ let boundingHeight;
2542
+ let contentWidth;
2543
+ let contentHeight;
2544
+ let width;
2545
+ let height;
2599
2546
  let { floorIndex } = $$props;
2600
2547
  let { floorplanData } = $$props;
2601
2548
 
2602
2549
  $$self.$$set = $$props => {
2603
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2604
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2550
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
2551
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
2605
2552
  };
2606
2553
 
2607
2554
  $$self.$$.update = () => {
2608
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2609
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
2555
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
2556
+ $$invalidate(0, bounding = floorplanData.bounding);
2610
2557
  }
2611
2558
 
2612
- if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
2613
- $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
2614
- ? void 0
2615
- : _a[floorIndex]) === null || _b === void 0
2616
- ? void 0
2617
- : _b.svgContent);
2559
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
2560
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
2561
+ }
2562
+
2563
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
2564
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
2565
+ }
2566
+
2567
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
2568
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2569
+ }
2570
+
2571
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2572
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
2573
+ }
2574
+
2575
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2576
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
2577
+ }
2578
+
2579
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2580
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
2581
+ }
2582
+
2583
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2584
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
2585
+ }
2586
+
2587
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
2588
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
2589
+ }
2590
+
2591
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
2592
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
2618
2593
  }
2619
2594
  };
2620
2595
 
2621
- return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
2596
+ return [
2597
+ bounding,
2598
+ height,
2599
+ width,
2600
+ ruleLabelArray,
2601
+ floorIndex,
2602
+ floorplanData,
2603
+ boundingHeight,
2604
+ contentHeight,
2605
+ boundingWidth,
2606
+ contentWidth,
2607
+ ruleLabelData,
2608
+ ruleLabelDataKeys
2609
+ ];
2622
2610
  }
2623
2611
 
2624
- class BaseImage extends internal.SvelteComponent {
2612
+ class RuleLabels extends internal.SvelteComponent {
2625
2613
  constructor(options) {
2626
2614
  super();
2627
- internal.init(this, options, instance$g, create_fragment$g, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$c);
2615
+ internal.init(this, options, instance$g, create_fragment$g, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$c);
2628
2616
  }
2629
2617
  }
2630
2618
 
@@ -2898,17 +2886,17 @@
2898
2886
  internal.append_styles(target, "svelte-1d4xj70", "svg.svelte-1d4xj70{position:absolute;width:100%;height:100%;overflow:visible}");
2899
2887
  }
2900
2888
 
2901
- function get_each_context$4(ctx, list, i) {
2889
+ function get_each_context$5(ctx, list, i) {
2902
2890
  const child_ctx = ctx.slice();
2903
- child_ctx[4] = list[i];
2891
+ child_ctx[5] = list[i];
2904
2892
  return child_ctx;
2905
2893
  }
2906
2894
 
2907
- // (18:6) {:else}
2895
+ // (19:6) {:else}
2908
2896
  function create_else_block(ctx) {
2909
2897
  let roommaterial_1;
2910
2898
  let current;
2911
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
2899
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
2912
2900
 
2913
2901
  return {
2914
2902
  c() {
@@ -2920,7 +2908,7 @@
2920
2908
  },
2921
2909
  p(ctx, dirty) {
2922
2910
  const roommaterial_1_changes = {};
2923
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
2911
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
2924
2912
  roommaterial_1.$set(roommaterial_1_changes);
2925
2913
  },
2926
2914
  i(local) {
@@ -2938,11 +2926,11 @@
2938
2926
  };
2939
2927
  }
2940
2928
 
2941
- // (16:37)
2929
+ // (17:37)
2942
2930
  function create_if_block_1$2(ctx) {
2943
2931
  let roommaterial_2;
2944
2932
  let current;
2945
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
2933
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
2946
2934
 
2947
2935
  return {
2948
2936
  c() {
@@ -2954,7 +2942,7 @@
2954
2942
  },
2955
2943
  p(ctx, dirty) {
2956
2944
  const roommaterial_2_changes = {};
2957
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
2945
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
2958
2946
  roommaterial_2.$set(roommaterial_2_changes);
2959
2947
  },
2960
2948
  i(local) {
@@ -2972,11 +2960,11 @@
2972
2960
  };
2973
2961
  }
2974
2962
 
2975
- // (14:6) {#if room.floorType === 1}
2963
+ // (15:6) {#if room.floorType === 1}
2976
2964
  function create_if_block$4(ctx) {
2977
2965
  let roommaterial_0;
2978
2966
  let current;
2979
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
2967
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
2980
2968
 
2981
2969
  return {
2982
2970
  c() {
@@ -2988,7 +2976,7 @@
2988
2976
  },
2989
2977
  p(ctx, dirty) {
2990
2978
  const roommaterial_0_changes = {};
2991
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
2979
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
2992
2980
  roommaterial_0.$set(roommaterial_0_changes);
2993
2981
  },
2994
2982
  i(local) {
@@ -3006,18 +2994,19 @@
3006
2994
  };
3007
2995
  }
3008
2996
 
3009
- // (12:2) {#each rooms as room}
3010
- function create_each_block$4(ctx) {
2997
+ // (13:2) {#each rooms as room}
2998
+ function create_each_block$5(ctx) {
3011
2999
  let svg;
3012
3000
  let current_block_type_index;
3013
3001
  let if_block;
3002
+ let svg_viewBox_value;
3014
3003
  let current;
3015
3004
  const if_block_creators = [create_if_block$4, create_if_block_1$2, create_else_block];
3016
3005
  const if_blocks = [];
3017
3006
 
3018
3007
  function select_block_type(ctx, dirty) {
3019
- if (/*room*/ ctx[4].floorType === 1) return 0;
3020
- if (/*room*/ ctx[4].floorType === 0) return 1;
3008
+ if (/*room*/ ctx[5].floorType === 1) return 0;
3009
+ if (/*room*/ ctx[5].floorType === 0) return 1;
3021
3010
  return 2;
3022
3011
  }
3023
3012
 
@@ -3028,6 +3017,9 @@
3028
3017
  c() {
3029
3018
  svg = internal.svg_element("svg");
3030
3019
  if_block.c();
3020
+ internal.attr(svg, "width", "100%");
3021
+ internal.attr(svg, "height", "100%");
3022
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
3031
3023
  internal.attr(svg, "class", "svelte-1d4xj70");
3032
3024
  },
3033
3025
  m(target, anchor) {
@@ -3085,7 +3077,7 @@
3085
3077
  let each_blocks = [];
3086
3078
 
3087
3079
  for (let i = 0; i < each_value.length; i += 1) {
3088
- each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
3080
+ each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
3089
3081
  }
3090
3082
 
3091
3083
  const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
@@ -3112,18 +3104,18 @@
3112
3104
  current = true;
3113
3105
  },
3114
3106
  p(ctx, [dirty]) {
3115
- if (dirty & /*rooms*/ 1) {
3107
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
3116
3108
  each_value = /*rooms*/ ctx[0];
3117
3109
  let i;
3118
3110
 
3119
3111
  for (i = 0; i < each_value.length; i += 1) {
3120
- const child_ctx = get_each_context$4(ctx, each_value, i);
3112
+ const child_ctx = get_each_context$5(ctx, each_value, i);
3121
3113
 
3122
3114
  if (each_blocks[i]) {
3123
3115
  each_blocks[i].p(child_ctx, dirty);
3124
3116
  internal.transition_in(each_blocks[i], 1);
3125
3117
  } else {
3126
- each_blocks[i] = create_each_block$4(child_ctx);
3118
+ each_blocks[i] = create_each_block$5(child_ctx);
3127
3119
  each_blocks[i].c();
3128
3120
  internal.transition_in(each_blocks[i], 1);
3129
3121
  each_blocks[i].m(div, null);
@@ -3167,30 +3159,30 @@
3167
3159
  function instance$c($$self, $$props, $$invalidate) {
3168
3160
  let rooms;
3169
3161
  let { floorIndex } = $$props;
3170
- let { pxmm } = $$props;
3171
3162
  let { floorplanData } = $$props;
3163
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3164
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3172
3165
 
3173
3166
  $$self.$$set = $$props => {
3174
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3175
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
3176
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3167
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
3168
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
3177
3169
  };
3178
3170
 
3179
3171
  $$self.$$.update = () => {
3180
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
3172
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
3181
3173
  $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
3182
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
3174
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
3183
3175
  })));
3184
3176
  }
3185
3177
  };
3186
3178
 
3187
- return [rooms, floorIndex, pxmm, floorplanData];
3179
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
3188
3180
  }
3189
3181
 
3190
3182
  class RoomMaterial extends internal.SvelteComponent {
3191
3183
  constructor(options) {
3192
3184
  super();
3193
- internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$b);
3185
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$b);
3194
3186
  }
3195
3187
  }
3196
3188
 
@@ -3223,55 +3215,52 @@
3223
3215
  }
3224
3216
 
3225
3217
  function instance$b($$self, $$props, $$invalidate) {
3226
- let { pxmm } = $$props;
3227
3218
  let { room } = $$props;
3228
3219
  let { floorplanData } = $$props;
3229
3220
  const { bounding } = floorplanData;
3230
3221
 
3231
3222
  const _pathD = pathD(room.path, {
3232
3223
  needZ: true,
3233
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
3224
+ format: vector => formatFloorplanPoint(vector, bounding)
3234
3225
  });
3235
3226
 
3236
3227
  $$self.$$set = $$props => {
3237
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
3238
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
3239
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3228
+ if ('room' in $$props) $$invalidate(1, room = $$props.room);
3229
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3240
3230
  };
3241
3231
 
3242
- return [_pathD, pxmm, room, floorplanData];
3232
+ return [_pathD, room, floorplanData];
3243
3233
  }
3244
3234
 
3245
3235
  class Room extends internal.SvelteComponent {
3246
3236
  constructor(options) {
3247
3237
  super();
3248
- internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$a);
3238
+ internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { room: 1, floorplanData: 2 }, add_css$a);
3249
3239
  }
3250
3240
  }
3251
3241
 
3252
3242
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
3253
3243
 
3254
3244
  function add_css$9(target) {
3255
- internal.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}");
3245
+ internal.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}");
3256
3246
  }
3257
3247
 
3258
- function get_each_context$3(ctx, list, i) {
3248
+ function get_each_context$4(ctx, list, i) {
3259
3249
  const child_ctx = ctx.slice();
3260
- child_ctx[12] = list[i];
3250
+ child_ctx[4] = list[i];
3261
3251
  return child_ctx;
3262
3252
  }
3263
3253
 
3264
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3265
- function create_each_block$3(key_1, ctx) {
3254
+ // (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3255
+ function create_each_block$4(key_1, ctx) {
3266
3256
  let first;
3267
3257
  let room;
3268
3258
  let current;
3269
3259
 
3270
3260
  const room_spread_levels = [
3271
3261
  {
3272
- room: /*room*/ ctx[12],
3273
- floorplanData: /*floorplanData*/ ctx[2],
3274
- pxmm: /*pxmm*/ ctx[0]
3262
+ room: /*room*/ ctx[4],
3263
+ floorplanData: /*floorplanData*/ ctx[1]
3275
3264
  }
3276
3265
  ];
3277
3266
 
@@ -3299,12 +3288,11 @@
3299
3288
  p(new_ctx, dirty) {
3300
3289
  ctx = new_ctx;
3301
3290
 
3302
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
3291
+ const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
3303
3292
  ? internal.get_spread_update(room_spread_levels, [
3304
3293
  {
3305
- room: /*room*/ ctx[12],
3306
- floorplanData: /*floorplanData*/ ctx[2],
3307
- pxmm: /*pxmm*/ ctx[0]
3294
+ room: /*room*/ ctx[4],
3295
+ floorplanData: /*floorplanData*/ ctx[1]
3308
3296
  }
3309
3297
  ])
3310
3298
  : {};
@@ -3332,17 +3320,14 @@
3332
3320
  let svg;
3333
3321
  let each_blocks = [];
3334
3322
  let each_1_lookup = new Map();
3335
- let div_resize_listener;
3336
3323
  let current;
3337
- let mounted;
3338
- let dispose;
3339
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3340
- const get_key = ctx => /*room*/ ctx[12].id;
3324
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3325
+ const get_key = ctx => /*room*/ ctx[4].id;
3341
3326
 
3342
3327
  for (let i = 0; i < each_value.length; i += 1) {
3343
- let child_ctx = get_each_context$3(ctx, each_value, i);
3328
+ let child_ctx = get_each_context$4(ctx, each_value, i);
3344
3329
  let key = get_key(child_ctx);
3345
- each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
3330
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
3346
3331
  }
3347
3332
 
3348
3333
  return {
@@ -3354,9 +3339,11 @@
3354
3339
  each_blocks[i].c();
3355
3340
  }
3356
3341
 
3357
- internal.attr(svg, "class", "svelte-klfhwd");
3358
- internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-klfhwd");
3359
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
3342
+ internal.attr(svg, "width", "100%");
3343
+ internal.attr(svg, "height", "100%");
3344
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
3345
+ internal.attr(svg, "class", "svelte-1kqo6e4");
3346
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
3360
3347
  },
3361
3348
  m(target, anchor) {
3362
3349
  internal.insert(target, div, anchor);
@@ -3366,20 +3353,13 @@
3366
3353
  each_blocks[i].m(svg, null);
3367
3354
  }
3368
3355
 
3369
- /*div_binding*/ ctx[9](div);
3370
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
3371
3356
  current = true;
3372
-
3373
- if (!mounted) {
3374
- dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
3375
- mounted = true;
3376
- }
3377
3357
  },
3378
3358
  p(ctx, [dirty]) {
3379
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
3380
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3359
+ if (dirty & /*floorplanData, floorIndex*/ 3) {
3360
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3381
3361
  internal.group_outros();
3382
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$3, null, get_each_context$3);
3362
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$4, null, get_each_context$4);
3383
3363
  internal.check_outros();
3384
3364
  }
3385
3365
  },
@@ -3405,127 +3385,46 @@
3405
3385
  for (let i = 0; i < each_blocks.length; i += 1) {
3406
3386
  each_blocks[i].d();
3407
3387
  }
3408
-
3409
- /*div_binding*/ ctx[9](null);
3410
- div_resize_listener();
3411
- mounted = false;
3412
- dispose();
3413
3388
  }
3414
3389
  };
3415
3390
  }
3416
3391
 
3417
3392
  function instance$a($$self, $$props, $$invalidate) {
3418
- let { five } = $$props;
3419
- let { pxmm } = $$props;
3420
3393
  let { floorIndex } = $$props;
3421
3394
  let { floorplanData } = $$props;
3422
- let { onRoomHeightClick } = $$props;
3423
- let clientWidth;
3424
- let clientHeight;
3425
- let highlightContainerDom;
3426
- const { observers: floorplan_observers } = floorplanData;
3427
-
3428
- const handleClick = function (e) {
3429
- if ((onRoomHeightClick === null || onRoomHeightClick === void 0
3430
- ? void 0
3431
- : onRoomHeightClick(e)) === false) return;
3432
-
3433
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
3434
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
3435
-
3436
- const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
3437
- const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
3438
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
3439
-
3440
- // px 转换为 百分比
3441
- const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
3442
-
3443
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
3444
- const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
3445
- const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
3446
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
3447
- })[0];
3448
-
3449
- five.moveToPano(closestPoint.index);
3450
- };
3451
-
3452
- function div_binding($$value) {
3453
- internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
3454
- highlightContainerDom = $$value;
3455
- $$invalidate(5, highlightContainerDom);
3456
- });
3457
- }
3458
-
3459
- function div_elementresize_handler() {
3460
- clientWidth = this.clientWidth;
3461
- clientHeight = this.clientHeight;
3462
- $$invalidate(3, clientWidth);
3463
- $$invalidate(4, clientHeight);
3464
- }
3395
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3396
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3465
3397
 
3466
3398
  $$self.$$set = $$props => {
3467
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
3468
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3469
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3470
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3471
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
3399
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
3400
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
3472
3401
  };
3473
3402
 
3474
- return [
3475
- pxmm,
3476
- floorIndex,
3477
- floorplanData,
3478
- clientWidth,
3479
- clientHeight,
3480
- highlightContainerDom,
3481
- handleClick,
3482
- five,
3483
- onRoomHeightClick,
3484
- div_binding,
3485
- div_elementresize_handler
3486
- ];
3403
+ return [floorIndex, floorplanData, boundingWidth, boundingHeight];
3487
3404
  }
3488
3405
 
3489
3406
  class RoomHighlight extends internal.SvelteComponent {
3490
3407
  constructor(options) {
3491
3408
  super();
3492
-
3493
- internal.init(
3494
- this,
3495
- options,
3496
- instance$a,
3497
- create_fragment$a,
3498
- internal.safe_not_equal,
3499
- {
3500
- five: 7,
3501
- pxmm: 0,
3502
- floorIndex: 1,
3503
- floorplanData: 2,
3504
- onRoomHeightClick: 8
3505
- },
3506
- add_css$9
3507
- );
3409
+ internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$9);
3508
3410
  }
3509
3411
  }
3510
3412
 
3511
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
3413
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
3512
3414
 
3513
3415
  function add_css$8(target) {
3514
- internal.append_styles(target, "svelte-tlo7rk", ".floorplan-current-floor.svelte-tlo7rk{position:relative;width:100%;height:100%}");
3416
+ internal.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}");
3515
3417
  }
3516
3418
 
3517
- // (19:2) {#if hoverEnable}
3419
+ // (17:2) {#if hoverEnable}
3518
3420
  function create_if_block_2(ctx) {
3519
3421
  let roomhighlight;
3520
3422
  let current;
3521
3423
 
3522
3424
  const roomhighlight_spread_levels = [
3523
3425
  {
3524
- five: /*five*/ ctx[1],
3525
- pxmm: /*pxmm*/ ctx[0],
3526
- floorIndex: /*floorIndex*/ ctx[2],
3527
- floorplanData: /*floorplanData*/ ctx[6],
3528
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3426
+ floorIndex: /*floorIndex*/ ctx[1],
3427
+ floorplanData: /*floorplanData*/ ctx[5]
3529
3428
  }
3530
3429
  ];
3531
3430
 
@@ -3546,14 +3445,11 @@
3546
3445
  current = true;
3547
3446
  },
3548
3447
  p(ctx, dirty) {
3549
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
3448
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3550
3449
  ? internal.get_spread_update(roomhighlight_spread_levels, [
3551
3450
  {
3552
- five: /*five*/ ctx[1],
3553
- pxmm: /*pxmm*/ ctx[0],
3554
- floorIndex: /*floorIndex*/ ctx[2],
3555
- floorplanData: /*floorplanData*/ ctx[6],
3556
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3451
+ floorIndex: /*floorIndex*/ ctx[1],
3452
+ floorplanData: /*floorplanData*/ ctx[5]
3557
3453
  }
3558
3454
  ])
3559
3455
  : {};
@@ -3575,16 +3471,16 @@
3575
3471
  };
3576
3472
  }
3577
3473
 
3578
- // (23:2) {#if roomLabelsEnable}
3474
+ // (21:2) {#if roomLabelsEnable}
3579
3475
  function create_if_block_1$1(ctx) {
3580
3476
  let roomlabels;
3581
3477
  let current;
3582
3478
 
3583
3479
  const roomlabels_spread_levels = [
3584
3480
  {
3585
- floorplanData: /*floorplanData*/ ctx[6],
3586
- floorIndex: /*floorIndex*/ ctx[2],
3587
- getLabelElement: /*getLabelElement*/ ctx[8]
3481
+ floorplanData: /*floorplanData*/ ctx[5],
3482
+ floorIndex: /*floorIndex*/ ctx[1],
3483
+ getLabelElement: /*getLabelElement*/ ctx[6]
3588
3484
  }
3589
3485
  ];
3590
3486
 
@@ -3605,12 +3501,12 @@
3605
3501
  current = true;
3606
3502
  },
3607
3503
  p(ctx, dirty) {
3608
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
3504
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 98)
3609
3505
  ? internal.get_spread_update(roomlabels_spread_levels, [
3610
3506
  {
3611
- floorplanData: /*floorplanData*/ ctx[6],
3612
- floorIndex: /*floorIndex*/ ctx[2],
3613
- getLabelElement: /*getLabelElement*/ ctx[8]
3507
+ floorplanData: /*floorplanData*/ ctx[5],
3508
+ floorIndex: /*floorIndex*/ ctx[1],
3509
+ getLabelElement: /*getLabelElement*/ ctx[6]
3614
3510
  }
3615
3511
  ])
3616
3512
  : {};
@@ -3632,16 +3528,15 @@
3632
3528
  };
3633
3529
  }
3634
3530
 
3635
- // (26:2) {#if ruleLabelsEnable}
3531
+ // (24:2) {#if ruleLabelsEnable}
3636
3532
  function create_if_block$3(ctx) {
3637
3533
  let rulelabels;
3638
3534
  let current;
3639
3535
 
3640
3536
  const rulelabels_spread_levels = [
3641
3537
  {
3642
- floorplanData: /*floorplanData*/ ctx[6],
3643
- floorIndex: /*floorIndex*/ ctx[2],
3644
- pxmm: /*pxmm*/ ctx[0]
3538
+ floorplanData: /*floorplanData*/ ctx[5],
3539
+ floorIndex: /*floorIndex*/ ctx[1]
3645
3540
  }
3646
3541
  ];
3647
3542
 
@@ -3662,12 +3557,11 @@
3662
3557
  current = true;
3663
3558
  },
3664
3559
  p(ctx, dirty) {
3665
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
3560
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3666
3561
  ? internal.get_spread_update(rulelabels_spread_levels, [
3667
3562
  {
3668
- floorplanData: /*floorplanData*/ ctx[6],
3669
- floorIndex: /*floorIndex*/ ctx[2],
3670
- pxmm: /*pxmm*/ ctx[0]
3563
+ floorplanData: /*floorplanData*/ ctx[5],
3564
+ floorIndex: /*floorIndex*/ ctx[1]
3671
3565
  }
3672
3566
  ])
3673
3567
  : {};
@@ -3697,13 +3591,13 @@
3697
3591
  let baseimage;
3698
3592
  let t2;
3699
3593
  let t3;
3594
+ let div_class_value;
3700
3595
  let current;
3701
3596
 
3702
3597
  const roommaterial_spread_levels = [
3703
3598
  {
3704
- floorIndex: /*floorIndex*/ ctx[2],
3705
- floorplanData: /*floorplanData*/ ctx[6],
3706
- pxmm: /*pxmm*/ ctx[0]
3599
+ floorIndex: /*floorIndex*/ ctx[1],
3600
+ floorplanData: /*floorplanData*/ ctx[5]
3707
3601
  }
3708
3602
  ];
3709
3603
 
@@ -3714,12 +3608,12 @@
3714
3608
  }
3715
3609
 
3716
3610
  roommaterial = new RoomMaterial({ props: roommaterial_props });
3717
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
3611
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
3718
3612
 
3719
3613
  const baseimage_spread_levels = [
3720
3614
  {
3721
- floorplanData: /*floorplanData*/ ctx[6],
3722
- floorIndex: /*floorIndex*/ ctx[2]
3615
+ floorplanData: /*floorplanData*/ ctx[5],
3616
+ floorIndex: /*floorIndex*/ ctx[1]
3723
3617
  }
3724
3618
  ];
3725
3619
 
@@ -3730,8 +3624,8 @@
3730
3624
  }
3731
3625
 
3732
3626
  baseimage = new BaseImage({ props: baseimage_props });
3733
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
3734
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$3(ctx);
3627
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
3628
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$3(ctx);
3735
3629
 
3736
3630
  return {
3737
3631
  c() {
@@ -3745,7 +3639,10 @@
3745
3639
  if (if_block1) if_block1.c();
3746
3640
  t3 = internal.space();
3747
3641
  if (if_block2) if_block2.c();
3748
- internal.attr(div, "class", "floorplan-current-floor svelte-tlo7rk");
3642
+
3643
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3644
+ ? ' floorplan-plugin__floor--is-current'
3645
+ : ''}`) + " svelte-bl8zrz"));
3749
3646
  },
3750
3647
  m(target, anchor) {
3751
3648
  internal.insert(target, div, anchor);
@@ -3761,23 +3658,22 @@
3761
3658
  current = true;
3762
3659
  },
3763
3660
  p(ctx, [dirty]) {
3764
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
3661
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3765
3662
  ? internal.get_spread_update(roommaterial_spread_levels, [
3766
3663
  {
3767
- floorIndex: /*floorIndex*/ ctx[2],
3768
- floorplanData: /*floorplanData*/ ctx[6],
3769
- pxmm: /*pxmm*/ ctx[0]
3664
+ floorIndex: /*floorIndex*/ ctx[1],
3665
+ floorplanData: /*floorplanData*/ ctx[5]
3770
3666
  }
3771
3667
  ])
3772
3668
  : {};
3773
3669
 
3774
3670
  roommaterial.$set(roommaterial_changes);
3775
3671
 
3776
- if (/*hoverEnable*/ ctx[3]) {
3672
+ if (/*hoverEnable*/ ctx[2]) {
3777
3673
  if (if_block0) {
3778
3674
  if_block0.p(ctx, dirty);
3779
3675
 
3780
- if (dirty & /*hoverEnable*/ 8) {
3676
+ if (dirty & /*hoverEnable*/ 4) {
3781
3677
  internal.transition_in(if_block0, 1);
3782
3678
  }
3783
3679
  } else {
@@ -3796,22 +3692,22 @@
3796
3692
  internal.check_outros();
3797
3693
  }
3798
3694
 
3799
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
3695
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3800
3696
  ? internal.get_spread_update(baseimage_spread_levels, [
3801
3697
  {
3802
- floorplanData: /*floorplanData*/ ctx[6],
3803
- floorIndex: /*floorIndex*/ ctx[2]
3698
+ floorplanData: /*floorplanData*/ ctx[5],
3699
+ floorIndex: /*floorIndex*/ ctx[1]
3804
3700
  }
3805
3701
  ])
3806
3702
  : {};
3807
3703
 
3808
3704
  baseimage.$set(baseimage_changes);
3809
3705
 
3810
- if (/*roomLabelsEnable*/ ctx[4]) {
3706
+ if (/*roomLabelsEnable*/ ctx[3]) {
3811
3707
  if (if_block1) {
3812
3708
  if_block1.p(ctx, dirty);
3813
3709
 
3814
- if (dirty & /*roomLabelsEnable*/ 16) {
3710
+ if (dirty & /*roomLabelsEnable*/ 8) {
3815
3711
  internal.transition_in(if_block1, 1);
3816
3712
  }
3817
3713
  } else {
@@ -3830,11 +3726,11 @@
3830
3726
  internal.check_outros();
3831
3727
  }
3832
3728
 
3833
- if (/*ruleLabelsEnable*/ ctx[5]) {
3729
+ if (/*ruleLabelsEnable*/ ctx[4]) {
3834
3730
  if (if_block2) {
3835
3731
  if_block2.p(ctx, dirty);
3836
3732
 
3837
- if (dirty & /*ruleLabelsEnable*/ 32) {
3733
+ if (dirty & /*ruleLabelsEnable*/ 16) {
3838
3734
  internal.transition_in(if_block2, 1);
3839
3735
  }
3840
3736
  } else {
@@ -3852,6 +3748,12 @@
3852
3748
 
3853
3749
  internal.check_outros();
3854
3750
  }
3751
+
3752
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3753
+ ? ' floorplan-plugin__floor--is-current'
3754
+ : ''}`) + " svelte-bl8zrz"))) {
3755
+ internal.attr(div, "class", div_class_value);
3756
+ }
3855
3757
  },
3856
3758
  i(local) {
3857
3759
  if (current) return;
@@ -3882,37 +3784,31 @@
3882
3784
  }
3883
3785
 
3884
3786
  function instance$9($$self, $$props, $$invalidate) {
3885
- let { pxmm } = $$props;
3886
- let { five } = $$props;
3787
+ let { isCurrent } = $$props;
3887
3788
  let { floorIndex } = $$props;
3888
3789
  let { hoverEnable } = $$props;
3889
3790
  let { roomLabelsEnable } = $$props;
3890
3791
  let { ruleLabelsEnable } = $$props;
3891
3792
  let { floorplanData } = $$props;
3892
- let { onRoomHeightClick } = $$props;
3893
3793
  let { getLabelElement } = $$props;
3894
3794
 
3895
3795
  $$self.$$set = $$props => {
3896
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3897
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
3898
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
3899
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
3900
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
3901
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
3902
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
3903
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
3904
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
3796
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
3797
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3798
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
3799
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
3800
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
3801
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
3802
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
3905
3803
  };
3906
3804
 
3907
3805
  return [
3908
- pxmm,
3909
- five,
3806
+ isCurrent,
3910
3807
  floorIndex,
3911
3808
  hoverEnable,
3912
3809
  roomLabelsEnable,
3913
3810
  ruleLabelsEnable,
3914
3811
  floorplanData,
3915
- onRoomHeightClick,
3916
3812
  getLabelElement
3917
3813
  ];
3918
3814
  }
@@ -3928,65 +3824,56 @@
3928
3824
  create_fragment$9,
3929
3825
  internal.safe_not_equal,
3930
3826
  {
3931
- pxmm: 0,
3932
- five: 1,
3933
- floorIndex: 2,
3934
- hoverEnable: 3,
3935
- roomLabelsEnable: 4,
3936
- ruleLabelsEnable: 5,
3937
- floorplanData: 6,
3938
- onRoomHeightClick: 7,
3939
- getLabelElement: 8
3827
+ isCurrent: 0,
3828
+ floorIndex: 1,
3829
+ hoverEnable: 2,
3830
+ roomLabelsEnable: 3,
3831
+ ruleLabelsEnable: 4,
3832
+ floorplanData: 5,
3833
+ getLabelElement: 6
3940
3834
  },
3941
3835
  add_css$8
3942
3836
  );
3943
3837
  }
3944
3838
  }
3945
3839
 
3946
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
3840
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
3947
3841
 
3948
3842
  function add_css$7(target) {
3949
3843
  internal.append_styles(target, "svelte-q5wdnn", ".floorplan-main.svelte-q5wdnn{width:100%;height:100%}");
3950
3844
  }
3951
3845
 
3952
- // (24:0) {#if visible}
3846
+ function get_each_context$3(ctx, list, i) {
3847
+ const child_ctx = ctx.slice();
3848
+ child_ctx[13] = list[i];
3849
+ return child_ctx;
3850
+ }
3851
+
3852
+ // (21:0) {#if visible}
3953
3853
  function create_if_block$2(ctx) {
3954
3854
  let div;
3955
- let currentfloor;
3956
3855
  let t0;
3957
3856
  let camera;
3958
3857
  let t1;
3959
3858
  let div_intro;
3960
3859
  let current;
3961
-
3962
- const currentfloor_spread_levels = [
3963
- {
3964
- five: /*five*/ ctx[2],
3965
- pxmm: /*pxmm*/ ctx[1],
3966
- floorIndex: /*floorIndex*/ ctx[6],
3967
- hoverEnable: /*hoverEnable*/ ctx[7],
3968
- floorplanData: /*floorplanData*/ ctx[11],
3969
- getLabelElement: /*getLabelElement*/ ctx[15],
3970
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
3971
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
3972
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3973
- }
3974
- ];
3975
-
3976
- let currentfloor_props = {};
3977
-
3978
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
3979
- currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
3860
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
3861
+ let each_blocks = [];
3862
+
3863
+ for (let i = 0; i < each_value.length; i += 1) {
3864
+ each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
3980
3865
  }
3981
3866
 
3982
- currentfloor = new CurrentFloor$1({ props: currentfloor_props });
3867
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
3868
+ each_blocks[i] = null;
3869
+ });
3983
3870
 
3984
3871
  const camera_spread_levels = [
3985
3872
  {
3986
- panoIndex: /*panoIndex*/ ctx[5],
3987
- floorplanData: /*floorplanData*/ ctx[11],
3988
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
3989
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3873
+ panoIndex: /*panoIndex*/ ctx[3],
3874
+ floorplanData: /*floorplanData*/ ctx[9],
3875
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3876
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
3990
3877
  }
3991
3878
  ];
3992
3879
 
@@ -3997,12 +3884,16 @@
3997
3884
  }
3998
3885
 
3999
3886
  camera = new Camera$1({ props: camera_props });
4000
- let if_block = /*compassEnable*/ ctx[8] && create_if_block_1(ctx);
3887
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
4001
3888
 
4002
3889
  return {
4003
3890
  c() {
4004
3891
  div = internal.element("div");
4005
- internal.create_component(currentfloor.$$.fragment);
3892
+
3893
+ for (let i = 0; i < each_blocks.length; i += 1) {
3894
+ each_blocks[i].c();
3895
+ }
3896
+
4006
3897
  t0 = internal.space();
4007
3898
  internal.create_component(camera.$$.fragment);
4008
3899
  t1 = internal.space();
@@ -4011,7 +3902,11 @@
4011
3902
  },
4012
3903
  m(target, anchor) {
4013
3904
  internal.insert(target, div, anchor);
4014
- internal.mount_component(currentfloor, div, null);
3905
+
3906
+ for (let i = 0; i < each_blocks.length; i += 1) {
3907
+ each_blocks[i].m(div, null);
3908
+ }
3909
+
4015
3910
  internal.append(div, t0);
4016
3911
  internal.mount_component(camera, div, null);
4017
3912
  internal.append(div, t1);
@@ -4021,42 +3916,51 @@
4021
3916
  p(new_ctx, dirty) {
4022
3917
  ctx = new_ctx;
4023
3918
 
4024
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 52934)
4025
- ? internal.get_spread_update(currentfloor_spread_levels, [
4026
- {
4027
- five: /*five*/ ctx[2],
4028
- pxmm: /*pxmm*/ ctx[1],
4029
- floorIndex: /*floorIndex*/ ctx[6],
4030
- hoverEnable: /*hoverEnable*/ ctx[7],
4031
- floorplanData: /*floorplanData*/ ctx[11],
4032
- getLabelElement: /*getLabelElement*/ ctx[15],
4033
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
4034
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
4035
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3919
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040) {
3920
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
3921
+ let i;
3922
+
3923
+ for (i = 0; i < each_value.length; i += 1) {
3924
+ const child_ctx = get_each_context$3(ctx, each_value, i);
3925
+
3926
+ if (each_blocks[i]) {
3927
+ each_blocks[i].p(child_ctx, dirty);
3928
+ internal.transition_in(each_blocks[i], 1);
3929
+ } else {
3930
+ each_blocks[i] = create_each_block$3(child_ctx);
3931
+ each_blocks[i].c();
3932
+ internal.transition_in(each_blocks[i], 1);
3933
+ each_blocks[i].m(div, t0);
4036
3934
  }
4037
- ])
4038
- : {};
3935
+ }
4039
3936
 
4040
- currentfloor.$set(currentfloor_changes);
3937
+ internal.group_outros();
3938
+
3939
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
3940
+ out(i);
3941
+ }
4041
3942
 
4042
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 14368)
3943
+ internal.check_outros();
3944
+ }
3945
+
3946
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
4043
3947
  ? internal.get_spread_update(camera_spread_levels, [
4044
3948
  {
4045
- panoIndex: /*panoIndex*/ ctx[5],
4046
- floorplanData: /*floorplanData*/ ctx[11],
4047
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
4048
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3949
+ panoIndex: /*panoIndex*/ ctx[3],
3950
+ floorplanData: /*floorplanData*/ ctx[9],
3951
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3952
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
4049
3953
  }
4050
3954
  ])
4051
3955
  : {};
4052
3956
 
4053
3957
  camera.$set(camera_changes);
4054
3958
 
4055
- if (/*compassEnable*/ ctx[8]) {
3959
+ if (/*compassEnable*/ ctx[6]) {
4056
3960
  if (if_block) {
4057
3961
  if_block.p(ctx, dirty);
4058
3962
 
4059
- if (dirty & /*compassEnable*/ 256) {
3963
+ if (dirty & /*compassEnable*/ 64) {
4060
3964
  internal.transition_in(if_block, 1);
4061
3965
  }
4062
3966
  } else {
@@ -4077,14 +3981,18 @@
4077
3981
  },
4078
3982
  i(local) {
4079
3983
  if (current) return;
4080
- internal.transition_in(currentfloor.$$.fragment, local);
3984
+
3985
+ for (let i = 0; i < each_value.length; i += 1) {
3986
+ internal.transition_in(each_blocks[i]);
3987
+ }
3988
+
4081
3989
  internal.transition_in(camera.$$.fragment, local);
4082
3990
  internal.transition_in(if_block);
4083
3991
 
4084
3992
  if (!div_intro) {
4085
3993
  internal.add_render_callback(() => {
4086
3994
  div_intro = internal.create_in_transition(div, transition.fade, {
4087
- duration: /*duration*/ ctx[3],
3995
+ duration: /*duration*/ ctx[0],
4088
3996
  easing: easing.linear
4089
3997
  });
4090
3998
 
@@ -4095,29 +4003,107 @@
4095
4003
  current = true;
4096
4004
  },
4097
4005
  o(local) {
4098
- internal.transition_out(currentfloor.$$.fragment, local);
4006
+ each_blocks = each_blocks.filter(Boolean);
4007
+
4008
+ for (let i = 0; i < each_blocks.length; i += 1) {
4009
+ internal.transition_out(each_blocks[i]);
4010
+ }
4011
+
4099
4012
  internal.transition_out(camera.$$.fragment, local);
4100
4013
  internal.transition_out(if_block);
4101
4014
  current = false;
4102
4015
  },
4103
4016
  d(detaching) {
4104
4017
  if (detaching) internal.detach(div);
4105
- internal.destroy_component(currentfloor);
4018
+ internal.destroy_each(each_blocks, detaching);
4106
4019
  internal.destroy_component(camera);
4107
4020
  if (if_block) if_block.d();
4108
4021
  }
4109
4022
  };
4110
4023
  }
4111
4024
 
4112
- // (40:4) {#if compassEnable}
4025
+ // (23:4) {#each floorplanData.floorDatas as floorData}
4026
+ function create_each_block$3(ctx) {
4027
+ let currentfloor;
4028
+ let current;
4029
+
4030
+ const currentfloor_spread_levels = [
4031
+ {
4032
+ hoverEnable: /*hoverEnable*/ ctx[5],
4033
+ floorplanData: /*floorplanData*/ ctx[9],
4034
+ getLabelElement: /*getLabelElement*/ ctx[12],
4035
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4036
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4037
+ },
4038
+ {
4039
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4040
+ },
4041
+ {
4042
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4043
+ }
4044
+ ];
4045
+
4046
+ let currentfloor_props = {};
4047
+
4048
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
4049
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
4050
+ }
4051
+
4052
+ currentfloor = new CurrentFloor$1({ props: currentfloor_props });
4053
+
4054
+ return {
4055
+ c() {
4056
+ internal.create_component(currentfloor.$$.fragment);
4057
+ },
4058
+ m(target, anchor) {
4059
+ internal.mount_component(currentfloor, target, anchor);
4060
+ current = true;
4061
+ },
4062
+ p(ctx, dirty) {
4063
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040)
4064
+ ? internal.get_spread_update(currentfloor_spread_levels, [
4065
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable*/ 5024 && {
4066
+ hoverEnable: /*hoverEnable*/ ctx[5],
4067
+ floorplanData: /*floorplanData*/ ctx[9],
4068
+ getLabelElement: /*getLabelElement*/ ctx[12],
4069
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4070
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4071
+ },
4072
+ dirty & /*floorplanData*/ 512 && {
4073
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4074
+ },
4075
+ dirty & /*floorplanData, floorIndex*/ 528 && {
4076
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4077
+ }
4078
+ ])
4079
+ : {};
4080
+
4081
+ currentfloor.$set(currentfloor_changes);
4082
+ },
4083
+ i(local) {
4084
+ if (current) return;
4085
+ internal.transition_in(currentfloor.$$.fragment, local);
4086
+ current = true;
4087
+ },
4088
+ o(local) {
4089
+ internal.transition_out(currentfloor.$$.fragment, local);
4090
+ current = false;
4091
+ },
4092
+ d(detaching) {
4093
+ internal.destroy_component(currentfloor, detaching);
4094
+ }
4095
+ };
4096
+ }
4097
+
4098
+ // (37:4) {#if compassEnable}
4113
4099
  function create_if_block_1(ctx) {
4114
4100
  let compass;
4115
4101
  let current;
4116
4102
 
4117
4103
  compass = new Compass({
4118
4104
  props: {
4119
- floorplanData: /*floorplanData*/ ctx[11],
4120
- northDesc: /*northDesc*/ ctx[0]
4105
+ floorplanData: /*floorplanData*/ ctx[9],
4106
+ northDesc: /*northDesc*/ ctx[2]
4121
4107
  }
4122
4108
  });
4123
4109
 
@@ -4131,8 +4117,8 @@
4131
4117
  },
4132
4118
  p(ctx, dirty) {
4133
4119
  const compass_changes = {};
4134
- if (dirty & /*floorplanData*/ 2048) compass_changes.floorplanData = /*floorplanData*/ ctx[11];
4135
- if (dirty & /*northDesc*/ 1) compass_changes.northDesc = /*northDesc*/ ctx[0];
4120
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
4121
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
4136
4122
  compass.$set(compass_changes);
4137
4123
  },
4138
4124
  i(local) {
@@ -4153,7 +4139,7 @@
4153
4139
  function create_fragment$8(ctx) {
4154
4140
  let if_block_anchor;
4155
4141
  let current;
4156
- let if_block = /*visible*/ ctx[4] && create_if_block$2(ctx);
4142
+ let if_block = /*visible*/ ctx[1] && create_if_block$2(ctx);
4157
4143
 
4158
4144
  return {
4159
4145
  c() {
@@ -4166,11 +4152,11 @@
4166
4152
  current = true;
4167
4153
  },
4168
4154
  p(ctx, [dirty]) {
4169
- if (/*visible*/ ctx[4]) {
4155
+ if (/*visible*/ ctx[1]) {
4170
4156
  if (if_block) {
4171
4157
  if_block.p(ctx, dirty);
4172
4158
 
4173
- if (dirty & /*visible*/ 16) {
4159
+ if (dirty & /*visible*/ 2) {
4174
4160
  internal.transition_in(if_block, 1);
4175
4161
  }
4176
4162
  } else {
@@ -4206,11 +4192,9 @@
4206
4192
  }
4207
4193
 
4208
4194
  function instance$8($$self, $$props, $$invalidate) {
4209
- let { northDesc } = $$props;
4210
- let { pxmm } = $$props;
4211
- let { five } = $$props;
4212
4195
  let { duration = 0 } = $$props;
4213
4196
  let { visible } = $$props;
4197
+ let { northDesc } = $$props;
4214
4198
  let { panoIndex } = $$props;
4215
4199
  let { floorIndex } = $$props;
4216
4200
  let { hoverEnable } = $$props;
@@ -4220,34 +4204,28 @@
4220
4204
  let { floorplanData } = $$props;
4221
4205
  let { lastPanoramaLongitude } = $$props;
4222
4206
  let { cameraImageUrl } = $$props;
4223
- let { onRoomHeightClick } = $$props;
4224
4207
  let { getLabelElement } = $$props;
4225
4208
 
4226
4209
  $$self.$$set = $$props => {
4227
- if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
4228
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
4229
- if ('five' in $$props) $$invalidate(2, five = $$props.five);
4230
- if ('duration' in $$props) $$invalidate(3, duration = $$props.duration);
4231
- if ('visible' in $$props) $$invalidate(4, visible = $$props.visible);
4232
- if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
4233
- if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
4234
- if ('hoverEnable' in $$props) $$invalidate(7, hoverEnable = $$props.hoverEnable);
4235
- if ('compassEnable' in $$props) $$invalidate(8, compassEnable = $$props.compassEnable);
4236
- if ('roomLabelsEnable' in $$props) $$invalidate(9, roomLabelsEnable = $$props.roomLabelsEnable);
4237
- if ('ruleLabelsEnable' in $$props) $$invalidate(10, ruleLabelsEnable = $$props.ruleLabelsEnable);
4238
- if ('floorplanData' in $$props) $$invalidate(11, floorplanData = $$props.floorplanData);
4239
- if ('lastPanoramaLongitude' in $$props) $$invalidate(12, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4240
- if ('cameraImageUrl' in $$props) $$invalidate(13, cameraImageUrl = $$props.cameraImageUrl);
4241
- if ('onRoomHeightClick' in $$props) $$invalidate(14, onRoomHeightClick = $$props.onRoomHeightClick);
4242
- if ('getLabelElement' in $$props) $$invalidate(15, getLabelElement = $$props.getLabelElement);
4210
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
4211
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
4212
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
4213
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
4214
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
4215
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
4216
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
4217
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
4218
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
4219
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
4220
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4221
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
4222
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
4243
4223
  };
4244
4224
 
4245
4225
  return [
4246
- northDesc,
4247
- pxmm,
4248
- five,
4249
4226
  duration,
4250
4227
  visible,
4228
+ northDesc,
4251
4229
  panoIndex,
4252
4230
  floorIndex,
4253
4231
  hoverEnable,
@@ -4257,7 +4235,6 @@
4257
4235
  floorplanData,
4258
4236
  lastPanoramaLongitude,
4259
4237
  cameraImageUrl,
4260
- onRoomHeightClick,
4261
4238
  getLabelElement
4262
4239
  ];
4263
4240
  }
@@ -4273,22 +4250,19 @@
4273
4250
  create_fragment$8,
4274
4251
  internal.safe_not_equal,
4275
4252
  {
4276
- northDesc: 0,
4277
- pxmm: 1,
4278
- five: 2,
4279
- duration: 3,
4280
- visible: 4,
4281
- panoIndex: 5,
4282
- floorIndex: 6,
4283
- hoverEnable: 7,
4284
- compassEnable: 8,
4285
- roomLabelsEnable: 9,
4286
- ruleLabelsEnable: 10,
4287
- floorplanData: 11,
4288
- lastPanoramaLongitude: 12,
4289
- cameraImageUrl: 13,
4290
- onRoomHeightClick: 14,
4291
- getLabelElement: 15
4253
+ duration: 0,
4254
+ visible: 1,
4255
+ northDesc: 2,
4256
+ panoIndex: 3,
4257
+ floorIndex: 4,
4258
+ hoverEnable: 5,
4259
+ compassEnable: 6,
4260
+ roomLabelsEnable: 7,
4261
+ ruleLabelsEnable: 8,
4262
+ floorplanData: 9,
4263
+ lastPanoramaLongitude: 10,
4264
+ cameraImageUrl: 11,
4265
+ getLabelElement: 12
4292
4266
  },
4293
4267
  add_css$7
4294
4268
  );
@@ -4398,32 +4372,58 @@
4398
4372
  value: () => {
4399
4373
  var _a, _b;
4400
4374
  this.hide();
4401
- (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
4402
- (_b = this.app) === null || _b === void 0 ? void 0 : _b.$destroy();
4403
- this.five.off('modeChange', this.handleModeChange);
4404
- this.five.off('panoArrived', this.handlePanoArrived);
4405
- this.five.off('modelLoaded', this.handleModelLoaded);
4406
- this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
4407
- this.five.off('wantsPanGesture', this.handleWantsPanGesture);
4408
- this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
4375
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
4376
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
4377
+ this.five.off('modeChange', this.onFiveModeChange);
4378
+ this.five.off('panGesture', this.onFivePanGesture);
4379
+ this.five.off('panoArrived', this.onFivePanoArrived);
4380
+ this.five.off('modelLoaded', this.onFiveModelLoaded);
4381
+ this.five.off('pinchGesture', this.onFivePinchGesture);
4382
+ this.five.off('wantsGesture', this.onFiveWantsGesture);
4383
+ this.five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
4384
+ this.five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
4409
4385
  this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
4410
4386
  }
4411
4387
  });
4412
- /** 模型楼层高亮改变时,自动进行楼层切换 */
4388
+ Object.defineProperty(this, "onFiveWantsMoveToPano", {
4389
+ enumerable: true,
4390
+ configurable: true,
4391
+ writable: true,
4392
+ value: () => {
4393
+ if (this.visible && this.configs.preventRoomClick)
4394
+ return false;
4395
+ }
4396
+ });
4397
+ Object.defineProperty(this, "onFiveWantsGesture", {
4398
+ enumerable: true,
4399
+ configurable: true,
4400
+ writable: true,
4401
+ value: (type) => {
4402
+ if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
4403
+ return;
4404
+ if (this.visible && !this.configs.gestureEnable)
4405
+ return false;
4406
+ }
4407
+ });
4413
4408
  Object.defineProperty(this, "onModelShownFloorChange", {
4414
4409
  enumerable: true,
4415
4410
  configurable: true,
4416
4411
  writable: true,
4417
4412
  value: (shownFloor) => {
4418
- if (shownFloor === null)
4413
+ if (this.floorIndex === shownFloor)
4414
+ return;
4415
+ if (shownFloor === null) {
4416
+ const panoIndex = this.five.getCurrentState().panoIndex;
4417
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
4419
4418
  return;
4419
+ }
4420
+ // 模型楼层高亮改变时,自动进行楼层切换
4420
4421
  this.floorIndex = shownFloor;
4421
4422
  this.updateSize();
4422
4423
  this.render();
4423
4424
  }
4424
4425
  });
4425
- /** panoIndex 改变时,更新 floorIndex */
4426
- Object.defineProperty(this, "handlePanoArrived", {
4426
+ Object.defineProperty(this, "onFivePanoArrived", {
4427
4427
  enumerable: true,
4428
4428
  configurable: true,
4429
4429
  writable: true,
@@ -4435,31 +4435,28 @@
4435
4435
  this.floorIndex = this.five.work.observers[index].floorIndex;
4436
4436
  }
4437
4437
  });
4438
- /** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
4439
- Object.defineProperty(this, "handleWantsMoveToPano", {
4438
+ Object.defineProperty(this, "onFivePanGesture", {
4440
4439
  enumerable: true,
4441
4440
  configurable: true,
4442
4441
  writable: true,
4443
4442
  value: () => {
4444
4443
  if (!this.visible)
4445
4444
  return;
4446
- if (this.configs.preventRoomClick)
4447
- return false;
4448
- return;
4445
+ this.updatePosition();
4449
4446
  }
4450
4447
  });
4451
- /** 在户型图展示时阻止 Five 滑动行为 */
4452
- Object.defineProperty(this, "handleWantsPanGesture", {
4448
+ Object.defineProperty(this, "onFivePinchGesture", {
4453
4449
  enumerable: true,
4454
4450
  configurable: true,
4455
4451
  writable: true,
4456
4452
  value: () => {
4457
4453
  if (!this.visible)
4458
4454
  return;
4459
- return false;
4455
+ this.updatePosition();
4456
+ this.updateSize();
4460
4457
  }
4461
4458
  });
4462
- Object.defineProperty(this, "handleModelLoaded", {
4459
+ Object.defineProperty(this, "onFiveModelLoaded", {
4463
4460
  enumerable: true,
4464
4461
  configurable: true,
4465
4462
  writable: true,
@@ -4476,7 +4473,7 @@
4476
4473
  }
4477
4474
  });
4478
4475
  /** 非 Topview 态隐藏户型图 */
4479
- Object.defineProperty(this, "handleModeChange", {
4476
+ Object.defineProperty(this, "onFiveModeChange", {
4480
4477
  enumerable: true,
4481
4478
  configurable: true,
4482
4479
  writable: true,
@@ -4486,7 +4483,7 @@
4486
4483
  }
4487
4484
  });
4488
4485
  /** 动画结束后是 Topview 态就展示户型图 */
4489
- Object.defineProperty(this, "handleInitAnimationEnded", {
4486
+ Object.defineProperty(this, "onFiveInitAnimationEnded", {
4490
4487
  enumerable: true,
4491
4488
  configurable: true,
4492
4489
  writable: true,
@@ -4526,24 +4523,30 @@
4526
4523
  this.five = five;
4527
4524
  this.selector = params.selector;
4528
4525
  this.configs = omit(params, ['selector']);
4526
+ this.five.addExtraElement(this.container);
4529
4527
  // 设置 container 样式
4530
4528
  this.container.classList.add('floorplan-plugin');
4531
4529
  Object.assign(this.container.style, pluginStyle$1);
4532
4530
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
4533
- this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
4531
+ this.five.model.loaded
4532
+ ? this.onFiveModelLoaded()
4533
+ : five.once('modelLoaded', this.onFiveModelLoaded);
4534
4534
  this.five.once('dispose', this.dispose);
4535
- this.five.on('modeChange', this.handleModeChange);
4536
- this.five.on('panoArrived', this.handlePanoArrived);
4537
- this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
4535
+ this.five.on('modeChange', this.onFiveModeChange);
4536
+ this.five.on('panGesture', this.onFivePanGesture);
4537
+ this.five.on('mouseWheel', this.onFivePinchGesture);
4538
+ this.five.on('panoArrived', this.onFivePanoArrived);
4539
+ this.five.on('pinchGesture', this.onFivePinchGesture);
4540
+ this.five.on('wantsGesture', this.onFiveWantsGesture);
4541
+ this.five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
4542
+ this.five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
4538
4543
  this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
4539
4544
  }
4540
4545
  /** 加载户型图数据 */
4541
- load(data) {
4542
- return __awaiter(this, void 0, void 0, function* () {
4543
- const copyData = JSON.parse(JSON.stringify(data));
4544
- this.floorplanData = yield formatData(copyData);
4545
- this.render();
4546
- });
4546
+ async load(data) {
4547
+ const copyData = JSON.parse(JSON.stringify(data));
4548
+ this.floorplanData = await formatData(copyData);
4549
+ this.render();
4547
4550
  }
4548
4551
  /** 把插件的渲染DOM插入到对应的容器中去 */
4549
4552
  appendTo(wrapper) {
@@ -4554,6 +4557,7 @@
4554
4557
  show() {
4555
4558
  this.visible = true;
4556
4559
  this.five.model.show(this.floorIndex);
4560
+ this.updatePosition();
4557
4561
  this.updateSize();
4558
4562
  const renderDuration = 500;
4559
4563
  const modelOpacity = this.configs.modelOpacity;
@@ -4561,8 +4565,6 @@
4561
4565
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4562
4566
  }
4563
4567
  this.render(renderDuration);
4564
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4565
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4566
4568
  }
4567
4569
  hide() {
4568
4570
  const modelOpacity = 1;
@@ -4570,20 +4572,28 @@
4570
4572
  this.visible = false;
4571
4573
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4572
4574
  this.render();
4573
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4574
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4575
+ }
4576
+ /** 更新户型图位置 */
4577
+ updatePosition() {
4578
+ var _a;
4579
+ const modelCenter = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE__namespace.Vector3());
4580
+ if (!modelCenter)
4581
+ return;
4582
+ const ndcModelCenter = modelCenter.clone().project(this.five.camera);
4583
+ const left = (ndcModelCenter.x + 1) / 2;
4584
+ const top = -(ndcModelCenter.y - 1) / 2;
4585
+ this.container.style.left = left * 100 + '%';
4586
+ this.container.style.top = top * 100 + '%';
4575
4587
  }
4576
4588
  render(duration) {
4577
4589
  if (!this.container || !this.floorplanData)
4578
4590
  return;
4579
4591
  if (this.size.width === 0)
4580
4592
  return;
4581
- const { northDesc, getLabelElement, cameraImageUrl, preventRoomClick, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4582
- const handleClick = preventRoomClick ? () => false : undefined;
4593
+ const { northDesc, getLabelElement, cameraImageUrl, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4583
4594
  const props = {
4595
+ getLabelElement,
4584
4596
  northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4585
- five: this.five,
4586
- pxmm: this.pxmm,
4587
4597
  cameraImageUrl,
4588
4598
  visible: this.visible,
4589
4599
  duration: duration !== null && duration !== void 0 ? duration : 0,
@@ -4595,8 +4605,6 @@
4595
4605
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
4596
4606
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
4597
4607
  lastPanoramaLongitude: this.lastPanoramaLongitude,
4598
- getLabelElement,
4599
- onRoomHeightClick: handleClick,
4600
4608
  };
4601
4609
  if (!this.app) {
4602
4610
  this.app = new Main$1({
@@ -5478,9 +5486,9 @@
5478
5486
  enumerable: true,
5479
5487
  configurable: true,
5480
5488
  writable: true,
5481
- value: (data) => __awaiter(this, void 0, void 0, function* () {
5489
+ value: async (data) => {
5482
5490
  const copyData = JSON.parse(JSON.stringify(data));
5483
- const floorplanData = yield formatData(copyData);
5491
+ const floorplanData = await formatData(copyData);
5484
5492
  this.data = floorplanData;
5485
5493
  // const loadImage = async () => {
5486
5494
  // const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
@@ -5498,7 +5506,7 @@
5498
5506
  // }
5499
5507
  // await loadImage()
5500
5508
  this.render();
5501
- })
5509
+ }
5502
5510
  });
5503
5511
  this.five = five;
5504
5512
  (params === null || params === void 0 ? void 0 : params.configs) && Object.assign(this.configs, params.configs);
@@ -5558,24 +5566,37 @@
5558
5566
  return new PanoFloorplanRadarPluginController(five, params);
5559
5567
  };
5560
5568
 
5569
+ var FloorplanErrorType;
5570
+ (function (FloorplanErrorType) {
5571
+ FloorplanErrorType["UnknownError"] = "UnknowError";
5572
+ FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5573
+ FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5574
+ FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5575
+ FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5576
+ FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5577
+ FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5578
+ })(FloorplanErrorType || (FloorplanErrorType = {}));
5579
+ /** 户型图展示 & 模型消失的默认时间 */
5580
+ const SHOW_ANIME_DURATION = 500;
5581
+ /** Five camera 默认 fov */
5582
+ const FIVE_CAMERA_DEFAULT_FOV = 80;
5583
+
5561
5584
  /**
5562
5585
  * 传入一个 Promise
5563
5586
  * 无异常,返回 [null, data]
5564
5587
  * 有异常,则返回 [Error, undefined]
5565
5588
  * 用于替代 try&catch 处理 await 异常的方案
5566
5589
  */
5567
- function to(promise) {
5568
- return __awaiter(this, void 0, void 0, function* () {
5569
- try {
5570
- const data = yield promise;
5571
- return [null, data];
5572
- }
5573
- catch (error) {
5574
- if (error instanceof Error)
5575
- return [error, null];
5576
- return [new Error(''), null];
5577
- }
5578
- });
5590
+ async function to(promise) {
5591
+ try {
5592
+ const data = await promise;
5593
+ return [null, data];
5594
+ }
5595
+ catch (error) {
5596
+ if (error instanceof Error)
5597
+ return [error, null];
5598
+ return [new Error(''), null];
5599
+ }
5579
5600
  }
5580
5601
 
5581
5602
  /**
@@ -5683,38 +5704,21 @@
5683
5704
  return isDeepEqual(value, other);
5684
5705
  }
5685
5706
 
5686
- function changeMode(five, ...changeModeParams) {
5687
- return __awaiter(this, void 0, void 0, function* () {
5688
- const [changeModeError] = yield to(five.changeMode(...changeModeParams));
5689
- if (changeModeError)
5690
- throw changeModeError;
5691
- yield new Promise((reslove, reject) => {
5692
- five.once('initAnimationEnded', reslove);
5693
- const handleModeChange = (mode) => {
5694
- if (mode !== changeModeParams[0])
5695
- reject('changeMode 被中断');
5696
- five.off('modeChange', handleModeChange);
5697
- };
5698
- five.on('modeChange', handleModeChange);
5699
- });
5707
+ async function changeMode(five, ...changeModeParams) {
5708
+ const [changeModeError] = await to(five.changeMode(...changeModeParams));
5709
+ if (changeModeError)
5710
+ throw changeModeError;
5711
+ await new Promise((reslove, reject) => {
5712
+ five.once('initAnimationEnded', reslove);
5713
+ const handleModeChange = (mode) => {
5714
+ if (mode !== changeModeParams[0])
5715
+ reject('changeMode 被中断');
5716
+ five.off('modeChange', handleModeChange);
5717
+ };
5718
+ five.on('modeChange', handleModeChange);
5700
5719
  });
5701
5720
  }
5702
5721
 
5703
- var FloorplanErrorType;
5704
- (function (FloorplanErrorType) {
5705
- FloorplanErrorType["UnknownError"] = "UnknowError";
5706
- FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5707
- FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5708
- FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5709
- FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5710
- FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5711
- FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5712
- })(FloorplanErrorType || (FloorplanErrorType = {}));
5713
- /** 户型图展示 & 模型消失的默认时间 */
5714
- const SHOW_ANIME_DURATION = 500;
5715
- /** Five camera 默认 fov */
5716
- const FIVE_CAMERA_DEFAULT_FOV = 80;
5717
-
5718
5722
  /**
5719
5723
  * 比较两个数字近似相等
5720
5724
  * @param num1 数字1
@@ -5741,32 +5745,30 @@
5741
5745
  * 2. 内置了相应的动画时间计算
5742
5746
  * 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
5743
5747
  */
5744
- function correctFiveState(five$1, showState, userAction = true) {
5745
- return __awaiter(this, void 0, void 0, function* () {
5746
- // 当前已满足状态,不需要变更
5748
+ async function correctFiveState(five$1, showState, userAction = true) {
5749
+ // 当前已满足状态,不需要变更
5750
+ const result = checkShowState(five$1, showState);
5751
+ if (result === true)
5752
+ return;
5753
+ // 纠正 mode
5754
+ if (five$1.currentMode !== five.Five.Mode.Floorplan) {
5755
+ const [changeModeError] = await to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
5756
+ if (changeModeError)
5757
+ throw changeModeError;
5758
+ // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5747
5759
  const result = checkShowState(five$1, showState);
5748
- if (result === true)
5749
- return;
5750
- // 纠正 mode
5751
- if (five$1.currentMode !== five.Five.Mode.Floorplan) {
5752
- const [changeModeError] = yield to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
5753
- if (changeModeError)
5754
- throw changeModeError;
5755
- // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5756
- const result = checkShowState(five$1, showState);
5757
- if (result === false)
5758
- throw new Error(FloorplanErrorType.ChangeModeError);
5759
- return;
5760
- }
5761
- // 纠正相机状态
5762
- // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5763
- const { latitude, longitude, fov } = five$1.getCurrentState();
5764
- 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));
5765
- const [updateCameraError] = yield to(five$1.updateCamera(showState, time, userAction));
5766
- if (updateCameraError)
5767
- throw new Error(FloorplanErrorType.UpdateCameraError);
5760
+ if (result === false)
5761
+ throw new Error(FloorplanErrorType.ChangeModeError);
5768
5762
  return;
5769
- });
5763
+ }
5764
+ // 纠正相机状态
5765
+ // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5766
+ const { latitude, longitude, fov } = five$1.getCurrentState();
5767
+ 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));
5768
+ const [updateCameraError] = await to(five$1.updateCamera(showState, time, userAction));
5769
+ if (updateCameraError)
5770
+ throw new Error(FloorplanErrorType.UpdateCameraError);
5771
+ return;
5770
5772
  }
5771
5773
 
5772
5774
  const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
@@ -5955,12 +5957,12 @@
5955
5957
  enumerable: true,
5956
5958
  configurable: true,
5957
5959
  writable: true,
5958
- value: (opts) => __awaiter(this, void 0, void 0, function* () {
5959
- var _b, _c;
5960
+ value: async (opts) => {
5961
+ var _a, _b;
5960
5962
  // 已经在展示中了
5961
5963
  if (!this.showPromise && this.visible)
5962
5964
  return true;
5963
- if (!((_b = this.five.model) === null || _b === void 0 ? void 0 : _b.loaded))
5965
+ if (!((_a = this.five.model) === null || _a === void 0 ? void 0 : _a.loaded))
5964
5966
  throw new Error(FloorplanErrorType.ModelNotLoaded);
5965
5967
  if (!this.floorplanData)
5966
5968
  throw new Error(FloorplanErrorType.DataNotLoaded);
@@ -5970,18 +5972,18 @@
5970
5972
  if (!!this.showPromise && sameWithLastOpts)
5971
5973
  return this.showPromise;
5972
5974
  if (!!this.showPromise && !sameWithLastOpts)
5973
- (_c = this.showRejection) === null || _c === void 0 ? void 0 : _c.call(this, FloorplanErrorType.DifferentShowParams);
5975
+ (_b = this.showRejection) === null || _b === void 0 ? void 0 : _b.call(this, FloorplanErrorType.DifferentShowParams);
5974
5976
  }
5975
5977
  this.ModelFloorplanPluginsShowOpts = opts;
5976
- const getShowPromise = () => __awaiter(this, void 0, void 0, function* () {
5977
- var _d, _e;
5978
+ const getShowPromise = async () => {
5979
+ var _a, _b;
5978
5980
  let hasRejected = false;
5979
5981
  let externalErrorMsg;
5980
5982
  this.showRejection = (errorMsg) => {
5981
5983
  hasRejected = true;
5982
5984
  externalErrorMsg = errorMsg;
5983
5985
  };
5984
- const [correctError] = yield to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
5986
+ const [correctError] = await to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
5985
5987
  if (correctError)
5986
5988
  throw correctError;
5987
5989
  // 异步结束要判断当前是不是被中断了,是不是调用了隐藏
@@ -6000,7 +6002,7 @@
6000
6002
  this.floorIndex = opts.floorIndex;
6001
6003
  this.five.model.show(this.floorIndex);
6002
6004
  // 模型消失, 渲染户型图
6003
- 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;
6005
+ 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;
6004
6006
  const renderDuration = (opts === null || opts === void 0 ? void 0 : opts.immediately) ? 0 : SHOW_ANIME_DURATION;
6005
6007
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
6006
6008
  this.render(renderDuration);
@@ -6008,7 +6010,7 @@
6008
6010
  this.five.on('wantsGesture', this.handleWantsGesture);
6009
6011
  this.five.on('wantsTapGesture', this.handleWantsTapGesture);
6010
6012
  return true;
6011
- });
6013
+ };
6012
6014
  const showPromise = getShowPromise()
6013
6015
  .then(() => {
6014
6016
  var _a;
@@ -6030,7 +6032,7 @@
6030
6032
  });
6031
6033
  this.showPromise = showPromise;
6032
6034
  return showPromise;
6033
- })
6035
+ }
6034
6036
  });
6035
6037
  /** 隐藏户型图 */
6036
6038
  Object.defineProperty(this, "hide", {
@@ -6060,8 +6062,13 @@
6060
6062
  configurable: true,
6061
6063
  writable: true,
6062
6064
  value: (shownFloor) => {
6063
- if (shownFloor === null)
6065
+ if (this.floorIndex === shownFloor)
6064
6066
  return;
6067
+ if (shownFloor === null) {
6068
+ const panoIndex = this.five.getCurrentState().panoIndex;
6069
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
6070
+ return;
6071
+ }
6065
6072
  this.floorIndex = shownFloor;
6066
6073
  this.updateSize();
6067
6074
  this.render();
@@ -6174,7 +6181,9 @@
6174
6181
  enumerable: true,
6175
6182
  configurable: true,
6176
6183
  writable: true,
6177
- value: ({ latitude, longitude }, isFinal) => __awaiter(this, void 0, void 0, function* () {
6184
+ value: async ({ latitude, longitude }, isFinal) => {
6185
+ if (this.five.getCurrentState().mode !== 'Floorplan')
6186
+ return;
6178
6187
  if (this.configs.autoShowEnable === false)
6179
6188
  return;
6180
6189
  // 如果操作结束后,户型图还在展示中,初始化模型状态
@@ -6195,16 +6204,16 @@
6195
6204
  const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
6196
6205
  if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
6197
6206
  // 当手指离开时需要等惯性结束之后在进行判断
6198
- const handleInteriaPan = (any, isFinal) => __awaiter(this, void 0, void 0, function* () {
6207
+ const handleInteriaPan = async (any, isFinal) => {
6199
6208
  if (!isFinal)
6200
6209
  return;
6201
6210
  this.five.off('interiaPan', handleInteriaPan);
6202
- yield this.show({ isAutoShow: true });
6203
- });
6211
+ await this.show({ isAutoShow: true });
6212
+ };
6204
6213
  this.five.on('interiaPan', handleInteriaPan);
6205
6214
  return;
6206
6215
  }
6207
- })
6216
+ }
6208
6217
  });
6209
6218
  this.five = five$1;
6210
6219
  this.hooks = new five.Subscribe();
@@ -6218,9 +6227,9 @@
6218
6227
  left: '50%',
6219
6228
  top: '50%',
6220
6229
  transform: 'translate(-50%, -50%)',
6221
- pointerEvents: 'none',
6222
6230
  zIndex: 10,
6223
6231
  });
6232
+ this.five.addExtraElement(this.container);
6224
6233
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
6225
6234
  this.five.model.loaded ? this.handleModelLoaded() : five$1.once('modelLoaded', this.handleModelLoaded);
6226
6235
  five$1.once('dispose', this.dispose);
@@ -6231,12 +6240,10 @@
6231
6240
  five$1.on('modelShownFloorChange', this.onModelShownFloorChange);
6232
6241
  }
6233
6242
  /** 加载户型图数据 */
6234
- load(data) {
6235
- return __awaiter(this, void 0, void 0, function* () {
6236
- const copyData = JSON.parse(JSON.stringify(data));
6237
- this.floorplanData = yield formatData(copyData);
6238
- this.render();
6239
- });
6243
+ async load(data) {
6244
+ const copyData = JSON.parse(JSON.stringify(data));
6245
+ this.floorplanData = await formatData(copyData);
6246
+ this.render();
6240
6247
  }
6241
6248
  /** 把插件的渲染DOM插入到对应的容器中去 */
6242
6249
  appendTo(wrapper) {
@@ -6247,8 +6254,6 @@
6247
6254
  /** 更改户型图楼层 */
6248
6255
  changeFloor(floorIndex) {
6249
6256
  this.five.model.show(floorIndex);
6250
- this.floorIndex = floorIndex;
6251
- this.render();
6252
6257
  }
6253
6258
  changeConfigs(params) {
6254
6259
  Object.assign(this.configs, params);
@@ -6263,10 +6268,9 @@
6263
6268
  return;
6264
6269
  const { northDesc, hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
6265
6270
  const props = {
6266
- northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6267
- five: this.five,
6268
- pxmm: this.pxmm,
6269
6271
  cameraImageUrl,
6272
+ getLabelElement,
6273
+ northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6270
6274
  visible: this.visible,
6271
6275
  duration: duration !== null && duration !== void 0 ? duration : 0,
6272
6276
  panoIndex: this.panoIndex,
@@ -6277,8 +6281,6 @@
6277
6281
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
6278
6282
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
6279
6283
  lastPanoramaLongitude: this.lastPanoramaLongitude,
6280
- getLabelElement,
6281
- onRoomHeightClick: this.handleClick,
6282
6284
  };
6283
6285
  if (!this.app) {
6284
6286
  this.app = new Main$1({
@@ -6348,7 +6350,7 @@
6348
6350
  const defaultNorthRad = params.north_rad || undefined;
6349
6351
  // 局部状态
6350
6352
  const state = {};
6351
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6353
+ const load = async (data) => {
6352
6354
  const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
6353
6355
  const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
6354
6356
  if (!northRad) {
@@ -6359,7 +6361,7 @@
6359
6361
  const zOffset = bounding.max.z - bounding.min.z;
6360
6362
  const maxOffset = Math.max(xOffset, zOffset);
6361
6363
  const fbxLoader = new FBXLoader.FBXLoader();
6362
- const object = yield fbxLoader.loadAsync(fbxUrl);
6364
+ const object = await fbxLoader.loadAsync(fbxUrl);
6363
6365
  transfromToMeshBasicMaterial(object, {
6364
6366
  transparent: true,
6365
6367
  side: THREE__namespace.DoubleSide,
@@ -6373,7 +6375,7 @@
6373
6375
  bject3d2LocalMatrix(object, { position, rotation, scale });
6374
6376
  state.object = object;
6375
6377
  return true;
6376
- });
6378
+ };
6377
6379
  const onCameraUpdate = ({ latitude }) => {
6378
6380
  if (!state.object)
6379
6381
  return;
@@ -6443,25 +6445,25 @@
6443
6445
  const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
6444
6446
  const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
6445
6447
  const mixers = [];
6446
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6447
- var _d, _e, _f, _g, _h, _j, _k;
6448
- const position = (_d = data === null || data === void 0 ? void 0 : data.position) !== null && _d !== void 0 ? _d : defaultModelPosition;
6448
+ const load = async (data) => {
6449
+ var _a, _b, _c, _d, _e, _f, _g;
6450
+ const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
6449
6451
  if (!position)
6450
6452
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
6451
6453
  const modelPosition = transformPositionToVector3(position);
6452
- const rad = (_e = data === null || data === void 0 ? void 0 : data.rad) !== null && _e !== void 0 ? _e : defaultRad;
6453
- const fbxUrl = (_f = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _f !== void 0 ? _f : defaultFbxUrl;
6454
+ const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
6455
+ const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
6454
6456
  state.rad = rad;
6455
6457
  if (rad === undefined)
6456
6458
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
6457
6459
  // 加载模型
6458
- const object = yield new FBXLoader.FBXLoader().loadAsync(fbxUrl);
6460
+ const object = await new FBXLoader.FBXLoader().loadAsync(fbxUrl);
6459
6461
  // 设置位置
6460
6462
  object.position.copy(modelPosition);
6461
6463
  object.rotation.z = rad;
6462
6464
  object.scale.set(0.8, 0.8, 0.8);
6463
6465
  transfromToMeshBasicMaterial(object, { transparent: true, side: THREE__namespace.DoubleSide });
6464
- 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();
6466
+ 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();
6465
6467
  if (!textMesh)
6466
6468
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
6467
6469
  textMesh.material = new THREE.MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
@@ -6469,7 +6471,7 @@
6469
6471
  object.children[0].add(textMesh);
6470
6472
  state.object = object;
6471
6473
  return true;
6472
- });
6474
+ };
6473
6475
  const initAnimation = () => {
6474
6476
  if (state.animation)
6475
6477
  return;
@@ -6706,21 +6708,21 @@
6706
6708
  */
6707
6709
  const CameraMovementPlugin = (five$1) => {
6708
6710
  const state = {};
6709
- const move = (args, duration, opts = { preload: true }) => __awaiter(void 0, void 0, void 0, function* () {
6711
+ const move = async (args, duration, opts = { preload: true }) => {
6710
6712
  if (state.interruptCallback) {
6711
6713
  state.interruptCallback(false);
6712
6714
  }
6713
6715
  if (opts.asyncStartCallback) {
6714
- yield opts.asyncStartCallback();
6716
+ await opts.asyncStartCallback();
6715
6717
  }
6716
6718
  if (args.mode && args.mode !== five$1.currentMode) {
6717
- yield five$1.changeMode(args.mode);
6719
+ await five$1.changeMode(args.mode);
6718
6720
  }
6719
6721
  if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
6720
- yield five$1.preloadPano(args.panoIndex);
6722
+ await five$1.preloadPano(args.panoIndex);
6721
6723
  }
6722
6724
  if (opts.asyncEndCallback) {
6723
- yield opts.asyncEndCallback();
6725
+ await opts.asyncEndCallback();
6724
6726
  }
6725
6727
  if (args.panoIndex === undefined &&
6726
6728
  args.fov === undefined &&
@@ -6728,7 +6730,7 @@
6728
6730
  args.longitude === undefined) {
6729
6731
  return true;
6730
6732
  }
6731
- return yield new Promise((resolve, reject) => {
6733
+ return await new Promise((resolve, reject) => {
6732
6734
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five$1.panoIndex;
6733
6735
  if (panoIndex !== undefined) {
6734
6736
  five$1.moveToPano(panoIndex, Object.assign({
@@ -6741,7 +6743,7 @@
6741
6743
  reject(false);
6742
6744
  }
6743
6745
  });
6744
- });
6746
+ };
6745
6747
  const getAnimeParams = (args) => {
6746
6748
  const currentFiveState = five$1.state;
6747
6749
  // latitude
@@ -6757,20 +6759,20 @@
6757
6759
  to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
6758
6760
  };
6759
6761
  };
6760
- const rotate = (args, duration, opts = {}) => __awaiter(void 0, void 0, void 0, function* () {
6762
+ const rotate = async (args, duration, opts = {}) => {
6761
6763
  if (state.interruptCallback) {
6762
6764
  state.interruptCallback(false);
6763
6765
  }
6764
6766
  if (opts.asyncStartCallback) {
6765
- yield opts.asyncStartCallback();
6767
+ await opts.asyncStartCallback();
6766
6768
  }
6767
6769
  if (five$1.currentMode !== five.Five.Mode.Panorama) {
6768
- yield five$1.changeMode(five.Five.Mode.Panorama);
6770
+ await five$1.changeMode(five.Five.Mode.Panorama);
6769
6771
  }
6770
6772
  if (args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
6771
6773
  if (opts.preload)
6772
- yield five$1.preloadPano(args.panoIndex);
6773
- yield new Promise((resolve, reject) => {
6774
+ await five$1.preloadPano(args.panoIndex);
6775
+ await new Promise((resolve, reject) => {
6774
6776
  if (!args.panoIndex) {
6775
6777
  resolve(true);
6776
6778
  return;
@@ -6782,10 +6784,10 @@
6782
6784
  });
6783
6785
  }
6784
6786
  if (opts.asyncEndCallback) {
6785
- yield opts.asyncEndCallback();
6787
+ await opts.asyncEndCallback();
6786
6788
  }
6787
6789
  const { from, to } = getAnimeParams(args);
6788
- return yield new Promise((resolve) => {
6790
+ return await new Promise((resolve) => {
6789
6791
  const onUpdate = ({ progress }) => {
6790
6792
  const state = {};
6791
6793
  state.longitude = progressNumber(from.longitude, to.longitude, progress);
@@ -6827,7 +6829,7 @@
6827
6829
  state.interruptCallback(true);
6828
6830
  }, duration);
6829
6831
  });
6830
- });
6832
+ };
6831
6833
  return {
6832
6834
  move,
6833
6835
  rotate,
@@ -7186,7 +7188,7 @@
7186
7188
  state.loaded = true;
7187
7189
  return true;
7188
7190
  };
7189
- const load = (_roomInfo, _roomRules, options) => __awaiter(void 0, void 0, void 0, function* () {
7191
+ const load = async (_roomInfo, _roomRules, options) => {
7190
7192
  const roomInfo = _roomInfo || params.roomInfo;
7191
7193
  const roomRules = _roomRules || params.roomRules;
7192
7194
  if (!roomInfo || !roomRules) {
@@ -7197,9 +7199,9 @@
7197
7199
  return _load(roomInfo, roomRules);
7198
7200
  }
7199
7201
  else {
7200
- return yield new Promise((resolve) => five$1.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7202
+ return await new Promise((resolve) => five$1.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7201
7203
  }
7202
- });
7204
+ };
7203
7205
  if (params.roomInfo && params.roomRules) {
7204
7206
  load(params.roomInfo, params.roomRules);
7205
7207
  }
@@ -7464,14 +7466,12 @@
7464
7466
  }
7465
7467
 
7466
7468
  const textureLoader = new THREE__namespace.TextureLoader();
7467
- function loadTexture(url) {
7468
- return __awaiter(this, void 0, void 0, function* () {
7469
- return new Promise((resolve, reject) => {
7470
- textureLoader.load(url, resolve, undefined, reject);
7471
- }).then((texture) => {
7472
- texture.encoding = THREE__namespace.sRGBEncoding;
7473
- return texture;
7474
- });
7469
+ async function loadTexture(url) {
7470
+ return new Promise((resolve, reject) => {
7471
+ textureLoader.load(url, resolve, undefined, reject);
7472
+ }).then((texture) => {
7473
+ texture.encoding = THREE__namespace.sRGBEncoding;
7474
+ return texture;
7475
7475
  });
7476
7476
  }
7477
7477
 
@@ -7711,65 +7711,59 @@
7711
7711
  if (this.modelLoaded)
7712
7712
  this.init();
7713
7713
  }
7714
- init() {
7715
- return __awaiter(this, void 0, void 0, function* () {
7716
- if (!this.data || !this.modelLoaded)
7717
- return;
7718
- const northRad = this.data.north_rad;
7719
- if (northRad != null) {
7720
- this.compassMesh = yield this.loadCompassMesh();
7721
- this.compassMesh.rotateX(-Math.PI / 2);
7722
- this.compassMesh.rotateZ(northRad - Math.PI / 2);
7723
- this.group.add(this.compassMesh);
7724
- }
7725
- if (this.data.entrance != null) {
7726
- this.entryDoorMesh = yield this.loadEntryDoorMesh();
7727
- this.roomInfoWrapperInstance = this.loadRoomInfo();
7728
- this.roomInfoInstance = getRoomInfoInstance();
7729
- this.entryDoorMesh.rotateX(-Math.PI / 2);
7730
- if (this.roomInfoWrapperInstance)
7731
- this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7732
- this.group.add(this.entryDoorMesh);
7733
- }
7734
- this.onFivePanoArrived(this.five.panoIndex || 0);
7735
- this.five.needsRender = true;
7736
- });
7737
- }
7738
- loadCompassMesh() {
7714
+ async init() {
7715
+ if (!this.data || !this.modelLoaded)
7716
+ return;
7717
+ const northRad = this.data.north_rad;
7718
+ if (northRad != null) {
7719
+ this.compassMesh = await this.loadCompassMesh();
7720
+ this.compassMesh.rotateX(-Math.PI / 2);
7721
+ this.compassMesh.rotateZ(northRad - Math.PI / 2);
7722
+ this.group.add(this.compassMesh);
7723
+ }
7724
+ if (this.data.entrance != null) {
7725
+ this.entryDoorMesh = await this.loadEntryDoorMesh();
7726
+ this.roomInfoWrapperInstance = this.loadRoomInfo();
7727
+ this.roomInfoInstance = getRoomInfoInstance();
7728
+ this.entryDoorMesh.rotateX(-Math.PI / 2);
7729
+ if (this.roomInfoWrapperInstance)
7730
+ this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7731
+ this.group.add(this.entryDoorMesh);
7732
+ }
7733
+ this.onFivePanoArrived(this.five.panoIndex || 0);
7734
+ this.five.needsRender = true;
7735
+ }
7736
+ async loadCompassMesh() {
7739
7737
  var _a;
7740
- return __awaiter(this, void 0, void 0, function* () {
7741
- const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7742
- '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7743
- const compassTexture = yield loadTexture(compassImageUrl);
7744
- const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
7745
- const compassMaterial = new THREE__namespace.MeshBasicMaterial({
7746
- map: compassTexture,
7747
- transparent: true,
7748
- opacity: 0,
7749
- depthTest: false,
7750
- });
7751
- const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
7752
- compassMesh.name = 'pano-compass-mesh';
7753
- return compassMesh;
7738
+ const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7739
+ '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7740
+ const compassTexture = await loadTexture(compassImageUrl);
7741
+ const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
7742
+ const compassMaterial = new THREE__namespace.MeshBasicMaterial({
7743
+ map: compassTexture,
7744
+ transparent: true,
7745
+ opacity: 0,
7746
+ depthTest: false,
7754
7747
  });
7748
+ const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
7749
+ compassMesh.name = 'pano-compass-mesh';
7750
+ return compassMesh;
7755
7751
  }
7756
- loadEntryDoorMesh() {
7752
+ async loadEntryDoorMesh() {
7757
7753
  var _a;
7758
- return __awaiter(this, void 0, void 0, function* () {
7759
- const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7760
- '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7761
- const entryDoorTexture = yield loadTexture(entryDoorImageUrl);
7762
- const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
7763
- const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
7764
- map: entryDoorTexture,
7765
- transparent: true,
7766
- opacity: 0.8,
7767
- depthTest: false,
7768
- });
7769
- const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
7770
- entryDoorMesh.name = 'pano-compass-entry-door';
7771
- return entryDoorMesh;
7754
+ const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7755
+ '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7756
+ const entryDoorTexture = await loadTexture(entryDoorImageUrl);
7757
+ const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
7758
+ const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
7759
+ map: entryDoorTexture,
7760
+ transparent: true,
7761
+ opacity: 0.8,
7762
+ depthTest: false,
7772
7763
  });
7764
+ const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
7765
+ entryDoorMesh.name = 'pano-compass-entry-door';
7766
+ return entryDoorMesh;
7773
7767
  }
7774
7768
  loadRoomInfo() {
7775
7769
  const points = [
@@ -12738,6 +12732,7 @@
12738
12732
  this.container.remove();
12739
12733
  }
12740
12734
  show() {
12735
+ this.container.style.display = 'block';
12741
12736
  this.container.style.opacity = '1';
12742
12737
  this.container.style.transform = 'translate(0, 0)';
12743
12738
  this.revoke = new Revoke(this.measureController, this.container);
@@ -12747,6 +12742,7 @@
12747
12742
  }
12748
12743
  hide() {
12749
12744
  var _a, _b;
12745
+ this.container.style.display = 'none';
12750
12746
  this.container.style.opacity = '0';
12751
12747
  this.container.style.transform = 'translate(0, 10px)';
12752
12748
  (_a = this.revoke) === null || _a === void 0 ? void 0 : _a.dispose();
@@ -15049,7 +15045,7 @@
15049
15045
  xhr.send();
15050
15046
  });
15051
15047
  };
15052
- const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
15048
+ const load = async (data, videoElement) => {
15053
15049
  const { video_src, video_poster_src, points } = data;
15054
15050
  state.videoSource = video_src;
15055
15051
  // TODO 存疑,先处理多一次遍历 o(2n)
@@ -15059,11 +15055,11 @@
15059
15055
  if (videoElement) {
15060
15056
  state.videoElement = videoElement;
15061
15057
  }
15062
- state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
15058
+ state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
15063
15059
  state.enabled = !!data.enable;
15064
15060
  if (state.enabled)
15065
15061
  enable();
15066
- });
15062
+ };
15067
15063
  const dispose = () => {
15068
15064
  disable();
15069
15065
  state.videoTexture = undefined;