@ifc-lite/viewer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/LICENSE +373 -0
  2. package/components.json +22 -0
  3. package/dist/assets/arrow2_bg-BoXCojjR.wasm +0 -0
  4. package/dist/assets/geometry.worker-DpnHtNr3.ts +157 -0
  5. package/dist/assets/ifc_lite_wasm_bg-Cd3m3f2h.wasm +0 -0
  6. package/dist/assets/index-DKe9Oy-s.css +1 -0
  7. package/dist/assets/index-Dzz3WVwq.js +637 -0
  8. package/dist/ifc_lite_wasm_bg.wasm +0 -0
  9. package/dist/index.html +13 -0
  10. package/dist/web-ifc.wasm +0 -0
  11. package/index.html +12 -0
  12. package/package.json +52 -0
  13. package/postcss.config.js +6 -0
  14. package/public/ifc_lite_wasm_bg.wasm +0 -0
  15. package/public/web-ifc.wasm +0 -0
  16. package/src/App.tsx +13 -0
  17. package/src/components/Viewport.tsx +723 -0
  18. package/src/components/ui/button.tsx +58 -0
  19. package/src/components/ui/collapsible.tsx +11 -0
  20. package/src/components/ui/context-menu.tsx +174 -0
  21. package/src/components/ui/dropdown-menu.tsx +175 -0
  22. package/src/components/ui/input.tsx +49 -0
  23. package/src/components/ui/progress.tsx +26 -0
  24. package/src/components/ui/scroll-area.tsx +47 -0
  25. package/src/components/ui/separator.tsx +27 -0
  26. package/src/components/ui/tabs.tsx +56 -0
  27. package/src/components/ui/tooltip.tsx +31 -0
  28. package/src/components/viewer/AxisHelper.tsx +125 -0
  29. package/src/components/viewer/BoxSelectionOverlay.tsx +53 -0
  30. package/src/components/viewer/EntityContextMenu.tsx +220 -0
  31. package/src/components/viewer/HierarchyPanel.tsx +363 -0
  32. package/src/components/viewer/HoverTooltip.tsx +82 -0
  33. package/src/components/viewer/KeyboardShortcutsDialog.tsx +104 -0
  34. package/src/components/viewer/MainToolbar.tsx +441 -0
  35. package/src/components/viewer/PropertiesPanel.tsx +288 -0
  36. package/src/components/viewer/StatusBar.tsx +141 -0
  37. package/src/components/viewer/ToolOverlays.tsx +311 -0
  38. package/src/components/viewer/ViewCube.tsx +195 -0
  39. package/src/components/viewer/ViewerLayout.tsx +190 -0
  40. package/src/components/viewer/Viewport.tsx +1136 -0
  41. package/src/components/viewer/ViewportContainer.tsx +49 -0
  42. package/src/components/viewer/ViewportOverlays.tsx +185 -0
  43. package/src/hooks/useIfc.ts +168 -0
  44. package/src/hooks/useKeyboardShortcuts.ts +142 -0
  45. package/src/index.css +177 -0
  46. package/src/lib/utils.ts +45 -0
  47. package/src/main.tsx +18 -0
  48. package/src/store.ts +471 -0
  49. package/src/webgpu-types.d.ts +20 -0
  50. package/tailwind.config.js +72 -0
  51. package/tsconfig.json +16 -0
  52. package/vite.config.ts +45 -0
@@ -0,0 +1,637 @@
1
+ function uw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function Bu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var am={exports:{}},$a={},lm={exports:{}},ce={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Gs=Symbol.for("react.element"),dw=Symbol.for("react.portal"),fw=Symbol.for("react.fragment"),hw=Symbol.for("react.strict_mode"),pw=Symbol.for("react.profiler"),mw=Symbol.for("react.provider"),gw=Symbol.for("react.context"),yw=Symbol.for("react.forward_ref"),vw=Symbol.for("react.suspense"),xw=Symbol.for("react.memo"),ww=Symbol.for("react.lazy"),Pf=Symbol.iterator;function bw(e){return e===null||typeof e!="object"?null:(e=Pf&&e[Pf]||e["@@iterator"],typeof e=="function"?e:null)}var cm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},um=Object.assign,dm={};function No(e,t,n){this.props=e,this.context=t,this.refs=dm,this.updater=n||cm}No.prototype.isReactComponent={};No.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};No.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fm(){}fm.prototype=No.prototype;function $u(e,t,n){this.props=e,this.context=t,this.refs=dm,this.updater=n||cm}var Vu=$u.prototype=new fm;Vu.constructor=$u;um(Vu,No.prototype);Vu.isPureReactComponent=!0;var Mf=Array.isArray,hm=Object.prototype.hasOwnProperty,Uu={current:null},pm={key:!0,ref:!0,__self:!0,__source:!0};function mm(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)hm.call(t,r)&&!pm.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Gs,type:e,key:s,ref:i,props:o,_owner:Uu.current}}function Sw(e,t){return{$$typeof:Gs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Wu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gs}function Cw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Nf=/\/+/g;function zl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Cw(""+e.key):t.toString(36)}function Oi(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Gs:case dw:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+zl(i,0):r,Mf(o)?(n="",e!=null&&(n=e.replace(Nf,"$&/")+"/"),Oi(o,t,n,"",function(c){return c})):o!=null&&(Wu(o)&&(o=Sw(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(Nf,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",Mf(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+zl(s,a);i+=Oi(s,t,n,l,o)}else if(l=bw(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+zl(s,a++),i+=Oi(s,t,n,l,o);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function ci(e,t,n){if(e==null)return e;var r=[],o=0;return Oi(e,r,"","",function(s){return t.call(n,s,o++)}),r}function Ew(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ot={current:null},Di={transition:null},Iw={ReactCurrentDispatcher:ot,ReactCurrentBatchConfig:Di,ReactCurrentOwner:Uu};function gm(){throw Error("act(...) is not supported in production builds of React.")}ce.Children={map:ci,forEach:function(e,t,n){ci(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ci(e,function(){t++}),t},toArray:function(e){return ci(e,function(t){return t})||[]},only:function(e){if(!Wu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ce.Component=No;ce.Fragment=fw;ce.Profiler=pw;ce.PureComponent=$u;ce.StrictMode=hw;ce.Suspense=vw;ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Iw;ce.act=gm;ce.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=um({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=Uu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)hm.call(t,l)&&!pm.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Gs,type:e.type,key:o,ref:s,props:r,_owner:i}};ce.createContext=function(e){return e={$$typeof:gw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:mw,_context:e},e.Consumer=e};ce.createElement=mm;ce.createFactory=function(e){var t=mm.bind(null,e);return t.type=e,t};ce.createRef=function(){return{current:null}};ce.forwardRef=function(e){return{$$typeof:yw,render:e}};ce.isValidElement=Wu;ce.lazy=function(e){return{$$typeof:ww,_payload:{_status:-1,_result:e},_init:Ew}};ce.memo=function(e,t){return{$$typeof:xw,type:e,compare:t===void 0?null:t}};ce.startTransition=function(e){var t=Di.transition;Di.transition={};try{e()}finally{Di.transition=t}};ce.unstable_act=gm;ce.useCallback=function(e,t){return ot.current.useCallback(e,t)};ce.useContext=function(e){return ot.current.useContext(e)};ce.useDebugValue=function(){};ce.useDeferredValue=function(e){return ot.current.useDeferredValue(e)};ce.useEffect=function(e,t){return ot.current.useEffect(e,t)};ce.useId=function(){return ot.current.useId()};ce.useImperativeHandle=function(e,t,n){return ot.current.useImperativeHandle(e,t,n)};ce.useInsertionEffect=function(e,t){return ot.current.useInsertionEffect(e,t)};ce.useLayoutEffect=function(e,t){return ot.current.useLayoutEffect(e,t)};ce.useMemo=function(e,t){return ot.current.useMemo(e,t)};ce.useReducer=function(e,t,n){return ot.current.useReducer(e,t,n)};ce.useRef=function(e){return ot.current.useRef(e)};ce.useState=function(e){return ot.current.useState(e)};ce.useSyncExternalStore=function(e,t,n){return ot.current.useSyncExternalStore(e,t,n)};ce.useTransition=function(){return ot.current.useTransition()};ce.version="18.3.1";lm.exports=ce;var p=lm.exports;const rn=Bu(p),Hu=uw({__proto__:null,default:rn},[p]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var _w=p,kw=Symbol.for("react.element"),Rw=Symbol.for("react.fragment"),Pw=Object.prototype.hasOwnProperty,Mw=_w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Nw={key:!0,ref:!0,__self:!0,__source:!0};function ym(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Pw.call(t,r)&&!Nw.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:kw,type:e,key:s,ref:i,props:o,_owner:Mw.current}}$a.Fragment=Rw;$a.jsx=ym;$a.jsxs=ym;am.exports=$a;var d=am.exports,kc={},vm={exports:{}},It={},xm={exports:{}},wm={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(k,N){var U=k.length;k.push(N);e:for(;0<U;){var re=U-1>>>1,K=k[re];if(0<o(K,N))k[re]=N,k[U]=K,U=re;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var N=k[0],U=k.pop();if(U!==N){k[0]=U;e:for(var re=0,K=k.length,J=K>>>1;re<J;){var oe=2*(re+1)-1,de=k[oe],_e=oe+1,se=k[_e];if(0>o(de,U))_e<K&&0>o(se,de)?(k[re]=se,k[_e]=U,re=_e):(k[re]=de,k[oe]=U,re=oe);else if(_e<K&&0>o(se,U))k[re]=se,k[_e]=U,re=_e;else break e}}return N}function o(k,N){var U=k.sortIndex-N.sortIndex;return U!==0?U:k.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],c=[],u=1,f=null,h=3,y=!1,m=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(k){for(var N=n(c);N!==null;){if(N.callback===null)r(c);else if(N.startTime<=k)r(c),N.sortIndex=N.expirationTime,t(l,N);else break;N=n(c)}}function S(k){if(v=!1,w(k),!m)if(n(l)!==null)m=!0,O(C);else{var N=n(c);N!==null&&H(S,N.startTime-k)}}function C(k,N){m=!1,v&&(v=!1,g(I),I=-1),y=!0;var U=h;try{for(w(N),f=n(l);f!==null&&(!(f.expirationTime>N)||k&&!z());){var re=f.callback;if(typeof re=="function"){f.callback=null,h=f.priorityLevel;var K=re(f.expirationTime<=N);N=e.unstable_now(),typeof K=="function"?f.callback=K:f===n(l)&&r(l),w(N)}else r(l);f=n(l)}if(f!==null)var J=!0;else{var oe=n(c);oe!==null&&H(S,oe.startTime-N),J=!1}return J}finally{f=null,h=U,y=!1}}var _=!1,E=null,I=-1,M=5,R=-1;function z(){return!(e.unstable_now()-R<M)}function P(){if(E!==null){var k=e.unstable_now();R=k;var N=!0;try{N=E(!0,k)}finally{N?j():(_=!1,E=null)}}else _=!1}var j;if(typeof x=="function")j=function(){x(P)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,$=W.port2;W.port1.onmessage=P,j=function(){$.postMessage(null)}}else j=function(){b(P,0)};function O(k){E=k,_||(_=!0,j())}function H(k,N){I=b(function(){k(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_continueExecution=function(){m||y||(m=!0,O(C))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(k){switch(h){case 1:case 2:case 3:var N=3;break;default:N=h}var U=h;h=N;try{return k()}finally{h=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,N){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var U=h;h=k;try{return N()}finally{h=U}},e.unstable_scheduleCallback=function(k,N,U){var re=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?re+U:re):U=re,k){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=U+K,k={id:u++,callback:N,priorityLevel:k,startTime:U,expirationTime:K,sortIndex:-1},U>re?(k.sortIndex=U,t(c,k),n(l)===null&&k===n(c)&&(v?(g(I),I=-1):v=!0,H(S,U-re))):(k.sortIndex=K,t(l,k),m||y||(m=!0,O(C))),k},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(k){var N=h;return function(){var U=h;h=N;try{return k.apply(this,arguments)}finally{h=U}}}})(wm);xm.exports=wm;var Tw=xm.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var zw=p,Et=Tw;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var bm=new Set,vs={};function Or(e,t){vo(e,t),vo(e+"Capture",t)}function vo(e,t){for(vs[e]=t,e=0;e<t.length;e++)bm.add(t[e])}var kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=Object.prototype.hasOwnProperty,Aw=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Tf={},zf={};function jw(e){return Rc.call(zf,e)?!0:Rc.call(Tf,e)?!1:Aw.test(e)?zf[e]=!0:(Tf[e]=!0,!1)}function Lw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ow(e,t,n,r){if(t===null||typeof t>"u"||Lw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function st(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ye[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ye[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ye[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ye[e]=new st(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ye[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ye[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ye[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ye[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ye[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gu=/[\-:]([a-z])/g;function Yu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gu,Yu);Ye[t]=new st(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gu,Yu);Ye[t]=new st(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gu,Yu);Ye[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ye[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});Ye.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ye[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function qu(e,t,n,r){var o=Ye.hasOwnProperty(t)?Ye[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ow(t,n,o,r)&&(n=null),r||o===null?jw(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var zn=zw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ui=Symbol.for("react.element"),Qr=Symbol.for("react.portal"),Kr=Symbol.for("react.fragment"),Xu=Symbol.for("react.strict_mode"),Pc=Symbol.for("react.profiler"),Sm=Symbol.for("react.provider"),Cm=Symbol.for("react.context"),Qu=Symbol.for("react.forward_ref"),Mc=Symbol.for("react.suspense"),Nc=Symbol.for("react.suspense_list"),Ku=Symbol.for("react.memo"),$n=Symbol.for("react.lazy"),Em=Symbol.for("react.offscreen"),Af=Symbol.iterator;function $o(e){return e===null||typeof e!="object"?null:(e=Af&&e[Af]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Object.assign,Al;function Ko(e){if(Al===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Al=t&&t[1]||""}return`
34
+ `+Al+e}var jl=!1;function Ll(e,t){if(!e||jl)return"";jl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),i=o.length-1,a=s.length-1;1<=i&&0<=a&&o[i]!==s[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==s[a]){if(i!==1||a!==1)do if(i--,a--,0>a||o[i]!==s[a]){var l=`
37
+ `+o[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{jl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ko(e):""}function Dw(e){switch(e.tag){case 5:return Ko(e.type);case 16:return Ko("Lazy");case 13:return Ko("Suspense");case 19:return Ko("SuspenseList");case 0:case 2:case 15:return e=Ll(e.type,!1),e;case 11:return e=Ll(e.type.render,!1),e;case 1:return e=Ll(e.type,!0),e;default:return""}}function Tc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kr:return"Fragment";case Qr:return"Portal";case Pc:return"Profiler";case Xu:return"StrictMode";case Mc:return"Suspense";case Nc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Cm:return(e.displayName||"Context")+".Consumer";case Sm:return(e._context.displayName||"Context")+".Provider";case Qu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ku:return t=e.displayName||null,t!==null?t:Tc(e.type)||"Memo";case $n:t=e._payload,e=e._init;try{return Tc(e(t))}catch{}}return null}function Fw(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Tc(t);case 8:return t===Xu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function nr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Im(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bw(e){var t=Im(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function di(e){e._valueTracker||(e._valueTracker=Bw(e))}function _m(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Im(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ra(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function zc(e,t){var n=t.checked;return Te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=nr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function km(e,t){t=t.checked,t!=null&&qu(e,"checked",t,!1)}function Ac(e,t){km(e,t);var n=nr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?jc(e,t.type,n):t.hasOwnProperty("defaultValue")&&jc(e,t.type,nr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function jc(e,t,n){(t!=="number"||ra(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zo=Array.isArray;function co(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+nr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Lc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return Te({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Of(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(Zo(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:nr(n)}}function Rm(e,t){var n=nr(t.value),r=nr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Df(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Pm(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Oc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Pm(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var fi,Mm=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(fi=fi||document.createElement("div"),fi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=fi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ss={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$w=["Webkit","ms","Moz","O"];Object.keys(ss).forEach(function(e){$w.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ss[t]=ss[e]})});function Nm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ss.hasOwnProperty(e)&&ss[e]?(""+t).trim():t+"px"}function Tm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Nm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Vw=Te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dc(e,t){if(t){if(Vw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function Fc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Bc=null;function Zu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $c=null,uo=null,fo=null;function Ff(e){if(e=Xs(e)){if(typeof $c!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Ga(t),$c(e.stateNode,e.type,t))}}function zm(e){uo?fo?fo.push(e):fo=[e]:uo=e}function Am(){if(uo){var e=uo,t=fo;if(fo=uo=null,Ff(e),t)for(e=0;e<t.length;e++)Ff(t[e])}}function jm(e,t){return e(t)}function Lm(){}var Ol=!1;function Om(e,t,n){if(Ol)return e(t,n);Ol=!0;try{return jm(e,t,n)}finally{Ol=!1,(uo!==null||fo!==null)&&(Lm(),Am())}}function ws(e,t){var n=e.stateNode;if(n===null)return null;var r=Ga(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var Vc=!1;if(kn)try{var Vo={};Object.defineProperty(Vo,"passive",{get:function(){Vc=!0}}),window.addEventListener("test",Vo,Vo),window.removeEventListener("test",Vo,Vo)}catch{Vc=!1}function Uw(e,t,n,r,o,s,i,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var is=!1,oa=null,sa=!1,Uc=null,Ww={onError:function(e){is=!0,oa=e}};function Hw(e,t,n,r,o,s,i,a,l){is=!1,oa=null,Uw.apply(Ww,arguments)}function Gw(e,t,n,r,o,s,i,a,l){if(Hw.apply(this,arguments),is){if(is){var c=oa;is=!1,oa=null}else throw Error(B(198));sa||(sa=!0,Uc=c)}}function Dr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Dm(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Bf(e){if(Dr(e)!==e)throw Error(B(188))}function Yw(e){var t=e.alternate;if(!t){if(t=Dr(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return Bf(o),e;if(s===r)return Bf(o),t;s=s.sibling}throw Error(B(188))}if(n.return!==r.return)n=o,r=s;else{for(var i=!1,a=o.child;a;){if(a===n){i=!0,n=o,r=s;break}if(a===r){i=!0,r=o,n=s;break}a=a.sibling}if(!i){for(a=s.child;a;){if(a===n){i=!0,n=s,r=o;break}if(a===r){i=!0,r=s,n=o;break}a=a.sibling}if(!i)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function Fm(e){return e=Yw(e),e!==null?Bm(e):null}function Bm(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Bm(e);if(t!==null)return t;e=e.sibling}return null}var $m=Et.unstable_scheduleCallback,$f=Et.unstable_cancelCallback,qw=Et.unstable_shouldYield,Xw=Et.unstable_requestPaint,Le=Et.unstable_now,Qw=Et.unstable_getCurrentPriorityLevel,Ju=Et.unstable_ImmediatePriority,Vm=Et.unstable_UserBlockingPriority,ia=Et.unstable_NormalPriority,Kw=Et.unstable_LowPriority,Um=Et.unstable_IdlePriority,Va=null,cn=null;function Zw(e){if(cn&&typeof cn.onCommitFiberRoot=="function")try{cn.onCommitFiberRoot(Va,e,void 0,(e.current.flags&128)===128)}catch{}}var qt=Math.clz32?Math.clz32:t1,Jw=Math.log,e1=Math.LN2;function t1(e){return e>>>=0,e===0?32:31-(Jw(e)/e1|0)|0}var hi=64,pi=4194304;function Jo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function aa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~o;a!==0?r=Jo(a):(s&=i,s!==0&&(r=Jo(s)))}else i=n&~o,i!==0?r=Jo(i):s!==0&&(r=Jo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-qt(t),o=1<<n,r|=e[n],t&=~o;return r}function n1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function r1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-qt(s),a=1<<i,l=o[i];l===-1?(!(a&n)||a&r)&&(o[i]=n1(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Wc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Wm(){var e=hi;return hi<<=1,!(hi&4194240)&&(hi=64),e}function Dl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ys(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qt(t),e[t]=n}function o1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-qt(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function ed(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var pe=0;function Hm(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Gm,td,Ym,qm,Xm,Hc=!1,mi=[],qn=null,Xn=null,Qn=null,bs=new Map,Ss=new Map,Wn=[],s1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Vf(e,t){switch(e){case"focusin":case"focusout":qn=null;break;case"dragenter":case"dragleave":Xn=null;break;case"mouseover":case"mouseout":Qn=null;break;case"pointerover":case"pointerout":bs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ss.delete(t.pointerId)}}function Uo(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=Xs(t),t!==null&&td(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function i1(e,t,n,r,o){switch(t){case"focusin":return qn=Uo(qn,e,t,n,r,o),!0;case"dragenter":return Xn=Uo(Xn,e,t,n,r,o),!0;case"mouseover":return Qn=Uo(Qn,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return bs.set(s,Uo(bs.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,Ss.set(s,Uo(Ss.get(s)||null,e,t,n,r,o)),!0}return!1}function Qm(e){var t=br(e.target);if(t!==null){var n=Dr(t);if(n!==null){if(t=n.tag,t===13){if(t=Dm(n),t!==null){e.blockedOn=t,Xm(e.priority,function(){Ym(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Gc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Bc=r,n.target.dispatchEvent(r),Bc=null}else return t=Xs(n),t!==null&&td(t),e.blockedOn=n,!1;t.shift()}return!0}function Uf(e,t,n){Fi(e)&&n.delete(t)}function a1(){Hc=!1,qn!==null&&Fi(qn)&&(qn=null),Xn!==null&&Fi(Xn)&&(Xn=null),Qn!==null&&Fi(Qn)&&(Qn=null),bs.forEach(Uf),Ss.forEach(Uf)}function Wo(e,t){e.blockedOn===t&&(e.blockedOn=null,Hc||(Hc=!0,Et.unstable_scheduleCallback(Et.unstable_NormalPriority,a1)))}function Cs(e){function t(o){return Wo(o,e)}if(0<mi.length){Wo(mi[0],e);for(var n=1;n<mi.length;n++){var r=mi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(qn!==null&&Wo(qn,e),Xn!==null&&Wo(Xn,e),Qn!==null&&Wo(Qn,e),bs.forEach(t),Ss.forEach(t),n=0;n<Wn.length;n++)r=Wn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wn.length&&(n=Wn[0],n.blockedOn===null);)Qm(n),n.blockedOn===null&&Wn.shift()}var ho=zn.ReactCurrentBatchConfig,la=!0;function l1(e,t,n,r){var o=pe,s=ho.transition;ho.transition=null;try{pe=1,nd(e,t,n,r)}finally{pe=o,ho.transition=s}}function c1(e,t,n,r){var o=pe,s=ho.transition;ho.transition=null;try{pe=4,nd(e,t,n,r)}finally{pe=o,ho.transition=s}}function nd(e,t,n,r){if(la){var o=Gc(e,t,n,r);if(o===null)ql(e,t,r,ca,n),Vf(e,r);else if(i1(o,e,t,n,r))r.stopPropagation();else if(Vf(e,r),t&4&&-1<s1.indexOf(e)){for(;o!==null;){var s=Xs(o);if(s!==null&&Gm(s),s=Gc(e,t,n,r),s===null&&ql(e,t,r,ca,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else ql(e,t,r,null,n)}}var ca=null;function Gc(e,t,n,r){if(ca=null,e=Zu(r),e=br(e),e!==null)if(t=Dr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Dm(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ca=e,null}function Km(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qw()){case Ju:return 1;case Vm:return 4;case ia:case Kw:return 16;case Um:return 536870912;default:return 16}default:return 16}}var Gn=null,rd=null,Bi=null;function Zm(){if(Bi)return Bi;var e,t=rd,n=t.length,r,o="value"in Gn?Gn.value:Gn.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[s-r];r++);return Bi=o.slice(e,1<r?1-r:void 0)}function $i(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function gi(){return!0}function Wf(){return!1}function _t(e){function t(n,r,o,s,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?gi:Wf,this.isPropagationStopped=Wf,this}return Te(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=gi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=gi)},persist:function(){},isPersistent:gi}),t}var To={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},od=_t(To),qs=Te({},To,{view:0,detail:0}),u1=_t(qs),Fl,Bl,Ho,Ua=Te({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ho&&(Ho&&e.type==="mousemove"?(Fl=e.screenX-Ho.screenX,Bl=e.screenY-Ho.screenY):Bl=Fl=0,Ho=e),Fl)},movementY:function(e){return"movementY"in e?e.movementY:Bl}}),Hf=_t(Ua),d1=Te({},Ua,{dataTransfer:0}),f1=_t(d1),h1=Te({},qs,{relatedTarget:0}),$l=_t(h1),p1=Te({},To,{animationName:0,elapsedTime:0,pseudoElement:0}),m1=_t(p1),g1=Te({},To,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),y1=_t(g1),v1=Te({},To,{data:0}),Gf=_t(v1),x1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},b1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function S1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=b1[e])?!!t[e]:!1}function sd(){return S1}var C1=Te({},qs,{key:function(e){if(e.key){var t=x1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$i(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?w1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sd,charCode:function(e){return e.type==="keypress"?$i(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$i(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),E1=_t(C1),I1=Te({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yf=_t(I1),_1=Te({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sd}),k1=_t(_1),R1=Te({},To,{propertyName:0,elapsedTime:0,pseudoElement:0}),P1=_t(R1),M1=Te({},Ua,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),N1=_t(M1),T1=[9,13,27,32],id=kn&&"CompositionEvent"in window,as=null;kn&&"documentMode"in document&&(as=document.documentMode);var z1=kn&&"TextEvent"in window&&!as,Jm=kn&&(!id||as&&8<as&&11>=as),qf=" ",Xf=!1;function eg(e,t){switch(e){case"keyup":return T1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zr=!1;function A1(e,t){switch(e){case"compositionend":return tg(t);case"keypress":return t.which!==32?null:(Xf=!0,qf);case"textInput":return e=t.data,e===qf&&Xf?null:e;default:return null}}function j1(e,t){if(Zr)return e==="compositionend"||!id&&eg(e,t)?(e=Zm(),Bi=rd=Gn=null,Zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Jm&&t.locale!=="ko"?null:t.data;default:return null}}var L1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!L1[e.type]:t==="textarea"}function ng(e,t,n,r){zm(r),t=ua(t,"onChange"),0<t.length&&(n=new od("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ls=null,Es=null;function O1(e){hg(e,0)}function Wa(e){var t=to(e);if(_m(t))return e}function D1(e,t){if(e==="change")return t}var rg=!1;if(kn){var Vl;if(kn){var Ul="oninput"in document;if(!Ul){var Kf=document.createElement("div");Kf.setAttribute("oninput","return;"),Ul=typeof Kf.oninput=="function"}Vl=Ul}else Vl=!1;rg=Vl&&(!document.documentMode||9<document.documentMode)}function Zf(){ls&&(ls.detachEvent("onpropertychange",og),Es=ls=null)}function og(e){if(e.propertyName==="value"&&Wa(Es)){var t=[];ng(t,Es,e,Zu(e)),Om(O1,t)}}function F1(e,t,n){e==="focusin"?(Zf(),ls=t,Es=n,ls.attachEvent("onpropertychange",og)):e==="focusout"&&Zf()}function B1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wa(Es)}function $1(e,t){if(e==="click")return Wa(t)}function V1(e,t){if(e==="input"||e==="change")return Wa(t)}function U1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qt=typeof Object.is=="function"?Object.is:U1;function Is(e,t){if(Qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Rc.call(t,o)||!Qt(e[o],t[o]))return!1}return!0}function Jf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eh(e,t){var n=Jf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Jf(n)}}function sg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ig(){for(var e=window,t=ra();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ra(e.document)}return t}function ad(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function W1(e){var t=ig(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&sg(n.ownerDocument.documentElement,n)){if(r!==null&&ad(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=eh(n,s);var i=eh(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var H1=kn&&"documentMode"in document&&11>=document.documentMode,Jr=null,Yc=null,cs=null,qc=!1;function th(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qc||Jr==null||Jr!==ra(r)||(r=Jr,"selectionStart"in r&&ad(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),cs&&Is(cs,r)||(cs=r,r=ua(Yc,"onSelect"),0<r.length&&(t=new od("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function yi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var eo={animationend:yi("Animation","AnimationEnd"),animationiteration:yi("Animation","AnimationIteration"),animationstart:yi("Animation","AnimationStart"),transitionend:yi("Transition","TransitionEnd")},Wl={},ag={};kn&&(ag=document.createElement("div").style,"AnimationEvent"in window||(delete eo.animationend.animation,delete eo.animationiteration.animation,delete eo.animationstart.animation),"TransitionEvent"in window||delete eo.transitionend.transition);function Ha(e){if(Wl[e])return Wl[e];if(!eo[e])return e;var t=eo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ag)return Wl[e]=t[n];return e}var lg=Ha("animationend"),cg=Ha("animationiteration"),ug=Ha("animationstart"),dg=Ha("transitionend"),fg=new Map,nh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ir(e,t){fg.set(e,t),Or(t,[e])}for(var Hl=0;Hl<nh.length;Hl++){var Gl=nh[Hl],G1=Gl.toLowerCase(),Y1=Gl[0].toUpperCase()+Gl.slice(1);ir(G1,"on"+Y1)}ir(lg,"onAnimationEnd");ir(cg,"onAnimationIteration");ir(ug,"onAnimationStart");ir("dblclick","onDoubleClick");ir("focusin","onFocus");ir("focusout","onBlur");ir(dg,"onTransitionEnd");vo("onMouseEnter",["mouseout","mouseover"]);vo("onMouseLeave",["mouseout","mouseover"]);vo("onPointerEnter",["pointerout","pointerover"]);vo("onPointerLeave",["pointerout","pointerover"]);Or("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Or("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Or("onBeforeInput",["compositionend","keypress","textInput","paste"]);Or("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Or("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Or("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var es="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),q1=new Set("cancel close invalid load scroll toggle".split(" ").concat(es));function rh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Gw(r,t,void 0,e),e.currentTarget=null}function hg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var a=r[i],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&o.isPropagationStopped())break e;rh(o,a,c),s=l}else for(i=0;i<r.length;i++){if(a=r[i],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&o.isPropagationStopped())break e;rh(o,a,c),s=l}}}if(sa)throw e=Uc,sa=!1,Uc=null,e}function Ce(e,t){var n=t[Jc];n===void 0&&(n=t[Jc]=new Set);var r=e+"__bubble";n.has(r)||(pg(t,e,2,!1),n.add(r))}function Yl(e,t,n){var r=0;t&&(r|=4),pg(n,e,r,t)}var vi="_reactListening"+Math.random().toString(36).slice(2);function _s(e){if(!e[vi]){e[vi]=!0,bm.forEach(function(n){n!=="selectionchange"&&(q1.has(n)||Yl(n,!1,e),Yl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[vi]||(t[vi]=!0,Yl("selectionchange",!1,t))}}function pg(e,t,n,r){switch(Km(t)){case 1:var o=l1;break;case 4:o=c1;break;default:o=nd}n=o.bind(null,t,n,e),o=void 0,!Vc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function ql(e,t,n,r,o){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&(l=i.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;i=i.return}for(;a!==null;){if(i=br(a),i===null)return;if(l=i.tag,l===5||l===6){r=s=i;continue e}a=a.parentNode}}r=r.return}Om(function(){var c=s,u=Zu(n),f=[];e:{var h=fg.get(e);if(h!==void 0){var y=od,m=e;switch(e){case"keypress":if($i(n)===0)break e;case"keydown":case"keyup":y=E1;break;case"focusin":m="focus",y=$l;break;case"focusout":m="blur",y=$l;break;case"beforeblur":case"afterblur":y=$l;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=Hf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=f1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=k1;break;case lg:case cg:case ug:y=m1;break;case dg:y=P1;break;case"scroll":y=u1;break;case"wheel":y=N1;break;case"copy":case"cut":case"paste":y=y1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Yf}var v=(t&4)!==0,b=!v&&e==="scroll",g=v?h!==null?h+"Capture":null:h;v=[];for(var x=c,w;x!==null;){w=x;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,g!==null&&(S=ws(x,g),S!=null&&v.push(ks(x,S,w)))),b)break;x=x.return}0<v.length&&(h=new y(h,m,null,n,u),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",h&&n!==Bc&&(m=n.relatedTarget||n.fromElement)&&(br(m)||m[Rn]))break e;if((y||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,y?(m=n.relatedTarget||n.toElement,y=c,m=m?br(m):null,m!==null&&(b=Dr(m),m!==b||m.tag!==5&&m.tag!==6)&&(m=null)):(y=null,m=c),y!==m)){if(v=Hf,S="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=Yf,S="onPointerLeave",g="onPointerEnter",x="pointer"),b=y==null?h:to(y),w=m==null?h:to(m),h=new v(S,x+"leave",y,n,u),h.target=b,h.relatedTarget=w,S=null,br(u)===c&&(v=new v(g,x+"enter",m,n,u),v.target=w,v.relatedTarget=b,S=v),b=S,y&&m)t:{for(v=y,g=m,x=0,w=v;w;w=Ur(w))x++;for(w=0,S=g;S;S=Ur(S))w++;for(;0<x-w;)v=Ur(v),x--;for(;0<w-x;)g=Ur(g),w--;for(;x--;){if(v===g||g!==null&&v===g.alternate)break t;v=Ur(v),g=Ur(g)}v=null}else v=null;y!==null&&oh(f,h,y,v,!1),m!==null&&b!==null&&oh(f,b,m,v,!0)}}e:{if(h=c?to(c):window,y=h.nodeName&&h.nodeName.toLowerCase(),y==="select"||y==="input"&&h.type==="file")var C=D1;else if(Qf(h))if(rg)C=V1;else{C=B1;var _=F1}else(y=h.nodeName)&&y.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=$1);if(C&&(C=C(e,c))){ng(f,C,n,u);break e}_&&_(e,h,c),e==="focusout"&&(_=h._wrapperState)&&_.controlled&&h.type==="number"&&jc(h,"number",h.value)}switch(_=c?to(c):window,e){case"focusin":(Qf(_)||_.contentEditable==="true")&&(Jr=_,Yc=c,cs=null);break;case"focusout":cs=Yc=Jr=null;break;case"mousedown":qc=!0;break;case"contextmenu":case"mouseup":case"dragend":qc=!1,th(f,n,u);break;case"selectionchange":if(H1)break;case"keydown":case"keyup":th(f,n,u)}var E;if(id)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else Zr?eg(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(Jm&&n.locale!=="ko"&&(Zr||I!=="onCompositionStart"?I==="onCompositionEnd"&&Zr&&(E=Zm()):(Gn=u,rd="value"in Gn?Gn.value:Gn.textContent,Zr=!0)),_=ua(c,I),0<_.length&&(I=new Gf(I,e,null,n,u),f.push({event:I,listeners:_}),E?I.data=E:(E=tg(n),E!==null&&(I.data=E)))),(E=z1?A1(e,n):j1(e,n))&&(c=ua(c,"onBeforeInput"),0<c.length&&(u=new Gf("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=E))}hg(f,t)})}function ks(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ua(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=ws(e,n),s!=null&&r.unshift(ks(e,s,o)),s=ws(e,t),s!=null&&r.push(ks(e,s,o))),e=e.return}return r}function Ur(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function oh(e,t,n,r,o){for(var s=t._reactName,i=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=ws(n,s),l!=null&&i.unshift(ks(n,l,a))):o||(l=ws(n,s),l!=null&&i.push(ks(n,l,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var X1=/\r\n?/g,Q1=/\u0000|\uFFFD/g;function sh(e){return(typeof e=="string"?e:""+e).replace(X1,`
38
+ `).replace(Q1,"")}function xi(e,t,n){if(t=sh(t),sh(e)!==t&&n)throw Error(B(425))}function da(){}var Xc=null,Qc=null;function Kc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Zc=typeof setTimeout=="function"?setTimeout:void 0,K1=typeof clearTimeout=="function"?clearTimeout:void 0,ih=typeof Promise=="function"?Promise:void 0,Z1=typeof queueMicrotask=="function"?queueMicrotask:typeof ih<"u"?function(e){return ih.resolve(null).then(e).catch(J1)}:Zc;function J1(e){setTimeout(function(){throw e})}function Xl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Cs(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Cs(t)}function Kn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ah(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var zo=Math.random().toString(36).slice(2),sn="__reactFiber$"+zo,Rs="__reactProps$"+zo,Rn="__reactContainer$"+zo,Jc="__reactEvents$"+zo,eb="__reactListeners$"+zo,tb="__reactHandles$"+zo;function br(e){var t=e[sn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Rn]||n[sn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ah(e);e!==null;){if(n=e[sn])return n;e=ah(e)}return t}e=n,n=e.parentNode}return null}function Xs(e){return e=e[sn]||e[Rn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function to(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function Ga(e){return e[Rs]||null}var eu=[],no=-1;function ar(e){return{current:e}}function Ie(e){0>no||(e.current=eu[no],eu[no]=null,no--)}function be(e,t){no++,eu[no]=e.current,e.current=t}var rr={},Je=ar(rr),mt=ar(!1),Pr=rr;function xo(e,t){var n=e.type.contextTypes;if(!n)return rr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function gt(e){return e=e.childContextTypes,e!=null}function fa(){Ie(mt),Ie(Je)}function lh(e,t,n){if(Je.current!==rr)throw Error(B(168));be(Je,t),be(mt,n)}function mg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(B(108,Fw(e)||"Unknown",o));return Te({},n,r)}function ha(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rr,Pr=Je.current,be(Je,e),be(mt,mt.current),!0}function ch(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=mg(e,t,Pr),r.__reactInternalMemoizedMergedChildContext=e,Ie(mt),Ie(Je),be(Je,e)):Ie(mt),be(mt,n)}var Sn=null,Ya=!1,Ql=!1;function gg(e){Sn===null?Sn=[e]:Sn.push(e)}function nb(e){Ya=!0,gg(e)}function lr(){if(!Ql&&Sn!==null){Ql=!0;var e=0,t=pe;try{var n=Sn;for(pe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Sn=null,Ya=!1}catch(o){throw Sn!==null&&(Sn=Sn.slice(e+1)),$m(Ju,lr),o}finally{pe=t,Ql=!1}}return null}var ro=[],oo=0,pa=null,ma=0,Tt=[],zt=0,Mr=null,En=1,In="";function yr(e,t){ro[oo++]=ma,ro[oo++]=pa,pa=e,ma=t}function yg(e,t,n){Tt[zt++]=En,Tt[zt++]=In,Tt[zt++]=Mr,Mr=e;var r=En;e=In;var o=32-qt(r)-1;r&=~(1<<o),n+=1;var s=32-qt(t)+o;if(30<s){var i=o-o%5;s=(r&(1<<i)-1).toString(32),r>>=i,o-=i,En=1<<32-qt(t)+o|n<<o|r,In=s+e}else En=1<<s|n<<o|r,In=e}function ld(e){e.return!==null&&(yr(e,1),yg(e,1,0))}function cd(e){for(;e===pa;)pa=ro[--oo],ro[oo]=null,ma=ro[--oo],ro[oo]=null;for(;e===Mr;)Mr=Tt[--zt],Tt[zt]=null,In=Tt[--zt],Tt[zt]=null,En=Tt[--zt],Tt[zt]=null}var St=null,bt=null,Re=!1,Ht=null;function vg(e,t){var n=At(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function uh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,St=e,bt=Kn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,St=e,bt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Mr!==null?{id:En,overflow:In}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=At(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,St=e,bt=null,!0):!1;default:return!1}}function tu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nu(e){if(Re){var t=bt;if(t){var n=t;if(!uh(e,t)){if(tu(e))throw Error(B(418));t=Kn(n.nextSibling);var r=St;t&&uh(e,t)?vg(r,n):(e.flags=e.flags&-4097|2,Re=!1,St=e)}}else{if(tu(e))throw Error(B(418));e.flags=e.flags&-4097|2,Re=!1,St=e}}}function dh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;St=e}function wi(e){if(e!==St)return!1;if(!Re)return dh(e),Re=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kc(e.type,e.memoizedProps)),t&&(t=bt)){if(tu(e))throw xg(),Error(B(418));for(;t;)vg(e,t),t=Kn(t.nextSibling)}if(dh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){bt=Kn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}bt=null}}else bt=St?Kn(e.stateNode.nextSibling):null;return!0}function xg(){for(var e=bt;e;)e=Kn(e.nextSibling)}function wo(){bt=St=null,Re=!1}function ud(e){Ht===null?Ht=[e]:Ht.push(e)}var rb=zn.ReactCurrentBatchConfig;function Go(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var a=o.refs;i===null?delete a[s]:a[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function bi(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fh(e){var t=e._init;return t(e._payload)}function wg(e){function t(g,x){if(e){var w=g.deletions;w===null?(g.deletions=[x],g.flags|=16):w.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function o(g,x){return g=tr(g,x),g.index=0,g.sibling=null,g}function s(g,x,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<x?(g.flags|=2,x):w):(g.flags|=2,x)):(g.flags|=1048576,x)}function i(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,x,w,S){return x===null||x.tag!==6?(x=rc(w,g.mode,S),x.return=g,x):(x=o(x,w),x.return=g,x)}function l(g,x,w,S){var C=w.type;return C===Kr?u(g,x,w.props.children,S,w.key):x!==null&&(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===$n&&fh(C)===x.type)?(S=o(x,w.props),S.ref=Go(g,x,w),S.return=g,S):(S=qi(w.type,w.key,w.props,null,g.mode,S),S.ref=Go(g,x,w),S.return=g,S)}function c(g,x,w,S){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=oc(w,g.mode,S),x.return=g,x):(x=o(x,w.children||[]),x.return=g,x)}function u(g,x,w,S,C){return x===null||x.tag!==7?(x=_r(w,g.mode,S,C),x.return=g,x):(x=o(x,w),x.return=g,x)}function f(g,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=rc(""+x,g.mode,w),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ui:return w=qi(x.type,x.key,x.props,null,g.mode,w),w.ref=Go(g,null,x),w.return=g,w;case Qr:return x=oc(x,g.mode,w),x.return=g,x;case $n:var S=x._init;return f(g,S(x._payload),w)}if(Zo(x)||$o(x))return x=_r(x,g.mode,w,null),x.return=g,x;bi(g,x)}return null}function h(g,x,w,S){var C=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return C!==null?null:a(g,x,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ui:return w.key===C?l(g,x,w,S):null;case Qr:return w.key===C?c(g,x,w,S):null;case $n:return C=w._init,h(g,x,C(w._payload),S)}if(Zo(w)||$o(w))return C!==null?null:u(g,x,w,S,null);bi(g,w)}return null}function y(g,x,w,S,C){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(w)||null,a(x,g,""+S,C);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ui:return g=g.get(S.key===null?w:S.key)||null,l(x,g,S,C);case Qr:return g=g.get(S.key===null?w:S.key)||null,c(x,g,S,C);case $n:var _=S._init;return y(g,x,w,_(S._payload),C)}if(Zo(S)||$o(S))return g=g.get(w)||null,u(x,g,S,C,null);bi(x,S)}return null}function m(g,x,w,S){for(var C=null,_=null,E=x,I=x=0,M=null;E!==null&&I<w.length;I++){E.index>I?(M=E,E=null):M=E.sibling;var R=h(g,E,w[I],S);if(R===null){E===null&&(E=M);break}e&&E&&R.alternate===null&&t(g,E),x=s(R,x,I),_===null?C=R:_.sibling=R,_=R,E=M}if(I===w.length)return n(g,E),Re&&yr(g,I),C;if(E===null){for(;I<w.length;I++)E=f(g,w[I],S),E!==null&&(x=s(E,x,I),_===null?C=E:_.sibling=E,_=E);return Re&&yr(g,I),C}for(E=r(g,E);I<w.length;I++)M=y(E,g,I,w[I],S),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?I:M.key),x=s(M,x,I),_===null?C=M:_.sibling=M,_=M);return e&&E.forEach(function(z){return t(g,z)}),Re&&yr(g,I),C}function v(g,x,w,S){var C=$o(w);if(typeof C!="function")throw Error(B(150));if(w=C.call(w),w==null)throw Error(B(151));for(var _=C=null,E=x,I=x=0,M=null,R=w.next();E!==null&&!R.done;I++,R=w.next()){E.index>I?(M=E,E=null):M=E.sibling;var z=h(g,E,R.value,S);if(z===null){E===null&&(E=M);break}e&&E&&z.alternate===null&&t(g,E),x=s(z,x,I),_===null?C=z:_.sibling=z,_=z,E=M}if(R.done)return n(g,E),Re&&yr(g,I),C;if(E===null){for(;!R.done;I++,R=w.next())R=f(g,R.value,S),R!==null&&(x=s(R,x,I),_===null?C=R:_.sibling=R,_=R);return Re&&yr(g,I),C}for(E=r(g,E);!R.done;I++,R=w.next())R=y(E,g,I,R.value,S),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?I:R.key),x=s(R,x,I),_===null?C=R:_.sibling=R,_=R);return e&&E.forEach(function(P){return t(g,P)}),Re&&yr(g,I),C}function b(g,x,w,S){if(typeof w=="object"&&w!==null&&w.type===Kr&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ui:e:{for(var C=w.key,_=x;_!==null;){if(_.key===C){if(C=w.type,C===Kr){if(_.tag===7){n(g,_.sibling),x=o(_,w.props.children),x.return=g,g=x;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===$n&&fh(C)===_.type){n(g,_.sibling),x=o(_,w.props),x.ref=Go(g,_,w),x.return=g,g=x;break e}n(g,_);break}else t(g,_);_=_.sibling}w.type===Kr?(x=_r(w.props.children,g.mode,S,w.key),x.return=g,g=x):(S=qi(w.type,w.key,w.props,null,g.mode,S),S.ref=Go(g,x,w),S.return=g,g=S)}return i(g);case Qr:e:{for(_=w.key;x!==null;){if(x.key===_)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(g,x.sibling),x=o(x,w.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=oc(w,g.mode,S),x.return=g,g=x}return i(g);case $n:return _=w._init,b(g,x,_(w._payload),S)}if(Zo(w))return m(g,x,w,S);if($o(w))return v(g,x,w,S);bi(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(g,x.sibling),x=o(x,w),x.return=g,g=x):(n(g,x),x=rc(w,g.mode,S),x.return=g,g=x),i(g)):n(g,x)}return b}var bo=wg(!0),bg=wg(!1),ga=ar(null),ya=null,so=null,dd=null;function fd(){dd=so=ya=null}function hd(e){var t=ga.current;Ie(ga),e._currentValue=t}function ru(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function po(e,t){ya=e,dd=so=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ht=!0),e.firstContext=null)}function Dt(e){var t=e._currentValue;if(dd!==e)if(e={context:e,memoizedValue:t,next:null},so===null){if(ya===null)throw Error(B(308));so=e,ya.dependencies={lanes:0,firstContext:e}}else so=so.next=e;return t}var Sr=null;function pd(e){Sr===null?Sr=[e]:Sr.push(e)}function Sg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,pd(t)):(n.next=o.next,o.next=n),t.interleaved=n,Pn(e,r)}function Pn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Vn=!1;function md(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function _n(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Zn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Pn(e,n)}return o=r.interleaved,o===null?(t.next=t,pd(r)):(t.next=o.next,o.next=t),r.interleaved=t,Pn(e,n)}function Vi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ed(e,n)}}function hh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function va(e,t,n,r){var o=e.updateQueue;Vn=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?s=c:i.next=c,i=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==i&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=o.baseState;i=0,u=c=l=null,a=s;do{var h=a.lane,y=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,v=a;switch(h=t,y=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){f=m.call(y,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,h=typeof m=="function"?m.call(y,f,h):m,h==null)break e;f=Te({},f,h);break e;case 2:Vn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[a]:h.push(a))}else y={eventTime:y,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=y,l=f):u=u.next=y,i|=h;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;h=a,a=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(u===null&&(l=f),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);Tr|=i,e.lanes=i,e.memoizedState=f}}function ph(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(B(191,o));o.call(r)}}}var Qs={},un=ar(Qs),Ps=ar(Qs),Ms=ar(Qs);function Cr(e){if(e===Qs)throw Error(B(174));return e}function gd(e,t){switch(be(Ms,t),be(Ps,e),be(un,Qs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Oc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Oc(t,e)}Ie(un),be(un,t)}function So(){Ie(un),Ie(Ps),Ie(Ms)}function Eg(e){Cr(Ms.current);var t=Cr(un.current),n=Oc(t,e.type);t!==n&&(be(Ps,e),be(un,n))}function yd(e){Ps.current===e&&(Ie(un),Ie(Ps))}var Me=ar(0);function xa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Kl=[];function vd(){for(var e=0;e<Kl.length;e++)Kl[e]._workInProgressVersionPrimary=null;Kl.length=0}var Ui=zn.ReactCurrentDispatcher,Zl=zn.ReactCurrentBatchConfig,Nr=0,Ne=null,Be=null,Ve=null,wa=!1,us=!1,Ns=0,ob=0;function qe(){throw Error(B(321))}function xd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Qt(e[n],t[n]))return!1;return!0}function wd(e,t,n,r,o,s){if(Nr=s,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ui.current=e===null||e.memoizedState===null?lb:cb,e=n(r,o),us){s=0;do{if(us=!1,Ns=0,25<=s)throw Error(B(301));s+=1,Ve=Be=null,t.updateQueue=null,Ui.current=ub,e=n(r,o)}while(us)}if(Ui.current=ba,t=Be!==null&&Be.next!==null,Nr=0,Ve=Be=Ne=null,wa=!1,t)throw Error(B(300));return e}function bd(){var e=Ns!==0;return Ns=0,e}function nn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ve===null?Ne.memoizedState=Ve=e:Ve=Ve.next=e,Ve}function Ft(){if(Be===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Be.next;var t=Ve===null?Ne.memoizedState:Ve.next;if(t!==null)Ve=t,Be=e;else{if(e===null)throw Error(B(310));Be=e,e={memoizedState:Be.memoizedState,baseState:Be.baseState,baseQueue:Be.baseQueue,queue:Be.queue,next:null},Ve===null?Ne.memoizedState=Ve=e:Ve=Ve.next=e}return Ve}function Ts(e,t){return typeof t=="function"?t(e):t}function Jl(e){var t=Ft(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Be,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var i=o.next;o.next=s.next,s.next=i}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var a=i=null,l=null,c=s;do{var u=c.lane;if((Nr&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,i=r):l=l.next=f,Ne.lanes|=u,Tr|=u}c=c.next}while(c!==null&&c!==s);l===null?i=r:l.next=a,Qt(r,t.memoizedState)||(ht=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,Ne.lanes|=s,Tr|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ec(e){var t=Ft(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do s=e(s,i.action),i=i.next;while(i!==o);Qt(s,t.memoizedState)||(ht=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Ig(){}function _g(e,t){var n=Ne,r=Ft(),o=t(),s=!Qt(r.memoizedState,o);if(s&&(r.memoizedState=o,ht=!0),r=r.queue,Sd(Pg.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Ve!==null&&Ve.memoizedState.tag&1){if(n.flags|=2048,zs(9,Rg.bind(null,n,r,o,t),void 0,null),Ue===null)throw Error(B(349));Nr&30||kg(n,t,o)}return o}function kg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rg(e,t,n,r){t.value=n,t.getSnapshot=r,Mg(t)&&Ng(e)}function Pg(e,t,n){return n(function(){Mg(t)&&Ng(e)})}function Mg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qt(e,n)}catch{return!0}}function Ng(e){var t=Pn(e,1);t!==null&&Xt(t,e,1,-1)}function mh(e){var t=nn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:e},t.queue=e,e=e.dispatch=ab.bind(null,Ne,e),[t.memoizedState,e]}function zs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Tg(){return Ft().memoizedState}function Wi(e,t,n,r){var o=nn();Ne.flags|=e,o.memoizedState=zs(1|t,n,void 0,r===void 0?null:r)}function qa(e,t,n,r){var o=Ft();r=r===void 0?null:r;var s=void 0;if(Be!==null){var i=Be.memoizedState;if(s=i.destroy,r!==null&&xd(r,i.deps)){o.memoizedState=zs(t,n,s,r);return}}Ne.flags|=e,o.memoizedState=zs(1|t,n,s,r)}function gh(e,t){return Wi(8390656,8,e,t)}function Sd(e,t){return qa(2048,8,e,t)}function zg(e,t){return qa(4,2,e,t)}function Ag(e,t){return qa(4,4,e,t)}function jg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Lg(e,t,n){return n=n!=null?n.concat([e]):null,qa(4,4,jg.bind(null,t,e),n)}function Cd(){}function Og(e,t){var n=Ft();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Dg(e,t){var n=Ft();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Fg(e,t,n){return Nr&21?(Qt(n,t)||(n=Wm(),Ne.lanes|=n,Tr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ht=!0),e.memoizedState=n)}function sb(e,t){var n=pe;pe=n!==0&&4>n?n:4,e(!0);var r=Zl.transition;Zl.transition={};try{e(!1),t()}finally{pe=n,Zl.transition=r}}function Bg(){return Ft().memoizedState}function ib(e,t,n){var r=er(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},$g(e))Vg(t,n);else if(n=Sg(e,t,n,r),n!==null){var o=rt();Xt(n,e,r,o),Ug(n,t,r)}}function ab(e,t,n){var r=er(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if($g(e))Vg(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(o.hasEagerState=!0,o.eagerState=a,Qt(a,i)){var l=t.interleaved;l===null?(o.next=o,pd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Sg(e,t,o,r),n!==null&&(o=rt(),Xt(n,e,r,o),Ug(n,t,r))}}function $g(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Vg(e,t){us=wa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ug(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ed(e,n)}}var ba={readContext:Dt,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},lb={readContext:Dt,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:gh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Wi(4194308,4,jg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Wi(4,2,e,t)},useMemo:function(e,t){var n=nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ib.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:mh,useDebugValue:Cd,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=mh(!1),t=e[0];return e=sb.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,o=nn();if(Re){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ue===null)throw Error(B(349));Nr&30||kg(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,gh(Pg.bind(null,r,s,e),[e]),r.flags|=2048,zs(9,Rg.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=nn(),t=Ue.identifierPrefix;if(Re){var n=In,r=En;n=(r&~(1<<32-qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ns++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ob++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},cb={readContext:Dt,useCallback:Og,useContext:Dt,useEffect:Sd,useImperativeHandle:Lg,useInsertionEffect:zg,useLayoutEffect:Ag,useMemo:Dg,useReducer:Jl,useRef:Tg,useState:function(){return Jl(Ts)},useDebugValue:Cd,useDeferredValue:function(e){var t=Ft();return Fg(t,Be.memoizedState,e)},useTransition:function(){var e=Jl(Ts)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:Ig,useSyncExternalStore:_g,useId:Bg,unstable_isNewReconciler:!1},ub={readContext:Dt,useCallback:Og,useContext:Dt,useEffect:Sd,useImperativeHandle:Lg,useInsertionEffect:zg,useLayoutEffect:Ag,useMemo:Dg,useReducer:ec,useRef:Tg,useState:function(){return ec(Ts)},useDebugValue:Cd,useDeferredValue:function(e){var t=Ft();return Be===null?t.memoizedState=e:Fg(t,Be.memoizedState,e)},useTransition:function(){var e=ec(Ts)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:Ig,useSyncExternalStore:_g,useId:Bg,unstable_isNewReconciler:!1};function Ut(e,t){if(e&&e.defaultProps){t=Te({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ou(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Te({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xa={isMounted:function(e){return(e=e._reactInternals)?Dr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=rt(),o=er(e),s=_n(r,o);s.payload=t,n!=null&&(s.callback=n),t=Zn(e,s,o),t!==null&&(Xt(t,e,o,r),Vi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=rt(),o=er(e),s=_n(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Zn(e,s,o),t!==null&&(Xt(t,e,o,r),Vi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rt(),r=er(e),o=_n(n,r);o.tag=2,t!=null&&(o.callback=t),t=Zn(e,o,r),t!==null&&(Xt(t,e,r,n),Vi(t,e,r))}};function yh(e,t,n,r,o,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!Is(n,r)||!Is(o,s):!0}function Wg(e,t,n){var r=!1,o=rr,s=t.contextType;return typeof s=="object"&&s!==null?s=Dt(s):(o=gt(t)?Pr:Je.current,r=t.contextTypes,s=(r=r!=null)?xo(e,o):rr),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xa,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function vh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Xa.enqueueReplaceState(t,t.state,null)}function su(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},md(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=Dt(s):(s=gt(t)?Pr:Je.current,o.context=xo(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(ou(e,t,s,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Xa.enqueueReplaceState(o,o.state,null),va(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Co(e,t){try{var n="",r=t;do n+=Dw(r),r=r.return;while(r);var o=n}catch(s){o=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:o,digest:null}}function tc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function iu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var db=typeof WeakMap=="function"?WeakMap:Map;function Hg(e,t,n){n=_n(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ca||(Ca=!0,gu=r),iu(e,t)},n}function Gg(e,t,n){n=_n(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){iu(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){iu(e,t),typeof r!="function"&&(Jn===null?Jn=new Set([this]):Jn.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function xh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new db;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Ib.bind(null,e,t,n),t.then(e,e))}function wh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function bh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=_n(-1,1),t.tag=2,Zn(n,t,1))),n.lanes|=1),e)}var fb=zn.ReactCurrentOwner,ht=!1;function et(e,t,n,r){t.child=e===null?bg(t,null,n,r):bo(t,e.child,n,r)}function Sh(e,t,n,r,o){n=n.render;var s=t.ref;return po(t,o),r=wd(e,t,n,r,s,o),n=bd(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Mn(e,t,o)):(Re&&n&&ld(t),t.flags|=1,et(e,t,r,o),t.child)}function Ch(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!Nd(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Yg(e,t,s,r,o)):(e=qi(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:Is,n(i,r)&&e.ref===t.ref)return Mn(e,t,o)}return t.flags|=1,e=tr(s,r),e.ref=t.ref,e.return=t,t.child=e}function Yg(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(Is(s,r)&&e.ref===t.ref)if(ht=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(ht=!0);else return t.lanes=e.lanes,Mn(e,t,o)}return au(e,t,n,r,o)}function qg(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},be(ao,vt),vt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,be(ao,vt),vt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,be(ao,vt),vt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,be(ao,vt),vt|=r;return et(e,t,o,n),t.child}function Xg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function au(e,t,n,r,o){var s=gt(n)?Pr:Je.current;return s=xo(t,s),po(t,o),n=wd(e,t,n,r,s,o),r=bd(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Mn(e,t,o)):(Re&&r&&ld(t),t.flags|=1,et(e,t,n,o),t.child)}function Eh(e,t,n,r,o){if(gt(n)){var s=!0;ha(t)}else s=!1;if(po(t,o),t.stateNode===null)Hi(e,t),Wg(t,n,r),su(t,n,r,o),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Dt(c):(c=gt(n)?Pr:Je.current,c=xo(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||l!==c)&&vh(t,i,r,c),Vn=!1;var h=t.memoizedState;i.state=h,va(t,r,i,o),l=t.memoizedState,a!==r||h!==l||mt.current||Vn?(typeof u=="function"&&(ou(t,n,u,r),l=t.memoizedState),(a=Vn||yh(t,n,a,r,h,l,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=c,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Cg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Ut(t.type,a),i.props=c,f=t.pendingProps,h=i.context,l=n.contextType,typeof l=="object"&&l!==null?l=Dt(l):(l=gt(n)?Pr:Je.current,l=xo(t,l));var y=n.getDerivedStateFromProps;(u=typeof y=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||h!==l)&&vh(t,i,r,l),Vn=!1,h=t.memoizedState,i.state=h,va(t,r,i,o);var m=t.memoizedState;a!==f||h!==m||mt.current||Vn?(typeof y=="function"&&(ou(t,n,y,r),m=t.memoizedState),(c=Vn||yh(t,n,c,r,h,m,l)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,m,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,m,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),i.props=r,i.state=m,i.context=l,r=c):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return lu(e,t,n,r,s,o)}function lu(e,t,n,r,o,s){Xg(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&ch(t,n,!1),Mn(e,t,s);r=t.stateNode,fb.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=bo(t,e.child,null,s),t.child=bo(t,null,a,s)):et(e,t,a,s),t.memoizedState=r.state,o&&ch(t,n,!0),t.child}function Qg(e){var t=e.stateNode;t.pendingContext?lh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&lh(e,t.context,!1),gd(e,t.containerInfo)}function Ih(e,t,n,r,o){return wo(),ud(o),t.flags|=256,et(e,t,n,r),t.child}var cu={dehydrated:null,treeContext:null,retryLane:0};function uu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Kg(e,t,n){var r=t.pendingProps,o=Me.current,s=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),be(Me,o&1),e===null)return nu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=Za(i,r,0,null),e=_r(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=uu(n),t.memoizedState=cu,e):Ed(t,i));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return hb(e,t,i,r,a,o,n);if(s){s=r.fallback,i=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(i&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=tr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?s=tr(a,s):(s=_r(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?uu(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=cu,r}return s=e.child,e=s.sibling,r=tr(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ed(e,t){return t=Za({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Si(e,t,n,r){return r!==null&&ud(r),bo(t,e.child,null,n),e=Ed(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hb(e,t,n,r,o,s,i){if(n)return t.flags&256?(t.flags&=-257,r=tc(Error(B(422))),Si(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=Za({mode:"visible",children:r.children},o,0,null),s=_r(s,o,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&bo(t,e.child,null,i),t.child.memoizedState=uu(i),t.memoizedState=cu,s);if(!(t.mode&1))return Si(e,t,i,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(B(419)),r=tc(s,r,void 0),Si(e,t,i,r)}if(a=(i&e.childLanes)!==0,ht||a){if(r=Ue,r!==null){switch(i&-i){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|i)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,Pn(e,o),Xt(r,e,o,-1))}return Md(),r=tc(Error(B(421))),Si(e,t,i,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=_b.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,bt=Kn(o.nextSibling),St=t,Re=!0,Ht=null,e!==null&&(Tt[zt++]=En,Tt[zt++]=In,Tt[zt++]=Mr,En=e.id,In=e.overflow,Mr=t),t=Ed(t,r.children),t.flags|=4096,t)}function _h(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ru(e.return,t,n)}function nc(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function Zg(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(et(e,t,r.children,n),r=Me.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_h(e,n,t);else if(e.tag===19)_h(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(be(Me,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&xa(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),nc(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&xa(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}nc(t,!0,n,null,s);break;case"together":nc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Tr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=tr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=tr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function pb(e,t,n){switch(t.tag){case 3:Qg(t),wo();break;case 5:Eg(t);break;case 1:gt(t.type)&&ha(t);break;case 4:gd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;be(ga,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(be(Me,Me.current&1),t.flags|=128,null):n&t.child.childLanes?Kg(e,t,n):(be(Me,Me.current&1),e=Mn(e,t,n),e!==null?e.sibling:null);be(Me,Me.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Zg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),be(Me,Me.current),r)break;return null;case 22:case 23:return t.lanes=0,qg(e,t,n)}return Mn(e,t,n)}var Jg,du,ey,ty;Jg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};du=function(){};ey=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Cr(un.current);var s=null;switch(n){case"input":o=zc(e,o),r=zc(e,r),s=[];break;case"select":o=Te({},o,{value:void 0}),r=Te({},r,{value:void 0}),s=[];break;case"textarea":o=Lc(e,o),r=Lc(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=da)}Dc(n,r);var i;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(vs.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=o?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in l)l.hasOwnProperty(i)&&a[i]!==l[i]&&(n||(n={}),n[i]=l[i])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(vs.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ce("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};ty=function(e,t,n,r){n!==r&&(t.flags|=4)};function Yo(e,t){if(!Re)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function mb(e,t,n){var r=t.pendingProps;switch(cd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return gt(t.type)&&fa(),Xe(t),null;case 3:return r=t.stateNode,So(),Ie(mt),Ie(Je),vd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(wi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ht!==null&&(xu(Ht),Ht=null))),du(e,t),Xe(t),null;case 5:yd(t);var o=Cr(Ms.current);if(n=t.type,e!==null&&t.stateNode!=null)ey(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Xe(t),null}if(e=Cr(un.current),wi(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[sn]=t,r[Rs]=s,e=(t.mode&1)!==0,n){case"dialog":Ce("cancel",r),Ce("close",r);break;case"iframe":case"object":case"embed":Ce("load",r);break;case"video":case"audio":for(o=0;o<es.length;o++)Ce(es[o],r);break;case"source":Ce("error",r);break;case"img":case"image":case"link":Ce("error",r),Ce("load",r);break;case"details":Ce("toggle",r);break;case"input":jf(r,s),Ce("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Ce("invalid",r);break;case"textarea":Of(r,s),Ce("invalid",r)}Dc(n,s),o=null;for(var i in s)if(s.hasOwnProperty(i)){var a=s[i];i==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&xi(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&xi(r.textContent,a,e),o=["children",""+a]):vs.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&Ce("scroll",r)}switch(n){case"input":di(r),Lf(r,s,!0);break;case"textarea":di(r),Df(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=da)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Pm(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[sn]=t,e[Rs]=r,Jg(e,t,!1,!1),t.stateNode=e;e:{switch(i=Fc(n,r),n){case"dialog":Ce("cancel",e),Ce("close",e),o=r;break;case"iframe":case"object":case"embed":Ce("load",e),o=r;break;case"video":case"audio":for(o=0;o<es.length;o++)Ce(es[o],e);o=r;break;case"source":Ce("error",e),o=r;break;case"img":case"image":case"link":Ce("error",e),Ce("load",e),o=r;break;case"details":Ce("toggle",e),o=r;break;case"input":jf(e,r),o=zc(e,r),Ce("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Te({},r,{value:void 0}),Ce("invalid",e);break;case"textarea":Of(e,r),o=Lc(e,r),Ce("invalid",e);break;default:o=r}Dc(n,o),a=o;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Tm(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Mm(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&xs(e,l):typeof l=="number"&&xs(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(vs.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Ce("scroll",e):l!=null&&qu(e,s,l,i))}switch(n){case"input":di(e),Lf(e,r,!1);break;case"textarea":di(e),Df(e);break;case"option":r.value!=null&&e.setAttribute("value",""+nr(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?co(e,!!r.multiple,s,!1):r.defaultValue!=null&&co(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=da)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xe(t),null;case 6:if(e&&t.stateNode!=null)ty(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Cr(Ms.current),Cr(un.current),wi(t)){if(r=t.stateNode,n=t.memoizedProps,r[sn]=t,(s=r.nodeValue!==n)&&(e=St,e!==null))switch(e.tag){case 3:xi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&xi(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[sn]=t,t.stateNode=r}return Xe(t),null;case 13:if(Ie(Me),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Re&&bt!==null&&t.mode&1&&!(t.flags&128))xg(),wo(),t.flags|=98560,s=!1;else if(s=wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(B(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(B(317));s[sn]=t}else wo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xe(t),s=!1}else Ht!==null&&(xu(Ht),Ht=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Me.current&1?$e===0&&($e=3):Md())),t.updateQueue!==null&&(t.flags|=4),Xe(t),null);case 4:return So(),du(e,t),e===null&&_s(t.stateNode.containerInfo),Xe(t),null;case 10:return hd(t.type._context),Xe(t),null;case 17:return gt(t.type)&&fa(),Xe(t),null;case 19:if(Ie(Me),s=t.memoizedState,s===null)return Xe(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)Yo(s,!1);else{if($e!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=xa(e),i!==null){for(t.flags|=128,Yo(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return be(Me,Me.current&1|2),t.child}e=e.sibling}s.tail!==null&&Le()>Eo&&(t.flags|=128,r=!0,Yo(s,!1),t.lanes=4194304)}else{if(!r)if(e=xa(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Yo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!Re)return Xe(t),null}else 2*Le()-s.renderingStartTime>Eo&&n!==1073741824&&(t.flags|=128,r=!0,Yo(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Le(),t.sibling=null,n=Me.current,be(Me,r?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return Pd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?vt&1073741824&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function gb(e,t){switch(cd(t),t.tag){case 1:return gt(t.type)&&fa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return So(),Ie(mt),Ie(Je),vd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yd(t),null;case 13:if(Ie(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));wo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Me),null;case 4:return So(),null;case 10:return hd(t.type._context),null;case 22:case 23:return Pd(),null;case 24:return null;default:return null}}var Ci=!1,Qe=!1,yb=typeof WeakSet=="function"?WeakSet:Set,G=null;function io(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){je(e,t,r)}else n.current=null}function fu(e,t,n){try{n()}catch(r){je(e,t,r)}}var kh=!1;function vb(e,t){if(Xc=la,e=ig(),ad(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,a=-1,l=-1,c=0,u=0,f=e,h=null;t:for(;;){for(var y;f!==n||o!==0&&f.nodeType!==3||(a=i+o),f!==s||r!==0&&f.nodeType!==3||(l=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(y=f.firstChild)!==null;)h=f,f=y;for(;;){if(f===e)break t;if(h===n&&++c===o&&(a=i),h===s&&++u===r&&(l=i),(y=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=y}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qc={focusedElem:e,selectionRange:n},la=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,b=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ut(t.type,v),b);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(S){je(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=kh,kh=!1,m}function ds(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&fu(t,n,s)}o=o.next}while(o!==r)}}function Qa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ny(e){var t=e.alternate;t!==null&&(e.alternate=null,ny(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sn],delete t[Rs],delete t[Jc],delete t[eb],delete t[tb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ry(e){return e.tag===5||e.tag===3||e.tag===4}function Rh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ry(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=da));else if(r!==4&&(e=e.child,e!==null))for(pu(e,t,n),e=e.sibling;e!==null;)pu(e,t,n),e=e.sibling}function mu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(mu(e,t,n),e=e.sibling;e!==null;)mu(e,t,n),e=e.sibling}var He=null,Wt=!1;function Dn(e,t,n){for(n=n.child;n!==null;)oy(e,t,n),n=n.sibling}function oy(e,t,n){if(cn&&typeof cn.onCommitFiberUnmount=="function")try{cn.onCommitFiberUnmount(Va,n)}catch{}switch(n.tag){case 5:Qe||io(n,t);case 6:var r=He,o=Wt;He=null,Dn(e,t,n),He=r,Wt=o,He!==null&&(Wt?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Wt?(e=He,n=n.stateNode,e.nodeType===8?Xl(e.parentNode,n):e.nodeType===1&&Xl(e,n),Cs(e)):Xl(He,n.stateNode));break;case 4:r=He,o=Wt,He=n.stateNode.containerInfo,Wt=!0,Dn(e,t,n),He=r,Wt=o;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&fu(n,t,i),o=o.next}while(o!==r)}Dn(e,t,n);break;case 1:if(!Qe&&(io(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){je(n,t,a)}Dn(e,t,n);break;case 21:Dn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Dn(e,t,n),Qe=r):Dn(e,t,n);break;default:Dn(e,t,n)}}function Ph(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yb),t.forEach(function(r){var o=kb.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Vt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:He=a.stateNode,Wt=!1;break e;case 3:He=a.stateNode.containerInfo,Wt=!0;break e;case 4:He=a.stateNode.containerInfo,Wt=!0;break e}a=a.return}if(He===null)throw Error(B(160));oy(s,i,o),He=null,Wt=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){je(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)sy(t,e),t=t.sibling}function sy(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Vt(t,e),tn(e),r&4){try{ds(3,e,e.return),Qa(3,e)}catch(v){je(e,e.return,v)}try{ds(5,e,e.return)}catch(v){je(e,e.return,v)}}break;case 1:Vt(t,e),tn(e),r&512&&n!==null&&io(n,n.return);break;case 5:if(Vt(t,e),tn(e),r&512&&n!==null&&io(n,n.return),e.flags&32){var o=e.stateNode;try{xs(o,"")}catch(v){je(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&km(o,s),Fc(a,i);var c=Fc(a,s);for(i=0;i<l.length;i+=2){var u=l[i],f=l[i+1];u==="style"?Tm(o,f):u==="dangerouslySetInnerHTML"?Mm(o,f):u==="children"?xs(o,f):qu(o,u,f,c)}switch(a){case"input":Ac(o,s);break;case"textarea":Rm(o,s);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var y=s.value;y!=null?co(o,!!s.multiple,y,!1):h!==!!s.multiple&&(s.defaultValue!=null?co(o,!!s.multiple,s.defaultValue,!0):co(o,!!s.multiple,s.multiple?[]:"",!1))}o[Rs]=s}catch(v){je(e,e.return,v)}}break;case 6:if(Vt(t,e),tn(e),r&4){if(e.stateNode===null)throw Error(B(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(v){je(e,e.return,v)}}break;case 3:if(Vt(t,e),tn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Cs(t.containerInfo)}catch(v){je(e,e.return,v)}break;case 4:Vt(t,e),tn(e);break;case 13:Vt(t,e),tn(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||(kd=Le())),r&4&&Ph(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Qe=(c=Qe)||u,Vt(t,e),Qe=c):Vt(t,e),tn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(G=e,u=e.child;u!==null;){for(f=G=u;G!==null;){switch(h=G,y=h.child,h.tag){case 0:case 11:case 14:case 15:ds(4,h,h.return);break;case 1:io(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){je(r,n,v)}}break;case 5:io(h,h.return);break;case 22:if(h.memoizedState!==null){Nh(f);continue}}y!==null?(y.return=h,G=y):Nh(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{o=f.stateNode,c?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,i=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Nm("display",i))}catch(v){je(e,e.return,v)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(v){je(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Vt(t,e),tn(e),r&4&&Ph(e);break;case 21:break;default:Vt(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ry(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(xs(o,""),r.flags&=-33);var s=Rh(e);mu(e,s,o);break;case 3:case 4:var i=r.stateNode.containerInfo,a=Rh(e);pu(e,a,i);break;default:throw Error(B(161))}}catch(l){je(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xb(e,t,n){G=e,iy(e)}function iy(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var o=G,s=o.child;if(o.tag===22&&r){var i=o.memoizedState!==null||Ci;if(!i){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Qe;a=Ci;var c=Qe;if(Ci=i,(Qe=l)&&!c)for(G=o;G!==null;)i=G,l=i.child,i.tag===22&&i.memoizedState!==null?Th(o):l!==null?(l.return=i,G=l):Th(o);for(;s!==null;)G=s,iy(s),s=s.sibling;G=o,Ci=a,Qe=c}Mh(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,G=s):Mh(e)}}function Mh(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Qe||Qa(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Qe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Ut(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ph(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ph(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Cs(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Qe||t.flags&512&&hu(t)}catch(h){je(t,t.return,h)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function Nh(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function Th(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Qa(4,t)}catch(l){je(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){je(t,o,l)}}var s=t.return;try{hu(t)}catch(l){je(t,s,l)}break;case 5:var i=t.return;try{hu(t)}catch(l){je(t,i,l)}}}catch(l){je(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var wb=Math.ceil,Sa=zn.ReactCurrentDispatcher,Id=zn.ReactCurrentOwner,jt=zn.ReactCurrentBatchConfig,ue=0,Ue=null,De=null,Ge=0,vt=0,ao=ar(0),$e=0,As=null,Tr=0,Ka=0,_d=0,fs=null,ft=null,kd=0,Eo=1/0,bn=null,Ca=!1,gu=null,Jn=null,Ei=!1,Yn=null,Ea=0,hs=0,yu=null,Gi=-1,Yi=0;function rt(){return ue&6?Le():Gi!==-1?Gi:Gi=Le()}function er(e){return e.mode&1?ue&2&&Ge!==0?Ge&-Ge:rb.transition!==null?(Yi===0&&(Yi=Wm()),Yi):(e=pe,e!==0||(e=window.event,e=e===void 0?16:Km(e.type)),e):1}function Xt(e,t,n,r){if(50<hs)throw hs=0,yu=null,Error(B(185));Ys(e,n,r),(!(ue&2)||e!==Ue)&&(e===Ue&&(!(ue&2)&&(Ka|=n),$e===4&&Hn(e,Ge)),yt(e,r),n===1&&ue===0&&!(t.mode&1)&&(Eo=Le()+500,Ya&&lr()))}function yt(e,t){var n=e.callbackNode;r1(e,t);var r=aa(e,e===Ue?Ge:0);if(r===0)n!==null&&$f(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&$f(n),t===1)e.tag===0?nb(zh.bind(null,e)):gg(zh.bind(null,e)),Z1(function(){!(ue&6)&&lr()}),n=null;else{switch(Hm(r)){case 1:n=Ju;break;case 4:n=Vm;break;case 16:n=ia;break;case 536870912:n=Um;break;default:n=ia}n=py(n,ay.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ay(e,t){if(Gi=-1,Yi=0,ue&6)throw Error(B(327));var n=e.callbackNode;if(mo()&&e.callbackNode!==n)return null;var r=aa(e,e===Ue?Ge:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ia(e,r);else{t=r;var o=ue;ue|=2;var s=cy();(Ue!==e||Ge!==t)&&(bn=null,Eo=Le()+500,Ir(e,t));do try{Cb();break}catch(a){ly(e,a)}while(!0);fd(),Sa.current=s,ue=o,De!==null?t=0:(Ue=null,Ge=0,t=$e)}if(t!==0){if(t===2&&(o=Wc(e),o!==0&&(r=o,t=vu(e,o))),t===1)throw n=As,Ir(e,0),Hn(e,r),yt(e,Le()),n;if(t===6)Hn(e,r);else{if(o=e.current.alternate,!(r&30)&&!bb(o)&&(t=Ia(e,r),t===2&&(s=Wc(e),s!==0&&(r=s,t=vu(e,s))),t===1))throw n=As,Ir(e,0),Hn(e,r),yt(e,Le()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:vr(e,ft,bn);break;case 3:if(Hn(e,r),(r&130023424)===r&&(t=kd+500-Le(),10<t)){if(aa(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){rt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Zc(vr.bind(null,e,ft,bn),t);break}vr(e,ft,bn);break;case 4:if(Hn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var i=31-qt(r);s=1<<i,i=t[i],i>o&&(o=i),r&=~s}if(r=o,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wb(r/1960))-r,10<r){e.timeoutHandle=Zc(vr.bind(null,e,ft,bn),r);break}vr(e,ft,bn);break;case 5:vr(e,ft,bn);break;default:throw Error(B(329))}}}return yt(e,Le()),e.callbackNode===n?ay.bind(null,e):null}function vu(e,t){var n=fs;return e.current.memoizedState.isDehydrated&&(Ir(e,t).flags|=256),e=Ia(e,t),e!==2&&(t=ft,ft=n,t!==null&&xu(t)),e}function xu(e){ft===null?ft=e:ft.push.apply(ft,e)}function bb(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],s=o.getSnapshot;o=o.value;try{if(!Qt(s(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Hn(e,t){for(t&=~_d,t&=~Ka,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qt(t),r=1<<n;e[n]=-1,t&=~r}}function zh(e){if(ue&6)throw Error(B(327));mo();var t=aa(e,0);if(!(t&1))return yt(e,Le()),null;var n=Ia(e,t);if(e.tag!==0&&n===2){var r=Wc(e);r!==0&&(t=r,n=vu(e,r))}if(n===1)throw n=As,Ir(e,0),Hn(e,t),yt(e,Le()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vr(e,ft,bn),yt(e,Le()),null}function Rd(e,t){var n=ue;ue|=1;try{return e(t)}finally{ue=n,ue===0&&(Eo=Le()+500,Ya&&lr())}}function zr(e){Yn!==null&&Yn.tag===0&&!(ue&6)&&mo();var t=ue;ue|=1;var n=jt.transition,r=pe;try{if(jt.transition=null,pe=1,e)return e()}finally{pe=r,jt.transition=n,ue=t,!(ue&6)&&lr()}}function Pd(){vt=ao.current,Ie(ao)}function Ir(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,K1(n)),De!==null)for(n=De.return;n!==null;){var r=n;switch(cd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&fa();break;case 3:So(),Ie(mt),Ie(Je),vd();break;case 5:yd(r);break;case 4:So();break;case 13:Ie(Me);break;case 19:Ie(Me);break;case 10:hd(r.type._context);break;case 22:case 23:Pd()}n=n.return}if(Ue=e,De=e=tr(e.current,null),Ge=vt=t,$e=0,As=null,_d=Ka=Tr=0,ft=fs=null,Sr!==null){for(t=0;t<Sr.length;t++)if(n=Sr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=o,r.next=i}n.pending=r}Sr=null}return e}function ly(e,t){do{var n=De;try{if(fd(),Ui.current=ba,wa){for(var r=Ne.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}wa=!1}if(Nr=0,Ve=Be=Ne=null,us=!1,Ns=0,Id.current=null,n===null||n.return===null){$e=1,As=t,De=null;break}e:{var s=e,i=n.return,a=n,l=t;if(t=Ge,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var y=wh(i);if(y!==null){y.flags&=-257,bh(y,i,a,s,t),y.mode&1&&xh(s,c,t),t=y,l=c;var m=t.updateQueue;if(m===null){var v=new Set;v.add(l),t.updateQueue=v}else m.add(l);break e}else{if(!(t&1)){xh(s,c,t),Md();break e}l=Error(B(426))}}else if(Re&&a.mode&1){var b=wh(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),bh(b,i,a,s,t),ud(Co(l,a));break e}}s=l=Co(l,a),$e!==4&&($e=2),fs===null?fs=[s]:fs.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=Hg(s,l,t);hh(s,g);break e;case 1:a=l;var x=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Jn===null||!Jn.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=Gg(s,a,t);hh(s,S);break e}}s=s.return}while(s!==null)}dy(n)}catch(C){t=C,De===n&&n!==null&&(De=n=n.return);continue}break}while(!0)}function cy(){var e=Sa.current;return Sa.current=ba,e===null?ba:e}function Md(){($e===0||$e===3||$e===2)&&($e=4),Ue===null||!(Tr&268435455)&&!(Ka&268435455)||Hn(Ue,Ge)}function Ia(e,t){var n=ue;ue|=2;var r=cy();(Ue!==e||Ge!==t)&&(bn=null,Ir(e,t));do try{Sb();break}catch(o){ly(e,o)}while(!0);if(fd(),ue=n,Sa.current=r,De!==null)throw Error(B(261));return Ue=null,Ge=0,$e}function Sb(){for(;De!==null;)uy(De)}function Cb(){for(;De!==null&&!qw();)uy(De)}function uy(e){var t=hy(e.alternate,e,vt);e.memoizedProps=e.pendingProps,t===null?dy(e):De=t,Id.current=null}function dy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=gb(n,t),n!==null){n.flags&=32767,De=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{$e=6,De=null;return}}else if(n=mb(n,t,vt),n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);$e===0&&($e=5)}function vr(e,t,n){var r=pe,o=jt.transition;try{jt.transition=null,pe=1,Eb(e,t,n,r)}finally{jt.transition=o,pe=r}return null}function Eb(e,t,n,r){do mo();while(Yn!==null);if(ue&6)throw Error(B(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(o1(e,s),e===Ue&&(De=Ue=null,Ge=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ei||(Ei=!0,py(ia,function(){return mo(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=jt.transition,jt.transition=null;var i=pe;pe=1;var a=ue;ue|=4,Id.current=null,vb(e,n),sy(n,e),W1(Qc),la=!!Xc,Qc=Xc=null,e.current=n,xb(n),Xw(),ue=a,pe=i,jt.transition=s}else e.current=n;if(Ei&&(Ei=!1,Yn=e,Ea=o),s=e.pendingLanes,s===0&&(Jn=null),Zw(n.stateNode),yt(e,Le()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ca)throw Ca=!1,e=gu,gu=null,e;return Ea&1&&e.tag!==0&&mo(),s=e.pendingLanes,s&1?e===yu?hs++:(hs=0,yu=e):hs=0,lr(),null}function mo(){if(Yn!==null){var e=Hm(Ea),t=jt.transition,n=pe;try{if(jt.transition=null,pe=16>e?16:e,Yn===null)var r=!1;else{if(e=Yn,Yn=null,Ea=0,ue&6)throw Error(B(331));var o=ue;for(ue|=4,G=e.current;G!==null;){var s=G,i=s.child;if(G.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(G=c;G!==null;){var u=G;switch(u.tag){case 0:case 11:case 15:ds(8,u,s)}var f=u.child;if(f!==null)f.return=u,G=f;else for(;G!==null;){u=G;var h=u.sibling,y=u.return;if(ny(u),u===c){G=null;break}if(h!==null){h.return=y,G=h;break}G=y}}}var m=s.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}G=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,G=i;else e:for(;G!==null;){if(s=G,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ds(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,G=g;break e}G=s.return}}var x=e.current;for(G=x;G!==null;){i=G;var w=i.child;if(i.subtreeFlags&2064&&w!==null)w.return=i,G=w;else e:for(i=x;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Qa(9,a)}}catch(C){je(a,a.return,C)}if(a===i){G=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,G=S;break e}G=a.return}}if(ue=o,lr(),cn&&typeof cn.onPostCommitFiberRoot=="function")try{cn.onPostCommitFiberRoot(Va,e)}catch{}r=!0}return r}finally{pe=n,jt.transition=t}}return!1}function Ah(e,t,n){t=Co(n,t),t=Hg(e,t,1),e=Zn(e,t,1),t=rt(),e!==null&&(Ys(e,1,t),yt(e,t))}function je(e,t,n){if(e.tag===3)Ah(e,e,n);else for(;t!==null;){if(t.tag===3){Ah(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Jn===null||!Jn.has(r))){e=Co(n,e),e=Gg(t,e,1),t=Zn(t,e,1),e=rt(),t!==null&&(Ys(t,1,e),yt(t,e));break}}t=t.return}}function Ib(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=rt(),e.pingedLanes|=e.suspendedLanes&n,Ue===e&&(Ge&n)===n&&($e===4||$e===3&&(Ge&130023424)===Ge&&500>Le()-kd?Ir(e,0):_d|=n),yt(e,t)}function fy(e,t){t===0&&(e.mode&1?(t=pi,pi<<=1,!(pi&130023424)&&(pi=4194304)):t=1);var n=rt();e=Pn(e,t),e!==null&&(Ys(e,t,n),yt(e,n))}function _b(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fy(e,n)}function kb(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),fy(e,n)}var hy;hy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mt.current)ht=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ht=!1,pb(e,t,n);ht=!!(e.flags&131072)}else ht=!1,Re&&t.flags&1048576&&yg(t,ma,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hi(e,t),e=t.pendingProps;var o=xo(t,Je.current);po(t,n),o=wd(null,t,r,e,o,n);var s=bd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,gt(r)?(s=!0,ha(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,md(t),o.updater=Xa,t.stateNode=o,o._reactInternals=t,su(t,r,e,n),t=lu(null,t,r,!0,s,n)):(t.tag=0,Re&&s&&ld(t),et(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Pb(r),e=Ut(r,e),o){case 0:t=au(null,t,r,e,n);break e;case 1:t=Eh(null,t,r,e,n);break e;case 11:t=Sh(null,t,r,e,n);break e;case 14:t=Ch(null,t,r,Ut(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ut(r,o),au(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ut(r,o),Eh(e,t,r,o,n);case 3:e:{if(Qg(t),e===null)throw Error(B(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Cg(e,t),va(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=Co(Error(B(423)),t),t=Ih(e,t,r,n,o);break e}else if(r!==o){o=Co(Error(B(424)),t),t=Ih(e,t,r,n,o);break e}else for(bt=Kn(t.stateNode.containerInfo.firstChild),St=t,Re=!0,Ht=null,n=bg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wo(),r===o){t=Mn(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return Eg(t),e===null&&nu(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Kc(r,o)?i=null:s!==null&&Kc(r,s)&&(t.flags|=32),Xg(e,t),et(e,t,i,n),t.child;case 6:return e===null&&nu(t),null;case 13:return Kg(e,t,n);case 4:return gd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bo(t,null,r,n):et(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ut(r,o),Sh(e,t,r,o,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,be(ga,r._currentValue),r._currentValue=i,s!==null)if(Qt(s.value,i)){if(s.children===o.children&&!mt.current){t=Mn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=_n(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),ru(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(B(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ru(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}et(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,po(t,n),o=Dt(o),r=r(o),t.flags|=1,et(e,t,r,n),t.child;case 14:return r=t.type,o=Ut(r,t.pendingProps),o=Ut(r.type,o),Ch(e,t,r,o,n);case 15:return Yg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ut(r,o),Hi(e,t),t.tag=1,gt(r)?(e=!0,ha(t)):e=!1,po(t,n),Wg(t,r,o),su(t,r,o,n),lu(null,t,r,!0,e,n);case 19:return Zg(e,t,n);case 22:return qg(e,t,n)}throw Error(B(156,t.tag))};function py(e,t){return $m(e,t)}function Rb(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function At(e,t,n,r){return new Rb(e,t,n,r)}function Nd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pb(e){if(typeof e=="function")return Nd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qu)return 11;if(e===Ku)return 14}return 2}function tr(e,t){var n=e.alternate;return n===null?(n=At(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qi(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")Nd(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Kr:return _r(n.children,o,s,t);case Xu:i=8,o|=8;break;case Pc:return e=At(12,n,t,o|2),e.elementType=Pc,e.lanes=s,e;case Mc:return e=At(13,n,t,o),e.elementType=Mc,e.lanes=s,e;case Nc:return e=At(19,n,t,o),e.elementType=Nc,e.lanes=s,e;case Em:return Za(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Sm:i=10;break e;case Cm:i=9;break e;case Qu:i=11;break e;case Ku:i=14;break e;case $n:i=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=At(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function _r(e,t,n,r){return e=At(7,e,r,t),e.lanes=n,e}function Za(e,t,n,r){return e=At(22,e,r,t),e.elementType=Em,e.lanes=n,e.stateNode={isHidden:!1},e}function rc(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function oc(e,t,n){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mb(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Dl(0),this.expirationTimes=Dl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Td(e,t,n,r,o,s,i,a,l){return e=new Mb(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=At(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},md(s),e}function Nb(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function my(e){if(!e)return rr;e=e._reactInternals;e:{if(Dr(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(gt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(gt(n))return mg(e,n,t)}return t}function gy(e,t,n,r,o,s,i,a,l){return e=Td(n,r,!0,e,o,s,i,a,l),e.context=my(null),n=e.current,r=rt(),o=er(n),s=_n(r,o),s.callback=t??null,Zn(n,s,o),e.current.lanes=o,Ys(e,o,r),yt(e,r),e}function Ja(e,t,n,r){var o=t.current,s=rt(),i=er(o);return n=my(n),t.context===null?t.context=n:t.pendingContext=n,t=_n(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Zn(o,t,i),e!==null&&(Xt(e,o,i,s),Vi(e,o,i)),i}function _a(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function jh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function zd(e,t){jh(e,t),(e=e.alternate)&&jh(e,t)}function Tb(){return null}var yy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ad(e){this._internalRoot=e}el.prototype.render=Ad.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Ja(e,t,null,null)};el.prototype.unmount=Ad.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zr(function(){Ja(null,e,null,null)}),t[Rn]=null}};function el(e){this._internalRoot=e}el.prototype.unstable_scheduleHydration=function(e){if(e){var t=qm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wn.length&&t!==0&&t<Wn[n].priority;n++);Wn.splice(n,0,e),n===0&&Qm(e)}};function jd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function tl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lh(){}function zb(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var c=_a(i);s.call(c)}}var i=gy(t,r,e,0,null,!1,!1,"",Lh);return e._reactRootContainer=i,e[Rn]=i.current,_s(e.nodeType===8?e.parentNode:e),zr(),i}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=_a(l);a.call(c)}}var l=Td(e,0,!1,null,null,!1,!1,"",Lh);return e._reactRootContainer=l,e[Rn]=l.current,_s(e.nodeType===8?e.parentNode:e),zr(function(){Ja(t,l,n,r)}),l}function nl(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s;if(typeof o=="function"){var a=o;o=function(){var l=_a(i);a.call(l)}}Ja(t,i,e,o)}else i=zb(n,t,e,o,r);return _a(i)}Gm=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Jo(t.pendingLanes);n!==0&&(ed(t,n|1),yt(t,Le()),!(ue&6)&&(Eo=Le()+500,lr()))}break;case 13:zr(function(){var r=Pn(e,1);if(r!==null){var o=rt();Xt(r,e,1,o)}}),zd(e,1)}};td=function(e){if(e.tag===13){var t=Pn(e,134217728);if(t!==null){var n=rt();Xt(t,e,134217728,n)}zd(e,134217728)}};Ym=function(e){if(e.tag===13){var t=er(e),n=Pn(e,t);if(n!==null){var r=rt();Xt(n,e,t,r)}zd(e,t)}};qm=function(){return pe};Xm=function(e,t){var n=pe;try{return pe=e,t()}finally{pe=n}};$c=function(e,t,n){switch(t){case"input":if(Ac(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Ga(r);if(!o)throw Error(B(90));_m(r),Ac(r,o)}}}break;case"textarea":Rm(e,n);break;case"select":t=n.value,t!=null&&co(e,!!n.multiple,t,!1)}};jm=Rd;Lm=zr;var Ab={usingClientEntryPoint:!1,Events:[Xs,to,Ga,zm,Am,Rd]},qo={findFiberByHostInstance:br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jb={bundleType:qo.bundleType,version:qo.version,rendererPackageName:qo.rendererPackageName,rendererConfig:qo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:zn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Fm(e),e===null?null:e.stateNode},findFiberByHostInstance:qo.findFiberByHostInstance||Tb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ii=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ii.isDisabled&&Ii.supportsFiber)try{Va=Ii.inject(jb),cn=Ii}catch{}}It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ab;It.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!jd(t))throw Error(B(200));return Nb(e,t,null,n)};It.createRoot=function(e,t){if(!jd(e))throw Error(B(299));var n=!1,r="",o=yy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Td(e,1,!1,null,null,n,!1,r,o),e[Rn]=t.current,_s(e.nodeType===8?e.parentNode:e),new Ad(t)};It.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=Fm(t),e=e===null?null:e.stateNode,e};It.flushSync=function(e){return zr(e)};It.hydrate=function(e,t,n){if(!tl(t))throw Error(B(200));return nl(null,e,t,!0,n)};It.hydrateRoot=function(e,t,n){if(!jd(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",i=yy;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=gy(t,null,e,1,n??null,o,!1,s,i),e[Rn]=t.current,_s(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new el(t)};It.render=function(e,t,n){if(!tl(t))throw Error(B(200));return nl(null,e,t,!1,n)};It.unmountComponentAtNode=function(e){if(!tl(e))throw Error(B(40));return e._reactRootContainer?(zr(function(){nl(null,null,e,!1,function(){e._reactRootContainer=null,e[Rn]=null})}),!0):!1};It.unstable_batchedUpdates=Rd;It.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!tl(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return nl(e,t,n,!1,r)};It.version="18.3.1-next-f1338f8080-20240426";function vy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vy)}catch(e){console.error(e)}}vy(),vm.exports=It;var Ks=vm.exports;const Lb=Bu(Ks);var Oh=Ks;kc.createRoot=Oh.createRoot,kc.hydrateRoot=Oh.hydrateRoot;function ve(e,t="Assertion error"){if(!e)throw Error(t)}function Io({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,o)=>(r+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,r),0)}function wu(e,t){return t.sort(e==="horizontal"?Ob:Db)}function Ob(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Db(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function xy(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function wy(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Fb({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let o,s=Number.MAX_VALUE;for(const i of t){const{x:a,y:l}=wy(r,i),c=e==="horizontal"?a:l;c<s&&(s=c,o=i)}return ve(o,"No rect found"),o}function by(e){const{element:t,orientation:n,panels:r,separators:o}=e,s=wu(n,Array.from(t.children).filter(xy).map(u=>({element:u}))).map(({element:u})=>u),i=[];let a=!1,l,c=[];for(const u of s)if(u.hasAttribute("data-panel")){const f=r.find(h=>h.element===u);if(f){if(l){const h=l.element.getBoundingClientRect(),y=u.getBoundingClientRect();let m;if(a){const v=n==="horizontal"?new DOMRect(h.right,h.top,0,h.height):new DOMRect(h.left,h.bottom,h.width,0),b=n==="horizontal"?new DOMRect(y.left,y.top,0,y.height):new DOMRect(y.left,y.top,y.width,0);switch(c.length){case 0:{m=[v,b];break}case 1:{const g=c[0],x=Fb({orientation:n,rects:[h,y],targetRect:g.element.getBoundingClientRect()});m=[g,x===h?b:v];break}default:{m=c;break}}}else c.length?m=c:m=[n==="horizontal"?new DOMRect(h.right,y.top,y.left-h.right,y.height):new DOMRect(y.left,h.bottom,y.width,y.top-h.bottom)];for(const v of m)i.push({group:e,groupSize:Io({group:e}),panels:[l,f],separator:"width"in v?void 0:v,rect:"width"in v?v:v.element.getBoundingClientRect()})}a=!1,l=f,c=[]}}else if(u.hasAttribute("data-separator")){const f=o.find(h=>h.element===u);f?c.push(f):(l=void 0,c=[])}else a=!0;return i}function Bb(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function $b(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function Vb(e){return e/100*window.innerHeight}function Ub(e){return e/100*window.innerWidth}function Wb(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function _i({groupSize:e,panelElement:t,styleProp:n}){let r;const[o,s]=Wb(n);switch(s){case"%":{r=o/100*e;break}case"px":{r=o;break}case"rem":{r=$b(t,o);break}case"em":{r=Bb(t,o);break}case"vh":{r=Vb(o);break}case"vw":{r=Ub(o);break}}return r}function Yt(e){return parseFloat(e.toFixed(3))}function Dh(e){const{panels:t}=e,n=Io({group:e});return n===0?t.map(r=>({collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:o,panelConstraints:s}=r;let i=0;if(s.collapsedSize){const u=_i({groupSize:n,panelElement:o,styleProp:s.collapsedSize});i=Yt(u/n*100)}let a;if(s.defaultSize){const u=_i({groupSize:n,panelElement:o,styleProp:s.defaultSize});a=Yt(u/n*100)}let l=0;if(s.minSize){const u=_i({groupSize:n,panelElement:o,styleProp:s.minSize});l=Yt(u/n*100)}let c=100;if(s.maxSize){const u=_i({groupSize:n,panelElement:o,styleProp:s.maxSize});c=Yt(u/n*100)}return{collapsedSize:i,collapsible:s.collapsible===!0,defaultSize:a,minSize:l,maxSize:c,panelId:r.id}})}class Hb{#e={};addListener(t,n){const r=this.#e[t];return r===void 0?this.#e[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=this.#e[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let o=!1,s=null;const i=Array.from(r);for(let a=0;a<i.length;a++){const l=i[a];try{l.call(null,n)}catch(c){s===null&&(o=!0,s=c)}}if(o)throw s}}removeAllListeners(){this.#e={}}removeListener(t,n){const r=this.#e[t];if(r!==void 0){const o=r.indexOf(n);o>=0&&r.splice(o,1)}}}function tt(e,t,n=0){return Math.abs(Yt(e)-Yt(t))<=n}let Pt={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const kr=new Hb;function Lt(){return Pt}function pt(e){const t=typeof e=="function"?e(Pt):e;if(Pt===t)return Pt;const n=Pt;return Pt={...Pt,...t},t.cursorFlags!==void 0&&kr.emit("cursorFlagsChange",Pt.cursorFlags),t.interactionState!==void 0&&kr.emit("interactionStateChange",Pt.interactionState),t.mountedGroups!==void 0&&(Pt.mountedGroups.forEach((r,o)=>{r.derivedPanelConstraints.forEach(s=>{if(s.collapsible){const{layout:i}=n.mountedGroups.get(o)??{};if(i){const a=tt(s.collapsedSize,r.layout[s.panelId]),l=tt(s.collapsedSize,i[s.panelId]);a&&!l&&(o.inMemoryLastExpandedPanelSizes[s.panelId]=i[s.panelId])}}})}),kr.emit("mountedGroupsChange",Pt.mountedGroups)),Pt}function Gb(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function js(e,t){return tt(e,t)?0:e>t?1:-1}function lo({panelConstraints:e,size:t}){const{collapsedSize:n=0,collapsible:r,maxSize:o=100,minSize:s=0}=e;if(js(t,s)<0)if(r){const i=(n+s)/2;js(t,i)<0?t=n:t=s}else t=s;return t=Math.min(o,t),t=Yt(t),t}function Ls({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:s}){if(tt(e,0))return t;const i=Object.values(t),a=Object.values(o),l=[...i],[c,u]=r;ve(c!=null,"Invalid first pivot index"),ve(u!=null,"Invalid second pivot index");let f=0;if(s==="keyboard"){{const m=e<0?u:c,v=n[m];ve(v,`Panel constraints not found for index ${m}`);const{collapsedSize:b=0,collapsible:g,minSize:x=0}=v;if(g){const w=i[m];if(ve(w!=null,`Previous layout not found for panel index ${m}`),tt(w,b)){const S=x-w;js(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const m=e<0?c:u,v=n[m];ve(v,`No panel constraints found for index ${m}`);const{collapsedSize:b=0,collapsible:g,minSize:x=0}=v;if(g){const w=i[m];if(ve(w!=null,`Previous layout not found for panel index ${m}`),tt(w,x)){const S=w-b;js(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}}{const m=e<0?1:-1;let v=e<0?u:c,b=0;for(;;){const x=i[v];ve(x!=null,`Previous layout not found for panel index ${v}`);const w=lo({panelConstraints:n[v],size:100})-x;if(b+=w,v+=m,v<0||v>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(b));e=e<0?0-g:g}{let m=e<0?c:u;for(;m>=0&&m<n.length;){const v=Math.abs(e)-Math.abs(f),b=i[m];ve(b!=null,`Previous layout not found for panel index ${m}`);const g=b-v,x=lo({panelConstraints:n[m],size:g});if(!tt(b,x)&&(f+=b-x,l[m]=x,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?m--:m++}}if(Gb(a,l))return o;{const m=e<0?u:c,v=i[m];ve(v!=null,`Previous layout not found for panel index ${m}`);const b=v+f,g=lo({panelConstraints:n[m],size:b});if(l[m]=g,!tt(g,b)){let x=b-g,w=e<0?u:c;for(;w>=0&&w<n.length;){const S=l[w];ve(S!=null,`Previous layout not found for panel index ${w}`);const C=S+x,_=lo({panelConstraints:n[w],size:C});if(tt(S,_)||(x-=_-S,l[w]=_),tt(x,0))break;e>0?w--:w++}}}const h=Object.values(l).reduce((m,v)=>v+m,0);if(!tt(h,100,.1))return o;const y=Object.keys(o);return l.reduce((m,v,b)=>(m[y[b]]=v,m),{})}function Xi(e){const{mountedGroups:t}=Lt();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function Ar(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||js(e[n],t[n])!==0)return!1;return!0}function jr({layout:e,panelConstraints:t}){const n=[...Object.values(e)],r=n.reduce((i,a)=>i+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!tt(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const a=n[i];ve(a!=null,`No layout data found for index ${i}`);const l=100/r*a;n[i]=l}let o=0;for(let i=0;i<t.length;i++){const a=n[i];ve(a!=null,`No layout data found for index ${i}`);const l=lo({panelConstraints:t[i],size:a});a!=l&&(o+=a-l,n[i]=l)}if(!tt(o,0))for(let i=0;i<t.length;i++){const a=n[i];ve(a!=null,`No layout data found for index ${i}`);const l=a+o,c=lo({panelConstraints:t[i],size:l});if(a!==c&&(o-=c-a,n[i]=c,tt(o,0)))break}const s=Object.keys(e);return n.reduce((i,a,l)=>(i[s[l]]=a,i),{})}function Sy({groupId:e}){const t=()=>{const{mountedGroups:n}=Lt();for(const[r,o]of n)if(r.id===e)return{group:r,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:o,group:s,layout:i,separatorToPanels:a}=t(),l=jr({layout:n,panelConstraints:o});return r?i:(Ar(i,l)||pt(c=>({mountedGroups:new Map(c.mountedGroups).set(s,{defaultLayoutDeferred:r,derivedPanelConstraints:o,layout:l,separatorToPanels:a})})),l)}}}function Cy(e){const{mountedGroups:t}=Lt(),n=t.get(e);return ve(n,`Mounted Group ${e.id} not found`),n}function pr(e,t){const n=Xi(e),r=Cy(n),o=n.separators.find(u=>u.element===e);ve(o,"Matching separator not found");const s=r.separatorToPanels.get(o);ve(s,"Matching panels not found");const i=s.map(u=>n.panels.indexOf(u)),a=Sy({groupId:n.id}).getLayout(),l=Ls({delta:t,initialLayout:a,panelConstraints:r.derivedPanelConstraints,pivotIndices:i,prevLayout:a,trigger:"keyboard"}),c=jr({layout:l,panelConstraints:r.derivedPanelConstraints});Ar(a,c)||pt(u=>({mountedGroups:new Map(u.mountedGroups).set(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,layout:c,separatorToPanels:r.separatorToPanels})}))}function Fh(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Xi(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&pr(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&pr(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&pr(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&pr(t,-5);break}case"End":{e.preventDefault(),pr(t,100);break}case"Enter":{e.preventDefault();const r=Xi(t),{derivedPanelConstraints:o,layout:s,separatorToPanels:i}=Cy(r),a=r.separators.find(f=>f.element===t);ve(a,"Matching separator not found");const l=i.get(a);ve(l,"Matching panels not found");const c=l[0],u=o.find(f=>f.panelId===c.id);if(ve(u,"Panel metadata not found"),u.collapsible){const f=s[c.id],h=u.collapsedSize===f?r.inMemoryLastExpandedPanelSizes[c.id]??u.minSize:u.collapsedSize;pr(t,h-f)}break}case"F6":{e.preventDefault();const r=Xi(t).separators.map(i=>i.element),o=Array.from(r).findIndex(i=>i===e.currentTarget);ve(o!==null,"Index not found");const s=e.shiftKey?o>0?o-1:r.length-1:o+1<r.length?o+1:0;r[s].focus();break}case"Home":{e.preventDefault(),pr(t,-100);break}}}const Yb=e=>e,sc=()=>{},Ey=1,Iy=2,_y=4,ky=8,Bh={coarse:10,precise:5};function qb(e,t,n){let r,o={x:1/0,y:1/0};for(const s of t){const i=wy(n,s.rect);switch(e){case"horizontal":{i.x<=o.x&&(r=s,o=i);break}case"vertical":{i.y<=o.y&&(r=s,o=i);break}}}return r?{distance:o,hitRegion:r}:void 0}let ki;function Xb(){return ki===void 0&&(typeof matchMedia=="function"?ki=!!matchMedia("(pointer:coarse)").matches:ki=!1),ki}function Qb(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Kb(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Uh(e),b:Uh(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;ve(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Vh($h(n.a)),b:Vh($h(n.b))};if(o.a===o.b){const s=r.childNodes,i={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===i.a)return 1;if(l===i.b)return-1}}return Math.sign(o.a-o.b)}const Zb=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Jb(e){const t=getComputedStyle(Ry(e)??e).display;return t==="flex"||t==="inline-flex"}function eS(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Jb(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Zb.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function $h(e){let t=e.length;for(;t--;){const n=e[t];if(ve(n,"Missing node"),eS(n))return n}return null}function Vh(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Uh(e){const t=[];for(;e;)t.push(e),e=Ry(e);return t}function Ry(e){const{parentNode:t}=e;return Qb(t)?t.host:t}function tS(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function nS({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!xy(n)||n.contains(e)||e.contains(n))return!0;if(Kb(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(tS(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Py(e,t){const n=[];return t.forEach((r,o)=>{if(o.disabled)return;const s=Xb()?Bh.coarse:Bh.precise,i=by(o),a=qb(o.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=s&&a.distance.y<=s&&nS({groupElement:o.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Wh(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{mountedGroups:t}=Lt(),n=Py(e,t),r=new Set,o=new Set,s=new Set,i=new Map;let a=!1;n.forEach(l=>{r.add(l.group),l.panels.forEach(u=>{o.add(u)}),l.separator&&(s.add(l.separator),a||(a=!0,l.separator.element.focus()));const c=t.get(l.group);c&&i.set(l.group,c.layout)}),pt({interactionState:{hitRegions:n,initialLayoutMap:i,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),n.length&&e.preventDefault()}function rS({cursorFlags:e,groups:t,state:n}){let r=0,o=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{o++;break}}})}if(r===0&&o===0)return null;switch(n){case"active":{const s=(e&Ey)!==0,i=(e&Iy)!==0,a=(e&_y)!==0,l=(e&ky)!==0;if(e){if(s)return a?"se-resize":l?"ne-resize":"e-resize";if(i)return a?"sw-resize":l?"nw-resize":"w-resize";if(a)return"s-resize";if(l)return"n-resize"}break}}return r>0&&o>0?"move":r>0?"ew-resize":"ns-resize"}const Hh=new WeakMap;function Ld(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Hh.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets=[n]);const{cursorFlags:r,interactionState:o}=Lt();switch(o.state){case"active":case"hover":{const s=rS({cursorFlags:r,groups:o.hitRegions.map(a=>a.group),state:o.state}),i=`*{cursor: ${s} !important; ${o.state==="active"?"touch-action: none;":""} }`;if(t===i)return;t=i,s?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}Hh.set(e,{prevStyle:t,styleSheet:n})}function My({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:o,pointerDownAtPoint:s}){let i=0;const a=new Map(o);n.forEach(l=>{const{group:c,groupSize:u}=l,{disableCursor:f,orientation:h,panels:y}=c;let m=0;s?h==="horizontal"?m=(t.clientX-s.x)/u*100:m=(t.clientY-s.y)/u*100:h==="horizontal"?m=t.clientX<0?-100:100:m=t.clientY<0?-100:100;const v=r.get(c),{defaultLayoutDeferred:b,derivedPanelConstraints:g,layout:x,separatorToPanels:w}=o.get(c)??{defaultLayoutDeferred:!1};if(g&&v&&x&&w){const S=Ls({delta:m,initialLayout:v,panelConstraints:g,pivotIndices:l.panels.map(C=>y.indexOf(C)),prevLayout:x,trigger:"mouse-or-touch"});if(Ar(S,x)){if(m!==0&&!f)switch(h){case"horizontal":{i|=m<0?Ey:Iy;break}case"vertical":{i|=m<0?_y:ky;break}}}else{a.set(l.group,{defaultLayoutDeferred:b,derivedPanelConstraints:g,layout:S,separatorToPanels:w});const C=l.group.panels.map(({id:_})=>_).join(",");l.group.inMemoryLayouts[C]=S}}}),pt({cursorFlags:i,mountedGroups:a}),Ld(e)}function Gh(e){const{interactionState:t,mountedGroups:n}=Lt();switch(t.state){case"active":My({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})}}function Yh(e){if(e.defaultPrevented)return;const{interactionState:t,mountedGroups:n}=Lt();switch(t.state){case"active":{if(e.buttons===0){pt(r=>r.interactionState.state==="inactive"?r:{cursorFlags:0,interactionState:{state:"inactive"}}),pt(r=>({mountedGroups:new Map(r.mountedGroups)}));return}My({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break}default:{const r=Py(e,n);r.length===0?t.state!=="inactive"&&pt({interactionState:{state:"inactive"}}):pt({interactionState:{hitRegions:r,state:"hover"}}),Ld(e.currentTarget);break}}}function qh(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{interactionState:t}=Lt();switch(t.state){case"active":pt({cursorFlags:0,interactionState:{state:"inactive"}}),t.hitRegions.length>0&&(Ld(e.currentTarget),pt(n=>({mountedGroups:new Map(n.mountedGroups)})),e.preventDefault())}}function Xh(e){let t=0,n=0;const r={};for(const s of e)if(s.defaultSize!==void 0){t++;const i=Yt(s.defaultSize);n+=i,r[s.panelId]=i}else r[s.panelId]=void 0;const o=e.length-t;if(o!==0){const s=Yt((100-n)/o);for(const i of e)i.defaultSize===void 0&&(r[i.panelId]=s)}return r}function oS(e,t,n){if(!n[0])return;const r=e.panels.find(l=>l.element===t);if(!r||!r.onResize)return;const o=Io({group:e}),s=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,i=r.mutableValues.prevSize,a={asPercentage:Yt(s/o*100),inPixels:s};r.mutableValues.prevSize=a,r.onResize(a,r.id,i)}function sS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function iS(e,t){const n=e.map(o=>o.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o))return!1;return!0}const Wr=new Map;function aS(e){let t=!0;ve(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,o=new Set,s=new n(m=>{for(const v of m){const{borderBoxSize:b,target:g}=v;if(g===e.element){if(t){if(Io({group:e})===0)return;pt(x=>{const w=x.mountedGroups.get(e);if(w){const S=Dh(e),C=w.defaultLayoutDeferred?Xh(S):w.layout,_=jr({layout:C,panelConstraints:S});return!w.defaultLayoutDeferred&&Ar(C,_)&&sS(w.derivedPanelConstraints,S)?x:{mountedGroups:new Map(x.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:S,layout:_,separatorToPanels:w.separatorToPanels})}}return x})}}else oS(e,g,b)}});s.observe(e.element),e.panels.forEach(m=>{ve(!r.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.onResize&&s.observe(m.element)});const i=Io({group:e}),a=Dh(e),l=e.panels.map(({id:m})=>m).join(",");let c=e.defaultLayout;c&&(iS(e.panels,c)||(c=void 0));const u=e.inMemoryLayouts[l]??c??Xh(a),f=jr({layout:u,panelConstraints:a}),h=by(e),y=e.element.ownerDocument;return pt(m=>{const v=new Map;return Wr.set(y,(Wr.get(y)??0)+1),h.forEach(b=>{b.separator&&v.set(b.separator,b.panels)}),{mountedGroups:new Map(m.mountedGroups).set(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:a,layout:f,separatorToPanels:v})}}),e.separators.forEach(m=>{ve(!o.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.element.addEventListener("keydown",Fh)}),Wr.get(y)===1&&(y.addEventListener("pointerdown",Wh,!0),y.addEventListener("pointerleave",Gh),y.addEventListener("pointermove",Yh),y.addEventListener("pointerup",qh,!0)),function(){t=!1,Wr.set(y,Math.max(0,(Wr.get(y)??0)-1)),pt(m=>{const v=new Map(m.mountedGroups);return v.delete(e),{mountedGroups:v}}),e.separators.forEach(m=>{m.element.removeEventListener("keydown",Fh)}),Wr.get(y)||(y.removeEventListener("pointerdown",Wh,!0),y.removeEventListener("pointerleave",Gh),y.removeEventListener("pointermove",Yh),y.removeEventListener("pointerup",qh,!0)),s.disconnect()}}function Ny(){const[e,t]=p.useState({}),n=p.useCallback(()=>t({}),[]);return[e,n]}function Od(e){const t=p.useId();return`${e??t}`}const Fr=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ps(e){const t=p.useRef(e);return Fr(()=>{t.current=e},[e]),p.useCallback((...n)=>t.current?.(...n),[t])}function Dd(...e){return ps(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function lS(e){const t=p.useRef({...e});return Fr(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Ty=p.createContext(null);function cS(e,t){const n=p.useRef({getLayout:()=>({}),setLayout:Yb});p.useImperativeHandle(t,()=>n.current,[]),Fr(()=>{Object.assign(n.current,Sy({groupId:e}))})}function zy({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:o,elementRef:s,groupRef:i,id:a,onLayoutChange:l,onLayoutChanged:c,orientation:u="horizontal",style:f,...h}){const y=p.useRef({onLayoutChange:{},onLayoutChanged:{}}),m=ps(R=>{Ar(y.current.onLayoutChange,R)||(y.current.onLayoutChange=R,l?.(R))}),v=ps(R=>{Ar(y.current.onLayoutChanged,R)||(y.current.onLayoutChanged=R,c?.(R))}),b=Od(a),g=p.useRef(null),[x,w]=Ny(),S=p.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),C=Dd(g,s);cS(b,i);const _=ps((R,z)=>{const{interactionState:P,mountedGroups:j}=Lt();for(const W of j.keys())if(W.id===R){const $=j.get(W);if($){let O=!1;switch(P.state){case"active":{O=P.hitRegions.some(H=>H.group===W);break}}return{flexGrow:$.layout[z]??1,pointerEvents:O?"none":void 0}}}return{flexGrow:n?.[z]??1}}),E=p.useMemo(()=>({getPanelStyles:_,id:b,orientation:u,registerPanel:R=>{const z=S.current;return z.panels=wu(u,[...z.panels,R]),w(),()=>{z.panels=z.panels.filter(P=>P!==R),w()}},registerSeparator:R=>{const z=S.current;return z.separators=wu(u,[...z.separators,R]),w(),()=>{z.separators=z.separators.filter(P=>P!==R),w()}}}),[_,b,w,u]),I=lS({defaultLayout:n,disableCursor:r}),M=p.useRef(null);return Fr(()=>{const R=g.current;if(R===null)return;const z=S.current,P={defaultLayout:I.defaultLayout,disableCursor:!!I.disableCursor,disabled:!!o,element:R,id:b,inMemoryLastExpandedPanelSizes:S.current.lastExpandedPanelSizes,inMemoryLayouts:S.current.layouts,orientation:u,panels:z.panels,separators:z.separators};M.current=P;const j=aS(P),W=Lt().mountedGroups.get(P);if(W){const{defaultLayoutDeferred:H,derivedPanelConstraints:k,layout:N}=W;!H&&k.length>0&&(m(N),v(N),z.panels.forEach(U=>{U.scheduleUpdate()}))}const $=kr.addListener("interactionStateChange",()=>{z.panels.forEach(H=>{H.scheduleUpdate()})}),O=kr.addListener("mountedGroupsChange",H=>{const k=H.get(P);if(k){const{defaultLayoutDeferred:N,derivedPanelConstraints:U,layout:re}=k;if(N||U.length===0)return;const{interactionState:K}=Lt(),J=K.state!=="active";m(re),J&&v(re),z.panels.forEach(oe=>{oe.scheduleUpdate()})}});return()=>{M.current=null,j(),$(),O()}},[o,b,v,m,u,x,I]),p.useEffect(()=>{const R=M.current;R&&(R.defaultLayout=n,R.disableCursor=!!r)}),d.jsx(Ty.Provider,{value:E,children:d.jsx("div",{...h,"aria-orientation":u,className:t,"data-group":!0,"data-testid":b,id:b,ref:C,style:{height:"100%",width:"100%",overflow:"hidden",...f,display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}zy.displayName="Group";function Fd(){const e=p.useContext(Ty);return ve(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function uS({groupId:e,panelId:t}){const n=()=>{const{mountedGroups:a}=Lt();for(const[l,{defaultLayoutDeferred:c,derivedPanelConstraints:u,layout:f,separatorToPanels:h}]of a)if(l.id===e)return{defaultLayoutDeferred:c,derivedPanelConstraints:u,group:l,layout:f,separatorToPanels:h};throw Error(`Group ${e} not found`)},r=()=>{const a=n().derivedPanelConstraints.find(l=>l.panelId===t);if(a!==void 0)return a;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const a=n().group.panels.find(l=>l.id===t);if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},s=()=>{const a=n().layout[t];if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},i=a=>{const l=s();if(a===l)return;const{defaultLayoutDeferred:c,derivedPanelConstraints:u,group:f,layout:h,separatorToPanels:y}=n(),m=f.panels.findIndex(x=>x.id===t),v=m===f.panels.length-1,b=Ls({delta:v?l-a:a-l,initialLayout:h,panelConstraints:u,pivotIndices:v?[m-1,m]:[m,m+1],prevLayout:h,trigger:"imperative-api"}),g=jr({layout:b,panelConstraints:u});Ar(h,g)||pt(x=>({mountedGroups:new Map(x.mountedGroups).set(f,{defaultLayoutDeferred:c,derivedPanelConstraints:u,layout:g,separatorToPanels:y})}))};return{collapse:()=>{const{collapsible:a,collapsedSize:l}=r(),{mutableValues:c}=o(),u=s();a&&u!==l&&(c.expandToSize=u,i(l))},expand:()=>{const{collapsible:a,collapsedSize:l,minSize:c}=r(),{mutableValues:u}=o(),f=s();if(a&&f===l){let h=u.expandToSize??c;h===0&&(h=1),i(h)}},getSize:()=>{const{group:a}=n(),l=s(),{element:c}=o(),u=a.orientation==="horizontal"?c.offsetWidth:c.offsetHeight;return{asPercentage:l,inPixels:u}},isCollapsed:()=>{const{collapsible:a,collapsedSize:l}=r(),c=s();return a&&tt(l,c)},resize:a=>{if(s()!==a){let l;switch(typeof a){case"number":{const{group:c}=n(),u=Io({group:c});l=Yt(a/u*100);break}case"string":{l=parseFloat(a);break}}i(l)}}}}function dS(e,t){const{id:n}=Fd(),r=p.useRef({collapse:sc,expand:sc,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:sc});p.useImperativeHandle(t,()=>r.current,[]),Fr(()=>{Object.assign(r.current,uS({groupId:n,panelId:e}))})}function Qi({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:o,elementRef:s,id:i,maxSize:a="100%",minSize:l="0%",onResize:c,panelRef:u,style:f,...h}){const y=!!i,m=Od(i),v=p.useRef(null),b=Dd(v,s),[,g]=Ny(),{getPanelStyles:x,id:w,registerPanel:S}=Fd(),C=c!==null,_=ps((I,M,R)=>{c?.(I,i,R)});Fr(()=>{const I=v.current;if(I!==null)return S({element:I,id:m,idIsStable:y,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:C?_:void 0,panelConstraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},scheduleUpdate:g})},[n,r,o,g,C,m,y,a,l,_,S]),dS(m,u);const E=x(w,m);return d.jsx("div",{...h,"data-panel":!0,"data-testid":m,id:m,ref:b,style:{...fS,flexBasis:0,flexShrink:1,overflow:"hidden",...E},children:d.jsx("div",{className:t,style:{width:"100%",height:"100%",...f},children:e})})}Qi.displayName="Panel";const fS={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function hS({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let o,s;const i=e[n],a=t.find(l=>l.panelId===n);if(a){const l=a.maxSize,c=s=a.collapsible?a.collapsedSize:a.minSize,u=[r,r+1];s=jr({layout:Ls({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n],o=jr({layout:Ls({delta:l-i,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n]}return{valueControls:n,valueMax:o,valueMin:s,valueNow:i}}function bu({children:e,className:t,elementRef:n,id:r,style:o,...s}){const i=Od(r),[a,l]=p.useState({}),[c,u]=p.useState("inactive"),f=p.useRef(null),h=Dd(f,n),{id:y,orientation:m,registerSeparator:v}=Fd(),b=m==="horizontal"?"vertical":"horizontal";return Fr(()=>{const g=f.current;if(g!==null){const x={element:g,id:i},w=v(x),S=kr.addListener("interactionStateChange",_=>{u(_.state!=="inactive"&&_.hitRegions.some(E=>E.separator===x)?_.state:"inactive")}),C=kr.addListener("mountedGroupsChange",_=>{_.forEach(({derivedPanelConstraints:E,layout:I,separatorToPanels:M},R)=>{if(R.id===y){const z=M.get(x);if(z){const P=z[0],j=R.panels.indexOf(P);l(hS({layout:I,panelConstraints:E,panelId:P.id,panelIndex:j}))}}})});return()=>{S(),C(),w()}}},[y,i,v]),d.jsx("div",{...s,"aria-controls":a.valueControls,"aria-orientation":b,"aria-valuemax":a.valueMax,"aria-valuemin":a.valueMin,"aria-valuenow":a.valueNow,children:e,className:t,"data-separator":c,"data-testid":i,id:i,ref:h,role:"separator",style:{flexBasis:"auto",...o,flexGrow:0,flexShrink:0},tabIndex:0})}bu.displayName="Separator";function ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Qh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zs(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Qh(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Qh(e[o],null)}}}}function ze(...e){return p.useCallback(Zs(...e),e)}function An(e,t=[]){let n=[];function r(s,i){const a=p.createContext(i),l=n.length;n=[...n,i];const c=f=>{const{scope:h,children:y,...m}=f,v=h?.[e]?.[l]||a,b=p.useMemo(()=>m,Object.values(m));return d.jsx(v.Provider,{value:b,children:y})};c.displayName=s+"Provider";function u(f,h){const y=h?.[e]?.[l]||a,m=p.useContext(y);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=n.map(i=>p.createContext(i));return function(a){const l=a?.[e]||s;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,pS(o,...t)]}function pS(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function ka(e){const t=mS(e),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),l=a.find(yS);if(l){const c=l.props.children,u=a.map(f=>f===l?p.Children.count(c)>1?p.Children.only(null):p.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...i,ref:o,children:p.isValidElement(c)?p.cloneElement(c,void 0,u):null})}return d.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function mS(e){const t=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=xS(o),a=vS(s,o.props);return o.type!==p.Fragment&&(a.ref=r?Zs(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ay=Symbol("radix.slottable");function gS(e){const t=({children:n})=>d.jsx(d.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ay,t}function yS(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ay}function vS(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function xS(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],me=wS.reduce((e,t)=>{const n=ka(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function jy(e,t){e&&Ks.flushSync(()=>e.dispatchEvent(t))}function Ze(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>t.current?.(...n),[])}function bS(e,t=globalThis?.document){const n=Ze(e);p.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var SS="DismissableLayer",Su="dismissableLayer.update",CS="dismissableLayer.pointerDownOutside",ES="dismissableLayer.focusOutside",Kh,Ly=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bd=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=p.useContext(Ly),[u,f]=p.useState(null),h=u?.ownerDocument??globalThis?.document,[,y]=p.useState({}),m=ze(t,E=>f(E)),v=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(b),x=u?v.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,S=x>=g,C=kS(E=>{const I=E.target,M=[...c.branches].some(R=>R.contains(I));!S||M||(o?.(E),i?.(E),E.defaultPrevented||a?.())},h),_=RS(E=>{const I=E.target;[...c.branches].some(R=>R.contains(I))||(s?.(E),i?.(E),E.defaultPrevented||a?.())},h);return bS(E=>{x===c.layers.size-1&&(r?.(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),p.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Kh=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Zh(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Kh)}},[u,h,n,c]),p.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Zh())},[u,c]),p.useEffect(()=>{const E=()=>y({});return document.addEventListener(Su,E),()=>document.removeEventListener(Su,E)},[]),d.jsx(me.div,{...l,ref:m,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,_.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,C.onPointerDownCapture)})});Bd.displayName=SS;var IS="DismissableLayerBranch",_S=p.forwardRef((e,t)=>{const n=p.useContext(Ly),r=p.useRef(null),o=ze(t,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),d.jsx(me.div,{...e,ref:o})});_S.displayName=IS;function kS(e,t=globalThis?.document){const n=Ze(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Oy(CS,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function RS(e,t=globalThis?.document){const n=Ze(e),r=p.useRef(!1);return p.useEffect(()=>{const o=s=>{s.target&&!r.current&&Oy(ES,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Zh(){const e=new CustomEvent(Su);document.dispatchEvent(e)}function Oy(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?jy(o,s):o.dispatchEvent(s)}var fn=globalThis?.document?p.useLayoutEffect:()=>{},PS=Hu[" useId ".trim().toString()]||(()=>{}),MS=0;function _o(e){const[t,n]=p.useState(PS());return fn(()=>{n(r=>r??String(MS++))},[e]),t?`radix-${t}`:""}const NS=["top","right","bottom","left"],or=Math.min,wt=Math.max,Ra=Math.round,Ri=Math.floor,dn=e=>({x:e,y:e}),TS={left:"right",right:"left",bottom:"top",top:"bottom"},zS={start:"end",end:"start"};function Cu(e,t,n){return wt(e,or(t,n))}function Nn(e,t){return typeof e=="function"?e(t):e}function Tn(e){return e.split("-")[0]}function Ao(e){return e.split("-")[1]}function $d(e){return e==="x"?"y":"x"}function Vd(e){return e==="y"?"height":"width"}const AS=new Set(["top","bottom"]);function ln(e){return AS.has(Tn(e))?"y":"x"}function Ud(e){return $d(ln(e))}function jS(e,t,n){n===void 0&&(n=!1);const r=Ao(e),o=Ud(e),s=Vd(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Pa(i)),[i,Pa(i)]}function LS(e){const t=Pa(e);return[Eu(e),t,Eu(t)]}function Eu(e){return e.replace(/start|end/g,t=>zS[t])}const Jh=["left","right"],ep=["right","left"],OS=["top","bottom"],DS=["bottom","top"];function FS(e,t,n){switch(e){case"top":case"bottom":return n?t?ep:Jh:t?Jh:ep;case"left":case"right":return t?OS:DS;default:return[]}}function BS(e,t,n,r){const o=Ao(e);let s=FS(Tn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Eu)))),s}function Pa(e){return e.replace(/left|right|bottom|top/g,t=>TS[t])}function $S(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dy(e){return typeof e!="number"?$S(e):{top:e,right:e,bottom:e,left:e}}function Ma(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function tp(e,t,n){let{reference:r,floating:o}=e;const s=ln(t),i=Ud(t),a=Vd(i),l=Tn(t),c=s==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let y;switch(l){case"top":y={x:u,y:r.y-o.height};break;case"bottom":y={x:u,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:f};break;case"left":y={x:r.x-o.width,y:f};break;default:y={x:r.x,y:r.y}}switch(Ao(t)){case"start":y[i]-=h*(n&&c?-1:1);break;case"end":y[i]+=h*(n&&c?-1:1);break}return y}const VS=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=tp(c,r,l),h=r,y={},m=0;for(let v=0;v<a.length;v++){const{name:b,fn:g}=a[v],{x,y:w,data:S,reset:C}=await g({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:y,rects:c,platform:i,elements:{reference:e,floating:t}});u=x??u,f=w??f,y={...y,[b]:{...y[b],...S}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:f}=tp(c,h,l)),v=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:y}};async function Os(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:y=0}=Nn(t,e),m=Dy(y),b=a[h?f==="floating"?"reference":"floating":f],g=Ma(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Ma(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(g.top-C.top+m.top)/S.y,bottom:(C.bottom-g.bottom+m.bottom)/S.y,left:(g.left-C.left+m.left)/S.x,right:(C.right-g.right+m.right)/S.x}}const US=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Nn(e,t)||{};if(c==null)return{};const f=Dy(u),h={x:n,y:r},y=Ud(o),m=Vd(y),v=await i.getDimensions(c),b=y==="y",g=b?"top":"left",x=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=s.reference[m]+s.reference[y]-h[y]-s.floating[m],C=h[y]-s.reference[y],_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=_?_[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(_)))&&(E=a.floating[w]||s.floating[m]);const I=S/2-C/2,M=E/2-v[m]/2-1,R=or(f[g],M),z=or(f[x],M),P=R,j=E-v[m]-z,W=E/2-v[m]/2+I,$=Cu(P,W,j),O=!l.arrow&&Ao(o)!=null&&W!==$&&s.reference[m]/2-(W<P?R:z)-v[m]/2<0,H=O?W<P?W-P:W-j:0;return{[y]:h[y]+H,data:{[y]:$,centerOffset:W-$-H,...O&&{alignmentOffset:H}},reset:O}}}),WS=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...b}=Nn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=Tn(o),x=ln(a),w=Tn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(w||!v?[Pa(a)]:LS(a)),_=m!=="none";!h&&_&&C.push(...BS(a,v,m,S));const E=[a,...C],I=await Os(t,b),M=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&M.push(I[g]),f){const W=jS(o,i,S);M.push(I[W[0]],I[W[1]])}if(R=[...R,{placement:o,overflows:M}],!M.every(W=>W<=0)){var z,P;const W=(((z=s.flip)==null?void 0:z.index)||0)+1,$=E[W];if($&&(!(f==="alignment"?x!==ln($):!1)||R.every(k=>ln(k.placement)===x?k.overflows[0]>0:!0)))return{data:{index:W,overflows:R},reset:{placement:$}};let O=(P=R.filter(H=>H.overflows[0]<=0).sort((H,k)=>H.overflows[1]-k.overflows[1])[0])==null?void 0:P.placement;if(!O)switch(y){case"bestFit":{var j;const H=(j=R.filter(k=>{if(_){const N=ln(k.placement);return N===x||N==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(N=>N>0).reduce((N,U)=>N+U,0)]).sort((k,N)=>k[1]-N[1])[0])==null?void 0:j[0];H&&(O=H);break}case"initialPlacement":O=a;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function np(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rp(e){return NS.some(t=>e[t]>=0)}const HS=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Nn(e,t);switch(r){case"referenceHidden":{const s=await Os(t,{...o,elementContext:"reference"}),i=np(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:rp(i)}}}case"escaped":{const s=await Os(t,{...o,altBoundary:!0}),i=np(s,n.floating);return{data:{escapedOffsets:i,escaped:rp(i)}}}default:return{}}}}},Fy=new Set(["left","top"]);async function GS(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Tn(n),a=Ao(n),l=ln(n)==="y",c=Fy.has(i)?-1:1,u=s&&l?-1:1,f=Nn(t,e);let{mainAxis:h,crossAxis:y,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(y=a==="end"?m*-1:m),l?{x:y*u,y:h*c}:{x:h*c,y:y*u}}const YS=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await GS(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},qS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:b=>{let{x:g,y:x}=b;return{x:g,y:x}}},...l}=Nn(e,t),c={x:n,y:r},u=await Os(t,l),f=ln(Tn(o)),h=$d(f);let y=c[h],m=c[f];if(s){const b=h==="y"?"top":"left",g=h==="y"?"bottom":"right",x=y+u[b],w=y-u[g];y=Cu(x,y,w)}if(i){const b=f==="y"?"top":"left",g=f==="y"?"bottom":"right",x=m+u[b],w=m-u[g];m=Cu(x,m,w)}const v=a.fn({...t,[h]:y,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:s,[f]:i}}}}}},XS=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Nn(e,t),u={x:n,y:r},f=ln(o),h=$d(f);let y=u[h],m=u[f];const v=Nn(a,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const w=h==="y"?"height":"width",S=s.reference[h]-s.floating[w]+b.mainAxis,C=s.reference[h]+s.reference[w]-b.mainAxis;y<S?y=S:y>C&&(y=C)}if(c){var g,x;const w=h==="y"?"width":"height",S=Fy.has(Tn(o)),C=s.reference[f]-s.floating[w]+(S&&((g=i.offset)==null?void 0:g[f])||0)+(S?0:b.crossAxis),_=s.reference[f]+s.reference[w]+(S?0:((x=i.offset)==null?void 0:x[f])||0)-(S?b.crossAxis:0);m<C?m=C:m>_&&(m=_)}return{[h]:y,[f]:m}}}},QS=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Nn(e,t),u=await Os(t,c),f=Tn(o),h=Ao(o),y=ln(o)==="y",{width:m,height:v}=s.floating;let b,g;f==="top"||f==="bottom"?(b=f,g=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,b=h==="end"?"top":"bottom");const x=v-u.top-u.bottom,w=m-u.left-u.right,S=or(v-u[b],x),C=or(m-u[g],w),_=!t.middlewareData.shift;let E=S,I=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=x),_&&!h){const R=wt(u.left,0),z=wt(u.right,0),P=wt(u.top,0),j=wt(u.bottom,0);y?I=m-2*(R!==0||z!==0?R+z:wt(u.left,u.right)):E=v-2*(P!==0||j!==0?P+j:wt(u.top,u.bottom))}await l({...t,availableWidth:I,availableHeight:E});const M=await i.getDimensions(a.floating);return m!==M.width||v!==M.height?{reset:{rects:!0}}:{}}}};function rl(){return typeof window<"u"}function jo(e){return By(e)?(e.nodeName||"").toLowerCase():"#document"}function Ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pn(e){var t;return(t=(By(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function By(e){return rl()?e instanceof Node||e instanceof Ct(e).Node:!1}function Kt(e){return rl()?e instanceof Element||e instanceof Ct(e).Element:!1}function hn(e){return rl()?e instanceof HTMLElement||e instanceof Ct(e).HTMLElement:!1}function op(e){return!rl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ct(e).ShadowRoot}const KS=new Set(["inline","contents"]);function Js(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!KS.has(o)}const ZS=new Set(["table","td","th"]);function JS(e){return ZS.has(jo(e))}const eC=[":popover-open",":modal"];function ol(e){return eC.some(t=>{try{return e.matches(t)}catch{return!1}})}const tC=["transform","translate","scale","rotate","perspective"],nC=["transform","translate","scale","rotate","perspective","filter"],rC=["paint","layout","strict","content"];function Wd(e){const t=Hd(),n=Kt(e)?Zt(e):e;return tC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||nC.some(r=>(n.willChange||"").includes(r))||rC.some(r=>(n.contain||"").includes(r))}function oC(e){let t=sr(e);for(;hn(t)&&!ko(t);){if(Wd(t))return t;if(ol(t))return null;t=sr(t)}return null}function Hd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sC=new Set(["html","body","#document"]);function ko(e){return sC.has(jo(e))}function Zt(e){return Ct(e).getComputedStyle(e)}function sl(e){return Kt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sr(e){if(jo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||op(e)&&e.host||pn(e);return op(t)?t.host:t}function $y(e){const t=sr(e);return ko(t)?e.ownerDocument?e.ownerDocument.body:e.body:hn(t)&&Js(t)?t:$y(t)}function Ds(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=$y(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ct(o);if(s){const a=Iu(i);return t.concat(i,i.visualViewport||[],Js(o)?o:[],a&&n?Ds(a):[])}return t.concat(o,Ds(o,[],n))}function Iu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vy(e){const t=Zt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=hn(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ra(n)!==s||Ra(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Gd(e){return Kt(e)?e:e.contextElement}function go(e){const t=Gd(e);if(!hn(t))return dn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Vy(t);let i=(s?Ra(n.width):n.width)/r,a=(s?Ra(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const iC=dn(0);function Uy(e){const t=Ct(e);return!Hd()||!t.visualViewport?iC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ct(e)?!1:t}function Lr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Gd(e);let i=dn(1);t&&(r?Kt(r)&&(i=go(r)):i=go(e));const a=aC(s,n,r)?Uy(s):dn(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,f=o.height/i.y;if(s){const h=Ct(s),y=r&&Kt(r)?Ct(r):r;let m=h,v=Iu(m);for(;v&&r&&y!==m;){const b=go(v),g=v.getBoundingClientRect(),x=Zt(v),w=g.left+(v.clientLeft+parseFloat(x.paddingLeft))*b.x,S=g.top+(v.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=w,c+=S,m=Ct(v),v=Iu(m)}}return Ma({width:u,height:f,x:l,y:c})}function il(e,t){const n=sl(e).scrollLeft;return t?t.left+n:Lr(pn(e)).left+n}function Wy(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-il(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function lC(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=pn(r),a=t?ol(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=dn(1);const u=dn(0),f=hn(r);if((f||!f&&!s)&&((jo(r)!=="body"||Js(i))&&(l=sl(r)),hn(r))){const y=Lr(r);c=go(r),u.x=y.x+r.clientLeft,u.y=y.y+r.clientTop}const h=i&&!f&&!s?Wy(i,l):dn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function cC(e){return Array.from(e.getClientRects())}function uC(e){const t=pn(e),n=sl(e),r=e.ownerDocument.body,o=wt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=wt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+il(e);const a=-n.scrollTop;return Zt(r).direction==="rtl"&&(i+=wt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const sp=25;function dC(e,t){const n=Ct(e),r=pn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=Hd();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=il(r);if(c<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),y=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-y);m<=sp&&(s-=m)}else c<=sp&&(s+=c);return{width:s,height:i,x:a,y:l}}const fC=new Set(["absolute","fixed"]);function hC(e,t){const n=Lr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=hn(e)?go(e):dn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function ip(e,t,n){let r;if(t==="viewport")r=dC(e,n);else if(t==="document")r=uC(pn(e));else if(Kt(t))r=hC(t,n);else{const o=Uy(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ma(r)}function Hy(e,t){const n=sr(e);return n===t||!Kt(n)||ko(n)?!1:Zt(n).position==="fixed"||Hy(n,t)}function pC(e,t){const n=t.get(e);if(n)return n;let r=Ds(e,[],!1).filter(a=>Kt(a)&&jo(a)!=="body"),o=null;const s=Zt(e).position==="fixed";let i=s?sr(e):e;for(;Kt(i)&&!ko(i);){const a=Zt(i),l=Wd(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&fC.has(o.position)||Js(i)&&!l&&Hy(e,i))?r=r.filter(u=>u!==i):o=a,i=sr(i)}return t.set(e,r),r}function mC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ol(t)?[]:pC(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const f=ip(t,u,o);return c.top=wt(f.top,c.top),c.right=or(f.right,c.right),c.bottom=or(f.bottom,c.bottom),c.left=wt(f.left,c.left),c},ip(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function gC(e){const{width:t,height:n}=Vy(e);return{width:t,height:n}}function yC(e,t,n){const r=hn(t),o=pn(t),s=n==="fixed",i=Lr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=dn(0);function c(){l.x=il(o)}if(r||!r&&!s)if((jo(t)!=="body"||Js(o))&&(a=sl(t)),r){const y=Lr(t,!0,s,t);l.x=y.x+t.clientLeft,l.y=y.y+t.clientTop}else o&&c();s&&!r&&o&&c();const u=o&&!r&&!s?Wy(o,a):dn(0),f=i.left+a.scrollLeft-l.x-u.x,h=i.top+a.scrollTop-l.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function ic(e){return Zt(e).position==="static"}function ap(e,t){if(!hn(e)||Zt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pn(e)===n&&(n=n.ownerDocument.body),n}function Gy(e,t){const n=Ct(e);if(ol(e))return n;if(!hn(e)){let o=sr(e);for(;o&&!ko(o);){if(Kt(o)&&!ic(o))return o;o=sr(o)}return n}let r=ap(e,t);for(;r&&JS(r)&&ic(r);)r=ap(r,t);return r&&ko(r)&&ic(r)&&!Wd(r)?n:r||oC(e)||n}const vC=async function(e){const t=this.getOffsetParent||Gy,n=this.getDimensions,r=await n(e.floating);return{reference:yC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xC(e){return Zt(e).direction==="rtl"}const wC={convertOffsetParentRelativeRectToViewportRelativeRect:lC,getDocumentElement:pn,getClippingRect:mC,getOffsetParent:Gy,getElementRects:vC,getClientRects:cC,getDimensions:gC,getScale:go,isElement:Kt,isRTL:xC};function Yy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bC(e,t){let n=null,r;const o=pn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:u,top:f,width:h,height:y}=c;if(a||t(),!h||!y)return;const m=Ri(f),v=Ri(o.clientWidth-(u+h)),b=Ri(o.clientHeight-(f+y)),g=Ri(u),w={rootMargin:-m+"px "+-v+"px "+-b+"px "+-g+"px",threshold:wt(0,or(1,l))||1};let S=!0;function C(_){const E=_[0].intersectionRatio;if(E!==l){if(!S)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Yy(c,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),s}function SC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Gd(e),u=o||s?[...c?Ds(c):[],...Ds(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const f=c&&a?bC(c,n):null;let h=-1,y=null;i&&(y=new ResizeObserver(g=>{let[x]=g;x&&x.target===c&&y&&(y.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=y)==null||w.observe(t)})),n()}),c&&!l&&y.observe(c),y.observe(t));let m,v=l?Lr(e):null;l&&b();function b(){const g=Lr(e);v&&!Yy(v,g)&&n(),v=g,m=requestAnimationFrame(b)}return n(),()=>{var g;u.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f?.(),(g=y)==null||g.disconnect(),y=null,l&&cancelAnimationFrame(m)}}const CC=YS,EC=qS,IC=WS,_C=QS,kC=HS,lp=US,RC=XS,PC=(e,t,n)=>{const r=new Map,o={platform:wC,...n},s={...o.platform,_c:r};return VS(e,t,{...o,platform:s})};var MC=typeof document<"u",NC=function(){},Ki=MC?p.useLayoutEffect:NC;function Na(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Na(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Na(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function qy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cp(e,t){const n=qy(e);return Math.round(t*n)/n}function ac(e){const t=p.useRef(e);return Ki(()=>{t.current=e}),t}function TC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,y]=p.useState(r);Na(h,r)||y(r);const[m,v]=p.useState(null),[b,g]=p.useState(null),x=p.useCallback(k=>{k!==_.current&&(_.current=k,v(k))},[]),w=p.useCallback(k=>{k!==E.current&&(E.current=k,g(k))},[]),S=s||m,C=i||b,_=p.useRef(null),E=p.useRef(null),I=p.useRef(u),M=l!=null,R=ac(l),z=ac(o),P=ac(c),j=p.useCallback(()=>{if(!_.current||!E.current)return;const k={placement:t,strategy:n,middleware:h};z.current&&(k.platform=z.current),PC(_.current,E.current,k).then(N=>{const U={...N,isPositioned:P.current!==!1};W.current&&!Na(I.current,U)&&(I.current=U,Ks.flushSync(()=>{f(U)}))})},[h,t,n,z,P]);Ki(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[c]);const W=p.useRef(!1);Ki(()=>(W.current=!0,()=>{W.current=!1}),[]),Ki(()=>{if(S&&(_.current=S),C&&(E.current=C),S&&C){if(R.current)return R.current(S,C,j);j()}},[S,C,j,R,M]);const $=p.useMemo(()=>({reference:_,floating:E,setReference:x,setFloating:w}),[x,w]),O=p.useMemo(()=>({reference:S,floating:C}),[S,C]),H=p.useMemo(()=>{const k={position:n,left:0,top:0};if(!O.floating)return k;const N=cp(O.floating,u.x),U=cp(O.floating,u.y);return a?{...k,transform:"translate("+N+"px, "+U+"px)",...qy(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:U}},[n,a,O.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:j,refs:$,elements:O,floatingStyles:H}),[u,j,$,O,H])}const zC=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?lp({element:r.current,padding:o}).fn(n):{}:r?lp({element:r,padding:o}).fn(n):{}}}},AC=(e,t)=>({...CC(e),options:[e,t]}),jC=(e,t)=>({...EC(e),options:[e,t]}),LC=(e,t)=>({...RC(e),options:[e,t]}),OC=(e,t)=>({...IC(e),options:[e,t]}),DC=(e,t)=>({..._C(e),options:[e,t]}),FC=(e,t)=>({...kC(e),options:[e,t]}),BC=(e,t)=>({...zC(e),options:[e,t]});var $C="Arrow",Xy=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return d.jsx(me.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xy.displayName=$C;var VC=Xy;function UC(e){const[t,n]=p.useState(void 0);return fn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Yd="Popper",[Qy,al]=An(Yd),[WC,Ky]=Qy(Yd),Zy=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return d.jsx(WC,{scope:t,anchor:r,onAnchorChange:o,children:n})};Zy.displayName=Yd;var Jy="PopperAnchor",ev=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Ky(Jy,n),i=p.useRef(null),a=ze(t,i),l=p.useRef(null);return p.useEffect(()=>{const c=l.current;l.current=r?.current||i.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:d.jsx(me.div,{...o,ref:a})});ev.displayName=Jy;var qd="PopperContent",[HC,GC]=Qy(qd),tv=p.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:y="optimized",onPlaced:m,...v}=e,b=Ky(qd,n),[g,x]=p.useState(null),w=ze(t,se=>x(se)),[S,C]=p.useState(null),_=UC(S),E=_?.width??0,I=_?.height??0,M=r+(s!=="center"?"-"+s:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},z=Array.isArray(c)?c:[c],P=z.length>0,j={padding:R,boundary:z.filter(qC),altBoundary:P},{refs:W,floatingStyles:$,placement:O,isPositioned:H,middlewareData:k}=TC({strategy:"fixed",placement:M,whileElementsMounted:(...se)=>SC(...se,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[AC({mainAxis:o+I,alignmentAxis:i}),l&&jC({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?LC():void 0,...j}),l&&OC({...j}),DC({...j,apply:({elements:se,rects:ge,availableWidth:gn,availableHeight:at})=>{const{width:jn,height:Ln}=ge.reference,ur=se.floating.style;ur.setProperty("--radix-popper-available-width",`${gn}px`),ur.setProperty("--radix-popper-available-height",`${at}px`),ur.setProperty("--radix-popper-anchor-width",`${jn}px`),ur.setProperty("--radix-popper-anchor-height",`${Ln}px`)}}),S&&BC({element:S,padding:a}),XC({arrowWidth:E,arrowHeight:I}),h&&FC({strategy:"referenceHidden",...j})]}),[N,U]=ov(O),re=Ze(m);fn(()=>{H&&re?.()},[H,re]);const K=k.arrow?.x,J=k.arrow?.y,oe=k.arrow?.centerOffset!==0,[de,_e]=p.useState();return fn(()=>{g&&_e(window.getComputedStyle(g).zIndex)},[g]),d.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:H?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(" "),...k.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(HC,{scope:n,placedSide:N,onArrowChange:C,arrowX:K,arrowY:J,shouldHideArrow:oe,children:d.jsx(me.div,{"data-side":N,"data-align":U,...v,ref:w,style:{...v.style,animation:H?void 0:"none"}})})})});tv.displayName=qd;var nv="PopperArrow",YC={top:"bottom",right:"left",bottom:"top",left:"right"},rv=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=GC(nv,r),i=YC[s.placedSide];return d.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:d.jsx(VC,{...o,ref:n,style:{...o.style,display:"block"}})})});rv.displayName=nv;function qC(e){return e!==null}var XC=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=ov(n),f={start:"0%",center:"50%",end:"100%"}[u],h=(o.arrow?.x??0)+a/2,y=(o.arrow?.y??0)+l/2;let m="",v="";return c==="bottom"?(m=i?f:`${h}px`,v=`${-l}px`):c==="top"?(m=i?f:`${h}px`,v=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,v=i?f:`${y}px`):c==="left"&&(m=`${r.floating.width+l}px`,v=i?f:`${y}px`),{data:{x:m,y:v}}}});function ov(e){const[t,n="center"]=e.split("-");return[t,n]}var sv=Zy,iv=ev,av=tv,lv=rv,QC="Portal",Xd=p.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=p.useState(!1);fn(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?Lb.createPortal(d.jsx(me.div,{...r,ref:t}),i):null});Xd.displayName=QC;function KC(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var kt=e=>{const{present:t,children:n}=e,r=ZC(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=ze(r.ref,JC(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};kt.displayName="Presence";function ZC(e){const[t,n]=p.useState(),r=p.useRef(null),o=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[a,l]=KC(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=Pi(r.current);s.current=a==="mounted"?c:"none"},[a]),fn(()=>{const c=r.current,u=o.current;if(u!==e){const h=s.current,y=Pi(c);e?l("MOUNT"):y==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),fn(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=y=>{const v=Pi(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&v&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=y=>{y.target===t&&(s.current=Pi(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Pi(e){return e?.animationName||"none"}function JC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eE=Hu[" useInsertionEffect ".trim().toString()]||fn;function ei({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=tE({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=p.useRef(e!==void 0);p.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=p.useCallback(u=>{if(a){const f=nE(u)?u(e):u;f!==e&&i.current?.(f)}else s(u)},[a,e,s,i]);return[l,c]}function tE({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),o=p.useRef(n),s=p.useRef(t);return eE(()=>{s.current=t},[t]),p.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function nE(e){return typeof e=="function"}var rE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),oE="VisuallyHidden",cv=p.forwardRef((e,t)=>d.jsx(me.span,{...e,ref:t,style:{...rE,...e.style}}));cv.displayName=oE;var sE=cv,[ll]=An("Tooltip",[al]),cl=al(),uv="TooltipProvider",iE=700,_u="tooltip.open",[aE,Qd]=ll(uv),dv=e=>{const{__scopeTooltip:t,delayDuration:n=iE,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=p.useRef(!0),a=p.useRef(!1),l=p.useRef(0);return p.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),d.jsx(aE,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:s})};dv.displayName=uv;var Fs="Tooltip",[lE,ti]=ll(Fs),fv=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=Qd(Fs,e.__scopeTooltip),c=cl(t),[u,f]=p.useState(null),h=_o(),y=p.useRef(0),m=i??l.disableHoverableContent,v=a??l.delayDuration,b=p.useRef(!1),[g,x]=ei({prop:r,defaultProp:o??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(_u))):l.onClose(),s?.(E)},caller:Fs}),w=p.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),S=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,x(!0)},[x]),C=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,x(!1)},[x]),_=p.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,x(!0),y.current=0},v)},[v,x]);return p.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),d.jsx(sv,{...c,children:d.jsx(lE,{scope:t,contentId:h,open:g,stateAttribute:w,trigger:u,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{l.isOpenDelayedRef.current?_():S()},[l.isOpenDelayedRef,_,S]),onTriggerLeave:p.useCallback(()=>{m?C():(window.clearTimeout(y.current),y.current=0)},[C,m]),onOpen:S,onClose:C,disableHoverableContent:m,children:n})})};fv.displayName=Fs;var ku="TooltipTrigger",hv=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ti(ku,n),s=Qd(ku,n),i=cl(n),a=p.useRef(null),l=ze(t,a,o.onTriggerChange),c=p.useRef(!1),u=p.useRef(!1),f=p.useCallback(()=>c.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),d.jsx(iv,{asChild:!0,...i,children:d.jsx(me.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ee(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ee(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ee(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ee(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ee(e.onBlur,o.onClose),onClick:ee(e.onClick,o.onClose)})})});hv.displayName=ku;var Kd="TooltipPortal",[cE,uE]=ll(Kd,{forceMount:void 0}),pv=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=ti(Kd,t);return d.jsx(cE,{scope:t,forceMount:n,children:d.jsx(kt,{present:n||s.open,children:d.jsx(Xd,{asChild:!0,container:o,children:r})})})};pv.displayName=Kd;var Ro="TooltipContent",mv=p.forwardRef((e,t)=>{const n=uE(Ro,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=ti(Ro,e.__scopeTooltip);return d.jsx(kt,{present:r||i.open,children:i.disableHoverableContent?d.jsx(gv,{side:o,...s,ref:t}):d.jsx(dE,{side:o,...s,ref:t})})}),dE=p.forwardRef((e,t)=>{const n=ti(Ro,e.__scopeTooltip),r=Qd(Ro,e.__scopeTooltip),o=p.useRef(null),s=ze(t,o),[i,a]=p.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,h=p.useCallback(()=>{a(null),f(!1)},[f]),y=p.useCallback((m,v)=>{const b=m.currentTarget,g={x:m.clientX,y:m.clientY},x=gE(g,b.getBoundingClientRect()),w=yE(g,x),S=vE(v.getBoundingClientRect()),C=wE([...w,...S]);a(C),f(!0)},[f]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(l&&u){const m=b=>y(b,u),v=b=>y(b,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",v)}}},[l,u,y,h]),p.useEffect(()=>{if(i){const m=v=>{const b=v.target,g={x:v.clientX,y:v.clientY},x=l?.contains(b)||u?.contains(b),w=!xE(g,i);x?h():w&&(h(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,i,c,h]),d.jsx(gv,{...e,ref:s})}),[fE,hE]=ll(Fs,{isInside:!1}),pE=gS("TooltipContent"),gv=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=ti(Ro,n),c=cl(n),{onClose:u}=l;return p.useEffect(()=>(document.addEventListener(_u,u),()=>document.removeEventListener(_u,u)),[u]),p.useEffect(()=>{if(l.trigger){const f=h=>{h.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),d.jsx(Bd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:d.jsxs(av,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(pE,{children:r}),d.jsx(fE,{scope:n,isInside:!0,children:d.jsx(sE,{id:l.contentId,role:"tooltip",children:o||r})})]})})});mv.displayName=Ro;var yv="TooltipArrow",mE=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=cl(n);return hE(yv,n).isInside?null:d.jsx(lv,{...o,...r,ref:t})});mE.displayName=yv;function gE(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function yE(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function vE(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function xE(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,u=a.y,f=l.x,h=l.y;u>r!=h>r&&n<(f-c)*(r-u)/(h-u)+c&&(o=!o)}return o}function wE(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),bE(t)}function bE(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var SE=dv,CE=fv,EE=hv,IE=pv,vv=mv;function xv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=xv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wv(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=xv(e))&&(r&&(r+=" "),r+=t);return r}const _E=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},kE=(e,t)=>({classGroupId:e,validator:t}),bv=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ta="-",up=[],RE="arbitrary..",PE=e=>{const t=NE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return ME(i);const a=i.split(Ta),l=a[0]===""&&a.length>1?1:0;return Sv(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=r[i],c=n[i];return l?c?_E(c,l):l:c||up}return n[i]||up}}},Sv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const c=Sv(e,t+1,s);if(c)return c}const i=n.validators;if(i===null)return;const a=t===0?e.join(Ta):e.slice(t).join(Ta),l=i.length;for(let c=0;c<l;c++){const u=i[c];if(u.validator(a))return u.classGroupId}},ME=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?RE+r:void 0})(),NE=e=>{const{theme:t,classGroups:n}=e;return TE(n,t)},TE=(e,t)=>{const n=bv();for(const r in e){const o=e[r];Zd(o,n,r,t)}return n},Zd=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];zE(i,t,n,r)}},zE=(e,t,n,r)=>{if(typeof e=="string"){AE(e,t,n);return}if(typeof e=="function"){jE(e,t,n,r);return}LE(e,t,n,r)},AE=(e,t,n)=>{const r=e===""?t:Cv(t,e);r.classGroupId=n},jE=(e,t,n,r)=>{if(OE(e)){Zd(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(kE(n,e))},LE=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];Zd(l,Cv(t,a),n,r)}},Cv=(e,t)=>{let n=e;const r=t.split(Ta),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=bv(),n.nextPart.set(i,a)),n=a}return n},OE=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,DE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},Ru="!",dp=":",FE=[],fp=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),BE=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;const u=o.length;for(let v=0;v<u;v++){const b=o[v];if(i===0&&a===0){if(b===dp){s.push(o.slice(l,v)),l=v+1;continue}if(b==="/"){c=v;continue}}b==="["?i++:b==="]"?i--:b==="("?a++:b===")"&&a--}const f=s.length===0?o:o.slice(l);let h=f,y=!1;f.endsWith(Ru)?(h=f.slice(0,-1),y=!0):f.startsWith(Ru)&&(h=f.slice(1),y=!0);const m=c&&c>l?c-l:void 0;return fp(s,y,h,m)};if(t){const o=t+dp,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):fp(FE,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},$E=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",l=t.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},VE=e=>({cache:DE(e.cacheSize),parseClassName:BE(e),sortModifiers:$E(e),...PE(e)}),UE=/\s+/,WE=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(UE);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:f,modifiers:h,hasImportantModifier:y,baseClassName:m,maybePostfixModifierPosition:v}=n(u);if(f){l=u+(l.length>0?" "+l:l);continue}let b=!!v,g=r(b?m.substring(0,v):m);if(!g){if(!b){l=u+(l.length>0?" "+l:l);continue}if(g=r(m),!g){l=u+(l.length>0?" "+l:l);continue}b=!1}const x=h.length===0?"":h.length===1?h[0]:s(h).join(":"),w=y?x+Ru:x,S=w+g;if(i.indexOf(S)>-1)continue;i.push(S);const C=o(g,b);for(let _=0;_<C.length;++_){const E=C[_];i.push(w+E)}l=u+(l.length>0?" "+l:l)}return l},HE=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Ev(n))&&(o&&(o+=" "),o+=r);return o},Ev=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ev(e[r]))&&(n&&(n+=" "),n+=t);return n},GE=(e,...t)=>{let n,r,o,s;const i=l=>{const c=t.reduce((u,f)=>f(u),e());return n=VE(c),r=n.cache.get,o=n.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=WE(l,n);return o(l,u),u};return s=i,(...l)=>s(HE(...l))},YE=[],Fe=e=>{const t=n=>n[e]||YE;return t.isThemeGetter=!0,t},Iv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_v=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qE=/^\d+\/\d+$/,XE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,KE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ZE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,JE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hr=e=>qE.test(e),ie=e=>!!e&&!Number.isNaN(Number(e)),Fn=e=>!!e&&Number.isInteger(Number(e)),lc=e=>e.endsWith("%")&&ie(e.slice(0,-1)),wn=e=>XE.test(e),e2=()=>!0,t2=e=>QE.test(e)&&!KE.test(e),kv=()=>!1,n2=e=>ZE.test(e),r2=e=>JE.test(e),o2=e=>!q(e)&&!X(e),s2=e=>Lo(e,Mv,kv),q=e=>Iv.test(e),mr=e=>Lo(e,Nv,t2),cc=e=>Lo(e,u2,ie),hp=e=>Lo(e,Rv,kv),i2=e=>Lo(e,Pv,r2),Mi=e=>Lo(e,Tv,n2),X=e=>_v.test(e),Xo=e=>Oo(e,Nv),a2=e=>Oo(e,d2),pp=e=>Oo(e,Rv),l2=e=>Oo(e,Mv),c2=e=>Oo(e,Pv),Ni=e=>Oo(e,Tv,!0),Lo=(e,t,n)=>{const r=Iv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Oo=(e,t,n=!1)=>{const r=_v.exec(e);return r?r[1]?t(r[1]):n:!1},Rv=e=>e==="position"||e==="percentage",Pv=e=>e==="image"||e==="url",Mv=e=>e==="length"||e==="size"||e==="bg-size",Nv=e=>e==="length",u2=e=>e==="number",d2=e=>e==="family-name",Tv=e=>e==="shadow",f2=()=>{const e=Fe("color"),t=Fe("font"),n=Fe("text"),r=Fe("font-weight"),o=Fe("tracking"),s=Fe("leading"),i=Fe("breakpoint"),a=Fe("container"),l=Fe("spacing"),c=Fe("radius"),u=Fe("shadow"),f=Fe("inset-shadow"),h=Fe("text-shadow"),y=Fe("drop-shadow"),m=Fe("blur"),v=Fe("perspective"),b=Fe("aspect"),g=Fe("ease"),x=Fe("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),X,q],_=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],I=()=>[X,q,l],M=()=>[Hr,"full","auto",...I()],R=()=>[Fn,"none","subgrid",X,q],z=()=>["auto",{span:["full",Fn,X,q]},Fn,X,q],P=()=>[Fn,"auto",X,q],j=()=>["auto","min","max","fr",X,q],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...I()],H=()=>[Hr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],k=()=>[e,X,q],N=()=>[...S(),pp,hp,{position:[X,q]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",l2,s2,{size:[X,q]}],K=()=>[lc,Xo,mr],J=()=>["","none","full",c,X,q],oe=()=>["",ie,Xo,mr],de=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[ie,lc,pp,hp],ge=()=>["","none",m,X,q],gn=()=>["none",ie,X,q],at=()=>["none",ie,X,q],jn=()=>[ie,X,q],Ln=()=>[Hr,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wn],breakpoint:[wn],color:[e2],container:[wn],"drop-shadow":[wn],ease:["in","out","in-out"],font:[o2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wn],shadow:[wn],spacing:["px",ie],text:[wn],"text-shadow":[wn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hr,q,X,b]}],container:["container"],columns:[{columns:[ie,q,X,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Fn,"auto",X,q]}],basis:[{basis:[Hr,"full","auto",a,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ie,Hr,"auto","initial","none",q]}],grow:[{grow:["",ie,X,q]}],shrink:[{shrink:["",ie,X,q]}],order:[{order:[Fn,"first","last","none",X,q]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[a,"screen",...H()]}],"min-w":[{"min-w":[a,"screen","none",...H()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,Xo,mr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,X,cc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lc,q]}],"font-family":[{font:[a2,q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,X,q]}],"line-clamp":[{"line-clamp":[ie,"none",X,cc]}],leading:[{leading:[s,...I()]}],"list-image":[{"list-image":["none",X,q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",X,q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[ie,"from-font","auto",X,mr]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[ie,"auto",X,q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",X,q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",X,q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fn,X,q],radial:["",X,q],conic:[Fn,X,q]},c2,i2]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ie,X,q]}],"outline-w":[{outline:["",ie,Xo,mr]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",u,Ni,Mi]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",f,Ni,Mi]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[ie,mr]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",h,Ni,Mi]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[ie,X,q]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[X,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",X,q]}],filter:[{filter:["","none",X,q]}],blur:[{blur:ge()}],brightness:[{brightness:[ie,X,q]}],contrast:[{contrast:[ie,X,q]}],"drop-shadow":[{"drop-shadow":["","none",y,Ni,Mi]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",ie,X,q]}],"hue-rotate":[{"hue-rotate":[ie,X,q]}],invert:[{invert:["",ie,X,q]}],saturate:[{saturate:[ie,X,q]}],sepia:[{sepia:["",ie,X,q]}],"backdrop-filter":[{"backdrop-filter":["","none",X,q]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[ie,X,q]}],"backdrop-contrast":[{"backdrop-contrast":[ie,X,q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ie,X,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ie,X,q]}],"backdrop-invert":[{"backdrop-invert":["",ie,X,q]}],"backdrop-opacity":[{"backdrop-opacity":[ie,X,q]}],"backdrop-saturate":[{"backdrop-saturate":[ie,X,q]}],"backdrop-sepia":[{"backdrop-sepia":["",ie,X,q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",X,q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ie,"initial",X,q]}],ease:[{ease:["linear","initial",g,X,q]}],delay:[{delay:[ie,X,q]}],animate:[{animate:["none",x,X,q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,X,q]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:gn()}],"rotate-x":[{"rotate-x":gn()}],"rotate-y":[{"rotate-y":gn()}],"rotate-z":[{"rotate-z":gn()}],scale:[{scale:at()}],"scale-x":[{"scale-x":at()}],"scale-y":[{"scale-y":at()}],"scale-z":[{"scale-z":at()}],"scale-3d":["scale-3d"],skew:[{skew:jn()}],"skew-x":[{"skew-x":jn()}],"skew-y":[{"skew-y":jn()}],transform:[{transform:[X,q,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ln()}],"translate-x":[{"translate-x":Ln()}],"translate-y":[{"translate-y":Ln()}],"translate-z":[{"translate-z":Ln()}],"translate-none":["translate-none"],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",X,q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",X,q]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[ie,Xo,mr,cc]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},h2=GE(f2);function Se(...e){return h2(wv(e))}function uc(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function p2(e){return e>=1024*1024*1024?(e/(1024*1024*1024)).toFixed(1)+" GB":e>=1024*1024?(e/(1024*1024)).toFixed(0)+" MB":e>=1024?(e/1024).toFixed(0)+" KB":e+" B"}const m2=SE,Mt=CE,Nt=EE,xt=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(IE,{children:d.jsx(vv,{ref:r,sideOffset:t,className:Se("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));xt.displayName=vv.displayName;/**
41
+ * @license lucide-react v0.562.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */const g2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),mp=e=>{const t=y2(e);return t.charAt(0).toUpperCase()+t.slice(1)},zv=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),v2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
46
+ * @license lucide-react v0.562.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */var x2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
51
+ * @license lucide-react v0.562.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const w2=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>p.createElement("svg",{ref:l,...x2,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zv("lucide",o),...!s&&!v2(a)&&{"aria-hidden":"true"},...a},[...i.map(([c,u])=>p.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
56
+ * @license lucide-react v0.562.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const ne=(e,t)=>{const n=p.forwardRef(({className:r,...o},s)=>p.createElement(w2,{ref:s,iconNode:t,className:zv(`lucide-${g2(mp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=mp(e),n};/**
61
+ * @license lucide-react v0.562.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const b2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],S2=ne("arrow-down",b2);/**
66
+ * @license lucide-react v0.562.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const C2=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],gp=ne("arrow-left",C2);/**
71
+ * @license lucide-react v0.562.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const E2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],yp=ne("arrow-right",E2);/**
76
+ * @license lucide-react v0.562.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const I2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],_2=ne("arrow-up",I2);/**
81
+ * @license lucide-react v0.562.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const k2=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Pu=ne("box",k2);/**
86
+ * @license lucide-react v0.562.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const R2=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],P2=ne("boxes",R2);/**
91
+ * @license lucide-react v0.562.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const M2=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],Jd=ne("building-2",M2);/**
96
+ * @license lucide-react v0.562.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const N2=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],T2=ne("calculator",N2);/**
101
+ * @license lucide-react v0.562.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const z2=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],A2=ne("camera",z2);/**
106
+ * @license lucide-react v0.562.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const j2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],L2=ne("check",j2);/**
111
+ * @license lucide-react v0.562.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const O2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Av=ne("chevron-right",O2);/**
116
+ * @license lucide-react v0.562.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const D2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],F2=ne("circle-alert",D2);/**
121
+ * @license lucide-react v0.562.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const B2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$2=ne("circle-check",B2);/**
126
+ * @license lucide-react v0.562.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const V2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],U2=ne("circle-question-mark",V2);/**
131
+ * @license lucide-react v0.562.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const W2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],H2=ne("circle",W2);/**
136
+ * @license lucide-react v0.562.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const G2=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],jv=ne("copy",G2);/**
141
+ * @license lucide-react v0.562.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const Y2=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],q2=ne("door-open",Y2);/**
146
+ * @license lucide-react v0.562.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const X2=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],vp=ne("download",X2);/**
151
+ * @license lucide-react v0.562.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const Q2=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ul=ne("eye-off",Q2);/**
156
+ * @license lucide-react v0.562.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const K2=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],dl=ne("eye",K2);/**
161
+ * @license lucide-react v0.562.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const Z2=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],J2=ne("file-braces",Z2);/**
166
+ * @license lucide-react v0.562.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const eI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],dc=ne("file-spreadsheet",eI);/**
171
+ * @license lucide-react v0.562.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const tI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],nI=ne("file-text",tI);/**
176
+ * @license lucide-react v0.562.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const rI=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],za=ne("focus",rI);/**
181
+ * @license lucide-react v0.562.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const oI=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],sI=ne("folder-kanban",oI);/**
186
+ * @license lucide-react v0.562.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const iI=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],aI=ne("folder-open",iI);/**
191
+ * @license lucide-react v0.562.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const lI=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],cI=ne("grid-3x3",lI);/**
196
+ * @license lucide-react v0.562.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const uI=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],dI=ne("hand",uI);/**
201
+ * @license lucide-react v0.562.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const fI=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Lv=ne("house",fI);/**
206
+ * @license lucide-react v0.562.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const hI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],pI=ne("info",hI);/**
211
+ * @license lucide-react v0.562.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const mI=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],fl=ne("layers",mI);/**
216
+ * @license lucide-react v0.562.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const gI=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],yI=ne("loader-circle",gI);/**
221
+ * @license lucide-react v0.562.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const vI=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],xI=ne("map-pin",vI);/**
226
+ * @license lucide-react v0.562.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const wI=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Ov=ne("maximize-2",wI);/**
231
+ * @license lucide-react v0.562.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const bI=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],SI=ne("moon",bI);/**
236
+ * @license lucide-react v0.562.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const CI=[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]],EI=ne("mouse-pointer-2",CI);/**
241
+ * @license lucide-react v0.562.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const II=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["path",{d:"m9 20 3-6 3 6",key:"se2kox"}],["path",{d:"m6 8 6 2 6-2",key:"4o3us4"}],["path",{d:"M12 10v4",key:"1kjpxc"}]],_I=ne("person-standing",II);/**
246
+ * @license lucide-react v0.562.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const kI=[["path",{d:"M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2",key:"10n0gc"}],["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4",key:"1lxi77"}]],RI=ne("rotate-3d",kI);/**
251
+ * @license lucide-react v0.562.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const PI=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],Dv=ne("ruler",PI);/**
256
+ * @license lucide-react v0.562.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const MI=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],NI=ne("scissors",MI);/**
261
+ * @license lucide-react v0.562.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const TI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],zI=ne("search",TI);/**
266
+ * @license lucide-react v0.562.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const AI=[["path",{d:"M11 16.586V19a1 1 0 0 1-1 1H2L18.37 3.63a1 1 0 1 1 3 3l-9.663 9.663a1 1 0 0 1-1.414 0L8 14",key:"1sllp5"}]],jI=ne("slice",AI);/**
271
+ * @license lucide-react v0.562.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const LI=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h2",key:"1qve2z"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v2",key:"p14lih"}],["path",{d:"M3 14v1",key:"vnatye"}]],OI=ne("square-dashed-mouse-pointer",LI);/**
276
+ * @license lucide-react v0.562.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const DI=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],xp=ne("square",DI);/**
281
+ * @license lucide-react v0.562.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const FI=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],BI=ne("sun",FI);/**
286
+ * @license lucide-react v0.562.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const $I=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],VI=ne("trash-2",$I);/**
291
+ * @license lucide-react v0.562.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const UI=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],WI=ne("triangle",UI);/**
296
+ * @license lucide-react v0.562.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const HI=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hl=ne("x",HI);/**
301
+ * @license lucide-react v0.562.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const GI=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],YI=ne("zoom-in",GI);/**
306
+ * @license lucide-react v0.562.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const qI=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],XI=ne("zoom-out",qI);var QI=Symbol.for("react.lazy"),Aa=Hu[" use ".trim().toString()];function KI(e){return typeof e=="object"&&e!==null&&"then"in e}function Fv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===QI&&"_payload"in e&&KI(e._payload)}function Bv(e){const t=JI(e),n=p.forwardRef((r,o)=>{let{children:s,...i}=r;Fv(s)&&typeof Aa=="function"&&(s=Aa(s._payload));const a=p.Children.toArray(s),l=a.find(t_);if(l){const c=l.props.children,u=a.map(f=>f===l?p.Children.count(c)>1?p.Children.only(null):p.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...i,ref:o,children:p.isValidElement(c)?p.cloneElement(c,void 0,u):null})}return d.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var ZI=Bv("Slot");function JI(e){const t=p.forwardRef((n,r)=>{let{children:o,...s}=n;if(Fv(o)&&typeof Aa=="function"&&(o=Aa(o._payload)),p.isValidElement(o)){const i=r_(o),a=n_(s,o.props);return o.type!==p.Fragment&&(a.ref=r?Zs(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e_=Symbol("radix.slottable");function t_(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e_}function n_(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function r_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const wp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,bp=wv,o_=(e,t)=>n=>{var r;if(t?.variants==null)return bp(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const u=n?.[c],f=s?.[c];if(u===null)return null;const h=wp(u)||wp(f);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...y}=u;return Object.entries(y).every(m=>{let[v,b]=m;return Array.isArray(b)?b.includes({...s,...a}[v]):{...s,...a}[v]===b})?[...c,f,h]:c},[]);return bp(e,i,l,n?.class,n?.className)},s_=o_("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-8 w-8","icon-xs":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),ke=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?ZI:"button";return d.jsx(i,{className:Se(s_({variant:t,size:n,className:e})),ref:s,...o})});ke.displayName="Button";var i_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ef=i_.reduce((e,t)=>{const n=Bv(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),a_="Separator",Sp="horizontal",l_=["horizontal","vertical"],$v=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=Sp,...o}=e,s=c_(r)?r:Sp,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return d.jsx(ef.div,{"data-orientation":s,...a,...o,ref:t})});$v.displayName=a_;function c_(e){return l_.includes(e)}var Vv=$v;const Gt=p.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>d.jsx(Vv,{ref:o,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Gt.displayName=Vv.displayName;function Uv(e){const t=e+"CollectionProvider",[n,r]=An(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:b,children:g}=v,x=rn.useRef(null),w=rn.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:w,collectionRef:x,children:g})};i.displayName=t;const a=e+"CollectionSlot",l=ka(a),c=rn.forwardRef((v,b)=>{const{scope:g,children:x}=v,w=s(a,g),S=ze(b,w.collectionRef);return d.jsx(l,{ref:S,children:x})});c.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",h=ka(u),y=rn.forwardRef((v,b)=>{const{scope:g,children:x,...w}=v,S=rn.useRef(null),C=ze(b,S),_=s(u,g);return rn.useEffect(()=>(_.itemMap.set(S,{ref:S,...w}),()=>void _.itemMap.delete(S))),d.jsx(h,{[f]:"",ref:C,children:x})});y.displayName=u;function m(v){const b=s(e+"CollectionConsumer",v);return rn.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((_,E)=>w.indexOf(_.ref.current)-w.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:y},m,r]}var u_=p.createContext(void 0);function pl(e){const t=p.useContext(u_);return e||t||"ltr"}var fc=0;function d_(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cp()),document.body.insertAdjacentElement("beforeend",e[1]??Cp()),fc++,()=>{fc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fc--}},[])}function Cp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var hc="focusScope.autoFocusOnMount",pc="focusScope.autoFocusOnUnmount",Ep={bubbles:!1,cancelable:!0},f_="FocusScope",Wv=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=p.useState(null),c=Ze(o),u=Ze(s),f=p.useRef(null),h=ze(t,v=>l(v)),y=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(w){if(y.paused||!a)return;const S=w.target;a.contains(S)?f.current=S:Bn(f.current,{select:!0})},b=function(w){if(y.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Bn(f.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&Bn(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const x=new MutationObserver(g);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),x.disconnect()}}},[r,a,y.paused]),p.useEffect(()=>{if(a){_p.add(y);const v=document.activeElement;if(!a.contains(v)){const g=new CustomEvent(hc,Ep);a.addEventListener(hc,c),a.dispatchEvent(g),g.defaultPrevented||(h_(v_(Hv(a)),{select:!0}),document.activeElement===v&&Bn(a))}return()=>{a.removeEventListener(hc,c),setTimeout(()=>{const g=new CustomEvent(pc,Ep);a.addEventListener(pc,u),a.dispatchEvent(g),g.defaultPrevented||Bn(v??document.body,{select:!0}),a.removeEventListener(pc,u),_p.remove(y)},0)}}},[a,c,u,y]);const m=p.useCallback(v=>{if(!n&&!r||y.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(b&&g){const x=v.currentTarget,[w,S]=p_(x);w&&S?!v.shiftKey&&g===S?(v.preventDefault(),n&&Bn(w,{select:!0})):v.shiftKey&&g===w&&(v.preventDefault(),n&&Bn(S,{select:!0})):g===x&&v.preventDefault()}},[n,r,y.paused]);return d.jsx(me.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});Wv.displayName=f_;function h_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bn(r,{select:t}),document.activeElement!==n)return}function p_(e){const t=Hv(e),n=Ip(t,e),r=Ip(t.reverse(),e);return[n,r]}function Hv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ip(e,t){for(const n of e)if(!m_(n,{upTo:t}))return n}function m_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function g_(e){return e instanceof HTMLInputElement&&"select"in e}function Bn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&g_(e)&&t&&e.select()}}var _p=y_();function y_(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kp(e,t),e.unshift(t)},remove(t){e=kp(e,t),e[0]?.resume()}}}function kp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function v_(e){return e.filter(t=>t.tagName!=="A")}var mc="rovingFocusGroup.onEntryFocus",x_={bubbles:!1,cancelable:!0},ni="RovingFocusGroup",[Mu,Gv,w_]=Uv(ni),[b_,ml]=An(ni,[w_]),[S_,C_]=b_(ni),Yv=p.forwardRef((e,t)=>d.jsx(Mu.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Mu.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(E_,{...e,ref:t})})}));Yv.displayName=ni;var E_=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,h=p.useRef(null),y=ze(t,h),m=pl(s),[v,b]=ei({prop:i,defaultProp:a??null,onChange:l,caller:ni}),[g,x]=p.useState(!1),w=Ze(c),S=Gv(n),C=p.useRef(!1),[_,E]=p.useState(0);return p.useEffect(()=>{const I=h.current;if(I)return I.addEventListener(mc,w),()=>I.removeEventListener(mc,w)},[w]),d.jsx(S_,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:v,onItemFocus:p.useCallback(I=>b(I),[b]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(I=>I+1),[]),onFocusableItemRemove:p.useCallback(()=>E(I=>I-1),[]),children:d.jsx(me.div,{tabIndex:g||_===0?-1:0,"data-orientation":r,...f,ref:y,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{C.current=!0}),onFocus:ee(e.onFocus,I=>{const M=!C.current;if(I.target===I.currentTarget&&M&&!g){const R=new CustomEvent(mc,x_);if(I.currentTarget.dispatchEvent(R),!R.defaultPrevented){const z=S().filter(O=>O.focusable),P=z.find(O=>O.active),j=z.find(O=>O.id===v),$=[P,j,...z].filter(Boolean).map(O=>O.ref.current);Qv($,u)}}C.current=!1}),onBlur:ee(e.onBlur,()=>x(!1))})})}),qv="RovingFocusGroupItem",Xv=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=_o(),c=s||l,u=C_(qv,n),f=u.currentTabStopId===c,h=Gv(n),{onFocusableItemAdd:y,onFocusableItemRemove:m,currentTabStopId:v}=u;return p.useEffect(()=>{if(r)return y(),()=>m()},[r,y,m]),d.jsx(Mu.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:d.jsx(me.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:ee(e.onMouseDown,b=>{r?u.onItemFocus(c):b.preventDefault()}),onFocus:ee(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:ee(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=k_(b,u.orientation,u.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const S=w.indexOf(b.currentTarget);w=u.loop?R_(w,S+1):w.slice(S+1)}setTimeout(()=>Qv(w))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:v!=null}):i})})});Xv.displayName=qv;var I_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function __(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function k_(e,t,n){const r=__(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return I_[r]}function Qv(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function R_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Kv=Yv,Zv=Xv,P_=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Gr=new WeakMap,Ti=new WeakMap,zi={},gc=0,Jv=function(e){return e&&(e.host||Jv(e.parentNode))},M_=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Jv(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},N_=function(e,t,n,r){var o=M_(t,Array.isArray(e)?e:[e]);zi[n]||(zi[n]=new WeakMap);var s=zi[n],i=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))u(h);else try{var y=h.getAttribute(r),m=y!==null&&y!=="false",v=(Gr.get(h)||0)+1,b=(s.get(h)||0)+1;Gr.set(h,v),s.set(h,b),i.push(h),v===1&&m&&Ti.set(h,!0),b===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return u(t),a.clear(),gc++,function(){i.forEach(function(f){var h=Gr.get(f)-1,y=s.get(f)-1;Gr.set(f,h),s.set(f,y),h||(Ti.has(f)||f.removeAttribute(r),Ti.delete(f)),y||f.removeAttribute(n)}),gc--,gc||(Gr=new WeakMap,Gr=new WeakMap,Ti=new WeakMap,zi={})}},T_=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=P_(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),N_(r,o,n,"aria-hidden")):function(){return null}},an=function(){return an=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},an.apply(this,arguments)};function e0(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function z_(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Zi="right-scroll-bar-position",Ji="width-before-scroll-bar",A_="with-scroll-bars-hidden",j_="--removed-body-scroll-bar-size";function yc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function L_(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var O_=typeof window<"u"?p.useLayoutEffect:p.useEffect,Rp=new WeakMap;function D_(e,t){var n=L_(null,function(r){return e.forEach(function(o){return yc(o,r)})});return O_(function(){var r=Rp.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||yc(a,null)}),s.forEach(function(a){o.has(a)||yc(a,i)})}Rp.set(n,e)},[e]),n}function F_(e){return e}function B_(e,t){t===void 0&&(t=F_);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),n}}}};return o}function $_(e){e===void 0&&(e={});var t=B_(null);return t.options=an({async:!0,ssr:!1},e),t}var t0=function(e){var t=e.sideCar,n=e0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,an({},n))};t0.isSideCarExport=!0;function V_(e,t){return e.useMedium(t),t0}var n0=$_(),vc=function(){},gl=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:vc,onWheelCapture:vc,onTouchMoveCapture:vc}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,y=e.noRelative,m=e.noIsolation,v=e.inert,b=e.allowPinchZoom,g=e.as,x=g===void 0?"div":g,w=e.gapMode,S=e0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,_=D_([n,t]),E=an(an({},S),o);return p.createElement(p.Fragment,null,u&&p.createElement(C,{sideCar:n0,removeScrollBar:c,shards:f,noRelative:y,noIsolation:m,inert:v,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:w}),i?p.cloneElement(p.Children.only(a),an(an({},E),{ref:_})):p.createElement(x,an({},E,{className:l,ref:_}),a))});gl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gl.classNames={fullWidth:Ji,zeroRight:Zi};var U_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function W_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=U_();return t&&e.setAttribute("nonce",t),e}function H_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function G_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Y_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=W_())&&(H_(t,n),G_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},q_=function(){var e=Y_();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},r0=function(){var e=q_(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},X_={left:0,top:0,right:0,gap:0},xc=function(e){return parseInt(e||"",10)||0},Q_=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xc(n),xc(r),xc(o)]},K_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return X_;var t=Q_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Z_=r0(),yo="data-scroll-locked",J_=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
311
+ .`.concat(A_,` {
312
+ overflow: hidden `).concat(r,`;
313
+ padding-right: `).concat(a,"px ").concat(r,`;
314
+ }
315
+ body[`).concat(yo,`] {
316
+ overflow: hidden `).concat(r,`;
317
+ overscroll-behavior: contain;
318
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
319
+ padding-left: `.concat(o,`px;
320
+ padding-top: `).concat(s,`px;
321
+ padding-right: `).concat(i,`px;
322
+ margin-left:0;
323
+ margin-top:0;
324
+ margin-right: `).concat(a,"px ").concat(r,`;
325
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
326
+ }
327
+
328
+ .`).concat(Zi,` {
329
+ right: `).concat(a,"px ").concat(r,`;
330
+ }
331
+
332
+ .`).concat(Ji,` {
333
+ margin-right: `).concat(a,"px ").concat(r,`;
334
+ }
335
+
336
+ .`).concat(Zi," .").concat(Zi,` {
337
+ right: 0 `).concat(r,`;
338
+ }
339
+
340
+ .`).concat(Ji," .").concat(Ji,` {
341
+ margin-right: 0 `).concat(r,`;
342
+ }
343
+
344
+ body[`).concat(yo,`] {
345
+ `).concat(j_,": ").concat(a,`px;
346
+ }
347
+ `)},Pp=function(){var e=parseInt(document.body.getAttribute(yo)||"0",10);return isFinite(e)?e:0},ek=function(){p.useEffect(function(){return document.body.setAttribute(yo,(Pp()+1).toString()),function(){var e=Pp()-1;e<=0?document.body.removeAttribute(yo):document.body.setAttribute(yo,e.toString())}},[])},tk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ek();var s=p.useMemo(function(){return K_(o)},[o]);return p.createElement(Z_,{styles:J_(s,!t,o,n?"":"!important")})},Nu=!1;if(typeof window<"u")try{var Ai=Object.defineProperty({},"passive",{get:function(){return Nu=!0,!0}});window.addEventListener("test",Ai,Ai),window.removeEventListener("test",Ai,Ai)}catch{Nu=!1}var Yr=Nu?{passive:!1}:!1,nk=function(e){return e.tagName==="TEXTAREA"},o0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nk(e)&&n[t]==="visible")},rk=function(e){return o0(e,"overflowY")},ok=function(e){return o0(e,"overflowX")},Mp=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=s0(e,r);if(o){var s=i0(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sk=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ik=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},s0=function(e,t){return e==="v"?rk(t):ok(t)},i0=function(e,t){return e==="v"?sk(t):ik(t)},ak=function(e,t){return e==="h"&&t==="rtl"?-1:1},lk=function(e,t,n,r,o){var s=ak(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,u=i>0,f=0,h=0;do{if(!a)break;var y=i0(e,a),m=y[0],v=y[1],b=y[2],g=v-b-s*m;(m||g)&&s0(e,a)&&(f+=g,h+=m);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(f)<1||!u&&Math.abs(h)<1)&&(c=!0),c},ji=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Np=function(e){return[e.deltaX,e.deltaY]},Tp=function(e){return e&&"current"in e?e.current:e},ck=function(e,t){return e[0]===t[0]&&e[1]===t[1]},uk=function(e){return`
348
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
349
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
350
+ `)},dk=0,qr=[];function fk(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(dk++)[0],s=p.useState(r0)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=z_([e.lockRef.current],(e.shards||[]).map(Tp),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var g=ji(v),x=n.current,w="deltaX"in v?v.deltaX:x[0]-g[0],S="deltaY"in v?v.deltaY:x[1]-g[1],C,_=v.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in v&&E==="h"&&_.type==="range")return!1;var I=window.getSelection(),M=I&&I.anchorNode,R=M?M===_||M.contains(_):!1;if(R)return!1;var z=Mp(E,_);if(!z)return!0;if(z?C=E:(C=E==="v"?"h":"v",z=Mp(E,_)),!z)return!1;if(!r.current&&"changedTouches"in v&&(w||S)&&(r.current=C),!C)return!0;var P=r.current||C;return lk(P,b,v,P==="h"?w:S)},[]),l=p.useCallback(function(v){var b=v;if(!(!qr.length||qr[qr.length-1]!==s)){var g="deltaY"in b?Np(b):ji(b),x=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&ck(C.delta,g)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var w=(i.current.shards||[]).map(Tp).filter(Boolean).filter(function(C){return C.contains(b.target)}),S=w.length>0?a(b,w[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=p.useCallback(function(v,b,g,x){var w={name:v,delta:b,target:g,should:x,shadowParent:hk(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=p.useCallback(function(v){n.current=ji(v),r.current=void 0},[]),f=p.useCallback(function(v){c(v.type,Np(v),v.target,a(v,e.lockRef.current))},[]),h=p.useCallback(function(v){c(v.type,ji(v),v.target,a(v,e.lockRef.current))},[]);p.useEffect(function(){return qr.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Yr),document.addEventListener("touchmove",l,Yr),document.addEventListener("touchstart",u,Yr),function(){qr=qr.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,Yr),document.removeEventListener("touchmove",l,Yr),document.removeEventListener("touchstart",u,Yr)}},[]);var y=e.removeScrollBar,m=e.inert;return p.createElement(p.Fragment,null,m?p.createElement(s,{styles:uk(o)}):null,y?p.createElement(tk,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function hk(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pk=V_(n0,fk);var a0=p.forwardRef(function(e,t){return p.createElement(gl,an({},e,{ref:t,sideCar:pk}))});a0.classNames=gl.classNames;var Tu=["Enter"," "],mk=["ArrowDown","PageUp","Home"],l0=["ArrowUp","PageDown","End"],gk=[...mk,...l0],yk={ltr:[...Tu,"ArrowRight"],rtl:[...Tu,"ArrowLeft"]},vk={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ri="Menu",[Bs,xk,wk]=Uv(ri),[Br,c0]=An(ri,[wk,al,ml]),yl=al(),u0=ml(),[bk,$r]=Br(ri),[Sk,oi]=Br(ri),d0=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=yl(t),[l,c]=p.useState(null),u=p.useRef(!1),f=Ze(s),h=pl(o);return p.useEffect(()=>{const y=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),d.jsx(sv,{...a,children:d.jsx(bk,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c,children:d.jsx(Sk,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:h,modal:i,children:r})})})};d0.displayName=ri;var Ck="MenuAnchor",tf=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=yl(n);return d.jsx(iv,{...o,...r,ref:t})});tf.displayName=Ck;var nf="MenuPortal",[Ek,f0]=Br(nf,{forceMount:void 0}),h0=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=$r(nf,t);return d.jsx(Ek,{scope:t,forceMount:n,children:d.jsx(kt,{present:n||s.open,children:d.jsx(Xd,{asChild:!0,container:o,children:r})})})};h0.displayName=nf;var Ot="MenuContent",[Ik,rf]=Br(Ot),p0=p.forwardRef((e,t)=>{const n=f0(Ot,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=$r(Ot,e.__scopeMenu),i=oi(Ot,e.__scopeMenu);return d.jsx(Bs.Provider,{scope:e.__scopeMenu,children:d.jsx(kt,{present:r||s.open,children:d.jsx(Bs.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(_k,{...o,ref:t}):d.jsx(kk,{...o,ref:t})})})})}),_k=p.forwardRef((e,t)=>{const n=$r(Ot,e.__scopeMenu),r=p.useRef(null),o=ze(t,r);return p.useEffect(()=>{const s=r.current;if(s)return T_(s)},[]),d.jsx(of,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kk=p.forwardRef((e,t)=>{const n=$r(Ot,e.__scopeMenu);return d.jsx(of,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Rk=ka("MenuContent.ScrollLock"),of=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:y,disableOutsideScroll:m,...v}=e,b=$r(Ot,n),g=oi(Ot,n),x=yl(n),w=u0(n),S=xk(n),[C,_]=p.useState(null),E=p.useRef(null),I=ze(t,E,b.onContentChange),M=p.useRef(0),R=p.useRef(""),z=p.useRef(0),P=p.useRef(null),j=p.useRef("right"),W=p.useRef(0),$=m?a0:p.Fragment,O=m?{as:Rk,allowPinchZoom:!0}:void 0,H=N=>{const U=R.current+N,re=S().filter(se=>!se.disabled),K=document.activeElement,J=re.find(se=>se.ref.current===K)?.textValue,oe=re.map(se=>se.textValue),de=Bk(oe,U,J),_e=re.find(se=>se.textValue===de)?.ref.current;(function se(ge){R.current=ge,window.clearTimeout(M.current),ge!==""&&(M.current=window.setTimeout(()=>se(""),1e3))})(U),_e&&setTimeout(()=>_e.focus())};p.useEffect(()=>()=>window.clearTimeout(M.current),[]),d_();const k=p.useCallback(N=>j.current===P.current?.side&&Vk(N,P.current?.area),[]);return d.jsx(Ik,{scope:n,searchRef:R,onItemEnter:p.useCallback(N=>{k(N)&&N.preventDefault()},[k]),onItemLeave:p.useCallback(N=>{k(N)||(E.current?.focus(),_(null))},[k]),onTriggerLeave:p.useCallback(N=>{k(N)&&N.preventDefault()},[k]),pointerGraceTimerRef:z,onPointerGraceIntentChange:p.useCallback(N=>{P.current=N},[]),children:d.jsx($,{...O,children:d.jsx(Wv,{asChild:!0,trapped:o,onMountAutoFocus:ee(s,N=>{N.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(Bd,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:y,children:d.jsx(Kv,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:_,onEntryFocus:ee(l,N=>{g.isUsingKeyboardRef.current||N.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(av,{role:"menu","aria-orientation":"vertical","data-state":M0(b.open),"data-radix-menu-content":"",dir:g.dir,...x,...v,ref:I,style:{outline:"none",...v.style},onKeyDown:ee(v.onKeyDown,N=>{const re=N.target.closest("[data-radix-menu-content]")===N.currentTarget,K=N.ctrlKey||N.altKey||N.metaKey,J=N.key.length===1;re&&(N.key==="Tab"&&N.preventDefault(),!K&&J&&H(N.key));const oe=E.current;if(N.target!==oe||!gk.includes(N.key))return;N.preventDefault();const _e=S().filter(se=>!se.disabled).map(se=>se.ref.current);l0.includes(N.key)&&_e.reverse(),Dk(_e)}),onBlur:ee(e.onBlur,N=>{N.currentTarget.contains(N.target)||(window.clearTimeout(M.current),R.current="")}),onPointerMove:ee(e.onPointerMove,$s(N=>{const U=N.target,re=W.current!==N.clientX;if(N.currentTarget.contains(U)&&re){const K=N.clientX>W.current?"right":"left";j.current=K,W.current=N.clientX}}))})})})})})})});p0.displayName=Ot;var Pk="MenuGroup",sf=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(me.div,{role:"group",...r,ref:t})});sf.displayName=Pk;var Mk="MenuLabel",m0=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(me.div,{...r,ref:t})});m0.displayName=Mk;var ja="MenuItem",zp="menu.itemSelect",vl=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=p.useRef(null),i=oi(ja,e.__scopeMenu),a=rf(ja,e.__scopeMenu),l=ze(t,s),c=p.useRef(!1),u=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(zp,{bubbles:!0,cancelable:!0});f.addEventListener(zp,y=>r?.(y),{once:!0}),jy(f,h),h.defaultPrevented?c.current=!1:i.onClose()}};return d.jsx(g0,{...o,ref:l,disabled:n,onClick:ee(e.onClick,u),onPointerDown:f=>{e.onPointerDown?.(f),c.current=!0},onPointerUp:ee(e.onPointerUp,f=>{c.current||f.currentTarget?.click()}),onKeyDown:ee(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||Tu.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});vl.displayName=ja;var g0=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=rf(ja,n),a=u0(n),l=p.useRef(null),c=ze(t,l),[u,f]=p.useState(!1),[h,y]=p.useState("");return p.useEffect(()=>{const m=l.current;m&&y((m.textContent??"").trim())},[s.children]),d.jsx(Bs.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:d.jsx(Zv,{asChild:!0,...a,focusable:!r,children:d.jsx(me.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ee(e.onPointerMove,$s(m=>{r?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(e.onPointerLeave,$s(m=>i.onItemLeave(m))),onFocus:ee(e.onFocus,()=>f(!0)),onBlur:ee(e.onBlur,()=>f(!1))})})})}),Nk="MenuCheckboxItem",y0=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return d.jsx(S0,{scope:e.__scopeMenu,checked:n,children:d.jsx(vl,{role:"menuitemcheckbox","aria-checked":La(n)?"mixed":n,...o,ref:t,"data-state":lf(n),onSelect:ee(o.onSelect,()=>r?.(La(n)?!0:!n),{checkForDefaultPrevented:!1})})})});y0.displayName=Nk;var v0="MenuRadioGroup",[Tk,zk]=Br(v0,{value:void 0,onValueChange:()=>{}}),x0=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Ze(r);return d.jsx(Tk,{scope:e.__scopeMenu,value:n,onValueChange:s,children:d.jsx(sf,{...o,ref:t})})});x0.displayName=v0;var w0="MenuRadioItem",b0=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=zk(w0,e.__scopeMenu),s=n===o.value;return d.jsx(S0,{scope:e.__scopeMenu,checked:s,children:d.jsx(vl,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":lf(s),onSelect:ee(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});b0.displayName=w0;var af="MenuItemIndicator",[S0,Ak]=Br(af,{checked:!1}),C0=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Ak(af,n);return d.jsx(kt,{present:r||La(s.checked)||s.checked===!0,children:d.jsx(me.span,{...o,ref:t,"data-state":lf(s.checked)})})});C0.displayName=af;var jk="MenuSeparator",E0=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(me.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});E0.displayName=jk;var Lk="MenuArrow",I0=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=yl(n);return d.jsx(lv,{...o,...r,ref:t})});I0.displayName=Lk;var Ok="MenuSub",[rN,_0]=Br(Ok),ts="MenuSubTrigger",k0=p.forwardRef((e,t)=>{const n=$r(ts,e.__scopeMenu),r=oi(ts,e.__scopeMenu),o=_0(ts,e.__scopeMenu),s=rf(ts,e.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>u,[u]),p.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),d.jsx(tf,{asChild:!0,...c,children:d.jsx(g0,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":M0(n.open),...e,ref:Zs(t,o.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ee(e.onPointerMove,$s(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ee(e.onPointerLeave,$s(f=>{u();const h=n.content?.getBoundingClientRect();if(h){const y=n.content?.dataset.side,m=y==="right",v=m?-5:5,b=h[m?"left":"right"],g=h[m?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:b,y:h.top},{x:g,y:h.top},{x:g,y:h.bottom},{x:b,y:h.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ee(e.onKeyDown,f=>{const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||yk[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});k0.displayName=ts;var R0="MenuSubContent",P0=p.forwardRef((e,t)=>{const n=f0(Ot,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=$r(Ot,e.__scopeMenu),i=oi(Ot,e.__scopeMenu),a=_0(R0,e.__scopeMenu),l=p.useRef(null),c=ze(t,l);return d.jsx(Bs.Provider,{scope:e.__scopeMenu,children:d.jsx(kt,{present:r||s.open,children:d.jsx(Bs.Slot,{scope:e.__scopeMenu,children:d.jsx(of,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&l.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ee(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ee(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:ee(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),h=vk[i.dir].includes(u.key);f&&h&&(s.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});P0.displayName=R0;function M0(e){return e?"open":"closed"}function La(e){return e==="indeterminate"}function lf(e){return La(e)?"indeterminate":e?"checked":"unchecked"}function Dk(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Fk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bk(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Fk(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function $k(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,u=a.y,f=l.x,h=l.y;u>r!=h>r&&n<(f-c)*(r-u)/(h-u)+c&&(o=!o)}return o}function Vk(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return $k(n,t)}function $s(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Uk=d0,Wk=tf,Hk=h0,Gk=p0,Yk=sf,qk=m0,Xk=vl,Qk=y0,Kk=x0,Zk=b0,Jk=C0,eR=E0,tR=I0,nR=k0,rR=P0,xl="DropdownMenu",[oR]=An(xl,[c0]),it=c0(),[sR,N0]=oR(xl),T0=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=it(t),c=p.useRef(null),[u,f]=ei({prop:o,defaultProp:s??!1,onChange:i,caller:xl});return d.jsx(sR,{scope:t,triggerId:_o(),triggerRef:c,contentId:_o(),open:u,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:d.jsx(Uk,{...l,open:u,onOpenChange:f,dir:r,modal:a,children:n})})};T0.displayName=xl;var z0="DropdownMenuTrigger",A0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=N0(z0,n),i=it(n);return d.jsx(Wk,{asChild:!0,...i,children:d.jsx(me.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Zs(t,s.triggerRef),onPointerDown:ee(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ee(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});A0.displayName=z0;var iR="DropdownMenuPortal",j0=e=>{const{__scopeDropdownMenu:t,...n}=e,r=it(t);return d.jsx(Hk,{...r,...n})};j0.displayName=iR;var L0="DropdownMenuContent",O0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=N0(L0,n),s=it(n),i=p.useRef(!1);return d.jsx(Gk,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ee(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ee(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});O0.displayName=L0;var aR="DropdownMenuGroup",lR=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(Yk,{...o,...r,ref:t})});lR.displayName=aR;var cR="DropdownMenuLabel",D0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(qk,{...o,...r,ref:t})});D0.displayName=cR;var uR="DropdownMenuItem",F0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(Xk,{...o,...r,ref:t})});F0.displayName=uR;var dR="DropdownMenuCheckboxItem",B0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(Qk,{...o,...r,ref:t})});B0.displayName=dR;var fR="DropdownMenuRadioGroup",hR=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(Kk,{...o,...r,ref:t})});hR.displayName=fR;var pR="DropdownMenuRadioItem",$0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(Zk,{...o,...r,ref:t})});$0.displayName=pR;var mR="DropdownMenuItemIndicator",V0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(Jk,{...o,...r,ref:t})});V0.displayName=mR;var gR="DropdownMenuSeparator",U0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(eR,{...o,...r,ref:t})});U0.displayName=gR;var yR="DropdownMenuArrow",vR=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(tR,{...o,...r,ref:t})});vR.displayName=yR;var xR="DropdownMenuSubTrigger",W0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(nR,{...o,...r,ref:t})});W0.displayName=xR;var wR="DropdownMenuSubContent",H0=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=it(n);return d.jsx(rR,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});H0.displayName=wR;var bR=T0,SR=A0,CR=j0,G0=O0,Y0=D0,q0=F0,X0=B0,Q0=$0,K0=V0,Z0=U0,J0=W0,ex=H0;const Ap=bR,jp=SR,ER=p.forwardRef(({className:e,inset:t,children:n,...r},o)=>d.jsxs(J0,{ref:o,className:Se("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,d.jsx(Av,{className:"ml-auto h-4 w-4"})]}));ER.displayName=J0.displayName;const IR=p.forwardRef(({className:e,...t},n)=>d.jsx(ex,{ref:n,className:Se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));IR.displayName=ex.displayName;const zu=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(CR,{children:d.jsx(G0,{ref:r,sideOffset:t,className:Se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));zu.displayName=G0.displayName;const dt=p.forwardRef(({className:e,inset:t,...n},r)=>d.jsx(q0,{ref:r,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));dt.displayName=q0.displayName;const _R=p.forwardRef(({className:e,children:t,checked:n,...r},o)=>d.jsxs(X0,{ref:o,className:Se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(K0,{children:d.jsx(L2,{className:"h-4 w-4"})})}),t]}));_R.displayName=X0.displayName;const kR=p.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(Q0,{ref:r,className:Se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(K0,{children:d.jsx(H2,{className:"h-2 w-2 fill-current"})})}),t]}));kR.displayName=Q0.displayName;const RR=p.forwardRef(({className:e,inset:t,...n},r)=>d.jsx(Y0,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));RR.displayName=Y0.displayName;const ea=p.forwardRef(({className:e,...t},n)=>d.jsx(Z0,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));ea.displayName=Z0.displayName;function PR(e,t=[]){let n=[];function r(s,i){const a=p.createContext(i);a.displayName=s+"Context";const l=n.length;n=[...n,i];const c=f=>{const{scope:h,children:y,...m}=f,v=h?.[e]?.[l]||a,b=p.useMemo(()=>m,Object.values(m));return d.jsx(v.Provider,{value:b,children:y})};c.displayName=s+"Provider";function u(f,h){const y=h?.[e]?.[l]||a,m=p.useContext(y);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=n.map(i=>p.createContext(i));return function(a){const l=a?.[e]||s;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,MR(o,...t)]}function MR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var cf="Progress",uf=100,[NR]=PR(cf),[TR,zR]=NR(cf),tx=p.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:s=AR,...i}=e;(o||o===0)&&!Lp(o)&&console.error(jR(`${o}`,"Progress"));const a=Lp(o)?o:uf;r!==null&&!Op(r,a)&&console.error(LR(`${r}`,"Progress"));const l=Op(r,a)?r:null,c=Oa(l)?s(l,a):void 0;return d.jsx(TR,{scope:n,value:l,max:a,children:d.jsx(ef.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Oa(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":ox(l,a),"data-value":l??void 0,"data-max":a,...i,ref:t})})});tx.displayName=cf;var nx="ProgressIndicator",rx=p.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=zR(nx,n);return d.jsx(ef.div,{"data-state":ox(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});rx.displayName=nx;function AR(e,t){return`${Math.round(e/t*100)}%`}function ox(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Oa(e){return typeof e=="number"}function Lp(e){return Oa(e)&&!isNaN(e)&&e>0}function Op(e,t){return Oa(e)&&!isNaN(e)&&e<=t&&e>=0}function jR(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${uf}\`.`}function LR(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
351
+ - a positive number
352
+ - less than the value passed to \`max\` (or ${uf} if no \`max\` prop is set)
353
+ - \`null\` or \`undefined\` if the progress is indeterminate.
354
+
355
+ Defaulting to \`null\`.`}var sx=tx,OR=rx;const ix=p.forwardRef(({className:e,value:t,...n},r)=>d.jsx(sx,{ref:r,className:Se("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:d.jsx(OR,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ix.displayName=sx.displayName;const DR={},Dp=e=>{let t;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const y=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,y))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(DR?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,o,l);return l},FR=e=>e?Dp(e):Dp;var ax={exports:{}},lx={},cx={exports:{}},ux={};/**
356
+ * @license React
357
+ * use-sync-external-store-shim.production.js
358
+ *
359
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
360
+ *
361
+ * This source code is licensed under the MIT license found in the
362
+ * LICENSE file in the root directory of this source tree.
363
+ */var Po=p;function BR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $R=typeof Object.is=="function"?Object.is:BR,VR=Po.useState,UR=Po.useEffect,WR=Po.useLayoutEffect,HR=Po.useDebugValue;function GR(e,t){var n=t(),r=VR({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return WR(function(){o.value=n,o.getSnapshot=t,wc(o)&&s({inst:o})},[e,n,t]),UR(function(){return wc(o)&&s({inst:o}),e(function(){wc(o)&&s({inst:o})})},[e]),HR(n),n}function wc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$R(e,n)}catch{return!0}}function YR(e,t){return t()}var qR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?YR:GR;ux.useSyncExternalStore=Po.useSyncExternalStore!==void 0?Po.useSyncExternalStore:qR;cx.exports=ux;var XR=cx.exports;/**
364
+ * @license React
365
+ * use-sync-external-store-shim/with-selector.production.js
366
+ *
367
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
368
+ *
369
+ * This source code is licensed under the MIT license found in the
370
+ * LICENSE file in the root directory of this source tree.
371
+ */var wl=p,QR=XR;function KR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ZR=typeof Object.is=="function"?Object.is:KR,JR=QR.useSyncExternalStore,eP=wl.useRef,tP=wl.useEffect,nP=wl.useMemo,rP=wl.useDebugValue;lx.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=eP(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=nP(function(){function l(y){if(!c){if(c=!0,u=y,y=r(y),o!==void 0&&i.hasValue){var m=i.value;if(o(m,y))return f=m}return f=y}if(m=f,ZR(u,y))return m;var v=r(y);return o!==void 0&&o(m,v)?(u=y,m):(u=y,f=v)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,o]);var a=JR(e,s[0],s[1]);return tP(function(){i.hasValue=!0,i.value=a},[a]),rP(a),a};ax.exports=lx;var oP=ax.exports;const sP=Bu(oP),dx={},{useDebugValue:iP}=rn,{useSyncExternalStoreWithSelector:aP}=sP;let Fp=!1;const lP=e=>e;function cP(e,t=lP,n){(dx?"production":void 0)!=="production"&&n&&!Fp&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Fp=!0);const r=aP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return iP(r),r}const Bp=e=>{(dx?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?FR(e):e,n=(r,o)=>cP(t,r,o);return Object.assign(n,t),n},uP=e=>e?Bp(e):Bp,D=uP((e,t)=>({loading:!1,progress:null,error:null,ifcDataStore:null,geometryResult:null,selectedEntityId:null,selectedEntityIds:new Set,selectedStorey:null,hiddenEntities:new Set,isolatedEntities:null,leftPanelCollapsed:!1,rightPanelCollapsed:!1,activeTool:"select",theme:"dark",isMobile:!1,hoverTooltipsEnabled:!1,hoverState:{entityId:null,screenX:0,screenY:0},contextMenu:{isOpen:!1,entityId:null,screenX:0,screenY:0},boxSelect:{isSelecting:!1,startX:0,startY:0,currentX:0,currentY:0},measurements:[],pendingMeasurePoint:null,sectionPlane:{axis:"y",position:50,enabled:!1},cameraRotation:{azimuth:45,elevation:25},cameraCallbacks:{},onCameraRotationChange:null,onScaleChange:null,setLoading:n=>e({loading:n}),setProgress:n=>e({progress:n}),setError:n=>e({error:n}),setIfcDataStore:n=>e({ifcDataStore:n}),setGeometryResult:n=>e({geometryResult:n}),appendGeometryBatch:(n,r)=>e(o=>{if(!o.geometryResult){const l=n.reduce((u,f)=>u+f.indices.length/3,0),c=n.reduce((u,f)=>u+f.positions.length/3,0);return{geometryResult:{meshes:n,totalTriangles:l,totalVertices:c,coordinateInfo:r||{originShift:{x:0,y:0,z:0},originalBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},shiftedBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},isGeoReferenced:!1}}}}const s=[...o.geometryResult.meshes,...n],i=s.reduce((l,c)=>l+c.indices.length/3,0),a=s.reduce((l,c)=>l+c.positions.length/3,0);return{geometryResult:{...o.geometryResult,meshes:s,totalTriangles:i,totalVertices:a,coordinateInfo:r||o.geometryResult.coordinateInfo}}}),updateCoordinateInfo:n=>e(r=>r.geometryResult?{geometryResult:{...r.geometryResult,coordinateInfo:n}}:{}),setSelectedEntityId:n=>e({selectedEntityId:n}),setSelectedStorey:n=>e({selectedStorey:n}),setLeftPanelCollapsed:n=>e({leftPanelCollapsed:n}),setRightPanelCollapsed:n=>e({rightPanelCollapsed:n}),setActiveTool:n=>e({activeTool:n}),setTheme:n=>{document.documentElement.classList.toggle("dark",n==="dark"),e({theme:n})},toggleTheme:()=>{const n=t().theme==="dark"?"light":"dark";document.documentElement.classList.toggle("dark",n==="dark"),e({theme:n})},setIsMobile:n=>e({isMobile:n}),toggleHoverTooltips:()=>e(n=>({hoverTooltipsEnabled:!n.hoverTooltipsEnabled})),setCameraRotation:n=>e({cameraRotation:n}),setCameraCallbacks:n=>e({cameraCallbacks:n}),setOnCameraRotationChange:n=>e({onCameraRotationChange:n}),updateCameraRotationRealtime:n=>{const r=t().onCameraRotationChange;r&&r(n)},setOnScaleChange:n=>e({onScaleChange:n}),updateScaleRealtime:n=>{const r=t().onScaleChange;r&&r(n)},hideEntity:n=>e(r=>{const o=new Set(r.hiddenEntities);return o.add(n),{hiddenEntities:o}}),hideEntities:n=>e(r=>{const o=new Set(r.hiddenEntities);return n.forEach(s=>o.add(s)),{hiddenEntities:o}}),showEntity:n=>e(r=>{const o=new Set(r.hiddenEntities);return o.delete(n),{hiddenEntities:o}}),showEntities:n=>e(r=>{const o=new Set(r.hiddenEntities);return n.forEach(s=>o.delete(s)),{hiddenEntities:o}}),toggleEntityVisibility:n=>e(r=>{const o=new Set(r.hiddenEntities);return o.has(n)?o.delete(n):o.add(n),{hiddenEntities:o}}),isolateEntity:n=>e({isolatedEntities:new Set([n])}),isolateEntities:n=>e({isolatedEntities:new Set(n)}),clearIsolation:()=>e({isolatedEntities:null}),showAll:()=>e({hiddenEntities:new Set,isolatedEntities:null}),isEntityVisible:n=>{const r=t();return!(r.hiddenEntities.has(n)||r.isolatedEntities!==null&&!r.isolatedEntities.has(n))},addToSelection:n=>e(r=>{const o=new Set(r.selectedEntityIds);return o.add(n),{selectedEntityIds:o,selectedEntityId:n}}),removeFromSelection:n=>e(r=>{const o=new Set(r.selectedEntityIds);o.delete(n);const s=Array.from(o);return{selectedEntityIds:o,selectedEntityId:s.length>0?s[s.length-1]:null}}),toggleSelection:n=>e(r=>{const o=new Set(r.selectedEntityIds);o.has(n)?o.delete(n):o.add(n);const s=Array.from(o);return{selectedEntityIds:o,selectedEntityId:s.length>0?s[s.length-1]:null}}),setSelectedEntityIds:n=>e({selectedEntityIds:new Set(n),selectedEntityId:n.length>0?n[n.length-1]:null}),clearSelection:()=>e({selectedEntityIds:new Set,selectedEntityId:null}),setHoverState:n=>e({hoverState:n}),clearHover:()=>e({hoverState:{entityId:null,screenX:0,screenY:0}}),openContextMenu:(n,r,o)=>e({contextMenu:{isOpen:!0,entityId:n,screenX:r,screenY:o}}),closeContextMenu:()=>e({contextMenu:{isOpen:!1,entityId:null,screenX:0,screenY:0}}),startBoxSelect:(n,r)=>e({boxSelect:{isSelecting:!0,startX:n,startY:r,currentX:n,currentY:r}}),updateBoxSelect:(n,r)=>e(o=>({boxSelect:{...o.boxSelect,currentX:n,currentY:r}})),endBoxSelect:()=>e({boxSelect:{isSelecting:!1,startX:0,startY:0,currentX:0,currentY:0}}),cancelBoxSelect:()=>e({boxSelect:{isSelecting:!1,startX:0,startY:0,currentX:0,currentY:0}}),addMeasurePoint:n=>e({pendingMeasurePoint:n}),completeMeasurement:n=>e(r=>{if(!r.pendingMeasurePoint)return{};const o=r.pendingMeasurePoint,s=Math.sqrt(Math.pow(n.x-o.x,2)+Math.pow(n.y-o.y,2)+Math.pow(n.z-o.z,2)),i={id:`m-${Date.now()}`,start:o,end:n,distance:s};return{measurements:[...r.measurements,i],pendingMeasurePoint:null}}),deleteMeasurement:n=>e(r=>({measurements:r.measurements.filter(o=>o.id!==n)})),clearMeasurements:()=>e({measurements:[],pendingMeasurePoint:null}),setSectionPlaneAxis:n=>e(r=>({sectionPlane:{...r.sectionPlane,axis:n}})),setSectionPlanePosition:n=>e(r=>({sectionPlane:{...r.sectionPlane,position:n}})),toggleSectionPlane:()=>e(n=>({sectionPlane:{...n.sectionPlane,enabled:!n.sectionPlane.enabled}})),flipSectionPlane:()=>e(n=>({sectionPlane:{...n.sectionPlane,position:100-n.sectionPlane.position}})),resetSectionPlane:()=>e({sectionPlane:{axis:"y",position:50,enabled:!1}}),resetViewerState:()=>e({selectedEntityId:null,selectedEntityIds:new Set,selectedStorey:null,hiddenEntities:new Set,isolatedEntities:null,hoverState:{entityId:null,screenX:0,screenY:0},contextMenu:{isOpen:!1,entityId:null,screenX:0,screenY:0},boxSelect:{isSelecting:!1,startX:0,startY:0,currentX:0,currentY:0},measurements:[],pendingMeasurePoint:null,sectionPlane:{axis:"y",position:50,enabled:!1},cameraRotation:{azimuth:45,elevation:25},activeTool:"select"})}));class $p{buffer;position=0;lineNumber=1;constructor(t){this.buffer=t}*scanEntities(){for(this.position=0,this.lineNumber=1;this.position<this.buffer.length;)if(this.buffer[this.position]===35){const t=this.position,n=this.lineNumber,r=this.readExpressId();if(r===null){this.position++;continue}if(this.skipWhitespace(),this.position>=this.buffer.length||this.buffer[this.position]!==61){this.position++;continue}this.position++,this.skipWhitespace();const o=this.readTypeName();if(!o){this.position++;continue}if(this.skipWhitespace(),this.position>=this.buffer.length||this.buffer[this.position]!==40){this.position++;continue}const s=this.findEntityLength(t);s>0&&(yield{expressId:r,type:o,offset:t,length:s,line:n})}else this.buffer[this.position]===10?(this.lineNumber++,this.position++):this.position++}readExpressId(){let t=0,n=0,r=this.position+1;for(;r<this.buffer.length;){const o=this.buffer[r];if(o>=48&&o<=57)t=t*10+(o-48),n++,r++;else break}return n===0?null:(this.position=r,t)}readTypeName(){let t=this.position,n=t;if(this.position>=this.buffer.length||this.buffer[this.position]<65||this.buffer[this.position]>90)return null;for(;n<this.buffer.length;){const o=this.buffer[n];if(o>=65&&o<=90||o>=97&&o<=122||o>=48&&o<=57||o===95)n++;else break}if(n===t)return null;const r=new TextDecoder().decode(this.buffer.subarray(t,n));return this.position=n,r}skipWhitespace(){for(;this.position<this.buffer.length;){const t=this.buffer[this.position];if(t===32||t===9||t===13||t===10)t===10&&this.lineNumber++,this.position++;else break}}findEntityLength(t){let n=this.position,r=0,o=!1,s=!1;for(;n<this.buffer.length;){const i=this.buffer[n];if(s){s=!1,n++;continue}if(i===39){o=!o,n++;continue}if(o){i===92&&(s=!0),n++;continue}if(i===40)r++,n++;else if(i===41){if(r--,n++,r===0)return n-t}else n++}return 0}}class Vp{byId=new Map;byType=new Map;addEntity(t){this.byId.set(t.expressId,t);let n=this.byType.get(t.type);n||(n=[],this.byType.set(t.type,n)),n.push(t.expressId)}build(){return{byId:this.byId,byType:this.byType}}}class Au{buffer;constructor(t){this.buffer=t}extractEntity(t){try{const r=new TextDecoder().decode(this.buffer.subarray(t.byteOffset,t.byteOffset+t.byteLength)).match(/^#(\d+)\s*=\s*(\w+)\((.*)\)/);if(!r)return null;const o=parseInt(r[1],10),s=r[2],i=r[3],a=this.parseAttributes(i);return{expressId:o,type:s,attributes:a}}catch(n){return console.warn(`Failed to extract entity #${t.expressId}:`,n),null}}parseAttributes(t){if(!t.trim())return[];const n=[];let r=0,o="",s=!1,i=!1;for(let a=0;a<t.length;a++){const l=t[a];if(i){o+=l,i=!1;continue}l==="'"?(s=!s,o+=l):s?(l==="\\"&&(i=!0),o+=l):l==="("?(r++,o+=l):l===")"?(r--,o+=l):l===","&&r===0?(n.push(this.parseAttributeValue(o.trim())),o=""):o+=l}return o.trim()&&n.push(this.parseAttributeValue(o.trim())),n}parseAttributeValue(t){if(t=t.trim(),!t||t==="$")return null;if(t.startsWith("(")&&t.endsWith(")")){const r=t.slice(1,-1).trim();if(!r)return[];const o=[];let s=0,i="";for(let a=0;a<r.length;a++){const l=r[a];if(l==="(")s++,i+=l;else if(l===")")s--,i+=l;else if(l===","&&s===0){const c=i.trim();c&&o.push(this.parseAttributeValue(c)),i=""}else i+=l}return i.trim()&&o.push(this.parseAttributeValue(i.trim())),o}if(t.startsWith("#")){const r=parseInt(t.substring(1),10);return isNaN(r)?null:r}if(t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1).replace(/\\'/g,"'").replace(/\\\\/g,"\\");const n=parseFloat(t);return isNaN(n)?t:n}}class fx{entities;constructor(t){this.entities=t}extractPropertySets(){const t=new Map;for(const[n,r]of this.entities)if(r.type.toUpperCase()==="IFCPROPERTYSET"){const o=this.extractPropertySet(r);o&&t.set(n,o)}return t}extractPropertySet(t){try{const n=this.getAttributeValue(t,2);if(!n)return null;const r=this.getAttributeValue(t,4),o=new Map;if(Array.isArray(r)){for(const s of r)if(typeof s=="number"){const i=this.entities.get(s);if(i){const a=this.extractProperty(i);a&&o.set(a.name,a.value)}}}return{name:n,properties:o}}catch(n){return console.warn(`Failed to extract PropertySet #${t.expressId}:`,n),null}}extractProperty(t){try{const n=this.getAttributeValue(t,0);if(!n)return null;const r=this.getAttributeValue(t,2),o=this.parsePropertyValue(r);return{name:n,value:o}}catch(n){return console.warn(`Failed to extract property #${t.expressId}:`,n),null}}parsePropertyValue(t){return t==null?{type:"null",value:null}:typeof t=="number"?{type:"number",value:t}:typeof t=="boolean"?{type:"boolean",value:t}:typeof t=="string"?{type:"string",value:t}:typeof t=="number"&&t<0?{type:"reference",value:t}:{type:"string",value:String(t)}}getAttributeValue(t,n){return n<0||n>=t.attributes.length?null:t.attributes[n]}}const Up={IFCQUANTITYLENGTH:"length",IFCQUANTITYAREA:"area",IFCQUANTITYVOLUME:"volume",IFCQUANTITYCOUNT:"count",IFCQUANTITYWEIGHT:"weight",IFCQUANTITYTIME:"time"};class dP{entities;debug;constructor(t,n=!1){this.entities=t,this.debug=n}extractQuantitySets(){const t=new Map;let n=0,r=0;for(const[o,s]of this.entities)if(s.type.toUpperCase()==="IFCELEMENTQUANTITY"){n++;const a=this.extractQuantitySet(s);a&&(t.set(o,a),r+=a.quantities.length,this.debug&&t.size<=3&&console.log(`[QuantityExtractor] Extracted QuantitySet #${o}:`,{name:a.name,quantities:a.quantities.length,first:a.quantities[0]}))}return console.log(`[QuantityExtractor] Found ${n} IfcElementQuantity entities`),console.log(`[QuantityExtractor] Extracted ${t.size} quantity sets with ${r} total quantities`),t}extractQuantitySet(t){try{const n=t.attributes;if(n.length<6)return this.debug&&console.warn(`[QuantityExtractor] IfcElementQuantity #${t.expressId} has insufficient attributes: ${n.length}`),null;const r=this.toString(n[0]),o=this.toString(n[2]);if(!o)return this.debug&&console.warn(`[QuantityExtractor] IfcElementQuantity #${t.expressId} has no name`),null;const s=this.toString(n[4])||void 0,i=n[5],a=[];if(Array.isArray(i)){for(const l of i)if(typeof l=="number"){const c=this.entities.get(l);if(c){const u=this.extractQuantity(c);u&&a.push(u)}else this.debug&&console.warn(`[QuantityExtractor] Referenced quantity #${l} not found`)}}return{expressId:t.expressId,name:o,globalId:r||void 0,methodOfMeasurement:s,quantities:a}}catch(n){return console.warn(`[QuantityExtractor] Failed to extract QuantitySet #${t.expressId}:`,n),null}}extractQuantity(t){try{const n=t.type.toUpperCase(),r=Up[n];if(!r)return null;const o=t.attributes;if(o.length<4)return this.debug&&console.warn(`[QuantityExtractor] ${t.type} #${t.expressId} has insufficient attributes: ${o.length}`),null;const s=this.toString(o[0]);if(!s)return this.debug&&console.warn(`[QuantityExtractor] ${t.type} #${t.expressId} has no name`),null;const i=o[3];if(typeof i!="number")return this.debug&&console.warn(`[QuantityExtractor] ${t.type} #${t.expressId} has non-numeric value:`,i),null;const a=o.length>4&&this.toString(o[4])||void 0;return{name:s,type:r,value:i,formula:a}}catch(n){return console.warn(`[QuantityExtractor] Failed to extract quantity #${t.expressId}:`,n),null}}toString(t){return t==null?null:typeof t=="string"?t:null}getElementQuantityCount(){let t=0;for(const n of this.entities.values())n.type.toUpperCase()==="IFCELEMENTQUANTITY"&&t++;return t}getQuantityValueCount(){let t=0;for(const n of this.entities.values()){const r=n.type.toUpperCase();Up[r]&&t++}return t}}class hx{entities;constructor(t){this.entities=t}extractRelationships(){const t=[],n=new Map;for(const[,r]of this.entities){const o=r.type.toUpperCase();o.startsWith("IFCREL")&&n.set(o,(n.get(o)||0)+1);const s=this.extractRelationship(r);s&&t.push(s)}return console.log("[RelationshipExtractor] Relationship type counts:",Object.fromEntries(n)),console.log("[RelationshipExtractor] Successfully extracted:",t.length),t}extractRelationship(t){const n=t.type.toUpperCase();if(!["IFCRELCONTAINEDINSPATIALSTRUCTURE","IFCRELAGGREGATES","IFCRELDEFINESBYPROPERTIES","IFCRELDEFINESBYTYPE","IFCRELASSOCIATESMATERIAL","IFCRELVOIDSELEMENT","IFCRELFILLSELEMENT"].includes(n))return null;try{let o,s;return n==="IFCRELDEFINESBYPROPERTIES"?(s=this.getAttributeValue(t,4),o=this.getAttributeValue(t,5)):n==="IFCRELCONTAINEDINSPATIALSTRUCTURE"?(s=this.getAttributeValue(t,4),o=this.getAttributeValue(t,5)):(o=this.getAttributeValue(t,4),s=this.getAttributeValue(t,5)),o===null||typeof o!="number"||!Array.isArray(s)?null:{type:t.type,relatingObject:o,relatedObjects:s.filter(i=>typeof i=="number")}}catch(o){return console.warn(`Failed to extract relationship #${t.expressId}:`,o),null}}getAttributeValue(t,n){return n<0||n>=t.attributes.length?null:t.attributes[n]}}class fP{strings=[""];index=new Map([["",0]]);NULL_INDEX=-1;get count(){return this.strings.length}get(t){return t<0||t>=this.strings.length?"":this.strings[t]}intern(t){if(t==null)return this.NULL_INDEX;const n=this.index.get(t);if(n!==void 0)return n;const r=this.strings.length;return this.strings.push(t),this.index.set(t,r),r}has(t){return this.index.has(t)}indexOf(t){return this.index.get(t)??-1}getAll(){return[...this.strings]}}var A;(function(e){e[e.IfcProject=1]="IfcProject",e[e.IfcSite=2]="IfcSite",e[e.IfcBuilding=3]="IfcBuilding",e[e.IfcBuildingStorey=4]="IfcBuildingStorey",e[e.IfcSpace=5]="IfcSpace",e[e.IfcWall=10]="IfcWall",e[e.IfcWallStandardCase=11]="IfcWallStandardCase",e[e.IfcDoor=12]="IfcDoor",e[e.IfcWindow=13]="IfcWindow",e[e.IfcSlab=14]="IfcSlab",e[e.IfcColumn=15]="IfcColumn",e[e.IfcBeam=16]="IfcBeam",e[e.IfcStair=17]="IfcStair",e[e.IfcRamp=18]="IfcRamp",e[e.IfcRoof=19]="IfcRoof",e[e.IfcCovering=20]="IfcCovering",e[e.IfcCurtainWall=21]="IfcCurtainWall",e[e.IfcRailing=22]="IfcRailing",e[e.IfcOpeningElement=30]="IfcOpeningElement",e[e.IfcDistributionElement=40]="IfcDistributionElement",e[e.IfcFlowTerminal=41]="IfcFlowTerminal",e[e.IfcFlowSegment=42]="IfcFlowSegment",e[e.IfcFlowFitting=43]="IfcFlowFitting",e[e.IfcRelContainedInSpatialStructure=100]="IfcRelContainedInSpatialStructure",e[e.IfcRelAggregates=101]="IfcRelAggregates",e[e.IfcRelDefinesByProperties=102]="IfcRelDefinesByProperties",e[e.IfcRelDefinesByType=103]="IfcRelDefinesByType",e[e.IfcRelAssociatesMaterial=104]="IfcRelAssociatesMaterial",e[e.IfcRelAssociatesClassification=105]="IfcRelAssociatesClassification",e[e.IfcRelVoidsElement=106]="IfcRelVoidsElement",e[e.IfcRelFillsElement=107]="IfcRelFillsElement",e[e.IfcRelConnectsPathElements=108]="IfcRelConnectsPathElements",e[e.IfcRelSpaceBoundary=109]="IfcRelSpaceBoundary",e[e.IfcPropertySet=200]="IfcPropertySet",e[e.IfcPropertySingleValue=201]="IfcPropertySingleValue",e[e.IfcPropertyEnumeratedValue=202]="IfcPropertyEnumeratedValue",e[e.IfcPropertyBoundedValue=203]="IfcPropertyBoundedValue",e[e.IfcPropertyListValue=204]="IfcPropertyListValue",e[e.IfcElementQuantity=210]="IfcElementQuantity",e[e.IfcQuantityLength=211]="IfcQuantityLength",e[e.IfcQuantityArea=212]="IfcQuantityArea",e[e.IfcQuantityVolume=213]="IfcQuantityVolume",e[e.IfcQuantityCount=214]="IfcQuantityCount",e[e.IfcQuantityWeight=215]="IfcQuantityWeight",e[e.IfcWallType=300]="IfcWallType",e[e.IfcDoorType=301]="IfcDoorType",e[e.IfcWindowType=302]="IfcWindowType",e[e.IfcSlabType=303]="IfcSlabType",e[e.IfcColumnType=304]="IfcColumnType",e[e.IfcBeamType=305]="IfcBeamType",e[e.Unknown=9999]="Unknown"})(A||(A={}));var le;(function(e){e[e.String=0]="String",e[e.Real=1]="Real",e[e.Integer=2]="Integer",e[e.Boolean=3]="Boolean",e[e.Logical=4]="Logical",e[e.Label=5]="Label",e[e.Identifier=6]="Identifier",e[e.Text=7]="Text",e[e.Enum=8]="Enum",e[e.Reference=9]="Reference",e[e.List=10]="List"})(le||(le={}));var nt;(function(e){e[e.Length=0]="Length",e[e.Area=1]="Area",e[e.Volume=2]="Volume",e[e.Count=3]="Count",e[e.Weight=4]="Weight",e[e.Time=5]="Time"})(nt||(nt={}));var te;(function(e){e[e.ContainsElements=1]="ContainsElements",e[e.Aggregates=2]="Aggregates",e[e.DefinesByProperties=10]="DefinesByProperties",e[e.DefinesByType=11]="DefinesByType",e[e.AssociatesMaterial=20]="AssociatesMaterial",e[e.AssociatesClassification=30]="AssociatesClassification",e[e.ConnectsPathElements=40]="ConnectsPathElements",e[e.FillsElement=41]="FillsElement",e[e.VoidsElement=42]="VoidsElement",e[e.ConnectsElements=43]="ConnectsElements",e[e.SpaceBoundary=50]="SpaceBoundary",e[e.AssignsToGroup=60]="AssignsToGroup",e[e.AssignsToProduct=61]="AssignsToProduct",e[e.ReferencedInSpatialStructure=70]="ReferencedInSpatialStructure"})(te||(te={}));var ms;(function(e){e[e.HAS_GEOMETRY=1]="HAS_GEOMETRY",e[e.HAS_PROPERTIES=2]="HAS_PROPERTIES",e[e.HAS_QUANTITIES=4]="HAS_QUANTITIES",e[e.IS_TYPE=8]="IS_TYPE",e[e.IS_EXTERNAL=16]="IS_EXTERNAL",e[e.HAS_OPENINGS=32]="HAS_OPENINGS",e[e.IS_FILLING=64]="IS_FILLING"})(ms||(ms={}));const hP=new Map([["IFCPROJECT",A.IfcProject],["IFCSITE",A.IfcSite],["IFCBUILDING",A.IfcBuilding],["IFCBUILDINGSTOREY",A.IfcBuildingStorey],["IFCSPACE",A.IfcSpace],["IFCWALL",A.IfcWall],["IFCWALLSTANDARDCASE",A.IfcWallStandardCase],["IFCDOOR",A.IfcDoor],["IFCWINDOW",A.IfcWindow],["IFCSLAB",A.IfcSlab],["IFCCOLUMN",A.IfcColumn],["IFCBEAM",A.IfcBeam],["IFCSTAIR",A.IfcStair],["IFCRAMP",A.IfcRamp],["IFCROOF",A.IfcRoof],["IFCCOVERING",A.IfcCovering],["IFCCURTAINWALL",A.IfcCurtainWall],["IFCRAILING",A.IfcRailing],["IFCOPENINGELEMENT",A.IfcOpeningElement],["IFCDISTRIBUTIONELEMENT",A.IfcDistributionElement],["IFCFLOWTERMINAL",A.IfcFlowTerminal],["IFCFLOWSEGMENT",A.IfcFlowSegment],["IFCFLOWFITTING",A.IfcFlowFitting],["IFCRELCONTAINEDINSPATIALSTRUCTURE",A.IfcRelContainedInSpatialStructure],["IFCRELAGGREGATES",A.IfcRelAggregates],["IFCRELDEFINESBYPROPERTIES",A.IfcRelDefinesByProperties],["IFCRELDEFINESBYTYPE",A.IfcRelDefinesByType],["IFCRELASSOCIATESMATERIAL",A.IfcRelAssociatesMaterial],["IFCRELASSOCIATESCLASSIFICATION",A.IfcRelAssociatesClassification],["IFCRELVOIDSELEMENT",A.IfcRelVoidsElement],["IFCRELFILLSELEMENT",A.IfcRelFillsElement],["IFCRELCONNECTSPATHELEMENTS",A.IfcRelConnectsPathElements],["IFCRELSPACEBOUNDARY",A.IfcRelSpaceBoundary],["IFCPROPERTYSET",A.IfcPropertySet],["IFCPROPERTYSINGLEVALUE",A.IfcPropertySingleValue],["IFCPROPERTYENUMERATEDVALUE",A.IfcPropertyEnumeratedValue],["IFCPROPERTYBOUNDEDVALUE",A.IfcPropertyBoundedValue],["IFCPROPERTYLISTVALUE",A.IfcPropertyListValue],["IFCELEMENTQUANTITY",A.IfcElementQuantity],["IFCQUANTITYLENGTH",A.IfcQuantityLength],["IFCQUANTITYAREA",A.IfcQuantityArea],["IFCQUANTITYVOLUME",A.IfcQuantityVolume],["IFCQUANTITYCOUNT",A.IfcQuantityCount],["IFCQUANTITYWEIGHT",A.IfcQuantityWeight],["IFCWALLTYPE",A.IfcWallType],["IFCDOORTYPE",A.IfcDoorType],["IFCWINDOWTYPE",A.IfcWindowType],["IFCSLABTYPE",A.IfcSlabType],["IFCCOLUMNTYPE",A.IfcColumnType],["IFCBEAMTYPE",A.IfcBeamType]]),pP=new Map([[A.IfcProject,"IfcProject"],[A.IfcSite,"IfcSite"],[A.IfcBuilding,"IfcBuilding"],[A.IfcBuildingStorey,"IfcBuildingStorey"],[A.IfcSpace,"IfcSpace"],[A.IfcWall,"IfcWall"],[A.IfcWallStandardCase,"IfcWallStandardCase"],[A.IfcDoor,"IfcDoor"],[A.IfcWindow,"IfcWindow"],[A.IfcSlab,"IfcSlab"],[A.IfcColumn,"IfcColumn"],[A.IfcBeam,"IfcBeam"],[A.IfcStair,"IfcStair"],[A.IfcRamp,"IfcRamp"],[A.IfcRoof,"IfcRoof"],[A.IfcCovering,"IfcCovering"],[A.IfcCurtainWall,"IfcCurtainWall"],[A.IfcRailing,"IfcRailing"],[A.IfcOpeningElement,"IfcOpeningElement"],[A.IfcDistributionElement,"IfcDistributionElement"],[A.IfcFlowTerminal,"IfcFlowTerminal"],[A.IfcFlowSegment,"IfcFlowSegment"],[A.IfcFlowFitting,"IfcFlowFitting"],[A.IfcRelContainedInSpatialStructure,"IfcRelContainedInSpatialStructure"],[A.IfcRelAggregates,"IfcRelAggregates"],[A.IfcRelDefinesByProperties,"IfcRelDefinesByProperties"],[A.IfcRelDefinesByType,"IfcRelDefinesByType"],[A.IfcRelAssociatesMaterial,"IfcRelAssociatesMaterial"],[A.IfcRelAssociatesClassification,"IfcRelAssociatesClassification"],[A.IfcRelVoidsElement,"IfcRelVoidsElement"],[A.IfcRelFillsElement,"IfcRelFillsElement"],[A.IfcRelConnectsPathElements,"IfcRelConnectsPathElements"],[A.IfcRelSpaceBoundary,"IfcRelSpaceBoundary"],[A.IfcPropertySet,"IfcPropertySet"],[A.IfcPropertySingleValue,"IfcPropertySingleValue"],[A.IfcPropertyEnumeratedValue,"IfcPropertyEnumeratedValue"],[A.IfcPropertyBoundedValue,"IfcPropertyBoundedValue"],[A.IfcPropertyListValue,"IfcPropertyListValue"],[A.IfcElementQuantity,"IfcElementQuantity"],[A.IfcQuantityLength,"IfcQuantityLength"],[A.IfcQuantityArea,"IfcQuantityArea"],[A.IfcQuantityVolume,"IfcQuantityVolume"],[A.IfcQuantityCount,"IfcQuantityCount"],[A.IfcQuantityWeight,"IfcQuantityWeight"],[A.IfcWallType,"IfcWallType"],[A.IfcDoorType,"IfcDoorType"],[A.IfcWindowType,"IfcWindowType"],[A.IfcSlabType,"IfcSlabType"],[A.IfcColumnType,"IfcColumnType"],[A.IfcBeamType,"IfcBeamType"]]);function px(e){return hP.get(e.toUpperCase())??A.Unknown}function mx(e){return pP.get(e)??"Unknown"}class mP{count=0;strings;expressId;typeEnum;globalId;name;description;objectType;flags;containedInStorey;definedByType;geometryIndex;typeStarts=new Map;typeCounts=new Map;constructor(t,n){this.strings=n,this.expressId=new Uint32Array(t),this.typeEnum=new Uint16Array(t),this.globalId=new Uint32Array(t),this.name=new Uint32Array(t),this.description=new Uint32Array(t),this.objectType=new Uint32Array(t),this.flags=new Uint8Array(t),this.containedInStorey=new Int32Array(t).fill(-1),this.definedByType=new Int32Array(t).fill(-1),this.geometryIndex=new Int32Array(t).fill(-1)}add(t,n,r,o,s,i,a=!1,l=!1){const c=this.count++;this.expressId[c]=t;const u=px(n);this.typeEnum[c]=u,this.globalId[c]=this.strings.intern(r),this.name[c]=this.strings.intern(o),this.description[c]=this.strings.intern(s),this.objectType[c]=this.strings.intern(i);let f=0;a&&(f|=ms.HAS_GEOMETRY),l&&(f|=ms.IS_TYPE),this.flags[c]=f,this.typeStarts.has(u)||(this.typeStarts.set(u,c),this.typeCounts.set(u,0)),this.typeCounts.set(u,this.typeCounts.get(u)+1)}build(){const t=y=>y.subarray(0,this.count),n=new Map;for(const[y,m]of this.typeStarts){const v=this.typeCounts.get(y);n.set(y,{start:m,end:m+v})}const r=t(this.expressId),o=t(this.typeEnum),s=t(this.globalId),i=t(this.name),a=t(this.description),l=t(this.objectType),c=t(this.flags),u=t(this.containedInStorey),f=t(this.definedByType),h=t(this.geometryIndex);return{count:this.count,expressId:r,typeEnum:o,globalId:s,name:i,description:a,objectType:l,flags:c,containedInStorey:u,definedByType:f,geometryIndex:h,typeRanges:n,getGlobalId:y=>{const m=this.indexOfId(r,y);return m>=0?this.strings.get(s[m]):""},getName:y=>{const m=this.indexOfId(r,y);return m>=0?this.strings.get(i[m]):""},getTypeName:y=>{const m=this.indexOfId(r,y);return m>=0?mx(o[m]):"Unknown"},hasGeometry:y=>{const m=this.indexOfId(r,y);return m>=0?(c[m]&ms.HAS_GEOMETRY)!==0:!1},getByType:y=>{const m=n.get(y);if(!m)return[];const v=[];for(let b=m.start;b<m.end;b++)v.push(r[b]);return v}}}indexOfId(t,n){for(let r=0;r<t.length;r++)if(t[r]===n)return r;return-1}}class gP{strings;rows=[];constructor(t){this.strings=t}add(t){this.rows.push(t)}build(){const t=this.rows.length,n=new Uint32Array(t),r=new Uint32Array(t),o=new Uint32Array(t),s=new Uint32Array(t),i=new Uint8Array(t),a=new Uint32Array(t),l=new Float64Array(t),c=new Int32Array(t),u=new Uint8Array(t).fill(255),f=new Int32Array(t).fill(-1),h=new Map,y=new Map,m=new Map;for(let g=0;g<t;g++){const x=this.rows[g];n[g]=x.entityId;const w=this.strings.intern(x.psetName),S=this.strings.intern(x.psetGlobalId),C=this.strings.intern(x.propName);switch(r[g]=w,o[g]=S,s[g]=C,i[g]=x.propType,x.propType){case le.String:case le.Label:case le.Identifier:case le.Text:case le.Enum:a[g]=this.strings.intern(x.value);break;case le.Real:l[g]=x.value;break;case le.Integer:c[g]=x.value;break;case le.Boolean:case le.Logical:u[g]=x.value===!0?1:x.value===!1?0:255;break;case le.List:a[g]=this.strings.intern(JSON.stringify(x.value));break}x.unitId!==void 0&&(f[g]=x.unitId),bc(h,x.entityId,g),bc(y,w,g),bc(m,C,g)}const v=this.strings,b={count:t,entityId:n,psetName:r,psetGlobalId:o,propName:s,propType:i,valueString:a,valueReal:l,valueInt:c,valueBool:u,unitId:f,entityIndex:h,psetIndex:y,propIndex:m,getForEntity:g=>{const x=h.get(g)||[],w=new Map;for(const S of x){const C=v.get(r[S]),_=v.get(o[S]);w.has(C)||w.set(C,{name:C,globalId:_,properties:[]});const E=w.get(C),I=v.get(s[S]),M=Sc(b,S,v);E.properties.push({name:I,type:i[S],value:M})}return Array.from(w.values())},getPropertyValue:(g,x,w)=>{const S=h.get(g)||[],C=v.indexOf(x),_=v.indexOf(w);for(const E of S)if(r[E]===C&&s[E]===_)return Sc(b,E,v);return null},findByProperty:(g,x,w)=>{const S=v.indexOf(g);if(S<0)return[];const C=m.get(S)||[],_=[];for(const E of C){const I=Sc(b,E,v);yP(I,x,w)&&_.push(n[E])}return _}};return b}}function bc(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Sc(e,t,n){switch(e.propType[t]){case le.String:case le.Label:case le.Identifier:case le.Text:case le.Enum:return e.valueString[t]>=0?n.get(e.valueString[t]):null;case le.Real:return e.valueReal[t];case le.Integer:return e.valueInt[t];case le.Boolean:case le.Logical:const o=e.valueBool[t];return o===255?null:o===1;case le.List:const s=n.get(e.valueString[t]);try{return JSON.parse(s)}catch{return[]}default:return null}}function yP(e,t,n){if(e===null||n===null)return!1;if(typeof e=="number"&&typeof n=="number")switch(t){case">=":return e>=n;case">":return e>n;case"<=":return e<=n;case"<":return e<n;case"=":case"==":return e===n;case"!=":return e!==n}if(typeof e=="string"&&typeof n=="string")switch(t){case"=":case"==":return e===n;case"!=":return e!==n;case"contains":return e.includes(n);case"startsWith":return e.startsWith(n)}return!1}class vP{strings;rows=[];constructor(t){this.strings=t}add(t){this.rows.push(t)}build(){const t=this.rows.length,n=new Uint32Array(t),r=new Uint32Array(t),o=new Uint32Array(t),s=new Uint8Array(t),i=new Float64Array(t),a=new Int32Array(t).fill(-1),l=new Uint32Array(t).fill(0),c=new Map,u=new Map,f=new Map;for(let h=0;h<t;h++){const y=this.rows[h];n[h]=y.entityId,r[h]=this.strings.intern(y.qsetName),o[h]=this.strings.intern(y.quantityName),s[h]=y.quantityType,i[h]=y.value,y.unitId!==void 0&&(a[h]=y.unitId),y.formula&&(l[h]=this.strings.intern(y.formula)),Cc(c,y.entityId,h),Cc(u,r[h],h),Cc(f,o[h],h)}return{count:t,entityId:n,qsetName:r,quantityName:o,quantityType:s,value:i,unitId:a,formula:l,entityIndex:c,qsetIndex:u,quantityIndex:f,getForEntity:h=>{const y=c.get(h)||[],m=new Map;for(const v of y){const b=this.strings.get(r[v]);m.has(b)||m.set(b,{name:b,quantities:[]});const g=m.get(b),x=this.strings.get(o[v]);g.quantities.push({name:x,type:s[v],value:i[v],formula:l[v]>0?this.strings.get(l[v]):void 0})}return Array.from(m.values())},getQuantityValue:(h,y,m)=>{const v=c.get(h)||[],b=this.strings.indexOf(y),g=this.strings.indexOf(m);for(const x of v)if(r[x]===b&&o[x]===g)return i[x];return null},sumByType:h=>{const y=this.strings.indexOf(h);if(y<0)return 0;const m=f.get(y)||[];let v=0;for(const b of m)v+=i[b];return v}}}}function Cc(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}class xP{edges=[];addEdge(t,n,r,o){this.edges.push({source:t,target:n,type:r,relId:o})}build(){const t=[...this.edges].sort((s,i)=>s.source-i.source),n=[...this.edges].sort((s,i)=>s.target-i.target),r=this.buildEdges(t,"source","target"),o=this.buildEdges(n,"target","source");return{forward:r,inverse:o,getRelated:(s,i,a)=>(a==="forward"?r.getEdges(s,i):o.getEdges(s,i)).map(c=>c.target),hasRelationship:(s,i,a)=>r.getEdges(s,a).some(c=>c.target===i),getRelationshipsBetween:(s,i)=>r.getEdges(s).filter(l=>l.target===i).map(l=>({relationshipId:l.relationshipId,type:l.type,typeName:wP(l.type)}))}}buildEdges(t,n,r){const o=new Map,s=new Map,i=new Uint32Array(t.length),a=new Uint16Array(t.length),l=new Uint32Array(t.length);let c=-1;for(let u=0;u<t.length;u++){const f=t[u],h=f[n];h!==c&&(o.set(h,u),c=h),s.set(h,(s.get(h)??0)+1),i[u]=f[r],a[u]=f.type,l[u]=f.relId}return{offsets:o,counts:s,edgeTargets:i,edgeTypes:a,edgeRelIds:l,getEdges(u,f){const h=o.get(u);if(h===void 0)return[];const y=s.get(u),m=[];for(let v=h;v<h+y;v++)(f===void 0||a[v]===f)&&m.push({target:i[v],type:a[v],relationshipId:l[v]});return m},getTargets(u,f){return this.getEdges(u,f).map(h=>h.target)},hasAnyEdges(u){return o.has(u)}}}}function wP(e){return{[te.ContainsElements]:"IfcRelContainedInSpatialStructure",[te.Aggregates]:"IfcRelAggregates",[te.DefinesByProperties]:"IfcRelDefinesByProperties",[te.DefinesByType]:"IfcRelDefinesByType",[te.AssociatesMaterial]:"IfcRelAssociatesMaterial",[te.AssociatesClassification]:"IfcRelAssociatesClassification",[te.VoidsElement]:"IfcRelVoidsElement",[te.FillsElement]:"IfcRelFillsElement",[te.ConnectsPathElements]:"IfcRelConnectsPathElements",[te.ConnectsElements]:"IfcRelConnectsElements",[te.SpaceBoundary]:"IfcRelSpaceBoundary",[te.AssignsToGroup]:"IfcRelAssignsToGroup",[te.AssignsToProduct]:"IfcRelAssignsToProduct",[te.ReferencedInSpatialStructure]:"ReferencedInSpatialStructure"}[e]||"Unknown"}class bP{build(t,n,r,o,s){const i=new Map,a=new Map,l=new Map,c=new Map,u=new Map,f=new Map,h=t.getByType(A.IfcProject);if(h.length===0)throw console.warn("[SpatialHierarchyBuilder] No IfcProject found in IFC file"),new Error("No IfcProject found in IFC file");const y=h[0],m=this.buildNode(y,t,n,r,o,s,i,a,l,c,u,f);for(const[b,g]of i)for(const x of g)f.set(x,b);return i.size===0&&console.warn("[SpatialHierarchyBuilder] No storeys found in spatial hierarchy"),a.size===0&&console.warn("[SpatialHierarchyBuilder] No buildings found in spatial hierarchy"),{project:m,byStorey:i,byBuilding:a,bySite:l,bySpace:c,storeyElevations:u,elementToStorey:f,getStoreyElements(b){return i.get(b)??[]},getStoreyByElevation(b){let g=null,x=1/0;for(const[w,S]of u){const C=Math.abs(S-b);C<x&&(x=C,g=w)}return x<1?g:null},getContainingSpace(b){for(const[g,x]of c)if(x.includes(b))return g;return null},getPath(b){const g=[];if(!f.get(b))return g;const w=(S,C)=>{if(g.push(S),S.elements.includes(C))return!0;for(const _ of S.children)if(w(_,C))return!0;return g.pop(),!1};return w(m,b),g}}}buildNode(t,n,r,o,s,i,a,l,c,u,f,h){const y=this.getTypeEnum(t,n),m=n.getName(t);let v;y===A.IfcBuildingStorey&&(v=this.extractElevation(t,s,i),v!==void 0&&f.set(t,v));const b=r.getRelated(t,te.ContainsElements,"forward"),g=r.getRelated(t,te.Aggregates,"forward"),x=[];for(const w of g){const S=this.getTypeEnum(w,n);if(S===A.IfcSite||S===A.IfcBuilding||S===A.IfcBuildingStorey||S===A.IfcSpace){const C=this.buildNode(w,n,r,o,s,i,a,l,c,u,f,h);x.push(C)}}return y===A.IfcBuildingStorey?a.set(t,b):y===A.IfcBuilding?l.set(t,b):y===A.IfcSite?c.set(t,b):y===A.IfcSpace&&u.set(t,b),{expressId:t,type:y,name:m,elevation:v,children:x,elements:b}}getTypeEnum(t,n){for(let r=0;r<n.count;r++)if(n.expressId[r]===t)return n.typeEnum[r];return A.Unknown}extractElevation(t,n,r){const o=r.byId.get(t);if(o)try{const i=new Au(n).extractEntity(o);if(!i)return;const a=i.attributes||[];if(a.length>8&&typeof a[8]=="number")return a[8];if(a.length>7&&typeof a[7]=="number")return a[7];if(a.length>6&&typeof a[6]=="number")return a[6];for(let l=0;l<a.length;l++)if(typeof a[l]=="number"&&Math.abs(a[l])<1e4)return a[l]}catch{}}}class SP{async parse(t,n,r,o={}){const s=performance.now(),i=new Uint8Array(t),a=new fP,l=new mP(r.size,a),c=new gP(a),u=new xP;o.onProgress?.({phase:"entities",percent:0});let f=0;for(const[$,O]of r){const H=O.attributes||[],k=String(H[0]||""),N=String(H[2]||""),U=String(H[3]||""),re=String(H[7]||""),K=O.type.toUpperCase().includes("WALL")||O.type.toUpperCase().includes("DOOR")||O.type.toUpperCase().includes("WINDOW")||O.type.toUpperCase().includes("SLAB")||O.type.toUpperCase().includes("COLUMN")||O.type.toUpperCase().includes("BEAM"),J=O.type.toUpperCase().endsWith("TYPE");l.add($,O.type,k,N,U,re,K,J),f++,f%1e3===0&&o.onProgress?.({phase:"entities",percent:f/r.size*100})}const h=l.build();o.onProgress?.({phase:"entities",percent:100}),o.onProgress?.({phase:"properties",percent:0});const m=new fx(r).extractPropertySets(),v=new Map,g=new hx(r).extractRelationships();for(const $ of g)if($.type.toUpperCase()==="IFCRELDEFINESBYPROPERTIES"){const O=$.relatingObject;for(const H of $.relatedObjects){let k=v.get(O);k||(k=[],v.set(O,k)),k.push(H)}}for(const[$,O]of m){const H=v.get($)||[],k=String(r.get($)?.attributes?.[0]||"");for(const[N,U]of O.properties)for(const re of H){let K=le.String,J=U.value;U.type==="number"?(K=le.Real,J=U.value):U.type==="boolean"?(K=le.Boolean,J=U.value):U.type==="string"&&(K=le.String,J=String(U.value)),c.add({entityId:re,psetName:O.name,psetGlobalId:k,propName:N,propType:K,value:J})}}const x=c.build();o.onProgress?.({phase:"properties",percent:100}),o.onProgress?.({phase:"quantities",percent:0});const w=new vP(a),C=new dP(r).extractQuantitySets(),_=new Map;for(const $ of g)if($.type.toUpperCase()==="IFCRELDEFINESBYPROPERTIES"){const O=$.relatingObject;if(C.has(O))for(const H of $.relatedObjects){let k=_.get(O);k||(k=[],_.set(O,k)),k.push(H)}}const E={length:nt.Length,area:nt.Area,volume:nt.Volume,count:nt.Count,weight:nt.Weight,time:nt.Time};for(const[$,O]of C){const H=_.get($)||[];for(const k of O.quantities)for(const N of H)w.add({entityId:N,qsetName:O.name,quantityName:k.name,quantityType:E[k.type]??nt.Length,value:k.value,formula:k.formula})}const I=w.build();o.onProgress?.({phase:"quantities",percent:100}),o.onProgress?.({phase:"relationships",percent:0});const M={IFCRELCONTAINEDINSPATIALSTRUCTURE:te.ContainsElements,IFCRELAGGREGATES:te.Aggregates,IFCRELDEFINESBYPROPERTIES:te.DefinesByProperties,IFCRELDEFINESBYTYPE:te.DefinesByType,IFCRELASSOCIATESMATERIAL:te.AssociatesMaterial,IFCRELASSOCIATESCLASSIFICATION:te.AssociatesClassification,IFCRELVOIDSELEMENT:te.VoidsElement,IFCRELFILLSELEMENT:te.FillsElement,IFCRELCONNECTSPATHELEMENTS:te.ConnectsPathElements,IFCRELSPACEBOUNDARY:te.SpaceBoundary};for(const $ of g){const O=M[$.type.toUpperCase()];if(O)for(const H of $.relatedObjects)u.addEdge($.relatingObject,H,O,$.relatingObject)}const R=u.build();o.onProgress?.({phase:"relationships",percent:100});let z="IFC4";for(const[,$]of r)if($.type.toUpperCase()==="IFCPROJECT"){z="IFC4";break}const P=performance.now()-s,j={byId:new Map,byType:new Map};for(const $ of n){j.byId.set($.expressId,$);let O=j.byType.get($.type);O||(O=[],j.byType.set($.type,O)),O.push($.expressId)}o.onProgress?.({phase:"spatial-hierarchy",percent:0});let W;try{W=new bP().build(h,R,a,i,j)}catch($){console.warn("[ColumnarParser] Failed to build spatial hierarchy:",$)}return o.onProgress?.({phase:"spatial-hierarchy",percent:100}),{fileSize:t.byteLength,schemaVersion:z,entityCount:r.size,parseTime:P,source:i,entityIndex:j,strings:a,entities:h,properties:x,quantities:I,relationships:R,spatialHierarchy:W}}}class CP{async parse(t,n={}){const r=new Uint8Array(t);n.onProgress?.({phase:"scan",percent:0});const o=new $p(r),s=new Vp,i=[];for(const m of o.scanEntities())s.addEntity({expressId:m.expressId,type:m.type,byteOffset:m.offset,byteLength:m.length,lineNumber:m.line}),i.push({expressId:m.expressId,type:m.type,byteOffset:m.offset,byteLength:m.length,lineNumber:m.line});const a=s.build();n.onProgress?.({phase:"scan",percent:100}),n.onProgress?.({phase:"extract",percent:0});const l=new Au(r),c=new Map;for(let m=0;m<i.length;m++){const v=i[m],b=l.extractEntity(v);b&&c.set(v.expressId,b),(m+1)%1e3===0&&n.onProgress?.({phase:"extract",percent:(m+1)/i.length*100})}n.onProgress?.({phase:"extract",percent:100}),n.onProgress?.({phase:"properties",percent:0});const f=new fx(c).extractPropertySets();n.onProgress?.({phase:"properties",percent:100}),n.onProgress?.({phase:"relationships",percent:0});const y=new hx(c).extractRelationships();return n.onProgress?.({phase:"relationships",percent:100}),{entities:c,propertySets:f,relationships:y,entityIndex:a,fileSize:t.byteLength,entityCount:c.size}}async parseColumnar(t,n={}){const r=new Uint8Array(t);n.onProgress?.({phase:"scan",percent:0});const o=new $p(r),s=new Vp,i=[];for(const u of o.scanEntities())s.addEntity({expressId:u.expressId,type:u.type,byteOffset:u.offset,byteLength:u.length,lineNumber:u.line}),i.push({expressId:u.expressId,type:u.type,byteOffset:u.offset,byteLength:u.length,lineNumber:u.line});s.build(),n.onProgress?.({phase:"scan",percent:100}),n.onProgress?.({phase:"extract",percent:0});const a=new Au(r),l=new Map;for(let u=0;u<i.length;u++){const f=i[u],h=a.extractEntity(f);h&&l.set(f.expressId,h),(u+1)%1e3===0&&n.onProgress?.({phase:"extract",percent:(u+1)/i.length*100})}return n.onProgress?.({phase:"extract",percent:100}),new SP().parse(t,i,l,n)}}let V;function Ee(e){gs===Cn.length&&Cn.push(Cn.length+1);const t=gs;return gs=Cn[t],Cn[t]=e,t}const Wp=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>e.dtor(e.a,e.b));function ju(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){const o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){const o=e.length;let s="[";o>0&&(s+=ju(e[0]));for(let i=1;i<o;i++)s+=", "+ju(e[i]);return s+="]",s}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
372
+ ${e.stack}`:r}function EP(e){e<132||(Cn[e]=gs,gs=e)}function Da(e,t){return e=e>>>0,_P().subarray(e/4,e/4+t)}function IP(e,t){return e=e>>>0,kP().subarray(e/4,e/4+t)}let xr=null;function Ke(){return(xr===null||xr.buffer.detached===!0||xr.buffer.detached===void 0&&xr.buffer!==V.memory.buffer)&&(xr=new DataView(V.memory.buffer)),xr}let ns=null;function _P(){return(ns===null||ns.byteLength===0)&&(ns=new Float32Array(V.memory.buffer)),ns}function Er(e,t){return e=e>>>0,MP(e,t)}let rs=null;function kP(){return(rs===null||rs.byteLength===0)&&(rs=new Uint32Array(V.memory.buffer)),rs}let os=null;function ta(){return(os===null||os.byteLength===0)&&(os=new Uint8Array(V.memory.buffer)),os}function Oe(e){return Cn[e]}function Ec(e,t){try{return e.apply(this,t)}catch(n){V.__wbindgen_export3(Ee(n))}}let Cn=new Array(128).fill(void 0);Cn.push(void 0,null,!0,!1);let gs=Cn.length;function Li(e){return e==null}function RP(e,t,n,r){const o={a:e,b:t,cnt:1,dtor:n},s=(...i)=>{o.cnt++;const a=o.a;o.a=0;try{return r(a,o.b,...i)}finally{o.a=a,s._wbg_cb_unref()}};return s._wbg_cb_unref=()=>{--o.cnt===0&&(o.dtor(o.a,o.b),o.a=0,Wp.unregister(o))},Wp.register(s,o,o),s}function Un(e,t,n){if(n===void 0){const a=ys.encode(e),l=t(a.length,1)>>>0;return ta().subarray(l,l+a.length).set(a),on=a.length,l}let r=e.length,o=t(r,1)>>>0;const s=ta();let i=0;for(;i<r;i++){const a=e.charCodeAt(i);if(a>127)break;s[o+i]=a}if(i!==r){i!==0&&(e=e.slice(i)),o=n(o,r,r=i+e.length*3,1)>>>0;const a=ta().subarray(o+i,o+r),l=ys.encodeInto(e,a);i+=l.written,o=n(o,r,i,1)>>>0}return on=i,o}function Rr(e){const t=Oe(e);return EP(e),t}let na=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});na.decode();const PP=2146435072;let Ic=0;function MP(e,t){return Ic+=t,Ic>=PP&&(na=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),na.decode(),Ic=t),na.decode(ta().subarray(e,e+t))}const ys=new TextEncoder;"encodeInto"in ys||(ys.encodeInto=function(e,t){const n=ys.encode(e);return t.set(n),{read:e.length,written:n.length}});let on=0;function NP(e,t,n){V.__wasm_bindgen_func_elem_160(e,t,Ee(n))}function TP(e,t,n,r){V.__wasm_bindgen_func_elem_198(e,t,Ee(n),Ee(r))}const Hp=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>V.__wbg_ifcapi_free(e>>>0,1)),Gp=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>V.__wbg_meshcollection_free(e>>>0,1)),Yp=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>V.__wbg_meshdatajs_free(e>>>0,1)),_c=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>V.__wbg_zerocopymesh_free(e>>>0,1));class Lu{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Hp.unregister(this),t}free(){const t=this.__destroy_into_raw();V.__wbg_ifcapi_free(t,0)}getMemory(){const t=V.ifcapi_getMemory(this.__wbg_ptr);return Rr(t)}parseMeshes(t){const n=Un(t,V.__wbindgen_export,V.__wbindgen_export2),r=on,o=V.ifcapi_parseMeshes(this.__wbg_ptr,n,r);return Vs.__wrap(o)}parseStreaming(t,n){const r=Un(t,V.__wbindgen_export,V.__wbindgen_export2),o=on,s=V.ifcapi_parseStreaming(this.__wbg_ptr,r,o,Ee(n));return Rr(s)}parseZeroCopy(t){const n=Un(t,V.__wbindgen_export,V.__wbindgen_export2),r=on,o=V.ifcapi_parseZeroCopy(this.__wbg_ptr,n,r);return Ws.__wrap(o)}debugProcessEntity953(t){let n,r;try{const i=V.__wbindgen_add_to_stack_pointer(-16),a=Un(t,V.__wbindgen_export,V.__wbindgen_export2),l=on;V.ifcapi_debugProcessEntity953(i,this.__wbg_ptr,a,l);var o=Ke().getInt32(i+4*0,!0),s=Ke().getInt32(i+4*1,!0);return n=o,r=s,Er(o,s)}finally{V.__wbindgen_add_to_stack_pointer(16),V.__wbindgen_export4(n,r,1)}}debugProcessFirstWall(t){let n,r;try{const i=V.__wbindgen_add_to_stack_pointer(-16),a=Un(t,V.__wbindgen_export,V.__wbindgen_export2),l=on;V.ifcapi_debugProcessFirstWall(i,this.__wbg_ptr,a,l);var o=Ke().getInt32(i+4*0,!0),s=Ke().getInt32(i+4*1,!0);return n=o,r=s,Er(o,s)}finally{V.__wbindgen_add_to_stack_pointer(16),V.__wbindgen_export4(n,r,1)}}constructor(){const t=V.ifcapi_new();return this.__wbg_ptr=t>>>0,Hp.register(this,this.__wbg_ptr,this),this}parse(t){const n=Un(t,V.__wbindgen_export,V.__wbindgen_export2),r=on,o=V.ifcapi_parse(this.__wbg_ptr,n,r);return Rr(o)}get version(){let t,n;try{const s=V.__wbindgen_add_to_stack_pointer(-16);V.ifcapi_version(s,this.__wbg_ptr);var r=Ke().getInt32(s+4*0,!0),o=Ke().getInt32(s+4*1,!0);return t=r,n=o,Er(r,o)}finally{V.__wbindgen_add_to_stack_pointer(16),V.__wbindgen_export4(t,n,1)}}get is_ready(){return V.ifcapi_is_ready(this.__wbg_ptr)!==0}}Symbol.dispose&&(Lu.prototype[Symbol.dispose]=Lu.prototype.free);class Vs{static __wrap(t){t=t>>>0;const n=Object.create(Vs.prototype);return n.__wbg_ptr=t,Gp.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Gp.unregister(this),t}free(){const t=this.__destroy_into_raw();V.__wbg_meshcollection_free(t,0)}get totalVertices(){return V.meshcollection_totalVertices(this.__wbg_ptr)>>>0}get totalTriangles(){return V.meshcollection_totalTriangles(this.__wbg_ptr)>>>0}get(t){const n=V.meshcollection_get(this.__wbg_ptr,t);return n===0?void 0:Us.__wrap(n)}get length(){return V.meshcollection_length(this.__wbg_ptr)>>>0}}Symbol.dispose&&(Vs.prototype[Symbol.dispose]=Vs.prototype.free);class Us{static __wrap(t){t=t>>>0;const n=Object.create(Us.prototype);return n.__wbg_ptr=t,Yp.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Yp.unregister(this),t}free(){const t=this.__destroy_into_raw();V.__wbg_meshdatajs_free(t,0)}get expressId(){return V.meshdatajs_expressId(this.__wbg_ptr)>>>0}get vertexCount(){return V.meshdatajs_vertexCount(this.__wbg_ptr)>>>0}get triangleCount(){return V.meshdatajs_triangleCount(this.__wbg_ptr)>>>0}get color(){try{const o=V.__wbindgen_add_to_stack_pointer(-16);V.meshdatajs_color(o,this.__wbg_ptr);var t=Ke().getInt32(o+4*0,!0),n=Ke().getInt32(o+4*1,!0),r=Da(t,n).slice();return V.__wbindgen_export4(t,n*4,4),r}finally{V.__wbindgen_add_to_stack_pointer(16)}}get indices(){const t=V.meshdatajs_indices(this.__wbg_ptr);return Rr(t)}get normals(){const t=V.meshdatajs_normals(this.__wbg_ptr);return Rr(t)}get positions(){const t=V.meshdatajs_positions(this.__wbg_ptr);return Rr(t)}}Symbol.dispose&&(Us.prototype[Symbol.dispose]=Us.prototype.free);class Ws{static __wrap(t){t=t>>>0;const n=Object.create(Ws.prototype);return n.__wbg_ptr=t,_c.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,_c.unregister(this),t}free(){const t=this.__destroy_into_raw();V.__wbg_zerocopymesh_free(t,0)}bounds_max(){try{const o=V.__wbindgen_add_to_stack_pointer(-16);V.zerocopymesh_bounds_max(o,this.__wbg_ptr);var t=Ke().getInt32(o+4*0,!0),n=Ke().getInt32(o+4*1,!0),r=Da(t,n).slice();return V.__wbindgen_export4(t,n*4,4),r}finally{V.__wbindgen_add_to_stack_pointer(16)}}bounds_min(){try{const o=V.__wbindgen_add_to_stack_pointer(-16);V.zerocopymesh_bounds_min(o,this.__wbg_ptr);var t=Ke().getInt32(o+4*0,!0),n=Ke().getInt32(o+4*1,!0),r=Da(t,n).slice();return V.__wbindgen_export4(t,n*4,4),r}finally{V.__wbindgen_add_to_stack_pointer(16)}}get indices_len(){return V.zerocopymesh_indices_len(this.__wbg_ptr)>>>0}get indices_ptr(){return V.zerocopymesh_indices_ptr(this.__wbg_ptr)>>>0}get normals_len(){return V.zerocopymesh_normals_len(this.__wbg_ptr)>>>0}get normals_ptr(){return V.zerocopymesh_normals_ptr(this.__wbg_ptr)>>>0}get vertex_count(){return V.meshdatajs_vertexCount(this.__wbg_ptr)>>>0}get positions_len(){return V.zerocopymesh_positions_len(this.__wbg_ptr)>>>0}get positions_ptr(){return V.zerocopymesh_positions_ptr(this.__wbg_ptr)>>>0}get triangle_count(){return V.meshdatajs_triangleCount(this.__wbg_ptr)>>>0}constructor(){const t=V.zerocopymesh_new();return this.__wbg_ptr=t>>>0,_c.register(this,this.__wbg_ptr,this),this}get is_empty(){return V.zerocopymesh_is_empty(this.__wbg_ptr)!==0}}Symbol.dispose&&(Ws.prototype[Symbol.dispose]=Ws.prototype.free);const zP=new Set(["basic","cors","default"]);async function AP(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.ok&&zP.has(e.type)&&e.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function jP(){const e={};return e.wbg={},e.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(t,n){const r=ju(Oe(n)),o=Un(r,V.__wbindgen_export,V.__wbindgen_export2),s=on;Ke().setInt32(t+4*1,s,!0),Ke().setInt32(t+4*0,o,!0)},e.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd=function(t){return typeof Oe(t)=="function"},e.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(t){return Oe(t)===void 0},e.wbg.__wbg___wbindgen_memory_a342e963fbcabd68=function(){const t=V.memory;return Ee(t)},e.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(t,n){throw new Error(Er(t,n))},e.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7=function(t){Oe(t)._wbg_cb_unref()},e.wbg.__wbg_call_3020136f7a2d6e44=function(){return Ec(function(t,n,r){const o=Oe(t).call(Oe(n),Oe(r));return Ee(o)},arguments)},e.wbg.__wbg_call_abb4ff46ce38be40=function(){return Ec(function(t,n){const r=Oe(t).call(Oe(n));return Ee(r)},arguments)},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,n){let r,o;try{r=t,o=n,console.error(Er(t,n))}finally{V.__wbindgen_export4(r,o,1)}},e.wbg.__wbg_new_1ba21ce319a06297=function(){const t=new Object;return Ee(t)},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){const t=new Error;return Ee(t)},e.wbg.__wbg_new_ff12d2b041fb48f1=function(t,n){try{var r={a:t,b:n},o=(i,a)=>{const l=r.a;r.a=0;try{return TP(l,r.b,i,a)}finally{r.a=l}};const s=new Promise(o);return Ee(s)}finally{r.a=r.b=0}},e.wbg.__wbg_new_from_slice_41e2764a343e3cb1=function(t,n){const r=new Float32Array(Da(t,n));return Ee(r)},e.wbg.__wbg_new_from_slice_db0691b69e9d3891=function(t,n){const r=new Uint32Array(IP(t,n));return Ee(r)},e.wbg.__wbg_new_no_args_cb138f77cf6151ee=function(t,n){const r=new Function(Er(t,n));return Ee(r)},e.wbg.__wbg_queueMicrotask_9b549dfce8865860=function(t){const n=Oe(t).queueMicrotask;return Ee(n)},e.wbg.__wbg_queueMicrotask_fca69f5bfad613a5=function(t){queueMicrotask(Oe(t))},e.wbg.__wbg_resolve_fd5bfbaa4ce36e1e=function(t){const n=Promise.resolve(Oe(t));return Ee(n)},e.wbg.__wbg_set_781438a03c0c3c81=function(){return Ec(function(t,n,r){return Reflect.set(Oe(t),Oe(n),Oe(r))},arguments)},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,n){const r=Oe(n).stack,o=Un(r,V.__wbindgen_export,V.__wbindgen_export2),s=on;Ke().setInt32(t+4*1,s,!0),Ke().setInt32(t+4*0,o,!0)},e.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335=function(){const t=typeof global>"u"?null:global;return Li(t)?0:Ee(t)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1=function(){const t=typeof globalThis>"u"?null:globalThis;return Li(t)?0:Ee(t)},e.wbg.__wbg_static_accessor_SELF_08f5a74c69739274=function(){const t=typeof self>"u"?null:self;return Li(t)?0:Ee(t)},e.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024=function(){const t=typeof window>"u"?null:window;return Li(t)?0:Ee(t)},e.wbg.__wbg_then_4f95312d68691235=function(t,n){const r=Oe(t).then(Oe(n));return Ee(r)},e.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,n){const r=Er(t,n);return Ee(r)},e.wbg.__wbindgen_cast_a2f2ccacb7ef777f=function(t,n){const r=RP(t,n,V.__wasm_bindgen_func_elem_159,NP);return Ee(r)},e.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(t){return Ee(t)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=Oe(t);return Ee(n)},e.wbg.__wbindgen_object_drop_ref=function(t){Rr(t)},e}function LP(e,t){return V=e.exports,gx.__wbindgen_wasm_module=t,xr=null,ns=null,rs=null,os=null,V.__wbindgen_start(),V}async function gx(e){if(V!==void 0)return V;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("/assets/ifc_lite_wasm_bg-Cd3m3f2h.wasm",import.meta.url));const t=jP();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await AP(await e,t);return LP(n,r)}class OP{ifcApi=null;initialized=!1;async init(t="/"){if(this.initialized)return;const n=t.endsWith("/")?`${t}ifc_lite_wasm_bg.wasm`:`${t}/ifc_lite_wasm_bg.wasm`;await gx(n),this.ifcApi=new Lu,this.initialized=!0}parseMeshes(t){if(!this.ifcApi)throw new Error("IFC-Lite not initialized. Call init() first.");return this.ifcApi.parseMeshes(t)}getApi(){if(!this.ifcApi)throw new Error("IFC-Lite not initialized. Call init() first.");return this.ifcApi}isInitialized(){return this.initialized}getVersion(){return this.ifcApi?.version??"unknown"}}class qp{ifcApi;content;constructor(t,n){this.ifcApi=t,this.content=n}convertZUpToYUp(t){for(let n=0;n<t.length;n+=3){const r=t[n+1],o=t[n+2];t[n+1]=o,t[n+2]=-r}}collectMeshes(){const t=this.ifcApi.parseMeshes(this.content),n=[];for(let r=0;r<t.length;r++){const o=t.get(r);if(!o)continue;const s=o.color,i=[s[0],s[1],s[2],s[3]],a=o.positions,l=o.normals,c=o.indices;this.convertZUpToYUp(a),this.convertZUpToYUp(l),n.push({expressId:o.expressId,positions:a,normals:l,indices:c,color:i}),o.free()}return t.free(),n}async*collectMeshesStreaming(t=100){const n=this.ifcApi.parseMeshes(this.content);let r=[];for(let o=0;o<n.length;o++){const s=n.get(o);if(!s)continue;const i=s.color,a=[i[0],i[1],i[2],i[3]],l=s.positions,c=s.normals,u=s.indices;this.convertZUpToYUp(l),this.convertZUpToYUp(c),r.push({expressId:s.expressId,positions:l,normals:c,indices:u,color:a}),s.free(),r.length>=t&&(yield r,r=[],await new Promise(f=>setTimeout(f,0)))}r.length>0&&(yield r),n.free()}}class yx{buildInterleavedBuffer(t){const n=t.positions.length/3,r=new Float32Array(n*6);for(let o=0;o<n;o++){const s=o*6,i=o*3,a=o*3;r[s]=t.positions[i],r[s+1]=t.positions[i+1],r[s+2]=t.positions[i+2],r[s+3]=t.normals[a],r[s+4]=t.normals[a+1],r[s+5]=t.normals[a+2]}return r}processMeshes(t){let n=0,r=0;for(const o of t)n+=o.indices.length/3,r+=o.positions.length/3;return{meshes:t,totalTriangles:n,totalVertices:r}}}class DP{originShift={x:0,y:0,z:0};THRESHOLD=1e4;MAX_REASONABLE_COORD=1e7;accumulatedBounds=null;shiftCalculated=!1;isReasonableValue(t){return Number.isFinite(t)&&Math.abs(t)<this.MAX_REASONABLE_COORD}calculateBounds(t){const n={min:{x:1/0,y:1/0,z:1/0},max:{x:-1/0,y:-1/0,z:-1/0}};let r=0,o=0;for(const s of t){const i=s.positions;for(let a=0;a<i.length;a+=3){const l=i[a],c=i[a+1],u=i[a+2];this.isReasonableValue(l)&&this.isReasonableValue(c)&&this.isReasonableValue(u)?(n.min.x=Math.min(n.min.x,l),n.min.y=Math.min(n.min.y,c),n.min.z=Math.min(n.min.z,u),n.max.x=Math.max(n.max.x,l),n.max.y=Math.max(n.max.y,c),n.max.z=Math.max(n.max.z,u),r++):o++}}return o>0&&console.log(`[CoordinateHandler] Filtered ${o} corrupted vertices, kept ${r} valid`),n}needsShift(t){return Math.max(Math.abs(t.min.x),Math.abs(t.max.x),Math.abs(t.min.y),Math.abs(t.max.y),Math.abs(t.min.z),Math.abs(t.max.z))>this.THRESHOLD}calculateCentroid(t){return{x:(t.min.x+t.max.x)/2,y:(t.min.y+t.max.y)/2,z:(t.min.z+t.max.z)/2}}shiftPositions(t,n){for(let r=0;r<t.length;r+=3){const o=t[r],s=t[r+1],i=t[r+2];this.isReasonableValue(o)&&this.isReasonableValue(s)&&this.isReasonableValue(i)?(t[r]=o-n.x,t[r+1]=s-n.y,t[r+2]=i-n.z):(t[r]=0,t[r+1]=0,t[r+2]=0)}}shiftBounds(t,n){return{min:{x:t.min.x-n.x,y:t.min.y-n.y,z:t.min.z-n.z},max:{x:t.max.x-n.x,y:t.max.y-n.y,z:t.max.z-n.z}}}processMeshes(t){const n={originShift:{x:0,y:0,z:0},originalBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},shiftedBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},isGeoReferenced:!1};if(t.length===0)return n;const r=this.calculateBounds(t);if(!(r.min.x!==1/0&&r.max.x!==-1/0))return console.warn("[CoordinateHandler] No valid coordinates found in geometry"),n;const s={x:r.max.x-r.min.x,y:r.max.y-r.min.y,z:r.max.z-r.min.z},i=Math.max(s.x,s.y,s.z);if(console.log("[CoordinateHandler] Original bounds:",{min:r.min,max:r.max,size:s,maxSize:i.toFixed(2)+"m"}),!this.needsShift(r)){console.log("[CoordinateHandler] Coordinates within normal range, no shift needed");const u={x:0,y:0,z:0};for(const f of t)this.shiftPositions(f.positions,u);return{originShift:u,originalBounds:r,shiftedBounds:r,isGeoReferenced:!1}}const l=this.calculateCentroid(r);this.originShift=l,console.log("[CoordinateHandler] Large coordinates detected, shifting to origin:",{centroid:l,maxCoord:Math.max(Math.abs(r.min.x),Math.abs(r.max.x),Math.abs(r.min.y),Math.abs(r.max.y),Math.abs(r.min.z),Math.abs(r.max.z)).toFixed(2)+"m"});for(const u of t)this.shiftPositions(u.positions,l);const c=this.shiftBounds(r,l);return console.log("[CoordinateHandler] Shifted bounds:",{min:c.min,max:c.max,maxSize:i.toFixed(2)+"m"}),{originShift:l,originalBounds:r,shiftedBounds:c,isGeoReferenced:!0}}toWorldCoordinates(t){return{x:t.x+this.originShift.x,y:t.y+this.originShift.y,z:t.z+this.originShift.z}}toLocalCoordinates(t){return{x:t.x-this.originShift.x,y:t.y-this.originShift.y,z:t.z-this.originShift.z}}getOriginShift(){return{...this.originShift}}processMeshesIncremental(t){const n=this.calculateBounds(t);if(this.accumulatedBounds===null?this.accumulatedBounds=n:(this.accumulatedBounds.min.x=Math.min(this.accumulatedBounds.min.x,n.min.x),this.accumulatedBounds.min.y=Math.min(this.accumulatedBounds.min.y,n.min.y),this.accumulatedBounds.min.z=Math.min(this.accumulatedBounds.min.z,n.min.z),this.accumulatedBounds.max.x=Math.max(this.accumulatedBounds.max.x,n.max.x),this.accumulatedBounds.max.y=Math.max(this.accumulatedBounds.max.y,n.max.y),this.accumulatedBounds.max.z=Math.max(this.accumulatedBounds.max.z,n.max.z)),!this.shiftCalculated&&this.accumulatedBounds){if(this.accumulatedBounds.min.x!==1/0&&this.accumulatedBounds.max.x!==-1/0){const o={x:this.accumulatedBounds.max.x-this.accumulatedBounds.min.x,y:this.accumulatedBounds.max.y-this.accumulatedBounds.min.y,z:this.accumulatedBounds.max.z-this.accumulatedBounds.min.z},s=Math.max(o.x,o.y,o.z),i=this.calculateCentroid(this.accumulatedBounds),a=Math.sqrt(i.x**2+i.y**2+i.z**2);(a>this.THRESHOLD||s>this.THRESHOLD)&&(this.originShift=i,console.log("[CoordinateHandler] Large coordinates detected, shifting to origin:",{distanceFromOrigin:a.toFixed(2)+"m",maxSize:s.toFixed(2)+"m",shift:this.originShift}))}this.shiftCalculated=!0}if(this.originShift.x!==0||this.originShift.y!==0||this.originShift.z!==0)for(const r of t)this.shiftPositions(r.positions,this.originShift)}getCurrentCoordinateInfo(){if(!this.accumulatedBounds||!(this.accumulatedBounds.min.x!==1/0&&this.accumulatedBounds.max.x!==-1/0))return null;const n=this.shiftBounds(this.accumulatedBounds,this.originShift),r=this.originShift.x!==0||this.originShift.y!==0||this.originShift.z!==0;return{originShift:{...this.originShift},originalBounds:{...this.accumulatedBounds},shiftedBounds:n,isGeoReferenced:r}}getFinalCoordinateInfo(){const t=this.getCurrentCoordinateInfo();return t||{originShift:{x:0,y:0,z:0},originalBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},shiftedBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},isGeoReferenced:!1}}reset(){this.accumulatedBounds=null,this.shiftCalculated=!1,this.originShift={x:0,y:0,z:0}}}class FP{workers=[];taskQueue=[];activeTasks=new Map;availableWorkers=new Set;workerCount;workerUrl;initialized=!1;constructor(t,n){this.workerUrl=t,this.workerCount=n??Math.max(1,navigator.hardwareConcurrency??4)}async init(){if(this.initialized)return;const t=performance.now();if(typeof Worker>"u"){console.warn("[WorkerPool] Web Workers not available");return}try{for(let r=0;r<this.workerCount;r++){const o=performance.now(),s=new Worker(this.workerUrl,{type:"module"});await new Promise(i=>{const a=l=>{if(l.data.type==="ready"){s.removeEventListener("message",a),s.onmessage=u=>{this.handleMessage(s,u)};const c=performance.now()-o;console.log(`[WorkerPool] Worker ${r} ready in ${c.toFixed(2)}ms`),i()}};s.addEventListener("message",a)}),s.onerror=i=>{console.error(`[WorkerPool] Worker ${r} error:`,i),this.availableWorkers.delete(s)},this.workers.push(s),this.availableWorkers.add(s)}this.initialized=!0;const n=performance.now()-t;console.log(`[WorkerPool] Initialized ${this.workers.length} workers in ${n.toFixed(2)}ms`)}catch(n){console.error("[WorkerPool] Failed to initialize:",n)}}isAvailable(){return this.initialized&&this.workers.length>0&&this.availableWorkers.size>0}async submit(t,n){if(!this.isAvailable())throw new Error("Worker pool not available. Use fallback to main thread.");return new Promise((r,o)=>{const s={id:crypto.randomUUID(),type:t,data:n,resolve:r,reject:o};this.taskQueue.push(s),this.processQueue()})}processQueue(){if(this.taskQueue.length===0||this.availableWorkers.size===0)return;const t=Array.from(this.availableWorkers)[0],n=this.taskQueue.shift();!n||!t||(this.activeTasks.set(n.id,n),this.availableWorkers.delete(t),t.postMessage({id:n.id,type:n.type,data:n.data}))}handleMessage(t,n){const{id:r,type:o,result:s,error:i}=n.data;if(o==="ready")return;const a=this.activeTasks.get(r);if(!a){console.warn(`[WorkerPool] Task ${r} not found`),this.availableWorkers.add(t),this.processQueue();return}this.activeTasks.delete(r),o==="task-result"?a.resolve(s):o==="task-error"&&a.reject(new Error(i||"Unknown worker error")),this.availableWorkers.add(t),this.processQueue()}terminate(){for(const t of this.workers)t.terminate();this.workers=[],this.availableWorkers.clear(),this.taskQueue=[],this.activeTasks.clear(),this.initialized=!1}}var vx=(e=>(e.Fast="fast",e.Balanced="balanced",e.High="high",e))(vx||{});class BP{bridge;bufferBuilder;coordinateHandler;workerPool=null;wasmPath="/";useWorkers=!1;constructor(t={}){this.bridge=new OP,this.bufferBuilder=new yx,this.coordinateHandler=new DP,this.useWorkers=t.useWorkers??!1,t.quality}async init(t="/"){this.wasmPath=t,await this.bridge.init(t)}async process(t,n){this.bridge.isInitialized()||await this.init();let r;if(this.useWorkers){if(!this.workerPool)try{let a;try{a=new URL("/assets/geometry.worker-DpnHtNr3.ts",import.meta.url)}catch{a="./geometry.worker.ts"}this.workerPool=new FP(a,1),await this.workerPool.init()}catch(a){console.warn("[GeometryProcessor] Worker pool initialization failed, will use main thread:",a),this.workerPool=null}if(this.workerPool?.isAvailable())try{r=await this.workerPool.submit("mesh-collection",{buffer:t.buffer,wasmPath:this.wasmPath})}catch(a){console.warn("[Geometry] Worker pool failed, falling back to main thread:",a),r=await this.collectMeshesMainThread(t)}else r=await this.collectMeshesMainThread(t)}else r=await this.collectMeshesMainThread(t);const o=this.coordinateHandler.processMeshes(r),s=this.bufferBuilder.processMeshes(r);return{meshes:s.meshes,totalTriangles:s.totalTriangles,totalVertices:s.totalVertices,coordinateInfo:o}}async collectMeshesMainThread(t,n){const o=new TextDecoder().decode(t);return new qp(this.bridge.getApi(),o).collectMeshes()}async*processStreaming(t,n,r=100){this.bridge.isInitialized()||await this.init(),this.coordinateHandler.reset(),yield{type:"start",totalEstimate:t.length/1e3};const s=new TextDecoder().decode(t);yield{type:"model-open",modelID:0};const i=new qp(this.bridge.getApi(),s);let a=0;for await(const c of i.collectMeshesStreaming(r)){this.coordinateHandler.processMeshesIncremental(c),a+=c.length;const u=this.coordinateHandler.getCurrentCoordinateInfo();yield{type:"batch",meshes:c,totalSoFar:a,coordinateInfo:u||void 0}}const l=this.coordinateHandler.getFinalCoordinateInfo();yield{type:"complete",totalMeshes:a,coordinateInfo:l}}dispose(){this.workerPool&&(this.workerPool.terminate(),this.workerPool=null)}}class Hs{store;expressId;constructor(t,n){this.store=t,this.expressId=n}get globalId(){return this.store.entities.getGlobalId(this.expressId)}get name(){return this.store.entities.getName(this.expressId)}get type(){return this.store.entities.getTypeName(this.expressId)}contains(){return this.getRelated(te.ContainsElements,"forward")}containedIn(){return this.getRelated(te.ContainsElements,"inverse")[0]??null}decomposes(){return this.getRelated(te.Aggregates,"forward")}decomposedBy(){return this.getRelated(te.Aggregates,"inverse")[0]??null}definingType(){return this.getRelated(te.DefinesByType,"forward")[0]??null}instances(){return this.getRelated(te.DefinesByType,"inverse")}voids(){return this.getRelated(te.VoidsElement,"forward")}filledBy(){return this.getRelated(te.FillsElement,"inverse")}traverse(t,n,r="forward"){const o=new Set,s=[],i=(a,l)=>{if(l>n||o.has(a))return;o.add(a),a!==this.expressId&&s.push(new Hs(this.store,a));const c=r==="forward"?this.store.relationships.forward.getEdges(a,t):this.store.relationships.inverse.getEdges(a,t);for(const u of c)i(u.target,l+1)};return i(this.expressId,0),s}building(){let t=this;const n=new Set;for(;t&&!n.has(t.expressId);){if(n.add(t.expressId),t.type==="IfcBuilding")return t;t=t.containedIn()??t.decomposedBy()}return null}storey(){let t=this;const n=new Set;for(;t&&!n.has(t.expressId);){if(n.add(t.expressId),t.type==="IfcBuildingStorey")return t;t=t.containedIn()??t.decomposedBy()}return null}properties(){return this.store.properties.getForEntity(this.expressId)}property(t,n){return this.store.properties.getPropertyValue(this.expressId,t,n)}quantities(){return this.store.quantities.getForEntity(this.expressId)}quantity(t,n){return this.store.quantities.getQuantityValue(this.expressId,t,n)}getRelated(t,n){return this.store.relationships.getRelated(this.expressId,t,n).map(o=>new Hs(this.store,o))}}class $P{store;expressId;_properties;_quantities;_geometry;constructor(t,n,r){this.store=t,this.expressId=n}get globalId(){return this.store.entities.getGlobalId(this.expressId)}get name(){return this.store.entities.getName(this.expressId)}get type(){return this.store.entities.getTypeName(this.expressId)}get properties(){return this._properties!==void 0?this._properties:this.store.properties.getForEntity(this.expressId)}get quantities(){return this._quantities!==void 0?this._quantities:this.store.quantities?this.store.quantities.getForEntity(this.expressId):[]}get geometry(){return this._geometry!==void 0?this._geometry:null}getProperty(t,n){return this.store.properties.getPropertyValue(this.expressId,t,n)}loadProperties(){this._properties===void 0&&(this._properties=this.store.properties.getForEntity(this.expressId))}loadQuantities(){this._quantities===void 0&&this.store.quantities?this._quantities=this.store.quantities.getForEntity(this.expressId):this._quantities===void 0&&(this._quantities=[])}loadGeometry(){this._geometry===void 0&&(this._geometry=null)}asNode(){return new Hs(this.store,this.expressId)}toJSON(){return{expressId:this.expressId,globalId:this.globalId,name:this.name,type:this.type,properties:this.properties,quantities:this.quantities.length>0?this.quantities:void 0}}}class Qo{store;typeFilter;idFilter;propertyFilters=[];limitCount=null;offsetCount=0;includeFlags={};constructor(t,n,r=null){this.store=t,this.typeFilter=n,this.idFilter=r}whereProperty(t,n,r,o){return this.propertyFilters.push({pset:t,prop:n,op:r,value:o}),this}limit(t){return this.limitCount=t,this}offset(t){return this.offsetCount=t,this}includeGeometry(){return this.includeFlags.geometry=!0,this}includeProperties(){return this.includeFlags.properties=!0,this}includeQuantities(){return this.includeFlags.quantities=!0,this}includeAll(){return this.includeFlags={geometry:!0,properties:!0,quantities:!0},this}execute(){let t=this.getCandidateIds();t=this.applyPropertyFilters(t),this.offsetCount>0&&(t=t.slice(this.offsetCount)),this.limitCount!==null&&(t=t.slice(0,this.limitCount));const n=t.map(r=>new $P(this.store,r,this.includeFlags));for(const r of n)this.includeFlags.properties&&r.loadProperties(),this.includeFlags.quantities&&r.loadQuantities(),this.includeFlags.geometry&&r.loadGeometry();return n}async ids(){let t=this.getCandidateIds();return t=this.applyPropertyFilters(t),this.offsetCount>0&&(t=t.slice(this.offsetCount)),this.limitCount!==null&&(t=t.slice(0,this.limitCount)),t}async count(){let t=this.getCandidateIds();return t=this.applyPropertyFilters(t),t.length}async first(){return this.limit(1).execute()[0]??null}getCandidateIds(){if(this.idFilter)return[...this.idFilter];if(this.typeFilter){const n=[];for(const r of this.typeFilter)n.push(...this.store.entities.getByType(r));return n}const t=[];for(let n=0;n<this.store.entities.count;n++)t.push(this.store.entities.expressId[n]);return t}applyPropertyFilters(t){if(this.propertyFilters.length===0)return t;let n=t;for(const r of this.propertyFilters){const o=this.store.properties.findByProperty(r.prop,r.op,r.value),s=new Set(o);n=n.filter(i=>s.has(i))}return n}}class Xp{db=null;conn=null;initPromise=null;initialized=!1;async init(t){if(!this.initialized)return this.initPromise?this.initPromise:(this.initPromise=(async()=>{try{const n=await new Function('return import("@duckdb/duckdb-wasm")')(),r=await n.selectBundle(n.getJsDelivrBundles()),o=new Worker(r.mainWorker);this.db=new n.AsyncDuckDB(new n.ConsoleLogger,o),await this.db.instantiate(r.mainModule,r.pthreadWorker),this.conn=await this.db.connect(),await this.registerTables(t),await this.createViews(),this.initialized=!0,console.log("[DuckDB] Initialization complete")}catch(n){throw new Error(`Failed to initialize DuckDB: ${n}`)}})(),this.initPromise)}async query(t){if(!this.initialized)throw new Error("DuckDB not initialized. Call init() first.");const n=await this.conn.query(t),r=n.toArray();return{columns:n.schema.fields.map(o=>o.name),rows:r,toArray:()=>r,toJSON:()=>r.map(o=>{const s={};return n.schema.fields.forEach((i,a)=>{s[i.name]=Array.isArray(o)?o[a]:o[i.name]}),s})}}async registerTables(t){console.log("[DuckDB] Registering tables from store with",t.entities.count,"entities"),await this.createEntitiesTable(t),await this.createPropertiesTable(t),await this.createQuantitiesTable(t),await this.createRelationshipsTable(t),console.log("[DuckDB] All tables registered successfully")}async createEntitiesTable(t){await this.conn.query(`
373
+ CREATE TABLE entities (
374
+ express_id INTEGER PRIMARY KEY,
375
+ global_id VARCHAR,
376
+ name VARCHAR,
377
+ description VARCHAR,
378
+ type VARCHAR,
379
+ object_type VARCHAR,
380
+ has_geometry BOOLEAN,
381
+ is_type BOOLEAN,
382
+ contained_in_storey INTEGER,
383
+ defined_by_type INTEGER
384
+ )
385
+ `);const{entities:n,strings:r}=t,o=1e3;for(let s=0;s<n.count;s+=o){const i=Math.min(s+o,n.count),a=[];for(let l=s;l<i;l++){const c=n.expressId[l],u=Rt(r.get(n.globalId[l])),f=Rt(r.get(n.name[l])),h=Rt(r.get(n.description[l])),y=Rt(mx(n.typeEnum[l])),m=Rt(r.get(n.objectType[l])),v=(n.flags[l]&1)!==0,b=(n.flags[l]&2)!==0,g=n.containedInStorey[l]||"NULL",x=n.definedByType[l]||"NULL";a.push(`(${c}, '${u}', '${f}', '${h}', '${y}', '${m}', ${v}, ${b}, ${g}, ${x})`)}a.length>0&&await this.conn.query(`INSERT INTO entities VALUES ${a.join(", ")}`)}console.log(`[DuckDB] Registered entities table with ${n.count} rows`)}async createPropertiesTable(t){await this.conn.query(`
386
+ CREATE TABLE properties (
387
+ entity_id INTEGER,
388
+ pset_name VARCHAR,
389
+ pset_global_id VARCHAR,
390
+ prop_name VARCHAR,
391
+ prop_type VARCHAR,
392
+ value_string VARCHAR,
393
+ value_real DOUBLE,
394
+ value_int INTEGER,
395
+ value_bool BOOLEAN
396
+ )
397
+ `);const{properties:n,strings:r}=t,o=1e3,s={[le.String]:"String",[le.Real]:"Real",[le.Integer]:"Integer",[le.Boolean]:"Boolean",[le.Logical]:"Logical",[le.Label]:"Label",[le.Identifier]:"Identifier",[le.Text]:"Text",[le.Enum]:"Enum",[le.Reference]:"Reference",[le.List]:"List"};for(let i=0;i<n.count;i+=o){const a=Math.min(i+o,n.count),l=[];for(let c=i;c<a;c++){const u=n.entityId[c],f=Rt(r.get(n.psetName[c])),h=Rt(r.get(n.psetGlobalId[c])),y=Rt(r.get(n.propName[c])),m=s[n.propType[c]]||"Unknown",v=n.valueString[c],b=v>=0?Rt(r.get(v)):"",g=isNaN(n.valueReal[c])?"NULL":n.valueReal[c],x=n.valueInt[c],w=n.valueBool[c],S=w===255?"NULL":w===1?"true":"false";l.push(`(${u}, '${f}', '${h}', '${y}', '${m}', '${b}', ${g}, ${x}, ${S})`)}l.length>0&&await this.conn.query(`INSERT INTO properties VALUES ${l.join(", ")}`)}console.log(`[DuckDB] Registered properties table with ${n.count} rows`)}async createQuantitiesTable(t){await this.conn.query(`
398
+ CREATE TABLE quantities (
399
+ entity_id INTEGER,
400
+ qset_name VARCHAR,
401
+ quantity_name VARCHAR,
402
+ quantity_type VARCHAR,
403
+ value DOUBLE,
404
+ formula VARCHAR
405
+ )
406
+ `);const{quantities:n,strings:r}=t,o=1e3,s={[nt.Length]:"Length",[nt.Area]:"Area",[nt.Volume]:"Volume",[nt.Count]:"Count",[nt.Weight]:"Weight",[nt.Time]:"Time"};for(let i=0;i<n.count;i+=o){const a=Math.min(i+o,n.count),l=[];for(let c=i;c<a;c++){const u=n.entityId[c],f=Rt(r.get(n.qsetName[c])),h=Rt(r.get(n.quantityName[c])),y=s[n.quantityType[c]]||"Unknown",m=n.value[c],v=n.formula[c],b=v>0?Rt(r.get(v)):"";l.push(`(${u}, '${f}', '${h}', '${y}', ${m}, '${b}')`)}l.length>0&&await this.conn.query(`INSERT INTO quantities VALUES ${l.join(", ")}`)}console.log(`[DuckDB] Registered quantities table with ${n.count} rows`)}async createRelationshipsTable(t){await this.conn.query(`
407
+ CREATE TABLE relationships (
408
+ source_id INTEGER,
409
+ target_id INTEGER,
410
+ rel_type VARCHAR,
411
+ rel_id INTEGER
412
+ )
413
+ `);const{relationships:n}=t,r=n.forward,o=1e3,s={[te.ContainsElements]:"ContainsElements",[te.Aggregates]:"Aggregates",[te.DefinesByProperties]:"DefinesByProperties",[te.DefinesByType]:"DefinesByType",[te.AssociatesMaterial]:"AssociatesMaterial",[te.AssociatesClassification]:"AssociatesClassification",[te.VoidsElement]:"VoidsElement",[te.FillsElement]:"FillsElement",[te.ConnectsPathElements]:"ConnectsPathElements",[te.ConnectsElements]:"ConnectsElements",[te.SpaceBoundary]:"SpaceBoundary",[te.AssignsToGroup]:"AssignsToGroup",[te.AssignsToProduct]:"AssignsToProduct",[te.ReferencedInSpatialStructure]:"ReferencedInSpatialStructure"},i=[];for(const[a,l]of r.offsets){const c=r.counts.get(a)||0;for(let u=l;u<l+c;u++)i.push({sourceId:a,targetId:r.edgeTargets[u],relType:s[r.edgeTypes[u]]||"Unknown",relId:r.edgeRelIds[u]})}for(let a=0;a<i.length;a+=o){const l=Math.min(a+o,i.length),c=[];for(let u=a;u<l;u++){const f=i[u];c.push(`(${f.sourceId}, ${f.targetId}, '${f.relType}', ${f.relId})`)}c.length>0&&await this.conn.query(`INSERT INTO relationships VALUES ${c.join(", ")}`)}console.log(`[DuckDB] Registered relationships table with ${i.length} rows`)}async createViews(){try{await this.conn.query(`
414
+ CREATE VIEW IF NOT EXISTS walls AS
415
+ SELECT * FROM entities WHERE type IN ('IfcWall', 'IfcWallStandardCase')
416
+ `),await this.conn.query(`
417
+ CREATE VIEW IF NOT EXISTS doors AS
418
+ SELECT * FROM entities WHERE type = 'IfcDoor'
419
+ `),await this.conn.query(`
420
+ CREATE VIEW IF NOT EXISTS windows AS
421
+ SELECT * FROM entities WHERE type = 'IfcWindow'
422
+ `),await this.conn.query(`
423
+ CREATE VIEW IF NOT EXISTS slabs AS
424
+ SELECT * FROM entities WHERE type = 'IfcSlab'
425
+ `),await this.conn.query(`
426
+ CREATE VIEW IF NOT EXISTS columns AS
427
+ SELECT * FROM entities WHERE type = 'IfcColumn'
428
+ `),await this.conn.query(`
429
+ CREATE VIEW IF NOT EXISTS beams AS
430
+ SELECT * FROM entities WHERE type = 'IfcBeam'
431
+ `),await this.conn.query(`
432
+ CREATE VIEW IF NOT EXISTS spaces AS
433
+ SELECT * FROM entities WHERE type = 'IfcSpace'
434
+ `),await this.conn.query(`
435
+ CREATE VIEW IF NOT EXISTS entity_properties AS
436
+ SELECT
437
+ e.express_id, e.name as entity_name, e.type as entity_type,
438
+ p.pset_name, p.prop_name, p.prop_type,
439
+ p.value_string, p.value_real, p.value_int, p.value_bool
440
+ FROM entities e
441
+ LEFT JOIN properties p ON e.express_id = p.entity_id
442
+ `),await this.conn.query(`
443
+ CREATE VIEW IF NOT EXISTS entity_quantities AS
444
+ SELECT
445
+ e.express_id, e.name as entity_name, e.type as entity_type,
446
+ q.qset_name, q.quantity_name, q.quantity_type, q.value
447
+ FROM entities e
448
+ LEFT JOIN quantities q ON e.express_id = q.entity_id
449
+ `),console.log("[DuckDB] Created convenience views")}catch(t){console.warn("[DuckDB] Could not create views:",t)}}static async isAvailable(){try{return await new Function('return import("@duckdb/duckdb-wasm")')(),!0}catch{return!1}}async dispose(){this.conn&&(await this.conn.close(),this.conn=null),this.db&&(await this.db.terminate(),this.db=null),this.initialized=!1,this.initPromise=null}}function Rt(e){return e==null?"":e.replace(/'/g,"''")}class VP{store;duckdb=null;constructor(t){this.store=t}async sql(t){return await this.ensureDuckDB(),this.duckdb.query(t)}async ensureDuckDB(){if(!this.duckdb){if(!await Xp.isAvailable())throw new Error("DuckDB-WASM is not available. Install @duckdb/duckdb-wasm to use SQL queries.");this.duckdb=new Xp,await this.duckdb.init(this.store)}}walls(){return this.ofType("IfcWall","IfcWallStandardCase")}doors(){return this.ofType("IfcDoor")}windows(){return this.ofType("IfcWindow")}slabs(){return this.ofType("IfcSlab")}columns(){return this.ofType("IfcColumn")}beams(){return this.ofType("IfcBeam")}spaces(){return this.ofType("IfcSpace")}ofType(...t){const n=t.map(r=>px(r));return new Qo(this.store,n)}all(){return new Qo(this.store,null)}byId(t){return new Qo(this.store,null,[t])}entity(t){return new Hs(this.store,t)}inBounds(t){if(!this.store.spatialIndex)throw new Error("Spatial index not available. Geometry must be processed first.");const n=this.store.spatialIndex.queryAABB(t);return new Qo(this.store,null,n)}onStorey(t){if(!this.store.spatialHierarchy)throw new Error("Spatial hierarchy not available.");const n=this.store.spatialHierarchy.byStorey.get(t)??[];return new Qo(this.store,null,n)}raycast(t,n){if(!this.store.spatialIndex)throw new Error("Spatial index not available. Geometry must be processed first.");return this.store.spatialIndex.raycast(t,n)}get hierarchy(){return this.store.spatialHierarchy??null}get project(){return this.store.spatialHierarchy?this.entity(this.store.spatialHierarchy.project.expressId):null}get storeys(){return this.store.spatialHierarchy?[...this.store.spatialHierarchy.byStorey.keys()].sort((t,n)=>{const r=this.store.spatialHierarchy.storeyElevations.get(t)??0,o=this.store.spatialHierarchy.storeyElevations.get(n)??0;return r-o}).map(t=>this.entity(t)):[]}}class Qp{static intersects(t,n){return t.min[0]<=n.max[0]&&t.max[0]>=n.min[0]&&t.min[1]<=n.max[1]&&t.max[1]>=n.min[1]&&t.min[2]<=n.max[2]&&t.max[2]>=n.min[2]}static union(t,n){return{min:[Math.min(t.min[0],n.min[0]),Math.min(t.min[1],n.min[1]),Math.min(t.min[2],n.min[2])],max:[Math.max(t.max[0],n.max[0]),Math.max(t.max[1],n.max[1]),Math.max(t.max[2],n.max[2])]}}static center(t){return[(t.min[0]+t.max[0])/2,(t.min[1]+t.max[1])/2,(t.min[2]+t.max[2])/2]}static size(t){return[t.max[0]-t.min[0],t.max[1]-t.min[1],t.max[2]-t.min[2]]}static surfaceArea(t){const[n,r,o]=this.size(t);return 2*(n*r+n*o+r*o)}static contains(t,n){return n[0]>=t.min[0]&&n[0]<=t.max[0]&&n[1]>=t.min[1]&&n[1]<=t.max[1]&&n[2]>=t.min[2]&&n[2]<=t.max[2]}}class Ou{static isAABBVisible(t,n){for(const r of t.planes){const o=[r.normal[0]>0?n.max[0]:n.min[0],r.normal[1]>0?n.max[1]:n.min[1],r.normal[2]>0?n.max[2]:n.min[2]];if(this.pointToPlaneDistance(o,r)<0)return!1}return!0}static pointToPlaneDistance(t,n){return t[0]*n.normal[0]+t[1]*n.normal[1]+t[2]*n.normal[2]+n.distance}static fromViewProjMatrix(t){const n=t,r=[];r.push({normal:[n[3]+n[0],n[7]+n[4],n[11]+n[8]],distance:n[15]+n[12]}),r.push({normal:[n[3]-n[0],n[7]-n[4],n[11]-n[8]],distance:n[15]-n[12]}),r.push({normal:[n[3]+n[1],n[7]+n[5],n[11]+n[9]],distance:n[15]+n[13]}),r.push({normal:[n[3]-n[1],n[7]-n[5],n[11]-n[9]],distance:n[15]-n[13]}),r.push({normal:[n[3]+n[2],n[7]+n[6],n[11]+n[10]],distance:n[15]+n[14]}),r.push({normal:[n[3]-n[2],n[7]-n[6],n[11]-n[10]],distance:n[15]-n[14]});for(const o of r){const s=Math.sqrt(o.normal[0]**2+o.normal[1]**2+o.normal[2]**2);s>0&&(o.normal[0]/=s,o.normal[1]/=s,o.normal[2]/=s,o.distance/=s)}return{planes:r}}}class df{root=null;meshes=[];static build(t){const n=new df;if(n.meshes=t,t.length===0)return n;const r=t.map((o,s)=>s);return n.root=n.buildNode(r,0),n}queryAABB(t){const n=[];return this.root&&this.queryNode(this.root,t,n),n}raycast(t,n){const r=[];if(!this.root)return r;const o=Math.sqrt(n[0]**2+n[1]**2+n[2]**2),s=[n[0]/o,n[1]/o,n[2]/o];return this.raycastNode(this.root,t,s,r),r}queryFrustum(t){const n=[];return this.root&&this.queryFrustumNode(this.root,t,n),n}buildNode(t,n){if(t.length===0)throw new Error("Empty node");if(t.length===1)return{bounds:this.meshes[t[0]].bounds,meshIndices:[t[0]]};const r=this.computeBounds(t),o=[r.max[0]-r.min[0],r.max[1]-r.min[1],r.max[2]-r.min[2]],s=o[0]>o[1]&&o[0]>o[2]?0:o[1]>o[2]?1:2;t.sort((c,u)=>{const f=(this.meshes[c].bounds.min[s]+this.meshes[c].bounds.max[s])/2,h=(this.meshes[u].bounds.min[s]+this.meshes[u].bounds.max[s])/2;return f-h});const i=Math.floor(t.length/2),a=t.slice(0,i),l=t.slice(i);return{bounds:r,left:this.buildNode(a,n+1),right:this.buildNode(l,n+1)}}computeBounds(t){let n=1/0,r=1/0,o=1/0,s=-1/0,i=-1/0,a=-1/0;for(const l of t){const c=this.meshes[l].bounds;n=Math.min(n,c.min[0]),r=Math.min(r,c.min[1]),o=Math.min(o,c.min[2]),s=Math.max(s,c.max[0]),i=Math.max(i,c.max[1]),a=Math.max(a,c.max[2])}return{min:[n,r,o],max:[s,i,a]}}queryNode(t,n,r){if(Qp.intersects(t.bounds,n))if(t.meshIndices)for(const o of t.meshIndices)Qp.intersects(this.meshes[o].bounds,n)&&r.push(this.meshes[o].expressId);else t.left&&this.queryNode(t.left,n,r),t.right&&this.queryNode(t.right,n,r)}raycastNode(t,n,r,o){if(this.rayIntersectsAABB(n,r,t.bounds))if(t.meshIndices)for(const s of t.meshIndices)this.rayIntersectsAABB(n,r,this.meshes[s].bounds)&&o.push(this.meshes[s].expressId);else t.left&&this.raycastNode(t.left,n,r,o),t.right&&this.raycastNode(t.right,n,r,o)}queryFrustumNode(t,n,r){if(Ou.isAABBVisible(n,t.bounds))if(t.meshIndices)for(const o of t.meshIndices)Ou.isAABBVisible(n,this.meshes[o].bounds)&&r.push(this.meshes[o].expressId);else t.left&&this.queryFrustumNode(t.left,n,r),t.right&&this.queryFrustumNode(t.right,n,r)}rayIntersectsAABB(t,n,r){let o=-1/0,s=1/0;for(let i=0;i<3;i++){const a=1/n[i];let l=(r.min[i]-t[i])*a,c=(r.max[i]-t[i])*a;if(a<0&&([l,c]=[c,l]),o=Math.max(o,l),s=Math.min(s,c),s<o)return!1}return s>=0}}function UP(e){const t=e.map(n=>{const r=WP(n);return{expressId:n.expressId,bounds:r}});return df.build(t)}function WP(e){const t=e.positions;if(t.length===0)return{min:[0,0,0],max:[0,0,0]};let n=1/0,r=1/0,o=1/0,s=-1/0,i=-1/0,a=-1/0;for(let l=0;l<t.length;l+=3){const c=t[l],u=t[l+1],f=t[l+2];n=Math.min(n,c),r=Math.min(r,u),o=Math.min(o,f),s=Math.max(s,c),i=Math.max(i,u),a=Math.max(a,f)}return{min:[n,r,o],max:[s,i,a]}}function cr(){const{loading:e,progress:t,error:n,ifcDataStore:r,geometryResult:o,setLoading:s,setProgress:i,setError:a,setIfcDataStore:l,setGeometryResult:c,appendGeometryBatch:u,updateCoordinateInfo:f}=D(),h=p.useRef(null),y=p.useCallback(async v=>{const{resetViewerState:b}=D.getState();try{b(),s(!0),a(null),i({phase:"Loading file",percent:0});const g=await v.arrayBuffer();i({phase:"Parsing IFC",percent:10});const w=await new CP().parseColumnar(g,{onProgress:R=>{i({phase:`Parsing: ${R.phase}`,percent:10+R.percent*.4})}});l(w),i({phase:"Triangulating geometry",percent:50});const S=new BP({useWorkers:!1,quality:vx.Balanced});await S.init();const C=new Map;if(w.entityIndex?.byId)for(const[R,z]of w.entityIndex.byId)C.set(R,{type:z.type});const _=new yx;let E=0,I=0;const M=[];c(null);try{for await(const R of S.processStreaming(new Uint8Array(g),C,100))switch(R.type){case"start":E=R.totalEstimate;break;case"model-open":i({phase:"Processing geometry",percent:50});break;case"batch":M.push(...R.meshes);const z=_.processMeshes(R.meshes).meshes;u(z,R.coordinateInfo),I=R.totalSoFar;const P=50+Math.min(45,I/Math.max(E,I)*45);i({phase:`Rendering geometry (${I} meshes)`,percent:P});break;case"complete":if(f(R.coordinateInfo),M.length>0){i({phase:"Building spatial index",percent:95});try{const j=UP(M);w.spatialIndex=j,l(w)}catch(j){console.warn("[useIfc] Failed to build spatial index:",j)}}i({phase:"Complete",percent:100});break}}catch(R){console.error("[useIfc] Error in streaming processing:",R),a(R instanceof Error?R.message:"Unknown error during geometry processing")}s(!1)}catch(g){a(g instanceof Error?g.message:"Unknown error"),s(!1)}},[s,a,i,l,c,u,f]),m=p.useMemo(()=>r?(h.current=r,new VP(r)):null,[r]);return{loading:e,progress:t,error:n,ifcDataStore:r,geometryResult:o,query:m,loadFile:y}}class HP{geometryResult;constructor(t){this.geometryResult=t}exportGLB(t={}){const n=this.buildGLTF(t);return this.packGLB(n.json,n.buffers)}exportGLTF(t={}){const n=this.buildGLTF(t);return{json:JSON.stringify(n.json,null,2),bin:this.combineBuffers(n.buffers)}}buildGLTF(t){const n=this.geometryResult.meshes,r={asset:{version:"2.0",generator:"IFC-Lite"},scene:0,scenes:[{nodes:[]}],nodes:[],meshes:[],accessors:[],bufferViews:[],buffers:[{byteLength:0}]};t.includeMetadata&&(r.asset.extras={meshCount:n.length,vertexCount:this.geometryResult.totalVertices,triangleCount:this.geometryResult.totalTriangles});const o=[],s=[],i=[],a=[],l=b=>{if(b.length===0)return{min:[0,0,0],max:[0,0,0]};let g=b[0],x=b[1],w=b[2],S=b[0],C=b[1],_=b[2];for(let E=0;E<b.length;E+=3){const I=b[E],M=b[E+1],R=b[E+2];g=Math.min(g,I),x=Math.min(x,M),w=Math.min(w,R),S=Math.max(S,I),C=Math.max(C,M),_=Math.max(_,R)}return{min:[g,x,w],max:[S,C,_]}};for(let b=0;b<n.length;b++){const g=n[b],x=g.positions||[],w=g.normals||[],S=g.indices||[];if(!x.length||!w.length||!S.length){console.warn(`Skipping empty mesh ${b} (positions: ${x.length}, normals: ${w.length}, indices: ${S.length})`);continue}if(x.length%3!==0){console.warn(`Mesh ${b} has invalid position count: ${x.length} (not divisible by 3)`);continue}if(w.length%3!==0){console.warn(`Mesh ${b} has invalid normal count: ${w.length} (not divisible by 3)`);continue}const C=o.length*4,_=s.length*4,E=i.length*4,I=Array.from(x),M=Array.from(w),R=Array.from(S);o.push(...I),s.push(...M),i.push(...R);const z=l(I),P=r.accessors.length;r.accessors.push({bufferView:0,byteOffset:C,componentType:5126,count:x.length/3,type:"VEC3",min:z.min,max:z.max});const j=r.accessors.length;r.accessors.push({bufferView:1,byteOffset:_,componentType:5126,count:w.length/3,type:"VEC3"});const W=r.accessors.length;r.accessors.push({bufferView:2,byteOffset:E,componentType:5125,count:S.length,type:"SCALAR"});const $=r.meshes.length;r.meshes.push({primitives:[{attributes:{POSITION:P,NORMAL:j},indices:W}]});const O=r.nodes.length,H={mesh:$};t.includeMetadata&&g.expressId&&(H.extras={expressId:g.expressId}),r.nodes.push(H),a.push(O)}if(r.scenes[0].nodes=a,o.length===0||s.length===0||i.length===0)throw new Error("Cannot export GLB: no valid geometry data found");const c=new Float32Array(o),u=new Float32Array(s),f=new Uint32Array(i),h=c.buffer,y=u.buffer,m=f.buffer,v=h.byteLength+y.byteLength+m.byteLength;r.bufferViews.push({buffer:0,byteOffset:0,byteLength:h.byteLength,byteStride:12,target:34962}),r.bufferViews.push({buffer:0,byteOffset:h.byteLength,byteLength:y.byteLength,byteStride:12,target:34962}),r.bufferViews.push({buffer:0,byteOffset:h.byteLength+y.byteLength,byteLength:m.byteLength,target:34963}),r.buffers[0].byteLength=v;for(const b of r.accessors){const g=r.bufferViews[b.bufferView];if(!g)throw new Error(`Accessor references invalid bufferView ${b.bufferView}`);let x=0;if(b.componentType===5126)x=4;else if(b.componentType===5125)x=4;else if(b.componentType===5123)x=2;else if(b.componentType===5120)x=1;else throw new Error(`Unsupported component type: ${b.componentType}`);let w=1;if(b.type==="VEC3")w=3;else if(b.type==="VEC2")w=2;else if(b.type==="SCALAR")w=1;else throw new Error(`Unsupported accessor type: ${b.type}`);const S=b.count*w*x,C=(b.byteOffset||0)+S;if(C>g.byteLength)throw new Error(`Accessor exceeds bufferView bounds: accessor byteOffset=${b.byteOffset||0}, length=${S}, bufferView byteLength=${g.byteLength}, end=${C}`)}return{json:r,buffers:[new Uint8Array(h),new Uint8Array(y),new Uint8Array(m)]}}combineBuffers(t){const n=t.reduce((s,i)=>s+i.byteLength,0),r=new Uint8Array(n);let o=0;for(const s of t)r.set(s,o),o+=s.byteLength;return r}packGLB(t,n){const r=JSON.stringify(t),o=new TextEncoder().encode(r),s=(4-o.byteLength%4)%4,i=o.byteLength+s,a=this.combineBuffers(n),l=(4-a.byteLength%4)%4,c=a.byteLength+l,u=20+i+8+c,f=new ArrayBuffer(u),h=new DataView(f),y=new Uint8Array(f);let m=0;h.setUint32(m,1179937895,!0),m+=4,h.setUint32(m,2,!0),m+=4,h.setUint32(m,u,!0),m+=4,h.setUint32(m,i,!0),m+=4,h.setUint32(m,1313821514,!0),m+=4,y.set(o,m),m+=o.byteLength;for(let v=0;v<s;v++)y[m++]=32;return h.setUint32(m,c,!0),m+=4,h.setUint32(m,5130562,!0),m+=4,y.set(a,m),new Uint8Array(f)}}class GP{store;constructor(t){this.store=t}exportEntities(t,n={}){const r=n.delimiter??",",o=n.includeProperties??!1,s=n.flattenProperties??!1,i=["expressId","globalId","name","type"],a=new Map;if(o&&s){const u=t??this.getAllEntityIds();for(const f of u){const h=this.store.properties.getForEntity(f);for(const y of h){a.has(y.name)||a.set(y.name,new Set);for(const m of y.properties)a.get(y.name).add(m.name)}}for(const[f,h]of a)for(const y of h)i.push(`${f}_${y}`)}const l=[this.escapeRow(i,r)],c=t??this.getAllEntityIds();for(const u of c){const f=[String(u),this.escapeValue(this.store.entities.getGlobalId(u)),this.escapeValue(this.store.entities.getName(u)),this.escapeValue(this.store.entities.getTypeName(u))];if(o&&s){const h=this.store.properties.getForEntity(u),y=new Map;for(const m of h){const v=new Map;for(const b of m.properties)v.set(b.name,b.value);y.set(m.name,v)}for(const[m,v]of a)for(const b of v){const g=y.get(m)?.get(b)??"";f.push(this.escapeValue(g))}}l.push(this.escapeRow(f,r))}return l.join(`
450
+ `)}exportProperties(t,n={}){const r=n.delimiter??",",o=["entityId","psetName","propName","value","type"],s=[this.escapeRow(o,r)],i=t??this.getAllEntityIds();for(const a of i){const l=this.store.properties.getForEntity(a);for(const c of l)for(const u of c.properties){const f=[String(a),this.escapeValue(c.name),this.escapeValue(u.name),this.escapeValue(u.value),String(u.type)];s.push(this.escapeRow(f,r))}}return s.join(`
451
+ `)}exportQuantities(t,n={}){const r=n.delimiter??",";if(!this.store.quantities)return this.escapeRow(["entityId","qsetName","quantityName","value","type"],r);const o=["entityId","qsetName","quantityName","value","type"],s=[this.escapeRow(o,r)],i=t??this.getAllEntityIds();for(const a of i){const l=this.store.quantities.getForEntity(a);for(const c of l)for(const u of c.quantities){const f=[String(a),this.escapeValue(c.name),this.escapeValue(u.name),String(u.value),String(u.type)];s.push(this.escapeRow(f,r))}}return s.join(`
452
+ `)}getAllEntityIds(){const t=[];for(let n=0;n<this.store.entities.count;n++)t.push(this.store.entities.expressId[n]);return t}escapeValue(t){if(t==null)return"";const n=String(t);return n.includes(",")||n.includes('"')||n.includes(`
453
+ `)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}escapeRow(t,n){return t.map(r=>this.escapeValue(r)).join(n)}}function YP({onShowShortcuts:e}={}){const t=p.useRef(null),{loadFile:n,loading:r,progress:o,geometryResult:s,ifcDataStore:i}=cr(),a=D(P=>P.activeTool),l=D(P=>P.setActiveTool),c=D(P=>P.theme),u=D(P=>P.toggleTheme),f=D(P=>P.selectedEntityId),h=D(P=>P.isolateEntity),y=D(P=>P.hideEntity),m=D(P=>P.showAll),v=D(P=>P.error),b=D(P=>P.cameraCallbacks),g=D(P=>P.hoverTooltipsEnabled),x=D(P=>P.toggleHoverTooltips),w=p.useCallback(P=>{const j=P.target.files?.[0];j&&n(j)},[n]),S=p.useCallback(()=>{f&&h(f)},[f,h]),C=p.useCallback(()=>{f&&y(f)},[f,y]),_=p.useCallback(()=>{if(s)try{const j=new HP(s).exportGLB({includeMetadata:!0}),W=new Blob([new Uint8Array(j)],{type:"model/gltf-binary"}),$=URL.createObjectURL(W),O=document.createElement("a");O.href=$,O.download="model.glb",O.click(),URL.revokeObjectURL($)}catch(P){console.error("Export failed:",P)}},[s]),E=p.useCallback(()=>{const P=document.querySelector("canvas");if(P)try{const j=P.toDataURL("image/png"),W=document.createElement("a");W.href=j,W.download="screenshot.png",W.click()}catch(j){console.error("Screenshot failed:",j)}},[]),I=p.useCallback(P=>{if(i)try{const j=new GP(i);let W,$;switch(P){case"entities":W=j.exportEntities(void 0,{includeProperties:!0,flattenProperties:!0}),$="entities.csv";break;case"properties":W=j.exportProperties(),$="properties.csv";break;case"quantities":W=j.exportQuantities(),$="quantities.csv";break}const O=new Blob([W],{type:"text/csv"}),H=URL.createObjectURL(O),k=document.createElement("a");k.href=H,k.download=$,k.click(),URL.revokeObjectURL(H)}catch(j){console.error("CSV export failed:",j)}},[i]),M=p.useCallback(()=>{if(i)try{const P=[];for(let H=0;H<i.entities.count;H++){const k=i.entities.expressId[H];P.push({expressId:k,globalId:i.entities.getGlobalId(k),name:i.entities.getName(k),type:i.entities.getTypeName(k),properties:i.properties.getForEntity(k)})}const j=JSON.stringify({entities:P},null,2),W=new Blob([j],{type:"application/json"}),$=URL.createObjectURL(W),O=document.createElement("a");O.href=$,O.download="model-data.json",O.click(),URL.revokeObjectURL($)}catch(P){console.error("JSON export failed:",P)}},[i]),R=({tool:P,icon:j,label:W,shortcut:$})=>d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:a===P?"default":"ghost",size:"icon-sm",onClick:()=>l(P),className:Se(a===P&&"bg-primary text-primary-foreground"),children:d.jsx(j,{className:"h-4 w-4"})})}),d.jsxs(xt,{children:[W," ",$&&d.jsxs("span",{className:"ml-2 text-xs opacity-60",children:["(",$,")"]})]})]}),z=({icon:P,label:j,onClick:W,shortcut:$,disabled:O})=>d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:W,disabled:O,children:d.jsx(P,{className:"h-4 w-4"})})}),d.jsxs(xt,{children:[j," ",$&&d.jsxs("span",{className:"ml-2 text-xs opacity-60",children:["(",$,")"]})]})]});return d.jsxs("div",{className:"flex items-center gap-1 px-2 h-12 border-b bg-card",children:[d.jsx("input",{ref:t,type:"file",accept:".ifc",onChange:w,className:"hidden"}),d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>t.current?.click(),disabled:r,children:r?d.jsx(yI,{className:"h-4 w-4 animate-spin"}):d.jsx(aI,{className:"h-4 w-4"})})}),d.jsx(xt,{children:"Open IFC File"})]}),d.jsxs(Ap,{children:[d.jsx(jp,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",disabled:!s,children:d.jsx(vp,{className:"h-4 w-4"})})}),d.jsxs(zu,{children:[d.jsxs(dt,{onClick:_,children:[d.jsx(vp,{className:"h-4 w-4 mr-2"}),"Export GLB (3D Model)"]}),d.jsx(ea,{}),d.jsxs(dt,{onClick:()=>I("entities"),disabled:!i,children:[d.jsx(dc,{className:"h-4 w-4 mr-2"}),"Export Entities (CSV)"]}),d.jsxs(dt,{onClick:()=>I("properties"),disabled:!i,children:[d.jsx(dc,{className:"h-4 w-4 mr-2"}),"Export Properties (CSV)"]}),d.jsxs(dt,{onClick:()=>I("quantities"),disabled:!i,children:[d.jsx(dc,{className:"h-4 w-4 mr-2"}),"Export Quantities (CSV)"]}),d.jsxs(dt,{onClick:M,disabled:!i,children:[d.jsx(J2,{className:"h-4 w-4 mr-2"}),"Export JSON (All Data)"]}),d.jsx(ea,{}),d.jsxs(dt,{onClick:E,children:[d.jsx(A2,{className:"h-4 w-4 mr-2"}),"Screenshot"]})]})]}),d.jsx(Gt,{orientation:"vertical",className:"h-6 mx-1"}),d.jsx(R,{tool:"select",icon:EI,label:"Select",shortcut:"V"}),d.jsx(R,{tool:"boxselect",icon:OI,label:"Box Select",shortcut:"B"}),d.jsx(R,{tool:"pan",icon:dI,label:"Pan",shortcut:"P"}),d.jsx(R,{tool:"orbit",icon:RI,label:"Orbit",shortcut:"O"}),d.jsx(R,{tool:"walk",icon:_I,label:"Walk Mode",shortcut:"C"}),d.jsx(Gt,{orientation:"vertical",className:"h-6 mx-1"}),d.jsx(R,{tool:"measure",icon:Dv,label:"Measure",shortcut:"M"}),d.jsx(R,{tool:"section",icon:NI,label:"Section",shortcut:"X"}),d.jsx(Gt,{orientation:"vertical",className:"h-6 mx-1"}),d.jsx(z,{icon:za,label:"Isolate Selection",onClick:S,shortcut:"I",disabled:!f}),d.jsx(z,{icon:ul,label:"Hide Selection",onClick:C,shortcut:"Del",disabled:!f}),d.jsx(z,{icon:dl,label:"Show All",onClick:m,shortcut:"A"}),d.jsx(Gt,{orientation:"vertical",className:"h-6 mx-1"}),d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:g?"default":"ghost",size:"icon-sm",onClick:x,className:Se(g&&"bg-primary text-primary-foreground"),children:d.jsx(pI,{className:"h-4 w-4"})})}),d.jsxs(xt,{children:[g?"Disable":"Enable"," Hover Tooltips"]})]}),d.jsx(Gt,{orientation:"vertical",className:"h-6 mx-1"}),d.jsx(z,{icon:Lv,label:"Home (Isometric)",onClick:()=>b.home?.(),shortcut:"H"}),d.jsx(z,{icon:Ov,label:"Fit All",onClick:()=>b.fitAll?.(),shortcut:"Z"}),d.jsx(z,{icon:za,label:"Frame Selection",onClick:()=>b.frameSelection?.(),shortcut:"F",disabled:!f}),d.jsxs(Ap,{children:[d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(jp,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",children:d.jsx(cI,{className:"h-4 w-4"})})})}),d.jsx(xt,{children:"Preset Views (0-6)"})]}),d.jsxs(zu,{children:[d.jsxs(dt,{onClick:()=>b.home?.(),children:[d.jsx(Pu,{className:"h-4 w-4 mr-2"})," Isometric ",d.jsx("span",{className:"ml-auto text-xs opacity-60",children:"0"})]}),d.jsx(ea,{}),d.jsxs(dt,{onClick:()=>b.setPresetView?.("top"),children:[d.jsx(_2,{className:"h-4 w-4 mr-2"})," Top ",d.jsx("span",{className:"ml-auto text-xs opacity-60",children:"1"})]}),d.jsxs(dt,{onClick:()=>b.setPresetView?.("bottom"),children:[d.jsx(S2,{className:"h-4 w-4 mr-2"})," Bottom ",d.jsx("span",{className:"ml-auto text-xs opacity-60",children:"2"})]}),d.jsxs(dt,{onClick:()=>b.setPresetView?.("front"),children:[d.jsx(yp,{className:"h-4 w-4 mr-2"})," Front ",d.jsx("span",{className:"ml-auto text-xs opacity-60",children:"3"})]}),d.jsxs(dt,{onClick:()=>b.setPresetView?.("back"),children:[d.jsx(gp,{className:"h-4 w-4 mr-2"})," Back ",d.jsx("span",{className:"ml-auto text-xs opacity-60",children:"4"})]}),d.jsxs(dt,{onClick:()=>b.setPresetView?.("left"),children:[d.jsx(gp,{className:"h-4 w-4 mr-2"})," Left ",d.jsx("span",{className:"ml-auto text-xs opacity-60",children:"5"})]}),d.jsxs(dt,{onClick:()=>b.setPresetView?.("right"),children:[d.jsx(yp,{className:"h-4 w-4 mr-2"})," Right ",d.jsx("span",{className:"ml-auto text-xs opacity-60",children:"6"})]})]})]}),d.jsx("div",{className:"flex-1"}),r&&o&&d.jsxs("div",{className:"flex items-center gap-2 mr-4",children:[d.jsx("span",{className:"text-xs text-muted-foreground",children:o.phase}),d.jsx(ix,{value:o.percent,className:"w-32 h-2"}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[Math.round(o.percent),"%"]})]}),v&&d.jsx("span",{className:"text-xs text-destructive mr-4",children:v}),d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:u,children:c==="dark"?d.jsx(BI,{className:"h-4 w-4"}):d.jsx(SI,{className:"h-4 w-4"})})}),d.jsx(xt,{children:"Toggle Theme"})]}),d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>e?.(),children:d.jsx(U2,{className:"h-4 w-4"})})}),d.jsx(xt,{children:"Keyboard Shortcuts (?)"})]})]})}function Xr(e,t,n){let r=n.initialDeps??[],o,s=!0;function i(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((m,v)=>r[v]!==m)))return o;r=f;let y;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(y=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const m=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-y)*100)/100,b=v/16,g=(x,w)=>{for(x=String(x);x.length<w;)x=" "+x;return x};console.info(`%c⏱ ${g(v,5)} /${g(m,5)} ms`,`
454
+ font-size: .6rem;
455
+ font-weight: bold;
456
+ color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(o),s=!1,o}return i.updateDeps=a=>{r=a},i}function Kp(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const qP=(e,t)=>Math.abs(e-t)<1.01,XP=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},Zp=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},QP=e=>e,KP=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},ZP=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=i=>{const{width:a,height:l}=i;t({width:Math.round(a),height:Math.round(l)})};if(o(Zp(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(i=>{const a=()=>{const l=i[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(Zp(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},Jp={passive:!0},em=typeof window>"u"?!0:"onscrollend"in window,JP=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const s=e.options.useScrollendEvent&&em?()=>{}:XP(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),i=u=>()=>{const{horizontal:f,isRtl:h}=e.options;o=f?n.scrollLeft*(h&&-1||1):n.scrollTop,s(),t(o,u)},a=i(!0),l=i(!1);n.addEventListener("scroll",a,Jp);const c=e.options.useScrollendEvent&&em;return c&&n.addEventListener("scrollend",l,Jp),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},eM=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},tM=(e,{adjustments:t=0,behavior:n},r)=>{var o,s;const i=e+t;(s=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||s.call(o,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class nM{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(s=>{const i=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var s;return(s=r())==null?void 0:s.observe(o,{box:"border-box"})},unobserve:o=>{var s;return(s=r())==null?void 0:s.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:QP,rangeExtractor:KP,onChange:()=>{},measureElement:eM,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Xr(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=s,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,s=new Map;for(let i=r-1;i>=0;i--){const a=n[i];if(o.has(a.lane))continue;const l=s.get(a.lane);if(l==null||a.end>l.end?s.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Xr(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,s,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=Xr(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i,lanes:a},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const h of this.laneAssignments.keys())h>=n&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let h=0;h<c;h++){const y=u[h];y&&(f[y.lane]=h)}for(let h=c;h<n;h++){const y=s(h),m=this.laneAssignments.get(h);let v,b;if(m!==void 0&&this.options.lanes>1){v=m;const S=f[v],C=S!==void 0?u[S]:void 0;b=C?C.end+this.options.gap:r+o}else{const S=this.options.lanes===1?u[h-1]:this.getFurthestMeasurement(u,h);b=S?S.end+this.options.gap:r+o,v=S?S.lane:h%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(h,v)}const g=l.get(y),x=typeof g=="number"?g:this.options.estimateSize(h),w=b+x;u[h]={index:h,start:b,size:x,end:w,key:y,lane:v},f[v]=h}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Xr(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,s)=>this.range=n.length>0&&r>0?rM({measurements:n,outerSize:r,scrollOffset:o,lanes:s}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Xr(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,s,i)=>s===null||i===null?[]:n({startIndex:s,endIndex:i,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),s=this.measurementsCache[o];if(!s)return;const i=s.key,a=this.elementsCache.get(i);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(i,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const s=this.itemSizeCache.get(o.key)??o.size,i=r-s;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,i,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=Xr(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let s=0,i=n.length;s<i;s++){const a=n[s],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Kp(r[xx(0,r.length-1,o=>Kp(r[o]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+s?"end":"start"),r==="center"?n+=(o-s)/2:r==="end"&&(n-=s);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const s=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(o.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let s=0;const i=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,h]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const y=()=>{if(this.currentScrollToIndex!==n)return;const m=this.getScrollOffset(),v=this.getOffsetForIndex(n,h);if(!v){console.warn("Failed to get offset for index:",n);return}qP(v[0],m)||l(h)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(y):y()})},l=c=>{this.targetWindow&&this.currentScrollToIndex===n&&(s++,s<i?this.targetWindow.requestAnimationFrame(()=>a(c)):console.warn(`Failed to scroll to index ${n} after ${i} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&s.some(a=>a===null);){const a=r[i];s[a.lane]===null&&(s[a.lane]=a.end),i--}o=Math.max(...s.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const xx=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,s=n(o);if(s<r)e=o+1;else if(s>r)t=o-1;else return o}return e>0?e-1:0};function rM({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,s=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let i=xx(0,o,s,n),a=i;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;i>=0&&c.some(u=>u>=n);){const u=e[i];c[u.lane]=u.start,i--}i=Math.max(0,i-i%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:i,endIndex:a}}const tm=typeof document<"u"?p.useLayoutEffect:p.useEffect;function oM({useFlushSync:e=!0,...t}){const n=p.useReducer(()=>({}),{})[1],r={...t,onChange:(s,i)=>{var a;e&&i?Ks.flushSync(n):n(),(a=t.onChange)==null||a.call(t,s,i)}},[o]=p.useState(()=>new nM(r));return o.setOptions(r),tm(()=>o._didMount(),[]),tm(()=>o._willUpdate()),o}function sM(e){return oM({observeElementRect:ZP,observeElementOffset:JP,scrollToFn:tM,...e})}const wx=p.forwardRef(({className:e,type:t,leftIcon:n,...r},o)=>n?d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground",children:n}),d.jsx("input",{type:t,className:Se("flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","pl-8 pr-3",e),ref:o,...r})]}):d.jsx("input",{type:t,className:Se("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));wx.displayName="Input";const nm={IfcProject:sI,IfcSite:xI,IfcBuilding:Jd,IfcBuildingStorey:fl,IfcSpace:Pu,IfcWall:xp,IfcWallStandardCase:xp,IfcDoor:q2,default:Pu};function rm(){const{ifcDataStore:e}=cr(),t=D(E=>E.selectedEntityId),n=D(E=>E.setSelectedEntityId),r=D(E=>E.selectedStorey),o=D(E=>E.setSelectedStorey),s=D(E=>E.hiddenEntities),i=D(E=>E.hideEntities),a=D(E=>E.showEntities),l=D(E=>E.toggleEntityVisibility),c=D(E=>E.isEntityVisible),[u,f]=p.useState(""),[h,y]=p.useState(new Set),m=p.useMemo(()=>e?.spatialHierarchy?e.spatialHierarchy.byStorey:new Map,[e]),v=p.useMemo(()=>{if(!e?.spatialHierarchy)return[];const E=e.spatialHierarchy,I=[];I.push({id:E.project.expressId,name:E.project.name||"Project",type:"IfcProject",depth:0,hasChildren:E.byStorey.size>0,isExpanded:!0,isVisible:!0});const R=Array.from(E.byStorey.entries()).map(([z,P])=>({id:z,name:e.entities.getName(z)||`Storey #${z}`,elevation:E.storeyElevations.get(z)??0,elements:P})).sort((z,P)=>P.elevation-z.elevation);for(const z of R){const P=h.has(z.id);if(I.push({id:z.id,name:z.name,type:"IfcBuildingStorey",depth:1,hasChildren:z.elements.length>0,isExpanded:P,isVisible:!0,elementCount:z.elements.length}),P&&z.elements.length>0)for(const j of z.elements){const W=e.entities.getTypeName(j)||"Unknown",$=e.entities.getName(j)||`${W} #${j}`;I.push({id:j,name:$,type:W,depth:2,hasChildren:!1,isExpanded:!1,isVisible:c(j)})}}return I},[e,h,c,s]),b=p.useMemo(()=>{if(!u.trim())return v;const E=u.toLowerCase();return v.filter(I=>I.name.toLowerCase().includes(E)||I.type.toLowerCase().includes(E))},[v,u]),g=p.useRef(null),x=sM({count:b.length,getScrollElement:()=>g.current,estimateSize:()=>36,overscan:10}),w=p.useCallback(E=>{y(I=>{const M=new Set(I);return M.has(E)?M.delete(E):M.add(E),M})},[]),S=p.useCallback(E=>{if(E.type==="IfcBuildingStorey"){const I=m.get(E.id)||[];if(I.length===0)return;I.every(R=>c(R))?i(I):a(I)}else l(E.id)},[m,c,i,a,l]),C=p.useCallback(E=>{const I=m.get(E)||[];return I.length===0?!0:I.every(M=>c(M))},[m,c]),_=p.useCallback(E=>{E.type==="IfcBuildingStorey"?o(r===E.id?null:E.id):n(E.id)},[r,o,n]);return e?d.jsxs("div",{className:"h-full flex flex-col border-r bg-card",children:[d.jsxs("div",{className:"p-3 border-b space-y-2",children:[d.jsx("h2",{className:"font-semibold text-sm",children:"Model Hierarchy"}),d.jsx(wx,{placeholder:"Search elements...",value:u,onChange:E=>f(E.target.value),leftIcon:d.jsx(zI,{className:"h-4 w-4"}),className:"h-8 text-sm"})]}),d.jsx("div",{ref:g,className:"flex-1 overflow-auto scrollbar-thin",children:d.jsx("div",{style:{height:`${x.getTotalSize()}px`,width:"100%",position:"relative"},children:x.getVirtualItems().map(E=>{const I=b[E.index],M=nm[I.type]||nm.default,R=I.type==="IfcBuildingStorey"?r===I.id:t===I.id,z=I.type==="IfcBuildingStorey"?C(I.id):c(I.id),P=!z;return d.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:`${E.size}px`,transform:`translateY(${E.start}px)`},children:d.jsxs("div",{className:Se("flex items-center gap-1 px-2 py-1.5 cursor-pointer hover:bg-muted/50 border-l-2 border-transparent transition-colors group",R&&"bg-primary/10 border-l-primary",P&&"opacity-50"),style:{paddingLeft:`${I.depth*16+8}px`},onClick:j=>{j.target.closest("button")===null&&_(I)},onMouseDown:j=>{j.target.closest("button")===null&&j.preventDefault()},children:[I.hasChildren?d.jsx("button",{onClick:j=>{j.stopPropagation(),w(I.id)},className:"p-0.5 hover:bg-muted rounded",children:d.jsx(Av,{className:Se("h-3.5 w-3.5 transition-transform",I.isExpanded&&"rotate-90")})}):d.jsx("div",{className:"w-4.5"}),d.jsx("button",{onClick:j=>{j.stopPropagation(),S(I)},className:Se("p-0.5 rounded opacity-0 group-hover:opacity-100 transition-opacity",P&&"opacity-100"),children:z?d.jsx(dl,{className:"h-3 w-3 text-muted-foreground"}):d.jsx(ul,{className:"h-3 w-3 text-muted-foreground"})}),d.jsx(M,{className:"h-4 w-4 text-muted-foreground shrink-0"}),d.jsx("span",{className:Se("flex-1 text-sm truncate",P&&"line-through"),children:I.name}),I.elementCount!==void 0&&d.jsx("span",{className:"text-xs text-muted-foreground",children:I.elementCount})]})},I.id)})})}),r&&d.jsx("div",{className:"p-2 border-t bg-primary/5",children:d.jsxs("div",{className:"flex items-center justify-between text-xs",children:[d.jsx("span",{className:"text-muted-foreground",children:"Filtered to storey"}),d.jsx(ke,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>o(null),children:"Clear filter"})]})})]}):d.jsxs("div",{className:"h-full flex flex-col border-r bg-card",children:[d.jsx("div",{className:"p-3 border-b",children:d.jsx("h2",{className:"font-semibold text-sm",children:"Model Hierarchy"})}),d.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Load an IFC file to view hierarchy"})]})}var bl="Tabs",[iM]=An(bl,[ml]),bx=ml(),[aM,ff]=iM(bl),Sx=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=pl(a),[f,h]=ei({prop:r,onChange:o,defaultProp:s??"",caller:bl});return d.jsx(aM,{scope:n,baseId:_o(),value:f,onValueChange:h,orientation:i,dir:u,activationMode:l,children:d.jsx(me.div,{dir:u,"data-orientation":i,...c,ref:t})})});Sx.displayName=bl;var Cx="TabsList",Ex=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=ff(Cx,n),i=bx(n);return d.jsx(Kv,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:d.jsx(me.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Ex.displayName=Cx;var Ix="TabsTrigger",_x=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=ff(Ix,n),a=bx(n),l=Px(i.baseId,r),c=Mx(i.baseId,r),u=r===i.value;return d.jsx(Zv,{asChild:!0,...a,focusable:!o,active:u,children:d.jsx(me.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...s,ref:t,onMouseDown:ee(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:ee(e.onFocus,()=>{const f=i.activationMode!=="manual";!u&&!o&&f&&i.onValueChange(r)})})})});_x.displayName=Ix;var kx="TabsContent",Rx=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=ff(kx,n),l=Px(a.baseId,r),c=Mx(a.baseId,r),u=r===a.value,f=p.useRef(u);return p.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),d.jsx(kt,{present:o||u,children:({present:h})=>d.jsx(me.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});Rx.displayName=kx;function Px(e,t){return`${e}-trigger-${t}`}function Mx(e,t){return`${e}-content-${t}`}var lM=Sx,Nx=Ex,Tx=_x,zx=Rx;const cM=lM,Ax=p.forwardRef(({className:e,...t},n)=>d.jsx(Nx,{ref:n,className:Se("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Ax.displayName=Nx.displayName;const Du=p.forwardRef(({className:e,...t},n)=>d.jsx(Tx,{ref:n,className:Se("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Du.displayName=Tx.displayName;const Fu=p.forwardRef(({className:e,...t},n)=>d.jsx(zx,{ref:n,className:Se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Fu.displayName=zx.displayName;function uM(e,[t,n]){return Math.min(n,Math.max(t,e))}function dM(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var hf="ScrollArea",[jx]=An(hf),[fM,Bt]=jx(hf),Lx=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,l]=p.useState(null),[c,u]=p.useState(null),[f,h]=p.useState(null),[y,m]=p.useState(null),[v,b]=p.useState(null),[g,x]=p.useState(0),[w,S]=p.useState(0),[C,_]=p.useState(!1),[E,I]=p.useState(!1),M=ze(t,z=>l(z)),R=pl(o);return d.jsx(fM,{scope:n,type:r,dir:R,scrollHideDelay:s,scrollArea:a,viewport:c,onViewportChange:u,content:f,onContentChange:h,scrollbarX:y,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:_,scrollbarY:v,onScrollbarYChange:b,scrollbarYEnabled:E,onScrollbarYEnabledChange:I,onCornerWidthChange:x,onCornerHeightChange:S,children:d.jsx(me.div,{dir:R,...i,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Lx.displayName=hf;var Ox="ScrollAreaViewport",Dx=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=Bt(Ox,n),a=p.useRef(null),l=ze(t,a,i.onViewportChange);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(me.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:d.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Dx.displayName=Ox;var mn="ScrollAreaScrollbar",pf=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Bt(mn,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return p.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?d.jsx(hM,{...r,ref:t,forceMount:n}):o.type==="scroll"?d.jsx(pM,{...r,ref:t,forceMount:n}):o.type==="auto"?d.jsx(Fx,{...r,ref:t,forceMount:n}):o.type==="always"?d.jsx(mf,{...r,ref:t}):null});pf.displayName=mn;var hM=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Bt(mn,e.__scopeScrollArea),[s,i]=p.useState(!1);return p.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},u=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),d.jsx(kt,{present:n||s,children:d.jsx(Fx,{"data-state":s?"visible":"hidden",...r,ref:t})})}),pM=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Bt(mn,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Cl(()=>l("SCROLL_END"),100),[a,l]=dM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return p.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),p.useEffect(()=>{const c=o.viewport,u=s?"scrollLeft":"scrollTop";if(c){let f=c[u];const h=()=>{const y=c[u];f!==y&&(l("SCROLL"),i()),f=y};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[o.viewport,s,l,i]),d.jsx(kt,{present:n||a!=="hidden",children:d.jsx(mf,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ee(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ee(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Fx=p.forwardRef((e,t)=>{const n=Bt(mn,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=p.useState(!1),a=e.orientation==="horizontal",l=Cl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?c:u)}},10);return Mo(n.viewport,l),Mo(n.content,l),d.jsx(kt,{present:r||s,children:d.jsx(mf,{"data-state":s?"visible":"hidden",...o,ref:t})})}),mf=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Bt(mn,e.__scopeScrollArea),s=p.useRef(null),i=p.useRef(0),[a,l]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Wx(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>s.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function f(h,y){return wM(h,i.current,a,y)}return n==="horizontal"?d.jsx(mM,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const h=o.viewport.scrollLeft,y=om(h,a,o.dir);s.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=f(h,o.dir))}}):n==="vertical"?d.jsx(gM,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const h=o.viewport.scrollTop,y=om(h,a);s.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=f(h))}}):null}),mM=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=Bt(mn,e.__scopeScrollArea),[i,a]=p.useState(),l=p.useRef(null),c=ze(t,l,s.onScrollbarXChange);return p.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),d.jsx($x,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sl(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(s.viewport){const h=s.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),Gx(h,f)&&u.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ba(i.paddingLeft),paddingEnd:Ba(i.paddingRight)}})}})}),gM=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=Bt(mn,e.__scopeScrollArea),[i,a]=p.useState(),l=p.useRef(null),c=ze(t,l,s.onScrollbarYChange);return p.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),d.jsx($x,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sl(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(s.viewport){const h=s.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),Gx(h,f)&&u.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ba(i.paddingTop),paddingEnd:Ba(i.paddingBottom)}})}})}),[yM,Bx]=jx(mn),$x=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:f,...h}=e,y=Bt(mn,n),[m,v]=p.useState(null),b=ze(t,M=>v(M)),g=p.useRef(null),x=p.useRef(""),w=y.viewport,S=r.content-r.viewport,C=Ze(u),_=Ze(l),E=Cl(f,10);function I(M){if(g.current){const R=M.clientX-g.current.left,z=M.clientY-g.current.top;c({x:R,y:z})}}return p.useEffect(()=>{const M=R=>{const z=R.target;m?.contains(z)&&C(R,S)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[w,m,S,C]),p.useEffect(_,[r,_]),Mo(m,E),Mo(y.content,E),d.jsx(yM,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:Ze(s),onThumbPointerUp:Ze(i),onThumbPositionChange:_,onThumbPointerDown:Ze(a),children:d.jsx(me.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:ee(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),g.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),I(M))}),onPointerMove:ee(e.onPointerMove,I),onPointerUp:ee(e.onPointerUp,M=>{const R=M.target;R.hasPointerCapture(M.pointerId)&&R.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=x.current,y.viewport&&(y.viewport.style.scrollBehavior=""),g.current=null})})})}),Fa="ScrollAreaThumb",Vx=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Bx(Fa,e.__scopeScrollArea);return d.jsx(kt,{present:n||o.hasThumb,children:d.jsx(vM,{ref:t,...r})})}),vM=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=Bt(Fa,n),i=Bx(Fa,n),{onThumbPositionChange:a}=i,l=ze(t,f=>i.onThumbChange(f)),c=p.useRef(void 0),u=Cl(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const f=s.viewport;if(f){const h=()=>{if(u(),!c.current){const y=bM(f,a);c.current=y,a()}};return a(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[s.viewport,u,a]),d.jsx(me.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ee(e.onPointerDownCapture,f=>{const y=f.target.getBoundingClientRect(),m=f.clientX-y.left,v=f.clientY-y.top;i.onThumbPointerDown({x:m,y:v})}),onPointerUp:ee(e.onPointerUp,i.onThumbPointerUp)})});Vx.displayName=Fa;var gf="ScrollAreaCorner",Ux=p.forwardRef((e,t)=>{const n=Bt(gf,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.jsx(xM,{...e,ref:t}):null});Ux.displayName=gf;var xM=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Bt(gf,n),[s,i]=p.useState(0),[a,l]=p.useState(0),c=!!(s&&a);return Mo(o.scrollbarX,()=>{const u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),Mo(o.scrollbarY,()=>{const u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),i(u)}),c?d.jsx(me.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ba(e){return e?parseInt(e,10):0}function Wx(e,t){const n=e/t;return isNaN(n)?0:n}function Sl(e){const t=Wx(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function wM(e,t,n,r="ltr"){const o=Sl(n),s=o/2,i=t||s,a=o-i,l=n.scrollbar.paddingStart+i,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return Hx([l,c],f)(e)}function om(e,t,n="ltr"){const r=Sl(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-r,l=n==="ltr"?[0,i]:[i*-1,0],c=uM(e,l);return Hx([0,i],[0,a])(c)}function Hx(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Gx(e,t){return e>0&&e<t}var bM=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Cl(e,t){const n=Ze(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Mo(e,t){const n=Ze(t);fn(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var Yx=Lx,SM=Dx,CM=Ux;const qx=p.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(Yx,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[d.jsx(SM,{className:"h-full w-full rounded-[inherit]",children:t}),d.jsx(Xx,{}),d.jsx(CM,{})]}));qx.displayName=Yx.displayName;const Xx=p.forwardRef(({className:e,orientation:t="vertical",...n},r)=>d.jsx(pf,{ref:r,orientation:t,className:Se("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:d.jsx(Vx,{className:"relative flex-1 rounded-full bg-border"})}));Xx.displayName=pf.displayName;var El="Collapsible",[EM]=An(El),[IM,yf]=EM(El),Qx=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[l,c]=ei({prop:r,defaultProp:o??!1,onChange:i,caller:El});return d.jsx(IM,{scope:n,disabled:s,contentId:_o(),open:l,onOpenToggle:p.useCallback(()=>c(u=>!u),[c]),children:d.jsx(me.div,{"data-state":xf(l),"data-disabled":s?"":void 0,...a,ref:t})})});Qx.displayName=El;var Kx="CollapsibleTrigger",Zx=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=yf(Kx,n);return d.jsx(me.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":xf(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:ee(e.onClick,o.onOpenToggle)})});Zx.displayName=Kx;var vf="CollapsibleContent",Jx=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yf(vf,e.__scopeCollapsible);return d.jsx(kt,{present:n||o.open,children:({present:s})=>d.jsx(_M,{...r,ref:t,present:s})})});Jx.displayName=vf;var _M=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=yf(vf,n),[a,l]=p.useState(r),c=p.useRef(null),u=ze(t,c),f=p.useRef(0),h=f.current,y=p.useRef(0),m=y.current,v=i.open||a,b=p.useRef(v),g=p.useRef(void 0);return p.useEffect(()=>{const x=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(x)},[]),fn(()=>{const x=c.current;if(x){g.current=g.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();f.current=w.height,y.current=w.width,b.current||(x.style.transitionDuration=g.current.transitionDuration,x.style.animationName=g.current.animationName),l(r)}},[i.open,r]),d.jsx(me.div,{"data-state":xf(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...s,ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:v&&o})});function xf(e){return e?"open":"closed"}var kM=Qx;const ew=kM,tw=Zx,nw=Jx;function sm(){const e=D(m=>m.selectedEntityId),t=D(m=>m.cameraCallbacks),n=D(m=>m.toggleEntityVisibility),r=D(m=>m.isEntityVisible),{query:o,ifcDataStore:s}=cr(),i=p.useMemo(()=>{if(!e||!s?.spatialHierarchy)return null;const m=s.spatialHierarchy;let v=null;for(const[b,g]of m.byStorey)if(g.includes(e)){v=b;break}return v?{storeyId:v,storeyName:s.entities.getName(v)||`Storey #${v}`,elevation:m.storeyElevations.get(v)}:null},[e,s]),a=p.useMemo(()=>!e||!s?.quantities?[]:s.quantities.getForEntity(e),[e,s]);if(!e||!o)return d.jsxs("div",{className:"h-full flex flex-col border-l bg-card",children:[d.jsx("div",{className:"p-3 border-b",children:d.jsx("h2",{className:"font-semibold text-sm",children:"Properties"})}),d.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm p-4 text-center",children:"Select an object to view properties"})]});const l=o.entity(e),c=l.properties(),u=l.type,f=l.name,h=l.globalId,y=m=>{navigator.clipboard.writeText(m)};return d.jsxs("div",{className:"h-full flex flex-col border-l bg-card",children:[d.jsxs("div",{className:"p-3 border-b space-y-2",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"p-2 rounded-lg bg-primary/10 shrink-0",children:d.jsx(Jd,{className:"h-5 w-5 text-primary"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h3",{className:"font-semibold text-sm truncate",children:f||`${u}`}),d.jsx("p",{className:"text-xs text-muted-foreground",children:u})]}),d.jsxs("div",{className:"flex gap-1 shrink-0",children:[d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-xs",onClick:()=>{e&&t.frameSelection&&t.frameSelection()},children:d.jsx(za,{className:"h-3.5 w-3.5"})})}),d.jsx(xt,{children:"Zoom to"})]}),d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-xs",onClick:()=>{e&&n(e)},children:e&&r(e)?d.jsx(ul,{className:"h-3.5 w-3.5"}):d.jsx(dl,{className:"h-3.5 w-3.5"})})}),d.jsx(xt,{children:e&&r(e)?"Hide":"Show"})]})]})]}),h&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"flex-1 text-xs bg-muted px-2 py-1 rounded truncate font-mono",children:h}),d.jsx(ke,{variant:"ghost",size:"icon-xs",onClick:()=>y(h),children:d.jsx(jv,{className:"h-3 w-3"})})]}),i&&d.jsxs("div",{className:"flex items-center gap-2 text-xs bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 px-2 py-1.5 rounded",children:[d.jsx(fl,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"font-medium",children:i.storeyName}),i.elevation!==void 0&&d.jsxs("span",{className:"text-emerald-600/70 dark:text-emerald-400/70",children:["(",i.elevation.toFixed(2),"m)"]})]})]}),d.jsxs(cM,{defaultValue:"properties",className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs(Ax,{className:"w-full justify-start rounded-none border-b bg-transparent h-9 p-0",children:[d.jsxs(Du,{value:"properties",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",children:[d.jsx(nI,{className:"h-3.5 w-3.5 mr-1.5"}),"Properties"]}),d.jsxs(Du,{value:"quantities",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",children:[d.jsx(T2,{className:"h-3.5 w-3.5 mr-1.5"}),"Quantities"]})]}),d.jsxs(qx,{className:"flex-1",children:[d.jsx(Fu,{value:"properties",className:"m-0 p-3",children:c.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No property sets"}):d.jsx("div",{className:"space-y-2",children:c.map(m=>d.jsx(RM,{pset:m},m.name))})}),d.jsx(Fu,{value:"quantities",className:"m-0 p-3",children:a.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No quantities"}):d.jsx("div",{className:"space-y-2",children:a.map(m=>d.jsx(PM,{qset:m},m.name))})})]})]})]})}function RM({pset:e}){return d.jsxs(ew,{defaultOpen:!0,className:"border rounded-lg",children:[d.jsxs(tw,{className:"flex items-center justify-between w-full p-2.5 hover:bg-muted/50 rounded-t-lg text-left",children:[d.jsx("span",{className:"font-medium text-sm",children:e.name}),d.jsx("span",{className:"text-xs text-muted-foreground",children:e.properties.length})]}),d.jsxs(nw,{children:[d.jsx(Gt,{}),d.jsx("div",{className:"divide-y",children:e.properties.map(t=>d.jsxs("div",{className:"flex justify-between gap-2 px-2.5 py-1.5 text-sm",children:[d.jsx("span",{className:"text-muted-foreground truncate",children:t.name}),d.jsx("span",{className:"text-right truncate font-medium",children:t.value!==null&&t.value!==void 0?String(t.value):"—"})]},t.name))})]})]})}function PM({qset:e}){const t=(n,r)=>{const o=n.toLocaleString(void 0,{maximumFractionDigits:3});switch(r){case 0:return`${o} m`;case 1:return`${o} m²`;case 2:return`${o} m³`;case 3:return o;case 4:return`${o} kg`;case 5:return`${o} s`;default:return o}};return d.jsxs(ew,{defaultOpen:!0,className:"border rounded-lg border-blue-200 dark:border-blue-900",children:[d.jsxs(tw,{className:"flex items-center justify-between w-full p-2.5 hover:bg-blue-50 dark:hover:bg-blue-950/50 rounded-t-lg text-left",children:[d.jsx("span",{className:"font-medium text-sm text-blue-700 dark:text-blue-400",children:e.name}),d.jsx("span",{className:"text-xs text-blue-500/70",children:e.quantities.length})]}),d.jsxs(nw,{children:[d.jsx(Gt,{className:"bg-blue-200 dark:bg-blue-900"}),d.jsx("div",{className:"divide-y divide-blue-100 dark:divide-blue-900/50",children:e.quantities.map(n=>d.jsxs("div",{className:"flex justify-between gap-2 px-2.5 py-1.5 text-sm",children:[d.jsx("span",{className:"text-muted-foreground truncate",children:n.name}),d.jsx("span",{className:"text-right font-mono text-blue-700 dark:text-blue-400",children:t(n.value,n.type)})]},n.name))})]})]})}function MM(){const{loading:e,geometryResult:t,ifcDataStore:n}=cr(),r=D(m=>m.progress),o=D(m=>m.error),s=D(m=>m.selectedStorey),[i,a]=p.useState(60),[l,c]=p.useState(0),[u,f]=p.useState(null);p.useEffect(()=>{f("gpu"in navigator)},[]),p.useEffect(()=>{let m=0,v=performance.now(),b;const g=()=>{m++;const x=performance.now();x-v>=1e3&&(a(m),m=0,v=x),b=requestAnimationFrame(g)};return b=requestAnimationFrame(g),()=>cancelAnimationFrame(b)},[]),p.useEffect(()=>{const m=()=>{performance.memory&&c(performance.memory.usedJSHeapSize)};m();const v=setInterval(m,2e3);return()=>clearInterval(v)},[]);const h=p.useMemo(()=>t?{elements:t.meshes?.length??0,triangles:t.totalTriangles??0}:{elements:0,triangles:0},[t]),y=p.useMemo(()=>!s||!n?.spatialHierarchy?h.elements:n.spatialHierarchy.byStorey.get(s)?.length??h.elements,[s,n,h.elements]);return d.jsxs("div",{className:"h-7 px-3 border-t bg-muted/30 flex items-center justify-between text-xs text-muted-foreground",children:[d.jsx("div",{className:"flex items-center gap-3",children:e?d.jsx("span",{className:"text-primary",children:r?.phase||"Loading..."}):o?d.jsx("span",{className:"text-destructive",children:o}):d.jsx("span",{children:"Ready"})}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(P2,{className:"h-3.5 w-3.5"}),d.jsxs("span",{children:[uc(y),s&&h.elements!==y&&d.jsxs("span",{className:"opacity-60",children:[" / ",uc(h.elements)]})," ","elements"]})]}),d.jsx(Gt,{orientation:"vertical",className:"h-3.5"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(WI,{className:"h-3.5 w-3.5"}),d.jsxs("span",{children:[uc(h.triangles)," tris"]})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("span",{className:i<30?"text-destructive":i<50?"text-yellow-500":"",children:[i," FPS"]}),l>0&&d.jsxs(d.Fragment,{children:[d.jsx(Gt,{orientation:"vertical",className:"h-3.5"}),d.jsx("span",{children:p2(l)})]}),d.jsx(Gt,{orientation:"vertical",className:"h-3.5"}),d.jsxs("div",{className:"flex items-center gap-1",children:[u?d.jsx($2,{className:"h-3.5 w-3.5 text-green-500"}):d.jsx(F2,{className:"h-3.5 w-3.5 text-yellow-500"}),d.jsx("span",{children:u?"WebGPU":"WebGL"})]})]})]})}class NM{adapter=null;device=null;context=null;format="bgra8unorm";canvas=null;lastWidth=0;lastHeight=0;contextConfigured=!1;frameCount=0;async init(t){if(!navigator.gpu)throw new Error("WebGPU not available");if(this.adapter=await navigator.gpu.requestAdapter(),!this.adapter)throw new Error("Failed to get GPU adapter");if(this.device=await this.adapter.requestDevice(),this.format=navigator.gpu.getPreferredCanvasFormat(),this.canvas=t,this.context=t.getContext("webgpu"),!this.context)throw new Error("Failed to get WebGPU context");const n=this.device;n.lost&&n.lost.then(r=>{console.warn("[WebGPU] Device lost:",r.message),this.contextConfigured=!1}),this.configureContext()}configureContext(){if(!(!this.context||!this.device||!this.canvas)){this.lastWidth=this.canvas.width,this.lastHeight=this.canvas.height;try{this.context.configure({device:this.device,format:this.format,usage:GPUTextureUsage.RENDER_ATTACHMENT,alphaMode:"premultiplied"}),this.contextConfigured=!0}catch(t){console.warn("[WebGPU] Failed to configure context:",t),this.contextConfigured=!1}}}needsReconfigure(){return this.canvas?this.contextConfigured?this.canvas.width!==this.lastWidth||this.canvas.height!==this.lastHeight:!0:!1}invalidateContext(){this.contextConfigured=!1}ensureContext(){return!this.context||!this.device||!this.canvas?!1:(this.needsReconfigure()&&this.configureContext(),this.contextConfigured)}getCurrentTexture(){if(!this.context||!this.contextConfigured)return null;try{const t=this.context.getCurrentTexture();return this.frameCount++,t}catch{return this.contextConfigured=!1,null}}getDevice(){if(!this.device)throw new Error("Device not initialized");return this.device}getContext(){if(!this.context)throw new Error("Context not initialized");return this.context}getFormat(){return this.format}isInitialized(){return this.device!==null&&this.context!==null}}class TM{device;pipeline;depthTexture;depthTextureView;uniformBuffer;bindGroup;currentWidth;currentHeight;constructor(t,n=1,r=1){this.currentWidth=n,this.currentHeight=r,this.device=t.getDevice();const o=t.getFormat();this.depthTexture=this.device.createTexture({size:{width:n,height:r},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}),this.depthTextureView=this.depthTexture.createView(),this.uniformBuffer=this.device.createBuffer({size:192,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});const s=this.device.createShaderModule({code:`
457
+ struct Uniforms {
458
+ viewProj: mat4x4<f32>,
459
+ model: mat4x4<f32>,
460
+ baseColor: vec4<f32>,
461
+ metallicRoughness: vec2<f32>, // x = metallic, y = roughness
462
+ _padding1: vec2<f32>,
463
+ sectionPlane: vec4<f32>, // xyz = plane normal, w = plane distance
464
+ flags: vec4<u32>, // x = isSelected, y = sectionEnabled, z,w = reserved
465
+ }
466
+ @binding(0) @group(0) var<uniform> uniforms: Uniforms;
467
+
468
+ struct VertexInput {
469
+ @location(0) position: vec3<f32>,
470
+ @location(1) normal: vec3<f32>,
471
+ }
472
+
473
+ struct VertexOutput {
474
+ @builtin(position) position: vec4<f32>,
475
+ @location(0) worldPos: vec3<f32>,
476
+ @location(1) normal: vec3<f32>,
477
+ @location(2) @interpolate(flat) objectId: u32,
478
+ }
479
+
480
+ @vertex
481
+ fn vs_main(input: VertexInput, @builtin(instance_index) instanceIndex: u32) -> VertexOutput {
482
+ var output: VertexOutput;
483
+ let worldPos = uniforms.model * vec4<f32>(input.position, 1.0);
484
+ output.position = uniforms.viewProj * worldPos;
485
+ output.worldPos = worldPos.xyz;
486
+ output.normal = normalize((uniforms.model * vec4<f32>(input.normal, 0.0)).xyz);
487
+ output.objectId = instanceIndex;
488
+ return output;
489
+ }
490
+
491
+ // PBR helper functions
492
+ fn fresnelSchlick(cosTheta: f32, F0: vec3<f32>) -> vec3<f32> {
493
+ return F0 + (1.0 - F0) * pow(clamp(1.0 - cosTheta, 0.0, 1.0), 5.0);
494
+ }
495
+
496
+ fn distributionGGX(NdotH: f32, roughness: f32) -> f32 {
497
+ let a = roughness * roughness;
498
+ let a2 = a * a;
499
+ let NdotH2 = NdotH * NdotH;
500
+ let num = a2;
501
+ let denomBase = (NdotH2 * (a2 - 1.0) + 1.0);
502
+ let denom = 3.14159265 * denomBase * denomBase;
503
+ return num / max(denom, 0.0000001);
504
+ }
505
+
506
+ fn geometrySchlickGGX(NdotV: f32, roughness: f32) -> f32 {
507
+ let r = (roughness + 1.0);
508
+ let k = (r * r) / 8.0;
509
+ let num = NdotV;
510
+ let denom = NdotV * (1.0 - k) + k;
511
+ return num / max(denom, 0.0000001);
512
+ }
513
+
514
+ fn geometrySmith(NdotV: f32, NdotL: f32, roughness: f32) -> f32 {
515
+ let ggx2 = geometrySchlickGGX(NdotV, roughness);
516
+ let ggx1 = geometrySchlickGGX(NdotL, roughness);
517
+ return ggx1 * ggx2;
518
+ }
519
+
520
+ @fragment
521
+ fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
522
+ // Section plane clipping
523
+ if (uniforms.flags.y == 1u) {
524
+ let planeNormal = uniforms.sectionPlane.xyz;
525
+ let planeDistance = uniforms.sectionPlane.w;
526
+ let distToPlane = dot(input.worldPos, planeNormal) - planeDistance;
527
+ if (distToPlane > 0.0) {
528
+ discard;
529
+ }
530
+ }
531
+
532
+ let N = normalize(input.normal);
533
+ let L = normalize(vec3<f32>(0.5, 1.0, 0.3)); // Light direction
534
+
535
+ let NdotL = max(dot(N, L), 0.0);
536
+
537
+ var baseColor = uniforms.baseColor.rgb;
538
+
539
+ // Simple diffuse lighting with ambient
540
+ let ambient = 0.3;
541
+ let diffuse = NdotL * 0.7;
542
+
543
+ var color = baseColor * (ambient + diffuse);
544
+
545
+ // Selection highlight - add glow/fresnel effect
546
+ if (uniforms.flags.x == 1u) {
547
+ // Calculate view direction for fresnel effect
548
+ let V = normalize(-input.worldPos); // Assuming camera at origin (simplified)
549
+ let NdotV = max(dot(N, V), 0.0);
550
+
551
+ // Fresnel-like edge highlight for selection
552
+ let fresnel = pow(1.0 - NdotV, 2.0);
553
+ let highlightColor = vec3<f32>(0.3, 0.6, 1.0); // Blue highlight
554
+ color = mix(color, highlightColor, fresnel * 0.5 + 0.2);
555
+ }
556
+
557
+ // Gamma correction (IFC colors are typically in sRGB)
558
+ color = pow(color, vec3<f32>(1.0 / 2.2));
559
+
560
+ return vec4<f32>(color, uniforms.baseColor.a);
561
+ }
562
+ `});this.pipeline=this.device.createRenderPipeline({layout:"auto",vertex:{module:s,entryPoint:"vs_main",buffers:[{arrayStride:24,attributes:[{shaderLocation:0,offset:0,format:"float32x3"},{shaderLocation:1,offset:12,format:"float32x3"}]}]},fragment:{module:s,entryPoint:"fs_main",targets:[{format:o}]},primitive:{topology:"triangle-list",cullMode:"none"},depthStencil:{format:"depth24plus",depthWriteEnabled:!0,depthCompare:"less"}}),this.bindGroup=this.device.createBindGroup({layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}}]})}updateUniforms(t,n,r,o,s,i){const a=new Float32Array(48),l=new Uint32Array(a.buffer,176,4);a.set(t,0),a.set(n,16),r?a.set(r,32):a.set([1,1,1,1],32);const c=o?.metallic??0,u=o?.roughness??.6;a[36]=c,a[37]=u,s&&(a[40]=s.normal[0],a[41]=s.normal[1],a[42]=s.normal[2],a[43]=s.distance),l[0]=i?1:0,l[1]=s?.enabled?1:0,l[2]=0,l[3]=0,this.device.queue.writeBuffer(this.uniformBuffer,0,a)}needsResize(t,n){return this.currentWidth!==t||this.currentHeight!==n}resize(t,n){t<=0||n<=0||(this.currentWidth=t,this.currentHeight=n,this.depthTexture.destroy(),this.depthTexture=this.device.createTexture({size:{width:t,height:n},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}),this.depthTextureView=this.depthTexture.createView())}getPipeline(){return this.pipeline}getDepthTextureView(){return this.depthTextureView}getBindGroup(){return this.bindGroup}getBindGroupLayout(){return this.pipeline.getBindGroupLayout(0)}getUniformBufferSize(){return 192}}class wr{static identity(){const t=new Float32Array(16);return t[0]=1,t[5]=1,t[10]=1,t[15]=1,{m:t}}static perspective(t,n,r,o){const s=1/Math.tan(t/2),i=1/(r-o),a=new Float32Array(16);return a[0]=s/n,a[5]=s,a[10]=(o+r)*i,a[11]=-1,a[14]=2*o*r*i,{m:a}}static lookAt(t,n,r){const o=t.x-n.x,s=t.y-n.y,i=t.z-n.z,a=1/Math.sqrt(o*o+s*s+i*i),l=o*a,c=s*a,u=i*a,f=r.y*u-r.z*c,h=r.z*l-r.x*u,y=r.x*c-r.y*l,m=1/Math.sqrt(f*f+h*h+y*y),v=f*m,b=h*m,g=y*m,x=c*g-u*b,w=u*v-l*g,S=l*b-c*v,C=new Float32Array(16);return C[0]=v,C[1]=x,C[2]=l,C[3]=0,C[4]=b,C[5]=w,C[6]=c,C[7]=0,C[8]=g,C[9]=S,C[10]=u,C[11]=0,C[12]=-(v*t.x+b*t.y+g*t.z),C[13]=-(x*t.x+w*t.y+S*t.z),C[14]=-(l*t.x+c*t.y+u*t.z),C[15]=1,{m:C}}static multiply(t,n){const r=new Float32Array(16),o=t.m[0],s=t.m[1],i=t.m[2],a=t.m[3],l=t.m[4],c=t.m[5],u=t.m[6],f=t.m[7],h=t.m[8],y=t.m[9],m=t.m[10],v=t.m[11],b=t.m[12],g=t.m[13],x=t.m[14],w=t.m[15],S=n.m[0],C=n.m[1],_=n.m[2],E=n.m[3],I=n.m[4],M=n.m[5],R=n.m[6],z=n.m[7],P=n.m[8],j=n.m[9],W=n.m[10],$=n.m[11],O=n.m[12],H=n.m[13],k=n.m[14],N=n.m[15];return r[0]=S*o+C*l+_*h+E*b,r[1]=S*s+C*c+_*y+E*g,r[2]=S*i+C*u+_*m+E*x,r[3]=S*a+C*f+_*v+E*w,r[4]=I*o+M*l+R*h+z*b,r[5]=I*s+M*c+R*y+z*g,r[6]=I*i+M*u+R*m+z*x,r[7]=I*a+M*f+R*v+z*w,r[8]=P*o+j*l+W*h+$*b,r[9]=P*s+j*c+W*y+$*g,r[10]=P*i+j*u+W*m+$*x,r[11]=P*a+j*f+W*v+$*w,r[12]=O*o+H*l+k*h+N*b,r[13]=O*s+H*c+k*y+N*g,r[14]=O*i+H*u+k*m+N*x,r[15]=O*a+H*f+k*v+N*w,{m:r}}}class zM{camera;viewMatrix;projMatrix;viewProjMatrix;velocity={orbit:{x:0,y:0},pan:{x:0,y:0},zoom:0};damping=.92;minVelocity=.001;animationStartTime=0;animationDuration=0;animationStartPos=null;animationStartTarget=null;animationEndPos=null;animationEndTarget=null;animationStartUp=null;animationEndUp=null;animationEasing=null;isFirstPersonMode=!1;firstPersonSpeed=.1;orbitPivot=null;lastPresetView=null;presetViewRotation=0;constructor(){this.camera={position:{x:50,y:50,z:100},target:{x:0,y:0,z:0},up:{x:0,y:1,z:0},fov:Math.PI/4,aspect:1,near:.1,far:1e4},this.viewMatrix=wr.identity(),this.projMatrix=wr.identity(),this.viewProjMatrix=wr.identity(),this.updateMatrices()}setAspect(t){this.camera.aspect=t,this.updateMatrices()}setPosition(t,n,r){this.camera.position={x:t,y:n,z:r},this.updateMatrices()}setTarget(t,n,r){this.camera.target={x:t,y:n,z:r},this.updateMatrices()}setOrbitPivot(t){this.orbitPivot=t?{...t}:null}getOrbitPivot(){return this.orbitPivot?{...this.orbitPivot}:{...this.camera.target}}hasOrbitPivot(){return this.orbitPivot!==null}orbit(t,n,r=!1){this.camera.up={x:0,y:1,z:0},this.lastPresetView=null,this.presetViewRotation=0;const o=-t*.01,s=-n*.01,i=this.orbitPivot||this.camera.target,a={x:this.camera.position.x-i.x,y:this.camera.position.y-i.y,z:this.camera.position.z-i.z},l=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z);if(l<1e-6)return;let c=Math.acos(Math.max(-1,Math.min(1,a.y/l))),u;Math.sin(c)>.05?u=Math.atan2(a.x,a.z):(u=0,c<Math.PI/2?c=.15:c=Math.PI-.15),u+=o;const h=c+s,y=Math.max(.15,Math.min(Math.PI-.15,h)),m=i.x+l*Math.sin(y)*Math.sin(u),v=i.y+l*Math.cos(y),b=i.z+l*Math.sin(y)*Math.cos(u);this.camera.position.x=m,this.camera.position.y=v,this.camera.position.z=b,r&&(this.velocity.orbit.x+=t*.001,this.velocity.orbit.y+=n*.001),this.updateMatrices()}pan(t,n,r=!1){const o={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},s=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z),i={x:-o.z,y:0,z:o.x},a=Math.sqrt(i.x*i.x+i.z*i.z);a>1e-10&&(i.x/=a,i.z/=a);const l={x:i.z*o.y-i.y*o.z,y:i.x*o.z-i.z*o.x,z:i.y*o.x-i.x*o.y},c=Math.sqrt(l.x*l.x+l.y*l.y+l.z*l.z);c>1e-10&&(l.x/=c,l.y/=c,l.z/=c);const u=s*.001;this.camera.target.x+=(i.x*t+l.x*n)*u,this.camera.target.y+=(i.y*t+l.y*n)*u,this.camera.target.z+=(i.z*t+l.z*n)*u,this.camera.position.x+=(i.x*t+l.x*n)*u,this.camera.position.y+=(i.y*t+l.y*n)*u,this.camera.position.z+=(i.z*t+l.z*n)*u,r&&(this.velocity.pan.x+=t*u*.1,this.velocity.pan.y+=n*u*.1),this.updateMatrices()}zoom(t,n=!1,r,o,s,i){const a={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},l=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z),c=Math.sign(t)*Math.min(Math.abs(t)*.001,.1),u=1+c;if(r!==void 0&&o!==void 0&&s&&i){const y=r/s*2-1,m=1-o/i*2,v={x:-a.x/l,y:-a.y/l,z:-a.z/l},b=this.camera.up,g={x:v.y*b.z-v.z*b.y,y:v.z*b.x-v.x*b.z,z:v.x*b.y-v.y*b.x},x=Math.sqrt(g.x*g.x+g.y*g.y+g.z*g.z);x>1e-10&&(g.x/=x,g.y/=x,g.z/=x);const w={x:g.y*v.z-g.z*v.y,y:g.z*v.x-g.x*v.z,z:g.x*v.y-g.y*v.x},S=l*Math.tan(this.camera.fov/2),C=S*this.camera.aspect,_=y*C,E=m*S,I={x:this.camera.target.x+g.x*_+w.x*E,y:this.camera.target.y+g.y*_+w.y*E,z:this.camera.target.z+g.z*_+w.z*E},M=1-u;this.camera.target.x+=(I.x-this.camera.target.x)*M,this.camera.target.y+=(I.y-this.camera.target.y)*M,this.camera.target.z+=(I.z-this.camera.target.z)*M}const h=Math.max(.1,l*u)/l;this.camera.position.x=this.camera.target.x+a.x*h,this.camera.position.y=this.camera.target.y+a.y*h,this.camera.position.z=this.camera.target.z+a.z*h,n&&(this.velocity.zoom+=c*.1),this.updateMatrices()}fitToBounds(t,n){const r={x:(t.x+n.x)/2,y:(t.y+n.y)/2,z:(t.z+n.z)/2},o={x:n.x-t.x,y:n.y-t.y,z:n.z-t.z},i=Math.max(o.x,o.y,o.z)*2;this.camera.target=r,this.camera.position={x:r.x+i*.6,y:r.y+i*.5,z:r.z+i*.6},this.camera.far=Math.max(1e4,i*20),this.camera.near=Math.max(.01,i*1e-4),this.updateMatrices()}update(t){let n=!1;if(this.animationStartTime>0&&this.animationDuration>0){const r=Date.now()-this.animationStartTime,o=Math.min(r/this.animationDuration,1);if(o<1&&this.animationStartPos&&this.animationEndPos&&this.animationStartTarget&&this.animationEndTarget&&this.animationEasing){const s=this.animationEasing(o);if(this.camera.position.x=this.animationStartPos.x+(this.animationEndPos.x-this.animationStartPos.x)*s,this.camera.position.y=this.animationStartPos.y+(this.animationEndPos.y-this.animationStartPos.y)*s,this.camera.position.z=this.animationStartPos.z+(this.animationEndPos.z-this.animationStartPos.z)*s,this.camera.target.x=this.animationStartTarget.x+(this.animationEndTarget.x-this.animationStartTarget.x)*s,this.camera.target.y=this.animationStartTarget.y+(this.animationEndTarget.y-this.animationStartTarget.y)*s,this.camera.target.z=this.animationStartTarget.z+(this.animationEndTarget.z-this.animationStartTarget.z)*s,this.animationStartUp&&this.animationEndUp){let i=this.animationStartUp.x+(this.animationEndUp.x-this.animationStartUp.x)*s,a=this.animationStartUp.y+(this.animationEndUp.y-this.animationStartUp.y)*s,l=this.animationStartUp.z+(this.animationEndUp.z-this.animationStartUp.z)*s;const c=Math.sqrt(i*i+a*a+l*l);c>1e-4&&(this.camera.up.x=i/c,this.camera.up.y=a/c,this.camera.up.z=l/c)}this.updateMatrices(),n=!0}else this.animationEndPos&&(this.camera.position.x=this.animationEndPos.x,this.camera.position.y=this.animationEndPos.y,this.camera.position.z=this.animationEndPos.z),this.animationEndTarget&&(this.camera.target.x=this.animationEndTarget.x,this.camera.target.y=this.animationEndTarget.y,this.camera.target.z=this.animationEndTarget.z),this.animationEndUp&&(this.camera.up.x=this.animationEndUp.x,this.camera.up.y=this.animationEndUp.y,this.camera.up.z=this.animationEndUp.z),this.updateMatrices(),this.animationStartTime=0,this.animationDuration=0,this.animationStartPos=null,this.animationEndPos=null,this.animationStartTarget=null,this.animationEndTarget=null,this.animationStartUp=null,this.animationEndUp=null,this.animationEasing=null}return(Math.abs(this.velocity.orbit.x)>this.minVelocity||Math.abs(this.velocity.orbit.y)>this.minVelocity)&&(this.orbit(this.velocity.orbit.x*100,this.velocity.orbit.y*100,!1),this.velocity.orbit.x*=this.damping,this.velocity.orbit.y*=this.damping,n=!0),(Math.abs(this.velocity.pan.x)>this.minVelocity||Math.abs(this.velocity.pan.y)>this.minVelocity)&&(this.pan(this.velocity.pan.x*1e3,this.velocity.pan.y*1e3,!1),this.velocity.pan.x*=this.damping,this.velocity.pan.y*=this.damping,n=!0),Math.abs(this.velocity.zoom)>this.minVelocity&&(this.zoom(this.velocity.zoom*1e3,!1),this.velocity.zoom*=this.damping,n=!0),n}async zoomToFit(t,n,r=500){const o={x:(t.x+n.x)/2,y:(t.y+n.y)/2,z:(t.z+n.z)/2},s={x:n.x-t.x,y:n.y-t.y,z:n.z-t.z},a=Math.max(s.x,s.y,s.z)*2,l=o,c={x:o.x+a*.6,y:o.y+a*.5,z:o.z+a*.6};return this.animateTo(c,l,r)}async framePoint(t,n=300){const r={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},o={x:t.x+r.x,y:t.y+r.y,z:t.z+r.z};return this.animateTo(o,t,n)}async frameBounds(t,n,r=300){const o={x:(t.x+n.x)/2,y:(t.y+n.y)/2,z:(t.z+n.z)/2},s={x:n.x-t.x,y:n.y-t.y,z:n.z-t.z},i=Math.max(s.x,s.y,s.z);if(i<1e-6)return this.framePoint(o,r);const a=Math.tan(this.camera.fov/2),l=i/2/a*1.2,c=this.viewMatrix.m;let u={x:-c[8],y:-c[9],z:-c[10]};const f=Math.sqrt(u.x*u.x+u.y*u.y+u.z*u.z);if(f>1e-6)u.x/=f,u.y/=f,u.z/=f;else{u={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z};const y=Math.sqrt(u.x*u.x+u.y*u.y+u.z*u.z);if(y>1e-6)u.x/=y,u.y/=y,u.z/=y;else{u.x=.6,u.y=.5,u.z=.6;const m=Math.sqrt(u.x*u.x+u.y*u.y+u.z*u.z);u.x/=m,u.y/=m,u.z/=m}}const h={x:o.x+u.x*l,y:o.y+u.y*l,z:o.z+u.z*l};return this.animateTo(h,o,r)}async zoomExtent(t,n,r=300){const o={x:(t.x+n.x)/2,y:(t.y+n.y)/2,z:(t.z+n.z)/2},s={x:n.x-t.x,y:n.y-t.y,z:n.z-t.z},i=Math.max(s.x,s.y,s.z),a=Math.tan(this.camera.fov/2),l=i/2/a*1.5,c={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},u=Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z);if(u>1e-10)c.x/=u,c.y/=u,c.z/=u;else{c.x=.6,c.y=.5,c.z=.6;const h=Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z);c.x/=h,c.y/=h,c.z/=h}const f={x:o.x+c.x*l,y:o.y+c.y*l,z:o.z+c.z*l};return this.animateTo(f,o,r)}async animateTo(t,n,r=500){return this.animationStartPos={...this.camera.position},this.animationStartTarget={...this.camera.target},this.animationEndPos=t,this.animationEndTarget=n,this.animationStartUp=null,this.animationEndUp=null,this.animationDuration=r,this.animationStartTime=Date.now(),this.animationEasing=this.easeOutCubic,new Promise(o=>{const s=()=>{this.animationStartTime===0?o():requestAnimationFrame(s)};s()})}async animateToWithUp(t,n,r,o=500){return this.velocity.orbit.x=0,this.velocity.orbit.y=0,this.velocity.pan.x=0,this.velocity.pan.y=0,this.velocity.zoom=0,this.animationStartPos={...this.camera.position},this.animationStartTarget={...this.camera.target},this.animationStartUp={...this.camera.up},this.animationEndPos=t,this.animationEndTarget=n,this.animationEndUp=r,this.animationDuration=o,this.animationStartTime=Date.now(),this.animationEasing=this.easeOutCubic,new Promise(s=>{const i=()=>{this.animationStartTime===0?s():requestAnimationFrame(i)};i()})}easeOutCubic(t){return 1-Math.pow(1-t,3)}enableFirstPersonMode(t){this.isFirstPersonMode=t}moveFirstPerson(t,n,r){if(!this.isFirstPersonMode)return;const o={x:this.camera.target.x-this.camera.position.x,y:this.camera.target.y-this.camera.position.y,z:this.camera.target.z-this.camera.position.z},s=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z);s>1e-10&&(o.x/=s,o.y/=s,o.z/=s);const i={x:-o.z,y:0,z:o.x},a=Math.sqrt(i.x*i.x+i.z*i.z);a>1e-10&&(i.x/=a,i.z/=a);const l={x:i.z*o.y-i.y*o.z,y:i.x*o.z-i.z*o.x,z:i.y*o.x-i.x*o.y},c=this.firstPersonSpeed;this.camera.position.x+=(o.x*t+i.x*n+l.x*r)*c,this.camera.position.y+=(o.y*t+i.y*n+l.y*r)*c,this.camera.position.z+=(o.z*t+i.z*n+l.z*r)*c,this.camera.target.x+=(o.x*t+i.x*n+l.x*r)*c,this.camera.target.y+=(o.y*t+i.y*n+l.y*r)*c,this.camera.target.z+=(o.z*t+i.z*n+l.z*r)*c,this.updateMatrices()}setPresetView(t,n){const r=n||this.getCurrentBounds();if(!r){console.warn("[Camera] No bounds available for setPresetView");return}this.lastPresetView===t?this.presetViewRotation=(this.presetViewRotation+1)%4:(this.lastPresetView=t,this.presetViewRotation=0);const o={x:(r.min.x+r.max.x)/2,y:(r.min.y+r.max.y)/2,z:(r.min.z+r.max.z)/2},s={x:r.max.x-r.min.x,y:r.max.y-r.min.y,z:r.max.z-r.min.z},i=Math.max(s.x,s.y,s.z),a=Math.tan(this.camera.fov/2),l=i/2/a*1.5;let c;const u=o;let f={x:0,y:1,z:0};const h=[{x:0,y:0,z:-1},{x:-1,y:0,z:0},{x:0,y:0,z:1},{x:1,y:0,z:0}],y=[{x:0,y:0,z:1},{x:1,y:0,z:0},{x:0,y:0,z:-1},{x:-1,y:0,z:0}];switch(t){case"top":c={x:o.x,y:o.y+l,z:o.z},f=h[this.presetViewRotation];break;case"bottom":c={x:o.x,y:o.y-l,z:o.z},f=y[this.presetViewRotation];break;case"front":c={x:o.x,y:o.y,z:o.z+l},f={x:0,y:1,z:0};break;case"back":c={x:o.x,y:o.y,z:o.z-l},f={x:0,y:1,z:0};break;case"left":c={x:o.x-l,y:o.y,z:o.z},f={x:0,y:1,z:0};break;case"right":c={x:o.x+l,y:o.y,z:o.z},f={x:0,y:1,z:0};break}this.animateToWithUp(c,u,f,300)}getCurrentBounds(){const t={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},r=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)/2;return{min:{x:this.camera.target.x-r,y:this.camera.target.y-r,z:this.camera.target.z-r},max:{x:this.camera.target.x+r,y:this.camera.target.y+r,z:this.camera.target.z+r}}}stopInertia(){this.velocity.orbit.x=0,this.velocity.orbit.y=0,this.velocity.pan.x=0,this.velocity.pan.y=0,this.velocity.zoom=0}reset(){this.orbitPivot=null,this.stopInertia(),this.animationStartTime=0,this.animationDuration=0,this.animationStartPos=null,this.animationStartTarget=null,this.animationEndPos=null,this.animationEndTarget=null,this.animationStartUp=null,this.animationEndUp=null,this.animationEasing=null,this.lastPresetView=null,this.presetViewRotation=0}getViewProjMatrix(){return this.viewProjMatrix}getPosition(){return{...this.camera.position}}getTarget(){return{...this.camera.target}}getFOV(){return this.camera.fov}getDistance(){const t={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z};return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}getRotation(){const t={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},n=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);if(n<1e-6)return{azimuth:0,elevation:0};const r=Math.asin(Math.max(-1,Math.min(1,t.y/n)))*180/Math.PI,o=this.camera.up.x,s=this.camera.up.y,i=this.camera.up.z,a=Math.sqrt(o*o+i*i);let l;return a>.01?(l=(Math.atan2(-o,-i)*180/Math.PI+360)%360,r<-80&&s<0&&(l=(l+180)%360)):l=(Math.atan2(t.x,t.z)*180/Math.PI+360)%360,{azimuth:l,elevation:r}}projectToScreen(t,n,r){const o=this.viewProjMatrix.m,s=o[0]*t.x+o[4]*t.y+o[8]*t.z+o[12],i=o[1]*t.x+o[5]*t.y+o[9]*t.z+o[13],a=o[2]*t.x+o[6]*t.y+o[10]*t.z+o[14],l=o[3]*t.x+o[7]*t.y+o[11]*t.z+o[15];if(l<=0)return null;const c=s/l,u=i/l,f=a/l;if(f<-1||f>1)return null;const h=(c+1)*.5*n,y=(1-u)*.5*r;return{x:h,y}}updateMatrices(){this.viewMatrix=wr.lookAt(this.camera.position,this.camera.target,this.camera.up),this.projMatrix=wr.perspective(this.camera.fov,this.camera.aspect,this.camera.near,this.camera.far),this.viewProjMatrix=wr.multiply(this.projMatrix,this.viewMatrix)}}class AM{meshes=[];addMesh(t){this.meshes.push(t)}getMeshes(){return this.meshes}clear(){for(const t of this.meshes)t.vertexBuffer.destroy(),t.indexBuffer.destroy(),t.uniformBuffer&&t.uniformBuffer.destroy();this.meshes=[]}getBounds(){return this.meshes.length===0?null:{min:{x:-10,y:-10,z:-10},max:{x:10,y:10,z:10}}}}class jM{device;pipeline;depthTexture;colorTexture;uniformBuffer;expressIdBuffer;bindGroup;maxMeshes=1e4;constructor(t,n=1,r=1){this.device=t.getDevice(),this.colorTexture=this.device.createTexture({size:{width:n,height:r},format:"r32uint",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.depthTexture=this.device.createTexture({size:{width:n,height:r},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}),this.uniformBuffer=this.device.createBuffer({size:64,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.expressIdBuffer=this.device.createBuffer({size:this.maxMeshes*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:`
563
+ struct Uniforms {
564
+ viewProj: mat4x4<f32>,
565
+ }
566
+ @binding(0) @group(0) var<uniform> uniforms: Uniforms;
567
+ @binding(1) @group(0) var<storage, read> expressIds: array<u32>;
568
+
569
+ struct VertexInput {
570
+ @location(0) position: vec3<f32>,
571
+ @location(1) normal: vec3<f32>,
572
+ }
573
+
574
+ struct VertexOutput {
575
+ @builtin(position) position: vec4<f32>,
576
+ @location(0) @interpolate(flat) objectId: u32,
577
+ }
578
+
579
+ @vertex
580
+ fn vs_main(input: VertexInput, @builtin(instance_index) instanceIndex: u32) -> VertexOutput {
581
+ var output: VertexOutput;
582
+ // Identity transform - positions are already in world space
583
+ output.position = uniforms.viewProj * vec4<f32>(input.position, 1.0);
584
+ // Look up expressId from storage buffer using instance index
585
+ output.objectId = expressIds[instanceIndex];
586
+ return output;
587
+ }
588
+
589
+ @fragment
590
+ fn fs_main(input: VertexOutput) -> @location(0) u32 {
591
+ return input.objectId;
592
+ }
593
+ `});this.pipeline=this.device.createRenderPipeline({layout:"auto",vertex:{module:o,entryPoint:"vs_main",buffers:[{arrayStride:24,attributes:[{shaderLocation:0,offset:0,format:"float32x3"},{shaderLocation:1,offset:12,format:"float32x3"}]}]},fragment:{module:o,entryPoint:"fs_main",targets:[{format:"r32uint"}]},primitive:{topology:"triangle-list",cullMode:"back"},depthStencil:{format:"depth24plus",depthWriteEnabled:!0,depthCompare:"less"}}),this.bindGroup=this.device.createBindGroup({layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}},{binding:1,resource:{buffer:this.expressIdBuffer}}]})}async pick(t,n,r,o,s,i){(this.colorTexture.width!==r||this.colorTexture.height!==o)&&(this.colorTexture.destroy(),this.depthTexture.destroy(),this.colorTexture=this.device.createTexture({size:{width:r,height:o},format:"r32uint",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.depthTexture=this.device.createTexture({size:{width:r,height:o},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}));const a=this.colorTexture.createView(),l=this.depthTexture.createView(),c=this.device.createCommandEncoder(),u=c.beginRenderPass({colorAttachments:[{view:a,loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0},storeOp:"store"}],depthStencilAttachment:{view:l,depthClearValue:1,depthLoadOp:"clear",depthStoreOp:"store"}});this.device.queue.writeBuffer(this.uniformBuffer,0,i);const f=new Uint32Array(s.length);for(let b=0;b<s.length;b++){const g=s[b];g&&(f[b]=g.expressId+1)}this.device.queue.writeBuffer(this.expressIdBuffer,0,f),u.setPipeline(this.pipeline),u.setBindGroup(0,this.bindGroup);for(let b=0;b<s.length;b++){const g=s[b];g&&(u.setVertexBuffer(0,g.vertexBuffer),u.setIndexBuffer(g.indexBuffer,"uint32"),u.drawIndexed(g.indexCount,1,0,0,b))}u.end();const h=256,y=this.device.createBuffer({size:h,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});c.copyTextureToBuffer({texture:this.colorTexture,origin:{x:Math.floor(t),y:Math.floor(n),z:0}},{buffer:y,bytesPerRow:h,rowsPerImage:1},{width:1,height:1}),this.device.queue.submit([c.finish()]),await y.mapAsync(1);const v=new Uint32Array(y.getMappedRange())[0];return y.unmap(),y.destroy(),v>0?v-1:null}updateUniforms(t){this.device.queue.writeBuffer(this.uniformBuffer,0,t)}}class LM{device;pipeline=null;vertexBuffer=null;uniformBuffer=null;bindGroup=null;format;initialized=!1;constructor(t,n){this.device=t,this.format=n}init(){if(this.initialized)return;const t=this.device.createShaderModule({code:`
594
+ struct Uniforms {
595
+ viewProj: mat4x4<f32>,
596
+ planeColor: vec4<f32>,
597
+ }
598
+ @binding(0) @group(0) var<uniform> uniforms: Uniforms;
599
+
600
+ struct VertexOutput {
601
+ @builtin(position) position: vec4<f32>,
602
+ @location(0) uv: vec2<f32>,
603
+ }
604
+
605
+ @vertex
606
+ fn vs_main(@location(0) position: vec3<f32>, @location(1) uv: vec2<f32>) -> VertexOutput {
607
+ var output: VertexOutput;
608
+ output.position = uniforms.viewProj * vec4<f32>(position, 1.0);
609
+ output.uv = uv;
610
+ return output;
611
+ }
612
+
613
+ @fragment
614
+ fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
615
+ // Create a grid pattern on the plane
616
+ let gridSize = 0.05;
617
+ let lineWidth = 0.02;
618
+
619
+ let gridX = abs(fract(input.uv.x / gridSize + 0.5) - 0.5);
620
+ let gridY = abs(fract(input.uv.y / gridSize + 0.5) - 0.5);
621
+
622
+ let gridLine = min(gridX, gridY);
623
+ let isGridLine = gridLine < lineWidth;
624
+
625
+ // Edge fade for softer appearance
626
+ let edgeFade = smoothstep(0.0, 0.1, min(input.uv.x, min(input.uv.y, min(1.0 - input.uv.x, 1.0 - input.uv.y))));
627
+
628
+ var color = uniforms.planeColor;
629
+ if (isGridLine) {
630
+ color = vec4<f32>(color.rgb * 1.3, color.a * 1.5);
631
+ }
632
+
633
+ color.a *= edgeFade;
634
+
635
+ return color;
636
+ }
637
+ `});this.pipeline=this.device.createRenderPipeline({layout:"auto",vertex:{module:t,entryPoint:"vs_main",buffers:[{arrayStride:20,attributes:[{shaderLocation:0,offset:0,format:"float32x3"},{shaderLocation:1,offset:12,format:"float32x2"}]}]},fragment:{module:t,entryPoint:"fs_main",targets:[{format:this.format,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}}}]},primitive:{topology:"triangle-list",cullMode:"none"},depthStencil:{format:"depth24plus",depthWriteEnabled:!1,depthCompare:"less-equal"}}),this.vertexBuffer=this.device.createBuffer({size:6*5*4,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST}),this.uniformBuffer=this.device.createBuffer({size:80,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.bindGroup=this.device.createBindGroup({layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}}]}),this.initialized=!0}render(t,n,r,o){if(this.init(),!this.pipeline||!this.vertexBuffer||!this.uniformBuffer||!this.bindGroup)return;const{axis:s,position:i,bounds:a,viewProj:l}=o,c=this.calculatePlaneVertices(s,i,a);this.device.queue.writeBuffer(this.vertexBuffer,0,c);const u=new Float32Array(20);u.set(l,0),u[16]=.2,u[17]=.6,u[18]=.9,u[19]=.3,this.device.queue.writeBuffer(this.uniformBuffer,0,u);const f=t.beginRenderPass({colorAttachments:[{view:n,loadOp:"load",storeOp:"store"}],depthStencilAttachment:{view:r,depthLoadOp:"load",depthStoreOp:"store"}});f.setPipeline(this.pipeline),f.setBindGroup(0,this.bindGroup),f.setVertexBuffer(0,this.vertexBuffer),f.draw(6),f.end()}calculatePlaneVertices(t,n,r){const{min:o,max:s}=r,i=.1,a=(s.x-o.x)*(1+i),l=(s.y-o.y)*(1+i),c=(s.z-o.z)*(1+i),u=(o.x+s.x)/2,f=(o.y+s.y)/2,h=(o.z+s.z)/2,y=n/100;let m=[];if(t==="x"){const v=o.x+y*(s.x-o.x),b=l/2,g=c/2;m=[v,f-b,h-g,0,0,v,f+b,h-g,1,0,v,f+b,h+g,1,1,v,f-b,h-g,0,0,v,f+b,h+g,1,1,v,f-b,h+g,0,1]}else if(t==="y"){const v=o.y+y*(s.y-o.y),b=a/2,g=c/2;m=[u-b,v,h-g,0,0,u+b,v,h-g,1,0,u+b,v,h+g,1,1,u-b,v,h-g,0,0,u+b,v,h+g,1,1,u-b,v,h+g,0,1]}else{const v=o.z+y*(s.z-o.z),b=a/2,g=l/2;m=[u-b,f-g,v,0,0,u+b,f-g,v,1,0,u+b,f+g,v,1,1,u-b,f-g,v,0,0,u+b,f+g,v,1,1,u-b,f+g,v,0,1]}return new Float32Array(m)}}class OM{device;pipeline=null;camera;scene;picker=null;canvas;sectionPlaneRenderer=null;modelBounds=null;constructor(t){this.canvas=t,this.device=new NM,this.camera=new zM,this.scene=new AM}async init(){await this.device.init(this.canvas);const t=this.canvas.getBoundingClientRect(),n=this.canvas.width||Math.max(1,Math.floor(t.width)),r=this.canvas.height||Math.max(1,Math.floor(t.height));(!this.canvas.width||!this.canvas.height)&&(this.canvas.width=n,this.canvas.height=r),this.pipeline=new TM(this.device,n,r),this.picker=new jM(this.device,n,r),this.sectionPlaneRenderer=new LM(this.device.getDevice(),this.device.getFormat()),this.camera.setAspect(n/r)}addMesh(t){if(!t.uniformBuffer&&this.pipeline&&this.device.isInitialized()){const n=this.device.getDevice();t.uniformBuffer=n.createBuffer({size:this.pipeline.getUniformBufferSize(),usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),t.bindGroup=n.createBindGroup({layout:this.pipeline.getBindGroupLayout(),entries:[{binding:0,resource:{buffer:t.uniformBuffer}}]})}this.scene.addMesh(t)}ensureMeshResources(){if(!this.pipeline||!this.device.isInitialized())return;const t=this.device.getDevice();let n=0;for(const r of this.scene.getMeshes())r.uniformBuffer||(r.uniformBuffer=t.createBuffer({size:this.pipeline.getUniformBufferSize(),usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),r.bindGroup=t.createBindGroup({layout:this.pipeline.getBindGroupLayout(),entries:[{binding:0,resource:{buffer:r.uniformBuffer}}]}),n++);n>0&&console.log(`[Renderer] Created GPU resources for ${n} meshes`)}render(t={}){if(!this.device.isInitialized()||!this.pipeline)return;const n=this.canvas.getBoundingClientRect(),r=Math.max(1,Math.floor(n.width)),o=Math.max(1,Math.floor(n.height));if(r<10||o<10||((this.canvas.width!==r||this.canvas.height!==o)&&(this.canvas.width=r,this.canvas.height=o,this.camera.setAspect(r/o),this.device.configureContext(),this.pipeline.resize(r,o)),this.canvas.width===0||this.canvas.height===0)||!this.device.ensureContext())return;const i=this.device.getDevice(),a=this.camera.getViewProjMatrix().m;this.ensureMeshResources();let l=this.scene.getMeshes();if(t.enableFrustumCulling&&t.spatialIndex)try{const u=Ou.fromViewProjMatrix(a),f=new Set(t.spatialIndex.queryFrustum(u));l=l.filter(h=>f.has(h.expressId))}catch(u){console.warn("Frustum culling failed:",u)}t.hiddenIds&&t.hiddenIds.size>0&&(l=l.filter(u=>!t.hiddenIds.has(u.expressId))),t.isolatedIds!==null&&t.isolatedIds!==void 0&&(l=l.filter(u=>t.isolatedIds.has(u.expressId))),this.pipeline.needsResize(this.canvas.width,this.canvas.height)&&this.pipeline.resize(this.canvas.width,this.canvas.height);const c=this.device.getCurrentTexture();if(c)try{const u=t.clearColor?Array.isArray(t.clearColor)?{r:t.clearColor[0],g:t.clearColor[1],b:t.clearColor[2],a:t.clearColor[3]}:t.clearColor:{r:.1,g:.1,b:.1,a:1},f=c.createView(),h=[],y=[];for(const S of l){const C=S.color[3],_=S.material?.transparency??0;C<.99||_>.01?y.push(S):h.push(S)}y.length>0&&y.sort((S,C)=>C.expressId-S.expressId);const m=[...h,...y],v=t.selectedId,b=t.selectedIds;let g;if(t.sectionPlane?.enabled){const S=[0,0,0];t.sectionPlane.axis==="x"?S[0]=1:t.sectionPlane.axis==="y"?S[1]=1:S[2]=1;const C={x:1/0,y:1/0,z:1/0},_={x:-1/0,y:-1/0,z:-1/0};if(l.length>0){for(const P of l)P.bounds&&(C.x=Math.min(C.x,P.bounds.min[0]),C.y=Math.min(C.y,P.bounds.min[1]),C.z=Math.min(C.z,P.bounds.min[2]),_.x=Math.max(_.x,P.bounds.max[0]),_.y=Math.max(_.y,P.bounds.max[1]),_.z=Math.max(_.z,P.bounds.max[2]));Number.isFinite(C.x)||(C.x=C.y=C.z=-100,_.x=_.y=_.z=100)}else C.x=C.y=C.z=-100,_.x=_.y=_.z=100;this.modelBounds={min:C,max:_};const E=t.sectionPlane.axis==="x"?"x":t.sectionPlane.axis==="y"?"y":"z",I=C[E],R=_[E]-I,z=I+t.sectionPlane.position/100*R;g={normal:S,distance:z,enabled:!0}}for(const S of m)if(S.uniformBuffer){const C=new Float32Array(48),_=new Uint32Array(C.buffer,176,4);C.set(a,0),C.set(S.transform.m,16);const E=v!=null&&S.expressId===v||b!==void 0&&b.has(S.expressId);C.set(S.color,32),C[36]=S.material?.metallic??0,C[37]=S.material?.roughness??.6,g&&(C[40]=g.normal[0],C[41]=g.normal[1],C[42]=g.normal[2],C[43]=g.distance),_[0]=E?1:0,_[1]=g?.enabled?1:0,_[2]=0,_[3]=0,i.queue.writeBuffer(S.uniformBuffer,0,C)}const x=i.createCommandEncoder(),w=x.beginRenderPass({colorAttachments:[{view:f,loadOp:"clear",clearValue:u,storeOp:"store"}],depthStencilAttachment:{view:this.pipeline.getDepthTextureView(),depthClearValue:1,depthLoadOp:"clear",depthStoreOp:"store"}});w.setPipeline(this.pipeline.getPipeline());for(const S of h)S.bindGroup?w.setBindGroup(0,S.bindGroup):w.setBindGroup(0,this.pipeline.getBindGroup()),w.setVertexBuffer(0,S.vertexBuffer),w.setIndexBuffer(S.indexBuffer,"uint32"),w.drawIndexed(S.indexCount,1,0,0,0);for(const S of y)S.bindGroup?w.setBindGroup(0,S.bindGroup):w.setBindGroup(0,this.pipeline.getBindGroup()),w.setVertexBuffer(0,S.vertexBuffer),w.setIndexBuffer(S.indexBuffer,"uint32"),w.drawIndexed(S.indexCount,1,0,0,0);w.end(),g?.enabled&&this.sectionPlaneRenderer&&this.modelBounds&&this.sectionPlaneRenderer.render(x,f,this.pipeline.getDepthTextureView(),{axis:t.sectionPlane.axis,position:t.sectionPlane.position,bounds:this.modelBounds,viewProj:a}),i.queue.submit([x.finish()])}catch(u){this.device.invalidateContext(),Math.random()<.01&&console.warn("Render error (context will be reconfigured):",u)}}async pick(t,n){if(!this.picker)return null;const r=this.scene.getMeshes(),o=this.camera.getViewProjMatrix().m;return this.picker.pick(t,n,this.canvas.width,this.canvas.height,r,o)}resize(t,n){this.canvas.width=t,this.canvas.height=n,this.camera.setAspect(t/n)}getCamera(){return this.camera}getScene(){return this.scene}isReady(){return this.device.isInitialized()&&this.pipeline!==null}getGPUDevice(){return this.device.isInitialized()?this.device.getDevice():null}}function DM({geometry:e,coordinateInfo:t}){const n=p.useRef(null),r=p.useRef(null),[o,s]=p.useState(!1),i=D(L=>L.selectedEntityId),a=D(L=>L.setSelectedEntityId),l=D(L=>L.hiddenEntities),c=D(L=>L.isolatedEntities),u=D(L=>L.activeTool),f=D(L=>L.updateCameraRotationRealtime),h=D(L=>L.updateScaleRealtime),y=D(L=>L.setCameraCallbacks),m=D(L=>L.theme),v=D(L=>L.setHoverState),b=D(L=>L.clearHover),g=D(L=>L.hoverTooltipsEnabled),x=D(L=>L.openContextMenu),w=D(L=>L.startBoxSelect),S=D(L=>L.updateBoxSelect),C=D(L=>L.endBoxSelect),_=D(L=>L.boxSelect),E=D(L=>L.setSelectedEntityIds),I=D(L=>L.toggleSelection),M=D(L=>L.pendingMeasurePoint),R=D(L=>L.addMeasurePoint),z=D(L=>L.completeMeasurement),P=D(L=>L.sectionPlane),j=p.useRef([.1,.1,.1,1]);p.useEffect(()=>{m==="light"?j.current=[.95,.95,.95,1]:j.current=[.1,.1,.1,1];const L=r.current;L&&o&&L.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current})},[m,o]);const W=p.useRef(null),$=p.useRef(0),O=p.useRef({isDragging:!1,isPanning:!1,lastX:0,lastY:0,button:0,startX:0,startY:0,didDrag:!1}),H=p.useRef({touches:[],lastDistance:0,lastCenter:{x:0,y:0}}),k=p.useRef(0),N=p.useRef(null),U=p.useRef({handleKeyDown:null,handleKeyUp:null}),re=p.useRef(!1),K=p.useRef({min:{x:-100,y:-100,z:-100},max:{x:100,y:100,z:100}}),J=p.useRef(l),oe=p.useRef(c),de=p.useRef(i),_e=p.useRef(u),se=p.useRef(M),ge=p.useRef(P),gn=p.useRef(_),at=p.useRef(e),jn=p.useRef(0),Ln=50,ur=p.useRef(g);p.useEffect(()=>{J.current=l},[l]),p.useEffect(()=>{oe.current=c},[c]),p.useEffect(()=>{de.current=i},[i]),p.useEffect(()=>{_e.current=u},[u]),p.useEffect(()=>{se.current=M},[M]),p.useEffect(()=>{ge.current=P},[P]),p.useEffect(()=>{gn.current=_},[_]),p.useEffect(()=>{at.current=e},[e]),p.useEffect(()=>{ur.current=g,g||b()},[g,b]),p.useEffect(()=>{const L=n.current;if(!L)return;s(!1);let $t=!1,yn=null;const hr=L.getBoundingClientRect(),si=Math.max(1,Math.floor(hr.width)),Il=Math.max(1,Math.floor(hr.height));L.width=si,L.height=Il;const xe=new OM(L);return r.current=xe,xe.init().then(()=>{if($t)return;s(!0);const F=xe.getCamera(),ae=O.current,Q=H.current;function Jt(T,Y){if(!T)return console.warn("[Viewport] getEntityBounds: geometry is null"),null;const Z=T.find(We=>We.expressId===Y);if(!Z)return console.warn(`[Viewport] getEntityBounds: mesh not found for entityId ${Y}`),null;if(Z.positions.length<3)return console.warn(`[Viewport] getEntityBounds: mesh has insufficient positions for entityId ${Y}`),null;let fe=1/0,he=1/0,we=1/0,lt=-1/0,ct=-1/0,ye=-1/0;for(let We=0;We<Z.positions.length;We+=3){const ut=Z.positions[We],ii=Z.positions[We+1],ai=Z.positions[We+2];fe=Math.min(fe,ut),he=Math.min(he,ii),we=Math.min(we,ai),lt=Math.max(lt,ut),ct=Math.max(ct,ii),ye=Math.max(ye,ai)}return{min:{x:fe,y:he,z:we},max:{x:lt,y:ct,z:ye}}}function en(T,Y){const Z=Jt(T,Y);return Z?{x:(Z.min.x+Z.max.x)/2,y:(Z.min.y+Z.max.y)/2,z:(Z.min.z+Z.max.z)/2}:null}y({setPresetView:T=>{F.setPresetView(T,K.current),xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0}),Pe()},fitAll:()=>{F.zoomExtent(K.current.min,K.current.max,300),Pe()},home:()=>{F.zoomToFit(K.current.min,K.current.max,500),Pe()},zoomIn:()=>{F.zoom(-50,!1),xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0}),Pe()},zoomOut:()=>{F.zoom(50,!1),xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0}),Pe()},frameSelection:()=>{const T=de.current,Y=at.current;if(T!==null&&Y){const Z=Jt(Y,T);Z?(F.frameBounds(Z.min,Z.max,300),Pe()):console.warn("[Viewport] frameSelection: Could not get bounds for selected element")}else console.warn("[Viewport] frameSelection: No selection or geometry")},orbit:(T,Y)=>{F.orbit(T,Y,!1),xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0}),f(F.getRotation()),Pe()}});const Pe=()=>{const T=n.current;if(!T)return;const Y=T.height,Z=F.getDistance(),fe=F.getFOV(),we=96/Y*(Z*Math.tan(fe/2)*2);h(we)};let vn=0,xn=0;const Sf=T=>{if($t)return;const Y=T-$.current;$.current=T,F.update(Y)?(xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0}),f(F.getRotation()),Pe()):!ae.isDragging&&T-vn>100&&(f(F.getRotation()),vn=T),T-xn>100&&(Pe(),xn=T),W.current=requestAnimationFrame(Sf)};$.current=performance.now(),W.current=requestAnimationFrame(Sf),L.addEventListener("mousedown",async T=>{T.preventDefault(),ae.isDragging=!0,ae.button=T.button,ae.lastX=T.clientX,ae.lastY=T.clientY,ae.startX=T.clientX,ae.startY=T.clientY,ae.didDrag=!1;const Y=_e.current;if(Y==="boxselect"&&T.button===0){w(T.clientX,T.clientY),L.style.cursor="crosshair";return}if(!(Y==="pan"||T.button===1||T.button===2||Y==="select"&&T.shiftKey||Y!=="orbit"&&Y!=="select"&&T.shiftKey)&&Y!=="measure"&&Y!=="walk"){const fe=L.getBoundingClientRect(),he=T.clientX-fe.left,we=T.clientY-fe.top,lt=await xe.pick(he,we);if(lt!==null){const ct=en(at.current,lt);ct?F.setOrbitPivot(ct):F.setOrbitPivot(null)}else F.setOrbitPivot(null)}Y==="pan"||T.button===1||T.button===2?(ae.isPanning=!0,L.style.cursor="move"):Y==="orbit"?(ae.isPanning=!1,L.style.cursor="grabbing"):Y==="select"?(ae.isPanning=T.shiftKey,L.style.cursor=T.shiftKey?"move":"grabbing"):Y==="measure"?L.style.cursor="crosshair":(ae.isPanning=T.shiftKey,L.style.cursor=T.shiftKey?"move":"grabbing")}),L.addEventListener("mousemove",async T=>{const Y=L.getBoundingClientRect(),Z=T.clientX-Y.left,fe=T.clientY-Y.top;if(ae.isDragging){const he=T.clientX-ae.lastX,we=T.clientY-ae.lastY,lt=_e.current,ct=T.clientX-ae.startX,ye=T.clientY-ae.startY;if((Math.abs(ct)>5||Math.abs(ye)>5)&&(ae.didDrag=!0),lt==="boxselect"&&ae.button===0){S(T.clientX,T.clientY);return}ae.isPanning||lt==="pan"?F.pan(he,we,!1):lt==="walk"?(F.orbit(he*.5,0,!1),Math.abs(we)>2&&F.zoom(we*2,!1)):F.orbit(he,we,!1),ae.lastX=T.clientX,ae.lastY=T.clientY,xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0}),f(F.getRotation()),Pe(),b()}else if(ur.current){const he=Date.now();if(he-jn.current>Ln){jn.current=he;const we=await xe.pick(Z,fe);we?v({entityId:we,screenX:T.clientX,screenY:T.clientY}):b()}}}),L.addEventListener("mouseup",()=>{ae.isDragging=!1,ae.isPanning=!1;const T=_e.current;L.style.cursor=T==="pan"||T==="orbit"?"grab":"default",F.setOrbitPivot(null)}),L.addEventListener("mouseleave",()=>{ae.isDragging=!1,ae.isPanning=!1,F.stopInertia(),F.setOrbitPivot(null),L.style.cursor="default",b()}),L.addEventListener("contextmenu",async T=>{T.preventDefault();const Y=L.getBoundingClientRect(),Z=T.clientX-Y.left,fe=T.clientY-Y.top,he=await xe.pick(Z,fe);x(he,T.clientX,T.clientY)}),L.addEventListener("wheel",T=>{T.preventDefault();const Y=L.getBoundingClientRect(),Z=T.clientX-Y.left,fe=T.clientY-Y.top;F.zoom(T.deltaY,!1,Z,fe,L.width,L.height),xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0})}),L.addEventListener("click",async T=>{const Y=L.getBoundingClientRect(),Z=T.clientX-Y.left,fe=T.clientY-Y.top,he=_e.current;if(ae.didDrag||he==="orbit"||he==="pan"||he==="walk")return;if(he==="measure"){const ye=await xe.pick(Z,fe);if(ye){const We=ow(at.current,ye,Z,fe,L.width,L.height),ut={x:We.x,y:We.y,z:We.z,screenX:T.clientX,screenY:T.clientY};se.current?z(ut):R(ut)}return}if(he==="boxselect"){const ye=gn.current,We=at.current;if(ye.isSelecting&&We){const ut={left:Math.min(ye.startX,ye.currentX),right:Math.max(ye.startX,ye.currentX),top:Math.min(ye.startY,ye.currentY),bottom:Math.max(ye.startY,ye.currentY)},ii=ut.right-ut.left,ai=ut.bottom-ut.top;if(ii>5&&ai>5){const li=L.getBoundingClientRect(),sw=ut.left-li.left,iw=ut.right-li.left,aw=ut.top-li.top,lw=ut.bottom-li.top,_l=[];for(const Vr of We)if(Vr.positions.length>=3){let kl=1/0,Rl=1/0,Pl=1/0,Ml=-1/0,Nl=-1/0,Tl=-1/0;for(let Bo=0;Bo<Vr.positions.length;Bo+=3){const _f=Vr.positions[Bo],kf=Vr.positions[Bo+1],Rf=Vr.positions[Bo+2];kl=Math.min(kl,_f),Rl=Math.min(Rl,kf),Pl=Math.min(Pl,Rf),Ml=Math.max(Ml,_f),Nl=Math.max(Nl,kf),Tl=Math.max(Tl,Rf)}const cw={x:(kl+Ml)/2,y:(Rl+Nl)/2,z:(Pl+Tl)/2},Fo=F.projectToScreen(cw,L.width,L.height);Fo&&Fo.x>=sw&&Fo.x<=iw&&Fo.y>=aw&&Fo.y<=lw&&_l.push(Vr.expressId)}_l.length>0&&E(_l)}}C();return}const we=Date.now(),lt=we-k.current,ct={x:Z,y:fe};if(N.current&&lt<300&&Math.abs(ct.x-N.current.x)<5&&Math.abs(ct.y-N.current.y)<5){const ye=await xe.pick(Z,fe);ye&&a(ye),k.current=0,N.current=null}else{const ye=await xe.pick(Z,fe);T.ctrlKey||T.metaKey?ye&&I(ye):a(ye),k.current=we,N.current=ct}});function ow(T,Y,Z,fe,he,we){return en(T,Y)||{x:0,y:0,z:0}}L.addEventListener("touchstart",async T=>{if(T.preventDefault(),Q.touches=Array.from(T.touches),Q.touches.length===1){Q.lastCenter={x:Q.touches[0].clientX,y:Q.touches[0].clientY};const Y=L.getBoundingClientRect(),Z=Q.touches[0].clientX-Y.left,fe=Q.touches[0].clientY-Y.top,he=await xe.pick(Z,fe);if(he!==null){const we=en(at.current,he);we?F.setOrbitPivot(we):F.setOrbitPivot(null)}else F.setOrbitPivot(null)}else if(Q.touches.length===2){const Y=Q.touches[1].clientX-Q.touches[0].clientX,Z=Q.touches[1].clientY-Q.touches[0].clientY;Q.lastDistance=Math.sqrt(Y*Y+Z*Z),Q.lastCenter={x:(Q.touches[0].clientX+Q.touches[1].clientX)/2,y:(Q.touches[0].clientY+Q.touches[1].clientY)/2}}}),L.addEventListener("touchmove",T=>{if(T.preventDefault(),Q.touches=Array.from(T.touches),Q.touches.length===1){const Y=Q.touches[0].clientX-Q.lastCenter.x,Z=Q.touches[0].clientY-Q.lastCenter.y;F.orbit(Y,Z,!1),Q.lastCenter={x:Q.touches[0].clientX,y:Q.touches[0].clientY},xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current})}else if(Q.touches.length===2){const Y=Q.touches[1].clientX-Q.touches[0].clientX,Z=Q.touches[1].clientY-Q.touches[0].clientY,fe=Math.sqrt(Y*Y+Z*Z),he=(Q.touches[0].clientX+Q.touches[1].clientX)/2,we=(Q.touches[0].clientY+Q.touches[1].clientY)/2,lt=he-Q.lastCenter.x,ct=we-Q.lastCenter.y;F.pan(lt,ct,!1);const ye=fe-Q.lastDistance,We=L.getBoundingClientRect();F.zoom(ye*10,!1,he-We.left,we-We.top,L.width,L.height),Q.lastDistance=fe,Q.lastCenter={x:he,y:we},xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0})}}),L.addEventListener("touchend",T=>{T.preventDefault(),Q.touches=Array.from(T.touches),Q.touches.length===0&&(F.stopInertia(),F.setOrbitPivot(null))});const Ae={},Cf=T=>{if(document.activeElement?.tagName==="INPUT"||document.activeElement?.tagName==="TEXTAREA")return;Ae[T.key.toLowerCase()]=!0;const Y=Z=>{F.setPresetView(Z,K.current),xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current}),f(F.getRotation()),Pe()};if(T.key==="1"&&Y("top"),T.key==="2"&&Y("bottom"),T.key==="3"&&Y("front"),T.key==="4"&&Y("back"),T.key==="5"&&Y("left"),T.key==="6"&&Y("right"),T.key==="f"||T.key==="F"){const Z=de.current;if(Z!==null){const fe=Jt(at.current,Z);fe&&F.frameBounds(fe.min,fe.max,300)}else F.zoomExtent(K.current.min,K.current.max,300);Pe()}(T.key==="h"||T.key==="H")&&(F.zoomToFit(K.current.min,K.current.max,500),Pe()),(T.key==="z"||T.key==="Z")&&(F.zoomExtent(K.current.min,K.current.max,300),Pe()),(T.key==="c"||T.key==="C")&&(re.current=!re.current,F.enableFirstPersonMode(re.current))},Ef=T=>{Ae[T.key.toLowerCase()]=!1};U.current.handleKeyDown=Cf,U.current.handleKeyUp=Ef;const If=()=>{if($t)return;let T=!1;const Y=5,Z=.1;re.current?((Ae.w||Ae.arrowup)&&(F.moveFirstPerson(1,0,0),T=!0),(Ae.s||Ae.arrowdown)&&(F.moveFirstPerson(-1,0,0),T=!0),(Ae.a||Ae.arrowleft)&&(F.moveFirstPerson(0,-1,0),T=!0),(Ae.d||Ae.arrowright)&&(F.moveFirstPerson(0,1,0),T=!0),Ae.q&&(F.moveFirstPerson(0,0,-1),T=!0),Ae.e&&(F.moveFirstPerson(0,0,1),T=!0)):((Ae.w||Ae.arrowup)&&(F.pan(0,Y,!1),T=!0),(Ae.s||Ae.arrowdown)&&(F.pan(0,-Y,!1),T=!0),(Ae.a||Ae.arrowleft)&&(F.pan(-Y,0,!1),T=!0),(Ae.d||Ae.arrowright)&&(F.pan(Y,0,!1),T=!0),Ae.q&&(F.zoom(-Z*100,!1),T=!0),Ae.e&&(F.zoom(Z*100,!1),T=!0)),T&&xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current,sectionPlane:ge.current.enabled?ge.current:void 0}),requestAnimationFrame(If)};window.addEventListener("keydown",Cf),window.addEventListener("keyup",Ef),If(),yn=new ResizeObserver(()=>{if($t)return;const T=L.getBoundingClientRect(),Y=Math.max(1,Math.floor(T.width)),Z=Math.max(1,Math.floor(T.height));xe.resize(Y,Z),xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current})}),yn.observe(L),xe.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current})}),()=>{$t=!0,W.current!==null&&cancelAnimationFrame(W.current),yn&&yn.disconnect(),U.current.handleKeyDown&&window.removeEventListener("keydown",U.current.handleKeyDown),U.current.handleKeyUp&&window.removeEventListener("keyup",U.current.handleKeyUp),s(!1),r.current=null}},[a]);const Do=p.useRef(new Set),dr=p.useRef(0),On=p.useRef(null),fr=p.useRef(!1);p.useEffect(()=>{const L=r.current;if(!L||!e||!o)return;const $t=L.getGPUDevice();if(!$t)return;const yn=L.getScene(),hr=e.length,si=On.current!==e;if(si&&On.current!==null)yn.clear(),Do.current.clear(),fr.current=!1,dr.current=0,On.current=e,L.getCamera().reset(),K.current={min:{x:-100,y:-100,z:-100},max:{x:100,y:100,z:100}};else if(hr>dr.current)On.current=e;else if(hr===0){yn.clear(),Do.current.clear(),fr.current=!1,dr.current=0,On.current=null,L.getCamera().reset(),K.current={min:{x:-100,y:-100,z:-100},max:{x:100,y:100,z:100}};return}else{if(hr===dr.current&&!si)return;yn.clear(),Do.current.clear(),fr.current=!1,dr.current=0,On.current=e,L.getCamera().reset(),K.current={min:{x:-100,y:-100,z:-100},max:{x:100,y:100,z:100}}}On.current===null&&(On.current=e);const Il=dr.current,xe=e.slice(Il);for(const F of xe){if(Do.current.has(F.expressId))continue;const ae=F.positions.length/3,Q=new Float32Array(ae*6);for(let Pe=0;Pe<ae;Pe++){const vn=Pe*6,xn=Pe*3;Q[vn]=F.positions[xn],Q[vn+1]=F.positions[xn+1],Q[vn+2]=F.positions[xn+2],Q[vn+3]=F.normals[xn],Q[vn+4]=F.normals[xn+1],Q[vn+5]=F.normals[xn+2]}const Jt=$t.createBuffer({size:Q.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});$t.queue.writeBuffer(Jt,0,Q);const en=$t.createBuffer({size:F.indices.byteLength,usage:GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST});$t.queue.writeBuffer(en,0,F.indices),yn.addMesh({expressId:F.expressId,vertexBuffer:Jt,indexBuffer:en,indexCount:F.indices.length,transform:wr.identity(),color:F.color}),Do.current.add(F.expressId)}if(dr.current=hr,!fr.current&&t?.shiftedBounds){const F=t.shiftedBounds,ae=Math.max(F.max.x-F.min.x,F.max.y-F.min.y,F.max.z-F.min.z);ae>0&&Number.isFinite(ae)&&(L.getCamera().fitToBounds(F.min,F.max),K.current={min:{...F.min},max:{...F.max}},fr.current=!0)}else if(!fr.current&&e.length>0){const F={min:{x:1/0,y:1/0,z:1/0},max:{x:-1/0,y:-1/0,z:-1/0}};for(const ae of e)for(let Q=0;Q<ae.positions.length;Q+=3){const Jt=ae.positions[Q],en=ae.positions[Q+1],Pe=ae.positions[Q+2];Number.isFinite(Jt)&&Number.isFinite(en)&&Number.isFinite(Pe)&&(F.min.x=Math.min(F.min.x,Jt),F.min.y=Math.min(F.min.y,en),F.min.z=Math.min(F.min.z,Pe),F.max.x=Math.max(F.max.x,Jt),F.max.y=Math.max(F.max.y,en),F.max.z=Math.max(F.max.z,Pe))}F.min.x!==1/0&&(L.getCamera().fitToBounds(F.min,F.max),K.current=F,fr.current=!0)}L.render({hiddenIds:J.current,isolatedIds:oe.current,selectedId:de.current,clearColor:j.current})},[e,o,t]);const bf=D(L=>L.selectedEntityIds);return p.useEffect(()=>{const L=r.current;!L||!o||L.render({hiddenIds:l,isolatedIds:c,selectedId:i,selectedIds:bf,clearColor:j.current,sectionPlane:P.enabled?P:void 0})},[l,c,i,bf,o,P]),d.jsx("canvas",{ref:n,className:"w-full h-full block"})}const FM=[{id:"front",label:"FRONT",transform:e=>`translateZ(${e}px)`},{id:"back",label:"BACK",transform:e=>`translateZ(${-e}px) rotateY(180deg)`},{id:"top",label:"TOP",transform:e=>`translateY(${-e}px) rotateX(90deg)`},{id:"bottom",label:"BTM",transform:e=>`translateY(${e}px) rotateX(-90deg)`},{id:"right",label:"RIGHT",transform:e=>`translateX(${e}px) rotateY(90deg)`},{id:"left",label:"LEFT",transform:e=>`translateX(${-e}px) rotateY(-90deg)`}],rw=p.forwardRef(({onViewChange:e,onDrag:t,rotationX:n=-25,rotationY:r=45},o)=>{const[s,i]=p.useState(null),[a,l]=p.useState(!1),c=p.useRef(null),u=p.useRef(!1),f=p.useRef(!1),h=p.useRef(t),y=p.useRef(null),m=p.useRef(null),v=p.useRef(null);p.useEffect(()=>{h.current=t},[t]),p.useImperativeHandle(o,()=>({updateRotation:(S,C)=>{y.current&&(v.current={x:S,y:C},m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{y.current&&v.current&&(y.current.style.transform=`rotateX(${v.current.x}deg) rotateY(${v.current.y}deg)`,v.current=null),m.current=null}))}}),[]),p.useEffect(()=>{y.current&&(y.current.style.transform=`rotateX(${n}deg) rotateY(${r}deg)`)},[]);const b=60,g=b/2,x=p.useCallback(S=>{c.current={x:S.clientX,y:S.clientY},u.current=!1,f.current=!1,l(!0)},[]);p.useEffect(()=>{if(!a){document.body.style.cursor="";return}const S=_=>{if(!c.current)return;const E=_.clientX-c.current.x,I=_.clientY-c.current.y;!f.current&&(Math.abs(E)>5||Math.abs(I)>5)&&(f.current=!0,u.current=!0,document.body.style.cursor="grabbing"),f.current&&(h.current?.(E*2,I*2),c.current={x:_.clientX,y:_.clientY})},C=()=>{l(!1),f.current=!1,c.current=null,document.body.style.cursor="",setTimeout(()=>{u.current=!1},50)};return document.addEventListener("mousemove",S),document.addEventListener("mouseup",C),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",C),document.body.style.cursor=""}},[a]);const w=p.useCallback(S=>{u.current||e?.(S)},[e]);return d.jsx("div",{className:"relative select-none",style:{width:b,height:b,perspective:200},onMouseDown:x,children:d.jsx("div",{ref:y,className:"relative w-full h-full",style:{transformStyle:"preserve-3d",transform:`rotateX(${n}deg) rotateY(${r}deg)`},children:FM.map(({id:S,label:C,transform:_})=>d.jsx("button",{type:"button",className:Se("absolute w-full h-full flex items-center justify-center text-[10px] font-bold transition-colors cursor-pointer","bg-card/95 border border-border/50",s===S?"bg-primary/30 border-primary text-primary":"hover:bg-muted"),style:{transform:_(g),backfaceVisibility:"hidden"},onMouseEnter:()=>i(S),onMouseLeave:()=>i(null),onClick:()=>w(S),children:C},S))})})});rw.displayName="ViewCube";function BM({rotationX:e=-25,rotationY:t=45}){return d.jsx("div",{className:"relative select-none",style:{width:50,height:50,perspective:200},children:d.jsxs("div",{className:"relative w-full h-full",style:{transformStyle:"preserve-3d",transform:`rotateX(${e}deg) rotateY(${t}deg)`},children:[d.jsx("div",{className:"absolute bg-red-500",style:{width:20,height:2,left:50/2,top:50/2-1,transformOrigin:"left center",transform:"rotateY(0deg)"}}),d.jsx("div",{className:"absolute text-red-500 font-bold text-xs",style:{left:50/2+26,top:50/2-6,transform:`rotateY(${-t}deg) rotateX(${-e}deg)`,transformStyle:"preserve-3d"},children:"X"}),d.jsx("div",{className:"absolute bg-blue-500",style:{width:2,height:20,left:50/2-1,top:50/2-20,transformOrigin:"center bottom"}}),d.jsx("div",{className:"absolute text-blue-500 font-bold text-xs",style:{left:50/2-4,top:50/2-26-6,transform:`rotateY(${-t}deg) rotateX(${-e}deg)`,transformStyle:"preserve-3d"},children:"Z"}),d.jsx("div",{className:"absolute bg-green-500",style:{width:20,height:2,left:50/2,top:50/2-1,transformOrigin:"left center",transform:"rotateY(-90deg)"}}),d.jsx("div",{className:"absolute text-green-500 font-bold text-xs",style:{left:50/2-4,top:50/2+6,transform:`translateZ(26px) rotateY(${-t}deg) rotateX(${-e}deg)`,transformStyle:"preserve-3d"},children:"Y"}),d.jsx("div",{className:"absolute w-2 h-2 bg-white rounded-full border border-gray-400",style:{left:50/2-4,top:50/2-4}})]})})}function $M(){const e=D(C=>C.selectedStorey),t=D(C=>C.hiddenEntities),n=D(C=>C.isolatedEntities),r=D(C=>C.cameraCallbacks),o=D(C=>C.setOnCameraRotationChange),s=D(C=>C.setOnScaleChange),{ifcDataStore:i,geometryResult:a}=cr(),l=p.useRef({azimuth:45,elevation:25}),c=p.useRef(null),[u,f]=p.useState(10);p.useEffect(()=>(o(_=>{if(l.current=_,c.current){const E=-_.elevation,I=-_.azimuth;c.current.updateRotation(E,I)}}),()=>o(null)),[o]),p.useEffect(()=>(s(f),()=>s(null)),[s]);const h=e&&i?i.entities.getName(e)||`Storey #${e}`:null,y=a?.meshes?.length??0;n!==null?n.size:t.size>0&&y-t.size;const m=-l.current.elevation,v=-l.current.azimuth,b=p.useCallback(C=>{const E={top:"top",bottom:"bottom",front:"front",back:"back",left:"left",right:"right"}[C];E&&r.setPresetView&&r.setPresetView(E)},[r]),g=p.useCallback(()=>{r.home?.()},[r]);p.useCallback(()=>{r.fitAll?.()},[r]);const x=p.useCallback(()=>{r.zoomIn?.()},[r]),w=p.useCallback(()=>{r.zoomOut?.()},[r]),S=C=>C>=1e3?`${(C/1e3).toFixed(1)}km`:C>=1?`${C.toFixed(1)}m`:C>=.1?`${(C*100).toFixed(0)}cm`:`${(C*1e3).toFixed(0)}mm`;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"absolute bottom-4 right-4 flex flex-col gap-1 bg-background/80 backdrop-blur-sm rounded-lg border shadow-sm p-1",children:[d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:g,children:d.jsx(Lv,{className:"h-4 w-4"})})}),d.jsx(xt,{side:"left",children:"Home (H)"})]}),d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:x,children:d.jsx(YI,{className:"h-4 w-4"})})}),d.jsx(xt,{side:"left",children:"Zoom In (+)"})]}),d.jsxs(Mt,{children:[d.jsx(Nt,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:w,children:d.jsx(XI,{className:"h-4 w-4"})})}),d.jsx(xt,{side:"left",children:"Zoom Out (-)"})]})]}),h&&d.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 px-4 py-2 bg-background/80 backdrop-blur-sm rounded-full border shadow-sm",children:d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx(fl,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"font-medium",children:h})]})}),d.jsx("div",{className:"absolute top-6 right-6",children:d.jsx(rw,{ref:c,onViewChange:b,onDrag:(C,_)=>r.orbit?.(C,_),rotationX:m,rotationY:v})}),d.jsx("div",{className:"absolute bottom-16 left-4",children:d.jsx(BM,{rotationX:m,rotationY:v})}),d.jsxs("div",{className:"absolute bottom-4 left-4 flex flex-col items-start gap-1",children:[d.jsx("div",{className:"h-1 w-24 bg-foreground/80 rounded-full"}),d.jsx("span",{className:"text-xs text-foreground/80",children:S(u)})]})]})}function VM(){const e=D(t=>t.activeTool);return e==="measure"?d.jsx(UM,{}):e==="section"?d.jsx(GM,{}):null}function UM(){const e=D(c=>c.measurements),t=D(c=>c.pendingMeasurePoint),n=D(c=>c.deleteMeasurement),r=D(c=>c.clearMeasurements),o=D(c=>c.setActiveTool),s=p.useCallback(()=>{r()},[r]),i=p.useCallback(()=>{o("select")},[o]),a=p.useCallback(c=>{n(c)},[n]),l=e.reduce((c,u)=>c+u.distance,0);return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 bg-background/95 backdrop-blur-sm rounded-lg border shadow-lg p-3 min-w-64 z-30",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4 mb-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Dv,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"font-medium text-sm",children:"Measure Tool"})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:s,title:"Clear all",children:d.jsx(VI,{className:"h-4 w-4"})}),d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:i,title:"Close",children:d.jsx(hl,{className:"h-4 w-4"})})]})]}),d.jsx("div",{className:"text-xs text-muted-foreground mb-3",children:"Click on the model to place measurement points"}),e.length>0?d.jsxs("div",{className:"space-y-2",children:[e.map((c,u)=>d.jsx(WM,{measurement:c,index:u,onDelete:a},c.id)),e.length>1&&d.jsxs("div",{className:"flex items-center justify-between border-t pt-2 mt-2 text-sm font-medium",children:[d.jsx("span",{children:"Total"}),d.jsx("span",{className:"font-mono",children:wf(l)})]})]}):d.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:"No measurements yet"})]}),d.jsx("div",{className:"absolute bottom-20 left-1/2 -translate-x-1/2 bg-primary text-primary-foreground px-4 py-2 rounded-full text-sm shadow-lg z-30",children:t?"Click to set end point":"Click on model to set start point"}),d.jsx(HM,{measurements:e,pending:t})]})}function WM({measurement:e,index:t,onDelete:n}){return d.jsxs("div",{className:"flex items-center justify-between bg-muted/50 rounded px-2 py-1 text-sm",children:[d.jsxs("span",{className:"text-muted-foreground",children:["#",t+1]}),d.jsx("span",{className:"font-mono",children:wf(e.distance)}),d.jsx(ke,{variant:"ghost",size:"icon-sm",className:"h-5 w-5",onClick:()=>n(e.id),children:d.jsx(hl,{className:"h-3 w-3"})})]})}function HM({measurements:e,pending:t}){return d.jsxs(d.Fragment,{children:[e.map(n=>d.jsxs("div",{children:[d.jsxs("svg",{className:"absolute inset-0 pointer-events-none z-20",style:{overflow:"visible"},children:[d.jsx("line",{x1:n.start.screenX,y1:n.start.screenY,x2:n.end.screenX,y2:n.end.screenY,stroke:"hsl(var(--primary))",strokeWidth:"2",strokeDasharray:"5,5"}),d.jsx("circle",{cx:n.start.screenX,cy:n.start.screenY,r:"4",fill:"hsl(var(--primary))"}),d.jsx("circle",{cx:n.end.screenX,cy:n.end.screenY,r:"4",fill:"hsl(var(--primary))"})]}),d.jsx("div",{className:"absolute pointer-events-none z-20 bg-primary text-primary-foreground px-2 py-0.5 rounded text-xs font-mono -translate-x-1/2 -translate-y-1/2",style:{left:(n.start.screenX+n.end.screenX)/2,top:(n.start.screenY+n.end.screenY)/2},children:wf(n.distance)})]},n.id)),t&&d.jsxs("svg",{className:"absolute inset-0 pointer-events-none z-20",style:{overflow:"visible"},children:[d.jsx("circle",{cx:t.screenX,cy:t.screenY,r:"6",fill:"none",stroke:"hsl(var(--primary))",strokeWidth:"2"}),d.jsx("circle",{cx:t.screenX,cy:t.screenY,r:"3",fill:"hsl(var(--primary))"})]})]})}function GM(){const e=D(c=>c.sectionPlane),t=D(c=>c.setSectionPlaneAxis),n=D(c=>c.setSectionPlanePosition),r=D(c=>c.toggleSectionPlane),o=D(c=>c.flipSectionPlane),s=D(c=>c.setActiveTool),i=p.useCallback(()=>{s("select")},[s]),a=p.useCallback(c=>{t(c)},[t]),l=p.useCallback(c=>{n(Number(c.target.value))},[n]);return d.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 bg-background/95 backdrop-blur-sm rounded-lg border shadow-lg p-3 min-w-72 z-30",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4 mb-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(jI,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"font-medium text-sm",children:"Section Plane"})]}),d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:i,title:"Close",children:d.jsx(hl,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-muted-foreground mb-2 block",children:"Axis"}),d.jsx("div",{className:"flex gap-1",children:["x","y","z"].map(c=>d.jsx(ke,{variant:e.axis===c?"default":"outline",size:"sm",className:"flex-1",onClick:()=>a(c),children:c.toUpperCase()},c))})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("label",{className:"text-xs text-muted-foreground",children:"Position"}),d.jsxs("span",{className:"text-xs font-mono",children:[e.position,"%"]})]}),d.jsx("input",{type:"range",min:"0",max:"100",value:e.position,onChange:l,className:"w-full h-2 bg-muted rounded-lg appearance-none cursor-pointer accent-primary"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(ke,{variant:e.enabled?"default":"outline",size:"sm",className:"flex-1",onClick:r,children:e.enabled?"Disable":"Enable"}),d.jsx(ke,{variant:"outline",size:"sm",className:"flex-1",onClick:o,children:"Flip"})]}),d.jsx("div",{className:"text-xs text-muted-foreground text-center",children:"Section plane cuts the model along the selected axis"})]})]})}function wf(e){return e<.01?`${(e*1e3).toFixed(1)} mm`:e<1?`${(e*100).toFixed(1)} cm`:e<1e3?`${e.toFixed(2)} m`:`${(e/1e3).toFixed(2)} km`}function im(){const{geometryResult:e,ifcDataStore:t}=cr(),n=D(o=>o.selectedStorey),r=p.useMemo(()=>{if(!e?.meshes||!t?.spatialHierarchy)return e?.meshes||null;if(n===null)return e.meshes;const s=t.spatialHierarchy.byStorey.get(n);if(!s||s.length===0)return e.meshes;const i=new Set(s);return e.meshes.filter(a=>i.has(a.expressId))},[e,t,n]);return d.jsxs("div",{className:"relative h-full w-full bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-900 dark:to-slate-800",children:[d.jsx(DM,{geometry:r,coordinateInfo:e?.coordinateInfo}),d.jsx($M,{}),d.jsx(VM,{})]})}function YM(e={}){const{enabled:t=!0}=e,n=D(u=>u.selectedEntityId),r=D(u=>u.setSelectedEntityId),o=D(u=>u.setActiveTool),s=D(u=>u.isolateEntity),i=D(u=>u.hideEntity),a=D(u=>u.showAll),l=D(u=>u.toggleTheme),c=p.useCallback(u=>{const f=u.target;if(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable)return;const h=u.ctrlKey||u.metaKey,y=u.shiftKey,m=u.key.toLowerCase();m==="v"&&!h&&!y&&(u.preventDefault(),o("select")),m==="p"&&!h&&!y&&(u.preventDefault(),o("pan")),m==="o"&&!h&&!y&&(u.preventDefault(),o("orbit")),m==="c"&&!h&&!y&&(u.preventDefault(),o("walk")),m==="m"&&!h&&!y&&(u.preventDefault(),o("measure")),m==="x"&&!h&&!y&&(u.preventDefault(),o("section")),m==="b"&&!h&&!y&&(u.preventDefault(),o("boxselect")),m==="i"&&!h&&!y&&n&&(u.preventDefault(),s(n)),(m==="delete"||m==="backspace")&&!h&&!y&&n&&(u.preventDefault(),i(n)),m==="a"&&!h&&!y&&(u.preventDefault(),a()),m==="escape"&&(u.preventDefault(),r(null),a(),o("select")),m==="t"&&!h&&!y&&(u.preventDefault(),l())},[n,r,o,s,i,a,l]);p.useEffect(()=>{if(t)return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[t,c])}const qM=[{key:"V",description:"Select tool",category:"Tools"},{key:"B",description:"Box select tool",category:"Tools"},{key:"P",description:"Pan tool",category:"Tools"},{key:"O",description:"Orbit tool",category:"Tools"},{key:"C",description:"Walk mode",category:"Tools"},{key:"M",description:"Measure tool",category:"Tools"},{key:"X",description:"Section tool",category:"Tools"},{key:"I",description:"Isolate selection",category:"Visibility"},{key:"Del",description:"Hide selection",category:"Visibility"},{key:"A",description:"Show all",category:"Visibility"},{key:"H",description:"Home (Isometric view)",category:"Camera"},{key:"Z",description:"Fit all (zoom extents)",category:"Camera"},{key:"F",description:"Frame selection",category:"Camera"},{key:"0-6",description:"Preset views",category:"Camera"},{key:"T",description:"Toggle theme",category:"UI"},{key:"Esc",description:"Clear selection & switch to Select tool",category:"Selection"},{key:"?",description:"Show keyboard shortcuts",category:"Help"}];function XM({open:e,onClose:t}){if(p.useEffect(()=>{const r=o=>{o.key==="Escape"&&e&&t()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,t]),!e)return null;const n=qM.reduce((r,o)=>(r[o.category]||(r[o.category]=[]),r[o.category].push(o),r),{});return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:d.jsxs("div",{className:"bg-card border rounded-lg shadow-xl w-full max-w-md m-4",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[d.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard Shortcuts"}),d.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:t,children:d.jsx(hl,{className:"h-4 w-4"})})]}),d.jsx("div",{className:"p-4 max-h-96 overflow-y-auto",children:Object.entries(n).map(([r,o])=>d.jsxs("div",{className:"mb-4 last:mb-0",children:[d.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:r}),d.jsx("div",{className:"space-y-1",children:o.map(s=>d.jsxs("div",{className:"flex items-center justify-between py-1",children:[d.jsx("span",{className:"text-sm",children:s.description}),d.jsx("kbd",{className:"px-2 py-0.5 text-xs bg-muted rounded border font-mono",children:s.key})]},s.key+s.description))})]},r))}),d.jsx("div",{className:"p-4 border-t text-center",children:d.jsxs("span",{className:"text-xs text-muted-foreground",children:["Press ",d.jsx("kbd",{className:"px-1 py-0.5 bg-muted rounded border font-mono text-xs",children:"?"})," to toggle this dialog"]})})]})})}function QM(){const[e,t]=p.useState(!1),n=p.useCallback(()=>t(o=>!o),[]),r=p.useCallback(()=>t(!1),[]);return p.useEffect(()=>{const o=s=>{(s.key==="?"||s.key==="/"&&s.shiftKey)&&(s.preventDefault(),n())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),{open:e,toggle:n,close:r}}function KM(){const e=D(w=>w.contextMenu),t=D(w=>w.closeContextMenu),n=D(w=>w.isolateEntity),r=D(w=>w.hideEntity),o=D(w=>w.showAll),s=D(w=>w.setSelectedEntityId),i=D(w=>w.setSelectedEntityIds),a=D(w=>w.cameraCallbacks),l=p.useRef(null),{ifcDataStore:c}=cr();p.useEffect(()=>{const w=S=>{l.current&&!l.current.contains(S.target)&&t()};if(e.isOpen)return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[e.isOpen,t]),p.useEffect(()=>{const w=S=>{S.key==="Escape"&&t()};if(e.isOpen)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[e.isOpen,t]);const u=p.useCallback(()=>{e.entityId&&(s(e.entityId),a.fitAll?.()),t()},[e.entityId,s,a,t]),f=p.useCallback(()=>{e.entityId&&n(e.entityId),t()},[e.entityId,n,t]),h=p.useCallback(()=>{e.entityId&&r(e.entityId),t()},[e.entityId,r,t]),y=p.useCallback(()=>{o(),t()},[o,t]),m=p.useCallback(()=>{if(!e.entityId||!c){t();return}const w=c.entities;let S=null;for(let C=0;C<w.count;C++)if(w.expressId[C]===e.entityId){S=w.getTypeName(e.entityId);break}if(S){const C=[];for(let _=0;_<w.count;_++)w.getTypeName(w.expressId[_])===S&&C.push(w.expressId[_]);i(C)}t()},[e.entityId,c,i,t]),v=p.useCallback(()=>{if(!e.entityId||!c?.spatialHierarchy){t();return}const w=c.spatialHierarchy.elementToStorey.get(e.entityId);if(w){const S=c.spatialHierarchy.byStorey.get(w);S&&i(Array.from(S))}t()},[e.entityId,c,i,t]),b=p.useCallback(()=>{if(e.entityId&&c){const w=c.entities.getGlobalId(e.entityId);w&&navigator.clipboard.writeText(w)}t()},[e.entityId,c,t]);if(!e.isOpen)return null;let g="",x="";return e.entityId&&c&&(g=c.entities.getName(e.entityId)||"",x=c.entities.getTypeName(e.entityId)||""),d.jsxs("div",{ref:l,className:"fixed z-50 bg-popover border rounded-lg shadow-lg py-1 min-w-48",style:{left:e.screenX,top:e.screenY},children:[e.entityId&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"px-3 py-2 border-b",children:[d.jsx("div",{className:"font-medium text-sm truncate",children:g||`${x} #${e.entityId}`}),d.jsx("div",{className:"text-xs text-muted-foreground",children:x})]}),d.jsx(gr,{icon:Ov,label:"Zoom to",onClick:u}),d.jsx(gr,{icon:za,label:"Isolate",onClick:f}),d.jsx(gr,{icon:ul,label:"Hide",onClick:h}),d.jsx("div",{className:"h-px bg-border my-1"}),d.jsx(gr,{icon:fl,label:`Select all ${x}`,onClick:m}),d.jsx(gr,{icon:Jd,label:"Select same storey",onClick:v}),d.jsx("div",{className:"h-px bg-border my-1"}),d.jsx(gr,{icon:jv,label:"Copy GlobalId",onClick:b})]}),!e.entityId&&d.jsx(d.Fragment,{children:d.jsx(gr,{icon:dl,label:"Show all",onClick:y})})]})}function gr({icon:e,label:t,onClick:n,disabled:r}){return d.jsxs("button",{className:"w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed",onClick:n,disabled:r,children:[d.jsx(e,{className:"h-4 w-4 text-muted-foreground"}),d.jsx("span",{children:t})]})}const ZM={IfcWall:"🧱",IfcWallStandardCase:"🧱",IfcDoor:"🚪",IfcWindow:"🪟",IfcSlab:"⬜",IfcColumn:"🏛️",IfcBeam:"➖",IfcStair:"🪜",IfcRailing:"🚧",IfcRoof:"🏠",IfcSpace:"📦",IfcBuildingStorey:"🏢",IfcBuilding:"🏗️",IfcSite:"📍",IfcProject:"📁",IfcFurnishingElement:"🪑",IfcFlowSegment:"〰️",IfcFlowTerminal:"⚡",IfcCurtainWall:"🔲"};function JM(){const e=D(s=>s.hoverState),t=D(s=>s.hoverTooltipsEnabled),{ifcDataStore:n}=cr(),r=p.useMemo(()=>{if(!e.entityId||!n)return null;const s=n.entities.getName(e.entityId),i=n.entities.getTypeName(e.entityId);return{name:s,type:i}},[e.entityId,n]);if(!t||!e.entityId||!r)return null;const o=ZM[r.type]||"📄";return d.jsxs("div",{className:"fixed z-40 px-3 py-2 bg-popover text-popover-foreground rounded-md shadow-lg border pointer-events-none",style:{left:e.screenX+16,top:e.screenY+16},children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-base",children:o}),d.jsx("span",{className:"font-medium text-sm",children:r.name||r.type})]}),r.name&&d.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:r.type}),d.jsxs("div",{className:"text-xs text-muted-foreground",children:["#",e.entityId]})]})}function eN(){const e=D(s=>s.boxSelect);if(!e.isSelecting)return null;const t=Math.min(e.startX,e.currentX),n=Math.min(e.startY,e.currentY),r=Math.abs(e.currentX-e.startX),o=Math.abs(e.currentY-e.startY);return r<5&&o<5?null:d.jsxs("div",{className:"fixed pointer-events-none border-2 border-primary bg-primary/10 z-30",style:{left:t,top:n,width:r,height:o},children:[d.jsx("div",{className:"absolute -left-1 -top-1 w-2 h-2 bg-primary rounded-full"}),d.jsx("div",{className:"absolute -right-1 -top-1 w-2 h-2 bg-primary rounded-full"}),d.jsx("div",{className:"absolute -left-1 -bottom-1 w-2 h-2 bg-primary rounded-full"}),d.jsx("div",{className:"absolute -right-1 -bottom-1 w-2 h-2 bg-primary rounded-full"}),(r>50||o>30)&&d.jsxs("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs bg-primary text-primary-foreground px-2 py-0.5 rounded whitespace-nowrap",children:[Math.round(r)," x ",Math.round(o)]})]})}function tN(){YM();const e=QM(),t=D(l=>l.theme),n=D(l=>l.isMobile),r=D(l=>l.setIsMobile),o=D(l=>l.leftPanelCollapsed),s=D(l=>l.rightPanelCollapsed),i=D(l=>l.setLeftPanelCollapsed),a=D(l=>l.setRightPanelCollapsed);return p.useEffect(()=>{const l=()=>{const c=window.innerWidth<768;r(c),c&&(i(!0),a(!0))};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[r,i,a]),p.useEffect(()=>{document.documentElement.classList.toggle("dark",t==="dark")},[t]),d.jsx(m2,{delayDuration:300,children:d.jsxs("div",{className:"flex flex-col h-screen w-screen overflow-hidden bg-background text-foreground",children:[d.jsx(XM,{open:e.open,onClose:e.close}),d.jsx(KM,{}),d.jsx(JM,{}),d.jsx(eN,{}),d.jsx(YP,{onShowShortcuts:e.toggle}),!n&&d.jsxs(zy,{orientation:"horizontal",className:"flex-1 min-h-0",children:[d.jsx(Qi,{id:"left-panel",defaultSize:20,minSize:10,collapsible:!0,collapsedSize:0,children:d.jsx("div",{className:"h-full w-full overflow-hidden",children:d.jsx(rm,{})})}),d.jsx(bu,{className:"w-1.5 bg-border hover:bg-primary/50 active:bg-primary/70 transition-colors cursor-col-resize"}),d.jsx(Qi,{id:"viewport-panel",defaultSize:60,minSize:30,children:d.jsx("div",{className:"h-full w-full overflow-hidden",children:d.jsx(im,{})})}),d.jsx(bu,{className:"w-1.5 bg-border hover:bg-primary/50 active:bg-primary/70 transition-colors cursor-col-resize"}),d.jsx(Qi,{id:"right-panel",defaultSize:20,minSize:10,collapsible:!0,collapsedSize:0,children:d.jsx("div",{className:"h-full w-full overflow-hidden",children:d.jsx(sm,{})})})]}),n&&d.jsxs("div",{className:"flex-1 min-h-0 relative",children:[d.jsx("div",{className:"h-full w-full",children:d.jsx(im,{})}),!o&&d.jsxs("div",{className:"absolute inset-x-0 bottom-0 h-[50vh] bg-background border-t rounded-t-xl shadow-xl z-40 animate-in slide-in-from-bottom",children:[d.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[d.jsx("span",{className:"font-medium text-sm",children:"Hierarchy"}),d.jsxs("button",{className:"p-1 hover:bg-muted rounded",onClick:()=>i(!0),children:[d.jsx("span",{className:"sr-only",children:"Close"}),d.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]})]}),d.jsx("div",{className:"h-[calc(50vh-48px)] overflow-auto",children:d.jsx(rm,{})})]}),!s&&d.jsxs("div",{className:"absolute inset-x-0 bottom-0 h-[50vh] bg-background border-t rounded-t-xl shadow-xl z-40 animate-in slide-in-from-bottom",children:[d.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[d.jsx("span",{className:"font-medium text-sm",children:"Properties"}),d.jsxs("button",{className:"p-1 hover:bg-muted rounded",onClick:()=>a(!0),children:[d.jsx("span",{className:"sr-only",children:"Close"}),d.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]})]}),d.jsx("div",{className:"h-[calc(50vh-48px)] overflow-auto",children:d.jsx(sm,{})})]}),d.jsxs("div",{className:"absolute bottom-4 left-4 right-4 flex justify-center gap-2 z-30",children:[d.jsx("button",{className:"px-4 py-2 bg-primary text-primary-foreground rounded-full shadow-lg text-sm font-medium",onClick:()=>{a(!0),i(!o)},children:"Hierarchy"}),d.jsx("button",{className:"px-4 py-2 bg-primary text-primary-foreground rounded-full shadow-lg text-sm font-medium",onClick:()=>{i(!0),a(!s)},children:"Properties"})]})]}),d.jsx(MM,{})]})})}function nN(){return d.jsx(tN,{})}kc.createRoot(document.getElementById("root")).render(d.jsx(rn.StrictMode,{children:d.jsx(nN,{})}));