@vertexvis/viewer 1.1.1-testing.4 → 1.1.1-testing.5
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/{config-BY0v6BSK.js → config-OELTgslY.js} +3 -3
- package/dist/cjs/{config-BY0v6BSK.js.map → config-OELTgslY.js.map} +1 -1
- package/dist/cjs/{entities-CEaa12yP.js → entities-rj-TEPKc.js} +4 -4
- package/dist/cjs/{entities-CEaa12yP.js.map → entities-rj-TEPKc.js.map} +1 -1
- package/dist/cjs/{geometry_pb-EVfAEuPO.js → geometry_pb-asn2mNvW.js} +3 -3
- package/dist/cjs/{geometry_pb-EVfAEuPO.js.map → geometry_pb-asn2mNvW.js.map} +1 -1
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{queries-LthBzEHD.js → queries-e19TP_oF.js} +4 -4
- package/dist/cjs/{queries-LthBzEHD.js.map → queries-e19TP_oF.js.map} +1 -1
- package/dist/cjs/{regl-component-B_JaaVlv.js → regl-component-DjVaO3t3.js} +3 -3
- package/dist/cjs/{regl-component-B_JaaVlv.js.map → regl-component-DjVaO3t3.js.map} +1 -1
- package/dist/cjs/{representation_pb-B6XR10pQ.js → representation_pb-BVBPrHLf.js} +3 -3
- package/dist/cjs/{representation_pb-B6XR10pQ.js.map → representation_pb-BVBPrHLf.js.map} +1 -1
- package/dist/cjs/{streamAttributes-nCF7u7lv.js → streamAttributes-M3UUIO3l.js} +117 -94
- package/dist/cjs/streamAttributes-M3UUIO3l.js.map +1 -0
- package/dist/cjs/vertex-scene-tree-notification-banner_4.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree-notification-banner_4.cjs.entry.js.map +1 -1
- package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/vertex-scene-tree.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-dom-element_2.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-hit-result-indicator.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer-pin-label_2.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-pin-label_2.cjs.entry.js.map +1 -1
- package/dist/cjs/vertex-viewer-transform-widget.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer-transform-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer.cjs.entry.js +4 -4
- package/dist/collection/components/scene-tree-search/scene-tree-search.js +1 -1
- package/dist/collection/components/scene-tree-search/scene-tree-search.js.map +1 -1
- package/dist/collection/components/scene-tree-table-cell/scene-tree-table-cell.js +1 -1
- package/dist/collection/components/scene-tree-table-cell/scene-tree-table-cell.js.map +1 -1
- package/dist/collection/components/viewer-pin-label/viewer-pin-label.js +2 -2
- package/dist/collection/components/viewer-pin-label/viewer-pin-label.js.map +1 -1
- package/dist/collection/components/viewer-transform-widget/viewer-transform-widget-components.js +1 -1
- package/dist/collection/components/viewer-transform-widget/viewer-transform-widget-components.js.map +1 -1
- package/dist/collection/workers/png-decoder-pool.js +4 -3
- package/dist/collection/workers/png-decoder-pool.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-COznr3CH.js → p-5bk1mHRt.js} +2 -2
- package/dist/components/{p-D3bzgaCV.js → p-B8530k7R.js} +2 -2
- package/dist/components/{p-CWcvgy8e.js → p-BCuMPvZO.js} +2 -2
- package/dist/components/{p-DTwJX9HL.js → p-BgzjmANj.js} +2 -2
- package/dist/components/{p-DTwJX9HL.js.map → p-BgzjmANj.js.map} +1 -1
- package/dist/components/p-BjvjKoy7.js +5 -0
- package/dist/components/p-BjvjKoy7.js.map +1 -0
- package/dist/components/{p-Cxz4L6FA.js → p-Bwtyddca.js} +2 -2
- package/dist/components/{p-Ca253f0h.js → p-Bx42CNGV.js} +2 -2
- package/dist/components/p-C86HMDzi.js +5 -0
- package/dist/components/{p-Y8W_BXUk.js.map → p-C86HMDzi.js.map} +1 -1
- package/dist/components/p-CSVgoQU8.js +5 -0
- package/dist/components/{p-Cku0WCYo.js.map → p-CSVgoQU8.js.map} +1 -1
- package/dist/components/{p-D3in41xo.js → p-CTi-0-dI.js} +2 -2
- package/dist/components/{p-D1Vdomj_.js → p-D_h07qsA.js} +2 -2
- package/dist/components/{p-BNRm88jS.js → p-KidjtXKE.js} +2 -2
- package/dist/components/vertex-scene-tree-search.js +1 -1
- package/dist/components/vertex-scene-tree-table-cell.js +1 -1
- package/dist/components/vertex-scene-tree-table-cell.js.map +1 -1
- package/dist/components/vertex-scene-tree.js +1 -1
- package/dist/components/vertex-viewer-dom-renderer.js +1 -1
- package/dist/components/vertex-viewer-hit-result-indicator.js +1 -1
- package/dist/components/vertex-viewer-measurement-details.js +1 -1
- package/dist/components/vertex-viewer-measurement-distance.js +1 -1
- package/dist/components/vertex-viewer-measurement-overlays.js +1 -1
- package/dist/components/vertex-viewer-measurement-precise.js +1 -1
- package/dist/components/vertex-viewer-pin-group.js +1 -1
- package/dist/components/vertex-viewer-pin-label.js +1 -1
- package/dist/components/vertex-viewer-pin-tool.js +1 -1
- package/dist/components/vertex-viewer-transform-widget.js +1 -1
- package/dist/components/vertex-viewer-transform-widget.js.map +1 -1
- package/dist/components/vertex-viewer-view-cube.js +1 -1
- package/dist/components/vertex-viewer.js +1 -1
- package/dist/esm/{config-ss9ha12b.js → config-Cqrcty7U.js} +3 -3
- package/dist/esm/{config-ss9ha12b.js.map → config-Cqrcty7U.js.map} +1 -1
- package/dist/esm/{entities-DEFAhYdV.js → entities-CawBZH7i.js} +4 -4
- package/dist/esm/{entities-DEFAhYdV.js.map → entities-CawBZH7i.js.map} +1 -1
- package/dist/esm/{geometry_pb-D7fM1PYG.js → geometry_pb-COdZQiRi.js} +3 -3
- package/dist/esm/{geometry_pb-D7fM1PYG.js.map → geometry_pb-COdZQiRi.js.map} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/{queries-BcmE5Zbq.js → queries-B4XotYyr.js} +4 -4
- package/dist/esm/{queries-BcmE5Zbq.js.map → queries-B4XotYyr.js.map} +1 -1
- package/dist/esm/{regl-component-gIonUTBJ.js → regl-component-B1_h3_s8.js} +3 -3
- package/dist/esm/{regl-component-gIonUTBJ.js.map → regl-component-B1_h3_s8.js.map} +1 -1
- package/dist/esm/{representation_pb-Bf023NuN.js → representation_pb-C4MJfZMo.js} +3 -3
- package/dist/esm/{representation_pb-Bf023NuN.js.map → representation_pb-C4MJfZMo.js.map} +1 -1
- package/dist/esm/{streamAttributes-Bj2xDHfI.js → streamAttributes-BW9JzMeG.js} +116 -93
- package/dist/esm/streamAttributes-BW9JzMeG.js.map +1 -0
- package/dist/esm/vertex-scene-tree-notification-banner_4.entry.js +1 -1
- package/dist/esm/vertex-scene-tree-notification-banner_4.entry.js.map +1 -1
- package/dist/esm/vertex-scene-tree-table-cell.entry.js +2 -2
- package/dist/esm/vertex-scene-tree-table-cell.entry.js.map +1 -1
- package/dist/esm/vertex-scene-tree.entry.js +2 -2
- package/dist/esm/vertex-viewer-dom-element_2.entry.js +1 -1
- package/dist/esm/vertex-viewer-hit-result-indicator.entry.js +2 -2
- package/dist/esm/vertex-viewer-measurement-details.entry.js +2 -2
- package/dist/esm/vertex-viewer-measurement-distance.entry.js +2 -2
- package/dist/esm/vertex-viewer-measurement-line_2.entry.js +2 -2
- package/dist/esm/vertex-viewer-measurement-precise.entry.js +4 -4
- package/dist/esm/vertex-viewer-pin-group.entry.js +3 -3
- package/dist/esm/vertex-viewer-pin-label_2.entry.js +2 -2
- package/dist/esm/vertex-viewer-pin-label_2.entry.js.map +1 -1
- package/dist/esm/vertex-viewer-transform-widget.entry.js +3 -3
- package/dist/esm/vertex-viewer-transform-widget.entry.js.map +1 -1
- package/dist/esm/vertex-viewer-view-cube.entry.js +1 -1
- package/dist/esm/vertex-viewer.entry.js +4 -4
- package/dist/types/workers/png-decoder-pool.d.ts +0 -1
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/{p-00540193.entry.js → p-1506f9a2.entry.js} +2 -2
- package/dist/viewer/{p-5cfb3047.entry.js → p-293d8f3f.entry.js} +2 -2
- package/dist/viewer/{p-9a39315d.entry.js → p-2faddbf8.entry.js} +2 -2
- package/dist/viewer/{p-7cb9c9bb.entry.js → p-36349a80.entry.js} +2 -2
- package/dist/viewer/p-36349a80.entry.js.map +1 -0
- package/dist/viewer/p-44395076.entry.js +5 -0
- package/dist/viewer/{p-e4913b06.entry.js.map → p-44395076.entry.js.map} +1 -1
- package/dist/viewer/{p-30a5748d.entry.js → p-45cc095e.entry.js} +2 -2
- package/dist/viewer/{p-d5a57757.entry.js → p-93311f46.entry.js} +2 -2
- package/dist/viewer/{p-CyiY_hsD.js → p-BEOO-Ypv.js} +2 -2
- package/dist/viewer/{p-CyiY_hsD.js.map → p-BEOO-Ypv.js.map} +1 -1
- package/dist/viewer/{p-CS8PfgcI.js → p-BJGbLthH.js} +2 -2
- package/dist/viewer/{p-CS8PfgcI.js.map → p-BJGbLthH.js.map} +1 -1
- package/dist/viewer/{p-D2IEHEGM.js → p-Br21pGVj.js} +2 -2
- package/dist/viewer/{p-D2IEHEGM.js.map → p-Br21pGVj.js.map} +1 -1
- package/dist/viewer/{p-kMZA0v7I.js → p-Bw_ryWU0.js} +2 -2
- package/dist/viewer/{p-kMZA0v7I.js.map → p-Bw_ryWU0.js.map} +1 -1
- package/dist/viewer/{p-DHK23fw4.js → p-C4_1Jc7H.js} +2 -2
- package/dist/viewer/{p-DHK23fw4.js.map → p-C4_1Jc7H.js.map} +1 -1
- package/dist/viewer/p-Cc3XhAoA.js +5 -0
- package/dist/viewer/p-Cc3XhAoA.js.map +1 -0
- package/dist/viewer/p-DYDhLlLS.js +5 -0
- package/dist/viewer/{p-_LpaX1ga.js.map → p-DYDhLlLS.js.map} +1 -1
- package/dist/viewer/{p-48020de1.entry.js → p-a94b626c.entry.js} +2 -2
- package/dist/viewer/{p-b79c295a.entry.js → p-ced98004.entry.js} +2 -2
- package/dist/viewer/{p-32a51a21.entry.js → p-dcb6ddfe.entry.js} +2 -2
- package/dist/viewer/p-dcb6ddfe.entry.js.map +1 -0
- package/dist/viewer/{p-cc835213.entry.js → p-ea45c3e9.entry.js} +2 -2
- package/dist/viewer/p-ebd9dd99.entry.js +5 -0
- package/dist/viewer/p-ebd9dd99.entry.js.map +1 -0
- package/dist/viewer/{p-edc2f914.entry.js → p-ecd594f2.entry.js} +2 -2
- package/dist/viewer/p-fec5a15d.entry.js +5 -0
- package/dist/viewer/p-fec5a15d.entry.js.map +1 -0
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +9 -9
- package/dist/cjs/streamAttributes-nCF7u7lv.js.map +0 -1
- package/dist/components/p-Cku0WCYo.js +0 -5
- package/dist/components/p-CvEK3ZK1.js +0 -5
- package/dist/components/p-CvEK3ZK1.js.map +0 -1
- package/dist/components/p-Y8W_BXUk.js +0 -5
- package/dist/esm/streamAttributes-Bj2xDHfI.js.map +0 -1
- package/dist/viewer/p-32a51a21.entry.js.map +0 -1
- package/dist/viewer/p-4dd67d16.entry.js +0 -5
- package/dist/viewer/p-4dd67d16.entry.js.map +0 -1
- package/dist/viewer/p-7cb9c9bb.entry.js.map +0 -1
- package/dist/viewer/p-BhKTTmpL.js +0 -5
- package/dist/viewer/p-BhKTTmpL.js.map +0 -1
- package/dist/viewer/p-_LpaX1ga.js +0 -5
- package/dist/viewer/p-e4913b06.entry.js +0 -5
- package/dist/viewer/p-fd3a5837.entry.js +0 -5
- package/dist/viewer/p-fd3a5837.entry.js.map +0 -1
- /package/dist/components/{p-COznr3CH.js.map → p-5bk1mHRt.js.map} +0 -0
- /package/dist/components/{p-D3bzgaCV.js.map → p-B8530k7R.js.map} +0 -0
- /package/dist/components/{p-CWcvgy8e.js.map → p-BCuMPvZO.js.map} +0 -0
- /package/dist/components/{p-Cxz4L6FA.js.map → p-Bwtyddca.js.map} +0 -0
- /package/dist/components/{p-Ca253f0h.js.map → p-Bx42CNGV.js.map} +0 -0
- /package/dist/components/{p-D3in41xo.js.map → p-CTi-0-dI.js.map} +0 -0
- /package/dist/components/{p-D1Vdomj_.js.map → p-D_h07qsA.js.map} +0 -0
- /package/dist/components/{p-BNRm88jS.js.map → p-KidjtXKE.js.map} +0 -0
- /package/dist/viewer/{p-00540193.entry.js.map → p-1506f9a2.entry.js.map} +0 -0
- /package/dist/viewer/{p-5cfb3047.entry.js.map → p-293d8f3f.entry.js.map} +0 -0
- /package/dist/viewer/{p-9a39315d.entry.js.map → p-2faddbf8.entry.js.map} +0 -0
- /package/dist/viewer/{p-30a5748d.entry.js.map → p-45cc095e.entry.js.map} +0 -0
- /package/dist/viewer/{p-d5a57757.entry.js.map → p-93311f46.entry.js.map} +0 -0
- /package/dist/viewer/{p-48020de1.entry.js.map → p-a94b626c.entry.js.map} +0 -0
- /package/dist/viewer/{p-b79c295a.entry.js.map → p-ced98004.entry.js.map} +0 -0
- /package/dist/viewer/{p-cc835213.entry.js.map → p-ea45c3e9.entry.js.map} +0 -0
- /package/dist/viewer/{p-edc2f914.entry.js.map → p-ecd594f2.entry.js.map} +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Vertex Software LLC. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import{c as e,u as t,b as s,a as n}from"./p-CDM7zNn0.js";import{c as i,d as r,e as a}from"./p--8q6LyIm.js";import{u as o,m as u,a as h,p as c,b as l,r as d}from"./p-D3bzgaCV.js";import{s as p,w}from"./p-FRKLa468.js";import{r as v,c as f}from"./p-CioaIHsi.js";import{v as y,f as m,c as x,m as g,q as I,r as b,p as S,e as R}from"./p-2UsvOTHJ.js";import{R as B,t as V,T as E,u as A,e as k,g as T,U as q,V as C}from"./p-CvEK3ZK1.js";import{v as P,t as M,L as O}from"./p-5kcpg4MZ.js";const D={opacity:255,glossiness:4,diffuse:{r:0,g:0,b:0,a:0},ambient:{r:0,g:0,b:0,a:0},specular:{r:0,g:0,b:0,a:0},emissive:{r:0,g:0,b:0,a:0}};const _=(e,t,s,n)=>({...D,opacity:n!==null&&n!==void 0?n:D.opacity,diffuse:{r:e,g:t,b:s,a:0}});const U=(t,s)=>{const n=e.fromHexString(t);return{...D,opacity:s!==null&&s!==void 0?s:D.opacity,diffuse:n!=null?{...n}:{...D.diffuse}}};var j=Object.freeze({__proto__:null,create:_,defaultColor:D,fromHex:U});function F(e){var s;const n=t.parse(e);if(n.scheme!=="urn"||n.path==null){throw new Error("Invalid URN. Expected URN scheme.")}const[r,a,o,...u]=n.path.split(/[:/]/);if(r!=="vertexvis"&&r!=="vertex"){throw new Error("Invalid URN. Expected URN to be vertex namespace")}if(r==="vertexvis"){console.warn("vertexvis namespace is deprecated. Use 'vertex' for the namespace urn instead")}switch(a){case"stream-key":const e=N(n.query);const t=(s=z(u.join("/")))!==null&&s!==void 0?s:e.find((e=>e.type==="scene-view-state"));return{resource:{type:"stream-key",id:o},subResource:t,queries:e.filter((e=>e.type!=="scene-view-state"))};default:throw new i(`Invalid URN. Unknown resource type ${a}`)}}function z(e){if(e!=null){const[t,s]=e.split("/");switch(t){case"scene-view-states":return{type:"scene-view-state",id:s};default:return undefined}}}function N(e){if(e!=null){return e.split("&").map((e=>{const[t,s]=e.split("=");switch(t){case"supplied-id":return{type:"supplied-id",id:s};case"scene-view-state":return{type:"scene-view-state",id:s};default:throw new Error("Invalid URN. Unknown query value type")}}))}else{return[]}}var H=Object.freeze({__proto__:null,fromUrn:F});function L(e){return e.id!=null}function K(e){return e.suppliedId!=null}var Y=Object.freeze({__proto__:null,isSceneViewStateId:L,isSceneViewStateSuppliedId:K});class Q{constructor(e,t=new Date){this.knownRemoteTime=e;this.knownLocalTime=t}localOffset(){return this.duration(this.knownLocalTime,this.localNow())}localTime(e){const t=typeof e==="number"?new Date(this.knownLocalTime.getTime()+e):e;const s=this.duration(this.knownRemoteTime,t);return this.addDuration(this.knownLocalTime,s)}remoteOffset(e=new Date){return this.duration(this.remoteTime(this.knownLocalTime),this.remoteTime(e))}remoteNow(){return this.remoteTime(this.localNow())}remoteTime(e){const t=typeof e==="number"?new Date(this.knownLocalTime.getTime()+e):e;const s=this.duration(this.knownLocalTime,t);return this.addDuration(this.knownRemoteTime,s)}addDuration(e,t){return new Date(e.getTime()+t)}duration(e,t){return t.getTime()-e.getTime()}localNow(){return new Date(Date.now())}}function Z(e){const t=s.toMsbLsb(e);const n=new o.Uuid2l;n.setMsb(t.msb);n.setLsb(t.lsb);return n}class J{constructor(e,t,s,n){this.client=e;this.stream=t;this.jwtProvider=s;this.deviceIdProvider=n}async listByItem(e,{hasAnnotations:t,cursor:s,size:n=50}={}){const i=await v((async i=>{const r=this.deviceIdProvider();const a=await f(this.jwtProvider,r);const o=new p.ListItemModelViewsRequest;const u=Z(e);o.setItemId(u);if(t!=null){const e=new w.BoolValue;e.setValue(t);o.setHasAnnotations(e)}const h=new c.Pager;h.setLimit(n);if(s!=null){h.setCursor(s)}o.setPage(h);this.client.listItemModelViews(o,a,i)}));return u(i.toObject())}async load(e,t){const s=h({modelViewId:t,sceneItemId:e});this.stream.updateModelView({itemModelView:s},true)}async unload(){await this.stream.updateModelView({},true)}}class W{constructor(e,t,s){this.client=e;this.jwtProvider=t;this.deviceIdProvider=s}async listAnnotations({modelViewId:e,cursor:t,size:s=50}={}){const n=await v((async n=>{const i=this.deviceIdProvider();const r=await f(this.jwtProvider,i);const a=new p.ListPmiAnnotationsRequest;if(e!=null){const t=Z(e);a.setModelViewId(t)}const o=new c.Pager;o.setLimit(s);if(t!=null){o.setCursor(t)}a.setPage(o);this.client.listPmiAnnotations(a,r,n)}));return l(n.toObject())}}const $=1e3*10;class G{constructor(e,t,s,n=$){this.stream=e;this.predicate=t;this.transform=s;this.timeout=n;this.listeners=[];this.handleMessage=this.handleMessage.bind(this)}on(e){this.listeners=[...this.listeners,e];if(this.eventDisposable==null||this.requestDisposable==null){this.addListeners()}}off(e){this.listeners=this.listeners.filter((t=>t!==e));if(this.listeners.length===0){this.removeListeners()}}once(){let e;return n.timeout(this.timeout,new Promise((t=>{e=s=>{t(s);this.off(e)};this.on(e)}))).finally((()=>{this.off(e)}))}handleMessage(e){if(this.predicate(e)){const t=this.transform(e);if(t!=null){this.listeners.forEach((e=>e(t)))}}}addListeners(){this.eventDisposable=this.stream.onEvent(this.handleMessage);this.requestDisposable=this.stream.onRequest(this.handleMessage)}removeListeners(){var e,t;(e=this.eventDisposable)===null||e===void 0?void 0:e.dispose();(t=this.requestDisposable)===null||t===void 0?void 0:t.dispose()}}class X{constructor(e,t,{animationId:s,correlationId:n},i){this.data=undefined;this.onAnimationCompleted=new G(e,(e=>{var t,n,i;return((i=(n=(t=e.event)===null||t===void 0?void 0:t.animationCompleted)===null||n===void 0?void 0:n.animationId)===null||i===void 0?void 0:i.hex)===s}),(e=>{var t,s,n;return((n=(s=(t=e.event)===null||t===void 0?void 0:t.animationCompleted)===null||s===void 0?void 0:s.animationId)===null||n===void 0?void 0:n.hex)||undefined}),i);this.onFrameReceived=new G(e,(e=>{var t,s,i;return!!((i=(s=(t=e.request)===null||t===void 0?void 0:t.drawFrame)===null||s===void 0?void 0:s.frameCorrelationIds)===null||i===void 0?void 0:i.some((e=>e===n)))}),(e=>{var s;return((s=e.request)===null||s===void 0?void 0:s.drawFrame)!=null?t(e.request.drawFrame):undefined}),i)}}function ee(e){if(typeof e==="string"){return{sceneViewStateId:{hex:e}}}else if(L(e)){return{sceneViewStateId:{hex:e.id}}}else if(K(e)){return{sceneViewStateSuppliedId:{value:e.suppliedId}}}else{throw new Error("Unable to build scene view state identifier, input must be a string or `SceneViewStateIdentifier`.")}}function te(e,t){switch(e.type){case"and":case"or":return{operand:{itemCollection:{queries:e.expressions.map((e=>({sceneItemQuery:re(e)})))}}};case"not":return{not:{expression:te(e.query,t)}};case"item-id":case"supplied-id":return{operand:{item:{sceneItemQuery:re(e)}}};case"all":return{operand:{root:{}}};case"scene-tree-range":return{operand:{sceneTreeRange:{start:e.range.start,end:e.range.end}}};case"metadata":if(e.removeHiddenItems){return{and:{first:{operand:{metadata:{valueFilter:e.filter,keys:e.keys,exactMatch:e.exactMatch}}},second:{operand:{override:{visibility:{visibilityState:true}}}}}}}else{return{operand:{metadata:{valueFilter:e.filter,keys:e.keys,exactMatch:e.exactMatch}}}}case"all-selected":return{operand:{override:{selection:{}}}};case"all-visible":return{operand:{override:{visibility:{visibilityState:true}}}};case"point":return{operand:{point:{point:e.point,viewport:t.dimensions}}};case"volume-intersection":return{operand:{volume:{frustumByRectangle:{rectangle:e.rectangle},exclusive:e.exclusive,viewport:t.dimensions}}};default:return{}}}function se(e,t){switch(e.type){case"and":const t=e.expressions.length;if(t===1){return se({type:"annotation-id",value:e.expressions[0].value})}else if(t!==2){throw new Error("Incorrect number of query expressions provided.")}return{and:{first:se(e.expressions[0]),second:se(e.expressions[1])}};case"or":const n=e.expressions.length;if(n===1){return se({type:"annotation-id",value:e.expressions[0].value})}else if(n!==2){throw new Error("Incorrect number of query expressions provided.")}return{or:{first:se(e.expressions[0]),second:se(e.expressions[1])}};case"not":return{not:{expression:se(e.query)}};case"annotation-id":const{msb:i,lsb:r}=s.toMsbLsb(e.value);return{operand:{annotation:{id:new P.protobuf.core.Uuid2l({msb:O.fromString(i),lsb:O.fromString(r)})}}};case"all":return{operand:{all:{}}};default:return{}}}function ne(e,t,s){const n=oe(t);const i=te(e,s);return{sceneItemOperation:{queryExpression:i,operationTypes:n}}}function ie(e,t,s){const n=ue(t);const i=se(e);return{pmiAnnotationOperation:{queryExpression:i,operationTypes:n}}}function re(e){switch(e.type){case"item-id":return{id:new P.protobuf.core.Uuid({hex:e.value})};case"supplied-id":return{suppliedId:e.value};default:return{}}}function ae(e,t,s,n,i=false){const{type:r,data:a}=t.flyTo;const o={frameCorrelationId:{value:e}};if(s!=null){o.animation={duration:M(s.milliseconds)}}if(n!=null){if(i||B(n)){o.baseCamera=V(n)}}switch(r){case"supplied":o.itemSuppliedId=a;break;case"internal":o.itemId=new P.protobuf.core.Uuid({hex:a});break;case"camera":o.camera=V(a);break;case"scene-item-query":o.sceneItemQueryExpression=a;break;case"bounding-box":o.boundingBox={xmin:a.min.x,xmax:a.max.x,ymin:a.min.y,ymax:a.max.y,zmin:a.min.z,zmax:a.max.z};break}return o}function oe(e){return e.map((e=>{var t,s;switch(e.type){case"change-material":return{changeMaterial:{materialOverride:{colorMaterial:{d:e.material.opacity,ns:e.material.glossiness,ka:e.material.ambient,kd:e.material.diffuse,ks:e.material.specular,ke:e.material.emissive}}}};case"clear-override":return{clearMaterial:{}};case"change-transform":return{changeTransform:{transform:{...e.transform}}};case"clear-transform":return{clearTransform:{cascade:e.cascade}};case"hide":return{changeVisibility:{visible:false}};case"show":return{changeVisibility:{visible:true}};case"select":return{changeSelection:{selected:true}};case"deselect":return{changeSelection:{selected:false}};case"change-phantom":return{changePhantom:{phantom:(t=e.phantomState)!==null&&t!==void 0?t:true}};case"clear-phantom":return{changePhantom:{phantom:false}};case"change-end-item":return{changeEndItem:{endItem:(s=e.endItemState)!==null&&s!==void 0?s:true}};case"clear-end-item":return{changeEndItem:{endItem:false}};case"view-rendition-by-id":return{viewRendition:{id:new P.protobuf.core.Uuid({hex:e.id})}};case"view-rendition-by-supplied-id":return{viewRendition:{suppliedId:e.suppliedId}};case"view-default-rendition":return{viewDefaultRendition:{}};case"clear-rendition":return{clearRendition:{}};case"view-representation":if(e.id==="empty"){return{viewRepresentation:{predefinedId:d.RepresentationPredefinedId.REPRESENTATION_PREDEFINED_ID_EMPTY}}}else if(e.id==="entire-part"){return{viewRepresentation:{predefinedId:d.RepresentationPredefinedId.REPRESENTATION_PREDEFINED_ID_ENTIRE_PART}}}else{return{viewRepresentation:{id:new P.protobuf.core.Uuid({hex:e.id})}}}case"clear-representation":return{clearRepresentation:{}};default:return{}}}))}function ue(e){return e.map((e=>{switch(e.type){case"show":return{changeVisibility:{visible:true}};case"hide":return{changeVisibility:{visible:false}};case"select":return{changeSelection:{selected:true}};case"deselect":return{changeSelection:{selected:false}};default:return{}}}))}function he(e){return e.map((e=>{switch(e){case"camera":return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_CAMERA;case"material_overrides":return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_MATERIAL_OVERRIDE;case"selection":return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_SELECTION;case"visibility":return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_VISIBILITY;case"transforms":return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_TRANSFORM;case"cross_section":return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_CROSS_SECTION;case"phantom":return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_PHANTOM;case"shading":return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_SHADING;default:return P.protobuf.stream.SceneViewStateFeature.SCENE_VIEW_STATE_FEATURE_INVALID}}))}class ce{constructor(e){this.flyToOptions=e}build(){return this.flyToOptions}}class le{withItemId(e){return new ce({flyTo:{type:"internal",data:e}})}withSuppliedId(e){return new ce({flyTo:{type:"supplied",data:e}})}withCamera(e){return new ce({flyTo:{type:"camera",data:e}})}withBoundingBox(e){return new ce({flyTo:{type:"bounding-box",data:e}})}build(){return this.flyToOptions}}class de{constructor(e,t,s,n,i,r){this.stream=e;this.aspect=t;this.data=s;this.boundingBox=n;this.decodeFrame=i;this.flyToOptions=r;this.hasInitiallyValidFrameCamera=B(s)}fitToBoundingBox(e){return this.flyTo({boundingBox:e})}signedDistanceToBoundingBoxCenter(e){const{position:t,viewVector:s}=q(this.data);const n=x.center(e!==null&&e!==void 0?e:this.boundingBox);const i=y.subtract(n,t);return y.dot(s,i)/y.magnitude(s)}flyTo(e){if(typeof e!=="function"){const t=this.buildFlyToType(e);return this.updateFlyToOptions({flyTo:t})}else{return this.updateFlyToOptions(e(new le).build())}}viewAll(){return this.fitToBoundingBox(this.boundingBox)}async render(e={}){var t,n,i,r;if(this.flyToOptions==null&&e.animation){this.flyToOptions={flyTo:{type:"camera",data:this.data}}}try{(t=e.correlationId)!==null&&t!==void 0?t:e.correlationId=s.create();if(this.flyToOptions!=null){const t=ae(e.correlationId,this.flyToOptions,e.animation,this.toFrameCamera(),this.hasInitiallyValidFrameCamera&&e.skipCameraValidation);const s=await this.stream.flyTo(t,true);return new X(this.stream,this.decodeFrame,{correlationId:e.correlationId,animationId:((i=(n=s.flyTo)===null||n===void 0?void 0:n.animationId)===null||i===void 0?void 0:i.hex)||undefined},((r=e.animation)===null||r===void 0?void 0:r.milliseconds)!=null?e.animation.milliseconds+$:undefined)}else{this.stream.replaceCamera({camera:V(this.data),frameCorrelationId:{value:e.correlationId}});return new X(this.stream,this.decodeFrame,{correlationId:e.correlationId})}}catch(e){console.warn("Error when performing render: ",e);throw e}}rotateAroundAxis(e,t){return this.rotateAroundAxisAtPoint(e,this.data.lookAt,t)}alignTo(e,t){const s=y.normalize(y.cross(this.up,y.normalize(this.viewVector)));const n=y.normalize(y.cross(y.normalize(this.viewVector),s));const i=y.angleTo(t,n)>Math.PI/2?y.negate(n):n;const r=y.isEqual(i,t)?s:y.normalize(y.cross(i,t));const a=y.multiplyByTransformMatrixRowMajor(this.viewVector,g.makeRotation(I.fromAxisAngle(r,y.angleTo(t,i))));const o=b.create({origin:e,direction:y.normalize(a)});const u=b.at(o,y.magnitude(this.viewVector));return this.update({position:e,lookAt:u,up:t})}standardView(e){return this.update({position:e.position,viewVector:y.subtract(y.origin(),e.position),lookAt:y.origin(),up:e.up})}standardViewFixedLookAt(e){const t=b.create({origin:this.lookAt,direction:y.normalize(e.position)});const s=b.at(t,y.magnitude(this.viewVector));return this.update({up:e.up,position:s,viewVector:y.subtract(this.lookAt,s)})}buildFlyToType(e){if(e.boundingBox!=null){return{type:"bounding-box",data:e.boundingBox}}else if(e.camera!=null){return{type:"camera",data:e.camera}}else if(e.itemId!=null){return{type:"internal",data:e.itemId}}else if(e.itemSuppliedId!=null){return{type:"supplied",data:e.itemSuppliedId}}else if(e.sceneItemQueryExpression!=null){return{type:"scene-item-query",data:e.sceneItemQueryExpression}}else{throw new Error("Fly to must specify at least one option.")}}computeClippingPlanes(e){return C(this.boundingBox,e)}}class pe extends de{constructor(e,t,s,n,i,r){super(e,t,s,n,i,r);this.perspectiveData=s}moveBy(e){return this.update({position:y.add(this.position,e),lookAt:y.add(this.lookAt,e)})}rotateAroundAxisAtPoint(e,t,s){return this.update({position:y.rotateAboutAxis(e,this.position,s,t),lookAt:y.rotateAboutAxis(e,this.lookAt,s,t),up:y.rotateAboutAxis(e,this.up,s,y.origin())})}update(e){var t;const s=(t=e.fovY)!==null&&t!==void 0?t:this.fovY;return new pe(this.stream,this.aspect,{...this.perspectiveData,...e,fovY:s},this.boundingBox,this.decodeFrame,this.flyToOptions)}toFrameCamera(){var e;return new T(this.position,this.lookAt,this.up,this.near,this.far,this.aspectRatio,(e=this.fovY)!==null&&e!==void 0?e:45)}get viewVector(){return y.subtract(this.lookAt,this.position)}get position(){return{...this.perspectiveData.position}}get up(){return{...this.perspectiveData.up}}get lookAt(){return{...this.perspectiveData.lookAt}}get fovY(){return this.perspectiveData.fovY}get aspectRatio(){return this.aspect}get near(){const{near:e}=this.computeClippingPlanes(this.perspectiveData);return e}get far(){const{far:e}=this.computeClippingPlanes(this.perspectiveData);return e}updateFlyToOptions(e){return new pe(this.stream,this.aspect,this.perspectiveData,this.boundingBox,this.decodeFrame,e)}}class we extends de{constructor(e,t,s,n,i,r){super(e,t,s,n,i,r);this.orthographicData=s}moveBy(e){const t=y.add(this.lookAt,e);return this.update({lookAt:t,rotationPoint:t})}rotateAroundAxisAtPoint(e,t,s){const n=y.rotateAboutAxis(e,this.lookAt,s,t);const i=y.rotateAboutAxis(e,this.position,s,t);const r=E(y.subtract(n,i),m.create(this.boundingBox));return this.update({viewVector:r,lookAt:n,up:y.rotateAboutAxis(e,this.up,s,y.origin())})}update(e){return new we(this.stream,this.aspect,{...this.orthographicData,...e},this.boundingBox,this.decodeFrame,this.flyToOptions)}toFrameCamera(){const e=m.create(this.boundingBox);const t=E(this.viewVector,e);const s=A(this.lookAt,t,e.center);return new k(t,s,this.up,this.near,this.far,this.aspectRatio,this.fovHeight,this.rotationPoint)}get viewVector(){return{...this.orthographicData.viewVector}}get position(){return y.add(this.lookAt,y.negate(this.viewVector))}get rotationPoint(){const e=this.orthographicData.rotationPoint;if(e!=null){return e}else{return undefined}}get up(){return{...this.orthographicData.up}}get lookAt(){return{...this.orthographicData.lookAt}}get fovHeight(){return this.orthographicData.fovHeight}get aspectRatio(){return this.aspect}get near(){const{near:e}=this.computeClippingPlanes(this.orthographicData);return e}get far(){const{far:e}=this.computeClippingPlanes(this.orthographicData);return e}updateFlyToOptions(e){return new we(this.stream,this.aspect,this.orthographicData,this.boundingBox,this.decodeFrame,e)}}class ve{constructor(e,t){this.stream=e;this.data=t}async update(e){const t=await this.stream.updateCrossSectioning({crossSectioning:{sectionPlanes:e.sectionPlanes,highlightColor:e.highlightColor,lineWidth:(e===null||e===void 0?void 0:e.lineWidth)!=null?{value:e.lineWidth}:null}},true);return t.updateCrossSectioning||undefined}current(){return this.data}}class fe{constructor(e=[]){this.operations=e}build(){return this.operations.concat()}materialOverride(e){return new fe(this.operations.concat([{type:"change-material",material:e}]))}show(){return new fe(this.operations.concat([{type:"show"}]))}hide(){return new fe(this.operations.concat([{type:"hide"}]))}select(){return new fe(this.operations.concat([{type:"select"}]))}deselect(){return new fe(this.operations.concat([{type:"deselect"}]))}clearMaterialOverrides(){return new fe(this.operations.concat([{type:"clear-override"}]))}transform(e){return new fe(this.operations.concat([{type:"change-transform",transform:e}]))}clearTransforms(e=true){return new fe(this.operations.concat([{type:"clear-transform",cascade:e}]))}setPhantom(e){return new fe(this.operations.concat([{type:"change-phantom",phantomState:e}]))}clearPhantom(){return new fe(this.operations.concat([{type:"clear-phantom"}]))}setEndItem(e){return new fe(this.operations.concat([{type:"change-end-item",endItemState:e}]))}clearEndItem(){return new fe(this.operations.concat([{type:"clear-end-item"}]))}viewRenditionById(e){return new fe(this.operations.concat([{type:"view-rendition-by-id",id:e}]))}viewRenditionBySuppliedId(e){return new fe(this.operations.concat([{type:"view-rendition-by-supplied-id",suppliedId:e}]))}viewDefaultRendition(){return new fe(this.operations.concat([{type:"view-default-rendition"}]))}clearRendition(){return new fe(this.operations.concat([{type:"clear-rendition"}]))}viewRepresentation(e){return new fe(this.operations.concat({type:"view-representation",id:e}))}clearRepresentation(){return new fe(this.operations.concat({type:"clear-representation"}))}}class ye{constructor(e=[]){this.operations=e}build(){return this.operations.concat()}show(){return new ye(this.operations.concat([{type:"show"}]))}hide(){return new ye(this.operations.concat([{type:"hide"}]))}select(){return new ye(this.operations.concat([{type:"select"}]))}deselect(){return new ye(this.operations.concat([{type:"deselect"}]))}}class me{constructor(e,t){this.stream=e;this.imageScaleProvider=t}async hitItems(e,t){const s=this.imageScaleProvider();const n=await this.stream.hitItems({point:S.scale(e,(s===null||s===void 0?void 0:s.x)||1,(s===null||s===void 0?void 0:s.y)||1),includeMetadata:t===null||t===void 0?void 0:t.includeMetadata},true);return n.hitItems||undefined}}const xe=1e3*30;class ge{constructor(e,t,s,n){this.onFrameDrawn=new G(e,(e=>{var t,n,i;return!!((i=(n=(t=e.request)===null||t===void 0?void 0:t.drawFrame)===null||n===void 0?void 0:n.frameCorrelationIds)===null||i===void 0?void 0:i.some((e=>e===s)))}),(e=>{var s;return((s=e.request)===null||s===void 0?void 0:s.drawFrame)!=null?t(e.request.drawFrame):undefined}),n!==null&&n!==void 0?n:xe)}}class Ie{constructor(e,t,s,n,i){this.stream=e;this.decodeFrame=t;this.encodeCameraType=s;this.sceneId=n;this.sceneViewId=i}async applySceneViewState(e,t={}){const s=ee(e);await this.animateToSceneViewState(s,t);return await this.stream.loadSceneViewState({...s,frameCorrelationId:t.suppliedCorrelationId?{value:t.suppliedCorrelationId}:undefined,cameraType:t.cameraTypeOverride?this.encodeCameraType(t.cameraTypeOverride):undefined},true)}async applyPartialSceneViewState(e,t,s={}){const n=ee(e);const i=he(t);if(t.includes("camera")){await this.animateToSceneViewState(n,s)}return await this.stream.loadSceneViewState({...n,frameCorrelationId:s.suppliedCorrelationId?{value:s.suppliedCorrelationId}:undefined,sceneViewStateFeatureSubset:i,cameraType:s.cameraTypeOverride?this.encodeCameraType(s.cameraTypeOverride):undefined},true)}async animateToSceneViewState(e,t){var n,i,r;if(t.animation!=null){const a=s.create();const o=await this.stream.flyTo({sceneViewStateIdentifier:e,animation:{duration:M(t.animation.milliseconds)},frameCorrelationId:{value:a}},true);if(t.waitForAnimation==null||t.waitForAnimation){const e=new X(this.stream,this.decodeFrame,{animationId:(r=(i=(n=o.flyTo)===null||n===void 0?void 0:n.animationId)===null||i===void 0?void 0:i.hex)!==null&&r!==void 0?r:undefined,correlationId:a},t.animation.milliseconds+$);await e.onAnimationCompleted.once()}}}}class be{constructor(e,t){this.query=e;this.builder=t!==null&&t!==void 0?t:new fe}isItemBuilder(){return true}isAnnotationBuilder(){return false}materialOverride(e){if(typeof e==="string"){return new be(this.query,this.builder.materialOverride(U(e)))}else{return new be(this.query,this.builder.materialOverride(e))}}hide(){return new be(this.query,this.builder.hide())}show(){return new be(this.query,this.builder.show())}select(){return new be(this.query,this.builder.select())}deselect(){return new be(this.query,this.builder.deselect())}clearMaterialOverrides(){return new be(this.query,this.builder.clearMaterialOverrides())}transform(e){if(Array.isArray(e)){if(e.length!==16){throw new a("Matrix provided must contain exactly 16 values (4x4).")}return new be(this.query,this.builder.transform({r0:{x:e[0],y:e[1],z:e[2],w:e[3]},r1:{x:e[4],y:e[5],z:e[6],w:e[7]},r2:{x:e[8],y:e[9],z:e[10],w:e[11]},r3:{x:e[12],y:e[13],z:e[14],w:e[15]}}))}else{return new be(this.query,this.builder.transform(e))}}clearTransforms(e=true){return new be(this.query,this.builder.clearTransforms(e))}setPhantom(e){return new be(this.query,this.builder.setPhantom(e))}clearPhantom(){return new be(this.query,this.builder.clearPhantom())}setEndItem(e){return new be(this.query,this.builder.setEndItem(e))}clearEndItem(){return new be(this.query,this.builder.clearEndItem())}viewRenditionById(e){return new be(this.query,this.builder.viewRenditionById(e))}viewRenditionBySuppliedId(e){return new be(this.query,this.builder.viewRenditionBySuppliedId(e))}viewDefaultRendition(){return new be(this.query,this.builder.viewDefaultRendition())}clearRendition(){return new be(this.query,this.builder.clearRendition())}viewRepresentation(e){return new be(this.query,this.builder.viewRepresentation(e))}clearRepresentation(){return new be(this.query,this.builder.clearRepresentation())}build(){return{query:this.query,operations:this.builder.build()}}}class Se{constructor(e,t){this.query=e;this.builder=t!==null&&t!==void 0?t:new ye}isItemBuilder(){return false}isAnnotationBuilder(){return true}hide(){return new Se(this.query,this.builder.hide())}show(){return new Se(this.query,this.builder.show())}select(){return new Se(this.query,this.builder.select())}deselect(){return new Se(this.query,this.builder.deselect())}build(){return{query:this.query,operations:this.builder.build()}}}class Re{constructor(e,t,s,n,i,r){this.sceneViewId=e;this.stream=t;this.decodeFrame=s;this.dimensions=n;this.sceneItemQueryOperations=i;this.pmiAnnotationQueryOperations=r}async execute(e){var t;const n=this.sceneItemQueryOperations.map((e=>ne(e.query,e.operations,{dimensions:this.dimensions})));const i=this.pmiAnnotationQueryOperations.map((e=>ie(e.query,e.operations)));const r=(t=e===null||e===void 0?void 0:e.suppliedCorrelationId)!==null&&t!==void 0?t:s.create();const a={sceneViewId:{hex:this.sceneViewId},elementOperations:[...n,...i],suppliedCorrelationId:{value:r}};await this.stream.createSceneAlteration(a)}}class Be extends Re{async execute(e){var t;if(e===null||e===void 0?void 0:e.awaitCorrelatedFrame){const n=(t=e.suppliedCorrelationId)!==null&&t!==void 0?t:s.create();const i=new ge(this.stream,this.decodeFrame,n);await super.execute({...e,suppliedCorrelationId:n});await i.onFrameDrawn.once()}else{await super.execute(e)}}}class Ve extends Re{async execute(e){var t;if(e===null||e===void 0?void 0:e.skipAwaitCorrelatedFrame){await super.execute(e)}else{const n=(t=e===null||e===void 0?void 0:e.suppliedCorrelationId)!==null&&t!==void 0?t:s.create();const i=new ge(this.stream,this.decodeFrame,n);await super.execute({...e,suppliedCorrelationId:n});await i.onFrameDrawn.once()}}}class Ee{constructor(e,t,s,n,i,r,a,o){this.stream=e;this.frame=t;this.decodeFrame=s;this.encodeCameraType=n;this.imageScaleProvider=i;this.dimensions=r;this.sceneId=a;this.sceneViewId=o;this.sceneViewStateLoader=new Ie(e,s,n,a,o)}async applySceneViewState(e,t={}){return await this.sceneViewStateLoader.applySceneViewState(e,t)}async applyPartialSceneViewState(e,t,s={}){return await this.sceneViewStateLoader.applyPartialSceneViewState(e,t,s)}async reset(e={}){return await this.stream.resetSceneView({includeCamera:e.includeCamera,frameCorrelationId:e.suppliedCorrelationId?{value:e.suppliedCorrelationId}:undefined,cameraType:e.cameraTypeOverride?this.encodeCameraType(e.cameraTypeOverride):undefined},true)}items(e){const t=e(new Je);const s=Array.isArray(t)?t:[t];const n=s.filter((e=>e.isItemBuilder()));const i=n.reduce(((e,t)=>e.concat(t.build())),[]);return new Be(this.sceneViewId,this.stream,this.decodeFrame,this.dimensions,i,[])}elements(e){const t=e(new Qe);const s=Array.isArray(t)?t:[t];const n=s.filter((e=>e.isItemBuilder()));const i=n.reduce(((e,t)=>e.concat(t.build())),[]);const r=s.filter((e=>e.isAnnotationBuilder()));const a=r.reduce(((e,t)=>e.concat(t.build())),[]);return new Ve(this.sceneViewId,this.stream,this.decodeFrame,this.dimensions,i,a)}camera(){const{scene:e}=this.frame;if(e.camera.isOrthographic()){return new we(this.stream,R.aspectRatio(this.viewport()),{viewVector:e.camera.viewVector,lookAt:e.camera.lookAt,up:e.camera.up,fovHeight:e.camera.fovHeight,rotationPoint:e.camera.lookAt},this.frame.scene.boundingBox,this.decodeFrame)}else if(e.camera.isPerspective()){return new pe(this.stream,R.aspectRatio(this.viewport()),{position:e.camera.position,lookAt:e.camera.lookAt,up:e.camera.up,fovY:e.camera.fovY},this.frame.scene.boundingBox,this.decodeFrame)}else{throw new r("Cannot retrieve camera. Scene has an unknown or invalid camera type.")}}isOrthographic(){const{scene:e}=this.frame;return e.camera.isOrthographic()}boundingBox(){return this.frame.scene.boundingBox}crossSectioning(){return new ve(this.stream,this.frame.scene.crossSection)}raycaster(){return new me(this.stream,this.imageScaleProvider)}viewport(){return this.frame.dimensions}scale(){return this.imageScaleProvider()||S.create(1,1)}}class Ae{constructor(e){this.inverted=e}build(){if(this.inverted){return{type:"not",query:this.queryExpressionBuilder()}}else{return this.queryExpressionBuilder()}}}class ke{constructor(e=false){this.inverted=e}all(){return new Pe}not(){return new Te(!this.inverted)}withItemIds(e){return new Fe(e,"item-id",this.inverted)}withSuppliedIds(e){return new Fe(e,"supplied-id",this.inverted)}withItemId(e){return new ze({type:"item-id",value:e},this.inverted)}withSuppliedId(e){return new ze({type:"supplied-id",value:e},this.inverted)}withSceneTreeRange(e){return new Me(e,this.inverted)}withMetadata(e,t,s,n){return new Oe(e,t,s,this.inverted,n)}withSelected(){return new De(this.inverted)}withVisible(){return new _e(this.inverted)}withPoint(e){return new Ue(e,this.inverted)}withVolumeIntersection(e,t){return new je(e,this.inverted,t)}}class Te extends ke{constructor(e){super(e)}}class qe{constructor(e=false){this.inverted=e}all(){return new Pe}not(){return new Ce(!this.inverted)}withAnnotationIds(e){return new Fe(e,"annotation-id",this.inverted)}withAnnotationId(e){return new Le({type:"annotation-id",value:e},this.inverted)}}class Ce extends qe{constructor(e){super(e)}}class Pe extends Ae{constructor(e=false){super(e)}queryExpressionBuilder(){return{type:"all"}}}class Me extends Ae{constructor(e,t){super(t);this.range=e}queryExpressionBuilder(){return{type:"scene-tree-range",range:this.range}}}class Oe extends Ae{constructor(e,t,s,n,i){super(n);this.filter=e;this.keys=t;this.exactMatch=s;this.removeHiddenItems=i}queryExpressionBuilder(){return{type:"metadata",filter:this.filter,keys:this.keys,exactMatch:this.exactMatch,removeHiddenItems:this.removeHiddenItems}}}class De extends Ae{constructor(e){super(e)}queryExpressionBuilder(){return{type:"all-selected"}}}class _e extends Ae{constructor(e){super(e)}queryExpressionBuilder(){return{type:"all-visible"}}}class Ue extends Ae{constructor(e,t){super(t);this.point=e}queryExpressionBuilder(){return{type:"point",point:this.point}}}class je extends Ae{constructor(e,t,s){super(t);this.rectangle=e;this.exclusive=s}queryExpressionBuilder(){return{type:"volume-intersection",rectangle:this.rectangle,exclusive:!!this.exclusive}}}class Fe extends Ae{constructor(e,t,s){super(s);this.ids=e;this.type=t}queryExpressionBuilder(){return{type:"or",expressions:this.ids.map((e=>({type:this.type,value:e})))}}}class ze extends Ae{constructor(e,t){super(t);this.query=e}queryExpressionBuilder(){return{...this.query}}and(){return new He([this.query],this.inverted)}or(){return new Ne([this.query],this.inverted)}}class Ne extends Ae{constructor(e,t){super(t);this.expressions=e}queryExpressionBuilder(){return{type:"or",expressions:[...this.expressions]}}withItemId(e){return new Ne([...this.expressions,{type:"item-id",value:e}],this.inverted)}withSuppliedId(e){return new Ne([...this.expressions,{type:"supplied-id",value:e}],this.inverted)}or(){return this}}class He extends Ae{constructor(e,t){super(t);this.expressions=e}queryExpressionBuilder(){return{type:"and",expressions:[...this.expressions]}}withItemId(e){return new He([...this.expressions,{type:"item-id",value:e}],this.inverted)}withSuppliedId(e){return new He([...this.expressions,{type:"supplied-id",value:e}],this.inverted)}and(){return this}}class Le extends Ae{constructor(e,t){super(t);this.query=e}queryExpressionBuilder(){return{...this.query}}and(){return new Ye([this.query],this.inverted)}or(){return new Ke([this.query],this.inverted)}}class Ke extends Ae{constructor(e,t){super(t);this.expressions=e}queryExpressionBuilder(){return{type:"or",expressions:[...this.expressions]}}withAnnotationId(e){return new Ke([...this.expressions,{type:"annotation-id",value:e}],this.inverted)}or(){return this}}class Ye extends Ae{constructor(e,t){super(t);this.expressions=e}queryExpressionBuilder(){return{type:"and",expressions:[...this.expressions]}}withAnnotationId(e){return new Ye([...this.expressions,{type:"annotation-id",value:e}],this.inverted)}and(){return this}}class Qe{get items(){return new Je}get annotations(){return new Ze}}class Ze{where(e){const t=e(new qe).build();return new Se(t)}}class Je{where(e){const t=e(new ke).build();return new be(t)}}export{de as C,fe as I,J as M,Se as P,me as R,Ee as S,ve as a,Ze as b,j as c,ke as d,Qe as e,Ve as f,be as g,Je as h,Be as i,Q as j,W as k,H as l,D as m,F as n,Y as s,Z as t};
|
|
5
|
-
//# sourceMappingURL=p-Cku0WCYo.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Vertex Software LLC. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import{a as t,v as e,f as n,p as r,r as o,g as s,l as i,b as c,m as a,e as u,c as l,i as f,j as h}from"./p-2UsvOTHJ.js";import{v as d,p as m,L as p}from"./p-5kcpg4MZ.js";import{m as v,c as w,b as y}from"./p-CDM7zNn0.js";import{g}from"./p-CG9AChtV.js";const b=v.defineMapper((t=>{switch(t){case"perspective":return d.protobuf.stream.CameraType.CAMERA_TYPE_PERSPECTIVE;case"orthographic":return d.protobuf.stream.CameraType.CAMERA_TYPE_ORTHOGRAPHIC;default:return d.protobuf.stream.CameraType.CAMERA_TYPE_INVALID}}),(t=>t));function C(){return v.ifInvalidThrow(b)}const x=v.defineMapper(v.read(v.requiredProp("r"),v.requiredProp("g"),v.requiredProp("b"),v.requiredProp("a")),(([t,e,n,r])=>w.create(t,e,n,r)));const k=v.defineMapper(v.read(v.requiredProp("msb"),v.requiredProp("lsb")),(([t,e])=>y.fromMsbLsb(t,e)));const F=v.defineMapper(v.read(v.requiredProp("seconds"),v.requiredProp("nanos")),(([t,e])=>m({seconds:t,nanos:e})));const M=v.defineMapper(v.read(v.requiredProp("iso")),(([t])=>new Date(t)));const S=v.defineMapper(v.read(v.requiredProp("hex")),(([t])=>t));const E=v.defineMapper(v.read(v.requiredProp("msb"),v.requiredProp("lsb")),(([t,e])=>{const n=BigInt(typeof t==="number"?t:t.toString());const r=BigInt(typeof e==="number"?e:e.toString());return y.fromMsbLsb(n,r)}));const I=v.defineMapper(v.compose((t=>y.toMsbLsb(t)),v.read(v.mapProp("msb",p.fromString),v.mapProp("lsb",p.fromString))),(([t,e])=>({msb:t,lsb:e})));function P(t){"@babel/helpers - typeof";return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function j(t){if(t===null||t===true||t===false){return NaN}var e=Number(t);if(isNaN(e)){return e}return e<0?Math.ceil(e):Math.floor(e)}function N(t,e){if(e.length<t){throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}}function T(t){N(1,arguments);var e=Object.prototype.toString.call(t);if(t instanceof Date||P(t)==="object"&&e==="[object Date]"){return new Date(t.getTime())}else if(typeof t==="number"||e==="[object Number]"){return new Date(t)}else{if((typeof t==="string"||e==="[object String]")&&typeof console!=="undefined"){console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");console.warn((new Error).stack)}return new Date(NaN)}}function O(t,e){N(2,arguments);var n=T(t);var r=j(e);if(isNaN(r)){return new Date(NaN)}if(!r){return n}n.setDate(n.getDate()+r);return n}function D(t,e){N(2,arguments);var n=T(t);var r=j(e);if(isNaN(r)){return new Date(NaN)}if(!r){return n}var o=n.getDate();var s=new Date(n.getTime());s.setMonth(n.getMonth()+r+1,0);var i=s.getDate();if(o>=i){return s}else{n.setFullYear(s.getFullYear(),s.getMonth(),o);return n}}function A(t,e){N(2,arguments);if(!e||P(e)!=="object")return new Date(NaN);var n=e.years?j(e.years):0;var r=e.months?j(e.months):0;var o=e.weeks?j(e.weeks):0;var s=e.days?j(e.days):0;var i=e.hours?j(e.hours):0;var c=e.minutes?j(e.minutes):0;var a=e.seconds?j(e.seconds):0;var u=T(t);var l=r||n?D(u,r+n*12):u;var f=s||o?O(l,s+o*7):l;var h=c+i*60;var d=a+h*60;var m=d*1e3;var p=new Date(f.getTime()+m);return p}function V(t,e){N(2,arguments);return T(t).getTime()-T(e).getTime()}function z(t,e){N(2,arguments);var n=T(t);var r=T(e);return n.getTime()>r.getTime()}function B(t,e){N(2,arguments);var n=j(e);return O(t,-n)}function R(t,e){N(2,arguments);var n=j(e);return D(t,-n)}function W(t,e){N(2,arguments);if(!e||P(e)!=="object")return new Date(NaN);var n=e.years?j(e.years):0;var r=e.months?j(e.months):0;var o=e.weeks?j(e.weeks):0;var s=e.days?j(e.days):0;var i=e.hours?j(e.hours):0;var c=e.minutes?j(e.minutes):0;var a=e.seconds?j(e.seconds):0;var u=R(t,r+n*12);var l=B(u,s+o*7);var f=c+i*60;var h=a+f*60;var d=h*1e3;var m=new Date(l.getTime()-d);return m}class ${constructor(t,e,n){this.token=t;this.expiresIn=e;this.expiresAt=n}static create(t,e){const n=A(new Date,{seconds:e});return new $(t,e,n)}hasExpired(){return z(new Date,this.expiresAt)}remainingTimeInMs(t){return V(W(this.expiresAt,{seconds:t}),new Date)}}function _(t){if(G(t)){const n=q(t.lookAt);const r=q(t.position);const o=U(t.up);const s=n&&r&&U(e.subtract(t.lookAt,t.position));const i=t.fovY!=null&&Number.isFinite(t.fovY)&&t.fovY>=1&&t.fovY<=179;return o&&s&&i}else{const e=t;const n=U(e.viewVector);const r=q(e.lookAt);const o=U(e.up);const s=Number.isFinite(e.fovHeight)&&e.fovHeight>0;return n&&r&&o&&s}}function q(t){return t!=null&&e.isValid(t)}function U(t){return q(t)&&!e.isZeroVector(t)}function G(t){return t.position!=null&&t.fovHeight==null}function L(t){const e=t;return e.viewVector!=null&&e.fovHeight!=null}function H(t){if(L(t)){return{...t,position:e.add(t.lookAt,e.negate(t.viewVector))}}else{return{...t,viewVector:e.subtract(t.lookAt,t.position)}}}function Y(t={}){var n,r,o,s;return{position:(n=t.position)!==null&&n!==void 0?n:e.forward(),lookAt:(r=t.lookAt)!==null&&r!==void 0?r:e.origin(),up:(o=t.up)!==null&&o!==void 0?o:e.up(),fovY:(s=t.fovY)!==null&&s!==void 0?s:45}}function J(t={}){var n,r,o,s,i,c;return{viewVector:(n=t.viewVector)!==null&&n!==void 0?n:e.back(),lookAt:(r=t.lookAt)!==null&&r!==void 0?r:e.origin(),up:(o=t.up)!==null&&o!==void 0?o:e.up(),fovHeight:(s=t.fovHeight)!==null&&s!==void 0?s:1,rotationPoint:(c=(i=t.rotationPoint)!==null&&i!==void 0?i:t.lookAt)!==null&&c!==void 0?c:e.origin()}}function Q(r,o){var s;const i=e.subtract(r.lookAt,r.position);const c=n.create(o);const a=c.radius/e.magnitude(i);return{viewVector:e.scale(a,i),up:r.up,lookAt:r.lookAt,fovHeight:2*e.magnitude(i)*Math.tan(t.toRadians(((s=r.fovY)!==null&&s!==void 0?s:45)/2))}}function Z(n,r=45){const o=n.fovHeight/(2*Math.tan(t.toRadians(r/2)));const s=e.magnitude(n.viewVector);const i=o/s;return{position:e.add(n.lookAt,e.negate(e.scale(i,n.viewVector))),up:n.up,lookAt:n.lookAt,fovY:r}}function K(t){if(L(t)){return{orthographic:{viewVector:{...t.viewVector},lookAt:{...t.lookAt},up:{...t.up},fovHeight:t.fovHeight}}}else if(G(t)){return{perspective:{position:{...t.position},lookAt:{...t.lookAt},up:{...t.up},fovY:t.fovY?{value:t.fovY}:null},position:{...t.position},lookAt:{...t.lookAt},up:{...t.up}}}else{return{...t}}}var X=Object.freeze({__proto__:null,createOrthographic:J,createPerspective:Y,isOrthographicFrameCamera:L,isPerspectiveFrameCamera:G,isValidFrameCamera:_,toOrthographic:Q,toPerspective:Z,toProtobuf:K,withPositionAndViewVector:H});function tt(t,e){return L(e)?nt(t):et(t,e)}function et(t,r){const o=n.create(t);const s=o.epsilon*100;const i=e.dot(e.subtract(o.center,r.position),e.normalize(e.subtract(r.lookAt,r.position)));const c=Math.max(o.radius,s);let a=c+i<s?c*3:c+i;let u=a-c*2<s?Math.min(s,a):a-c*2;if(a-u<s){u=Math.max(u,s);a+=u+s}else if(u/a<1e-4){u=a*1e-4}if(u>a-c*2){if(u>1e3+s){a-=u-1e3;u=1e3}}return{near:u,far:a}}function nt(t,e){const r=n.create(t);const o=r.epsilon*100;const s=Math.max(r.radius,o);return{near:-s,far:s}}function rt(t={}){return{sectionPlanes:t.sectionPlanes||[],highlightColor:t.highlightColor,lineWidth:t.lineWidth}}var ot=Object.freeze({__proto__:null,create:rt});function st(t={}){return{modelViewId:t.modelViewId,sceneItemId:t.sceneItemId}}function it(t={}){return{visibleSummary:t.visibleSummary,selectedVisibleSummary:t.selectedVisibleSummary}}function ct(t,e){return at(t.scene.sceneViewSummary)?t.copy({scene:t.scene.copy({sceneViewSummary:e===null||e===void 0?void 0:e.scene.sceneViewSummary})}):t}function at(t){return t.visibleSummary==null}class ut{constructor(t,e,n){this.camera=t;this.imageAttr=e;this.pixels=n}static fromPng(t,e,n){if(t.data instanceof Uint16Array){return new ut(e,n,t.data)}else{throw new Error("Expected depth PNG to have depth of 16-bit")}}getDepthAtPoint(t,e){const{near:n,far:r}=this.camera;const o=this.camera.isPerspective();const s=this.getNormalizedDepthAtPoint(t,e);if(o){return s*(r-n)+n}else{return s*(r-n)}}getMaxDepthOfGeometry(){const{near:t,far:e}=this.camera;const n=this.camera.isPerspective();if(n){return e}else{return e-t}}getNormalizedDepthAtPoint(t,e){const{width:n,height:o}=this.imageAttr.imageRect;const s=r.subtract(t,this.imageAttr.imageRect);const i=1/this.imageAttr.imageScale;const c=r.scale(s,i,i);if(c.x>=0&&c.y>=0&&c.x<n&&c.y<o){const t=Math.floor(c.x)+Math.floor(c.y)*n;const r=this.pixels[t];const o=r===ut.MAX_DEPTH_VALUE?e!==null&&e!==void 0?e:r:r;return(o!==null&&o!==void 0?o:ut.MAX_DEPTH_VALUE)/ut.MAX_DEPTH_VALUE}else{return e!==null&&e!==void 0?e:1}}hitTest(t){return this.getNormalizedDepthAtPoint(t)<1}getWorldPoint(t,n,r){const s=this.getDepthAtPoint(t,r);const i=this.camera.isPerspective();if(i){const{position:t,viewVector:r,far:i}=this.camera;const c=o.at(n,i);const a=e.subtract(c,t);const u=e.dot(r,a)/(e.magnitude(r)*e.magnitude(a));return o.at(n,s/u)}else{return o.at(n,s)}}distanceToPoint(t){const{position:n,direction:r}=this.camera;const o=e.subtract(t,n);return Math.abs(e.dot(o,r))}depthOfClosestGeometry(t,e){const{projectionViewMatrix:n}=this.camera;const r=e.transformWorldToViewport(t,n);const o=e.transformPointToFrame(r,this);return this.getDepthAtPoint(o)}isOccluded(t,e){const n=this.distanceToPoint(t);const r=this.depthOfClosestGeometry(t,e);const o=Math.abs(.02*n);const s=Math.abs(r-n);return n>r&&s>o}isDetached(t,e){const n=this.distanceToPoint(t);const r=this.depthOfClosestGeometry(t,e);const o=r-n;const s=.02*n;const i=o<s;const c=this.getMaxDepthOfGeometry();const a=n>c;const u=!i||a;return u}}ut.MAX_DEPTH_VALUE=2**16-1;class lt{constructor(t){this.scale=t}convertTo(t){return t*this.scale}convertFrom(t){return t/this.scale}}class ft extends lt{constructor(){super(1)}}class ht extends lt{constructor(t=1){super(1/Math.pow(10,t))}}class dt extends lt{constructor(t=1){super(1/Math.pow(1e3,t))}}class mt extends lt{constructor(t=1){super(1/Math.pow(25.4,t))}}class pt extends lt{constructor(t=1){super(1/Math.pow(25.4*12,t))}}class vt extends lt{constructor(t=1){super(1/Math.pow(25.4*12*3,t))}}class wt{constructor(t){this.unitType=t;this.unit=wt.units[t]}convertWorldValueToReal(t){return this.unit.converter.convertTo(t)}convertRealValueToWorld(t){return this.unit.converter.convertFrom(t)}convertWorldPointToReal(t){const e=this.unit.converter.convertTo(t.x);const n=this.unit.converter.convertTo(t.y);const r=this.unit.converter.convertTo(t.z);return{x:e,y:n,z:r}}convertRealPointToWorld(t){const e=this.unit.converter.convertFrom(t.x);const n=this.unit.converter.convertFrom(t.y);const r=this.unit.converter.convertFrom(t.z);return{x:e,y:n,z:r}}}wt.units={millimeters:{name:"Millimeters",abbreviatedName:"mm",converter:new ft},centimeters:{name:"Centimeters",abbreviatedName:"cm",converter:new ht},meters:{name:"Meters",abbreviatedName:"m",converter:new dt},inches:{name:"Inches",abbreviatedName:"in",converter:new mt},feet:{name:"Feet",abbreviatedName:"ft",converter:new pt},yards:{name:"Yards",abbreviatedName:"yd",converter:new vt}};class yt{convertTo(e){return t.toDegrees(e)}convertFrom(e){return t.toRadians(e)}}class gt{constructor(t){this.unitType=t;this.unit=gt.units[t]}convertTo(t){return this.unit.converter.convertTo(t)}convertFrom(t){return this.unit.converter.convertFrom(t)}}gt.units={radians:{name:"Radians",abbreviatedName:"rad",converter:new lt(1)},degrees:{name:"Degrees",abbreviatedName:"deg",converter:new yt}};class bt{constructor(t){this.unitType=t;this.unit=bt.units[t]}convertWorldValueToReal(t){return this.unit.converter.convertTo(t)}convertRealValueToWorld(t){return this.unit.converter.convertFrom(t)}}bt.units={millimeters:{name:"Square Millimeters",abbreviatedName:"mm²",converter:new ft},centimeters:{name:"Square Centimeters",abbreviatedName:"cm²",converter:new ht(2)},meters:{name:"Square Meters",abbreviatedName:"m²",converter:new dt(2)},inches:{name:"Square Inches",abbreviatedName:"in²",converter:new mt(2)},feet:{name:"Square Feet",abbreviatedName:"ft²",converter:new pt(2)},yards:{name:"Square Yards",abbreviatedName:"yd²",converter:new vt(2)}};var Ct;(function(t){t[t["CROSS_SECTION"]=255]="CROSS_SECTION";t[t["PRECISE_EDGE"]=224]="PRECISE_EDGE";t[t["PRECISE_SURFACE"]=192]="PRECISE_SURFACE";t[t["IMPRECISE_EDGE"]=160]="IMPRECISE_EDGE";t[t["IMPRECISE_SURFACE"]=128]="IMPRECISE_SURFACE";t[t["GENERIC_GEOMETRY"]=96]="GENERIC_GEOMETRY";t[t["NO_GEOMETRY"]=0]="NO_GEOMETRY"})(Ct||(Ct={}));class xt{constructor(t,e){this.pixels=t;this.imageAttr=e}static fromPng(t,e){if(!(t.data instanceof Uint8Array)){throw new Error("Cannot create FeatureMap. Expected decoded PNG to be a Uint8Array.")}else if(t.channels!==4){throw new Error("Cannot create FeatureMap. Missing alpha channel.")}else{return new xt(t.data,{...e,imageRect:s.fromPointAndDimensions(e.imageRect,t)})}}getEntityType(t){const e=this.getColor(t);if((e===null||e===void 0?void 0:e.a)===Ct.CROSS_SECTION){return Ct.CROSS_SECTION}else if((e===null||e===void 0?void 0:e.a)===Ct.GENERIC_GEOMETRY){return Ct.GENERIC_GEOMETRY}else if((e===null||e===void 0?void 0:e.a)===Ct.IMPRECISE_EDGE){return Ct.IMPRECISE_EDGE}else if((e===null||e===void 0?void 0:e.a)===Ct.IMPRECISE_SURFACE){return Ct.IMPRECISE_SURFACE}else if((e===null||e===void 0?void 0:e.a)===Ct.PRECISE_EDGE){return Ct.PRECISE_EDGE}else if((e===null||e===void 0?void 0:e.a)===Ct.PRECISE_SURFACE){return Ct.PRECISE_SURFACE}else{return Ct.NO_GEOMETRY}}getColor(t){const{width:e,height:n}=this.imageAttr.imageRect;const o=r.subtract(t,this.imageAttr.imageRect);const s=1/this.imageAttr.imageScale;const i=r.scale(o,s,s);if(i.x>=0&&i.y>=0&&i.x<e&&i.y<n){const t=Math.floor(i.x)*4+Math.floor(i.y)*4*e;const n=this.pixels[t];const r=this.pixels[t+1];const o=this.pixels[t+2];const s=this.pixels[t+3];return w.create(n,r,o,s)}else return undefined}}let kt;function Ft(){if(!kt){kt=Mt()}return kt}function Mt(){try{throw new Error}catch(t){const e=(""+t.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(e){return St(e[0])}}return"/"}function St(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}const Et=typeof navigator!=="undefined"&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;const It=t=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t);function Pt(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function jt(){if(typeof Worker==="undefined"){return class t{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}}}class t extends Worker{constructor(t,e){var n,r;if(typeof t==="string"&&e&&e._baseURL){t=new URL(t,e._baseURL)}else if(typeof t==="string"&&!It(t)&&Ft().match(/^file:\/\//i)){t=new URL(t,Ft().replace(/\/[^/]+$/,"/"));if((n=e===null||e===void 0?void 0:e.CORSWorkaround)!==null&&n!==void 0?n:true){t=Pt(`importScripts(${JSON.stringify(t)});`)}}if(typeof t==="string"&&It(t)){if((r=e===null||e===void 0?void 0:e.CORSWorkaround)!==null&&r!==void 0?r:true){t=Pt(`importScripts(${JSON.stringify(t)});`)}}super(t,e)}}class e extends t{constructor(t,e){const n=window.URL.createObjectURL(t);super(n,e)}static fromText(t,n){const r=new window.Blob([t],{type:"text/javascript"});return new e(r,n)}}return{blob:e,default:t}}let Nt;function Tt(){if(!Nt){Nt=jt()}return Nt}var Ot={exports:{}};var Dt;var At;function Vt(){if(At)return Dt;At=1;var t=1e3;var e=t*60;var n=e*60;var r=n*24;var o=r*7;var s=r*365.25;Dt=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0){return i(t)}else if(n==="number"&&isFinite(t)){return e.long?a(t):c(t)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function i(i){i=String(i);if(i.length>100){return}var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!c){return}var a=parseFloat(c[1]);var u=(c[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*e;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return undefined}}function c(o){var s=Math.abs(o);if(s>=r){return Math.round(o/r)+"d"}if(s>=n){return Math.round(o/n)+"h"}if(s>=e){return Math.round(o/e)+"m"}if(s>=t){return Math.round(o/t)+"s"}return o+"ms"}function a(o){var s=Math.abs(o);if(s>=r){return u(o,s,r,"day")}if(s>=n){return u(o,s,n,"hour")}if(s>=e){return u(o,s,e,"minute")}if(s>=t){return u(o,s,t,"second")}return o+" ms"}function u(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}return Dt}var zt;var Bt;function Rt(){if(Bt)return zt;Bt=1;function t(t){n.debug=n;n.default=n;n.coerce=a;n.disable=i;n.enable=o;n.enabled=c;n.humanize=Vt();n.destroy=u;Object.keys(t).forEach((e=>{n[e]=t[e]}));n.names=[];n.skips=[];n.formatters={};function e(t){let e=0;for(let n=0;n<t.length;n++){e=(e<<5)-e+t.charCodeAt(n);e|=0}return n.colors[Math.abs(e)%n.colors.length]}n.selectColor=e;function n(t){let e;let o=null;let s;let i;function c(...t){if(!c.enabled){return}const r=c;const o=Number(new Date);const s=o-(e||o);r.diff=s;r.prev=e;r.curr=o;e=o;t[0]=n.coerce(t[0]);if(typeof t[0]!=="string"){t.unshift("%O")}let i=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((e,o)=>{if(e==="%%"){return"%"}i++;const s=n.formatters[o];if(typeof s==="function"){const n=t[i];e=s.call(r,n);t.splice(i,1);i--}return e}));n.formatArgs.call(r,t);const a=r.log||n.log;a.apply(r,t)}c.namespace=t;c.useColors=n.useColors();c.color=n.selectColor(t);c.extend=r;c.destroy=n.destroy;Object.defineProperty(c,"enabled",{enumerable:true,configurable:false,get:()=>{if(o!==null){return o}if(s!==n.namespaces){s=n.namespaces;i=n.enabled(t)}return i},set:t=>{o=t}});if(typeof n.init==="function"){n.init(c)}return c}function r(t,e){const r=n(this.namespace+(typeof e==="undefined"?":":e)+t);r.log=this.log;return r}function o(t){n.save(t);n.namespaces=t;n.names=[];n.skips=[];const e=(typeof t==="string"?t:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const t of e){if(t[0]==="-"){n.skips.push(t.slice(1))}else{n.names.push(t)}}}function s(t,e){let n=0;let r=0;let o=-1;let s=0;while(n<t.length){if(r<e.length&&(e[r]===t[n]||e[r]==="*")){if(e[r]==="*"){o=r;s=n;r++}else{n++;r++}}else if(o!==-1){r=o+1;s++;n=s}else{return false}}while(r<e.length&&e[r]==="*"){r++}return r===e.length}function i(){const t=[...n.names,...n.skips.map((t=>"-"+t))].join(",");n.enable("");return t}function c(t){for(const e of n.skips){if(s(t,e)){return false}}for(const e of n.names){if(s(t,e)){return true}}return false}function a(t){if(t instanceof Error){return t.stack||t.message}return t}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}n.enable(n.load());return n}zt=t;return zt}var Wt;function $t(){if(Wt)return Ot.exports;Wt=1;(function(t,e){e.formatArgs=r;e.save=o;e.load=s;e.useColors=n;e.storage=i();e.destroy=(()=>{let t=false;return()=>{if(!t){t=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let t;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff);if(!this.useColors){return}const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0;let o=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{if(t==="%%"){return}r++;if(t==="%c"){o=r}}));e.splice(o,0,n)}e.log=console.debug||console.log||(()=>{});function o(t){try{if(t){e.storage.setItem("debug",t)}else{e.storage.removeItem("debug")}}catch(t){}}function s(){let t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(t){}if(!t&&typeof process!=="undefined"&&"env"in process){t=process.env.DEBUG}return t}function i(){try{return localStorage}catch(t){}}t.exports=Rt()(e);const{formatters:c}=t.exports;c.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}})(Ot,Ot.exports);return Ot.exports}var _t=$t();var qt=g(_t);const Ut=()=>typeof Symbol==="function";const Gt=t=>Ut()&&Boolean(Symbol[t]);const Lt=t=>Gt(t)?Symbol[t]:"@@"+t;if(!Gt("asyncIterator")){Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator")}const Ht=Lt("iterator");const Yt=Lt("observable");const Jt=Lt("species");function Qt(t,e){const n=t[e];if(n==null){return undefined}if(typeof n!=="function"){throw new TypeError(n+" is not a function")}return n}function Zt(t){let e=t.constructor;if(e!==undefined){e=e[Jt];if(e===null){e=undefined}}return e!==undefined?e:ae}function Kt(t){return t instanceof ae}function Xt(t){if(Xt.log){Xt.log(t)}else{setTimeout((()=>{throw t}),0)}}function te(t){Promise.resolve().then((()=>{try{t()}catch(t){Xt(t)}}))}function ee(t){const e=t._cleanup;if(e===undefined){return}t._cleanup=undefined;if(!e){return}try{if(typeof e==="function"){e()}else{const t=Qt(e,"unsubscribe");if(t){t.call(e)}}}catch(t){Xt(t)}}function ne(t){t._observer=undefined;t._queue=undefined;t._state="closed"}function re(t){const e=t._queue;if(!e){return}t._queue=undefined;t._state="ready";for(const n of e){oe(t,n.type,n.value);if(t._state==="closed"){break}}}function oe(t,e,n){t._state="running";const r=t._observer;try{const o=r?Qt(r,e):undefined;switch(e){case"next":if(o)o.call(r,n);break;case"error":ne(t);if(o)o.call(r,n);else throw n;break;case"complete":ne(t);if(o)o.call(r);break}}catch(t){Xt(t)}if(t._state==="closed"){ee(t)}else if(t._state==="running"){t._state="ready"}}function se(t,e,n){if(t._state==="closed"){return}if(t._state==="buffering"){t._queue=t._queue||[];t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering";t._queue=[{type:e,value:n}];te((()=>re(t)));return}oe(t,e,n)}class ie{constructor(t,e){this._cleanup=undefined;this._observer=t;this._queue=undefined;this._state="initializing";const n=new ce(this);try{this._cleanup=e.call(undefined,n)}catch(t){n.error(t)}if(this._state==="initializing"){this._state="ready"}}get closed(){return this._state==="closed"}unsubscribe(){if(this._state!=="closed"){ne(this);ee(this)}}}class ce{constructor(t){this._subscription=t}get closed(){return this._subscription._state==="closed"}next(t){se(this._subscription,"next",t)}error(t){se(this._subscription,"error",t)}complete(){se(this._subscription,"complete")}}class ae{constructor(t){if(!(this instanceof ae)){throw new TypeError("Observable cannot be called as a function")}if(typeof t!=="function"){throw new TypeError("Observable initializer must be a function")}this._subscriber=t}subscribe(t,e,n){if(typeof t!=="object"||t===null){t={next:t,error:e,complete:n}}return new ie(t,this._subscriber)}pipe(t,...e){let n=this;for(const r of[t,...e]){n=r(n)}return n}tap(t,e,n){const r=typeof t!=="object"||t===null?{next:t,error:e,complete:n}:t;return new ae((t=>this.subscribe({next(e){r.next&&r.next(e);t.next(e)},error(e){r.error&&r.error(e);t.error(e)},complete(){r.complete&&r.complete();t.complete()},start(t){r.start&&r.start(t)}})))}forEach(t){return new Promise(((e,n)=>{if(typeof t!=="function"){n(new TypeError(t+" is not a function"));return}function r(){o.unsubscribe();e(undefined)}const o=this.subscribe({next(e){try{t(e,r)}catch(t){n(t);o.unsubscribe()}},error(t){n(t)},complete(){e(undefined)}})}))}map(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Zt(this);return new e((e=>this.subscribe({next(n){let r=n;try{r=t(n)}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}})))}filter(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Zt(this);return new e((e=>this.subscribe({next(n){try{if(!t(n))return}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}})))}reduce(t,e){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const n=Zt(this);const r=arguments.length>1;let o=false;let s=e;return new n((e=>this.subscribe({next(n){const i=!o;o=true;if(!i||r){try{s=t(s,n)}catch(t){return e.error(t)}}else{s=n}},error(t){e.error(t)},complete(){if(!o&&!r){return e.error(new TypeError("Cannot reduce an empty sequence"))}e.next(s);e.complete()}})))}concat(...t){const e=Zt(this);return new e((n=>{let r;let o=0;function s(i){r=i.subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){if(o===t.length){r=undefined;n.complete()}else{s(e.from(t[o++]))}}})}s(this);return()=>{if(r){r.unsubscribe();r=undefined}}}))}flatMap(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Zt(this);return new e((n=>{const r=[];const o=this.subscribe({next(o){let i;if(t){try{i=t(o)}catch(t){return n.error(t)}}else{i=o}const c=e.from(i).subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){const t=r.indexOf(c);if(t>=0)r.splice(t,1);s()}});r.push(c)},error(t){n.error(t)},complete(){s()}});function s(){if(o.closed&&r.length===0){n.complete()}}return()=>{r.forEach((t=>t.unsubscribe()));o.unsubscribe()}}))}[Yt](){return this}static from(t){const e=typeof this==="function"?this:ae;if(t==null){throw new TypeError(t+" is not an object")}const n=Qt(t,Yt);if(n){const r=n.call(t);if(Object(r)!==r){throw new TypeError(r+" is not an object")}if(Kt(r)&&r.constructor===e){return r}return new e((t=>r.subscribe(t)))}if(Gt("iterator")){const n=Qt(t,Ht);if(n){return new e((e=>{te((()=>{if(e.closed)return;for(const r of n.call(t)){e.next(r);if(e.closed)return}e.complete()}))}))}}if(Array.isArray(t)){return new e((e=>{te((()=>{if(e.closed)return;for(const n of t){e.next(n);if(e.closed)return}e.complete()}))}))}throw new TypeError(t+" is not observable")}static of(...t){const e=typeof this==="function"?this:ae;return new e((e=>{te((()=>{if(e.closed)return;for(const n of t){e.next(n);if(e.closed)return}e.complete()}))}))}static get[Jt](){return this}}if(Ut()){Object.defineProperty(ae,Symbol("extensions"),{value:{symbol:Yt,hostReportError:Xt},configurable:true})}function ue(t){if(typeof t==="function"){t()}else if(t&&typeof t.unsubscribe==="function"){t.unsubscribe()}}class le extends ae{constructor(){super((t=>{this._observers.add(t);return()=>this._observers.delete(t)}));this._observers=new Set}next(t){for(const e of this._observers){e.next(t)}}error(t){for(const e of this._observers){e.error(t)}}complete(){for(const t of this._observers){t.complete()}}}function fe(t){const e=new le;let n;let r=0;return new ae((o=>{if(!n){n=t.subscribe(e)}const s=e.subscribe(o);r++;return()=>{r--;s.unsubscribe();if(r===0){ue(n);n=undefined}}}))}function he(t){return Promise.all(t.map((t=>{const e=t=>({status:"fulfilled",value:t});const n=t=>({status:"rejected",reason:t});const r=Promise.resolve(t);try{return r.then(e,n)}catch(t){return Promise.reject(t)}})))}var de;(function(t){t["initialized"]="initialized";t["taskCanceled"]="taskCanceled";t["taskCompleted"]="taskCompleted";t["taskFailed"]="taskFailed";t["taskQueued"]="taskQueued";t["taskQueueDrained"]="taskQueueDrained";t["taskStart"]="taskStart";t["terminated"]="terminated"})(de||(de={}));const me=Symbol("thread.errors");const pe=Symbol("thread.events");const ve=Symbol("thread.terminate");const we=Symbol("thread.transferable");const ye=Symbol("thread.worker");function ge(t){throw Error(t)}const be={errors(t){return t[me]||ge("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},events(t){return t[pe]||ge("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},terminate(t){return t[ve]()}};var Ce=undefined&&undefined.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,s){function i(t){try{a(r.next(t))}catch(t){s(t)}}function c(t){try{a(r["throw"](t))}catch(t){s(t)}}function a(t){t.done?n(t.value):o(t.value).then(i,c)}a((r=r.apply(t,e||[])).next())}))};let xe=1;function ke(t){const e=[];for(let n=0;n<t;n++){e.push(n)}return e}function Fe(t){return new Promise((e=>setTimeout(e,t)))}function Me(t,e){return t.reduce(((t,n)=>[...t,...e(n)]),[])}function Se(t){return t.replace(/\W/g," ").trim().replace(/\s+/g,"-")}function Ee(t,e){return ke(e).map((()=>({init:t(),runningTasks:[]})))}class Ie{constructor(t,e){this.eventSubject=new le;this.initErrors=[];this.isClosing=false;this.nextTaskID=1;this.taskQueue=[];const n=typeof e==="number"?{size:e}:e||{};const{size:r=Et}=n;this.debug=qt(`threads:pool:${Se(n.name||String(xe++))}`);this.options=n;this.workers=Ee(t,r);this.eventObservable=fe(ae.from(this.eventSubject));Promise.all(this.workers.map((t=>t.init))).then((()=>this.eventSubject.next({type:de.initialized,size:this.workers.length})),(t=>{this.debug("Error while initializing pool worker:",t);this.eventSubject.error(t);this.initErrors.push(t)}))}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find((e=>e.runningTasks.length<t))}runPoolTask(t,e){return Ce(this,void 0,void 0,(function*(){const n=this.workers.indexOf(t)+1;this.debug(`Running task #${e.id} on worker #${n}...`);this.eventSubject.next({type:de.taskStart,taskID:e.id,workerID:n});try{const r=yield e.run(yield t.init);this.debug(`Task #${e.id} completed successfully`);this.eventSubject.next({type:de.taskCompleted,returnValue:r,taskID:e.id,workerID:n})}catch(t){this.debug(`Task #${e.id} failed`);this.eventSubject.next({type:de.taskFailed,taskID:e.id,error:t,workerID:n})}}))}run(t,e){return Ce(this,void 0,void 0,(function*(){const n=(()=>Ce(this,void 0,void 0,(function*(){const r=()=>{t.runningTasks=t.runningTasks.filter((t=>t!==n))};yield Fe(0);try{yield this.runPoolTask(t,e)}finally{r();if(!this.isClosing){this.scheduleWork()}}})))();t.runningTasks.push(n)}))}scheduleWork(){this.debug(`Attempt de-queueing a task in order to run it...`);const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e){this.debug(`Task queue is empty`);this.eventSubject.next({type:de.taskQueueDrained});return}this.run(t,e)}taskCompletion(t){return new Promise(((e,n)=>{const r=this.events().subscribe((o=>{if(o.type===de.taskCompleted&&o.taskID===t){r.unsubscribe();e(o.returnValue)}else if(o.type===de.taskFailed&&o.taskID===t){r.unsubscribe();n(o.error)}else if(o.type===de.terminated){r.unsubscribe();n(Error("Pool has been terminated before task was run."))}}))}))}settled(){return Ce(this,arguments,void 0,(function*(t=false){const e=()=>Me(this.workers,(t=>t.runningTasks));const n=[];const r=this.eventObservable.subscribe((t=>{if(t.type===de.taskFailed){n.push(t.error)}}));if(this.initErrors.length>0){return Promise.reject(this.initErrors[0])}if(t&&this.taskQueue.length===0){yield he(e());return n}yield new Promise(((t,e)=>{const n=this.eventObservable.subscribe({next(e){if(e.type===de.taskQueueDrained||e.type===de.terminated){n.unsubscribe();t(void 0)}},complete(){n.unsubscribe();t(void 0)},error:e})}));yield he(e());r.unsubscribe();return n}))}completed(){return Ce(this,arguments,void 0,(function*(t=false){const e=this.settled(t);const n=new Promise(((t,n)=>{const r=this.eventObservable.subscribe({next(o){if(o.type===de.taskQueueDrained||o.type===de.terminated){r.unsubscribe();t(e)}else if(o.type===de.taskFailed){r.unsubscribe();n(o.error)}},complete(){r.unsubscribe();t(e)},error:n})}));const r=yield Promise.race([e,n]);if(r.length>0){throw r[0]}}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=Infinity}=this.options;if(this.isClosing){throw Error(`Cannot schedule pool tasks after terminate() has been called.`)}if(this.initErrors.length>0){throw this.initErrors[0]}const n=this.nextTaskID++;const r=this.taskCompletion(n);r.catch((t=>{this.debug(`Task #${n} errored:`,t)}));const o={id:n,run:t,cancel:()=>{if(this.taskQueue.indexOf(o)===-1)return;this.taskQueue=this.taskQueue.filter((t=>t!==o));this.eventSubject.next({type:de.taskCanceled,taskID:o.id})},then:r.then.bind(r)};if(this.taskQueue.length>=e){throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\n"+"This usually happens for one of two reasons: We are either at peak "+"workload right now or some tasks just won't finish, thus blocking the pool.")}this.debug(`Queueing task #${o.id}...`);this.taskQueue.push(o);this.eventSubject.next({type:de.taskQueued,taskID:o.id});this.scheduleWork();return o}terminate(t){return Ce(this,void 0,void 0,(function*(){this.isClosing=true;if(!t){yield this.completed(true)}this.eventSubject.next({type:de.terminated,remainingQueue:[...this.taskQueue]});this.eventSubject.complete();yield Promise.all(this.workers.map((t=>Ce(this,void 0,void 0,(function*(){try{yield be.terminate(yield t.init)}catch(t){this.debug("Worker did not initialize; nothing to terminate:",t)}})))))}))}}Ie.EventType=de;function Pe(t,e){return new Ie(t,e)}Pe.EventType=de;const je=Pe;const Ne={deserialize(t){return Object.assign(Error(t.message),{name:t.name,stack:t.stack})},serialize(t){return{__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack}}};const Te=t=>t&&typeof t==="object"&&"__error_marker"in t&&t.__error_marker==="$$error";const Oe={deserialize(t){if(Te(t)){return Ne.deserialize(t)}else{return t}},serialize(t){if(t instanceof Error){return Ne.serialize(t)}else{return t}}};let De=Oe;function Ae(t){return De.deserialize(t)}function Ve(t){return De.serialize(t)}const ze=()=>undefined;function Be(){let t=false;let e;let n=ze;const r=new Promise((r=>{if(t){r(e)}else{n=r}}));const o=r=>{t=true;e=r;n(e)};return[r,o]}var Re;(function(t){t["internalError"]="internalError";t["message"]="message";t["termination"]="termination"})(Re||(Re={}));class We extends Error{constructor(t,e){super(t);this.name="ThreadCloneError";this.cause=e;Object.setPrototypeOf(this,We.prototype)}}function $e(t){return Boolean(t&&typeof t==="object"&&t.name==="DataCloneError")}var _e;const qe=()=>undefined;const Ue=t=>t;const Ge=t=>Promise.resolve().then(t);function Le(t){throw t}function He(t){return t&&typeof t.then==="function"}class Ye extends ae{constructor(t){super((e=>{const n=this;const r=Object.assign(Object.assign({},e),{complete(){e.complete();n.onCompletion()},error(t){e.error(t);n.onError(t)},next(t){e.next(t);n.onNext(t)}});try{this.initHasRun=true;return t(r)}catch(t){r.error(t)}}));this.initHasRun=false;this.fulfillmentCallbacks=[];this.rejectionCallbacks=[];this.firstValueSet=false;this.state="pending";this[_e]="[object ObservablePromise]"}onNext(t){if(!this.firstValueSet){this.firstValue=t;this.firstValueSet=true}}onError(t){this.state="rejected";this.rejection=t;for(const e of this.rejectionCallbacks){Ge((()=>e(t)))}}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks){Ge((()=>t(this.firstValue)))}}then(t,e){const n=t||Ue;const r=e||Le;let o=false;return new Promise(((t,e)=>{const s=n=>{if(o)return;o=true;try{t(r(n))}catch(t){e(t)}};const i=e=>{try{t(n(e))}catch(t){s(t)}};if(!this.initHasRun){this.subscribe({error:s})}if(this.state==="fulfilled"){return t(n(this.firstValue))}if(this.state==="rejected"){o=true;return t(r(this.rejection))}this.fulfillmentCallbacks.push(i);this.rejectionCallbacks.push(s)}))}catch(t){return this.then(undefined,t)}finally(t){const e=t||qe;return this.then((t=>{e();return t}),(()=>e()))}static from(t){if(He(t)){return new Ye((e=>{const n=t=>{e.next(t);e.complete()};const r=t=>{e.error(t)};t.then(n,r)}))}else{return super.from(t)}}}_e=Symbol.toStringTag;function Je(t){return t&&typeof t==="object"&&t[we]}var Qe;(function(t){t["cancel"]="cancel";t["run"]="run"})(Qe||(Qe={}));var Ze;(function(t){t["error"]="error";t["init"]="init";t["result"]="result";t["running"]="running";t["uncaughtError"]="uncaughtError"})(Ze||(Ze={}));const Ke=qt("threads:master:messages");let Xe=1;const tn=t=>Array.from(new Set(t));const en=t=>t&&t.type===Ze.error;const nn=t=>t&&t.type===Ze.result;const rn=t=>t&&t.type===Ze.running;function on(t,e){return new ae((n=>{let r;let o=false;const s=()=>{t.removeEventListener("message",i);t.removeEventListener("error",c);t.removeEventListener("exit",a)};const i=t=>{Ke("Message from worker:",t.data);if(!t.data||t.data.uid!==e)return;if(rn(t.data)){r=t.data.resultType}else if(nn(t.data)){if(r==="promise"){if(typeof t.data.payload!=="undefined"){n.next(Ae(t.data.payload))}o=true;n.complete();s()}else{if(typeof t.data.payload!=="undefined"){n.next(Ae(t.data.payload))}if(t.data.complete){o=true;n.complete();s()}}}else if(en(t.data)){const e=Ae(t.data.error);o=true;n.error(e);s()}};const c=t=>{if(o)return;o=true;const e=t&&t.data instanceof Error?t.data:Error(String(t&&t.data||"Worker errored before the job completed."));n.error(e);s()};const a=t=>{if(o)return;o=true;const e=t?t.data:undefined;n.error(Error(`Worker terminated before the job completed (exit code: ${e}).`));s()};t.addEventListener("message",i);t.addEventListener("error",c);t.addEventListener("exit",a);return()=>{if(r==="observable"||!r){const n={type:Qe.cancel,uid:e};t.postMessage(n)}s()}}))}function sn(t){if(t.length===0){return{args:[],transferables:[]}}const e=[];const n=[];for(const r of t){if(Je(r)){e.push(Ve(r.send));n.push(...r.transferables)}else{e.push(Ve(r))}}return{args:e,transferables:n.length===0?n:tn(n)}}function cn(t,e){return(...n)=>{const r=Xe++;const{args:o,transferables:s}=sn(n);const i={type:Qe.run,uid:r,method:e,args:o};Ke("Sending command to run function to worker:",i);try{t.postMessage(i,s)}catch(t){if($e(t)){const e=new We(`Cannot send arguments to the worker thread: a value is not structured-cloneable. `+`Functions, class instances and other non-serializable values cannot be passed to a thread. `+`Original error: ${t.message}`,t);return Ye.from(Promise.reject(e))}return Ye.from(Promise.reject(t))}return Ye.from(fe(on(t,r)))}}function an(t,e){const n={};for(const r of e){n[r]=cn(t,r)}return n}var un=undefined&&undefined.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,s){function i(t){try{a(r.next(t))}catch(t){s(t)}}function c(t){try{a(r["throw"](t))}catch(t){s(t)}}function a(t){t.done?n(t.value):o(t.value).then(i,c)}a((r=r.apply(t,e||[])).next())}))};const ln=qt("threads:master:messages");const fn=qt("threads:master:spawn");const hn=qt("threads:master:thread-utils");const dn=t=>t&&t.type==="init";const mn=t=>t&&t.type==="uncaughtError";const pn=typeof process!=="undefined"&&typeof process.env!=="undefined"&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function vn(t,e,n){return un(this,void 0,void 0,(function*(){let r;const o=new Promise(((t,o)=>{r=setTimeout((()=>o(Error(n))),e)}));try{return yield Promise.race([t,o])}finally{clearTimeout(r)}}))}function wn(t){return new Promise(((e,n)=>{const r=o=>{ln("Message from worker before finishing initialization:",o.data);if(dn(o.data)){t.removeEventListener("message",r);e(o.data)}else if(mn(o.data)){t.removeEventListener("message",r);n(Ae(o.data.error))}};t.addEventListener("message",r)}))}function yn(t,e){return new ae((n=>{const r=t=>{const e={type:Re.message,data:t.data};n.next(e)};const o=t=>{hn("Unhandled promise rejection event in thread:",t);const e={type:Re.internalError,error:Error(t.reason)};n.next(e)};t.addEventListener("message",r);t.addEventListener("unhandledrejection",o);e.then((()=>{const e={type:Re.termination};t.removeEventListener("message",r);t.removeEventListener("unhandledrejection",o);n.next(e);n.complete()}))}))}function gn(t){const[e,n]=Be();const r=()=>un(this,void 0,void 0,(function*(){hn("Terminating worker");yield t.terminate();n()}));return{terminate:r,termination:e}}function bn(t,e,n,r){const o=n.filter((t=>t.type===Re.internalError)).map((t=>t.error));return Object.assign(t,{[me]:o,[pe]:n,[ve]:r,[ye]:e})}function Cn(t,e){return un(this,void 0,void 0,(function*(){var e,n;fn("Initializing new thread");const r=pn;let o;try{o=yield vn(wn(t),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`)}catch(r){yield Promise.resolve((n=(e=t).terminate)===null||n===void 0?void 0:n.call(e)).catch((()=>undefined));throw r}const s=o.exposed;const{termination:i,terminate:c}=gn(t);const a=yn(t,i);if(s.type==="function"){const e=cn(t);return bn(e,t,a,c)}else if(s.type==="module"){const e=an(t,s.methods);return bn(e,t,a,c)}else{const t=s.type;throw Error(`Worker init message states unexpected type of expose(): ${t}`)}}))}Tt().blob;const xn=Tt().default;if(typeof global!=="undefined"){global.Worker=xn}else if(typeof window!=="undefined"){window.Worker=xn}const kn=new URL("./png-decoder.worker.js",import.meta.url);let Fn;const Mn=1;function Sn(){var t;if(typeof window!=="undefined"){const e=(t=window.navigator.hardwareConcurrency)!==null&&t!==void 0?t:8;return Math.ceil(e/4)}else{return Mn}}function En(){if(Fn==null){const t=Sn();console.debug(`Spawning PNG worker pool [size=${t}]`);Fn=je((()=>Cn(new Worker(kn))),{size:t})}return Fn}const In=async t=>{const e=En();return e.queue((e=>e(t)))};function Pn(t,n){const r=e.magnitude(t);const o=n.radius/r;return e.scale(o,t)}function jn(t,n,r){const o=e.subtract(r,t);const s=e.dot(n,o);const i=e.magnitudeSquared(n);const c=s/i;const a=e.scale(c,n);return e.add(a,t)}class Nn{constructor(t,e,n,r,o,s,i,c,a,u=y.create()){this.correlationIds=t;this.temporalRefinementCorrelationId=e;this.sequenceNumber=n;this.dimensions=r;this.image=o;this.scene=s;this.depthBufferBytes=i;this.featureMapBytes=c;this.partialFrame=a;this.id=u}getId(){return this.id}async depthBuffer(){if(this.cachedDepthBuffer==null){this.cachedDepthBuffer=this.depthBufferBytes!=null?this.decodeDepthBuffer(new Uint8Array(this.depthBufferBytes)):Promise.resolve(undefined)}return this.cachedDepthBuffer}async decodeDepthBuffer(t){const e=await In(t);return ut.fromPng(e,this.scene.camera,this.image.imageAttr)}async featureMap(){if(this.cachedFeatureMap==null){this.cachedFeatureMap=this.featureMapBytes!=null?this.decodeFeatureMap(new Uint8Array(this.featureMapBytes)):Promise.resolve(undefined)}return this.cachedFeatureMap}async decodeFeatureMap(t){const e=await In(t);return xt.fromPng(e,this.image.imageAttr)}copy({correlationIds:t,temporalRefinementCorrelationId:e,sequenceNumber:n,dimensions:r,image:o,scene:s,depthBufferBytes:i,featureMapBytes:c,partialFrame:a}){return new Nn(t!==null&&t!==void 0?t:this.correlationIds,e!==null&&e!==void 0?e:this.temporalRefinementCorrelationId,n!==null&&n!==void 0?n:this.sequenceNumber,r!==null&&r!==void 0?r:this.dimensions,o!==null&&o!==void 0?o:this.image,s!==null&&s!==void 0?s:this.scene,i!==null&&i!==void 0?i:this.depthBufferBytes,c!==null&&c!==void 0?c:this.featureMapBytes,a!==null&&a!==void 0?a:this.partialFrame,this.id)}}class Tn{constructor(t,e){this.imageAttr=t;this.imageBytes=e}}class On{constructor(t,e,n,r,o,s,i,c){this.camera=t;this.boundingBox=e;this.crossSection=n;this.worldOrientation=r;this.hasChanged=o;this.sceneViewSummary=s;this.modelViewId=i;this.itemModelView=c}copy({camera:t,boundingBox:e,crossSection:n,worldOrientation:r,hasChanged:o,sceneViewSummary:s,modelViewId:i,itemModelView:c}){return new On(t!==null&&t!==void 0?t:this.camera,e!==null&&e!==void 0?e:this.boundingBox,n!==null&&n!==void 0?n:this.crossSection,r!==null&&r!==void 0?r:this.worldOrientation,o!==null&&o!==void 0?o:this.hasChanged,s!==null&&s!==void 0?s:this.sceneViewSummary,i!==null&&i!==void 0?i:this.modelViewId,c!==null&&c!==void 0?c:this.itemModelView)}}class Dn{constructor(t,e,n,r,o,s){this.position=t;this.lookAt=e;this.up=n;this.near=r;this.far=o;this.aspectRatio=s}get direction(){return e.normalize(this.viewVector)}get viewVector(){return e.subtract(this.lookAt,this.position)}get worldMatrix(){return this.computeCameraMatrices().worldMatrix}get viewMatrix(){return this.computeCameraMatrices().viewMatrix}get projectionMatrix(){return this.computeCameraMatrices().projectionMatrix}get projectionMatrixInverse(){return this.computeCameraMatrices().projectionMatrixInverse}get projectionViewMatrix(){return this.computeCameraMatrices().projectionViewMatrix}static fromBoundingBox(t,e,r){var o;const{near:s,far:i}=tt(e,t);if(L(t)){const o=n.create(e);const c=Pn(t.viewVector,o);const a=jn(t.lookAt,c,o.center);return new Vn(c,a,t.up,s,i,r,t.fovHeight,t.rotationPoint)}else{return new An(t.position,t.lookAt,t.up,s,i,r,(o=t.fovY)!==null&&o!==void 0?o:45)}}isOrthographic(){return false}isPerspective(){return false}isPointBehindNear(t){const{position:n,direction:r,near:o}=this;const s=e.dot(e.subtract(t,n),r);return s<o}intersectLineWithNear(t){const{position:n,direction:r,near:o}=this;const s=e.subtract(t.start,n);const a=e.subtract(t.end,n);const u=i.create({start:s,end:a});const l=c.create({normal:r,constant:-o});const f=c.intersectLine(l,u);return f!=null?e.add(f,n):undefined}computeCameraMatrices(){if(this.cameraMatrices==null){return{viewMatrix:a.makeIdentity(),worldMatrix:a.makeIdentity(),projectionMatrix:a.makeIdentity(),projectionMatrixInverse:a.makeIdentity(),projectionViewMatrix:a.makeIdentity()}}return this.cameraMatrices}updateCameraMatrices(t){this.cameraMatrices=t;return this.cameraMatrices}}class An extends Dn{constructor(t,e,n,r,o,s,i){super(t,e,n,r,o,s);this.position=t;this.lookAt=e;this.up=n;this.near=r;this.far=o;this.aspectRatio=s;this.fovY=i}toOrthographic(t){return Dn.fromBoundingBox(Q(this,t),t,this.aspectRatio)}isPerspective(){return true}computeCameraMatrices(){if(this.cameraMatrices==null){const t=a.makeLookAtView(this.position,this.lookAt,this.up);const e=a.invert(t);const n=a.makePerspective(this.near,this.far,this.fovY,this.aspectRatio);const r=a.invert(n);const o=a.multiply(t,n);return super.updateCameraMatrices({viewMatrix:t,worldMatrix:e,projectionMatrix:n,projectionMatrixInverse:r,projectionViewMatrix:o})}return this.cameraMatrices}}class Vn extends Dn{constructor(t,n,r,o,s,i,c,a){super(e.add(n,e.negate(t)),n,r,o,s,i);this.lookAt=n;this.up=r;this.near=o;this.far=s;this.aspectRatio=i;this.fovHeight=c;this.rotationPoint=a;this.top=c*.5;this.bottom=-this.top;this.right=this.top*i;this.left=-this.right}toPerspective(t){return Dn.fromBoundingBox(Z(this),t,this.aspectRatio)}isOrthographic(){return true}computeCameraMatrices(){if(this.cameraMatrices==null){const t=a.makeLookAtView(this.position,this.lookAt,this.up);const e=a.invert(t);const n=a.makeOrthographic(this.left,this.right,this.bottom,this.top,this.near,this.far);const r=a.invert(n);const o=a.multiply(t,n);return super.updateCameraMatrices({viewMatrix:t,worldMatrix:e,projectionMatrix:n,projectionMatrixInverse:r,projectionViewMatrix:o})}return this.cameraMatrices}}class zn{constructor(t,e){this.y=t;this.z=e}get matrix(){const t=this.z;const n=this.y;const r=e.cross(n,t);return a.makeBasis(r,n,t)}}zn.DEFAULT=new zn(e.up(),e.back());class Bn{constructor(t,e){this.position=t;this.up=e}transformMatrix(t){const n=e.multiplyByTransformMatrixColumnMajor(this.position,t);const r=e.multiplyByTransformMatrixColumnMajor(this.up,t);return new Bn(n,r)}}Bn.FRONT=new Bn(e.back(),e.up());Bn.RIGHT=new Bn(e.right(),e.up());Bn.LEFT=new Bn(e.left(),e.up());Bn.BACK=new Bn(e.forward(),e.up());Bn.TOP=new Bn(e.up(),e.forward());Bn.BOTTOM=new Bn(e.down(),e.back());Bn.TOP_FRONT_RIGHT=new Bn(e.add(e.back(),e.up(),e.left()),e.up());Bn.TOP_FRONT_LEFT=new Bn(e.add(e.back(),e.up(),e.right()),e.up());Bn.BOTTOM_FRONT_RIGHT=new Bn(e.add(e.back(),e.down(),e.left()),e.up());Bn.BOTTOM_FRONT_LEFT=new Bn(e.add(e.back(),e.down(),e.right()),e.up());Bn.TOP_BACK_LEFT=new Bn(e.add(e.forward(),e.up(),e.right()),e.up());Bn.TOP_BACK_RIGHT=new Bn(e.add(e.forward(),e.up(),e.left()),e.up());Bn.BOTTOM_BACK_LEFT=new Bn(e.add(e.forward(),e.down(),e.right()),e.up());Bn.BOTTOM_BACK_RIGHT=new Bn(e.add(e.forward(),e.down(),e.left()),e.up());Bn.TOP_FRONT=new Bn(e.add(e.back(),e.up()),e.up());Bn.BOTTOM_FRONT=new Bn(e.add(e.back(),e.down()),e.up());Bn.FRONT_RIGHT=new Bn(e.add(e.back(),e.left()),e.up());Bn.FRONT_LEFT=new Bn(e.add(e.back(),e.right()),e.up());Bn.TOP_BACK=new Bn(e.add(e.forward(),e.up()),e.up());Bn.BOTTOM_BACK=new Bn(e.add(e.forward(),e.down()),e.up());Bn.BACK_LEFT=new Bn(e.add(e.forward(),e.right()),e.up());Bn.BACK_RIGHT=new Bn(e.add(e.forward(),e.left()),e.up());Bn.TOP_LEFT=new Bn(e.add(e.up(),e.right()),e.up());Bn.TOP_RIGHT=new Bn(e.add(e.up(),e.left()),e.up());Bn.BOTTOM_LEFT=new Bn(e.add(e.down(),e.right()),e.up());Bn.BOTTOM_RIGHT=new Bn(e.add(e.down(),e.left()),e.up());const Rn=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y")),(([t,e])=>r.create(t,e)));const Wn=v.defineMapper(v.read(v.requiredProp("width"),v.requiredProp("height")),(([t,e])=>u.create(t,e)));const $n=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("width"),v.requiredProp("height")),(([t,e,n,r])=>s.create(t,e,n,r)));const _n=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("z")),(([t,n,r])=>e.create(t,n,r)));const qn=v.defineMapper(v.read(v.requiredProp("xmin"),v.requiredProp("ymin"),v.requiredProp("zmin"),v.requiredProp("xmax"),v.requiredProp("ymax"),v.requiredProp("zmax")),(([t,n,r,o,s,i])=>l.create(e.create(t,n,r),e.create(o,s,i))));const Un=v.defineMapper(v.read(v.requiredProp("d"),v.mapRequiredProp("normal",_n)),(([t,e])=>c.create({normal:e,constant:t})));const Gn=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("z"),v.requiredProp("w")),(([t,e,n,r])=>f.create({x:t,y:e,z:n,w:r})));const Ln=v.defineMapper(v.read(v.mapRequiredProp("r0",Gn),v.mapRequiredProp("r1",Gn),v.mapRequiredProp("r2",Gn),v.mapRequiredProp("r3",Gn)),(([t,e,n,r])=>a.transpose(a.fromValues(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w))));const Hn=v.defineMapper(v.read(v.requiredProp("r"),v.requiredProp("g"),v.requiredProp("b")),(([t,e,n])=>w.create(t,e,n)));const Yn=v.defineMapper((t=>{function e(t){return{r:t.r,g:t.g,b:t.b}}if(typeof t==="string"){const n=w.fromHexString(t);return n!=null?e(n):{errors:["String is not a valid color."]}}else if(typeof t==="number"){return e(w.fromNumber(t))}else{return e(t)}}),(t=>t));tr();const Jn=tr();const Qn=tr();const Zn=er();const Kn=er();const Xn=er();function tr(){return v.defineMapper((t=>t!=null?{value:t}:undefined),(t=>t))}function er(){return v.defineMapper((t=>(t===null||t===void 0?void 0:t.value)||undefined),(t=>t))}const nr=v.defineMapper(v.read(v.mapProp("position",v.compose(v.required("position"),_n)),v.mapProp("lookAt",v.compose(v.required("lookAt"),_n)),v.mapProp("up",v.compose(v.required("up"),_n)),v.getProp("fovY")),(([t,e,n,r])=>({position:t,lookAt:e,up:n,fovY:(r===null||r===void 0?void 0:r.value)!=null?r.value:45})));const rr=v.defineMapper(v.read(v.mapProp("viewVector",v.compose(v.required("viewVector"),_n)),v.mapProp("lookAt",v.compose(v.required("lookAt"),_n)),v.mapProp("up",v.compose(v.required("up"),_n)),v.mapProp("fovHeight",v.required("fovHeight"))),(([t,e,n,r])=>({viewVector:t,lookAt:e,up:n,fovHeight:r})));const or=v.defineMapper(v.read(v.mapProp("position",v.ifDefined(_n)),v.mapProp("lookAt",v.ifDefined(_n)),v.mapProp("up",v.ifDefined(_n)),v.mapProp("perspective",v.ifDefined(nr)),v.mapProp("orthographic",v.ifDefined(rr))),(([t,n,r,o,s])=>{var i;return(i=o!==null&&o!==void 0?o:s)!==null&&i!==void 0?i:{position:t!==null&&t!==void 0?t:e.back(),lookAt:n!==null&&n!==void 0?n:e.origin(),up:r!==null&&r!==void 0?r:e.up(),fovY:45}}));const sr=v.defineMapper(v.read(v.mapProp("normal",v.compose(v.required("normal"),_n)),v.requiredProp("offset")),(([t,e])=>({normal:t,offset:e})));const ir=v.defineMapper(v.read(v.mapProp("frameDimensions",v.compose(v.required("frameDimensions"),Wn)),v.mapProp("imageRect",v.compose(v.required("imageRect"),$n)),v.mapProp("scaleFactor",v.required("scaleFactor"))),(([t,e,n])=>({frameDimensions:t,imageRect:e,imageScale:n})));const cr=v.defineMapper(v.read(v.mapProp("sectionPlanes",v.compose(v.required("sectionPlanes"),v.mapArray(sr))),v.mapProp("highlightColor",v.ifDefined(Hn))),(([t,e])=>rt({sectionPlanes:t,highlightColor:e||undefined})));const ar=v.defineMapper(v.read(v.requiredProp("count"),v.mapProp("boundingBox",v.ifDefined(qn))),(([t,e])=>({count:t,boundingBox:e!==null&&e!==void 0?e:undefined})));const ur=v.defineMapper(v.read(v.mapProp("visibleSummary",v.ifDefined(ar)),v.mapProp("selectedVisibleSummary",v.ifDefined(ar))),(([t,e])=>it({visibleSummary:t!==null&&t!==void 0?t:undefined,selectedVisibleSummary:e!==null&&e!==void 0?e:undefined})));const lr=v.defineMapper(v.read(v.mapProp("modelViewId",v.ifDefined(S)),v.mapProp("sceneItemId",v.ifDefined(S))),(([t,e])=>st({modelViewId:t!==null&&t!==void 0?t:undefined,sceneItemId:e!==null&&e!==void 0?e:undefined})));const fr=v.defineMapper(v.read(v.mapProp("imageAttributes",v.compose(v.required("imageAttributes"),ir))),(([t])=>t));const hr=v.defineMapper(v.read(fr,v.mapProp("image",v.required("image"))),(([t,e])=>new Tn(t,e)));const dr=v.defineMapper(v.read(v.mapRequiredProp("camera",or),v.mapRequiredProp("visibleBoundingBox",qn),v.mapRequiredProp("crossSectioning",cr),v.requiredProp("hasChanged"),v.mapRequiredProp("displayListSummary",ur),v.mapProp("modelViewId",v.ifDefined(E)),v.mapProp("itemModelView",v.ifDefined(lr))),(([t,e,n,r,o,s,i])=>({camera:t,boundingBox:e,crossSectioning:n,hasChanged:r,displayListSummary:o,modelViewId:s!==null&&s!==void 0?s:undefined,itemModelView:i!==null&&i!==void 0?i:undefined})));const mr=v.defineMapper(v.read(v.mapProp("sceneAttributes",v.compose(v.required("sceneAttributes"),dr))),(([t])=>t));const pr=v.defineMapper(v.read(mr,fr),(([t,e])=>Dn.fromBoundingBox(t.camera,t.boundingBox,u.aspectRatio(e.frameDimensions))));function vr(t){return v.defineMapper(v.read(mr,pr),(([e,n])=>new On(n,e.boundingBox,e.crossSectioning,t,e.hasChanged,e.displayListSummary,e.modelViewId,e.itemModelView)))}function wr(t){return v.defineMapper(v.read(v.mapProp("frameCorrelationIds",(t=>t!=null?t:[])),v.requiredProp("sequenceNumber"),v.compose(fr,v.getProp("frameDimensions")),vr(t),hr,v.mapProp("depthBuffer",Kn),v.mapProp("featureMap",Kn),v.mapProp("temporalRefinementCorrelationId",(t=>t!=null?S(t):null)),v.mapProp("partialFrame",v.ifDefined(Zn))),(([t,e,n,r,o,s,i,c,a])=>new Nn(t,c||"",e,n,o,r,s,i,a!==null&&a!==void 0?a:false)))}function yr(t){return v.ifInvalidThrow(wr(t))}const gr=v.defineMapper(v.compose(v.required("orientation"),v.read(v.mapProp("up",v.compose(v.required("up"),_n)),v.mapProp("front",v.compose(v.required("front"),_n)))),(([t,e])=>new zn(t,e)));v.ifInvalidThrow(gr);const br=v.defineMapper(v.read(v.mapRequiredProp("imageAttributes",ir),v.requiredProp("stencilBuffer"),v.mapRequiredProp("depthBuffer",v.compose(Kn,v.required("depthBuffer")))),(([t,e,n])=>({imageAttributes:t,stencilBuffer:e,depthBuffer:n})));const Cr=kr("stencilBuffer",br);const xr=v.ifInvalidThrow(Cr);function kr(t,e){return v.mapRequiredProp(t,e)}const Fr=v.defineMapper(v.read(v.requiredProp("token"),v.requiredProp("expiresIn")),(([t,e])=>$.create(t,e)));const Mr=v.defineMapper(v.read(v.compose(v.requiredProp("startStream"),v.mapRequiredProp("streamId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sceneId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sceneViewId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sessionId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("worldOrientation",gr)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("token",Fr))),(([t,e,n,r,o,s])=>({streamId:t,sceneId:e,sceneViewId:n,sessionId:r,worldOrientation:o,token:s})));const Sr=v.ifInvalidThrow(Mr);const Er=v.defineMapper(v.read(v.compose(v.requiredProp("reconnect"),v.mapRequiredProp("token",Fr))),(([t])=>({token:t})));const Ir=v.ifInvalidThrow(Er);const Pr=v.defineMapper(v.compose(v.requiredProp("refreshToken"),v.requiredProp("token"),Fr),(t=>t));const jr=v.ifInvalidThrow(Pr);const Nr=v.defineMapper(v.compose(v.requiredProp("syncTime"),v.requiredProp("replyTime"),v.read(v.requiredProp("seconds"),v.requiredProp("nanos"))),(([t,e])=>m({seconds:t,nanos:e})));const Tr=v.ifInvalidThrow(Nr);const Or=v.defineMapper(v.ifDefined(v.getProp("next")),(t=>t!=null?t:undefined));const Dr=v.defineMapper((t=>{switch(t){case"all":return{enabled:{value:true},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_ALL};case"final":return{enabled:{value:true},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_FINAL};default:return{enabled:{value:false},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_INVALID}}}),(t=>t));const Ar=v.defineMapper(v.read(v.ifDefined(v.getProp("opacity"))),(([t])=>({opacity:{value:h(t!==null&&t!==void 0?t:0,0,1)}})));const Vr=v.defineMapper(v.read(v.ifDefined(v.getProp("width")),v.ifDefined(v.mapProp("color",v.ifDefined(Yn)))),(([t,e])=>({lineWidth:t,lineColor:e})));const zr=v.defineMapper(v.read(v.ifDefined(v.mapProp("color",v.ifDefined(Yn))),v.ifDefined(v.mapProp("opacity",Jn)),v.ifDefined(v.getProp("lineWidth"))),(([t,e,n])=>{if(t||e||n){return{color:t,opacity:e,lineWidth:n}}else return undefined}));const Br=v.defineMapper(v.read(v.ifDefined(v.mapProp("highlightColor",v.ifDefined(Yn))),v.ifDefined(v.mapProp("occludedOpacity",Jn)),v.ifDefined(v.mapProp("outline",v.ifDefined(Vr)))),(([t,e,n])=>({highlightColor:t,occludedOpacity:e,outline:n})));const Rr=v.defineMapper((t=>!!t),(t=>t));const Wr=v.defineMapper((t=>t!==null&&t!==void 0?t:""),(t=>t));const $r=v.defineMapper(v.read(v.ifDefined(v.mapProp("frameBackgroundColor",v.ifDefined(Yn)))),(([t])=>({frameBackgroundColor:t})));const _r=v.defineMapper(v.read(v.ifDefined(v.mapProp("streamKeyToCompare",v.ifDefined(Qn)))),(([t])=>({streamKeyToCompare:t})));const qr=v.defineMapper(v.read(v.ifDefined(v.mapProp("endCapEnabled",(t=>!!t))),v.ifDefined(v.mapProp("endCapColor",v.ifDefined(Yn)))),(([t,e])=>({endCapEnabled:t,endCapColor:e})));const Ur=v.defineMapper(v.read(v.mapProp("depthBuffers",Dr),v.mapProp("phantom",Ar),v.mapProp("noDefaultLights",Rr),v.mapProp("featureLines",Vr),v.mapProp("featureHighlighting",Br),v.mapProp("featureMaps",Dr),v.mapProp("experimentalRenderingOptions",Wr),v.mapProp("selectionHighlighting",zr),v.mapProp("frames",$r),v.mapProp("sceneComparison",_r),v.mapProp("crossSectioning",qr)),(([t,e,n,r,o,s,i,c,a,u,l])=>{const f={depthBuffers:t,phantomItems:e,noDefaultLights:n,featureLines:r,featureHighlighting:o,featureMaps:s,experimentalRenderingOptions:i,selectionHighlighting:c,frames:a,sceneComparison:u,crossSectioningAttributes:l};return f}));export{gt as A,Yn as B,b as C,wt as D,Ct as E,Dn as F,Jn as G,yr as H,Sr as I,Ir as J,Tr as K,jr as L,ct as M,C as N,zn as O,Q as P,Z as Q,_ as R,Bn as S,Pn as T,H as U,tt as V,Un as W,or as X,I as Y,Nn as a,Tn as b,ot as c,On as d,Vn as e,X as f,An as g,bt as h,xr as i,In as j,ut as k,k as l,F as m,Xn as n,_n as o,x as p,Rn as q,Hn as r,Or as s,K as t,jn as u,M as v,Ln as w,Zn as x,qn as y,Ur as z};
|
|
5
|
-
//# sourceMappingURL=p-CvEK3ZK1.js.map
|