@realsee/dnalogel 2.0.0-alpha.16 → 2.0.0-alpha.19

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 (180) hide show
  1. package/CHANGELOG.md +13 -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/index.js +8 -8
  10. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  11. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelRoomLabelPlugin/index.js +6 -6
  13. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  14. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  15. package/dist/ModelTVVideoPlugin/index.js +3 -28
  16. package/dist/PanoCompassPlugin/index.js +53 -86
  17. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  19. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  21. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  22. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  23. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  25. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  27. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  28. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  33. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  34. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  35. package/dist/PanoMeasurePlugin/index.js +1 -21
  36. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  37. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  38. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  41. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  42. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  43. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  44. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  45. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  46. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  47. package/dist/PanoRulerPlugin/index.js +3 -28
  48. package/dist/PanoSpatialTagPlugin/index.js +11 -11
  49. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  50. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  51. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  52. package/dist/floorplan/ModelFloorplanPlugin/index.js +1266 -1298
  53. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +81 -204
  54. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  55. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  56. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1257 -1250
  57. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  58. package/dist/index.es.js +1480 -1507
  59. package/dist/index.js +1477 -1504
  60. package/dist/index.umd.js +1477 -1504
  61. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  62. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  63. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  64. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  65. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  66. package/docs/assets/search.js +1 -1
  67. package/docs/classes/ModelRoomLabelController.html +6 -6
  68. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  69. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  70. package/docs/interfaces/LineJson.html +1 -1
  71. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  74. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  76. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  77. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  78. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  80. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  81. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  84. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  85. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  86. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  87. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  88. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  91. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  92. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  94. package/docs/interfaces/PointJson.html +1 -1
  95. package/docs/interfaces/RoomLabel.html +7 -7
  96. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  97. package/docs/modules.html +12 -12
  98. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  99. package/libs/CameraMovementPlugin/index.js +15 -24
  100. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  101. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  102. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  103. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  104. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  105. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  106. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  107. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  108. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  109. package/libs/ModelTVVideoPlugin/index.js +3 -12
  110. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  111. package/libs/PanoCompassPlugin/index.js +49 -64
  112. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  113. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  114. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  115. package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
  116. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  117. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  118. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  119. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  120. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  121. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  122. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  123. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  124. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  125. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  126. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  128. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  130. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  133. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  135. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  136. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  138. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  139. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  140. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  141. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  142. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  143. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  144. package/libs/PanoRulerPlugin/index.js +3 -12
  145. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  146. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  149. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  150. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  152. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  153. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  154. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  156. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  157. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  158. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  159. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  160. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  161. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  162. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  163. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  164. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  165. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  166. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  167. package/libs/floorplan/utils/formatData.js +28 -43
  168. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  169. package/libs/floorplan/utils/formatPosition.js +2 -2
  170. package/libs/shared-utils/five/changeMode.js +12 -23
  171. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  172. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  173. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  174. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  175. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  176. package/libs/shared-utils/three/loadTexture.js +6 -17
  177. package/libs/shared-utils/to.js +10 -21
  178. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  179. package/package.json +3 -1
  180. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var five = require('@realsee/five');
5
6
  var internal = require('svelte/internal');
6
- var THREE = require('three');
7
7
  var easing = require('svelte/easing');
8
8
  var transition = require('svelte/transition');
9
- var five = require('@realsee/five');
9
+ var THREE = require('three');
10
10
 
11
11
  function _interopNamespace(e) {
12
12
  if (e && e.__esModule) return e;
@@ -28,29 +28,66 @@ function _interopNamespace(e) {
28
28
 
29
29
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
30
30
 
31
- /*! *****************************************************************************
32
- Copyright (c) Microsoft Corporation.
33
-
34
- Permission to use, copy, modify, and/or distribute this software for any
35
- purpose with or without fee is hereby granted.
36
-
37
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
38
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
40
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
41
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
42
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
43
- PERFORMANCE OF THIS SOFTWARE.
44
- ***************************************************************************** */
45
-
46
- function __awaiter(thisArg, _arguments, P, generator) {
47
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48
- return new (P || (P = Promise))(function (resolve, reject) {
49
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
50
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
51
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
52
- step((generator = generator.apply(thisArg, _arguments || [])).next());
53
- });
31
+ /**
32
+ * 把第一个参数传入第二个参数(函数)中并执行
33
+ * 一般用于执行函数后返回变量。
34
+ * @param {any} something
35
+ * @param {function} callback
36
+ * @return {any}
37
+ */
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
+ function tap(something, callback) {
40
+ callback(something);
41
+ return something;
42
+ }
43
+
44
+ /**
45
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
46
+ * @param object
47
+ * @param props 排除的属性
48
+ * @return
49
+ */
50
+ function omit(object, props) {
51
+ return tap({}, (result) => {
52
+ for (const name in object) {
53
+ if (props.indexOf(name) !== -1)
54
+ continue;
55
+ result[name] = object[name];
56
+ }
57
+ });
58
+ }
59
+
60
+ var FloorplanErrorType;
61
+ (function (FloorplanErrorType) {
62
+ FloorplanErrorType["UnknownError"] = "UnknowError";
63
+ FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
64
+ FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
65
+ FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
66
+ FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
67
+ FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
68
+ FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
69
+ })(FloorplanErrorType || (FloorplanErrorType = {}));
70
+ /** 户型图展示 & 模型消失的默认时间 */
71
+ const SHOW_ANIME_DURATION = 500;
72
+ /** Five camera 默认 fov */
73
+ const FIVE_CAMERA_DEFAULT_FOV = 80;
74
+
75
+ /**
76
+ * 传入一个 Promise
77
+ * 无异常,返回 [null, data]
78
+ * 有异常,则返回 [Error, undefined]
79
+ * 用于替代 try&catch 处理 await 异常的方案
80
+ */
81
+ async function to(promise) {
82
+ try {
83
+ const data = await promise;
84
+ return [null, data];
85
+ }
86
+ catch (error) {
87
+ if (error instanceof Error)
88
+ return [error, null];
89
+ return [new Error(''), null];
90
+ }
54
91
  }
55
92
 
56
93
  const CAMERA_IMAGE = 'data:image/png;base64,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';
@@ -59,10 +96,10 @@ function rad2Deg$1(rad) {
59
96
  return (rad * 180) / Math.PI;
60
97
  }
61
98
 
62
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
99
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
63
100
 
64
- function add_css$c(target) {
65
- internal.append_styles(target, "svelte-e8a2kn", ".floorplan__camera-position.svelte-e8a2kn{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-e8a2kn{position:absolute;background-repeat:no-repeat;background-size:100%}");
101
+ function add_css$d(target) {
102
+ 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%}");
66
103
  }
67
104
 
68
105
  function create_fragment$g(ctx) {
@@ -73,7 +110,7 @@ function create_fragment$g(ctx) {
73
110
  c() {
74
111
  div1 = internal.element("div");
75
112
  div0 = internal.element("div");
76
- internal.attr(div0, "class", "floorplan__camera-rotate svelte-e8a2kn");
113
+ internal.attr(div0, "class", "floorplan__camera-rotate svelte-17cl35n");
77
114
  internal.set_style(div0, "background-image", `url(${/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE})`);
78
115
  internal.set_style(div0, "width", /*domSizeStyle*/ ctx[4], false);
79
116
  internal.set_style(div0, "height", /*domSizeStyle*/ ctx[4], false);
@@ -81,7 +118,7 @@ function create_fragment$g(ctx) {
81
118
  internal.set_style(div0, "top", '-' + /*domSizeStyle*/ ctx[4], false);
82
119
  internal.set_style(div0, "transform", `rotate(${/*rotate*/ ctx[3]}deg)`, false);
83
120
  internal.set_style(div0, "transform-origin", `${/*domSizeStyle*/ ctx[4]} ${/*domSizeStyle*/ ctx[4]}`, false);
84
- internal.attr(div1, "class", "floorplan__camera-position svelte-e8a2kn");
121
+ internal.attr(div1, "class", "floorplan__camera-position svelte-17cl35n");
85
122
  internal.set_style(div1, "left", /*positionLeft*/ ctx[1], false);
86
123
  internal.set_style(div1, "top", /*positionTop*/ ctx[2], false);
87
124
  },
@@ -157,17 +194,17 @@ class Camera extends internal.SvelteComponent {
157
194
  lastPanoramaLongitude: 7,
158
195
  cameraImageUrl: 0
159
196
  },
160
- add_css$c
197
+ add_css$d
161
198
  );
162
199
  }
163
200
  }
164
201
 
165
202
  const COMPASS_IMAGE = 'data:image/png;base64,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';
166
203
 
167
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
204
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
168
205
 
169
- function add_css$b(target) {
170
- internal.append_styles(target, "svelte-5l80pv", ".floorplan-plugin__compass.svelte-5l80pv{position:absolute;left:50%;top:-46px;width:231px;height:41px;will-change:opacity;transform-origin:center 184px}.floorplan-plugin__compass-image.svelte-5l80pv{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-5l80pv{position:absolute;left:50%;top:15px;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:10px;color:#fff}");
206
+ function add_css$c(target) {
207
+ 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}");
171
208
  }
172
209
 
173
210
  // (13:0) {#if northRad}
@@ -185,10 +222,10 @@ function create_if_block$6(ctx) {
185
222
  t0 = internal.space();
186
223
  span = internal.element("span");
187
224
  t1 = internal.text(/*northDesc*/ ctx[0]);
188
- internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-5l80pv");
225
+ internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-1q44ru9");
189
226
  internal.set_style(div0, "background-image", `url(${COMPASS_IMAGE})`);
190
- internal.attr(span, "class", "floorplan-plugin__compass-text svelte-5l80pv");
191
- internal.attr(div1, "class", "floorplan-plugin__compass svelte-5l80pv");
227
+ internal.attr(span, "class", "floorplan-plugin__compass-text svelte-1q44ru9");
228
+ internal.attr(div1, "class", "floorplan-plugin__compass svelte-1q44ru9");
192
229
  internal.set_style(div1, "transform", /*compassTransformStyle*/ ctx[2], false);
193
230
  },
194
231
  m(target, anchor) {
@@ -259,345 +296,271 @@ function instance$f($$self, $$props, $$invalidate) {
259
296
  class Compass extends internal.SvelteComponent {
260
297
  constructor(options) {
261
298
  super();
262
- internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$b);
299
+ internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$c);
263
300
  }
264
301
  }
265
302
 
266
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
303
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
267
304
 
268
- function add_css$a(target) {
269
- internal.append_styles(target, "svelte-1ashbdx", ".floorplan-plugin__room-label-item.svelte-1ashbdx{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:15px;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-1ashbdx{opacity:0.45}");
305
+ function add_css$b(target) {
306
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
270
307
  }
271
308
 
272
- // (22:30)
273
- function create_if_block_1$4(ctx) {
274
- let html_tag;
275
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
276
- let html_anchor;
309
+ function create_fragment$e(ctx) {
310
+ let img;
311
+ let img_src_value;
277
312
 
278
313
  return {
279
314
  c() {
280
- html_tag = new internal.HtmlTag();
281
- html_anchor = internal.empty();
282
- html_tag.a = html_anchor;
315
+ img = internal.element("img");
316
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
317
+ internal.attr(img, "alt", "floorplan iamge");
318
+ internal.attr(img, "class", "svelte-1gfoniz");
283
319
  },
284
320
  m(target, anchor) {
285
- html_tag.m(raw_value, target, anchor);
286
- internal.insert(target, html_anchor, anchor);
321
+ internal.insert(target, img, anchor);
287
322
  },
288
- p(ctx, dirty) {
289
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
323
+ p(ctx, [dirty]) {
324
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
325
+ internal.attr(img, "src", img_src_value);
326
+ }
290
327
  },
328
+ i: internal.noop,
329
+ o: internal.noop,
291
330
  d(detaching) {
292
- if (detaching) internal.detach(html_anchor);
293
- if (detaching) html_tag.d();
331
+ if (detaching) internal.detach(img);
294
332
  }
295
333
  };
296
334
  }
297
335
 
298
- // (16:2) {#if getLabelElement === undefined}
299
- function create_if_block$5(ctx) {
300
- let span0;
301
- let t0_value = /*room*/ ctx[0].name + "";
302
- let t0;
303
- let t1;
304
- let span1;
336
+ function instance$e($$self, $$props, $$invalidate) {
337
+ let { url } = $$props;
305
338
 
306
- return {
307
- c() {
308
- span0 = internal.element("span");
309
- t0 = internal.text(t0_value);
310
- t1 = internal.space();
311
- span1 = internal.element("span");
312
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
313
- internal.attr(span0, "class", "floorplan-plugin__room-name");
314
- internal.attr(span1, "class", "floorplan-plugin__room-size svelte-1ashbdx");
315
- },
316
- m(target, anchor) {
317
- internal.insert(target, span0, anchor);
318
- internal.append(span0, t0);
319
- internal.insert(target, t1, anchor);
320
- internal.insert(target, span1, anchor);
321
- },
322
- p(ctx, dirty) {
323
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
324
- },
325
- d(detaching) {
326
- if (detaching) internal.detach(span0);
327
- if (detaching) internal.detach(t1);
328
- if (detaching) internal.detach(span1);
329
- }
339
+ $$self.$$set = $$props => {
340
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
330
341
  };
331
- }
332
342
 
333
- function create_fragment$e(ctx) {
334
- let div;
343
+ return [url];
344
+ }
335
345
 
336
- function select_block_type(ctx, dirty) {
337
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$5;
338
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
346
+ class Normalmage extends internal.SvelteComponent {
347
+ constructor(options) {
348
+ super();
349
+ internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { url: 0 }, add_css$b);
339
350
  }
351
+ }
340
352
 
341
- let current_block_type = select_block_type(ctx);
342
- let if_block = current_block_type && current_block_type(ctx);
353
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
354
+
355
+ function add_css$a(target) {
356
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
357
+ }
358
+
359
+ function create_fragment$d(ctx) {
360
+ let div;
361
+ let html_tag;
362
+ let t;
363
+ let html_tag_1;
343
364
 
344
365
  return {
345
366
  c() {
346
367
  div = internal.element("div");
347
- if (if_block) if_block.c();
348
- internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-1ashbdx");
349
- internal.set_style(div, "left", /*left*/ ctx[4], false);
350
- internal.set_style(div, "top", /*top*/ ctx[5], false);
351
- internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
368
+ html_tag = new internal.HtmlTag();
369
+ t = internal.space();
370
+ html_tag_1 = new internal.HtmlTag();
371
+ html_tag.a = t;
372
+ html_tag_1.a = null;
373
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
352
374
  },
353
375
  m(target, anchor) {
354
376
  internal.insert(target, div, anchor);
355
- if (if_block) if_block.m(div, null);
377
+ html_tag.m(/*svgStyle*/ ctx[1], div);
378
+ internal.append(div, t);
379
+ html_tag_1.m(/*content*/ ctx[0], div);
356
380
  },
357
381
  p(ctx, [dirty]) {
358
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
359
- if_block.p(ctx, dirty);
360
- } else {
361
- if (if_block) if_block.d(1);
362
- if_block = current_block_type && current_block_type(ctx);
363
-
364
- if (if_block) {
365
- if_block.c();
366
- if_block.m(div, null);
367
- }
368
- }
382
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
369
383
  },
370
384
  i: internal.noop,
371
385
  o: internal.noop,
372
386
  d(detaching) {
373
387
  if (detaching) internal.detach(div);
374
-
375
- if (if_block) {
376
- if_block.d();
377
- }
378
388
  }
379
389
  };
380
390
  }
381
391
 
382
- function instance$e($$self, $$props, $$invalidate) {
383
- let userConfigElement;
384
- let { room } = $$props;
385
- let { getLabelElement } = $$props;
386
-
387
- // TODO: 统一这里的判断条件,目前写了多处
388
- const bodyWidth = document.body.clientWidth;
392
+ function instance$d($$self, $$props, $$invalidate) {
393
+ let { content } = $$props;
389
394
 
390
- const bodyHeight = document.body.clientHeight;
391
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
392
- const roomLabel = room.roomLabel;
393
- const left = roomLabel.positionInImage.x * 100 + '%';
394
- const top = roomLabel.positionInImage.y * 100 + '%';
395
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
395
+ const svgStyle = `
396
+ <style>
397
+ svg [type='lineGroup'] path {
398
+ fill: #ffffff;
399
+ stroke: #ffffff;
400
+ }
401
+ svg [type='lineItemGroup'] g g g g {
402
+ stroke: #ffffff;
403
+ }</style>
404
+ `;
396
405
 
397
406
  $$self.$$set = $$props => {
398
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
399
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
400
- };
401
-
402
- $$self.$$.update = () => {
403
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
404
- $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
405
- ? void 0
406
- : getLabelElement(room));
407
- }
407
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
408
408
  };
409
409
 
410
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
410
+ return [content, svgStyle];
411
411
  }
412
412
 
413
- class RoomLabel extends internal.SvelteComponent {
413
+ class SvgImage extends internal.SvelteComponent {
414
414
  constructor(options) {
415
415
  super();
416
- internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$a);
416
+ internal.init(this, options, instance$d, create_fragment$d, internal.safe_not_equal, { content: 0 }, add_css$a);
417
417
  }
418
418
  }
419
419
 
420
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
420
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
421
421
 
422
422
  function add_css$9(target) {
423
- internal.append_styles(target, "svelte-sw25w3", ".floorplan-plugin__room-labels.svelte-sw25w3{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
424
- }
425
-
426
- function get_each_context$4(ctx, list, i) {
427
- const child_ctx = ctx.slice();
428
- child_ctx[4] = list[i];
429
- return child_ctx;
423
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
430
424
  }
431
425
 
432
- // (8:0) {#if rooms}
433
- function create_if_block$4(ctx) {
434
- let div;
435
- let each_blocks = [];
436
- let each_1_lookup = new Map();
426
+ // (13:22)
427
+ function create_if_block_1$4(ctx) {
428
+ let normalimage;
437
429
  let current;
438
- let each_value = /*rooms*/ ctx[1];
439
- const get_key = ctx => /*room*/ ctx[4].id;
440
-
441
- for (let i = 0; i < each_value.length; i += 1) {
442
- let child_ctx = get_each_context$4(ctx, each_value, i);
443
- let key = get_key(child_ctx);
444
- each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
445
- }
430
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
446
431
 
447
432
  return {
448
433
  c() {
449
- div = internal.element("div");
450
-
451
- for (let i = 0; i < each_blocks.length; i += 1) {
452
- each_blocks[i].c();
453
- }
454
-
455
- internal.attr(div, "class", "floorplan-plugin__room-labels svelte-sw25w3");
434
+ internal.create_component(normalimage.$$.fragment);
456
435
  },
457
436
  m(target, anchor) {
458
- internal.insert(target, div, anchor);
459
-
460
- for (let i = 0; i < each_blocks.length; i += 1) {
461
- each_blocks[i].m(div, null);
462
- }
463
-
437
+ internal.mount_component(normalimage, target, anchor);
464
438
  current = true;
465
439
  },
466
440
  p(ctx, dirty) {
467
- if (dirty & /*rooms, getLabelElement*/ 3) {
468
- each_value = /*rooms*/ ctx[1];
469
- internal.group_outros();
470
- 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$4, null, get_each_context$4);
471
- internal.check_outros();
472
- }
441
+ const normalimage_changes = {};
442
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
443
+ normalimage.$set(normalimage_changes);
473
444
  },
474
445
  i(local) {
475
446
  if (current) return;
476
-
477
- for (let i = 0; i < each_value.length; i += 1) {
478
- internal.transition_in(each_blocks[i]);
479
- }
480
-
447
+ internal.transition_in(normalimage.$$.fragment, local);
481
448
  current = true;
482
449
  },
483
450
  o(local) {
484
- for (let i = 0; i < each_blocks.length; i += 1) {
485
- internal.transition_out(each_blocks[i]);
486
- }
487
-
451
+ internal.transition_out(normalimage.$$.fragment, local);
488
452
  current = false;
489
453
  },
490
454
  d(detaching) {
491
- if (detaching) internal.detach(div);
492
-
493
- for (let i = 0; i < each_blocks.length; i += 1) {
494
- each_blocks[i].d();
495
- }
455
+ internal.destroy_component(normalimage, detaching);
496
456
  }
497
457
  };
498
458
  }
499
459
 
500
- // (10:4) {#each rooms as room (room.id)}
501
- function create_each_block$4(key_1, ctx) {
502
- let first;
503
- let roomlabel;
460
+ // (11:2) {#if svgContent}
461
+ function create_if_block$5(ctx) {
462
+ let svgimage;
504
463
  let current;
505
464
 
506
- const roomlabel_spread_levels = [
507
- {
508
- room: /*room*/ ctx[4],
509
- getLabelElement: /*getLabelElement*/ ctx[0]
510
- }
511
- ];
512
-
513
- let roomlabel_props = {};
514
-
515
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
516
- roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
517
- }
518
-
519
- roomlabel = new RoomLabel({ props: roomlabel_props });
465
+ svgimage = new SvgImage({
466
+ props: { content: /*svgContent*/ ctx[0] }
467
+ });
520
468
 
521
469
  return {
522
- key: key_1,
523
- first: null,
524
470
  c() {
525
- first = internal.empty();
526
- internal.create_component(roomlabel.$$.fragment);
527
- this.first = first;
471
+ internal.create_component(svgimage.$$.fragment);
528
472
  },
529
473
  m(target, anchor) {
530
- internal.insert(target, first, anchor);
531
- internal.mount_component(roomlabel, target, anchor);
474
+ internal.mount_component(svgimage, target, anchor);
532
475
  current = true;
533
476
  },
534
- p(new_ctx, dirty) {
535
- ctx = new_ctx;
536
-
537
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
538
- ? internal.get_spread_update(roomlabel_spread_levels, [
539
- {
540
- room: /*room*/ ctx[4],
541
- getLabelElement: /*getLabelElement*/ ctx[0]
542
- }
543
- ])
544
- : {};
545
-
546
- roomlabel.$set(roomlabel_changes);
477
+ p(ctx, dirty) {
478
+ const svgimage_changes = {};
479
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
480
+ svgimage.$set(svgimage_changes);
547
481
  },
548
482
  i(local) {
549
483
  if (current) return;
550
- internal.transition_in(roomlabel.$$.fragment, local);
484
+ internal.transition_in(svgimage.$$.fragment, local);
551
485
  current = true;
552
486
  },
553
487
  o(local) {
554
- internal.transition_out(roomlabel.$$.fragment, local);
488
+ internal.transition_out(svgimage.$$.fragment, local);
555
489
  current = false;
556
490
  },
557
491
  d(detaching) {
558
- if (detaching) internal.detach(first);
559
- internal.destroy_component(roomlabel, detaching);
492
+ internal.destroy_component(svgimage, detaching);
560
493
  }
561
494
  };
562
495
  }
563
496
 
564
- function create_fragment$d(ctx) {
565
- let if_block_anchor;
497
+ function create_fragment$c(ctx) {
498
+ let div;
499
+ let current_block_type_index;
500
+ let if_block;
566
501
  let current;
567
- let if_block = /*rooms*/ ctx[1] && create_if_block$4(ctx);
502
+ const if_block_creators = [create_if_block$5, create_if_block_1$4];
503
+ const if_blocks = [];
504
+
505
+ function select_block_type(ctx, dirty) {
506
+ if (/*svgContent*/ ctx[0]) return 0;
507
+ if (/*imageData*/ ctx[1]) return 1;
508
+ return -1;
509
+ }
510
+
511
+ if (~(current_block_type_index = select_block_type(ctx))) {
512
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
513
+ }
568
514
 
569
515
  return {
570
516
  c() {
517
+ div = internal.element("div");
571
518
  if (if_block) if_block.c();
572
- if_block_anchor = internal.empty();
519
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
573
520
  },
574
521
  m(target, anchor) {
575
- if (if_block) if_block.m(target, anchor);
576
- internal.insert(target, if_block_anchor, anchor);
522
+ internal.insert(target, div, anchor);
523
+
524
+ if (~current_block_type_index) {
525
+ if_blocks[current_block_type_index].m(div, null);
526
+ }
527
+
577
528
  current = true;
578
529
  },
579
530
  p(ctx, [dirty]) {
580
- if (/*rooms*/ ctx[1]) {
531
+ let previous_block_index = current_block_type_index;
532
+ current_block_type_index = select_block_type(ctx);
533
+
534
+ if (current_block_type_index === previous_block_index) {
535
+ if (~current_block_type_index) {
536
+ if_blocks[current_block_type_index].p(ctx, dirty);
537
+ }
538
+ } else {
581
539
  if (if_block) {
582
- if_block.p(ctx, dirty);
540
+ internal.group_outros();
583
541
 
584
- if (dirty & /*rooms*/ 2) {
585
- internal.transition_in(if_block, 1);
586
- }
587
- } else {
588
- if_block = create_if_block$4(ctx);
589
- if_block.c();
590
- internal.transition_in(if_block, 1);
591
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
542
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
543
+ if_blocks[previous_block_index] = null;
544
+ });
545
+
546
+ internal.check_outros();
592
547
  }
593
- } else if (if_block) {
594
- internal.group_outros();
595
548
 
596
- internal.transition_out(if_block, 1, 1, () => {
597
- if_block = null;
598
- });
549
+ if (~current_block_type_index) {
550
+ if_block = if_blocks[current_block_type_index];
599
551
 
600
- internal.check_outros();
552
+ if (!if_block) {
553
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
554
+ if_block.c();
555
+ } else {
556
+ if_block.p(ctx, dirty);
557
+ }
558
+
559
+ internal.transition_in(if_block, 1);
560
+ if_block.m(div, null);
561
+ } else {
562
+ if_block = null;
563
+ }
601
564
  }
602
565
  },
603
566
  i(local) {
@@ -610,856 +573,949 @@ function create_fragment$d(ctx) {
610
573
  current = false;
611
574
  },
612
575
  d(detaching) {
613
- if (if_block) if_block.d(detaching);
614
- if (detaching) internal.detach(if_block_anchor);
576
+ if (detaching) internal.detach(div);
577
+
578
+ if (~current_block_type_index) {
579
+ if_blocks[current_block_type_index].d();
580
+ }
615
581
  }
616
582
  };
617
583
  }
618
584
 
619
- function instance$d($$self, $$props, $$invalidate) {
620
- let rooms;
585
+ function instance$c($$self, $$props, $$invalidate) {
586
+ let imageData;
587
+ let svgContent;
588
+ var _a, _b;
621
589
  let { floorIndex } = $$props;
622
590
  let { floorplanData } = $$props;
623
- let { getLabelElement } = $$props;
624
591
 
625
592
  $$self.$$set = $$props => {
626
593
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
627
594
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
628
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
629
595
  };
630
596
 
631
597
  $$self.$$.update = () => {
632
598
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
633
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
599
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
600
+ }
601
+
602
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
603
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
604
+ ? void 0
605
+ : _a[floorIndex]) === null || _b === void 0
606
+ ? void 0
607
+ : _b.svgContent);
634
608
  }
635
609
  };
636
610
 
637
- return [getLabelElement, rooms, floorIndex, floorplanData];
611
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
638
612
  }
639
613
 
640
- class RoomLabels extends internal.SvelteComponent {
614
+ class BaseImage extends internal.SvelteComponent {
641
615
  constructor(options) {
642
616
  super();
643
-
644
- internal.init(
645
- this,
646
- options,
647
- instance$d,
648
- create_fragment$d,
649
- internal.safe_not_equal,
650
- {
651
- floorIndex: 2,
652
- floorplanData: 3,
653
- getLabelElement: 0
654
- },
655
- add_css$9
656
- );
617
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$9);
657
618
  }
658
619
  }
659
620
 
660
- /**
661
- * 判断对象是否为`null`或`undefined`。
662
- * @param
663
- * @return
664
- */
665
- /**
666
- * 判断对象不为`null`或`undefined`。
667
- */
668
- function notNil(value) {
669
- return value !== null && value !== undefined;
670
- }
671
-
672
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
621
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
673
622
 
674
623
  function add_css$8(target) {
675
- internal.append_styles(target, "svelte-1rr09in", ".floorplan-plugin__rule-labels.svelte-1rr09in{position:absolute;height:5px;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1rr09in{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1rr09in{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1rr09in{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1rr09in{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1rr09in{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1rr09in{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:5px}.floorplan-plugin__text-wrapper.svelte-1rr09in{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1rr09in{top:10px}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1rr09in{bottom:10px}.floorplan-plugin__rule-text.svelte-1rr09in{position:absolute;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:10px;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1rr09in{transform:translate(-50%, -50%)}");
676
- }
677
-
678
- function get_each_context$3(ctx, list, i) {
679
- const child_ctx = ctx.slice();
680
- child_ctx[24] = list[i];
681
- child_ctx[26] = i;
682
- return child_ctx;
683
- }
684
-
685
- function get_each_context_1(ctx, list, i) {
686
- const child_ctx = ctx.slice();
687
- child_ctx[27] = list[i];
688
- child_ctx[29] = i;
689
- return child_ctx;
624
+ 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}");
690
625
  }
691
626
 
692
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
693
- function create_each_block_1(key_1, ctx) {
694
- let div;
695
- let style_left = `${/*position*/ ctx[27]}px`;
627
+ // (22:30)
628
+ function create_if_block_1$3(ctx) {
629
+ let html_tag;
630
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
631
+ let html_anchor;
696
632
 
697
633
  return {
698
- key: key_1,
699
- first: null,
700
634
  c() {
701
- div = internal.element("div");
702
- internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1rr09in");
703
- internal.set_style(div, "left", style_left, false);
704
- this.first = div;
635
+ html_tag = new internal.HtmlTag();
636
+ html_anchor = internal.empty();
637
+ html_tag.a = html_anchor;
705
638
  },
706
639
  m(target, anchor) {
707
- internal.insert(target, div, anchor);
640
+ html_tag.m(raw_value, target, anchor);
641
+ internal.insert(target, html_anchor, anchor);
708
642
  },
709
- p(new_ctx, dirty) {
710
- ctx = new_ctx;
643
+ p(ctx, dirty) {
644
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
711
645
  },
712
646
  d(detaching) {
713
- if (detaching) internal.detach(div);
647
+ if (detaching) internal.detach(html_anchor);
648
+ if (detaching) html_tag.d();
714
649
  }
715
650
  };
716
651
  }
717
652
 
718
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
719
- function create_each_block$3(key_1, ctx) {
720
- let div;
721
- let span;
722
- let t0_value = /*textItem*/ ctx[24].distance + "";
653
+ // (16:2) {#if getLabelElement === undefined}
654
+ function create_if_block$4(ctx) {
655
+ let span0;
656
+ let t0_value = /*room*/ ctx[0].name + "";
723
657
  let t0;
724
658
  let t1;
725
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
659
+ let span1;
726
660
 
727
661
  return {
728
- key: key_1,
729
- first: null,
730
662
  c() {
731
- div = internal.element("div");
732
- span = internal.element("span");
663
+ span0 = internal.element("span");
733
664
  t0 = internal.text(t0_value);
734
665
  t1 = internal.space();
735
- internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1rr09in");
736
- internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
737
- internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1rr09in");
738
- internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
739
- internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
740
- internal.set_style(div, "left", style_left, false);
741
- this.first = div;
666
+ span1 = internal.element("span");
667
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
668
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
669
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
742
670
  },
743
671
  m(target, anchor) {
744
- internal.insert(target, div, anchor);
745
- internal.append(div, span);
746
- internal.append(span, t0);
747
- internal.append(div, t1);
672
+ internal.insert(target, span0, anchor);
673
+ internal.append(span0, t0);
674
+ internal.insert(target, t1, anchor);
675
+ internal.insert(target, span1, anchor);
748
676
  },
749
- p(new_ctx, dirty) {
750
- ctx = new_ctx;
677
+ p(ctx, dirty) {
678
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
751
679
  },
752
680
  d(detaching) {
753
- if (detaching) internal.detach(div);
681
+ if (detaching) internal.detach(span0);
682
+ if (detaching) internal.detach(t1);
683
+ if (detaching) internal.detach(span1);
754
684
  }
755
685
  };
756
686
  }
757
687
 
758
- function create_fragment$c(ctx) {
759
- let div1;
760
- let div0;
761
- let t0;
762
- let each_blocks_1 = [];
763
- let each0_lookup = new Map();
764
- let t1;
765
- let each_blocks = [];
766
- let each1_lookup = new Map();
767
- let div1_class_value;
768
- let each_value_1 = /*positionPxArray*/ ctx[6];
769
- const get_key = ctx => /*positionIndex*/ ctx[29];
688
+ function create_fragment$b(ctx) {
689
+ let div;
770
690
 
771
- for (let i = 0; i < each_value_1.length; i += 1) {
772
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
773
- let key = get_key(child_ctx);
774
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
691
+ function select_block_type(ctx, dirty) {
692
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$4;
693
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$3;
775
694
  }
776
695
 
777
- let each_value = /*textArray*/ ctx[10];
778
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
779
-
780
- for (let i = 0; i < each_value.length; i += 1) {
781
- let child_ctx = get_each_context$3(ctx, each_value, i);
782
- let key = get_key_1(child_ctx);
783
- each1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
784
- }
696
+ let current_block_type = select_block_type(ctx);
697
+ let if_block = current_block_type && current_block_type(ctx);
785
698
 
786
699
  return {
787
700
  c() {
788
- div1 = internal.element("div");
789
- div0 = internal.element("div");
790
- t0 = internal.space();
791
-
792
- for (let i = 0; i < each_blocks_1.length; i += 1) {
793
- each_blocks_1[i].c();
794
- }
795
-
796
- t1 = internal.space();
797
-
798
- for (let i = 0; i < each_blocks.length; i += 1) {
799
- each_blocks[i].c();
800
- }
801
-
802
- internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1rr09in");
803
- internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in");
804
- internal.set_style(div1, "width", /*width*/ ctx[9], false);
805
- internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
806
- internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
701
+ div = internal.element("div");
702
+ if (if_block) if_block.c();
703
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
704
+ internal.set_style(div, "left", /*left*/ ctx[4], false);
705
+ internal.set_style(div, "top", /*top*/ ctx[5], false);
706
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
807
707
  },
808
708
  m(target, anchor) {
809
- internal.insert(target, div1, anchor);
810
- internal.append(div1, div0);
811
- internal.append(div1, t0);
812
-
813
- for (let i = 0; i < each_blocks_1.length; i += 1) {
814
- each_blocks_1[i].m(div1, null);
815
- }
816
-
817
- internal.append(div1, t1);
818
-
819
- for (let i = 0; i < each_blocks.length; i += 1) {
820
- each_blocks[i].m(div1, null);
821
- }
709
+ internal.insert(target, div, anchor);
710
+ if (if_block) if_block.m(div, null);
822
711
  },
823
712
  p(ctx, [dirty]) {
824
- if (dirty & /*positionPxArray*/ 64) {
825
- each_value_1 = /*positionPxArray*/ ctx[6];
826
- 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);
827
- }
828
-
829
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
830
- each_value = /*textArray*/ ctx[10];
831
- 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$3, null, get_each_context$3);
832
- }
713
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
714
+ if_block.p(ctx, dirty);
715
+ } else {
716
+ if (if_block) if_block.d(1);
717
+ if_block = current_block_type && current_block_type(ctx);
833
718
 
834
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in")) {
835
- internal.attr(div1, "class", div1_class_value);
719
+ if (if_block) {
720
+ if_block.c();
721
+ if_block.m(div, null);
722
+ }
836
723
  }
837
724
  },
838
725
  i: internal.noop,
839
726
  o: internal.noop,
840
727
  d(detaching) {
841
- if (detaching) internal.detach(div1);
842
-
843
- for (let i = 0; i < each_blocks_1.length; i += 1) {
844
- each_blocks_1[i].d();
845
- }
728
+ if (detaching) internal.detach(div);
846
729
 
847
- for (let i = 0; i < each_blocks.length; i += 1) {
848
- each_blocks[i].d();
730
+ if (if_block) {
731
+ if_block.d();
849
732
  }
850
733
  }
851
734
  };
852
735
  }
853
736
 
854
- const padding = 1000;
855
-
856
- function instance$c($$self, $$props, $$invalidate) {
857
- let { pxmm } = $$props;
858
- let { type } = $$props;
859
- let { data } = $$props;
860
- let { bounding } = $$props;
861
- const isTop = type === 'top';
862
- const isBottom = type === 'bottom';
863
- const isLeft = type === 'left';
864
- const isRight = type === 'right';
865
- const isRow = isTop || isBottom;
737
+ function instance$b($$self, $$props, $$invalidate) {
738
+ let userConfigElement;
739
+ let { room } = $$props;
740
+ let { getLabelElement } = $$props;
866
741
 
867
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
868
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
869
- if (index === 0) return true;
870
- return x !== arr[index - 1];
871
- });
742
+ // TODO: 统一这里的判断条件,目前写了多处
743
+ const bodyWidth = document.body.clientWidth;
872
744
 
873
- const minPosition = positionArray[0];
874
- const maxPosition = positionArray.slice(-1)[0];
875
- const length = maxPosition - minPosition;
876
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
877
- const lengthPx = length * pxmm;
878
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
879
-
880
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
881
- const translateMain = (minPosition - minBounding) * pxmm;
882
-
883
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
884
- const translateSecond = 27 - padding * pxmm;
885
-
886
- const translate = (() => {
887
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
888
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
889
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
890
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
891
- })();
892
-
893
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
894
- const transform = `${translate} ${rotate}`;
895
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
896
- const width = lengthPx + 'px';
897
-
898
- // 把点位的户型图坐标转成距离起始位置的像素值
899
- const textArray = positionArray.map((position, index, array) => {
900
- if (index === 0) return null;
901
- const distance = position - array[index - 1];
902
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
903
- return { distance, positionPx };
904
- }).filter(notNil).filter(item => item.distance / length > 0.12);
745
+ const bodyHeight = document.body.clientHeight;
746
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
747
+ const roomLabel = room.roomLabel;
748
+ const left = roomLabel.positionInImage.x * 100 + '%';
749
+ const top = roomLabel.positionInImage.y * 100 + '%';
750
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
905
751
 
906
752
  $$self.$$set = $$props => {
907
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
908
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
909
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
910
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
753
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
754
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
911
755
  };
912
756
 
913
- return [
914
- type,
915
- isTop,
916
- isBottom,
917
- isLeft,
918
- isRight,
919
- isRow,
920
- positionPxArray,
921
- transform,
922
- transformOrigin,
923
- width,
924
- textArray,
925
- pxmm,
926
- data,
927
- bounding
928
- ];
757
+ $$self.$$.update = () => {
758
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
759
+ $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
760
+ ? void 0
761
+ : getLabelElement(room));
762
+ }
763
+ };
764
+
765
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
929
766
  }
930
767
 
931
- class RuleItem extends internal.SvelteComponent {
768
+ class RoomLabel extends internal.SvelteComponent {
932
769
  constructor(options) {
933
770
  super();
934
-
935
- internal.init(
936
- this,
937
- options,
938
- instance$c,
939
- create_fragment$c,
940
- internal.safe_not_equal,
941
- {
942
- pxmm: 11,
943
- type: 0,
944
- data: 12,
945
- bounding: 13
946
- },
947
- add_css$8
948
- );
771
+ internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$8);
949
772
  }
950
773
  }
951
774
 
952
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
775
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
953
776
 
954
- function get_each_context$2(ctx, list, i) {
777
+ function add_css$7(target) {
778
+ 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}");
779
+ }
780
+
781
+ function get_each_context$5(ctx, list, i) {
955
782
  const child_ctx = ctx.slice();
956
- child_ctx[7] = list[i][0];
957
- child_ctx[8] = list[i][1];
783
+ child_ctx[4] = list[i];
958
784
  return child_ctx;
959
785
  }
960
786
 
961
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
962
- function create_each_block$2(key_1, ctx) {
787
+ // (8:0) {#if rooms}
788
+ function create_if_block$3(ctx) {
789
+ let div;
790
+ let each_blocks = [];
791
+ let each_1_lookup = new Map();
792
+ let current;
793
+ let each_value = /*rooms*/ ctx[1];
794
+ const get_key = ctx => /*room*/ ctx[4].id;
795
+
796
+ for (let i = 0; i < each_value.length; i += 1) {
797
+ let child_ctx = get_each_context$5(ctx, each_value, i);
798
+ let key = get_key(child_ctx);
799
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
800
+ }
801
+
802
+ return {
803
+ c() {
804
+ div = internal.element("div");
805
+
806
+ for (let i = 0; i < each_blocks.length; i += 1) {
807
+ each_blocks[i].c();
808
+ }
809
+
810
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
811
+ },
812
+ m(target, anchor) {
813
+ internal.insert(target, div, anchor);
814
+
815
+ for (let i = 0; i < each_blocks.length; i += 1) {
816
+ each_blocks[i].m(div, null);
817
+ }
818
+
819
+ current = true;
820
+ },
821
+ p(ctx, dirty) {
822
+ if (dirty & /*rooms, getLabelElement*/ 3) {
823
+ each_value = /*rooms*/ ctx[1];
824
+ internal.group_outros();
825
+ 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);
826
+ internal.check_outros();
827
+ }
828
+ },
829
+ i(local) {
830
+ if (current) return;
831
+
832
+ for (let i = 0; i < each_value.length; i += 1) {
833
+ internal.transition_in(each_blocks[i]);
834
+ }
835
+
836
+ current = true;
837
+ },
838
+ o(local) {
839
+ for (let i = 0; i < each_blocks.length; i += 1) {
840
+ internal.transition_out(each_blocks[i]);
841
+ }
842
+
843
+ current = false;
844
+ },
845
+ d(detaching) {
846
+ if (detaching) internal.detach(div);
847
+
848
+ for (let i = 0; i < each_blocks.length; i += 1) {
849
+ each_blocks[i].d();
850
+ }
851
+ }
852
+ };
853
+ }
854
+
855
+ // (10:4) {#each rooms as room (room.id)}
856
+ function create_each_block$5(key_1, ctx) {
963
857
  let first;
964
- let ruleitem;
858
+ let roomlabel;
965
859
  let current;
966
860
 
967
- const ruleitem_spread_levels = [
861
+ const roomlabel_spread_levels = [
968
862
  {
969
- type: /*type*/ ctx[7],
970
- data: /*data*/ ctx[8],
971
- pxmm: /*pxmm*/ ctx[0],
972
- bounding: /*bounding*/ ctx[2]
863
+ room: /*room*/ ctx[4],
864
+ getLabelElement: /*getLabelElement*/ ctx[0]
973
865
  }
974
866
  ];
975
867
 
976
- let ruleitem_props = {};
868
+ let roomlabel_props = {};
977
869
 
978
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
979
- ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
870
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
871
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
980
872
  }
981
873
 
982
- ruleitem = new RuleItem({ props: ruleitem_props });
874
+ roomlabel = new RoomLabel({ props: roomlabel_props });
983
875
 
984
876
  return {
985
877
  key: key_1,
986
878
  first: null,
987
879
  c() {
988
880
  first = internal.empty();
989
- internal.create_component(ruleitem.$$.fragment);
881
+ internal.create_component(roomlabel.$$.fragment);
990
882
  this.first = first;
991
883
  },
992
884
  m(target, anchor) {
993
885
  internal.insert(target, first, anchor);
994
- internal.mount_component(ruleitem, target, anchor);
886
+ internal.mount_component(roomlabel, target, anchor);
995
887
  current = true;
996
888
  },
997
889
  p(new_ctx, dirty) {
998
890
  ctx = new_ctx;
999
891
 
1000
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
1001
- ? internal.get_spread_update(ruleitem_spread_levels, [
892
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
893
+ ? internal.get_spread_update(roomlabel_spread_levels, [
1002
894
  {
1003
- type: /*type*/ ctx[7],
1004
- data: /*data*/ ctx[8],
1005
- pxmm: /*pxmm*/ ctx[0],
1006
- bounding: /*bounding*/ ctx[2]
895
+ room: /*room*/ ctx[4],
896
+ getLabelElement: /*getLabelElement*/ ctx[0]
1007
897
  }
1008
898
  ])
1009
899
  : {};
1010
900
 
1011
- ruleitem.$set(ruleitem_changes);
901
+ roomlabel.$set(roomlabel_changes);
1012
902
  },
1013
903
  i(local) {
1014
904
  if (current) return;
1015
- internal.transition_in(ruleitem.$$.fragment, local);
905
+ internal.transition_in(roomlabel.$$.fragment, local);
1016
906
  current = true;
1017
907
  },
1018
908
  o(local) {
1019
- internal.transition_out(ruleitem.$$.fragment, local);
909
+ internal.transition_out(roomlabel.$$.fragment, local);
1020
910
  current = false;
1021
911
  },
1022
912
  d(detaching) {
1023
913
  if (detaching) internal.detach(first);
1024
- internal.destroy_component(ruleitem, detaching);
914
+ internal.destroy_component(roomlabel, detaching);
1025
915
  }
1026
916
  };
1027
917
  }
1028
918
 
1029
- function create_fragment$b(ctx) {
1030
- let div;
1031
- let each_blocks = [];
1032
- let each_1_lookup = new Map();
919
+ function create_fragment$a(ctx) {
920
+ let if_block_anchor;
1033
921
  let current;
1034
- let each_value = /*ruleLabelArray*/ ctx[1];
1035
- const get_key = ctx => /*type*/ ctx[7];
1036
-
1037
- for (let i = 0; i < each_value.length; i += 1) {
1038
- let child_ctx = get_each_context$2(ctx, each_value, i);
1039
- let key = get_key(child_ctx);
1040
- each_1_lookup.set(key, each_blocks[i] = create_each_block$2(key, child_ctx));
1041
- }
922
+ let if_block = /*rooms*/ ctx[1] && create_if_block$3(ctx);
1042
923
 
1043
924
  return {
1044
925
  c() {
1045
- div = internal.element("div");
1046
-
1047
- for (let i = 0; i < each_blocks.length; i += 1) {
1048
- each_blocks[i].c();
1049
- }
1050
-
1051
- internal.attr(div, "class", "floorplan-plugin__rulelabels");
926
+ if (if_block) if_block.c();
927
+ if_block_anchor = internal.empty();
1052
928
  },
1053
929
  m(target, anchor) {
1054
- internal.insert(target, div, anchor);
1055
-
1056
- for (let i = 0; i < each_blocks.length; i += 1) {
1057
- each_blocks[i].m(div, null);
1058
- }
1059
-
930
+ if (if_block) if_block.m(target, anchor);
931
+ internal.insert(target, if_block_anchor, anchor);
1060
932
  current = true;
1061
933
  },
1062
934
  p(ctx, [dirty]) {
1063
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
1064
- each_value = /*ruleLabelArray*/ ctx[1];
935
+ if (/*rooms*/ ctx[1]) {
936
+ if (if_block) {
937
+ if_block.p(ctx, dirty);
938
+
939
+ if (dirty & /*rooms*/ 2) {
940
+ internal.transition_in(if_block, 1);
941
+ }
942
+ } else {
943
+ if_block = create_if_block$3(ctx);
944
+ if_block.c();
945
+ internal.transition_in(if_block, 1);
946
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
947
+ }
948
+ } else if (if_block) {
1065
949
  internal.group_outros();
1066
- 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$2, null, get_each_context$2);
950
+
951
+ internal.transition_out(if_block, 1, 1, () => {
952
+ if_block = null;
953
+ });
954
+
1067
955
  internal.check_outros();
1068
956
  }
1069
957
  },
1070
958
  i(local) {
1071
959
  if (current) return;
1072
-
1073
- for (let i = 0; i < each_value.length; i += 1) {
1074
- internal.transition_in(each_blocks[i]);
1075
- }
1076
-
960
+ internal.transition_in(if_block);
1077
961
  current = true;
1078
962
  },
1079
963
  o(local) {
1080
- for (let i = 0; i < each_blocks.length; i += 1) {
1081
- internal.transition_out(each_blocks[i]);
1082
- }
1083
-
964
+ internal.transition_out(if_block);
1084
965
  current = false;
1085
966
  },
1086
967
  d(detaching) {
1087
- if (detaching) internal.detach(div);
1088
-
1089
- for (let i = 0; i < each_blocks.length; i += 1) {
1090
- each_blocks[i].d();
1091
- }
968
+ if (if_block) if_block.d(detaching);
969
+ if (detaching) internal.detach(if_block_anchor);
1092
970
  }
1093
971
  };
1094
972
  }
1095
973
 
1096
- function instance$b($$self, $$props, $$invalidate) {
1097
- let bounding;
1098
- let ruleLabelData;
1099
- let ruleLabelDataKeys;
1100
- let ruleLabelArray;
1101
- let { pxmm } = $$props;
974
+ function instance$a($$self, $$props, $$invalidate) {
975
+ let rooms;
1102
976
  let { floorIndex } = $$props;
1103
977
  let { floorplanData } = $$props;
978
+ let { getLabelElement } = $$props;
1104
979
 
1105
980
  $$self.$$set = $$props => {
1106
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
1107
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
1108
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
981
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
982
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
983
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
1109
984
  };
1110
985
 
1111
986
  $$self.$$.update = () => {
1112
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
1113
- $$invalidate(2, bounding = floorplanData.bounding);
1114
- }
1115
-
1116
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
1117
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1118
- }
1119
-
1120
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
1121
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
1122
- }
1123
-
1124
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
1125
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
987
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
988
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
1126
989
  }
1127
990
  };
1128
991
 
1129
- return [
1130
- pxmm,
1131
- ruleLabelArray,
1132
- bounding,
1133
- floorIndex,
1134
- floorplanData,
1135
- ruleLabelData,
1136
- ruleLabelDataKeys
1137
- ];
992
+ return [getLabelElement, rooms, floorIndex, floorplanData];
1138
993
  }
1139
994
 
1140
- class RuleLabels extends internal.SvelteComponent {
995
+ class RoomLabels extends internal.SvelteComponent {
1141
996
  constructor(options) {
1142
997
  super();
1143
- internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
998
+
999
+ internal.init(
1000
+ this,
1001
+ options,
1002
+ instance$a,
1003
+ create_fragment$a,
1004
+ internal.safe_not_equal,
1005
+ {
1006
+ floorIndex: 2,
1007
+ floorplanData: 3,
1008
+ getLabelElement: 0
1009
+ },
1010
+ add_css$7
1011
+ );
1144
1012
  }
1145
1013
  }
1146
1014
 
1147
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1015
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1148
1016
 
1149
- function add_css$7(target) {
1150
- internal.append_styles(target, "svelte-1cuuebb", "img.svelte-1cuuebb{width:100%;height:100%}");
1017
+ function add_css$6(target) {
1018
+ 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}");
1151
1019
  }
1152
1020
 
1153
- function create_fragment$a(ctx) {
1154
- let img;
1155
- let img_src_value;
1021
+ function get_each_context$4(ctx, list, i) {
1022
+ const child_ctx = ctx.slice();
1023
+ child_ctx[10] = list[i];
1024
+ child_ctx[12] = i;
1025
+ return child_ctx;
1026
+ }
1027
+
1028
+ function get_each_context_1(ctx, list, i) {
1029
+ const child_ctx = ctx.slice();
1030
+ child_ctx[13] = list[i];
1031
+ return child_ctx;
1032
+ }
1033
+
1034
+ // (53:4) {#each rulerLabels as rulerLabel}
1035
+ function create_each_block_1(ctx) {
1036
+ let div;
1156
1037
 
1157
1038
  return {
1158
1039
  c() {
1159
- img = internal.element("img");
1160
- if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1161
- internal.attr(img, "alt", "floorplan iamge");
1162
- internal.attr(img, "class", "svelte-1cuuebb");
1040
+ div = internal.element("div");
1041
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
1042
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
1043
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
1163
1044
  },
1164
1045
  m(target, anchor) {
1165
- internal.insert(target, img, anchor);
1166
- },
1167
- p(ctx, [dirty]) {
1168
- if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1169
- internal.attr(img, "src", img_src_value);
1170
- }
1046
+ internal.insert(target, div, anchor);
1171
1047
  },
1172
- i: internal.noop,
1173
- o: internal.noop,
1048
+ p: internal.noop,
1174
1049
  d(detaching) {
1175
- if (detaching) internal.detach(img);
1050
+ if (detaching) internal.detach(div);
1176
1051
  }
1177
1052
  };
1178
1053
  }
1179
1054
 
1180
- function instance$a($$self, $$props, $$invalidate) {
1181
- let { url } = $$props;
1055
+ // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
1056
+ function create_each_block$4(key_1, ctx) {
1057
+ let div1;
1058
+ let div0;
1059
+ let t0_value = /*textItem*/ ctx[10].distance + "";
1060
+ let t0;
1061
+ let t1;
1182
1062
 
1183
- $$self.$$set = $$props => {
1184
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
1063
+ return {
1064
+ key: key_1,
1065
+ first: null,
1066
+ c() {
1067
+ div1 = internal.element("div");
1068
+ div0 = internal.element("div");
1069
+ t0 = internal.text(t0_value);
1070
+ t1 = internal.space();
1071
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
1072
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
1073
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
1074
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
1075
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
1076
+ this.first = div1;
1077
+ },
1078
+ m(target, anchor) {
1079
+ internal.insert(target, div1, anchor);
1080
+ internal.append(div1, div0);
1081
+ internal.append(div0, t0);
1082
+ internal.append(div1, t1);
1083
+ },
1084
+ p(new_ctx, dirty) {
1085
+ ctx = new_ctx;
1086
+ },
1087
+ d(detaching) {
1088
+ if (detaching) internal.detach(div1);
1089
+ }
1185
1090
  };
1186
-
1187
- return [url];
1188
1091
  }
1189
1092
 
1190
- class Normalmage extends internal.SvelteComponent {
1191
- constructor(options) {
1192
- super();
1193
- internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { url: 0 }, add_css$7);
1194
- }
1195
- }
1093
+ function create_fragment$9(ctx) {
1094
+ let div3;
1095
+ let div0;
1096
+ let t0;
1097
+ let div1;
1098
+ let t1;
1099
+ let div2;
1100
+ let each_blocks = [];
1101
+ let each1_lookup = new Map();
1102
+ let div3_class_value;
1103
+ let each_value_1 = /*rulerLabels*/ ctx[2];
1104
+ let each_blocks_1 = [];
1196
1105
 
1197
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1106
+ for (let i = 0; i < each_value_1.length; i += 1) {
1107
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
1108
+ }
1198
1109
 
1199
- function add_css$6(target) {
1200
- internal.append_styles(target, "svelte-1qqy56u", ".floorplan-plugin__base-image.svelte-1qqy56u{width:100%;height:100%}");
1201
- }
1110
+ let each_value = /*rulerTexts*/ ctx[3];
1111
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
1202
1112
 
1203
- function create_fragment$9(ctx) {
1204
- let div;
1205
- let html_tag;
1206
- let t;
1207
- let html_tag_1;
1113
+ for (let i = 0; i < each_value.length; i += 1) {
1114
+ let child_ctx = get_each_context$4(ctx, each_value, i);
1115
+ let key = get_key(child_ctx);
1116
+ each1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
1117
+ }
1208
1118
 
1209
1119
  return {
1210
1120
  c() {
1211
- div = internal.element("div");
1212
- html_tag = new internal.HtmlTag();
1213
- t = internal.space();
1214
- html_tag_1 = new internal.HtmlTag();
1215
- html_tag.a = t;
1216
- html_tag_1.a = null;
1217
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-1qqy56u");
1121
+ div3 = internal.element("div");
1122
+ div0 = internal.element("div");
1123
+ t0 = internal.space();
1124
+ div1 = internal.element("div");
1125
+
1126
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1127
+ each_blocks_1[i].c();
1128
+ }
1129
+
1130
+ t1 = internal.space();
1131
+ div2 = internal.element("div");
1132
+
1133
+ for (let i = 0; i < each_blocks.length; i += 1) {
1134
+ each_blocks[i].c();
1135
+ }
1136
+
1137
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
1138
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
1139
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
1140
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
1141
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
1142
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1143
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1144
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1218
1145
  },
1219
1146
  m(target, anchor) {
1220
- internal.insert(target, div, anchor);
1221
- html_tag.m(/*svgStyle*/ ctx[1], div);
1222
- internal.append(div, t);
1223
- html_tag_1.m(/*content*/ ctx[0], div);
1147
+ internal.insert(target, div3, anchor);
1148
+ internal.append(div3, div0);
1149
+ internal.append(div3, t0);
1150
+ internal.append(div3, div1);
1151
+
1152
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1153
+ each_blocks_1[i].m(div1, null);
1154
+ }
1155
+
1156
+ internal.append(div3, t1);
1157
+ internal.append(div3, div2);
1158
+
1159
+ for (let i = 0; i < each_blocks.length; i += 1) {
1160
+ each_blocks[i].m(div2, null);
1161
+ }
1224
1162
  },
1225
1163
  p(ctx, [dirty]) {
1226
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1164
+ if (dirty & /*rulerLabels*/ 4) {
1165
+ each_value_1 = /*rulerLabels*/ ctx[2];
1166
+ let i;
1167
+
1168
+ for (i = 0; i < each_value_1.length; i += 1) {
1169
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
1170
+
1171
+ if (each_blocks_1[i]) {
1172
+ each_blocks_1[i].p(child_ctx, dirty);
1173
+ } else {
1174
+ each_blocks_1[i] = create_each_block_1(child_ctx);
1175
+ each_blocks_1[i].c();
1176
+ each_blocks_1[i].m(div1, null);
1177
+ }
1178
+ }
1179
+
1180
+ for (; i < each_blocks_1.length; i += 1) {
1181
+ each_blocks_1[i].d(1);
1182
+ }
1183
+
1184
+ each_blocks_1.length = each_value_1.length;
1185
+ }
1186
+
1187
+ if (dirty & /*rulerTexts, isRow*/ 10) {
1188
+ each_value = /*rulerTexts*/ ctx[3];
1189
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, internal.destroy_block, create_each_block$4, null, get_each_context$4);
1190
+ }
1191
+
1192
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
1193
+ internal.attr(div3, "class", div3_class_value);
1194
+ }
1195
+
1196
+ if (dirty & /*type, isRow*/ 3) {
1197
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1198
+ }
1227
1199
  },
1228
1200
  i: internal.noop,
1229
1201
  o: internal.noop,
1230
1202
  d(detaching) {
1231
- if (detaching) internal.detach(div);
1203
+ if (detaching) internal.detach(div3);
1204
+ internal.destroy_each(each_blocks_1, detaching);
1205
+
1206
+ for (let i = 0; i < each_blocks.length; i += 1) {
1207
+ each_blocks[i].d();
1208
+ }
1232
1209
  }
1233
1210
  };
1234
1211
  }
1235
1212
 
1213
+ const padding$1 = 1000;
1214
+ const exteriorWallOffset$1 = 180;
1215
+
1236
1216
  function instance$9($$self, $$props, $$invalidate) {
1237
- let { content } = $$props;
1217
+ let { type } = $$props;
1218
+ let { data } = $$props;
1219
+ let { bounding } = $$props;
1220
+ const isRow = type === 'top' || type === 'bottom';
1221
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
1222
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
1238
1223
 
1239
- const svgStyle = `
1240
- <style>
1241
- svg [type='lineGroup'] path {
1242
- fill: #ffffff;
1243
- stroke: #ffffff;
1244
- }
1245
- svg [type='lineItemGroup'] g g g g {
1246
- stroke: #ffffff;
1247
- }
1248
- </style>
1249
- `;
1224
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
1225
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
1226
+ // 筛除重复数据
1227
+ if (index === 0) return true;
1228
+
1229
+ return x !== arr[index - 1];
1230
+ });
1231
+
1232
+ const rulerLabels = rulerPoints.map(num => {
1233
+ const left = isRow
1234
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1235
+ : 0;
1236
+
1237
+ const bottom = !isRow
1238
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1239
+ : 0;
1240
+
1241
+ return { left, bottom };
1242
+ });
1243
+
1244
+ rulerLabels.unshift({ left: 0, bottom: 0 });
1245
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
1246
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
1247
+
1248
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
1249
+ const distance = index === 0 ? 0 : num - arr[index - 1];
1250
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
1251
+
1252
+ const left = isRow
1253
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1254
+ : 0;
1255
+
1256
+ const bottom = !isRow
1257
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1258
+ : 0;
1259
+
1260
+ return { left, bottom, distance };
1261
+ }).filter(({ distance }) => distance / length > 0.1);
1250
1262
 
1251
1263
  $$self.$$set = $$props => {
1252
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
1264
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
1265
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
1266
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
1253
1267
  };
1254
1268
 
1255
- return [content, svgStyle];
1269
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
1256
1270
  }
1257
1271
 
1258
- class SvgImage extends internal.SvelteComponent {
1272
+ class RuleItem extends internal.SvelteComponent {
1259
1273
  constructor(options) {
1260
1274
  super();
1261
- internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { content: 0 }, add_css$6);
1275
+ internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$6);
1262
1276
  }
1263
1277
  }
1264
1278
 
1265
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1279
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1266
1280
 
1267
1281
  function add_css$5(target) {
1268
- internal.append_styles(target, "svelte-126ja8e", ".floorplan-plugin__base-image.svelte-126ja8e{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1282
+ 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}");
1269
1283
  }
1270
1284
 
1271
- // (13:22)
1272
- function create_if_block_1$3(ctx) {
1273
- let normalimage;
1285
+ function get_each_context$3(ctx, list, i) {
1286
+ const child_ctx = ctx.slice();
1287
+ child_ctx[12] = list[i][0];
1288
+ child_ctx[13] = list[i][1];
1289
+ return child_ctx;
1290
+ }
1291
+
1292
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
1293
+ function create_each_block$3(key_1, ctx) {
1294
+ let first;
1295
+ let ruleitem;
1274
1296
  let current;
1275
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1276
1297
 
1277
- return {
1278
- c() {
1279
- internal.create_component(normalimage.$$.fragment);
1280
- },
1281
- m(target, anchor) {
1282
- internal.mount_component(normalimage, target, anchor);
1283
- current = true;
1284
- },
1285
- p(ctx, dirty) {
1286
- const normalimage_changes = {};
1287
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1288
- normalimage.$set(normalimage_changes);
1289
- },
1290
- i(local) {
1291
- if (current) return;
1292
- internal.transition_in(normalimage.$$.fragment, local);
1293
- current = true;
1294
- },
1295
- o(local) {
1296
- internal.transition_out(normalimage.$$.fragment, local);
1297
- current = false;
1298
- },
1299
- d(detaching) {
1300
- internal.destroy_component(normalimage, detaching);
1298
+ const ruleitem_spread_levels = [
1299
+ {
1300
+ type: /*type*/ ctx[12],
1301
+ data: /*data*/ ctx[13],
1302
+ bounding: /*bounding*/ ctx[0]
1301
1303
  }
1302
- };
1303
- }
1304
+ ];
1304
1305
 
1305
- // (11:2) {#if svgContent}
1306
- function create_if_block$3(ctx) {
1307
- let svgimage;
1308
- let current;
1306
+ let ruleitem_props = {};
1309
1307
 
1310
- svgimage = new SvgImage({
1311
- props: { content: /*svgContent*/ ctx[0] }
1312
- });
1308
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
1309
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
1310
+ }
1311
+
1312
+ ruleitem = new RuleItem({ props: ruleitem_props });
1313
1313
 
1314
1314
  return {
1315
+ key: key_1,
1316
+ first: null,
1315
1317
  c() {
1316
- internal.create_component(svgimage.$$.fragment);
1318
+ first = internal.empty();
1319
+ internal.create_component(ruleitem.$$.fragment);
1320
+ this.first = first;
1317
1321
  },
1318
1322
  m(target, anchor) {
1319
- internal.mount_component(svgimage, target, anchor);
1323
+ internal.insert(target, first, anchor);
1324
+ internal.mount_component(ruleitem, target, anchor);
1320
1325
  current = true;
1321
1326
  },
1322
- p(ctx, dirty) {
1323
- const svgimage_changes = {};
1324
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1325
- svgimage.$set(svgimage_changes);
1327
+ p(new_ctx, dirty) {
1328
+ ctx = new_ctx;
1329
+
1330
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
1331
+ ? internal.get_spread_update(ruleitem_spread_levels, [
1332
+ {
1333
+ type: /*type*/ ctx[12],
1334
+ data: /*data*/ ctx[13],
1335
+ bounding: /*bounding*/ ctx[0]
1336
+ }
1337
+ ])
1338
+ : {};
1339
+
1340
+ ruleitem.$set(ruleitem_changes);
1326
1341
  },
1327
1342
  i(local) {
1328
1343
  if (current) return;
1329
- internal.transition_in(svgimage.$$.fragment, local);
1344
+ internal.transition_in(ruleitem.$$.fragment, local);
1330
1345
  current = true;
1331
1346
  },
1332
1347
  o(local) {
1333
- internal.transition_out(svgimage.$$.fragment, local);
1348
+ internal.transition_out(ruleitem.$$.fragment, local);
1334
1349
  current = false;
1335
1350
  },
1336
1351
  d(detaching) {
1337
- internal.destroy_component(svgimage, detaching);
1352
+ if (detaching) internal.detach(first);
1353
+ internal.destroy_component(ruleitem, detaching);
1338
1354
  }
1339
1355
  };
1340
1356
  }
1341
1357
 
1342
1358
  function create_fragment$8(ctx) {
1343
1359
  let div;
1344
- let current_block_type_index;
1345
- let if_block;
1360
+ let each_blocks = [];
1361
+ let each_1_lookup = new Map();
1346
1362
  let current;
1347
- const if_block_creators = [create_if_block$3, create_if_block_1$3];
1348
- const if_blocks = [];
1349
-
1350
- function select_block_type(ctx, dirty) {
1351
- if (/*svgContent*/ ctx[0]) return 0;
1352
- if (/*imageData*/ ctx[1]) return 1;
1353
- return -1;
1354
- }
1363
+ let each_value = /*ruleLabelArray*/ ctx[3];
1364
+ const get_key = ctx => /*type*/ ctx[12];
1355
1365
 
1356
- if (~(current_block_type_index = select_block_type(ctx))) {
1357
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1366
+ for (let i = 0; i < each_value.length; i += 1) {
1367
+ let child_ctx = get_each_context$3(ctx, each_value, i);
1368
+ let key = get_key(child_ctx);
1369
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
1358
1370
  }
1359
1371
 
1360
1372
  return {
1361
1373
  c() {
1362
1374
  div = internal.element("div");
1363
- if (if_block) if_block.c();
1364
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-126ja8e");
1375
+
1376
+ for (let i = 0; i < each_blocks.length; i += 1) {
1377
+ each_blocks[i].c();
1378
+ }
1379
+
1380
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
1381
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1382
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1365
1383
  },
1366
1384
  m(target, anchor) {
1367
1385
  internal.insert(target, div, anchor);
1368
1386
 
1369
- if (~current_block_type_index) {
1370
- if_blocks[current_block_type_index].m(div, null);
1387
+ for (let i = 0; i < each_blocks.length; i += 1) {
1388
+ each_blocks[i].m(div, null);
1371
1389
  }
1372
1390
 
1373
1391
  current = true;
1374
1392
  },
1375
1393
  p(ctx, [dirty]) {
1376
- let previous_block_index = current_block_type_index;
1377
- current_block_type_index = select_block_type(ctx);
1378
-
1379
- if (current_block_type_index === previous_block_index) {
1380
- if (~current_block_type_index) {
1381
- if_blocks[current_block_type_index].p(ctx, dirty);
1382
- }
1383
- } else {
1384
- if (if_block) {
1385
- internal.group_outros();
1386
-
1387
- internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1388
- if_blocks[previous_block_index] = null;
1389
- });
1390
-
1391
- internal.check_outros();
1392
- }
1393
-
1394
- if (~current_block_type_index) {
1395
- if_block = if_blocks[current_block_type_index];
1394
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
1395
+ each_value = /*ruleLabelArray*/ ctx[3];
1396
+ internal.group_outros();
1397
+ 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$3, null, get_each_context$3);
1398
+ internal.check_outros();
1399
+ }
1396
1400
 
1397
- if (!if_block) {
1398
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1399
- if_block.c();
1400
- } else {
1401
- if_block.p(ctx, dirty);
1402
- }
1401
+ if (dirty & /*width*/ 4) {
1402
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1403
+ }
1403
1404
 
1404
- internal.transition_in(if_block, 1);
1405
- if_block.m(div, null);
1406
- } else {
1407
- if_block = null;
1408
- }
1405
+ if (dirty & /*height*/ 2) {
1406
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1409
1407
  }
1410
1408
  },
1411
1409
  i(local) {
1412
1410
  if (current) return;
1413
- internal.transition_in(if_block);
1411
+
1412
+ for (let i = 0; i < each_value.length; i += 1) {
1413
+ internal.transition_in(each_blocks[i]);
1414
+ }
1415
+
1414
1416
  current = true;
1415
1417
  },
1416
1418
  o(local) {
1417
- internal.transition_out(if_block);
1419
+ for (let i = 0; i < each_blocks.length; i += 1) {
1420
+ internal.transition_out(each_blocks[i]);
1421
+ }
1422
+
1418
1423
  current = false;
1419
1424
  },
1420
1425
  d(detaching) {
1421
1426
  if (detaching) internal.detach(div);
1422
1427
 
1423
- if (~current_block_type_index) {
1424
- if_blocks[current_block_type_index].d();
1428
+ for (let i = 0; i < each_blocks.length; i += 1) {
1429
+ each_blocks[i].d();
1425
1430
  }
1426
1431
  }
1427
1432
  };
1428
1433
  }
1429
1434
 
1435
+ const padding = 1000;
1436
+ const exteriorWallOffset = 180;
1437
+
1430
1438
  function instance$8($$self, $$props, $$invalidate) {
1431
- let imageData;
1432
- let svgContent;
1433
- var _a, _b;
1439
+ let bounding;
1440
+ let ruleLabelData;
1441
+ let ruleLabelDataKeys;
1442
+ let ruleLabelArray;
1443
+ let boundingWidth;
1444
+ let boundingHeight;
1445
+ let contentWidth;
1446
+ let contentHeight;
1447
+ let width;
1448
+ let height;
1434
1449
  let { floorIndex } = $$props;
1435
1450
  let { floorplanData } = $$props;
1436
1451
 
1437
1452
  $$self.$$set = $$props => {
1438
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1439
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1453
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
1454
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
1440
1455
  };
1441
1456
 
1442
1457
  $$self.$$.update = () => {
1443
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1444
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1458
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
1459
+ $$invalidate(0, bounding = floorplanData.bounding);
1445
1460
  }
1446
1461
 
1447
- if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
1448
- $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
1449
- ? void 0
1450
- : _a[floorIndex]) === null || _b === void 0
1451
- ? void 0
1452
- : _b.svgContent);
1462
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
1463
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1464
+ }
1465
+
1466
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
1467
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
1468
+ }
1469
+
1470
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
1471
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
1472
+ }
1473
+
1474
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1475
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
1476
+ }
1477
+
1478
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1479
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
1480
+ }
1481
+
1482
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1483
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
1484
+ }
1485
+
1486
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1487
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
1488
+ }
1489
+
1490
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
1491
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
1492
+ }
1493
+
1494
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
1495
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
1453
1496
  }
1454
1497
  };
1455
1498
 
1456
- return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
1499
+ return [
1500
+ bounding,
1501
+ height,
1502
+ width,
1503
+ ruleLabelArray,
1504
+ floorIndex,
1505
+ floorplanData,
1506
+ boundingHeight,
1507
+ contentHeight,
1508
+ boundingWidth,
1509
+ contentWidth,
1510
+ ruleLabelData,
1511
+ ruleLabelDataKeys
1512
+ ];
1457
1513
  }
1458
1514
 
1459
- class BaseImage extends internal.SvelteComponent {
1515
+ class RuleLabels extends internal.SvelteComponent {
1460
1516
  constructor(options) {
1461
1517
  super();
1462
- internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$5);
1518
+ internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$5);
1463
1519
  }
1464
1520
  }
1465
1521
 
@@ -1484,9 +1540,9 @@ function pathD(points, options = {}) {
1484
1540
  return d + (needZ ? 'Z' : '');
1485
1541
  }
1486
1542
  /** 把户型图上点点位转换到 SVG 上的点位 */
1487
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
1543
+ function formatFloorplanPoint({ x, y }, bounding) {
1488
1544
  const { max, min } = bounding;
1489
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
1545
+ return { x: x - min.x, y: max.y - y };
1490
1546
  }
1491
1547
 
1492
1548
  /* src/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte generated by Svelte v3.47.0 */
@@ -1756,20 +1812,20 @@ class RoomMaterial_2 extends internal.SvelteComponent {
1756
1812
  /* src/floorplan/Components/RoomMaterials/RoomMaterial.svelte generated by Svelte v3.47.0 */
1757
1813
 
1758
1814
  function add_css$4(target) {
1759
- internal.append_styles(target, "svelte-1b0icjc", "svg.svelte-1b0icjc{position:absolute;width:100%;height:100%;overflow:visible}");
1815
+ internal.append_styles(target, "svelte-1d4xj70", "svg.svelte-1d4xj70{position:absolute;width:100%;height:100%;overflow:visible}");
1760
1816
  }
1761
1817
 
1762
- function get_each_context$1(ctx, list, i) {
1818
+ function get_each_context$2(ctx, list, i) {
1763
1819
  const child_ctx = ctx.slice();
1764
- child_ctx[4] = list[i];
1820
+ child_ctx[5] = list[i];
1765
1821
  return child_ctx;
1766
1822
  }
1767
1823
 
1768
- // (18:6) {:else}
1824
+ // (19:6) {:else}
1769
1825
  function create_else_block(ctx) {
1770
1826
  let roommaterial_1;
1771
1827
  let current;
1772
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
1828
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
1773
1829
 
1774
1830
  return {
1775
1831
  c() {
@@ -1781,7 +1837,7 @@ function create_else_block(ctx) {
1781
1837
  },
1782
1838
  p(ctx, dirty) {
1783
1839
  const roommaterial_1_changes = {};
1784
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
1840
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
1785
1841
  roommaterial_1.$set(roommaterial_1_changes);
1786
1842
  },
1787
1843
  i(local) {
@@ -1799,11 +1855,11 @@ function create_else_block(ctx) {
1799
1855
  };
1800
1856
  }
1801
1857
 
1802
- // (16:37)
1858
+ // (17:37)
1803
1859
  function create_if_block_1$2(ctx) {
1804
1860
  let roommaterial_2;
1805
1861
  let current;
1806
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
1862
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
1807
1863
 
1808
1864
  return {
1809
1865
  c() {
@@ -1815,7 +1871,7 @@ function create_if_block_1$2(ctx) {
1815
1871
  },
1816
1872
  p(ctx, dirty) {
1817
1873
  const roommaterial_2_changes = {};
1818
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
1874
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
1819
1875
  roommaterial_2.$set(roommaterial_2_changes);
1820
1876
  },
1821
1877
  i(local) {
@@ -1833,11 +1889,11 @@ function create_if_block_1$2(ctx) {
1833
1889
  };
1834
1890
  }
1835
1891
 
1836
- // (14:6) {#if room.floorType === 1}
1892
+ // (15:6) {#if room.floorType === 1}
1837
1893
  function create_if_block$2(ctx) {
1838
1894
  let roommaterial_0;
1839
1895
  let current;
1840
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
1896
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
1841
1897
 
1842
1898
  return {
1843
1899
  c() {
@@ -1849,7 +1905,7 @@ function create_if_block$2(ctx) {
1849
1905
  },
1850
1906
  p(ctx, dirty) {
1851
1907
  const roommaterial_0_changes = {};
1852
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
1908
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
1853
1909
  roommaterial_0.$set(roommaterial_0_changes);
1854
1910
  },
1855
1911
  i(local) {
@@ -1867,18 +1923,19 @@ function create_if_block$2(ctx) {
1867
1923
  };
1868
1924
  }
1869
1925
 
1870
- // (12:2) {#each rooms as room}
1871
- function create_each_block$1(ctx) {
1926
+ // (13:2) {#each rooms as room}
1927
+ function create_each_block$2(ctx) {
1872
1928
  let svg;
1873
1929
  let current_block_type_index;
1874
1930
  let if_block;
1931
+ let svg_viewBox_value;
1875
1932
  let current;
1876
1933
  const if_block_creators = [create_if_block$2, create_if_block_1$2, create_else_block];
1877
1934
  const if_blocks = [];
1878
1935
 
1879
1936
  function select_block_type(ctx, dirty) {
1880
- if (/*room*/ ctx[4].floorType === 1) return 0;
1881
- if (/*room*/ ctx[4].floorType === 0) return 1;
1937
+ if (/*room*/ ctx[5].floorType === 1) return 0;
1938
+ if (/*room*/ ctx[5].floorType === 0) return 1;
1882
1939
  return 2;
1883
1940
  }
1884
1941
 
@@ -1889,7 +1946,10 @@ function create_each_block$1(ctx) {
1889
1946
  c() {
1890
1947
  svg = internal.svg_element("svg");
1891
1948
  if_block.c();
1892
- internal.attr(svg, "class", "svelte-1b0icjc");
1949
+ internal.attr(svg, "width", "100%");
1950
+ internal.attr(svg, "height", "100%");
1951
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
1952
+ internal.attr(svg, "class", "svelte-1d4xj70");
1893
1953
  },
1894
1954
  m(target, anchor) {
1895
1955
  internal.insert(target, svg, anchor);
@@ -1946,7 +2006,7 @@ function create_fragment$4(ctx) {
1946
2006
  let each_blocks = [];
1947
2007
 
1948
2008
  for (let i = 0; i < each_value.length; i += 1) {
1949
- each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
2009
+ each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
1950
2010
  }
1951
2011
 
1952
2012
  const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
@@ -1973,18 +2033,18 @@ function create_fragment$4(ctx) {
1973
2033
  current = true;
1974
2034
  },
1975
2035
  p(ctx, [dirty]) {
1976
- if (dirty & /*rooms*/ 1) {
2036
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
1977
2037
  each_value = /*rooms*/ ctx[0];
1978
2038
  let i;
1979
2039
 
1980
2040
  for (i = 0; i < each_value.length; i += 1) {
1981
- const child_ctx = get_each_context$1(ctx, each_value, i);
2041
+ const child_ctx = get_each_context$2(ctx, each_value, i);
1982
2042
 
1983
2043
  if (each_blocks[i]) {
1984
2044
  each_blocks[i].p(child_ctx, dirty);
1985
2045
  internal.transition_in(each_blocks[i], 1);
1986
2046
  } else {
1987
- each_blocks[i] = create_each_block$1(child_ctx);
2047
+ each_blocks[i] = create_each_block$2(child_ctx);
1988
2048
  each_blocks[i].c();
1989
2049
  internal.transition_in(each_blocks[i], 1);
1990
2050
  each_blocks[i].m(div, null);
@@ -2028,37 +2088,37 @@ function create_fragment$4(ctx) {
2028
2088
  function instance$4($$self, $$props, $$invalidate) {
2029
2089
  let rooms;
2030
2090
  let { floorIndex } = $$props;
2031
- let { pxmm } = $$props;
2032
2091
  let { floorplanData } = $$props;
2092
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2093
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2033
2094
 
2034
2095
  $$self.$$set = $$props => {
2035
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2036
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
2037
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2096
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2097
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2038
2098
  };
2039
2099
 
2040
2100
  $$self.$$.update = () => {
2041
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
2101
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2042
2102
  $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
2043
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
2103
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
2044
2104
  })));
2045
2105
  }
2046
2106
  };
2047
2107
 
2048
- return [rooms, floorIndex, pxmm, floorplanData];
2108
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
2049
2109
  }
2050
2110
 
2051
2111
  class RoomMaterial extends internal.SvelteComponent {
2052
2112
  constructor(options) {
2053
2113
  super();
2054
- internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$4);
2114
+ internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$4);
2055
2115
  }
2056
2116
  }
2057
2117
 
2058
2118
  /* src/floorplan/Components/RoomHighlight/Room.svelte generated by Svelte v3.47.0 */
2059
2119
 
2060
2120
  function add_css$3(target) {
2061
- internal.append_styles(target, "svelte-11takew", "path.svelte-11takew{opacity:0}path.svelte-11takew:hover{opacity:0.1}");
2121
+ internal.append_styles(target, "svelte-19uvvss", "path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}");
2062
2122
  }
2063
2123
 
2064
2124
  function create_fragment$3(ctx) {
@@ -2069,7 +2129,7 @@ function create_fragment$3(ctx) {
2069
2129
  path = internal.svg_element("path");
2070
2130
  internal.attr(path, "d", /*_pathD*/ ctx[0]);
2071
2131
  internal.attr(path, "fill", `#fff`);
2072
- internal.attr(path, "class", "svelte-11takew");
2132
+ internal.attr(path, "class", "svelte-19uvvss");
2073
2133
  },
2074
2134
  m(target, anchor) {
2075
2135
  internal.insert(target, path, anchor);
@@ -2084,55 +2144,52 @@ function create_fragment$3(ctx) {
2084
2144
  }
2085
2145
 
2086
2146
  function instance$3($$self, $$props, $$invalidate) {
2087
- let { pxmm } = $$props;
2088
2147
  let { room } = $$props;
2089
2148
  let { floorplanData } = $$props;
2090
2149
  const { bounding } = floorplanData;
2091
2150
 
2092
2151
  const _pathD = pathD(room.path, {
2093
2152
  needZ: true,
2094
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
2153
+ format: vector => formatFloorplanPoint(vector, bounding)
2095
2154
  });
2096
2155
 
2097
2156
  $$self.$$set = $$props => {
2098
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
2099
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
2100
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2157
+ if ('room' in $$props) $$invalidate(1, room = $$props.room);
2158
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
2101
2159
  };
2102
2160
 
2103
- return [_pathD, pxmm, room, floorplanData];
2161
+ return [_pathD, room, floorplanData];
2104
2162
  }
2105
2163
 
2106
2164
  class Room extends internal.SvelteComponent {
2107
2165
  constructor(options) {
2108
2166
  super();
2109
- internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$3);
2167
+ internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { room: 1, floorplanData: 2 }, add_css$3);
2110
2168
  }
2111
2169
  }
2112
2170
 
2113
2171
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
2114
2172
 
2115
2173
  function add_css$2(target) {
2116
- internal.append_styles(target, "svelte-1aais5l", ".floorplan-plugin__room-highlight.svelte-1aais5l{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-1aais5l{width:100%;height:100%;overflow:visible}");
2174
+ 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}");
2117
2175
  }
2118
2176
 
2119
- function get_each_context(ctx, list, i) {
2177
+ function get_each_context$1(ctx, list, i) {
2120
2178
  const child_ctx = ctx.slice();
2121
- child_ctx[12] = list[i];
2179
+ child_ctx[4] = list[i];
2122
2180
  return child_ctx;
2123
2181
  }
2124
2182
 
2125
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2126
- function create_each_block(key_1, ctx) {
2183
+ // (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2184
+ function create_each_block$1(key_1, ctx) {
2127
2185
  let first;
2128
2186
  let room;
2129
2187
  let current;
2130
2188
 
2131
2189
  const room_spread_levels = [
2132
2190
  {
2133
- room: /*room*/ ctx[12],
2134
- floorplanData: /*floorplanData*/ ctx[2],
2135
- pxmm: /*pxmm*/ ctx[0]
2191
+ room: /*room*/ ctx[4],
2192
+ floorplanData: /*floorplanData*/ ctx[1]
2136
2193
  }
2137
2194
  ];
2138
2195
 
@@ -2160,12 +2217,11 @@ function create_each_block(key_1, ctx) {
2160
2217
  p(new_ctx, dirty) {
2161
2218
  ctx = new_ctx;
2162
2219
 
2163
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
2220
+ const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
2164
2221
  ? internal.get_spread_update(room_spread_levels, [
2165
2222
  {
2166
- room: /*room*/ ctx[12],
2167
- floorplanData: /*floorplanData*/ ctx[2],
2168
- pxmm: /*pxmm*/ ctx[0]
2223
+ room: /*room*/ ctx[4],
2224
+ floorplanData: /*floorplanData*/ ctx[1]
2169
2225
  }
2170
2226
  ])
2171
2227
  : {};
@@ -2193,17 +2249,14 @@ function create_fragment$2(ctx) {
2193
2249
  let svg;
2194
2250
  let each_blocks = [];
2195
2251
  let each_1_lookup = new Map();
2196
- let div_resize_listener;
2197
2252
  let current;
2198
- let mounted;
2199
- let dispose;
2200
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2201
- const get_key = ctx => /*room*/ ctx[12].id;
2253
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2254
+ const get_key = ctx => /*room*/ ctx[4].id;
2202
2255
 
2203
2256
  for (let i = 0; i < each_value.length; i += 1) {
2204
- let child_ctx = get_each_context(ctx, each_value, i);
2257
+ let child_ctx = get_each_context$1(ctx, each_value, i);
2205
2258
  let key = get_key(child_ctx);
2206
- each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
2259
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx));
2207
2260
  }
2208
2261
 
2209
2262
  return {
@@ -2215,9 +2268,11 @@ function create_fragment$2(ctx) {
2215
2268
  each_blocks[i].c();
2216
2269
  }
2217
2270
 
2218
- internal.attr(svg, "class", "svelte-1aais5l");
2219
- internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1aais5l");
2220
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
2271
+ internal.attr(svg, "width", "100%");
2272
+ internal.attr(svg, "height", "100%");
2273
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
2274
+ internal.attr(svg, "class", "svelte-1kqo6e4");
2275
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
2221
2276
  },
2222
2277
  m(target, anchor) {
2223
2278
  internal.insert(target, div, anchor);
@@ -2227,20 +2282,13 @@ function create_fragment$2(ctx) {
2227
2282
  each_blocks[i].m(svg, null);
2228
2283
  }
2229
2284
 
2230
- /*div_binding*/ ctx[9](div);
2231
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
2232
2285
  current = true;
2233
-
2234
- if (!mounted) {
2235
- dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
2236
- mounted = true;
2237
- }
2238
2286
  },
2239
2287
  p(ctx, [dirty]) {
2240
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
2241
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2288
+ if (dirty & /*floorplanData, floorIndex*/ 3) {
2289
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2242
2290
  internal.group_outros();
2243
- 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, null, get_each_context);
2291
+ 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$1, null, get_each_context$1);
2244
2292
  internal.check_outros();
2245
2293
  }
2246
2294
  },
@@ -2266,127 +2314,46 @@ function create_fragment$2(ctx) {
2266
2314
  for (let i = 0; i < each_blocks.length; i += 1) {
2267
2315
  each_blocks[i].d();
2268
2316
  }
2269
-
2270
- /*div_binding*/ ctx[9](null);
2271
- div_resize_listener();
2272
- mounted = false;
2273
- dispose();
2274
2317
  }
2275
2318
  };
2276
2319
  }
2277
2320
 
2278
2321
  function instance$2($$self, $$props, $$invalidate) {
2279
- let { five } = $$props;
2280
- let { pxmm } = $$props;
2281
2322
  let { floorIndex } = $$props;
2282
2323
  let { floorplanData } = $$props;
2283
- let { onRoomHeightClick } = $$props;
2284
- let clientWidth;
2285
- let clientHeight;
2286
- let highlightContainerDom;
2287
- const { observers: floorplan_observers } = floorplanData;
2288
-
2289
- const handleClick = function (e) {
2290
- if ((onRoomHeightClick === null || onRoomHeightClick === void 0
2291
- ? void 0
2292
- : onRoomHeightClick(e)) === false) return;
2293
-
2294
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
2295
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
2296
-
2297
- const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
2298
- const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
2299
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
2300
-
2301
- // px 转换为 百分比
2302
- const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
2303
-
2304
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
2305
- const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
2306
- const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
2307
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
2308
- })[0];
2309
-
2310
- five.moveToPano(closestPoint.index);
2311
- };
2312
-
2313
- function div_binding($$value) {
2314
- internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
2315
- highlightContainerDom = $$value;
2316
- $$invalidate(5, highlightContainerDom);
2317
- });
2318
- }
2319
-
2320
- function div_elementresize_handler() {
2321
- clientWidth = this.clientWidth;
2322
- clientHeight = this.clientHeight;
2323
- $$invalidate(3, clientWidth);
2324
- $$invalidate(4, clientHeight);
2325
- }
2324
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2325
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2326
2326
 
2327
2327
  $$self.$$set = $$props => {
2328
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
2329
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2330
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2331
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
2332
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
2328
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
2329
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
2333
2330
  };
2334
2331
 
2335
- return [
2336
- pxmm,
2337
- floorIndex,
2338
- floorplanData,
2339
- clientWidth,
2340
- clientHeight,
2341
- highlightContainerDom,
2342
- handleClick,
2343
- five,
2344
- onRoomHeightClick,
2345
- div_binding,
2346
- div_elementresize_handler
2347
- ];
2332
+ return [floorIndex, floorplanData, boundingWidth, boundingHeight];
2348
2333
  }
2349
2334
 
2350
2335
  class RoomHighlight extends internal.SvelteComponent {
2351
2336
  constructor(options) {
2352
2337
  super();
2353
-
2354
- internal.init(
2355
- this,
2356
- options,
2357
- instance$2,
2358
- create_fragment$2,
2359
- internal.safe_not_equal,
2360
- {
2361
- five: 7,
2362
- pxmm: 0,
2363
- floorIndex: 1,
2364
- floorplanData: 2,
2365
- onRoomHeightClick: 8
2366
- },
2367
- add_css$2
2368
- );
2338
+ internal.init(this, options, instance$2, create_fragment$2, internal.safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$2);
2369
2339
  }
2370
2340
  }
2371
2341
 
2372
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
2342
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
2373
2343
 
2374
2344
  function add_css$1(target) {
2375
- internal.append_styles(target, "svelte-3pdgs4", ".floorplan-current-floor.svelte-3pdgs4{position:relative;width:100%;height:100%}");
2345
+ 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}");
2376
2346
  }
2377
2347
 
2378
- // (19:2) {#if hoverEnable}
2348
+ // (17:2) {#if hoverEnable}
2379
2349
  function create_if_block_2(ctx) {
2380
2350
  let roomhighlight;
2381
2351
  let current;
2382
2352
 
2383
2353
  const roomhighlight_spread_levels = [
2384
2354
  {
2385
- five: /*five*/ ctx[1],
2386
- pxmm: /*pxmm*/ ctx[0],
2387
- floorIndex: /*floorIndex*/ ctx[2],
2388
- floorplanData: /*floorplanData*/ ctx[6],
2389
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2355
+ floorIndex: /*floorIndex*/ ctx[1],
2356
+ floorplanData: /*floorplanData*/ ctx[5]
2390
2357
  }
2391
2358
  ];
2392
2359
 
@@ -2407,14 +2374,11 @@ function create_if_block_2(ctx) {
2407
2374
  current = true;
2408
2375
  },
2409
2376
  p(ctx, dirty) {
2410
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
2377
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData*/ 34)
2411
2378
  ? internal.get_spread_update(roomhighlight_spread_levels, [
2412
2379
  {
2413
- five: /*five*/ ctx[1],
2414
- pxmm: /*pxmm*/ ctx[0],
2415
- floorIndex: /*floorIndex*/ ctx[2],
2416
- floorplanData: /*floorplanData*/ ctx[6],
2417
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2380
+ floorIndex: /*floorIndex*/ ctx[1],
2381
+ floorplanData: /*floorplanData*/ ctx[5]
2418
2382
  }
2419
2383
  ])
2420
2384
  : {};
@@ -2436,16 +2400,16 @@ function create_if_block_2(ctx) {
2436
2400
  };
2437
2401
  }
2438
2402
 
2439
- // (23:2) {#if roomLabelsEnable}
2403
+ // (21:2) {#if roomLabelsEnable}
2440
2404
  function create_if_block_1$1(ctx) {
2441
2405
  let roomlabels;
2442
2406
  let current;
2443
2407
 
2444
2408
  const roomlabels_spread_levels = [
2445
2409
  {
2446
- floorplanData: /*floorplanData*/ ctx[6],
2447
- floorIndex: /*floorIndex*/ ctx[2],
2448
- getLabelElement: /*getLabelElement*/ ctx[8]
2410
+ floorplanData: /*floorplanData*/ ctx[5],
2411
+ floorIndex: /*floorIndex*/ ctx[1],
2412
+ getLabelElement: /*getLabelElement*/ ctx[6]
2449
2413
  }
2450
2414
  ];
2451
2415
 
@@ -2466,12 +2430,12 @@ function create_if_block_1$1(ctx) {
2466
2430
  current = true;
2467
2431
  },
2468
2432
  p(ctx, dirty) {
2469
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
2433
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 98)
2470
2434
  ? internal.get_spread_update(roomlabels_spread_levels, [
2471
2435
  {
2472
- floorplanData: /*floorplanData*/ ctx[6],
2473
- floorIndex: /*floorIndex*/ ctx[2],
2474
- getLabelElement: /*getLabelElement*/ ctx[8]
2436
+ floorplanData: /*floorplanData*/ ctx[5],
2437
+ floorIndex: /*floorIndex*/ ctx[1],
2438
+ getLabelElement: /*getLabelElement*/ ctx[6]
2475
2439
  }
2476
2440
  ])
2477
2441
  : {};
@@ -2493,16 +2457,15 @@ function create_if_block_1$1(ctx) {
2493
2457
  };
2494
2458
  }
2495
2459
 
2496
- // (26:2) {#if ruleLabelsEnable}
2460
+ // (24:2) {#if ruleLabelsEnable}
2497
2461
  function create_if_block$1(ctx) {
2498
2462
  let rulelabels;
2499
2463
  let current;
2500
2464
 
2501
2465
  const rulelabels_spread_levels = [
2502
2466
  {
2503
- floorplanData: /*floorplanData*/ ctx[6],
2504
- floorIndex: /*floorIndex*/ ctx[2],
2505
- pxmm: /*pxmm*/ ctx[0]
2467
+ floorplanData: /*floorplanData*/ ctx[5],
2468
+ floorIndex: /*floorIndex*/ ctx[1]
2506
2469
  }
2507
2470
  ];
2508
2471
 
@@ -2523,12 +2486,11 @@ function create_if_block$1(ctx) {
2523
2486
  current = true;
2524
2487
  },
2525
2488
  p(ctx, dirty) {
2526
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
2489
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2527
2490
  ? internal.get_spread_update(rulelabels_spread_levels, [
2528
2491
  {
2529
- floorplanData: /*floorplanData*/ ctx[6],
2530
- floorIndex: /*floorIndex*/ ctx[2],
2531
- pxmm: /*pxmm*/ ctx[0]
2492
+ floorplanData: /*floorplanData*/ ctx[5],
2493
+ floorIndex: /*floorIndex*/ ctx[1]
2532
2494
  }
2533
2495
  ])
2534
2496
  : {};
@@ -2558,13 +2520,13 @@ function create_fragment$1(ctx) {
2558
2520
  let baseimage;
2559
2521
  let t2;
2560
2522
  let t3;
2523
+ let div_class_value;
2561
2524
  let current;
2562
2525
 
2563
2526
  const roommaterial_spread_levels = [
2564
2527
  {
2565
- floorIndex: /*floorIndex*/ ctx[2],
2566
- floorplanData: /*floorplanData*/ ctx[6],
2567
- pxmm: /*pxmm*/ ctx[0]
2528
+ floorIndex: /*floorIndex*/ ctx[1],
2529
+ floorplanData: /*floorplanData*/ ctx[5]
2568
2530
  }
2569
2531
  ];
2570
2532
 
@@ -2575,12 +2537,12 @@ function create_fragment$1(ctx) {
2575
2537
  }
2576
2538
 
2577
2539
  roommaterial = new RoomMaterial({ props: roommaterial_props });
2578
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
2540
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
2579
2541
 
2580
2542
  const baseimage_spread_levels = [
2581
2543
  {
2582
- floorplanData: /*floorplanData*/ ctx[6],
2583
- floorIndex: /*floorIndex*/ ctx[2]
2544
+ floorplanData: /*floorplanData*/ ctx[5],
2545
+ floorIndex: /*floorIndex*/ ctx[1]
2584
2546
  }
2585
2547
  ];
2586
2548
 
@@ -2591,8 +2553,8 @@ function create_fragment$1(ctx) {
2591
2553
  }
2592
2554
 
2593
2555
  baseimage = new BaseImage({ props: baseimage_props });
2594
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
2595
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$1(ctx);
2556
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
2557
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$1(ctx);
2596
2558
 
2597
2559
  return {
2598
2560
  c() {
@@ -2606,7 +2568,10 @@ function create_fragment$1(ctx) {
2606
2568
  if (if_block1) if_block1.c();
2607
2569
  t3 = internal.space();
2608
2570
  if (if_block2) if_block2.c();
2609
- internal.attr(div, "class", "floorplan-current-floor svelte-3pdgs4");
2571
+
2572
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2573
+ ? ' floorplan-plugin__floor--is-current'
2574
+ : ''}`) + " svelte-bl8zrz"));
2610
2575
  },
2611
2576
  m(target, anchor) {
2612
2577
  internal.insert(target, div, anchor);
@@ -2622,23 +2587,22 @@ function create_fragment$1(ctx) {
2622
2587
  current = true;
2623
2588
  },
2624
2589
  p(ctx, [dirty]) {
2625
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
2590
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
2626
2591
  ? internal.get_spread_update(roommaterial_spread_levels, [
2627
2592
  {
2628
- floorIndex: /*floorIndex*/ ctx[2],
2629
- floorplanData: /*floorplanData*/ ctx[6],
2630
- pxmm: /*pxmm*/ ctx[0]
2593
+ floorIndex: /*floorIndex*/ ctx[1],
2594
+ floorplanData: /*floorplanData*/ ctx[5]
2631
2595
  }
2632
2596
  ])
2633
2597
  : {};
2634
2598
 
2635
2599
  roommaterial.$set(roommaterial_changes);
2636
2600
 
2637
- if (/*hoverEnable*/ ctx[3]) {
2601
+ if (/*hoverEnable*/ ctx[2]) {
2638
2602
  if (if_block0) {
2639
2603
  if_block0.p(ctx, dirty);
2640
2604
 
2641
- if (dirty & /*hoverEnable*/ 8) {
2605
+ if (dirty & /*hoverEnable*/ 4) {
2642
2606
  internal.transition_in(if_block0, 1);
2643
2607
  }
2644
2608
  } else {
@@ -2657,22 +2621,22 @@ function create_fragment$1(ctx) {
2657
2621
  internal.check_outros();
2658
2622
  }
2659
2623
 
2660
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
2624
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2661
2625
  ? internal.get_spread_update(baseimage_spread_levels, [
2662
2626
  {
2663
- floorplanData: /*floorplanData*/ ctx[6],
2664
- floorIndex: /*floorIndex*/ ctx[2]
2627
+ floorplanData: /*floorplanData*/ ctx[5],
2628
+ floorIndex: /*floorIndex*/ ctx[1]
2665
2629
  }
2666
2630
  ])
2667
2631
  : {};
2668
2632
 
2669
2633
  baseimage.$set(baseimage_changes);
2670
2634
 
2671
- if (/*roomLabelsEnable*/ ctx[4]) {
2635
+ if (/*roomLabelsEnable*/ ctx[3]) {
2672
2636
  if (if_block1) {
2673
2637
  if_block1.p(ctx, dirty);
2674
2638
 
2675
- if (dirty & /*roomLabelsEnable*/ 16) {
2639
+ if (dirty & /*roomLabelsEnable*/ 8) {
2676
2640
  internal.transition_in(if_block1, 1);
2677
2641
  }
2678
2642
  } else {
@@ -2691,11 +2655,11 @@ function create_fragment$1(ctx) {
2691
2655
  internal.check_outros();
2692
2656
  }
2693
2657
 
2694
- if (/*ruleLabelsEnable*/ ctx[5]) {
2658
+ if (/*ruleLabelsEnable*/ ctx[4]) {
2695
2659
  if (if_block2) {
2696
2660
  if_block2.p(ctx, dirty);
2697
2661
 
2698
- if (dirty & /*ruleLabelsEnable*/ 32) {
2662
+ if (dirty & /*ruleLabelsEnable*/ 16) {
2699
2663
  internal.transition_in(if_block2, 1);
2700
2664
  }
2701
2665
  } else {
@@ -2713,6 +2677,12 @@ function create_fragment$1(ctx) {
2713
2677
 
2714
2678
  internal.check_outros();
2715
2679
  }
2680
+
2681
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2682
+ ? ' floorplan-plugin__floor--is-current'
2683
+ : ''}`) + " svelte-bl8zrz"))) {
2684
+ internal.attr(div, "class", div_class_value);
2685
+ }
2716
2686
  },
2717
2687
  i(local) {
2718
2688
  if (current) return;
@@ -2743,37 +2713,31 @@ function create_fragment$1(ctx) {
2743
2713
  }
2744
2714
 
2745
2715
  function instance$1($$self, $$props, $$invalidate) {
2746
- let { pxmm } = $$props;
2747
- let { five } = $$props;
2716
+ let { isCurrent } = $$props;
2748
2717
  let { floorIndex } = $$props;
2749
2718
  let { hoverEnable } = $$props;
2750
2719
  let { roomLabelsEnable } = $$props;
2751
2720
  let { ruleLabelsEnable } = $$props;
2752
2721
  let { floorplanData } = $$props;
2753
- let { onRoomHeightClick } = $$props;
2754
2722
  let { getLabelElement } = $$props;
2755
2723
 
2756
2724
  $$self.$$set = $$props => {
2757
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2758
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
2759
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2760
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
2761
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
2762
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
2763
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
2764
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
2765
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
2725
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
2726
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2727
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
2728
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
2729
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
2730
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
2731
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
2766
2732
  };
2767
2733
 
2768
2734
  return [
2769
- pxmm,
2770
- five,
2735
+ isCurrent,
2771
2736
  floorIndex,
2772
2737
  hoverEnable,
2773
2738
  roomLabelsEnable,
2774
2739
  ruleLabelsEnable,
2775
2740
  floorplanData,
2776
- onRoomHeightClick,
2777
2741
  getLabelElement
2778
2742
  ];
2779
2743
  }
@@ -2789,65 +2753,56 @@ class CurrentFloor extends internal.SvelteComponent {
2789
2753
  create_fragment$1,
2790
2754
  internal.safe_not_equal,
2791
2755
  {
2792
- pxmm: 0,
2793
- five: 1,
2794
- floorIndex: 2,
2795
- hoverEnable: 3,
2796
- roomLabelsEnable: 4,
2797
- ruleLabelsEnable: 5,
2798
- floorplanData: 6,
2799
- onRoomHeightClick: 7,
2800
- getLabelElement: 8
2756
+ isCurrent: 0,
2757
+ floorIndex: 1,
2758
+ hoverEnable: 2,
2759
+ roomLabelsEnable: 3,
2760
+ ruleLabelsEnable: 4,
2761
+ floorplanData: 5,
2762
+ getLabelElement: 6
2801
2763
  },
2802
2764
  add_css$1
2803
2765
  );
2804
2766
  }
2805
2767
  }
2806
2768
 
2807
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
2769
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
2808
2770
 
2809
2771
  function add_css(target) {
2810
- internal.append_styles(target, "svelte-177x2q7", ".floorplan-main.svelte-177x2q7{width:100%;height:100%}");
2772
+ internal.append_styles(target, "svelte-q5wdnn", ".floorplan-main.svelte-q5wdnn{width:100%;height:100%}");
2773
+ }
2774
+
2775
+ function get_each_context(ctx, list, i) {
2776
+ const child_ctx = ctx.slice();
2777
+ child_ctx[13] = list[i];
2778
+ return child_ctx;
2811
2779
  }
2812
2780
 
2813
- // (24:0) {#if visible}
2781
+ // (21:0) {#if visible}
2814
2782
  function create_if_block(ctx) {
2815
2783
  let div;
2816
- let currentfloor;
2817
2784
  let t0;
2818
2785
  let camera;
2819
2786
  let t1;
2820
2787
  let div_intro;
2821
2788
  let current;
2789
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
2790
+ let each_blocks = [];
2822
2791
 
2823
- const currentfloor_spread_levels = [
2824
- {
2825
- five: /*five*/ ctx[2],
2826
- pxmm: /*pxmm*/ ctx[1],
2827
- floorIndex: /*floorIndex*/ ctx[6],
2828
- hoverEnable: /*hoverEnable*/ ctx[7],
2829
- floorplanData: /*floorplanData*/ ctx[11],
2830
- getLabelElement: /*getLabelElement*/ ctx[15],
2831
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
2832
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
2833
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
2834
- }
2835
- ];
2836
-
2837
- let currentfloor_props = {};
2838
-
2839
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
2840
- currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
2792
+ for (let i = 0; i < each_value.length; i += 1) {
2793
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
2841
2794
  }
2842
2795
 
2843
- currentfloor = new CurrentFloor({ props: currentfloor_props });
2796
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
2797
+ each_blocks[i] = null;
2798
+ });
2844
2799
 
2845
2800
  const camera_spread_levels = [
2846
2801
  {
2847
- panoIndex: /*panoIndex*/ ctx[5],
2848
- floorplanData: /*floorplanData*/ ctx[11],
2849
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
2850
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
2802
+ panoIndex: /*panoIndex*/ ctx[3],
2803
+ floorplanData: /*floorplanData*/ ctx[9],
2804
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
2805
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
2851
2806
  }
2852
2807
  ];
2853
2808
 
@@ -2858,21 +2813,29 @@ function create_if_block(ctx) {
2858
2813
  }
2859
2814
 
2860
2815
  camera = new Camera({ props: camera_props });
2861
- let if_block = /*compassEnable*/ ctx[8] && create_if_block_1(ctx);
2816
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
2862
2817
 
2863
2818
  return {
2864
2819
  c() {
2865
2820
  div = internal.element("div");
2866
- internal.create_component(currentfloor.$$.fragment);
2821
+
2822
+ for (let i = 0; i < each_blocks.length; i += 1) {
2823
+ each_blocks[i].c();
2824
+ }
2825
+
2867
2826
  t0 = internal.space();
2868
2827
  internal.create_component(camera.$$.fragment);
2869
2828
  t1 = internal.space();
2870
2829
  if (if_block) if_block.c();
2871
- internal.attr(div, "class", "floorplan-main svelte-177x2q7");
2830
+ internal.attr(div, "class", "floorplan-main svelte-q5wdnn");
2872
2831
  },
2873
2832
  m(target, anchor) {
2874
2833
  internal.insert(target, div, anchor);
2875
- internal.mount_component(currentfloor, div, null);
2834
+
2835
+ for (let i = 0; i < each_blocks.length; i += 1) {
2836
+ each_blocks[i].m(div, null);
2837
+ }
2838
+
2876
2839
  internal.append(div, t0);
2877
2840
  internal.mount_component(camera, div, null);
2878
2841
  internal.append(div, t1);
@@ -2882,42 +2845,51 @@ function create_if_block(ctx) {
2882
2845
  p(new_ctx, dirty) {
2883
2846
  ctx = new_ctx;
2884
2847
 
2885
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 52934)
2886
- ? internal.get_spread_update(currentfloor_spread_levels, [
2887
- {
2888
- five: /*five*/ ctx[2],
2889
- pxmm: /*pxmm*/ ctx[1],
2890
- floorIndex: /*floorIndex*/ ctx[6],
2891
- hoverEnable: /*hoverEnable*/ ctx[7],
2892
- floorplanData: /*floorplanData*/ ctx[11],
2893
- getLabelElement: /*getLabelElement*/ ctx[15],
2894
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
2895
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
2896
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
2848
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040) {
2849
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
2850
+ let i;
2851
+
2852
+ for (i = 0; i < each_value.length; i += 1) {
2853
+ const child_ctx = get_each_context(ctx, each_value, i);
2854
+
2855
+ if (each_blocks[i]) {
2856
+ each_blocks[i].p(child_ctx, dirty);
2857
+ internal.transition_in(each_blocks[i], 1);
2858
+ } else {
2859
+ each_blocks[i] = create_each_block(child_ctx);
2860
+ each_blocks[i].c();
2861
+ internal.transition_in(each_blocks[i], 1);
2862
+ each_blocks[i].m(div, t0);
2897
2863
  }
2898
- ])
2899
- : {};
2864
+ }
2900
2865
 
2901
- currentfloor.$set(currentfloor_changes);
2866
+ internal.group_outros();
2867
+
2868
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
2869
+ out(i);
2870
+ }
2871
+
2872
+ internal.check_outros();
2873
+ }
2902
2874
 
2903
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 14368)
2875
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
2904
2876
  ? internal.get_spread_update(camera_spread_levels, [
2905
2877
  {
2906
- panoIndex: /*panoIndex*/ ctx[5],
2907
- floorplanData: /*floorplanData*/ ctx[11],
2908
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
2909
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
2878
+ panoIndex: /*panoIndex*/ ctx[3],
2879
+ floorplanData: /*floorplanData*/ ctx[9],
2880
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
2881
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
2910
2882
  }
2911
2883
  ])
2912
2884
  : {};
2913
2885
 
2914
2886
  camera.$set(camera_changes);
2915
2887
 
2916
- if (/*compassEnable*/ ctx[8]) {
2888
+ if (/*compassEnable*/ ctx[6]) {
2917
2889
  if (if_block) {
2918
2890
  if_block.p(ctx, dirty);
2919
2891
 
2920
- if (dirty & /*compassEnable*/ 256) {
2892
+ if (dirty & /*compassEnable*/ 64) {
2921
2893
  internal.transition_in(if_block, 1);
2922
2894
  }
2923
2895
  } else {
@@ -2938,14 +2910,18 @@ function create_if_block(ctx) {
2938
2910
  },
2939
2911
  i(local) {
2940
2912
  if (current) return;
2941
- internal.transition_in(currentfloor.$$.fragment, local);
2913
+
2914
+ for (let i = 0; i < each_value.length; i += 1) {
2915
+ internal.transition_in(each_blocks[i]);
2916
+ }
2917
+
2942
2918
  internal.transition_in(camera.$$.fragment, local);
2943
2919
  internal.transition_in(if_block);
2944
2920
 
2945
2921
  if (!div_intro) {
2946
2922
  internal.add_render_callback(() => {
2947
2923
  div_intro = internal.create_in_transition(div, transition.fade, {
2948
- duration: /*duration*/ ctx[3],
2924
+ duration: /*duration*/ ctx[0],
2949
2925
  easing: easing.linear
2950
2926
  });
2951
2927
 
@@ -2956,29 +2932,107 @@ function create_if_block(ctx) {
2956
2932
  current = true;
2957
2933
  },
2958
2934
  o(local) {
2959
- internal.transition_out(currentfloor.$$.fragment, local);
2935
+ each_blocks = each_blocks.filter(Boolean);
2936
+
2937
+ for (let i = 0; i < each_blocks.length; i += 1) {
2938
+ internal.transition_out(each_blocks[i]);
2939
+ }
2940
+
2960
2941
  internal.transition_out(camera.$$.fragment, local);
2961
2942
  internal.transition_out(if_block);
2962
2943
  current = false;
2963
2944
  },
2964
2945
  d(detaching) {
2965
2946
  if (detaching) internal.detach(div);
2966
- internal.destroy_component(currentfloor);
2947
+ internal.destroy_each(each_blocks, detaching);
2967
2948
  internal.destroy_component(camera);
2968
2949
  if (if_block) if_block.d();
2969
2950
  }
2970
2951
  };
2971
2952
  }
2972
2953
 
2973
- // (40:4) {#if compassEnable}
2954
+ // (23:4) {#each floorplanData.floorDatas as floorData}
2955
+ function create_each_block(ctx) {
2956
+ let currentfloor;
2957
+ let current;
2958
+
2959
+ const currentfloor_spread_levels = [
2960
+ {
2961
+ hoverEnable: /*hoverEnable*/ ctx[5],
2962
+ floorplanData: /*floorplanData*/ ctx[9],
2963
+ getLabelElement: /*getLabelElement*/ ctx[12],
2964
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
2965
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
2966
+ },
2967
+ {
2968
+ floorIndex: /*floorData*/ ctx[13].floorIndex
2969
+ },
2970
+ {
2971
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
2972
+ }
2973
+ ];
2974
+
2975
+ let currentfloor_props = {};
2976
+
2977
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
2978
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
2979
+ }
2980
+
2981
+ currentfloor = new CurrentFloor({ props: currentfloor_props });
2982
+
2983
+ return {
2984
+ c() {
2985
+ internal.create_component(currentfloor.$$.fragment);
2986
+ },
2987
+ m(target, anchor) {
2988
+ internal.mount_component(currentfloor, target, anchor);
2989
+ current = true;
2990
+ },
2991
+ p(ctx, dirty) {
2992
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040)
2993
+ ? internal.get_spread_update(currentfloor_spread_levels, [
2994
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable*/ 5024 && {
2995
+ hoverEnable: /*hoverEnable*/ ctx[5],
2996
+ floorplanData: /*floorplanData*/ ctx[9],
2997
+ getLabelElement: /*getLabelElement*/ ctx[12],
2998
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
2999
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
3000
+ },
3001
+ dirty & /*floorplanData*/ 512 && {
3002
+ floorIndex: /*floorData*/ ctx[13].floorIndex
3003
+ },
3004
+ dirty & /*floorplanData, floorIndex*/ 528 && {
3005
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
3006
+ }
3007
+ ])
3008
+ : {};
3009
+
3010
+ currentfloor.$set(currentfloor_changes);
3011
+ },
3012
+ i(local) {
3013
+ if (current) return;
3014
+ internal.transition_in(currentfloor.$$.fragment, local);
3015
+ current = true;
3016
+ },
3017
+ o(local) {
3018
+ internal.transition_out(currentfloor.$$.fragment, local);
3019
+ current = false;
3020
+ },
3021
+ d(detaching) {
3022
+ internal.destroy_component(currentfloor, detaching);
3023
+ }
3024
+ };
3025
+ }
3026
+
3027
+ // (37:4) {#if compassEnable}
2974
3028
  function create_if_block_1(ctx) {
2975
3029
  let compass;
2976
3030
  let current;
2977
3031
 
2978
3032
  compass = new Compass({
2979
3033
  props: {
2980
- floorplanData: /*floorplanData*/ ctx[11],
2981
- northDesc: /*northDesc*/ ctx[0]
3034
+ floorplanData: /*floorplanData*/ ctx[9],
3035
+ northDesc: /*northDesc*/ ctx[2]
2982
3036
  }
2983
3037
  });
2984
3038
 
@@ -2992,8 +3046,8 @@ function create_if_block_1(ctx) {
2992
3046
  },
2993
3047
  p(ctx, dirty) {
2994
3048
  const compass_changes = {};
2995
- if (dirty & /*floorplanData*/ 2048) compass_changes.floorplanData = /*floorplanData*/ ctx[11];
2996
- if (dirty & /*northDesc*/ 1) compass_changes.northDesc = /*northDesc*/ ctx[0];
3049
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
3050
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
2997
3051
  compass.$set(compass_changes);
2998
3052
  },
2999
3053
  i(local) {
@@ -3014,7 +3068,7 @@ function create_if_block_1(ctx) {
3014
3068
  function create_fragment(ctx) {
3015
3069
  let if_block_anchor;
3016
3070
  let current;
3017
- let if_block = /*visible*/ ctx[4] && create_if_block(ctx);
3071
+ let if_block = /*visible*/ ctx[1] && create_if_block(ctx);
3018
3072
 
3019
3073
  return {
3020
3074
  c() {
@@ -3027,11 +3081,11 @@ function create_fragment(ctx) {
3027
3081
  current = true;
3028
3082
  },
3029
3083
  p(ctx, [dirty]) {
3030
- if (/*visible*/ ctx[4]) {
3084
+ if (/*visible*/ ctx[1]) {
3031
3085
  if (if_block) {
3032
3086
  if_block.p(ctx, dirty);
3033
3087
 
3034
- if (dirty & /*visible*/ 16) {
3088
+ if (dirty & /*visible*/ 2) {
3035
3089
  internal.transition_in(if_block, 1);
3036
3090
  }
3037
3091
  } else {
@@ -3067,11 +3121,9 @@ function create_fragment(ctx) {
3067
3121
  }
3068
3122
 
3069
3123
  function instance($$self, $$props, $$invalidate) {
3070
- let { northDesc } = $$props;
3071
- let { pxmm } = $$props;
3072
- let { five } = $$props;
3073
3124
  let { duration = 0 } = $$props;
3074
3125
  let { visible } = $$props;
3126
+ let { northDesc } = $$props;
3075
3127
  let { panoIndex } = $$props;
3076
3128
  let { floorIndex } = $$props;
3077
3129
  let { hoverEnable } = $$props;
@@ -3081,34 +3133,28 @@ function instance($$self, $$props, $$invalidate) {
3081
3133
  let { floorplanData } = $$props;
3082
3134
  let { lastPanoramaLongitude } = $$props;
3083
3135
  let { cameraImageUrl } = $$props;
3084
- let { onRoomHeightClick } = $$props;
3085
3136
  let { getLabelElement } = $$props;
3086
3137
 
3087
3138
  $$self.$$set = $$props => {
3088
- if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
3089
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
3090
- if ('five' in $$props) $$invalidate(2, five = $$props.five);
3091
- if ('duration' in $$props) $$invalidate(3, duration = $$props.duration);
3092
- if ('visible' in $$props) $$invalidate(4, visible = $$props.visible);
3093
- if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
3094
- if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
3095
- if ('hoverEnable' in $$props) $$invalidate(7, hoverEnable = $$props.hoverEnable);
3096
- if ('compassEnable' in $$props) $$invalidate(8, compassEnable = $$props.compassEnable);
3097
- if ('roomLabelsEnable' in $$props) $$invalidate(9, roomLabelsEnable = $$props.roomLabelsEnable);
3098
- if ('ruleLabelsEnable' in $$props) $$invalidate(10, ruleLabelsEnable = $$props.ruleLabelsEnable);
3099
- if ('floorplanData' in $$props) $$invalidate(11, floorplanData = $$props.floorplanData);
3100
- if ('lastPanoramaLongitude' in $$props) $$invalidate(12, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3101
- if ('cameraImageUrl' in $$props) $$invalidate(13, cameraImageUrl = $$props.cameraImageUrl);
3102
- if ('onRoomHeightClick' in $$props) $$invalidate(14, onRoomHeightClick = $$props.onRoomHeightClick);
3103
- if ('getLabelElement' in $$props) $$invalidate(15, getLabelElement = $$props.getLabelElement);
3139
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
3140
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
3141
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
3142
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
3143
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
3144
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
3145
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
3146
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
3147
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
3148
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
3149
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3150
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
3151
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
3104
3152
  };
3105
3153
 
3106
3154
  return [
3107
- northDesc,
3108
- pxmm,
3109
- five,
3110
3155
  duration,
3111
3156
  visible,
3157
+ northDesc,
3112
3158
  panoIndex,
3113
3159
  floorIndex,
3114
3160
  hoverEnable,
@@ -3118,7 +3164,6 @@ function instance($$self, $$props, $$invalidate) {
3118
3164
  floorplanData,
3119
3165
  lastPanoramaLongitude,
3120
3166
  cameraImageUrl,
3121
- onRoomHeightClick,
3122
3167
  getLabelElement
3123
3168
  ];
3124
3169
  }
@@ -3134,68 +3179,41 @@ class Main extends internal.SvelteComponent {
3134
3179
  create_fragment,
3135
3180
  internal.safe_not_equal,
3136
3181
  {
3137
- northDesc: 0,
3138
- pxmm: 1,
3139
- five: 2,
3140
- duration: 3,
3141
- visible: 4,
3142
- panoIndex: 5,
3143
- floorIndex: 6,
3144
- hoverEnable: 7,
3145
- compassEnable: 8,
3146
- roomLabelsEnable: 9,
3147
- ruleLabelsEnable: 10,
3148
- floorplanData: 11,
3149
- lastPanoramaLongitude: 12,
3150
- cameraImageUrl: 13,
3151
- onRoomHeightClick: 14,
3152
- getLabelElement: 15
3182
+ duration: 0,
3183
+ visible: 1,
3184
+ northDesc: 2,
3185
+ panoIndex: 3,
3186
+ floorIndex: 4,
3187
+ hoverEnable: 5,
3188
+ compassEnable: 6,
3189
+ roomLabelsEnable: 7,
3190
+ ruleLabelsEnable: 8,
3191
+ floorplanData: 9,
3192
+ lastPanoramaLongitude: 10,
3193
+ cameraImageUrl: 11,
3194
+ getLabelElement: 12
3153
3195
  },
3154
3196
  add_css
3155
3197
  );
3156
3198
  }
3157
3199
  }
3158
3200
 
3159
- /**
3160
- * 传入一个 Promise
3161
- * 无异常,返回 [null, data]
3162
- * 有异常,则返回 [Error, undefined]
3163
- * 用于替代 try&catch 处理 await 异常的方案
3164
- */
3165
- function to(promise) {
3166
- return __awaiter(this, void 0, void 0, function* () {
3167
- try {
3168
- const data = yield promise;
3169
- return [null, data];
3170
- }
3171
- catch (error) {
3172
- if (error instanceof Error)
3173
- return [error, null];
3174
- return [new Error(''), null];
3175
- }
3176
- });
3177
- }
3178
-
3179
- function formatOutlines(outlines) {
3180
- return __awaiter(this, void 0, void 0, function* () {
3181
- const headers = new Headers({ 'Content-Type': 'text/plain' });
3182
- const getOutlineItem = function (item) {
3183
- return __awaiter(this, void 0, void 0, function* () {
3184
- const outlineItem = {
3185
- index: item.index,
3186
- url: item.url,
3187
- svgUrl: item.svg_url,
3188
- };
3189
- if (item.svg_url) {
3190
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
3191
- outlineItem.svgContent = svgContent;
3192
- }
3193
- return outlineItem;
3194
- });
3201
+ async function formatOutlines(outlines) {
3202
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
3203
+ const getOutlineItem = async function (item) {
3204
+ const outlineItem = {
3205
+ index: item.index,
3206
+ url: item.url,
3207
+ svgUrl: item.svg_url,
3195
3208
  };
3196
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
3197
- return svgOutlineItems;
3198
- });
3209
+ if (item.svg_url) {
3210
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
3211
+ outlineItem.svgContent = svgContent;
3212
+ }
3213
+ return outlineItem;
3214
+ };
3215
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
3216
+ return svgOutlineItems;
3199
3217
  }
3200
3218
  function formatRoom(data) {
3201
3219
  const floorplanRoomItem = {
@@ -3241,21 +3259,19 @@ function formatFloorplanEntrance(data) {
3241
3259
  };
3242
3260
  return floorplanEntrance;
3243
3261
  }
3244
- function formatData(data) {
3245
- return __awaiter(this, void 0, void 0, function* () {
3246
- const outlines = yield formatOutlines(data.outlines);
3247
- const bounding = data.computed_data.bounding;
3248
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
3249
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
3250
- const floorplanData = {
3251
- outlines,
3252
- entrance,
3253
- bounding,
3254
- floorDatas,
3255
- observers: data.computed_data.observers.map(formateFloorplanObserver),
3256
- };
3257
- return floorplanData;
3258
- });
3262
+ async function formatData(data) {
3263
+ const outlines = await formatOutlines(data.outlines);
3264
+ const bounding = data.computed_data.bounding;
3265
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
3266
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
3267
+ const floorplanData = {
3268
+ outlines,
3269
+ entrance,
3270
+ bounding,
3271
+ floorDatas,
3272
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
3273
+ };
3274
+ return floorplanData;
3259
3275
  }
3260
3276
 
3261
3277
  /**
@@ -3403,38 +3419,21 @@ function getPxmm(five, container, floorIndex, options) {
3403
3419
  return pxmm;
3404
3420
  }
3405
3421
 
3406
- function changeMode(five, ...changeModeParams) {
3407
- return __awaiter(this, void 0, void 0, function* () {
3408
- const [changeModeError] = yield to(five.changeMode(...changeModeParams));
3409
- if (changeModeError)
3410
- throw changeModeError;
3411
- yield new Promise((reslove, reject) => {
3412
- five.once('initAnimationEnded', reslove);
3413
- const handleModeChange = (mode) => {
3414
- if (mode !== changeModeParams[0])
3415
- reject('changeMode 被中断');
3416
- five.off('modeChange', handleModeChange);
3417
- };
3418
- five.on('modeChange', handleModeChange);
3419
- });
3422
+ async function changeMode(five, ...changeModeParams) {
3423
+ const [changeModeError] = await to(five.changeMode(...changeModeParams));
3424
+ if (changeModeError)
3425
+ throw changeModeError;
3426
+ await new Promise((reslove, reject) => {
3427
+ five.once('initAnimationEnded', reslove);
3428
+ const handleModeChange = (mode) => {
3429
+ if (mode !== changeModeParams[0])
3430
+ reject('changeMode 被中断');
3431
+ five.off('modeChange', handleModeChange);
3432
+ };
3433
+ five.on('modeChange', handleModeChange);
3420
3434
  });
3421
3435
  }
3422
3436
 
3423
- var FloorplanErrorType;
3424
- (function (FloorplanErrorType) {
3425
- FloorplanErrorType["UnknownError"] = "UnknowError";
3426
- FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
3427
- FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
3428
- FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
3429
- FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
3430
- FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
3431
- FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
3432
- })(FloorplanErrorType || (FloorplanErrorType = {}));
3433
- /** 户型图展示 & 模型消失的默认时间 */
3434
- const SHOW_ANIME_DURATION = 500;
3435
- /** Five camera 默认 fov */
3436
- const FIVE_CAMERA_DEFAULT_FOV = 80;
3437
-
3438
3437
  /**
3439
3438
  * 比较两个数字近似相等
3440
3439
  * @param num1 数字1
@@ -3461,32 +3460,30 @@ function checkShowState(five$1, showState) {
3461
3460
  * 2. 内置了相应的动画时间计算
3462
3461
  * 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
3463
3462
  */
3464
- function correctFiveState(five$1, showState, userAction = true) {
3465
- return __awaiter(this, void 0, void 0, function* () {
3466
- // 当前已满足状态,不需要变更
3463
+ async function correctFiveState(five$1, showState, userAction = true) {
3464
+ // 当前已满足状态,不需要变更
3465
+ const result = checkShowState(five$1, showState);
3466
+ if (result === true)
3467
+ return;
3468
+ // 纠正 mode
3469
+ if (five$1.currentMode !== five.Five.Mode.Floorplan) {
3470
+ const [changeModeError] = await to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
3471
+ if (changeModeError)
3472
+ throw changeModeError;
3473
+ // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
3467
3474
  const result = checkShowState(five$1, showState);
3468
- if (result === true)
3469
- return;
3470
- // 纠正 mode
3471
- if (five$1.currentMode !== five.Five.Mode.Floorplan) {
3472
- const [changeModeError] = yield to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
3473
- if (changeModeError)
3474
- throw changeModeError;
3475
- // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
3476
- const result = checkShowState(five$1, showState);
3477
- if (result === false)
3478
- throw new Error(FloorplanErrorType.ChangeModeError);
3479
- return;
3480
- }
3481
- // 纠正相机状态
3482
- // 根据 latitude、longitude、fov 计算动画时间,最多 1s
3483
- const { latitude, longitude, fov } = five$1.getCurrentState();
3484
- 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));
3485
- const [updateCameraError] = yield to(five$1.updateCamera(showState, time, userAction));
3486
- if (updateCameraError)
3487
- throw new Error(FloorplanErrorType.UpdateCameraError);
3475
+ if (result === false)
3476
+ throw new Error(FloorplanErrorType.ChangeModeError);
3488
3477
  return;
3489
- });
3478
+ }
3479
+ // 纠正相机状态
3480
+ // 根据 latitude、longitude、fov 计算动画时间,最多 1s
3481
+ const { latitude, longitude, fov } = five$1.getCurrentState();
3482
+ 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));
3483
+ const [updateCameraError] = await to(five$1.updateCamera(showState, time, userAction));
3484
+ if (updateCameraError)
3485
+ throw new Error(FloorplanErrorType.UpdateCameraError);
3486
+ return;
3490
3487
  }
3491
3488
 
3492
3489
  function changeModelCanvasOpacity(five, opacity, duration = 300) {
@@ -3505,35 +3502,6 @@ function changeModelCanvasOpacity(five, opacity, duration = 300) {
3505
3502
  });
3506
3503
  }
3507
3504
 
3508
- /**
3509
- * 把第一个参数传入第二个参数(函数)中并执行
3510
- * 一般用于执行函数后返回变量。
3511
- * @param {any} something
3512
- * @param {function} callback
3513
- * @return {any}
3514
- */
3515
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3516
- function tap(something, callback) {
3517
- callback(something);
3518
- return something;
3519
- }
3520
-
3521
- /**
3522
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
3523
- * @param object
3524
- * @param props 排除的属性
3525
- * @return
3526
- */
3527
- function omit(object, props) {
3528
- return tap({}, (result) => {
3529
- for (const name in object) {
3530
- if (props.indexOf(name) !== -1)
3531
- continue;
3532
- result[name] = object[name];
3533
- }
3534
- });
3535
- }
3536
-
3537
3505
  const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
3538
3506
  class ModelFloorplanPluginController {
3539
3507
  constructor(five$1, params) {
@@ -3720,12 +3688,12 @@ class ModelFloorplanPluginController {
3720
3688
  enumerable: true,
3721
3689
  configurable: true,
3722
3690
  writable: true,
3723
- value: (opts) => __awaiter(this, void 0, void 0, function* () {
3724
- var _b, _c;
3691
+ value: async (opts) => {
3692
+ var _a, _b;
3725
3693
  // 已经在展示中了
3726
3694
  if (!this.showPromise && this.visible)
3727
3695
  return true;
3728
- if (!((_b = this.five.model) === null || _b === void 0 ? void 0 : _b.loaded))
3696
+ if (!((_a = this.five.model) === null || _a === void 0 ? void 0 : _a.loaded))
3729
3697
  throw new Error(FloorplanErrorType.ModelNotLoaded);
3730
3698
  if (!this.floorplanData)
3731
3699
  throw new Error(FloorplanErrorType.DataNotLoaded);
@@ -3735,18 +3703,18 @@ class ModelFloorplanPluginController {
3735
3703
  if (!!this.showPromise && sameWithLastOpts)
3736
3704
  return this.showPromise;
3737
3705
  if (!!this.showPromise && !sameWithLastOpts)
3738
- (_c = this.showRejection) === null || _c === void 0 ? void 0 : _c.call(this, FloorplanErrorType.DifferentShowParams);
3706
+ (_b = this.showRejection) === null || _b === void 0 ? void 0 : _b.call(this, FloorplanErrorType.DifferentShowParams);
3739
3707
  }
3740
3708
  this.ModelFloorplanPluginsShowOpts = opts;
3741
- const getShowPromise = () => __awaiter(this, void 0, void 0, function* () {
3742
- var _d, _e;
3709
+ const getShowPromise = async () => {
3710
+ var _a, _b;
3743
3711
  let hasRejected = false;
3744
3712
  let externalErrorMsg;
3745
3713
  this.showRejection = (errorMsg) => {
3746
3714
  hasRejected = true;
3747
3715
  externalErrorMsg = errorMsg;
3748
3716
  };
3749
- const [correctError] = yield to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
3717
+ const [correctError] = await to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
3750
3718
  if (correctError)
3751
3719
  throw correctError;
3752
3720
  // 异步结束要判断当前是不是被中断了,是不是调用了隐藏
@@ -3765,7 +3733,7 @@ class ModelFloorplanPluginController {
3765
3733
  this.floorIndex = opts.floorIndex;
3766
3734
  this.five.model.show(this.floorIndex);
3767
3735
  // 模型消失, 渲染户型图
3768
- 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;
3736
+ 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;
3769
3737
  const renderDuration = (opts === null || opts === void 0 ? void 0 : opts.immediately) ? 0 : SHOW_ANIME_DURATION;
3770
3738
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
3771
3739
  this.render(renderDuration);
@@ -3773,7 +3741,7 @@ class ModelFloorplanPluginController {
3773
3741
  this.five.on('wantsGesture', this.handleWantsGesture);
3774
3742
  this.five.on('wantsTapGesture', this.handleWantsTapGesture);
3775
3743
  return true;
3776
- });
3744
+ };
3777
3745
  const showPromise = getShowPromise()
3778
3746
  .then(() => {
3779
3747
  var _a;
@@ -3795,7 +3763,7 @@ class ModelFloorplanPluginController {
3795
3763
  });
3796
3764
  this.showPromise = showPromise;
3797
3765
  return showPromise;
3798
- })
3766
+ }
3799
3767
  });
3800
3768
  /** 隐藏户型图 */
3801
3769
  Object.defineProperty(this, "hide", {
@@ -3825,8 +3793,13 @@ class ModelFloorplanPluginController {
3825
3793
  configurable: true,
3826
3794
  writable: true,
3827
3795
  value: (shownFloor) => {
3828
- if (shownFloor === null)
3796
+ if (this.floorIndex === shownFloor)
3829
3797
  return;
3798
+ if (shownFloor === null) {
3799
+ const panoIndex = this.five.getCurrentState().panoIndex;
3800
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
3801
+ return;
3802
+ }
3830
3803
  this.floorIndex = shownFloor;
3831
3804
  this.updateSize();
3832
3805
  this.render();
@@ -3939,7 +3912,9 @@ class ModelFloorplanPluginController {
3939
3912
  enumerable: true,
3940
3913
  configurable: true,
3941
3914
  writable: true,
3942
- value: ({ latitude, longitude }, isFinal) => __awaiter(this, void 0, void 0, function* () {
3915
+ value: async ({ latitude, longitude }, isFinal) => {
3916
+ if (this.five.getCurrentState().mode !== 'Floorplan')
3917
+ return;
3943
3918
  if (this.configs.autoShowEnable === false)
3944
3919
  return;
3945
3920
  // 如果操作结束后,户型图还在展示中,初始化模型状态
@@ -3960,16 +3935,16 @@ class ModelFloorplanPluginController {
3960
3935
  const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
3961
3936
  if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
3962
3937
  // 当手指离开时需要等惯性结束之后在进行判断
3963
- const handleInteriaPan = (any, isFinal) => __awaiter(this, void 0, void 0, function* () {
3938
+ const handleInteriaPan = async (any, isFinal) => {
3964
3939
  if (!isFinal)
3965
3940
  return;
3966
3941
  this.five.off('interiaPan', handleInteriaPan);
3967
- yield this.show({ isAutoShow: true });
3968
- });
3942
+ await this.show({ isAutoShow: true });
3943
+ };
3969
3944
  this.five.on('interiaPan', handleInteriaPan);
3970
3945
  return;
3971
3946
  }
3972
- })
3947
+ }
3973
3948
  });
3974
3949
  this.five = five$1;
3975
3950
  this.hooks = new five.Subscribe();
@@ -3983,9 +3958,9 @@ class ModelFloorplanPluginController {
3983
3958
  left: '50%',
3984
3959
  top: '50%',
3985
3960
  transform: 'translate(-50%, -50%)',
3986
- pointerEvents: 'none',
3987
3961
  zIndex: 10,
3988
3962
  });
3963
+ this.five.addExtraElement(this.container);
3989
3964
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
3990
3965
  this.five.model.loaded ? this.handleModelLoaded() : five$1.once('modelLoaded', this.handleModelLoaded);
3991
3966
  five$1.once('dispose', this.dispose);
@@ -3996,12 +3971,10 @@ class ModelFloorplanPluginController {
3996
3971
  five$1.on('modelShownFloorChange', this.onModelShownFloorChange);
3997
3972
  }
3998
3973
  /** 加载户型图数据 */
3999
- load(data) {
4000
- return __awaiter(this, void 0, void 0, function* () {
4001
- const copyData = JSON.parse(JSON.stringify(data));
4002
- this.floorplanData = yield formatData(copyData);
4003
- this.render();
4004
- });
3974
+ async load(data) {
3975
+ const copyData = JSON.parse(JSON.stringify(data));
3976
+ this.floorplanData = await formatData(copyData);
3977
+ this.render();
4005
3978
  }
4006
3979
  /** 把插件的渲染DOM插入到对应的容器中去 */
4007
3980
  appendTo(wrapper) {
@@ -4012,8 +3985,6 @@ class ModelFloorplanPluginController {
4012
3985
  /** 更改户型图楼层 */
4013
3986
  changeFloor(floorIndex) {
4014
3987
  this.five.model.show(floorIndex);
4015
- this.floorIndex = floorIndex;
4016
- this.render();
4017
3988
  }
4018
3989
  changeConfigs(params) {
4019
3990
  Object.assign(this.configs, params);
@@ -4028,10 +3999,9 @@ class ModelFloorplanPluginController {
4028
3999
  return;
4029
4000
  const { northDesc, hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
4030
4001
  const props = {
4031
- northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4032
- five: this.five,
4033
- pxmm: this.pxmm,
4034
4002
  cameraImageUrl,
4003
+ getLabelElement,
4004
+ northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4035
4005
  visible: this.visible,
4036
4006
  duration: duration !== null && duration !== void 0 ? duration : 0,
4037
4007
  panoIndex: this.panoIndex,
@@ -4042,8 +4012,6 @@ class ModelFloorplanPluginController {
4042
4012
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
4043
4013
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
4044
4014
  lastPanoramaLongitude: this.lastPanoramaLongitude,
4045
- getLabelElement,
4046
- onRoomHeightClick: this.handleClick,
4047
4015
  };
4048
4016
  if (!this.app) {
4049
4017
  this.app = new Main({