@vertexvis/viewer 0.13.2-canary.8 → 0.13.2-canary.9
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.
- package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js +3 -5
- package/dist/cjs/vertex-viewer.cjs.entry.js +1 -1
- package/dist/collection/components/scene-tree-table-cell/scene-tree-table-cell.js +4 -6
- package/dist/collection/lib/interactions/multiTouchInteractionHandler.js +1 -1
- package/dist/custom-elements/index.js +4 -6
- package/dist/esm/vertex-scene-tree-table-cell.entry.js +3 -5
- package/dist/esm/vertex-viewer.entry.js +1 -1
- package/dist/viewer/{p-fd261908.entry.js → p-49d36e94.entry.js} +1 -1
- package/dist/viewer/p-90bb0a1f.entry.js +4 -0
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +7 -7
- package/dist/viewer/p-96020463.entry.js +0 -4
|
@@ -101,17 +101,15 @@ let SceneTreeTableCell = class {
|
|
|
101
101
|
} }, !((_b = this.node) === null || _b === void 0 ? void 0 : _b.isLeaf) && (index.h("div", { class: index$1.classnames('icon', {
|
|
102
102
|
'icon-expanded': !((_c = this.node) === null || _c === void 0 ? void 0 : _c.isLeaf) && ((_d = this.node) === null || _d === void 0 ? void 0 : _d.expanded),
|
|
103
103
|
'icon-collapsed': !((_e = this.node) === null || _e === void 0 ? void 0 : _e.isLeaf) && !((_f = this.node) === null || _f === void 0 ? void 0 : _f.expanded),
|
|
104
|
-
}) })))), index.h("div", { class: "content" }, this.value != null && this.value.trim() !== '' ? (index.h("slot", null, this.displayValue())) : (index.h("slot", { name: "placeholder" }, this.placeholder))),
|
|
105
|
-
|
|
106
|
-
this.toggleVisibility(event);
|
|
107
|
-
}, onTouchStart: (event) => {
|
|
104
|
+
}) })))), index.h("div", { class: "content" }, this.value != null && this.value.trim() !== '' ? (index.h("slot", null, this.displayValue())) : (index.h("slot", { name: "placeholder" }, this.placeholder))), index.h("button", { class: "visibility-btn no-shrink", "data-test-id": 'visibility-btn-' + ((_g = this.node) === null || _g === void 0 ? void 0 : _g.name), onPointerDown: (event) => {
|
|
105
|
+
console.log('touching the visibility toggle');
|
|
108
106
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
109
107
|
this.toggleVisibility(event);
|
|
110
108
|
} }, index.h("div", { class: index$1.classnames('icon', {
|
|
111
109
|
'icon-visible': !((_h = this.node) === null || _h === void 0 ? void 0 : _h.partiallyVisible) && ((_j = this.node) === null || _j === void 0 ? void 0 : _j.visible),
|
|
112
110
|
'icon-hidden': !((_k = this.node) === null || _k === void 0 ? void 0 : _k.partiallyVisible) && !((_l = this.node) === null || _l === void 0 ? void 0 : _l.visible),
|
|
113
111
|
'icon-partial': (_m = this.node) === null || _m === void 0 ? void 0 : _m.partiallyVisible,
|
|
114
|
-
}) }))
|
|
112
|
+
}) })), index.h("div", { class: "no-shrink" }, index.h("slot", { name: "right-gutter" })), !this.visibilityToggle && index.h("div", { class: "column-spacer" }))));
|
|
115
113
|
}
|
|
116
114
|
toggleAttribute(attr, value) {
|
|
117
115
|
if (value) {
|
|
@@ -1384,7 +1384,7 @@ class MultiTouchInteractionHandler {
|
|
|
1384
1384
|
(_c = this.interactionApi) === null || _c === void 0 ? void 0 : _c.panCameraByDelta(delta);
|
|
1385
1385
|
// Setting a minimum angle to prevent wobbling
|
|
1386
1386
|
console.log(Math.abs(angle));
|
|
1387
|
-
if (Math.abs(angle) > 0.
|
|
1387
|
+
if (Math.abs(angle) > 0.5) {
|
|
1388
1388
|
(_d = this.interactionApi) === null || _d === void 0 ? void 0 : _d.twistCamera(angle);
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
@@ -91,10 +91,8 @@ export class SceneTreeTableCell {
|
|
|
91
91
|
'icon-collapsed': !((_e = this.node) === null || _e === void 0 ? void 0 : _e.isLeaf) && !((_f = this.node) === null || _f === void 0 ? void 0 : _f.expanded),
|
|
92
92
|
}) })))),
|
|
93
93
|
h("div", { class: "content" }, this.value != null && this.value.trim() !== '' ? (h("slot", null, this.displayValue())) : (h("slot", { name: "placeholder" }, this.placeholder))),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.toggleVisibility(event);
|
|
97
|
-
}, onTouchStart: (event) => {
|
|
94
|
+
h("button", { class: "visibility-btn no-shrink", "data-test-id": 'visibility-btn-' + ((_g = this.node) === null || _g === void 0 ? void 0 : _g.name), onPointerDown: (event) => {
|
|
95
|
+
console.log('touching the visibility toggle');
|
|
98
96
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
99
97
|
this.toggleVisibility(event);
|
|
100
98
|
} },
|
|
@@ -102,7 +100,7 @@ export class SceneTreeTableCell {
|
|
|
102
100
|
'icon-visible': !((_h = this.node) === null || _h === void 0 ? void 0 : _h.partiallyVisible) && ((_j = this.node) === null || _j === void 0 ? void 0 : _j.visible),
|
|
103
101
|
'icon-hidden': !((_k = this.node) === null || _k === void 0 ? void 0 : _k.partiallyVisible) && !((_l = this.node) === null || _l === void 0 ? void 0 : _l.visible),
|
|
104
102
|
'icon-partial': (_m = this.node) === null || _m === void 0 ? void 0 : _m.partiallyVisible,
|
|
105
|
-
}) }))
|
|
103
|
+
}) })),
|
|
106
104
|
h("div", { class: "no-shrink" },
|
|
107
105
|
h("slot", { name: "right-gutter" })),
|
|
108
106
|
!this.visibilityToggle && h("div", { class: "column-spacer" }))));
|
|
@@ -371,4 +369,4 @@ export class SceneTreeTableCell {
|
|
|
371
369
|
}]; }
|
|
372
370
|
static get elementRef() { return "hostEl"; }
|
|
373
371
|
}
|
|
374
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
372
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NlbmUtdHJlZS10YWJsZS1jZWxsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2NlbmUtdHJlZS10YWJsZS1jZWxsL3NjZW5lLXRyZWUtdGFibGUtY2VsbC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLFNBQVMsRUFDVCxPQUFPLEVBQ1AsS0FBSyxFQUVMLENBQUMsRUFDRCxJQUFJLEVBQ0osSUFBSSxHQUNMLE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sVUFBVSxNQUFNLFlBQVksQ0FBQztBQVlwQyxNQUFNLE9BQU8sa0JBQWtCO0VBTC9CO0lBMEJFOzs7T0FHRztJQUVJLGdCQUFXLEdBQUcsSUFBSSxDQUFDO0lBc0IxQjs7OztPQUlHO0lBRUkseUJBQW9CLEdBQUcsS0FBSyxDQUFDO0lBRXBDOzs7OztPQUtHO0lBRUksbUNBQThCLEdBQUcsS0FBSyxDQUFDO0lBc0h0QyxpQkFBWSxHQUFHLEdBQVcsRUFBRTtNQUNsQyxNQUFNLElBQUksR0FDUixJQUFJLENBQUMsS0FBSyxJQUFJLElBQUksSUFBSSxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksRUFBRSxLQUFLLEVBQUU7UUFDNUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxXQUFXO1FBQ2xCLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDO01BRWpCLE9BQU8sSUFBSSxDQUFDO0lBQ2QsQ0FBQyxDQUFDO0lBRU0sMEJBQXFCLEdBQUcsQ0FBQyxLQUFtQixFQUFRLEVBQUU7O01BQzVELElBQ0UsQ0FBQyxLQUFLLENBQUMsZ0JBQWdCO1FBQ3ZCLEtBQUssQ0FBQyxNQUFNLEtBQUssQ0FBQztRQUNsQixDQUFDLElBQUksQ0FBQyxvQkFBb0IsRUFDMUI7UUFDQSxJQUFJLENBQUMsS0FBSyxDQUFDLE9BQU8sSUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLEtBQUksTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxRQUFRLENBQUEsRUFBRTtVQUMzRCxNQUFBLElBQUksQ0FBQyxJQUFJLDBDQUFFLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7U0FDcEM7YUFBTSxJQUFJLENBQUEsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxRQUFRLEtBQUksQ0FBQyxJQUFJLENBQUMsOEJBQThCLEVBQUU7VUFDdEUsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRTtZQUMvQixhQUFhLEVBQUUsSUFBSTtXQUNwQixDQUFDLENBQUM7U0FDSjthQUFNLElBQUksQ0FBQyxDQUFBLE1BQUEsSUFBSSxDQUFDLElBQUksMENBQUUsUUFBUSxDQUFBLEVBQUU7VUFDL0IsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRTtZQUMvQixNQUFNLEVBQUUsS0FBSyxDQUFDLE9BQU8sSUFBSSxLQUFLLENBQUMsT0FBTztZQUN0QyxLQUFLLEVBQUUsS0FBSyxDQUFDLFFBQVE7V0FDdEIsQ0FBQyxDQUFDO1NBQ0o7UUFDRCxJQUFJLENBQUMsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxJQUFJLEVBQUUsYUFBYSxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUM7T0FDdkU7SUFDSCxDQUFDLENBQUM7SUFFTSxvQkFBZSxHQUFHLENBQUMsS0FBbUIsRUFBUSxFQUFFO01BQ3RELElBQUksSUFBSSxDQUFDLElBQUksSUFBSSxJQUFJLElBQUksSUFBSSxDQUFDLElBQUksSUFBSSxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsb0JBQW9CLEVBQUU7UUFDeEUsSUFBSSxDQUFDLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7T0FDdkM7TUFDRCxJQUFJLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsSUFBSSxFQUFFLGFBQWEsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDO0lBQ3JFLENBQUMsQ0FBQztJQUVNLHFCQUFnQixHQUFHLENBQUMsS0FBZ0MsRUFBUSxFQUFFO01BQ3BFLElBQUksSUFBSSxDQUFDLElBQUksSUFBSSxJQUFJLElBQUksSUFBSSxDQUFDLElBQUksSUFBSSxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsb0JBQW9CLEVBQUU7UUFDeEUsSUFBSSxDQUFDLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7T0FDM0M7TUFDRCxJQUFJLENBQUMsaUJBQWlCLENBQUMsSUFBSSxDQUFDLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxJQUFJLEVBQUUsYUFBYSxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUM7SUFDekUsQ0FBQyxDQUFDO0dBU0g7RUExSVEsbUJBQW1COztJQUN4QixJQUFJLENBQUMsZUFBZSxDQUNsQixZQUFZLEVBQ1osSUFBSSxDQUFDLGFBQWEsTUFBSyxNQUFBLE1BQUEsSUFBSSxDQUFDLElBQUksMENBQUUsRUFBRSwwQ0FBRSxHQUFHLENBQUEsQ0FDMUMsQ0FBQztJQUNGLElBQUksQ0FBQyxlQUFlLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQSxNQUFBLElBQUksQ0FBQyxJQUFJLDBDQUFFLE9BQU8sQ0FBQSxDQUFDLENBQUM7SUFDdkQsSUFBSSxDQUFDLGVBQWUsQ0FBQyxhQUFhLEVBQUUsQ0FBQyxDQUFDLENBQUEsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxRQUFRLENBQUEsQ0FBQyxDQUFDO0lBQzNELElBQUksQ0FBQyxlQUFlLENBQUMsWUFBWSxFQUFFLENBQUMsQ0FBQyxDQUFBLE1BQUEsSUFBSSxDQUFDLElBQUksMENBQUUsZ0JBQWdCLENBQUEsQ0FBQyxDQUFDO0lBQ2xFLElBQUksQ0FBQyxlQUFlLENBQUMsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFBLE1BQUEsSUFBSSxDQUFDLElBQUksMENBQUUsTUFBTSxDQUFBLENBQUMsQ0FBQztJQUNyRCxJQUFJLENBQUMsZUFBZSxDQUFDLGVBQWUsRUFBRSxDQUFDLENBQUMsQ0FBQSxNQUFBLElBQUksQ0FBQyxJQUFJLDBDQUFFLFNBQVMsQ0FBQSxDQUFDLENBQUM7RUFDaEUsQ0FBQztFQUVNLE1BQU07O0lBQ1gsT0FBTyxDQUNMLEVBQUMsSUFBSSxJQUNILGNBQWMsRUFBRSxDQUFDLENBQWUsRUFBRSxFQUFFO1FBQ2xDLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDO1VBQ2hCLElBQUksRUFBRSxJQUFJLENBQUMsSUFBSTtVQUNmLGFBQWEsRUFBRSxDQUFDO1NBQ2pCLENBQUMsQ0FBQztNQUNMLENBQUMsRUFDRCxjQUFjLEVBQUUsR0FBRyxFQUFFO1FBQ25CLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDO01BQy9CLENBQUMsRUFDRCxhQUFhLEVBQUUsSUFBSSxDQUFDLHFCQUFxQjtNQUV6QyxXQUFLLEtBQUssRUFBQyxTQUFTO1FBQ2xCLFdBQUssS0FBSyxFQUFDLFdBQVc7VUFDcEIsWUFBTSxJQUFJLEVBQUMsYUFBYSxHQUFHLENBQ3ZCO1FBQ0wsSUFBSSxDQUFDLFlBQVksSUFBSSxDQUNwQixjQUNFLEtBQUssRUFBQyxzQkFBc0Isa0JBQ2QsU0FBUyxJQUFHLE1BQUEsSUFBSSxDQUFDLElBQUksMENBQUUsSUFBSSxDQUFBLEVBQ3pDLGFBQWEsRUFBRSxDQUFDLEtBQUssRUFBRSxFQUFFO1lBQ3ZCLEtBQUssQ0FBQyxjQUFjLEVBQUUsQ0FBQztZQUN2QixJQUFJLENBQUMsZUFBZSxDQUFDLEtBQUssQ0FBQyxDQUFDO1VBQzlCLENBQUMsSUFFQSxDQUFDLENBQUEsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxNQUFNLENBQUEsSUFBSSxDQUNyQixXQUNFLEtBQUssRUFBRSxVQUFVLENBQUMsTUFBTSxFQUFFO1lBQ3hCLGVBQWUsRUFBRSxDQUFDLENBQUEsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxNQUFNLENBQUEsS0FBSSxNQUFBLElBQUksQ0FBQyxJQUFJLDBDQUFFLFFBQVEsQ0FBQTtZQUMxRCxnQkFBZ0IsRUFDZCxDQUFDLENBQUEsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxNQUFNLENBQUEsSUFBSSxDQUFDLENBQUEsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxRQUFRLENBQUE7V0FDN0MsQ0FBQyxHQUNGLENBQ0gsQ0FDTSxDQUNWO1FBRUQsV0FBSyxLQUFLLEVBQUMsU0FBUyxJQUNqQixJQUFJLENBQUMsS0FBSyxJQUFJLElBQUksSUFBSSxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FDaEQsZ0JBQU8sSUFBSSxDQUFDLFlBQVksRUFBRSxDQUFRLENBQ25DLENBQUMsQ0FBQyxDQUFDLENBQ0YsWUFBTSxJQUFJLEVBQUMsYUFBYSxJQUFFLElBQUksQ0FBQyxXQUFXLENBQVEsQ0FDbkQsQ0FDRztRQUNOLGNBQ0UsS0FBSyxFQUFDLDBCQUEwQixrQkFDbEIsaUJBQWlCLElBQUcsTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxJQUFJLENBQUEsRUFDakQsYUFBYSxFQUFFLENBQUMsS0FBSyxFQUFFLEVBQUU7WUFDdkIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxnQ0FBZ0MsQ0FBQyxDQUFDO1lBQzlDLEtBQUssYUFBTCxLQUFLLHVCQUFMLEtBQUssQ0FBRSxjQUFjLEVBQUUsQ0FBQztZQUN4QixJQUFJLENBQUMsZ0JBQWdCLENBQUMsS0FBSyxDQUFDLENBQUM7VUFDL0IsQ0FBQztVQUVELFdBQ0UsS0FBSyxFQUFFLFVBQVUsQ0FBQyxNQUFNLEVBQUU7Y0FDeEIsY0FBYyxFQUNaLENBQUMsQ0FBQSxNQUFBLElBQUksQ0FBQyxJQUFJLDBDQUFFLGdCQUFnQixDQUFBLEtBQUksTUFBQSxJQUFJLENBQUMsSUFBSSwwQ0FBRSxPQUFPLENBQUE7Y0FDcEQsYUFBYSxFQUNYLENBQUMsQ0FBQSxNQUFBLElBQUksQ0FBQyxJQUFJLDBDQUFFLGdCQUFnQixDQUFBLElBQUksQ0FBQyxDQUFBLE1BQUEsSUFBSSxDQUFDLElBQUksMENBQUUsT0FBTyxDQUFBO2NBQ3JELGNBQWMsRUFBRSxNQUFBLElBQUksQ0FBQyxJQUFJLDBDQUFFLGdCQUFnQjthQUM1QyxDQUFDLEdBQ0YsQ0FDSztRQUNULFdBQUssS0FBSyxFQUFDLFdBQVc7VUFDcEIsWUFBTSxJQUFJLEVBQUMsY0FBYyxHQUFHLENBQ3hCO1FBQ0wsQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLElBQUksV0FBSyxLQUFLLEVBQUMsZUFBZSxHQUFHLENBQ3BELENBQ0QsQ0FDUixDQUFDO0VBQ0osQ0FBQztFQStDTyxlQUFlLENBQUMsSUFBWSxFQUFFLEtBQWM7SUFDbEQsSUFBSSxLQUFLLEVBQUU7TUFDVCxJQUFJLENBQUMsTUFBTSxDQUFDLFlBQVksQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLENBQUM7S0FDcEM7U0FBTTtNQUNMLElBQUksQ0FBQyxNQUFNLENBQUMsZUFBZSxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQ25DO0VBQ0gsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztDQUNGIn0=
|
|
@@ -21,7 +21,7 @@ export class MultiTouchInteractionHandler {
|
|
|
21
21
|
(_c = this.interactionApi) === null || _c === void 0 ? void 0 : _c.panCameraByDelta(delta);
|
|
22
22
|
// Setting a minimum angle to prevent wobbling
|
|
23
23
|
console.log(Math.abs(angle));
|
|
24
|
-
if (Math.abs(angle) > 0.
|
|
24
|
+
if (Math.abs(angle) > 0.5) {
|
|
25
25
|
(_d = this.interactionApi) === null || _d === void 0 ? void 0 : _d.twistCamera(angle);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -99363,17 +99363,15 @@ let SceneTreeTableCell = class extends HTMLElement$1 {
|
|
|
99363
99363
|
} }, !((_b = this.node) === null || _b === void 0 ? void 0 : _b.isLeaf) && (h("div", { class: classnames('icon', {
|
|
99364
99364
|
'icon-expanded': !((_c = this.node) === null || _c === void 0 ? void 0 : _c.isLeaf) && ((_d = this.node) === null || _d === void 0 ? void 0 : _d.expanded),
|
|
99365
99365
|
'icon-collapsed': !((_e = this.node) === null || _e === void 0 ? void 0 : _e.isLeaf) && !((_f = this.node) === null || _f === void 0 ? void 0 : _f.expanded),
|
|
99366
|
-
}) })))), h("div", { class: "content" }, this.value != null && this.value.trim() !== '' ? (h("slot", null, this.displayValue())) : (h("slot", { name: "placeholder" }, this.placeholder))),
|
|
99367
|
-
|
|
99368
|
-
this.toggleVisibility(event);
|
|
99369
|
-
}, onTouchStart: (event) => {
|
|
99366
|
+
}) })))), h("div", { class: "content" }, this.value != null && this.value.trim() !== '' ? (h("slot", null, this.displayValue())) : (h("slot", { name: "placeholder" }, this.placeholder))), h("button", { class: "visibility-btn no-shrink", "data-test-id": 'visibility-btn-' + ((_g = this.node) === null || _g === void 0 ? void 0 : _g.name), onPointerDown: (event) => {
|
|
99367
|
+
console.log('touching the visibility toggle');
|
|
99370
99368
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
99371
99369
|
this.toggleVisibility(event);
|
|
99372
99370
|
} }, h("div", { class: classnames('icon', {
|
|
99373
99371
|
'icon-visible': !((_h = this.node) === null || _h === void 0 ? void 0 : _h.partiallyVisible) && ((_j = this.node) === null || _j === void 0 ? void 0 : _j.visible),
|
|
99374
99372
|
'icon-hidden': !((_k = this.node) === null || _k === void 0 ? void 0 : _k.partiallyVisible) && !((_l = this.node) === null || _l === void 0 ? void 0 : _l.visible),
|
|
99375
99373
|
'icon-partial': (_m = this.node) === null || _m === void 0 ? void 0 : _m.partiallyVisible,
|
|
99376
|
-
}) }))
|
|
99374
|
+
}) })), h("div", { class: "no-shrink" }, h("slot", { name: "right-gutter" })), !this.visibilityToggle && h("div", { class: "column-spacer" }))));
|
|
99377
99375
|
}
|
|
99378
99376
|
toggleAttribute(attr, value) {
|
|
99379
99377
|
if (value) {
|
|
@@ -101498,7 +101496,7 @@ class MultiTouchInteractionHandler {
|
|
|
101498
101496
|
(_c = this.interactionApi) === null || _c === void 0 ? void 0 : _c.panCameraByDelta(delta);
|
|
101499
101497
|
// Setting a minimum angle to prevent wobbling
|
|
101500
101498
|
console.log(Math.abs(angle$1));
|
|
101501
|
-
if (Math.abs(angle$1) > 0.
|
|
101499
|
+
if (Math.abs(angle$1) > 0.5) {
|
|
101502
101500
|
(_d = this.interactionApi) === null || _d === void 0 ? void 0 : _d.twistCamera(angle$1);
|
|
101503
101501
|
}
|
|
101504
101502
|
}
|
|
@@ -97,17 +97,15 @@ let SceneTreeTableCell = class {
|
|
|
97
97
|
} }, !((_b = this.node) === null || _b === void 0 ? void 0 : _b.isLeaf) && (h("div", { class: classnames('icon', {
|
|
98
98
|
'icon-expanded': !((_c = this.node) === null || _c === void 0 ? void 0 : _c.isLeaf) && ((_d = this.node) === null || _d === void 0 ? void 0 : _d.expanded),
|
|
99
99
|
'icon-collapsed': !((_e = this.node) === null || _e === void 0 ? void 0 : _e.isLeaf) && !((_f = this.node) === null || _f === void 0 ? void 0 : _f.expanded),
|
|
100
|
-
}) })))), h("div", { class: "content" }, this.value != null && this.value.trim() !== '' ? (h("slot", null, this.displayValue())) : (h("slot", { name: "placeholder" }, this.placeholder))),
|
|
101
|
-
|
|
102
|
-
this.toggleVisibility(event);
|
|
103
|
-
}, onTouchStart: (event) => {
|
|
100
|
+
}) })))), h("div", { class: "content" }, this.value != null && this.value.trim() !== '' ? (h("slot", null, this.displayValue())) : (h("slot", { name: "placeholder" }, this.placeholder))), h("button", { class: "visibility-btn no-shrink", "data-test-id": 'visibility-btn-' + ((_g = this.node) === null || _g === void 0 ? void 0 : _g.name), onPointerDown: (event) => {
|
|
101
|
+
console.log('touching the visibility toggle');
|
|
104
102
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
105
103
|
this.toggleVisibility(event);
|
|
106
104
|
} }, h("div", { class: classnames('icon', {
|
|
107
105
|
'icon-visible': !((_h = this.node) === null || _h === void 0 ? void 0 : _h.partiallyVisible) && ((_j = this.node) === null || _j === void 0 ? void 0 : _j.visible),
|
|
108
106
|
'icon-hidden': !((_k = this.node) === null || _k === void 0 ? void 0 : _k.partiallyVisible) && !((_l = this.node) === null || _l === void 0 ? void 0 : _l.visible),
|
|
109
107
|
'icon-partial': (_m = this.node) === null || _m === void 0 ? void 0 : _m.partiallyVisible,
|
|
110
|
-
}) }))
|
|
108
|
+
}) })), h("div", { class: "no-shrink" }, h("slot", { name: "right-gutter" })), !this.visibilityToggle && h("div", { class: "column-spacer" }))));
|
|
111
109
|
}
|
|
112
110
|
toggleAttribute(attr, value) {
|
|
113
111
|
if (value) {
|
|
@@ -1380,7 +1380,7 @@ class MultiTouchInteractionHandler {
|
|
|
1380
1380
|
(_c = this.interactionApi) === null || _c === void 0 ? void 0 : _c.panCameraByDelta(delta);
|
|
1381
1381
|
// Setting a minimum angle to prevent wobbling
|
|
1382
1382
|
console.log(Math.abs(angle$1));
|
|
1383
|
-
if (Math.abs(angle$1) > 0.
|
|
1383
|
+
if (Math.abs(angle$1) > 0.5) {
|
|
1384
1384
|
(_d = this.interactionApi) === null || _d === void 0 ? void 0 : _d.twistCamera(angle$1);
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as i,h as s,H as n,g as e}from"./p-cafa57a6.js";import{p as h,v as o,h as r,j as a,r as l,b as c,q as u,d}from"./p-661f0612.js";import{l as v,m as w,n as f,t as p,E as m,p as g,o as y,q as b,S as C,r as P,s as T,u as I,x,y as D,z as S,B as k,W as E,g as M,C as O,G as j}from"./p-77be081a.js";import{E as A,m as R,c as F,o as B,u as z,a as N,b as $}from"./p-e75bba97.js";import{c as L}from"./p-f482325b.js";import{p as K}from"./p-809d09d9.js";import{C as W}from"./p-3561d910.js";import{g as V,c as q}from"./p-487e054a.js";import{I as H,f as U,C as G,W as J,a as _,b as X,d as Y,V as Q,e as Z,g as tt,h as it,i as st,S as nt}from"./p-d32b54cb.js";import{V as et}from"./p-a93a63a9.js";import"./p-112455b1.js";class ht{constructor(t){this.viewer=t,this.handleInteractionStarted=()=>{this.invalidateStencilBuffer(),this.pendingInteractionFinished=new Promise((t=>{this.pendingInteractionFinishedResolver=t}))},this.handleInteractionFinished=()=>{var t;null===(t=this.pendingInteractionFinishedResolver)||void 0===t||t.call(this),this.pendingInteractionFinished=void 0,this.pendingInteractionFinishedResolver=void 0},this.invalidateStencilBuffer=()=>{this.pendingStencilBuffer=void 0},t.addEventListener("interactionStarted",this.handleInteractionStarted),t.addEventListener("interactionFinished",this.handleInteractionFinished),t.addEventListener("frameReceived",(()=>{this.invalidateStencilBuffer()}))}async fetch(){var t;const i=await this.viewer.isSceneReady()?await this.viewer.scene():void 0,s=null!=i&&(i.crossSectioning().current().sectionPlanes.length>0||null!=this.viewer.featureLines),n=null===(t=this.viewer.frame)||void 0===t?void 0:t.scene.camera;if(s&&null!=this.viewer.stream&&null!=n){const t=await this.viewer.stream.getStencilBuffer({includeDepthBuffer:!0}),{stencilBuffer:i,depthBuffer:s,imageAttributes:e}=v(t),[h,o]=await Promise.all([w(new Uint8Array(i)),w(new Uint8Array(s))]);return ot.fromPng(h,e,i,f.fromPng(o,n,e))}}latest(){return null==this.pendingStencilBuffer&&(this.pendingStencilBuffer=this.fetch()),this.pendingStencilBuffer}async latestAfterInteraction(){return await this.pendingInteractionFinished,this.latest()}}class ot{constructor(t,i,s,n,e){this.imageAttr=t,this.imageBytes=i,this.pixelBytes=s,this.imageChannels=n,this.depthBuffer=e}static fromPng(t,i,s,n){if(t.data instanceof Uint8Array){if(1!==t.channels)throw new Error("Expected stencil PNG to have 1 color channel");return new ot(i,s,t.data,t.channels,n)}throw new Error("Expected stencil PNG to have depth of 8-bit")}getValue(t){const{width:i,height:s}=this.imageAttr.imageRect,n=h.subtract(t,this.imageAttr.imageRect),e=1/this.imageAttr.imageScale,o=h.scale(n,e,e);if(o.x>=0&&o.y>=0&&o.x<i&&o.y<s){const t=Math.floor(o.x)+Math.floor(o.y)*i;return this.pixelBytes[t]}return 0}hitTest(t){return 0!==this.getValue(t)}snapToNearestPixel(t,i,s=(()=>!0)){const n=2*i,e=h.create(t.x-i,t.y-i),o=[];for(let r=0;r<n*n;r++){const a=r%n,l=Math.floor(r/n),c=h.add(e,{x:a,y:l});if(h.distance(c,t)<=i){const t=this.getValue(c);255===t&&s(t)&&o.push(c)}}const r=o.sort(((i,s)=>h.distance(i,t)-h.distance(s,t)))[0];return null!=r?h.create(Math.floor(r.x)+.5,Math.floor(r.y)+.5):t}}class rt{constructor(t,i,s){this.stream=t,this.configProvider=i,this.imageScaleProvider=s}predicate(t){return t.altKey&&!t.shiftKey}async fn(t){var i;const s=this.imageScaleProvider(),n=await this.stream.hitItems({point:h.scale(t.position,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1)},!0);null!=(null===(i=n.hitItems)||void 0===i?void 0:i.hits)&&n.hitItems.hits.length>0?await this.stream.flyTo({itemId:n.hitItems.hits[0].itemId,animation:{duration:p(this.configProvider().animation.durationMs)}}):console.debug(`No hit results found for fly to part [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}class at{constructor(t,i,s,n,e,h,o,r,a,l,c){this.stream=t,this.cursors=i,this.getConfig=s,this.getScene=n,this.getFrame=e,this.getViewport=h,this.tapEmitter=o,this.doubleTapEmitter=r,this.longPressEmitter=a,this.interactionStartedEmitter=l,this.interactionFinishedEmitter=c,this.tap=this.tap.bind(this),this.doubleTap=this.doubleTap.bind(this),this.longPress=this.longPress.bind(this),this.emitTapEvent=this.emitTapEvent.bind(this)}addCursor(t,i){return this.cursors.add(t,i)}async getWorldPointFromViewport(t){const i=this.getViewport(),s=this.getFrame();if(null==s)throw new Error("Cannot get world point. Frame is undefined.");const n=await s.depthBuffer();return null!=n?i.transformPointToWorldSpace(t,n,.5):void 0}async getEntityTypeAtPoint(t){var i;const s=this.getViewport(),n=await(null===(i=this.getFrame())||void 0===i?void 0:i.featureMap());if(null!=n){const i=s.transformPointToFrame(t,n);return n.getEntityType(i)}return m.NO_GEOMETRY}getRayFromPoint(t){const i=this.getViewport(),s=this.getFrame();if(null!=s)return i.transformPointToRay(t,s.image,s.scene.camera);throw new Error("Cannot get camera. Frame is undefined.")}async tap(t,i={},s=0){this.emitTapEvent(this.tapEmitter.emit,t,i,s)}async doubleTap(t,i={},s=0){this.emitTapEvent(this.doubleTapEmitter.emit,t,i,s)}async longPress(t,i={},s=0){this.emitTapEvent(this.longPressEmitter.emit,t,i,s)}async beginInteraction(){this.isInteracting()||(this.interactionStartedEmitter.emit(),this.currentCamera=this.getScene().camera(),await this.stream.beginInteraction())}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),n=this.getViewport(),e=this.getFrame(),h=await(null==e?void 0:e.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=n&&null!=e?t({camera:this.currentCamera,viewport:n,scale:s.scale(),boundingBox:s.boundingBox(),frame:e,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}async twistCamera(...t){return this.transformCamera((({camera:i,viewport:s})=>{const n=o.normalize(o.subtract(i.lookAt,i.position));if(1===t.length&&"number"==typeof t[0]){const s=r.toRadians(-t[0]);return i.rotateAroundAxis(s,n)}if(1===t.length){const n=h.create(s.width/2,s.height/2),e=r.toDegrees(r.fromPoints(n,t[0])),a=null!=this.lastAngle?e-this.lastAngle:0;this.lastAngle=e;const l=o.normalize(o.subtract(i.lookAt,i.position)),c=r.toRadians(-a);return i.rotateAroundAxis(c,l)}return i}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:n,depthBuffer:e})=>{if(null==this.panData){const h=i.toFrameCamera(),o=h.direction,r=n.transformPointToRay(t,s.image,h),c=a.fromNormalAndCoplanarPoint(o,i.lookAt),u=l.intersectPlane(r,c);if(null==u)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;const d=null!=e?this.getWorldPoint(t,e,u):u,v=a.fromNormalAndCoplanarPoint(o,d);this.panData={hitPt:d,hitPlane:v,startingCamera:h}}if(null!=this.panData){const{hitPt:e,hitPlane:h,startingCamera:r}=this.panData,a=n.transformPointToRay(t,s.image,r),c=l.intersectPlane(a,h);if(null!=c){const t=o.subtract(e,c);return i.update(r).moveBy(t)}}return i}))}async viewAll(){await this.getScene().camera().viewAll().render()}async rotateCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=o.normalize(i.up),e=o.normalize(o.subtract(i.lookAt,i.position)),h=o.cross(n,e),r=o.cross(e,h),a=o.normalize({x:t.x*h.x+t.y*r.x,y:t.x*h.y+t.y*r.y,z:t.x*h.z+t.y*r.z}),l=o.cross(a,e),c=3*Math.PI*t.x/s.width,u=3*Math.PI*t.y/s.height,d=Math.abs(c)+Math.abs(u);return i.rotateAroundAxis(d,l)}))}async rotateCameraAtPoint(t,i){return this.transformCamera((({camera:s,viewport:n,boundingBox:e,depthBuffer:h})=>{if(null==this.worldRotationPoint){const t=c.center(e);this.worldRotationPoint=null!=h?this.getWorldPoint(i,h,t):s.lookAt}const r=o.normalize(s.up),a=o.normalize(o.subtract(s.lookAt,s.position)),l=o.cross(r,a),u=o.cross(a,l),d=o.normalize({x:t.x*l.x+t.y*u.x,y:t.x*l.y+t.y*u.y,z:t.x*l.z+t.y*u.z}),v=o.cross(d,a),w=3*Math.PI*t.x/n.width,f=3*Math.PI*t.y/n.height,p=Math.abs(w)+Math.abs(f),m=s.rotateAroundAxisAtPoint(p,this.worldRotationPoint,v);return m.update({lookAt:o.add(o.scale(Math.abs(s.signedDistanceToBoundingBoxCenter())/o.magnitude(m.viewVector),m.viewVector),m.position)})}))}async zoomCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=i.viewVector,e=o.normalize(n),h=o.magnitude(n),r=o.add(i.position,o.scale(3*h*t/s.height,e));return i.update({position:r})}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:n,frame:e,depthBuffer:h})=>{const r=e.scene.camera,c=r.direction,u=s.toFrameCamera(),d=n.transformPointToRay(t,e.image,u);if(null==this.zoomData){const i=a.fromNormalAndCoplanarPoint(c,r.lookAt),n=l.intersectPlane(d,i);if(null==n)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const e=null!=h?this.getWorldPoint(t,h,n):n,o=a.fromNormalAndCoplanarPoint(c,e);this.zoomData={hitPt:e,hitPlane:o}}if(null!=this.zoomData){const{hitPt:t,hitPlane:e}=this.zoomData,h=o.distance(s.position,t),r=l.at(d,6*h*i/n.height),c=a.projectPoint(e,r),u=s.update({position:r,lookAt:c});if(o.distance(r,c)>=u.near)return u}return s}))}async endInteraction(){this.isInteracting()&&(this.currentCamera=void 0,this.worldRotationPoint=void 0,this.panData=void 0,this.zoomData=void 0,this.resetLastAngle(),this.interactionFinishedEmitter.emit(),await this.stream.endInteraction())}resetLastAngle(){this.lastAngle=void 0}isInteracting(){return null!=this.currentCamera}pixelThreshold(t){return(this.isCoarseInputDevice(t)?this.getConfig().coarsePointerThreshold:this.getConfig().finePointerThreshold)*window.devicePixelRatio}async hitItems(t){var i;const s=await this.getScene().raycaster().hitItems(t);return null!==(i=null==s?void 0:s.hits)&&void 0!==i?i:[]}emitTapEvent(t,i,s={},n=0){const{altKey:e=!1,ctrlKey:h=!1,metaKey:o=!1,shiftKey:r=!1}=s;t({position:i,altKey:e,ctrlKey:h,metaKey:o,shiftKey:r,buttons:n})}isCoarseInputDevice(t){return t||window.matchMedia("(pointer: coarse)").matches}getWorldPoint(t,i,s){const n=this.getViewport(),e=n.transformPointToFrame(t,i);return i.hitTest(e)?n.transformPointToWorldSpace(t,i):s}}class lt extends at{constructor(t,i,s,n,e,h,o,r,a,l,c){super(t,i,s,n,e,h,o,r,a,l,c)}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=i.viewVector,e=o.normalize(i.up),h=o.normalize(n),r=o.magnitude(n)*Math.tan(i.fovHeight),a=t.x*r/s.width,l=t.y/s.width*r,c=o.cross(e,h),u=o.cross(h,c),d=o.add(o.scale(a,c),o.scale(l,u));return i.moveBy(d)}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:n})=>{if(null==this.panData){const e=i.toFrameCamera(),h=e.direction,o=n.transformPointToOrthographicRay(t,s.image,e),r=a.fromNormalAndCoplanarPoint(h,i.lookAt),c=l.intersectPlane(o,r);if(null==c)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;this.panData={hitPt:c,hitPlane:r,startingCamera:e}}if(null!=this.panData){const{hitPt:e,hitPlane:h,startingCamera:r}=this.panData,a=n.transformPointToOrthographicRay(t,s.image,r),c=l.intersectPlane(a,h);if(null!=c){const t=o.subtract(e,c);return i.update({lookAt:o.add(r.lookAt,t)})}}return i}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:n,frame:e,depthBuffer:r})=>{if(null==this.orthographicZoomData||h.distance(t,this.orthographicZoomData.startingScreenPt)>2){const i=s.toFrameCamera(),h=i.direction,o=n.transformPointToOrthographicRay(t,e.image,i),c=a.fromNormalAndCoplanarPoint(h,i.lookAt),u=l.intersectPlane(o,c);if(null==u)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const d=null!=r?this.getWorldPoint(t,r,u):u,v=a.fromNormalAndCoplanarPoint(h,d);this.orthographicZoomData={hitPt:d,hitPlane:v,startingScreenPt:t}}if(null!=this.orthographicZoomData){const{hitPt:t,hitPlane:e}=this.orthographicZoomData,h=s.fovHeight/n.height*2*i,r=Math.max(1,s.fovHeight-h),l=a.projectPoint(e,s.lookAt),c=o.scale((s.fovHeight-r)/s.fovHeight,o.subtract(t,l));return s.update({lookAt:o.add(s.lookAt,c),fovHeight:Math.max(1,s.fovHeight-h)})}return s}))}getWorldPoint(t,i,s){const n=this.getViewport(),e=n.transformPointToFrame(t,i);return i.hitTest(e)?n.transformPointToOrthographicWorldSpace(t,i):s}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),n=this.getViewport(),e=this.getFrame(),h=await(null==e?void 0:e.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=n&&null!=e?t({camera:this.currentCamera,viewport:n,scale:s.scale(),boundingBox:s.boundingBox(),frame:e,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}}class ct extends at{constructor(t,i,s,n,e,h,o,r,a,l,c){super(t,i,s,n,e,h,o,r,a,l,c)}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{var n;const e=i.viewVector,h=o.normalize(i.up),r=o.normalize(e),a=o.magnitude(e)*Math.tan(null!==(n=i.fovY)&&void 0!==n?n:45),l=t.x*a/s.width,c=t.y/s.width*a,u=o.cross(h,r),d=o.cross(r,u),v=o.add(o.scale(l,u),o.scale(c,d));return i.moveBy(v)}))}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),n=this.getViewport(),e=this.getFrame(),h=await(null==e?void 0:e.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=n&&null!=e?t({camera:this.currentCamera,viewport:n,scale:s.scale(),boundingBox:s.boundingBox(),frame:e,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}}class ut{constructor(t,i,s,n){this.stream=t,this.configProvider=i,this.imageScaleProvider=s,this.sceneProvider=n}predicate(t){return t.altKey&&t.shiftKey}async fn(t){var i,s;const n=this.imageScaleProvider(),e=await this.stream.hitItems({point:h.scale(t.position,(null==n?void 0:n.x)||1,(null==n?void 0:n.y)||1)},!0);if(null!=(null===(i=e.hitItems)||void 0===i?void 0:i.hits)&&e.hitItems.hits.length>0&&null!=e.hitItems.hits[0].hitPoint){const i=this.sceneProvider().camera(),n=e.hitItems.hits[0];null!=n.hitPoint&&null!=n.hitPoint.x&&null!=n.hitPoint.y&&null!=n.hitPoint.z?await this.stream.flyTo({camera:i.update({lookAt:o.create(n.hitPoint.x,n.hitPoint.y,n.hitPoint.z)}).toFrameCamera(),animation:{duration:p(this.configProvider().animation.durationMs)}}):console.debug(`No hit position found for fly to position [position={x: ${t.position.x}, y: ${t.position.y}}, hit-id={${null===(s=n.itemId)||void 0===s?void 0:s.hex}}]`)}else console.debug(`No hit results found for fly to position [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}const dt=[.2,.15,.25,.25,.15];class vt{constructor(t,i,s,n,e,h,o,r,a){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.rotateInteraction=n,this.rotatePointInteraction=e,this.zoomInteraction=h,this.panInteraction=o,this.twistInteraction=r,this.getConfig=a,this.primaryInteraction=this.rotateInteraction,this.isDragging=!1,this.keyboardControls=!1,this.disableIndividualInteractions=!1,this.primaryInteractionTypeChange=new A,this.handleDownEvent=this.handleDownEvent.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleWindowMove=this.handleWindowMove.bind(this),this.handleWindowUp=this.handleWindowUp.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this)}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDownEvent),t.addEventListener("mousedown",this.handleDoubleClick),t.addEventListener("wheel",this.handleMouseWheel)}dispose(){var t,i,s;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDownEvent),null===(i=this.element)||void 0===i||i.removeEventListener("mousedown",this.handleDoubleClick),null===(s=this.element)||void 0===s||s.removeEventListener("wheel",this.handleMouseWheel),this.element=void 0}onPrimaryInteractionTypeChange(t){return this.primaryInteractionTypeChange.on(t)}setCurrentInteractionType(t){var i;switch(t){case"rotate":this.currentInteraction=this.rotateInteraction;break;case"zoom":this.currentInteraction=this.zoomInteraction;break;case"pan":this.currentInteraction=this.panInteraction;break;case"twist":this.currentInteraction=this.twistInteraction;break;case"rotate-point":this.currentInteraction=this.rotatePointInteraction;break;default:this.currentInteraction=void 0}if(this.draggingInteraction){const t=this.draggingInteraction.getPosition();this.draggingInteraction=this.currentInteraction||this.primaryInteraction,null===(i=this.interactionApi)||void 0===i||i.resetLastAngle(),this.draggingInteraction.setPosition(t)}}getPrimaryInteractionType(){return this.primaryInteraction.getType()}getCurrentInteractionType(){return(this.currentInteraction||this.primaryInteraction).getType()}setPrimaryInteractionType(t){switch(t){case"rotate":this.primaryInteraction=this.rotateInteraction;break;case"rotate-point":this.primaryInteraction=this.rotatePointInteraction;break;case"zoom":this.primaryInteraction=this.zoomInteraction;break;case"pan":this.primaryInteraction=this.panInteraction}this.primaryInteractionTypeChange.emit()}setDefaultKeyboardControls(t){this.keyboardControls=t}handleDownEvent(t){this.interactionTimer=window.setTimeout((()=>{this.downPosition=h.create(t.screenX,t.screenY),this.downPositionCanvas=this.getCanvasPosition(t),this.interactionTimer=void 0,null!=this.lastMoveEvent&&this.handleWindowMove(this.lastMoveEvent)}),this.getConfig().interactions.interactionDelay),window.addEventListener(this.moveEvent,this.handleWindowMove),window.addEventListener(this.upEvent,this.handleWindowUp)}handleWindowMove(t){if(null==this.interactionTimer){if(this.disableIndividualInteractions)return;const i=h.create(t.screenX,t.screenY),s=null!=this.interactionApi?this.interactionApi.pixelThreshold(this.isTouch(t)):2;null!=this.downPosition&&h.distance(i,this.downPosition)>=s&&!this.isDragging&&(this.beginDrag(t),this.isDragging=!0),this.isDragging&&this.drag(t)}this.lastMoveEvent=t}async handleWindowUp(t){this.isDragging&&(this.endDrag(t),this.isDragging=!1),null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0),window.removeEventListener(this.moveEvent,this.handleWindowMove),window.removeEventListener(this.upEvent,this.handleWindowUp),this.lastMoveEvent=void 0}async handleDoubleClick(t){2===t.detail&&4===t.buttons&&null!=this.interactionApi&&this.interactionApi.viewAll()}beginDrag(t){this.keyboardControls&&t.metaKey&&t.shiftKey?this.currentInteraction=this.rotatePointInteraction:this.keyboardControls&&t.shiftKey?this.currentInteraction=this.zoomInteraction:this.keyboardControls&&(t.metaKey||t.ctrlKey)?this.currentInteraction=this.panInteraction:this.keyboardControls&&t.altKey&&(this.currentInteraction=this.rotateInteraction),1===t.buttons||4===t.buttons?this.draggingInteraction=this.currentInteraction||this.primaryInteraction:2===t.buttons&&(this.draggingInteraction=this.panInteraction),null!=this.draggingInteraction&&null!=this.interactionApi&&null!=this.element&&(this.zoomInteraction.endDrag(t,this.interactionApi),this.draggingInteraction.beginDrag(t,this.downPositionCanvas||h.create(t.clientX,t.clientY),this.interactionApi,this.element))}drag(t){this.currentInteraction=this.keyboardControls&&t.altKey&&t.shiftKey?this.twistInteraction:void 0,this.draggingInteraction=this.currentInteraction||this.draggingInteraction||this.primaryInteraction,null!=this.draggingInteraction&&null!=this.interactionApi&&this.draggingInteraction.drag(t,this.interactionApi)}endDrag(t){this.keyboardControls&&this.currentInteraction===this.twistInteraction&&(this.currentInteraction=void 0),null!=this.draggingInteraction&&null!=this.interactionApi&&(this.draggingInteraction.endDrag(t,this.interactionApi),this.draggingInteraction=void 0)}handleMouseWheel(t){if(t.preventDefault(),null!=this.element&&null!=this.interactionApi&&4!==t.buttons){const i=-this.wheelDeltaToPixels(t.deltaY,t.deltaMode)/10,s=this.element.getBoundingClientRect(),n=V(t,s);dt.forEach(((t,s)=>{window.setTimeout((()=>{null!=this.interactionApi&&this.zoomInteraction.zoomToPoint(n,i*t,this.interactionApi)}),2*s)}))}}wheelDeltaToPixels(t,i){null==this.computedBodyStyle&&(this.computedBodyStyle=window.getComputedStyle(document.body));const s=null==this.computedBodyStyle.fontSize||""===this.computedBodyStyle.fontSize||isNaN(parseFloat(this.computedBodyStyle.fontSize))?19.2:1.2*parseFloat(this.computedBodyStyle.fontSize);return 1===i?null==this.computedBodyStyle.lineHeight||""===this.computedBodyStyle.lineHeight||isNaN(parseFloat(this.computedBodyStyle.lineHeight))?t*s:t*parseFloat(this.computedBodyStyle.lineHeight):2===i?null==this.computedBodyStyle.height||""===this.computedBodyStyle.height||isNaN(parseFloat(this.computedBodyStyle.height))?t*window.innerHeight:t*parseFloat(this.computedBodyStyle.height):t}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),n=null!=s?h.create(s.left,s.top):void 0;return null!=n?h.subtract(h.create(t.clientX,t.clientY),n):void 0}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class wt{setPosition(t){this.currentPosition=t}getPosition(){return this.currentPosition}getType(){return this.type}beginDrag(t,i,s,n){}drag(t,i){}endDrag(t,i){null!=this.currentPosition&&(i.endInteraction(),this.currentPosition=void 0)}zoom(t,i){}}class ft extends wt{constructor(){super(...arguments),this.type="rotate"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.screenX,t.screenY),n=h.subtract(s,this.currentPosition);i.rotateCamera(n),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class pt extends wt{constructor(){super(...arguments),this.type="rotate-point"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),this.startingPosition=i,s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.startingPosition){const s=h.create(t.screenX,t.screenY),n=h.subtract(s,this.currentPosition);i.rotateCameraAtPoint(n,this.startingPosition),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class mt extends wt{constructor(t=1e3){super(),this.interactionTimeout=t,this.type="zoom",this.didTransformBegin=!1}beginDrag(t,i,s,n){if(null==this.currentPosition){this.currentPosition=h.create(t.clientX,t.clientY);const i=n.getBoundingClientRect(),e=V(t,i);this.startPt=e,s.beginInteraction()}}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.clientX,t.clientY),n=h.subtract(s,this.currentPosition);null!=this.startPt&&(i.zoomCameraToPoint(this.startPt,n.y),this.currentPosition=s)}}endDrag(t,i){super.endDrag(t,i),this.stopInteractionTimer(),this.didTransformBegin=!1,this.startPt=void 0}zoom(t,i){this.operateWithTimer(i,(()=>i.zoomCamera(t)))}zoomToPoint(t,i,s){this.operateWithTimer(s,(()=>s.zoomCameraToPoint(t,i)))}beginInteraction(t){this.didTransformBegin=!0,t.beginInteraction()}endInteraction(t){this.didTransformBegin=!1,t.endInteraction()}resetInteractionTimer(t){this.stopInteractionTimer(),this.startInteractionTimer(t)}startInteractionTimer(t){this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0,this.endInteraction(t)}),this.interactionTimeout)}stopInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}operateWithTimer(t,i){this.didTransformBegin||this.beginInteraction(t),this.resetInteractionTimer(t),i()}}class gt extends wt{constructor(){super(...arguments),this.type="pan"}beginDrag(t,i,s,n){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),this.canvasRect=n.getBoundingClientRect(),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.canvasRect){const s=V(t,this.canvasRect);i.panCameraToScreenPoint(s),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class yt extends wt{constructor(){super(...arguments),this.type="twist"}beginDrag(t,i,s){this.currentPosition=h.create(t.clientX,t.clientY),s.beginInteraction()}drag(t,i){const s=h.create(t.clientX,t.clientY);this.currentPosition=s,i.twistCamera(s)}endDrag(t,i){super.endDrag(t,i)}}class bt extends vt{constructor(t,i=new ft,s=new pt,n=new mt,e=new gt,h=new yt){super("mousedown","mouseup","mousemove",i,s,n,e,h,t)}}class Ct{initialize(t,i){this.element=t,this.interactionApi=i}dispose(){this.element=void 0}handleTwoPointTouchMove(t,i){var s,n,e,o;if(null!=this.currentPosition1&&null!=this.currentPosition2){const a=h.scale(h.add(h.subtract(t,this.currentPosition1),h.subtract(i,this.currentPosition2)),.25,.25),l=.5*(h.distance(t,i)-h.distance(this.currentPosition1,this.currentPosition2)),c=u.create(h.subtract(this.currentPosition1,this.currentPosition2),h.subtract(t,i)),d=r.toDegrees(Math.atan2(u.determinant(c),u.dot(c)));null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(n=this.interactionApi)||void 0===n||n.zoomCamera(l),null===(e=this.interactionApi)||void 0===e||e.panCameraByDelta(a),console.log(Math.abs(d)),Math.abs(d)>.4&&(null===(o=this.interactionApi)||void 0===o||o.twistCamera(d))}this.currentPosition1=t,this.currentPosition2=i}}class Pt extends Ct{constructor(){super(),this.touchPoints={},this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("pointerdown",this.handlePointerDown),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){const i=h.create(t.screenX,t.screenY);this.touchPoints=Object.assign(Object.assign({},this.touchPoints),{[t.pointerId]:i}),1===Object.keys(this.touchPoints).length&&(window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp))}handlePointerMove(t){null!=this.touchPoints[t.pointerId]&&(this.touchPoints[t.pointerId]=h.create(t.screenX,t.screenY));const i=Object.keys(this.touchPoints);2===i.length&&this.handleTwoPointTouchMove(this.touchPoints[i[0]],this.touchPoints[i[1]])}handlePointerUp(t){var i;delete this.touchPoints[t.pointerId];const s=Object.keys(this.touchPoints);1===s.length&&(null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.currentPosition1=void 0,this.currentPosition2=void 0),0===s.length&&(window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp))}}class Tt extends vt{constructor(t){super("pointerdown","pointerup","pointermove",new ft,new pt,new mt,new gt,new yt,t),this.touchPoints=new Set,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){this.downPosition=h.create(t.screenX,t.screenY),this.touchPoints.add(t.pointerId),1===this.touchPoints.size&&window.addEventListener("pointerup",this.handlePointerUp),2===this.touchPoints.size&&(this.disableIndividualInteractions=!0)}handlePointerUp(t){this.touchPoints.delete(t.pointerId),this.touchPoints.size<2&&(this.disableIndividualInteractions=!1),0===this.touchPoints.size&&window.removeEventListener("pointerup",this.handlePointerUp)}}class It{constructor(t,i,s,n){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.getConfig=n,this.handleDown=this.handleDown.bind(this),this.handleUp=this.handleUp.bind(this),this.handleMove=this.handleMove.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerEnd=this.handlePointerEnd.bind(this),this.clearPositions=this.clearPositions.bind(this),this.restartDoubleTapTimer=this.restartDoubleTapTimer.bind(this),this.clearDoubleTapTimer=this.clearDoubleTapTimer.bind(this),this.restartLongPressTimer=this.restartLongPressTimer.bind(this),this.clearLongPressTimer=this.clearLongPressTimer.bind(this),this.setPointerPositions=this.setPointerPositions.bind(this),this.emit=this.emit.bind(this)}dispose(){var t,i;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDown),null===(i=this.element)||void 0===i||i.removeEventListener("touchstart",this.handleTouchStart),this.element=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer()}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDown),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){1===t.touches.length&&(this.setPointerPositions(h.create(t.touches[0].clientX,t.touches[0].clientY)),this.restartLongPressTimer(),window.addEventListener("touchend",this.handleTouchEnd),window.addEventListener("touchmove",this.handleTouchMove))}handleTouchMove(t){t.touches.length>0&&this.handlePointerMove(h.create(t.touches[0].clientX,t.touches[0].clientY),!0)}handleTouchEnd(t){null!=this.pointerDownPosition&&(window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchmove",this.handleTouchMove)),this.handlePointerEnd(this.pointerDownPosition)}handleDown(t){this.setPointerPositions(h.create(t.clientX,t.clientY)),this.buttons=t.buttons,this.restartLongPressTimer({altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}),window.addEventListener(this.upEvent,this.handleUp),window.addEventListener(this.moveEvent,this.handleMove)}handleMove(t){this.handlePointerMove(h.create(t.clientX,t.clientY),this.isTouch(t))}handleUp(t){null!=this.pointerDownPosition&&(window.removeEventListener(this.upEvent,this.handleUp),window.removeEventListener(this.moveEvent,this.handleMove)),this.handlePointerEnd(h.create(t.clientX,t.clientY),{altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey},this.buttons,this.isTouch(t)),this.buttons=void 0}handlePointerMove(t,i){var s;const n=(null===(s=this.interactionApi)||void 0===s?void 0:s.pixelThreshold(i))||2;null!=this.pointerDownPosition&&h.distance(t,this.pointerDownPosition)>=n&&null==this.interactionTimer&&this.clearPositions()}handlePointerEnd(t,i={},s=0,n=!1){var e,h;null!=t&&(null!=this.longPressTimer&&this.emit(null===(e=this.interactionApi)||void 0===e?void 0:e.tap)(t,i,s),null!=this.doubleTapTimer&&null!=this.secondPointerDownPosition&&(this.emit(null===(h=this.interactionApi)||void 0===h?void 0:h.doubleTap)(t,i,s,this.secondPointerDownPosition),this.clearDoubleTapTimer())),this.pointerDownPosition=void 0,this.clearLongPressTimer()}emit(t){return(i,s={},n=0,e,o=!1)=>{var r;const a=e||this.pointerDownPosition,l=(null===(r=this.interactionApi)||void 0===r?void 0:r.pixelThreshold(o))||1;let c;null!=this.interactionTimer?c=this.getCanvasPosition(a||i):null!=a&&h.distance(a,i)<=l&&(c=this.getCanvasPosition(i)),null!=c&&null!=t&&t(c,s,n)}}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),n=null!=s?h.create(s.left,s.top):void 0;return null!=n?h.subtract(h.create(t.x,t.y),n):void 0}clearPositions(){this.pointerDownPosition=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer(),this.clearInteractionTimer()}clearDoubleTapTimer(){null!=this.doubleTapTimer&&window.clearTimeout(this.doubleTapTimer),this.doubleTapTimer=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0}restartDoubleTapTimer(){this.clearDoubleTapTimer(),this.doubleTapTimer=window.setTimeout((()=>this.clearDoubleTapTimer()),this.getConfig().events.doubleTapThreshold)}clearLongPressTimer(){null!=this.longPressTimer&&window.clearTimeout(this.longPressTimer),this.longPressTimer=void 0}restartLongPressTimer(t={}){this.clearLongPressTimer(),this.longPressTimer=window.setTimeout((()=>{var i;this.pointerDownPosition&&this.emit(null===(i=this.interactionApi)||void 0===i?void 0:i.longPress)(this.pointerDownPosition,t,this.buttons),this.clearLongPressTimer()}),this.getConfig().events.longPressThreshold)}restartInteractionTimer(){this.clearInteractionTimer(),this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0}),this.getConfig().interactions.interactionDelay)}clearInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}setPointerPositions(t){this.pointerDownPosition=t,this.restartInteractionTimer(),null==this.firstPointerDownPosition?(this.restartDoubleTapTimer(),this.firstPointerDownPosition=t):this.secondPointerDownPosition=t}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class xt extends Ct{constructor(){super(),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("touchstart",this.handleTouchStart),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){if(t.touches.length>=1){const i=t.touches[0],s=t.touches[1];this.currentPosition1=h.create(i.screenX,i.screenY),this.currentPosition2=null!=s?h.create(s.screenX,s.screenY):void 0,window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),window.addEventListener("touchend",this.handleTouchEnd)}}handleTouchMove(t){if(1===t.touches.length)this.handleOnePointTouchMove(t.touches[0]);else if(2===t.touches.length){const i=h.create(t.touches[0].clientX,t.touches[0].clientY),s=h.create(t.touches[1].clientX,t.touches[1].clientY);this.handleTwoPointTouchMove(i,s)}}handleTouchEnd(t){var i;null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.isInteracting=!1,window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd)}handleOnePointTouchMove(t){var i,s,n;const e=h.create(t.screenX,t.screenY);if(null!=this.currentPosition1){const t=h.subtract(e,this.currentPosition1),o=(null===(i=this.interactionApi)||void 0===i?void 0:i.pixelThreshold(!0))||2;(h.distance(e,this.currentPosition1)>=o||this.isInteracting)&&(null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(n=this.interactionApi)||void 0===n||n.rotateCamera(t),this.isInteracting=!0)}this.currentPosition1=e}}const Dt=new class{constructor(t,i=window.performance){this.name=t,this.perf=i,this.measures=new Set,this.nextId=0}clearMeasurements(){this.perf.clearMeasures(this.name)}measure(t){if(null!=(i=t)&&i.then instanceof Function&&i.catch instanceof Function&&i.finally instanceof Function){const i=this.begin();return t.finally((()=>this.end(i)))}if("function"==typeof t){const i=this.begin(),s=t();return this.end(i),s}throw new Error("Input must be a function or Promise");var i}takeMeasurements(){const t=this.perf.getEntriesByName(this.name);return this.clearMeasurements(),t}takeLastMeasurement(){const t=this.takeMeasurements();return t[t.length-1]}begin(){const t=`${this.name}-${this.nextId++}`;return this.measures.add(t),this.perf.mark(t),t}end(t){this.perf.measure(this.name,t),this.perf.clearMarks(t),this.measures.delete(t)}}("paint_time");function St(t){return null!=window.createImageBitmap?async function(t){const i=new Blob([t]),s=await window.createImageBitmap(i);return{image:s,dispose:()=>s.close()}}(t):(i=t,new Promise(((t,s)=>{const n=new Blob([i]),e=URL.createObjectURL(n),h=new Image;h.addEventListener("load",(()=>{t({image:h,dispose:()=>{}}),URL.revokeObjectURL(e)})),h.addEventListener("error",(()=>{s(new H("Failed to load image data")),URL.revokeObjectURL(e)})),h.src=e})));var i}function kt(t,i){const s=i.viewport.calculateDrawRect(i.frame.image);i.canvas.clearRect(0,0,i.canvasDimensions.width,i.canvasDimensions.height),i.canvas.drawImage(t.image,s.x,s.y,s.width,s.height)}function Et(t,i,s,n,e=1e3){let h,o,r=0,a=[];return s&&setInterval((()=>{if(null!=o){5===a.length?a=[...a.slice(1),o]:a.push(o);const t=a.reduce(((t,i)=>t+i))/a.length;console.debug(`Paint rate: ${o}fps`),console.debug(`Paint rate (avg): ${t}`),o=void 0}}),1e3),s=>(r++,null==h&&(h=setInterval((()=>{!function(t,i){const s=t.takeMeasurements();s.length>0&&i(s)}(t,n),0===r&&null!=h&&(clearInterval(h),h=void 0)}),e)),t.measure((async()=>{const t=await i(s);return o=null==o?1:o+1,t})).finally((()=>{r--})))}var Mt;!function(t){t.DEVICE_ID="vertexvis:device-id"}(Mt||(Mt={}));class Ot extends C{constructor(t,i={}){var s,n,e;super(t,{loggingEnabled:i.loggingEnabled}),this.state={type:"disconnected"},this.stateChanged=new A,this.dimensions=d.create(0,0),this.streamAttributes={},this.frameBgColor=F.create(255,255,255),this.config=K("platprod"),this.options={tokenRefreshOffsetInSeconds:null!==(s=i.tokenRefreshOffsetInSeconds)&&void 0!==s?s:30,offlineThresholdInSeconds:null!==(n=i.offlineThresholdInSeconds)&&void 0!==n?n:30,loadTimeoutInSeconds:null!==(e=i.loadTimeoutInSeconds)&&void 0!==e?e:15}}getState(){return this.state}disconnect(){"disconnected"!==this.state.type&&"connection-failed"!==this.state.type&&(console.debug("Disconnecting websocket"),this.state.connection.dispose(),this.updateState({type:"disconnected"}))}async load(t,i,s,n=K("platprod")){return this.clientId=i,this.deviceId=s,this.config=n,"disconnected"===this.state.type||"connection-failed"===this.state.type?this.loadIfDisconnected(t):this.loadIfConnectingOrConnected(t,this.state)}update(t){this.frameBgColor=t.frameBgColor?t.frameBgColor:this.frameBgColor,null!=t.dimensions&&t.dimensions!==this.dimensions&&(this.dimensions=t.dimensions,this.ifState("connected",(()=>this.updateDimensions({dimensions:this.dimensions})))),null!=t.streamAttributes&&this.streamAttributes!==t.streamAttributes&&(this.streamAttributes=t.streamAttributes,this.ifState("connected",(()=>this.updateStream({streamAttributes:jt(this.streamAttributes)}))))}async loadIfConnectingOrConnected(t,i){const{resource:s,queries:n}=i.resource,e=U(t),h=!B.isEqual(s,e.resource),o=!B.isEqual(n,e.queries),r=null!=e.queries[0],a="connected"===i.type;if(h||("connecting"===i.type||"reconnecting"===i.type)&&o)return this.disconnect(),this.loadIfDisconnected(t);a&&r&&o&&(await this.loadSceneViewState({sceneViewStateId:{hex:e.queries[0].id}}),this.updateState(Object.assign(Object.assign({},i),{resource:e})))}async loadIfDisconnected(t){try{await this.connectWithNewStream(U(t))}catch(t){throw this.updateState(t instanceof G?{type:"connection-failed",message:`Cannot load scene. ${t.message}`,error:t}:t instanceof P?{type:"connection-failed",message:"Cannot load scene. Stream request failed to start stream.",error:t}:{type:"connection-failed",message:"Cannot load scene for unknown reason. See console logs.",error:t}),t}}connectWithNewStream(t){return this.openWebsocketStream(t,"connecting",(()=>this.requestNewStream(t)))}connectToExistingStream(t){return this.openWebsocketStream(t.resource,"reconnecting",(()=>this.requestReconnectStream(t)),{maxRetries:Number.POSITIVE_INFINITY})}async openWebsocketStream(t,i,s,{maxRetries:n=3}={}){const e=(h=function(t,i,s,n){return z.appendPath(null!=s?z.toString(z.parseAndAddParams("/ws",{clientId:s,deviceId:n})):`/stream-keys/${i.id}/session`,z.parse(t.network.renderingHost))}(this.config,t.resource,this.clientId,this.deviceId),{url:z.toString(h),protocols:["ws.vertexvis.com"]});var h;console.debug(`Initiating WS connection [uri=${e.url}]`);const o=new AbortController,r=(a=this.config,{EXPERIMENTAL_frameDelivery:Object.assign(Object.assign({},a.EXPERIMENTAL_frameDelivery),{rateLimitingEnabled:a.flags.throttleFrameDelivery}),EXPERIMENTAL_adaptiveRendering:Object.assign(Object.assign({},a.EXPERIMENTAL_adaptiveRendering),{enabled:a.flags.adaptiveRendering}),EXPERIMENTAL_qualityOfService:Object.assign({},a.EXPERIMENTAL_qualityOfService)});var a;this.updateState({type:i,resource:t,connection:{dispose:()=>{this.dispose(),o.abort()}}});const l=await N.abort(o.signal,N.retry((()=>this.connect(e,r)),{maxRetries:n,delaysInMs:Ot.WS_RECONNECT_DELAYS})).catch((t=>{throw new J("Websocket connection failed.",t instanceof Error?t:void 0)}));if(!l.aborted)return this.requestNewOrExistingStream(t,l.result,s);this.updateState({type:"disconnected"})}async requestNewOrExistingStream(t,i,s){const n=this.requestClock(),e=await s();console.debug(`Stream connected [stream-id=${e.streamId}, scene-view-id=${e.sceneViewId}]`);const h=this.onRequest((t=>{const i=t.request.drawFrame;if(null!=i){const t=T(e.worldOrientation)(i);"connected"===this.state.type&&this.updateState(Object.assign(Object.assign({},this.state),{frame:t}))}})),o=this.reconnectWhenNeeded(),r=this.refreshTokenWhenExpired(e.token),a=this.acknowledgeFrameRequests(),l=null==e.frame?await this.waitForFrame(e.worldOrientation,this.options.loadTimeoutInSeconds):e.frame,c=await n;console.debug(`Synchronized clocks [local-time=${c.knownLocalTime.toISOString()}, remote-time=${c.knownRemoteTime.toISOString()}]`),this.updateState({type:"connected",connection:{dispose:()=>{o.dispose(),h.dispose(),r.dispose(),a.dispose(),i.dispose()}},resource:t,streamId:e.streamId,deviceId:e.deviceId,sceneViewId:e.sceneViewId,worldOrientation:e.worldOrientation,token:e.token,frame:l,clock:c})}async requestNewStream(t){var i;const s=I(await this.startStream({streamKey:{value:t.resource.id},dimensions:this.dimensions,frameBackgroundColor:At(this.frameBgColor),streamAttributes:jt(this.streamAttributes),sceneViewStateId:"scene-view-state"===(null===(i=t.queries[0])||void 0===i?void 0:i.type)?{hex:t.queries[0].id}:void 0}));return{resource:t,streamId:s.streamId,sceneViewId:s.sceneViewId,deviceId:s.sessionId,token:s.token,worldOrientation:s.worldOrientation,frame:void 0}}async requestReconnectStream(t){const i=x(await this.reconnect({streamId:{hex:t.streamId},dimensions:this.dimensions,frameBackgroundColor:At(this.frameBgColor),streamAttributes:jt(this.streamAttributes)}));return Object.assign(Object.assign({},t),{token:i.token})}async requestClock(){const t=D(await this.syncTime({requestTime:S()}));return new _(t)}reconnectWhenNeeded(){const t=this.onClose((()=>{"connected"===this.state.type&&this.closeAndReconnect(this.state)})),i=this.onRequest((t=>{null!=t.request.gracefulReconnection&&"connected"===this.state.type&&(console.debug("Received request for graceful reconnect. Closing connection and attempting reconnect."),this.closeAndReconnect(this.state))})),s=this.reconnectWhenOffline();return{dispose:()=>{t.dispose(),i.dispose(),s.dispose()}}}refreshTokenWhenExpired(t){let i;const s=t=>{const{tokenRefreshOffsetInSeconds:n}=this.options,e=t.remainingTimeInMs(n);i=window.setTimeout((async()=>{const t=await this.refreshToken(),i=k(t);s(i),"connected"===this.state.type&&this.updateState(Object.assign(Object.assign({},this.state),{token:i}))}),e)};return s(t),{dispose:()=>clearTimeout(i)}}reconnectWhenOffline(){let t;const i=()=>window.clearTimeout(t),s=()=>{i();const s=this.options.offlineThresholdInSeconds;console.debug(`Detected that host is offline. Will attempt reconnect in ${s}s.`),t=window.setTimeout((()=>{"connected"===this.state.type&&this.closeAndReconnect(this.state)}),1e3*s)};return window.addEventListener("offline",(()=>s())),window.addEventListener("online",(()=>{console.debug("Detected that host is online."),i()})),{dispose:()=>{i(),window.removeEventListener("offline",s),window.removeEventListener("online",i)}}}closeAndReconnect(t){return t.connection.dispose(),this.connectToExistingStream(t)}async waitForFrame(t,i){let s;try{return await N.timeout(1e3*i,new Promise((i=>{s=this.onRequest((n=>{try{const e=n.request.drawFrame;if(null!=e){const s=T(t)(e);i(s)}}finally{null==s||s.dispose()}}))})))}catch(t){throw new X(`Frame timed out after ${i/1e3}s`,t instanceof Error?t:void 0)}finally{null==s||s.dispose()}}acknowledgeFrameRequests(){return this.onRequest(function(t,i){const s=function(t){let i=!1;return s=>{const n=t();if(null!=n){const t=n.remoteTime(new Date(Date.now())),e=p(s,t);return g(e).getTime()>=0?e:void(i||(console.warn(`Possible erroneous send to receive timing. Muting for 60s. [sent-at=${s.toISOString()}, received-at=${t.toISOString()}, remote-time=${n.knownRemoteTime.toISOString()}]`),i=!0,setTimeout((()=>i=!1),6e4)))}}}(i);return n=i=>{return n=()=>n=>{const e=g(n.sentAtTime);null!=e&&t.replyResult(i,{drawFrame:{sendToReceiveDuration:s(e)}})},t=>{const{drawFrame:i}=t.request;null!=i&&n()(t)};var n},t=>{var i;const s=null===(i=t.request.requestId)||void 0===i?void 0:i.value;null!=s&&n(s)(t)};var n}(this,(()=>"connected"===this.state.type?this.state.clock:void 0)))}updateState(t){this.state!==t&&(this.state=t,this.stateChanged.emit(this.state))}ifState(t,i){if(this.state.type===t)return i()}onStateChanged(t){return this.stateChanged.on(t)}}Ot.WS_RECONNECT_DELAYS=[0,1e3,1e3,5e3];const jt=R.ifInvalidThrow(y),At=R.ifInvalidThrow(b);let Rt=class{constructor(s){t(this,s),this.tap=i(this,"tap",7),this.doubletap=i(this,"doubletap",7),this.longpress=i(this,"longpress",7),this.frameReceived=i(this,"frameReceived",7),this.frameDrawn=i(this,"frameDrawn",7),this.tokenExpired=i(this,"tokenExpired",7),this.connectionChange=i(this,"connectionChange",7),this.sceneReady=i(this,"sceneReady",7),this.sceneChanged=i(this,"sceneChanged",7),this.interactionStarted=i(this,"interactionStarted",7),this.interactionFinished=i(this,"interactionFinished",7),this.deviceIdChange=i(this,"deviceIdChange",7),this.dimensionschange=i(this,"dimensionschange",7),this.configEnv="platprod",this.cameraControls=!0,this.cameraType="perspective",this.keyboardControls=!0,this.rotateAroundTapPoint=!0,this.experimentalGhostingOpacity=0,this.selectionMaterial=Y,this.resizeDebounce=100,this.stencilBuffer=new ht(this.hostElement),this.viewport=et.fromDimensions(d.create(0,0)),this.stateMap={cursorManager:new W,streamState:{type:"disconnected"}},this.interactionHandlers=[],this.tapKeyInteractions=[],this.internalFrameDrawnDispatcher=new A,this.handleElementResize=this.handleElementResize.bind(this)}componentWillLoad(){var t;this.updateResolvedConfig(),this.calculateComponentDimensions(),this.resizeObserver=new ResizeObserver(this.handleElementResize),this.registerSlotChangeListeners(),this.stream=null!==(t=this.stream)&&void 0!==t?t:new Ot(new E,{loggingEnabled:this.getResolvedConfig().flags.logWsMessages}),this.addStreamListeners(),this.updateStreamAttributes(),this.stateMap.cursorManager.onChanged.on((()=>this.handleCursorChanged()))}componentDidLoad(){var t,i,s;if(this.interactionApi=this.createInteractionApi(),null!=this.containerElement&&(null===(t=this.resizeObserver)||void 0===t||t.observe(this.containerElement)),null!=this.src)try{this.load(this.src)}catch(t){console.error("Error loading scene",t)}if(this.cameraControls)if(null!=window.PointerEvent){const t=new It("pointerdown","pointerup","pointermove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new Tt((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new Pt),this.registerInteractionHandler(t)}else{const t=new It("mousedown","mouseup","mousemove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new bt((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new xt),this.registerInteractionHandler(t)}this.keyboardControls&&null!=this.stream&&(null===(i=this.baseInteractionHandler)||void 0===i||i.setDefaultKeyboardControls(this.keyboardControls),this.registerTapKeyInteraction(new rt(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale()))),this.registerTapKeyInteraction(new ut(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale()),(()=>this.createScene())))),this.rotateAroundTapPoint&&(null===(s=this.baseInteractionHandler)||void 0===s||s.setPrimaryInteractionType("rotate-point")),this.injectViewerApi()}render(){var t;return s(n,null,s("div",{class:"viewer-container",style:{cursor:q(null!==(t=this.cursor)&&void 0!==t?t:"")},onContextMenu:t=>t.preventDefault()},s("div",{ref:t=>this.containerElement=t,class:L("canvas-container",{"enable-pointer-events ":null!=window.PointerEvent})},s("canvas",{ref:t=>{this.canvasElement=t,this.stateMap.interactionTarget=t},class:"canvas"}),null!=this.errorMessage?s("div",{class:"error-message"},this.errorMessage):null),s("slot",null)))}async dispatchFrameDrawn(t){this.frame=t,this.internalFrameDrawnDispatcher.emit(t),this.frameDrawn.emit(t)}async registerInteractionHandler(t){return this.interactionHandlers.push(t),this.initializeInteractionHandler(t),{dispose:()=>{const i=this.interactionHandlers.indexOf(t);-1!==i&&(this.interactionHandlers[i].dispose(),this.interactionHandlers.splice(i,1))}}}async registerTapKeyInteraction(t){this.tapKeyInteractions=[...this.tapKeyInteractions,t]}async getInteractionTarget(){if(null!=this.stateMap.interactionTarget)return this.stateMap.interactionTarget;throw new Error("Interaction target is undefined.")}async addCursor(t,i){return this.stateMap.cursorManager.add(t,i)}async getInteractionHandlers(){return this.interactionHandlers}async getBaseInteractionHandler(){return this.baseInteractionHandler}async getJwt(){return this.token}handleSrcChanged(t){null!=t?this.load(t):this.unload()}handleRotateAboutTapPointChanged(){var t,i;this.updateStreamAttributes(),this.rotateAroundTapPoint?null===(t=this.baseInteractionHandler)||void 0===t||t.setPrimaryInteractionType("rotate-point"):null===(i=this.baseInteractionHandler)||void 0===i||i.setPrimaryInteractionType("rotate")}handleCameraTypeChanged(t,i){t!==i&&this.updateCameraType()}handleDepthBuffersChanged(){this.updateStreamAttributes()}handleExperimentalGhostingOpacityChanged(){this.updateStreamAttributes()}handleFeatureLinesChanged(){this.updateStreamAttributes()}handleFeatureHighlightingChanged(){this.updateStreamAttributes()}handleFeatureMapsChanged(){this.updateStreamAttributes()}handleConfigChanged(){this.updateResolvedConfig()}handleConfigEnvChanged(){this.updateResolvedConfig()}async load(t){var i;if(null==this.stream||null==this.dimensions)throw new Q("Cannot load scene. Viewer has not been initialized.");this.calculateComponentDimensions(),this.stream.update({streamAttributes:this.getStreamAttributes(),config:K(this.configEnv,this.config),dimensions:this.dimensions,frameBgColor:this.getBackgroundColor()}),await(null===(i=this.stream)||void 0===i?void 0:i.load(t,this.clientId,this.getDeviceId(),this.getResolvedConfig())),this.sceneReady.emit()}async unload(){if(null!=this.stream&&(this.stream.disconnect(),this.frame=void 0,this.errorMessage=void 0),null!=this.canvasElement){const t=this.canvasElement.getContext("2d");null!=t&&t.clearRect(0,0,this.canvasElement.width,this.canvasElement.height)}}async scene(){return this.createScene()}async isSceneReady(){return"connected"===this.stateMap.streamState.type}async handleTapEvent(t){this.tapKeyInteractions.filter((i=>i.predicate(t.detail))).forEach((i=>i.fn(t.detail)))}emitConnectionChange(t){this.connectionChange.emit(t)}handleElementResize(t){t.length>=0&&null!=this.dimensions&&!d.isEqual(t[0].contentRect,this.viewport)&&(null!=this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=void 0),this.isResizing||(this.resizeTimer=setTimeout((()=>{this.isResizing=!0,this.isResizeUpdate=!0,this.recalculateComponentDimensions()}),this.resizeDebounce)))}registerSlotChangeListeners(){this.mutationObserver=new MutationObserver((()=>this.injectViewerApi())),this.mutationObserver.observe(this.hostElement,{childList:!0,subtree:!0})}injectViewerApi(){function t(t){return Array.from(t.querySelectorAll("*"))}t(this.hostElement).filter((t=>t.nodeName.startsWith("VERTEX-"))).reduce(((i,s)=>[...i,s,...t(s)]),[]).forEach((t=>{t.viewer=this.hostElement}))}calculateComponentDimensions(){var t;const i=this.getBounds();if(null!=(null==i?void 0:i.width)&&null!=(null==i?void 0:i.height)){const s=d.create(i.width,i.height),n=d.scaleFit(2073600,s);this.hostDimensions=s,this.dimensions=null!=n?d.create(n.width,n.height):void 0,this.viewport=et.fromDimensions(null!==(t=this.getCanvasDimensions())&&void 0!==t?t:d.create(0,0))}}recalculateComponentDimensions(){var t;this.isResizing&&(this.calculateComponentDimensions(),this.isResizing=!1,null===(t=this.stream)||void 0===t||t.update({dimensions:this.dimensions}),this.dimensionschange.emit(this.dimensions))}reportPerformance(t){if("connected"===this.stateMap.streamState.type){const i={timings:t.map((t=>({receiveToPaintDuration:p(t.duration)})))};this.getStream().recordPerformance(i,!1)}}addStreamListeners(){this.stateMap.streamListeners=this.getStream().stateChanged.on((t=>{this.handleStreamStateChanged(this.stateMap.streamState,t)}))}handleStreamStateChanged(t,i){this.stateMap.streamState=i,"connecting"===i.type?this.handleConnecting(t,i):"connected"===i.type?this.handleConnected(t,i):"connection-failed"===i.type?this.handleConnectionFailed(t,i):"disconnected"===i.type&&this.handleDisconnected(t,i)}handleConnecting(t,i){"connecting"!==t.type&&(this.token=void 0,this.errorMessage=void 0,this.emitConnectionChange({status:"connecting"}))}handleConnected(t,i){this.token=i.token.token,"connected"!==t.type&&(this.errorMessage=void 0,this.canvasRenderer=Et(Dt,function(){let t;return async i=>{var s;const n=i.frame.sequenceNumber,e=await St(i.frame.image.imageBytes);return(null==t||n>t)&&(t=n,null===(s=i.beforeDraw)||void 0===s||s.call(i),kt(e,i)),e.dispose(),i.frame}}(),this.getResolvedConfig().flags.logFrameRate,(t=>this.reportPerformance(t))),this.resizeRenderer=Et(Dt,function(){const t=document.createElement("canvas");let i;return async s=>{var n;const e=s.frame.sequenceNumber,h=null==i||e>i,o=null==s.dimensions||d.isEqual(s.dimensions,s.frame.image.imageAttr.frameDimensions),r=await St(s.frame.image.imageBytes);t.width=s.canvasDimensions.width,t.height=s.canvasDimensions.height;const a=t.getContext("2d");return null!=a&&h&&o&&(i=e,kt(r,Object.assign(Object.assign({},s),{canvas:a})),null===(n=s.beforeDraw)||void 0===n||n.call(s),s.canvas.drawImage(t,0,0)),r.dispose(),s.frame}}(),this.getResolvedConfig().flags.logFrameRate,(t=>this.reportPerformance(t))),this.emitConnectionChange({status:"connected",jwt:i.token.token}),this.deviceIdChange.emit(i.deviceId)),this.frame!==i.frame&&this.updateFrame(i.frame)}handleConnectionFailed(t,i){"connection-failed"!==t.type&&(this.token=void 0,this.errorMessage=i.message)}handleDisconnected(t,i){"disconnected"!==t.type&&(this.token=void 0,this.errorMessage=void 0,this.emitConnectionChange({status:"disconnected"}))}async updateFrame(t){const i=this.getCanvasDimensions();if(null!=this.canvasElement&&null!=i&&this.frame!==t){const s=this.canvasElement.getContext("2d");if(null!=s){const n=this.frame;this.frame=t,this.updateInteractionApi(n);const e={canvas:s,canvasDimensions:i,dimensions:this.dimensions,frame:this.frame,viewport:this.viewport,beforeDraw:()=>{this.updateCanvasDimensions(i),this.isResizeUpdate=!1}};this.frameReceived.emit(this.frame),this.frame.scene.hasChanged&&this.sceneChanged.emit();const h=this.isResizeUpdate?await this.resizeRenderer(e):await this.canvasRenderer(e);this.dispatchFrameDrawn(h)}}}initializeInteractionHandler(t){if(null==this.stateMap.interactionTarget)throw new Z("Cannot initialize interaction handler. Interaction target is undefined.");if(null==this.interactionApi)throw new Z("Cannot initialize interaction handler. Interaction APi is undefined.");t.initialize(this.stateMap.interactionTarget,this.interactionApi)}createInteractionApi(){if(null==this.stream)throw new tt("Cannot create interaction API. Component has not been initialized.");return null==this.frame||this.frame.scene.camera.isPerspective()?new ct(this.stream,this.stateMap.cursorManager,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>this.viewport),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished):new lt(this.stream,this.stateMap.cursorManager,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>this.viewport),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished)}handleCursorChanged(){window.requestAnimationFrame((()=>{this.cursor=this.stateMap.cursorManager.getActiveCursor()}))}createScene(){if("connected"!==this.stateMap.streamState.type)throw new it("Cannot create scene. Viewer stream is not connected.");const{frame:t,sceneViewId:i,worldOrientation:s}=this.stateMap.streamState,n="string"==typeof this.selectionMaterial?st(this.selectionMaterial):this.selectionMaterial;return new nt(this.getStream(),t,T(s),(()=>this.getImageScale()),this.viewport,i,n)}getBackgroundColor(){if(null!=this.containerElement)return function(t){const i=window.getComputedStyle(t);return F.fromCss(i.backgroundColor)}(this.containerElement)}getBounds(){return this.hostElement.getBoundingClientRect()}getCanvasDimensions(){return this.getResolvedConfig().flags.letterboxFrames?this.dimensions:this.hostDimensions}getImageScale(){const t=this.getCanvasDimensions();if(null!=this.dimensions&&null!=t)return h.create(this.dimensions.width/t.width,this.dimensions.height/t.height)}getStreamAttributes(){return{depthBuffers:this.getDepthBufferStreamAttributesValue(),experimentalGhosting:this.experimentalGhostingOpacity,featureLines:this.featureLines,featureHighlighting:this.featureHighlighting,featureMaps:this.featureMaps}}updateCanvasDimensions(t){null!=this.canvasElement&&(this.canvasElement.width=t.width,this.canvasElement.height=t.height)}updateStreamAttributes(){var t;null===(t=this.stream)||void 0===t||t.update({streamAttributes:this.getStreamAttributes()})}updateInteractionApi(t){if(null!=t&&null!=this.frame){const i=t.scene.camera.isPerspective()&&this.frame.scene.camera.isOrthographic(),s=t.scene.camera.isOrthographic()&&this.frame.scene.camera.isPerspective();(i||s)&&(this.interactionApi=this.createInteractionApi(),this.interactionHandlers.forEach((t=>this.initializeInteractionHandler(t))))}}updateCameraType(){var t,i;null!=this.frame&&("orthographic"===this.cameraType&&this.frame.scene.camera.isPerspective()?null===(t=this.stream)||void 0===t||t.replaceCamera({camera:M(O(this.frame.scene.camera,this.frame.scene.boundingBox))}):"perspective"===this.cameraType&&this.frame.scene.camera.isOrthographic()&&(null===(i=this.stream)||void 0===i||i.replaceCamera({camera:M(j(this.frame.scene.camera))})))}getDepthBufferStreamAttributesValue(){var t;return null!==(t=this.depthBuffers)&&void 0!==t?t:this.rotateAroundTapPoint?"final":void 0}updateResolvedConfig(){this.resolvedConfig=K(this.configEnv,this.config)}getResolvedConfig(){return Ft("Resolved config is undefined",(()=>this.resolvedConfig))}getStream(){return Ft("Stream is undefined",(()=>this.stream))}getDeviceId(){if(null==this.deviceId){try{this.deviceId=function(t,i,s=window.localStorage){const n=s.getItem(Mt.DEVICE_ID);if(null!=n)return i(JSON.parse(n))}(0,(t=>t["device-id"]))}catch(t){console.warn("Cannot read device ID. Local storage is not supported.")}if(null==this.deviceId){this.deviceId=$.create();try{!function(t,i,s=window.localStorage){const n=s.getItem(t);if(null!=n){const e=Object.assign(Object.assign({},JSON.parse(n)),i);s.setItem(t,JSON.stringify(e))}else s.setItem(t,JSON.stringify(i))}(Mt.DEVICE_ID,{"device-id":this.deviceId})}catch(t){console.warn("Cannot write device ID. Local storage is not supported.")}}}return this.deviceId}get hostElement(){return e(this)}static get watchers(){return{src:["handleSrcChanged"],rotateAroundTapPoint:["handleRotateAboutTapPointChanged"],cameraType:["handleCameraTypeChanged"],depthBuffers:["handleDepthBuffersChanged"],experimentalGhostingOpacity:["handleExperimentalGhostingOpacityChanged"],featureLines:["handleFeatureLinesChanged"],featureHighlighting:["handleFeatureHighlightingChanged"],featureMaps:["handleFeatureMapsChanged"],config:["handleConfigChanged"],configEnv:["handleConfigEnvChanged"]}}};function Ft(t,i){const s=i();if(null!=s)return s;throw new Error(t)}Rt.style=":host{--image-background:var(--image-background);--viewer-background:var(--viewer-background);display:block;position:relative;width:300px;height:300px;min-width:1px;min-height:1px}.canvas-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:relative;background:var(--image-background, var(--viewer-background, #ffffff))}.enable-pointer-events{touch-action:none}.viewer-container{width:100%;height:100%;overflow:hidden;background:var(--viewer-background, #ffffff)}.error-message{position:absolute;top:50%;width:100%;transform:translateY(-50%);text-align:center}";export{Rt as vertex_viewer}
|
|
4
|
+
import{r as t,c as i,h as s,H as n,g as e}from"./p-cafa57a6.js";import{p as h,v as o,h as r,j as a,r as l,b as c,q as u,d}from"./p-661f0612.js";import{l as v,m as w,n as f,t as p,E as m,p as g,o as y,q as b,S as C,r as P,s as T,u as I,x,y as D,z as S,B as k,W as E,g as M,C as O,G as j}from"./p-77be081a.js";import{E as A,m as R,c as F,o as B,u as z,a as N,b as $}from"./p-e75bba97.js";import{c as L}from"./p-f482325b.js";import{p as K}from"./p-809d09d9.js";import{C as W}from"./p-3561d910.js";import{g as V,c as q}from"./p-487e054a.js";import{I as H,f as U,C as G,W as J,a as _,b as X,d as Y,V as Q,e as Z,g as tt,h as it,i as st,S as nt}from"./p-d32b54cb.js";import{V as et}from"./p-a93a63a9.js";import"./p-112455b1.js";class ht{constructor(t){this.viewer=t,this.handleInteractionStarted=()=>{this.invalidateStencilBuffer(),this.pendingInteractionFinished=new Promise((t=>{this.pendingInteractionFinishedResolver=t}))},this.handleInteractionFinished=()=>{var t;null===(t=this.pendingInteractionFinishedResolver)||void 0===t||t.call(this),this.pendingInteractionFinished=void 0,this.pendingInteractionFinishedResolver=void 0},this.invalidateStencilBuffer=()=>{this.pendingStencilBuffer=void 0},t.addEventListener("interactionStarted",this.handleInteractionStarted),t.addEventListener("interactionFinished",this.handleInteractionFinished),t.addEventListener("frameReceived",(()=>{this.invalidateStencilBuffer()}))}async fetch(){var t;const i=await this.viewer.isSceneReady()?await this.viewer.scene():void 0,s=null!=i&&(i.crossSectioning().current().sectionPlanes.length>0||null!=this.viewer.featureLines),n=null===(t=this.viewer.frame)||void 0===t?void 0:t.scene.camera;if(s&&null!=this.viewer.stream&&null!=n){const t=await this.viewer.stream.getStencilBuffer({includeDepthBuffer:!0}),{stencilBuffer:i,depthBuffer:s,imageAttributes:e}=v(t),[h,o]=await Promise.all([w(new Uint8Array(i)),w(new Uint8Array(s))]);return ot.fromPng(h,e,i,f.fromPng(o,n,e))}}latest(){return null==this.pendingStencilBuffer&&(this.pendingStencilBuffer=this.fetch()),this.pendingStencilBuffer}async latestAfterInteraction(){return await this.pendingInteractionFinished,this.latest()}}class ot{constructor(t,i,s,n,e){this.imageAttr=t,this.imageBytes=i,this.pixelBytes=s,this.imageChannels=n,this.depthBuffer=e}static fromPng(t,i,s,n){if(t.data instanceof Uint8Array){if(1!==t.channels)throw new Error("Expected stencil PNG to have 1 color channel");return new ot(i,s,t.data,t.channels,n)}throw new Error("Expected stencil PNG to have depth of 8-bit")}getValue(t){const{width:i,height:s}=this.imageAttr.imageRect,n=h.subtract(t,this.imageAttr.imageRect),e=1/this.imageAttr.imageScale,o=h.scale(n,e,e);if(o.x>=0&&o.y>=0&&o.x<i&&o.y<s){const t=Math.floor(o.x)+Math.floor(o.y)*i;return this.pixelBytes[t]}return 0}hitTest(t){return 0!==this.getValue(t)}snapToNearestPixel(t,i,s=(()=>!0)){const n=2*i,e=h.create(t.x-i,t.y-i),o=[];for(let r=0;r<n*n;r++){const a=r%n,l=Math.floor(r/n),c=h.add(e,{x:a,y:l});if(h.distance(c,t)<=i){const t=this.getValue(c);255===t&&s(t)&&o.push(c)}}const r=o.sort(((i,s)=>h.distance(i,t)-h.distance(s,t)))[0];return null!=r?h.create(Math.floor(r.x)+.5,Math.floor(r.y)+.5):t}}class rt{constructor(t,i,s){this.stream=t,this.configProvider=i,this.imageScaleProvider=s}predicate(t){return t.altKey&&!t.shiftKey}async fn(t){var i;const s=this.imageScaleProvider(),n=await this.stream.hitItems({point:h.scale(t.position,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1)},!0);null!=(null===(i=n.hitItems)||void 0===i?void 0:i.hits)&&n.hitItems.hits.length>0?await this.stream.flyTo({itemId:n.hitItems.hits[0].itemId,animation:{duration:p(this.configProvider().animation.durationMs)}}):console.debug(`No hit results found for fly to part [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}class at{constructor(t,i,s,n,e,h,o,r,a,l,c){this.stream=t,this.cursors=i,this.getConfig=s,this.getScene=n,this.getFrame=e,this.getViewport=h,this.tapEmitter=o,this.doubleTapEmitter=r,this.longPressEmitter=a,this.interactionStartedEmitter=l,this.interactionFinishedEmitter=c,this.tap=this.tap.bind(this),this.doubleTap=this.doubleTap.bind(this),this.longPress=this.longPress.bind(this),this.emitTapEvent=this.emitTapEvent.bind(this)}addCursor(t,i){return this.cursors.add(t,i)}async getWorldPointFromViewport(t){const i=this.getViewport(),s=this.getFrame();if(null==s)throw new Error("Cannot get world point. Frame is undefined.");const n=await s.depthBuffer();return null!=n?i.transformPointToWorldSpace(t,n,.5):void 0}async getEntityTypeAtPoint(t){var i;const s=this.getViewport(),n=await(null===(i=this.getFrame())||void 0===i?void 0:i.featureMap());if(null!=n){const i=s.transformPointToFrame(t,n);return n.getEntityType(i)}return m.NO_GEOMETRY}getRayFromPoint(t){const i=this.getViewport(),s=this.getFrame();if(null!=s)return i.transformPointToRay(t,s.image,s.scene.camera);throw new Error("Cannot get camera. Frame is undefined.")}async tap(t,i={},s=0){this.emitTapEvent(this.tapEmitter.emit,t,i,s)}async doubleTap(t,i={},s=0){this.emitTapEvent(this.doubleTapEmitter.emit,t,i,s)}async longPress(t,i={},s=0){this.emitTapEvent(this.longPressEmitter.emit,t,i,s)}async beginInteraction(){this.isInteracting()||(this.interactionStartedEmitter.emit(),this.currentCamera=this.getScene().camera(),await this.stream.beginInteraction())}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),n=this.getViewport(),e=this.getFrame(),h=await(null==e?void 0:e.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=n&&null!=e?t({camera:this.currentCamera,viewport:n,scale:s.scale(),boundingBox:s.boundingBox(),frame:e,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}async twistCamera(...t){return this.transformCamera((({camera:i,viewport:s})=>{const n=o.normalize(o.subtract(i.lookAt,i.position));if(1===t.length&&"number"==typeof t[0]){const s=r.toRadians(-t[0]);return i.rotateAroundAxis(s,n)}if(1===t.length){const n=h.create(s.width/2,s.height/2),e=r.toDegrees(r.fromPoints(n,t[0])),a=null!=this.lastAngle?e-this.lastAngle:0;this.lastAngle=e;const l=o.normalize(o.subtract(i.lookAt,i.position)),c=r.toRadians(-a);return i.rotateAroundAxis(c,l)}return i}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:n,depthBuffer:e})=>{if(null==this.panData){const h=i.toFrameCamera(),o=h.direction,r=n.transformPointToRay(t,s.image,h),c=a.fromNormalAndCoplanarPoint(o,i.lookAt),u=l.intersectPlane(r,c);if(null==u)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;const d=null!=e?this.getWorldPoint(t,e,u):u,v=a.fromNormalAndCoplanarPoint(o,d);this.panData={hitPt:d,hitPlane:v,startingCamera:h}}if(null!=this.panData){const{hitPt:e,hitPlane:h,startingCamera:r}=this.panData,a=n.transformPointToRay(t,s.image,r),c=l.intersectPlane(a,h);if(null!=c){const t=o.subtract(e,c);return i.update(r).moveBy(t)}}return i}))}async viewAll(){await this.getScene().camera().viewAll().render()}async rotateCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=o.normalize(i.up),e=o.normalize(o.subtract(i.lookAt,i.position)),h=o.cross(n,e),r=o.cross(e,h),a=o.normalize({x:t.x*h.x+t.y*r.x,y:t.x*h.y+t.y*r.y,z:t.x*h.z+t.y*r.z}),l=o.cross(a,e),c=3*Math.PI*t.x/s.width,u=3*Math.PI*t.y/s.height,d=Math.abs(c)+Math.abs(u);return i.rotateAroundAxis(d,l)}))}async rotateCameraAtPoint(t,i){return this.transformCamera((({camera:s,viewport:n,boundingBox:e,depthBuffer:h})=>{if(null==this.worldRotationPoint){const t=c.center(e);this.worldRotationPoint=null!=h?this.getWorldPoint(i,h,t):s.lookAt}const r=o.normalize(s.up),a=o.normalize(o.subtract(s.lookAt,s.position)),l=o.cross(r,a),u=o.cross(a,l),d=o.normalize({x:t.x*l.x+t.y*u.x,y:t.x*l.y+t.y*u.y,z:t.x*l.z+t.y*u.z}),v=o.cross(d,a),w=3*Math.PI*t.x/n.width,f=3*Math.PI*t.y/n.height,p=Math.abs(w)+Math.abs(f),m=s.rotateAroundAxisAtPoint(p,this.worldRotationPoint,v);return m.update({lookAt:o.add(o.scale(Math.abs(s.signedDistanceToBoundingBoxCenter())/o.magnitude(m.viewVector),m.viewVector),m.position)})}))}async zoomCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=i.viewVector,e=o.normalize(n),h=o.magnitude(n),r=o.add(i.position,o.scale(3*h*t/s.height,e));return i.update({position:r})}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:n,frame:e,depthBuffer:h})=>{const r=e.scene.camera,c=r.direction,u=s.toFrameCamera(),d=n.transformPointToRay(t,e.image,u);if(null==this.zoomData){const i=a.fromNormalAndCoplanarPoint(c,r.lookAt),n=l.intersectPlane(d,i);if(null==n)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const e=null!=h?this.getWorldPoint(t,h,n):n,o=a.fromNormalAndCoplanarPoint(c,e);this.zoomData={hitPt:e,hitPlane:o}}if(null!=this.zoomData){const{hitPt:t,hitPlane:e}=this.zoomData,h=o.distance(s.position,t),r=l.at(d,6*h*i/n.height),c=a.projectPoint(e,r),u=s.update({position:r,lookAt:c});if(o.distance(r,c)>=u.near)return u}return s}))}async endInteraction(){this.isInteracting()&&(this.currentCamera=void 0,this.worldRotationPoint=void 0,this.panData=void 0,this.zoomData=void 0,this.resetLastAngle(),this.interactionFinishedEmitter.emit(),await this.stream.endInteraction())}resetLastAngle(){this.lastAngle=void 0}isInteracting(){return null!=this.currentCamera}pixelThreshold(t){return(this.isCoarseInputDevice(t)?this.getConfig().coarsePointerThreshold:this.getConfig().finePointerThreshold)*window.devicePixelRatio}async hitItems(t){var i;const s=await this.getScene().raycaster().hitItems(t);return null!==(i=null==s?void 0:s.hits)&&void 0!==i?i:[]}emitTapEvent(t,i,s={},n=0){const{altKey:e=!1,ctrlKey:h=!1,metaKey:o=!1,shiftKey:r=!1}=s;t({position:i,altKey:e,ctrlKey:h,metaKey:o,shiftKey:r,buttons:n})}isCoarseInputDevice(t){return t||window.matchMedia("(pointer: coarse)").matches}getWorldPoint(t,i,s){const n=this.getViewport(),e=n.transformPointToFrame(t,i);return i.hitTest(e)?n.transformPointToWorldSpace(t,i):s}}class lt extends at{constructor(t,i,s,n,e,h,o,r,a,l,c){super(t,i,s,n,e,h,o,r,a,l,c)}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{const n=i.viewVector,e=o.normalize(i.up),h=o.normalize(n),r=o.magnitude(n)*Math.tan(i.fovHeight),a=t.x*r/s.width,l=t.y/s.width*r,c=o.cross(e,h),u=o.cross(h,c),d=o.add(o.scale(a,c),o.scale(l,u));return i.moveBy(d)}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:n})=>{if(null==this.panData){const e=i.toFrameCamera(),h=e.direction,o=n.transformPointToOrthographicRay(t,s.image,e),r=a.fromNormalAndCoplanarPoint(h,i.lookAt),c=l.intersectPlane(o,r);if(null==c)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;this.panData={hitPt:c,hitPlane:r,startingCamera:e}}if(null!=this.panData){const{hitPt:e,hitPlane:h,startingCamera:r}=this.panData,a=n.transformPointToOrthographicRay(t,s.image,r),c=l.intersectPlane(a,h);if(null!=c){const t=o.subtract(e,c);return i.update({lookAt:o.add(r.lookAt,t)})}}return i}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:n,frame:e,depthBuffer:r})=>{if(null==this.orthographicZoomData||h.distance(t,this.orthographicZoomData.startingScreenPt)>2){const i=s.toFrameCamera(),h=i.direction,o=n.transformPointToOrthographicRay(t,e.image,i),c=a.fromNormalAndCoplanarPoint(h,i.lookAt),u=l.intersectPlane(o,c);if(null==u)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const d=null!=r?this.getWorldPoint(t,r,u):u,v=a.fromNormalAndCoplanarPoint(h,d);this.orthographicZoomData={hitPt:d,hitPlane:v,startingScreenPt:t}}if(null!=this.orthographicZoomData){const{hitPt:t,hitPlane:e}=this.orthographicZoomData,h=s.fovHeight/n.height*2*i,r=Math.max(1,s.fovHeight-h),l=a.projectPoint(e,s.lookAt),c=o.scale((s.fovHeight-r)/s.fovHeight,o.subtract(t,l));return s.update({lookAt:o.add(s.lookAt,c),fovHeight:Math.max(1,s.fovHeight-h)})}return s}))}getWorldPoint(t,i,s){const n=this.getViewport(),e=n.transformPointToFrame(t,i);return i.hitTest(e)?n.transformPointToOrthographicWorldSpace(t,i):s}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),n=this.getViewport(),e=this.getFrame(),h=await(null==e?void 0:e.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=n&&null!=e?t({camera:this.currentCamera,viewport:n,scale:s.scale(),boundingBox:s.boundingBox(),frame:e,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}}class ct extends at{constructor(t,i,s,n,e,h,o,r,a,l,c){super(t,i,s,n,e,h,o,r,a,l,c)}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{var n;const e=i.viewVector,h=o.normalize(i.up),r=o.normalize(e),a=o.magnitude(e)*Math.tan(null!==(n=i.fovY)&&void 0!==n?n:45),l=t.x*a/s.width,c=t.y/s.width*a,u=o.cross(h,r),d=o.cross(r,u),v=o.add(o.scale(l,u),o.scale(c,d));return i.moveBy(v)}))}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),n=this.getViewport(),e=this.getFrame(),h=await(null==e?void 0:e.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=n&&null!=e?t({camera:this.currentCamera,viewport:n,scale:s.scale(),boundingBox:s.boundingBox(),frame:e,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}}class ut{constructor(t,i,s,n){this.stream=t,this.configProvider=i,this.imageScaleProvider=s,this.sceneProvider=n}predicate(t){return t.altKey&&t.shiftKey}async fn(t){var i,s;const n=this.imageScaleProvider(),e=await this.stream.hitItems({point:h.scale(t.position,(null==n?void 0:n.x)||1,(null==n?void 0:n.y)||1)},!0);if(null!=(null===(i=e.hitItems)||void 0===i?void 0:i.hits)&&e.hitItems.hits.length>0&&null!=e.hitItems.hits[0].hitPoint){const i=this.sceneProvider().camera(),n=e.hitItems.hits[0];null!=n.hitPoint&&null!=n.hitPoint.x&&null!=n.hitPoint.y&&null!=n.hitPoint.z?await this.stream.flyTo({camera:i.update({lookAt:o.create(n.hitPoint.x,n.hitPoint.y,n.hitPoint.z)}).toFrameCamera(),animation:{duration:p(this.configProvider().animation.durationMs)}}):console.debug(`No hit position found for fly to position [position={x: ${t.position.x}, y: ${t.position.y}}, hit-id={${null===(s=n.itemId)||void 0===s?void 0:s.hex}}]`)}else console.debug(`No hit results found for fly to position [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}const dt=[.2,.15,.25,.25,.15];class vt{constructor(t,i,s,n,e,h,o,r,a){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.rotateInteraction=n,this.rotatePointInteraction=e,this.zoomInteraction=h,this.panInteraction=o,this.twistInteraction=r,this.getConfig=a,this.primaryInteraction=this.rotateInteraction,this.isDragging=!1,this.keyboardControls=!1,this.disableIndividualInteractions=!1,this.primaryInteractionTypeChange=new A,this.handleDownEvent=this.handleDownEvent.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleWindowMove=this.handleWindowMove.bind(this),this.handleWindowUp=this.handleWindowUp.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this)}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDownEvent),t.addEventListener("mousedown",this.handleDoubleClick),t.addEventListener("wheel",this.handleMouseWheel)}dispose(){var t,i,s;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDownEvent),null===(i=this.element)||void 0===i||i.removeEventListener("mousedown",this.handleDoubleClick),null===(s=this.element)||void 0===s||s.removeEventListener("wheel",this.handleMouseWheel),this.element=void 0}onPrimaryInteractionTypeChange(t){return this.primaryInteractionTypeChange.on(t)}setCurrentInteractionType(t){var i;switch(t){case"rotate":this.currentInteraction=this.rotateInteraction;break;case"zoom":this.currentInteraction=this.zoomInteraction;break;case"pan":this.currentInteraction=this.panInteraction;break;case"twist":this.currentInteraction=this.twistInteraction;break;case"rotate-point":this.currentInteraction=this.rotatePointInteraction;break;default:this.currentInteraction=void 0}if(this.draggingInteraction){const t=this.draggingInteraction.getPosition();this.draggingInteraction=this.currentInteraction||this.primaryInteraction,null===(i=this.interactionApi)||void 0===i||i.resetLastAngle(),this.draggingInteraction.setPosition(t)}}getPrimaryInteractionType(){return this.primaryInteraction.getType()}getCurrentInteractionType(){return(this.currentInteraction||this.primaryInteraction).getType()}setPrimaryInteractionType(t){switch(t){case"rotate":this.primaryInteraction=this.rotateInteraction;break;case"rotate-point":this.primaryInteraction=this.rotatePointInteraction;break;case"zoom":this.primaryInteraction=this.zoomInteraction;break;case"pan":this.primaryInteraction=this.panInteraction}this.primaryInteractionTypeChange.emit()}setDefaultKeyboardControls(t){this.keyboardControls=t}handleDownEvent(t){this.interactionTimer=window.setTimeout((()=>{this.downPosition=h.create(t.screenX,t.screenY),this.downPositionCanvas=this.getCanvasPosition(t),this.interactionTimer=void 0,null!=this.lastMoveEvent&&this.handleWindowMove(this.lastMoveEvent)}),this.getConfig().interactions.interactionDelay),window.addEventListener(this.moveEvent,this.handleWindowMove),window.addEventListener(this.upEvent,this.handleWindowUp)}handleWindowMove(t){if(null==this.interactionTimer){if(this.disableIndividualInteractions)return;const i=h.create(t.screenX,t.screenY),s=null!=this.interactionApi?this.interactionApi.pixelThreshold(this.isTouch(t)):2;null!=this.downPosition&&h.distance(i,this.downPosition)>=s&&!this.isDragging&&(this.beginDrag(t),this.isDragging=!0),this.isDragging&&this.drag(t)}this.lastMoveEvent=t}async handleWindowUp(t){this.isDragging&&(this.endDrag(t),this.isDragging=!1),null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0),window.removeEventListener(this.moveEvent,this.handleWindowMove),window.removeEventListener(this.upEvent,this.handleWindowUp),this.lastMoveEvent=void 0}async handleDoubleClick(t){2===t.detail&&4===t.buttons&&null!=this.interactionApi&&this.interactionApi.viewAll()}beginDrag(t){this.keyboardControls&&t.metaKey&&t.shiftKey?this.currentInteraction=this.rotatePointInteraction:this.keyboardControls&&t.shiftKey?this.currentInteraction=this.zoomInteraction:this.keyboardControls&&(t.metaKey||t.ctrlKey)?this.currentInteraction=this.panInteraction:this.keyboardControls&&t.altKey&&(this.currentInteraction=this.rotateInteraction),1===t.buttons||4===t.buttons?this.draggingInteraction=this.currentInteraction||this.primaryInteraction:2===t.buttons&&(this.draggingInteraction=this.panInteraction),null!=this.draggingInteraction&&null!=this.interactionApi&&null!=this.element&&(this.zoomInteraction.endDrag(t,this.interactionApi),this.draggingInteraction.beginDrag(t,this.downPositionCanvas||h.create(t.clientX,t.clientY),this.interactionApi,this.element))}drag(t){this.currentInteraction=this.keyboardControls&&t.altKey&&t.shiftKey?this.twistInteraction:void 0,this.draggingInteraction=this.currentInteraction||this.draggingInteraction||this.primaryInteraction,null!=this.draggingInteraction&&null!=this.interactionApi&&this.draggingInteraction.drag(t,this.interactionApi)}endDrag(t){this.keyboardControls&&this.currentInteraction===this.twistInteraction&&(this.currentInteraction=void 0),null!=this.draggingInteraction&&null!=this.interactionApi&&(this.draggingInteraction.endDrag(t,this.interactionApi),this.draggingInteraction=void 0)}handleMouseWheel(t){if(t.preventDefault(),null!=this.element&&null!=this.interactionApi&&4!==t.buttons){const i=-this.wheelDeltaToPixels(t.deltaY,t.deltaMode)/10,s=this.element.getBoundingClientRect(),n=V(t,s);dt.forEach(((t,s)=>{window.setTimeout((()=>{null!=this.interactionApi&&this.zoomInteraction.zoomToPoint(n,i*t,this.interactionApi)}),2*s)}))}}wheelDeltaToPixels(t,i){null==this.computedBodyStyle&&(this.computedBodyStyle=window.getComputedStyle(document.body));const s=null==this.computedBodyStyle.fontSize||""===this.computedBodyStyle.fontSize||isNaN(parseFloat(this.computedBodyStyle.fontSize))?19.2:1.2*parseFloat(this.computedBodyStyle.fontSize);return 1===i?null==this.computedBodyStyle.lineHeight||""===this.computedBodyStyle.lineHeight||isNaN(parseFloat(this.computedBodyStyle.lineHeight))?t*s:t*parseFloat(this.computedBodyStyle.lineHeight):2===i?null==this.computedBodyStyle.height||""===this.computedBodyStyle.height||isNaN(parseFloat(this.computedBodyStyle.height))?t*window.innerHeight:t*parseFloat(this.computedBodyStyle.height):t}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),n=null!=s?h.create(s.left,s.top):void 0;return null!=n?h.subtract(h.create(t.clientX,t.clientY),n):void 0}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class wt{setPosition(t){this.currentPosition=t}getPosition(){return this.currentPosition}getType(){return this.type}beginDrag(t,i,s,n){}drag(t,i){}endDrag(t,i){null!=this.currentPosition&&(i.endInteraction(),this.currentPosition=void 0)}zoom(t,i){}}class ft extends wt{constructor(){super(...arguments),this.type="rotate"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.screenX,t.screenY),n=h.subtract(s,this.currentPosition);i.rotateCamera(n),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class pt extends wt{constructor(){super(...arguments),this.type="rotate-point"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),this.startingPosition=i,s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.startingPosition){const s=h.create(t.screenX,t.screenY),n=h.subtract(s,this.currentPosition);i.rotateCameraAtPoint(n,this.startingPosition),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class mt extends wt{constructor(t=1e3){super(),this.interactionTimeout=t,this.type="zoom",this.didTransformBegin=!1}beginDrag(t,i,s,n){if(null==this.currentPosition){this.currentPosition=h.create(t.clientX,t.clientY);const i=n.getBoundingClientRect(),e=V(t,i);this.startPt=e,s.beginInteraction()}}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.clientX,t.clientY),n=h.subtract(s,this.currentPosition);null!=this.startPt&&(i.zoomCameraToPoint(this.startPt,n.y),this.currentPosition=s)}}endDrag(t,i){super.endDrag(t,i),this.stopInteractionTimer(),this.didTransformBegin=!1,this.startPt=void 0}zoom(t,i){this.operateWithTimer(i,(()=>i.zoomCamera(t)))}zoomToPoint(t,i,s){this.operateWithTimer(s,(()=>s.zoomCameraToPoint(t,i)))}beginInteraction(t){this.didTransformBegin=!0,t.beginInteraction()}endInteraction(t){this.didTransformBegin=!1,t.endInteraction()}resetInteractionTimer(t){this.stopInteractionTimer(),this.startInteractionTimer(t)}startInteractionTimer(t){this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0,this.endInteraction(t)}),this.interactionTimeout)}stopInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}operateWithTimer(t,i){this.didTransformBegin||this.beginInteraction(t),this.resetInteractionTimer(t),i()}}class gt extends wt{constructor(){super(...arguments),this.type="pan"}beginDrag(t,i,s,n){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),this.canvasRect=n.getBoundingClientRect(),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.canvasRect){const s=V(t,this.canvasRect);i.panCameraToScreenPoint(s),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class yt extends wt{constructor(){super(...arguments),this.type="twist"}beginDrag(t,i,s){this.currentPosition=h.create(t.clientX,t.clientY),s.beginInteraction()}drag(t,i){const s=h.create(t.clientX,t.clientY);this.currentPosition=s,i.twistCamera(s)}endDrag(t,i){super.endDrag(t,i)}}class bt extends vt{constructor(t,i=new ft,s=new pt,n=new mt,e=new gt,h=new yt){super("mousedown","mouseup","mousemove",i,s,n,e,h,t)}}class Ct{initialize(t,i){this.element=t,this.interactionApi=i}dispose(){this.element=void 0}handleTwoPointTouchMove(t,i){var s,n,e,o;if(null!=this.currentPosition1&&null!=this.currentPosition2){const a=h.scale(h.add(h.subtract(t,this.currentPosition1),h.subtract(i,this.currentPosition2)),.25,.25),l=.5*(h.distance(t,i)-h.distance(this.currentPosition1,this.currentPosition2)),c=u.create(h.subtract(this.currentPosition1,this.currentPosition2),h.subtract(t,i)),d=r.toDegrees(Math.atan2(u.determinant(c),u.dot(c)));null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(n=this.interactionApi)||void 0===n||n.zoomCamera(l),null===(e=this.interactionApi)||void 0===e||e.panCameraByDelta(a),console.log(Math.abs(d)),Math.abs(d)>.5&&(null===(o=this.interactionApi)||void 0===o||o.twistCamera(d))}this.currentPosition1=t,this.currentPosition2=i}}class Pt extends Ct{constructor(){super(),this.touchPoints={},this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("pointerdown",this.handlePointerDown),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){const i=h.create(t.screenX,t.screenY);this.touchPoints=Object.assign(Object.assign({},this.touchPoints),{[t.pointerId]:i}),1===Object.keys(this.touchPoints).length&&(window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp))}handlePointerMove(t){null!=this.touchPoints[t.pointerId]&&(this.touchPoints[t.pointerId]=h.create(t.screenX,t.screenY));const i=Object.keys(this.touchPoints);2===i.length&&this.handleTwoPointTouchMove(this.touchPoints[i[0]],this.touchPoints[i[1]])}handlePointerUp(t){var i;delete this.touchPoints[t.pointerId];const s=Object.keys(this.touchPoints);1===s.length&&(null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.currentPosition1=void 0,this.currentPosition2=void 0),0===s.length&&(window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp))}}class Tt extends vt{constructor(t){super("pointerdown","pointerup","pointermove",new ft,new pt,new mt,new gt,new yt,t),this.touchPoints=new Set,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){this.downPosition=h.create(t.screenX,t.screenY),this.touchPoints.add(t.pointerId),1===this.touchPoints.size&&window.addEventListener("pointerup",this.handlePointerUp),2===this.touchPoints.size&&(this.disableIndividualInteractions=!0)}handlePointerUp(t){this.touchPoints.delete(t.pointerId),this.touchPoints.size<2&&(this.disableIndividualInteractions=!1),0===this.touchPoints.size&&window.removeEventListener("pointerup",this.handlePointerUp)}}class It{constructor(t,i,s,n){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.getConfig=n,this.handleDown=this.handleDown.bind(this),this.handleUp=this.handleUp.bind(this),this.handleMove=this.handleMove.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerEnd=this.handlePointerEnd.bind(this),this.clearPositions=this.clearPositions.bind(this),this.restartDoubleTapTimer=this.restartDoubleTapTimer.bind(this),this.clearDoubleTapTimer=this.clearDoubleTapTimer.bind(this),this.restartLongPressTimer=this.restartLongPressTimer.bind(this),this.clearLongPressTimer=this.clearLongPressTimer.bind(this),this.setPointerPositions=this.setPointerPositions.bind(this),this.emit=this.emit.bind(this)}dispose(){var t,i;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDown),null===(i=this.element)||void 0===i||i.removeEventListener("touchstart",this.handleTouchStart),this.element=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer()}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDown),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){1===t.touches.length&&(this.setPointerPositions(h.create(t.touches[0].clientX,t.touches[0].clientY)),this.restartLongPressTimer(),window.addEventListener("touchend",this.handleTouchEnd),window.addEventListener("touchmove",this.handleTouchMove))}handleTouchMove(t){t.touches.length>0&&this.handlePointerMove(h.create(t.touches[0].clientX,t.touches[0].clientY),!0)}handleTouchEnd(t){null!=this.pointerDownPosition&&(window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchmove",this.handleTouchMove)),this.handlePointerEnd(this.pointerDownPosition)}handleDown(t){this.setPointerPositions(h.create(t.clientX,t.clientY)),this.buttons=t.buttons,this.restartLongPressTimer({altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}),window.addEventListener(this.upEvent,this.handleUp),window.addEventListener(this.moveEvent,this.handleMove)}handleMove(t){this.handlePointerMove(h.create(t.clientX,t.clientY),this.isTouch(t))}handleUp(t){null!=this.pointerDownPosition&&(window.removeEventListener(this.upEvent,this.handleUp),window.removeEventListener(this.moveEvent,this.handleMove)),this.handlePointerEnd(h.create(t.clientX,t.clientY),{altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey},this.buttons,this.isTouch(t)),this.buttons=void 0}handlePointerMove(t,i){var s;const n=(null===(s=this.interactionApi)||void 0===s?void 0:s.pixelThreshold(i))||2;null!=this.pointerDownPosition&&h.distance(t,this.pointerDownPosition)>=n&&null==this.interactionTimer&&this.clearPositions()}handlePointerEnd(t,i={},s=0,n=!1){var e,h;null!=t&&(null!=this.longPressTimer&&this.emit(null===(e=this.interactionApi)||void 0===e?void 0:e.tap)(t,i,s),null!=this.doubleTapTimer&&null!=this.secondPointerDownPosition&&(this.emit(null===(h=this.interactionApi)||void 0===h?void 0:h.doubleTap)(t,i,s,this.secondPointerDownPosition),this.clearDoubleTapTimer())),this.pointerDownPosition=void 0,this.clearLongPressTimer()}emit(t){return(i,s={},n=0,e,o=!1)=>{var r;const a=e||this.pointerDownPosition,l=(null===(r=this.interactionApi)||void 0===r?void 0:r.pixelThreshold(o))||1;let c;null!=this.interactionTimer?c=this.getCanvasPosition(a||i):null!=a&&h.distance(a,i)<=l&&(c=this.getCanvasPosition(i)),null!=c&&null!=t&&t(c,s,n)}}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),n=null!=s?h.create(s.left,s.top):void 0;return null!=n?h.subtract(h.create(t.x,t.y),n):void 0}clearPositions(){this.pointerDownPosition=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer(),this.clearInteractionTimer()}clearDoubleTapTimer(){null!=this.doubleTapTimer&&window.clearTimeout(this.doubleTapTimer),this.doubleTapTimer=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0}restartDoubleTapTimer(){this.clearDoubleTapTimer(),this.doubleTapTimer=window.setTimeout((()=>this.clearDoubleTapTimer()),this.getConfig().events.doubleTapThreshold)}clearLongPressTimer(){null!=this.longPressTimer&&window.clearTimeout(this.longPressTimer),this.longPressTimer=void 0}restartLongPressTimer(t={}){this.clearLongPressTimer(),this.longPressTimer=window.setTimeout((()=>{var i;this.pointerDownPosition&&this.emit(null===(i=this.interactionApi)||void 0===i?void 0:i.longPress)(this.pointerDownPosition,t,this.buttons),this.clearLongPressTimer()}),this.getConfig().events.longPressThreshold)}restartInteractionTimer(){this.clearInteractionTimer(),this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0}),this.getConfig().interactions.interactionDelay)}clearInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}setPointerPositions(t){this.pointerDownPosition=t,this.restartInteractionTimer(),null==this.firstPointerDownPosition?(this.restartDoubleTapTimer(),this.firstPointerDownPosition=t):this.secondPointerDownPosition=t}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class xt extends Ct{constructor(){super(),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("touchstart",this.handleTouchStart),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){if(t.touches.length>=1){const i=t.touches[0],s=t.touches[1];this.currentPosition1=h.create(i.screenX,i.screenY),this.currentPosition2=null!=s?h.create(s.screenX,s.screenY):void 0,window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),window.addEventListener("touchend",this.handleTouchEnd)}}handleTouchMove(t){if(1===t.touches.length)this.handleOnePointTouchMove(t.touches[0]);else if(2===t.touches.length){const i=h.create(t.touches[0].clientX,t.touches[0].clientY),s=h.create(t.touches[1].clientX,t.touches[1].clientY);this.handleTwoPointTouchMove(i,s)}}handleTouchEnd(t){var i;null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.isInteracting=!1,window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd)}handleOnePointTouchMove(t){var i,s,n;const e=h.create(t.screenX,t.screenY);if(null!=this.currentPosition1){const t=h.subtract(e,this.currentPosition1),o=(null===(i=this.interactionApi)||void 0===i?void 0:i.pixelThreshold(!0))||2;(h.distance(e,this.currentPosition1)>=o||this.isInteracting)&&(null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(n=this.interactionApi)||void 0===n||n.rotateCamera(t),this.isInteracting=!0)}this.currentPosition1=e}}const Dt=new class{constructor(t,i=window.performance){this.name=t,this.perf=i,this.measures=new Set,this.nextId=0}clearMeasurements(){this.perf.clearMeasures(this.name)}measure(t){if(null!=(i=t)&&i.then instanceof Function&&i.catch instanceof Function&&i.finally instanceof Function){const i=this.begin();return t.finally((()=>this.end(i)))}if("function"==typeof t){const i=this.begin(),s=t();return this.end(i),s}throw new Error("Input must be a function or Promise");var i}takeMeasurements(){const t=this.perf.getEntriesByName(this.name);return this.clearMeasurements(),t}takeLastMeasurement(){const t=this.takeMeasurements();return t[t.length-1]}begin(){const t=`${this.name}-${this.nextId++}`;return this.measures.add(t),this.perf.mark(t),t}end(t){this.perf.measure(this.name,t),this.perf.clearMarks(t),this.measures.delete(t)}}("paint_time");function St(t){return null!=window.createImageBitmap?async function(t){const i=new Blob([t]),s=await window.createImageBitmap(i);return{image:s,dispose:()=>s.close()}}(t):(i=t,new Promise(((t,s)=>{const n=new Blob([i]),e=URL.createObjectURL(n),h=new Image;h.addEventListener("load",(()=>{t({image:h,dispose:()=>{}}),URL.revokeObjectURL(e)})),h.addEventListener("error",(()=>{s(new H("Failed to load image data")),URL.revokeObjectURL(e)})),h.src=e})));var i}function kt(t,i){const s=i.viewport.calculateDrawRect(i.frame.image);i.canvas.clearRect(0,0,i.canvasDimensions.width,i.canvasDimensions.height),i.canvas.drawImage(t.image,s.x,s.y,s.width,s.height)}function Et(t,i,s,n,e=1e3){let h,o,r=0,a=[];return s&&setInterval((()=>{if(null!=o){5===a.length?a=[...a.slice(1),o]:a.push(o);const t=a.reduce(((t,i)=>t+i))/a.length;console.debug(`Paint rate: ${o}fps`),console.debug(`Paint rate (avg): ${t}`),o=void 0}}),1e3),s=>(r++,null==h&&(h=setInterval((()=>{!function(t,i){const s=t.takeMeasurements();s.length>0&&i(s)}(t,n),0===r&&null!=h&&(clearInterval(h),h=void 0)}),e)),t.measure((async()=>{const t=await i(s);return o=null==o?1:o+1,t})).finally((()=>{r--})))}var Mt;!function(t){t.DEVICE_ID="vertexvis:device-id"}(Mt||(Mt={}));class Ot extends C{constructor(t,i={}){var s,n,e;super(t,{loggingEnabled:i.loggingEnabled}),this.state={type:"disconnected"},this.stateChanged=new A,this.dimensions=d.create(0,0),this.streamAttributes={},this.frameBgColor=F.create(255,255,255),this.config=K("platprod"),this.options={tokenRefreshOffsetInSeconds:null!==(s=i.tokenRefreshOffsetInSeconds)&&void 0!==s?s:30,offlineThresholdInSeconds:null!==(n=i.offlineThresholdInSeconds)&&void 0!==n?n:30,loadTimeoutInSeconds:null!==(e=i.loadTimeoutInSeconds)&&void 0!==e?e:15}}getState(){return this.state}disconnect(){"disconnected"!==this.state.type&&"connection-failed"!==this.state.type&&(console.debug("Disconnecting websocket"),this.state.connection.dispose(),this.updateState({type:"disconnected"}))}async load(t,i,s,n=K("platprod")){return this.clientId=i,this.deviceId=s,this.config=n,"disconnected"===this.state.type||"connection-failed"===this.state.type?this.loadIfDisconnected(t):this.loadIfConnectingOrConnected(t,this.state)}update(t){this.frameBgColor=t.frameBgColor?t.frameBgColor:this.frameBgColor,null!=t.dimensions&&t.dimensions!==this.dimensions&&(this.dimensions=t.dimensions,this.ifState("connected",(()=>this.updateDimensions({dimensions:this.dimensions})))),null!=t.streamAttributes&&this.streamAttributes!==t.streamAttributes&&(this.streamAttributes=t.streamAttributes,this.ifState("connected",(()=>this.updateStream({streamAttributes:jt(this.streamAttributes)}))))}async loadIfConnectingOrConnected(t,i){const{resource:s,queries:n}=i.resource,e=U(t),h=!B.isEqual(s,e.resource),o=!B.isEqual(n,e.queries),r=null!=e.queries[0],a="connected"===i.type;if(h||("connecting"===i.type||"reconnecting"===i.type)&&o)return this.disconnect(),this.loadIfDisconnected(t);a&&r&&o&&(await this.loadSceneViewState({sceneViewStateId:{hex:e.queries[0].id}}),this.updateState(Object.assign(Object.assign({},i),{resource:e})))}async loadIfDisconnected(t){try{await this.connectWithNewStream(U(t))}catch(t){throw this.updateState(t instanceof G?{type:"connection-failed",message:`Cannot load scene. ${t.message}`,error:t}:t instanceof P?{type:"connection-failed",message:"Cannot load scene. Stream request failed to start stream.",error:t}:{type:"connection-failed",message:"Cannot load scene for unknown reason. See console logs.",error:t}),t}}connectWithNewStream(t){return this.openWebsocketStream(t,"connecting",(()=>this.requestNewStream(t)))}connectToExistingStream(t){return this.openWebsocketStream(t.resource,"reconnecting",(()=>this.requestReconnectStream(t)),{maxRetries:Number.POSITIVE_INFINITY})}async openWebsocketStream(t,i,s,{maxRetries:n=3}={}){const e=(h=function(t,i,s,n){return z.appendPath(null!=s?z.toString(z.parseAndAddParams("/ws",{clientId:s,deviceId:n})):`/stream-keys/${i.id}/session`,z.parse(t.network.renderingHost))}(this.config,t.resource,this.clientId,this.deviceId),{url:z.toString(h),protocols:["ws.vertexvis.com"]});var h;console.debug(`Initiating WS connection [uri=${e.url}]`);const o=new AbortController,r=(a=this.config,{EXPERIMENTAL_frameDelivery:Object.assign(Object.assign({},a.EXPERIMENTAL_frameDelivery),{rateLimitingEnabled:a.flags.throttleFrameDelivery}),EXPERIMENTAL_adaptiveRendering:Object.assign(Object.assign({},a.EXPERIMENTAL_adaptiveRendering),{enabled:a.flags.adaptiveRendering}),EXPERIMENTAL_qualityOfService:Object.assign({},a.EXPERIMENTAL_qualityOfService)});var a;this.updateState({type:i,resource:t,connection:{dispose:()=>{this.dispose(),o.abort()}}});const l=await N.abort(o.signal,N.retry((()=>this.connect(e,r)),{maxRetries:n,delaysInMs:Ot.WS_RECONNECT_DELAYS})).catch((t=>{throw new J("Websocket connection failed.",t instanceof Error?t:void 0)}));if(!l.aborted)return this.requestNewOrExistingStream(t,l.result,s);this.updateState({type:"disconnected"})}async requestNewOrExistingStream(t,i,s){const n=this.requestClock(),e=await s();console.debug(`Stream connected [stream-id=${e.streamId}, scene-view-id=${e.sceneViewId}]`);const h=this.onRequest((t=>{const i=t.request.drawFrame;if(null!=i){const t=T(e.worldOrientation)(i);"connected"===this.state.type&&this.updateState(Object.assign(Object.assign({},this.state),{frame:t}))}})),o=this.reconnectWhenNeeded(),r=this.refreshTokenWhenExpired(e.token),a=this.acknowledgeFrameRequests(),l=null==e.frame?await this.waitForFrame(e.worldOrientation,this.options.loadTimeoutInSeconds):e.frame,c=await n;console.debug(`Synchronized clocks [local-time=${c.knownLocalTime.toISOString()}, remote-time=${c.knownRemoteTime.toISOString()}]`),this.updateState({type:"connected",connection:{dispose:()=>{o.dispose(),h.dispose(),r.dispose(),a.dispose(),i.dispose()}},resource:t,streamId:e.streamId,deviceId:e.deviceId,sceneViewId:e.sceneViewId,worldOrientation:e.worldOrientation,token:e.token,frame:l,clock:c})}async requestNewStream(t){var i;const s=I(await this.startStream({streamKey:{value:t.resource.id},dimensions:this.dimensions,frameBackgroundColor:At(this.frameBgColor),streamAttributes:jt(this.streamAttributes),sceneViewStateId:"scene-view-state"===(null===(i=t.queries[0])||void 0===i?void 0:i.type)?{hex:t.queries[0].id}:void 0}));return{resource:t,streamId:s.streamId,sceneViewId:s.sceneViewId,deviceId:s.sessionId,token:s.token,worldOrientation:s.worldOrientation,frame:void 0}}async requestReconnectStream(t){const i=x(await this.reconnect({streamId:{hex:t.streamId},dimensions:this.dimensions,frameBackgroundColor:At(this.frameBgColor),streamAttributes:jt(this.streamAttributes)}));return Object.assign(Object.assign({},t),{token:i.token})}async requestClock(){const t=D(await this.syncTime({requestTime:S()}));return new _(t)}reconnectWhenNeeded(){const t=this.onClose((()=>{"connected"===this.state.type&&this.closeAndReconnect(this.state)})),i=this.onRequest((t=>{null!=t.request.gracefulReconnection&&"connected"===this.state.type&&(console.debug("Received request for graceful reconnect. Closing connection and attempting reconnect."),this.closeAndReconnect(this.state))})),s=this.reconnectWhenOffline();return{dispose:()=>{t.dispose(),i.dispose(),s.dispose()}}}refreshTokenWhenExpired(t){let i;const s=t=>{const{tokenRefreshOffsetInSeconds:n}=this.options,e=t.remainingTimeInMs(n);i=window.setTimeout((async()=>{const t=await this.refreshToken(),i=k(t);s(i),"connected"===this.state.type&&this.updateState(Object.assign(Object.assign({},this.state),{token:i}))}),e)};return s(t),{dispose:()=>clearTimeout(i)}}reconnectWhenOffline(){let t;const i=()=>window.clearTimeout(t),s=()=>{i();const s=this.options.offlineThresholdInSeconds;console.debug(`Detected that host is offline. Will attempt reconnect in ${s}s.`),t=window.setTimeout((()=>{"connected"===this.state.type&&this.closeAndReconnect(this.state)}),1e3*s)};return window.addEventListener("offline",(()=>s())),window.addEventListener("online",(()=>{console.debug("Detected that host is online."),i()})),{dispose:()=>{i(),window.removeEventListener("offline",s),window.removeEventListener("online",i)}}}closeAndReconnect(t){return t.connection.dispose(),this.connectToExistingStream(t)}async waitForFrame(t,i){let s;try{return await N.timeout(1e3*i,new Promise((i=>{s=this.onRequest((n=>{try{const e=n.request.drawFrame;if(null!=e){const s=T(t)(e);i(s)}}finally{null==s||s.dispose()}}))})))}catch(t){throw new X(`Frame timed out after ${i/1e3}s`,t instanceof Error?t:void 0)}finally{null==s||s.dispose()}}acknowledgeFrameRequests(){return this.onRequest(function(t,i){const s=function(t){let i=!1;return s=>{const n=t();if(null!=n){const t=n.remoteTime(new Date(Date.now())),e=p(s,t);return g(e).getTime()>=0?e:void(i||(console.warn(`Possible erroneous send to receive timing. Muting for 60s. [sent-at=${s.toISOString()}, received-at=${t.toISOString()}, remote-time=${n.knownRemoteTime.toISOString()}]`),i=!0,setTimeout((()=>i=!1),6e4)))}}}(i);return n=i=>{return n=()=>n=>{const e=g(n.sentAtTime);null!=e&&t.replyResult(i,{drawFrame:{sendToReceiveDuration:s(e)}})},t=>{const{drawFrame:i}=t.request;null!=i&&n()(t)};var n},t=>{var i;const s=null===(i=t.request.requestId)||void 0===i?void 0:i.value;null!=s&&n(s)(t)};var n}(this,(()=>"connected"===this.state.type?this.state.clock:void 0)))}updateState(t){this.state!==t&&(this.state=t,this.stateChanged.emit(this.state))}ifState(t,i){if(this.state.type===t)return i()}onStateChanged(t){return this.stateChanged.on(t)}}Ot.WS_RECONNECT_DELAYS=[0,1e3,1e3,5e3];const jt=R.ifInvalidThrow(y),At=R.ifInvalidThrow(b);let Rt=class{constructor(s){t(this,s),this.tap=i(this,"tap",7),this.doubletap=i(this,"doubletap",7),this.longpress=i(this,"longpress",7),this.frameReceived=i(this,"frameReceived",7),this.frameDrawn=i(this,"frameDrawn",7),this.tokenExpired=i(this,"tokenExpired",7),this.connectionChange=i(this,"connectionChange",7),this.sceneReady=i(this,"sceneReady",7),this.sceneChanged=i(this,"sceneChanged",7),this.interactionStarted=i(this,"interactionStarted",7),this.interactionFinished=i(this,"interactionFinished",7),this.deviceIdChange=i(this,"deviceIdChange",7),this.dimensionschange=i(this,"dimensionschange",7),this.configEnv="platprod",this.cameraControls=!0,this.cameraType="perspective",this.keyboardControls=!0,this.rotateAroundTapPoint=!0,this.experimentalGhostingOpacity=0,this.selectionMaterial=Y,this.resizeDebounce=100,this.stencilBuffer=new ht(this.hostElement),this.viewport=et.fromDimensions(d.create(0,0)),this.stateMap={cursorManager:new W,streamState:{type:"disconnected"}},this.interactionHandlers=[],this.tapKeyInteractions=[],this.internalFrameDrawnDispatcher=new A,this.handleElementResize=this.handleElementResize.bind(this)}componentWillLoad(){var t;this.updateResolvedConfig(),this.calculateComponentDimensions(),this.resizeObserver=new ResizeObserver(this.handleElementResize),this.registerSlotChangeListeners(),this.stream=null!==(t=this.stream)&&void 0!==t?t:new Ot(new E,{loggingEnabled:this.getResolvedConfig().flags.logWsMessages}),this.addStreamListeners(),this.updateStreamAttributes(),this.stateMap.cursorManager.onChanged.on((()=>this.handleCursorChanged()))}componentDidLoad(){var t,i,s;if(this.interactionApi=this.createInteractionApi(),null!=this.containerElement&&(null===(t=this.resizeObserver)||void 0===t||t.observe(this.containerElement)),null!=this.src)try{this.load(this.src)}catch(t){console.error("Error loading scene",t)}if(this.cameraControls)if(null!=window.PointerEvent){const t=new It("pointerdown","pointerup","pointermove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new Tt((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new Pt),this.registerInteractionHandler(t)}else{const t=new It("mousedown","mouseup","mousemove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new bt((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new xt),this.registerInteractionHandler(t)}this.keyboardControls&&null!=this.stream&&(null===(i=this.baseInteractionHandler)||void 0===i||i.setDefaultKeyboardControls(this.keyboardControls),this.registerTapKeyInteraction(new rt(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale()))),this.registerTapKeyInteraction(new ut(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale()),(()=>this.createScene())))),this.rotateAroundTapPoint&&(null===(s=this.baseInteractionHandler)||void 0===s||s.setPrimaryInteractionType("rotate-point")),this.injectViewerApi()}render(){var t;return s(n,null,s("div",{class:"viewer-container",style:{cursor:q(null!==(t=this.cursor)&&void 0!==t?t:"")},onContextMenu:t=>t.preventDefault()},s("div",{ref:t=>this.containerElement=t,class:L("canvas-container",{"enable-pointer-events ":null!=window.PointerEvent})},s("canvas",{ref:t=>{this.canvasElement=t,this.stateMap.interactionTarget=t},class:"canvas"}),null!=this.errorMessage?s("div",{class:"error-message"},this.errorMessage):null),s("slot",null)))}async dispatchFrameDrawn(t){this.frame=t,this.internalFrameDrawnDispatcher.emit(t),this.frameDrawn.emit(t)}async registerInteractionHandler(t){return this.interactionHandlers.push(t),this.initializeInteractionHandler(t),{dispose:()=>{const i=this.interactionHandlers.indexOf(t);-1!==i&&(this.interactionHandlers[i].dispose(),this.interactionHandlers.splice(i,1))}}}async registerTapKeyInteraction(t){this.tapKeyInteractions=[...this.tapKeyInteractions,t]}async getInteractionTarget(){if(null!=this.stateMap.interactionTarget)return this.stateMap.interactionTarget;throw new Error("Interaction target is undefined.")}async addCursor(t,i){return this.stateMap.cursorManager.add(t,i)}async getInteractionHandlers(){return this.interactionHandlers}async getBaseInteractionHandler(){return this.baseInteractionHandler}async getJwt(){return this.token}handleSrcChanged(t){null!=t?this.load(t):this.unload()}handleRotateAboutTapPointChanged(){var t,i;this.updateStreamAttributes(),this.rotateAroundTapPoint?null===(t=this.baseInteractionHandler)||void 0===t||t.setPrimaryInteractionType("rotate-point"):null===(i=this.baseInteractionHandler)||void 0===i||i.setPrimaryInteractionType("rotate")}handleCameraTypeChanged(t,i){t!==i&&this.updateCameraType()}handleDepthBuffersChanged(){this.updateStreamAttributes()}handleExperimentalGhostingOpacityChanged(){this.updateStreamAttributes()}handleFeatureLinesChanged(){this.updateStreamAttributes()}handleFeatureHighlightingChanged(){this.updateStreamAttributes()}handleFeatureMapsChanged(){this.updateStreamAttributes()}handleConfigChanged(){this.updateResolvedConfig()}handleConfigEnvChanged(){this.updateResolvedConfig()}async load(t){var i;if(null==this.stream||null==this.dimensions)throw new Q("Cannot load scene. Viewer has not been initialized.");this.calculateComponentDimensions(),this.stream.update({streamAttributes:this.getStreamAttributes(),config:K(this.configEnv,this.config),dimensions:this.dimensions,frameBgColor:this.getBackgroundColor()}),await(null===(i=this.stream)||void 0===i?void 0:i.load(t,this.clientId,this.getDeviceId(),this.getResolvedConfig())),this.sceneReady.emit()}async unload(){if(null!=this.stream&&(this.stream.disconnect(),this.frame=void 0,this.errorMessage=void 0),null!=this.canvasElement){const t=this.canvasElement.getContext("2d");null!=t&&t.clearRect(0,0,this.canvasElement.width,this.canvasElement.height)}}async scene(){return this.createScene()}async isSceneReady(){return"connected"===this.stateMap.streamState.type}async handleTapEvent(t){this.tapKeyInteractions.filter((i=>i.predicate(t.detail))).forEach((i=>i.fn(t.detail)))}emitConnectionChange(t){this.connectionChange.emit(t)}handleElementResize(t){t.length>=0&&null!=this.dimensions&&!d.isEqual(t[0].contentRect,this.viewport)&&(null!=this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=void 0),this.isResizing||(this.resizeTimer=setTimeout((()=>{this.isResizing=!0,this.isResizeUpdate=!0,this.recalculateComponentDimensions()}),this.resizeDebounce)))}registerSlotChangeListeners(){this.mutationObserver=new MutationObserver((()=>this.injectViewerApi())),this.mutationObserver.observe(this.hostElement,{childList:!0,subtree:!0})}injectViewerApi(){function t(t){return Array.from(t.querySelectorAll("*"))}t(this.hostElement).filter((t=>t.nodeName.startsWith("VERTEX-"))).reduce(((i,s)=>[...i,s,...t(s)]),[]).forEach((t=>{t.viewer=this.hostElement}))}calculateComponentDimensions(){var t;const i=this.getBounds();if(null!=(null==i?void 0:i.width)&&null!=(null==i?void 0:i.height)){const s=d.create(i.width,i.height),n=d.scaleFit(2073600,s);this.hostDimensions=s,this.dimensions=null!=n?d.create(n.width,n.height):void 0,this.viewport=et.fromDimensions(null!==(t=this.getCanvasDimensions())&&void 0!==t?t:d.create(0,0))}}recalculateComponentDimensions(){var t;this.isResizing&&(this.calculateComponentDimensions(),this.isResizing=!1,null===(t=this.stream)||void 0===t||t.update({dimensions:this.dimensions}),this.dimensionschange.emit(this.dimensions))}reportPerformance(t){if("connected"===this.stateMap.streamState.type){const i={timings:t.map((t=>({receiveToPaintDuration:p(t.duration)})))};this.getStream().recordPerformance(i,!1)}}addStreamListeners(){this.stateMap.streamListeners=this.getStream().stateChanged.on((t=>{this.handleStreamStateChanged(this.stateMap.streamState,t)}))}handleStreamStateChanged(t,i){this.stateMap.streamState=i,"connecting"===i.type?this.handleConnecting(t,i):"connected"===i.type?this.handleConnected(t,i):"connection-failed"===i.type?this.handleConnectionFailed(t,i):"disconnected"===i.type&&this.handleDisconnected(t,i)}handleConnecting(t,i){"connecting"!==t.type&&(this.token=void 0,this.errorMessage=void 0,this.emitConnectionChange({status:"connecting"}))}handleConnected(t,i){this.token=i.token.token,"connected"!==t.type&&(this.errorMessage=void 0,this.canvasRenderer=Et(Dt,function(){let t;return async i=>{var s;const n=i.frame.sequenceNumber,e=await St(i.frame.image.imageBytes);return(null==t||n>t)&&(t=n,null===(s=i.beforeDraw)||void 0===s||s.call(i),kt(e,i)),e.dispose(),i.frame}}(),this.getResolvedConfig().flags.logFrameRate,(t=>this.reportPerformance(t))),this.resizeRenderer=Et(Dt,function(){const t=document.createElement("canvas");let i;return async s=>{var n;const e=s.frame.sequenceNumber,h=null==i||e>i,o=null==s.dimensions||d.isEqual(s.dimensions,s.frame.image.imageAttr.frameDimensions),r=await St(s.frame.image.imageBytes);t.width=s.canvasDimensions.width,t.height=s.canvasDimensions.height;const a=t.getContext("2d");return null!=a&&h&&o&&(i=e,kt(r,Object.assign(Object.assign({},s),{canvas:a})),null===(n=s.beforeDraw)||void 0===n||n.call(s),s.canvas.drawImage(t,0,0)),r.dispose(),s.frame}}(),this.getResolvedConfig().flags.logFrameRate,(t=>this.reportPerformance(t))),this.emitConnectionChange({status:"connected",jwt:i.token.token}),this.deviceIdChange.emit(i.deviceId)),this.frame!==i.frame&&this.updateFrame(i.frame)}handleConnectionFailed(t,i){"connection-failed"!==t.type&&(this.token=void 0,this.errorMessage=i.message)}handleDisconnected(t,i){"disconnected"!==t.type&&(this.token=void 0,this.errorMessage=void 0,this.emitConnectionChange({status:"disconnected"}))}async updateFrame(t){const i=this.getCanvasDimensions();if(null!=this.canvasElement&&null!=i&&this.frame!==t){const s=this.canvasElement.getContext("2d");if(null!=s){const n=this.frame;this.frame=t,this.updateInteractionApi(n);const e={canvas:s,canvasDimensions:i,dimensions:this.dimensions,frame:this.frame,viewport:this.viewport,beforeDraw:()=>{this.updateCanvasDimensions(i),this.isResizeUpdate=!1}};this.frameReceived.emit(this.frame),this.frame.scene.hasChanged&&this.sceneChanged.emit();const h=this.isResizeUpdate?await this.resizeRenderer(e):await this.canvasRenderer(e);this.dispatchFrameDrawn(h)}}}initializeInteractionHandler(t){if(null==this.stateMap.interactionTarget)throw new Z("Cannot initialize interaction handler. Interaction target is undefined.");if(null==this.interactionApi)throw new Z("Cannot initialize interaction handler. Interaction APi is undefined.");t.initialize(this.stateMap.interactionTarget,this.interactionApi)}createInteractionApi(){if(null==this.stream)throw new tt("Cannot create interaction API. Component has not been initialized.");return null==this.frame||this.frame.scene.camera.isPerspective()?new ct(this.stream,this.stateMap.cursorManager,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>this.viewport),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished):new lt(this.stream,this.stateMap.cursorManager,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>this.viewport),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished)}handleCursorChanged(){window.requestAnimationFrame((()=>{this.cursor=this.stateMap.cursorManager.getActiveCursor()}))}createScene(){if("connected"!==this.stateMap.streamState.type)throw new it("Cannot create scene. Viewer stream is not connected.");const{frame:t,sceneViewId:i,worldOrientation:s}=this.stateMap.streamState,n="string"==typeof this.selectionMaterial?st(this.selectionMaterial):this.selectionMaterial;return new nt(this.getStream(),t,T(s),(()=>this.getImageScale()),this.viewport,i,n)}getBackgroundColor(){if(null!=this.containerElement)return function(t){const i=window.getComputedStyle(t);return F.fromCss(i.backgroundColor)}(this.containerElement)}getBounds(){return this.hostElement.getBoundingClientRect()}getCanvasDimensions(){return this.getResolvedConfig().flags.letterboxFrames?this.dimensions:this.hostDimensions}getImageScale(){const t=this.getCanvasDimensions();if(null!=this.dimensions&&null!=t)return h.create(this.dimensions.width/t.width,this.dimensions.height/t.height)}getStreamAttributes(){return{depthBuffers:this.getDepthBufferStreamAttributesValue(),experimentalGhosting:this.experimentalGhostingOpacity,featureLines:this.featureLines,featureHighlighting:this.featureHighlighting,featureMaps:this.featureMaps}}updateCanvasDimensions(t){null!=this.canvasElement&&(this.canvasElement.width=t.width,this.canvasElement.height=t.height)}updateStreamAttributes(){var t;null===(t=this.stream)||void 0===t||t.update({streamAttributes:this.getStreamAttributes()})}updateInteractionApi(t){if(null!=t&&null!=this.frame){const i=t.scene.camera.isPerspective()&&this.frame.scene.camera.isOrthographic(),s=t.scene.camera.isOrthographic()&&this.frame.scene.camera.isPerspective();(i||s)&&(this.interactionApi=this.createInteractionApi(),this.interactionHandlers.forEach((t=>this.initializeInteractionHandler(t))))}}updateCameraType(){var t,i;null!=this.frame&&("orthographic"===this.cameraType&&this.frame.scene.camera.isPerspective()?null===(t=this.stream)||void 0===t||t.replaceCamera({camera:M(O(this.frame.scene.camera,this.frame.scene.boundingBox))}):"perspective"===this.cameraType&&this.frame.scene.camera.isOrthographic()&&(null===(i=this.stream)||void 0===i||i.replaceCamera({camera:M(j(this.frame.scene.camera))})))}getDepthBufferStreamAttributesValue(){var t;return null!==(t=this.depthBuffers)&&void 0!==t?t:this.rotateAroundTapPoint?"final":void 0}updateResolvedConfig(){this.resolvedConfig=K(this.configEnv,this.config)}getResolvedConfig(){return Ft("Resolved config is undefined",(()=>this.resolvedConfig))}getStream(){return Ft("Stream is undefined",(()=>this.stream))}getDeviceId(){if(null==this.deviceId){try{this.deviceId=function(t,i,s=window.localStorage){const n=s.getItem(Mt.DEVICE_ID);if(null!=n)return i(JSON.parse(n))}(0,(t=>t["device-id"]))}catch(t){console.warn("Cannot read device ID. Local storage is not supported.")}if(null==this.deviceId){this.deviceId=$.create();try{!function(t,i,s=window.localStorage){const n=s.getItem(t);if(null!=n){const e=Object.assign(Object.assign({},JSON.parse(n)),i);s.setItem(t,JSON.stringify(e))}else s.setItem(t,JSON.stringify(i))}(Mt.DEVICE_ID,{"device-id":this.deviceId})}catch(t){console.warn("Cannot write device ID. Local storage is not supported.")}}}return this.deviceId}get hostElement(){return e(this)}static get watchers(){return{src:["handleSrcChanged"],rotateAroundTapPoint:["handleRotateAboutTapPointChanged"],cameraType:["handleCameraTypeChanged"],depthBuffers:["handleDepthBuffersChanged"],experimentalGhostingOpacity:["handleExperimentalGhostingOpacityChanged"],featureLines:["handleFeatureLinesChanged"],featureHighlighting:["handleFeatureHighlightingChanged"],featureMaps:["handleFeatureMapsChanged"],config:["handleConfigChanged"],configEnv:["handleConfigEnvChanged"]}}};function Ft(t,i){const s=i();if(null!=s)return s;throw new Error(t)}Rt.style=":host{--image-background:var(--image-background);--viewer-background:var(--viewer-background);display:block;position:relative;width:300px;height:300px;min-width:1px;min-height:1px}.canvas-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:relative;background:var(--image-background, var(--viewer-background, #ffffff))}.enable-pointer-events{touch-action:none}.viewer-container{width:100%;height:100%;overflow:hidden;background:var(--viewer-background, #ffffff)}.error-message{position:absolute;top:50%;width:100%;transform:translateY(-50%);text-align:center}";export{Rt as vertex_viewer}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import{r as i,c as t,h as s,H as e,g as l}from"./p-cafa57a6.js";import{c as n}from"./p-f482325b.js";import"./p-112455b1.js";let o=class{constructor(s){i(this,s),this.hovered=t(this,"hovered",7),this.expandToggled=t(this,"expandToggled",7),this.visibilityToggled=t(this,"visibilityToggled",7),this.selectionToggled=t(this,"selectionToggled",7),this.placeholder="--",this.interactionsDisabled=!1,this.recurseParentSelectionDisabled=!1,this.displayValue=()=>null==this.value||""===this.value.trim()?this.placeholder:this.value,this.handleCellPointerDown=i=>{var t,s,e,l,n,o;i.defaultPrevented||0!==i.button||this.interactionsDisabled||((i.ctrlKey||i.metaKey)&&(null===(t=this.node)||void 0===t?void 0:t.selected)?null===(s=this.tree)||void 0===s||s.deselectItem(this.node):(null===(e=this.node)||void 0===e?void 0:e.selected)&&!this.recurseParentSelectionDisabled?null===(l=this.tree)||void 0===l||l.selectItem(this.node,{recurseParent:!0}):(null===(n=this.node)||void 0===n?void 0:n.selected)||null===(o=this.tree)||void 0===o||o.selectItem(this.node,{append:i.ctrlKey||i.metaKey,range:i.shiftKey}),this.selectionToggled.emit({node:this.node,originalEvent:i}))},this.toggleExpansion=i=>{null==this.tree||null==this.node||this.interactionsDisabled||this.tree.toggleExpandItem(this.node),this.expandToggled.emit({node:this.node,originalEvent:i})},this.toggleVisibility=i=>{null==this.tree||null==this.node||this.interactionsDisabled||this.tree.toggleItemVisibility(this.node),this.visibilityToggled.emit({node:this.node,originalEvent:i})}}componentWillRender(){var i,t,s,e,l,n,o;this.toggleAttribute("is-hovered",this.hoveredNodeId===(null===(t=null===(i=this.node)||void 0===i?void 0:i.id)||void 0===t?void 0:t.hex)),this.toggleAttribute("is-hidden",!(null===(s=this.node)||void 0===s?void 0:s.visible)),this.toggleAttribute("is-selected",!!(null===(e=this.node)||void 0===e?void 0:e.selected)),this.toggleAttribute("is-partial",!!(null===(l=this.node)||void 0===l?void 0:l.partiallyVisible)),this.toggleAttribute("is-leaf",!!(null===(n=this.node)||void 0===n?void 0:n.isLeaf)),this.toggleAttribute("is-filter-hit",!!(null===(o=this.node)||void 0===o?void 0:o.filterHit))}render(){var i,t,l,o,a,h,d,r,v,c,g,u;return s(e,{onPointerEnter:i=>{this.hovered.emit({node:this.node,originalEvent:i})},onPointerLeave:()=>{this.hovered.emit(void 0)},onPointerDown:this.handleCellPointerDown},s("div",{class:"wrapper"},s("div",{class:"no-shrink"},s("slot",{name:"left-gutter"})),this.expandToggle&&s("button",{class:"expand-btn no-shrink","data-test-id":"expand-"+(null===(i=this.node)||void 0===i?void 0:i.name),onPointerDown:i=>{i.preventDefault(),this.toggleExpansion(i)}},!(null===(t=this.node)||void 0===t?void 0:t.isLeaf)&&s("div",{class:n("icon",{"icon-expanded":!(null===(l=this.node)||void 0===l?void 0:l.isLeaf)&&(null===(o=this.node)||void 0===o?void 0:o.expanded),"icon-collapsed":!(null===(a=this.node)||void 0===a?void 0:a.isLeaf)&&!(null===(h=this.node)||void 0===h?void 0:h.expanded)})})),s("div",{class:"content"},null!=this.value&&""!==this.value.trim()?s("slot",null,this.displayValue()):s("slot",{name:"placeholder"},this.placeholder)),s("button",{class:"visibility-btn no-shrink","data-test-id":"visibility-btn-"+(null===(d=this.node)||void 0===d?void 0:d.name),onPointerDown:i=>{console.log("touching the visibility toggle"),null==i||i.preventDefault(),this.toggleVisibility(i)}},s("div",{class:n("icon",{"icon-visible":!(null===(r=this.node)||void 0===r?void 0:r.partiallyVisible)&&(null===(v=this.node)||void 0===v?void 0:v.visible),"icon-hidden":!(null===(c=this.node)||void 0===c?void 0:c.partiallyVisible)&&!(null===(g=this.node)||void 0===g?void 0:g.visible),"icon-partial":null===(u=this.node)||void 0===u?void 0:u.partiallyVisible})})),s("div",{class:"no-shrink"},s("slot",{name:"right-gutter"})),!this.visibilityToggle&&s("div",{class:"column-spacer"})))}toggleAttribute(i,t){t?this.hostEl.setAttribute(i,""):this.hostEl.removeAttribute(i)}get hostEl(){return l(this)}};o.style="button{border:none;background:transparent;cursor:pointer;margin:0;padding:0}:host{display:flex;align-items:center;box-sizing:border-box;--scene-tree-cell-background-hover:var(--blue-200);--scene-tree-cell-background-selected:var(--blue-300);--scene-tree-cell-text-positioning:left;--scene-tree-cell-padding:0.25rem 0}:host([is-hovered]){background:var(--scene-tree-cell-background-hover)}:host([is-selected]){background:var(--scene-tree-cell-background-selected)}.wrapper{display:flex;align-items:center;box-sizing:border-box;width:100%;height:100%;padding:var(--scene-tree-cell-padding)}.content{width:100%;text-align:var(--scene-tree-cell-text-positioning);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.column-spacer{width:var(--scene-tree-table-column-gap)}.expand-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px}.no-shrink{flex-shrink:0}:host([is-leaf]) .expand-btn{visibility:hidden;cursor:default}.visibility-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;visibility:hidden;width:24px;height:24px}:host([is-hidden]) .visibility-btn,:host([is-partial]) .visibility-btn,:host([is-hovered]) .visibility-btn{visibility:inherit}.icon{width:14px;height:14px}.icon-expanded{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' class='icon' %3E%3Cpath fill='%23444444' d='M11.88,9.17l-3.5-4a.51.51,0,0,0-.76,0l-3.5,4A.5.5,0,0,0,4.5,10h7a.5.5,0,0,0,.38-.83Z' transform='rotate(180 8 8)' /%3E%3C/svg%3E\")}.icon-collapsed{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' class='icon' %3E%3Cpath fill='%23444444' d='M10.83,7.62l-4-3.5A.5.5,0,0,0,6,4.5v7a.5.5,0,0,0,.83.38l4-3.5a.51.51,0,0,0,0-.76Z' /%3E%3C/svg%3E\")}.icon-visible{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' class='icon' %3E%3Cpath fill='%23444444' d='M8 5a3 3 0 103 3 3 3 0 00-3-3zm4.65-1.17A8.53 8.53 0 008 2.5a8.53 8.53 0 00-4.65 1.33A6.57 6.57 0 00.51 7.89v.22a6.57 6.57 0 002.84 4.06A8.53 8.53 0 008 13.5a8.53 8.53 0 004.65-1.33 6.57 6.57 0 002.84-4.06v-.22a6.57 6.57 0 00-2.84-4.06zm-.55 7.5A7.52 7.52 0 018 12.5a7.52 7.52 0 01-4.1-1.17A5.49 5.49 0 011.53 8 5.49 5.49 0 013.9 4.67 7.52 7.52 0 018 3.5a7.52 7.52 0 014.1 1.17A5.49 5.49 0 0114.47 8a5.49 5.49 0 01-2.37 3.33z' /%3E%3C/svg%3E\")}.icon-hidden{background-image:url(\"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' class='icon' %3E%3Cpath fill='%23444444' d='M13.35 2.65a.48.48 0 00-.7 0l-.78.77a8.71 8.71 0 00-8.52.41A6.57 6.57 0 00.51 7.89v.22a6.58 6.58 0 002.71 4l-.57.58a.49.49 0 00.7.7l10-10a.48.48 0 000-.74zM9.73 5.56a3 3 0 00-4.17 4.17l-1.62 1.62A5.49 5.49 0 011.53 8 5.49 5.49 0 013.9 4.67 7.52 7.52 0 018 3.5a7.67 7.67 0 013.12.67zm3.61-1.2l-.72.72A5.45 5.45 0 0114.47 8a5.49 5.49 0 01-2.37 3.33A7.52 7.52 0 018 12.5a8.15 8.15 0 01-2.41-.38l-.78.78a8.9 8.9 0 003.19.6 8.53 8.53 0 004.65-1.33 6.57 6.57 0 002.84-4.06v-.22a6.56 6.56 0 00-2.15-3.53z' /%3E%3C/svg%3E%0A\")}.icon-partial{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M4.12 11.46A5.62 5.62 0 011.52 8 5.57 5.57 0 013.9 4.67 7.52 7.52 0 018 3.5a7.7 7.7 0 013.33.75l.74-.74A8.67 8.67 0 008 2.5a8.53 8.53 0 00-4.65 1.33A6.57 6.57 0 00.51 7.89v.22a6.54 6.54 0 002.88 4.08z' fill='%23444'/%3E%3Cpath d='M8 5a3 3 0 00-3 3 3 3 0 00.69 1.89l4.2-4.2A3 3 0 008 5zM5.88 5.88zM9.2 12.41a.51.51 0 00-.42.57.5.5 0 00.56.42.5.5 0 00.43-.57.51.51 0 00-.57-.42zM6.77 12.41a.5.5 0 00-.57.42.49.49 0 00.41.57.5.5 0 10.15-1zM14.48 5.61a.5.5 0 00-.7-.12.49.49 0 00-.12.69.5.5 0 00.82-.57zM11.5 11.68a.5.5 0 00-.22.67.51.51 0 00.68.22.5.5 0 00-.46-.89zM15.07 7.77a.52.52 0 00-.62.35.51.51 0 00.35.62.5.5 0 00.61-.35.52.52 0 00-.34-.62zM13.36 10.21a.5.5 0 10.76.64.49.49 0 00-.06-.7.51.51 0 00-.7.06z' fill='%23444'/%3E%3C/svg%3E\")}";export{o as vertex_scene_tree_table_cell}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import{d as e,N as t,w as a,p as r,b as i}from"./p-cafa57a6.js";import{g as n}from"./p-7e0328aa.js";import"./p-112455b1.js";(()=>{const i=Array.from(e.querySelectorAll("script")).find((e=>new RegExp(`/${t}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===t)),n={};return n.resourcesUrl=new URL(".",new URL(i.getAttribute("data-resources-url")||i.src,a.location.href)).href,((r,i)=>{const n=`__sc_import_${t.replace(/\s|-/g,"_")}`;try{a[n]=new Function("w",`return import(w);//${Math.random()}`)}catch(t){const o=new Map;a[n]=t=>{const s=new URL(t,r).href;let l=o.get(s);if(!l){const t=e.createElement("script");t.type="module",t.crossOrigin=i.crossOrigin,t.src=URL.createObjectURL(new Blob([`import * as m from '${s}'; window.${n}.m = m;`],{type:"application/javascript"})),l=new Promise((e=>{t.onload=()=>{e(a[n].m),t.remove()}})),o.set(s,l),e.head.appendChild(t)}return l}}})(n.resourcesUrl,i),a.customElements?r(n):__sc_import_viewer("./p-ac0761c3.js").then((()=>n))})().then((e=>(n(),i([["p-a455ae02",[[1,"vertex-viewer-default-toolbar",{viewer:[16],placement:[1],direction:[1],animationsDisabled:[4,"animations-disabled"],animationMs:[2,"animation-ms"]}]]],["p-73a5eacc",[[1,"vertex-scene-tree",{overScanCount:[2,"over-scan-count"],viewerSelector:[1,"viewer-selector"],viewer:[1040],rowData:[16],config:[16],configEnv:[1,"config-env"],controller:[1040],filterOnMetadata:[1028,"filter-on-metadata"],metadataKeys:[16],rows:[32],totalRows:[32],stateMap:[32],connectionErrorDetails:[32],attemptingRetry:[32],invalidateRows:[64],scrollToIndex:[64],scrollToItem:[64],expandAll:[64],collapseAll:[64],expandItem:[64],collapseItem:[64],toggleExpandItem:[64],toggleItemVisibility:[64],hideItem:[64],showItem:[64],selectItem:[64],deselectItem:[64],getRowAtIndex:[64],getRowForEvent:[64],getRowAtClientY:[64],filterItems:[64],fetchMetadataKeys:[64]},[[0,"search","handleSearch"]]]]],["p-0a189e62",[[1,"vertex-viewer-measurement-tool",{distanceTemplateId:[1,"distance-template-id"],tool:[1],units:[1],fractionalDigits:[2,"fractional-digits"],disabled:[4],viewer:[16],isMeasuring:[1540,"is-measuring"],snapDistance:[2,"snap-distance"],stateMap:[32]}]]],["p-1ca95f9a",[[1,"vertex-viewer-markup",{arrowTemplateId:[1,"arrow-template-id"],circleTemplateId:[1,"circle-template-id"],freeformTemplateId:[1,"freeform-template-id"],tool:[1],disabled:[4],viewer:[16],selectedMarkupId:[1025,"selected-markup-id"],selectNew:[4,"select-new"],toSelectMarkupId:[32],pointerDownPosition:[32],addMarkup:[64],removeMarkup:[64],getMarkupElements:[64],getMarkupElement:[64]},[[0,"markupEnd","handleMarkupEnd"],[1,"pointerdown","handleMarkupPointerDown"]]]]],["p-41028d3b",[[1,"vertex-viewer-markup-tool",{arrowTemplateId:[1,"arrow-template-id"],circleTemplateId:[1,"circle-template-id"],freeformTemplateId:[1,"freeform-template-id"],tool:[1],disabled:[4],viewer:[16],stateMap:[32],reset:[64]}]]],["p-f0411993",[[1,"vertex-viewer-measurements",{distanceTemplateId:[1,"distance-template-id"],tool:[1],units:[1],fractionalDigits:[2,"fractional-digits"],disabled:[4],viewer:[16],selectedMeasurementId:[1025,"selected-measurement-id"],snapDistance:[2,"snap-distance"],showAxisReferenceLines:[4,"show-axis-reference-lines"],measurementModel:[16],addMeasurement:[64],removeMeasurement:[64],getMeasurementElement:[64],getMeasurementElements:[64]},[[0,"measureEnd","handleMeasureEnd"],[1,"pointerdown","handleMeasurementPointerDown"]]]]],["p-858bd2c7",[[1,"vertex-viewer-view-cube",{xPositiveLabel:[1,"x-positive-label"],xNegativeLabel:[1,"x-negative-label"],yPositiveLabel:[1,"y-positive-label"],yNegativeLabel:[1,"y-negative-label"],zPositiveLabel:[1,"z-positive-label"],zNegativeLabel:[1,"z-negative-label"],standardViewsOff:[4,"standard-views-off"],animationDuration:[2,"animation-duration"],triadOff:[4,"triad-off"],worldOrientation:[1040],camera:[1040],viewer:[16],boxLength:[32],triadPosition:[32]}]]],["p-ebd55df7",[[1,"vertex-viewer-measurement-precise",{measurementModel:[16],measurementOverlays:[16],measurementController:[1040],measurableEntityTypes:[16],viewer:[16],configEnv:[1,"config-env"],config:[16],overlays:[32]}]]],["p-
|
|
4
|
+
import{d as e,N as t,w as a,p as r,b as i}from"./p-cafa57a6.js";import{g as n}from"./p-7e0328aa.js";import"./p-112455b1.js";(()=>{const i=Array.from(e.querySelectorAll("script")).find((e=>new RegExp(`/${t}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===t)),n={};return n.resourcesUrl=new URL(".",new URL(i.getAttribute("data-resources-url")||i.src,a.location.href)).href,((r,i)=>{const n=`__sc_import_${t.replace(/\s|-/g,"_")}`;try{a[n]=new Function("w",`return import(w);//${Math.random()}`)}catch(t){const o=new Map;a[n]=t=>{const s=new URL(t,r).href;let l=o.get(s);if(!l){const t=e.createElement("script");t.type="module",t.crossOrigin=i.crossOrigin,t.src=URL.createObjectURL(new Blob([`import * as m from '${s}'; window.${n}.m = m;`],{type:"application/javascript"})),l=new Promise((e=>{t.onload=()=>{e(a[n].m),t.remove()}})),o.set(s,l),e.head.appendChild(t)}return l}}})(n.resourcesUrl,i),a.customElements?r(n):__sc_import_viewer("./p-ac0761c3.js").then((()=>n))})().then((e=>(n(),i([["p-a455ae02",[[1,"vertex-viewer-default-toolbar",{viewer:[16],placement:[1],direction:[1],animationsDisabled:[4,"animations-disabled"],animationMs:[2,"animation-ms"]}]]],["p-73a5eacc",[[1,"vertex-scene-tree",{overScanCount:[2,"over-scan-count"],viewerSelector:[1,"viewer-selector"],viewer:[1040],rowData:[16],config:[16],configEnv:[1,"config-env"],controller:[1040],filterOnMetadata:[1028,"filter-on-metadata"],metadataKeys:[16],rows:[32],totalRows:[32],stateMap:[32],connectionErrorDetails:[32],attemptingRetry:[32],invalidateRows:[64],scrollToIndex:[64],scrollToItem:[64],expandAll:[64],collapseAll:[64],expandItem:[64],collapseItem:[64],toggleExpandItem:[64],toggleItemVisibility:[64],hideItem:[64],showItem:[64],selectItem:[64],deselectItem:[64],getRowAtIndex:[64],getRowForEvent:[64],getRowAtClientY:[64],filterItems:[64],fetchMetadataKeys:[64]},[[0,"search","handleSearch"]]]]],["p-0a189e62",[[1,"vertex-viewer-measurement-tool",{distanceTemplateId:[1,"distance-template-id"],tool:[1],units:[1],fractionalDigits:[2,"fractional-digits"],disabled:[4],viewer:[16],isMeasuring:[1540,"is-measuring"],snapDistance:[2,"snap-distance"],stateMap:[32]}]]],["p-1ca95f9a",[[1,"vertex-viewer-markup",{arrowTemplateId:[1,"arrow-template-id"],circleTemplateId:[1,"circle-template-id"],freeformTemplateId:[1,"freeform-template-id"],tool:[1],disabled:[4],viewer:[16],selectedMarkupId:[1025,"selected-markup-id"],selectNew:[4,"select-new"],toSelectMarkupId:[32],pointerDownPosition:[32],addMarkup:[64],removeMarkup:[64],getMarkupElements:[64],getMarkupElement:[64]},[[0,"markupEnd","handleMarkupEnd"],[1,"pointerdown","handleMarkupPointerDown"]]]]],["p-41028d3b",[[1,"vertex-viewer-markup-tool",{arrowTemplateId:[1,"arrow-template-id"],circleTemplateId:[1,"circle-template-id"],freeformTemplateId:[1,"freeform-template-id"],tool:[1],disabled:[4],viewer:[16],stateMap:[32],reset:[64]}]]],["p-f0411993",[[1,"vertex-viewer-measurements",{distanceTemplateId:[1,"distance-template-id"],tool:[1],units:[1],fractionalDigits:[2,"fractional-digits"],disabled:[4],viewer:[16],selectedMeasurementId:[1025,"selected-measurement-id"],snapDistance:[2,"snap-distance"],showAxisReferenceLines:[4,"show-axis-reference-lines"],measurementModel:[16],addMeasurement:[64],removeMeasurement:[64],getMeasurementElement:[64],getMeasurementElements:[64]},[[0,"measureEnd","handleMeasureEnd"],[1,"pointerdown","handleMeasurementPointerDown"]]]]],["p-858bd2c7",[[1,"vertex-viewer-view-cube",{xPositiveLabel:[1,"x-positive-label"],xNegativeLabel:[1,"x-negative-label"],yPositiveLabel:[1,"y-positive-label"],yNegativeLabel:[1,"y-negative-label"],zPositiveLabel:[1,"z-positive-label"],zNegativeLabel:[1,"z-negative-label"],standardViewsOff:[4,"standard-views-off"],animationDuration:[2,"animation-duration"],triadOff:[4,"triad-off"],worldOrientation:[1040],camera:[1040],viewer:[16],boxLength:[32],triadPosition:[32]}]]],["p-ebd55df7",[[1,"vertex-viewer-measurement-precise",{measurementModel:[16],measurementOverlays:[16],measurementController:[1040],measurableEntityTypes:[16],viewer:[16],configEnv:[1,"config-env"],config:[16],overlays:[32]}]]],["p-90bb0a1f",[[1,"vertex-scene-tree-table-cell",{node:[16],tree:[16],value:[1],placeholder:[1],hoveredNodeId:[1,"hovered-node-id"],expandToggle:[4,"expand-toggle"],visibilityToggle:[4,"visibility-toggle"],interactionsDisabled:[4,"interactions-disabled"],recurseParentSelectionDisabled:[4,"recurse-parent-selection-disabled"]}]]],["p-70ca1ea7",[[1,"vertex-scene-tree-table-column",{initialWidth:[2,"initial-width"],minWidth:[2,"min-width"],maxWidth:[2,"max-width"]}]]],["p-d2bcf788",[[1,"vertex-scene-tree-table-header"]]],["p-61b1097b",[[1,"vertex-scene-tree-table-resize-divider",{dragging:[32]}]]],["p-099fe6ca",[[1,"vertex-scene-tree-toolbar-group"]]],["p-49d36e94",[[1,"vertex-viewer",{src:[1],clientId:[1,"client-id"],deviceId:[1,"device-id"],config:[1],configEnv:[1,"config-env"],resolvedConfig:[1040],cameraControls:[4,"camera-controls"],cameraType:[1,"camera-type"],keyboardControls:[4,"keyboard-controls"],rotateAroundTapPoint:[4,"rotate-around-tap-point"],token:[1025],depthBuffers:[1,"depth-buffers"],experimentalGhostingOpacity:[2,"experimental-ghosting-opacity"],featureLines:[16],featureHighlighting:[16],featureMaps:[1,"feature-maps"],selectionMaterial:[1,"selection-material"],resizeDebounce:[2,"resize-debounce"],frame:[1040],stream:[1040],stencilBuffer:[1040],viewport:[1040],dimensions:[32],hostDimensions:[32],errorMessage:[32],cursor:[32],stateMap:[32],dispatchFrameDrawn:[64],registerInteractionHandler:[64],registerTapKeyInteraction:[64],getInteractionTarget:[64],addCursor:[64],getInteractionHandlers:[64],getBaseInteractionHandler:[64],getJwt:[64],load:[64],unload:[64],scene:[64],isSceneReady:[64]},[[0,"tap","handleTapEvent"]]]]],["p-89b66838",[[1,"vertex-viewer-measurement-details",{measurementModel:[16],measurementOverlays:[16],measurementOutcome:[1040],distanceUnits:[1,"distance-units"],angleUnits:[1,"angle-units"],fractionalDigits:[2,"fractional-digits"],distanceFormatter:[16],angleFormatter:[16],areaFormatter:[16],resultTypes:[16],overlay:[32],distanceMeasurementUnits:[32],angleMeasurementUnits:[32],areaMeasurementUnits:[32]}]]],["p-bcde5521",[[1,"vertex-viewer-measurement-distance",{start:[1040],startJson:[1,"start-json"],end:[1040],endJson:[1,"end-json"],distance:[1026],showAxisReferenceLines:[4,"show-axis-reference-lines"],snapDistance:[2,"snap-distance"],units:[1],fractionalDigits:[2,"fractional-digits"],labelFormatter:[16],anchorLabelOffset:[2,"anchor-label-offset"],lineCapLength:[2,"line-cap-length"],mode:[513],interactingAnchor:[1537,"interacting-anchor"],invalid:[1540],camera:[16],hitProvider:[16],indicatorPt:[1040],viewer:[16],measurementModel:[16],viewport:[32],elementBounds:[32],interactionCount:[32],internalCamera:[32],invalidateStateCounter:[32],stateMap:[32],measurementUnits:[32],computeElementMetrics:[64]}]]],["p-b043b076",[[1,"vertex-scene-tree-search",{debounce:[2],disabled:[4],placeholder:[1],value:[1025],focused:[32],setFocus:[64]}],[1,"vertex-scene-tree-table-layout",{tree:[16],controller:[16],rows:[16],totalRows:[2,"total-rows"],rowHeight:[1026,"row-height"],overScanCount:[2,"over-scan-count"],rowData:[16],layoutOffset:[1026,"layout-offset"],scrollOffset:[1026,"scroll-offset"],layoutHeight:[1026,"layout-height"],layoutWidth:[1026,"layout-width"],viewportStartIndex:[1026,"viewport-start-index"],viewportEndIndex:[1026,"viewport-end-index"],columnGridLayout:[32],columnGridFixedLayout:[32],hoveredNodeId:[32],isComputingCellHeight:[32],lastDividerPointerPosition:[32],resizingColumnIndex:[32],stateMap:[32],scrollToPosition:[64]}],[1,"vertex-scene-tree-toolbar"]]],["p-31658489",[[1,"vertex-viewer-toolbar",{placement:[1],direction:[1]}],[1,"vertex-viewer-button"],[1,"vertex-viewer-toolbar-group",{direction:[1]}]]],["p-b0ac6b3c",[[1,"vertex-viewer-dom-element",{position:[1040],positionJson:[1,"position"],rotation:[1040],rotationJson:[1,"rotation"],quaternion:[1040],quaternionJson:[1,"quaternion"],scale:[1040],scaleJson:[1,"scale"],matrix:[1040],occlusionOff:[4,"occlusion-off"],occluded:[516],billboardOff:[4,"billboard-off"],interactionsOff:[516,"interactions-off"]}],[1,"vertex-viewer-dom-group",{position:[1040],positionJson:[1,"position"],rotation:[1040],rotationJson:[1,"rotation"],quaternion:[1040],quaternionJson:[1,"quaternion"],scale:[1040],scaleJson:[1,"scale"],matrix:[1040]}],[1,"vertex-viewer-dom-renderer",{drawMode:[1,"draw-mode"],viewer:[16],camera:[1040],depthBuffer:[1040],viewport:[32],invalidateFrameCounter:[32]},[[0,"propertyChange","handlePropertyChange"]]]]],["p-4717c98e",[[1,"vertex-viewer-icon",{name:[1],size:[1]}]]],["p-46459921",[[1,"vertex-viewer-layer",{stretchOff:[516,"stretch-off"]}]]],["p-d3a20af4",[[1,"vertex-viewer-markup-arrow",{start:[1040],startJson:[1,"start"],end:[1040],endJson:[1,"end"],mode:[513],viewer:[16],elementBounds:[32],editAnchor:[32],dispose:[64]}],[1,"vertex-viewer-markup-circle",{bounds:[1040],boundsJson:[1,"bounds"],mode:[513],viewer:[16],elementBounds:[32],startPosition:[32],editAnchor:[32],resizeBounds:[32],dispose:[64]}],[1,"vertex-viewer-markup-freeform",{points:[1040],pointsJson:[1,"points"],bounds:[1040],boundsJson:[1,"bounds"],mode:[513],viewer:[16],elementBounds:[32],resizeStartPosition:[32],editAnchor:[32],resizeBounds:[32],resizePoints:[32],screenPoints:[32],dispose:[64]}]]],["p-d9f99f4d",[[1,"vertex-viewer-measurement-overlays",{measurementOverlays:[16],camera:[1040],viewer:[16],overlays:[32]}],[1,"vertex-viewer-measurement-line",{start:[16],end:[16],capLength:[2,"cap-length"],pointerEvents:[1,"pointer-events"]}]]]],e))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertexvis/viewer",
|
|
3
|
-
"version": "0.13.2-canary.
|
|
3
|
+
"version": "0.13.2-canary.9",
|
|
4
4
|
"description": "The Vertex SDK for viewing models.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vertex Developers <support@vertexvis.com> (https://developer.vertexvis.com)",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"@stencil/core": "^2.12.1",
|
|
50
50
|
"@types/classnames": "^2.3.1",
|
|
51
51
|
"@vertexvis/frame-streaming-protos": "^0.6.19",
|
|
52
|
-
"@vertexvis/geometry": "0.13.2-canary.
|
|
53
|
-
"@vertexvis/html-templates": "0.13.2-canary.
|
|
52
|
+
"@vertexvis/geometry": "0.13.2-canary.9",
|
|
53
|
+
"@vertexvis/html-templates": "0.13.2-canary.9",
|
|
54
54
|
"@vertexvis/scene-tree-protos": "^0.1.12",
|
|
55
55
|
"@vertexvis/scene-view-protos": "^0.1.8",
|
|
56
|
-
"@vertexvis/stream-api": "0.13.2-canary.
|
|
57
|
-
"@vertexvis/utils": "0.13.2-canary.
|
|
56
|
+
"@vertexvis/stream-api": "0.13.2-canary.9",
|
|
57
|
+
"@vertexvis/utils": "0.13.2-canary.9",
|
|
58
58
|
"@vertexvis/web-workers": "^0.1.0",
|
|
59
59
|
"camel-case": "^4.1.2",
|
|
60
60
|
"classnames": "^2.3.1",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@vertexvis/rollup-plugin-vertexvis-copyright": "^0.4.1",
|
|
80
80
|
"@vertexvis/rollup-plugin-web-workers": "^0.1.0",
|
|
81
81
|
"@vertexvis/typescript-config-vertexvis": "1.1.0",
|
|
82
|
-
"@vertexwebsdk/build": "0.13.2-canary.
|
|
82
|
+
"@vertexwebsdk/build": "0.13.2-canary.9",
|
|
83
83
|
"abortcontroller-polyfill": "^1.7.3",
|
|
84
84
|
"chance": "^1.1.8",
|
|
85
85
|
"eslint": "^8.6.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"typedoc": "^0.22.10",
|
|
95
95
|
"typescript": "^4.5.4"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "f2e9bd79bdfa6cddfaff87cd4df4f393f79ff9cb"
|
|
98
98
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/**!
|
|
2
|
-
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import{r as i,c as t,h as s,H as e,g as l}from"./p-cafa57a6.js";import{c as n}from"./p-f482325b.js";import"./p-112455b1.js";let o=class{constructor(s){i(this,s),this.hovered=t(this,"hovered",7),this.expandToggled=t(this,"expandToggled",7),this.visibilityToggled=t(this,"visibilityToggled",7),this.selectionToggled=t(this,"selectionToggled",7),this.placeholder="--",this.interactionsDisabled=!1,this.recurseParentSelectionDisabled=!1,this.displayValue=()=>null==this.value||""===this.value.trim()?this.placeholder:this.value,this.handleCellPointerDown=i=>{var t,s,e,l,n,o;i.defaultPrevented||0!==i.button||this.interactionsDisabled||((i.ctrlKey||i.metaKey)&&(null===(t=this.node)||void 0===t?void 0:t.selected)?null===(s=this.tree)||void 0===s||s.deselectItem(this.node):(null===(e=this.node)||void 0===e?void 0:e.selected)&&!this.recurseParentSelectionDisabled?null===(l=this.tree)||void 0===l||l.selectItem(this.node,{recurseParent:!0}):(null===(n=this.node)||void 0===n?void 0:n.selected)||null===(o=this.tree)||void 0===o||o.selectItem(this.node,{append:i.ctrlKey||i.metaKey,range:i.shiftKey}),this.selectionToggled.emit({node:this.node,originalEvent:i}))},this.toggleExpansion=i=>{null==this.tree||null==this.node||this.interactionsDisabled||this.tree.toggleExpandItem(this.node),this.expandToggled.emit({node:this.node,originalEvent:i})},this.toggleVisibility=i=>{null==this.tree||null==this.node||this.interactionsDisabled||this.tree.toggleItemVisibility(this.node),this.visibilityToggled.emit({node:this.node,originalEvent:i})}}componentWillRender(){var i,t,s,e,l,n,o;this.toggleAttribute("is-hovered",this.hoveredNodeId===(null===(t=null===(i=this.node)||void 0===i?void 0:i.id)||void 0===t?void 0:t.hex)),this.toggleAttribute("is-hidden",!(null===(s=this.node)||void 0===s?void 0:s.visible)),this.toggleAttribute("is-selected",!!(null===(e=this.node)||void 0===e?void 0:e.selected)),this.toggleAttribute("is-partial",!!(null===(l=this.node)||void 0===l?void 0:l.partiallyVisible)),this.toggleAttribute("is-leaf",!!(null===(n=this.node)||void 0===n?void 0:n.isLeaf)),this.toggleAttribute("is-filter-hit",!!(null===(o=this.node)||void 0===o?void 0:o.filterHit))}render(){var i,t,l,o,a,h,d,r,v,c,g,u;return s(e,{onPointerEnter:i=>{this.hovered.emit({node:this.node,originalEvent:i})},onPointerLeave:()=>{this.hovered.emit(void 0)},onPointerDown:this.handleCellPointerDown},s("div",{class:"wrapper"},s("div",{class:"no-shrink"},s("slot",{name:"left-gutter"})),this.expandToggle&&s("button",{class:"expand-btn no-shrink","data-test-id":"expand-"+(null===(i=this.node)||void 0===i?void 0:i.name),onPointerDown:i=>{i.preventDefault(),this.toggleExpansion(i)}},!(null===(t=this.node)||void 0===t?void 0:t.isLeaf)&&s("div",{class:n("icon",{"icon-expanded":!(null===(l=this.node)||void 0===l?void 0:l.isLeaf)&&(null===(o=this.node)||void 0===o?void 0:o.expanded),"icon-collapsed":!(null===(a=this.node)||void 0===a?void 0:a.isLeaf)&&!(null===(h=this.node)||void 0===h?void 0:h.expanded)})})),s("div",{class:"content"},null!=this.value&&""!==this.value.trim()?s("slot",null,this.displayValue()):s("slot",{name:"placeholder"},this.placeholder)),this.visibilityToggle&&s("button",{class:"visibility-btn no-shrink","data-test-id":"visibility-btn-"+(null===(d=this.node)||void 0===d?void 0:d.name),onPointerDown:i=>{null==i||i.preventDefault(),this.toggleVisibility(i)},onTouchStart:i=>{null==i||i.preventDefault(),this.toggleVisibility(i)}},s("div",{class:n("icon",{"icon-visible":!(null===(r=this.node)||void 0===r?void 0:r.partiallyVisible)&&(null===(v=this.node)||void 0===v?void 0:v.visible),"icon-hidden":!(null===(c=this.node)||void 0===c?void 0:c.partiallyVisible)&&!(null===(g=this.node)||void 0===g?void 0:g.visible),"icon-partial":null===(u=this.node)||void 0===u?void 0:u.partiallyVisible})})),s("div",{class:"no-shrink"},s("slot",{name:"right-gutter"})),!this.visibilityToggle&&s("div",{class:"column-spacer"})))}toggleAttribute(i,t){t?this.hostEl.setAttribute(i,""):this.hostEl.removeAttribute(i)}get hostEl(){return l(this)}};o.style="button{border:none;background:transparent;cursor:pointer;margin:0;padding:0}:host{display:flex;align-items:center;box-sizing:border-box;--scene-tree-cell-background-hover:var(--blue-200);--scene-tree-cell-background-selected:var(--blue-300);--scene-tree-cell-text-positioning:left;--scene-tree-cell-padding:0.25rem 0}:host([is-hovered]){background:var(--scene-tree-cell-background-hover)}:host([is-selected]){background:var(--scene-tree-cell-background-selected)}.wrapper{display:flex;align-items:center;box-sizing:border-box;width:100%;height:100%;padding:var(--scene-tree-cell-padding)}.content{width:100%;text-align:var(--scene-tree-cell-text-positioning);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.column-spacer{width:var(--scene-tree-table-column-gap)}.expand-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px}.no-shrink{flex-shrink:0}:host([is-leaf]) .expand-btn{visibility:hidden;cursor:default}.visibility-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;visibility:hidden;width:24px;height:24px}:host([is-hidden]) .visibility-btn,:host([is-partial]) .visibility-btn,:host([is-hovered]) .visibility-btn{visibility:inherit}.icon{width:14px;height:14px}.icon-expanded{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' class='icon' %3E%3Cpath fill='%23444444' d='M11.88,9.17l-3.5-4a.51.51,0,0,0-.76,0l-3.5,4A.5.5,0,0,0,4.5,10h7a.5.5,0,0,0,.38-.83Z' transform='rotate(180 8 8)' /%3E%3C/svg%3E\")}.icon-collapsed{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' class='icon' %3E%3Cpath fill='%23444444' d='M10.83,7.62l-4-3.5A.5.5,0,0,0,6,4.5v7a.5.5,0,0,0,.83.38l4-3.5a.51.51,0,0,0,0-.76Z' /%3E%3C/svg%3E\")}.icon-visible{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' class='icon' %3E%3Cpath fill='%23444444' d='M8 5a3 3 0 103 3 3 3 0 00-3-3zm4.65-1.17A8.53 8.53 0 008 2.5a8.53 8.53 0 00-4.65 1.33A6.57 6.57 0 00.51 7.89v.22a6.57 6.57 0 002.84 4.06A8.53 8.53 0 008 13.5a8.53 8.53 0 004.65-1.33 6.57 6.57 0 002.84-4.06v-.22a6.57 6.57 0 00-2.84-4.06zm-.55 7.5A7.52 7.52 0 018 12.5a7.52 7.52 0 01-4.1-1.17A5.49 5.49 0 011.53 8 5.49 5.49 0 013.9 4.67 7.52 7.52 0 018 3.5a7.52 7.52 0 014.1 1.17A5.49 5.49 0 0114.47 8a5.49 5.49 0 01-2.37 3.33z' /%3E%3C/svg%3E\")}.icon-hidden{background-image:url(\"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' class='icon' %3E%3Cpath fill='%23444444' d='M13.35 2.65a.48.48 0 00-.7 0l-.78.77a8.71 8.71 0 00-8.52.41A6.57 6.57 0 00.51 7.89v.22a6.58 6.58 0 002.71 4l-.57.58a.49.49 0 00.7.7l10-10a.48.48 0 000-.74zM9.73 5.56a3 3 0 00-4.17 4.17l-1.62 1.62A5.49 5.49 0 011.53 8 5.49 5.49 0 013.9 4.67 7.52 7.52 0 018 3.5a7.67 7.67 0 013.12.67zm3.61-1.2l-.72.72A5.45 5.45 0 0114.47 8a5.49 5.49 0 01-2.37 3.33A7.52 7.52 0 018 12.5a8.15 8.15 0 01-2.41-.38l-.78.78a8.9 8.9 0 003.19.6 8.53 8.53 0 004.65-1.33 6.57 6.57 0 002.84-4.06v-.22a6.56 6.56 0 00-2.15-3.53z' /%3E%3C/svg%3E%0A\")}.icon-partial{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M4.12 11.46A5.62 5.62 0 011.52 8 5.57 5.57 0 013.9 4.67 7.52 7.52 0 018 3.5a7.7 7.7 0 013.33.75l.74-.74A8.67 8.67 0 008 2.5a8.53 8.53 0 00-4.65 1.33A6.57 6.57 0 00.51 7.89v.22a6.54 6.54 0 002.88 4.08z' fill='%23444'/%3E%3Cpath d='M8 5a3 3 0 00-3 3 3 3 0 00.69 1.89l4.2-4.2A3 3 0 008 5zM5.88 5.88zM9.2 12.41a.51.51 0 00-.42.57.5.5 0 00.56.42.5.5 0 00.43-.57.51.51 0 00-.57-.42zM6.77 12.41a.5.5 0 00-.57.42.49.49 0 00.41.57.5.5 0 10.15-1zM14.48 5.61a.5.5 0 00-.7-.12.49.49 0 00-.12.69.5.5 0 00.82-.57zM11.5 11.68a.5.5 0 00-.22.67.51.51 0 00.68.22.5.5 0 00-.46-.89zM15.07 7.77a.52.52 0 00-.62.35.51.51 0 00.35.62.5.5 0 00.61-.35.52.52 0 00-.34-.62zM13.36 10.21a.5.5 0 10.76.64.49.49 0 00-.06-.7.51.51 0 00-.7.06z' fill='%23444'/%3E%3C/svg%3E\")}";export{o as vertex_scene_tree_table_cell}
|