@vertexvis/viewer 0.13.1 → 0.13.2-canary.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/cjs/{browser.esm-31b03292.js → browser.esm-075810bf.js} +1 -1
  2. package/dist/cjs/{bundle.esm-dc0a8361.js → bundle.esm-618a5fe9.js} +80 -28
  3. package/dist/cjs/{config-90ee43d5.js → config-fb124bac.js} +2 -2
  4. package/dist/cjs/{cursors-ad2fd395.js → cursors-d71f6a74.js} +1 -1
  5. package/dist/cjs/{dom-dd265f48.js → dom-57ef84e9.js} +1 -1
  6. package/dist/cjs/{entities-aa59890e.js → entities-90f1347a.js} +3 -3
  7. package/dist/cjs/index.cjs.js +14 -12
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{mapper-f6e6cafe.js → mapper-80ee2957.js} +2 -2
  10. package/dist/cjs/{markup-fb1553b1.js → markup-7f7de5f2.js} +2 -2
  11. package/dist/cjs/{measurement-aba1e0e8.js → measurement-f1ae9248.js} +2 -2
  12. package/dist/cjs/{model-4ec0c36e.js → model-55abd9ab.js} +1 -1
  13. package/dist/cjs/{overlays-40c6cbc7.js → overlays-68e8eff2.js} +2 -2
  14. package/dist/cjs/{png-decoder-27d25eed.js → png-decoder-076131d8.js} +1 -1
  15. package/dist/cjs/{results-bc325974.js → results-e9496869.js} +1 -1
  16. package/dist/cjs/{scene-d420fd26.js → scene-92728420.js} +188 -90
  17. package/dist/cjs/{streamAttributes-d6236448.js → streamAttributes-81eb52f2.js} +1508 -43
  18. package/dist/cjs/{utils-545b1865.js → utils-463cd52e.js} +1 -1
  19. package/dist/cjs/{utils-f80be307.js → utils-6397efca.js} +1 -1
  20. package/dist/cjs/vertex-scene-tree-search_3.cjs.entry.js +1 -1
  21. package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js +1 -1
  22. package/dist/cjs/vertex-scene-tree.cjs.entry.js +4 -4
  23. package/dist/cjs/vertex-viewer-dom-element_3.cjs.entry.js +8 -7
  24. package/dist/cjs/vertex-viewer-markup-arrow_3.cjs.entry.js +3 -3
  25. package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +4 -4
  26. package/dist/cjs/vertex-viewer-markup.cjs.entry.js +4 -4
  27. package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +3 -3
  28. package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +20 -15
  29. package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +6 -6
  30. package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +10 -10
  31. package/dist/cjs/vertex-viewer-measurement-tool.cjs.entry.js +5 -5
  32. package/dist/cjs/vertex-viewer-measurements.cjs.entry.js +8 -8
  33. package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +3 -3
  34. package/dist/cjs/vertex-viewer.cjs.entry.js +287 -80
  35. package/dist/cjs/viewer.cjs.js +1 -1
  36. package/dist/cjs/{viewport-8c39089f.js → viewport-54b1389d.js} +34 -2
  37. package/dist/collection/components/scene-tree-table-cell/scene-tree-table-cell.css +1 -1
  38. package/dist/collection/components/viewer/viewer.js +68 -4
  39. package/dist/collection/components/viewer-dom-renderer/renderer2d.js +1 -1
  40. package/dist/collection/components/viewer-dom-renderer/renderer3d.js +4 -2
  41. package/dist/collection/components/viewer-dom-renderer/viewer-dom-renderer.js +5 -6
  42. package/dist/collection/components/viewer-measurement-distance/hitTest.js +9 -4
  43. package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +5 -5
  44. package/dist/collection/components/viewer-measurement-overlays/viewer-measurement-overlays.js +3 -3
  45. package/dist/collection/index.js +2 -2
  46. package/dist/collection/lib/errors.js +8 -1
  47. package/dist/collection/lib/interactions/index.js +3 -1
  48. package/dist/collection/lib/interactions/interactionApi.js +4 -25
  49. package/dist/collection/lib/interactions/interactionApiOrthographic.js +136 -0
  50. package/dist/collection/lib/interactions/interactionApiPerspective.js +51 -0
  51. package/dist/collection/lib/interactions/multiTouchInteractionHandler.js +3 -2
  52. package/dist/collection/lib/mappers/frameStreaming.js +27 -5
  53. package/dist/collection/lib/rendering/matrices.js +13 -4
  54. package/dist/collection/lib/rendering/vectors.js +7 -0
  55. package/dist/collection/lib/scenes/__mocks__/mocks.js +2 -2
  56. package/dist/collection/lib/scenes/camera.js +163 -83
  57. package/dist/collection/lib/scenes/mapper.js +3 -2
  58. package/dist/collection/lib/scenes/scene.js +22 -9
  59. package/dist/collection/lib/types/clippingPlanes.js +48 -20
  60. package/dist/collection/lib/types/depthBuffer.js +32 -3
  61. package/dist/collection/lib/types/frame.js +133 -24
  62. package/dist/collection/lib/types/frameCamera.js +87 -6
  63. package/dist/collection/lib/types/viewport.js +34 -2
  64. package/dist/collection/testing/fixtures.js +28 -15
  65. package/dist/collection/testing/viewer.js +5 -3
  66. package/dist/custom-elements/index.js +2135 -283
  67. package/dist/esm/{browser.esm-59e914f6.js → browser.esm-e72d80ad.js} +1 -1
  68. package/dist/esm/{bundle.esm-d899b2d5.js → bundle.esm-8ceccb91.js} +80 -29
  69. package/dist/esm/{config-604c644e.js → config-fb7cd8ff.js} +2 -2
  70. package/dist/esm/{cursors-a7ec4adb.js → cursors-fc2deed7.js} +1 -1
  71. package/dist/esm/{dom-780d25be.js → dom-2cd18856.js} +1 -1
  72. package/dist/esm/{entities-759d97cd.js → entities-78557270.js} +3 -3
  73. package/dist/esm/index.js +12 -12
  74. package/dist/esm/index.mjs +12 -12
  75. package/dist/esm/loader.js +1 -1
  76. package/dist/esm/loader.mjs +1 -1
  77. package/dist/esm/{mapper-4b815e31.js → mapper-da36de17.js} +2 -2
  78. package/dist/esm/{markup-1d177b4a.js → markup-c313d99c.js} +2 -2
  79. package/dist/esm/{measurement-12cdbf5c.js → measurement-544b69d5.js} +2 -2
  80. package/dist/esm/{model-e5a4f00f.js → model-2a34b443.js} +1 -1
  81. package/dist/esm/{overlays-1919b192.js → overlays-354e275c.js} +2 -2
  82. package/dist/esm/{png-decoder-3f1fa486.js → png-decoder-07de80d1.js} +1 -1
  83. package/dist/esm/{results-994bdb50.js → results-4d0c3568.js} +1 -1
  84. package/dist/esm/{scene-2c2460d5.js → scene-2bfcce74.js} +188 -90
  85. package/dist/esm/{streamAttributes-d623bb60.js → streamAttributes-d0b384b3.js} +1502 -44
  86. package/dist/esm/{utils-83a19677.js → utils-3ea0acdd.js} +1 -1
  87. package/dist/esm/{utils-5e57bf24.js → utils-e0941c61.js} +1 -1
  88. package/dist/esm/vertex-scene-tree-search_3.entry.js +1 -1
  89. package/dist/esm/vertex-scene-tree-table-cell.entry.js +1 -1
  90. package/dist/esm/vertex-scene-tree.entry.js +4 -4
  91. package/dist/esm/vertex-viewer-dom-element_3.entry.js +8 -7
  92. package/dist/esm/vertex-viewer-markup-arrow_3.entry.js +3 -3
  93. package/dist/esm/vertex-viewer-markup-tool.entry.js +4 -4
  94. package/dist/esm/vertex-viewer-markup.entry.js +4 -4
  95. package/dist/esm/vertex-viewer-measurement-details.entry.js +3 -3
  96. package/dist/esm/vertex-viewer-measurement-distance.entry.js +20 -15
  97. package/dist/esm/vertex-viewer-measurement-line_2.entry.js +6 -6
  98. package/dist/esm/vertex-viewer-measurement-precise.entry.js +10 -10
  99. package/dist/esm/vertex-viewer-measurement-tool.entry.js +5 -5
  100. package/dist/esm/vertex-viewer-measurements.entry.js +8 -8
  101. package/dist/esm/vertex-viewer-view-cube.entry.js +3 -3
  102. package/dist/esm/vertex-viewer.entry.js +287 -80
  103. package/dist/esm/viewer.js +1 -1
  104. package/dist/esm/{viewport-01c886ea.js → viewport-5cc7b128.js} +34 -2
  105. package/dist/types/components/scene-tree-table-cell/scene-tree-table-cell.d.ts +1 -1
  106. package/dist/types/components/viewer/viewer.d.ts +8 -0
  107. package/dist/types/components/viewer-dom-renderer/renderer2d.d.ts +2 -2
  108. package/dist/types/components/viewer-dom-renderer/renderer3d.d.ts +3 -3
  109. package/dist/types/components/viewer-dom-renderer/viewer-dom-renderer.d.ts +2 -2
  110. package/dist/types/components/viewer-measurement-distance/hitTest.d.ts +3 -2
  111. package/dist/types/components/viewer-measurement-distance/utils.d.ts +2 -2
  112. package/dist/types/components/viewer-measurement-distance/viewer-measurement-distance.d.ts +2 -2
  113. package/dist/types/components/viewer-measurement-overlays/viewer-measurement-overlays-components.d.ts +2 -2
  114. package/dist/types/components/viewer-measurement-overlays/viewer-measurement-overlays.d.ts +2 -2
  115. package/dist/types/components.d.ts +15 -7
  116. package/dist/types/index.d.ts +1 -1
  117. package/dist/types/lib/errors.d.ts +3 -0
  118. package/dist/types/lib/interactions/index.d.ts +2 -0
  119. package/dist/types/lib/interactions/interactionApi.d.ts +34 -26
  120. package/dist/types/lib/interactions/interactionApiOrthographic.d.ts +35 -0
  121. package/dist/types/lib/interactions/interactionApiPerspective.d.ts +21 -0
  122. package/dist/types/lib/mappers/frameStreaming.d.ts +2 -0
  123. package/dist/types/lib/rendering/vectors.d.ts +2 -0
  124. package/dist/types/lib/scenes/__mocks__/mocks.d.ts +2 -2
  125. package/dist/types/lib/scenes/camera.d.ts +101 -38
  126. package/dist/types/lib/scenes/scene.d.ts +1 -1
  127. package/dist/types/lib/types/clippingPlanes.d.ts +3 -1
  128. package/dist/types/lib/types/depthBuffer.d.ts +28 -6
  129. package/dist/types/lib/types/frame.d.ts +80 -11
  130. package/dist/types/lib/types/frameCamera.d.ts +22 -3
  131. package/dist/types/lib/types/viewport.d.ts +24 -4
  132. package/dist/types/testing/fixtures.d.ts +8 -5
  133. package/dist/viewer/index.esm.js +1 -1
  134. package/dist/viewer/{p-f8d01b8a.entry.js → p-0a189e62.entry.js} +1 -1
  135. package/dist/viewer/{p-e07377fa.entry.js → p-1ca95f9a.entry.js} +1 -1
  136. package/dist/viewer/{p-d00e9203.js → p-3561d910.js} +1 -1
  137. package/dist/viewer/p-388a43f7.js +4 -0
  138. package/dist/viewer/{p-3810c24d.js → p-3f0f83ad.js} +1 -1
  139. package/dist/viewer/{p-8decee06.entry.js → p-41028d3b.entry.js} +1 -1
  140. package/dist/viewer/{p-439220c6.js → p-487e054a.js} +1 -1
  141. package/dist/viewer/p-49d36e94.entry.js +4 -0
  142. package/dist/viewer/{p-da2f4a56.js → p-5b342e97.js} +1 -1
  143. package/dist/viewer/p-661f0612.js +18 -0
  144. package/dist/viewer/{p-364ce21c.js → p-69058178.js} +1 -1
  145. package/dist/viewer/{p-353cfc7a.entry.js → p-73a5eacc.entry.js} +1 -1
  146. package/dist/viewer/p-77be081a.js +4 -0
  147. package/dist/viewer/{p-a0df0e0c.js → p-809d09d9.js} +1 -1
  148. package/dist/viewer/{p-d90f2f6d.entry.js → p-858bd2c7.entry.js} +1 -1
  149. package/dist/viewer/{p-25eaab00.entry.js → p-89b66838.entry.js} +1 -1
  150. package/dist/viewer/p-a93a63a9.js +4 -0
  151. package/dist/viewer/{p-df292b56.entry.js → p-b043b076.entry.js} +1 -1
  152. package/dist/viewer/{p-915d95ad.entry.js → p-b0ac6b3c.entry.js} +1 -1
  153. package/dist/viewer/{p-fec1a8d0.entry.js → p-b7624ff2.entry.js} +1 -1
  154. package/dist/viewer/{p-f7cb7e59.js → p-b8774c9c.js} +1 -1
  155. package/dist/viewer/{p-67446e35.js → p-bcb66f97.js} +1 -1
  156. package/dist/viewer/p-bcde5521.entry.js +4 -0
  157. package/dist/viewer/{p-7cad9bf4.js → p-d1584404.js} +1 -1
  158. package/dist/viewer/p-d32b54cb.js +4 -0
  159. package/dist/viewer/{p-f755af5a.entry.js → p-d3a20af4.entry.js} +1 -1
  160. package/dist/viewer/{p-c62cb926.entry.js → p-d9f99f4d.entry.js} +1 -1
  161. package/dist/viewer/p-e38458da.js +4 -0
  162. package/dist/viewer/{p-301660cf.js → p-e75bba97.js} +2 -2
  163. package/dist/viewer/{p-6e80f8b0.entry.js → p-ebd55df7.entry.js} +1 -1
  164. package/dist/viewer/{p-671c113c.entry.js → p-f0411993.entry.js} +1 -1
  165. package/dist/viewer/{p-2cefb1b0.js → p-fa9a0bed.js} +1 -1
  166. package/dist/viewer/p-ffdeb08c.js +4 -0
  167. package/dist/viewer/viewer.esm.js +1 -1
  168. package/package.json +8 -8
  169. package/dist/viewer/p-081e6873.js +0 -4
  170. package/dist/viewer/p-085e908a.js +0 -4
  171. package/dist/viewer/p-0aba71fd.js +0 -18
  172. package/dist/viewer/p-3f6ac74f.js +0 -4
  173. package/dist/viewer/p-423410be.js +0 -4
  174. package/dist/viewer/p-432267bc.entry.js +0 -4
  175. package/dist/viewer/p-4985fad5.js +0 -4
  176. package/dist/viewer/p-e2297df2.entry.js +0 -4
  177. package/dist/viewer/p-fe11d694.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{v as t}from"./p-0aba71fd.js";function i(i,n){return{type:"minimum-distance",point1:i,point2:n,distance:t.distance(i,n)}}export{i as m}
4
+ import{v as t}from"./p-661f0612.js";function i(i,n){return{type:"minimum-distance",point1:i,point2:n,distance:t.distance(i,n)}}export{i as m}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{h as t,r as i,c as e,H as s,g as n}from"./p-cafa57a6.js";import{v as r,h as a,p as o,l as h}from"./p-661f0612.js";import{M as l,a as d}from"./p-849bd025.js";import{m as c}from"./p-3561d910.js";import{a as u,g as m}from"./p-487e054a.js";import"./p-b8774c9c.js";import"./p-3a20a038.js";import{j as v,D as p}from"./p-77be081a.js";import{M as w}from"./p-5b342e97.js";import{M as f}from"./p-3f0f83ad.js";import{m as b}from"./p-bcb66f97.js";import{V as g}from"./p-a93a63a9.js";import{E as y,m as P}from"./p-e75bba97.js";import{g as E}from"./p-fa9a0bed.js";import{c as C}from"./p-f482325b.js";import"./p-112455b1.js";class M{constructor(t,i,e,s){this.stencil=t,this.depthBuffer=i,this.viewport=e,this.camera=s}hitTest(t){const i=this.viewport.transformPointToFrame(t,this.depthBuffer);if(null!=this.stencil){const e=this.viewport.transformPointToFrame(t,this.stencil);return this.stencil.hitTest(e)||this.depthBuffer.hitTest(i)}return this.depthBuffer.hitTest(i)}snapToNearestPixel(t,i){if(null!=this.stencil){const e=this.viewport.transformPointToFrame(t,this.stencil),s=this.stencil.snapToNearestPixel(e,i);return this.viewport.transformPointToViewport(s,this.stencil)}return t}transformPointToWorld(t,{ignoreHitTest:i=!1}={}){const e=this.pickDepthBuffer(t);return null!=e?null==this.camera||this.camera.isPerspective()?this.viewport.transformPointToWorldSpace(t,e):this.viewport.transformPointToOrthographicWorldSpace(t,e):i?null==this.camera||this.camera.isPerspective()?this.viewport.transformPointToWorldSpace(t,this.depthBuffer):this.viewport.transformPointToOrthographicWorldSpace(t,this.depthBuffer):void 0}pickDepthBuffer(t){if(null!=this.stencil){const i=this.viewport.transformPointToFrame(t,this.stencil);if(this.stencil.hitTest(i))return this.stencil.depthBuffer}const i=this.viewport.transformPointToFrame(t,this.depthBuffer);return this.depthBuffer.hitTest(i)?this.depthBuffer:void 0}}class x{constructor(t){this.model=t}newMeasurement(t,i){const e=i.hitTester().transformPointToWorld(t);return null!=e?new I(t,e,this.model):void 0}editMeasurement(t){const i=this.model.getMeasurement();if(null==i)throw new Error("Cannot edit measurement. Measurement is empty.");return"start"===t?new D(i,this.model):new k(i,this.model)}clearIndicator(){this.model.setIndicator(void 0)}moveIndicator(t,i){const e=i.hitTester().transformPointToWorld(t);return this.model.setIndicator(e),null!=e}}class j{constructor(){this.measurementChanged=new y,this.indicatorChanged=new y}static empty(){return new j}getMeasurement(){return this.measurement}setMeasurement(t){this.measurement!==t&&(this.measurement=t,this.measurementChanged.emit(t))}setMeasurementFromValues(t,i,e){if(null!=t&&null!=i){const s=e?L(t,i):T(t,i);this.setMeasurement(s)}else this.setMeasurement(void 0)}onMeasurementChanged(t){return this.measurementChanged.on(t)}getIndicator(){return this.indicator}setIndicator(t){this.indicator!==t&&(this.indicator=t,this.indicatorChanged.emit(t))}onIndicatorChanged(t){return this.indicatorChanged.on(t)}}class I{constructor(t,i,e){this.pt=t,this.world=i,this.model=e,this.hitWorldValid=!0,this.preventUpdate=!1}fetchStartIfMissing(t){null==this.pendingStart&&(this.pendingStart=this.fetchStart(t))}async fetchStart(t){const i=await t.raycaster(),e=await S(i,this.pt);if(null==e){const i=t.hitTester().transformPointToWorld(this.pt);this.hitWorld=i,this.hitWorldValid=!1}else this.hitWorld=e,this.hitWorldValid=!0}update(t,i){var e;if(!this.preventUpdate){this.fetchStartIfMissing(i);const s=i.hitTester().transformPointToWorld(t,{ignoreHitTest:!0}),n=i.hitTester().hitTest(t),r=null!==(e=this.hitWorld)&&void 0!==e?e:this.world;if(null==s)throw new Error("Cannot update new measurement interaction. End point is empty.");this.hitWorldValid&&n?(this.model.setIndicator(s),this.setMeasurement(L(r,s))):(this.model.setIndicator(s),this.setMeasurement(T(r,s)))}}async finish(t,i){var e;this.preventUpdate=!0,this.fetchStartIfMissing(i),await this.pendingStart,this.model.setIndicator(void 0);const s=await i.raycaster(),n=await S(s,t),r=null!==(e=this.hitWorld)&&void 0!==e?e:this.world;if(this.preventUpdate=!1,null==n){const e=i.hitTester().transformPointToWorld(t,{ignoreHitTest:!0});if(null==e)throw new Error("Cannot complete new measurement interaction. End point is empty.");return this.setMeasurement(T(r,e))}return this.setMeasurement(this.hitWorldValid?L(r,n):T(r,n))}setMeasurement(t){return this.model.setMeasurement(t),t}}class A{constructor(t,i){this.measurement=t,this.model=i}update(t,i){const e=i.hitTester().transformPointToWorld(t,{ignoreHitTest:!0}),s=i.hitTester().hitTest(t);if(null==e)throw new Error("Cannot update new measurement interaction. End point is empty.");s?(this.model.setIndicator(e),this.setMeasurement(this.getValidMeasurement(e))):(this.model.setIndicator(e),this.setMeasurement(this.getInvalidMeasurement(e)))}async finish(t,i){const e=await i.raycaster(),s=await S(e,t);if(this.model.setIndicator(void 0),null==s){const e=i.hitTester().transformPointToWorld(t,{ignoreHitTest:!0});if(null==e)throw new Error("Cannot complete edit measurement interaction. End point is empty.");return this.setMeasurement(this.getInvalidMeasurement(e))}return this.setMeasurement(this.getValidMeasurement(s))}setMeasurement(t){return this.model.setMeasurement(t),t}}class D extends A{constructor(t,i){super(t,i)}getInvalidMeasurement(t){return T(t,this.measurement.end)}getValidMeasurement(t){return L(t,this.measurement.end)}}class k extends A{constructor(t,i){super(t,i)}getInvalidMeasurement(t){return T(this.measurement.start,t)}getValidMeasurement(t){return L(this.measurement.start,t)}}async function S(t,i){var e;const s=await t.hitItems(i),[n]=null!==(e=null==s?void 0:s.hits)&&void 0!==e?e:[];if(null!=(null==n?void 0:n.hitPoint)){const t=v(n.hitPoint);if(P.isInvalid(t))throw new Error(`Invalid hit response [${t.errors.join(",")}]`);return t}}function L(t,i){return{start:t,end:i,distance:r.distance(t,i),valid:!0}}function T(t,i){return{start:t,end:i,valid:!1}}const H=({startPt:i,endPt:e,centerPt:s,indicatorPt:n,distance:r,anchorLabelOffset:h,lineCapLength:l,linePointerEvents:d,hideStartAnchor:c,hideEndAnchor:m,onStartAnchorPointerDown:v,onEndAnchorPointerDown:p})=>{const w=null!=i&&null!=e?a.fromPoints(i,e):void 0,f=null!=w&&null!=i&&null!=h?o.add(i,o.polar(-h,w)):void 0,b=null!=w&&null!=e&&null!=h?o.add(e,o.polar(h,w)):void 0;return t("div",null,null!=i&&null!=e&&t("vertex-viewer-measurement-line",{class:C("line",{"hide-start-line-cap":c,"hide-end-line-cap":m}),start:i,end:e,capLength:l,pointerEvents:d}),!c&&null!=i&&t("div",{id:"start-anchor",class:"anchor anchor-start",style:{transform:u(i)},onPointerDown:v},t("slot",{name:"start-anchor"},t("div",{class:"anchor-placeholder"}))),!c&&f&&t("div",{class:"anchor-label anchor-label-start",style:{transform:u(f)}},t("slot",{name:"start-label"})),!m&&null!=e&&t("div",{id:"end-anchor",class:"anchor anchor-end",style:{transform:u(e)},onPointerDown:p},t("slot",{name:"end-anchor"},t("div",{class:"anchor-placeholder"}))),!m&&b&&t("div",{class:"anchor-label anchor-label-end",style:{transform:u(b)}},t("slot",{name:"end-label"})),null!=s&&t("div",{id:"label",class:"distance-label",style:{transform:u(s)}},r),null!=n&&t("div",{class:"indicator",style:{transform:u(n)}},t("slot",{name:"indicator"},t("div",{class:"indicator-placeholder"}))))};let O=class{constructor(t){i(this,t),this.editBegin=e(this,"editBegin",7),this.editEnd=e(this,"editEnd",7),this.showAxisReferenceLines=!1,this.snapDistance=l,this.units="millimeters",this.fractionalDigits=2,this.anchorLabelOffset=20,this.lineCapLength=d,this.mode="",this.interactingAnchor="none",this.invalid=!1,this.measurementModel=new w,this.viewport=new g(0,0),this.interactionCount=0,this.invalidateStateCounter=0,this.stateMap={},this.measurementUnits=new p(this.units),this.model=j.empty(),this.controller=new x(this.model),this.overlays=new f,this.isUserInteractingWithModel=!1,this.handleFrameDrawn=()=>{this.invalidateState()},this.clearIndicator=()=>{this.controller.clearIndicator()},this.updateStartAnchor=async t=>{if(this.getStencilBuffer(),0===this.interactionCount){const i=m(t,this.elementBounds),e=this.snapPoint(i,t);this.updateIndicator(e)}},this.newMeasurement=t=>{if(0===this.interactionCount&&0===t.button){const i=t=>{const i=()=>{window.removeEventListener("pointerup",e),window.removeEventListener("pointermove",s)},e=async()=>{i(),t()},s=t=>{t.buttons>0&&i()};window.addEventListener("pointermove",s),window.addEventListener("pointerup",e)},e=t=>{let i=o.create(0,0);const e=e=>{o.distance(i,m(e))>=3&&t()},s=()=>(window.removeEventListener("pointermove",e),void window.removeEventListener("pointerup",s)),n=t=>{i=m(t),window.addEventListener("pointermove",e),window.addEventListener("pointerup",s)};return window.addEventListener("pointerdown",n),{dispose:()=>window.removeEventListener("pointerdown",n)}},s=()=>{const t=e((()=>{var t;this.isUserInteractingWithModel=!0,null===(t=this.stateMap.hoverCursor)||void 0===t||t.dispose()})),i=this.createInteractionMoveHandler(),s=async e=>{var n;if(0===e.button)if(this.isUserInteractingWithModel)this.isUserInteractingWithModel=!1;else{const r=this.getHitProvider();if(null!=r){const a=m(e,this.elementBounds),o=this.snapPoint(a,e);await(null===(n=this.interaction)||void 0===n?void 0:n.finish(o,r)),window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",s),t.dispose(),this.updateMeasurementPropsFromModel(),this.endEditing()}}};this.beginEditing("replace","end"),window.addEventListener("pointermove",i),window.addEventListener("pointerup",s)},n=this.getHitProvider();if(null!=n){const e=m(t,this.elementBounds),r=this.snapPoint(e,t);this.interaction=this.controller.newMeasurement(r,n),null!=this.interaction&&i(s)}}}}async computeElementMetrics(){var t,i,e;const s=null===(t=this.hostEl.shadowRoot)||void 0===t?void 0:t.getElementById("start-anchor"),n=null===(i=this.hostEl.shadowRoot)||void 0===i?void 0:i.getElementById("end-anchor"),r=null===(e=this.hostEl.shadowRoot)||void 0===e?void 0:e.getElementById("label");return null!=s&&null!=n&&null!=r?{startAnchor:s.getBoundingClientRect(),endAnchor:n.getBoundingClientRect(),label:r.getBoundingClientRect()}:void 0}disconnectedCallback(){var t;null===(t=this.stateMap.hoverCursor)||void 0===t||t.dispose()}componentWillLoad(){this.updatePropsFromJson(),this.model.setMeasurementFromValues(this.start,this.end,!this.invalid),this.getStencilBuffer(),this.updateViewport(),this.handleViewerChanged(this.viewer),this.handleModeChanged(),this.computePropsAndState(),this.model.onIndicatorChanged((t=>{this.indicatorPt=t}))}componentDidLoad(){new ResizeObserver((()=>this.updateViewport())).observe(this.hostEl)}componentWillUpdate(){this.computePropsAndState()}render(){return t(s,null,this.showAxisReferenceLines&&t("vertex-viewer-measurement-overlays",{measurementOverlays:this.overlays,viewer:this.viewer}),this.renderMeasurement())}renderMeasurement(){const i=this.computeElementPositions(),{startPt:e,endPt:s,labelPt:n,indicatorPt:r,hideStart:a,hideEnd:o}=i,h=this.formatDistance(this.distance);return t(H,"edit"===this.mode||"replace"===this.mode?{startPt:e,endPt:s,centerPt:n,indicatorPt:r,distance:h,anchorLabelOffset:this.anchorLabelOffset,lineCapLength:this.lineCapLength,hideStartAnchor:a,hideEndAnchor:o,onStartAnchorPointerDown:this.handleEditAnchor("start"),onEndAnchorPointerDown:this.handleEditAnchor("end")}:{startPt:e,endPt:s,centerPt:n,indicatorPt:this.indicatorPt,distance:h,hideStartAnchor:a,hideEndAnchor:o,anchorLabelOffset:this.anchorLabelOffset,lineCapLength:this.lineCapLength,linePointerEvents:"painted"})}handleViewerChanged(t,i){null!=i&&(i.removeEventListener("frameDrawn",this.handleFrameDrawn),this.removeInteractionListeners(i)),null!=t&&(t.addEventListener("frameDrawn",this.handleFrameDrawn),this.addInteractionListeners(t))}handleUnitsChanged(){this.measurementUnits=new p(this.units)}handleCameraChanged(){this.updateCamera()}handleModeChanged(){this.warnIfDepthBuffersDisabled(),null!=this.viewer&&(this.removeInteractionListeners(this.viewer),this.addInteractionListeners(this.viewer))}handleStartChanged(){this.updateInteractionModel()}handleEndChanged(){this.updateInteractionModel()}handleInvalidChanged(){this.updateInteractionModel()}computePropsAndState(){this.updateCamera(),this.updateDepthBuffer(),this.updateMeasurementPropsFromModel(),this.updateOverlays()}updateOverlays(){var t;null===(t=this.overlay)||void 0===t||t.dispose(),this.showAxisReferenceLines&&0===this.interactionCount&&!this.invalid&&null!=this.start&&null!=this.end&&(this.overlay=this.overlays.addDistanceVector(this.start,this.end))}async setCursor(t){var i,e;null===(i=this.stateMap.hoverCursor)||void 0===i||i.dispose(),this.isUserInteractingWithModel||(this.stateMap.hoverCursor=await(null===(e=this.viewer)||void 0===e?void 0:e.addCursor(t)))}computeElementPositions(){return"replace"===this.mode?this.computeReplaceElementPositions():this.computeEditOrViewElementPositions()}computeEditOrViewElementPositions(){const t=this.model.getMeasurement();return null!=this.internalCamera&&null!=t?this.computeLineElementPositions(h.create(t)):{}}computeReplaceElementPositions(){if(null!=this.internalCamera){const t=this.model.getMeasurement(),i=null!=t?this.computeLineElementPositions(h.create(t)):{},e=null!=this.indicatorPt?{indicatorPt:this.viewport.transformWorldToViewport(this.indicatorPt,this.internalCamera.projectionViewMatrix)}:{};return Object.assign(Object.assign({},i),e)}return{}}computeLineElementPositions(t){return null!=this.internalCamera?E(t,this.interactingAnchor,{viewport:this.viewport,camera:this.internalCamera}):{}}updateCamera(){var t,i;this.internalCamera=this.camera||(null===(i=null===(t=this.viewer)||void 0===t?void 0:t.frame)||void 0===i?void 0:i.scene.camera)}async updateDepthBuffer(){var t,i;this.stateMap.depthBuffer=await(null===(i=null===(t=this.viewer)||void 0===t?void 0:t.frame)||void 0===i?void 0:i.depthBuffer())}updateViewport(){const t=this.hostEl.getBoundingClientRect();this.viewport=new g(t.width,t.height),this.elementBounds=t}updatePropsFromJson(){var t,i;this.start=V(null!==(t=this.startJson)&&void 0!==t?t:this.start),this.end=V(null!==(i=this.endJson)&&void 0!==i?i:this.end)}updateInteractionModel(){this.model.setMeasurementFromValues(this.start,this.end,!this.invalid)}invalidateState(){this.invalidateStateCounter=this.invalidateStateCounter+1}async addInteractionListeners(t){const i=await t.getInteractionTarget();"replace"===this.mode&&(i.addEventListener("pointermove",this.updateStartAnchor),i.addEventListener("pointerdown",this.newMeasurement),i.addEventListener("pointerleave",this.clearIndicator))}async removeInteractionListeners(t){const i=await t.getInteractionTarget();i.removeEventListener("pointermove",this.updateStartAnchor),i.removeEventListener("pointerdown",this.newMeasurement),i.removeEventListener("pointerleave",this.clearIndicator)}handleEditAnchor(t){if("edit"===this.mode||"replace"===this.mode){const i=this.createInteractionMoveHandler(),e=async t=>{var s;const n=this.getHitProvider();if(null!=n){window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",e);const r=m(t,this.elementBounds),a=this.snapPoint(r,t);await(null===(s=this.interaction)||void 0===s?void 0:s.finish(a,n)),this.updateMeasurementPropsFromModel(),this.endEditing()}};return s=>{this.getStencilBuffer(),0===s.button&&(this.beginEditing("edit",t),this.interaction=this.controller.editMeasurement(t),window.addEventListener("pointermove",i),window.addEventListener("pointerup",e))}}}createInteractionMoveHandler(){return t=>{var i;const e=this.getHitProvider();if(null!=this.elementBounds&&null!=e){t.preventDefault(),this.getStencilBuffer();const s=m(t,this.elementBounds),n=this.snapPoint(s,t);null===(i=this.interaction)||void 0===i||i.update(n,e),this.updateMeasurementPropsFromModel()}}}async getStencilBuffer(){var t;const i=await(null===(t=this.viewer)||void 0===t?void 0:t.stencilBuffer.latestAfterInteraction());this.stateMap.stencil=i}snapPoint(t,i){const e=this.getHitProvider();if(null!=e&&!i.shiftKey){const i=Math.max(0,this.snapDistance);return e.hitTester().snapToNearestPixel(t,i)}return t}formatDistance(t){const i=null!=t?this.measurementUnits.convertWorldValueToReal(t):void 0;if(null!=this.labelFormatter)return this.labelFormatter(i);{const t=this.measurementUnits.unit.abbreviatedName;return null==i?"---":`~${i.toFixed(this.fractionalDigits)} ${t}`}}beginEditing(t,i){0===this.interactionCount&&(this.interactingAnchor=i,this.editBegin.emit({type:t,anchor:i})),this.interactionCount=this.interactionCount+1}endEditing(){if(1===this.interactionCount){const t=this.model.getMeasurement();this.interactingAnchor="none",this.updateMeasurementModel(),null!=t&&this.editEnd.emit(t)}this.interactionCount=this.interactionCount-1}updateMeasurementModel(){this.measurementModel.clearOutcome(),this.invalid||null==this.start||null==this.end||this.measurementModel.setOutcome({isApproximate:!0,results:[b(this.start,this.end)]})}getHitProvider(){if(null!=this.hitProvider)return this.hitProvider;{const t=this.getHitTester(),i=this.viewer;if(null!=i&&null!=t)return{hitTester:()=>t,raycaster:async()=>(await i.scene()).raycaster()}}}getHitTester(){const{stencil:t,depthBuffer:i}=this.stateMap;if(null!=i)return new M(t,i,this.viewport,this.internalCamera)}updateMeasurementPropsFromModel(){const t=this.model.getMeasurement();this.start=null==t?void 0:t.start,this.end=null==t?void 0:t.end,this.distance=null==t?void 0:t.distance,this.invalid=null!=t&&!t.valid}updateIndicator(t){var i;const e=this.getHitProvider();null!=e&&this.controller.moveIndicator(t,e)?this.setCursor(c):null===(i=this.stateMap.hoverCursor)||void 0===i||i.dispose()}warnIfDepthBuffersDisabled(){null!=this.viewer&&null==this.viewer.depthBuffers&&console.warn("Measurement editing is disabled. <vertex-viewer> must have its `depth-buffers` attribute set.")}get hostEl(){return n(this)}static get watchers(){return{viewer:["handleViewerChanged"],units:["handleUnitsChanged"],camera:["handleCameraChanged"],mode:["handleModeChanged"],start:["handleStartChanged"],end:["handleEndChanged"],invalid:["handleInvalidChanged"]}}};function V(t){return"string"==typeof t?r.fromJson(t):t}O.style=":host{--viewer-measurement-distance-accent-color:var(--neutral-900);--viewer-measurement-distance-contrast-color:var(--white);--viewer-measurement-distance-invalid-accent-color:var(--red-600);--viewer-measurement-distance-invalid-contrast-color:var(--white);--viewer-measurement-distance-line-stroke-width:1.25px;--viewer-measurement-distance-line-fill-width:2px;--viewer-measurement-distance-distance-border:1px solid\n var(--viewer-measurement-distance-accent-color);--viewer-measurement-distance-distance-border-radius:0.25rem;--viewer-measurement-distance-distance-padding:0.375rem 0.5rem;color:var(--viewer-measurement-distance-accent-color);font-size:0.75rem;position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;pointer-events:none}:host([invalid]:not([invalid='false'])){--viewer-measurement-distance-accent-color:var(\n --viewer-measurement-distance-invalid-accent-color\n ) !important;--viewer-measurement-distance-contrast-color:var(\n --viewer-measurement-distance-invalid-contrast-color\n ) !important}.line{--viewer-measurement-line-stroke:var(\n --viewer-measurement-distance-contrast-color\n );--viewer-measurement-line-stroke-opacity:0.75;--viewer-measurement-line-stroke-width:var(\n --viewer-measurement-distance-line-stroke-width\n );--viewer-measurement-line-fill:var(\n --viewer-measurement-distance-accent-color\n );--viewer-measurement-line-fill-width:var(\n --viewer-measurement-distance-line-fill-width\n );position:absolute;width:100%;height:100%}.anchor{position:absolute;border-radius:50%;transform:translate(-50%, -50%);display:block;pointer-events:auto}:host([interacting-anchor='start']) .anchor-start,:host([interacting-anchor='start']) .anchor-label-start{visibility:hidden}.hide-start-line-cap,:host([interacting-anchor='start']) .line{--viewer-measurement-line-start-cap-visibility:hidden}:host([interacting-anchor='end']) .anchor-end,:host([interacting-anchor='end']) .anchor-label-end{visibility:hidden}.hide-end-line-cap,:host([interacting-anchor='end']) .line{--viewer-measurement-line-end-cap-visibility:hidden}.anchor-label{position:absolute;border-radius:50%;transform:translate(-50%, -50%);display:block;pointer-events:auto}:host(:not([mode=''])){cursor:inherit}:host(:not([mode=''])) .anchor{cursor:move}:host([mode='']) .anchor{visibility:hidden}.anchor-placeholder{background:var(--viewer-measurement-distance-contrast-color);width:12px;height:12px;border-radius:50%;box-sizing:border-box}:host(:not([mode=''])) .anchor-placeholder{border:2px solid var(--viewer-measurement-distance-accent-color);background:var(--viewer-measurement-distance-contrast-color)}:host([mode='']) .distance-label{color:var(--viewer-measurement-distance-contrast-color);background:var(--viewer-measurement-distance-accent-color)}.distance-label{position:absolute;background:var(--viewer-measurement-distance-contrast-color);border:var(--viewer-measurement-distance-distance-border);border-radius:var(--viewer-measurement-distance-distance-border-radius);padding:var(--viewer-measurement-distance-distance-padding);pointer-events:auto}.indicator{position:absolute}.indicator-placeholder{background:var(--viewer-measurement-distance-accent-color);border:1px solid var(--viewer-measurement-distance-contrast-color);width:6px;height:6px;border-radius:50%;box-sizing:border-box}";export{O as vertex_viewer_measurement_distance}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{p as n,q as t,i as e,g as r}from"./p-0aba71fd.js";function a(r,a,s=60){const i=n.distance(r,a),f=e.normalize(e.toDegrees(e.fromPoints(r,a))-270),o=Math.max(4,Math.min(16,.25*i)),E=o/Math.cos(e.toRadians(90-s)),u=t.rotation(f),R=n.polar(E,e.toRadians(2*s)),c=n.polar(E,e.toRadians(s)),M=n.polar(o,e.toRadians(90));return{tip:a,left:n.add(a,t.transformPoint(u,R)),right:n.add(a,t.transformPoint(u,c)),base:n.add(a,t.transformPoint(u,M))}}function s(n){return[n.tip,n.right,n.base,n.left].map((n=>`${n.x},${n.y}`)).join(" ")}function i(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-ARROW"===n.nodeName}function f(t){return"string"==typeof t?n.fromJson(t):t}function o(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-CIRCLE"===n.nodeName}function E(n){return"string"==typeof n?r.fromJson(n):n}function u(t){return"string"==typeof t?JSON.parse(t).map((t=>n.fromJson(JSON.stringify(t)))):t}function R(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-FREEFORM"===n.nodeName}export{o as a,R as b,a as c,s as d,E as e,u as f,i,f as p}
4
+ import{p as n,s as t,h as e,i as r}from"./p-661f0612.js";function s(r,s,a=60){const i=n.distance(r,s),f=e.normalize(e.toDegrees(e.fromPoints(r,s))-270),o=Math.max(4,Math.min(16,.25*i)),E=o/Math.cos(e.toRadians(90-a)),u=t.rotation(f),R=n.polar(E,e.toRadians(2*a)),c=n.polar(E,e.toRadians(a)),M=n.polar(o,e.toRadians(90));return{tip:s,left:n.add(s,t.transformPoint(u,R)),right:n.add(s,t.transformPoint(u,c)),base:n.add(s,t.transformPoint(u,M))}}function a(n){return[n.tip,n.right,n.base,n.left].map((n=>`${n.x},${n.y}`)).join(" ")}function i(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-ARROW"===n.nodeName}function f(t){return"string"==typeof t?n.fromJson(t):t}function o(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-CIRCLE"===n.nodeName}function E(n){return"string"==typeof n?r.fromJson(n):n}function u(t){return"string"==typeof t?JSON.parse(t).map((t=>n.fromJson(JSON.stringify(t)))):t}function R(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-FREEFORM"===n.nodeName}export{o as a,R as b,s as c,a as d,E as e,u as f,i,f as p}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{c as t,u as e,a as s,b as i}from"./p-e75bba97.js";import{v as r,b as n,a as o,p as a,d as h}from"./p-661f0612.js";import{v as u,t as c,g as l,e as d,h as p,d as w,w as v,i as m}from"./p-77be081a.js";const y={opacity:100,glossiness:10,diffuse:{r:0,g:0,b:0,a:0},ambient:{r:0,g:0,b:0,a:0},specular:{r:0,g:0,b:0,a:0},emissive:{r:0,g:0,b:0,a:0}},b=(e,s)=>{const i=t.fromHexString(e);return Object.assign(Object.assign({},y),{opacity:s||100,glossiness:s||10,diffuse:Object.assign({},null!=i?i:y.diffuse)})},f={opacity:100,glossiness:4,diffuse:{r:255,g:255,b:0,a:0},ambient:{r:0,g:0,b:0,a:0},specular:{r:255,g:255,b:255,a:0},emissive:{r:0,g:0,b:0,a:0}},g=Object.freeze({__proto__:null,create:(t,e,s,i)=>Object.assign(Object.assign({},y),{opacity:i||100,glossiness:i||10,diffuse:{r:t,g:e,b:s,a:0}}),fromHex:b,defaultSelectionMaterial:f});class x extends Error{constructor(t,e){super(),this.message=t,this.stack=null==e?void 0:e.stack,this.name=this.constructor.name,Object.setPrototypeOf(this,x.prototype)}}class O extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,O.prototype)}}class j extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,j.prototype)}}class I extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,I.prototype)}}class T extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,T.prototype)}}class k extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,k.prototype)}}class A extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,A.prototype)}}class S extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,S.prototype)}}class V extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,V.prototype)}}class B extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,B.prototype)}}class C extends x{constructor(t,e){super(t,e),Object.setPrototypeOf(this,C.prototype)}}function M(t){const s=e.parse(t);if("urn"!==s.scheme||null==s.path)throw new Error("Invalid URN. Expected URN scheme.");const[i,r,n]=s.path.split(":");if("vertexvis"!==i)throw new Error("Invalid URN. Expected URN to be vertexvis namespace");switch(r){case"stream-key":return{resource:{type:"stream-key",id:n},queries:(o=s.query,null!=o?o.split("&").map((t=>{const[e,s]=t.split("=");switch(e){case"scene-view-state":return{type:"scene-view-state",id:s};default:throw new Error("Invalid URN. Unknown query resource type")}})):[])};default:throw new O(`Invalid URN. Unknown resource type ${r}`)}var o}const R=Object.freeze({__proto__:null,fromUrn:M});class D{constructor(t,e=new Date){this.knownRemoteTime=t,this.knownLocalTime=e}localOffset(){return this.duration(this.knownLocalTime,this.localNow())}localTime(t){const e="number"==typeof t?new Date(this.knownLocalTime.getTime()+t):t,s=this.duration(this.knownRemoteTime,e);return this.addDuration(this.knownLocalTime,s)}remoteOffset(t=new Date){return this.duration(this.remoteTime(this.knownLocalTime),this.remoteTime(t))}remoteNow(){return this.remoteTime(this.localNow())}remoteTime(t){const e="number"==typeof t?new Date(this.knownLocalTime.getTime()+t):t,s=this.duration(this.knownLocalTime,e);return this.addDuration(this.knownRemoteTime,s)}addDuration(t,e){return new Date(t.getTime()+e)}duration(t,e){return e.getTime()-t.getTime()}localNow(){return new Date(Date.now())}}class U{constructor(t,e,s,i=1e4){this.stream=t,this.predicate=e,this.transform=s,this.timeout=i,this.listeners=[],this.handleMessage=this.handleMessage.bind(this)}on(t){this.listeners=[...this.listeners,t],null!=this.eventDisposable&&null!=this.requestDisposable||this.addListeners()}off(t){this.listeners=this.listeners.filter((e=>e!==t)),0===this.listeners.length&&this.removeListeners()}once(){let t;return s.timeout(this.timeout,new Promise((e=>{t=s=>{e(s),this.off(t)},this.on(t)}))).finally((()=>{this.off(t)}))}handleMessage(t){if(this.predicate(t)){const e=this.transform(t);null!=e&&this.listeners.forEach((t=>t(e)))}}addListeners(){this.eventDisposable=this.stream.onEvent(this.handleMessage),this.requestDisposable=this.stream.onRequest(this.handleMessage)}removeListeners(){var t,e;null===(t=this.eventDisposable)||void 0===t||t.dispose(),null===(e=this.requestDisposable)||void 0===e||e.dispose()}}class E{constructor(t,e,{animationId:s,correlationId:i},r){this.data=void 0,this.onAnimationCompleted=new U(t,(t=>{var e,i,r;return(null===(r=null===(i=null===(e=t.event)||void 0===e?void 0:e.animationCompleted)||void 0===i?void 0:i.animationId)||void 0===r?void 0:r.hex)===s}),(t=>{var e,s,i;return(null===(i=null===(s=null===(e=t.event)||void 0===e?void 0:e.animationCompleted)||void 0===s?void 0:s.animationId)||void 0===i?void 0:i.hex)||void 0}),r),this.onFrameReceived=new U(t,(t=>{var e,s,r;return!!(null===(r=null===(s=null===(e=t.request)||void 0===e?void 0:e.drawFrame)||void 0===s?void 0:s.frameCorrelationIds)||void 0===r?void 0:r.some((t=>t===i)))}),(t=>{var s;return null!=(null===(s=t.request)||void 0===s?void 0:s.drawFrame)?e(t.request.drawFrame):void 0}),r)}}function N(t){switch(t.type){case"item-id":return{id:new u.protobuf.core.Uuid({hex:t.value})};case"supplied-id":return{suppliedId:t.value};default:return{}}}class _{constructor(t){this.flyToOptions=t}build(){return this.flyToOptions}}class F{withItemId(t){return new _({flyTo:{type:"internal",data:t}})}withSuppliedId(t){return new _({flyTo:{type:"supplied",data:t}})}withCamera(t){return new _({flyTo:{type:"camera",data:t}})}withBoundingBox(t){return new _({flyTo:{type:"bounding-box",data:t}})}build(){return this.flyToOptions}}class z{constructor(t,e,s,i,r,n){this.stream=t,this.aspect=e,this.data=s,this.boundingBox=i,this.decodeFrame=r,this.flyToOptions=n}fitCameraToBoundingBox(t,e,s){const i=r.scale(e,r.normalize(s)),o=n.center(t),a=r.subtract(o,i);return this.update({lookAt:o,position:a,viewVector:i})}signedDistanceToBoundingBoxCenter(t){const{position:e,viewVector:s}=v(this.data),i=n.center(null!=t?t:this.boundingBox),o=r.subtract(i,e);return r.dot(s,o)/r.magnitude(s)}flyTo(t){return this.updateFlyToOptions("function"!=typeof t?{flyTo:this.buildFlyToType(t)}:t(new F).build())}viewAll(){return this.fitToBoundingBox(this.boundingBox)}async render(t){var e,s,r;null==this.flyToOptions&&null!=t&&(this.flyToOptions={flyTo:{type:"camera",data:this.data}});try{const n=i.create();if(null!=this.flyToOptions){const i=function(t,e,s){const i={frameCorrelationId:{value:t},animation:s?{duration:c(s.milliseconds)}:void 0};switch(e.flyTo.type){case"supplied":return Object.assign(Object.assign({},i),{itemSuppliedId:e.flyTo.data});case"internal":return Object.assign(Object.assign({},i),{itemId:new u.protobuf.core.Uuid({hex:e.flyTo.data})});case"camera":return Object.assign(Object.assign({},i),{camera:l(e.flyTo.data)});case"bounding-box":return Object.assign(Object.assign({},i),{boundingBox:{xmin:e.flyTo.data.min.x,xmax:e.flyTo.data.max.x,ymin:e.flyTo.data.min.y,ymax:e.flyTo.data.max.y,zmin:e.flyTo.data.min.z,zmax:e.flyTo.data.max.z}});default:return{}}}(n,this.flyToOptions,null==t?void 0:t.animation),o=await this.stream.flyTo(i,!0);return new E(this.stream,this.decodeFrame,{correlationId:n,animationId:(null===(s=null===(e=o.flyTo)||void 0===e?void 0:e.animationId)||void 0===s?void 0:s.hex)||void 0},null!=(null===(r=null==t?void 0:t.animation)||void 0===r?void 0:r.milliseconds)?t.animation.milliseconds+1e4:void 0)}return this.stream.replaceCamera({camera:l(this.data),frameCorrelationId:{value:n}}),new E(this.stream,this.decodeFrame,{correlationId:n})}catch(t){throw console.warn("Error when performing render: ",t),t}}rotateAroundAxis(t,e){return this.rotateAroundAxisAtPoint(t,this.data.lookAt,e)}standardView(t){return this.update({position:t.position,viewVector:r.subtract(r.origin(),t.position),lookAt:r.origin(),up:t.up})}buildFlyToType(t){if(null!=t.boundingBox)return{type:"bounding-box",data:t.boundingBox};if(null!=t.camera)return{type:"camera",data:t.camera};if(null!=t.itemId)return{type:"internal",data:t.itemId};if(null!=t.itemSuppliedId)return{type:"supplied",data:t.itemSuppliedId};throw new Error("Fly to must specify at least one option.")}computeClippingPlanes(t){return m(this.boundingBox,t)}}class P extends z{constructor(t,e,s,i,r,n){super(t,e,s,i,r,n),this.perspectiveData=s}moveBy(t){return this.update({position:r.add(this.position,t),lookAt:r.add(this.lookAt,t)})}rotateAroundAxisAtPoint(t,e,s){return this.update({position:r.rotateAboutAxis(t,this.position,s,e),lookAt:r.rotateAboutAxis(t,this.lookAt,s,e),up:r.rotateAboutAxis(t,this.up,s,r.origin())})}fitToBoundingBox(t){var e;const s=1.1*r.magnitude(r.subtract(t.max,n.center(t)));let i=Math.tan(.008726646259972*(null!==(e=this.fovY)&&void 0!==e?e:45));this.aspect<1&&(i*=this.aspect);const o=Math.abs(s/i);return super.fitCameraToBoundingBox(t,o,this.viewVector)}update(t){return new P(this.stream,this.aspect,Object.assign(Object.assign({},this.perspectiveData),t),this.boundingBox,this.decodeFrame,this.flyToOptions)}toFrameCamera(){var t;return new d(this.position,this.lookAt,this.up,this.near,this.far,this.aspectRatio,null!==(t=this.fovY)&&void 0!==t?t:45)}get viewVector(){return r.subtract(this.lookAt,this.position)}get position(){return Object.assign({},this.perspectiveData.position)}get up(){return Object.assign({},this.perspectiveData.up)}get lookAt(){return Object.assign({},this.perspectiveData.lookAt)}get fovY(){return this.perspectiveData.fovY}get aspectRatio(){return this.aspect}get near(){const{near:t}=this.computeClippingPlanes(this.perspectiveData);return t}get far(){const{far:t}=this.computeClippingPlanes(this.perspectiveData);return t}updateFlyToOptions(t){return new P(this.stream,this.aspect,this.perspectiveData,this.boundingBox,this.decodeFrame,t)}}class q extends z{constructor(t,e,s,i,r,n){super(t,e,s,i,r,n),this.orthographicData=s}moveBy(t){return this.update({lookAt:r.add(this.lookAt,t)})}rotateAroundAxisAtPoint(t,e,s){const i=r.rotateAboutAxis(t,this.lookAt,s,e),n=r.rotateAboutAxis(t,this.position,s,e),a=p(r.subtract(i,n),o.create(this.boundingBox));return this.update({viewVector:a,lookAt:i,up:r.rotateAboutAxis(t,this.up,s,r.origin())})}fitToBoundingBox(t){const e=o.create(t),s=super.fitCameraToBoundingBox(t,e.radius,this.viewVector);return this.update({lookAt:s.lookAt,viewVector:s.viewVector,fovHeight:2*e.radius})}update(t){return new q(this.stream,this.aspect,Object.assign(Object.assign({},this.orthographicData),t),this.boundingBox,this.decodeFrame,this.flyToOptions)}toFrameCamera(){return new w(p(this.viewVector,o.create(this.boundingBox)),this.lookAt,this.up,this.near,this.far,this.aspectRatio,this.fovHeight)}get viewVector(){return Object.assign({},this.orthographicData.viewVector)}get position(){return r.add(this.lookAt,r.negate(this.viewVector))}get up(){return Object.assign({},this.orthographicData.up)}get lookAt(){return Object.assign({},this.orthographicData.lookAt)}get fovHeight(){return this.orthographicData.fovHeight}get aspectRatio(){return this.aspect}get near(){const{near:t}=this.computeClippingPlanes(this.orthographicData);return t}get far(){const{far:t}=this.computeClippingPlanes(this.orthographicData);return t}updateFlyToOptions(t){return new q(this.stream,this.aspect,this.orthographicData,this.boundingBox,this.decodeFrame,t)}}class H{constructor(t,e){this.stream=t,this.imageScaleProvider=e}async hitItems(t,e){const s=this.imageScaleProvider();return(await this.stream.hitItems({point:a.scale(t,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1),includeMetadata:null==e?void 0:e.includeMetadata},!0)).hitItems||void 0}}class L{constructor(t,e){this.stream=t,this.data=e}async update(t){return(await this.stream.updateCrossSectioning({crossSectioning:t},!0)).updateCrossSectioning||void 0}current(){return this.data}}class Q{constructor(t=[]){this.operations=t}build(){return this.operations.concat()}materialOverride(t){return new Q(this.operations.concat([{type:"change-material",material:t}]))}show(){return new Q(this.operations.concat([{type:"show"}]))}hide(){return new Q(this.operations.concat([{type:"hide"}]))}select(t){return new Q(this.operations.concat([{type:"select",material:t}]))}deselect(){return new Q(this.operations.concat([{type:"deselect"}]))}clearMaterialOverrides(){return new Q(this.operations.concat([{type:"clear-override"}]))}transform(t){return new Q(this.operations.concat([{type:"change-transform",transform:t}]))}}class Y{all(){return new W}withItemIds(t){return new X(t,"item-id")}withSuppliedIds(t){return new X(t,"supplied-id")}withItemId(t){return new Z({type:"item-id",value:t})}withSuppliedId(t){return new Z({type:"supplied-id",value:t})}withSceneTreeRange(t){return new $(t)}withMetadata(t,e){return new G(t,e)}withSelected(){return new J}withPoint(t){return new K(t)}}class W{build(){return{type:"all"}}}class ${constructor(t){this.range=t}build(){return{type:"scene-tree-range",range:this.range}}}class G{constructor(t,e){this.filter=t,this.keys=e}build(){return{type:"metadata",filter:this.filter,keys:this.keys}}}class J{build(){return{type:"all-selected"}}}class K{constructor(t){this.point=t}build(){return{type:"point",point:this.point}}}class X{constructor(t,e){this.ids=t,this.type=e}build(){return{type:"or",expressions:this.ids.map((t=>({type:this.type,value:t})))}}}class Z{constructor(t){this.query=t}build(){return Object.assign({},this.query)}and(){return new et([this.query])}or(){return new tt([this.query])}}class tt{constructor(t){this.expressions=t}build(){return{type:"or",expressions:[...this.expressions]}}withItemId(t){return new tt([...this.expressions,{type:"item-id",value:t}])}withSuppliedId(t){return new tt([...this.expressions,{type:"supplied-id",value:t}])}or(){return this}}class et{constructor(t){this.expressions=t}build(){return{type:"and",expressions:[...this.expressions]}}withItemId(t){return new et([...this.expressions,{type:"item-id",value:t}])}withSuppliedId(t){return new et([...this.expressions,{type:"supplied-id",value:t}])}and(){return this}}class st{constructor(t){this.defaultSelectionMaterial=t}where(t){const e=t(new Y).build();return new it(e,this.defaultSelectionMaterial)}}class it{constructor(t,e,s){this.query=t,this.defaultSelectionMaterial=e,this.builder=null!=s?s:new Q}materialOverride(t){return new it(this.query,this.defaultSelectionMaterial,this.builder.materialOverride("string"==typeof t?b(t):t))}hide(){return new it(this.query,this.defaultSelectionMaterial,this.builder.hide())}show(){return new it(this.query,this.defaultSelectionMaterial,this.builder.show())}select(t){return new it(this.query,this.defaultSelectionMaterial,this.builder.select("string"==typeof t?b(t):t||this.defaultSelectionMaterial))}deselect(){return new it(this.query,this.defaultSelectionMaterial,this.builder.deselect())}clearMaterialOverrides(){return new it(this.query,this.defaultSelectionMaterial,this.builder.clearMaterialOverrides())}transform(t){if(Array.isArray(t)){if(16!==t.length)throw new B("Matrix provided must contain exactly 16 values (4x4).");return new it(this.query,this.defaultSelectionMaterial,this.builder.transform({r0:{x:t[0],y:t[1],z:t[2],w:t[3]},r1:{x:t[4],y:t[5],z:t[6],w:t[7]},r2:{x:t[8],y:t[9],z:t[10],w:t[11]},r3:{x:t[12],y:t[13],z:t[14],w:t[15]}}))}return new it(this.query,this.defaultSelectionMaterial,this.builder.transform(t))}build(){return{query:this.query,operations:this.builder.build()}}}class rt{constructor(t,e,s,i){this.sceneViewId=t,this.stream=e,this.dimensions=s,this.queryOperations=i}async execute(t){const e=this.queryOperations.map((t=>function(t,e,s){const i=function(t){return t.map((t=>{switch(t.type){case"change-material":return{changeMaterial:{material:{d:t.material.opacity,ns:t.material.glossiness,ka:t.material.ambient,kd:t.material.diffuse,ks:t.material.specular,ke:t.material.emissive}}};case"clear-override":return{changeMaterial:{}};case"change-transform":return{changeTransform:{transform:Object.assign({},t.transform)}};case"hide":return{changeVisibility:{visible:!1}};case"show":return{changeVisibility:{visible:!0}};case"select":return{changeSelection:{material:{d:t.material.opacity,ns:t.material.glossiness,ka:t.material.ambient,kd:t.material.diffuse,ks:t.material.specular,ke:t.material.emissive}}};case"deselect":return{changeSelection:{}};default:return{}}}))}(e);switch(t.type){case"and":case"or":return{[t.type]:{queries:t.expressions.map((t=>({sceneItemQuery:N(t)})))},operationTypes:i};case"item-id":case"supplied-id":return{item:{sceneItemQuery:N(t)},operationTypes:i};case"all":return{all:{},operationTypes:i};case"scene-tree-range":return{sceneTreeRange:{start:t.range.start,end:t.range.end},operationTypes:i};case"metadata":return{metadata:{valueFilter:t.filter,keys:t.keys},operationTypes:i};case"all-selected":return{override:{selection:{}},operationTypes:i};case"point":return{point:{point:t.point,viewport:s.dimensions},operationTypes:i};default:return{}}}(t.query,t.operations,{dimensions:this.dimensions}))),s={sceneViewId:{hex:this.sceneViewId},operations:e,suppliedCorrelationId:null!=(null==t?void 0:t.suppliedCorrelationId)?{value:null==t?void 0:t.suppliedCorrelationId}:void 0};await this.stream.createSceneAlteration(s)}}class nt{constructor(t,e,s,i,r,n,o){this.stream=t,this.frame=e,this.decodeFrame=s,this.imageScaleProvider=i,this.dimensions=r,this.sceneViewId=n,this.defaultSelectionMaterial=o}async applySceneViewState(t,e={}){return await this.stream.loadSceneViewState({sceneViewStateId:{hex:t},frameCorrelationId:e.suppliedCorrelationId?{value:e.suppliedCorrelationId}:void 0},!0)}async reset(t={}){return await this.stream.resetSceneView({includeCamera:t.includeCamera,frameCorrelationId:t.suppliedCorrelationId?{value:t.suppliedCorrelationId}:void 0},!0)}items(t){const e=t(new st(this.defaultSelectionMaterial)),s=(Array.isArray(e)?e:[e]).reduce(((t,e)=>t.concat(e.build())),[]);return new rt(this.sceneViewId,this.stream,this.dimensions,s)}camera(){const{scene:t}=this.frame;if(t.camera.isOrthographic())return new q(this.stream,h.aspectRatio(this.viewport()),{viewVector:t.camera.viewVector,lookAt:t.camera.lookAt,up:t.camera.up,fovHeight:t.camera.fovHeight},this.frame.scene.boundingBox,this.decodeFrame);if(t.camera.isPerspective())return new P(this.stream,h.aspectRatio(this.viewport()),{position:t.camera.position,lookAt:t.camera.lookAt,up:t.camera.up,fovY:t.camera.fovY},this.frame.scene.boundingBox,this.decodeFrame);throw new C("Cannot retrieve camera. Scene has an unknown or invalid camera type.")}boundingBox(){return this.frame.scene.boundingBox}crossSectioning(){return new L(this.stream,this.frame.scene.crossSection)}raycaster(){return new H(this.stream,this.imageScaleProvider)}viewport(){return this.frame.dimensions}scale(){return this.imageScaleProvider()||a.create(1,1)}}export{x as C,S as I,nt as S,j as V,k as W,D as a,T as b,g as c,f as d,A as e,M as f,I as g,V as h,b as i,R as l}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{h as o,r as t,c as r,H as e,g as i}from"./p-cafa57a6.js";import{p as n,d as s,g as h,i as a}from"./p-0aba71fd.js";import{g as d}from"./p-439220c6.js";import{i as c,a as l,b as u,p as w,c as p,d as b,e as v,f as m}from"./p-7cad9bf4.js";import{c as f}from"./p-f482325b.js";import"./p-112455b1.js";function g(o){return o.getBoundingClientRect()}function k(o,t){switch(t){case"top-left":return n.create(o.x,o.y);case"top":return n.create(o.x+o.width/2,o.y);case"top-right":return n.create(o.x+o.width,o.y);case"right":return n.create(o.x+o.width,o.y+o.height/2);case"bottom-right":return n.create(o.x+o.width,o.y+o.height);case"bottom":return n.create(o.x+o.width/2,o.y+o.height);case"bottom-left":return n.create(o.x,o.y+o.height);case"left":return n.create(o.x,o.y+o.height/2);case"center":return h.center(o)}}function x(o){return Math.min(o.width,o.height)}function D(o,t){const r=x(t);return n.add(n.scale(o,r,r),s.center(t))}function P(o,t){const r=x(t);return s.scale(r,r,o)}function y(o,t){const r=D(o,t),e=P(o,t);return h.fromPointAndDimensions(r,e)}function A(o,t){const r=function(o){return 1/x(o)}(t);return n.scale(n.subtract(o,s.center(t)),r,r)}function C(o,t,r){const e=h.fromPoints(o,t);if(r){const r=Math.max(e.width,e.height),i=e.height>e.width;return h.create(t.x<=o.x?i?o.x-r:t.x:o.x,t.y<=o.y?i?t.y:o.y-r:o.y,r,r)}return e}function L(o,t,r,e,i){const s=n.subtract(r,t),{x:a,y:d,width:c,height:l}=o,u=a+c,w=d+l,p=n.create(a,d),b=n.create(a,w),v=n.create(u,d),m=n.create(u,w);switch(e){case"top-left":return C(m,r,!!i);case"top":return C(m,n.create(a,r.y),!!i);case"top-right":return C(b,r,!!i);case"right":return C(b,n.create(r.x,d),!!i);case"bottom-right":return C(p,r,!!i);case"bottom":return C(p,n.create(u,r.y),!!i);case"bottom-left":return C(v,r,!!i);case"left":return C(m,n.create(r.x,d),!!i);case"center":return h.create(o.x+s.x,o.y+s.y,o.width,o.height)}}function T(o){const t=o.target;return function(o){return c(o)||l(o)||u(o)}(t)&&"edit"!==t.mode}const B=({id:t,rotation:r,name:e,point:i,onPointerDown:n},s)=>o("div",{id:t,class:"bounds-anchor-position",style:{top:`${i.y}px`,left:`${i.x}px`},onTouchStart:o=>o.preventDefault(),onPointerDown:n},o("div",{class:"bounds-anchor",style:{transform:`rotateZ(${null!=r?r:0}deg)`}},o("slot",{name:e},s))),M=({id:t})=>o("filter",{id:t,filterUnits:"userSpaceOnUse"},o("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"2"}),o("feOffset",{dx:"0",dy:"1",result:"offsetblur"}),o("feFlood",{"flood-color":"#000000","flood-opacity":"0.25"}),o("feComposite",{in2:"offsetblur",operator:"in"}),o("feMerge",null,o("feMergeNode",null),o("feMergeNode",{in:"SourceGraphic"}))),R=({start:t,end:r,onStartAnchorPointerDown:e,onCenterAnchorPointerDown:i,onEndAnchorPointerDown:s})=>{const h=a.normalize(a.toDegrees(a.fromPoints(t,r))-270),d=n.create((t.x+r.x)/2,(t.y+r.y)/2);return o("div",{class:"bounds-container"},o(B,{id:"bounding-box-1d-start-anchor",name:"start-anchor",rotation:h,point:t,onPointerDown:e},o("div",{class:f("bounds-default-anchor","bounds-cap-anchor")})),o(B,{id:"bounding-box-1d-end-anchor",name:"end-anchor",rotation:h,point:r,onPointerDown:s},o("div",{class:f("bounds-default-anchor","bounds-cap-anchor")})),o(B,{id:"bounding-box-1d-center-anchor",name:"center-anchor",point:d,onPointerDown:i},o("div",{class:f("bounds-default-anchor","bounds-center-anchor")})))};let S=class{constructor(o){t(this,o),this.editBegin=r(this,"editBegin",7),this.editEnd=r(this,"editEnd",7),this.viewRendered=r(this,"viewRendered",7),this.mode="",this.editAnchor="end",this.editStartPoint=o=>{this.editAnchor="start",this.startMarkup(o)},this.editCenterPoint=o=>{this.editAnchor="center",this.startMarkup(o)},this.editEndPoint=o=>{this.editAnchor="end",this.startMarkup(o)},this.updatePoints=o=>{if(null!=this.elementBounds&&this.pointerId===o.pointerId){const t=A(d(o,this.elementBounds),this.elementBounds);if("start"===this.editAnchor)this.start=t;else if("end"===this.editAnchor)this.end=t;else if(null!=this.start&&null!=this.end){const o=n.create((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2),r=o.x-t.x,e=o.y-t.y;this.start=n.create(this.start.x-r,this.start.y-e),this.end=n.create(this.end.x-r,this.end.y-e)}}},this.handleWindowPointerDown=o=>{T(o)&&this.startMarkup(o)},this.handleTouchStart=o=>{o.preventDefault()},this.startMarkup=o=>{var t;""!==this.mode&&null!=this.elementBounds&&null==this.pointerId&&(this.pointerId=o.pointerId,this.start=null!==(t=this.start)&&void 0!==t?t:A(d(o,this.elementBounds),this.elementBounds),this.editBegin.emit(),this.addDrawingInteractionListeners())},this.endMarkup=o=>{if(this.pointerId===o.pointerId){const o=null!=this.start&&null!=this.elementBounds?D(this.start,this.elementBounds):void 0,t=null!=this.end&&null!=this.elementBounds?D(this.end,this.elementBounds):void 0;""!==this.mode&&null!=o&&null!=t&&n.distance(o,t)>=2?this.editEnd.emit():(this.start=void 0,this.end=void 0),this.pointerId=void 0,this.removeDrawingInteractionListeners()}}}componentWillLoad(){this.updateViewport(),this.handleViewerChanged(this.viewer),this.updatePointsFromProps()}componentDidLoad(){this.updatePointsFromProps(),new ResizeObserver((()=>this.updateViewport())).observe(this.hostEl),"create"===this.mode&&window.addEventListener("pointerdown",this.handleWindowPointerDown)}componentDidRender(){""===this.mode&&this.viewRendered.emit()}disconnectedCallback(){window.removeEventListener("pointerdown",this.handleWindowPointerDown)}async dispose(){null!=this.viewer&&this.removeInteractionListeners(this.viewer),this.removeDrawingInteractionListeners(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}handleViewerChanged(o,t){null!=t&&this.removeInteractionListeners(t),null!=o&&this.addInteractionListeners(o)}handleStartJsonChange(){this.updatePointsFromProps()}handleEndJsonChange(){this.updatePointsFromProps()}handleModeChange(){"create"!==this.mode&&window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updateViewport(){const o=g(this.hostEl);this.elementBounds=o}updatePointsFromProps(){this.start=this.start||w(this.startJson),this.end=this.end||w(this.endJson)}render(){if(null!=this.start&&null!=this.end&&null!=this.elementBounds){const t=D(this.start,this.elementBounds),r=D(this.end,this.elementBounds),i=p(t,r);return function(...o){return o.every((o=>!isNaN(o.x)&&!isNaN(o.y)))}(t,r)?o(e,null,o("svg",{class:"svg",onTouchStart:this.handleTouchStart},o("defs",null,o(M,{id:"arrow-shadow"})),o("g",{filter:"url(#arrow-shadow)"},o("polygon",{id:"arrow-head",class:"head",points:b(i)}),o("line",{id:"arrow-line",class:"line",x1:t.x,y1:t.y,x2:i.base.x,y2:i.base.y}),"edit"===this.mode&&o("line",{id:"bounding-box-1d-line",class:"bounds-line",x1:t.x,y1:t.y,x2:r.x,y2:r.y}))),"edit"===this.mode&&o(R,{start:t,end:r,onStartAnchorPointerDown:this.editStartPoint,onCenterAnchorPointerDown:this.editCenterPoint,onEndAnchorPointerDown:this.editEndPoint}),"create"===this.mode&&o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart})):o(e,null)}return o(e,null,o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart}))}async addInteractionListeners(o){const t=await o.getInteractionTarget();"create"===this.mode&&t.addEventListener("pointerdown",this.startMarkup)}async addDrawingInteractionListeners(){""!==this.mode&&(window.addEventListener("pointermove",this.updatePoints),window.addEventListener("pointerup",this.endMarkup))}async removeInteractionListeners(o){(await o.getInteractionTarget()).removeEventListener("pointerdown",this.startMarkup)}async removeDrawingInteractionListeners(){window.removeEventListener("pointermove",this.updatePoints),window.removeEventListener("pointerup",this.endMarkup)}get hostEl(){return i(this)}static get watchers(){return{viewer:["handleViewerChanged"],start:["handleStartJsonChange"],end:["handleEndJsonChange"],mode:["handleModeChange"]}}};S.style=":host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;--viewer-markup-arrow-line-stroke-color:var(--red-800);--viewer-markup-arrow-line-stroke-width:4;--viewer-markup-arrow-head-stroke-color:var(--red-800);--viewer-markup-arrow-head-stroke-width:4;--viewer-markup-arrow-head-fill-color:var(--red-800);--viewer-markup-arrow-head-fill-opacity:1;--viewer-markup-arrow-bounds-cap-border-color:var(--blue-400);--viewer-markup-arrow-bounds-cap-border-width:1px;--viewer-markup-arrow-bounds-cap-background-color:white;--viewer-markup-arrow-bounds-center-anchor-border-color:white;--viewer-markup-arrow-bounds-center-anchor-border-width:1px;--viewer-markup-arrow-bounds-center-anchor-background-color:var(--blue-400);--viewer-markup-arrow-bounds-outline-width:1px;--viewer-markup-arrow-bounds-outline-color:var(--blue-400);--viewer-markup-arrow-bounds-anchor-width:9px;--viewer-markup-arrow-bounds-anchor-height:9px}.svg{pointer-events:none;width:100%;height:100%}.create-overlay{pointer-events:auto;position:absolute;left:0;top:0;width:100%;height:100%;cursor:crosshair}.line{pointer-events:auto;stroke:var(--viewer-markup-arrow-line-stroke-color);stroke-width:var(--viewer-markup-arrow-line-stroke-width);cursor:default}.head{pointer-events:auto;stroke:var(--viewer-markup-arrow-head-stroke-color);stroke-width:var(--viewer-markup-arrow-head-stroke-width);fill:var(--viewer-markup-arrow-head-fill-color);fill-opacity:var(--viewer-markup-arrow-head-fill-opacity);cursor:default}.bounds-line{pointer-events:auto;stroke:var(--viewer-markup-arrow-bounds-outline-color);stroke-width:var(--viewer-markup-arrow-bounds-outline-width)}.bounds-container{pointer-events:none;position:absolute;width:100%;height:100%;top:0;left:0;overflow:hidden}.bounds-anchor-position{position:absolute;transform:translate(-50%, -50%)}.bounds-anchor{pointer-events:auto;cursor:default;user-select:none}.bounds-default-anchor{width:var(--viewer-markup-arrow-bounds-anchor-width);height:var(--viewer-markup-arrow-bounds-anchor-height);box-sizing:border-box;box-shadow:0 0 2px rgba(0, 0, 0, 0.3)}.bounds-center-anchor{border-radius:100%;border-width:var(--viewer-markup-arrow-bounds-center-anchor-border-width);border-color:var(--viewer-markup-arrow-bounds-center-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-arrow-bounds-center-anchor-background-color)}.bounds-cap-anchor{border-width:var(--viewer-markup-arrow-bounds-cap-border-width);border-color:var(--viewer-markup-arrow-bounds-cap-border-color);border-style:solid;background-color:var(--viewer-markup-arrow-bounds-cap-background-color)}";const I=({bounds:t,onTopLeftAnchorPointerDown:r,onLeftAnchorPointerDown:e,onTopRightAnchorPointerDown:i,onRightAnchorPointerDown:n,onBottomLeftAnchorPointerDown:s,onBottomAnchorPointerDown:a,onBottomRightAnchorPointerDown:d,onTopAnchorPointerDown:c,onCenterAnchorPointerDown:l})=>{const u=h.pad(t,6),w=h.center(u);return o("div",{class:"bounds-container"},o("div",{class:"bounds-outline",style:{top:`${u.y}px`,left:`${u.x}px`,width:`${u.width}px`,height:`${u.height}px`}}),o(B,{id:"bounding-box-2d-top-left-anchor",name:"top-left-anchor",point:k(u,"top-left"),onPointerDown:r},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-left-anchor",name:"left-anchor",point:k(u,"left"),onPointerDown:e},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-top-right-anchor",name:"top-right-anchor",point:k(u,"top-right"),onPointerDown:i},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-right-anchor",name:"right-anchor",point:k(u,"right"),onPointerDown:n},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-bottom-left-anchor",name:"bottom-left-anchor",point:k(u,"bottom-left"),onPointerDown:s},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-bottom-anchor",name:"bottom-anchor",point:k(u,"bottom"),onPointerDown:a},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-bottom-right-anchor",name:"bottom-right-anchor",point:k(u,"bottom-right"),onPointerDown:d},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-top-anchor",name:"top-anchor",point:k(u,"top"),onPointerDown:c},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-center-anchor",name:"center-anchor",point:w,onPointerDown:l},o("div",{class:f("bounds-default-anchor","bounds-center-anchor")})))};let E=class{constructor(o){t(this,o),this.editBegin=r(this,"editBegin",7),this.editEnd=r(this,"editEnd",7),this.viewRendered=r(this,"viewRendered",7),this.mode="",this.editAnchor="bottom-right",this.updateEditAnchor=(o,t)=>{this.resizeBounds=this.bounds,this.editAnchor=t,this.startMarkup(o)},this.updatePoints=o=>{var t;if(null!=this.bounds&&null!=this.startPosition&&null!=this.elementBounds&&this.pointerId===o.pointerId){const r=A(d(o,this.elementBounds),this.elementBounds);this.bounds=L(null!==(t=this.resizeBounds)&&void 0!==t?t:this.bounds,this.startPosition,r,this.editAnchor,o.shiftKey)}},this.handleWindowPointerDown=o=>{T(o)&&this.startMarkup(o)},this.handleTouchStart=o=>{o.preventDefault()},this.startMarkup=o=>{var t;if(""!==this.mode&&null!=this.elementBounds&&null==this.pointerId){const r=A(d(o,this.elementBounds),this.elementBounds);this.pointerId=o.pointerId,this.startPosition=r,this.bounds=null!==(t=this.bounds)&&void 0!==t?t:h.create(r.x,r.y,0,0),this.resizeBounds=this.bounds,this.editBegin.emit(),this.addDrawingInteractionListeners()}},this.endMarkup=o=>{var t,r;this.pointerId===o.pointerId&&(""!==this.mode&&null!=this.bounds&&(null===(t=this.bounds)||void 0===t?void 0:t.width)>0&&(null===(r=this.bounds)||void 0===r?void 0:r.height)>0?(this.editAnchor="bottom-right",this.editEnd.emit()):this.bounds=void 0,this.pointerId=void 0,this.removeDrawingInteractionListeners())}}componentWillLoad(){this.updateViewport(),this.handleViewerChanged(this.viewer),this.updateBoundsFromProps()}componentDidLoad(){this.updateBoundsFromProps(),new ResizeObserver((()=>this.updateViewport())).observe(this.hostEl),"create"===this.mode&&window.addEventListener("pointerdown",this.handleWindowPointerDown)}componentDidRender(){""===this.mode&&this.viewRendered.emit()}disconnectedCallback(){window.removeEventListener("pointerdown",this.handleWindowPointerDown)}async dispose(){null!=this.viewer&&this.removeInteractionListeners(this.viewer),this.removeDrawingInteractionListeners(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}handleViewerChanged(o,t){null!=t&&this.removeInteractionListeners(t),null!=o&&this.addInteractionListeners(o)}handleBoundsJsonChange(){this.updateBoundsFromProps()}handleModeChange(){"create"!==this.mode&&window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updateViewport(){const o=g(this.hostEl);this.elementBounds=o}updateBoundsFromProps(){var o;this.bounds=null!==(o=this.bounds)&&void 0!==o?o:v(this.boundsJson)}render(){if(null!=this.bounds&&null!=this.elementBounds){const t=y(this.bounds,this.elementBounds),r=h.center(t);return o(e,null,o("svg",{class:"svg",onTouchStart:this.handleTouchStart},o("defs",null,o(M,{id:"circle-shadow"})),o("g",{filter:"url(#circle-shadow)"},o("ellipse",{class:"ellipse",cx:r.x,cy:r.y,rx:t.width/2,ry:t.height/2,stroke:"#000ff0","stroke-width":4,fill:"none"}))),"edit"===this.mode&&o(I,{bounds:t,onTopLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"top-left"),onTopRightAnchorPointerDown:o=>this.updateEditAnchor(o,"top-right"),onTopAnchorPointerDown:o=>this.updateEditAnchor(o,"top"),onBottomLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom-left"),onBottomRightAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom-right"),onBottomAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom"),onLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"left"),onRightAnchorPointerDown:o=>this.updateEditAnchor(o,"right"),onCenterAnchorPointerDown:o=>this.updateEditAnchor(o,"center")}),"create"===this.mode&&o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart}))}return o(e,null,o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart}))}async addInteractionListeners(o){const t=await o.getInteractionTarget();"create"===this.mode&&t.addEventListener("pointerdown",this.startMarkup)}async addDrawingInteractionListeners(){""!==this.mode&&(window.addEventListener("pointermove",this.updatePoints),window.addEventListener("pointerup",this.endMarkup))}async removeInteractionListeners(o){(await o.getInteractionTarget()).removeEventListener("pointerdown",this.startMarkup)}async removeDrawingInteractionListeners(){window.removeEventListener("pointermove",this.updatePoints),window.removeEventListener("pointerup",this.endMarkup)}get hostEl(){return i(this)}static get watchers(){return{viewer:["handleViewerChanged"],bounds:["handleBoundsJsonChange"],mode:["handleModeChange"]}}};E.style=":host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;--viewer-markup-circle-ellipse-stroke-color:var(--red-700);--viewer-markup-circle-ellipse-stroke-width:4;--viewer-markup-circle-ellipse-fill-color:none;--viewer-markup-circle-ellipse-fill-opacity:0;--viewer-markup-circle-bounds-outline-border-color:var(--blue-400);--viewer-markup-circle-bounds-outline-border-width:1px;--viewer-markup-circle-bounds-edge-anchor-border-color:var(--blue-400);--viewer-markup-circle-bounds-edge-anchor-border-width:1px;--viewer-markup-circle-bounds-edge-anchor-background-color:white;--viewer-markup-circle-bounds-center-anchor-border-color:white;--viewer-markup-circle-bounds-center-anchor-border-width:1px;--viewer-markup-circle-bounds-center-anchor-background-color:var(--blue-400);--viewer-markup-circle-bounds-anchor-width:9px;--viewer-markup-circle-bounds-anchor-height:9px}.svg{pointer-events:none;width:100%;height:100%}.create-overlay{pointer-events:auto;position:absolute;left:0;top:0;width:100%;height:100%;cursor:crosshair}.ellipse{pointer-events:auto;stroke:var(--viewer-markup-circle-ellipse-stroke-color);stroke-width:var(--viewer-markup-circle-ellipse-stroke-width);fill:var(--viewer-markup-circle-ellipse-fill-color);fill-opacity:var(--viewer-markup-circle-ellipse-fill-opacity);cursor:default}.bounds-container{pointer-events:none;position:absolute;width:100%;height:100%;top:0;left:0;overflow:hidden}.bounds-outline{position:absolute;border-width:var(--viewer-markup-circle-bounds-outline-border-width);border-color:var(--viewer-markup-circle-bounds-outline-border-color);border-style:solid;box-shadow:0 0 3px rgba(0, 0, 0, 0.3)}.bounds-anchor-position{position:absolute;transform:translate(-50%, -50%)}.bounds-anchor{pointer-events:auto;cursor:default;user-select:none}.bounds-default-anchor{width:var(--viewer-markup-circle-bounds-anchor-width);height:var(--viewer-markup-circle-bounds-anchor-height);box-sizing:border-box;box-shadow:0 0 2px rgba(0, 0, 0, 0.3)}.bounds-center-anchor{border-radius:100%;border-width:var(--viewer-markup-circle-bounds-center-anchor-border-width);border-color:var(--viewer-markup-circle-bounds-center-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-circle-bounds-center-anchor-background-color)}.bounds-edge-anchor{border-width:var(--viewer-markup-circle-bounds-edge-anchor-border-width);border-color:var(--viewer-markup-circle-bounds-edge-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-circle-bounds-edge-anchor-background-color)}";let $=class{constructor(o){t(this,o),this.editBegin=r(this,"editBegin",7),this.editEnd=r(this,"editEnd",7),this.viewRendered=r(this,"viewRendered",7),this.mode="",this.editAnchor="bottom-right",this.screenPoints=[],this.handleWindowPointerDown=o=>{T(o)&&this.startMarkup(o)},this.handleTouchStart=o=>{o.preventDefault()},this.updateEditAnchor=(o,t)=>{null!=this.elementBounds&&(this.resizeBounds=this.bounds,this.resizePoints=this.points,this.editAnchor=t,this.resizeStartPosition=A(d(o,this.elementBounds),this.elementBounds),this.addEditingInteractionListeners())},this.updateBounds=o=>{var t,r,e;if(null!=this.resizeStartPosition&&null!=this.elementBounds&&null!=this.resizeBounds&&null!=this.resizePoints){const i=A(d(o,this.elementBounds),this.elementBounds),s=L(this.resizeBounds,this.resizeStartPosition,i,this.editAnchor,o.shiftKey);this.points=(r=this.resizeBounds,e=s,this.resizePoints.map((o=>n.add(n.scale(n.subtract(o,r),e.width/(r.width||1),e.height/(r.height||1)),e)))),this.screenPoints=null!==(t=this.convertPointsToScreen())&&void 0!==t?t:this.screenPoints,this.bounds=s}},this.updatePoints=o=>{if(this.pointerId===o.pointerId&&null!=this.points&&null!=this.elementBounds){const t=d(o,this.elementBounds),r=A(t,this.elementBounds);this.updateMinAndMax(r),this.points=[...this.points,r],this.screenPoints=[...this.screenPoints,t]}},this.startMarkup=o=>{var t,r;if(null==this.pointerId&&""!==this.mode&&null!=this.elementBounds){this.pointerId=o.pointerId;const e=d(o,this.elementBounds),i=A(e,this.elementBounds);this.updateMinAndMax(i),this.points=null!==(t=this.points)&&void 0!==t?t:[i],this.screenPoints=null!==(r=this.screenPoints)&&void 0!==r?r:[e],this.editBegin.emit(),this.addDrawingInteractionListeners()}},this.endMarkup=o=>{if(this.pointerId===o.pointerId){if(""!==this.mode&&null!=this.points&&this.points.length>2&&null!=this.elementBounds){const t=d(o,this.elementBounds),r=A(t,this.elementBounds);this.updateMinAndMax(r),this.points=[...this.points,r],this.screenPoints=[...this.screenPoints,t],this.editEnd.emit()}else this.points=void 0;this.min=void 0,this.max=void 0,this.pointerId=void 0,this.removeDrawingInteractionListeners()}},this.endEdit=()=>{this.resizeBounds=void 0,this.removeEditingInteractionListeners(),this.editEnd.emit()}}componentWillLoad(){this.updateViewport(),this.handleViewerChanged(this.viewer),this.updatePointsFromProps()}componentDidLoad(){new ResizeObserver((()=>this.updateViewport())).observe(this.hostEl),"create"===this.mode&&window.addEventListener("pointerdown",this.handleWindowPointerDown)}componentDidRender(){""===this.mode&&this.viewRendered.emit()}disconnectedCallback(){window.removeEventListener("pointerdown",this.handleWindowPointerDown)}async dispose(){null!=this.viewer&&this.removeInteractionListeners(this.viewer),this.removeDrawingInteractionListeners(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}handleViewerChanged(o,t){null!=t&&this.removeInteractionListeners(t),null!=o&&this.addInteractionListeners(o)}handlePointsJsonChange(){this.updatePointsFromProps()}handleBoundsJsonChange(){this.updatePointsFromProps()}handleModeChange(){"create"!==this.mode&&window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updateViewport(){var o;const t=g(this.hostEl);this.elementBounds=t,this.screenPoints=null!==(o=this.convertPointsToScreen())&&void 0!==o?o:this.screenPoints}updatePointsFromProps(){var o,t,r;this.points=null!==(o=this.points)&&void 0!==o?o:m(this.pointsJson),this.screenPoints=null!==(t=this.convertPointsToScreen())&&void 0!==t?t:[],this.bounds=null!==(r=this.bounds)&&void 0!==r?r:v(this.boundsJson)}render(){return this.screenPoints.length>0&&null!=this.elementBounds?o(e,null,o("svg",{class:"svg",onTouchStart:this.handleTouchStart},o("defs",null,o(M,{id:"freeform-markup-shadow"})),o("g",{filter:"url(#freeform-markup-shadow)"},o("path",{class:"path",d:this.screenPoints.reduce(((o,t)=>`${o}L${t.x},${t.y}`),`M${this.screenPoints[0].x},${this.screenPoints[0].y}`),fill:"none"}))),"edit"===this.mode&&null!=this.bounds&&o(I,{bounds:y(this.bounds,this.elementBounds),onTopLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"top-left"),onTopRightAnchorPointerDown:o=>this.updateEditAnchor(o,"top-right"),onTopAnchorPointerDown:o=>this.updateEditAnchor(o,"top"),onBottomLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom-left"),onBottomRightAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom-right"),onBottomAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom"),onLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"left"),onRightAnchorPointerDown:o=>this.updateEditAnchor(o,"right"),onCenterAnchorPointerDown:o=>this.updateEditAnchor(o,"center")}),"create"===this.mode&&o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart})):o(e,null,o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart}))}async addInteractionListeners(o){const t=await o.getInteractionTarget();"create"===this.mode&&t.addEventListener("pointerdown",this.startMarkup)}async addDrawingInteractionListeners(){""!==this.mode&&(window.addEventListener("pointermove",this.updatePoints),window.addEventListener("pointerup",this.endMarkup))}async addEditingInteractionListeners(){"edit"===this.mode&&(window.addEventListener("pointermove",this.updateBounds),window.addEventListener("pointerup",this.endEdit))}async removeInteractionListeners(o){(await o.getInteractionTarget()).removeEventListener("pointerdown",this.startMarkup)}async removeDrawingInteractionListeners(){window.removeEventListener("pointermove",this.updatePoints),window.removeEventListener("pointerup",this.endMarkup)}async removeEditingInteractionListeners(){"edit"===this.mode&&(window.removeEventListener("pointermove",this.updateBounds),window.removeEventListener("pointerup",this.endEdit))}updateMinAndMax(o){this.min=null!=this.min?n.create(Math.min(this.min.x,o.x),Math.min(this.min.y,o.y)):o,this.max=null!=this.max?n.create(Math.max(this.max.x,o.x),Math.max(this.max.y,o.y)):o,this.bounds=h.create(this.min.x,this.min.y,this.max.x-this.min.x,this.max.y-this.min.y)}convertPointsToScreen(){var o;const t=this.elementBounds;if(null!=t)return null===(o=this.points)||void 0===o?void 0:o.map((o=>D(o,t)))}get hostEl(){return i(this)}static get watchers(){return{viewer:["handleViewerChanged"],points:["handlePointsJsonChange"],bounds:["handleBoundsJsonChange"],mode:["handleModeChange"]}}};$.style=":host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;--viewer-markup-freeform-stroke-color:var(--red-800);--viewer-markup-freeform-stroke-width:4;--viewer-markup-freeform-line-join:round;--viewer-markup-freeform-line-cap:round;--viewer-markup-freeform-bounds-outline-border-color:var(--blue-400);--viewer-markup-freeform-bounds-outline-border-width:1px;--viewer-markup-freeform-bounds-edge-anchor-border-color:var(--blue-400);--viewer-markup-freeform-bounds-edge-anchor-border-width:1px;--viewer-markup-freeform-bounds-edge-anchor-background-color:white;--viewer-markup-freeform-bounds-center-anchor-border-color:white;--viewer-markup-freeform-bounds-center-anchor-border-width:1px;--viewer-markup-freeform-bounds-center-anchor-background-color:var(--blue-400);--viewer-markup-freeform-bounds-anchor-width:9px;--viewer-markup-freeform-bounds-anchor-height:9px}.svg{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.path{pointer-events:auto;cursor:default;stroke:var(--viewer-markup-freeform-stroke-color);stroke-width:var(--viewer-markup-freeform-stroke-width);stroke-linejoin:var(--viewer-markup-freeform-line-join);stroke-linecap:var(--viewer-markup-freeform-line-cap)}.create-overlay{pointer-events:auto;position:absolute;left:0;top:0;width:100%;height:100%;cursor:crosshair}.bounds-container{pointer-events:none;position:absolute;width:100%;height:100%;top:0;left:0;overflow:hidden}.bounds-outline{position:absolute;border-width:var(--viewer-markup-freeform-bounds-outline-border-width);border-color:var(--viewer-markup-freeform-bounds-outline-border-color);border-style:solid;box-shadow:0 0 3px rgba(0, 0, 0, 0.3)}.bounds-anchor-position{position:absolute;transform:translate(-50%, -50%)}.bounds-anchor{pointer-events:auto;cursor:default;user-select:none}.bounds-default-anchor{width:var(--viewer-markup-freeform-bounds-anchor-width);height:var(--viewer-markup-freeform-bounds-anchor-height);box-sizing:border-box;box-shadow:0 0 2px rgba(0, 0, 0, 0.3)}.bounds-center-anchor{border-radius:100%;border-width:var(--viewer-markup-freeform-bounds-center-anchor-border-width);border-color:var(--viewer-markup-freeform-bounds-center-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-freeform-bounds-center-anchor-background-color)}.bounds-edge-anchor{border-width:var(--viewer-markup-freeform-bounds-edge-anchor-border-width);border-color:var(--viewer-markup-freeform-bounds-edge-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-freeform-bounds-edge-anchor-background-color)}";export{S as vertex_viewer_markup_arrow,E as vertex_viewer_markup_circle,$ as vertex_viewer_markup_freeform}
4
+ import{h as o,r as t,c as e,H as r,g as i}from"./p-cafa57a6.js";import{p as n,d as s,i as h,h as a}from"./p-661f0612.js";import{g as d}from"./p-487e054a.js";import{i as c,a as l,b as u,p as w,c as p,d as b,e as v,f as m}from"./p-d1584404.js";import{c as f}from"./p-f482325b.js";import"./p-112455b1.js";function g(o){return o.getBoundingClientRect()}function k(o,t){switch(t){case"top-left":return n.create(o.x,o.y);case"top":return n.create(o.x+o.width/2,o.y);case"top-right":return n.create(o.x+o.width,o.y);case"right":return n.create(o.x+o.width,o.y+o.height/2);case"bottom-right":return n.create(o.x+o.width,o.y+o.height);case"bottom":return n.create(o.x+o.width/2,o.y+o.height);case"bottom-left":return n.create(o.x,o.y+o.height);case"left":return n.create(o.x,o.y+o.height/2);case"center":return h.center(o)}}function x(o){return Math.min(o.width,o.height)}function D(o,t){const e=x(t);return n.add(n.scale(o,e,e),s.center(t))}function P(o,t){const e=x(t);return s.scale(e,e,o)}function y(o,t){const e=D(o,t),r=P(o,t);return h.fromPointAndDimensions(e,r)}function A(o,t){const e=function(o){return 1/x(o)}(t);return n.scale(n.subtract(o,s.center(t)),e,e)}function C(o,t,e){const r=h.fromPoints(o,t);if(e){const e=Math.max(r.width,r.height),i=r.height>r.width;return h.create(t.x<=o.x?i?o.x-e:t.x:o.x,t.y<=o.y?i?t.y:o.y-e:o.y,e,e)}return r}function L(o,t,e,r,i){const s=n.subtract(e,t),{x:a,y:d,width:c,height:l}=o,u=a+c,w=d+l,p=n.create(a,d),b=n.create(a,w),v=n.create(u,d),m=n.create(u,w);switch(r){case"top-left":return C(m,e,!!i);case"top":return C(m,n.create(a,e.y),!!i);case"top-right":return C(b,e,!!i);case"right":return C(b,n.create(e.x,d),!!i);case"bottom-right":return C(p,e,!!i);case"bottom":return C(p,n.create(u,e.y),!!i);case"bottom-left":return C(v,e,!!i);case"left":return C(m,n.create(e.x,d),!!i);case"center":return h.create(o.x+s.x,o.y+s.y,o.width,o.height)}}function T(o){const t=o.target;return function(o){return c(o)||l(o)||u(o)}(t)&&"edit"!==t.mode}const B=({id:t,rotation:e,name:r,point:i,onPointerDown:n},s)=>o("div",{id:t,class:"bounds-anchor-position",style:{top:`${i.y}px`,left:`${i.x}px`},onTouchStart:o=>o.preventDefault(),onPointerDown:n},o("div",{class:"bounds-anchor",style:{transform:`rotateZ(${null!=e?e:0}deg)`}},o("slot",{name:r},s))),M=({id:t})=>o("filter",{id:t,filterUnits:"userSpaceOnUse"},o("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"2"}),o("feOffset",{dx:"0",dy:"1",result:"offsetblur"}),o("feFlood",{"flood-color":"#000000","flood-opacity":"0.25"}),o("feComposite",{in2:"offsetblur",operator:"in"}),o("feMerge",null,o("feMergeNode",null),o("feMergeNode",{in:"SourceGraphic"}))),R=({start:t,end:e,onStartAnchorPointerDown:r,onCenterAnchorPointerDown:i,onEndAnchorPointerDown:s})=>{const h=a.normalize(a.toDegrees(a.fromPoints(t,e))-270),d=n.create((t.x+e.x)/2,(t.y+e.y)/2);return o("div",{class:"bounds-container"},o(B,{id:"bounding-box-1d-start-anchor",name:"start-anchor",rotation:h,point:t,onPointerDown:r},o("div",{class:f("bounds-default-anchor","bounds-cap-anchor")})),o(B,{id:"bounding-box-1d-end-anchor",name:"end-anchor",rotation:h,point:e,onPointerDown:s},o("div",{class:f("bounds-default-anchor","bounds-cap-anchor")})),o(B,{id:"bounding-box-1d-center-anchor",name:"center-anchor",point:d,onPointerDown:i},o("div",{class:f("bounds-default-anchor","bounds-center-anchor")})))};let S=class{constructor(o){t(this,o),this.editBegin=e(this,"editBegin",7),this.editEnd=e(this,"editEnd",7),this.viewRendered=e(this,"viewRendered",7),this.mode="",this.editAnchor="end",this.editStartPoint=o=>{this.editAnchor="start",this.startMarkup(o)},this.editCenterPoint=o=>{this.editAnchor="center",this.startMarkup(o)},this.editEndPoint=o=>{this.editAnchor="end",this.startMarkup(o)},this.updatePoints=o=>{if(null!=this.elementBounds&&this.pointerId===o.pointerId){const t=A(d(o,this.elementBounds),this.elementBounds);if("start"===this.editAnchor)this.start=t;else if("end"===this.editAnchor)this.end=t;else if(null!=this.start&&null!=this.end){const o=n.create((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2),e=o.x-t.x,r=o.y-t.y;this.start=n.create(this.start.x-e,this.start.y-r),this.end=n.create(this.end.x-e,this.end.y-r)}}},this.handleWindowPointerDown=o=>{T(o)&&this.startMarkup(o)},this.handleTouchStart=o=>{o.preventDefault()},this.startMarkup=o=>{var t;""!==this.mode&&null!=this.elementBounds&&null==this.pointerId&&(this.pointerId=o.pointerId,this.start=null!==(t=this.start)&&void 0!==t?t:A(d(o,this.elementBounds),this.elementBounds),this.editBegin.emit(),this.addDrawingInteractionListeners())},this.endMarkup=o=>{if(this.pointerId===o.pointerId){const o=null!=this.start&&null!=this.elementBounds?D(this.start,this.elementBounds):void 0,t=null!=this.end&&null!=this.elementBounds?D(this.end,this.elementBounds):void 0;""!==this.mode&&null!=o&&null!=t&&n.distance(o,t)>=2?this.editEnd.emit():(this.start=void 0,this.end=void 0),this.pointerId=void 0,this.removeDrawingInteractionListeners()}}}componentWillLoad(){this.updateViewport(),this.handleViewerChanged(this.viewer),this.updatePointsFromProps()}componentDidLoad(){this.updatePointsFromProps(),new ResizeObserver((()=>this.updateViewport())).observe(this.hostEl),"create"===this.mode&&window.addEventListener("pointerdown",this.handleWindowPointerDown)}componentDidRender(){""===this.mode&&this.viewRendered.emit()}disconnectedCallback(){window.removeEventListener("pointerdown",this.handleWindowPointerDown)}async dispose(){null!=this.viewer&&this.removeInteractionListeners(this.viewer),this.removeDrawingInteractionListeners(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}handleViewerChanged(o,t){null!=t&&this.removeInteractionListeners(t),null!=o&&this.addInteractionListeners(o)}handleStartJsonChange(){this.updatePointsFromProps()}handleEndJsonChange(){this.updatePointsFromProps()}handleModeChange(){"create"!==this.mode&&window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updateViewport(){const o=g(this.hostEl);this.elementBounds=o}updatePointsFromProps(){this.start=this.start||w(this.startJson),this.end=this.end||w(this.endJson)}render(){if(null!=this.start&&null!=this.end&&null!=this.elementBounds){const t=D(this.start,this.elementBounds),e=D(this.end,this.elementBounds),i=p(t,e);return function(...o){return o.every((o=>!isNaN(o.x)&&!isNaN(o.y)))}(t,e)?o(r,null,o("svg",{class:"svg",onTouchStart:this.handleTouchStart},o("defs",null,o(M,{id:"arrow-shadow"})),o("g",{filter:"url(#arrow-shadow)"},o("polygon",{id:"arrow-head",class:"head",points:b(i)}),o("line",{id:"arrow-line",class:"line",x1:t.x,y1:t.y,x2:i.base.x,y2:i.base.y}),"edit"===this.mode&&o("line",{id:"bounding-box-1d-line",class:"bounds-line",x1:t.x,y1:t.y,x2:e.x,y2:e.y}))),"edit"===this.mode&&o(R,{start:t,end:e,onStartAnchorPointerDown:this.editStartPoint,onCenterAnchorPointerDown:this.editCenterPoint,onEndAnchorPointerDown:this.editEndPoint}),"create"===this.mode&&o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart})):o(r,null)}return o(r,null,o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart}))}async addInteractionListeners(o){const t=await o.getInteractionTarget();"create"===this.mode&&t.addEventListener("pointerdown",this.startMarkup)}async addDrawingInteractionListeners(){""!==this.mode&&(window.addEventListener("pointermove",this.updatePoints),window.addEventListener("pointerup",this.endMarkup))}async removeInteractionListeners(o){(await o.getInteractionTarget()).removeEventListener("pointerdown",this.startMarkup)}async removeDrawingInteractionListeners(){window.removeEventListener("pointermove",this.updatePoints),window.removeEventListener("pointerup",this.endMarkup)}get hostEl(){return i(this)}static get watchers(){return{viewer:["handleViewerChanged"],start:["handleStartJsonChange"],end:["handleEndJsonChange"],mode:["handleModeChange"]}}};S.style=":host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;--viewer-markup-arrow-line-stroke-color:var(--red-800);--viewer-markup-arrow-line-stroke-width:4;--viewer-markup-arrow-head-stroke-color:var(--red-800);--viewer-markup-arrow-head-stroke-width:4;--viewer-markup-arrow-head-fill-color:var(--red-800);--viewer-markup-arrow-head-fill-opacity:1;--viewer-markup-arrow-bounds-cap-border-color:var(--blue-400);--viewer-markup-arrow-bounds-cap-border-width:1px;--viewer-markup-arrow-bounds-cap-background-color:white;--viewer-markup-arrow-bounds-center-anchor-border-color:white;--viewer-markup-arrow-bounds-center-anchor-border-width:1px;--viewer-markup-arrow-bounds-center-anchor-background-color:var(--blue-400);--viewer-markup-arrow-bounds-outline-width:1px;--viewer-markup-arrow-bounds-outline-color:var(--blue-400);--viewer-markup-arrow-bounds-anchor-width:9px;--viewer-markup-arrow-bounds-anchor-height:9px}.svg{pointer-events:none;width:100%;height:100%}.create-overlay{pointer-events:auto;position:absolute;left:0;top:0;width:100%;height:100%;cursor:crosshair}.line{pointer-events:auto;stroke:var(--viewer-markup-arrow-line-stroke-color);stroke-width:var(--viewer-markup-arrow-line-stroke-width);cursor:default}.head{pointer-events:auto;stroke:var(--viewer-markup-arrow-head-stroke-color);stroke-width:var(--viewer-markup-arrow-head-stroke-width);fill:var(--viewer-markup-arrow-head-fill-color);fill-opacity:var(--viewer-markup-arrow-head-fill-opacity);cursor:default}.bounds-line{pointer-events:auto;stroke:var(--viewer-markup-arrow-bounds-outline-color);stroke-width:var(--viewer-markup-arrow-bounds-outline-width)}.bounds-container{pointer-events:none;position:absolute;width:100%;height:100%;top:0;left:0;overflow:hidden}.bounds-anchor-position{position:absolute;transform:translate(-50%, -50%)}.bounds-anchor{pointer-events:auto;cursor:default;user-select:none}.bounds-default-anchor{width:var(--viewer-markup-arrow-bounds-anchor-width);height:var(--viewer-markup-arrow-bounds-anchor-height);box-sizing:border-box;box-shadow:0 0 2px rgba(0, 0, 0, 0.3)}.bounds-center-anchor{border-radius:100%;border-width:var(--viewer-markup-arrow-bounds-center-anchor-border-width);border-color:var(--viewer-markup-arrow-bounds-center-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-arrow-bounds-center-anchor-background-color)}.bounds-cap-anchor{border-width:var(--viewer-markup-arrow-bounds-cap-border-width);border-color:var(--viewer-markup-arrow-bounds-cap-border-color);border-style:solid;background-color:var(--viewer-markup-arrow-bounds-cap-background-color)}";const I=({bounds:t,onTopLeftAnchorPointerDown:e,onLeftAnchorPointerDown:r,onTopRightAnchorPointerDown:i,onRightAnchorPointerDown:n,onBottomLeftAnchorPointerDown:s,onBottomAnchorPointerDown:a,onBottomRightAnchorPointerDown:d,onTopAnchorPointerDown:c,onCenterAnchorPointerDown:l})=>{const u=h.pad(t,6),w=h.center(u);return o("div",{class:"bounds-container"},o("div",{class:"bounds-outline",style:{top:`${u.y}px`,left:`${u.x}px`,width:`${u.width}px`,height:`${u.height}px`}}),o(B,{id:"bounding-box-2d-top-left-anchor",name:"top-left-anchor",point:k(u,"top-left"),onPointerDown:e},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-left-anchor",name:"left-anchor",point:k(u,"left"),onPointerDown:r},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-top-right-anchor",name:"top-right-anchor",point:k(u,"top-right"),onPointerDown:i},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-right-anchor",name:"right-anchor",point:k(u,"right"),onPointerDown:n},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-bottom-left-anchor",name:"bottom-left-anchor",point:k(u,"bottom-left"),onPointerDown:s},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-bottom-anchor",name:"bottom-anchor",point:k(u,"bottom"),onPointerDown:a},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-bottom-right-anchor",name:"bottom-right-anchor",point:k(u,"bottom-right"),onPointerDown:d},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-top-anchor",name:"top-anchor",point:k(u,"top"),onPointerDown:c},o("div",{class:f("bounds-default-anchor","bounds-edge-anchor")})),o(B,{id:"bounding-box-2d-center-anchor",name:"center-anchor",point:w,onPointerDown:l},o("div",{class:f("bounds-default-anchor","bounds-center-anchor")})))};let E=class{constructor(o){t(this,o),this.editBegin=e(this,"editBegin",7),this.editEnd=e(this,"editEnd",7),this.viewRendered=e(this,"viewRendered",7),this.mode="",this.editAnchor="bottom-right",this.updateEditAnchor=(o,t)=>{this.resizeBounds=this.bounds,this.editAnchor=t,this.startMarkup(o)},this.updatePoints=o=>{var t;if(null!=this.bounds&&null!=this.startPosition&&null!=this.elementBounds&&this.pointerId===o.pointerId){const e=A(d(o,this.elementBounds),this.elementBounds);this.bounds=L(null!==(t=this.resizeBounds)&&void 0!==t?t:this.bounds,this.startPosition,e,this.editAnchor,o.shiftKey)}},this.handleWindowPointerDown=o=>{T(o)&&this.startMarkup(o)},this.handleTouchStart=o=>{o.preventDefault()},this.startMarkup=o=>{var t;if(""!==this.mode&&null!=this.elementBounds&&null==this.pointerId){const e=A(d(o,this.elementBounds),this.elementBounds);this.pointerId=o.pointerId,this.startPosition=e,this.bounds=null!==(t=this.bounds)&&void 0!==t?t:h.create(e.x,e.y,0,0),this.resizeBounds=this.bounds,this.editBegin.emit(),this.addDrawingInteractionListeners()}},this.endMarkup=o=>{var t,e;this.pointerId===o.pointerId&&(""!==this.mode&&null!=this.bounds&&(null===(t=this.bounds)||void 0===t?void 0:t.width)>0&&(null===(e=this.bounds)||void 0===e?void 0:e.height)>0?(this.editAnchor="bottom-right",this.editEnd.emit()):this.bounds=void 0,this.pointerId=void 0,this.removeDrawingInteractionListeners())}}componentWillLoad(){this.updateViewport(),this.handleViewerChanged(this.viewer),this.updateBoundsFromProps()}componentDidLoad(){this.updateBoundsFromProps(),new ResizeObserver((()=>this.updateViewport())).observe(this.hostEl),"create"===this.mode&&window.addEventListener("pointerdown",this.handleWindowPointerDown)}componentDidRender(){""===this.mode&&this.viewRendered.emit()}disconnectedCallback(){window.removeEventListener("pointerdown",this.handleWindowPointerDown)}async dispose(){null!=this.viewer&&this.removeInteractionListeners(this.viewer),this.removeDrawingInteractionListeners(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}handleViewerChanged(o,t){null!=t&&this.removeInteractionListeners(t),null!=o&&this.addInteractionListeners(o)}handleBoundsJsonChange(){this.updateBoundsFromProps()}handleModeChange(){"create"!==this.mode&&window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updateViewport(){const o=g(this.hostEl);this.elementBounds=o}updateBoundsFromProps(){var o;this.bounds=null!==(o=this.bounds)&&void 0!==o?o:v(this.boundsJson)}render(){if(null!=this.bounds&&null!=this.elementBounds){const t=y(this.bounds,this.elementBounds),e=h.center(t);return o(r,null,o("svg",{class:"svg",onTouchStart:this.handleTouchStart},o("defs",null,o(M,{id:"circle-shadow"})),o("g",{filter:"url(#circle-shadow)"},o("ellipse",{class:"ellipse",cx:e.x,cy:e.y,rx:t.width/2,ry:t.height/2,stroke:"#000ff0","stroke-width":4,fill:"none"}))),"edit"===this.mode&&o(I,{bounds:t,onTopLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"top-left"),onTopRightAnchorPointerDown:o=>this.updateEditAnchor(o,"top-right"),onTopAnchorPointerDown:o=>this.updateEditAnchor(o,"top"),onBottomLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom-left"),onBottomRightAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom-right"),onBottomAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom"),onLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"left"),onRightAnchorPointerDown:o=>this.updateEditAnchor(o,"right"),onCenterAnchorPointerDown:o=>this.updateEditAnchor(o,"center")}),"create"===this.mode&&o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart}))}return o(r,null,o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart}))}async addInteractionListeners(o){const t=await o.getInteractionTarget();"create"===this.mode&&t.addEventListener("pointerdown",this.startMarkup)}async addDrawingInteractionListeners(){""!==this.mode&&(window.addEventListener("pointermove",this.updatePoints),window.addEventListener("pointerup",this.endMarkup))}async removeInteractionListeners(o){(await o.getInteractionTarget()).removeEventListener("pointerdown",this.startMarkup)}async removeDrawingInteractionListeners(){window.removeEventListener("pointermove",this.updatePoints),window.removeEventListener("pointerup",this.endMarkup)}get hostEl(){return i(this)}static get watchers(){return{viewer:["handleViewerChanged"],bounds:["handleBoundsJsonChange"],mode:["handleModeChange"]}}};E.style=":host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;--viewer-markup-circle-ellipse-stroke-color:var(--red-700);--viewer-markup-circle-ellipse-stroke-width:4;--viewer-markup-circle-ellipse-fill-color:none;--viewer-markup-circle-ellipse-fill-opacity:0;--viewer-markup-circle-bounds-outline-border-color:var(--blue-400);--viewer-markup-circle-bounds-outline-border-width:1px;--viewer-markup-circle-bounds-edge-anchor-border-color:var(--blue-400);--viewer-markup-circle-bounds-edge-anchor-border-width:1px;--viewer-markup-circle-bounds-edge-anchor-background-color:white;--viewer-markup-circle-bounds-center-anchor-border-color:white;--viewer-markup-circle-bounds-center-anchor-border-width:1px;--viewer-markup-circle-bounds-center-anchor-background-color:var(--blue-400);--viewer-markup-circle-bounds-anchor-width:9px;--viewer-markup-circle-bounds-anchor-height:9px}.svg{pointer-events:none;width:100%;height:100%}.create-overlay{pointer-events:auto;position:absolute;left:0;top:0;width:100%;height:100%;cursor:crosshair}.ellipse{pointer-events:auto;stroke:var(--viewer-markup-circle-ellipse-stroke-color);stroke-width:var(--viewer-markup-circle-ellipse-stroke-width);fill:var(--viewer-markup-circle-ellipse-fill-color);fill-opacity:var(--viewer-markup-circle-ellipse-fill-opacity);cursor:default}.bounds-container{pointer-events:none;position:absolute;width:100%;height:100%;top:0;left:0;overflow:hidden}.bounds-outline{position:absolute;border-width:var(--viewer-markup-circle-bounds-outline-border-width);border-color:var(--viewer-markup-circle-bounds-outline-border-color);border-style:solid;box-shadow:0 0 3px rgba(0, 0, 0, 0.3)}.bounds-anchor-position{position:absolute;transform:translate(-50%, -50%)}.bounds-anchor{pointer-events:auto;cursor:default;user-select:none}.bounds-default-anchor{width:var(--viewer-markup-circle-bounds-anchor-width);height:var(--viewer-markup-circle-bounds-anchor-height);box-sizing:border-box;box-shadow:0 0 2px rgba(0, 0, 0, 0.3)}.bounds-center-anchor{border-radius:100%;border-width:var(--viewer-markup-circle-bounds-center-anchor-border-width);border-color:var(--viewer-markup-circle-bounds-center-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-circle-bounds-center-anchor-background-color)}.bounds-edge-anchor{border-width:var(--viewer-markup-circle-bounds-edge-anchor-border-width);border-color:var(--viewer-markup-circle-bounds-edge-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-circle-bounds-edge-anchor-background-color)}";let $=class{constructor(o){t(this,o),this.editBegin=e(this,"editBegin",7),this.editEnd=e(this,"editEnd",7),this.viewRendered=e(this,"viewRendered",7),this.mode="",this.editAnchor="bottom-right",this.screenPoints=[],this.handleWindowPointerDown=o=>{T(o)&&this.startMarkup(o)},this.handleTouchStart=o=>{o.preventDefault()},this.updateEditAnchor=(o,t)=>{null!=this.elementBounds&&(this.resizeBounds=this.bounds,this.resizePoints=this.points,this.editAnchor=t,this.resizeStartPosition=A(d(o,this.elementBounds),this.elementBounds),this.addEditingInteractionListeners())},this.updateBounds=o=>{var t,e,r;if(null!=this.resizeStartPosition&&null!=this.elementBounds&&null!=this.resizeBounds&&null!=this.resizePoints){const i=A(d(o,this.elementBounds),this.elementBounds),s=L(this.resizeBounds,this.resizeStartPosition,i,this.editAnchor,o.shiftKey);this.points=(e=this.resizeBounds,r=s,this.resizePoints.map((o=>n.add(n.scale(n.subtract(o,e),r.width/(e.width||1),r.height/(e.height||1)),r)))),this.screenPoints=null!==(t=this.convertPointsToScreen())&&void 0!==t?t:this.screenPoints,this.bounds=s}},this.updatePoints=o=>{if(this.pointerId===o.pointerId&&null!=this.points&&null!=this.elementBounds){const t=d(o,this.elementBounds),e=A(t,this.elementBounds);this.updateMinAndMax(e),this.points=[...this.points,e],this.screenPoints=[...this.screenPoints,t]}},this.startMarkup=o=>{var t,e;if(null==this.pointerId&&""!==this.mode&&null!=this.elementBounds){this.pointerId=o.pointerId;const r=d(o,this.elementBounds),i=A(r,this.elementBounds);this.updateMinAndMax(i),this.points=null!==(t=this.points)&&void 0!==t?t:[i],this.screenPoints=null!==(e=this.screenPoints)&&void 0!==e?e:[r],this.editBegin.emit(),this.addDrawingInteractionListeners()}},this.endMarkup=o=>{if(this.pointerId===o.pointerId){if(""!==this.mode&&null!=this.points&&this.points.length>2&&null!=this.elementBounds){const t=d(o,this.elementBounds),e=A(t,this.elementBounds);this.updateMinAndMax(e),this.points=[...this.points,e],this.screenPoints=[...this.screenPoints,t],this.editEnd.emit()}else this.points=void 0;this.min=void 0,this.max=void 0,this.pointerId=void 0,this.removeDrawingInteractionListeners()}},this.endEdit=()=>{this.resizeBounds=void 0,this.removeEditingInteractionListeners(),this.editEnd.emit()}}componentWillLoad(){this.updateViewport(),this.handleViewerChanged(this.viewer),this.updatePointsFromProps()}componentDidLoad(){new ResizeObserver((()=>this.updateViewport())).observe(this.hostEl),"create"===this.mode&&window.addEventListener("pointerdown",this.handleWindowPointerDown)}componentDidRender(){""===this.mode&&this.viewRendered.emit()}disconnectedCallback(){window.removeEventListener("pointerdown",this.handleWindowPointerDown)}async dispose(){null!=this.viewer&&this.removeInteractionListeners(this.viewer),this.removeDrawingInteractionListeners(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}handleViewerChanged(o,t){null!=t&&this.removeInteractionListeners(t),null!=o&&this.addInteractionListeners(o)}handlePointsJsonChange(){this.updatePointsFromProps()}handleBoundsJsonChange(){this.updatePointsFromProps()}handleModeChange(){"create"!==this.mode&&window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updateViewport(){var o;const t=g(this.hostEl);this.elementBounds=t,this.screenPoints=null!==(o=this.convertPointsToScreen())&&void 0!==o?o:this.screenPoints}updatePointsFromProps(){var o,t,e;this.points=null!==(o=this.points)&&void 0!==o?o:m(this.pointsJson),this.screenPoints=null!==(t=this.convertPointsToScreen())&&void 0!==t?t:[],this.bounds=null!==(e=this.bounds)&&void 0!==e?e:v(this.boundsJson)}render(){return this.screenPoints.length>0&&null!=this.elementBounds?o(r,null,o("svg",{class:"svg",onTouchStart:this.handleTouchStart},o("defs",null,o(M,{id:"freeform-markup-shadow"})),o("g",{filter:"url(#freeform-markup-shadow)"},o("path",{class:"path",d:this.screenPoints.reduce(((o,t)=>`${o}L${t.x},${t.y}`),`M${this.screenPoints[0].x},${this.screenPoints[0].y}`),fill:"none"}))),"edit"===this.mode&&null!=this.bounds&&o(I,{bounds:y(this.bounds,this.elementBounds),onTopLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"top-left"),onTopRightAnchorPointerDown:o=>this.updateEditAnchor(o,"top-right"),onTopAnchorPointerDown:o=>this.updateEditAnchor(o,"top"),onBottomLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom-left"),onBottomRightAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom-right"),onBottomAnchorPointerDown:o=>this.updateEditAnchor(o,"bottom"),onLeftAnchorPointerDown:o=>this.updateEditAnchor(o,"left"),onRightAnchorPointerDown:o=>this.updateEditAnchor(o,"right"),onCenterAnchorPointerDown:o=>this.updateEditAnchor(o,"center")}),"create"===this.mode&&o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart})):o(r,null,o("div",{class:"create-overlay",onTouchStart:this.handleTouchStart}))}async addInteractionListeners(o){const t=await o.getInteractionTarget();"create"===this.mode&&t.addEventListener("pointerdown",this.startMarkup)}async addDrawingInteractionListeners(){""!==this.mode&&(window.addEventListener("pointermove",this.updatePoints),window.addEventListener("pointerup",this.endMarkup))}async addEditingInteractionListeners(){"edit"===this.mode&&(window.addEventListener("pointermove",this.updateBounds),window.addEventListener("pointerup",this.endEdit))}async removeInteractionListeners(o){(await o.getInteractionTarget()).removeEventListener("pointerdown",this.startMarkup)}async removeDrawingInteractionListeners(){window.removeEventListener("pointermove",this.updatePoints),window.removeEventListener("pointerup",this.endMarkup)}async removeEditingInteractionListeners(){"edit"===this.mode&&(window.removeEventListener("pointermove",this.updateBounds),window.removeEventListener("pointerup",this.endEdit))}updateMinAndMax(o){this.min=null!=this.min?n.create(Math.min(this.min.x,o.x),Math.min(this.min.y,o.y)):o,this.max=null!=this.max?n.create(Math.max(this.max.x,o.x),Math.max(this.max.y,o.y)):o,this.bounds=h.create(this.min.x,this.min.y,this.max.x-this.min.x,this.max.y-this.min.y)}convertPointsToScreen(){var o;const t=this.elementBounds;if(null!=t)return null===(o=this.points)||void 0===o?void 0:o.map((o=>D(o,t)))}get hostEl(){return i(this)}static get watchers(){return{viewer:["handleViewerChanged"],points:["handlePointsJsonChange"],bounds:["handleBoundsJsonChange"],mode:["handleModeChange"]}}};$.style=":host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;--viewer-markup-freeform-stroke-color:var(--red-800);--viewer-markup-freeform-stroke-width:4;--viewer-markup-freeform-line-join:round;--viewer-markup-freeform-line-cap:round;--viewer-markup-freeform-bounds-outline-border-color:var(--blue-400);--viewer-markup-freeform-bounds-outline-border-width:1px;--viewer-markup-freeform-bounds-edge-anchor-border-color:var(--blue-400);--viewer-markup-freeform-bounds-edge-anchor-border-width:1px;--viewer-markup-freeform-bounds-edge-anchor-background-color:white;--viewer-markup-freeform-bounds-center-anchor-border-color:white;--viewer-markup-freeform-bounds-center-anchor-border-width:1px;--viewer-markup-freeform-bounds-center-anchor-background-color:var(--blue-400);--viewer-markup-freeform-bounds-anchor-width:9px;--viewer-markup-freeform-bounds-anchor-height:9px}.svg{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.path{pointer-events:auto;cursor:default;stroke:var(--viewer-markup-freeform-stroke-color);stroke-width:var(--viewer-markup-freeform-stroke-width);stroke-linejoin:var(--viewer-markup-freeform-line-join);stroke-linecap:var(--viewer-markup-freeform-line-cap)}.create-overlay{pointer-events:auto;position:absolute;left:0;top:0;width:100%;height:100%;cursor:crosshair}.bounds-container{pointer-events:none;position:absolute;width:100%;height:100%;top:0;left:0;overflow:hidden}.bounds-outline{position:absolute;border-width:var(--viewer-markup-freeform-bounds-outline-border-width);border-color:var(--viewer-markup-freeform-bounds-outline-border-color);border-style:solid;box-shadow:0 0 3px rgba(0, 0, 0, 0.3)}.bounds-anchor-position{position:absolute;transform:translate(-50%, -50%)}.bounds-anchor{pointer-events:auto;cursor:default;user-select:none}.bounds-default-anchor{width:var(--viewer-markup-freeform-bounds-anchor-width);height:var(--viewer-markup-freeform-bounds-anchor-height);box-sizing:border-box;box-shadow:0 0 2px rgba(0, 0, 0, 0.3)}.bounds-center-anchor{border-radius:100%;border-width:var(--viewer-markup-freeform-bounds-center-anchor-border-width);border-color:var(--viewer-markup-freeform-bounds-center-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-freeform-bounds-center-anchor-background-color)}.bounds-edge-anchor{border-width:var(--viewer-markup-freeform-bounds-edge-anchor-border-width);border-color:var(--viewer-markup-freeform-bounds-edge-anchor-border-color);border-style:solid;background-color:var(--viewer-markup-freeform-bounds-edge-anchor-background-color)}";export{S as vertex_viewer_markup_arrow,E as vertex_viewer_markup_circle,$ as vertex_viewer_markup_freeform}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{r as e,h as i,F as t,H as s}from"./p-cafa57a6.js";import{p as r,i as a}from"./p-0aba71fd.js";import"./p-f7cb7e59.js";import"./p-3a20a038.js";import"./p-fe11d694.js";import{M as n}from"./p-3810c24d.js";import{t as l}from"./p-2cefb1b0.js";import"./p-112455b1.js";import"./p-301660cf.js";let o=class{constructor(i){e(this,i),this.start=r.create(),this.end=r.create(),this.capLength=0,this.pointerEvents="none"}render(){const e=a.fromPoints(this.start,this.end),t=v(this.start,this.end,e,this.capLength),s=v(this.start,this.end,e,this.capLength+1);return i("svg",null,i("g",{class:"line-stroke","pointer-events":this.pointerEvents},i("line",{class:"line",x1:this.start.x,y1:this.start.y,x2:this.end.x,y2:this.end.y}),i("line",{class:"start-cap",x1:s.startEndCap.start.x,y1:s.startEndCap.start.y,x2:s.startEndCap.end.x,y2:s.startEndCap.end.y}),i("line",{class:"end-cap",x1:s.endEndCap.start.x,y1:s.endEndCap.start.y,x2:s.endEndCap.end.x,y2:s.endEndCap.end.y})),i("g",{class:"line-fill","pointer-events":this.pointerEvents},i("line",{class:"line",x1:this.start.x,y1:this.start.y,x2:this.end.x,y2:this.end.y}),i("line",{class:"start-cap",x1:t.startEndCap.start.x,y1:t.startEndCap.start.y,x2:t.startEndCap.end.x,y2:t.startEndCap.end.y}),i("line",{class:"end-cap",x1:t.endEndCap.start.x,y1:t.endEndCap.start.y,x2:t.endEndCap.end.x,y2:t.endEndCap.end.y})))}};function v(e,i,t,s){return{startEndCap:m(e,t,s),endEndCap:m(i,t,s)}}function m(e,i,t){const s=i+Math.PI/2;return{start:r.add(e,r.polar(t/2,s)),end:r.add(e,r.polar(t/2,s+Math.PI))}}o.style=":host{display:block;--viewer-measurement-line-stroke:var(--white);--viewer-measurement-line-stroke-opacity:0.75;--viewer-measurement-line-stroke-width:1.25px;--viewer-measurement-line-fill:var(--neutral-900);--viewer-measurement-line-fill-width:2px;--viewer-measurement-line-start-cap-visibility:initial;--viewer-measurement-line-end-cap-visibility:initial}svg{width:100%;height:100%}.line-stroke{stroke-width:calc(\n var(--viewer-measurement-line-fill-width) +\n var(--viewer-measurement-line-stroke-width)\n );stroke:var(--viewer-measurement-line-stroke);opacity:var(--viewer-measurement-line-stroke-opacity)}.line-fill{stroke-width:var(--viewer-measurement-line-fill-width);stroke:var(--viewer-measurement-line-fill)}.start-cap{visibility:var(--viewer-measurement-line-start-cap-visibility)}.end-cap{visibility:var(--viewer-measurement-line-end-cap-visibility)}";const h=({overlay:e,viewport:t,camera:s})=>i("line"===e.type?c:u,{overlay:e,viewport:t,camera:s}),c=({overlay:e,camera:t,viewport:s})=>{const{start:r,end:a}=l(e,{camera:t,viewport:s});return i("vertex-viewer-measurement-line",{class:"measurement-line",start:r,end:a})},u=({overlay:{x:e,y:s,z:r},camera:a,viewport:n})=>{const o={camera:a,viewport:n},{start:v,end:m}=l(e,o),{start:h,end:c}=l(s,o),{start:u,end:d}=l(r,o);return i(t,null,i("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-x",start:v,end:m}),i("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-y",start:h,end:c}),i("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-z",start:u,end:d}))};let d=class{constructor(i){e(this,i),this.measurementOverlays=new n,this.overlays=[],this.updateCamera=()=>{var e,i;this.camera=null===(i=null===(e=this.viewer)||void 0===e?void 0:e.frame)||void 0===i?void 0:i.scene.camera}}handleMeasurementOverlaysChanged(){this.removeModelListeners(),this.addModelListeners(),this.updateOverlays()}handleViewerChanged(e,i){this.removeViewerListeners(i),this.addViewerListeners(),this.updateCamera()}componentWillLoad(){this.addModelListeners(),this.addViewerListeners(),this.updateOverlays(),this.updateCamera()}addModelListeners(){this.onOverlaysChangedListener=this.measurementOverlays.onOverlaysChanged((()=>this.updateOverlays()))}removeModelListeners(){var e;null===(e=this.onOverlaysChangedListener)||void 0===e||e.dispose(),this.onOverlaysChangedListener=void 0}addViewerListeners(){var e;null===(e=this.viewer)||void 0===e||e.addEventListener("frameReceived",this.updateCamera)}removeViewerListeners(e){null==e||e.removeEventListener("frameReceived",this.updateCamera)}updateOverlays(){this.overlays=this.measurementOverlays.getOverlays()}render(){return i(s,null,this.overlays.map((e=>{if(null!=this.camera&&null!=this.viewer)return i(h,{overlay:e,viewport:this.viewer.viewport,camera:this.camera})})))}static get watchers(){return{measurementOverlays:["handleMeasurementOverlaysChanged"],viewer:["handleViewerChanged"]}}};d.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;--viewer-measurement-overlays-x-axis-color:var(--x-axis-color);--viewer-measurement-overlays-y-axis-color:var(--y-axis-color);--viewer-measurement-overlays-z-axis-color:var(--z-axis-color)}.measurement-line{position:absolute;width:100%;height:100%}.measurement-line.distance-vector-x{--viewer-measurement-line-fill:var(\n --viewer-measurement-overlays-x-axis-color\n )}.measurement-line.distance-vector-y{--viewer-measurement-line-fill:var(\n --viewer-measurement-overlays-y-axis-color\n )}.measurement-line.distance-vector-z{--viewer-measurement-line-fill:var(\n --viewer-measurement-overlays-z-axis-color\n )}";export{o as vertex_viewer_measurement_line,d as vertex_viewer_measurement_overlays}
4
+ import{r as e,h as i,F as t,H as s}from"./p-cafa57a6.js";import{p as r,h as a}from"./p-661f0612.js";import"./p-b8774c9c.js";import"./p-3a20a038.js";import"./p-77be081a.js";import{M as n}from"./p-3f0f83ad.js";import{t as l}from"./p-fa9a0bed.js";import"./p-112455b1.js";import"./p-e75bba97.js";let o=class{constructor(i){e(this,i),this.start=r.create(),this.end=r.create(),this.capLength=0,this.pointerEvents="none"}render(){const e=a.fromPoints(this.start,this.end),t=v(this.start,this.end,e,this.capLength),s=v(this.start,this.end,e,this.capLength+1);return i("svg",null,i("g",{class:"line-stroke","pointer-events":this.pointerEvents},i("line",{class:"line",x1:this.start.x,y1:this.start.y,x2:this.end.x,y2:this.end.y}),i("line",{class:"start-cap",x1:s.startEndCap.start.x,y1:s.startEndCap.start.y,x2:s.startEndCap.end.x,y2:s.startEndCap.end.y}),i("line",{class:"end-cap",x1:s.endEndCap.start.x,y1:s.endEndCap.start.y,x2:s.endEndCap.end.x,y2:s.endEndCap.end.y})),i("g",{class:"line-fill","pointer-events":this.pointerEvents},i("line",{class:"line",x1:this.start.x,y1:this.start.y,x2:this.end.x,y2:this.end.y}),i("line",{class:"start-cap",x1:t.startEndCap.start.x,y1:t.startEndCap.start.y,x2:t.startEndCap.end.x,y2:t.startEndCap.end.y}),i("line",{class:"end-cap",x1:t.endEndCap.start.x,y1:t.endEndCap.start.y,x2:t.endEndCap.end.x,y2:t.endEndCap.end.y})))}};function v(e,i,t,s){return{startEndCap:m(e,t,s),endEndCap:m(i,t,s)}}function m(e,i,t){const s=i+Math.PI/2;return{start:r.add(e,r.polar(t/2,s)),end:r.add(e,r.polar(t/2,s+Math.PI))}}o.style=":host{display:block;--viewer-measurement-line-stroke:var(--white);--viewer-measurement-line-stroke-opacity:0.75;--viewer-measurement-line-stroke-width:1.25px;--viewer-measurement-line-fill:var(--neutral-900);--viewer-measurement-line-fill-width:2px;--viewer-measurement-line-start-cap-visibility:initial;--viewer-measurement-line-end-cap-visibility:initial}svg{width:100%;height:100%}.line-stroke{stroke-width:calc(\n var(--viewer-measurement-line-fill-width) +\n var(--viewer-measurement-line-stroke-width)\n );stroke:var(--viewer-measurement-line-stroke);opacity:var(--viewer-measurement-line-stroke-opacity)}.line-fill{stroke-width:var(--viewer-measurement-line-fill-width);stroke:var(--viewer-measurement-line-fill)}.start-cap{visibility:var(--viewer-measurement-line-start-cap-visibility)}.end-cap{visibility:var(--viewer-measurement-line-end-cap-visibility)}";const h=({overlay:e,viewport:t,camera:s})=>i("line"===e.type?c:u,{overlay:e,viewport:t,camera:s}),c=({overlay:e,camera:t,viewport:s})=>{const{start:r,end:a}=l(e,{camera:t,viewport:s});return i("vertex-viewer-measurement-line",{class:"measurement-line",start:r,end:a})},u=({overlay:{x:e,y:s,z:r},camera:a,viewport:n})=>{const o={camera:a,viewport:n},{start:v,end:m}=l(e,o),{start:h,end:c}=l(s,o),{start:u,end:d}=l(r,o);return i(t,null,i("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-x",start:v,end:m}),i("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-y",start:h,end:c}),i("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-z",start:u,end:d}))};let d=class{constructor(i){e(this,i),this.measurementOverlays=new n,this.overlays=[],this.updateCamera=()=>{var e,i;this.camera=null===(i=null===(e=this.viewer)||void 0===e?void 0:e.frame)||void 0===i?void 0:i.scene.camera}}handleMeasurementOverlaysChanged(){this.removeModelListeners(),this.addModelListeners(),this.updateOverlays()}handleViewerChanged(e,i){this.removeViewerListeners(i),this.addViewerListeners(),this.updateCamera()}componentWillLoad(){this.addModelListeners(),this.addViewerListeners(),this.updateOverlays(),this.updateCamera()}addModelListeners(){this.onOverlaysChangedListener=this.measurementOverlays.onOverlaysChanged((()=>this.updateOverlays()))}removeModelListeners(){var e;null===(e=this.onOverlaysChangedListener)||void 0===e||e.dispose(),this.onOverlaysChangedListener=void 0}addViewerListeners(){var e;null===(e=this.viewer)||void 0===e||e.addEventListener("frameReceived",this.updateCamera)}removeViewerListeners(e){null==e||e.removeEventListener("frameReceived",this.updateCamera)}updateOverlays(){this.overlays=this.measurementOverlays.getOverlays()}render(){return i(s,null,this.overlays.map((e=>{if(null!=this.camera&&null!=this.viewer)return i(h,{overlay:e,viewport:this.viewer.viewport,camera:this.camera})})))}static get watchers(){return{measurementOverlays:["handleMeasurementOverlaysChanged"],viewer:["handleViewerChanged"]}}};d.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;--viewer-measurement-overlays-x-axis-color:var(--x-axis-color);--viewer-measurement-overlays-y-axis-color:var(--y-axis-color);--viewer-measurement-overlays-z-axis-color:var(--z-axis-color)}.measurement-line{position:absolute;width:100%;height:100%}.measurement-line.distance-vector-x{--viewer-measurement-line-fill:var(\n --viewer-measurement-overlays-x-axis-color\n )}.measurement-line.distance-vector-y{--viewer-measurement-line-fill:var(\n --viewer-measurement-overlays-y-axis-color\n )}.measurement-line.distance-vector-z{--viewer-measurement-line-fill:var(\n --viewer-measurement-overlays-z-axis-color\n )}";export{o as vertex_viewer_measurement_line,d as vertex_viewer_measurement_overlays}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{p as s,i as r}from"./p-661f0612.js";import{b as o}from"./p-e75bba97.js";class i{constructor(r){var i,l,a;this.start=null!==(i=r.start)&&void 0!==i?i:s.create(),this.end=null!==(l=r.end)&&void 0!==l?l:s.create(),this.id=null!==(a=r.id)&&void 0!==a?a:`arrow-markup--${o.create()}`}}class l{constructor(s){var i,l;this.bounds=null!==(i=s.bounds)&&void 0!==i?i:r.create(0,0,0,0),this.id=null!==(l=s.id)&&void 0!==l?l:`circle-markup--${o.create()}`}}class a{constructor(s){var i,l,a;this.bounds=null!==(i=s.bounds)&&void 0!==i?i:r.create(0,0,0,0),this.points=null!==(l=s.points)&&void 0!==l?l:[],this.id=null!==(a=s.id)&&void 0!==a?a:`freeform-markup--${o.create()}`}}export{i as A,l as C,a as F}
@@ -1,7 +1,7 @@
1
1
  /**!
2
2
  * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{_ as r,k as n,f as t,e,a as u,c as i}from"./p-0aba71fd.js";function o(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return u(this,void 0,void 0,(function(){var n,t,e;return i(this,(function(u){switch(u.label){case 0:return"number"!=typeof(n=r[0])?[3,4]:(t=r[1],e=new Promise((function(r){return setTimeout(r,n)})),null==t?[3,2]:[4,e]);case 1:return u.sent(),[2,t];case 2:return[2,e];case 3:return[3,5];case 4:return[2,Promise.reject(new TypeError("First argument to `delay` must be a number"))];case 5:return[2]}}))}))}var c=Object.freeze({__proto__:null,delay:o,timeout:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return u(this,void 0,void 0,(function(){var n,t,e,u,o;return i(this,(function(i){switch(i.label){case 0:return"number"!=typeof(n=r[0])?[3,4]:(t=r[1],u=new Promise((function(r,t){e=setTimeout((function(){return t(new Error("Promise timed out after ".concat(n,"ms")))}),n)})),null==t?[3,2]:[4,Promise.race([t,u])]);case 1:return o=i.sent(),clearTimeout(e),[2,o];case 2:return[2,u];case 3:return[3,5];case 4:return[2,Promise.reject("First argument to `timeout` must be a number")];case 5:return[2]}}))}))},retry:function(r,n){return void 0===n&&(n={}),u(this,void 0,void 0,(function(){function t(r,n,e){return u(this,void 0,void 0,(function(){var u,c,f,a,s;return i(this,(function(i){switch(i.label){case 0:c=void 0===(u=e.delaysInMs)?[]:u,a=void 0===(f=e.maxRetries)?1:f,i.label=1;case 1:return i.trys.push([1,4,,8]),[4,o(0===r||0===c.length?0:c[Math.min(r-1,c.length-1)])];case 2:return i.sent(),[4,n()];case 3:return[2,i.sent()];case 4:return s=i.sent(),r<a?[4,t(r+1,n,e)]:[3,6];case 5:return[2,i.sent()];case 6:throw s;case 7:return[3,8];case 8:return[2]}}))}))}return i(this,(function(){return[2,t(0,r,n)]}))}))},abort:function(r,n){return u(this,void 0,void 0,(function(){var t,e,o;return i(this,(function(c){switch(c.label){case 0:return t=new AbortController,e=function(r,n,t){return u(this,void 0,void 0,(function(){return i(this,(function(){return[2,new Promise((function(e){r.addEventListener(n,(function t(u){r.removeEventListener(n,t),e(u)}),t)}))]}))}))}(r,"abort",{signal:t.signal}),[4,Promise.race([n,e])];case 1:return(f=o=c.sent())instanceof Event&&"abort"===f.type?[2,{aborted:!0}]:(t.abort(),[2,{aborted:!1,result:o}])}var f}))}))}}),f=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,a=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,s=/^(#|0x)?([A-Fa-f0-9]{6})$/,v=function(r,n,t,e){return void 0===e&&(e=255),{r,g:n,b:t,a:e}},l=function(r){var n=16777215&r;return v(n>>16&255,n>>8&255,255&n)},d=function(r){var n=s.exec(r);if(null!=n)return l(parseInt(n[2],16))},h=function(r){var n=r.toString(16);return 1===n.length?"0"+n:n},p=Object.freeze({__proto__:null,create:v,fromNumber:l,fromHexString:d,fromCss:function(r){var n=f.exec(r);if(null!=n)return v(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]));var t=a.exec(r);return null!=t?v(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),Math.floor(255*parseFloat(t[4]))):s.test(r)?d(r):void 0},fromArray:function(r){return v(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#".concat(h(r.r)).concat(h(r.g)).concat(h(r.b))}}),b=function(n){function t(r){var e=n.call(this,"Validation error mapping object.")||this;return e.errors=r,Object.setPrototypeOf(e,t.prototype),e}return r(t,n),t}(Error);function y(r){return function(n){return null!=n?n:{errors:["".concat(r," is required.")]}}}function m(r,n){return function(t){return n(t[r])}}function j(r){return null!=r&&r.hasOwnProperty("errors")}function w(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return function(n){return r.reduce((function(r,n){return j(r)?r:n(r)}),n)}}var _=Object.freeze({__proto__:null,MapperValidationError:b,required:y,requiredProp:function(r){return function(n){var t=n[r];return null!=t?t:{errors:["".concat(r," is required")]}}},ifDefined:function(r){return function(n){return null!=n?r(n):n}},getProp:function(r){return function(n){return n[r]}},mapProp:m,mapRequiredProp:function(r,n){return m(r,w(y(r.toString()),n))},mapArray:function(r){return function(e){if(e.length>0){var u=n(e),i=u[0],o=u.slice(1),c=r(i);return o.reduce((function(e,u){var i=r(u);return j(i)?j(e)?{errors:t(t([],n(e.errors),!1),n(i.errors),!1)}:i:j(e)?e:t(t([],n(e),!1),[i],!1)}),j(c)?c:[c])}return[]}},isInvalid:j,ifInvalidThrow:function(r){return function(n){var t=r(n);if(j(t))throw new b(t.errors);return t}},read:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(e){return r.reduce((function(r,u){var i=u(e);return j(i)?j(r)?{errors:t(t([],n(r.errors),!1),n(i.errors),!1)}:i:j(r)?r:t(t([],n(r),!1),[i],!1)}),[])}},defineMapper:function(r,n){return function(t){var e,u,i=r(t);return u=n,j(e=i)?e:u(e)}},compose:w,pickFirst:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return function(n){return r.reduce((function(r,t){return void 0===r?t(n):r}),void 0)}}});
4
+ import{_ as r,n,g as t,f as e,c as u,e as i}from"./p-661f0612.js";function o(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return u(this,void 0,void 0,(function(){var n,t,e;return i(this,(function(u){switch(u.label){case 0:return"number"!=typeof(n=r[0])?[3,4]:(t=r[1],e=new Promise((function(r){return setTimeout(r,n)})),null==t?[3,2]:[4,e]);case 1:return u.sent(),[2,t];case 2:return[2,e];case 3:return[3,5];case 4:return[2,Promise.reject(new TypeError("First argument to `delay` must be a number"))];case 5:return[2]}}))}))}var c=Object.freeze({__proto__:null,delay:o,timeout:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return u(this,void 0,void 0,(function(){var n,t,e,u,o;return i(this,(function(i){switch(i.label){case 0:return"number"!=typeof(n=r[0])?[3,4]:(t=r[1],u=new Promise((function(r,t){e=setTimeout((function(){return t(new Error("Promise timed out after ".concat(n,"ms")))}),n)})),null==t?[3,2]:[4,Promise.race([t,u])]);case 1:return o=i.sent(),clearTimeout(e),[2,o];case 2:return[2,u];case 3:return[3,5];case 4:return[2,Promise.reject("First argument to `timeout` must be a number")];case 5:return[2]}}))}))},retry:function(r,n){return void 0===n&&(n={}),u(this,void 0,void 0,(function(){function t(r,n,e){return u(this,void 0,void 0,(function(){var u,c,f,a,s;return i(this,(function(i){switch(i.label){case 0:c=void 0===(u=e.delaysInMs)?[]:u,a=void 0===(f=e.maxRetries)?1:f,i.label=1;case 1:return i.trys.push([1,4,,8]),[4,o(0===r||0===c.length?0:c[Math.min(r-1,c.length-1)])];case 2:return i.sent(),[4,n()];case 3:return[2,i.sent()];case 4:return s=i.sent(),r<a?[4,t(r+1,n,e)]:[3,6];case 5:return[2,i.sent()];case 6:throw s;case 7:return[3,8];case 8:return[2]}}))}))}return i(this,(function(){return[2,t(0,r,n)]}))}))},abort:function(r,n){return u(this,void 0,void 0,(function(){var t,e,o;return i(this,(function(c){switch(c.label){case 0:return t=new AbortController,e=function(r,n,t){return u(this,void 0,void 0,(function(){return i(this,(function(){return[2,new Promise((function(e){r.addEventListener(n,(function t(u){r.removeEventListener(n,t),e(u)}),t)}))]}))}))}(r,"abort",{signal:t.signal}),[4,Promise.race([n,e])];case 1:return(f=o=c.sent())instanceof Event&&"abort"===f.type?[2,{aborted:!0}]:(t.abort(),[2,{aborted:!1,result:o}])}var f}))}))}}),f=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,a=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,s=/^(#|0x)?([A-Fa-f0-9]{6})$/,v=function(r,n,t,e){return void 0===e&&(e=255),{r,g:n,b:t,a:e}},l=function(r){var n=16777215&r;return v(n>>16&255,n>>8&255,255&n)},d=function(r){var n=s.exec(r);if(null!=n)return l(parseInt(n[2],16))},h=function(r){var n=r.toString(16);return 1===n.length?"0"+n:n},p=Object.freeze({__proto__:null,create:v,fromNumber:l,fromHexString:d,fromCss:function(r){var n=f.exec(r);if(null!=n)return v(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]));var t=a.exec(r);return null!=t?v(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),Math.floor(255*parseFloat(t[4]))):s.test(r)?d(r):void 0},fromArray:function(r){return v(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#".concat(h(r.r)).concat(h(r.g)).concat(h(r.b))}}),b=function(n){function t(r){var e=n.call(this,"Validation error mapping object.")||this;return e.errors=r,Object.setPrototypeOf(e,t.prototype),e}return r(t,n),t}(Error);function y(r){return function(n){return null!=n?n:{errors:["".concat(r," is required.")]}}}function m(r,n){return function(t){return n(t[r])}}function j(r){return null!=r&&r.hasOwnProperty("errors")}function w(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return function(n){return r.reduce((function(r,n){return j(r)?r:n(r)}),n)}}var _=Object.freeze({__proto__:null,MapperValidationError:b,required:y,requiredProp:function(r){return function(n){var t=n[r];return null!=t?t:{errors:["".concat(r," is required")]}}},ifDefined:function(r){return function(n){return null!=n?r(n):n}},getProp:function(r){return function(n){return n[r]}},mapProp:m,mapRequiredProp:function(r,n){return m(r,w(y(r.toString()),n))},mapArray:function(r){return function(e){if(e.length>0){var u=n(e),i=u[0],o=u.slice(1),c=r(i);return o.reduce((function(e,u){var i=r(u);return j(i)?j(e)?{errors:t(t([],n(e.errors),!1),n(i.errors),!1)}:i:j(e)?e:t(t([],n(e),!1),[i],!1)}),j(c)?c:[c])}return[]}},isInvalid:j,ifInvalidThrow:function(r){return function(n){var t=r(n);if(j(t))throw new b(t.errors);return t}},read:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(e){return r.reduce((function(r,u){var i=u(e);return j(i)?j(r)?{errors:t(t([],n(r.errors),!1),n(i.errors),!1)}:i:j(r)?r:t(t([],n(r),!1),[i],!1)}),[])}},defineMapper:function(r,n){return function(t){var e,u,i=r(t);return u=n,j(e=i)?e:u(e)}},compose:w,pickFirst:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return function(n){return r.reduce((function(r,t){return void 0===r?t(n):r}),void 0)}}});
5
5
  /*!
6
6
  * isobject <https://github.com/jonschlinkert/isobject>
7
7
  *
@@ -14,4 +14,4 @@ import{_ as r,k as n,f as t,e,a as u,c as i}from"./p-0aba71fd.js";function o(){f
14
14
  * Copyright (c) 2014-2017, Jon Schlinkert.
15
15
  * Released under the MIT License.
16
16
  */
17
- function g(r){return 1==(null!=(n=r)&&"object"==typeof n&&!1===Array.isArray(n))&&"[object Object]"===Object.prototype.toString.call(r);var n}var O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},A={exports:{}};!function(r,n){var t="__lodash_hash_undefined__",e=9007199254740991,u="[object Arguments]",i="[object Array]",o="[object Boolean]",c="[object Date]",f="[object Error]",a="[object Function]",s="[object Map]",v="[object Number]",l="[object Object]",d="[object Promise]",h="[object RegExp]",p="[object Set]",b="[object String]",y="[object WeakMap]",m="[object ArrayBuffer]",j="[object DataView]",w=/^\[object .+?Constructor\]$/,_=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[u]=g[i]=g[m]=g[o]=g[j]=g[c]=g[f]=g[a]=g[s]=g[v]=g[l]=g[h]=g[p]=g[b]=g[y]=!1;var A="object"==typeof O&&O&&O.Object===Object&&O,P="object"==typeof self&&self&&self.Object===Object&&self,E=A||P||Function("return this")(),S=n&&!n.nodeType&&n,I=S&&r&&!r.nodeType&&r,q=I&&I.exports===S,C=q&&A.process,F=function(){try{return C&&C.binding&&C.binding("util")}catch(r){}}(),M=F&&F.isTypedArray;function $(r,n){for(var t=-1,e=null==r?0:r.length;++t<e;)if(n(r[t],t,r))return!0;return!1}function k(r){var n=-1,t=Array(r.size);return r.forEach((function(r,e){t[++n]=[e,r]})),t}function x(r){var n=-1,t=Array(r.size);return r.forEach((function(r){t[++n]=r})),t}var T,D,R,U=Array.prototype,N=Object.prototype,V=E["__core-js_shared__"],Q=Function.prototype.toString,B=N.hasOwnProperty,H=(T=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",J=N.toString,W=RegExp("^"+Q.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=q?E.Buffer:void 0,L=E.Symbol,z=E.Uint8Array,K=N.propertyIsEnumerable,X=U.splice,Y=L?L.toStringTag:void 0,Z=Object.getOwnPropertySymbols,rr=G?G.isBuffer:void 0,nr=(D=Object.keys,R=Object,function(r){return D(R(r))}),tr=Sr(E,"DataView"),er=Sr(E,"Map"),ur=Sr(E,"Promise"),ir=Sr(E,"Set"),or=Sr(E,"WeakMap"),cr=Sr(Object,"create"),fr=Fr(tr),ar=Fr(er),sr=Fr(ur),vr=Fr(ir),lr=Fr(or),dr=L?L.prototype:void 0,hr=dr?dr.valueOf:void 0;function pr(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function br(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function yr(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function mr(r){var n=-1,t=null==r?0:r.length;for(this.__data__=new yr;++n<t;)this.add(r[n])}function jr(r){var n=this.__data__=new br(r);this.size=n.size}function wr(r,n){for(var t=r.length;t--;)if(Mr(r[t][0],n))return t;return-1}function _r(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":Y&&Y in Object(r)?function(r){var n=B.call(r,Y),t=r[Y];try{r[Y]=void 0;var e=!0}catch(r){}var u=J.call(r);return e&&(n?r[Y]=t:delete r[Y]),u}(r):function(r){return J.call(r)}(r)}function gr(r){return Ur(r)&&_r(r)==u}function Or(r,n,t,e,a){return r===n||(null==r||null==n||!Ur(r)&&!Ur(n)?r!=r&&n!=n:function(r,n,t,e,a,d){var y=kr(r),w=kr(n),_=y?i:qr(r),g=w?i:qr(n),O=(_=_==u?l:_)==l,A=(g=g==u?l:g)==l,P=_==g;if(P&&xr(r)){if(!xr(n))return!1;y=!0,O=!1}if(P&&!O)return d||(d=new jr),y||Nr(r)?Ar(r,n,t,e,a,d):function(r,n,t,e,u,i,a){switch(t){case j:if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case m:return!(r.byteLength!=n.byteLength||!i(new z(r),new z(n)));case o:case c:case v:return Mr(+r,+n);case f:return r.name==n.name&&r.message==n.message;case h:case b:return r==n+"";case s:var l=k;case p:if(l||(l=x),r.size!=n.size&&!(1&e))return!1;var d=a.get(r);if(d)return d==n;e|=2,a.set(r,n);var y=Ar(l(r),l(n),e,u,i,a);return a.delete(r),y;case"[object Symbol]":if(hr)return hr.call(r)==hr.call(n)}return!1}(r,n,_,t,e,a,d);if(!(1&t)){var E=O&&B.call(r,"__wrapped__"),S=A&&B.call(n,"__wrapped__");if(E||S){var I=E?r.value():r,q=S?n.value():n;return d||(d=new jr),a(I,q,t,e,d)}}return!!P&&(d||(d=new jr),function(r,n,t,e,u,i){var o=1&t,c=Pr(r),f=c.length;if(f!=Pr(n).length&&!o)return!1;for(var a=f;a--;){var s=c[a];if(!(o?s in n:B.call(n,s)))return!1}var v=i.get(r);if(v&&i.get(n))return v==n;var l=!0;i.set(r,n),i.set(n,r);for(var d=o;++a<f;){var h=r[s=c[a]],p=n[s];if(e)var b=o?e(p,h,s,n,r,i):e(h,p,s,r,n,i);if(!(void 0===b?h===p||u(h,p,t,e,i):b)){l=!1;break}d||(d="constructor"==s)}if(l&&!d){var y=r.constructor,m=n.constructor;y==m||!("constructor"in r)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m||(l=!1)}return i.delete(r),i.delete(n),l}(r,n,t,e,a,d))}(r,n,t,e,Or,a))}function Ar(r,n,t,e,u,i){var o=1&t,c=r.length,f=n.length;if(c!=f&&!(o&&f>c))return!1;var a=i.get(r);if(a&&i.get(n))return a==n;var s=-1,v=!0,l=2&t?new mr:void 0;for(i.set(r,n),i.set(n,r);++s<c;){var d=r[s],h=n[s];if(e)var p=o?e(h,d,s,n,r,i):e(d,h,s,r,n,i);if(void 0!==p){if(p)continue;v=!1;break}if(l){if(!$(n,(function(r,n){if(!l.has(n)&&(d===r||u(d,r,t,e,i)))return l.push(n)}))){v=!1;break}}else if(d!==h&&!u(d,h,t,e,i)){v=!1;break}}return i.delete(r),i.delete(n),v}function Pr(r){return function(r,n,t){var e=n(r);return kr(r)?e:function(r,n){for(var t=-1,e=n.length,u=r.length;++t<e;)r[u+t]=n[t];return r}(e,t(r))}(r,Vr,Ir)}function Er(r,n){var t,e,u=r.__data__;return("string"==(e=typeof(t=n))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t)?u["string"==typeof n?"string":"hash"]:u.map}function Sr(r,n){var t=function(r,n){return null==r?void 0:r[n]}(r,n);return function(r){return!(!Rr(r)||function(r){return!!H&&H in r}(r))&&(Tr(r)?W:w).test(Fr(r))}(t)?t:void 0}pr.prototype.clear=function(){this.__data__=cr?cr(null):{},this.size=0},pr.prototype.delete=function(r){var n=this.has(r)&&delete this.__data__[r];return this.size-=n?1:0,n},pr.prototype.get=function(r){var n=this.__data__;if(cr){var e=n[r];return e===t?void 0:e}return B.call(n,r)?n[r]:void 0},pr.prototype.has=function(r){var n=this.__data__;return cr?void 0!==n[r]:B.call(n,r)},pr.prototype.set=function(r,n){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=cr&&void 0===n?t:n,this},br.prototype.clear=function(){this.__data__=[],this.size=0},br.prototype.delete=function(r){var n=this.__data__,t=wr(n,r);return!(t<0||(t==n.length-1?n.pop():X.call(n,t,1),--this.size,0))},br.prototype.get=function(r){var n=this.__data__,t=wr(n,r);return t<0?void 0:n[t][1]},br.prototype.has=function(r){return wr(this.__data__,r)>-1},br.prototype.set=function(r,n){var t=this.__data__,e=wr(t,r);return e<0?(++this.size,t.push([r,n])):t[e][1]=n,this},yr.prototype.clear=function(){this.size=0,this.__data__={hash:new pr,map:new(er||br),string:new pr}},yr.prototype.delete=function(r){var n=Er(this,r).delete(r);return this.size-=n?1:0,n},yr.prototype.get=function(r){return Er(this,r).get(r)},yr.prototype.has=function(r){return Er(this,r).has(r)},yr.prototype.set=function(r,n){var t=Er(this,r),e=t.size;return t.set(r,n),this.size+=t.size==e?0:1,this},mr.prototype.add=mr.prototype.push=function(r){return this.__data__.set(r,t),this},mr.prototype.has=function(r){return this.__data__.has(r)},jr.prototype.clear=function(){this.__data__=new br,this.size=0},jr.prototype.delete=function(r){var n=this.__data__,t=n.delete(r);return this.size=n.size,t},jr.prototype.get=function(r){return this.__data__.get(r)},jr.prototype.has=function(r){return this.__data__.has(r)},jr.prototype.set=function(r,n){var t=this.__data__;if(t instanceof br){var e=t.__data__;if(!er||e.length<199)return e.push([r,n]),this.size=++t.size,this;t=this.__data__=new yr(e)}return t.set(r,n),this.size=t.size,this};var Ir=Z?function(r){return null==r?[]:(r=Object(r),function(n){for(var t=-1,e=null==n?0:n.length,u=0,i=[];++t<e;){var o=n[t];K.call(r,o)&&(i[u++]=o)}return i}(Z(r)))}:function(){return[]},qr=_r;function Cr(r,n){return!!(n=null==n?e:n)&&("number"==typeof r||_.test(r))&&r>-1&&r%1==0&&r<n}function Fr(r){if(null!=r){try{return Q.call(r)}catch(r){}try{return r+""}catch(r){}}return""}function Mr(r,n){return r===n||r!=r&&n!=n}(tr&&qr(new tr(new ArrayBuffer(1)))!=j||er&&qr(new er)!=s||ur&&qr(ur.resolve())!=d||ir&&qr(new ir)!=p||or&&qr(new or)!=y)&&(qr=function(r){var n=_r(r),t=n==l?r.constructor:void 0,e=t?Fr(t):"";if(e)switch(e){case fr:return j;case ar:return s;case sr:return d;case vr:return p;case lr:return y}return n});var $r=gr(function(){return arguments}())?gr:function(r){return Ur(r)&&B.call(r,"callee")&&!K.call(r,"callee")},kr=Array.isArray,xr=rr||function(){return!1};function Tr(r){if(!Rr(r))return!1;var n=_r(r);return n==a||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Dr(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=e}function Rr(r){var n=typeof r;return null!=r&&("object"==n||"function"==n)}function Ur(r){return null!=r&&"object"==typeof r}var Nr=M?function(r){return function(n){return r(n)}}(M):function(r){return Ur(r)&&Dr(r.length)&&!!g[_r(r)]};function Vr(r){return null!=(n=r)&&Dr(n.length)&&!Tr(n)?function(r,n){var t=kr(r),e=!t&&$r(r),u=!t&&!e&&xr(r),i=!t&&!e&&!u&&Nr(r),o=t||e||u||i,c=o?function(r,n){for(var t=-1,e=Array(r);++t<r;)e[t]=n(t);return e}(r.length,String):[],f=c.length;for(var a in r)!n&&!B.call(r,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Cr(a,f))||c.push(a);return c}(r):function(r){if((n=r)!==("function"==typeof(t=n&&n.constructor)&&t.prototype||N))return nr(r);var n,t,e=[];for(var u in Object(r))B.call(r,u)&&"constructor"!=u&&e.push(u);return e}(r);var n}r.exports=function(r,n){return Or(r,n)}}(A,A.exports);var P=A.exports;function E(r){return!1!==g(n=r)&&"function"==typeof(t=n.constructor)&&!1!==g(e=t.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var n,t,e}var S,I=Object.freeze({__proto__:null,defaults:function r(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];var i=n(t),o=i[0],c=i.slice(1),f=e({},o);if(0===c.length)return f;if(1===c.length){var a=c[0];for(var s in a)null==f[s]?f[s]=a[s]:E(f[s])&&(f[s]=r(f[s],a[s]));return f}return c.reduce((function(n,t){return r(n,t)}),o)},isPlainObject:E,isEqual:function(r,n){return P(r,n)},toPairs:function(r){return null!=r?Object.keys(r).map((function(n){return[n,r[n]]})):[]},fromPairs:function(r){return Array.isArray(r)?r.reduce((function(r,n){var t;return null!=n?e(e({},r),((t={})[n[0]]=n[1],t)):r}),{}):{}}}),q=function(r,n){return r<n?-1:r>n?1:0},C=function(r){var n=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=n?{scheme:n[2],authority:n[4],path:n[5],query:n[7],fragment:n[9]}:{}},F=function(r,n){var t="/"===r[0]?r:"/".concat(r);return e(e({},n),{path:t})},M=function(r){return null!=r.path?R(r.path.split("/")):[]},$=function(r,u){if(null!=r[1]){var i=t(t([],n(T(u)),!1),[r],!1);return e(e({},u),{query:i.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return u},k=function(r,n){return r.reduce((function(r,n){return $(n,r)}),n)},x=function(r,n){return U(r).reduce((function(r,n){return $(n,r)}),n)},T=function(r){return null!=r.query?D(r.query):[]},D=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},R=function(r){return r.filter((function(r){return r.length>0}))},U=function(r){var n=[];for(var t in r)n.push([t,r[t]]);return n},N=function(r){return r.concat().sort((t=q,function(r,e){var u=n(r,1)[0],i=n(e,1);return t(u,i[0])}));var t},V=Object.freeze({__proto__:null,parse:C,parseAndAddParams:function(r,n){var t=C(r);return n?x(n,t):t},isEqual:function(r,n){var t=JSON.stringify(N(T(r))),e=JSON.stringify(N(T(n)));return r.scheme===n.scheme&&r.authority===n.authority&&r.path===n.path&&r.fragment===n.fragment&&t===e},replacePath:F,pathAsArray:M,appendPath:function(r,n){var t=M(n),e=R(r.split("/"));return F(t.concat(e).join("/"),n)},addQueryString:function(r,n){var t=D(r);return k(t,n)},addQueryEntry:$,addQueryEntries:k,addQueryParams:x,replaceFragment:function(r,n){return e(e({},n),{fragment:r})},queryAsArray:T,queryAsMap:function(r){return T(r).reduce((function(r,t){var u,i=n(t,2),o=i[0],c=i[1];return e(e({},r),((u={})[o]=c,u))}),{})},toString:function(r){var n="";return null!=r.scheme&&r.scheme.length>0&&(n="".concat(r.scheme,":")),null!=r.authority&&r.authority.length>0&&(n+="//".concat(r.authority)),n+=r.path,null!=r.query&&r.query.length>0&&(n+="?".concat(r.query)),null!=r.fragment&&r.fragment.length>0&&(n+="#".concat(r.fragment)),n}}),Q=new Uint8Array(16);function B(){if(!S&&!(S="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return S(Q)}var H=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function J(r){return"string"==typeof r&&H.test(r)}for(var W,G,L=[],z=0;z<256;++z)L.push((z+256).toString(16).substr(1));var K=0,X=0;function Y(r,n,t){var e=n&&t||0,u=n||new Array(16),i=(r=r||{}).node||W,o=void 0!==r.clockseq?r.clockseq:G;if(null==i||null==o){var c=r.random||(r.rng||B)();null==i&&(i=W=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==o&&(o=G=16383&(c[6]<<8|c[7]))}var f=void 0!==r.msecs?r.msecs:Date.now(),a=void 0!==r.nsecs?r.nsecs:X+1,s=f-K+(a-X)/1e4;if(s<0&&void 0===r.clockseq&&(o=o+1&16383),(s<0||f>K)&&void 0===r.nsecs&&(a=0),a>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");K=f,X=a,G=o;var v=(1e4*(268435455&(f+=122192928e5))+a)%4294967296;u[e++]=v>>>24&255,u[e++]=v>>>16&255,u[e++]=v>>>8&255,u[e++]=255&v;var l=f/4294967296*1e4&268435455;u[e++]=l>>>8&255,u[e++]=255&l,u[e++]=l>>>24&15|16,u[e++]=l>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var d=0;d<6;++d)u[e+d]=i[d];return n||function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(L[r[n+0]]+L[r[n+1]]+L[r[n+2]]+L[r[n+3]]+"-"+L[r[n+4]]+L[r[n+5]]+"-"+L[r[n+6]]+L[r[n+7]]+"-"+L[r[n+8]]+L[r[n+9]]+"-"+L[r[n+10]]+L[r[n+11]]+L[r[n+12]]+L[r[n+13]]+L[r[n+14]]+L[r[n+15]]).toLowerCase();if(!J(t))throw TypeError("Stringified UUID is invalid");return t}(u)}var Z=Object.freeze({__proto__:null,create:function(){return Y()}}),rr=function(){function r(){this.listeners=[]}return r.prototype.on=function(r,n){var t,e=this;void 0===n&&(n={}),this.listeners.push(r);var u=new AbortController;return u.signal.addEventListener("abort",(function(){return e.off(r)})),null===(t=n.abort)||void 0===t||t.addEventListener("abort",(function(){return u.abort()})),{dispose:function(){return u.abort()}}},r.prototype.once=function(r){var n=this;return void 0===r&&(r={}),new Promise((function(t){n.on((function(r){return t(r)}),r)}))},r.prototype.onceWhen=function(r,n){var t;return void 0===n&&(n={}),u(this,void 0,void 0,(function(){var u,o=this;return i(this,(function(){return u=new AbortController,null===(t=n.abort)||void 0===t||t.addEventListener("abort",(function(){return u.abort()})),[2,new Promise((function(t){o.when(r,(function(n){r(n)&&(u.abort(),t(n))}),e(e({},n),{abort:u.signal}))}))]}))}))},r.prototype.when=function(r,n,t){return void 0===t&&(t={}),this.on((function(t){r(t)&&n(t)}),t)},r.prototype.off=function(r){var n=this.listeners.indexOf(r);-1!==n&&this.listeners.splice(n,1)},r.prototype.emit=function(r){this.listeners.forEach((function(n){return n(r)}))},r}();export{rr as E,c as a,Z as b,p as c,_ as m,I as o,V as u}
17
+ function g(r){return 1==(null!=(n=r)&&"object"==typeof n&&!1===Array.isArray(n))&&"[object Object]"===Object.prototype.toString.call(r);var n}var O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},A={exports:{}};!function(r,n){var t="__lodash_hash_undefined__",e=9007199254740991,u="[object Arguments]",i="[object Array]",o="[object Boolean]",c="[object Date]",f="[object Error]",a="[object Function]",s="[object Map]",v="[object Number]",l="[object Object]",d="[object Promise]",h="[object RegExp]",p="[object Set]",b="[object String]",y="[object WeakMap]",m="[object ArrayBuffer]",j="[object DataView]",w=/^\[object .+?Constructor\]$/,_=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[u]=g[i]=g[m]=g[o]=g[j]=g[c]=g[f]=g[a]=g[s]=g[v]=g[l]=g[h]=g[p]=g[b]=g[y]=!1;var A="object"==typeof O&&O&&O.Object===Object&&O,P="object"==typeof self&&self&&self.Object===Object&&self,E=A||P||Function("return this")(),S=n&&!n.nodeType&&n,I=S&&r&&!r.nodeType&&r,q=I&&I.exports===S,C=q&&A.process,F=function(){try{return C&&C.binding&&C.binding("util")}catch(r){}}(),M=F&&F.isTypedArray;function $(r,n){for(var t=-1,e=null==r?0:r.length;++t<e;)if(n(r[t],t,r))return!0;return!1}function x(r){var n=-1,t=Array(r.size);return r.forEach((function(r,e){t[++n]=[e,r]})),t}function T(r){var n=-1,t=Array(r.size);return r.forEach((function(r){t[++n]=r})),t}var k,D,R,U=Array.prototype,N=Object.prototype,V=E["__core-js_shared__"],Q=Function.prototype.toString,B=N.hasOwnProperty,H=(k=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",J=N.toString,W=RegExp("^"+Q.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=q?E.Buffer:void 0,L=E.Symbol,z=E.Uint8Array,K=N.propertyIsEnumerable,X=U.splice,Y=L?L.toStringTag:void 0,Z=Object.getOwnPropertySymbols,rr=G?G.isBuffer:void 0,nr=(D=Object.keys,R=Object,function(r){return D(R(r))}),tr=Sr(E,"DataView"),er=Sr(E,"Map"),ur=Sr(E,"Promise"),ir=Sr(E,"Set"),or=Sr(E,"WeakMap"),cr=Sr(Object,"create"),fr=Fr(tr),ar=Fr(er),sr=Fr(ur),vr=Fr(ir),lr=Fr(or),dr=L?L.prototype:void 0,hr=dr?dr.valueOf:void 0;function pr(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function br(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function yr(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function mr(r){var n=-1,t=null==r?0:r.length;for(this.__data__=new yr;++n<t;)this.add(r[n])}function jr(r){var n=this.__data__=new br(r);this.size=n.size}function wr(r,n){for(var t=r.length;t--;)if(Mr(r[t][0],n))return t;return-1}function _r(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":Y&&Y in Object(r)?function(r){var n=B.call(r,Y),t=r[Y];try{r[Y]=void 0;var e=!0}catch(r){}var u=J.call(r);return e&&(n?r[Y]=t:delete r[Y]),u}(r):function(r){return J.call(r)}(r)}function gr(r){return Ur(r)&&_r(r)==u}function Or(r,n,t,e,a){return r===n||(null==r||null==n||!Ur(r)&&!Ur(n)?r!=r&&n!=n:function(r,n,t,e,a,d){var y=xr(r),w=xr(n),_=y?i:qr(r),g=w?i:qr(n),O=(_=_==u?l:_)==l,A=(g=g==u?l:g)==l,P=_==g;if(P&&Tr(r)){if(!Tr(n))return!1;y=!0,O=!1}if(P&&!O)return d||(d=new jr),y||Nr(r)?Ar(r,n,t,e,a,d):function(r,n,t,e,u,i,a){switch(t){case j:if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case m:return!(r.byteLength!=n.byteLength||!i(new z(r),new z(n)));case o:case c:case v:return Mr(+r,+n);case f:return r.name==n.name&&r.message==n.message;case h:case b:return r==n+"";case s:var l=x;case p:if(l||(l=T),r.size!=n.size&&!(1&e))return!1;var d=a.get(r);if(d)return d==n;e|=2,a.set(r,n);var y=Ar(l(r),l(n),e,u,i,a);return a.delete(r),y;case"[object Symbol]":if(hr)return hr.call(r)==hr.call(n)}return!1}(r,n,_,t,e,a,d);if(!(1&t)){var E=O&&B.call(r,"__wrapped__"),S=A&&B.call(n,"__wrapped__");if(E||S){var I=E?r.value():r,q=S?n.value():n;return d||(d=new jr),a(I,q,t,e,d)}}return!!P&&(d||(d=new jr),function(r,n,t,e,u,i){var o=1&t,c=Pr(r),f=c.length;if(f!=Pr(n).length&&!o)return!1;for(var a=f;a--;){var s=c[a];if(!(o?s in n:B.call(n,s)))return!1}var v=i.get(r);if(v&&i.get(n))return v==n;var l=!0;i.set(r,n),i.set(n,r);for(var d=o;++a<f;){var h=r[s=c[a]],p=n[s];if(e)var b=o?e(p,h,s,n,r,i):e(h,p,s,r,n,i);if(!(void 0===b?h===p||u(h,p,t,e,i):b)){l=!1;break}d||(d="constructor"==s)}if(l&&!d){var y=r.constructor,m=n.constructor;y==m||!("constructor"in r)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m||(l=!1)}return i.delete(r),i.delete(n),l}(r,n,t,e,a,d))}(r,n,t,e,Or,a))}function Ar(r,n,t,e,u,i){var o=1&t,c=r.length,f=n.length;if(c!=f&&!(o&&f>c))return!1;var a=i.get(r);if(a&&i.get(n))return a==n;var s=-1,v=!0,l=2&t?new mr:void 0;for(i.set(r,n),i.set(n,r);++s<c;){var d=r[s],h=n[s];if(e)var p=o?e(h,d,s,n,r,i):e(d,h,s,r,n,i);if(void 0!==p){if(p)continue;v=!1;break}if(l){if(!$(n,(function(r,n){if(!l.has(n)&&(d===r||u(d,r,t,e,i)))return l.push(n)}))){v=!1;break}}else if(d!==h&&!u(d,h,t,e,i)){v=!1;break}}return i.delete(r),i.delete(n),v}function Pr(r){return function(r,n,t){var e=n(r);return xr(r)?e:function(r,n){for(var t=-1,e=n.length,u=r.length;++t<e;)r[u+t]=n[t];return r}(e,t(r))}(r,Vr,Ir)}function Er(r,n){var t,e,u=r.__data__;return("string"==(e=typeof(t=n))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t)?u["string"==typeof n?"string":"hash"]:u.map}function Sr(r,n){var t=function(r,n){return null==r?void 0:r[n]}(r,n);return function(r){return!(!Rr(r)||function(r){return!!H&&H in r}(r))&&(kr(r)?W:w).test(Fr(r))}(t)?t:void 0}pr.prototype.clear=function(){this.__data__=cr?cr(null):{},this.size=0},pr.prototype.delete=function(r){var n=this.has(r)&&delete this.__data__[r];return this.size-=n?1:0,n},pr.prototype.get=function(r){var n=this.__data__;if(cr){var e=n[r];return e===t?void 0:e}return B.call(n,r)?n[r]:void 0},pr.prototype.has=function(r){var n=this.__data__;return cr?void 0!==n[r]:B.call(n,r)},pr.prototype.set=function(r,n){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=cr&&void 0===n?t:n,this},br.prototype.clear=function(){this.__data__=[],this.size=0},br.prototype.delete=function(r){var n=this.__data__,t=wr(n,r);return!(t<0||(t==n.length-1?n.pop():X.call(n,t,1),--this.size,0))},br.prototype.get=function(r){var n=this.__data__,t=wr(n,r);return t<0?void 0:n[t][1]},br.prototype.has=function(r){return wr(this.__data__,r)>-1},br.prototype.set=function(r,n){var t=this.__data__,e=wr(t,r);return e<0?(++this.size,t.push([r,n])):t[e][1]=n,this},yr.prototype.clear=function(){this.size=0,this.__data__={hash:new pr,map:new(er||br),string:new pr}},yr.prototype.delete=function(r){var n=Er(this,r).delete(r);return this.size-=n?1:0,n},yr.prototype.get=function(r){return Er(this,r).get(r)},yr.prototype.has=function(r){return Er(this,r).has(r)},yr.prototype.set=function(r,n){var t=Er(this,r),e=t.size;return t.set(r,n),this.size+=t.size==e?0:1,this},mr.prototype.add=mr.prototype.push=function(r){return this.__data__.set(r,t),this},mr.prototype.has=function(r){return this.__data__.has(r)},jr.prototype.clear=function(){this.__data__=new br,this.size=0},jr.prototype.delete=function(r){var n=this.__data__,t=n.delete(r);return this.size=n.size,t},jr.prototype.get=function(r){return this.__data__.get(r)},jr.prototype.has=function(r){return this.__data__.has(r)},jr.prototype.set=function(r,n){var t=this.__data__;if(t instanceof br){var e=t.__data__;if(!er||e.length<199)return e.push([r,n]),this.size=++t.size,this;t=this.__data__=new yr(e)}return t.set(r,n),this.size=t.size,this};var Ir=Z?function(r){return null==r?[]:(r=Object(r),function(n){for(var t=-1,e=null==n?0:n.length,u=0,i=[];++t<e;){var o=n[t];K.call(r,o)&&(i[u++]=o)}return i}(Z(r)))}:function(){return[]},qr=_r;function Cr(r,n){return!!(n=null==n?e:n)&&("number"==typeof r||_.test(r))&&r>-1&&r%1==0&&r<n}function Fr(r){if(null!=r){try{return Q.call(r)}catch(r){}try{return r+""}catch(r){}}return""}function Mr(r,n){return r===n||r!=r&&n!=n}(tr&&qr(new tr(new ArrayBuffer(1)))!=j||er&&qr(new er)!=s||ur&&qr(ur.resolve())!=d||ir&&qr(new ir)!=p||or&&qr(new or)!=y)&&(qr=function(r){var n=_r(r),t=n==l?r.constructor:void 0,e=t?Fr(t):"";if(e)switch(e){case fr:return j;case ar:return s;case sr:return d;case vr:return p;case lr:return y}return n});var $r=gr(function(){return arguments}())?gr:function(r){return Ur(r)&&B.call(r,"callee")&&!K.call(r,"callee")},xr=Array.isArray,Tr=rr||function(){return!1};function kr(r){if(!Rr(r))return!1;var n=_r(r);return n==a||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Dr(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=e}function Rr(r){var n=typeof r;return null!=r&&("object"==n||"function"==n)}function Ur(r){return null!=r&&"object"==typeof r}var Nr=M?function(r){return function(n){return r(n)}}(M):function(r){return Ur(r)&&Dr(r.length)&&!!g[_r(r)]};function Vr(r){return null!=(n=r)&&Dr(n.length)&&!kr(n)?function(r,n){var t=xr(r),e=!t&&$r(r),u=!t&&!e&&Tr(r),i=!t&&!e&&!u&&Nr(r),o=t||e||u||i,c=o?function(r,n){for(var t=-1,e=Array(r);++t<r;)e[t]=n(t);return e}(r.length,String):[],f=c.length;for(var a in r)!n&&!B.call(r,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Cr(a,f))||c.push(a);return c}(r):function(r){if((n=r)!==("function"==typeof(t=n&&n.constructor)&&t.prototype||N))return nr(r);var n,t,e=[];for(var u in Object(r))B.call(r,u)&&"constructor"!=u&&e.push(u);return e}(r);var n}r.exports=function(r,n){return Or(r,n)}}(A,A.exports);var P=A.exports;function E(r){return!1!==g(n=r)&&"function"==typeof(t=n.constructor)&&!1!==g(e=t.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var n,t,e}var S,I=Object.freeze({__proto__:null,defaults:function r(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];var i=n(t),o=i[0],c=i.slice(1),f=e({},o);if(0===c.length)return f;if(1===c.length){var a=c[0];for(var s in a)null==f[s]?f[s]=a[s]:E(f[s])&&(f[s]=r(f[s],a[s]));return f}return c.reduce((function(n,t){return r(n,t)}),o)},isPlainObject:E,isEqual:function(r,n){return P(r,n)},toPairs:function(r){return null!=r?Object.keys(r).map((function(n){return[n,r[n]]})):[]},fromPairs:function(r){return Array.isArray(r)?r.reduce((function(r,n){var t;return null!=n?e(e({},r),((t={})[n[0]]=n[1],t)):r}),{}):{}}}),q=function(r,n){return r<n?-1:r>n?1:0},C=function(r){var n=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=n?{scheme:n[2],authority:n[4],path:n[5],query:n[7],fragment:n[9]}:{}},F=function(r,n){var t="/"===r[0]?r:"/".concat(r);return e(e({},n),{path:t})},M=function(r){return null!=r.path?R(r.path.split("/")):[]},$=function(r,u){if(null!=r[1]){var i=t(t([],n(k(u)),!1),[r],!1);return e(e({},u),{query:i.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return u},x=function(r,n){return r.reduce((function(r,n){return $(n,r)}),n)},T=function(r,n){return U(r).reduce((function(r,n){return $(n,r)}),n)},k=function(r){return null!=r.query?D(r.query):[]},D=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},R=function(r){return r.filter((function(r){return r.length>0}))},U=function(r){var n=[];for(var t in r)n.push([t,r[t]]);return n},N=function(r){return r.concat().sort((t=q,function(r,e){var u=n(r,1)[0],i=n(e,1);return t(u,i[0])}));var t},V=Object.freeze({__proto__:null,parse:C,parseAndAddParams:function(r,n){var t=C(r);return n?T(n,t):t},isEqual:function(r,n){var t=JSON.stringify(N(k(r))),e=JSON.stringify(N(k(n)));return r.scheme===n.scheme&&r.authority===n.authority&&r.path===n.path&&r.fragment===n.fragment&&t===e},replacePath:F,pathAsArray:M,appendPath:function(r,n){var t=M(n),e=R(r.split("/"));return F(t.concat(e).join("/"),n)},addQueryString:function(r,n){var t=D(r);return x(t,n)},addQueryEntry:$,addQueryEntries:x,addQueryParams:T,replaceFragment:function(r,n){return e(e({},n),{fragment:r})},queryAsArray:k,queryAsMap:function(r){return k(r).reduce((function(r,t){var u,i=n(t,2),o=i[0],c=i[1];return e(e({},r),((u={})[o]=c,u))}),{})},toString:function(r){var n="";return null!=r.scheme&&r.scheme.length>0&&(n="".concat(r.scheme,":")),null!=r.authority&&r.authority.length>0&&(n+="//".concat(r.authority)),n+=r.path,null!=r.query&&r.query.length>0&&(n+="?".concat(r.query)),null!=r.fragment&&r.fragment.length>0&&(n+="#".concat(r.fragment)),n}}),Q=new Uint8Array(16);function B(){if(!S&&!(S="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return S(Q)}var H=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function J(r){return"string"==typeof r&&H.test(r)}for(var W,G,L=[],z=0;z<256;++z)L.push((z+256).toString(16).substr(1));var K=0,X=0;function Y(r,n,t){var e=n&&t||0,u=n||new Array(16),i=(r=r||{}).node||W,o=void 0!==r.clockseq?r.clockseq:G;if(null==i||null==o){var c=r.random||(r.rng||B)();null==i&&(i=W=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==o&&(o=G=16383&(c[6]<<8|c[7]))}var f=void 0!==r.msecs?r.msecs:Date.now(),a=void 0!==r.nsecs?r.nsecs:X+1,s=f-K+(a-X)/1e4;if(s<0&&void 0===r.clockseq&&(o=o+1&16383),(s<0||f>K)&&void 0===r.nsecs&&(a=0),a>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");K=f,X=a,G=o;var v=(1e4*(268435455&(f+=122192928e5))+a)%4294967296;u[e++]=v>>>24&255,u[e++]=v>>>16&255,u[e++]=v>>>8&255,u[e++]=255&v;var l=f/4294967296*1e4&268435455;u[e++]=l>>>8&255,u[e++]=255&l,u[e++]=l>>>24&15|16,u[e++]=l>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var d=0;d<6;++d)u[e+d]=i[d];return n||function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(L[r[n+0]]+L[r[n+1]]+L[r[n+2]]+L[r[n+3]]+"-"+L[r[n+4]]+L[r[n+5]]+"-"+L[r[n+6]]+L[r[n+7]]+"-"+L[r[n+8]]+L[r[n+9]]+"-"+L[r[n+10]]+L[r[n+11]]+L[r[n+12]]+L[r[n+13]]+L[r[n+14]]+L[r[n+15]]).toLowerCase();if(!J(t))throw TypeError("Stringified UUID is invalid");return t}(u)}var Z=Object.freeze({__proto__:null,create:function(){return Y()}}),rr=function(){function r(){this.listeners=[]}return r.prototype.on=function(r,n){var t,e=this;void 0===n&&(n={}),this.listeners.push(r);var u=new AbortController;return u.signal.addEventListener("abort",(function(){return e.off(r)})),null===(t=n.abort)||void 0===t||t.addEventListener("abort",(function(){return u.abort()})),{dispose:function(){return u.abort()}}},r.prototype.once=function(r){var n=this;return void 0===r&&(r={}),new Promise((function(t){n.on((function(r){return t(r)}),r)}))},r.prototype.onceWhen=function(r,n){var t;return void 0===n&&(n={}),u(this,void 0,void 0,(function(){var u,o=this;return i(this,(function(){return u=new AbortController,null===(t=n.abort)||void 0===t||t.addEventListener("abort",(function(){return u.abort()})),[2,new Promise((function(t){o.when(r,(function(n){r(n)&&(u.abort(),t(n))}),e(e({},n),{abort:u.signal}))}))]}))}))},r.prototype.when=function(r,n,t){return void 0===t&&(t={}),this.on((function(t){r(t)&&n(t)}),t)},r.prototype.off=function(r){var n=this.listeners.indexOf(r);-1!==n&&this.listeners.splice(n,1)},r.prototype.emit=function(r){this.listeners.forEach((function(n){return n(r)}))},r}();export{rr as E,c as a,Z as b,p as c,_ as m,I as o,V as u}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{r as t,h as e,H as i}from"./p-cafa57a6.js";import{s}from"./p-f7cb7e59.js";import{g as n}from"./p-3a20a038.js";import{p as r}from"./p-a0df0e0c.js";import{a as o,M as a}from"./p-364ce21c.js";import{E as h}from"./p-fe11d694.js";import{M as l}from"./p-da2f4a56.js";import{M as d}from"./p-3810c24d.js";import{p as u}from"./p-0aba71fd.js";import{a as p}from"./p-d00e9203.js";import{g as c}from"./p-439220c6.js";import"./p-112455b1.js";import"./p-301660cf.js";var m=n.grpc,v=function(){function t(){}return t.serviceName="vertexvis.protobuf.sceneview.v1.SceneViewAPI",t}();function f(t,e){this.serviceHost=t,this.options=e||{}}v.UpdateModelEntities={methodName:"UpdateModelEntities",service:v,requestStream:!1,responseStream:!1,requestType:s.UpdateModelEntitiesRequest,responseType:s.UpdateModelEntitiesResponse},v.Measure={methodName:"Measure",service:v,requestStream:!1,responseStream:!1,requestType:s.MeasureRequest,responseType:s.MeasureResponse},f.prototype.updateModelEntities=function(t,e,i){2===arguments.length&&(i=arguments[1]);var s=m.unary(v.UpdateModelEntities,{request:t,host:this.serviceHost,metadata:e,transport:this.options.transport,debug:this.options.debug,onEnd:function(t){if(i)if(t.status!==m.Code.OK){var e=new Error(t.statusMessage);e.code=t.status,e.metadata=t.trailers,i(e,null)}else i(null,t.message)}});return{cancel:function(){i=null,s.close()}}},f.prototype.measure=function(t,e,i){2===arguments.length&&(i=arguments[1]);var s=m.unary(v.Measure,{request:t,host:this.serviceHost,metadata:e,transport:this.options.transport,debug:this.options.debug,onEnd:function(t){if(i)if(t.status!==m.Code.OK){var e=new Error(t.statusMessage);e.code=t.status,e.metadata=t.trailers,i(e,null)}else i(null,t.message)}});return{cancel:function(){i=null,s.close()}}};var w=f;class y{constructor(){this.observer=new ResizeObserver((()=>this.measure()))}observe(t){this.element=t,this.observer.observe(t),this.measure()}disconnect(){this.element=void 0,this.observer.disconnect()}measure(){var t;this.rect=null===(t=this.element)||void 0===t?void 0:t.getBoundingClientRect()}}class M{constructor(t,e){this.rectObserver=new y,this.handlePointerMove=async t=>{await this.isMeasurableEntityUnderPointer(t)?(this.clearCursor(),this.addCursor(p)):this.clearCursor()},this.handlePointerDown=t=>{this.ifNoInteraction(t,(async()=>{await this.isMeasurableEntityUnderPointer(t)?this.measureEntityUnderPointer(t):this.controller.clearEntities()}))},this.controller=t,this.measurableEntityTypes=e}get elementRect(){return this.rectObserver.rect}initialize(t,e){this.element=t,this.api=e,this.rectObserver.observe(t),t.addEventListener("pointermove",this.handlePointerMove),t.addEventListener("pointerdown",this.handlePointerDown)}dispose(){var t,e,i;this.rectObserver.disconnect(),null===(t=this.measurementInteraction)||void 0===t||t.dispose(),this.clearCursor(),null===(e=this.element)||void 0===e||e.removeEventListener("pointermove",this.handlePointerMove),null===(i=this.element)||void 0===i||i.removeEventListener("pointerdown",this.handlePointerDown),this.element=void 0,this.api=void 0}addCursor(t){this.cursor=this.ifInitialized((({api:e})=>e.addCursor(t)))}clearCursor(){var t;null===(t=this.cursor)||void 0===t||t.dispose(),this.cursor=void 0}async isMeasurableEntityUnderPointer(t){var e;const i=c(t,this.elementRect),s=await(null===(e=this.api)||void 0===e?void 0:e.getEntityTypeAtPoint(i));return null!=s&&this.measurableEntityTypes.includes(s)}measureEntityUnderPointer(t){this.ifInitialized((async({api:e})=>{const i=c(t,this.elementRect),[s]=await e.hitItems(i);null!=s?this.controller.addEntity(o.fromHit(s)):this.controller.clearEntities()}))}ifInitialized(t){if(null!=this.element&&null!=this.api)return t({element:this.element,api:this.api});throw new Error("Measurement interaction handler not initialized.")}ifNoInteraction(t,e){const i=u.create(t.clientX,t.clientY);let s=!1;const n=t=>{const e=u.create(t.clientX,t.clientY),n=u.distance(i,e);s=n>2},r=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),s||e()};window.addEventListener("pointermove",n),window.addEventListener("pointerup",r)}}let b=class{constructor(e){t(this,e),this.measurementModel=new l,this.measurementOverlays=new d,this.measurableEntityTypes=[h.PRECISE_SURFACE,h.IMPRECISE_SURFACE],this.configEnv="platprod",this.overlays=[]}connectedCallback(){this.setupInteractionHandler()}componentWillLoad(){this.setupController(),this.setupModelListeners(),this.setupInteractionHandler()}disconnectedCallback(){this.clearInteractionHandler(),this.clearModelListeners()}handleMeasurableEntityTypesChanged(){this.setupInteractionHandler()}handleMeasurementControllerChanged(){this.setupInteractionHandler()}handleMeasurementModelChanged(){this.setupController(),this.setupModelListeners()}handleViewerChanged(){this.setupInteractionHandler()}render(){return e(i,null,e("vertex-viewer-measurement-overlays",{viewer:this.viewer,measurementOverlays:this.measurementOverlays}))}setupController(){var t;const e=r(this.configEnv,this.config),i=new w(e.network.sceneViewHost);this.measurementController=new a(this.measurementModel,i,(()=>{var t;return null===(t=this.viewer)||void 0===t?void 0:t.token}),null===(t=this.viewer)||void 0===t?void 0:t.deviceId)}clearInteractionHandler(){var t;null===(t=this.registeredInteractionHandler)||void 0===t||t.then((t=>t.dispose())),this.registeredInteractionHandler=void 0}setupInteractionHandler(){var t;this.clearInteractionHandler(),null!=this.measurementController&&(this.registeredInteractionHandler=null===(t=this.viewer)||void 0===t?void 0:t.registerInteractionHandler(new M(this.measurementController,this.measurableEntityTypes)))}clearModelListeners(){var t,e;null===(t=this.onEntitiesChangedHandler)||void 0===t||t.dispose(),this.onEntitiesChangedHandler=void 0,null===(e=this.onOverlaysChangedHandler)||void 0===e||e.dispose(),this.onOverlaysChangedHandler=void 0}setupModelListeners(){this.onOverlaysChangedHandler=this.measurementOverlays.onOverlaysChanged((t=>{this.overlays=t}))}static get watchers(){return{measurableEntityTypes:["handleMeasurableEntityTypesChanged"],measurementController:["handleMeasurementControllerChanged"],measurementModel:["handleMeasurementModelChanged"],viewer:["handleViewerChanged"]}}};b.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}";export{b as vertex_viewer_measurement_precise}
4
+ import{r as t,h as e,H as i}from"./p-cafa57a6.js";import{s}from"./p-b8774c9c.js";import{g as n}from"./p-3a20a038.js";import{p as r}from"./p-809d09d9.js";import{a as o,M as a}from"./p-69058178.js";import{E as h}from"./p-77be081a.js";import{M as l}from"./p-5b342e97.js";import{M as d}from"./p-3f0f83ad.js";import{p as u}from"./p-661f0612.js";import{a as p}from"./p-3561d910.js";import{g as c}from"./p-487e054a.js";import"./p-112455b1.js";import"./p-e75bba97.js";var m=n.grpc,v=function(){function t(){}return t.serviceName="vertexvis.protobuf.sceneview.v1.SceneViewAPI",t}();function w(t,e){this.serviceHost=t,this.options=e||{}}v.UpdateModelEntities={methodName:"UpdateModelEntities",service:v,requestStream:!1,responseStream:!1,requestType:s.UpdateModelEntitiesRequest,responseType:s.UpdateModelEntitiesResponse},v.Measure={methodName:"Measure",service:v,requestStream:!1,responseStream:!1,requestType:s.MeasureRequest,responseType:s.MeasureResponse},w.prototype.updateModelEntities=function(t,e,i){2===arguments.length&&(i=arguments[1]);var s=m.unary(v.UpdateModelEntities,{request:t,host:this.serviceHost,metadata:e,transport:this.options.transport,debug:this.options.debug,onEnd:function(t){if(i)if(t.status!==m.Code.OK){var e=new Error(t.statusMessage);e.code=t.status,e.metadata=t.trailers,i(e,null)}else i(null,t.message)}});return{cancel:function(){i=null,s.close()}}},w.prototype.measure=function(t,e,i){2===arguments.length&&(i=arguments[1]);var s=m.unary(v.Measure,{request:t,host:this.serviceHost,metadata:e,transport:this.options.transport,debug:this.options.debug,onEnd:function(t){if(i)if(t.status!==m.Code.OK){var e=new Error(t.statusMessage);e.code=t.status,e.metadata=t.trailers,i(e,null)}else i(null,t.message)}});return{cancel:function(){i=null,s.close()}}};var f=w;class b{constructor(){this.observer=new ResizeObserver((()=>this.measure()))}observe(t){this.element=t,this.observer.observe(t),this.measure()}disconnect(){this.element=void 0,this.observer.disconnect()}measure(){var t;this.rect=null===(t=this.element)||void 0===t?void 0:t.getBoundingClientRect()}}class y{constructor(t,e){this.rectObserver=new b,this.handlePointerMove=async t=>{await this.isMeasurableEntityUnderPointer(t)?(this.clearCursor(),this.addCursor(p)):this.clearCursor()},this.handlePointerDown=t=>{this.ifNoInteraction(t,(async()=>{await this.isMeasurableEntityUnderPointer(t)?this.measureEntityUnderPointer(t):this.controller.clearEntities()}))},this.controller=t,this.measurableEntityTypes=e}get elementRect(){return this.rectObserver.rect}initialize(t,e){this.element=t,this.api=e,this.rectObserver.observe(t),t.addEventListener("pointermove",this.handlePointerMove),t.addEventListener("pointerdown",this.handlePointerDown)}dispose(){var t,e,i;this.rectObserver.disconnect(),null===(t=this.measurementInteraction)||void 0===t||t.dispose(),this.clearCursor(),null===(e=this.element)||void 0===e||e.removeEventListener("pointermove",this.handlePointerMove),null===(i=this.element)||void 0===i||i.removeEventListener("pointerdown",this.handlePointerDown),this.element=void 0,this.api=void 0}addCursor(t){this.cursor=this.ifInitialized((({api:e})=>e.addCursor(t)))}clearCursor(){var t;null===(t=this.cursor)||void 0===t||t.dispose(),this.cursor=void 0}async isMeasurableEntityUnderPointer(t){var e;const i=c(t,this.elementRect),s=await(null===(e=this.api)||void 0===e?void 0:e.getEntityTypeAtPoint(i));return null!=s&&this.measurableEntityTypes.includes(s)}measureEntityUnderPointer(t){this.ifInitialized((async({api:e})=>{const i=c(t,this.elementRect),[s]=await e.hitItems(i);null!=s?this.controller.addEntity(o.fromHit(s)):this.controller.clearEntities()}))}ifInitialized(t){if(null!=this.element&&null!=this.api)return t({element:this.element,api:this.api});throw new Error("Measurement interaction handler not initialized.")}ifNoInteraction(t,e){const i=u.create(t.clientX,t.clientY);let s=!1;const n=t=>{const e=u.create(t.clientX,t.clientY),n=u.distance(i,e);s=n>2},r=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),s||e()};window.addEventListener("pointermove",n),window.addEventListener("pointerup",r)}}let M=class{constructor(e){t(this,e),this.measurementModel=new l,this.measurementOverlays=new d,this.measurableEntityTypes=[h.PRECISE_SURFACE,h.IMPRECISE_SURFACE],this.configEnv="platprod",this.overlays=[]}connectedCallback(){this.setupInteractionHandler()}componentWillLoad(){this.setupController(),this.setupModelListeners(),this.setupInteractionHandler()}disconnectedCallback(){this.clearInteractionHandler(),this.clearModelListeners()}handleMeasurableEntityTypesChanged(){this.setupInteractionHandler()}handleMeasurementControllerChanged(){this.setupInteractionHandler()}handleMeasurementModelChanged(){this.setupController(),this.setupModelListeners()}handleViewerChanged(){this.setupInteractionHandler()}render(){return e(i,null,e("vertex-viewer-measurement-overlays",{viewer:this.viewer,measurementOverlays:this.measurementOverlays}))}setupController(){var t;const e=r(this.configEnv,this.config),i=new f(e.network.sceneViewHost);this.measurementController=new a(this.measurementModel,i,(()=>{var t;return null===(t=this.viewer)||void 0===t?void 0:t.token}),null===(t=this.viewer)||void 0===t?void 0:t.deviceId)}clearInteractionHandler(){var t;null===(t=this.registeredInteractionHandler)||void 0===t||t.then((t=>t.dispose())),this.registeredInteractionHandler=void 0}setupInteractionHandler(){var t;this.clearInteractionHandler(),null!=this.measurementController&&(this.registeredInteractionHandler=null===(t=this.viewer)||void 0===t?void 0:t.registerInteractionHandler(new y(this.measurementController,this.measurableEntityTypes)))}clearModelListeners(){var t,e;null===(t=this.onEntitiesChangedHandler)||void 0===t||t.dispose(),this.onEntitiesChangedHandler=void 0,null===(e=this.onOverlaysChangedHandler)||void 0===e||e.dispose(),this.onOverlaysChangedHandler=void 0}setupModelListeners(){this.onOverlaysChangedHandler=this.measurementOverlays.onOverlaysChanged((t=>{this.overlays=t}))}static get watchers(){return{measurableEntityTypes:["handleMeasurableEntityTypesChanged"],measurementController:["handleMeasurementControllerChanged"],measurementModel:["handleMeasurementModelChanged"],viewer:["handleViewerChanged"]}}};M.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}";export{M as vertex_viewer_measurement_precise}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{r as e,c as t,h as s,H as n,g as a}from"./p-cafa57a6.js";import{M as i}from"./p-849bd025.js";import"./p-f7cb7e59.js";import"./p-3a20a038.js";import"./p-fe11d694.js";import{M as r}from"./p-da2f4a56.js";import{m as h}from"./p-67446e35.js";import{s as o}from"./p-c738296e.js";import{D as d}from"./p-423410be.js";import{i as m}from"./p-2cefb1b0.js";import"./p-112455b1.js";import"./p-301660cf.js";import"./p-0aba71fd.js";let l=class{constructor(s){e(this,s),this.measurementAdded=t(this,"measurementAdded",7),this.measurementRemoved=t(this,"measurementRemoved",7),this.tool="distance",this.units="millimeters",this.fractionalDigits=2,this.disabled=!1,this.snapDistance=i,this.showAxisReferenceLines=!1,this.measurementModel=new r}async addMeasurement(e){if(e instanceof d){const{start:t,end:s,invalid:n,id:a}=e,i=this.createDistanceMeasurementElement();return i.id=a,i.start=t,i.end=s,i.invalid=n,this.updatePropsOnMeasurement(i),this.hostEl.appendChild(i),this.measurementAdded.emit(i),i}throw new Error(`Cannot add measurement. Unknown type '${e}'.`)}async removeMeasurement(e){const t=(await this.getMeasurementElements()).find((t=>t.id===e));return null!=t&&(t.remove(),this.measurementRemoved.emit(t)),t}async getMeasurementElement(e){return(await this.getMeasurementElements()).find((t=>t.id===e))}async getMeasurementElements(){return Array.from(this.hostEl.children).filter(m)}async handleSelectedMeasurementIdChanged(){this.measurementModel.clearOutcome(),(await this.getMeasurementElements()).forEach((e=>{e.id===this.selectedMeasurementId?(e.mode="edit",e.showAxisReferenceLines=this.showAxisReferenceLines,null!=e.start&&null!=e.end&&this.measurementModel.setOutcome({isApproximate:!0,results:[h(e.start,e.end)]})):(e.mode="",e.showAxisReferenceLines=!1)}))}handleToolChanged(){this.updatePropsOnMeasurementTool()}async handleViewerChanged(e){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleDisabledChanged(){this.updatePropsOnMeasurementTool()}handleDistanceTemplateIdChanged(){this.updatePropsOnMeasurementTool()}handleUnitsChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleFractionalDigitsChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleSnapDistanceChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}async handleMeasureEnd(e){const t=e;await this.addMeasurement(t.detail),this.selectedMeasurementId=t.detail.id}async handleMeasurementPointerDown(e){if(!this.disabled){const t=e.target,s=(await this.getMeasurementElements()).find((e=>e===t));null!=(null==s?void 0:s.id)&&""!==(null==s?void 0:s.id)&&(this.selectedMeasurementId=t.id)}}componentDidLoad(){this.updatePropsOnMeasurementTool()}render(){return s(n,null,s("slot",null))}createDistanceMeasurementElement(){if(null!=this.distanceTemplateId){const e=o(window.document.body,this.distanceTemplateId,m,(()=>console.warn(`Distance template with ID ${this.distanceTemplateId} not found. Using default distance element.`)),(()=>console.warn("Distance template does not contain a vertex-viewer-measurement-distance. Using default distance element.")));if(null!=e)return e}return document.createElement("vertex-viewer-measurement-distance")}async updatePropsOnMeasurements(){(await this.getMeasurementElements()).forEach((e=>this.updatePropsOnMeasurement(e)))}updatePropsOnMeasurement(e){e.fractionalDigits=this.fractionalDigits,e.units=this.units,e.snapDistance=this.snapDistance,e.viewer=this.viewer,e.classList.add("viewer-measurements__measurement")}updatePropsOnMeasurementTool(){const e=this.getMeasurementTool();null!=e&&(e.disabled=this.disabled,e.distanceTemplateId=this.distanceTemplateId,e.tool=this.tool,e.fractionalDigits=this.fractionalDigits,e.units=this.units,e.snapDistance=this.snapDistance,e.viewer=this.viewer)}getMeasurementTool(){return this.hostEl.querySelector("vertex-viewer-measurement-tool")}get hostEl(){return a(this)}static get watchers(){return{selectedMeasurementId:["handleSelectedMeasurementIdChanged"],tool:["handleToolChanged"],viewer:["handleViewerChanged"],disabled:["handleDisabledChanged"],distanceTemplateId:["handleDistanceTemplateIdChanged"],units:["handleUnitsChanged"],fractionalDigits:["handleFractionalDigitsChanged"],snapDistance:["handleSnapDistanceChanged"]}}};l.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}::slotted(.viewer-measurements__measurement[mode='']){cursor:pointer}::slotted(.viewer-measurements__measurement[mode='edit']){z-index:1}::slotted(.viewer-measurements__measurement[interacting-anchor='start']),::slotted(.viewer-measurements__measurement[interacting-anchor='end']),::slotted(vertex-viewer-measurement-tool[is-measuring]){z-index:2}";export{l as vertex_viewer_measurements}
4
+ import{r as e,c as t,h as s,H as n,g as a}from"./p-cafa57a6.js";import{M as i}from"./p-849bd025.js";import"./p-b8774c9c.js";import"./p-3a20a038.js";import"./p-77be081a.js";import{M as r}from"./p-5b342e97.js";import{m as h}from"./p-bcb66f97.js";import{s as o}from"./p-c738296e.js";import{D as d}from"./p-ffdeb08c.js";import{i as m}from"./p-fa9a0bed.js";import"./p-112455b1.js";import"./p-e75bba97.js";import"./p-661f0612.js";let l=class{constructor(s){e(this,s),this.measurementAdded=t(this,"measurementAdded",7),this.measurementRemoved=t(this,"measurementRemoved",7),this.tool="distance",this.units="millimeters",this.fractionalDigits=2,this.disabled=!1,this.snapDistance=i,this.showAxisReferenceLines=!1,this.measurementModel=new r}async addMeasurement(e){if(e instanceof d){const{start:t,end:s,invalid:n,id:a}=e,i=this.createDistanceMeasurementElement();return i.id=a,i.start=t,i.end=s,i.invalid=n,this.updatePropsOnMeasurement(i),this.hostEl.appendChild(i),this.measurementAdded.emit(i),i}throw new Error(`Cannot add measurement. Unknown type '${e}'.`)}async removeMeasurement(e){const t=(await this.getMeasurementElements()).find((t=>t.id===e));return null!=t&&(t.remove(),this.measurementRemoved.emit(t)),t}async getMeasurementElement(e){return(await this.getMeasurementElements()).find((t=>t.id===e))}async getMeasurementElements(){return Array.from(this.hostEl.children).filter(m)}async handleSelectedMeasurementIdChanged(){this.measurementModel.clearOutcome(),(await this.getMeasurementElements()).forEach((e=>{e.id===this.selectedMeasurementId?(e.mode="edit",e.showAxisReferenceLines=this.showAxisReferenceLines,null!=e.start&&null!=e.end&&this.measurementModel.setOutcome({isApproximate:!0,results:[h(e.start,e.end)]})):(e.mode="",e.showAxisReferenceLines=!1)}))}handleToolChanged(){this.updatePropsOnMeasurementTool()}async handleViewerChanged(e){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleDisabledChanged(){this.updatePropsOnMeasurementTool()}handleDistanceTemplateIdChanged(){this.updatePropsOnMeasurementTool()}handleUnitsChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleFractionalDigitsChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleSnapDistanceChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}async handleMeasureEnd(e){const t=e;await this.addMeasurement(t.detail),this.selectedMeasurementId=t.detail.id}async handleMeasurementPointerDown(e){if(!this.disabled){const t=e.target,s=(await this.getMeasurementElements()).find((e=>e===t));null!=(null==s?void 0:s.id)&&""!==(null==s?void 0:s.id)&&(this.selectedMeasurementId=t.id)}}componentDidLoad(){this.updatePropsOnMeasurementTool()}render(){return s(n,null,s("slot",null))}createDistanceMeasurementElement(){if(null!=this.distanceTemplateId){const e=o(window.document.body,this.distanceTemplateId,m,(()=>console.warn(`Distance template with ID ${this.distanceTemplateId} not found. Using default distance element.`)),(()=>console.warn("Distance template does not contain a vertex-viewer-measurement-distance. Using default distance element.")));if(null!=e)return e}return document.createElement("vertex-viewer-measurement-distance")}async updatePropsOnMeasurements(){(await this.getMeasurementElements()).forEach((e=>this.updatePropsOnMeasurement(e)))}updatePropsOnMeasurement(e){e.fractionalDigits=this.fractionalDigits,e.units=this.units,e.snapDistance=this.snapDistance,e.viewer=this.viewer,e.classList.add("viewer-measurements__measurement")}updatePropsOnMeasurementTool(){const e=this.getMeasurementTool();null!=e&&(e.disabled=this.disabled,e.distanceTemplateId=this.distanceTemplateId,e.tool=this.tool,e.fractionalDigits=this.fractionalDigits,e.units=this.units,e.snapDistance=this.snapDistance,e.viewer=this.viewer)}getMeasurementTool(){return this.hostEl.querySelector("vertex-viewer-measurement-tool")}get hostEl(){return a(this)}static get watchers(){return{selectedMeasurementId:["handleSelectedMeasurementIdChanged"],tool:["handleToolChanged"],viewer:["handleViewerChanged"],disabled:["handleDisabledChanged"],distanceTemplateId:["handleDistanceTemplateIdChanged"],units:["handleUnitsChanged"],fractionalDigits:["handleFractionalDigitsChanged"],snapDistance:["handleSnapDistanceChanged"]}}};l.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}::slotted(.viewer-measurements__measurement[mode='']){cursor:pointer}::slotted(.viewer-measurements__measurement[mode='edit']){z-index:1}::slotted(.viewer-measurements__measurement[interacting-anchor='start']),::slotted(.viewer-measurements__measurement[interacting-anchor='end']),::slotted(vertex-viewer-measurement-tool[is-measuring]){z-index:2}";export{l as vertex_viewer_measurements}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{p as t,l as n}from"./p-0aba71fd.js";function e(t,e){const{camera:r,viewport:a}=e,d=r.isPointBehindNear(t.start),i=r.isPointBehindNear(t.end);if(d||i){const e=r.intersectLineWithNear(t),s=n.create({start:d&&null!=e?e:t.start,end:i&&null!=e?e:t.end}),o=n.transformMatrix(s,r.projectionViewMatrix);return{start:a.transformVectorToViewport(o.start),end:a.transformVectorToViewport(o.end),hideStart:d,hideEnd:i}}{const e=n.transformMatrix(t,r.projectionViewMatrix);return{start:a.transformVectorToViewport(e.start),end:a.transformVectorToViewport(e.end),hideStart:!1,hideEnd:!1}}}function r(n,r,a){const{start:d,end:i,hideStart:s,hideEnd:o}=e(n,a);return{startPt:d,endPt:i,labelPt:t.lerp(d,i,.5),indicatorPt:"none"!==r?function(t,n,e){return e.viewport.transformWorldToViewport("start"===n?t.start:t.end,e.camera.projectionViewMatrix)}(n,r,a):void 0,hideStart:s,hideEnd:o}}function a(t){return t instanceof HTMLElement&&"VERTEX-VIEWER-MEASUREMENT-DISTANCE"===t.nodeName}export{r as g,a as i,e as t}
4
+ import{p as t,l as n}from"./p-661f0612.js";function e(t,e){const{camera:r,viewport:a}=e,i=r.isPointBehindNear(t.start),d=r.isPointBehindNear(t.end);if(i||d){const e=r.intersectLineWithNear(t),s=n.create({start:i&&null!=e?e:t.start,end:d&&null!=e?e:t.end}),o=n.transformMatrix(s,r.projectionViewMatrix);return{start:a.transformVectorToViewport(o.start),end:a.transformVectorToViewport(o.end),hideStart:i,hideEnd:d}}{const e=n.transformMatrix(t,r.projectionViewMatrix);return{start:a.transformVectorToViewport(e.start),end:a.transformVectorToViewport(e.end),hideStart:!1,hideEnd:!1}}}function r(n,r,a){const{start:i,end:d,hideStart:s,hideEnd:o}=e(n,a);return{startPt:i,endPt:d,labelPt:t.lerp(i,d,.5),indicatorPt:"none"!==r?function(t,n,e){return e.viewport.transformWorldToViewport("start"===n?t.start:t.end,e.camera.projectionViewMatrix)}(n,r,a):void 0,hideStart:s,hideEnd:o}}function a(t){return t instanceof HTMLElement&&"VERTEX-VIEWER-MEASUREMENT-DISTANCE"===t.nodeName}export{r as g,a as i,e as t}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2022 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{v as t}from"./p-661f0612.js";import{b as s}from"./p-e75bba97.js";class i{constructor(i){var r,e,o,l;this.start=null!==(r=i.start)&&void 0!==r?r:t.origin(),this.end=null!==(e=i.end)&&void 0!==e?e:t.origin(),this.invalid=null!==(o=i.invalid)&&void 0!==o&&o,this.id=null!==(l=i.id)&&void 0!==l?l:`measurement--${s.create()}`}getWorldDistance(){return t.distance(this.start,this.end)}getRealDistance(t){return t.convertRealValueToWorld(this.getWorldDistance())}}export{i as D}