@vertexvis/viewer-toolkit-react 0.0.5-canary.3 → 0.0.5-canary.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.
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import a from"quick-format-unescaped";import{useRecoilCallback as i,atom as l,selector as o,useRecoilValue as s,useRecoilState as r,useSetRecoilState as c,selectorFamily as d,atomFamily as u,DefaultValue as m,useRecoilValueLoadable as p,useRecoilStateLoadable as h,RecoilRoot as f}from"recoil";import*as g from"react";import v,{useEffect as b,useCallback as w,useRef as C,useState as S,useMemo as k}from"react";import{Vector3 as A,BoundingBox as T,Angle as E,Point as P,Euler as N,Matrix4 as O}from"@vertexvis/geometry";import{VertexColorPicker as I,VertexSlider as M,VertexTooltip as V,VertexIconButton as L,VertexDialog as R,VertexToggle as _,VertexButton as j,VertexDropdownMenu as B,VertexIcon as D,VertexMenuItem as F,VertexResizable as H,VertexMenu as U,VertexMenuDivider as W,VertexDraggablePopover as G,VertexBanner as K,VertexToast as $,VertexPopover as q,VertexTextfield as Y,VertexSelect as X}from"@vertexvis/ui-react";import{toWorldTransform as Z,toLocalTransform as J,toMatrix as Q,toRadiansTransform as ee,ColorMaterial as te}from"@vertexvis/viewer";import{VertexViewerMeasurementDetails as ne,VertexViewerMeasurementDistance as ae,VertexViewerMeasurementPrecise as ie,VertexSceneTreeNotificationBanner as le,VertexSceneTreeSearch as oe,VertexSceneTreeToolbar as se,VertexSceneTreeTableLayout as re,VertexSceneTreeTableColumn as ce,VertexSceneTree as de,VertexViewerToolbarGroup as ue,VertexViewerToolbar as me,VertexViewerTransformWidget as pe,VertexViewerBoxQueryTool as he,VertexViewerViewCube as fe,VertexViewer as ge}from"@vertexvis/viewer-react";import{defineCustomElements as ve}from"@vertexvis/ui/loader";import{defineCustomElements as ye}from"@vertexvis/viewer/loader";var extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function __rest(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]]);return n}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),i,l=[],o;try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)l.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return l}"function"==typeof SuppressedError&&SuppressedError;var be={exports:{}};const we=a;be.exports=pino;const Ce=pfGlobalThisOrFallback().console||{},xe={mapHttpRequest:mock,mapHttpResponse:mock,wrapRequestSerializer:passthrough,wrapResponseSerializer:passthrough,wrapErrorSerializer:passthrough,req:mock,res:mock,err:asErrValue,errWithCause:asErrValue};function levelToValue(e,t){return"silent"===e?1/0:t.levels.values[e]}const Se=Symbol("pino.logFuncs"),ke=Symbol("pino.hierarchy"),Ae={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function appendChildLogger(e,t){const n={logger:t,parent:e[ke]};t[ke]=n}function setupBaseLogFunctions(e,t,n){const a={};t.forEach((e=>{a[e]=n[e]?n[e]:Ce[e]||Ce[Ae[e]||"log"]||noop})),e[Se]=a}function shouldSerialize(e,t){if(Array.isArray(e)){const t=undefined;return e.filter((function(e){return"!stdSerializers.err"!==e}))}return!0===e&&Object.keys(t)}function pino(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const n=e.browser.write||Ce;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},i=shouldSerialize(e.browser.serialize,a);let l=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(l=!1);const o=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(o);"function"==typeof n&&s.forEach((function(e){n[e]=n})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const r=e.level||"info",c=Object.create(n);c.log||(c.log=noop),setupBaseLogFunctions(c,s,n),appendChildLogger({},c),Object.defineProperty(c,"levelVal",{get:getLevelVal}),Object.defineProperty(c,"level",{get:getLevel,set:setLevel});const d={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:s,timestamp:getTimeFunction(e),messageKey:e.messageKey||"msg",onChild:e.onChild||noop};function getLevelVal(){return levelToValue(this.level,this)}function getLevel(){return this._level}function setLevel(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,set(this,d,c,"error"),set(this,d,c,"fatal"),set(this,d,c,"warn"),set(this,d,c,"info"),set(this,d,c,"debug"),set(this,d,c,"trace"),o.forEach((e=>{set(this,d,c,e)}))}function child(n,l,o){if(!l)throw new Error("missing bindings for child Pino");o=o||{},i&&l.serializers&&(o.serializers=l.serializers);const s=o.serializers;if(i&&s){var r=Object.assign({},a,s),c=!0===e.browser.serialize?Object.keys(r):i;delete l.serializers,applySerializers([l],c,r,this._stdErrSerialize)}function Child(e){this._childLevel=1+(0|e._childLevel),this.bindings=l,r&&(this.serializers=r,this._serialize=c),t&&(this._logEvent=createLogEventShape([].concat(e._logEvent.bindings,l)))}Child.prototype=this;const d=new Child(this);return appendChildLogger(this,d),d.child=function(...e){return child.call(this,n,...e)},d.level=o.level||this.level,n.onChild(d),d}return c.levels=getLevels(e),c.level=r,c.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=noop,c.serializers=a,c._serialize=i,c._stdErrSerialize=l,c.child=function(...e){return child.call(this,d,...e)},t&&(c._logEvent=createLogEventShape()),c}function getLevels(e){const t=e.customLevels||{},n=undefined,a=undefined;return{values:Object.assign({},pino.levels.values,t),labels:Object.assign({},pino.levels.labels,invertObject(t))}}function invertObject(e){const t={};return Object.keys(e).forEach((function(n){t[e[n]]=n})),t}function getBindingChain(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[ke];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function set(e,t,n,a){if(Object.defineProperty(e,a,{value:levelToValue(e.level,n)>levelToValue(a,n)?noop:n[Se][a],writable:!0,enumerable:!0,configurable:!0}),e[a]===noop){if(!t.transmit)return;const i=undefined,l=levelToValue(t.transmit.level||e.level,n),o=undefined;if(levelToValue(a,n)<l)return}e[a]=createWrap(e,t,n,a);const i=getBindingChain(e);0!==i.length&&(e[a]=prependBindingsInArguments(i,e[a]))}function prependBindingsInArguments(e,t){return function(){return t.apply(this,[...e,...arguments])}}function createWrap(e,t,n,a){return i=e[Se][a],function LOG(){const l=t.timestamp(),o=new Array(arguments.length),s=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ce?Ce:this;for(var r=0;r<o.length;r++)o[r]=arguments[r];var c=!1;if(t.serialize&&(applySerializers(o,this._serialize,this.serializers,this._stdErrSerialize),c=!0),t.asObject||t.formatters?i.call(s,...asObject(this,a,o,l,t)):i.apply(s,o),t.transmit){const i=void 0,s=levelToValue(t.transmit.level||e._level,n),r=levelToValue(a,n);if(r<s)return;transmit(this,{ts:l,methodLevel:a,methodValue:r,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:levelToValue(e._level,n)},o,c)}};var i}function asObject(e,t,n,a,i){const{level:l,log:o=e=>e}=i.formatters||{},s=n.slice();let r=s[0];const c={};let d=1+(0|e._childLevel);if(d<1&&(d=1),a&&(c.time=a),l){const n=l(t,e.levels.values[t]);Object.assign(c,n)}else c.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(null!==r&&"object"==typeof r)for(;d--&&"object"==typeof s[0];)Object.assign(c,s.shift());const e=undefined;return[o(c),...s]}{if(null!==r&&"object"==typeof r){for(;d--&&"object"==typeof s[0];)Object.assign(c,s.shift());r=s.length?we(s.shift(),s):void 0}else"string"==typeof r&&(r=we(s.shift(),s));void 0!==r&&(c[i.messageKey]=r);const e=undefined;return[o(c)]}}function applySerializers(e,t,n,a){for(const i in e)if(a&&e[i]instanceof Error)e[i]=pino.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i])&&t)for(const a in e[i])t.indexOf(a)>-1&&a in n&&(e[i][a]=n[a](e[i][a]))}function transmit(e,t,n,a=!1){const i=t.send,l=t.ts,o=t.methodLevel,s=t.methodValue,r=t.val,c=e._logEvent.bindings;a||applySerializers(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=l,e._logEvent.messages=n.filter((function(e){return-1===c.indexOf(e)})),e._logEvent.level.label=o,e._logEvent.level.value=s,i(o,e._logEvent,r),e._logEvent=createLogEventShape(c)}function createLogEventShape(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function asErrValue(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function getTimeFunction(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?nullTime:epochTime}function mock(){return{}}function passthrough(e){return e}function noop(){}function nullTime(){return!1}function epochTime(){return Date.now()}function unixTime(){return Math.round(Date.now()/1e3)}function isoTime(){return new Date(Date.now()).toISOString()}function pfGlobalThisOrFallback(){function defd(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(e){return defd(self)||defd(window)||defd(this)||{}}}var Te;pino.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},pino.stdSerializers=xe,pino.stdTimeFunctions=Object.assign({},{nullTime:nullTime,epochTime:epochTime,unixTime:unixTime,isoTime:isoTime}),be.exports.default=pino,be.exports.pino=pino;const Ee=(0,be.exports)({formatters:{level:e=>({level:e})}}),logger_error=(e,t)=>{null!=t?Ee.error(t,e):Ee.error(e)},logger_info=(e,t)=>{null!=t?Ee.info(t,e):Ee.info(e)},logger_warn=(e,t)=>{null!=t?Ee.warn(t,e):Ee.warn(e)},logger_debug=(e,t)=>{null!=t?Ee.debug(t,e):Ee.debug(e)};class Pe{}function useActionCallback(e,t=[]){const n=undefined;return i((t=>e(Object.assign(Object.assign({},t),{snapshot:Object.defineProperties(t.snapshot,{getPromiseRequired:{configurable:!0,value:createGetPromiseRequiredWrapper(t.snapshot)},tryGetPromise:{configurable:!0,value:createTryGetPromiseWrapper(t.snapshot)}})}))),t instanceof Pe?void 0:t)}function retainSnapshot(e){return t=>{var{snapshot:n}=t,a=__rest(t,["snapshot"]);return async(...t)=>{const i=n.retain();try{const i=undefined;return await e(Object.assign(Object.assign({},a),{snapshot:n}))(...t)}finally{i()}}}}function createGetPromiseRequiredWrapper(e){return async(t,n)=>{const a=await e.getPromise(t);if(null==a)throw null!=n?n:new Error(`No value present for required value ${t.key}`);return a}}function createTryGetPromiseWrapper(e){return async t=>{try{return{value:await e.getPromise(t)}}catch(e){return logger_debug(`Error encountered retrieving Recoil value. [key={${t.key}}]`,e),{error:e}}}}var Ne=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,Oe=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,Ie=/^(#|0x)?([A-Fa-f0-9]{6})$/,create$2=function(e,t,n,a){return void 0===a&&(a=255),{r:e,g:t,b:n,a:a}},fromNumber=function(e){var t=16777215&e;return create$2(t>>16&255,t>>8&255,255&t)},fromHexString=function(e){var t=Ie.exec(e);if(null!=t)return fromNumber(parseInt(t[2],16))},fromCss=function(e){var t=Ne.exec(e);if(null!=t)return create$2(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=Oe.exec(e);return null!=n?create$2(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):Ie.test(e)?fromHexString(e):void 0},fromArray=function(e){return create$2(e[0],e[1],e[2],e[3])},isInvisible=function(e){return 0===e.a},isOpaque=function(e){return 255===e.a},toHexString=function(e){return"#".concat(componentToHex(e.r)).concat(componentToHex(e.g)).concat(componentToHex(e.b))},componentToHex=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},Me=Object.freeze({__proto__:null,create:create$2,fromNumber:fromNumber,fromHexString:fromHexString,fromCss:fromCss,fromArray:fromArray,isInvisible:isInvisible,isOpaque:isOpaque,toHexString:toHexString});!function(e){function MapperValidationError(t){var n=e.call(this,"Validation error mapping object.")||this;return n.errors=t,Object.setPrototypeOf(n,MapperValidationError.prototype),n}__extends(MapperValidationError,e)}(Error);var Ve=function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,a,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(a=n;0!=a--;)if(!equal(e[a],t[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return!1;for(a=n;0!=a--;){var l=i[a];if(!equal(e[l],t[l]))return!1}return!0}return e!=e&&t!=t};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import a from"quick-format-unescaped";import{useRecoilCallback as i,atom as l,selector as o,useRecoilValue as s,useRecoilState as r,useSetRecoilState as c,selectorFamily as d,atomFamily as u,DefaultValue as m,useRecoilValueLoadable as p,useRecoilStateLoadable as h,RecoilRoot as f}from"recoil";import*as g from"react";import v,{useEffect as b,useCallback as w,useRef as C,useState as S,useMemo as k}from"react";import{Vector3 as A,BoundingBox as T,Angle as P,Point as E,Euler as N,Matrix4 as O}from"@vertexvis/geometry";import{VertexColorPicker as I,VertexSlider as M,VertexTooltip as V,VertexIconButton as L,VertexDialog as R,VertexToggle as _,VertexButton as j,VertexDropdownMenu as B,VertexIcon as D,VertexMenuItem as H,VertexResizable as F,VertexMenu as U,VertexMenuDivider as W,VertexDraggablePopover as G,VertexBanner as K,VertexToast as $,VertexPopover as q,VertexTextfield as Y,VertexSelect as X}from"@vertexvis/ui-react";import{toWorldTransform as Z,toLocalTransform as J,toMatrix as Q,toRadiansTransform as ee,ColorMaterial as te}from"@vertexvis/viewer";import{VertexViewerMeasurementDetails as ne,VertexViewerMeasurementDistance as ae,VertexViewerMeasurementPrecise as ie,VertexSceneTreeNotificationBanner as le,VertexSceneTreeSearch as oe,VertexSceneTreeToolbar as se,VertexSceneTreeTableLayout as re,VertexSceneTreeTableColumn as ce,VertexSceneTree as de,VertexViewerToolbarGroup as ue,VertexViewerToolbar as me,VertexViewerTransformWidget as pe,VertexViewerBoxQueryTool as he,VertexViewerViewCube as fe,VertexViewer as ge}from"@vertexvis/viewer-react";import{defineCustomElements as ve}from"@vertexvis/ui/loader";import{defineCustomElements as ye}from"@vertexvis/viewer/loader";var extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function __rest(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]]);return n}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),i,l=[],o;try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)l.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return l}"function"==typeof SuppressedError&&SuppressedError;var be={exports:{}};const we=a;be.exports=pino;const Ce=pfGlobalThisOrFallback().console||{},xe={mapHttpRequest:mock,mapHttpResponse:mock,wrapRequestSerializer:passthrough,wrapResponseSerializer:passthrough,wrapErrorSerializer:passthrough,req:mock,res:mock,err:asErrValue,errWithCause:asErrValue};function levelToValue(e,t){return"silent"===e?1/0:t.levels.values[e]}const Se=Symbol("pino.logFuncs"),ke=Symbol("pino.hierarchy"),Ae={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function appendChildLogger(e,t){const n={logger:t,parent:e[ke]};t[ke]=n}function setupBaseLogFunctions(e,t,n){const a={};t.forEach((e=>{a[e]=n[e]?n[e]:Ce[e]||Ce[Ae[e]||"log"]||noop})),e[Se]=a}function shouldSerialize(e,t){if(Array.isArray(e)){const t=undefined;return e.filter((function(e){return"!stdSerializers.err"!==e}))}return!0===e&&Object.keys(t)}function pino(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const n=e.browser.write||Ce;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},i=shouldSerialize(e.browser.serialize,a);let l=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(l=!1);const o=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(o);"function"==typeof n&&s.forEach((function(e){n[e]=n})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const r=e.level||"info",c=Object.create(n);c.log||(c.log=noop),setupBaseLogFunctions(c,s,n),appendChildLogger({},c),Object.defineProperty(c,"levelVal",{get:getLevelVal}),Object.defineProperty(c,"level",{get:getLevel,set:setLevel});const d={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:s,timestamp:getTimeFunction(e),messageKey:e.messageKey||"msg",onChild:e.onChild||noop};function getLevelVal(){return levelToValue(this.level,this)}function getLevel(){return this._level}function setLevel(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,set(this,d,c,"error"),set(this,d,c,"fatal"),set(this,d,c,"warn"),set(this,d,c,"info"),set(this,d,c,"debug"),set(this,d,c,"trace"),o.forEach((e=>{set(this,d,c,e)}))}function child(n,l,o){if(!l)throw new Error("missing bindings for child Pino");o=o||{},i&&l.serializers&&(o.serializers=l.serializers);const s=o.serializers;if(i&&s){var r=Object.assign({},a,s),c=!0===e.browser.serialize?Object.keys(r):i;delete l.serializers,applySerializers([l],c,r,this._stdErrSerialize)}function Child(e){this._childLevel=1+(0|e._childLevel),this.bindings=l,r&&(this.serializers=r,this._serialize=c),t&&(this._logEvent=createLogEventShape([].concat(e._logEvent.bindings,l)))}Child.prototype=this;const d=new Child(this);return appendChildLogger(this,d),d.child=function(...e){return child.call(this,n,...e)},d.level=o.level||this.level,n.onChild(d),d}return c.levels=getLevels(e),c.level=r,c.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=noop,c.serializers=a,c._serialize=i,c._stdErrSerialize=l,c.child=function(...e){return child.call(this,d,...e)},t&&(c._logEvent=createLogEventShape()),c}function getLevels(e){const t=e.customLevels||{},n=undefined,a=undefined;return{values:Object.assign({},pino.levels.values,t),labels:Object.assign({},pino.levels.labels,invertObject(t))}}function invertObject(e){const t={};return Object.keys(e).forEach((function(n){t[e[n]]=n})),t}function getBindingChain(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[ke];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function set(e,t,n,a){if(Object.defineProperty(e,a,{value:levelToValue(e.level,n)>levelToValue(a,n)?noop:n[Se][a],writable:!0,enumerable:!0,configurable:!0}),e[a]===noop){if(!t.transmit)return;const i=undefined,l=levelToValue(t.transmit.level||e.level,n),o=undefined;if(levelToValue(a,n)<l)return}e[a]=createWrap(e,t,n,a);const i=getBindingChain(e);0!==i.length&&(e[a]=prependBindingsInArguments(i,e[a]))}function prependBindingsInArguments(e,t){return function(){return t.apply(this,[...e,...arguments])}}function createWrap(e,t,n,a){return i=e[Se][a],function LOG(){const l=t.timestamp(),o=new Array(arguments.length),s=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ce?Ce:this;for(var r=0;r<o.length;r++)o[r]=arguments[r];var c=!1;if(t.serialize&&(applySerializers(o,this._serialize,this.serializers,this._stdErrSerialize),c=!0),t.asObject||t.formatters?i.call(s,...asObject(this,a,o,l,t)):i.apply(s,o),t.transmit){const i=void 0,s=levelToValue(t.transmit.level||e._level,n),r=levelToValue(a,n);if(r<s)return;transmit(this,{ts:l,methodLevel:a,methodValue:r,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:levelToValue(e._level,n)},o,c)}};var i}function asObject(e,t,n,a,i){const{level:l,log:o=e=>e}=i.formatters||{},s=n.slice();let r=s[0];const c={};let d=1+(0|e._childLevel);if(d<1&&(d=1),a&&(c.time=a),l){const n=l(t,e.levels.values[t]);Object.assign(c,n)}else c.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(null!==r&&"object"==typeof r)for(;d--&&"object"==typeof s[0];)Object.assign(c,s.shift());const e=undefined;return[o(c),...s]}{if(null!==r&&"object"==typeof r){for(;d--&&"object"==typeof s[0];)Object.assign(c,s.shift());r=s.length?we(s.shift(),s):void 0}else"string"==typeof r&&(r=we(s.shift(),s));void 0!==r&&(c[i.messageKey]=r);const e=undefined;return[o(c)]}}function applySerializers(e,t,n,a){for(const i in e)if(a&&e[i]instanceof Error)e[i]=pino.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i])&&t)for(const a in e[i])t.indexOf(a)>-1&&a in n&&(e[i][a]=n[a](e[i][a]))}function transmit(e,t,n,a=!1){const i=t.send,l=t.ts,o=t.methodLevel,s=t.methodValue,r=t.val,c=e._logEvent.bindings;a||applySerializers(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=l,e._logEvent.messages=n.filter((function(e){return-1===c.indexOf(e)})),e._logEvent.level.label=o,e._logEvent.level.value=s,i(o,e._logEvent,r),e._logEvent=createLogEventShape(c)}function createLogEventShape(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function asErrValue(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function getTimeFunction(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?nullTime:epochTime}function mock(){return{}}function passthrough(e){return e}function noop(){}function nullTime(){return!1}function epochTime(){return Date.now()}function unixTime(){return Math.round(Date.now()/1e3)}function isoTime(){return new Date(Date.now()).toISOString()}function pfGlobalThisOrFallback(){function defd(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(e){return defd(self)||defd(window)||defd(this)||{}}}var Te;pino.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},pino.stdSerializers=xe,pino.stdTimeFunctions=Object.assign({},{nullTime:nullTime,epochTime:epochTime,unixTime:unixTime,isoTime:isoTime}),be.exports.default=pino,be.exports.pino=pino;const Pe=(0,be.exports)({formatters:{level:e=>({level:e})}}),logger_error=(e,t)=>{null!=t?Pe.error(t,e):Pe.error(e)},logger_info=(e,t)=>{null!=t?Pe.info(t,e):Pe.info(e)},logger_warn=(e,t)=>{null!=t?Pe.warn(t,e):Pe.warn(e)},logger_debug=(e,t)=>{null!=t?Pe.debug(t,e):Pe.debug(e)};class Ee{}function useActionCallback(e,t=[]){const n=undefined;return i((t=>e(Object.assign(Object.assign({},t),{snapshot:Object.defineProperties(t.snapshot,{getPromiseRequired:{configurable:!0,value:createGetPromiseRequiredWrapper(t.snapshot)},tryGetPromise:{configurable:!0,value:createTryGetPromiseWrapper(t.snapshot)}})}))),t instanceof Ee?void 0:t)}function retainSnapshot(e){return t=>{var{snapshot:n}=t,a=__rest(t,["snapshot"]);return async(...t)=>{const i=n.retain();try{const i=undefined;return await e(Object.assign(Object.assign({},a),{snapshot:n}))(...t)}finally{i()}}}}function createGetPromiseRequiredWrapper(e){return async(t,n)=>{const a=await e.getPromise(t);if(null==a)throw null!=n?n:new Error(`No value present for required value ${t.key}`);return a}}function createTryGetPromiseWrapper(e){return async t=>{try{return{value:await e.getPromise(t)}}catch(e){return logger_debug(`Error encountered retrieving Recoil value. [key={${t.key}}]`,e),{error:e}}}}var Ne=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,Oe=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,Ie=/^(#|0x)?([A-Fa-f0-9]{6})$/,create$2=function(e,t,n,a){return void 0===a&&(a=255),{r:e,g:t,b:n,a:a}},fromNumber=function(e){var t=16777215&e;return create$2(t>>16&255,t>>8&255,255&t)},fromHexString=function(e){var t=Ie.exec(e);if(null!=t)return fromNumber(parseInt(t[2],16))},fromCss=function(e){var t=Ne.exec(e);if(null!=t)return create$2(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=Oe.exec(e);return null!=n?create$2(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):Ie.test(e)?fromHexString(e):void 0},fromArray=function(e){return create$2(e[0],e[1],e[2],e[3])},isInvisible=function(e){return 0===e.a},isOpaque=function(e){return 255===e.a},toHexString=function(e){return"#".concat(componentToHex(e.r)).concat(componentToHex(e.g)).concat(componentToHex(e.b))},componentToHex=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},Me=Object.freeze({__proto__:null,create:create$2,fromNumber:fromNumber,fromHexString:fromHexString,fromCss:fromCss,fromArray:fromArray,isInvisible:isInvisible,isOpaque:isOpaque,toHexString:toHexString});!function(e){function MapperValidationError(t){var n=e.call(this,"Validation error mapping object.")||this;return n.errors=t,Object.setPrototypeOf(n,MapperValidationError.prototype),n}__extends(MapperValidationError,e)}(Error);var Ve=function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,a,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(a=n;0!=a--;)if(!equal(e[a],t[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return!1;for(a=n;0!=a--;){var l=i[a];if(!equal(e[l],t[l]))return!1}return!0}return e!=e&&t!=t};
2
2
  /*!
3
3
  * isobject <https://github.com/jonschlinkert/isobject>
4
4
  *
@@ -10,10 +10,10 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import a from"qu
10
10
  *
11
11
  * Copyright (c) 2014-2017, Jon Schlinkert.
12
12
  * Released under the MIT License.
13
- */function isObjectObject(e){return!0===isObject(e)&&"[object Object]"===Object.prototype.toString.call(e)}function isPlainObject$1(e){var t,n;return!1!==isObjectObject(e)&&("function"==typeof(t=e.constructor)&&(!1!==isObjectObject(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}function defaults(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=__read(e),a=n[0],i=n.slice(1),l=__assign({},a);if(0===i.length)return l;if(1===i.length){var o=i[0];for(var s in o)null==l[s]?l[s]=o[s]:isPlainObject(l[s])&&(l[s]=defaults(l[s],o[s]));return l}return i.reduce((function(e,t){return defaults(e,t)}),a)}function isPlainObject(e){return isPlainObject$1(e)}function isEqual$1(e,t){return Ve(e,t)}function toPairs(e){return null!=e?Object.keys(e).map((function(t){return[t,e[t]]})):[]}function fromPairs(e){return Array.isArray(e)?e.reduce((function(e,t){var n;return null!=t?__assign(__assign({},e),((n={})[t[0]]=t[1],n)):e}),{}):{}}var Le=Object.freeze({__proto__:null,defaults:defaults,isPlainObject:isPlainObject,isEqual:isEqual$1,toPairs:toPairs,fromPairs:fromPairs}),Re,_e=new Uint8Array(16);function rng(){if(!Re&&!(Re="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Re(_e)}var je=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return"string"==typeof e&&je.test(e)}for(var Be=[],ze=0;ze<256;++ze)Be.push((ze+256).toString(16).substr(1));function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Be[e[t+0]]+Be[e[t+1]]+Be[e[t+2]]+Be[e[t+3]]+"-"+Be[e[t+4]]+Be[e[t+5]]+"-"+Be[e[t+6]]+Be[e[t+7]]+"-"+Be[e[t+8]]+Be[e[t+9]]+"-"+Be[e[t+10]]+Be[e[t+11]]+Be[e[t+12]]+Be[e[t+13]]+Be[e[t+14]]+Be[e[t+15]]).toLowerCase();if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}function v4(e,t,n){var a=(e=e||{}).random||(e.rng||rng)();return a[6]=15&a[6]|64,a[8]=63&a[8]|128,stringify(a)}function create$1(){return v4()}function fromMsbLsb(e,t){function digits(e,t){var n=BigInt(1)<<t*BigInt(4);return(n|e&n-BigInt(1)).toString(16).substring(1)}var n="string"==typeof e?BigInt(e):e,a="string"==typeof t?BigInt(t):t,i=digits(n>>BigInt(32),BigInt(8)),l=digits(n>>BigInt(16),BigInt(4)),o=digits(n,BigInt(4)),s=digits(a>>BigInt(48),BigInt(4)),r=digits(a,BigInt(12));return"".concat(i,"-").concat(l,"-").concat(o,"-").concat(s,"-").concat(r)}function toMsbLsb(e){var t=__read(e.split("-"),5),n=t[0],a=t[1],i=t[2],l=t[3],o=t[4];if(null==n||null==a||null==i||null==l||null==o)throw new Error("Invalid UUID string ".concat(e));var s=BigInt.asIntN(64,BigInt("0x".concat(n+a+i))),r=BigInt.asIntN(64,BigInt("0x".concat(l+o)));return{msb:s.toString(),lsb:r.toString()}}var De=Object.freeze({__proto__:null,create:create$1,fromMsbLsb:fromMsbLsb,toMsbLsb:toMsbLsb});const Fe=l({key:"viewerToolkitViewerElement",default:void 0,dangerouslyAllowMutability:!0}),He=l({key:"viewerElementId",default:"vertex-viewer"}),Ue=l({key:"viewerInitialSceneReady",default:!1}),We=l({key:"viewerBaseInteractionHandlerProvider",default:Promise.resolve(void 0),dangerouslyAllowMutability:!0}),Ge=l({key:"viewerPrimaryInteractionType",default:"rotate"}),Ke=l({key:"viewerSceneViewId",default:void 0}),$e=o({key:"viewerScene",get:({get:e})=>async()=>{var t;return null===(t=e(Fe))||void 0===t?void 0:t.scene()},dangerouslyAllowMutability:!0}),qe=l({key:"viewerFrameScene",default:void 0,dangerouslyAllowMutability:!0}),Ye=o({key:"viewerSceneVisibleBoundingBox",get:({get:e})=>{var t;return null===(t=e(qe))||void 0===t?void 0:t.boundingBox}});function useViewerSceneActions(){const e=useActionCallback((({snapshot:e})=>async(t,n,...a)=>{const i=await e.getPromise($e),l=await i();a.length>0&&await(null==l?void 0:l.items((e=>a.map((t=>t(e))))).execute({suppliedCorrelationId:n}))})),t=v.useCallback(((...e)=>t=>t.where((t=>t.withItemIds(e))).select()),[]),n=v.useCallback(((...e)=>t=>t.where((t=>t.withItemIds(e))).deselect()),[]),a=v.useCallback((e=>e.where((e=>e.all())).deselect()),[]);return{executeWithCorrelationId:e,execute:useActionCallback((()=>async(t,...n)=>{const a=De.create();await e(t,a,...n)})),selectItemsTransform:t,deselectItemsTransform:n,clearSelectionTransform:a,reset:useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromiseRequired($e),a=await n(),i=await e.getPromiseRequired(Ze);null==a||a.reset({includeCamera:!0,suppliedCorrelationId:t,cameraTypeOverride:i})}))}}const Xe=500;function useViewerCameraActions(){return{flyToById:useActionCallback((({snapshot:e})=>async(t,n)=>{const a=await e.getPromise($e),i=await a();await(null==i?void 0:i.camera().flyTo({itemId:t}).render({animation:{milliseconds:null!=n?n:Xe}}))})),flyToByBoundingBox:useActionCallback((({snapshot:e})=>async(t,n)=>{const a=await e.getPromise($e),i=await a();await(null==i?void 0:i.camera().flyTo({boundingBox:t}).render({animation:{milliseconds:null!=n?n:Xe}}))})),updateCameraType:useActionCallback((({set:e})=>t=>{e(Ze,t)}))}}const Ze=l({key:"viewerCameraType",default:"perspective"});class Je{constructor(){this.interactionStarted=!1}initialize(e,t){this.api=t}dispose(){this.endInteraction()}async beginInteraction(){var e;this.interactionStarted||(await(null===(e=this.api)||void 0===e?void 0:e.beginInteraction()),this.interactionStarted=!0)}async endInteraction(){var e;await(null===(e=this.api)||void 0===e?void 0:e.endInteraction()),this.interactionStarted=!1}}const create=(e,t=0)=>({normal:e,offset:t}),forAxis=(e,t)=>{switch(e){case"x":return x(t);case"y":return y(t);case"z":return z(t)}},x=e=>create(A.left(),-e),y=e=>create(A.down(),-e),z=e=>create(A.forward(),-e),getAxis=(e,t)=>{switch(e){case"x":return xAxis(t);case"y":return yAxis(t);case"z":return zAxis(t)}},Qe={x:A.left(),y:A.down(),z:A.forward()},xAxis=e=>e.x,yAxis=e=>e.y||A.create(e.x.z,e.x.x,e.x.y),zAxis=e=>e.z||A.create(e.x.y,e.x.z,e.x.x),axis=(e,t,n,a)=>e&&e.normal&&[["x",t],["y",n],["z",a]].filter((t=>0===A.magnitude(A.cross(e.normal,t[1])))).map((e=>e[0])).pop(),isNegativeNormal=e=>A.dot(A.create(-1,-1,-1),e.normal)>0,towardsVector=(e,t)=>{const n=undefined;return A.dot(e,t.normal)<0?invert(t):t},towardsCamera=(e,t)=>towardsVector(e.viewVector,t),invert=e=>Object.assign(Object.assign({},e),{normal:A.multiply(e.normal,A.create(-1,-1,-1)),offset:-e.offset}),fromHit=(e,t)=>{const n=A.normalize(e.normal),a=A.dot(n,e.position);return towardsCamera(t,create(n,a))},toAxis=(e,t,n,a,i)=>{const l=n.viewAll(),o=getAxis(e,t),s=null!=a&&null!=o?create(o,A.dot(o,i||T.center(a))):forAxis(e,l.lookAt[e]);return towardsCamera(n,s)};function corners(e){return[A.create(e.min.x,e.min.y,e.min.z),A.create(e.min.x,e.min.y,e.max.z),A.create(e.min.x,e.max.y,e.min.z),A.create(e.min.x,e.max.y,e.max.z),A.create(e.max.x,e.max.y,e.max.z),A.create(e.max.x,e.max.y,e.min.z),A.create(e.max.x,e.min.y,e.max.z),A.create(e.max.x,e.min.y,e.min.z)]}function equals(e,t){return e.min.x===t.min.x&&e.min.y===t.min.y&&e.min.z===t.min.z&&e.max.x===t.max.x&&e.max.y===t.max.y&&e.max.z===t.max.z}const et="#999999",tt=1,nt={default:5,min:0,max:10},at=l({key:"crossSectioningEnabled",default:!1}),it=l({key:"crossSectioningHighlightColor",default:et}),lt=l({key:"crossSectioningBorderWidth",default:1}),ot=l({key:"crossSectioningPlanes",default:[]}),st=l({key:"crossSectioningAlignment",default:{mode:"global",hitPending:!1}}),rt=o({key:"crossSectioningTargetBoundingBox",get:async({get:e})=>{const t=undefined;return e(Ye)}}),ct=l({key:"crossSectioningIsInteractive",default:!1}),dt=l({key:"crossSectioningActiveAxis",default:"x"}),ut=l({key:"crossSectioningAvailableAxes",default:Qe}),mt=o({key:"crossSectioningOffsetScalar",get:({get:e})=>{const t=e(ot);return t.length>0&&isNegativeNormal(t[0])?-1:1}}),pt=o({key:"crossSectioningSliderRange",get:({get:e})=>{const t=e(ot),n=e(rt),a=null!=n?corners(n):[];if(t.length>0){const e=a.map((e=>A.dot(e,isNegativeNormal(t[0])?A.multiply(t[0].normal,A.create(-1,-1,-1)):t[0].normal)));return{default:t[0].offset,min:Math.min(...e)-2,max:Math.max(...e)+2}}return nt}}),ht=o({key:"crossSectioningPlaneDisplayOffset",get:({get:e})=>{const t=e(ot),n=e(mt),a=e(pt);return t.length>0?t[0].offset*n:a.default}}),ft=l({key:"crossSectioningAdditionalToolsOpen",default:!1}),gt=l({key:"crossSectioningAlignmentToolsOpen",default:!1}),vt=l({key:"crossSectioningAxisToolsOpen",default:!1}),yt=l({key:"crossSectioningInteractionHandler",default:new Je,dangerouslyAllowMutability:!0});function useCrossSectioning(e,t){const n=s(yt);v.useEffect((()=>{t&&(null==e||e.registerInteractionHandler(n))}),[e,t,n])}const bt=l({key:"hitResultsTapDetails",default:void 0}),wt=l({key:"hitResultsLongPressDetails",default:void 0}),Ct=l({key:"previousHitResult",default:void 0}),xt=l({key:"currentHitResult",default:void 0}),St=o({key:"hitResult",get:async({get:e})=>{var t,n,a,i,l,o,s,r;const c=e(bt),d=e(wt),u=null!=c?c:d,m=e($e),p=await m(),h=null==p?void 0:p.sceneViewId,f=null==p?void 0:p.raycaster();if(null!=u&&null!=f&&null!=h){const e=await f.hitItems(u.position),c=((null==e?void 0:e.hits)||[])[0];if(null!=c)return{id:null===(t=c.itemId)||void 0===t?void 0:t.hex,normal:A.create((null===(n=null==c?void 0:c.hitNormal)||void 0===n?void 0:n.x)||0,(null===(a=null==c?void 0:c.hitNormal)||void 0===a?void 0:a.y)||0,(null===(i=null==c?void 0:c.hitNormal)||void 0===i?void 0:i.z)||0),position:A.create((null===(l=null==c?void 0:c.hitPoint)||void 0===l?void 0:l.x)||0,(null===(o=null==c?void 0:c.hitPoint)||void 0===o?void 0:o.y)||0,(null===(s=null==c?void 0:c.hitPoint)||void 0===s?void 0:s.z)||0),meta:u.metaKey||u.ctrlKey||!1,metadata:[],ancestors:(null===(r=null==c?void 0:c.ancestors)||void 0===r?void 0:r.filter((e=>{var t;return null!=(null===(t=e.itemId)||void 0===t?void 0:t.hex)})).map((e=>{var t;return null===(t=e.itemId)||void 0===t?void 0:t.hex})))||[]}}}}),kt=l({key:"hitResultsSkipNextTap",default:!1}),alignToNormal=(e,t,n)=>{if(e.toFrameCamera().isPerspective()){const n=A.dot(A.normalize(e.up),t),a=Math.abs(n)>.98?A.normalize(A.scale(-n,e.viewVector)):e.up,i=A.add(A.scale(A.distance(e.position,e.lookAt),A.multiply(t,A.create(-1,-1,-1))),e.lookAt);return e.update({up:a,position:i})}{const a=A.angleTo(A.normalize(e.viewVector),t),i=null!=n?T.center(n):e.lookAt,l=A.normalize(A.cross(A.normalize(e.viewVector),t));return e.rotateAroundAxisAtPoint(a,i,l)}};function isParallelTo(e,t){const n=E.toDegrees(A.angleTo(e,t));return 0===n||180===n}const At=500;function useCrossSectioningActions(){const e=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(lt),n=await e.getPromise(it),a=await e.getPromise(ot),i=await e.getPromise($e),l=await i();await(null==l?void 0:l.crossSectioning().update({sectionPlanes:a,highlightColor:n?Me.fromHexString(n):void 0,lineWidth:t}))})),t=useActionCallback((({set:t,reset:n,snapshot:a})=>async()=>{const i=await a.getPromise($e),l=await i();if(null!=l){const a=l.camera().viewAll();n(ut),t(ot,[towardsCamera(l.camera(),x(a.lookAt.x))]),await e()}})),n=useActionCallback(retainSnapshot((({snapshot:t,set:n})=>async()=>{const a=await t.tryGetPromise(St).then((e=>e.value)),i=await t.getPromise($e),l=await i();if(null!=a&&null!=l){const t=fromHit(a,l.camera());n(ot,null!=t?[t]:[]),n(ut,null!=t?{x:t.normal}:Qe),await e()}}))),a=useActionCallback((({set:e,snapshot:n})=>async()=>{const a=await n.getPromise(ot),i=undefined;await n.getPromise(at)||(e(at,!0),0===a.length&&await t())})),i=useActionCallback((({reset:t,snapshot:n})=>async()=>{const a=undefined;await n.getPromise(at)&&(t(at),t(ft),t(gt),t(vt),t(ot),t(st),t(dt),await e())}));return{enable:a,disable:i,reapply:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(at)&&await e()})),openAdditionalTools:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=undefined;await t.getPromise(at)||await a(),e(ft,!0)})),closeAdditionalTools:useActionCallback((({reset:e})=>()=>{e(ft)})),openAlignmentTools:useActionCallback((({set:e,reset:t})=>()=>{t(vt),e(gt,!0)})),closeAlignmentTools:useActionCallback((({reset:e})=>()=>{e(gt)})),openAxisTools:useActionCallback((({set:e,reset:t})=>()=>{t(gt),e(vt,!0)})),closeAxisTools:useActionCallback((({reset:e})=>()=>{e(vt)})),beginInteraction:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(yt);e(ct,!0),await n.beginInteraction()})),endInteraction:useActionCallback((({reset:e,snapshot:t})=>async()=>{const n=await t.getPromise(yt);e(ct),await n.endInteraction()})),updatePlanes:useActionCallback(retainSnapshot((({set:t,snapshot:n})=>async a=>{const i=await n.getPromise(ot);if(i.length>0){const l=await n.getPromise(mt),o=await n.getPromise(pt),s=l<0?-1*o.max:o.min,r=l<0?-1*o.min:o.max,c=i.map((e=>Object.assign(Object.assign({},e),{offset:Math.min(Math.max(a*l,s),r)})));t(ot,c),await e()}}))),flipPlanes:useActionCallback((({set:t,snapshot:n})=>async()=>{const a=await n.getPromise(ot);t(ot,a.map((e=>invert(e)))),await e()})),alignViewToPlane:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(ot),n=await e.getPromise(Fe),a=await(null==n?void 0:n.scene());t.length>0&&null!=a&&await alignToNormal(a.camera(),t[0].normal,a.boundingBox()).render({animation:{milliseconds:At}})})),updateAxis:useActionCallback(retainSnapshot((({set:t,reset:n,snapshot:a})=>async i=>{const l=await a.getPromise(ot),o=await a.getPromise(ut),s=await a.getPromise(rt),r=await a.getPromise(st),c=await a.getPromise(Fe),d=await(null==c?void 0:c.scene()),u=o[i],m=null!=u&&l.length>0&&isParallelTo(l[0].normal,u)&&!isNaN(A.angleTo(l[0].normal,u));if(null!=d&&!m){const e=await a.tryGetPromise(St).then((e=>e.value));t(dt,i),t(ot,[toAxis(i,o,d.camera(),s,"global"!==r.mode?null==e?void 0:e.position:void 0)])}n(vt),await e()}))),updateAlignment:useActionCallback((({set:e,reset:i})=>async(l,o)=>{i(gt),e(st,{mode:l,hitPending:"global"!==l&&null==o}),"global"===l?(i(dt),i(ut),await t()):"surface"===l&&null!=o&&(await a(),await n())})),sectionCurrentHit:useActionCallback((({set:e,snapshot:t})=>async()=>{const a=await t.getPromise(st);a.hitPending&&(e(st,Object.assign(Object.assign({},a),{hitPending:!1})),"surface"===a.mode&&await n())})),cancelCurrentHit:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(st);n.hitPending&&e(st,Object.assign(Object.assign({},n),{hitPending:!1}))}))}}var Tt=Object.freeze({__proto__:null,DEFAULT_ALIGN_TO_PLANE_ANIMATION_DURATION_MS:At,DEFAULT_CROSS_SECTION_HIGHLIGHT_COLOR:et,DEFAULT_CROSS_SECTION_LINE_THICKNESS_VALUE:1,DEFAULT_SLIDER_RANGE:nt,crossSectioningActiveAxis:dt,crossSectioningAdditionalToolsOpen:ft,crossSectioningAlignment:st,crossSectioningAlignmentToolsOpen:gt,crossSectioningAvailableAxes:ut,crossSectioningAxisToolsOpen:vt,crossSectioningBorderWidth:lt,crossSectioningEnabled:at,crossSectioningHighlightColor:it,crossSectioningInteractionHandler:yt,crossSectioningIsInteractive:ct,crossSectioningOffsetScalar:mt,crossSectioningPlaneDisplayOffset:ht,crossSectioningPlanes:ot,crossSectioningSliderRange:pt,crossSectioningTargetBoundingBox:rt,useCrossSectioning:useCrossSectioning,useCrossSectioningActions:useCrossSectioningActions});function useDebouncedCallback(e,t){const[n,a]=v.useState();return v.useEffect((()=>()=>{null!=n&&clearTimeout(n)}),[e,t,n]),v.useCallback((i=>{const handler=()=>{e(i)};null!=n&&clearTimeout(n),a(setTimeout(handler,t))}),[e,t,n])}const VertexColorPicker=t=>{var{onInput:n}=t,a=__rest(t,["onInput"]);const i=useDebouncedCallback((e=>{null==n||n(e)}),500),l=v.useCallback((e=>{const t=e.target;i(t.value)}),[i]);return e(I,Object.assign({onInput:l},a))},VertexCrossSectionAppearanceColorPicker=({onUpdate:t})=>{const n=useCrossSectioningActions(),[a,i]=r(it);return e(VertexColorPicker,{"data-testid":"cross-section-highlight-color-picker",value:a,onValueChanged:e=>{null==t||t(e.detail)},onInput:async e=>{i(e),await n.reapply()}})};var Et={exports:{}},Pt;
13
+ */function isObjectObject(e){return!0===isObject(e)&&"[object Object]"===Object.prototype.toString.call(e)}function isPlainObject$1(e){var t,n;return!1!==isObjectObject(e)&&("function"==typeof(t=e.constructor)&&(!1!==isObjectObject(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}function defaults(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=__read(e),a=n[0],i=n.slice(1),l=__assign({},a);if(0===i.length)return l;if(1===i.length){var o=i[0];for(var s in o)null==l[s]?l[s]=o[s]:isPlainObject(l[s])&&(l[s]=defaults(l[s],o[s]));return l}return i.reduce((function(e,t){return defaults(e,t)}),a)}function isPlainObject(e){return isPlainObject$1(e)}function isEqual$1(e,t){return Ve(e,t)}function toPairs(e){return null!=e?Object.keys(e).map((function(t){return[t,e[t]]})):[]}function fromPairs(e){return Array.isArray(e)?e.reduce((function(e,t){var n;return null!=t?__assign(__assign({},e),((n={})[t[0]]=t[1],n)):e}),{}):{}}var Le=Object.freeze({__proto__:null,defaults:defaults,isPlainObject:isPlainObject,isEqual:isEqual$1,toPairs:toPairs,fromPairs:fromPairs}),Re,_e=new Uint8Array(16);function rng(){if(!Re&&!(Re="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Re(_e)}var je=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return"string"==typeof e&&je.test(e)}for(var Be=[],ze=0;ze<256;++ze)Be.push((ze+256).toString(16).substr(1));function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Be[e[t+0]]+Be[e[t+1]]+Be[e[t+2]]+Be[e[t+3]]+"-"+Be[e[t+4]]+Be[e[t+5]]+"-"+Be[e[t+6]]+Be[e[t+7]]+"-"+Be[e[t+8]]+Be[e[t+9]]+"-"+Be[e[t+10]]+Be[e[t+11]]+Be[e[t+12]]+Be[e[t+13]]+Be[e[t+14]]+Be[e[t+15]]).toLowerCase();if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}function v4(e,t,n){var a=(e=e||{}).random||(e.rng||rng)();return a[6]=15&a[6]|64,a[8]=63&a[8]|128,stringify(a)}function create$1(){return v4()}function fromMsbLsb(e,t){function digits(e,t){var n=BigInt(1)<<t*BigInt(4);return(n|e&n-BigInt(1)).toString(16).substring(1)}var n="string"==typeof e?BigInt(e):e,a="string"==typeof t?BigInt(t):t,i=digits(n>>BigInt(32),BigInt(8)),l=digits(n>>BigInt(16),BigInt(4)),o=digits(n,BigInt(4)),s=digits(a>>BigInt(48),BigInt(4)),r=digits(a,BigInt(12));return"".concat(i,"-").concat(l,"-").concat(o,"-").concat(s,"-").concat(r)}function toMsbLsb(e){var t=__read(e.split("-"),5),n=t[0],a=t[1],i=t[2],l=t[3],o=t[4];if(null==n||null==a||null==i||null==l||null==o)throw new Error("Invalid UUID string ".concat(e));var s=BigInt.asIntN(64,BigInt("0x".concat(n+a+i))),r=BigInt.asIntN(64,BigInt("0x".concat(l+o)));return{msb:s.toString(),lsb:r.toString()}}var De=Object.freeze({__proto__:null,create:create$1,fromMsbLsb:fromMsbLsb,toMsbLsb:toMsbLsb});const He=l({key:"viewerToolkitViewerElement",default:void 0,dangerouslyAllowMutability:!0}),Fe=l({key:"viewerElementId",default:"vertex-viewer"}),Ue=l({key:"viewerInitialSceneReady",default:!1}),We=l({key:"viewerBaseInteractionHandlerProvider",default:Promise.resolve(void 0),dangerouslyAllowMutability:!0}),Ge=l({key:"viewerPrimaryInteractionType",default:"rotate"}),Ke=l({key:"viewerSceneViewId",default:void 0}),$e=o({key:"viewerScene",get:({get:e})=>async()=>{var t;return null===(t=e(He))||void 0===t?void 0:t.scene()},dangerouslyAllowMutability:!0}),qe=l({key:"viewerFrameScene",default:void 0,dangerouslyAllowMutability:!0}),Ye=o({key:"viewerSceneVisibleBoundingBox",get:({get:e})=>{var t;return null===(t=e(qe))||void 0===t?void 0:t.boundingBox}});function useViewerSceneActions(){const e=useActionCallback((({snapshot:e})=>async(t,n,...a)=>{const i=await e.getPromise($e),l=await i();a.length>0&&await(null==l?void 0:l.items((e=>a.map((t=>t(e))))).execute({suppliedCorrelationId:n}))})),t=v.useCallback(((...e)=>t=>t.where((t=>t.withItemIds(e))).select()),[]),n=v.useCallback(((...e)=>t=>t.where((t=>t.withItemIds(e))).deselect()),[]),a=v.useCallback((e=>e.where((e=>e.all())).deselect()),[]);return{executeWithCorrelationId:e,execute:useActionCallback((()=>async(t,...n)=>{const a=De.create();await e(t,a,...n)})),selectItemsTransform:t,deselectItemsTransform:n,clearSelectionTransform:a,reset:useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromiseRequired($e),a=await n(),i=await e.getPromiseRequired(Ze);null==a||a.reset({includeCamera:!0,suppliedCorrelationId:t,cameraTypeOverride:i})}))}}const Xe=500;function useViewerCameraActions(){return{flyToById:useActionCallback((({snapshot:e})=>async(t,n)=>{const a=await e.getPromise($e),i=await a();await(null==i?void 0:i.camera().flyTo({itemId:t}).render({animation:{milliseconds:null!=n?n:Xe}}))})),flyToByBoundingBox:useActionCallback((({snapshot:e})=>async(t,n)=>{const a=await e.getPromise($e),i=await a();await(null==i?void 0:i.camera().flyTo({boundingBox:t}).render({animation:{milliseconds:null!=n?n:Xe}}))})),updateCameraType:useActionCallback((({set:e})=>t=>{e(Ze,t)}))}}const Ze=l({key:"viewerCameraType",default:"perspective"});class Je{constructor(){this.interactionStarted=!1}initialize(e,t){this.api=t}dispose(){this.endInteraction()}async beginInteraction(){var e;this.interactionStarted||(await(null===(e=this.api)||void 0===e?void 0:e.beginInteraction()),this.interactionStarted=!0)}async endInteraction(){var e;await(null===(e=this.api)||void 0===e?void 0:e.endInteraction()),this.interactionStarted=!1}}const create=(e,t=0)=>({normal:e,offset:t}),forAxis=(e,t)=>{switch(e){case"x":return x(t);case"y":return y(t);case"z":return z(t)}},x=e=>create(A.left(),-e),y=e=>create(A.down(),-e),z=e=>create(A.forward(),-e),getAxis=(e,t)=>{switch(e){case"x":return xAxis(t);case"y":return yAxis(t);case"z":return zAxis(t)}},Qe={x:A.left(),y:A.down(),z:A.forward()},xAxis=e=>e.x,yAxis=e=>e.y||A.create(e.x.z,e.x.x,e.x.y),zAxis=e=>e.z||A.create(e.x.y,e.x.z,e.x.x),axis=(e,t,n,a)=>e&&e.normal&&[["x",t],["y",n],["z",a]].filter((t=>0===A.magnitude(A.cross(e.normal,t[1])))).map((e=>e[0])).pop(),isNegativeNormal=e=>A.dot(A.create(-1,-1,-1),e.normal)>0,towardsVector=(e,t)=>{const n=undefined;return A.dot(e,t.normal)<0?invert(t):t},towardsCamera=(e,t)=>towardsVector(e.viewVector,t),invert=e=>Object.assign(Object.assign({},e),{normal:A.multiply(e.normal,A.create(-1,-1,-1)),offset:-e.offset}),fromHit=(e,t)=>{const n=A.normalize(e.normal),a=A.dot(n,e.position);return towardsCamera(t,create(n,a))},toAxis=(e,t,n,a,i)=>{const l=n.viewAll(),o=getAxis(e,t),s=null!=a&&null!=o?create(o,A.dot(o,i||T.center(a))):forAxis(e,l.lookAt[e]);return towardsCamera(n,s)};function corners(e){return[A.create(e.min.x,e.min.y,e.min.z),A.create(e.min.x,e.min.y,e.max.z),A.create(e.min.x,e.max.y,e.min.z),A.create(e.min.x,e.max.y,e.max.z),A.create(e.max.x,e.max.y,e.max.z),A.create(e.max.x,e.max.y,e.min.z),A.create(e.max.x,e.min.y,e.max.z),A.create(e.max.x,e.min.y,e.min.z)]}function equals(e,t){return e.min.x===t.min.x&&e.min.y===t.min.y&&e.min.z===t.min.z&&e.max.x===t.max.x&&e.max.y===t.max.y&&e.max.z===t.max.z}const et="#999999",tt=1,nt={default:5,min:0,max:10},at=l({key:"crossSectioningEnabled",default:!1}),it=l({key:"crossSectioningHighlightColor",default:et}),lt=l({key:"crossSectioningBorderWidth",default:1}),ot=l({key:"crossSectioningPlanes",default:[]}),st=l({key:"crossSectioningAlignment",default:{mode:"global",hitPending:!1}}),rt=o({key:"crossSectioningTargetBoundingBox",get:async({get:e})=>{const t=undefined;return e(Ye)}}),ct=l({key:"crossSectioningIsInteractive",default:!1}),dt=l({key:"crossSectioningActiveAxis",default:"x"}),ut=l({key:"crossSectioningAvailableAxes",default:Qe}),mt=o({key:"crossSectioningOffsetScalar",get:({get:e})=>{const t=e(ot);return t.length>0&&isNegativeNormal(t[0])?-1:1}}),pt=o({key:"crossSectioningSliderRange",get:({get:e})=>{const t=e(ot),n=e(rt),a=null!=n?corners(n):[];if(t.length>0){const e=a.map((e=>A.dot(e,isNegativeNormal(t[0])?A.multiply(t[0].normal,A.create(-1,-1,-1)):t[0].normal)));return{default:t[0].offset,min:Math.min(...e)-2,max:Math.max(...e)+2}}return nt}}),ht=o({key:"crossSectioningPlaneDisplayOffset",get:({get:e})=>{const t=e(ot),n=e(mt),a=e(pt);return t.length>0?t[0].offset*n:a.default}}),ft=l({key:"crossSectioningAdditionalToolsOpen",default:!1}),gt=l({key:"crossSectioningAlignmentToolsOpen",default:!1}),vt=l({key:"crossSectioningAxisToolsOpen",default:!1}),yt=l({key:"crossSectioningInteractionHandler",default:new Je,dangerouslyAllowMutability:!0});function useCrossSectioning(e,t){const n=s(yt);v.useEffect((()=>{t&&(null==e||e.registerInteractionHandler(n))}),[e,t,n])}const bt=l({key:"hitResultsTapDetails",default:void 0}),wt=l({key:"hitResultsLongPressDetails",default:void 0}),Ct=l({key:"previousHitResult",default:void 0}),xt=l({key:"currentHitResult",default:void 0}),St=o({key:"hitResult",get:async({get:e})=>{var t,n,a,i,l,o,s,r;const c=e(bt),d=e(wt),u=null!=c?c:d,m=e($e),p=await m(),h=null==p?void 0:p.sceneViewId,f=null==p?void 0:p.raycaster();if(null!=u&&null!=f&&null!=h){const e=await f.hitItems(u.position),c=((null==e?void 0:e.hits)||[])[0];if(null!=c)return{id:null===(t=c.itemId)||void 0===t?void 0:t.hex,normal:A.create((null===(n=null==c?void 0:c.hitNormal)||void 0===n?void 0:n.x)||0,(null===(a=null==c?void 0:c.hitNormal)||void 0===a?void 0:a.y)||0,(null===(i=null==c?void 0:c.hitNormal)||void 0===i?void 0:i.z)||0),position:A.create((null===(l=null==c?void 0:c.hitPoint)||void 0===l?void 0:l.x)||0,(null===(o=null==c?void 0:c.hitPoint)||void 0===o?void 0:o.y)||0,(null===(s=null==c?void 0:c.hitPoint)||void 0===s?void 0:s.z)||0),meta:u.metaKey||u.ctrlKey||!1,metadata:[],ancestors:(null===(r=null==c?void 0:c.ancestors)||void 0===r?void 0:r.filter((e=>{var t;return null!=(null===(t=e.itemId)||void 0===t?void 0:t.hex)})).map((e=>{var t;return null===(t=e.itemId)||void 0===t?void 0:t.hex})))||[]}}}}),kt=l({key:"hitResultsSkipNextTap",default:!1}),alignToNormal=(e,t,n)=>{if(e.toFrameCamera().isPerspective()){const n=A.dot(A.normalize(e.up),t),a=Math.abs(n)>.98?A.normalize(A.scale(-n,e.viewVector)):e.up,i=A.add(A.scale(A.distance(e.position,e.lookAt),A.multiply(t,A.create(-1,-1,-1))),e.lookAt);return e.update({up:a,position:i})}{const a=A.angleTo(A.normalize(e.viewVector),t),i=null!=n?T.center(n):e.lookAt,l=A.normalize(A.cross(A.normalize(e.viewVector),t));return e.rotateAroundAxisAtPoint(a,i,l)}};function isParallelTo(e,t){const n=P.toDegrees(A.angleTo(e,t));return 0===n||180===n}const At=500;function useCrossSectioningActions(){const e=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(lt),n=await e.getPromise(it),a=await e.getPromise(ot),i=await e.getPromise($e),l=await i();await(null==l?void 0:l.crossSectioning().update({sectionPlanes:a,highlightColor:n?Me.fromHexString(n):void 0,lineWidth:t}))})),t=useActionCallback((({set:t,reset:n,snapshot:a})=>async()=>{const i=await a.getPromise($e),l=await i();if(null!=l){const a=l.camera().viewAll();n(ut),t(ot,[towardsCamera(l.camera(),x(a.lookAt.x))]),await e()}})),n=useActionCallback(retainSnapshot((({snapshot:t,set:n})=>async()=>{const a=await t.tryGetPromise(St).then((e=>e.value)),i=await t.getPromise($e),l=await i();if(null!=a&&null!=l){const t=fromHit(a,l.camera());n(ot,null!=t?[t]:[]),n(ut,null!=t?{x:t.normal}:Qe),await e()}}))),a=useActionCallback((({set:e,snapshot:n})=>async()=>{const a=await n.getPromise(ot),i=undefined;await n.getPromise(at)||(e(at,!0),0===a.length&&await t())})),i=useActionCallback((({reset:t,snapshot:n})=>async()=>{const a=undefined;await n.getPromise(at)&&(t(at),t(ft),t(gt),t(vt),t(ot),t(st),t(dt),await e())}));return{enable:a,disable:i,reapply:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(at)&&await e()})),openAdditionalTools:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=undefined;await t.getPromise(at)||await a(),e(ft,!0)})),closeAdditionalTools:useActionCallback((({reset:e})=>()=>{e(ft)})),openAlignmentTools:useActionCallback((({set:e,reset:t})=>()=>{t(vt),e(gt,!0)})),closeAlignmentTools:useActionCallback((({reset:e})=>()=>{e(gt)})),openAxisTools:useActionCallback((({set:e,reset:t})=>()=>{t(gt),e(vt,!0)})),closeAxisTools:useActionCallback((({reset:e})=>()=>{e(vt)})),beginInteraction:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(yt);e(ct,!0),await n.beginInteraction()})),endInteraction:useActionCallback((({reset:e,snapshot:t})=>async()=>{const n=await t.getPromise(yt);e(ct),await n.endInteraction()})),updatePlanes:useActionCallback(retainSnapshot((({set:t,snapshot:n})=>async a=>{const i=await n.getPromise(ot);if(i.length>0){const l=await n.getPromise(mt),o=await n.getPromise(pt),s=l<0?-1*o.max:o.min,r=l<0?-1*o.min:o.max,c=i.map((e=>Object.assign(Object.assign({},e),{offset:Math.min(Math.max(a*l,s),r)})));t(ot,c),await e()}}))),flipPlanes:useActionCallback((({set:t,snapshot:n})=>async()=>{const a=await n.getPromise(ot);t(ot,a.map((e=>invert(e)))),await e()})),alignViewToPlane:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(ot),n=await e.getPromise(He),a=await(null==n?void 0:n.scene());t.length>0&&null!=a&&await alignToNormal(a.camera(),t[0].normal,a.boundingBox()).render({animation:{milliseconds:At}})})),updateAxis:useActionCallback(retainSnapshot((({set:t,reset:n,snapshot:a})=>async i=>{const l=await a.getPromise(ot),o=await a.getPromise(ut),s=await a.getPromise(rt),r=await a.getPromise(st),c=await a.getPromise(He),d=await(null==c?void 0:c.scene()),u=o[i],m=null!=u&&l.length>0&&isParallelTo(l[0].normal,u)&&!isNaN(A.angleTo(l[0].normal,u));if(null!=d&&!m){const e=await a.tryGetPromise(St).then((e=>e.value));t(dt,i),t(ot,[toAxis(i,o,d.camera(),s,"global"!==r.mode?null==e?void 0:e.position:void 0)])}n(vt),await e()}))),updateAlignment:useActionCallback((({set:e,reset:i})=>async(l,o)=>{i(gt),e(st,{mode:l,hitPending:"global"!==l&&null==o}),"global"===l?(i(dt),i(ut),await t()):"surface"===l&&null!=o&&(await a(),await n())})),sectionCurrentHit:useActionCallback((({set:e,snapshot:t})=>async()=>{const a=await t.getPromise(st);a.hitPending&&(e(st,Object.assign(Object.assign({},a),{hitPending:!1})),"surface"===a.mode&&await n())})),cancelCurrentHit:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(st);n.hitPending&&e(st,Object.assign(Object.assign({},n),{hitPending:!1}))}))}}var Tt=Object.freeze({__proto__:null,DEFAULT_ALIGN_TO_PLANE_ANIMATION_DURATION_MS:At,DEFAULT_CROSS_SECTION_HIGHLIGHT_COLOR:et,DEFAULT_CROSS_SECTION_LINE_THICKNESS_VALUE:1,DEFAULT_SLIDER_RANGE:nt,crossSectioningActiveAxis:dt,crossSectioningAdditionalToolsOpen:ft,crossSectioningAlignment:st,crossSectioningAlignmentToolsOpen:gt,crossSectioningAvailableAxes:ut,crossSectioningAxisToolsOpen:vt,crossSectioningBorderWidth:lt,crossSectioningEnabled:at,crossSectioningHighlightColor:it,crossSectioningInteractionHandler:yt,crossSectioningIsInteractive:ct,crossSectioningOffsetScalar:mt,crossSectioningPlaneDisplayOffset:ht,crossSectioningPlanes:ot,crossSectioningSliderRange:pt,crossSectioningTargetBoundingBox:rt,useCrossSectioning:useCrossSectioning,useCrossSectioningActions:useCrossSectioningActions});function useDebouncedCallback(e,t){const[n,a]=v.useState();return v.useEffect((()=>()=>{null!=n&&clearTimeout(n)}),[e,t,n]),v.useCallback((i=>{const handler=()=>{e(i)};null!=n&&clearTimeout(n),a(setTimeout(handler,t))}),[e,t,n])}const VertexColorPicker=t=>{var{onInput:n}=t,a=__rest(t,["onInput"]);const i=useDebouncedCallback((e=>{null==n||n(e)}),500),l=v.useCallback((e=>{const t=e.target;i(t.value)}),[i]);return e(I,Object.assign({onInput:l},a))},VertexCrossSectionAppearanceColorPicker=({onUpdate:t})=>{const n=useCrossSectioningActions(),[a,i]=r(it);return e(VertexColorPicker,{"data-testid":"cross-section-highlight-color-picker",value:a,onValueChanged:e=>{null==t||t(e.detail)},onInput:async e=>{i(e),await n.reapply()}})};var Pt={exports:{}},Et;
14
14
  /*!
15
15
  Copyright (c) 2018 Jed Watson.
16
16
  Licensed under the MIT License (MIT), see
17
17
  http://jedwatson.github.io/classnames
18
- */Pt=Et,function(){var e={}.hasOwnProperty;function classNames(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=appendClass(e,parseValue(n)))}return e}function parseValue(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return classNames.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var n="";for(var a in t)e.call(t,a)&&t[a]&&(n=appendClass(n,a));return n}function appendClass(e,t){return t?e?e+" "+t:e+t:e}Pt.exports?(classNames.default=classNames,Pt.exports=classNames):window.classNames=classNames}();var Nt=Et.exports;const VertexSlider=n=>{var{value:a,defaultValue:i,leftLabel:l,rightLabel:o,onChange:s,onValueChange:r,onValueInput:c}=n,d=__rest(n,["value","defaultValue","leftLabel","rightLabel","onChange","onValueChange","onValueInput"]);const[u,m]=v.useState(i);return t("div",{className:"flex w-full items-center gap-2",children:[l&&e("div",{className:"pl-0.5 text-xs text-center",children:l}),e(M,Object.assign({className:Nt("w-full",{"mt-0.5":null!=l||null!=o}),value:null!=a?a:u,onValueChange:e=>{m(e.detail.value),null==s||s(e.detail.value),null==r||r(e)},onValueInput:e=>{m(e.detail.value),null==s||s(e.detail.value),null==c||c(e)}},d)),o&&e("div",{className:"text-xs pr-2 flex-shrink-0 text-right",children:o})]})},VertexCrossSectionAppearanceLineThicknessSlider=({onUpdate:t})=>{const n=useCrossSectioningActions(),[a,i]=r(lt);return e(VertexSlider,{id:"cross-section-line-thickness","data-testid":"cross-section-line-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:a,valueLabelDisplay:"auto",onValueInput:async e=>{i(e.detail.value),await n.reapply()},onValueChange:e=>{null==t||t(e.detail.value)}})};function VertexCrossSectionAppearanceControls({onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexCrossSectionAppearanceColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexCrossSectionAppearanceLineThicknessSlider,{onUpdate:i})]})}function PanelSection({header:n,children:a}){return t("div",{className:"py-3 px-4 border-neutral-300 border-b",children:[e("div",{className:"my-2 text-base text-neutral-700",children:n}),a]})}const VertexCrossSectionAppearanceReset=({onReset:t})=>{const n=useCrossSectioningActions(),[a,i]=r(it),[l,o]=r(lt),s=undefined;return e("div",{className:"ml-auto",children:e(V,{content:"Reset Cross Sectioning Appearance",children:e(L,{"data-testid":"cross-section-appearance-reset",iconName:"reset",iconSize:"sm",onClick:async()=>{i(et),o(1),null==t||t(),await n.reapply()},disabled:!(a!==et||1!==l)})})})};function VertexCrossSectionAppearancePanelSection({onResetCrossSectionAppearance:n,onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Cross Sectioning",e(VertexCrossSectionAppearanceReset,{onReset:n})]}),children:e(VertexCrossSectionAppearanceControls,{onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i})})}const Ot=.5,It="#444444",Mt=l({key:"featureEdgesSelectedColor",default:It}),Vt=l({key:"featureEdgesLineThickness",default:Ot}),VertexFeatureEdgesColorPicker=({onUpdate:t})=>{const[n,a]=r(Mt);return e(VertexColorPicker,{"data-testid":"feature-edges-color-picker",value:n,onValueChanged:e=>{null==t||t(e.detail)},onInput:e=>a(e)})},VertexFeatureEdgesThicknessSlider=({onUpdate:t})=>{const[n,a]=r(Vt);return e(VertexSlider,{id:"feature-edges-thickness","data-testid":"feature-edges-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{null==t||t(e.detail.value)}})};function VertexFeatureEdgesControls({onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexFeatureEdgesColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexFeatureEdgesThicknessSlider,{onUpdate:i})]})}const VertexFeatureEdgesReset=({onReset:t})=>{const[n,a]=r(Mt),[i,l]=r(Vt),o=undefined;return e("div",{className:"ml-auto",children:e(V,{content:"Reset Feature Edges",children:e(L,{"data-testid":"feature-edges-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(It),l(Ot),null==t||t()},disabled:!(i!==Ot||n!==It)})})})};function VertexFeatureEdgesPanelSection({onResetFeatureEdges:n,onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Feature Edges",e(VertexFeatureEdgesReset,{onReset:n})]}),children:e(VertexFeatureEdgesControls,{onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i})})}function contextMenuItemIsRow(e){var t;return null!=e&&null!=(null===(t=null==e?void 0:e.node)||void 0===t?void 0:t.id)}const Lt=l({key:"contextMenuActive",default:void 0}),Rt=l({key:"contextMenuPosition",default:void 0}),_t=l({key:"contextMenuTarget",default:void 0}),jt=l({key:"contextMenuItem",default:void 0}),Bt=l({key:"contextMenuActions",default:[]}),zt=o({key:"contextMenuActivePosition",get:({get:e})=>null!=e(Lt)?e(Rt):void 0});function useContextMenuActions(){return{pointerDown:useActionCallback((({set:e})=>async t=>{if(2===t.button){const n=t.clientX,a=null==t?void 0:t.clientY;e(Rt,P.create(n,a)),e(_t,t.target)}})),pointerUp:useActionCallback((({snapshot:e,set:t})=>async(n,a,i,l)=>{const o=await e.getPromise(Rt),s=await e.getPromise(Lt);if(null!=o&&null==s){const e=n.clientX,s=null==n?void 0:n.clientY,r=P.create(e,s),c=null!=o?P.distance(o,r):0,d=null==i||i(n);c<2&&d&&(null==l||l(n,null!=o?o:r),t(Lt,a))}})),contextMenu:useActionCallback((()=>(e,t)=>{(null==t||t(e))&&e.preventDefault()})),longPress:useActionCallback((({set:e})=>(t,n,a,i)=>{if(null==a||a(t)){const a=P.create(t.touches[0].clientX,t.touches[0].clientY);e(Rt,a),e(_t,t.target),e(Lt,n),null==i||i(t,a)}})),clearActiveContextMenu:useActionCallback((({reset:e,set:t})=>n=>{t(kt,!!n),e(Lt),e(Bt),e(Rt)})),clearDismissedState:useActionCallback((({reset:e})=>()=>e(kt)))}}function targetWithinMenu(e){return e.target instanceof Element&&isChildOf("vertex-menu",e.target)}function targetShouldSkipNextHit(e){return e.target instanceof Element&&isChildOf("vertex-viewer",e.target)}function isChildOf(e,t){return null!=t.closest(e)}const Dt=l({key:"boxSelectionEnabled",default:!1}),Ft=l({key:"boxSelectionOperationType",default:"clearAndSelect"}),useBoxSelectionActions=()=>({enable:useActionCallback((({set:e})=>()=>{e(Dt,!0)})),disable:useActionCallback((({reset:e})=>async()=>{e(Dt),e(Ft)})),setOperationType:useActionCallback((({set:e})=>t=>{e(Ft,t)}))});async function whenComponentReady(e,t){return null!=e&&null!=e.nodeName&&await customElements.whenDefined(e.nodeName.toLowerCase()),"function"==typeof(null==e?void 0:e.componentOnReady)?(await(null==e?void 0:e.componentOnReady()),t()):void 0}const Ht=l({key:"isEditingPointToPointMeasurement",default:!1}),Ut=l({key:"pointToPointMeasurementOutcome",default:void 0}),Wt=l({key:"editedPointToPointMeasurement",default:void 0});function usePointToPointMeasurement(e){const t=c(Ut);b((()=>{let n;return whenComponentReady(e,(()=>{n=null==e?void 0:e.measurementModel.onOutcomeChanged(t)})),()=>null==n?void 0:n.dispose()}),[e,t])}const Gt=2,Kt=l({key:"isEditingPreciseMeasurement",default:!1}),$t=l({key:"preciseMeasurementOutcome",default:void 0}),qt=l({key:"preciseMeasurementController",dangerouslyAllowMutability:!0,default:void 0}),Yt=l({key:"preciseMeasurementOverlays",dangerouslyAllowMutability:!0,default:void 0}),Xt=l({key:"preciseMeasurementEntities",dangerouslyAllowMutability:!0,default:[]}),Zt=o({key:"preciseMeasurementMessage",get:({get:e})=>{const t=undefined;return 0===e(Xt).length?"Select a surface":void 0}});function usePreciseMeasurementModel(e,t,n){const a=c(Xt),i=c($t),l=c(qt),o=c(Yt),r=s(qt);b((()=>{let n;return whenComponentReady(e,(()=>{n=null==e?void 0:e.measurementModel.onEntitiesChanged((e=>{a(e),null==t||t(e)}))})),()=>null==n?void 0:n.dispose()}),[e,a]),b((()=>{let t;return whenComponentReady(e,(()=>{t=null==e?void 0:e.measurementModel.onOutcomeChanged((e=>{i(e),null==n||n(e)}))})),()=>null==t?void 0:t.dispose()}),[e,i]),b((()=>{let t;return whenComponentReady(e,(()=>{t=null==e?void 0:e.measurementModel.onEntitiesChanged((e=>{if(e.length>2){const t=e[2];null==r||r.setEntities(new Set([t]))}}))})),()=>null==t?void 0:t.dispose()}),[e,r]),b((()=>{whenComponentReady(e,(()=>{l(null==e?void 0:e.measurementController)}))}),[e,l]),b((()=>{whenComponentReady(e,(()=>{o(null==e?void 0:e.measurementOverlays)}))}),[e,o])}function useMeasurementActions(){const e=useBoxSelectionActions(),t=useEnablePointToPointMeasurement(),n=useDisablePointToPointMeasurement(),a=useDisablePreciseMeasurement(),i=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(qt);null==t||t.clearEntities()})),l=useActionCallback((()=>async(e={})=>{await i(),n(e),a()})),o=useActionCallback((({set:e,reset:n})=>async a=>{await l(),"point-to-point"===a?t():(n($t),n(Xt),e(Kt,!0))}));return{disableEditMeasurement:useActionCallback((()=>async e=>{await l(e)})),enableEditMeasurement:useActionCallback((()=>async e=>{await o(e)})),resetMeasurement:useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=await e.getPromise(Kt),a=await e.getPromise(Ht);n?await i():a&&(t(Ut),t(Wt))})),clearEditedPointToPointMeasurement:useActionCallback((({reset:e})=>()=>{e(Wt)})),setEditedPointToPointMeasurement:useActionCallback((({set:e})=>t=>{e(Wt,t)})),toggleEditPointToPointMeasurement:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(Ht)?await l():await o("point-to-point"),e.disable()})),toggleEditPreciseMeasurement:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(Kt)?await l():await o("precise"),e.disable()}))}}function useEnablePointToPointMeasurement(){return useActionCallback((({reset:e,set:t})=>(n={})=>{t(Ht,!0),n.keepExistingMeasurement||e(Ut)}))}function useDisablePointToPointMeasurement(){return useActionCallback((({reset:e})=>(t={})=>{e(Ht),t.keepExistingMeasurement||(e(Wt),e(Ut))}))}function useDisablePreciseMeasurement(){return useActionCallback((({reset:e})=>async()=>{e(Kt),e($t),e(Xt)}))}const Jt=o({key:"isEditingMeasurement",get:({get:e})=>e(Ht)||e(Kt)}),Qt=o({key:"measurementPanelModel",get:({get:e})=>e(Ut)||e($t)}),en=o({key:"measurementPanelOverlays",dangerouslyAllowMutability:!0,get:({get:e})=>e(Yt)}),tn=o({key:"measurementPanelMessage",get:({get:e})=>{const t=undefined;return e(Kt)?e(Zt):void 0}}),nn=o({key:"measurementPanelIsResettable",get:({get:e})=>e(Jt)&&null!=e(Qt)}),an=3e3,ln=l({key:"applicationMessageToast",default:void 0}),on=l({key:"applicationMessageBanner",default:void 0}),useApplicationMessageActions=()=>({setBannerMessage:useActionCallback((({set:e})=>t=>{e(on,null!=t?Object.assign(Object.assign({},t),{id:De.create()}):void 0)})),setToastMessage:useActionCallback((({set:e})=>t=>{e(ln,null!=t?Object.assign(Object.assign({},t),{id:De.create()}):void 0)}))});var sn;!function(e){e.HIDE_ITEM="Hide Item",e.SHOW_ONLY_SELECTED="Show Only Selected",e.HIDE_SELECTED="Hide Selected",e.SHOW_ONLY_ITEM="Show Only Item",e.SHOW_ALL="Show All",e.HIDE_ALL="Hide All",e.SELECT_FILTERED_ITEMS="Select Filtered Items",e.INVERT_SELECTION="Invert Selection",e.CLEAR_ALL_TRANSFORMS="Clear All Transforms",e.CLEAR_SELECTED_TRANSFORMS="Clear Selected Transforms",e.CLEAR_SELECTION="Clear Selection",e.DESELECTING_ITEMS="Deselecting Items",e.SELECTING_ITEMS="Selecting Items",e.SELECTING_ONLY_ITEM="Selecting Only Item",e.SELECTING_ANCESTOR="Selecting Ancestor",e.APPLY_MATERIAL_OVERRIDE_TO_ALL="Apply Material Override To All",e.APPLY_MATERIAL_OVERRIDE_TO_SELECTION="Apply Material Override To Selection",e.CLEAR_ALL_MATERIAL_OVERRIDES="Clear All Material Overrides",e.CLEAR_SELECTED_MATERIAL_OVERRIDES="Clear Selected Material Overrides",e.SET_PHANTOM_ALL="Set Phantom All",e.SET_PHANTOM_SELECTED_ITEMS="Set Phantom Selected Items",e.CLEAR_PHANTOM_ALL="Clear Phantom All",e.CLEAR_PHANTOM_SELECTED_ITEMS="Clear Phantom Selected Items",e.SET_PHANTOM_NON_SELECTED_ITEMS="Set Phantom Non Selected Items",e.RESTORE_PHANTOM_OVERRIDES="Restore Phantom Overrides",e.SET_ITEM_AS_END_ITEM="Set Item as End Item",e.UNSET_ITEM_AS_END_ITEM="Unset Item as End Item",e.SHOW_ANNOTATION="Show Annotation",e.HIDE_ANNOTATION="Hide Annotation"}(sn||(sn={}));const rn=l({key:"fetchedItemInvalidator",default:0}),cn=d({key:"fetchedItems",get:e=>async({get:t})=>{var n;const a=t(Fe),i=t(Ke);if(t(rn),t(Hn),null!=i)try{return await(null===(n=null==a?void 0:a.sceneItems)||void 0===n?void 0:n.getSceneViewItem(e,i,{includeOverride:!0,includeWorldTransform:!0}))}catch(t){return void logger_debug(`Error encountered get scene view item. [itemId={${e}}]`,t)}}}),dn=u({key:"selectionSelectedItems",default:void 0}),un=l({key:"selectionSelectedItemIds",default:[]}),mn=l({key:"selectionLastSelected",default:void 0}),pn=l({key:"selectionLastSelectionFromViewer",default:!1}),hn=l({key:"selectionLastSelectWasMultiSelect",default:!1}),fn=o({key:"selectionHasMultipleSelected",get:({get:e})=>{const t=e(mn),n=undefined;return e(un).filter((e=>{var n;return e!==(null==t?void 0:t.id)&&!(null===(n=null==t?void 0:t.ancestors)||void 0===n?void 0:n.includes(e))})).length>0}}),gn=l({key:"selectionFirstSelectedItemInTreeId",default:void 0}),vn=o({key:"selectionHighestSelectedAncestor",get:({get:e})=>{var t,n;const a=e(mn),i=e(un);return null!==(n=null===(t=null==a?void 0:a.ancestors)||void 0===t?void 0:t.find((e=>i.includes(e))))&&void 0!==n?n:null==a?void 0:a.id}}),yn=l({key:"selectionPreviousVisibleSummary",default:void 0}),bn=l({key:"selectionVisibleSummary",default:void 0}),wn=o({key:"selectionVisibleCount",get:({get:e})=>{var t,n;return null!==(n=null===(t=e(bn))||void 0===t?void 0:t.count)&&void 0!==n?n:0}}),Cn=o({key:"selectionBoundingBoxCenter",get:({get:e})=>{const t=e(bn);return null!=(null==t?void 0:t.boundingBox)?T.center(t.boundingBox):A.origin()}}),xn=o({key:"selectionIsActive",get:({get:e})=>{const t=e(un),n=undefined;return e(wn)>0||t.length>0}}),Sn=o({key:"fetchedAndSelectedItems",get:async({get:e})=>{const t=e(un),n=undefined;return null!=e(Ke)?t.map((t=>e(cn(t)))):[]}});function useSceneViewItemActions(){return{invalidateCachedItems:useActionCallback((({set:e})=>()=>{e(rn,(e=>e+1))}))}}const kn=l({key:"lengthUnit",default:"cm"}),An=l({key:"decimalPlace",default:"2"});var Tn,En;!function(e){e.mm="millimeters",e.cm="centimeters",e.m="meters",e.in="inches",e.ft="feet"}(Tn||(Tn={})),function(e){e[e.mm=1]="mm",e[e.cm=.1]="cm",e[e.m=.001]="m",e[e.in=.03937007874015748]="in",e[e.ft=.0032808398950131233]="ft"}(En||(En={}));const convertFrom=(e,t)=>{const n=undefined;return e/En[t]},convertTo=(e,t)=>{const n=undefined;return e*En[t]},formatWithUnit=(e,t,n)=>`${e.toFixed(n)} ${t}`,formatDistance=(e,t,n)=>formatWithUnit(convertTo(e,t),t,n),createDistanceFormatter=(e,t)=>n=>formatDistance(n,e,t);function toUnitType(e){switch(e){case"cm":return"centimeters";case"m":return"meters";case"in":return"inches";case"ft":return"feet";default:return"millimeters"}}function pickLocalOrWorldTransform(e,t){return"local"===t?e.local:e.world}function mapItemTransforms(e,t){return{local:t(e.local),world:t(e.world)}}function makeItemTransforms(e,t,n){return"local"===n?{local:e,world:Z(e,t)}:{world:e,local:J(e,t)}}function convertTransformToUnits(e,t){const{position:n,rotation:a,scale:i}=e;return{position:A.create(convertTo(n.x,t),convertTo(n.y,t),convertTo(n.z,t)),rotation:a,scale:i}}function convertTransformFromUnits(e,t){const{position:n,rotation:a,scale:i}=e;return{position:A.create(convertFrom(n.x,t),convertFrom(n.y,t),convertFrom(n.z,t)),rotation:a,scale:i}}function toValidTransform(e){const{position:t,rotation:n,scale:a}=e;return{position:{x:t.x||0,y:t.y||0,z:t.z||0},rotation:{x:n.x||0,y:n.y||0,z:n.z||0},scale:a||1}}function scale(e){const t=parseFloat(Math.sqrt(e[0]**2+e[4]**2+e[8]**2).toFixed(2)),n=parseFloat(Math.sqrt(e[1]**2+e[5]**2+e[9]**2).toFixed(2)),a=parseFloat(Math.sqrt(e[2]**2+e[6]**2+e[10]**2).toFixed(2));return t===n&&n===a?t:NaN}function translation(e){return{x:e[12],y:e[13],z:e[14]}}function rotation(e){const t=e.map((t=>t*(1/scale(e))));return t[8]<1?t[8]>-1?{x:Math.atan2(-t[9],t[10])*(180/Math.PI),y:Math.asin(t[8])*(180/Math.PI),z:Math.atan2(-t[4],t[0])*(180/Math.PI)}:{x:-Math.atan2(-t[1],t[5])*(180/Math.PI),y:-90,z:0}:{x:Math.atan2(t[1],t[5])*(180/Math.PI),y:90,z:0}}function toTransformFromApiMatrix(e){return null!=e?{position:translation(e),rotation:rotation(e),scale:scale(e)}:void 0}const Pn={position:A.create(0,0,0),rotation:A.create(0,0,0),scale:1},Nn=l({key:"transformWidgetEnabled",default:!1}),On=l({key:"transformWidgetPosition",default:void 0}),In=l({key:"transformWidgetOrientationOverride",default:void 0}),Mn=o({key:"transformWidgetOrientation",get:({get:e})=>{const t=e(In),n=e(mn);if(null!=t)return t;if(null!=n){const t=e(Fn(n.id));return N.fromDegrees({x:null==t?void 0:t.world.rotation.x,y:null==t?void 0:t.world.rotation.y,z:null==t?void 0:t.world.rotation.z})}}}),Vn=l({key:"transformWidgetCachedOrientation",default:void 0}),Ln=l({key:"transformWidgetSyncToSelection",default:!1}),Rn=l({key:"transformWidgetIsInteracting",default:!1}),_n=u({key:"appliedItemTransform",default:void 0}),jn=l({key:"appliedItemTransformIds",default:[]}),Bn=l({key:"selectedCoordinateSpace",default:"world"}),zn=u({key:"editedItemTransform",default:void 0}),Dn=d({key:"displayedItemTransform",get:e=>({get:t})=>{const n=t(Bn),a=t(kn),i=t(Fn(e)),l=t(zn(e));return null!=l?l.transform:null!=i?pickLocalOrWorldTransform(mapItemTransforms(i,(e=>convertTransformToUnits(e,a))),n):void 0},set:e=>({get:t,set:n},a)=>{const i=t(Bn),l=t(Un(e)),o=t(Fn(e)),s=t(kn);if(null!=o&&!(a instanceof m)&&null!=a&&null!=l){n(zn(e),{coordinateSpace:i,units:s,transform:a});const o=makeItemTransforms(convertTransformFromUnits(toValidTransform(a),s),l,i),r=t(jn);n(_n(e),o),n(jn,[...r,e])}}}),Fn=d({key:"fetchedItemTransforms",get:e=>({get:t})=>{var n,a;const i=t(cn(e));if(null!=i){const e=(null===(n=i.override)||void 0===n?void 0:n.transform)?toTransformFromApiMatrix(null===(a=i.override)||void 0===a?void 0:a.transform):void 0,t=i.worldTransform?toTransformFromApiMatrix(i.worldTransform):void 0;return{local:null!=e?e:Pn,world:null!=t?t:Pn}}}}),Hn=l({key:"transformInvalidator",default:0}),Un=d({key:"parentItemWorldMatrix",get:e=>({get:t})=>{const n=undefined;if(null!=t(Ke)){const n=t(cn(e));if(null!=(null==n?void 0:n.parentId)){const e=t(Fn(n.parentId)),a=t(_n(n.parentId));if(null==e)throw new Error("Invalid state. Parent item state should be populated, but is undefined.");return Q(ee(null!=a?a.world:e.world))}}return logger_debug(`Unable to find the world matrix for the parent of ${e}. Returning the identity matrix.`),O.makeIdentity()}});function useUpdateEditedTransformWhenSettingsChange(e){const t=s(kn),n=s(Bn),a=s(_n(null!=e?e:"")),[i,l]=r(zn(null!=e?e:""));b((()=>{if(null!=a&&((null==i?void 0:i.coordinateSpace)!==n||(null==i?void 0:i.units)!==t)){const e=undefined,i=convertTransformToUnits(pickLocalOrWorldTransform(a,n),t);l({units:t,coordinateSpace:n,transform:i})}}),[t,n])}function useEditItemTransform(e){const t=useTransformActions();useUpdateEditedTransformWhenSettingsChange(e);const n=p(Un(null!=e?e:"")),[a,i]=h(Dn(null!=e?e:""));return{transform:"hasValue"===a.state?a.contents:void 0,loading:"loading"===a.state||"loading"===n.state,error:"hasError"===a.state?a.contents:void 0,async update(n){i(n),null!=e&&await t.applyTransformToItem(e)}}}const useTransformActions=()=>{const e=useApplicationMessageActions(),t=useViewerSceneActions(),n=useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(Cn);e(On,n)})),a=useActionCallback((({set:e,snapshot:t})=>async()=>{const a=await t.getPromise(On),i=await t.getPromise(hn),l=await t.getPromise(un),o=await t.getPromise(wn);null==a&&(l.length>0||i||o>0)&&await n(),e(Ln,!0)})),i=useActionCallback((({set:e})=>async t=>{e(On,null!=t?t:void 0)})),l=useActionCallback(retainSnapshot((({snapshot:e,set:t,reset:n})=>async()=>{const a=await e.getPromise(Mn),i=undefined;(await e.getPromise(jn)).forEach((e=>{n(_n(e)),n(zn(e))})),n(jn),null!=a&&t(Vn,a),t(Hn,(e=>e+1))}))),o=useActionCallback((({set:e,reset:t})=>n=>{t(Vn),e(In,n)})),s=useActionCallback((({set:e})=>()=>{e(On,void 0),e(Nn,!1)}));return{enableTransformWidget:useActionCallback((({set:t})=>async(l,o)=>{e.setToastMessage({message:"Transform manipulator enabled! Select parts to interact.",duration:an}),t(Nn,!0),o?await n():null==l?await a():await i(l)})),disableTransformWidget:useActionCallback((({reset:e})=>()=>{e(Nn),e(In)})),setTransformWidgetOrientation:o,clearTransformWidgetOrientation:useActionCallback((({reset:e})=>()=>{e(Vn),e(In)})),setTransformWidgetPosition:i,clearTransformWidgetPosition:useActionCallback((({reset:e})=>()=>e(On))),invalidateTransforms:l,setIsInteractivelyTransforming:useActionCallback((({set:e})=>t=>{e(Rn,t)})),setDefaultWidgetPosition:a,setDefaultWidgetPositionToSelection:n,enableSelectionSync:useActionCallback((({set:e})=>()=>e(Ln,!0))),disableSelectionSync:useActionCallback((({reset:e})=>()=>e(Ln))),syncToSelection:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(yn),n=await e.getPromise(bn),a=undefined;if(await e.getPromise(Ln)){const e=null==n?void 0:n.boundingBox,a=null!=e&&null!=(null==t?void 0:t.boundingBox)&&equals(e,t.boundingBox);null==e||a||await i(T.center(e))}})),orientToHitResult:useActionCallback((({reset:e})=>async t=>{e(Ln),null!=t?(await i(null==t?void 0:t.position),o(A.eulerTo(A.up(),t.normal))):(e(On),o(void 0))})),clearSelectedTransforms:useActionCallback((()=>async()=>{await t.execute(sn.CLEAR_SELECTED_TRANSFORMS,(e=>e.where((e=>e.withSelected())).clearTransforms())),await l(),s()})),clearAllTransforms:useActionCallback((()=>async()=>{await t.execute(sn.CLEAR_SELECTED_TRANSFORMS,(e=>e.where((e=>e.all())).clearTransforms())),await l(),s()})),applyTransformToItem:useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(Fe),a=await(null==n?void 0:n.scene()),i=await e.getPromise(_n(t));if(null==i)return void logger_warn(`There is no transform to apply to item ${t}.`);const l=O.transpose(Q(ee(null==i?void 0:i.local)));return null==a?void 0:a.items((e=>e.where((e=>e.withItemId(t))).transform(l))).execute()}))}},useHitActions=()=>{const e=useCrossSectioningActions(),t=useMeasurementActions(),n=useTransformActions(),a=useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const n=await e.tryGetPromise(St).then((e=>e.value)),a=await e.getPromise(Wt);null==n&&null!=(null==a?void 0:a.start)&&null!=a.end&&await t.resetMeasurement()}))),i=useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const t=await e.tryGetPromise(St).then((e=>e.value));await n.orientToHitResult(t)}))),l=useActionCallback(retainSnapshot((({set:e,snapshot:t})=>async()=>{const n=await t.tryGetPromise(St).then((e=>e.value));e(jt,n)}))),o=useActionCallback(retainSnapshot((({snapshot:e,set:t})=>async()=>{t(xt,await e.tryGetPromise(St).then((e=>e.value)))})));return{tap:useActionCallback(retainSnapshot((({snapshot:t,set:n})=>async({detail:s},...r)=>{const c=await t.getPromise(Jt),d=await t.getPromise(st),u=2!==(null==s?void 0:s.buttons)&&!(null==s?void 0:s.altKey);s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;const m=u&&!d.hitPending&&!c,p=await t.tryGetPromise(St).then((e=>e.value));n(Ct,p),n(bt,s),await a(),m&&(r.forEach((e=>e())),await i()),await l(),await e.sectionCurrentHit(),await o()}))),longPress:useActionCallback(retainSnapshot((({snapshot:e,set:t,reset:n})=>async a=>{n(bt),t(wt,a.detail),await e.tryGetPromise(St),await l(),await o()})))}},Wn=o({key:"viewerToolkitHitState",get:({get:e})=>{const t=undefined,n=undefined,a=undefined,i=undefined,l=undefined;return{tapDetails:e(bt),longPressDetails:e(wt),previousHitResult:e(Ct),currentHitResult:e(xt)}}});var Gn=Object.freeze({__proto__:null,currentHitResult:xt,hitResult:St,hitResultsLongPressDetails:wt,hitResultsSkipNextTap:kt,hitResultsTapDetails:bt,hitState:Wn,previousHitResult:Ct,useHitActions:useHitActions});function useSelectionActions(){const e=useSceneViewItemActions(),t=useTransformActions(),n=useViewerSceneActions(),a=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=undefined;(await e.getPromise(un)).forEach((e=>t(dn(e))))})),i=useActionCallback((({snapshot:e,reset:t,set:a})=>async(i,l)=>{var o,s;const r=await e.getPromise(dn(i.id)),c=await e.getPromise(un),d=null===(s=[...null!==(o=i.ancestors)&&void 0!==o?o:[]])||void 0===s?void 0:s.reverse().find((e=>!c.includes(e)));null!=r&&null!=d?(a(dn(d),{id:d}),a(un,(e=>[...e,d])),n.execute(sn.SELECTING_ANCESTOR,n.selectItemsTransform(d))):(null==l?void 0:l.clear)?(a(dn(i.id),i),a(un,[i.id]),n.execute(sn.SELECTING_ONLY_ITEM,n.clearSelectionTransform,n.selectItemsTransform(i.id))):(a(dn(i.id),i),a(un,(e=>[...e,i.id])),n.execute(sn.SELECTING_ITEMS,n.selectItemsTransform(i.id))),u(i),a(mn,i),a(pn,!0),t(hn)})),l=useActionCallback((({reset:e,set:t})=>async a=>{e(dn(a)),e(hn),t(un,(e=>e.filter((e=>e!==a)))),n.execute(sn.DESELECTING_ITEMS,n.deselectItemsTransform(a))})),o=useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(dn(t.id));null!=n?await l(n.id):await i(t)})),s=useActionCallback((({snapshot:n,reset:a,set:l})=>async(o,s={})=>{const r=await n.getPromise(dn(o.id)),c=await n.getPromise(un);if(c.filter((e=>{var t;return e!==o.id&&!(null===(t=o.ancestors)||void 0===t?void 0:t.includes(e))})).forEach((e=>a(dn(e)))),a(hn),r)if(s.ignoreAncestorSelection)a(un),a(dn(r.id));else{const e=c.filter((e=>{var t;return e===o.id||(null===(t=o.ancestors)||void 0===t?void 0:t.includes(e))}));l(un,e)}else a(un);e.invalidateCachedItems(),t.clearTransformWidgetOrientation(),await i(o,{clear:!0})})),r=useActionCallback((({reset:e})=>async()=>{await a(),e(un),e(mn),e(pn),e(hn),t.clearTransformWidgetPosition(),t.clearTransformWidgetOrientation()})),c=useActionCallback((()=>async()=>{await r(),n.execute(sn.CLEAR_SELECTION,n.clearSelectionTransform)})),d=useActionCallback((({set:e})=>async t=>{e(hn,t)})),u=useActionCallback((({reset:e,set:t})=>e=>{}));return{select:i,toggleSelection:o,clearAndSelect:s,selectCurrentHit:useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const t=await e.tryGetPromise(St).then((e=>e.value)),n=await e.getPromise(bt),a=(null==n?void 0:n.metaKey)||(null==n?void 0:n.ctrlKey)||(null==n?void 0:n.shiftKey);null==t||a?null!=t&&a?await o(t):await c():await s(t)}))),syncSelection:useActionCallback((({set:e,reset:t})=>async(n,i)=>{i.selected?(await a(),e(dn(n.id),n),i.multiSelect?e(un,(e=>[...e.filter((e=>e!==n.id)),n.id])):e(un,[n.id]),u(n),e(mn,n),e(pn,!1),e(hn,!!i.multiSelect)):(t(dn(n.id)),t(hn),e(un,(e=>e.filter((e=>e!==n.id)))))})),deselect:l,clearSelection:c,resetSelectionState:r,toggleLastSelectWasMultiSelect:d,selectForModelViewsPanel:u}}const Kn=o({key:"viewerToolkitSelectionState",get:({get:e})=>{const t=undefined,n=undefined,a=undefined,i=undefined;return{selectedItemIds:e(un),lastSelected:e(mn),highestSelectedAncestorId:e(vn)}}});var $n=Object.freeze({__proto__:null,fetchedAndSelectedItems:Sn,selectionBoundingBoxCenter:Cn,selectionFirstSelectedItemInTreeId:gn,selectionHasMultipleSelected:fn,selectionHighestSelectedAncestor:vn,selectionIsActive:xn,selectionLastSelectWasMultiSelect:hn,selectionLastSelected:mn,selectionLastSelectionFromViewer:pn,selectionPreviousVisibleSummary:yn,selectionSelectedItemIds:un,selectionSelectedItems:dn,selectionState:Kn,selectionVisibleCount:wn,selectionVisibleSummary:bn,useSelectionActions:useSelectionActions});const qn=255,Yn=l({key:"sceneItemAdjustmentsSelectedColor",default:void 0}),Xn=l({key:"sceneItemAdjustmentsSelectedOpacity",default:void 0}),Zn=u({key:"appliedItemMaterialOverride",default:void 0}),Jn=l({key:"appliedItemMaterialOverrideIds",default:[]}),Qn=o({key:"sceneItemAdjustmentsLastSelectedOverride",get:({get:e})=>{const t=e(mn);if(null!=t)return e(Zn(t.id))}}),ea=l({key:"applyMaterialToAllUserAction",default:void 0}),ta=l({key:"showConfirmDialogWhenApplyingMaterialToAll",default:!0}),na=l({key:"confirmApplyMaterialToAllDialogOpen",default:!1}),useSceneItemMaterialActions=()=>{const e=useViewerSceneActions(),t=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=await e.getPromise(Jn);t(Yn),n.forEach((e=>t(Zn(e)))),t(Jn)}));return{updateColor:useActionCallback((({set:e})=>t=>{e(Yn,t)})),clearCurrentColor:useActionCallback((({reset:e})=>()=>{e(Yn)})),clearCurrentOpacity:useActionCallback((({reset:e})=>()=>{e(Xn)})),clear:useActionCallback((({snapshot:t,set:n,reset:a})=>async()=>{const i=await t.getPromise(un);a(Yn),i.forEach((e=>a(Zn(e)))),n(Jn,(e=>e.filter((e=>!i.includes(e))))),await e.execute(sn.CLEAR_SELECTED_MATERIAL_OVERRIDES,(e=>e.where((e=>e.withSelected())).clearMaterialOverrides().select()))})),clearAll:useActionCallback((()=>async()=>{await t(),await e.execute(sn.CLEAR_ALL_MATERIAL_OVERRIDES,(e=>e.where((e=>e.all())).clearMaterialOverrides()),(e=>e.where((e=>e.withSelected())).select()))})),clearState:t,updateOpacity:useActionCallback((({set:e})=>t=>{e(Xn,t)})),apply:useActionCallback((({snapshot:t,set:n})=>async()=>{const a=await t.getPromise(Yn),i=await t.getPromise(Xn),l=await t.getPromise(un),o=await t.getPromise(Qn),s=null!=a?a:o,r=null!=i?i:null==o?void 0:o.opacity;if(null!=s){const t=Object.assign(Object.assign({},s),{opacity:null!=r?r:s.opacity});await e.execute(sn.APPLY_MATERIAL_OVERRIDE_TO_SELECTION,(e=>e.where((e=>e.withSelected())).materialOverride(t))),l.forEach((e=>n(Zn(e),t))),n(Jn,(e=>[...e,...l]))}})),confirmApplyAll:useActionCallback((({set:e})=>t=>{e(na,!0),e(ea,(()=>t))})),cancelApplyAll:useActionCallback((({reset:e})=>()=>{e(na),e(ea)})),applyAll:useActionCallback((({snapshot:t,reset:n})=>async()=>{const a=await t.getPromise(Yn),i=await t.getPromise(Xn);if(null!=a){const l=await t.getPromise(Jn),o=Object.assign(Object.assign({},a),{opacity:null!=i?i:a.opacity});await e.execute(sn.APPLY_MATERIAL_OVERRIDE_TO_ALL,(e=>e.where((e=>e.all())).materialOverride(o))),l.forEach((e=>n(Zn(e))));const s=await t.getPromise(ea);null==s||s(o),n(na),n(ea)}})),hideConfirmApplyAllDialog:useActionCallback((({set:e})=>()=>{e(ta,!1)}))}},aa="#FFFFFF",ia=l({key:"viewerBackgroundSelectedColor",default:aa}),VertexSceneItemMaterialApplyAll=({onApplyAll:t})=>{const n=useSceneItemMaterialActions(),a=p(Qn),i=s(Yn),l=s(ta),o=g.useMemo((()=>"hasValue"===a.state?null!=i?i:a.contents:i),[a,i]);return e(V,{content:"Apply to All",children:e(L,{iconName:"square-dot-outline",iconSize:"sm",color:"secondary",disabled:null==o,onClick:async()=>{l?n.confirmApplyAll(t):(await n.applyAll(),null==t||t(o))}})})};function SceneItemMaterialApplyAllConfirmationDialog(){const a=useSceneItemMaterialActions(),i=s(na),[l,o]=v.useState(!1),onCloseDialog=()=>{a.cancelApplyAll(),o(!1)};return i?t(R,{open:!0,className:"text-sm",onClosed:onCloseDialog,onBackdropClick:onCloseDialog,children:[e("div",{slot:"heading",children:"Apply to All Parts"}),e("div",{className:"max-w-lg break-words pr-2",children:"This will apply the same material to all parts in the model. Any previous material changes will be lost."}),t("div",{className:"flex mt-8 gap-2 items-center",children:[t("div",{className:"flex gap-2",children:[e(_,{"data-testid":"hide-confirmation-dialog-in-future-checkbox",variant:"check",className:"pt-0.5",checked:l,onValueChanged:e=>{o(e.detail)}}),"Don't show again this session"]}),t("div",{className:"flex ml-auto gap-2",children:[e(j,{"data-testid":"cancel-apply-material-to-all",onClick:onCloseDialog,children:"Cancel"}),e(j,{color:"primary","data-testid":"confirm-apply-material-to-all",onClick:async()=>{await a.applyAll(),l&&a.hideConfirmApplyAllDialog()},children:"Apply"})]})]})]}):e(n,{})}function createColorMaterialWithId(e,t=De.create()){return Object.assign({id:t},te.fromHex(e))}const VertexSceneItemMaterialColorPicker=({onApply:t})=>{const n=useSceneItemMaterialActions(),a=p(Qn),i=s(Yn),l=g.useMemo((()=>"hasValue"===a.state?null!=i?i:a.contents:i),[a,i]);return e(VertexColorPicker,{"data-testid":"selected-item-color-picker",value:null!=l?Me.toHexString(l.diffuse):void 0,onValueChanged:()=>{n.apply(),null==t||t(l)},onInput:async e=>{n.updateColor(createColorMaterialWithId(e)),await n.apply()}})},VertexSceneItemMaterialOpacitySlider=({onApply:t})=>{const n=useSceneItemMaterialActions(),a=s(Xn),i=p(Qn),l=g.useMemo((()=>{var e,t;return"hasValue"===i.state?null!==(t=null!=a?a:null===(e=i.contents)||void 0===e?void 0:e.opacity)&&void 0!==t?t:qn:null!=a?a:qn}),[a,i]),o=useDebouncedCallback((()=>{n.apply()}),500),r=g.useCallback((e=>{n.updateOpacity(e.detail.value),o(e.detail.value)}),[o,n]),c=g.useMemo((()=>"hasValue"!==i.state||null==i.contents),[i]);return e(V,{className:"flex w-full",content:c?"Select a part and apply a color to enable opacity":`${Math.floor(l/qn*100)}%`,placement:"top",children:e(VertexSlider,{"data-testid":"scene-item-adjustments-opacity-slider",leftLabel:"0%",rightLabel:"100%",disabled:c,value:null!=l?l:qn,step:5,min:0,max:qn,onValueChange:e=>{n.updateOpacity(e.detail.value),n.apply(),null==t||t(e.detail.value)},onValueInput:r})})};function VertexMaterialControls({onApplyMaterial:a,onApplyMaterialToAll:i,onApplyOpacity:l}){const o=useSceneItemMaterialActions(),r=s(mn);return v.useEffect((()=>{o.clearCurrentColor(),o.clearCurrentOpacity()}),[null==r?void 0:r.id]),t(n,{children:[t("div",{className:"flex flex-col",children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),t("div",{className:"flex items-center gap-2",children:[e(VertexSceneItemMaterialColorPicker,{onApply:a}),e(VertexSceneItemMaterialApplyAll,{onApplyAll:i})]})]}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Opacity"}),e(VertexSceneItemMaterialOpacitySlider,{onApply:l}),e(SceneItemMaterialApplyAllConfirmationDialog,{})]})}const ResetButton=({id:n,tooltip:a,children:i})=>{const[l,o]=v.useState(!1);return e("div",{className:"ml-auto",children:t(B,{className:"flex items-stretch h-full","data-testid":`reset-button-dropdown-menu-${n}`,placement:"bottom-end",onMenuOpened:()=>o(!0),onMenuClosed:()=>o(!1),children:[e("div",{slot:"anchor",className:"flex items-center h-full",children:e(V,{content:a,disabled:l,placement:"bottom",children:t(j,{className:Nt("p-1.5 rounded-md select-none hover:bg-neutral-300 active:bg-neutral-400 cursor-pointer",{"bg-neutral-300":l}),"data-testid":`reset-button-${n}`,variant:"plaintext",children:[e(D,{className:"px-0.5",name:"reset",size:"sm"}),e(D,{name:"chevron-down",size:"sm"})]})})}),e("div",{className:"whitespace-nowrap",children:i})]})})},VertexSceneItemMaterialClear=({onClear:n,onClearAll:a})=>{const i=useSceneItemMaterialActions(),l=s(xn);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"materials",tooltip:"Clear Materials",children:[e("div",{className:"pt-1"}),e(F,{"data-testid":"clear-selected-materials",onClick:()=>{i.clear(),null==n||n()},disabled:!l,children:"Clear selected materials"}),e(F,{"data-testid":"clear-all-materials",onClick:()=>{i.clearAll(),null==a||a()},children:"Clear all materials"})]})})};function VertexMaterialPanelSection({onClearMaterial:n,onClearAllMaterials:a,onApplyMaterial:i,onApplyMaterialToAll:l,onApplyOpacity:o}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Material",e(VertexSceneItemMaterialClear,{onClear:n,onClearAll:a})]}),children:e(VertexMaterialControls,{onApplyMaterial:i,onApplyMaterialToAll:l,onApplyOpacity:o})})}const la="#ffff00",oa=35,sa=1,ra=l({key:"selectionHighlightingSelectedColor",default:la}),ca=l({key:"selectionHighlightingSelectedOpacity",default:oa}),da=l({key:"selectionHighlightingSelectedLineThickness",default:1}),VertexSelectionHighlightingColorPicker=({onUpdate:t})=>{const[n,a]=r(ra);return e(VertexColorPicker,{"data-testid":"selection-highlighting-color-picker",value:n,onValueChanged:e=>{null==t||t(e.detail)},onInput:e=>a(e)})},VertexSelectionHighlightingLineThicknessSlider=({onUpdate:t})=>{const[n,a]=r(da);return e(VertexSlider,{id:"selection-highlighting-line-thickness","data-testid":"selection-highlighting-line-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{null==t||t(e.detail.value)}})},VertexSelectionHighlightingOpacitySlider=({onUpdate:t})=>{const[n,a]=r(ca);return e(VertexSlider,{id:"selection-highlighting-opacity","data-testid":"selection-highlighting-opacity-slider",leftLabel:"0%",rightLabel:"100%",min:0,max:100,step:5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{null==t||t(e.detail.value)}})};function VertexSelectionHighlightingControls({onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:l}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexSelectionHighlightingColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Opacity"}),e(VertexSelectionHighlightingOpacitySlider,{onUpdate:i}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexSelectionHighlightingLineThicknessSlider,{onUpdate:l})]})}const VertexSelectionHighlightingReset=({onReset:t})=>{const[n,a]=r(ra),[i,l]=r(ca),[o,s]=r(da),c=undefined;return e("div",{className:"ml-auto",children:e(V,{content:"Reset Selection Highlighting",children:e(L,{"data-testid":"selection-highlighting-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(la),l(oa),s(1),null==t||t()},disabled:!(n!==la||i!==oa||1!==o)})})})};function VertexSelectionHighlightingPanelSection({onResetSelectionHighlighting:n,onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:l}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Selection Highlighting",e(VertexSelectionHighlightingReset,{onReset:n})]}),children:e(VertexSelectionHighlightingControls,{onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:l})})}const VertexViewerBackgroundColorPicker=({onUpdate:t})=>{const[n,a]=r(ia);return e(VertexColorPicker,{"data-testid":"viewer-background-color-picker",value:n,onValueChanged:e=>{null==t||t(e.detail)},onInput:e=>a(e)})};function VertexViewerBackgroundControls({onUpdateViewerBackgroundColor:a}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexViewerBackgroundColorPicker,{onUpdate:a})]})}const VertexViewerBackgroundReset=({onReset:t})=>{const[n,a]=r(ia),i=undefined;return e("div",{className:"ml-auto",children:e(V,{content:"Reset Background Color",children:e(L,{"data-testid":"viewer-background-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(aa),null==t||t()},disabled:!(n!==aa)})})})};function VertexViewerBackgroundPanelSection({onResetViewerBackgroundColor:n,onUpdateViewerBackgroundColor:a}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Viewer Background",e(VertexViewerBackgroundReset,{onReset:n})]}),children:e(VertexViewerBackgroundControls,{onUpdateViewerBackgroundColor:a})})}const isInputElement=e=>{const t=e instanceof HTMLElement&&"VERTEX-AUTO-RESIZE-TEXTAREA"===e.tagName,n=e instanceof HTMLElement&&"VERTEX-TEXTFIELD"===e.tagName,a=e instanceof HTMLElement&&"true"===e.contentEditable,i=e instanceof HTMLElement&&"VERTEX-SCENE-TREE-SEARCH"===e.tagName,l=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,o=e instanceof HTMLElement&&"VERTEX-VIEWER-PIN-TOOL"===e.tagName,s=e instanceof HTMLElement&&"VERTEX-VIEWER-TRANSFORM-WIDGET"===e.tagName;return t||n||a||i||l||o||s},useRecoilReducer=({reducer:e,atom:t})=>{const n=undefined,a=undefined;return[s(t),useRecoilReducerDispatch({reducer:e,atom:t})]},useRecoilReducerDispatch=({reducer:e,atom:t})=>{const n=i((({set:n})=>async a=>{n(t,(t=>e(t,a)))}),[]);return n},ua=l({key:"keyBindings",default:{applyBindings:[],bindings:{},pressed:{}}});function reducer(e,t){var n,a,i,l;switch(t.type){case"push-key-binding":const o=undefined;return null!=(null===(n=e.bindings[t.binding.keyBind])||void 0===n?void 0:n.find((e=>e.id===t.binding.id)))?e:Object.assign(Object.assign({},e),{bindings:Object.assign(Object.assign({},e.bindings),{[t.binding.keyBind]:[...null!==(a=e.bindings[t.binding.keyBind])&&void 0!==a?a:[],t.binding]})});case"remove-key-binding":const s=undefined;return null==(null===(i=e.bindings[t.binding.keyBind])||void 0===i?void 0:i.find((e=>e.id===t.binding.id)))?e:Object.assign(Object.assign({},e),{bindings:Object.assign(Object.assign({},e.bindings),{[t.binding.keyBind]:(null!==(l=e.bindings[t.binding.keyBind])&&void 0!==l?l:[]).filter((e=>e.id!==t.binding.id))})});case"add-apply-key-binding":return Object.assign(Object.assign({},e),{applyBindings:[...e.applyBindings,t.binding]});case"remove-apply-key-binding":return Object.assign(Object.assign({},e),{applyBindings:e.applyBindings.filter((e=>e.id!==t.id))});case"set-key-pressed":return Object.assign(Object.assign({},e),{applyBindings:e.applyBindings.map((t=>Object.assign(Object.assign({},t),{active:null!=t.keyBind&&allPressed(t.keyBind,e.pressed)}))),pressed:Object.assign(Object.assign({},e.pressed),{[t.key]:t.pressed}),lastPressed:t.pressed?t.key:void 0})}}const useKeyBindingState=()=>useRecoilReducer({reducer:reducer,atom:ua});function pressedValue(e,t){return e.includes("!")?!t[e.replace("!","")]&&!t[e.replace("!","").toLowerCase()]:t[e]||t[e.toLowerCase()]}function isPressed(e,t){const n=e.split("||");return n.length>1?n.some((e=>pressedValue(e,t))):pressedValue(n[0],t)}function allPressed(e,t){const n=undefined;return e.split("+").every((e=>isPressed(e,t)))}function matchingSingleFnBindings(e,t,n){return e.filter((e=>!e.repeat)).filter((e=>{var a;return null!=e.keyBind&&null!=n&&(null===(a=e.keyBind)||void 0===a?void 0:a.includes(n))&&allPressed(e.keyBind,t)})).map((e=>e.fn))}function matchingOffBindings(e,t,n){return e.filter((e=>e.off&&e.active&&null!=e.keyBind&&null==n&&!allPressed(e.keyBind,t))).map((e=>e.off))}const useApplyKeyBinding=e=>{const[t,n]=useKeyBindingState();v.useEffect((()=>{const a=De.create();return n({type:"add-apply-key-binding",binding:Object.assign(Object.assign({},e),{id:a,active:null!=e.keyBind&&allPressed(e.keyBind,t.pressed)})}),()=>{n({type:"remove-apply-key-binding",id:a})}}),[e.fn,e.off,e.keyBind,e.repeat])},useStackKeyBinding=(e,t=[])=>{const[,n]=useKeyBindingState();v.useEffect((()=>{const t=null==e.addPredicate||e.addPredicate(),a=null!=e.cancelPredicate&&e.cancelPredicate();t&&n({type:"push-key-binding",binding:e}),a&&n({type:"remove-key-binding",binding:e})}),t)},useKeyBindings=({keydownRepeatInterval:e=25,keydownIgnorePredicate:t=isInputElement}={})=>{const[n,a]=useKeyBindingState(),i=v.useCallback((e=>{Object.keys(n.bindings).filter((t=>t.includes(e)&&allPressed(t,Object.assign(Object.assign({},n.pressed),{[e]:!0})))).forEach((e=>{const t=n.bindings[e],i=t.length>0?t[t.length-1]:void 0;null!=i&&(i.fn(),a({type:"remove-key-binding",binding:i}))}))}),[n]);v.useEffect((()=>{const handleKeyDown=e=>{if(!e.repeat&&!t(e.target)){a({type:"set-key-pressed",key:e.key,pressed:!0}),i(e.key);const t=Object.assign(Object.assign({},n.pressed),{[e.key]:!0}),l=matchingSingleFnBindings(n.applyBindings,t,e.key),o=matchingOffBindings(n.applyBindings,t,e.key);(l.length>0||o.length>0)&&e.preventDefault()}},handleKeyUp=e=>{a({type:"set-key-pressed",key:e.key,pressed:!1})};return window.addEventListener("keydown",handleKeyDown),window.addEventListener("keyup",handleKeyUp),()=>{window.removeEventListener("keydown",handleKeyDown),window.removeEventListener("keyup",handleKeyUp)}}),[i,n.applyBindings,n.pressed]),v.useEffect((()=>{const e=matchingSingleFnBindings(n.applyBindings,n.pressed,n.lastPressed),t=matchingOffBindings(n.applyBindings,n.pressed,n.lastPressed);e.forEach((e=>e())),t.forEach((e=>e()))}),[n.pressed,n.lastPressed]),v.useEffect((()=>{const t=n.applyBindings.filter((e=>e.repeat&&null!=e.keyBind&&allPressed(e.keyBind,n.pressed))).map((e=>e.fn));if(t.length>0){const n=setInterval((()=>{t.forEach((e=>e()))}),e);return()=>{clearInterval(n)}}return()=>{}}),[n.applyBindings,n.lastPressed])},VertexBoxSelectionButton=()=>{const t=useBoxSelectionActions(),n=s(Dt);return useStackKeyBinding({id:"ExitBoxSelection",keyBind:"Escape",fn:t.disable,addPredicate:()=>n,cancelPredicate:()=>!n},[n]),e(V,{content:"Box Selection",children:e(L,{iconName:"box-cursor",iconColor:n?"primary":"secondary","data-testid":"viewer-toolbar-enable-box-selection-button",onClick:n?t.disable:t.enable})})},ma=1,VertexResizableContent=n=>{var{className:a,style:i,displayShadow:l,heading:o,id:s,initialScale:r,placement:c="left",children:d,onResize:u}=n,m=__rest(n,["className","style","displayShadow","heading","id","initialScale","placement","children","onResize"]);const p="left"===c||"right"===c,h="top"===c;function getHorizontalResizeDirection(){switch(c){case"left":return"right";case"right":return"left";default:return"none"}}function getVerticalResizeDirection(){return"top"===c?"top":"none"}const f=null!=r?r:1;return e(H,Object.assign({id:s,"data-testid":`resizable-content-position-${c}`,className:Nt(a,"pointer-events-auto z-popover md:z-overlay bg-white bg-opacity-95 flex-grow-0 flex-shrink-0 border-neutral-300",{"border-r min-w-75 max-w-half":"left"===c,"sidebar-shadow-right":"left"===c&&l,"border-l min-w-75 max-w-half":"right"===c,"sidebar-shadow-left":"right"===c&&l,"border-t bottom-0 fixed":"top"===c,"min-h-12 sheet":h}),style:Object.assign({maxHeight:"top"===c?window.innerHeight:void 0},i),initialHorizontalScale:p?r:void 0,initialVerticalScale:h?f:void 0,horizontalDirection:getHorizontalResizeDirection(),verticalDirection:getVerticalResizeDirection(),position:"right"===c||"top"===c?"absolute":"relative",onResizeEnd:()=>null==u?void 0:u()},m,{children:t("div",{className:"flex flex-col h-full w-full",children:["top"===c&&e("div",{className:"flex justify-center w-full",children:e("div",{className:"block md:hidden w-20 h-0.5 mt-0.5 bg-neutral-600 rounded"})}),o,e("div",{className:Nt("w-full flex flex-col h-0 flex-grow",{"right-0":"right"===c}),children:d})]})}))};function useDefaultKeybindings(){useApplyKeyBinding({fn:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromiseRequired($e),n={milliseconds:500},a=await t();await(null==a?void 0:a.camera().viewAll().render({animation:n}))})),keyBind:"f"})}function useLongPress({target:e,callback:t,delay:n=500,onMovement:a}){const[i,l]=g.useState(),[o,s]=g.useState();g.useEffect((()=>{const handleTouchStart=e=>{const a=e;null!=a.touches&&1===a.touches.length&&(null!=i&&clearTimeout(i),s(P.create(a.touches[0].clientX,a.touches[0].clientY)),l(setTimeout((()=>null==t?void 0:t(a)),n)))},handleTouchMove=e=>{const t=e;null!=t.touches&&t.touches.length>0&&null!=i&&null!=o&&P.distance(o,P.create(t.touches[0].clientX,t.touches[0].clientY))>=2&&(clearTimeout(i),null==a||a())},handleTouchEnd=()=>{null!=i&&clearTimeout(i)};return null==e||e.addEventListener("touchstart",handleTouchStart),null==e||e.addEventListener("touchmove",handleTouchMove),null==e||e.addEventListener("touchend",handleTouchEnd),()=>{null==e||e.removeEventListener("touchstart",handleTouchStart),null==e||e.removeEventListener("touchmove",handleTouchMove),null==e||e.removeEventListener("touchend",handleTouchEnd)}}),[e,i,o])}function asBooleanAttribute(e){return!!e||void 0}const VertexContextMenu=({targetElement:t,menuType:n,disableBackdrop:a,openPredicate:i,onOpen:l,onClose:o,children:r})=>{const c=useContextMenuActions(),d=s(Lt),u=s(zt),m=v.useMemo((()=>["bottom-end","top-start","top-end","right","left"]),[]),p=d===n;useStackKeyBinding({id:"ContextMenu",keyBind:"Escape",fn:c.clearActiveContextMenu,addPredicate:()=>null!=d&&d===n,cancelPredicate:()=>null==d},[d]);const h=v.useMemo((()=>null!=t?t:null!=i?window:void 0),[t,i]);return useLongPress({target:h,callback:e=>c.longPress(e,n,i,l),onMovement:()=>c.clearActiveContextMenu()}),v.useEffect((()=>{const handleWindowPointerDown=e=>{const t=undefined;if(!targetWithinMenu(e)&&2!==e.buttons&&d===n){const t=targetShouldSkipNextHit(e);c.clearActiveContextMenu(t)}};if(a)return window.addEventListener("pointerdown",handleWindowPointerDown),()=>{window.removeEventListener("pointerdown",handleWindowPointerDown)}}),[a,n,d]),v.useEffect((()=>{const handlePointerDown=e=>{c.pointerDown(e)},handlePointerUp=e=>{c.pointerUp(e,n,i,l)},handleContextMenu=e=>c.contextMenu(e,i);return null==h||h.addEventListener("pointerdown",handlePointerDown),null==h||h.addEventListener("pointerup",handlePointerUp),null==h||h.addEventListener("contextmenu",handleContextMenu),()=>{null==h||h.removeEventListener("pointerdown",handlePointerDown),null==h||h.removeEventListener("pointerup",handlePointerUp),null==h||h.removeEventListener("contextmenu",handleContextMenu)}}),[t,n,i]),e("div",{className:Nt({hidden:!p}),children:e(U,{"data-testid":`${n}-context-menu`,open:asBooleanAttribute(p),position:u,fallbackPlacements:m,backdrop:!a,onMenuClosed:()=>{c.clearActiveContextMenu(),null==o||o()},children:e("div",{className:"pt-1",children:r})})})},VertexFitSelectedMenuItem=()=>{const n=s(un),a=s(bn),i=useViewerCameraActions();return t(F,{"data-testid":"fit-selected-menu-option",onClick:()=>{null!=(null==a?void 0:a.boundingBox)&&i.flyToByBoundingBox(a.boundingBox)},disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"fit-selected",size:"sm"}),e("div",{className:"pl-2",children:"Fit Selected"})]})},VertexFlyToMenuItem=()=>{const n=useViewerCameraActions(),a=s(jt);return t(F,{"data-testid":"fly-to-part-menu-option",onClick:()=>{var e;const t=undefined,i=contextMenuItemIsRow(a)?null===(e=null==a?void 0:a.node.id)||void 0===e?void 0:e.hex:null==a?void 0:a.id;null!=i&&n.flyToById(i)},disabled:asBooleanAttribute(null==a),children:[e(D,{slot:"icon",name:"paper-airplane",size:"sm"}),e("div",{className:"pl-2",children:"Fly To"})]})};function useSceneItemsOperations(){const e=s(Fe),t=undefined,n=undefined,a=undefined,i=undefined,l=undefined,o=undefined;return{sceneItemsOperation:v.useCallback((async(t,n)=>{const a=await(null==e?void 0:e.scene());null==n?await(null==a?void 0:a.items((e=>t(e.where((e=>e.all()))))).execute()):n.length>0&&await(null==a?void 0:a.items((e=>t(e.where((e=>e.withItemIds(n)))))).execute())}),[e]),showOnlySelected:v.useCallback((async()=>{const t=await(null==e?void 0:e.scene());null==t||t.items((e=>[e.where((e=>e.all())).hide(),e.where((e=>e.withSelected())).show()])).execute()}),[e]),hideSelected:v.useCallback((async()=>{const t=await(null==e?void 0:e.scene());null==t||t.items((e=>[e.where((e=>e.withSelected())).hide()])).execute()}),[e]),showOnlyItem:v.useCallback((async t=>{const n=await(null==e?void 0:e.scene());null==n||n.items((e=>[e.where((e=>e.all())).hide(),e.where((e=>e.withItemIds([t]))).show()])).execute()}),[e]),ghostSelected:v.useCallback((async()=>{const t=await(null==e?void 0:e.scene());null==t||t.items((e=>[e.where((e=>e.withSelected())).setPhantom(!0)])).execute()}),[e]),unGhostSelected:v.useCallback((async()=>{const t=await(null==e?void 0:e.scene());null==t||t.items((e=>[e.where((e=>e.withSelected())).setPhantom(!1)])).execute()}),[e])}}const VertexHideAllMenuItem=()=>{const n=useSceneItemsOperations();return t(F,{"data-testid":"hide-all-menu-option",onClick:()=>{n.sceneItemsOperation((e=>e.hide()))},children:[e(D,{slot:"icon",name:"visibility-hidden",size:"sm"}),e("div",{className:"pl-2",children:"Hide All Parts"})]})},VertexHidePartMenuItem=()=>{const n=s(jt),a=useSceneItemsOperations();return t(F,{"data-testid":"hide-menu-option",onClick:()=>{var e;const t=undefined,i=contextMenuItemIsRow(n)?null===(e=null==n?void 0:n.node.id)||void 0===e?void 0:e.hex:n.id;null!=i&&a.sceneItemsOperation((e=>e.hide()),[i])},disabled:asBooleanAttribute(null==n),children:[e(D,{slot:"icon",name:"visibility-hidden",size:"sm"}),e("div",{className:"pl-2",children:"Hide Part"})]})},VertexHideSelectedMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return t(F,{"data-testid":"hide-selected-menu-option",onClick:()=>a.hideSelected(),disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"visibility-hidden",size:"sm"}),e("div",{className:"pl-2",children:"Hide Selected"})]})},VertexShowAllMenuItem=()=>{const n=useSceneItemsOperations();return t(F,{"data-testid":"show-all-menu-option",onClick:()=>{n.sceneItemsOperation((e=>e.show()))},children:[e(D,{slot:"icon",name:"visibility-visible",size:"sm"}),e("div",{className:"pl-2",children:"Show All Parts"})]})},VertexShowOnlyMenuItem=()=>{const n=s(jt),a=useSceneItemsOperations();return t(F,{"data-testid":"show-only-menu-option",onClick:()=>{var e;const t=undefined,i=contextMenuItemIsRow(n)?null===(e=null==n?void 0:n.node.id)||void 0===e?void 0:e.hex:null==n?void 0:n.id;null!=i&&a.showOnlyItem(i)},disabled:asBooleanAttribute(null==n),children:[e(D,{slot:"icon",name:"visibility-visible",size:"sm"}),e("div",{className:"pl-2",children:"Show Only Part"})]})},VertexShowOnlySelectedMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return t(F,{"data-testid":"show-only-selected-menu-option",onClick:()=>a.showOnlySelected(),disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"visibility-visible",size:"sm"}),e("div",{className:"pl-2",children:"Show Only Selected"})]})};l({key:"sceneTreeLoaderVisible",default:!1});const pa=l({key:"sceneTreeElement",default:void 0}),ha=l({key:"sceneTreeController",default:void 0,dangerouslyAllowMutability:!0});function useSceneTreeActions(){const e=useSelectionActions(),t=useViewerCameraActions();return{toggleSelection:useActionCallback((({snapshot:t})=>async(n,a,i)=>{var l,o;if(!n.defaultPrevented&&0===n.button&&(n.altKey||((n.ctrlKey||n.metaKey)&&a.selected?await i.deselectItem(a):a.selected?await i.selectItem(a,{recurseParent:!0}):a.selected||await i.selectItem(a,{append:n.ctrlKey||n.metaKey,range:n.shiftKey})),null!=a.id)){const i=await t.getPromise(mn);e.syncSelection({id:null===(l=a.id)||void 0===l?void 0:l.hex,ancestors:null!==(o=null==i?void 0:i.ancestors)&&void 0!==o?o:[]},{selected:!n.metaKey&&!n.ctrlKey||!a.selected,multiSelect:n.shiftKey||n.metaKey||n.ctrlKey})}})),toggleExpansion:useActionCallback((()=>(e,t,n)=>{n.toggleExpandItem(t)})),toggleVisibility:useActionCallback((()=>(e,t,n)=>{n.toggleItemVisibility(t)})),flyToRow:useActionCallback((({snapshot:e})=>async n=>{var a;const i=await e.getPromise(pa),l=await(null==i?void 0:i.getRowAtClientY(n));null!=(null===(a=null==l?void 0:l.node.id)||void 0===a?void 0:a.hex)&&await t.flyToById(l.node.id.hex)})),flyToFirstSelectedItem:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(pa),n=await e.getPromise(gn);null!=n&&(null==t||t.scrollToItem(n))})),setContextMenuItem:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=await t.getPromise(pa),i=await(null==a?void 0:a.getRowAtClientY(n));e(jt,i)}))}}const VertexGhostSelectedMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return t(F,{"data-testid":"ghost-selected-menu-option",onClick:()=>a.ghostSelected(),disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"visibility-partial",size:"sm"}),e("div",{className:"pl-2",children:"Ghost Selected"})]})},VertexUnghostSelectedMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return t(F,{"data-testid":"unghost-selected-menu-option",onClick:()=>a.unGhostSelected(),disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"visibility-visible",size:"sm"}),e("div",{className:"pl-2",children:"Unghost Selected"})]})},DefaultSceneTreeContextMenu=()=>t("div",{className:"w-56",children:[e(VertexHideSelectedMenuItem,{}),e(VertexHideAllMenuItem,{}),e(VertexShowOnlyMenuItem,{}),e(VertexShowOnlySelectedMenuItem,{}),e(VertexShowAllMenuItem,{}),e(VertexGhostSelectedMenuItem,{}),e(VertexUnghostSelectedMenuItem,{}),e(W,{}),e(VertexFitSelectedMenuItem,{}),e(VertexFlyToMenuItem,{})]}),VertexSceneTreeContextMenu=({children:t})=>{const n=useSceneTreeActions(),a=s(pa),i=undefined;return e(VertexContextMenu,{menuType:"scene-tree",targetElement:a,onOpen:async(e,t)=>{const a=e;await n.setContextMenuItem(a.clientY)},disableBackdrop:!0,children:null!=t&&!1!==t?t:e(DefaultSceneTreeContextMenu,{})})},DefaultViewerContextMenu=()=>t("div",{className:"w-56",children:[e(VertexHidePartMenuItem,{}),e(VertexHideSelectedMenuItem,{}),e(VertexHideAllMenuItem,{}),e(VertexShowOnlyMenuItem,{}),e(VertexShowOnlySelectedMenuItem,{}),e(VertexShowAllMenuItem,{}),e(VertexGhostSelectedMenuItem,{}),e(VertexUnghostSelectedMenuItem,{}),e(W,{}),e(VertexFitSelectedMenuItem,{}),e(VertexFlyToMenuItem,{})]}),VertexViewerContextMenu=({children:t})=>{const n=null!=t&&!1!==t,a=v.useCallback((e=>e.target instanceof HTMLElement&&"vertex-viewer"===e.target.id),[]);return e(VertexContextMenu,{menuType:"viewer",disableBackdrop:!0,openPredicate:a,children:n?t:e(DefaultViewerContextMenu,{})})},fa=undefined,ga=l({key:"sceneItemGhostingSelectedOpacity",default:35}),va=u({key:"appliedItemPhantomState",default:void 0}),ya=l({key:"appliedItemPhantomStateIds",default:[]}),ba=o({key:"sceneItemGhostingLastSelectedPhantom",get:({get:e})=>{var t;const n=e(mn);return null!=n&&(null!==(t=e(va(n.id)))&&void 0!==t&&t)}}),VertexSceneItemGhostingOpacitySlider=({onApply:t})=>{const[n,a]=r(ga);return e(VertexSlider,{id:"phantom-opacity","data-testid":"phantom-opacity-slider",leftLabel:"0%",rightLabel:"100%",min:0,max:100,step:5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{null==t||t(e.detail.value)}})},useSceneItemPhantomActions=()=>{const e=useViewerSceneActions(),t=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=undefined;(await e.getPromise(ya)).forEach((e=>t(va(e)))),t(ya)}));return{setPhantomState:useActionCallback((({snapshot:t,set:n})=>async a=>{const i=await t.getPromise(un);i.forEach((e=>n(va(e),a))),n(ya,(e=>[...e,...i])),await e.execute(sn.SET_PHANTOM_SELECTED_ITEMS,(e=>e.where((e=>e.withSelected())).setPhantom(a)))})),clearPhantomState:useActionCallback((({snapshot:t,set:n,reset:a})=>async()=>{const i=await t.getPromise(un);i.forEach((e=>a(va(e)))),n(ya,(e=>e.filter((e=>!i.includes(e))))),await e.execute(sn.CLEAR_PHANTOM_SELECTED_ITEMS,(e=>e.where((e=>e.withSelected())).clearPhantom()),(e=>e.where((e=>e.withSelected())).select()))})),clearAllPhantomState:useActionCallback((()=>async()=>{await t(),await e.execute(sn.CLEAR_PHANTOM_ALL,(e=>e.where((e=>e.all())).clearPhantom()),(e=>e.where((e=>e.withSelected())).select()))})),resetAllPhantomState:t}},VertexSceneItemGhostingToggle=({onApply:t})=>{const n=useSceneItemPhantomActions(),a=s(xn),i=p(ba);return e(V,{content:"Select a part to display as ghost",disabled:a,children:e(_,{className:"flex items-center","data-testid":"phantom-state-toggle",variant:"switch",disabled:!a,checked:"hasValue"===i.state&&i.contents,onValueChanged:async e=>{await n.setPhantomState(e.detail),null==t||t(e.detail)}})})};function VertexGhostingControls({onApplyGhostingChange:a,onApplyOpacity:i}){return t(n,{children:[t("div",{className:"flex items-center py-3",children:[e(VertexSceneItemGhostingToggle,{onApply:a}),e("span",{className:"pl-4 text-sm text-neutral-700",children:"Display as Ghost"})]}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Global Ghost Opacity"}),e(VertexSceneItemGhostingOpacitySlider,{onApply:i})]})}const VertexSceneItemGhostingClear=({onClear:n,onClearAll:a})=>{const i=useSceneItemPhantomActions(),l=s(ba);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"phantom",tooltip:"Clear Ghosting",children:[e("div",{className:"pt-1"}),e(F,{"data-testid":"reset-selected-phantom",onClick:async()=>{await i.clearPhantomState(),null==n||n()},disabled:!l,children:"Clear ghosting for selected"}),e(F,{"data-testid":"reset-all-phantom",onClick:async()=>{await i.clearAllPhantomState(),null==a||a()},children:"Clear ghosting for all"})]})})};function VertexGhostingPanelSection({onClearGhostState:n,onClearAllGhostState:a,onApplyGhostingChange:i,onApplyOpacity:l}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Ghosting",e(VertexSceneItemGhostingClear,{onClear:n,onClearAll:a})]}),children:e(VertexGhostingControls,{onApplyGhostingChange:i,onApplyOpacity:l})})}function VertexMeasurementContextMenu({onDelete:n}){const a=s(_t);return e(VertexContextMenu,{menuType:"measurement",openPredicate:e=>e.target instanceof HTMLElement&&"VERTEX-VIEWER-MEASUREMENT-DISTANCE"===e.target.tagName,children:t(F,{"data-testid":"measurement-delete",onClick:()=>null!=a&&n(a.id),children:[e(D,{slot:"icon",name:"delete",size:"sm"}),e("div",{className:"pl-2",children:"Delete"})]})})}function useDockedPlacement(e,t){const[n,a]=g.useState(P.create(0,0));return g.useLayoutEffect((()=>{if(null!=e){const n=e.getBoundingClientRect(),i=P.create(n.left,n.bottom),l=P.create(n.right,n.bottom);a("left"===t?i:l)}}),[e,t]),n}function VertexMeasurementDetails({placement:n}){const a=useMeasurementActions(),i=s(Fe),l=s(He),o=useDockedPlacement(null!=i?i:null,n),r=s(Qt),c=s(en),d=s(tn),u=s(nn),m=s(kn),p=s(An);return e(G,{className:"z-popover",boundaryPadding:16,boundarySelector:`#${l}`,position:o,children:t("div",{className:"flex flex-col leading-4 min-w-40",children:[t("div",{className:"pb-2 flex justify-between",children:[e("div",{className:"w-full",children:"Measurement"}),e("div",{className:Nt("-mt-1 relative",{hidden:!u}),children:e(V,{content:"Reset",placement:"left-start",children:e(L,{"data-testid":"measurement-details-reset",iconName:"reset",iconSize:"sm",onClick:a.resetMeasurement})})})]}),e(ne,{"data-testid":"measurement-details-viewer-measurement-details",className:Nt("gap-y-1.5 text-xs",{hidden:null==r}),measurementOutcome:r,measurementOverlays:c,distanceUnits:toUnitType(m),fractionalDigits:parseInt(p,10)}),e("div",{"data-testid":"measurement-details-message",className:Nt("text-xs",{hidden:null==d}),children:d})]})})}function useCallbackRef(e){var t;const[n,a]=v.useState((t=void 0,null)),i=undefined;return{element:n,callback:v.useCallback((e=>a(e)),[])}}function VertexPointToPointMeasurement({detailsPlacement:a,onPointToPointMeasurementChange:i}){const l=useMeasurementActions(),o=s(Fe),r=s(Ht),c=s(Wt),d=s(kn),u=s(An),{callback:m,element:p}=useCallbackRef();usePointToPointMeasurement(p);const h=w((e=>{const t={start:e.detail.start,end:e.detail.end,invalid:!e.detail.valid};l.setEditedPointToPointMeasurement(t),null==i||i(t)}),[l]);return r?t(n,{children:[e(ae,{"data-testid":"point-to-point-measurement",ref:m,viewer:null!=o?o:void 0,mode:"replace",start:null==c?void 0:c.start,end:null==c?void 0:c.end,invalid:null==c?void 0:c.invalid,units:toUnitType(d),fractionalDigits:parseInt(u,10),showAxisReferenceLines:!0,onEditEnd:h}),e(VertexMeasurementDetails,{placement:a}),e(VertexMeasurementContextMenu,{onDelete:l.resetMeasurement})]}):e(n,{})}function VertexPointToPointMeasurementTool(){const t=useMeasurementActions(),n=s(Ht);return useStackKeyBinding({id:"ExitMeasurement",keyBind:"Escape",fn:t.disableEditMeasurement,addPredicate:()=>n,cancelPredicate:()=>!n},[n,t]),e(V,{content:"Point to Point Measurement",children:e(L,{iconName:"tape-measure","data-testid":"viewer-toolbar-point-to-point-measurement-button",iconColor:n?"primary":"secondary",onClick:t.toggleEditPointToPointMeasurement})})}const wa=l({key:"viewerToolkitSdkConfig",default:void 0}),VertexPreciseMeasurement=({detailsPlacement:a,onEntitiesChanged:i,onOutcomeChanged:l})=>{var o,r,c,d;const u=s(Fe),m=s(wa),p=s(Kt),{callback:h,element:f}=useCallbackRef();return usePreciseMeasurementModel(f,i,l),p?t(n,{children:[e(ie,{"data-testid":"precise-measurement-viewer-tool",ref:h,viewer:null!=u?u:void 0,config:JSON.stringify({network:{apiHost:null===(o=null==m?void 0:m.network)||void 0===o?void 0:o.apiHost,renderingHost:null===(r=null==m?void 0:m.network)||void 0===r?void 0:r.renderingHost,sceneTreeHost:null===(c=null==m?void 0:m.network)||void 0===c?void 0:c.sceneTreeHost,sceneViewHost:null===(d=null==m?void 0:m.network)||void 0===d?void 0:d.sceneViewHost}})}),e(VertexMeasurementDetails,{placement:a})]}):e(n,{})};function VertexPreciseMeasurementTool(){const t=useMeasurementActions(),n=s(Kt);return e(V,{content:"Precise Measurement",children:e(L,{iconName:"ruler","data-testid":"viewer-toolbar-precise-measurement-button",iconColor:n?"primary":"secondary",onClick:t.toggleEditPreciseMeasurement})})}function VertexApplicationMessages(){const a=s(on),i=s(ln);return t(n,{children:[null!=a&&e(K,{className:"z-[16000]",duration:a.duration,open:!0,content:a.message,type:a.type},a.id),null!=i&&e($,{placement:"bottom-left",className:"z-[16000]",duration:i.duration,open:!0,content:i.message,type:i.type},i.id)]})}const Ca={binding:"{{row.node.name}}",label:"Name",metadataKeyName:"VERTEX_SCENE_ITEM_NAME"};function mapToColumn(e,t){return{label:"name"===e.toLowerCase()?"Name (Property)":e,binding:`{{row.metadata.${e}}}`,initialWidth:t,minWidth:t/2}}const xa=l({key:"sceneTreeColumnsRefreshTrigger",default:0}),Sa=o({key:"sceneTreeColumnsAvailableColumns",get:async({get:e})=>{const t=e(ha);return e(xa),null!=t?await t.fetchMetadataKeys():[]}}),ka=o({key:"sceneTreeColumnsAvailableSortedColumns",get:({get:e})=>e(Sa).filter((e=>e!==Ca.metadataKeyName)).sort(((e,t)=>e.localeCompare(t)))}),Aa=l({key:"sceneTreeColumnsVisibleMetadataColumnNames",default:[]}),Ta=o({key:"sceneTreeColumnsActiveColumns",get:({get:e})=>{const t=e(Aa),n=e(pa),a=null==n?void 0:n.clientWidth;if(null!=a&&a>0){const e=1/(t.length+1)*a,n=(a-e)/t.length;return t.reduce(((e,t)=>{const a=mapToColumn(t,n);return Object.assign(Object.assign({},e),{[a.label]:a})}),{Name:Object.assign(Object.assign({},Ca),{initialWidth:e,minWidth:n})})}return{Name:Ca}}}),Ea=o({key:"sceneTreeColumnsActiveColumnNames",get:({get:e})=>Object.keys(e(Ta))});function useSceneTreeColumnActions(){return{setActive:useActionCallback((({set:e,snapshot:t})=>async n=>{e(Aa,n);const a=await t.getPromise(ha);null==a||a.setMetadataKeys(n)})),refreshKeyList:useActionCallback((({set:e})=>()=>{e(xa,(e=>e+1))}))}}const Pa=16,Na=-8;var Oa;function useOpenColumnPopover({buttonElement:e,horizontalOffset:t,verticalOffset:n}){const[a,i]=g.useState(!1),[l,o]=g.useState(),[s,r]=g.useState(),c=g.useCallback((()=>{if(a)i(!1);else{const a=null==e?void 0:e.getBoundingClientRect();if(null!=a){const e=null!=t?t:Pa,l=null!=n?n:Na,s=a.x>window.innerWidth/2?Oa.LEFT:Oa.RIGHT;o({x:s===Oa.LEFT?a.left-e:a.right+e,y:a.top+l}),r(s),i(!0)}}}),[a,e]),d=g.useCallback((()=>{i(!1)}),[]);return{open:a,position:l,direction:s,handleOpen:c,handleClose:d}}!function(e){e.LEFT="left",e.RIGHT="right"}(Oa||(Oa={}));const Ia=l({key:"sceneTreeSearchActive",default:!1}),Ma=l({key:"sceneTreeColumnsPartial",default:!1}),Va=l({key:"sceneTreeSearchValue",default:void 0}),La=l({key:"sceneTreeSearchExactMatch",default:!1}),Ra=l({key:"sceneTreeSearchResultCount",default:0}),_a=l({key:"sceneTreeSearchActiveColumns",default:[]}),ja=o({key:"sceneTreeSearchNameColumnActive",get:({get:e})=>{const t=e(_a);return 0===t.length||t.includes(Ca.metadataKeyName)}});function useSceneTreeSearch({sceneTreeElement:e}){const t=useSceneTreeActions(),n=s(Ia),a=c(Ra),i=c(gn);v.useEffect((()=>{let t;return whenComponentReady(e,(()=>{var n;t=null===(n=null==e?void 0:e.controller)||void 0===n?void 0:n.stateChanged((e=>{void 0!==(null==e?void 0:e.totalFilteredRows)&&a(null==e?void 0:e.totalFilteredRows)}))})),()=>{null==t||t.dispose()}}),[e]),v.useEffect((()=>{if(null!=e){let a;return whenComponentReady(e,(()=>{var l;a=null===(l=null==e?void 0:e.controller)||void 0===l?void 0:l.stateChanged((e=>{var a;if(null!=(null==e?void 0:e.filterTerm)){const t=null==e?void 0:e.rows.find((e=>{var t;return null===(t=null==e?void 0:e.node)||void 0===t?void 0:t.selected}));i(null===(a=null==t?void 0:t.node.id)||void 0===a?void 0:a.hex)}else n&&t.flyToFirstSelectedItem()}))})),()=>{null==a||a.dispose()}}}),[e,null==e?void 0:e.controller,open])}function useSceneTreePartialResults({sceneTreeElement:e}){const t=c(Ma);v.useEffect((()=>{let n;return whenComponentReady(e,(()=>{var a;n=null===(a=null==e?void 0:e.controller)||void 0===a?void 0:a.stateChanged((e=>{t(!!(null==e?void 0:e.isPartialKeysResponse))}))})),()=>{null==n||n.dispose()}}),[e])}const useSceneTreeSearchActions=()=>{const e=useActionCallback((({set:e})=>t=>{e(_a,t)})),t=useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(pa),a=await e.getPromise(La),i=await e.getPromise(_a),l=a?[Ca.metadataKeyName]:[],o=i.length>0?i:l;null==n||n.filterItems(t,{columns:o,exactMatch:a})})),n=useActionCallback((({snapshot:t})=>async(n,a)=>{const i=await t.getPromise(_a);if(a)e(0===i.length?[Ca.metadataKeyName,n]:[...i,n]);else{const t=i.filter((e=>e!==n));e(t.every((e=>e===Ca.metadataKeyName))?[]:t)}})),a=useActionCallback((({set:e})=>t=>{e(La,t)}));return{setMetadataSearchKeys:e,updateSearchForActiveColumns:t,updateMetadataSearchAfterSearchKeysChange:n,setMetadataSearchExactMatch:a}};function useCacheableLoadable(e,t){const n=C(),[a,i]=S(0),l=p(e);b((()=>{"hasValue"===l.state&&(n.current=l.contents)}),[t,l]);const[o,s]=k((()=>"hasValue"!==l.state&&null!=n.current?[n.current,!0]:"hasValue"===l.state?[l.contents,!1]:[void 0,!1]),[l.state,l.contents,a]),r=w((()=>{n.current=void 0,i(a+1)}),[a]),c=undefined;return k((()=>({data:o,state:l.state,cached:s,invalidate:r})),[r,o,s,l.state])}const VertexSceneTreeMetadataCheck=({checked:n,disabled:a,onChange:i,children:l})=>{const o="string"==typeof l?l.replace(" ","-"):"";return t("div",{className:"flex items-center",children:[e(_,{"data-testid":`scene-tree-metadata-check-${o}`,variant:"check",checked:n,disabled:a,onValueChanged:e=>null==i?void 0:i(e.detail)}),e("div",{className:"pl-2 py-1 text-[0.875rem] w-full","data-testid":`scene-tree-metadata-name-${o}`,onClick:()=>{a||null==i||i(!n)},children:l})]})},VertexSceneTreeColumnPopover=({onVisibleSceneTreeColumnsChange:a})=>{const i=useSceneTreeColumnActions(),l=useSceneTreeSearchActions(),o=s(pa);useSceneTreePartialResults({sceneTreeElement:null!=o?o:null});const r=s(Va),c=useCacheableLoadable(ka),d=s(Aa),u=s(Ma),m=s(_a),[p,h]=g.useState(d),[f,v]=g.useState(""),{element:b,callback:w}=useCallbackRef(),{open:C,position:S,direction:k,handleOpen:A,handleClose:T}=useOpenColumnPopover({buttonElement:b}),E=k===Oa.LEFT?"left-end":"right-start",P=g.useMemo((()=>{if(null!=c.data){const e=c.data.filter((e=>p.indexOf(e)<0)),t=undefined;return[...[...p].sort(((e,t)=>e.localeCompare(t))),...e]}return[]}),[p,c.data]),N=g.useMemo((()=>P),[C,c.data]);return t(n,{children:[e(V,{content:"Configure Columns",placement:"top",children:e(L,{"data-testid":"scene-tree-column-popover-button",ref:w,iconName:"columns-add",iconSize:"sm",onClick:()=>{A()}})}),C&&e(q,{"data-testid":"scene-tree-column-popover",open:C,backdrop:!1,position:S,resizeBehavior:"fixed",placement:E,className:"z-popover",children:t("div",{className:Nt("flex flex-col bg-white border border-neutral-300 rounded",{hidden:!C}),children:[t("div",{className:"flex items-center text-[0.875rem] p-3",children:[t("div",{className:"pr-2",children:[e("div",{className:"text-[0.875rem]",children:"Assembly Properties"}),e("div",{className:"text-[0.75rem] text-neutral-700 mt-1.5",children:"Select up to six properties to appear in the Assembly panel."})]}),e(L,{"data-testid":"scene-tree-columns-popover-close-button",className:"ml-auto",iconName:"close",iconSize:"sm",onClick:()=>{v(""),T()}})]}),e(Y,{className:"flex w-full px-2 overflow-hidden border-b border-neutral-300 pb-2",id:"scene-tree-available-columns-search-bar","data-testid":"scene-tree-available-columns-search-bar",multiline:!1,placeholder:"Filter properties",type:"text",onInputInput:e=>{const t=e.detail.value;null!=t&&v(t.toLowerCase())}}),u&&e(le,{"data-testid":"partial-key-list-notification-banner",message:"loading"===c.state?"Refreshing results...":"Data loading, refresh for more.",actionLabel:"Refresh",onAction:()=>i.refreshKeyList()}),t("div",{className:"max-h-64 p-3 overflow-y-auto",children:[e(VertexSceneTreeMetadataCheck,{checked:!0,disabled:!0,children:Ca.label}),N.filter((e=>""===f||e.toLowerCase().includes(f))).map((t=>e(VertexSceneTreeMetadataCheck,{checked:p.includes(t),disabled:p.length>=6&&!p.includes(t),onChange:e=>{h(e?[...p,t]:p.filter((e=>e!==t)))},children:t},t)))]}),t("div",{className:"flex items-center p-3 border-t border-neutral-300 space-x-4",children:[e("div",{className:"text-[0.75rem] text-[var(--vertex-ui-blue-700)] cursor-pointer","data-testid":"scene-tree-column-clear-selection",onClick:()=>h([]),children:"Clear selection"}),e("div",{className:"flex-grow"}),t("div",{className:"flex space-x-2",children:[e(j,{"data-testid":"scene-tree-column-popover-cancel",color:"secondary",onClick:()=>{v(""),T()},children:"Cancel"}),e(j,{"data-testid":"scene-tree-column-popover-apply",color:"primary",onClick:async()=>{await i.setActive(p),null==a||a(p),v(""),T();const e=[Ca.metadataKeyName,...p],t=m.filter((t=>!e.includes(t)));t.length>0&&(await Promise.all(t.map((e=>l.updateMetadataSearchAfterSearchKeysChange(e,!1)))),null!=r&&await l.updateSearchForActiveColumns(r))},children:"Apply"})]})]})]})})]})},VertexSceneTreeSearchOptionsPopover=({onSearchedSceneTreeColumnsChange:a,onSearchForExactMatchChange:i})=>{const l=useSceneTreeSearchActions(),o=s(ja),r=s(_a),c=s(Va),d=s(La),u=s(Aa),{element:m,callback:p}=useCallbackRef(),{open:h,position:f,direction:g,handleOpen:v,handleClose:b}=useOpenColumnPopover({buttonElement:m,horizontalOffset:40}),w=g===Oa.LEFT?"left-end":"right-start";return t(n,{children:[e(V,{content:"Search Options",placement:"top",children:e(L,{"data-testid":"scene-tree-search-options-popover-button",ref:p,iconName:"gear",iconSize:"sm",onClick:()=>{v()}})}),e(q,{"data-testid":"scene-tree-search-options-popover",open:h,backdrop:!1,position:f,resizeBehavior:"fixed",placement:w,className:"z-popover",children:t("div",{className:Nt("flex flex-col bg-white border border-neutral-300 rounded",{hidden:!h}),children:[t("div",{className:"flex items-center text-[0.875rem] p-3 border-b border-neutral-300 pb-2",children:[e("div",{className:"pr-2 text-[0.875rem] whitespace-nowrap",children:"Column Properties Search"}),e(L,{className:"ml-auto",iconName:"close",iconSize:"sm",onClick:()=>{b()}})]}),t("div",{className:"max-h-64 p-3 overflow-y-auto",children:[e("div",{className:"text-[0.875rem] pb-2 pr-2",children:"Select properties to perform the search on:"}),e(VertexSceneTreeMetadataCheck,{checked:o,disabled:0===r.length||r.every((e=>e===Ca.metadataKeyName)),onChange:async e=>{await l.updateMetadataSearchAfterSearchKeysChange(Ca.metadataKeyName,e),null==a||a(),null!=c&&await l.updateSearchForActiveColumns(c)},children:Ca.label},Ca.metadataKeyName),u.map((t=>e(VertexSceneTreeMetadataCheck,{checked:r.includes(t),disabled:r.length>0&&r.every((e=>e===t)),onChange:async e=>{await l.updateMetadataSearchAfterSearchKeysChange(t,e),null==a||a(),null!=c&&await l.updateSearchForActiveColumns(c)},children:t},t)))]}),t("div",{className:"flex p-3 border-t border-neutral-300",children:[e(_,{className:"flex items-center","data-testid":"filter-exact-match-toggle",variant:"switch",checked:d,onValueChanged:async e=>{l.setMetadataSearchExactMatch(e.detail),null==i||i(),null!=c&&await l.updateSearchForActiveColumns(c)}}),e("span",{className:"pl-4 text-[0.875rem] text-neutral-800",children:"Return only exact matches"})]})]})})]})},VertexSceneTreeSearchBar=({onSearch:n,onClearSearch:a,onExitSearchMode:i,onSearchedSceneTreeColumnsChange:l,onSearchForExactMatchChange:o,children:c})=>{const d=useSceneTreeActions(),u=s(pa),[m,p]=r(Ia),[h,f]=r(Va);useSceneTreeSearch({sceneTreeElement:null!=u?u:null});const{element:v,callback:b}=useCallbackRef(),w=null==h||""===h,C=w?"Exit Search":"Clear Search";return g.useEffect((()=>{m&&(null==v||v.setFocus())}),[v,m]),t("div",{className:"flex w-full py-3 px-2",children:[e(oe,{"data-testid":"scene-tree-search-bar",ref:b,controller:null==u?void 0:u.controller,onBlur:()=>{w&&(p(!1),null==i||i())},onSearch:()=>{f(null==v?void 0:v.value),null==n||n(null==v?void 0:v.value)},children:c}),e("div",{className:"self-center px-1",onPointerDown:e=>{e.preventDefault()},children:e(VertexSceneTreeSearchOptionsPopover,{onSearchedSceneTreeColumnsChange:l,onSearchForExactMatchChange:o})}),e(V,{className:"self-center pr-1",content:C,children:e(L,{"data-testid":"scene-tree-search-close-button",iconName:"close-circle-fill",iconSize:"sm",variant:"plain",onPointerDown:e=>{e.preventDefault()},onClick:async()=>{w?(p(!1),await d.flyToFirstSelectedItem(),null==i||i()):(await(null==v?void 0:v.clear()),await(null==v?void 0:v.setFocus()),f(void 0),null==a||a())}})})]})};function VertexToolbarDivider(){return e("div",{"data-testid":"toolbar-divider",className:"h-6 w-px bg-neutral-300 mx-1"})}const VertexSceneTreeSearchInformationForToolbar=()=>{const a=useSelectionActions(),i=s(pa),l=s(Va),o=s(Ra),r=undefined,c=undefined,d=`${o>=1e3?`${o}+`:`${o}`} ${1===o?"result":"results"}`;return t(n,{children:[e(VertexToolbarDivider,{}),t("div",{className:"flex flex-row items-center overflow-hidden",children:[e("div",{className:"px-2 text-[0.8125rem] leading-4 text-neutral-900 truncate","data-testid":"search-result-info",children:`${d}`}),e(V,{className:"w-auto",content:"Select Results",placement:"top",children:e(j,{className:"h-6 rounded cursor-pointer","data-testid":"select-search-results-button",color:"secondary",variant:"text",size:"sm",onClick:async()=>{null!=i&&null!=l&&(await i.selectFilteredItems(l),a.toggleLastSelectWasMultiSelect(!0))},children:t("div",{className:"flex h-6 items-center gap-1",children:[e(D,{size:"sm",name:"check-circle"}),e("span",{className:"whitespace-nowrap",children:"Select Results"})]})})})]})]})},targetIsElement=(e,t)=>e instanceof Element&&e.tagName===t;function useRecoilRef({state:e}){const t=i((({set:t})=>n=>{t(e,n)}),[]);return t}var Ba;function styleFromOptionalFont(e){return null!=e?{"--scene-tree-default-font-family":styleFromFontFace(e.fontFace),"--scene-tree-default-font-color":e.color}:{}}function styleFromOptionalBackgroundColors(e){const t=null==e?void 0:e.depthColors,n=null!=t?Object.keys(t).reduce(((e,n)=>Object.assign(Object.assign({},e),{[`--scene-tree-row-background-color-depth-${n}`]:t[parseInt(n)]})),{}):{};return null!=e?Object.assign(Object.assign({},n),{"--scene-tree-hovered-row-background-color":e.hovered,"--scene-tree-selected-row-background-color":e.selected,"--scene-tree-row-background-color":e.defaultColor}):{}}function styleFromFontFace(e){return e===Ba.ROBOTO_MONO?"var(--vertex-ui-font-family-monospace)":"var(--vertex-ui-font-family)"}!function(e){e.ROBOTO="ROBOTO",e.ROBOTO_MONO="ROBOTO_MONO"}(Ba||(Ba={}));const VertexEnterSceneTreeSearchModeButton=({onEnterSearchMode:t})=>{const n=c(Ia);return e(V,{className:"flex ml-auto",content:"Scene Tree Search",children:e(L,{"data-testid":"enter-scene-tree-search-mode-button",iconName:"search",iconSize:"sm",onPointerDown:e=>{e.preventDefault()},onClick:()=>{n(!0),null==t||t()}})})},VertexSceneTreeSearch=({onEnterSearchMode:n,onExitSearchMode:a,onSearch:i,onClearSearch:l,onSearchedSceneTreeColumnsChange:o,onSearchForExactMatchChange:r,children:c})=>{const d=s(Ia);return t(se,{className:"h-11 p-0 border-b border-neutral-300 box-content",slot:"header",children:[d&&e(VertexSceneTreeSearchBar,{onSearch:i,onClearSearch:l,onExitSearchMode:a,onSearchedSceneTreeColumnsChange:o,onSearchForExactMatchChange:r,children:c}),!d&&e("div",{className:"ml-auto mr-2",children:e(VertexEnterSceneTreeSearchModeButton,{onEnterSearchMode:n})})]})},VertexSceneTreeCollapseAll=()=>{const t=s(pa);return e(V,{className:"w-auto",content:"Collapse All",placement:"top",children:e(D,{size:"sm",className:"h-6 w-6 hover:bg-neutral-300 rounded cursor-pointer","data-testid":"collapse-all-icon",name:"collapse-all",onClick:()=>{null==t||t.collapseAll()}})})},VertexSceneTreeExpandAll=()=>{const t=s(pa);return e(V,{className:"w-auto",content:"Expand All",placement:"top",children:e(D,{size:"sm","data-testid":"expand-all-icon",className:"h-6 w-6 hover:bg-neutral-300 rounded cursor-pointer",name:"expand-all",onClick:()=>{null==t||t.expandAll()}})})},VertexSceneTreeToolbar=({onVisibleSceneTreeColumnsChange:n})=>{const a=s(Va),i=null==a||""===a;return e(se,{className:"h-10 border-b border-neutral-300 box-border",children:t("div",{className:"flex w-full text-neutral-700 items-center gap mx-2",children:[e(VertexSceneTreeExpandAll,{}),e(VertexSceneTreeCollapseAll,{}),!i&&e(VertexSceneTreeSearchInformationForToolbar,{}),e("div",{className:"ml-auto",children:e(VertexSceneTreeColumnPopover,{onVisibleSceneTreeColumnsChange:n})})]})})},VertexSceneTreeHeader=({onEnterSearchMode:a,onExitSearchMode:i,onSearch:l,onClearSearch:o,onVisibleSceneTreeColumnsChange:s,children:r})=>{const c=undefined;return e("div",{slot:"header",className:"flex flex-col",children:null!=r&&!1!==r?r:t(n,{children:[e(VertexSceneTreeSearch,{onEnterSearchMode:a,onExitSearchMode:i,onSearch:l,onClearSearch:o,children:e("div",{slot:"clear-icon"})}),e(VertexSceneTreeToolbar,{onVisibleSceneTreeColumnsChange:s})]})})},VertexSceneTreeTableLayout=n=>{const a=s(Ta),i=s(Ea),l=[];return e(re,Object.assign({"data-testid":"scene-tree-table-layout"},n,{children:i.map(((n,o)=>{var s;const r=a[n],c=null!==(s=l[o])&&void 0!==s?s:r.initialWidth;return t(ce,{"data-testid":`scene-tree-table-column-${o}`,initialWidth:c,minWidth:r.minWidth,children:[e("template",{slot:"header",dangerouslySetInnerHTML:{__html:`\n <div class="text-sm text-neutral-800 my-2">\n <div class="${Nt("truncate",{"pl-2":0===o,"pr-2":o===i.length-1})}">\n ${r.label}\n </div>\n </div>\n `}}),e("template",{dangerouslySetInnerHTML:{__html:`\n <vertex-scene-tree-table-cell\n prop:value="${r.binding}"\n prop:selection-handler="{{row.data.handleSelection}}"\n prop:expansion-handler="{{row.data.handleExpansion}}"\n prop:visibility-handler="{{row.data.handleVisibility}}"\n ${0===o?"expand-toggle":""}\n ${o===i.length-1?"isolate-button visibility-toggle":""}>\n <div class="flex items-center gap-2">\n <vertex-tooltip \n class="truncate" \n prop:content="${null!=r.binding?r.binding:"--"}" \n placement="${o!==i.length-1?"right":"top"}">\n <div class="flex items-center w-full">\n <div class="truncate">${r.binding}</div>\n </div>\n </vertex-tooltip>\n </div>\n \n\n <div slot="placeholder" class="flex items-center w-full truncate">\n <div> -- </div>\n </div>\n </vertex-scene-tree-table-cell>\n `}})]},r.label)}))}))},VertexSceneTree=a=>{var{id:i,font:l,backgroundColors:o,children:r,style:d,onPointerDown:u,onClick:m,onToggleSelection:p,onToggleExpansion:h,onToggleVisibility:f,className:g,rowData:b}=a,w=__rest(a,["id","font","backgroundColors","children","style","onPointerDown","onClick","onToggleSelection","onToggleExpansion","onToggleVisibility","className","rowData"]);const C=useSceneTreeActions(),S=useSelectionActions(),k=s(wa),A=s(Fe),T=s(_a),E=s(La),P=s(Va),N=null==P||""===P,O=useRecoilRef({state:pa}),I=null!=r&&!1!==r,wrappedExpansionHandler=(e,t,n)=>{C.toggleExpansion(e,t,n),null==h||h(e,t,n)},wrappedSelectionHandler=(e,t,n)=>{C.toggleSelection(e,t,n),null==p||p(e,t,n)},wrappedVisibilityHandler=(e,t,n)=>{C.toggleVisibility(e,t,n),null==f||f(e,t,n)},handleClick=e=>{e.altKey&&C.flyToRow(e.clientY),null==m||m(e)},handlePointerDown=e=>{targetIsElement(e.target,"VERTEX-SCENE-TREE-TABLE-COLUMN")&&S.clearSelection(),null==u||u(e)},M=c(ha),handleFirstRowRendered=e=>{var t;M(e.target.controller),null===(t=null==w?void 0:w.onFirstRowRendered)||void 0===t||t.call(w,e)},V=v.useMemo((()=>({metadataSearchKeys:T,exactMatch:E})),[T,E]);return e("div",{className:Nt("flex flex-col w-full h-full",g),children:e("div",{className:"flex group h-full",children:e(de,Object.assign({id:null!=i?i:"vertex-scene-tree","data-testid":"vertex-scene-tree",config:k,ref:O,className:Nt("flex-1",{filtered:!N}),style:Object.assign(Object.assign(Object.assign({},styleFromOptionalFont(l)),styleFromOptionalBackgroundColors(o)),d),onConnectionError:e=>{logger_error("Scene Tree Connection Error: ",e.detail)},viewer:A,onPointerDown:handlePointerDown,onClick:handleClick,rowData:e=>{var t;const n=null!==(t=null==b?void 0:b(e))&&void 0!==t?t:{};return Object.assign({handleExpansion:wrappedExpansionHandler,handleSelection:wrappedSelectionHandler,handleVisibility:wrappedVisibilityHandler},n)},searchOptions:V},w,{onFirstRowRendered:handleFirstRowRendered,children:I?r:t(n,{children:[e(VertexSceneTreeHeader,{}),e(VertexSceneTreeTableLayout,{}),e(VertexSceneTreeContextMenu,{})]})}))})})},VertexDecimalPlaceSelector=({onApply:n})=>{const[a,i]=r(An);return t(X,{"data-testid":"decimal-place-select",className:"w-24",value:a,onOptionChanged:e=>{i(e.detail),null==n||n(e.detail)},children:[e("div",{className:"py-1.5 px-3",children:"0"}),e("div",{className:"py-1.5 px-3",children:"1"}),e("div",{className:"py-1.5 px-3",children:"2"}),e("div",{className:"py-1.5 px-3",children:"3"})]})},VertexLengthUnitSelector=({onApply:n})=>{const[a,i]=r(kn);return t(X,{"data-testid":"length-unit-select",className:"w-40",value:a,onOptionChanged:e=>{i(e.detail),null==n||n(e.detail)},children:[e("div",{"data-value":"cm",className:"py-1.5 px-3",children:"centimeters"}),e("div",{"data-value":"mm",className:"py-1.5 px-3",children:"millimeters"}),e("div",{"data-value":"m",className:"py-1.5 px-3",children:"meters"}),e("div",{"data-value":"in",className:"py-1.5 px-3",children:"inches"}),e("div",{"data-value":"ft",className:"py-1.5 px-3",children:"feet"})]})};function VertexUnitsControls({onUnitChange:a,onDecimalPlaceChange:i}){return t(n,{children:[t("div",{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Length Unit"}),e(VertexLengthUnitSelector,{onApply:a})]}),t("div",{children:[e("div",{className:"pt-2 pb-2 text-sm text-neutral-700",children:"Decimals"}),e(VertexDecimalPlaceSelector,{onApply:i})]})]})}function VertexUnitsPanelSection({onUnitChange:t,onDecimalPlaceChange:n}){return e(PanelSection,{header:e("div",{className:"flex items-center text-base",children:"Units"}),children:e(VertexUnitsControls,{onUnitChange:t,onDecimalPlaceChange:n})})}const za=l({key:"openedPanelActivePrimaryLeft",default:void 0}),Da=l({key:"openedPanelActivePrimaryRight",default:void 0});function usePanelActions(){return{openPrimary:useActionCallback((({set:e})=>(t,n)=>{e("left"===n?za:Da,t)})),closePrimary:useActionCallback((({set:e})=>t=>{e("left"===t?za:Da,void 0)}))}}function DefaultAppearancePanel(){return t("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:[e(VertexMaterialPanelSection,{}),e(VertexGhostingPanelSection,{}),e(VertexFeatureEdgesPanelSection,{}),e(VertexViewerBackgroundPanelSection,{}),e(VertexSelectionHighlightingPanelSection,{}),e(VertexCrossSectionAppearancePanelSection,{})]})}function DefaultSettingsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexUnitsPanelSection,{})})}const VertexTransformClear=({onClear:n,onClearAll:a})=>{const i=useTransformActions(),l=useCacheableLoadable(Sn),o=s(vn),r=useCacheableLoadable(_n(null!=o?o:"")),c=v.useMemo((()=>{var e;const t=null===(e=l.data)||void 0===e?void 0:e.some((e=>{var t;return null!=(null===(t=null==e?void 0:e.override)||void 0===t?void 0:t.transform)})),n=null!=r.data;return t||n}),[l,r]);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"transforms",tooltip:"Clear Transforms",children:[e("div",{className:"pt-1"}),e(F,{"data-testid":"clear-selected-transforms",onClick:async()=>{await i.clearSelectedTransforms(),null==n||n()},disabled:!c,children:"Clear selected transforms"}),e(F,{"data-testid":"clear-all-transforms",onClick:async()=>{await i.clearAllTransforms(),null==a||a()},children:"Clear all transforms"})]})})},VertexTransformNumericField=({bottomLabel:n,value:a,step:i,min:l,max:o,disabled:r,testId:c,onBlur:d,onInput:u,onChange:m})=>{const p=v.useRef(null),h=s(An),[f,g]=v.useState(!0);v.useEffect((()=>{var e;const t=null!=p.current&&Number.isNaN(p.current.valueAsNumber),n=f||t;null!=p.current&&n?p.current.value=null!==(e=null==a?void 0:a.toFixed(Number(h)))&&void 0!==e?e:"":g(!0)}),[a]);const b=v.useCallback((e=>{g(!1),null==m||m(e)}),[g,m]),w=v.useCallback((e=>{g(!0),null==d||d(e),null!=p.current&&null!=a&&(p.current.value=a.toFixed(Number(h)))}),[d,a,g]);return t("div",{children:[e("div",{className:"truncate rounded-md w-full",children:e("input",{ref:p,className:"w-full truncate border border-neutral-400 rounded-md px-2 py-1.5 hover:border-neutral-500 focus:border-neutral-500 focus:outline-none",type:"number",step:i,min:l,max:o,"data-testid":c,disabled:r,defaultValue:Number.isNaN(a)?"":null==a?void 0:a.toFixed(Number(h)),onBlur:w,onInput:u,onChange:b})}),null!=n&&e("div",{className:"flex justify-center items-center pointer-events-none text-neutral-500",children:e("span",{children:n})})]})},VertexTransformInputs=({onUpdateTransform:n})=>{const a=s(kn),i=s(fn),l=s(hn),o=i||l,r=s(vn),{transform:c,error:d,update:u}=useEditItemTransform(r),m=o?void 0:c,p=useDebouncedCallback((async e=>{await u(e),null==n||n(e)}),50);function updateTransform(e){return t=>{if(null!=m){const n=parseFloat(t.currentTarget.value);Number.isNaN(n)||null==p||p(Object.assign(Object.assign({},m),e(n,m)))}}}function updatePosition(e){return updateTransform(((t,n)=>({position:Object.assign(Object.assign({},n.position),e(t))})))}function updateRotation(e){return updateTransform(((t,n)=>({rotation:Object.assign(Object.assign({},n.rotation),e(t))})))}function updateScale(){return updateTransform((e=>e>0?{scale:e}:{}))}function updateToDefaultValueIfInvalid(e,t){return n=>{const a=parseFloat(n.currentTarget.value),i=undefined;(isNaN(a)||!!(null==t?void 0:t(a)))&&null!=m&&p(Le.defaults(e,m))}}return t("div",{children:[t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Position"}),t("div",{className:"flex flex-wrap w-full gap-2",children:[t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"X"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-x",value:null!=m?m.position.x:void 0,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({x:e}))),onBlur:updateToDefaultValueIfInvalid({position:{x:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Y"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-y",value:null==m?void 0:m.position.y,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({y:e}))),onBlur:updateToDefaultValueIfInvalid({position:{y:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Z"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-z",value:null==m?void 0:m.position.z,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({z:e}))),onBlur:updateToDefaultValueIfInvalid({position:{z:0}})})})]})]})]}),t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Rotation"}),t("div",{className:"flex flex-wrap w-full gap-2",children:[t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"X"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-x",value:null==m?void 0:m.rotation.x,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({x:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{x:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Y"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-y",value:null==m?void 0:m.rotation.y,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({y:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{y:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Z"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-z",value:null==m?void 0:m.rotation.z,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({z:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{z:0}})})})]})]})]}),t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Scale"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"scale",value:null==m?void 0:m.scale,step:.1,min:.1,disabled:null==m,onChange:updateScale(),onBlur:updateToDefaultValueIfInvalid({scale:1},(e=>e<=0))})}),o&&e("div",{className:"bg-orange-100 rounded px-3 py-2 mt-6 mb-2",children:"Input based part transformation is not yet supported for multiple parts."}),null!=d&&e("div",{className:"bg-red-100 rounded px-3 py-2 mt-6 mb-2",children:"There was a problem retrieving data. Try selecting a different part."})]})]})},VertexTransformManipulatorToggle=({onToggleTransformsManipulator:t})=>{const n=useTransformActions(),a=s(Nn),i=c(Bn);return e(_,{className:"flex items-center","data-testid":"transform-widget-toggle",variant:"switch",checked:a,onValueChanged:async()=>{a?(n.disableTransformWidget(),null==t||t(!1)):(i("world"),await n.enableTransformWidget(),null==t||t(!0))}})};function VertexTransformControls({onToggleTransformsManipulator:a,onUpdateTransform:i}){return t(n,{children:[t("div",{className:"flex items-center py-3",children:[e(VertexTransformManipulatorToggle,{onToggleTransformsManipulator:a}),e("span",{className:"pl-4 text-[0.8125rem] text-neutral-700",children:"Enable manipulator"})]}),e(VertexTransformInputs,{onUpdateTransform:i})]})}function VertexTransformPanelSection({onClearTransforms:n,onClearAllTransforms:a,onToggleTransformsManipulator:i,onUpdateTransform:l}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Manual Part Transforms",e(VertexTransformClear,{onClear:n,onClearAll:a})]}),children:e(VertexTransformControls,{onToggleTransformsManipulator:i,onUpdateTransform:l})})}function DefaultTransformsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexTransformPanelSection,{})})}const Fa="Appearance",Ha="Settings",Ua="Transforms",ViewerRightPanelHeader=()=>{const t=undefined,n=getHeading(s(Da));return e("div",{className:"flex flex-col w-full items-center z-overlay pointer-events-none md:pointer-events-auto py-3 px-4 border-b border-neutral-300",children:e("div",{className:"items-center w-full leading-6 text-md align-center font-medium text-neutral-800",children:n})})};function getHeading(e){switch(e){case"appearance":return Fa;case"settings":return Ha;case"transforms":return Ua;default:return"None"}}function VertexViewerRightOpenedPanel(){const a=s(Da),i=v.useMemo((()=>["appearance","settings","transforms"]),[]);return e(n,{children:null!=a&&i.includes(a)&&t(VertexResizableContent,{displayShadow:!0,heading:e(ViewerRightPanelHeader,{}),placement:"right",children:["appearance"===a&&e(DefaultAppearancePanel,{}),"transforms"===a&&e(DefaultTransformsPanel,{}),"settings"===a&&e(DefaultSettingsPanel,{})]})})}function Sidebar({children:t}){return e("div",{className:"pointer-events-auto flex flex-col items-center w-full border-neutral-300 py-2",children:t})}function SidebarIcon({name:n,iconName:a,active:i,responsive:l,disabled:o,content:s,tooltipPlacement:r,children:c,onSelect:d,onDeselect:u}){return e("div",{className:Nt({"text-[var(--vertex-ui-blue-700)]":i===n&&!o,"text-neutral-700 hover:text-neutral-800":i!==n&&!o,"cursor-pointer hover:bg-neutral-200":!o,"text-neutral-400":o,"rounded-full md:p-3":l,"p-3":!l&&null==c,"px-3 py-1":null!=c}),"data-testid":`${n}-sidebar-panel`,onClick:()=>{o||(i===n?u():d())},children:t(V,{placement:null!=r?r:void 0,content:v.isValidElement(s)?void 0:s,children:[e("div",{slot:"content",children:s}),t("div",{className:"flex flex-col",children:[e(D,{name:a}),c]})]})})}function VertexViewerRightSidebar(){const n=usePanelActions(),a=s(Da);return e("div",{className:"flex flex-col flex-shrink-0 items-center relative border-neutral-300 border-l bg-white h-full top-0 min-w-12 w-12",children:t(Sidebar,{children:[e(SidebarIcon,{name:"appearance",active:a,iconName:"adjustments",tooltipPlacement:"right",content:"Appearance",onSelect:()=>{n.openPrimary("appearance","right")},onDeselect:()=>n.closePrimary("right")}),e(SidebarIcon,{name:"transforms",active:a,iconName:"show-only-nearby",tooltipPlacement:"right",content:"Transforms",onSelect:()=>{n.openPrimary("transforms","right")},onDeselect:()=>n.closePrimary("right")}),e(SidebarIcon,{name:"settings",active:a,iconName:"gear",tooltipPlacement:"right",content:"Settings",onSelect:()=>{n.openPrimary("settings","right")},onDeselect:()=>n.closePrimary("right")})]})})}const VertexPopupButton=a=>{var{open:i,children:l}=a,o=__rest(a,["open","children"]);const s=l.find((e=>e.type===Anchor)),r=l.filter((e=>e.type!==Anchor));return null==s?e(n,{}):t(q,Object.assign({className:"flex",placement:"top",backdrop:!1,open:asBooleanAttribute(i)},o,{children:[s,e("div",{className:Nt("flex mb-1.5",{hidden:!i}),"data-testid":"align-plane-popover-menu",children:r})]}))},Anchor=({tooltipContent:t,children:n})=>e("div",{slot:"anchor",children:e(V,{className:"cursor-pointer",content:t,children:n})});function VertexViewerCrossSectionAlignmentPopoverMenu(){const n=useCrossSectioningActions(),a=s(gt),i=s(st),getBaseIcon=()=>`align-to-${null==i?void 0:i.mode}`;return useStackKeyBinding({id:"CrossSectionAlignment",keyBind:"Escape",fn:n.cancelCurrentHit,addPredicate:()=>{var e;return null!==(e=null==i?void 0:i.hitPending)&&void 0!==e&&e},cancelPredicate:()=>!(null==i?void 0:i.hitPending)},[null==i?void 0:i.hitPending]),t(VertexPopupButton,{"data-testid":"section-alignment-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(a),onDismissed:n.closeAlignmentTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Section Alignment",children:e(L,{"data-testid":"section-alignment-icon-button",iconName:getBaseIcon(),iconColor:"secondary",onClick:a?n.closeAlignmentTools:n.openAlignmentTools,children:e(D,{"data-testid":"section-alignment-icon-chevron",name:"chevron-up",size:"sm"})})}),t(ue,{direction:"vertical",className:"flex justify-evenly items-center py-1 my-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(L,{iconColor:"secondary",onClick:()=>n.updateAlignment("global"),className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2","data-testid":"section-alignment-align-global",iconName:"align-to-global",variant:"plain",children:e("div",{className:"text-base ml-2",children:"Align to Global"})}),e(L,{iconColor:"secondary",onClick:()=>n.updateAlignment("surface"),className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2","data-testid":"section-alignment-align-surface",iconName:"align-to-surface",variant:"plain",children:e("div",{className:"text-base ml-2",children:"Align to Surface"})})]})]})}function VertexViewerCrossSectionAxisPopoverMenu(){const n=useCrossSectioningActions(),a=s(vt),i=s(ot),l=p(ut),o=v.useMemo((()=>{const e=i.length>0&&"hasValue"===l.state?axis(i[0],xAxis(l.contents),yAxis(l.contents),zAxis(l.contents)):"x";return null!=e?`axis-${e}`:"axis-x"}),[l.state,l.contents,i]);return t(VertexPopupButton,{"data-testid":"align-plane-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(a),onDismissed:n.closeAxisTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Align Plane",children:e(L,{onClick:a?n.closeAxisTools:n.openAxisTools,iconName:o,"data-testid":"align-plane-icon",iconColor:"secondary",children:e(D,{"data-testid":"align-plane-icon-chevron",name:"chevron-up",size:"sm"})})}),t(ue,{direction:"vertical",className:"flex justify-evenly items-center py-1 my-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(L,{"data-testid":"align-plane-x-axis-button",className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",onClick:()=>n.updateAxis("x"),variant:"plain",iconColor:"secondary",iconName:"axis-x",children:e("div",{className:"text-base ml-2",children:"X-axis Plane"})}),e(L,{className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",variant:"plain",iconColor:"secondary",iconName:"axis-y","data-testid":"align-plane-y-axis-button",onClick:()=>n.updateAxis("y"),children:e("div",{className:"text-base ml-2",children:"Y-axis Plane"})}),e(L,{"data-testid":"align-plane-z-axis-button",className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",onClick:()=>n.updateAxis("z"),variant:"plain",iconColor:"secondary",iconName:"axis-z",children:e("div",{className:"text-base ml-2",children:"Z-axis Plane"})})]})]})}function VertexViewerCrossSectionOffsetStepper({offset:n,onOffsetChange:a}){const i=s(kn),l=s(An),[o,r]=v.useState(convertTo(n,i));v.useEffect((()=>{r(convertTo(n,i))}),[i,n]);const c=createDistanceFormatter(i,parseInt(l,10)),handleIncrementalUpdate=e=>{const t=convertFrom(o+e,i);a(t)},d=undefined,handleBlur=()=>{a(convertFrom(o,i))};return e(V,{content:"Plane Offset",children:e("form",{"data-testid":"cross-section-stepper-form",onSubmit:e=>{e.preventDefault(),a(convertFrom(o,i))},children:t(Y,{"data-testid":"cross-section-stepper-input",className:"viewer-toolbar-input w-32 border-none ring-0 bg-white",type:"text",value:c(parseFloat(n.toFixed(3))),onInputInput:e=>{r(null!=e.detail.value?parseFloat(e.detail.value):n)},onBlur:handleBlur,children:[e("div",{"data-testid":"cross-section-stepper-decrement",className:"py-1 cursor-pointer",slot:"left",onClick:()=>handleIncrementalUpdate(-1),children:e(D,{name:"chevron-left",size:"sm"})}),e("div",{"data-testid":"cross-section-stepper-increment",className:"py-1 cursor-pointer",slot:"right",onClick:()=>handleIncrementalUpdate(1),children:e(D,{name:"chevron-right",size:"sm"})})]})})})}VertexPopupButton.Anchor=Anchor;const Wa=400;function VertexViewerCrossSectionPopupMenu(){const n=useCrossSectioningActions(),a=s(ft),i=p(pt),l=p(ht),o=v.useRef(),r=v.useMemo((()=>"hasValue"===i.state?i.contents:nt),[i.state,i.contents]),c=v.useMemo((()=>"hasValue"===l.state?l.contents:0),[l.state,l.contents]),handleCrossSectionValueChange=e=>{clearTimeout(o.current),o.current=window.setTimeout((()=>{n.endInteraction()}),Wa),n.beginInteraction(),n.updatePlanes(e)};return t(VertexPopupButton,{"data-testid":"cross-section-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(a),onDismissed:n.closeAdditionalTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Section Tools",children:e("div",{className:"-ml-px py-1.5",children:e(D,{"data-testid":"cross-section-popover-icon",name:"chevron-up",size:"sm",onClick:a?n.closeAdditionalTools:n.openAdditionalTools})})}),t(ue,{className:"relative bottom-3 flex justify-evenly items-center p-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(VertexViewerCrossSectionAlignmentPopoverMenu,{}),e(V,{className:"w-auto",content:"Reverse",children:e(L,{iconName:"flip","data-testid":"viewer-toolbar-flip-button",onClick:n.flipPlanes,iconColor:"secondary"})}),e(V,{className:"w-auto",content:"Align View to Plane",children:e(L,{"data-testid":"viewer-toolbar-align-view-to-plane-button",iconName:"align-view-to-plane",onClick:n.alignViewToPlane,iconColor:"secondary"})}),e(VertexToolbarDivider,{}),e(VertexViewerCrossSectionAxisPopoverMenu,{}),e("div",{className:"w-52 mx-2",children:e(VertexSlider,{value:c,defaultValue:r.default,disabled:asBooleanAttribute("hasValue"!==i.state),min:r.min,max:r.max,step:.01,onChange:handleCrossSectionValueChange})}),e("div",{className:"px-4",children:e(VertexViewerCrossSectionOffsetStepper,{offset:"hasValue"===l.state?l.contents:0,onOffsetChange:handleCrossSectionValueChange})})]})]})}const VertexViewerCrossSectionButton=()=>{const a=useCrossSectioningActions(),i=s(at);return t(n,{children:[e(V,{content:i?"Hide Section":"Show Section",children:e(L,{"data-testid":"viewer-toolbar-cross-section-button",iconName:"cross-section",iconColor:i?"primary":"secondary",onClick:()=>i?a.disable():a.enable()})}),e(VertexViewerCrossSectionPopupMenu,{})]})},VertexFitAllButton=()=>{const t=s(Fe);return e(V,{content:"Fit All",children:e(L,{iconName:"fit-all",iconColor:"secondary","data-testid":"viewer-toolbar-fit-all-button",onClick:async()=>{const e=await(null==t?void 0:t.scene());await(null==e?void 0:e.camera().viewAll().render({animation:{milliseconds:500}}))}})})},VertexPanButton=()=>{const t=s(Fe),n=s(Ue),[a,i]=r(Ge),[l,o]=r(We);return v.useEffect((()=>{null!=t&&n&&o(t.getBaseInteractionHandler())}),[t,n,o]),e(V,{content:"Pan",children:e(L,{iconName:"pan",iconColor:"pan"===a?"primary":"secondary","data-testid":"viewer-toolbar-pan-button",onClick:async()=>{if(i("pan"),null!=l){const e=await l;null==e||e.setPrimaryInteractionType("pan")}}})})},VertexRotateButton=()=>{const t=s(Fe),n=s(Ue),[a,i]=r(Ge),[l,o]=r(We);return v.useEffect((()=>{null!=t&&n&&o(t.getBaseInteractionHandler())}),[t,n,o]),e(V,{content:"Rotate",children:e(L,{iconName:"rotate",iconColor:"rotate"===a?"primary":"secondary","data-testid":"viewer-toolbar-rotate-button",onClick:async()=>{if(i("rotate"),null!=l){const e=await l;null==e||e.setPrimaryInteractionType("rotate")}}})})},VertexZoomButton=()=>{const t=s(Fe),n=s(Ue),[a,i]=r(Ge),[l,o]=r(We);return v.useEffect((()=>{null!=t&&n&&o(t.getBaseInteractionHandler())}),[t,n,o]),e(V,{content:"Zoom",children:e(L,{iconName:"zoom",iconColor:"zoom"===a?"primary":"secondary","data-testid":"viewer-toolbar-zoom-button",onClick:async()=>{if(i("zoom"),null!=l){const e=await l;null==e||e.setPrimaryInteractionType("zoom")}}})})},DefaultToolbar=()=>e(me,{placement:"bottom-center",children:t(ue,{className:"p-1 border border-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(VertexRotateButton,{}),e(VertexPanButton,{}),e(VertexZoomButton,{}),e(VertexFitAllButton,{}),e(VertexToolbarDivider,{}),e(VertexBoxSelectionButton,{}),e(VertexToolbarDivider,{}),e(VertexViewerCrossSectionButton,{}),e(VertexToolbarDivider,{}),e(VertexPointToPointMeasurementTool,{}),e(VertexPreciseMeasurementTool,{})]})}),VertexToolbar=({children:t})=>{const n=undefined;return e(me,{placement:"bottom-center",children:null!=t&&!1!==t?e(ue,{className:"p-1 border border-neutral-200 rounded bg-neutral-100 opacity-95",children:t}):e(DefaultToolbar,{})})};function VertexTransformWidget({transformWidgetElement:t,supportUndo:a,onPositionChange:i,onRotationChange:l}){const o=useTransformActions(),r=s(Ln),c=s(Nn),d=s(On),u=s(Vn),m=p(Mn),h=s(kn),f=s(An),g=v.useMemo((()=>"hasValue"===m.state?m.contents:u),[m,u]),b=v.useMemo((()=>{const e=undefined;return c&&(null!=g||r)}),[c,g,r]);return e(n,{children:b&&e(pe,{id:"transform-widget","data-testid":"viewer-transform-widget",ref:t,position:d,rotation:null!=d?g:void 0,decimalPlaces:parseInt(f,10),distanceUnit:toUnitType(h),EXPERIMENTAL_undoKeybindings:null==a||a,onInteractionStarted:()=>{o.disableSelectionSync(),o.setIsInteractivelyTransforming(!0)},onInteractionEnded:()=>{o.invalidateTransforms(),o.setIsInteractivelyTransforming(!1)},onPositionChanged:async e=>{await o.setTransformWidgetPosition(e.detail),null==i||i(e.detail)},onRotationChanged:e=>{o.setTransformWidgetOrientation(e.detail),null==l||l(e.detail)}})})}const VertexViewerSceneReset=({onReset:t})=>{const n=useCrossSectioningActions(),a=useSelectionActions(),i=useTransformActions(),l=useViewerSceneActions(),o=undefined;return e(V,{content:"Reset View",children:e(L,{iconName:"reset",className:"flex bg-white opacity-70 hover:opacity-100 text-neutral-900 hover:text-neutral-700 hover:bg-neutral-200 rounded p-1 cursor-pointer","data-testid":"viewer-reset-tool-button",onClick:async()=>{await n.disable(),await a.resetSelectionState(),i.clearTransformWidgetPosition(),await i.invalidateTransforms(),null==t||t(),await l.reset()},variant:"plain"})})};function useViewerFrameActions(){const e=useTransformActions();return{frameDrawn:useActionCallback((({set:t,snapshot:n})=>async a=>{const i=await n.getPromise(bn);t(qe,a.detail.scene),t(bn,a.detail.scene.sceneViewSummary.selectedVisibleSummary),t(yn,i);const l=undefined;await n.getPromise(Nn)&&await e.syncToSelection()}))}}const VertexBoxSelectionTool=()=>{const{element:t,callback:n}=useCallbackRef(),a=useBoxSelectionActions(),i=useTransformActions(),l=s(Ft);return g.useEffect((()=>{const e=whenComponentReady(t,(()=>{var e;return[null===(e=null==t?void 0:t.model)||void 0===e?void 0:e.onDragComplete((()=>{"clearAndSelect"===l&&(i.clearTransformWidgetOrientation(),i.clearTransformWidgetPosition(),i.enableSelectionSync())}))]}));return()=>{null==e||e.then((e=>{null==e||e.forEach((e=>null==e?void 0:e.dispose()))}))}}),[t,l]),useApplyKeyBinding({keyBind:"Shift",fn:g.useCallback((()=>a.setOperationType("select")),[]),off:g.useCallback((()=>a.setOperationType("clearAndSelect")),[])}),e(he,{ref:n,"data-testid":"viewer-box-query-tool",operationType:l})};function VertexViewerCameraTypeMenu({open:n,onOpen:a,onDismiss:i,onCameraTypeChange:l}){const o=useViewerCameraActions(),r=s(Ze);return t(U,{"data-testid":"camera-types-popover",className:"flex",placement:"bottom-end",open:asBooleanAttribute(n),onMenuClosed:i,children:[e("div",{slot:"anchor",children:e("div",{className:Nt("flex bg-white hover:opacity-100 hover:text-neutral-700 hover:bg-neutral-200 rounded",{"opacity-70 text-neutral-900":!n,"opacity-100 text-neutral-700 bg-neutral-200":n}),children:e(V,{content:"Change View",children:e(L,{"data-testid":"set-camera-mode-option",className:"p-1 cursor-pointer",variant:"plain",onClick:a,iconName:"orthographic"===r?"cube-orthographic":"cube-perspective",children:e(D,{"data-testid":"change-camera-type-icon-button",name:"chevron-down",size:"sm"})})})})}),t("div",{className:"w-36",children:[e("div",{className:"pt-1"}),t(F,{"data-testid":"set-perspective-view",onClick:()=>{o.updateCameraType("perspective"),null==l||l("perspective")},children:[e(D,{slot:"icon","data-testid":"set-perspective-view-icon",name:"cube-perspective",size:"sm",className:Nt({"text-[var(--vertex-ui-blue-700)]":"perspective"===r})}),e("div",{className:Nt("ml-2 items-center",{"text-[var(--vertex-ui-blue-700)]":"perspective"===r}),children:"Perspective"})]}),t(F,{"data-testid":"set-orthographic-view",onClick:()=>{o.updateCameraType("orthographic"),null==l||l("orthographic")},children:[e(D,{slot:"icon","data-testid":"set-orthographic-view-icon",name:"cube-orthographic",size:"sm",className:Nt({"text-[var(--vertex-ui-blue-700)]":"orthographic"===r})}),e("div",{className:Nt("ml-2 items-center",{"text-[var(--vertex-ui-blue-700)]":"orthographic"===r}),children:"Orthographic"})]})]})]})}const VertexViewerViewCube=n=>{var{placement:a,children:i}=n,l=__rest(n,["placement","children"]);const o=Array.isArray(i)?i:[i],s=o.filter((e=>!v.isValidElement(e)||e.type!==fe)).filter((e=>null!=e&&!1!==e)),r=o.find((e=>v.isValidElement(e)&&e.type===fe)),[c,d]=v.useState(!1);return t(me,{direction:"vertical","data-testid":"view-cube-toolbar",placement:null!=a?a:"top-right",children:[null!=r?r:e(fe,Object.assign({className:"m-7"},l)),0===s.length?t("div",{className:"flex items-center justify-center mt-3 gap-1",children:[e(VertexViewerSceneReset,{}),e(VertexViewerCameraTypeMenu,{open:c,onDismiss:()=>d(!1),onOpen:()=>d(!0)})]}):e("div",{className:"mt-3",children:s})]})},VertexViewer=a=>{var{id:i,className:l,disableSelection:o,onTap:d,onLongpress:u,onFrameDrawn:m,onSceneReady:p,viewerRefCallback:h,children:f}=a,g=__rest(a,["id","className","disableSelection","onTap","onLongpress","onFrameDrawn","onSceneReady","viewerRefCallback","children"]);const b=s(wa),w=useRecoilRef({state:Fe}),C=useViewerCameraActions(),S=useHitActions(),k=useSelectionActions(),A=useViewerFrameActions(),[T,E]=r(Ue),P=s(Ze),N=s(st),O=s(Dt),I=c(Ke),[M,V]=r(He);v.useEffect((()=>{null!=i&&V(i)}),[i]);const L=s(ga),R=v.useMemo((()=>({opacity:L/100})),[L]),_=s(Mt),j=s(Vt),B=v.useMemo((()=>({color:_,width:j})),[_,j]),D=s(ia),F=s(ra),H=s(ca),U=s(da),W=v.useMemo((()=>({color:F,opacity:H/100,lineWidth:U})),[F,H,U]),G=s(Kt),K=null!=f&&!1!==f;return useKeyBindings(),useDefaultKeybindings(),t(ge,Object.assign({id:M,"data-testid":"vertex-viewer",ref:null!=h?h:w,className:Nt("flex w-full h-full",l,{"cursor-crosshair":N.hitPending}),style:{"--viewer-background":D},config:b,cameraType:T?P:void 0,onCameraTypeChanged:e=>{T&&C.updateCameraType(e.detail)},phantom:R,featureLines:B,selectionHighlighting:W,featureMaps:G?"final":void 0,onTap:e=>{const t=[...o?[]:[k.selectCurrentHit]];S.tap(e,...t),null==d||d(e)},onLongpress:e=>{S.longPress(e),null==u||u(e)},onFrameDrawn:e=>{A.frameDrawn(e),null==m||m(e)},onSceneReady:async e=>{var t;if(!T){E(!0);const n=await(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.scene());I(null==n?void 0:n.sceneViewId)}null==p||p(e)}},g,{children:[O&&e(VertexBoxSelectionTool,{}),K?f:t(n,{children:[e(VertexViewerViewCube,{}),e(VertexToolbar,{}),e(VertexViewerContextMenu,{})]})]}))};function toSdkConfig(e){return isOnlyNetworkConfig(e)?{network:e}:e}function isOnlyNetworkConfig(e){const t=undefined;return null!=e.renderingHost}const VertexViewerToolkitEventListener=({onHitStateChange:t,onSelectionStateChange:a})=>{const i=s(Wn),l=s(Kn);return v.useEffect((()=>{null==t||t(i)}),[i,t]),v.useEffect((()=>{null==a||a(l)}),[l,a]),e(n,{})},VertexViewerToolkitRoot=a=>{var{override:i,autoDefineCustomElements:l,children:o,config:s}=a,r=__rest(a,["override","autoDefineCustomElements","children","config"]);return v.useEffect((()=>{(null==l||l)&&(ye(),ve())}),[l]),e(f,{override:i,children:t(n,{children:[e(VertexViewerToolkitEventListener,Object.assign({},r)),e(VertexViewerToolkitRootConfig,{config:s,children:o})]})})},VertexViewerToolkitRootConfig=({config:t,children:a})=>{const i=c(wa);return v.useEffect((()=>{const e=null!=t?toSdkConfig(t):void 0;i(e)}),[t,i]),e(n,{children:a})};var Ga=Object.freeze({__proto__:null,get AssemblyFontFace(){return Ba}});export{Tt as CrossSection,Gn as Hits,Ga as SceneTree,$n as Selection,VertexApplicationMessages,VertexBoxSelectionButton,VertexContextMenu,VertexCrossSectionAppearanceColorPicker,VertexCrossSectionAppearanceControls,VertexCrossSectionAppearanceLineThicknessSlider,VertexCrossSectionAppearancePanelSection,VertexCrossSectionAppearanceReset,VertexDecimalPlaceSelector,VertexFeatureEdgesColorPicker,VertexFeatureEdgesControls,VertexFeatureEdgesPanelSection,VertexFeatureEdgesReset,VertexFeatureEdgesThicknessSlider,VertexFitAllButton,VertexFitSelectedMenuItem,VertexFlyToMenuItem,VertexGhostingControls,VertexGhostingPanelSection,VertexHideAllMenuItem,VertexHidePartMenuItem,VertexHideSelectedMenuItem,VertexLengthUnitSelector,VertexMaterialControls,VertexMaterialPanelSection,VertexMeasurementContextMenu,VertexMeasurementDetails,VertexPanButton,VertexPointToPointMeasurement,VertexPointToPointMeasurementTool,VertexPreciseMeasurement,VertexPreciseMeasurementTool,VertexResizableContent,VertexRotateButton,VertexSceneItemGhostingClear,VertexSceneItemGhostingOpacitySlider,VertexSceneItemGhostingToggle,VertexSceneItemMaterialClear,VertexSceneItemMaterialColorPicker,VertexSceneItemMaterialOpacitySlider,VertexSceneTree,VertexSceneTreeColumnPopover,VertexSceneTreeContextMenu,VertexSceneTreeHeader,VertexSceneTreeSearchBar,VertexSceneTreeSearchInformationForToolbar,VertexSceneTreeSearchOptionsPopover,VertexSceneTreeTableLayout,VertexSelectionHighlightingColorPicker,VertexSelectionHighlightingControls,VertexSelectionHighlightingLineThicknessSlider,VertexSelectionHighlightingOpacitySlider,VertexSelectionHighlightingPanelSection,VertexSelectionHighlightingReset,VertexShowAllMenuItem,VertexShowOnlyMenuItem,VertexShowOnlySelectedMenuItem,VertexToolbar,VertexToolbarDivider,VertexTransformClear,VertexTransformControls,VertexTransformInputs,VertexTransformManipulatorToggle,VertexTransformPanelSection,VertexTransformWidget,VertexUnitsControls,VertexUnitsPanelSection,VertexViewer,VertexViewerBackgroundColorPicker,VertexViewerBackgroundControls,VertexViewerBackgroundPanelSection,VertexViewerBackgroundReset,VertexViewerContextMenu,VertexViewerCrossSectionButton,VertexViewerRightOpenedPanel,VertexViewerRightSidebar,VertexViewerSceneReset,VertexViewerToolkitRoot,VertexViewerViewCube,VertexZoomButton};
18
+ */Et=Pt,function(){var e={}.hasOwnProperty;function classNames(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=appendClass(e,parseValue(n)))}return e}function parseValue(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return classNames.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var n="";for(var a in t)e.call(t,a)&&t[a]&&(n=appendClass(n,a));return n}function appendClass(e,t){return t?e?e+" "+t:e+t:e}Et.exports?(classNames.default=classNames,Et.exports=classNames):window.classNames=classNames}();var Nt=Pt.exports;const VertexSlider=n=>{var{value:a,defaultValue:i,leftLabel:l,rightLabel:o,onChange:s,onValueChange:r,onValueInput:c}=n,d=__rest(n,["value","defaultValue","leftLabel","rightLabel","onChange","onValueChange","onValueInput"]);const[u,m]=v.useState(i);return t("div",{className:"flex w-full items-center gap-2",children:[l&&e("div",{className:"pl-0.5 text-xs text-center",children:l}),e(M,Object.assign({className:Nt("w-full",{"mt-0.5":null!=l||null!=o}),value:null!=a?a:u,onValueChange:e=>{m(e.detail.value),null==s||s(e.detail.value),null==r||r(e)},onValueInput:e=>{m(e.detail.value),null==s||s(e.detail.value),null==c||c(e)}},d)),o&&e("div",{className:"text-xs pr-2 flex-shrink-0 text-right",children:o})]})},VertexCrossSectionAppearanceLineThicknessSlider=({onUpdate:t})=>{const n=useCrossSectioningActions(),[a,i]=r(lt);return e(VertexSlider,{id:"cross-section-line-thickness","data-testid":"cross-section-line-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:a,valueLabelDisplay:"auto",onValueInput:async e=>{i(e.detail.value),await n.reapply()},onValueChange:e=>{null==t||t(e.detail.value)}})};function VertexCrossSectionAppearanceControls({onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexCrossSectionAppearanceColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexCrossSectionAppearanceLineThicknessSlider,{onUpdate:i})]})}function PanelSection({header:n,children:a}){return t("div",{className:"py-3 px-4 border-neutral-300 border-b",children:[e("div",{className:"my-2 text-base text-neutral-700",children:n}),a]})}const VertexCrossSectionAppearanceReset=({onReset:t})=>{const n=useCrossSectioningActions(),[a,i]=r(it),[l,o]=r(lt),s=undefined;return e("div",{className:"ml-auto",children:e(V,{content:"Reset Cross Sectioning Appearance",children:e(L,{"data-testid":"cross-section-appearance-reset",iconName:"reset",iconSize:"sm",onClick:async()=>{i(et),o(1),null==t||t(),await n.reapply()},disabled:!(a!==et||1!==l)})})})};function VertexCrossSectionAppearancePanelSection({onResetCrossSectionAppearance:n,onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Cross Sectioning",e(VertexCrossSectionAppearanceReset,{onReset:n})]}),children:e(VertexCrossSectionAppearanceControls,{onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i})})}const Ot=.5,It="#444444",Mt=l({key:"featureEdgesSelectedColor",default:It}),Vt=l({key:"featureEdgesLineThickness",default:Ot}),VertexFeatureEdgesColorPicker=({onUpdate:t})=>{const[n,a]=r(Mt);return e(VertexColorPicker,{"data-testid":"feature-edges-color-picker",value:n,onValueChanged:e=>{null==t||t(e.detail)},onInput:e=>a(e)})},VertexFeatureEdgesThicknessSlider=({onUpdate:t})=>{const[n,a]=r(Vt);return e(VertexSlider,{id:"feature-edges-thickness","data-testid":"feature-edges-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{null==t||t(e.detail.value)}})};function VertexFeatureEdgesControls({onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexFeatureEdgesColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexFeatureEdgesThicknessSlider,{onUpdate:i})]})}const VertexFeatureEdgesReset=({onReset:t})=>{const[n,a]=r(Mt),[i,l]=r(Vt),o=undefined;return e("div",{className:"ml-auto",children:e(V,{content:"Reset Feature Edges",children:e(L,{"data-testid":"feature-edges-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(It),l(Ot),null==t||t()},disabled:!(i!==Ot||n!==It)})})})};function VertexFeatureEdgesPanelSection({onResetFeatureEdges:n,onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Feature Edges",e(VertexFeatureEdgesReset,{onReset:n})]}),children:e(VertexFeatureEdgesControls,{onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i})})}function contextMenuItemIsRow(e){var t;return null!=e&&null!=(null===(t=null==e?void 0:e.node)||void 0===t?void 0:t.id)}const Lt=l({key:"contextMenuActive",default:void 0}),Rt=l({key:"contextMenuPosition",default:void 0}),_t=l({key:"contextMenuTarget",default:void 0}),jt=l({key:"contextMenuItem",default:void 0}),Bt=l({key:"contextMenuActions",default:[]}),zt=o({key:"contextMenuActivePosition",get:({get:e})=>null!=e(Lt)?e(Rt):void 0});function useContextMenuActions(){return{pointerDown:useActionCallback((({set:e})=>async t=>{if(2===t.button){const n=t.clientX,a=null==t?void 0:t.clientY;e(Rt,E.create(n,a)),e(_t,t.target)}})),pointerUp:useActionCallback((({snapshot:e,set:t})=>async(n,a,i,l)=>{const o=await e.getPromise(Rt),s=await e.getPromise(Lt);if(null!=o&&null==s){const e=n.clientX,s=null==n?void 0:n.clientY,r=E.create(e,s),c=null!=o?E.distance(o,r):0,d=null==i||i(n);c<2&&d&&(null==l||l(n,null!=o?o:r),t(Lt,a))}})),contextMenu:useActionCallback((()=>(e,t)=>{(null==t||t(e))&&e.preventDefault()})),longPress:useActionCallback((({set:e})=>(t,n,a,i)=>{if(null==a||a(t)){const a=E.create(t.touches[0].clientX,t.touches[0].clientY);e(Rt,a),e(_t,t.target),e(Lt,n),null==i||i(t,a)}})),clearActiveContextMenu:useActionCallback((({reset:e,set:t})=>n=>{t(kt,!!n),e(Lt),e(Bt),e(Rt)})),clearDismissedState:useActionCallback((({reset:e})=>()=>e(kt)))}}function targetWithinMenu(e){return e.target instanceof Element&&isChildOf("vertex-menu",e.target)}function targetShouldSkipNextHit(e){return e.target instanceof Element&&isChildOf("vertex-viewer",e.target)}function isChildOf(e,t){return null!=t.closest(e)}const Dt=l({key:"boxSelectionEnabled",default:!1}),Ht=l({key:"boxSelectionOperationType",default:"clearAndSelect"}),useBoxSelectionActions=()=>({enable:useActionCallback((({set:e})=>()=>{e(Dt,!0)})),disable:useActionCallback((({reset:e})=>async()=>{e(Dt),e(Ht)})),setOperationType:useActionCallback((({set:e})=>t=>{e(Ht,t)}))});async function whenComponentReady(e,t){return null!=e&&null!=e.nodeName&&await customElements.whenDefined(e.nodeName.toLowerCase()),"function"==typeof(null==e?void 0:e.componentOnReady)?(await(null==e?void 0:e.componentOnReady()),t()):void 0}const Ft=l({key:"isEditingPointToPointMeasurement",default:!1}),Ut=l({key:"pointToPointMeasurementOutcome",default:void 0}),Wt=l({key:"editedPointToPointMeasurement",default:void 0});function usePointToPointMeasurement(e){const t=c(Ut);b((()=>{let n;return whenComponentReady(e,(()=>{n=null==e?void 0:e.measurementModel.onOutcomeChanged(t)})),()=>null==n?void 0:n.dispose()}),[e,t])}const Gt=2,Kt=l({key:"isEditingPreciseMeasurement",default:!1}),$t=l({key:"preciseMeasurementOutcome",default:void 0}),qt=l({key:"preciseMeasurementController",dangerouslyAllowMutability:!0,default:void 0}),Yt=l({key:"preciseMeasurementOverlays",dangerouslyAllowMutability:!0,default:void 0}),Xt=l({key:"preciseMeasurementEntities",dangerouslyAllowMutability:!0,default:[]}),Zt=o({key:"preciseMeasurementMessage",get:({get:e})=>{const t=undefined;return 0===e(Xt).length?"Select a surface":void 0}});function usePreciseMeasurementModel(e,t,n){const a=c(Xt),i=c($t),l=c(qt),o=c(Yt),r=s(qt);b((()=>{let n;return whenComponentReady(e,(()=>{n=null==e?void 0:e.measurementModel.onEntitiesChanged((e=>{a(e),null==t||t(e)}))})),()=>null==n?void 0:n.dispose()}),[e,a]),b((()=>{let t;return whenComponentReady(e,(()=>{t=null==e?void 0:e.measurementModel.onOutcomeChanged((e=>{i(e),null==n||n(e)}))})),()=>null==t?void 0:t.dispose()}),[e,i]),b((()=>{let t;return whenComponentReady(e,(()=>{t=null==e?void 0:e.measurementModel.onEntitiesChanged((e=>{if(e.length>2){const t=e[2];null==r||r.setEntities(new Set([t]))}}))})),()=>null==t?void 0:t.dispose()}),[e,r]),b((()=>{whenComponentReady(e,(()=>{l(null==e?void 0:e.measurementController)}))}),[e,l]),b((()=>{whenComponentReady(e,(()=>{o(null==e?void 0:e.measurementOverlays)}))}),[e,o])}function useMeasurementActions(){const e=useBoxSelectionActions(),t=useEnablePointToPointMeasurement(),n=useDisablePointToPointMeasurement(),a=useDisablePreciseMeasurement(),i=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(qt);null==t||t.clearEntities()})),l=useActionCallback((()=>async(e={})=>{await i(),n(e),a()})),o=useActionCallback((({set:e,reset:n})=>async a=>{await l(),"point-to-point"===a?t():(n($t),n(Xt),e(Kt,!0))}));return{disableEditMeasurement:useActionCallback((()=>async e=>{await l(e)})),enableEditMeasurement:useActionCallback((()=>async e=>{await o(e)})),resetMeasurement:useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=await e.getPromise(Kt),a=await e.getPromise(Ft);n?await i():a&&(t(Ut),t(Wt))})),clearEditedPointToPointMeasurement:useActionCallback((({reset:e})=>()=>{e(Wt)})),setEditedPointToPointMeasurement:useActionCallback((({set:e})=>t=>{e(Wt,t)})),toggleEditPointToPointMeasurement:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(Ft)?await l():await o("point-to-point"),e.disable()})),toggleEditPreciseMeasurement:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(Kt)?await l():await o("precise"),e.disable()}))}}function useEnablePointToPointMeasurement(){return useActionCallback((({reset:e,set:t})=>(n={})=>{t(Ft,!0),n.keepExistingMeasurement||e(Ut)}))}function useDisablePointToPointMeasurement(){return useActionCallback((({reset:e})=>(t={})=>{e(Ft),t.keepExistingMeasurement||(e(Wt),e(Ut))}))}function useDisablePreciseMeasurement(){return useActionCallback((({reset:e})=>async()=>{e(Kt),e($t),e(Xt)}))}const Jt=o({key:"isEditingMeasurement",get:({get:e})=>e(Ft)||e(Kt)}),Qt=o({key:"measurementPanelModel",get:({get:e})=>e(Ut)||e($t)}),en=o({key:"measurementPanelOverlays",dangerouslyAllowMutability:!0,get:({get:e})=>e(Yt)}),tn=o({key:"measurementPanelMessage",get:({get:e})=>{const t=undefined;return e(Kt)?e(Zt):void 0}}),nn=o({key:"measurementPanelIsResettable",get:({get:e})=>e(Jt)&&null!=e(Qt)}),an=3e3,ln=l({key:"applicationMessageToast",default:void 0}),on=l({key:"applicationMessageBanner",default:void 0}),useApplicationMessageActions=()=>({setBannerMessage:useActionCallback((({set:e})=>t=>{e(on,null!=t?Object.assign(Object.assign({},t),{id:De.create()}):void 0)})),setToastMessage:useActionCallback((({set:e})=>t=>{e(ln,null!=t?Object.assign(Object.assign({},t),{id:De.create()}):void 0)}))});var sn;!function(e){e.HIDE_ITEM="Hide Item",e.SHOW_ONLY_SELECTED="Show Only Selected",e.HIDE_SELECTED="Hide Selected",e.SHOW_ONLY_ITEM="Show Only Item",e.SHOW_ALL="Show All",e.HIDE_ALL="Hide All",e.SELECT_FILTERED_ITEMS="Select Filtered Items",e.INVERT_SELECTION="Invert Selection",e.CLEAR_ALL_TRANSFORMS="Clear All Transforms",e.CLEAR_SELECTED_TRANSFORMS="Clear Selected Transforms",e.CLEAR_SELECTION="Clear Selection",e.DESELECTING_ITEMS="Deselecting Items",e.SELECTING_ITEMS="Selecting Items",e.SELECTING_ONLY_ITEM="Selecting Only Item",e.SELECTING_ANCESTOR="Selecting Ancestor",e.APPLY_MATERIAL_OVERRIDE_TO_ALL="Apply Material Override To All",e.APPLY_MATERIAL_OVERRIDE_TO_SELECTION="Apply Material Override To Selection",e.CLEAR_ALL_MATERIAL_OVERRIDES="Clear All Material Overrides",e.CLEAR_SELECTED_MATERIAL_OVERRIDES="Clear Selected Material Overrides",e.SET_PHANTOM_ALL="Set Phantom All",e.SET_PHANTOM_SELECTED_ITEMS="Set Phantom Selected Items",e.CLEAR_PHANTOM_ALL="Clear Phantom All",e.CLEAR_PHANTOM_SELECTED_ITEMS="Clear Phantom Selected Items",e.SET_PHANTOM_NON_SELECTED_ITEMS="Set Phantom Non Selected Items",e.RESTORE_PHANTOM_OVERRIDES="Restore Phantom Overrides",e.SET_ITEM_AS_END_ITEM="Set Item as End Item",e.UNSET_ITEM_AS_END_ITEM="Unset Item as End Item",e.SHOW_ANNOTATION="Show Annotation",e.HIDE_ANNOTATION="Hide Annotation"}(sn||(sn={}));const rn=l({key:"fetchedItemInvalidator",default:0}),cn=d({key:"fetchedItems",get:e=>async({get:t})=>{var n;const a=t(He),i=t(Ke);if(t(rn),t(Fn),null!=i)try{return await(null===(n=null==a?void 0:a.sceneItems)||void 0===n?void 0:n.getSceneViewItem(e,i,{includeOverride:!0,includeWorldTransform:!0}))}catch(t){return void logger_debug(`Error encountered get scene view item. [itemId={${e}}]`,t)}}}),dn=u({key:"selectionSelectedItems",default:void 0}),un=l({key:"selectionSelectedItemIds",default:[]}),mn=l({key:"selectionLastSelected",default:void 0}),pn=l({key:"selectionLastSelectionFromViewer",default:!1}),hn=l({key:"selectionLastSelectWasMultiSelect",default:!1}),fn=o({key:"selectionHasMultipleSelected",get:({get:e})=>{const t=e(mn),n=undefined;return e(un).filter((e=>{var n;return e!==(null==t?void 0:t.id)&&!(null===(n=null==t?void 0:t.ancestors)||void 0===n?void 0:n.includes(e))})).length>0}}),gn=l({key:"selectionFirstSelectedItemInTreeId",default:void 0}),vn=o({key:"selectionHighestSelectedAncestor",get:({get:e})=>{var t,n;const a=e(mn),i=e(un);return null!==(n=null===(t=null==a?void 0:a.ancestors)||void 0===t?void 0:t.find((e=>i.includes(e))))&&void 0!==n?n:null==a?void 0:a.id}}),yn=l({key:"selectionPreviousVisibleSummary",default:void 0}),bn=l({key:"selectionVisibleSummary",default:void 0}),wn=o({key:"selectionVisibleCount",get:({get:e})=>{var t,n;return null!==(n=null===(t=e(bn))||void 0===t?void 0:t.count)&&void 0!==n?n:0}}),Cn=o({key:"selectionBoundingBoxCenter",get:({get:e})=>{const t=e(bn);return null!=(null==t?void 0:t.boundingBox)?T.center(t.boundingBox):A.origin()}}),xn=o({key:"selectionIsActive",get:({get:e})=>{const t=e(un),n=undefined;return e(wn)>0||t.length>0}}),Sn=o({key:"fetchedAndSelectedItems",get:async({get:e})=>{const t=e(un),n=undefined;return null!=e(Ke)?t.map((t=>e(cn(t)))):[]}});function useSceneViewItemActions(){return{invalidateCachedItems:useActionCallback((({set:e})=>()=>{e(rn,(e=>e+1))}))}}const kn=l({key:"lengthUnit",default:"cm"}),An=l({key:"decimalPlace",default:"2"});var Tn,Pn;!function(e){e.mm="millimeters",e.cm="centimeters",e.m="meters",e.in="inches",e.ft="feet"}(Tn||(Tn={})),function(e){e[e.mm=1]="mm",e[e.cm=.1]="cm",e[e.m=.001]="m",e[e.in=.03937007874015748]="in",e[e.ft=.0032808398950131233]="ft"}(Pn||(Pn={}));const convertFrom=(e,t)=>{const n=undefined;return e/Pn[t]},convertTo=(e,t)=>{const n=undefined;return e*Pn[t]},formatWithUnit=(e,t,n)=>`${e.toFixed(n)} ${t}`,formatDistance=(e,t,n)=>formatWithUnit(convertTo(e,t),t,n),createDistanceFormatter=(e,t)=>n=>formatDistance(n,e,t);function toUnitType(e){switch(e){case"cm":return"centimeters";case"m":return"meters";case"in":return"inches";case"ft":return"feet";default:return"millimeters"}}function pickLocalOrWorldTransform(e,t){return"local"===t?e.local:e.world}function mapItemTransforms(e,t){return{local:t(e.local),world:t(e.world)}}function makeItemTransforms(e,t,n){return"local"===n?{local:e,world:Z(e,t)}:{world:e,local:J(e,t)}}function convertTransformToUnits(e,t){const{position:n,rotation:a,scale:i}=e;return{position:A.create(convertTo(n.x,t),convertTo(n.y,t),convertTo(n.z,t)),rotation:a,scale:i}}function convertTransformFromUnits(e,t){const{position:n,rotation:a,scale:i}=e;return{position:A.create(convertFrom(n.x,t),convertFrom(n.y,t),convertFrom(n.z,t)),rotation:a,scale:i}}function toValidTransform(e){const{position:t,rotation:n,scale:a}=e;return{position:{x:t.x||0,y:t.y||0,z:t.z||0},rotation:{x:n.x||0,y:n.y||0,z:n.z||0},scale:a||1}}function scale(e){const t=parseFloat(Math.sqrt(e[0]**2+e[4]**2+e[8]**2).toFixed(2)),n=parseFloat(Math.sqrt(e[1]**2+e[5]**2+e[9]**2).toFixed(2)),a=parseFloat(Math.sqrt(e[2]**2+e[6]**2+e[10]**2).toFixed(2));return t===n&&n===a?t:NaN}function translation(e){return{x:e[12],y:e[13],z:e[14]}}function rotation(e){const t=e.map((t=>t*(1/scale(e))));return t[8]<1?t[8]>-1?{x:Math.atan2(-t[9],t[10])*(180/Math.PI),y:Math.asin(t[8])*(180/Math.PI),z:Math.atan2(-t[4],t[0])*(180/Math.PI)}:{x:-Math.atan2(-t[1],t[5])*(180/Math.PI),y:-90,z:0}:{x:Math.atan2(t[1],t[5])*(180/Math.PI),y:90,z:0}}function toTransformFromApiMatrix(e){return null!=e?{position:translation(e),rotation:rotation(e),scale:scale(e)}:void 0}const En={position:A.create(0,0,0),rotation:A.create(0,0,0),scale:1},Nn=l({key:"transformWidgetEnabled",default:!1}),On=l({key:"transformWidgetPosition",default:void 0}),In=l({key:"transformWidgetOrientationOverride",default:void 0}),Mn=o({key:"transformWidgetOrientation",get:({get:e})=>{const t=e(In),n=e(mn);if(null!=t)return t;if(null!=n){const t=e(Hn(n.id));return N.fromDegrees({x:null==t?void 0:t.world.rotation.x,y:null==t?void 0:t.world.rotation.y,z:null==t?void 0:t.world.rotation.z})}}}),Vn=l({key:"transformWidgetCachedOrientation",default:void 0}),Ln=l({key:"transformWidgetSyncToSelection",default:!1}),Rn=l({key:"transformWidgetIsInteracting",default:!1}),_n=u({key:"appliedItemTransform",default:void 0}),jn=l({key:"appliedItemTransformIds",default:[]}),Bn=l({key:"selectedCoordinateSpace",default:"world"}),zn=u({key:"editedItemTransform",default:void 0}),Dn=d({key:"displayedItemTransform",get:e=>({get:t})=>{const n=t(Bn),a=t(kn),i=t(Hn(e)),l=t(zn(e));return null!=l?l.transform:null!=i?pickLocalOrWorldTransform(mapItemTransforms(i,(e=>convertTransformToUnits(e,a))),n):void 0},set:e=>({get:t,set:n},a)=>{const i=t(Bn),l=t(Un(e)),o=t(Hn(e)),s=t(kn);if(null!=o&&!(a instanceof m)&&null!=a&&null!=l){n(zn(e),{coordinateSpace:i,units:s,transform:a});const o=makeItemTransforms(convertTransformFromUnits(toValidTransform(a),s),l,i),r=t(jn);n(_n(e),o),n(jn,[...r,e])}}}),Hn=d({key:"fetchedItemTransforms",get:e=>({get:t})=>{var n,a;const i=t(cn(e));if(null!=i){const e=(null===(n=i.override)||void 0===n?void 0:n.transform)?toTransformFromApiMatrix(null===(a=i.override)||void 0===a?void 0:a.transform):void 0,t=i.worldTransform?toTransformFromApiMatrix(i.worldTransform):void 0;return{local:null!=e?e:En,world:null!=t?t:En}}}}),Fn=l({key:"transformInvalidator",default:0}),Un=d({key:"parentItemWorldMatrix",get:e=>({get:t})=>{const n=undefined;if(null!=t(Ke)){const n=t(cn(e));if(null!=(null==n?void 0:n.parentId)){const e=t(Hn(n.parentId)),a=t(_n(n.parentId));if(null==e)throw new Error("Invalid state. Parent item state should be populated, but is undefined.");return Q(ee(null!=a?a.world:e.world))}}return logger_debug(`Unable to find the world matrix for the parent of ${e}. Returning the identity matrix.`),O.makeIdentity()}});function useUpdateEditedTransformWhenSettingsChange(e){const t=s(kn),n=s(Bn),a=s(_n(null!=e?e:"")),[i,l]=r(zn(null!=e?e:""));b((()=>{if(null!=a&&((null==i?void 0:i.coordinateSpace)!==n||(null==i?void 0:i.units)!==t)){const e=undefined,i=convertTransformToUnits(pickLocalOrWorldTransform(a,n),t);l({units:t,coordinateSpace:n,transform:i})}}),[t,n])}function useEditItemTransform(e){const t=useTransformActions();useUpdateEditedTransformWhenSettingsChange(e);const n=p(Un(null!=e?e:"")),[a,i]=h(Dn(null!=e?e:""));return{transform:"hasValue"===a.state?a.contents:void 0,loading:"loading"===a.state||"loading"===n.state,error:"hasError"===a.state?a.contents:void 0,async update(n){i(n),null!=e&&await t.applyTransformToItem(e)}}}const useTransformActions=()=>{const e=useApplicationMessageActions(),t=useViewerSceneActions(),n=useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(Cn);e(On,n)})),a=useActionCallback((({set:e,snapshot:t})=>async()=>{const a=await t.getPromise(On),i=await t.getPromise(hn),l=await t.getPromise(un),o=await t.getPromise(wn);null==a&&(l.length>0||i||o>0)&&await n(),e(Ln,!0)})),i=useActionCallback((({set:e})=>async t=>{e(On,null!=t?t:void 0)})),l=useActionCallback(retainSnapshot((({snapshot:e,set:t,reset:n})=>async()=>{const a=await e.getPromise(Mn),i=undefined;(await e.getPromise(jn)).forEach((e=>{n(_n(e)),n(zn(e))})),n(jn),null!=a&&t(Vn,a),t(Fn,(e=>e+1))}))),o=useActionCallback((({set:e,reset:t})=>n=>{t(Vn),e(In,n)})),s=useActionCallback((({set:e})=>()=>{e(On,void 0),e(Nn,!1)}));return{enableTransformWidget:useActionCallback((({set:t})=>async(l,o)=>{e.setToastMessage({message:"Transform manipulator enabled! Select parts to interact.",duration:an}),t(Nn,!0),o?await n():null==l?await a():await i(l)})),disableTransformWidget:useActionCallback((({reset:e})=>()=>{e(Nn),e(In)})),setTransformWidgetOrientation:o,clearTransformWidgetOrientation:useActionCallback((({reset:e})=>()=>{e(Vn),e(In)})),setTransformWidgetPosition:i,clearTransformWidgetPosition:useActionCallback((({reset:e})=>()=>e(On))),invalidateTransforms:l,setIsInteractivelyTransforming:useActionCallback((({set:e})=>t=>{e(Rn,t)})),setDefaultWidgetPosition:a,setDefaultWidgetPositionToSelection:n,enableSelectionSync:useActionCallback((({set:e})=>()=>e(Ln,!0))),disableSelectionSync:useActionCallback((({reset:e})=>()=>e(Ln))),syncToSelection:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(yn),n=await e.getPromise(bn),a=undefined;if(await e.getPromise(Ln)){const e=null==n?void 0:n.boundingBox,a=null!=e&&null!=(null==t?void 0:t.boundingBox)&&equals(e,t.boundingBox);null==e||a||await i(T.center(e))}})),orientToHitResult:useActionCallback((({reset:e})=>async t=>{e(Ln),null!=t?(await i(null==t?void 0:t.position),o(A.eulerTo(A.up(),t.normal))):(e(On),o(void 0))})),clearSelectedTransforms:useActionCallback((()=>async()=>{await t.execute(sn.CLEAR_SELECTED_TRANSFORMS,(e=>e.where((e=>e.withSelected())).clearTransforms())),await l(),s()})),clearAllTransforms:useActionCallback((()=>async()=>{await t.execute(sn.CLEAR_SELECTED_TRANSFORMS,(e=>e.where((e=>e.all())).clearTransforms())),await l(),s()})),applyTransformToItem:useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(He),a=await(null==n?void 0:n.scene()),i=await e.getPromise(_n(t));if(null==i)return void logger_warn(`There is no transform to apply to item ${t}.`);const l=O.transpose(Q(ee(null==i?void 0:i.local)));return null==a?void 0:a.items((e=>e.where((e=>e.withItemId(t))).transform(l))).execute()}))}},useHitActions=()=>{const e=useCrossSectioningActions(),t=useMeasurementActions(),n=useTransformActions(),a=useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const n=await e.tryGetPromise(St).then((e=>e.value)),a=await e.getPromise(Wt);null==n&&null!=(null==a?void 0:a.start)&&null!=a.end&&await t.resetMeasurement()}))),i=useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const t=await e.tryGetPromise(St).then((e=>e.value));await n.orientToHitResult(t)}))),l=useActionCallback(retainSnapshot((({set:e,snapshot:t})=>async()=>{const n=await t.tryGetPromise(St).then((e=>e.value));e(jt,n)}))),o=useActionCallback(retainSnapshot((({snapshot:e,set:t})=>async()=>{t(xt,await e.tryGetPromise(St).then((e=>e.value)))})));return{tap:useActionCallback(retainSnapshot((({snapshot:t,set:n})=>async({detail:s},...r)=>{const c=await t.getPromise(Jt),d=await t.getPromise(st),u=2!==(null==s?void 0:s.buttons)&&!(null==s?void 0:s.altKey);s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;const m=u&&!d.hitPending&&!c,p=await t.tryGetPromise(St).then((e=>e.value));n(Ct,p),n(bt,s),await a(),m&&(r.forEach((e=>e())),await i()),await l(),await e.sectionCurrentHit(),await o()}))),longPress:useActionCallback(retainSnapshot((({snapshot:e,set:t,reset:n})=>async a=>{n(bt),t(wt,a.detail),await e.tryGetPromise(St),await l(),await o()})))}},Wn=o({key:"viewerToolkitHitState",get:({get:e})=>{const t=undefined,n=undefined,a=undefined,i=undefined,l=undefined;return{tapDetails:e(bt),longPressDetails:e(wt),previousHitResult:e(Ct),currentHitResult:e(xt)}}});var Gn=Object.freeze({__proto__:null,currentHitResult:xt,hitResult:St,hitResultsLongPressDetails:wt,hitResultsSkipNextTap:kt,hitResultsTapDetails:bt,hitState:Wn,previousHitResult:Ct,useHitActions:useHitActions});function useSelectionActions(){const e=useSceneViewItemActions(),t=useTransformActions(),n=useViewerSceneActions(),a=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=undefined;(await e.getPromise(un)).forEach((e=>t(dn(e))))})),i=useActionCallback((({snapshot:e,reset:t,set:a})=>async(i,l)=>{var o,s;const r=await e.getPromise(dn(i.id)),c=await e.getPromise(un),d=null===(s=[...null!==(o=i.ancestors)&&void 0!==o?o:[]])||void 0===s?void 0:s.reverse().find((e=>!c.includes(e)));null!=r&&null!=d?(a(dn(d),{id:d}),a(un,(e=>[...e,d])),n.execute(sn.SELECTING_ANCESTOR,n.selectItemsTransform(d))):(null==l?void 0:l.clear)?(a(dn(i.id),i),a(un,[i.id]),n.execute(sn.SELECTING_ONLY_ITEM,n.clearSelectionTransform,n.selectItemsTransform(i.id))):(a(dn(i.id),i),a(un,(e=>[...e,i.id])),n.execute(sn.SELECTING_ITEMS,n.selectItemsTransform(i.id))),u(i),a(mn,i),a(pn,!0),t(hn)})),l=useActionCallback((({reset:e,set:t})=>async a=>{e(dn(a)),e(hn),t(un,(e=>e.filter((e=>e!==a)))),n.execute(sn.DESELECTING_ITEMS,n.deselectItemsTransform(a))})),o=useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(dn(t.id));null!=n?await l(n.id):await i(t)})),s=useActionCallback((({snapshot:n,reset:a,set:l})=>async(o,s={})=>{const r=await n.getPromise(dn(o.id)),c=await n.getPromise(un);if(c.filter((e=>{var t;return e!==o.id&&!(null===(t=o.ancestors)||void 0===t?void 0:t.includes(e))})).forEach((e=>a(dn(e)))),a(hn),r)if(s.ignoreAncestorSelection)a(un),a(dn(r.id));else{const e=c.filter((e=>{var t;return e===o.id||(null===(t=o.ancestors)||void 0===t?void 0:t.includes(e))}));l(un,e)}else a(un);e.invalidateCachedItems(),t.clearTransformWidgetOrientation(),await i(o,{clear:!0})})),r=useActionCallback((({reset:e})=>async()=>{await a(),e(un),e(mn),e(pn),e(hn),t.clearTransformWidgetPosition(),t.clearTransformWidgetOrientation()})),c=useActionCallback((()=>async()=>{await r(),n.execute(sn.CLEAR_SELECTION,n.clearSelectionTransform)})),d=useActionCallback((({set:e})=>async t=>{e(hn,t)})),u=useActionCallback((({reset:e,set:t})=>e=>{}));return{select:i,toggleSelection:o,clearAndSelect:s,selectCurrentHit:useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const t=await e.tryGetPromise(St).then((e=>e.value)),n=await e.getPromise(bt),a=(null==n?void 0:n.metaKey)||(null==n?void 0:n.ctrlKey)||(null==n?void 0:n.shiftKey);null==t||a?null!=t&&a?await o(t):await c():await s(t)}))),syncSelection:useActionCallback((({set:e,reset:t})=>async(n,i)=>{i.selected?(await a(),e(dn(n.id),n),i.multiSelect?e(un,(e=>[...e.filter((e=>e!==n.id)),n.id])):e(un,[n.id]),u(n),e(mn,n),e(pn,!1),e(hn,!!i.multiSelect)):(t(dn(n.id)),t(hn),e(un,(e=>e.filter((e=>e!==n.id)))))})),deselect:l,clearSelection:c,resetSelectionState:r,toggleLastSelectWasMultiSelect:d,selectForModelViewsPanel:u}}const Kn=o({key:"viewerToolkitSelectionState",get:({get:e})=>{const t=undefined,n=undefined,a=undefined,i=undefined;return{selectedItemIds:e(un),lastSelected:e(mn),highestSelectedAncestorId:e(vn)}}});var $n=Object.freeze({__proto__:null,fetchedAndSelectedItems:Sn,selectionBoundingBoxCenter:Cn,selectionFirstSelectedItemInTreeId:gn,selectionHasMultipleSelected:fn,selectionHighestSelectedAncestor:vn,selectionIsActive:xn,selectionLastSelectWasMultiSelect:hn,selectionLastSelected:mn,selectionLastSelectionFromViewer:pn,selectionPreviousVisibleSummary:yn,selectionSelectedItemIds:un,selectionSelectedItems:dn,selectionState:Kn,selectionVisibleCount:wn,selectionVisibleSummary:bn,useSelectionActions:useSelectionActions});const qn=255,Yn=l({key:"sceneItemAdjustmentsSelectedColor",default:void 0}),Xn=l({key:"sceneItemAdjustmentsSelectedOpacity",default:void 0}),Zn=u({key:"appliedItemMaterialOverride",default:void 0}),Jn=l({key:"appliedItemMaterialOverrideIds",default:[]}),Qn=o({key:"sceneItemAdjustmentsLastSelectedOverride",get:({get:e})=>{const t=e(mn);if(null!=t)return e(Zn(t.id))}}),ea=l({key:"applyMaterialToAllUserAction",default:void 0}),ta=l({key:"showConfirmDialogWhenApplyingMaterialToAll",default:!0}),na=l({key:"confirmApplyMaterialToAllDialogOpen",default:!1}),useSceneItemMaterialActions=()=>{const e=useViewerSceneActions(),t=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=await e.getPromise(Jn);t(Yn),n.forEach((e=>t(Zn(e)))),t(Jn)}));return{updateColor:useActionCallback((({set:e})=>t=>{e(Yn,t)})),clearCurrentColor:useActionCallback((({reset:e})=>()=>{e(Yn)})),clearCurrentOpacity:useActionCallback((({reset:e})=>()=>{e(Xn)})),clear:useActionCallback((({snapshot:t,set:n,reset:a})=>async()=>{const i=await t.getPromise(un);a(Yn),i.forEach((e=>a(Zn(e)))),n(Jn,(e=>e.filter((e=>!i.includes(e))))),await e.execute(sn.CLEAR_SELECTED_MATERIAL_OVERRIDES,(e=>e.where((e=>e.withSelected())).clearMaterialOverrides().select()))})),clearAll:useActionCallback((()=>async()=>{await t(),await e.execute(sn.CLEAR_ALL_MATERIAL_OVERRIDES,(e=>e.where((e=>e.all())).clearMaterialOverrides()),(e=>e.where((e=>e.withSelected())).select()))})),clearState:t,updateOpacity:useActionCallback((({set:e})=>t=>{e(Xn,t)})),apply:useActionCallback((({snapshot:t,set:n})=>async()=>{const a=await t.getPromise(Yn),i=await t.getPromise(Xn),l=await t.getPromise(un),o=await t.getPromise(Qn),s=null!=a?a:o,r=null!=i?i:null==o?void 0:o.opacity;if(null!=s){const t=Object.assign(Object.assign({},s),{opacity:null!=r?r:s.opacity});await e.execute(sn.APPLY_MATERIAL_OVERRIDE_TO_SELECTION,(e=>e.where((e=>e.withSelected())).materialOverride(t))),l.forEach((e=>n(Zn(e),t))),n(Jn,(e=>[...e,...l]))}})),confirmApplyAll:useActionCallback((({set:e})=>t=>{e(na,!0),e(ea,(()=>t))})),cancelApplyAll:useActionCallback((({reset:e})=>()=>{e(na),e(ea)})),applyAll:useActionCallback((({snapshot:t,reset:n})=>async()=>{const a=await t.getPromise(Yn),i=await t.getPromise(Xn);if(null!=a){const l=await t.getPromise(Jn),o=Object.assign(Object.assign({},a),{opacity:null!=i?i:a.opacity});await e.execute(sn.APPLY_MATERIAL_OVERRIDE_TO_ALL,(e=>e.where((e=>e.all())).materialOverride(o))),l.forEach((e=>n(Zn(e))));const s=await t.getPromise(ea);null==s||s(o),n(na),n(ea)}})),hideConfirmApplyAllDialog:useActionCallback((({set:e})=>()=>{e(ta,!1)}))}},aa="#FFFFFF",ia=l({key:"viewerBackgroundSelectedColor",default:aa}),VertexSceneItemMaterialApplyAll=({onApplyAll:t})=>{const n=useSceneItemMaterialActions(),a=p(Qn),i=s(Yn),l=s(ta),o=g.useMemo((()=>"hasValue"===a.state?null!=i?i:a.contents:i),[a,i]);return e(V,{content:"Apply to All",children:e(L,{iconName:"square-dot-outline",iconSize:"sm",color:"secondary",disabled:null==o,onClick:async()=>{l?n.confirmApplyAll(t):(await n.applyAll(),null==t||t(o))}})})};function SceneItemMaterialApplyAllConfirmationDialog(){const a=useSceneItemMaterialActions(),i=s(na),[l,o]=v.useState(!1),onCloseDialog=()=>{a.cancelApplyAll(),o(!1)};return i?t(R,{open:!0,className:"text-sm",onClosed:onCloseDialog,onBackdropClick:onCloseDialog,children:[e("div",{slot:"heading",children:"Apply to All Parts"}),e("div",{className:"max-w-lg break-words pr-2",children:"This will apply the same material to all parts in the model. Any previous material changes will be lost."}),t("div",{className:"flex mt-8 gap-2 items-center",children:[t("div",{className:"flex gap-2",children:[e(_,{"data-testid":"hide-confirmation-dialog-in-future-checkbox",variant:"check",className:"pt-0.5",checked:l,onValueChanged:e=>{o(e.detail)}}),"Don't show again this session"]}),t("div",{className:"flex ml-auto gap-2",children:[e(j,{"data-testid":"cancel-apply-material-to-all",onClick:onCloseDialog,children:"Cancel"}),e(j,{color:"primary","data-testid":"confirm-apply-material-to-all",onClick:async()=>{await a.applyAll(),l&&a.hideConfirmApplyAllDialog()},children:"Apply"})]})]})]}):e(n,{})}function createColorMaterialWithId(e,t=De.create()){return Object.assign({id:t},te.fromHex(e))}const VertexSceneItemMaterialColorPicker=({onApply:t})=>{const n=useSceneItemMaterialActions(),a=p(Qn),i=s(Yn),l=g.useMemo((()=>"hasValue"===a.state?null!=i?i:a.contents:i),[a,i]);return e(VertexColorPicker,{"data-testid":"selected-item-color-picker",value:null!=l?Me.toHexString(l.diffuse):void 0,onValueChanged:()=>{n.apply(),null==t||t(l)},onInput:async e=>{n.updateColor(createColorMaterialWithId(e)),await n.apply()}})},VertexSceneItemMaterialOpacitySlider=({onApply:t})=>{const n=useSceneItemMaterialActions(),a=s(Xn),i=p(Qn),l=g.useMemo((()=>{var e,t;return"hasValue"===i.state?null!==(t=null!=a?a:null===(e=i.contents)||void 0===e?void 0:e.opacity)&&void 0!==t?t:qn:null!=a?a:qn}),[a,i]),o=useDebouncedCallback((()=>{n.apply()}),500),r=g.useCallback((e=>{n.updateOpacity(e.detail.value),o(e.detail.value)}),[o,n]),c=g.useMemo((()=>"hasValue"!==i.state||null==i.contents),[i]);return e(V,{className:"flex w-full",content:c?"Select a part and apply a color to enable opacity":`${Math.floor(l/qn*100)}%`,placement:"top",children:e(VertexSlider,{"data-testid":"scene-item-adjustments-opacity-slider",leftLabel:"0%",rightLabel:"100%",disabled:c,value:null!=l?l:qn,step:5,min:0,max:qn,onValueChange:e=>{n.updateOpacity(e.detail.value),n.apply(),null==t||t(e.detail.value)},onValueInput:r})})};function VertexMaterialControls({onApplyMaterial:a,onApplyMaterialToAll:i,onApplyOpacity:l}){const o=useSceneItemMaterialActions(),r=s(mn);return v.useEffect((()=>{o.clearCurrentColor(),o.clearCurrentOpacity()}),[null==r?void 0:r.id]),t(n,{children:[t("div",{className:"flex flex-col",children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),t("div",{className:"flex items-center gap-2",children:[e(VertexSceneItemMaterialColorPicker,{onApply:a}),e(VertexSceneItemMaterialApplyAll,{onApplyAll:i})]})]}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Opacity"}),e(VertexSceneItemMaterialOpacitySlider,{onApply:l}),e(SceneItemMaterialApplyAllConfirmationDialog,{})]})}const ResetButton=({id:n,tooltip:a,children:i})=>{const[l,o]=v.useState(!1);return e("div",{className:"ml-auto",children:t(B,{className:"flex items-stretch h-full","data-testid":`reset-button-dropdown-menu-${n}`,placement:"bottom-end",onMenuOpened:()=>o(!0),onMenuClosed:()=>o(!1),children:[e("div",{slot:"anchor",className:"flex items-center h-full",children:e(V,{content:a,disabled:l,placement:"bottom",children:t(j,{className:Nt("p-1.5 rounded-md select-none hover:bg-neutral-300 active:bg-neutral-400 cursor-pointer",{"bg-neutral-300":l}),"data-testid":`reset-button-${n}`,variant:"plaintext",children:[e(D,{className:"px-0.5",name:"reset",size:"sm"}),e(D,{name:"chevron-down",size:"sm"})]})})}),e("div",{className:"whitespace-nowrap",children:i})]})})},VertexSceneItemMaterialClear=({onClear:n,onClearAll:a})=>{const i=useSceneItemMaterialActions(),l=s(xn);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"materials",tooltip:"Clear Materials",children:[e("div",{className:"pt-1"}),e(H,{"data-testid":"clear-selected-materials",onClick:()=>{i.clear(),null==n||n()},disabled:!l,children:"Clear selected materials"}),e(H,{"data-testid":"clear-all-materials",onClick:()=>{i.clearAll(),null==a||a()},children:"Clear all materials"})]})})};function VertexMaterialPanelSection({onClearMaterial:n,onClearAllMaterials:a,onApplyMaterial:i,onApplyMaterialToAll:l,onApplyOpacity:o}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Material",e(VertexSceneItemMaterialClear,{onClear:n,onClearAll:a})]}),children:e(VertexMaterialControls,{onApplyMaterial:i,onApplyMaterialToAll:l,onApplyOpacity:o})})}const la="#ffff00",oa=35,sa=1,ra=l({key:"selectionHighlightingSelectedColor",default:la}),ca=l({key:"selectionHighlightingSelectedOpacity",default:oa}),da=l({key:"selectionHighlightingSelectedLineThickness",default:1}),VertexSelectionHighlightingColorPicker=({onUpdate:t})=>{const[n,a]=r(ra);return e(VertexColorPicker,{"data-testid":"selection-highlighting-color-picker",value:n,onValueChanged:e=>{null==t||t(e.detail)},onInput:e=>a(e)})},VertexSelectionHighlightingLineThicknessSlider=({onUpdate:t})=>{const[n,a]=r(da);return e(VertexSlider,{id:"selection-highlighting-line-thickness","data-testid":"selection-highlighting-line-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{null==t||t(e.detail.value)}})},VertexSelectionHighlightingOpacitySlider=({onUpdate:t})=>{const[n,a]=r(ca);return e(VertexSlider,{id:"selection-highlighting-opacity","data-testid":"selection-highlighting-opacity-slider",leftLabel:"0%",rightLabel:"100%",min:0,max:100,step:5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{null==t||t(e.detail.value)}})};function VertexSelectionHighlightingControls({onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:l}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexSelectionHighlightingColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Opacity"}),e(VertexSelectionHighlightingOpacitySlider,{onUpdate:i}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexSelectionHighlightingLineThicknessSlider,{onUpdate:l})]})}const VertexSelectionHighlightingReset=({onReset:t})=>{const[n,a]=r(ra),[i,l]=r(ca),[o,s]=r(da),c=undefined;return e("div",{className:"ml-auto",children:e(V,{content:"Reset Selection Highlighting",children:e(L,{"data-testid":"selection-highlighting-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(la),l(oa),s(1),null==t||t()},disabled:!(n!==la||i!==oa||1!==o)})})})};function VertexSelectionHighlightingPanelSection({onResetSelectionHighlighting:n,onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:l}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Selection Highlighting",e(VertexSelectionHighlightingReset,{onReset:n})]}),children:e(VertexSelectionHighlightingControls,{onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:l})})}const VertexViewerBackgroundColorPicker=({onUpdate:t})=>{const[n,a]=r(ia);return e(VertexColorPicker,{"data-testid":"viewer-background-color-picker",value:n,onValueChanged:e=>{null==t||t(e.detail)},onInput:e=>a(e)})};function VertexViewerBackgroundControls({onUpdateViewerBackgroundColor:a}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexViewerBackgroundColorPicker,{onUpdate:a})]})}const VertexViewerBackgroundReset=({onReset:t})=>{const[n,a]=r(ia),i=undefined;return e("div",{className:"ml-auto",children:e(V,{content:"Reset Background Color",children:e(L,{"data-testid":"viewer-background-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(aa),null==t||t()},disabled:!(n!==aa)})})})};function VertexViewerBackgroundPanelSection({onResetViewerBackgroundColor:n,onUpdateViewerBackgroundColor:a}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Viewer Background",e(VertexViewerBackgroundReset,{onReset:n})]}),children:e(VertexViewerBackgroundControls,{onUpdateViewerBackgroundColor:a})})}const isInputElement=e=>{const t=e instanceof HTMLElement&&"VERTEX-AUTO-RESIZE-TEXTAREA"===e.tagName,n=e instanceof HTMLElement&&"VERTEX-TEXTFIELD"===e.tagName,a=e instanceof HTMLElement&&"true"===e.contentEditable,i=e instanceof HTMLElement&&"VERTEX-SCENE-TREE-SEARCH"===e.tagName,l=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,o=e instanceof HTMLElement&&"VERTEX-VIEWER-PIN-TOOL"===e.tagName,s=e instanceof HTMLElement&&"VERTEX-VIEWER-TRANSFORM-WIDGET"===e.tagName;return t||n||a||i||l||o||s},useRecoilReducer=({reducer:e,atom:t})=>{const n=undefined,a=undefined;return[s(t),useRecoilReducerDispatch({reducer:e,atom:t})]},useRecoilReducerDispatch=({reducer:e,atom:t})=>{const n=i((({set:n})=>async a=>{n(t,(t=>e(t,a)))}),[]);return n},ua=l({key:"keyBindings",default:{applyBindings:[],bindings:{},pressed:{}}});function reducer(e,t){var n,a,i,l;switch(t.type){case"push-key-binding":const o=undefined;return null!=(null===(n=e.bindings[t.binding.keyBind])||void 0===n?void 0:n.find((e=>e.id===t.binding.id)))?e:Object.assign(Object.assign({},e),{bindings:Object.assign(Object.assign({},e.bindings),{[t.binding.keyBind]:[...null!==(a=e.bindings[t.binding.keyBind])&&void 0!==a?a:[],t.binding]})});case"remove-key-binding":const s=undefined;return null==(null===(i=e.bindings[t.binding.keyBind])||void 0===i?void 0:i.find((e=>e.id===t.binding.id)))?e:Object.assign(Object.assign({},e),{bindings:Object.assign(Object.assign({},e.bindings),{[t.binding.keyBind]:(null!==(l=e.bindings[t.binding.keyBind])&&void 0!==l?l:[]).filter((e=>e.id!==t.binding.id))})});case"add-apply-key-binding":return Object.assign(Object.assign({},e),{applyBindings:[...e.applyBindings,t.binding]});case"remove-apply-key-binding":return Object.assign(Object.assign({},e),{applyBindings:e.applyBindings.filter((e=>e.id!==t.id))});case"set-key-pressed":return Object.assign(Object.assign({},e),{applyBindings:e.applyBindings.map((t=>Object.assign(Object.assign({},t),{active:null!=t.keyBind&&allPressed(t.keyBind,e.pressed)}))),pressed:Object.assign(Object.assign({},e.pressed),{[t.key]:t.pressed}),lastPressed:t.pressed?t.key:void 0})}}const useKeyBindingState=()=>useRecoilReducer({reducer:reducer,atom:ua});function pressedValue(e,t){return e.includes("!")?!t[e.replace("!","")]&&!t[e.replace("!","").toLowerCase()]:t[e]||t[e.toLowerCase()]}function isPressed(e,t){const n=e.split("||");return n.length>1?n.some((e=>pressedValue(e,t))):pressedValue(n[0],t)}function allPressed(e,t){const n=undefined;return e.split("+").every((e=>isPressed(e,t)))}function matchingSingleFnBindings(e,t,n){return e.filter((e=>!e.repeat)).filter((e=>{var a;return null!=e.keyBind&&null!=n&&(null===(a=e.keyBind)||void 0===a?void 0:a.includes(n))&&allPressed(e.keyBind,t)})).map((e=>e.fn))}function matchingOffBindings(e,t,n){return e.filter((e=>e.off&&e.active&&null!=e.keyBind&&null==n&&!allPressed(e.keyBind,t))).map((e=>e.off))}const useApplyKeyBinding=e=>{const[t,n]=useKeyBindingState();v.useEffect((()=>{const a=De.create();return n({type:"add-apply-key-binding",binding:Object.assign(Object.assign({},e),{id:a,active:null!=e.keyBind&&allPressed(e.keyBind,t.pressed)})}),()=>{n({type:"remove-apply-key-binding",id:a})}}),[e.fn,e.off,e.keyBind,e.repeat])},useStackKeyBinding=(e,t=[])=>{const[,n]=useKeyBindingState();v.useEffect((()=>{const t=null==e.addPredicate||e.addPredicate(),a=null!=e.cancelPredicate&&e.cancelPredicate();t&&n({type:"push-key-binding",binding:e}),a&&n({type:"remove-key-binding",binding:e})}),t)},useKeyBindings=({keydownRepeatInterval:e=25,keydownIgnorePredicate:t=isInputElement}={})=>{const[n,a]=useKeyBindingState(),i=v.useCallback((e=>{Object.keys(n.bindings).filter((t=>t.includes(e)&&allPressed(t,Object.assign(Object.assign({},n.pressed),{[e]:!0})))).forEach((e=>{const t=n.bindings[e],i=t.length>0?t[t.length-1]:void 0;null!=i&&(i.fn(),a({type:"remove-key-binding",binding:i}))}))}),[n]);v.useEffect((()=>{const handleKeyDown=e=>{if(!e.repeat&&!t(e.target)){a({type:"set-key-pressed",key:e.key,pressed:!0}),i(e.key);const t=Object.assign(Object.assign({},n.pressed),{[e.key]:!0}),l=matchingSingleFnBindings(n.applyBindings,t,e.key),o=matchingOffBindings(n.applyBindings,t,e.key);(l.length>0||o.length>0)&&e.preventDefault()}},handleKeyUp=e=>{a({type:"set-key-pressed",key:e.key,pressed:!1})};return window.addEventListener("keydown",handleKeyDown),window.addEventListener("keyup",handleKeyUp),()=>{window.removeEventListener("keydown",handleKeyDown),window.removeEventListener("keyup",handleKeyUp)}}),[i,n.applyBindings,n.pressed]),v.useEffect((()=>{const e=matchingSingleFnBindings(n.applyBindings,n.pressed,n.lastPressed),t=matchingOffBindings(n.applyBindings,n.pressed,n.lastPressed);e.forEach((e=>e())),t.forEach((e=>e()))}),[n.pressed,n.lastPressed]),v.useEffect((()=>{const t=n.applyBindings.filter((e=>e.repeat&&null!=e.keyBind&&allPressed(e.keyBind,n.pressed))).map((e=>e.fn));if(t.length>0){const n=setInterval((()=>{t.forEach((e=>e()))}),e);return()=>{clearInterval(n)}}return()=>{}}),[n.applyBindings,n.lastPressed])},VertexBoxSelectionButton=()=>{const t=useBoxSelectionActions(),n=s(Dt);return useStackKeyBinding({id:"ExitBoxSelection",keyBind:"Escape",fn:t.disable,addPredicate:()=>n,cancelPredicate:()=>!n},[n]),e(V,{content:"Box Selection",children:e(L,{iconName:"box-cursor",iconColor:n?"primary":"secondary","data-testid":"viewer-toolbar-enable-box-selection-button",onClick:n?t.disable:t.enable})})},ma=1,VertexResizableContent=n=>{var{className:a,style:i,displayShadow:l,heading:o,id:s,initialScale:r,placement:c="left",children:d,onResize:u}=n,m=__rest(n,["className","style","displayShadow","heading","id","initialScale","placement","children","onResize"]);const p="left"===c||"right"===c,h="top"===c;function getHorizontalResizeDirection(){switch(c){case"left":return"right";case"right":return"left";default:return"none"}}function getVerticalResizeDirection(){return"top"===c?"top":"none"}const f=null!=r?r:1;return e(F,Object.assign({id:s,"data-testid":`resizable-content-position-${c}`,className:Nt(a,"pointer-events-auto z-popover md:z-overlay bg-white bg-opacity-95 flex-grow-0 flex-shrink-0 border-neutral-300",{"border-r min-w-75 max-w-half":"left"===c,"sidebar-shadow-right":"left"===c&&l,"border-l min-w-75 max-w-half":"right"===c,"sidebar-shadow-left":"right"===c&&l,"border-t bottom-0 fixed":"top"===c,"min-h-12 sheet":h}),style:Object.assign({maxHeight:"top"===c?window.innerHeight:void 0},i),initialHorizontalScale:p?r:void 0,initialVerticalScale:h?f:void 0,horizontalDirection:getHorizontalResizeDirection(),verticalDirection:getVerticalResizeDirection(),position:"right"===c||"top"===c?"absolute":"relative",onResizeEnd:()=>null==u?void 0:u()},m,{children:t("div",{className:"flex flex-col h-full w-full",children:["top"===c&&e("div",{className:"flex justify-center w-full",children:e("div",{className:"block md:hidden w-20 h-0.5 mt-0.5 bg-neutral-600 rounded"})}),o,e("div",{className:Nt("w-full flex flex-col h-0 flex-grow",{"right-0":"right"===c}),children:d})]})}))};function useDefaultKeybindings(){useApplyKeyBinding({fn:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromiseRequired($e),n={milliseconds:500},a=await t();await(null==a?void 0:a.camera().viewAll().render({animation:n}))})),keyBind:"f"})}function useLongPress({target:e,callback:t,delay:n=500,onMovement:a}){const[i,l]=g.useState(),[o,s]=g.useState();g.useEffect((()=>{const handleTouchStart=e=>{const a=e;null!=a.touches&&1===a.touches.length&&(null!=i&&clearTimeout(i),s(E.create(a.touches[0].clientX,a.touches[0].clientY)),l(setTimeout((()=>null==t?void 0:t(a)),n)))},handleTouchMove=e=>{const t=e;null!=t.touches&&t.touches.length>0&&null!=i&&null!=o&&E.distance(o,E.create(t.touches[0].clientX,t.touches[0].clientY))>=2&&(clearTimeout(i),null==a||a())},handleTouchEnd=()=>{null!=i&&clearTimeout(i)};return null==e||e.addEventListener("touchstart",handleTouchStart),null==e||e.addEventListener("touchmove",handleTouchMove),null==e||e.addEventListener("touchend",handleTouchEnd),()=>{null==e||e.removeEventListener("touchstart",handleTouchStart),null==e||e.removeEventListener("touchmove",handleTouchMove),null==e||e.removeEventListener("touchend",handleTouchEnd)}}),[e,i,o])}function asBooleanAttribute(e){return!!e||void 0}const VertexContextMenu=({targetElement:t,menuType:n,disableBackdrop:a,openPredicate:i,onOpen:l,onClose:o,children:r})=>{const c=useContextMenuActions(),d=s(Lt),u=s(zt),m=v.useMemo((()=>["bottom-end","top-start","top-end","right","left"]),[]),p=d===n;useStackKeyBinding({id:"ContextMenu",keyBind:"Escape",fn:c.clearActiveContextMenu,addPredicate:()=>null!=d&&d===n,cancelPredicate:()=>null==d},[d]);const h=v.useMemo((()=>null!=t?t:null!=i?window:void 0),[t,i]);return useLongPress({target:h,callback:e=>c.longPress(e,n,i,l),onMovement:()=>c.clearActiveContextMenu()}),v.useEffect((()=>{const handleWindowPointerDown=e=>{const t=undefined;if(!targetWithinMenu(e)&&2!==e.buttons&&d===n){const t=targetShouldSkipNextHit(e);c.clearActiveContextMenu(t)}};if(a)return window.addEventListener("pointerdown",handleWindowPointerDown),()=>{window.removeEventListener("pointerdown",handleWindowPointerDown)}}),[a,n,d]),v.useEffect((()=>{const handlePointerDown=e=>{c.pointerDown(e)},handlePointerUp=e=>{c.pointerUp(e,n,i,l)},handleContextMenu=e=>c.contextMenu(e,i);return null==h||h.addEventListener("pointerdown",handlePointerDown),null==h||h.addEventListener("pointerup",handlePointerUp),null==h||h.addEventListener("contextmenu",handleContextMenu),()=>{null==h||h.removeEventListener("pointerdown",handlePointerDown),null==h||h.removeEventListener("pointerup",handlePointerUp),null==h||h.removeEventListener("contextmenu",handleContextMenu)}}),[t,n,i]),e("div",{className:Nt({hidden:!p}),children:e(U,{"data-testid":`${n}-context-menu`,open:asBooleanAttribute(p),position:u,fallbackPlacements:m,backdrop:!a,onMenuClosed:()=>{c.clearActiveContextMenu(),null==o||o()},children:e("div",{className:"pt-1",children:r})})})},VertexFitSelectedMenuItem=()=>{const n=s(un),a=s(bn),i=useViewerCameraActions();return t(H,{"data-testid":"fit-selected-menu-option",onClick:()=>{null!=(null==a?void 0:a.boundingBox)&&i.flyToByBoundingBox(a.boundingBox)},disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"fit-selected",size:"sm"}),e("div",{className:"pl-2",children:"Fit Selected"})]})},VertexFlyToMenuItem=()=>{const n=useViewerCameraActions(),a=s(jt);return t(H,{"data-testid":"fly-to-part-menu-option",onClick:()=>{var e;const t=undefined,i=contextMenuItemIsRow(a)?null===(e=null==a?void 0:a.node.id)||void 0===e?void 0:e.hex:null==a?void 0:a.id;null!=i&&n.flyToById(i)},disabled:asBooleanAttribute(null==a),children:[e(D,{slot:"icon",name:"paper-airplane",size:"sm"}),e("div",{className:"pl-2",children:"Fly To"})]})};function useSceneItemsOperations(){const e=s(He),t=undefined,n=undefined,a=undefined,i=undefined,l=undefined,o=undefined;return{sceneItemsOperation:v.useCallback((async(t,n)=>{const a=await(null==e?void 0:e.scene());null==n?await(null==a?void 0:a.items((e=>t(e.where((e=>e.all()))))).execute()):n.length>0&&await(null==a?void 0:a.items((e=>t(e.where((e=>e.withItemIds(n)))))).execute())}),[e]),showOnlySelected:v.useCallback((async()=>{const t=await(null==e?void 0:e.scene());null==t||t.items((e=>[e.where((e=>e.all())).hide(),e.where((e=>e.withSelected())).show()])).execute()}),[e]),hideSelected:v.useCallback((async()=>{const t=await(null==e?void 0:e.scene());null==t||t.items((e=>[e.where((e=>e.withSelected())).hide()])).execute()}),[e]),showOnlyItem:v.useCallback((async t=>{const n=await(null==e?void 0:e.scene());null==n||n.items((e=>[e.where((e=>e.all())).hide(),e.where((e=>e.withItemIds([t]))).show()])).execute()}),[e]),ghostSelected:v.useCallback((async()=>{const t=await(null==e?void 0:e.scene());null==t||t.items((e=>[e.where((e=>e.withSelected())).setPhantom(!0)])).execute()}),[e]),unGhostSelected:v.useCallback((async()=>{const t=await(null==e?void 0:e.scene());null==t||t.items((e=>[e.where((e=>e.withSelected())).setPhantom(!1)])).execute()}),[e])}}const VertexHideAllMenuItem=()=>{const n=useSceneItemsOperations();return t(H,{"data-testid":"hide-all-menu-option",onClick:()=>{n.sceneItemsOperation((e=>e.hide()))},children:[e(D,{slot:"icon",name:"visibility-hidden",size:"sm"}),e("div",{className:"pl-2",children:"Hide All Parts"})]})},VertexHidePartMenuItem=()=>{const n=s(jt),a=useSceneItemsOperations();return t(H,{"data-testid":"hide-menu-option",onClick:()=>{var e;const t=undefined,i=contextMenuItemIsRow(n)?null===(e=null==n?void 0:n.node.id)||void 0===e?void 0:e.hex:n.id;null!=i&&a.sceneItemsOperation((e=>e.hide()),[i])},disabled:asBooleanAttribute(null==n),children:[e(D,{slot:"icon",name:"visibility-hidden",size:"sm"}),e("div",{className:"pl-2",children:"Hide Part"})]})},VertexHideSelectedMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return t(H,{"data-testid":"hide-selected-menu-option",onClick:()=>a.hideSelected(),disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"visibility-hidden",size:"sm"}),e("div",{className:"pl-2",children:"Hide Selected"})]})},VertexShowAllMenuItem=()=>{const n=useSceneItemsOperations();return t(H,{"data-testid":"show-all-menu-option",onClick:()=>{n.sceneItemsOperation((e=>e.show()))},children:[e(D,{slot:"icon",name:"visibility-visible",size:"sm"}),e("div",{className:"pl-2",children:"Show All Parts"})]})},VertexShowOnlyMenuItem=()=>{const n=s(jt),a=useSceneItemsOperations();return t(H,{"data-testid":"show-only-menu-option",onClick:()=>{var e;const t=undefined,i=contextMenuItemIsRow(n)?null===(e=null==n?void 0:n.node.id)||void 0===e?void 0:e.hex:null==n?void 0:n.id;null!=i&&a.showOnlyItem(i)},disabled:asBooleanAttribute(null==n),children:[e(D,{slot:"icon",name:"visibility-visible",size:"sm"}),e("div",{className:"pl-2",children:"Show Only Part"})]})},VertexShowOnlySelectedMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return t(H,{"data-testid":"show-only-selected-menu-option",onClick:()=>a.showOnlySelected(),disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"visibility-visible",size:"sm"}),e("div",{className:"pl-2",children:"Show Only Selected"})]})};l({key:"sceneTreeLoaderVisible",default:!1});const pa=l({key:"sceneTreeElement",default:void 0}),ha=l({key:"sceneTreeController",default:void 0,dangerouslyAllowMutability:!0});function useSceneTreeActions(){const e=useSelectionActions(),t=useViewerCameraActions();return{toggleSelection:useActionCallback((({snapshot:t})=>async(n,a,i)=>{var l,o;if(!n.defaultPrevented&&0===n.button&&(n.altKey||((n.ctrlKey||n.metaKey)&&a.selected?await i.deselectItem(a):a.selected?await i.selectItem(a,{recurseParent:!0}):a.selected||await i.selectItem(a,{append:n.ctrlKey||n.metaKey,range:n.shiftKey})),null!=a.id)){const i=await t.getPromise(mn);e.syncSelection({id:null===(l=a.id)||void 0===l?void 0:l.hex,ancestors:null!==(o=null==i?void 0:i.ancestors)&&void 0!==o?o:[]},{selected:!n.metaKey&&!n.ctrlKey||!a.selected,multiSelect:n.shiftKey||n.metaKey||n.ctrlKey})}})),toggleExpansion:useActionCallback((()=>(e,t,n)=>{n.toggleExpandItem(t)})),toggleVisibility:useActionCallback((()=>(e,t,n)=>{n.toggleItemVisibility(t)})),flyToRow:useActionCallback((({snapshot:e})=>async n=>{var a;const i=await e.getPromise(pa),l=await(null==i?void 0:i.getRowAtClientY(n));null!=(null===(a=null==l?void 0:l.node.id)||void 0===a?void 0:a.hex)&&await t.flyToById(l.node.id.hex)})),flyToFirstSelectedItem:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(pa),n=await e.getPromise(gn);null!=n&&(null==t||t.scrollToItem(n))})),setContextMenuItem:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=await t.getPromise(pa),i=await(null==a?void 0:a.getRowAtClientY(n));e(jt,i)}))}}const VertexGhostSelectedMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return t(H,{"data-testid":"ghost-selected-menu-option",onClick:()=>a.ghostSelected(),disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"visibility-partial",size:"sm"}),e("div",{className:"pl-2",children:"Ghost Selected"})]})},VertexUnghostSelectedMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return t(H,{"data-testid":"unghost-selected-menu-option",onClick:()=>a.unGhostSelected(),disabled:asBooleanAttribute(0===n.length),children:[e(D,{slot:"icon",name:"visibility-visible",size:"sm"}),e("div",{className:"pl-2",children:"Unghost Selected"})]})},DefaultSceneTreeContextMenu=()=>t("div",{className:"w-56",children:[e(VertexHideSelectedMenuItem,{}),e(VertexHideAllMenuItem,{}),e(VertexShowOnlyMenuItem,{}),e(VertexShowOnlySelectedMenuItem,{}),e(VertexShowAllMenuItem,{}),e(VertexGhostSelectedMenuItem,{}),e(VertexUnghostSelectedMenuItem,{}),e(W,{}),e(VertexFitSelectedMenuItem,{}),e(VertexFlyToMenuItem,{})]}),VertexSceneTreeContextMenu=({children:t})=>{const n=useSceneTreeActions(),a=s(pa),i=undefined;return e(VertexContextMenu,{menuType:"scene-tree",targetElement:a,onOpen:async(e,t)=>{const a=e;await n.setContextMenuItem(a.clientY)},disableBackdrop:!0,children:null!=t&&!1!==t?t:e(DefaultSceneTreeContextMenu,{})})},DefaultViewerContextMenu=()=>t("div",{className:"w-56",children:[e(VertexHidePartMenuItem,{}),e(VertexHideSelectedMenuItem,{}),e(VertexHideAllMenuItem,{}),e(VertexShowOnlyMenuItem,{}),e(VertexShowOnlySelectedMenuItem,{}),e(VertexShowAllMenuItem,{}),e(VertexGhostSelectedMenuItem,{}),e(VertexUnghostSelectedMenuItem,{}),e(W,{}),e(VertexFitSelectedMenuItem,{}),e(VertexFlyToMenuItem,{})]}),VertexViewerContextMenu=({children:t})=>{const n=null!=t&&!1!==t,a=v.useCallback((e=>e.target instanceof HTMLElement&&"vertex-viewer"===e.target.id),[]);return e(VertexContextMenu,{menuType:"viewer",disableBackdrop:!0,openPredicate:a,children:n?t:e(DefaultViewerContextMenu,{})})},fa=undefined,ga=l({key:"sceneItemGhostingSelectedOpacity",default:35}),va=u({key:"appliedItemPhantomState",default:void 0}),ya=l({key:"appliedItemPhantomStateIds",default:[]}),ba=o({key:"sceneItemGhostingLastSelectedPhantom",get:({get:e})=>{var t;const n=e(mn);return null!=n&&(null!==(t=e(va(n.id)))&&void 0!==t&&t)}}),VertexSceneItemGhostingOpacitySlider=({onApply:t})=>{const[n,a]=r(ga);return e(VertexSlider,{id:"phantom-opacity","data-testid":"phantom-opacity-slider",leftLabel:"0%",rightLabel:"100%",min:0,max:100,step:5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{null==t||t(e.detail.value)}})},useSceneItemPhantomActions=()=>{const e=useViewerSceneActions(),t=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=undefined;(await e.getPromise(ya)).forEach((e=>t(va(e)))),t(ya)}));return{setPhantomState:useActionCallback((({snapshot:t,set:n})=>async a=>{const i=await t.getPromise(un);i.forEach((e=>n(va(e),a))),n(ya,(e=>[...e,...i])),await e.execute(sn.SET_PHANTOM_SELECTED_ITEMS,(e=>e.where((e=>e.withSelected())).setPhantom(a)))})),clearPhantomState:useActionCallback((({snapshot:t,set:n,reset:a})=>async()=>{const i=await t.getPromise(un);i.forEach((e=>a(va(e)))),n(ya,(e=>e.filter((e=>!i.includes(e))))),await e.execute(sn.CLEAR_PHANTOM_SELECTED_ITEMS,(e=>e.where((e=>e.withSelected())).clearPhantom()),(e=>e.where((e=>e.withSelected())).select()))})),clearAllPhantomState:useActionCallback((()=>async()=>{await t(),await e.execute(sn.CLEAR_PHANTOM_ALL,(e=>e.where((e=>e.all())).clearPhantom()),(e=>e.where((e=>e.withSelected())).select()))})),resetAllPhantomState:t}},VertexSceneItemGhostingToggle=({onApply:t})=>{const n=useSceneItemPhantomActions(),a=s(xn),i=p(ba);return e(V,{content:"Select a part to display as ghost",disabled:a,children:e(_,{className:"flex items-center","data-testid":"phantom-state-toggle",variant:"switch",disabled:!a,checked:"hasValue"===i.state&&i.contents,onValueChanged:async e=>{await n.setPhantomState(e.detail),null==t||t(e.detail)}})})};function VertexGhostingControls({onApplyGhostingChange:a,onApplyOpacity:i}){return t(n,{children:[t("div",{className:"flex items-center py-3",children:[e(VertexSceneItemGhostingToggle,{onApply:a}),e("span",{className:"pl-4 text-sm text-neutral-700",children:"Display as Ghost"})]}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Global Ghost Opacity"}),e(VertexSceneItemGhostingOpacitySlider,{onApply:i})]})}const VertexSceneItemGhostingClear=({onClear:n,onClearAll:a})=>{const i=useSceneItemPhantomActions(),l=s(ba);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"phantom",tooltip:"Clear Ghosting",children:[e("div",{className:"pt-1"}),e(H,{"data-testid":"reset-selected-phantom",onClick:async()=>{await i.clearPhantomState(),null==n||n()},disabled:!l,children:"Clear ghosting for selected"}),e(H,{"data-testid":"reset-all-phantom",onClick:async()=>{await i.clearAllPhantomState(),null==a||a()},children:"Clear ghosting for all"})]})})};function VertexGhostingPanelSection({onClearGhostState:n,onClearAllGhostState:a,onApplyGhostingChange:i,onApplyOpacity:l}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Ghosting",e(VertexSceneItemGhostingClear,{onClear:n,onClearAll:a})]}),children:e(VertexGhostingControls,{onApplyGhostingChange:i,onApplyOpacity:l})})}function VertexMeasurementContextMenu({onDelete:n}){const a=s(_t);return e(VertexContextMenu,{menuType:"measurement",openPredicate:e=>e.target instanceof HTMLElement&&"VERTEX-VIEWER-MEASUREMENT-DISTANCE"===e.target.tagName,children:t(H,{"data-testid":"measurement-delete",onClick:()=>null!=a&&n(a.id),children:[e(D,{slot:"icon",name:"delete",size:"sm"}),e("div",{className:"pl-2",children:"Delete"})]})})}function useDockedPlacement(e,t){const[n,a]=g.useState(E.create(0,0));return g.useLayoutEffect((()=>{if(null!=e){const n=e.getBoundingClientRect(),i=E.create(n.left,n.bottom),l=E.create(n.right,n.bottom);a("left"===t?i:l)}}),[e,t]),n}function VertexMeasurementDetails({placement:n}){const a=useMeasurementActions(),i=s(He),l=s(Fe),o=useDockedPlacement(null!=i?i:null,n),r=s(Qt),c=s(en),d=s(tn),u=s(nn),m=s(kn),p=s(An);return e(G,{className:"z-popover",boundaryPadding:16,boundarySelector:`#${l}`,position:o,children:t("div",{className:"flex flex-col leading-4 min-w-40",children:[t("div",{className:"pb-2 flex justify-between",children:[e("div",{className:"w-full",children:"Measurement"}),e("div",{className:Nt("-mt-1 relative",{hidden:!u}),children:e(V,{content:"Reset",placement:"left-start",children:e(L,{"data-testid":"measurement-details-reset",iconName:"reset",iconSize:"sm",onClick:a.resetMeasurement})})})]}),e(ne,{"data-testid":"measurement-details-viewer-measurement-details",className:Nt("gap-y-1.5 text-xs",{hidden:null==r}),measurementOutcome:r,measurementOverlays:c,distanceUnits:toUnitType(m),fractionalDigits:parseInt(p,10)}),e("div",{"data-testid":"measurement-details-message",className:Nt("text-xs",{hidden:null==d}),children:d})]})})}function useCallbackRef(e){var t;const[n,a]=v.useState((t=void 0,null)),i=undefined;return{element:n,callback:v.useCallback((e=>a(e)),[])}}function VertexPointToPointMeasurement({detailsPlacement:a,onPointToPointMeasurementChange:i}){const l=useMeasurementActions(),o=s(He),r=s(Ft),c=s(Wt),d=s(kn),u=s(An),{callback:m,element:p}=useCallbackRef();usePointToPointMeasurement(p);const h=w((e=>{const t={start:e.detail.start,end:e.detail.end,invalid:!e.detail.valid};l.setEditedPointToPointMeasurement(t),null==i||i(t)}),[l]);return r?t(n,{children:[e(ae,{"data-testid":"point-to-point-measurement",ref:m,viewer:null!=o?o:void 0,mode:"replace",start:null==c?void 0:c.start,end:null==c?void 0:c.end,invalid:null==c?void 0:c.invalid,units:toUnitType(d),fractionalDigits:parseInt(u,10),showAxisReferenceLines:!0,onEditEnd:h}),e(VertexMeasurementDetails,{placement:a}),e(VertexMeasurementContextMenu,{onDelete:l.resetMeasurement})]}):e(n,{})}function VertexPointToPointMeasurementTool(){const t=useMeasurementActions(),n=s(Ft);return useStackKeyBinding({id:"ExitMeasurement",keyBind:"Escape",fn:t.disableEditMeasurement,addPredicate:()=>n,cancelPredicate:()=>!n},[n,t]),e(V,{content:"Point to Point Measurement",children:e(L,{iconName:"tape-measure","data-testid":"viewer-toolbar-point-to-point-measurement-button",iconColor:n?"primary":"secondary",onClick:t.toggleEditPointToPointMeasurement})})}const wa=l({key:"viewerToolkitSdkConfig",default:void 0}),VertexPreciseMeasurement=({detailsPlacement:a,onEntitiesChanged:i,onOutcomeChanged:l})=>{var o,r,c,d;const u=s(He),m=s(wa),p=s(Kt),{callback:h,element:f}=useCallbackRef();return usePreciseMeasurementModel(f,i,l),p?t(n,{children:[e(ie,{"data-testid":"precise-measurement-viewer-tool",ref:h,viewer:null!=u?u:void 0,config:JSON.stringify({network:{apiHost:null===(o=null==m?void 0:m.network)||void 0===o?void 0:o.apiHost,renderingHost:null===(r=null==m?void 0:m.network)||void 0===r?void 0:r.renderingHost,sceneTreeHost:null===(c=null==m?void 0:m.network)||void 0===c?void 0:c.sceneTreeHost,sceneViewHost:null===(d=null==m?void 0:m.network)||void 0===d?void 0:d.sceneViewHost}})}),e(VertexMeasurementDetails,{placement:a})]}):e(n,{})};function VertexPreciseMeasurementTool(){const t=useMeasurementActions(),n=s(Kt);return e(V,{content:"Precise Measurement",children:e(L,{iconName:"ruler","data-testid":"viewer-toolbar-precise-measurement-button",iconColor:n?"primary":"secondary",onClick:t.toggleEditPreciseMeasurement})})}function VertexApplicationMessages(){const a=s(on),i=s(ln);return t(n,{children:[null!=a&&e(K,{className:"z-[16000]",duration:a.duration,open:!0,content:a.message,type:a.type},a.id),null!=i&&e($,{placement:"bottom-left",className:"z-[16000]",duration:i.duration,open:!0,content:i.message,type:i.type},i.id)]})}const Ca={binding:"{{row.node.name}}",label:"Name",metadataKeyName:"VERTEX_SCENE_ITEM_NAME"};function mapToColumn(e,t){return{label:"name"===e.toLowerCase()?"Name (Property)":e,binding:`{{row.metadata.${e}}}`,initialWidth:t,minWidth:t/2}}const xa=l({key:"sceneTreeColumnsRefreshTrigger",default:0}),Sa=o({key:"sceneTreeColumnsAvailableColumns",get:async({get:e})=>{const t=e(ha);return e(xa),null!=t?await t.fetchMetadataKeys():[]}}),ka=o({key:"sceneTreeColumnsAvailableSortedColumns",get:({get:e})=>e(Sa).filter((e=>e!==Ca.metadataKeyName)).sort(((e,t)=>e.localeCompare(t)))}),Aa=l({key:"sceneTreeColumnsVisibleMetadataColumnNames",default:[]}),Ta=o({key:"sceneTreeColumnsActiveColumns",get:({get:e})=>{const t=e(Aa),n=e(pa),a=null==n?void 0:n.clientWidth;if(null!=a&&a>0){const e=1/(t.length+1)*a,n=(a-e)/t.length;return t.reduce(((e,t)=>{const a=mapToColumn(t,n);return Object.assign(Object.assign({},e),{[a.label]:a})}),{Name:Object.assign(Object.assign({},Ca),{initialWidth:e,minWidth:n})})}return{Name:Ca}}}),Pa=o({key:"sceneTreeColumnsActiveColumnNames",get:({get:e})=>Object.keys(e(Ta))});function useSceneTreeColumnActions(){return{setActive:useActionCallback((({set:e,snapshot:t})=>async n=>{e(Aa,n);const a=await t.getPromise(ha);null==a||a.setMetadataKeys(n)})),refreshKeyList:useActionCallback((({set:e})=>()=>{e(xa,(e=>e+1))}))}}const Ea=16,Na=-8;var Oa;function useOpenColumnPopover({buttonElement:e,horizontalOffset:t,verticalOffset:n}){const[a,i]=g.useState(!1),[l,o]=g.useState(),[s,r]=g.useState(),c=g.useCallback((()=>{if(a)i(!1);else{const a=null==e?void 0:e.getBoundingClientRect();if(null!=a){const e=null!=t?t:Ea,l=null!=n?n:Na,s=a.x>window.innerWidth/2?Oa.LEFT:Oa.RIGHT;o({x:s===Oa.LEFT?a.left-e:a.right+e,y:a.top+l}),r(s),i(!0)}}}),[a,e]),d=g.useCallback((()=>{i(!1)}),[]);return{open:a,position:l,direction:s,handleOpen:c,handleClose:d}}!function(e){e.LEFT="left",e.RIGHT="right"}(Oa||(Oa={}));const Ia=l({key:"sceneTreeSearchActive",default:!1}),Ma=l({key:"sceneTreeColumnsPartial",default:!1}),Va=l({key:"sceneTreeSearchValue",default:void 0}),La=l({key:"sceneTreeSearchExactMatch",default:!1}),Ra=l({key:"sceneTreeSearchResultCount",default:0}),_a=l({key:"sceneTreeSearchActiveColumns",default:[]}),ja=o({key:"sceneTreeSearchNameColumnActive",get:({get:e})=>{const t=e(_a);return 0===t.length||t.includes(Ca.metadataKeyName)}});function useSceneTreeSearch({sceneTreeElement:e}){const t=useSceneTreeActions(),n=s(Ia),a=c(Ra),i=c(gn);v.useEffect((()=>{let t;return whenComponentReady(e,(()=>{var n;t=null===(n=null==e?void 0:e.controller)||void 0===n?void 0:n.stateChanged((e=>{void 0!==(null==e?void 0:e.totalFilteredRows)&&a(null==e?void 0:e.totalFilteredRows)}))})),()=>{null==t||t.dispose()}}),[e]),v.useEffect((()=>{if(null!=e){let a;return whenComponentReady(e,(()=>{var l;a=null===(l=null==e?void 0:e.controller)||void 0===l?void 0:l.stateChanged((e=>{var a;if(null!=(null==e?void 0:e.filterTerm)){const t=null==e?void 0:e.rows.find((e=>{var t;return null===(t=null==e?void 0:e.node)||void 0===t?void 0:t.selected}));i(null===(a=null==t?void 0:t.node.id)||void 0===a?void 0:a.hex)}else n&&t.flyToFirstSelectedItem()}))})),()=>{null==a||a.dispose()}}}),[e,null==e?void 0:e.controller,open])}function useSceneTreePartialResults({sceneTreeElement:e}){const t=c(Ma);v.useEffect((()=>{let n;return whenComponentReady(e,(()=>{var a;n=null===(a=null==e?void 0:e.controller)||void 0===a?void 0:a.stateChanged((e=>{t(!!(null==e?void 0:e.isPartialKeysResponse))}))})),()=>{null==n||n.dispose()}}),[e])}const useSceneTreeSearchActions=()=>{const e=useActionCallback((({set:e})=>t=>{e(_a,t)})),t=useActionCallback((({snapshot:t})=>async(n,a,i,l)=>{const o=await t.getPromise(pa),s=await t.getPromise(La),r=await t.getPromise(_a),c=r.length>0?a?[...r,n]:r.filter((e=>e!==n)):[...i,Ca.metadataKeyName].filter((e=>e!==n));e(c),l&&(null==o||o.filterItems(l,{columns:c,exactMatch:s}))})),n=useActionCallback((({snapshot:e,set:t})=>async(n,a,i)=>{const l=await e.getPromise(pa),o=await e.getPromise(La),s=await e.getPromise(_a),r=n.filter((e=>!a.includes(e))),c=a.filter((e=>!n.includes(e))),d=s.length>0?[...s.filter((e=>!r.includes(e))),...c]:[...a,Ca.metadataKeyName],u=d.length>0?d:[...a,Ca.metadataKeyName];t(_a,u),i&&(null==l||l.filterItems(i,{columns:u,exactMatch:o}))})),a=useActionCallback((({set:e})=>t=>{e(La,t)}));return{setMetadataSearchKeys:e,updateMetadataSearchAfterSearchKeysChange:t,updateMetadataSearchAfterColumnVisibilityChange:n,setMetadataSearchExactMatch:a}};function useCacheableLoadable(e,t){const n=C(),[a,i]=S(0),l=p(e);b((()=>{"hasValue"===l.state&&(n.current=l.contents)}),[t,l]);const[o,s]=k((()=>"hasValue"!==l.state&&null!=n.current?[n.current,!0]:"hasValue"===l.state?[l.contents,!1]:[void 0,!1]),[l.state,l.contents,a]),r=w((()=>{n.current=void 0,i(a+1)}),[a]),c=undefined;return k((()=>({data:o,state:l.state,cached:s,invalidate:r})),[r,o,s,l.state])}const VertexSceneTreeMetadataCheck=({checked:n,disabled:a,onChange:i,children:l})=>{const o="string"==typeof l?l.replace(" ","-"):"";return t("div",{className:"flex items-center",children:[e(_,{"data-testid":`scene-tree-metadata-check-${o}`,variant:"check",checked:n,disabled:a,onValueChanged:e=>null==i?void 0:i(e.detail)}),e("div",{className:"pl-2 py-1 text-[0.875rem] w-full","data-testid":`scene-tree-metadata-name-${o}`,onClick:()=>{a||null==i||i(!n)},children:l})]})},VertexSceneTreeColumnPopover=({onVisibleSceneTreeColumnsChange:a})=>{const i=useSceneTreeColumnActions(),l=useSceneTreeSearchActions(),o=s(pa);useSceneTreePartialResults({sceneTreeElement:null!=o?o:null});const r=s(Va),c=useCacheableLoadable(ka),d=s(Aa),u=s(Ma),[m,p]=g.useState(d),[h,f]=g.useState(""),{element:v,callback:b}=useCallbackRef(),{open:w,position:C,direction:S,handleOpen:k,handleClose:A}=useOpenColumnPopover({buttonElement:v}),T=S===Oa.LEFT?"left-end":"right-start",P=g.useMemo((()=>{if(null!=c.data){const e=c.data.filter((e=>m.indexOf(e)<0)),t=undefined;return[...[...m].sort(((e,t)=>e.localeCompare(t))),...e]}return[]}),[m,c.data]),E=g.useMemo((()=>P),[w,c.data]);return t(n,{children:[e(V,{content:"Configure Columns",placement:"top",children:e(L,{"data-testid":"scene-tree-column-popover-button",ref:b,iconName:"columns-add",iconSize:"sm",onClick:()=>{k()}})}),w&&e(q,{"data-testid":"scene-tree-column-popover",open:w,backdrop:!1,position:C,resizeBehavior:"fixed",placement:T,className:"z-popover",children:t("div",{className:Nt("flex flex-col bg-white border border-neutral-300 rounded",{hidden:!w}),children:[t("div",{className:"flex items-center text-[0.875rem] p-3",children:[t("div",{className:"pr-2",children:[e("div",{className:"text-[0.875rem]",children:"Assembly Properties"}),e("div",{className:"text-[0.75rem] text-neutral-700 mt-1.5",children:"Select up to six properties to appear in the Assembly panel."})]}),e(L,{"data-testid":"scene-tree-columns-popover-close-button",className:"ml-auto",iconName:"close",iconSize:"sm",onClick:()=>{f(""),A()}})]}),e(Y,{className:"flex w-full px-2 overflow-hidden border-b border-neutral-300 pb-2",id:"scene-tree-available-columns-search-bar","data-testid":"scene-tree-available-columns-search-bar",multiline:!1,placeholder:"Filter properties",type:"text",onInputInput:e=>{const t=e.detail.value;null!=t&&f(t.toLowerCase())}}),u&&e(le,{"data-testid":"partial-key-list-notification-banner",message:"loading"===c.state?"Refreshing results...":"Data loading, refresh for more.",actionLabel:"Refresh",onAction:()=>i.refreshKeyList()}),t("div",{className:"max-h-64 p-3 overflow-y-auto",children:[e(VertexSceneTreeMetadataCheck,{checked:!0,disabled:!0,children:Ca.label}),E.filter((e=>""===h||e.toLowerCase().includes(h))).map((t=>e(VertexSceneTreeMetadataCheck,{checked:m.includes(t),disabled:m.length>=6&&!m.includes(t),onChange:e=>{p(e?[...m,t]:m.filter((e=>e!==t)))},children:t},t)))]}),t("div",{className:"flex items-center p-3 border-t border-neutral-300 space-x-4",children:[e("div",{className:"text-[0.75rem] text-[var(--vertex-ui-blue-700)] cursor-pointer","data-testid":"scene-tree-column-clear-selection",onClick:()=>p([]),children:"Clear selection"}),e("div",{className:"flex-grow"}),t("div",{className:"flex space-x-2",children:[e(j,{"data-testid":"scene-tree-column-popover-cancel",color:"secondary",onClick:()=>{f(""),A()},children:"Cancel"}),e(j,{"data-testid":"scene-tree-column-popover-apply",color:"primary",onClick:async()=>{await l.updateMetadataSearchAfterColumnVisibilityChange(d,m,r),await i.setActive(m),null==a||a(m),f(""),A()},children:"Apply"})]})]})]})})]})},VertexSceneTreeSearchOptionsPopover=({onSearchedSceneTreeColumnsChange:a,onSearchForExactMatchChange:i})=>{const l=useSceneTreeSearchActions(),o=s(pa),r=s(ja),c=s(_a),d=s(Va),u=s(La),m=s(Aa),{element:p,callback:h}=useCallbackRef(),{open:f,position:g,direction:v,handleOpen:b,handleClose:w}=useOpenColumnPopover({buttonElement:p,horizontalOffset:40}),C=v===Oa.LEFT?"left-end":"right-start",updateSearch=e=>{if(d){const t=c.length>0?c:[...m,Ca.metadataKeyName];null==o||o.filterItems(d,{columns:t,exactMatch:e})}};return t(n,{children:[e(V,{content:"Search Options",placement:"top",children:e(L,{"data-testid":"scene-tree-search-options-popover-button",ref:h,iconName:"gear",iconSize:"sm",onClick:()=>{b()}})}),e(q,{"data-testid":"scene-tree-search-options-popover",open:f,backdrop:!1,position:g,resizeBehavior:"fixed",placement:C,className:"z-popover",children:t("div",{className:Nt("flex flex-col bg-white border border-neutral-300 rounded",{hidden:!f}),children:[t("div",{className:"flex items-center text-[0.875rem] p-3 border-b border-neutral-300 pb-2",children:[e("div",{className:"pr-2 text-[0.875rem] whitespace-nowrap",children:"Column Properties Search"}),e(L,{className:"ml-auto",iconName:"close",iconSize:"sm",onClick:()=>{w()}})]}),t("div",{className:"max-h-64 p-3 overflow-y-auto",children:[e("div",{className:"text-[0.875rem] pb-2 pr-2",children:"Select properties to perform the search on:"}),e(VertexSceneTreeMetadataCheck,{checked:r,disabled:0===c.length||c.every((e=>e===Ca.metadataKeyName)),onChange:async e=>{await l.updateMetadataSearchAfterSearchKeysChange(Ca.metadataKeyName,e,m,d),null==a||a()},children:Ca.label},Ca.metadataKeyName),m.map((t=>e(VertexSceneTreeMetadataCheck,{checked:c.includes(t),disabled:c.length>0&&c.every((e=>e===t)),onChange:async e=>{await l.updateMetadataSearchAfterSearchKeysChange(t,e,m,d),null==a||a()},children:t},t)))]}),t("div",{className:"flex p-3 border-t border-neutral-300",children:[e(_,{className:"flex items-center","data-testid":"filter-exact-match-toggle",variant:"switch",checked:u,onValueChanged:async e=>{l.setMetadataSearchExactMatch(e.detail),null==i||i(),updateSearch(e.detail)}}),e("span",{className:"pl-4 text-[0.875rem] text-neutral-800",children:"Return only exact matches"})]})]})})]})},VertexSceneTreeSearchBar=({onSearch:n,onClearSearch:a,onExitSearchMode:i,onSearchedSceneTreeColumnsChange:l,onSearchForExactMatchChange:o,children:c})=>{const d=useSceneTreeActions(),u=s(pa),[m,p]=r(Ia),[h,f]=r(Va);useSceneTreeSearch({sceneTreeElement:null!=u?u:null});const{element:v,callback:b}=useCallbackRef(),w=null==h||""===h,C=w?"Exit Search":"Clear Search";return g.useEffect((()=>{m&&(null==v||v.setFocus())}),[v,m]),t("div",{className:"flex w-full py-3 px-2",children:[e(oe,{"data-testid":"scene-tree-search-bar",ref:b,controller:null==u?void 0:u.controller,onBlur:()=>{w&&(p(!1),null==i||i())},onSearch:()=>{f(null==v?void 0:v.value),null==n||n(null==v?void 0:v.value)},children:c}),e("div",{className:"self-center px-1",onPointerDown:e=>{e.preventDefault()},children:e(VertexSceneTreeSearchOptionsPopover,{onSearchedSceneTreeColumnsChange:l,onSearchForExactMatchChange:o})}),e(V,{className:"self-center pr-1",content:C,children:e(L,{"data-testid":"scene-tree-search-close-button",iconName:"close-circle-fill",iconSize:"sm",variant:"plain",onPointerDown:e=>{e.preventDefault()},onClick:async()=>{w?(p(!1),await d.flyToFirstSelectedItem(),null==i||i()):(await(null==v?void 0:v.clear()),await(null==v?void 0:v.setFocus()),f(void 0),null==a||a())}})})]})};function VertexToolbarDivider(){return e("div",{"data-testid":"toolbar-divider",className:"h-6 w-px bg-neutral-300 mx-1"})}const VertexSceneTreeSearchInformationForToolbar=()=>{const a=useSelectionActions(),i=s(pa),l=s(Va),o=s(Ra),r=undefined,c=undefined,d=`${o>=1e3?`${o}+`:`${o}`} ${1===o?"result":"results"}`;return t(n,{children:[e(VertexToolbarDivider,{}),t("div",{className:"flex flex-row items-center overflow-hidden",children:[e("div",{className:"px-2 text-[0.8125rem] leading-4 text-neutral-900 truncate","data-testid":"search-result-info",children:`${d}`}),e(V,{className:"w-auto",content:"Select Results",placement:"top",children:e(j,{className:"h-6 rounded cursor-pointer","data-testid":"select-search-results-button",color:"secondary",variant:"text",size:"sm",onClick:async()=>{null!=i&&null!=l&&(await i.selectFilteredItems(l),a.toggleLastSelectWasMultiSelect(!0))},children:t("div",{className:"flex h-6 items-center gap-1",children:[e(D,{size:"sm",name:"check-circle"}),e("span",{className:"whitespace-nowrap",children:"Select Results"})]})})})]})]})},targetIsElement=(e,t)=>e instanceof Element&&e.tagName===t;function useRecoilRef({state:e}){const t=i((({set:t})=>n=>{t(e,n)}),[]);return t}var Ba;function styleFromOptionalFont(e){return null!=e?{"--scene-tree-default-font-family":styleFromFontFace(e.fontFace),"--scene-tree-default-font-color":e.color}:{}}function styleFromOptionalBackgroundColors(e){const t=null==e?void 0:e.depthColors,n=null!=t?Object.keys(t).reduce(((e,n)=>Object.assign(Object.assign({},e),{[`--scene-tree-row-background-color-depth-${n}`]:t[parseInt(n)]})),{}):{};return null!=e?Object.assign(Object.assign({},n),{"--scene-tree-hovered-row-background-color":e.hovered,"--scene-tree-selected-row-background-color":e.selected,"--scene-tree-row-background-color":e.defaultColor}):{}}function styleFromFontFace(e){return e===Ba.ROBOTO_MONO?"var(--vertex-ui-font-family-monospace)":"var(--vertex-ui-font-family)"}!function(e){e.ROBOTO="ROBOTO",e.ROBOTO_MONO="ROBOTO_MONO"}(Ba||(Ba={}));const VertexEnterSceneTreeSearchModeButton=({onEnterSearchMode:t})=>{const n=c(Ia);return e(V,{className:"flex ml-auto",content:"Scene Tree Search",children:e(L,{"data-testid":"enter-scene-tree-search-mode-button",iconName:"search",iconSize:"sm",onPointerDown:e=>{e.preventDefault()},onClick:()=>{n(!0),null==t||t()}})})},VertexSceneTreeSearch=({onEnterSearchMode:n,onExitSearchMode:a,onSearch:i,onClearSearch:l,onSearchedSceneTreeColumnsChange:o,onSearchForExactMatchChange:r,children:c})=>{const d=s(Ia);return t(se,{className:"h-11 p-0 border-b border-neutral-300 box-content",slot:"header",children:[d&&e(VertexSceneTreeSearchBar,{onSearch:i,onClearSearch:l,onExitSearchMode:a,onSearchedSceneTreeColumnsChange:o,onSearchForExactMatchChange:r,children:c}),!d&&e("div",{className:"ml-auto mr-2",children:e(VertexEnterSceneTreeSearchModeButton,{onEnterSearchMode:n})})]})},VertexSceneTreeCollapseAll=()=>{const t=s(pa);return e(V,{className:"w-auto",content:"Collapse All",placement:"top",children:e(D,{size:"sm",className:"h-6 w-6 hover:bg-neutral-300 rounded cursor-pointer","data-testid":"collapse-all-icon",name:"collapse-all",onClick:()=>{null==t||t.collapseAll()}})})},VertexSceneTreeExpandAll=()=>{const t=s(pa);return e(V,{className:"w-auto",content:"Expand All",placement:"top",children:e(D,{size:"sm","data-testid":"expand-all-icon",className:"h-6 w-6 hover:bg-neutral-300 rounded cursor-pointer",name:"expand-all",onClick:()=>{null==t||t.expandAll()}})})},VertexSceneTreeToolbar=({onVisibleSceneTreeColumnsChange:n})=>{const a=s(Va),i=null==a||""===a;return e(se,{className:"h-10 border-b border-neutral-300 box-border",children:t("div",{className:"flex w-full text-neutral-700 items-center gap mx-2",children:[e(VertexSceneTreeExpandAll,{}),e(VertexSceneTreeCollapseAll,{}),!i&&e(VertexSceneTreeSearchInformationForToolbar,{}),e("div",{className:"ml-auto",children:e(VertexSceneTreeColumnPopover,{onVisibleSceneTreeColumnsChange:n})})]})})},VertexSceneTreeHeader=({onEnterSearchMode:a,onExitSearchMode:i,onSearch:l,onClearSearch:o,onVisibleSceneTreeColumnsChange:s,children:r})=>{const c=undefined;return e("div",{slot:"header",className:"flex flex-col",children:null!=r&&!1!==r?r:t(n,{children:[e(VertexSceneTreeSearch,{onEnterSearchMode:a,onExitSearchMode:i,onSearch:l,onClearSearch:o,children:e("div",{slot:"clear-icon"})}),e(VertexSceneTreeToolbar,{onVisibleSceneTreeColumnsChange:s})]})})},VertexSceneTreeTableLayout=n=>{const a=s(Ta),i=s(Pa),l=[];return e(re,Object.assign({"data-testid":"scene-tree-table-layout"},n,{children:i.map(((n,o)=>{var s;const r=a[n],c=null!==(s=l[o])&&void 0!==s?s:r.initialWidth;return t(ce,{"data-testid":`scene-tree-table-column-${o}`,initialWidth:c,minWidth:r.minWidth,children:[e("template",{slot:"header",dangerouslySetInnerHTML:{__html:`\n <div class="text-sm text-neutral-800 my-2">\n <div class="${Nt("truncate",{"pl-2":0===o,"pr-2":o===i.length-1})}">\n ${r.label}\n </div>\n </div>\n `}}),e("template",{dangerouslySetInnerHTML:{__html:`\n <vertex-scene-tree-table-cell\n prop:value="${r.binding}"\n prop:selection-handler="{{row.data.handleSelection}}"\n prop:expansion-handler="{{row.data.handleExpansion}}"\n prop:visibility-handler="{{row.data.handleVisibility}}"\n ${0===o?"expand-toggle":""}\n ${o===i.length-1?"isolate-button visibility-toggle":""}>\n <div class="flex items-center gap-2">\n <vertex-tooltip \n class="truncate" \n prop:content="${null!=r.binding?r.binding:"--"}" \n placement="${o!==i.length-1?"right":"top"}">\n <div class="flex items-center w-full">\n <div class="truncate">${r.binding}</div>\n </div>\n </vertex-tooltip>\n </div>\n \n\n <div slot="placeholder" class="flex items-center w-full truncate">\n <div> -- </div>\n </div>\n </vertex-scene-tree-table-cell>\n `}})]},r.label)}))}))},VertexSceneTree=a=>{var{id:i,font:l,backgroundColors:o,children:r,style:d,onPointerDown:u,onClick:m,onToggleSelection:p,onToggleExpansion:h,onToggleVisibility:f,className:g,rowData:b}=a,w=__rest(a,["id","font","backgroundColors","children","style","onPointerDown","onClick","onToggleSelection","onToggleExpansion","onToggleVisibility","className","rowData"]);const C=useSceneTreeActions(),S=useSelectionActions(),k=s(wa),A=s(He),T=s(_a),P=s(La),E=s(Va),N=null==E||""===E,O=useRecoilRef({state:pa}),I=null!=r&&!1!==r,wrappedExpansionHandler=(e,t,n)=>{C.toggleExpansion(e,t,n),null==h||h(e,t,n)},wrappedSelectionHandler=(e,t,n)=>{C.toggleSelection(e,t,n),null==p||p(e,t,n)},wrappedVisibilityHandler=(e,t,n)=>{C.toggleVisibility(e,t,n),null==f||f(e,t,n)},handleClick=e=>{e.altKey&&C.flyToRow(e.clientY),null==m||m(e)},handlePointerDown=e=>{targetIsElement(e.target,"VERTEX-SCENE-TREE-TABLE-COLUMN")&&S.clearSelection(),null==u||u(e)},M=c(ha),handleFirstRowRendered=e=>{var t;M(e.target.controller),null===(t=null==w?void 0:w.onFirstRowRendered)||void 0===t||t.call(w,e)},V=v.useMemo((()=>({metadataSearchKeys:T,exactMatch:P})),[T,P]);return e("div",{className:Nt("flex flex-col w-full h-full",g),children:e("div",{className:"flex group h-full",children:e(de,Object.assign({id:null!=i?i:"vertex-scene-tree","data-testid":"vertex-scene-tree",config:k,ref:O,className:Nt("flex-1",{filtered:!N}),style:Object.assign(Object.assign(Object.assign({},styleFromOptionalFont(l)),styleFromOptionalBackgroundColors(o)),d),onConnectionError:e=>{logger_error("Scene Tree Connection Error: ",e.detail)},viewer:A,onPointerDown:handlePointerDown,onClick:handleClick,rowData:e=>{var t;const n=null!==(t=null==b?void 0:b(e))&&void 0!==t?t:{};return Object.assign({handleExpansion:wrappedExpansionHandler,handleSelection:wrappedSelectionHandler,handleVisibility:wrappedVisibilityHandler},n)},searchOptions:V},w,{onFirstRowRendered:handleFirstRowRendered,children:I?r:t(n,{children:[e(VertexSceneTreeHeader,{}),e(VertexSceneTreeTableLayout,{}),e(VertexSceneTreeContextMenu,{})]})}))})})},VertexDecimalPlaceSelector=({onApply:n})=>{const[a,i]=r(An);return t(X,{"data-testid":"decimal-place-select",className:"w-24",value:a,onOptionChanged:e=>{i(e.detail),null==n||n(e.detail)},children:[e("div",{className:"py-1.5 px-3",children:"0"}),e("div",{className:"py-1.5 px-3",children:"1"}),e("div",{className:"py-1.5 px-3",children:"2"}),e("div",{className:"py-1.5 px-3",children:"3"})]})},VertexLengthUnitSelector=({onApply:n})=>{const[a,i]=r(kn);return t(X,{"data-testid":"length-unit-select",className:"w-40",value:a,onOptionChanged:e=>{i(e.detail),null==n||n(e.detail)},children:[e("div",{"data-value":"cm",className:"py-1.5 px-3",children:"centimeters"}),e("div",{"data-value":"mm",className:"py-1.5 px-3",children:"millimeters"}),e("div",{"data-value":"m",className:"py-1.5 px-3",children:"meters"}),e("div",{"data-value":"in",className:"py-1.5 px-3",children:"inches"}),e("div",{"data-value":"ft",className:"py-1.5 px-3",children:"feet"})]})};function VertexUnitsControls({onUnitChange:a,onDecimalPlaceChange:i}){return t(n,{children:[t("div",{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Length Unit"}),e(VertexLengthUnitSelector,{onApply:a})]}),t("div",{children:[e("div",{className:"pt-2 pb-2 text-sm text-neutral-700",children:"Decimals"}),e(VertexDecimalPlaceSelector,{onApply:i})]})]})}function VertexUnitsPanelSection({onUnitChange:t,onDecimalPlaceChange:n}){return e(PanelSection,{header:e("div",{className:"flex items-center text-base",children:"Units"}),children:e(VertexUnitsControls,{onUnitChange:t,onDecimalPlaceChange:n})})}const za=l({key:"openedPanelActivePrimaryLeft",default:void 0}),Da=l({key:"openedPanelActivePrimaryRight",default:void 0});function usePanelActions(){return{openPrimary:useActionCallback((({set:e})=>(t,n)=>{e("left"===n?za:Da,t)})),closePrimary:useActionCallback((({set:e})=>t=>{e("left"===t?za:Da,void 0)}))}}function childrenAsArray(e){return Array.isArray(e)?e:[e]}function filterChildElements(e,t){return childrenAsArray(e).filter((e=>v.isValidElement(e)&&e.type===t))}function DefaultAppearancePanel(){return t("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:[e(VertexMaterialPanelSection,{}),e(VertexGhostingPanelSection,{}),e(VertexFeatureEdgesPanelSection,{}),e(VertexViewerBackgroundPanelSection,{}),e(VertexSelectionHighlightingPanelSection,{}),e(VertexCrossSectionAppearancePanelSection,{})]})}function DefaultSettingsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexUnitsPanelSection,{})})}const VertexTransformClear=({onClear:n,onClearAll:a})=>{const i=useTransformActions(),l=useCacheableLoadable(Sn),o=s(vn),r=useCacheableLoadable(_n(null!=o?o:"")),c=v.useMemo((()=>{var e;const t=null===(e=l.data)||void 0===e?void 0:e.some((e=>{var t;return null!=(null===(t=null==e?void 0:e.override)||void 0===t?void 0:t.transform)})),n=null!=r.data;return t||n}),[l,r]);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"transforms",tooltip:"Clear Transforms",children:[e("div",{className:"pt-1"}),e(H,{"data-testid":"clear-selected-transforms",onClick:async()=>{await i.clearSelectedTransforms(),null==n||n()},disabled:!c,children:"Clear selected transforms"}),e(H,{"data-testid":"clear-all-transforms",onClick:async()=>{await i.clearAllTransforms(),null==a||a()},children:"Clear all transforms"})]})})},VertexTransformNumericField=({bottomLabel:n,value:a,step:i,min:l,max:o,disabled:r,testId:c,onBlur:d,onInput:u,onChange:m})=>{const p=v.useRef(null),h=s(An),[f,g]=v.useState(!0);v.useEffect((()=>{var e;const t=null!=p.current&&Number.isNaN(p.current.valueAsNumber),n=f||t;null!=p.current&&n?p.current.value=null!==(e=null==a?void 0:a.toFixed(Number(h)))&&void 0!==e?e:"":g(!0)}),[a]);const b=v.useCallback((e=>{g(!1),null==m||m(e)}),[g,m]),w=v.useCallback((e=>{g(!0),null==d||d(e),null!=p.current&&null!=a&&(p.current.value=a.toFixed(Number(h)))}),[d,a,g]);return t("div",{children:[e("div",{className:"truncate rounded-md w-full",children:e("input",{ref:p,className:"w-full truncate border border-neutral-400 rounded-md px-2 py-1.5 hover:border-neutral-500 focus:border-neutral-500 focus:outline-none",type:"number",step:i,min:l,max:o,"data-testid":c,disabled:r,defaultValue:Number.isNaN(a)?"":null==a?void 0:a.toFixed(Number(h)),onBlur:w,onInput:u,onChange:b})}),null!=n&&e("div",{className:"flex justify-center items-center pointer-events-none text-neutral-500",children:e("span",{children:n})})]})},VertexTransformInputs=({onUpdateTransform:n})=>{const a=s(kn),i=s(fn),l=s(hn),o=i||l,r=s(vn),{transform:c,error:d,update:u}=useEditItemTransform(r),m=o?void 0:c,p=useDebouncedCallback((async e=>{await u(e),null==n||n(e)}),50);function updateTransform(e){return t=>{if(null!=m){const n=parseFloat(t.currentTarget.value);Number.isNaN(n)||null==p||p(Object.assign(Object.assign({},m),e(n,m)))}}}function updatePosition(e){return updateTransform(((t,n)=>({position:Object.assign(Object.assign({},n.position),e(t))})))}function updateRotation(e){return updateTransform(((t,n)=>({rotation:Object.assign(Object.assign({},n.rotation),e(t))})))}function updateScale(){return updateTransform((e=>e>0?{scale:e}:{}))}function updateToDefaultValueIfInvalid(e,t){return n=>{const a=parseFloat(n.currentTarget.value),i=undefined;(isNaN(a)||!!(null==t?void 0:t(a)))&&null!=m&&p(Le.defaults(e,m))}}return t("div",{children:[t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Position"}),t("div",{className:"flex flex-wrap w-full gap-2",children:[t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"X"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-x",value:null!=m?m.position.x:void 0,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({x:e}))),onBlur:updateToDefaultValueIfInvalid({position:{x:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Y"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-y",value:null==m?void 0:m.position.y,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({y:e}))),onBlur:updateToDefaultValueIfInvalid({position:{y:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Z"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-z",value:null==m?void 0:m.position.z,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({z:e}))),onBlur:updateToDefaultValueIfInvalid({position:{z:0}})})})]})]})]}),t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Rotation"}),t("div",{className:"flex flex-wrap w-full gap-2",children:[t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"X"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-x",value:null==m?void 0:m.rotation.x,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({x:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{x:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Y"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-y",value:null==m?void 0:m.rotation.y,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({y:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{y:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Z"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-z",value:null==m?void 0:m.rotation.z,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({z:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{z:0}})})})]})]})]}),t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Scale"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"scale",value:null==m?void 0:m.scale,step:.1,min:.1,disabled:null==m,onChange:updateScale(),onBlur:updateToDefaultValueIfInvalid({scale:1},(e=>e<=0))})}),o&&e("div",{className:"bg-orange-100 rounded px-3 py-2 mt-6 mb-2",children:"Input based part transformation is not yet supported for multiple parts."}),null!=d&&e("div",{className:"bg-red-100 rounded px-3 py-2 mt-6 mb-2",children:"There was a problem retrieving data. Try selecting a different part."})]})]})},VertexTransformManipulatorToggle=({onToggleTransformsManipulator:t})=>{const n=useTransformActions(),a=s(Nn),i=c(Bn);return e(_,{className:"flex items-center","data-testid":"transform-widget-toggle",variant:"switch",checked:a,onValueChanged:async()=>{a?(n.disableTransformWidget(),null==t||t(!1)):(i("world"),await n.enableTransformWidget(),null==t||t(!0))}})};function VertexTransformControls({onToggleTransformsManipulator:a,onUpdateTransform:i}){return t(n,{children:[t("div",{className:"flex items-center py-3",children:[e(VertexTransformManipulatorToggle,{onToggleTransformsManipulator:a}),e("span",{className:"pl-4 text-[0.8125rem] text-neutral-700",children:"Enable manipulator"})]}),e(VertexTransformInputs,{onUpdateTransform:i})]})}function VertexTransformPanelSection({onClearTransforms:n,onClearAllTransforms:a,onToggleTransformsManipulator:i,onUpdateTransform:l}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Manual Part Transforms",e(VertexTransformClear,{onClear:n,onClearAll:a})]}),children:e(VertexTransformControls,{onToggleTransformsManipulator:i,onUpdateTransform:l})})}function DefaultTransformsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexTransformPanelSection,{})})}const Ha="Appearance",Fa="Settings",Ua="Transforms",ViewerRightPanelHeader=({additionalHeaderMap:t})=>{const n=undefined,a=getHeading(s(Da),t);return e("div",{className:"flex flex-col w-full items-center z-overlay pointer-events-none md:pointer-events-auto py-3 px-4 border-b border-neutral-300",children:e("div",{className:"items-center w-full leading-6 text-md align-center font-medium text-neutral-800",children:a})})};function getHeading(e,t={}){switch(e){case"appearance":return Ha;case"settings":return Fa;case"transforms":return Ua;default:const n=null!=e?t[e]:void 0;return null!=n?n:"None"}}function VertexViewerRightOpenedPanel({children:a}){const i=s(Da),l=v.useMemo((()=>filterChildElements(a,CustomPanelContent)),[a]),o=v.useMemo((()=>l.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.props.panelName]:t.props.panelTitle})),{})),[l]),r=v.useMemo((()=>["appearance","settings","transforms",...l.map((e=>e.props.panelName))]),[l]);return e(n,{children:null!=i&&r.includes(i)&&t(VertexResizableContent,{displayShadow:!0,heading:e(ViewerRightPanelHeader,{additionalHeaderMap:o}),placement:"right",children:["appearance"===i&&e(DefaultAppearancePanel,{}),"transforms"===i&&e(DefaultTransformsPanel,{}),"settings"===i&&e(DefaultSettingsPanel,{}),a]})})}function CustomPanelContent({panelName:t,children:a}){const i=s(Da);return e(n,{children:i===t&&a})}function Sidebar({children:t}){return e("div",{className:"pointer-events-auto flex flex-col items-center w-full border-neutral-300 py-2",children:t})}function SidebarIcon({name:n,iconName:a,active:i,responsive:l,disabled:o,content:s,tooltipPlacement:r,children:c,onSelect:d,onDeselect:u}){return e("div",{className:Nt({"text-[var(--vertex-ui-blue-700)]":i===n&&!o,"text-neutral-700 hover:text-neutral-800":i!==n&&!o,"cursor-pointer hover:bg-neutral-200":!o,"text-neutral-400":o,"rounded-full md:p-3":l,"p-3":!l&&null==c,"px-3 py-1":null!=c}),"data-testid":`${n}-sidebar-panel`,onClick:()=>{o||(i===n?u():d())},children:t(V,{placement:null!=r?r:void 0,content:v.isValidElement(s)?void 0:s,children:[e("div",{slot:"content",children:s}),e("div",{className:"flex flex-col",children:null!=c?c:e(D,{name:a})})]})})}function VertexViewerRightSidebar({children:n}){const a=usePanelActions(),i=s(Da);return e("div",{className:"flex flex-col flex-shrink-0 items-center relative border-neutral-300 border-l bg-white h-full top-0 min-w-12 w-12",children:t(Sidebar,{children:[n,e(SidebarIcon,{name:"appearance",active:i,iconName:"adjustments",tooltipPlacement:"right",content:"Appearance",onSelect:()=>{a.openPrimary("appearance","right")},onDeselect:()=>a.closePrimary("right")}),e(SidebarIcon,{name:"transforms",active:i,iconName:"show-only-nearby",tooltipPlacement:"right",content:"Transforms",onSelect:()=>{a.openPrimary("transforms","right")},onDeselect:()=>a.closePrimary("right")}),e(SidebarIcon,{name:"settings",active:i,iconName:"gear",tooltipPlacement:"right",content:"Settings",onSelect:()=>{a.openPrimary("settings","right")},onDeselect:()=>a.closePrimary("right")})]})})}function CustomPanelIcon(t){const n=usePanelActions(),a=s(Da),{panelName:i,tooltipContent:l,iconName:o}=t,r=__rest(t,["panelName","tooltipContent","iconName"]);if(null==o&&null==r.children)throw new Error('CustomPanelIcon must contain either a Vertex "iconName" or custom "children"');return e(SidebarIcon,Object.assign({},r,{name:i,iconName:null!=o?o:"help",active:a,content:l,onSelect:()=>{n.openPrimary(t.panelName,"right")},onDeselect:()=>{n.closePrimary("right")}}))}VertexViewerRightOpenedPanel.CustomPanelContent=CustomPanelContent,VertexViewerRightSidebar.CustomPanelIcon=CustomPanelIcon;const VertexPopupButton=a=>{var{open:i,children:l}=a,o=__rest(a,["open","children"]);const s=l.find((e=>e.type===Anchor)),r=l.filter((e=>e.type!==Anchor));return null==s?e(n,{}):t(q,Object.assign({className:"flex",placement:"top",backdrop:!1,open:asBooleanAttribute(i)},o,{children:[s,e("div",{className:Nt("flex mb-1.5",{hidden:!i}),"data-testid":"align-plane-popover-menu",children:r})]}))},Anchor=({tooltipContent:t,children:n})=>e("div",{slot:"anchor",children:e(V,{className:"cursor-pointer",content:t,children:n})});function VertexViewerCrossSectionAlignmentPopoverMenu(){const n=useCrossSectioningActions(),a=s(gt),i=s(st),getBaseIcon=()=>`align-to-${null==i?void 0:i.mode}`;return useStackKeyBinding({id:"CrossSectionAlignment",keyBind:"Escape",fn:n.cancelCurrentHit,addPredicate:()=>{var e;return null!==(e=null==i?void 0:i.hitPending)&&void 0!==e&&e},cancelPredicate:()=>!(null==i?void 0:i.hitPending)},[null==i?void 0:i.hitPending]),t(VertexPopupButton,{"data-testid":"section-alignment-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(a),onDismissed:n.closeAlignmentTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Section Alignment",children:e(L,{"data-testid":"section-alignment-icon-button",iconName:getBaseIcon(),iconColor:"secondary",onClick:a?n.closeAlignmentTools:n.openAlignmentTools,children:e(D,{"data-testid":"section-alignment-icon-chevron",name:"chevron-up",size:"sm"})})}),t(ue,{direction:"vertical",className:"flex justify-evenly items-center py-1 my-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(L,{iconColor:"secondary",onClick:()=>n.updateAlignment("global"),className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2","data-testid":"section-alignment-align-global",iconName:"align-to-global",variant:"plain",children:e("div",{className:"text-base ml-2",children:"Align to Global"})}),e(L,{iconColor:"secondary",onClick:()=>n.updateAlignment("surface"),className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2","data-testid":"section-alignment-align-surface",iconName:"align-to-surface",variant:"plain",children:e("div",{className:"text-base ml-2",children:"Align to Surface"})})]})]})}function VertexViewerCrossSectionAxisPopoverMenu(){const n=useCrossSectioningActions(),a=s(vt),i=s(ot),l=p(ut),o=v.useMemo((()=>{const e=i.length>0&&"hasValue"===l.state?axis(i[0],xAxis(l.contents),yAxis(l.contents),zAxis(l.contents)):"x";return null!=e?`axis-${e}`:"axis-x"}),[l.state,l.contents,i]);return t(VertexPopupButton,{"data-testid":"align-plane-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(a),onDismissed:n.closeAxisTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Align Plane",children:e(L,{onClick:a?n.closeAxisTools:n.openAxisTools,iconName:o,"data-testid":"align-plane-icon",iconColor:"secondary",children:e(D,{"data-testid":"align-plane-icon-chevron",name:"chevron-up",size:"sm"})})}),t(ue,{direction:"vertical",className:"flex justify-evenly items-center py-1 my-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(L,{"data-testid":"align-plane-x-axis-button",className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",onClick:()=>n.updateAxis("x"),variant:"plain",iconColor:"secondary",iconName:"axis-x",children:e("div",{className:"text-base ml-2",children:"X-axis Plane"})}),e(L,{className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",variant:"plain",iconColor:"secondary",iconName:"axis-y","data-testid":"align-plane-y-axis-button",onClick:()=>n.updateAxis("y"),children:e("div",{className:"text-base ml-2",children:"Y-axis Plane"})}),e(L,{"data-testid":"align-plane-z-axis-button",className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",onClick:()=>n.updateAxis("z"),variant:"plain",iconColor:"secondary",iconName:"axis-z",children:e("div",{className:"text-base ml-2",children:"Z-axis Plane"})})]})]})}function VertexViewerCrossSectionOffsetStepper({offset:n,onOffsetChange:a}){const i=s(kn),l=s(An),[o,r]=v.useState(convertTo(n,i));v.useEffect((()=>{r(convertTo(n,i))}),[i,n]);const c=createDistanceFormatter(i,parseInt(l,10)),handleIncrementalUpdate=e=>{const t=convertFrom(o+e,i);a(t)},d=undefined,handleBlur=()=>{a(convertFrom(o,i))};return e(V,{content:"Plane Offset",children:e("form",{"data-testid":"cross-section-stepper-form",onSubmit:e=>{e.preventDefault(),a(convertFrom(o,i))},children:t(Y,{"data-testid":"cross-section-stepper-input",className:"viewer-toolbar-input w-32 border-none ring-0 bg-white",type:"text",value:c(parseFloat(n.toFixed(3))),onInputInput:e=>{r(null!=e.detail.value?parseFloat(e.detail.value):n)},onBlur:handleBlur,children:[e("div",{"data-testid":"cross-section-stepper-decrement",className:"py-1 cursor-pointer",slot:"left",onClick:()=>handleIncrementalUpdate(-1),children:e(D,{name:"chevron-left",size:"sm"})}),e("div",{"data-testid":"cross-section-stepper-increment",className:"py-1 cursor-pointer",slot:"right",onClick:()=>handleIncrementalUpdate(1),children:e(D,{name:"chevron-right",size:"sm"})})]})})})}VertexPopupButton.Anchor=Anchor;const Wa=400;function VertexViewerCrossSectionPopupMenu(){const n=useCrossSectioningActions(),a=s(ft),i=p(pt),l=p(ht),o=v.useRef(),r=v.useMemo((()=>"hasValue"===i.state?i.contents:nt),[i.state,i.contents]),c=v.useMemo((()=>"hasValue"===l.state?l.contents:0),[l.state,l.contents]),handleCrossSectionValueChange=e=>{clearTimeout(o.current),o.current=window.setTimeout((()=>{n.endInteraction()}),Wa),n.beginInteraction(),n.updatePlanes(e)};return t(VertexPopupButton,{"data-testid":"cross-section-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(a),onDismissed:n.closeAdditionalTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Section Tools",children:e("div",{className:"-ml-px py-1.5",children:e(D,{"data-testid":"cross-section-popover-icon",name:"chevron-up",size:"sm",onClick:a?n.closeAdditionalTools:n.openAdditionalTools})})}),t(ue,{className:"relative bottom-3 flex justify-evenly items-center p-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(VertexViewerCrossSectionAlignmentPopoverMenu,{}),e(V,{className:"w-auto",content:"Reverse",children:e(L,{iconName:"flip","data-testid":"viewer-toolbar-flip-button",onClick:n.flipPlanes,iconColor:"secondary"})}),e(V,{className:"w-auto",content:"Align View to Plane",children:e(L,{"data-testid":"viewer-toolbar-align-view-to-plane-button",iconName:"align-view-to-plane",onClick:n.alignViewToPlane,iconColor:"secondary"})}),e(VertexToolbarDivider,{}),e(VertexViewerCrossSectionAxisPopoverMenu,{}),e("div",{className:"w-52 mx-2",children:e(VertexSlider,{value:c,defaultValue:r.default,disabled:asBooleanAttribute("hasValue"!==i.state),min:r.min,max:r.max,step:.01,onChange:handleCrossSectionValueChange})}),e("div",{className:"px-4",children:e(VertexViewerCrossSectionOffsetStepper,{offset:"hasValue"===l.state?l.contents:0,onOffsetChange:handleCrossSectionValueChange})})]})]})}const VertexViewerCrossSectionButton=()=>{const a=useCrossSectioningActions(),i=s(at);return t(n,{children:[e(V,{content:i?"Hide Section":"Show Section",children:e(L,{"data-testid":"viewer-toolbar-cross-section-button",iconName:"cross-section",iconColor:i?"primary":"secondary",onClick:()=>i?a.disable():a.enable()})}),e(VertexViewerCrossSectionPopupMenu,{})]})},VertexFitAllButton=()=>{const t=s(He);return e(V,{content:"Fit All",children:e(L,{iconName:"fit-all",iconColor:"secondary","data-testid":"viewer-toolbar-fit-all-button",onClick:async()=>{const e=await(null==t?void 0:t.scene());await(null==e?void 0:e.camera().viewAll().render({animation:{milliseconds:500}}))}})})},VertexPanButton=()=>{const t=s(He),n=s(Ue),[a,i]=r(Ge),[l,o]=r(We);return v.useEffect((()=>{null!=t&&n&&o(t.getBaseInteractionHandler())}),[t,n,o]),e(V,{content:"Pan",children:e(L,{iconName:"pan",iconColor:"pan"===a?"primary":"secondary","data-testid":"viewer-toolbar-pan-button",onClick:async()=>{if(i("pan"),null!=l){const e=await l;null==e||e.setPrimaryInteractionType("pan")}}})})},VertexRotateButton=()=>{const t=s(He),n=s(Ue),[a,i]=r(Ge),[l,o]=r(We);return v.useEffect((()=>{null!=t&&n&&o(t.getBaseInteractionHandler())}),[t,n,o]),e(V,{content:"Rotate",children:e(L,{iconName:"rotate",iconColor:"rotate"===a?"primary":"secondary","data-testid":"viewer-toolbar-rotate-button",onClick:async()=>{if(i("rotate"),null!=l){const e=await l;null==e||e.setPrimaryInteractionType("rotate")}}})})},VertexZoomButton=()=>{const t=s(He),n=s(Ue),[a,i]=r(Ge),[l,o]=r(We);return v.useEffect((()=>{null!=t&&n&&o(t.getBaseInteractionHandler())}),[t,n,o]),e(V,{content:"Zoom",children:e(L,{iconName:"zoom",iconColor:"zoom"===a?"primary":"secondary","data-testid":"viewer-toolbar-zoom-button",onClick:async()=>{if(i("zoom"),null!=l){const e=await l;null==e||e.setPrimaryInteractionType("zoom")}}})})},DefaultToolbar=()=>e(me,{placement:"bottom-center",children:t(ue,{className:"p-1 border border-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(VertexRotateButton,{}),e(VertexPanButton,{}),e(VertexZoomButton,{}),e(VertexFitAllButton,{}),e(VertexToolbarDivider,{}),e(VertexBoxSelectionButton,{}),e(VertexToolbarDivider,{}),e(VertexViewerCrossSectionButton,{}),e(VertexToolbarDivider,{}),e(VertexPointToPointMeasurementTool,{}),e(VertexPreciseMeasurementTool,{})]})}),VertexToolbar=({children:t})=>{const n=undefined;return e(me,{placement:"bottom-center",children:null!=t&&!1!==t?e(ue,{className:"p-1 border border-neutral-200 rounded bg-neutral-100 opacity-95",children:t}):e(DefaultToolbar,{})})};function VertexTransformWidget({transformWidgetElement:t,supportUndo:a,onPositionChange:i,onRotationChange:l}){const o=useTransformActions(),r=s(Ln),c=s(Nn),d=s(On),u=s(Vn),m=p(Mn),h=s(kn),f=s(An),g=v.useMemo((()=>"hasValue"===m.state?m.contents:u),[m,u]),b=v.useMemo((()=>{const e=undefined;return c&&(null!=g||r)}),[c,g,r]);return e(n,{children:b&&e(pe,{id:"transform-widget","data-testid":"viewer-transform-widget",ref:t,position:d,rotation:null!=d?g:void 0,decimalPlaces:parseInt(f,10),distanceUnit:toUnitType(h),EXPERIMENTAL_undoKeybindings:null==a||a,onInteractionStarted:()=>{o.disableSelectionSync(),o.setIsInteractivelyTransforming(!0)},onInteractionEnded:()=>{o.invalidateTransforms(),o.setIsInteractivelyTransforming(!1)},onPositionChanged:async e=>{await o.setTransformWidgetPosition(e.detail),null==i||i(e.detail)},onRotationChanged:e=>{o.setTransformWidgetOrientation(e.detail),null==l||l(e.detail)}})})}const VertexViewerSceneReset=({onReset:t})=>{const n=useCrossSectioningActions(),a=useSelectionActions(),i=useTransformActions(),l=useViewerSceneActions(),o=undefined;return e(V,{content:"Reset View",children:e(L,{iconName:"reset",className:"flex bg-white opacity-70 hover:opacity-100 text-neutral-900 hover:text-neutral-700 hover:bg-neutral-200 rounded p-1 cursor-pointer","data-testid":"viewer-reset-tool-button",onClick:async()=>{await n.disable(),await a.resetSelectionState(),i.clearTransformWidgetPosition(),await i.invalidateTransforms(),null==t||t(),await l.reset()},variant:"plain"})})};function useViewerFrameActions(){const e=useTransformActions();return{frameDrawn:useActionCallback((({set:t,snapshot:n})=>async a=>{const i=await n.getPromise(bn);t(qe,a.detail.scene),t(bn,a.detail.scene.sceneViewSummary.selectedVisibleSummary),t(yn,i);const l=undefined;await n.getPromise(Nn)&&await e.syncToSelection()}))}}const VertexBoxSelectionTool=()=>{const{element:t,callback:n}=useCallbackRef(),a=useBoxSelectionActions(),i=useTransformActions(),l=s(Ht);return g.useEffect((()=>{const e=whenComponentReady(t,(()=>{var e;return[null===(e=null==t?void 0:t.model)||void 0===e?void 0:e.onDragComplete((()=>{"clearAndSelect"===l&&(i.clearTransformWidgetOrientation(),i.clearTransformWidgetPosition(),i.enableSelectionSync())}))]}));return()=>{null==e||e.then((e=>{null==e||e.forEach((e=>null==e?void 0:e.dispose()))}))}}),[t,l]),useApplyKeyBinding({keyBind:"Shift",fn:g.useCallback((()=>a.setOperationType("select")),[]),off:g.useCallback((()=>a.setOperationType("clearAndSelect")),[])}),e(he,{ref:n,"data-testid":"viewer-box-query-tool",operationType:l})};function VertexViewerCameraTypeMenu({open:n,onOpen:a,onDismiss:i,onCameraTypeChange:l}){const o=useViewerCameraActions(),r=s(Ze);return t(U,{"data-testid":"camera-types-popover",className:"flex",placement:"bottom-end",open:asBooleanAttribute(n),onMenuClosed:i,children:[e("div",{slot:"anchor",children:e("div",{className:Nt("flex bg-white hover:opacity-100 hover:text-neutral-700 hover:bg-neutral-200 rounded",{"opacity-70 text-neutral-900":!n,"opacity-100 text-neutral-700 bg-neutral-200":n}),children:e(V,{content:"Change View",children:e(L,{"data-testid":"set-camera-mode-option",className:"p-1 cursor-pointer",variant:"plain",onClick:a,iconName:"orthographic"===r?"cube-orthographic":"cube-perspective",children:e(D,{"data-testid":"change-camera-type-icon-button",name:"chevron-down",size:"sm"})})})})}),t("div",{className:"w-36",children:[e("div",{className:"pt-1"}),t(H,{"data-testid":"set-perspective-view",onClick:()=>{o.updateCameraType("perspective"),null==l||l("perspective")},children:[e(D,{slot:"icon","data-testid":"set-perspective-view-icon",name:"cube-perspective",size:"sm",className:Nt({"text-[var(--vertex-ui-blue-700)]":"perspective"===r})}),e("div",{className:Nt("ml-2 items-center",{"text-[var(--vertex-ui-blue-700)]":"perspective"===r}),children:"Perspective"})]}),t(H,{"data-testid":"set-orthographic-view",onClick:()=>{o.updateCameraType("orthographic"),null==l||l("orthographic")},children:[e(D,{slot:"icon","data-testid":"set-orthographic-view-icon",name:"cube-orthographic",size:"sm",className:Nt({"text-[var(--vertex-ui-blue-700)]":"orthographic"===r})}),e("div",{className:Nt("ml-2 items-center",{"text-[var(--vertex-ui-blue-700)]":"orthographic"===r}),children:"Orthographic"})]})]})]})}const VertexViewerViewCube=n=>{var{placement:a,children:i}=n,l=__rest(n,["placement","children"]);const o=Array.isArray(i)?i:[i],s=o.filter((e=>!v.isValidElement(e)||e.type!==fe)).filter((e=>null!=e&&!1!==e)),r=o.find((e=>v.isValidElement(e)&&e.type===fe)),[c,d]=v.useState(!1);return t(me,{direction:"vertical","data-testid":"view-cube-toolbar",placement:null!=a?a:"top-right",children:[null!=r?r:e(fe,Object.assign({className:"m-7"},l)),0===s.length?t("div",{className:"flex items-center justify-center mt-3 gap-1",children:[e(VertexViewerSceneReset,{}),e(VertexViewerCameraTypeMenu,{open:c,onDismiss:()=>d(!1),onOpen:()=>d(!0)})]}):e("div",{className:"mt-3",children:s})]})},VertexViewer=a=>{var{id:i,className:l,disableSelection:o,onTap:d,onLongpress:u,onFrameDrawn:m,onSceneReady:p,viewerRefCallback:h,children:f}=a,g=__rest(a,["id","className","disableSelection","onTap","onLongpress","onFrameDrawn","onSceneReady","viewerRefCallback","children"]);const b=s(wa),w=useRecoilRef({state:He}),C=useViewerCameraActions(),S=useHitActions(),k=useSelectionActions(),A=useViewerFrameActions(),[T,P]=r(Ue),E=s(Ze),N=s(st),O=s(Dt),I=c(Ke),[M,V]=r(Fe);v.useEffect((()=>{null!=i&&V(i)}),[i]);const L=s(ga),R=v.useMemo((()=>({opacity:L/100})),[L]),_=s(Mt),j=s(Vt),B=v.useMemo((()=>({color:_,width:j})),[_,j]),D=s(ia),H=s(ra),F=s(ca),U=s(da),W=v.useMemo((()=>({color:H,opacity:F/100,lineWidth:U})),[H,F,U]),G=s(Kt),K=null!=f&&!1!==f;return useKeyBindings(),useDefaultKeybindings(),t(ge,Object.assign({id:M,"data-testid":"vertex-viewer",ref:null!=h?h:w,className:Nt("flex w-full h-full",l,{"cursor-crosshair":N.hitPending}),style:{"--viewer-background":D},config:b,cameraType:T?E:void 0,onCameraTypeChanged:e=>{T&&C.updateCameraType(e.detail)},phantom:R,featureLines:B,selectionHighlighting:W,featureMaps:G?"final":void 0,onTap:e=>{const t=[...o?[]:[k.selectCurrentHit]];S.tap(e,...t),null==d||d(e)},onLongpress:e=>{S.longPress(e),null==u||u(e)},onFrameDrawn:e=>{A.frameDrawn(e),null==m||m(e)},onSceneReady:async e=>{var t;if(!T){P(!0);const n=await(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.scene());I(null==n?void 0:n.sceneViewId)}null==p||p(e)}},g,{children:[O&&e(VertexBoxSelectionTool,{}),K?f:t(n,{children:[e(VertexViewerViewCube,{}),e(VertexToolbar,{}),e(VertexViewerContextMenu,{})]})]}))};function toSdkConfig(e){return isOnlyNetworkConfig(e)?{network:e}:e}function isOnlyNetworkConfig(e){const t=undefined;return null!=e.renderingHost}const VertexViewerToolkitEventListener=({onHitStateChange:t,onSelectionStateChange:a})=>{const i=s(Wn),l=s(Kn);return v.useEffect((()=>{null==t||t(i)}),[i,t]),v.useEffect((()=>{null==a||a(l)}),[l,a]),e(n,{})},VertexViewerToolkitRoot=a=>{var{override:i,autoDefineCustomElements:l,children:o,config:s}=a,r=__rest(a,["override","autoDefineCustomElements","children","config"]);return v.useEffect((()=>{(null==l||l)&&(ye(),ve())}),[l]),e(f,{override:i,children:t(n,{children:[e(VertexViewerToolkitEventListener,Object.assign({},r)),e(VertexViewerToolkitRootConfig,{config:s,children:o})]})})},VertexViewerToolkitRootConfig=({config:t,children:a})=>{const i=c(wa);return v.useEffect((()=>{const e=null!=t?toSdkConfig(t):void 0;i(e)}),[t,i]),e(n,{children:a})};var Ga=Object.freeze({__proto__:null,get AssemblyFontFace(){return Ba}});export{Tt as CrossSection,Gn as Hits,Ga as SceneTree,$n as Selection,VertexApplicationMessages,VertexBoxSelectionButton,VertexContextMenu,VertexCrossSectionAppearanceColorPicker,VertexCrossSectionAppearanceControls,VertexCrossSectionAppearanceLineThicknessSlider,VertexCrossSectionAppearancePanelSection,VertexCrossSectionAppearanceReset,VertexDecimalPlaceSelector,VertexFeatureEdgesColorPicker,VertexFeatureEdgesControls,VertexFeatureEdgesPanelSection,VertexFeatureEdgesReset,VertexFeatureEdgesThicknessSlider,VertexFitAllButton,VertexFitSelectedMenuItem,VertexFlyToMenuItem,VertexGhostingControls,VertexGhostingPanelSection,VertexHideAllMenuItem,VertexHidePartMenuItem,VertexHideSelectedMenuItem,VertexLengthUnitSelector,VertexMaterialControls,VertexMaterialPanelSection,VertexMeasurementContextMenu,VertexMeasurementDetails,VertexPanButton,VertexPointToPointMeasurement,VertexPointToPointMeasurementTool,VertexPreciseMeasurement,VertexPreciseMeasurementTool,VertexResizableContent,VertexRotateButton,VertexSceneItemGhostingClear,VertexSceneItemGhostingOpacitySlider,VertexSceneItemGhostingToggle,VertexSceneItemMaterialClear,VertexSceneItemMaterialColorPicker,VertexSceneItemMaterialOpacitySlider,VertexSceneTree,VertexSceneTreeColumnPopover,VertexSceneTreeContextMenu,VertexSceneTreeHeader,VertexSceneTreeSearchBar,VertexSceneTreeSearchInformationForToolbar,VertexSceneTreeSearchOptionsPopover,VertexSceneTreeTableLayout,VertexSelectionHighlightingColorPicker,VertexSelectionHighlightingControls,VertexSelectionHighlightingLineThicknessSlider,VertexSelectionHighlightingOpacitySlider,VertexSelectionHighlightingPanelSection,VertexSelectionHighlightingReset,VertexShowAllMenuItem,VertexShowOnlyMenuItem,VertexShowOnlySelectedMenuItem,VertexToolbar,VertexToolbarDivider,VertexTransformClear,VertexTransformControls,VertexTransformInputs,VertexTransformManipulatorToggle,VertexTransformPanelSection,VertexTransformWidget,VertexUnitsControls,VertexUnitsPanelSection,VertexViewer,VertexViewerBackgroundColorPicker,VertexViewerBackgroundControls,VertexViewerBackgroundPanelSection,VertexViewerBackgroundReset,VertexViewerContextMenu,VertexViewerCrossSectionButton,VertexViewerRightOpenedPanel,VertexViewerRightSidebar,VertexViewerSceneReset,VertexViewerToolkitRoot,VertexViewerViewCube,VertexZoomButton};
19
19
  //# sourceMappingURL=bundle.esm.js.map