@fleox/agent3d 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -10
- package/changelog.json +9 -0
- package/dist/agent/agent3d.mjs +2 -2
- package/dist/agent/chunks/{package-DzXqX5Oe.mjs → package-Bn7PKfXn.mjs} +1 -1
- package/dist/runtime/agent3d-runtime.js +1 -1
- package/dist/runtime/agent3d-runtime.single.js +1 -1
- package/dist/studio/assets/{assets-DnOt59SU.js → assets-DICv7P37.js} +1 -1
- package/dist/studio/assets/{camera-DrubOxWu.js → camera-HsMeC1mn.js} +1 -1
- package/dist/studio/assets/{editor-V--luWVq.js → editor-BZLIZJC8.js} +1 -1
- package/dist/studio/assets/{game-43BhY_EE.js → game-DnnuBk26.js} +1 -1
- package/dist/studio/assets/{generators-lG93qWTO.js → generators-C4n9MsXd.js} +1 -1
- package/dist/studio/assets/{index-BPVRhKVV.js → index-cDbmaVDl.js} +4 -4
- package/dist/studio/assets/{model-D8-inS_D.js → model-CkPfLOl0.js} +1 -1
- package/dist/studio/assets/{photo-BuVK-UvQ.js → photo-CPGGCRa-.js} +1 -1
- package/dist/studio/assets/{postfx-Bcnem9ci.js → postfx-Dp7mgfGJ.js} +1 -1
- package/dist/studio/assets/{runtime-5Ti8UJJR.js → runtime-ByR4qfyV.js} +4 -4
- package/dist/studio/assets/{shaders-WM5brr9C.js → shaders-DoRMwJE_.js} +1 -1
- package/dist/studio/assets/{svg-CJ_RtiER.js → svg-n3rkKAm5.js} +1 -1
- package/dist/studio/assets/{text-NO7lyCoH.js → text-BkPPDghK.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/agent3d-assets/SKILL.md +28 -28
- package/plugin/skills/agent3d-create/SKILL.md +30 -30
- package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
- package/plugin/skills/agent3d-create/references/recipes.md +6 -6
- package/plugin/skills/agent3d-edit/SKILL.md +22 -22
- package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
- package/plugin/skills/agent3d-game/SKILL.md +7 -7
- package/plugin/skills/agent3d-publish/SKILL.md +23 -23
- package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./runtime-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./runtime-ByR4qfyV.js","./rolldown-runtime-4tVxZq34.js","./three.module-B9FlcKtd.js","./catalog-DDg904x2.js","./camera-HsMeC1mn.js","./num-CQNAlL82.js","./assets-DICv7P37.js","./params-BZqUA__U.js","./editor-BZLIZJC8.js","./OrbitControls-1xEm394I.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{t as e}from"./rolldown-runtime-4tVxZq34.js";import{_ as t,a as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _,v,y}from"./catalog-DDg904x2.js";import{Kt as b,Ln as x,N as S,bt as C}from"./three.module-B9FlcKtd.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var w=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return te(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function D(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?D(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function oe(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=oe(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function se(e,t,n){if(e==null)return e;var r=[],i=0;return oe(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var le=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ue(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,le)}catch(e){le(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function de(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ue(de.bind(null,e))}var fe={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=fe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=de,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return te(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ne,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ue,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),T=e(((e,t)=>{t.exports=w()})),ee=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function te(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(te)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,D=ne.port2;ne.port1.onmessage=te,E=function(){D.postMessage(null)}}else E=function(){_(te,0)};function re(t,n){C=_(function(){t(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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),te=e(((e,t)=>{t.exports=ee()})),E=e((e=>{var t=T();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),ne=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=E()})),D=e((e=>{var t=te(),n=T(),r=ne();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function x(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function S(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function C(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var w=Object.assign,ee=Symbol.for(`react.element`),E=Symbol.for(`react.transitional.element`),D=Symbol.for(`react.portal`),re=Symbol.for(`react.fragment`),ie=Symbol.for(`react.strict_mode`),ae=Symbol.for(`react.profiler`),oe=Symbol.for(`react.consumer`),se=Symbol.for(`react.context`),ce=Symbol.for(`react.forward_ref`),le=Symbol.for(`react.suspense`),ue=Symbol.for(`react.suspense_list`),de=Symbol.for(`react.memo`),fe=Symbol.for(`react.lazy`),pe=Symbol.for(`react.activity`),O=Symbol.for(`react.legacy_hidden`),me=Symbol.for(`react.memo_cache_sentinel`),he=Symbol.for(`react.view_transition`),ge=Symbol.for(`react.recoverable`),k=Symbol.iterator;function _e(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var ve=Symbol.for(`react.client.reference`);function ye(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case re:return`Fragment`;case ae:return`Profiler`;case ie:return`StrictMode`;case le:return`Suspense`;case ue:return`SuspenseList`;case pe:return`Activity`;case he:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case D:return`Portal`;case se:return e.displayName||`Context`;case oe:return(e._context.displayName||`Context`)+`.Consumer`;case ce:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case de:return t=e.displayName||null,t===null?ye(e.type)||`Memo`:t;case fe:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var be=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Se=[],Ce=-1;function we(e){return{current:e}}function Te(e){0>Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function Ee(e,t){Ce++,Se[Ce]=e.current,e.current=t}var De=we(null),Oe=we(null),ke=we(null),Ae=we(null);function je(e,t){switch(Ee(ke,t),Ee(Oe,e),Ee(De,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Sp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Sp(t),e=Cp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Te(De),Ee(De,e)}function Me(){Te(De),Te(Oe),Te(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(vh._currentValue=t.memoizedState,Ee(Ae,e)),t=De.current;var n=Cp(t,e.type);t!==n&&(Ee(Oe,e),Ee(De,n))}function Pe(e){Oe.current===e&&(Te(De),Te(Oe)),Ae.current===e&&(Te(Ae),vh._currentValue=xe)}var Fe,Ie;function Le(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Fe+e+Ie}var Re=!1;function ze(e,t){if(!e||Re)return``;Re=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -7,7 +7,7 @@ import{t as e}from"./rolldown-runtime-4tVxZq34.js";import{_ as t,a as n,c as r,d
|
|
|
7
7
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Le(n):``}function Be(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le(`Lazy`);case 13:return e.child!==t&&t!==null?Le(`Suspense Fallback`):Le(`Suspense`);case 19:return Le(`SuspenseList`);case 0:case 15:return ze(e.type,!1);case 11:return ze(e.type.render,!1);case 1:return ze(e.type,!0);case 31:return Le(`Activity`);case 30:return Le(`ViewTransition`);default:return``}}function Ve(e){try{var t=``,n=null;do t+=Be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
8
|
Error generating stack: `+e.message+`
|
|
9
9
|
`+e.stack}}var He=Object.prototype.hasOwnProperty,Ue=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Ke=t.unstable_requestPaint,qe=t.unstable_now,Je=t.unstable_getCurrentPriorityLevel,Ye=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,Qe=t.unstable_LowPriority,$e=t.unstable_IdlePriority,et=t.log,tt=t.unstable_setDisableYieldValue,nt=null,rt=null;function it(e){if(typeof et==`function`&&tt(e),rt&&typeof rt.setStrictMode==`function`)try{rt.setStrictMode(nt,e)}catch{}}var at=Math.clz32?Math.clz32:ct,ot=Math.log,st=Math.LN2;function ct(e){return e>>>=0,e===0?32:31-(ot(e)/st|0)|0}var lt=256,ut=262144,dt=4194304;function ft(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function pt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ft(n))):i=ft(o):i=ft(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ft(n))):i=ft(o)):i=ft(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function mt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ht(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-at(n),i=1<<r;t|=e[r],n&=~i}return t}function gt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var e=dt;return dt<<=1,!(dt&62914560)&&(dt=4194304),e}function vt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-at(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&xt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function xt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-at(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function St(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ct(e,t){var n=t&-t;return n=n&42?1:wt(n),(n&(e.suspendedLanes|t))===0?n:0}function wt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Et(){var e=j.p;return e===0?(e=window.event,e===void 0?32:Ph(e.type)):e}function Dt(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var Ot=Math.random().toString(36).slice(2),kt=`__reactFiber$`+Ot,At=`__reactProps$`+Ot,jt=`__reactContainer$`+Ot,Mt=`__reactEvents$`+Ot,Nt=`__reactListeners$`+Ot,Pt=`__reactHandles$`+Ot,Ft=`__reactResources$`+Ot,It=`__reactMarker$`+Ot,Lt=`__reactLoad$`+Ot;function Rt(e){delete e[kt],delete e[At],delete e[Nt],delete e[Pt]}function zt(e){var t;if(t=e[kt])return t;for(var n=e.parentNode;n;){if(t=n[jt]||n[kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wm(e);e!==null;){if(n=e[kt])return n;e=wm(e)}return t}e=n,n=e.parentNode}return null}function Bt(e){if(e=e[kt]||e[jt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ht(e){var t=e[Ft];return t||=e[Ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ut(e){e[It]=!0}function Wt(e){e[Lt]=void 0}var Gt=new Set,Kt={};function qt(e,t){Jt(e,t),Jt(e+`Capture`,t)}function Jt(e,t){for(Kt[e]=t,e=0;e<t.length;e++)Gt.add(t[e])}var Yt=RegExp(`^[: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]*$`),Xt={},Zt={};function Qt(e){return He.call(Zt,e)?!0:He.call(Xt,e)?!1:Yt.test(e)?Zt[e]=!0:(Xt[e]=!0,!1)}var $t=!1;function en(){var e=$t;return $t=!1,e}function tn(e,t,n){if(Qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function nn(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function rn(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function an(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function on(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function sn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cn(e){if(!e._valueTracker){var t=on(e)?`checked`:`value`;e._valueTracker=sn(e,t,``+e[t])}}function ln(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=on(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var un=/[\n"\\]/g;function dn(e){return e.replace(un,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function fn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+an(t)):e.value!==``+an(t)&&(e.value=``+an(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):mn(e,an(n)):o===`number`&&e.value==t?mn(e,an(e.value)):mn(e,an(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+an(s):e.removeAttribute(`name`)}function pn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){cn(e);return}n=n==null?``:``+an(n),t=t==null?n:``+an(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),cn(e)}function mn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function hn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+an(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function gn(e,t,n){t!=null&&(t=``+an(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+an(n)}function _n(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(be(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=an(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),cn(e)}function vn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function bn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||yn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function xn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,$t=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(bn(e,a,r),$t=!0)}else for(var o in t)t.hasOwnProperty(o)&&bn(e,o,t[o])}function Sn(e){if(e.indexOf(`-`)===-1)return!1;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 Cn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),wn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Tn(e){return wn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function En(){}var Dn=null;function On(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kn=null,An=null;function jn(e){var t=Bt(e);if(t&&(e=t.stateNode)){var n=e[At]||null;a:switch(e=t.stateNode,t.type){case`input`:if(fn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+dn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[At]||null;if(!a)throw Error(i(90));fn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&ln(r)}break a;case`textarea`:gn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&hn(e,!!n.multiple,t,!1)}}}var Mn=!1;function Nn(e,t,n){if(Mn)return e(t,n);Mn=!0;try{return e(t)}finally{if(Mn=!1,(kn!==null||An!==null)&&(Yd(),kn&&(t=kn,e=An,An=kn=null,jn(t),e)))for(t=0;t<e.length;t++)jn(e[t])}}function Pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[At]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Fn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,In=!1;if(Fn)try{var Ln={};Object.defineProperty(Ln,"passive",{get:function(){In=!0}}),window.addEventListener(`test`,Ln,Ln),window.removeEventListener(`test`,Ln,Ln)}catch{In=!1}var Rn=null,zn=null,Bn=null;function Vn(){if(Bn)return Bn;var e,t=zn,n=t.length,r,i=`value`in Rn?Rn.value:Rn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Bn=i.slice(e,1<r?1-r:void 0)}function Hn(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 Un(){return!0}function Wn(){return!1}function Gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Un:Wn,this.isPropagationStopped=Wn,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Un)},persist:function(){},isPersistent:Un}),t}var Kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qn=Gn(Kn),Jn=w({},Kn,{view:0,detail:0}),Yn=Gn(Jn),Xn,Zn,Qn,$n=w({},Jn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ur,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!==Qn&&(Qn&&e.type===`mousemove`?(Xn=e.screenX-Qn.screenX,Zn=e.screenY-Qn.screenY):Zn=Xn=0,Qn=e),Xn)},movementY:function(e){return`movementY`in e?e.movementY:Zn}}),er=Gn($n),tr=Gn(w({},$n,{dataTransfer:0})),nr=Gn(w({},Jn,{relatedTarget:0})),rr=Gn(w({},Kn,{animationName:0,elapsedTime:0,pseudoElement:0})),ir=Gn(w({},Kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),ar=Gn(w({},Kn,{data:0})),or={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},sr={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`},cr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function lr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cr[e])?!!t[e]:!1}function ur(){return lr}var dr=Gn(w({},Jn,{key:function(e){if(e.key){var t=or[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Hn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?sr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ur,charCode:function(e){return e.type===`keypress`?Hn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Hn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),fr=Gn(w({},$n,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),pr=Gn(w({},Kn,{submitter:0})),mr=Gn(w({},Jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ur})),hr=Gn(w({},Kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),gr=Gn(w({},$n,{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})),_r=Gn(w({},Kn,{newState:0,oldState:0,source:0})),vr=[9,13,27,32],yr=Fn&&`CompositionEvent`in window,br=null;Fn&&`documentMode`in document&&(br=document.documentMode);var xr=Fn&&`TextEvent`in window&&!br,Sr=Fn&&(!yr||br&&8<br&&11>=br),Cr=` `,wr=!1;function Tr(e,t){switch(e){case`keyup`:return vr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Dr=!1;function Or(e,t){switch(e){case`compositionend`:return Er(t);case`keypress`:return t.which===32?(wr=!0,Cr):null;case`textInput`:return e=t.data,e===Cr&&wr?null:e;default:return null}}function kr(e,t){if(Dr)return e===`compositionend`||!yr&&Tr(e,t)?(e=Vn(),Bn=zn=Rn=null,Dr=!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 Sr&&t.locale!==`ko`?null:t.data;default:return null}}var Ar={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 jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Ar[e.type]:t===`textarea`}function Mr(e,t,n,r){kn?An?An.push(r):An=[r]:kn=r,t=ap(t,`onChange`),0<t.length&&(n=new qn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Nr=null,Pr=null;function Fr(e){Qf(e,0)}function Ir(e){if(ln(Vt(e)))return e}function Lr(e,t){if(e===`change`)return t}var Rr=!1;if(Fn){var zr;if(Fn){var Br=`oninput`in document;if(!Br){var Vr=document.createElement(`div`);Vr.setAttribute(`oninput`,`return;`),Br=typeof Vr.oninput==`function`}zr=Br}else zr=!1;Rr=zr&&(!document.documentMode||9<document.documentMode)}function Hr(){Nr&&(Nr.detachEvent(`onpropertychange`,Ur),Pr=Nr=null)}function Ur(e){if(e.propertyName===`value`&&Ir(Pr)){var t=[];Mr(t,Pr,e,On(e)),Nn(Fr,t)}}function Wr(e,t,n){e===`focusin`?(Hr(),Nr=t,Pr=n,Nr.attachEvent(`onpropertychange`,Ur)):e===`focusout`&&Hr()}function Gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ir(Pr)}function Kr(e,t){if(e===`click`)return Ir(t)}function qr(e,t){if(e===`input`||e===`change`)return Ir(t)}function Jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Yr=typeof Object.is==`function`?Object.is:Jr;function Xr(e,t){if(Yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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 i=n[r];if(!He.call(t,i)||!Yr(e[i],t[i]))return!1}return!0}function Zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $r(e,t){var n=Qr(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Qr(n)}}function ei(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ei(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ti(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Zr(e.document)}return t}function ni(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`)}var ri=Fn&&`documentMode`in document&&11>=document.documentMode,ii=null,ai=null,oi=null,si=!1;function ci(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;si||ii==null||ii!==Zr(r)||(r=ii,`selectionStart`in r&&ni(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}),oi&&Xr(oi,r)||(oi=r,r=ap(ai,`onSelect`),0<r.length&&(t=new qn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ii)))}function li(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ui={animationend:li(`Animation`,`AnimationEnd`),animationiteration:li(`Animation`,`AnimationIteration`),animationstart:li(`Animation`,`AnimationStart`),transitionrun:li(`Transition`,`TransitionRun`),transitionstart:li(`Transition`,`TransitionStart`),transitioncancel:li(`Transition`,`TransitionCancel`),transitionend:li(`Transition`,`TransitionEnd`)},di={},fi={};Fn&&(fi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ui.animationend.animation,delete ui.animationiteration.animation,delete ui.animationstart.animation),`TransitionEvent`in window||delete ui.transitionend.transition);function pi(e){if(di[e])return di[e];if(!ui[e])return e;var t=ui[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fi)return di[e]=t[n];return e}var mi=pi(`animationend`),hi=pi(`animationiteration`),gi=pi(`animationstart`),_i=pi(`transitionrun`),vi=pi(`transitionstart`),yi=pi(`transitioncancel`),bi=pi(`transitionend`),xi=new Map,Si=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);Si.push(`scrollEnd`);function Ci(e,t){xi.set(e,t),qt(t,[e])}var wi=0;function Ti(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ad.identifierPrefix;var n=wi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Ei(e){if(e==null||typeof e==`string`)return e;var t=null,n=Rd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Di(e,t){return e=Ei(e),t=Ei(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Oi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ki=[],Ai=0,ji=0;function Mi(){for(var e=Ai,t=ji=Ai=0;t<e;){var n=ki[t];ki[t++]=null;var r=ki[t];ki[t++]=null;var i=ki[t];ki[t++]=null;var a=ki[t];if(ki[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ii(n,i,a)}}function Ni(e,t,n,r){ki[Ai++]=e,ki[Ai++]=t,ki[Ai++]=n,ki[Ai++]=r,ji|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Pi(e,t,n,r){return Ni(e,t,n,r),Li(e)}function Fi(e,t){return Ni(e,null,null,t),Li(e)}function Ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-at(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Li(e){if(50<zd)throw zd=0,Bd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ri={};function zi(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.refCleanup=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 Bi(e,t,n,r){return new zi(e,t,n,r)}function Vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hi(e,t){var n=e.alternate;return n===null?(n=Bi(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&1206910976,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.refCleanup=e.refCleanup,n}function Ui(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function M(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Vi(r)&&(s=1);else if(typeof r==`string`)s=ih(e,n,De.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case pe:return e=Bi(31,n,t,a),e.elementType=pe,e.lanes=o,e;case re:return Wi(n.children,a,o,t);case ie:s=8,a|=24;break;case ae:return e=Bi(12,n,t,a|2),e.elementType=ae,e.lanes=o,e;case le:return e=Bi(13,n,t,a),e.elementType=le,e.lanes=o,e;case ue:return e=Bi(19,n,t,a),e.elementType=ue,e.lanes=o,e;case O:case he:return e=a|32,e=Bi(30,n,t,e),e.elementType=he,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case se:s=10;break a;case oe:s=9;break a;case ce:s=11;break a;case de:s=14;break a;case fe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Bi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Wi(e,t,n,r){return e=Bi(7,e,r,t),e.lanes=n,e}function Gi(e,t,n){return e=Bi(6,e,null,t),e.lanes=n,e}function Ki(e){var t=Bi(18,null,null,0);return t.stateNode=e,t}function qi(e,t,n){return t=Bi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ji=new WeakMap;function Yi(e,t){if(typeof e==`object`&&e){var n=Ji.get(e);return n===void 0?(t={value:e,source:t,stack:Ve(t)},Ji.set(e,t),t):n}return{value:e,source:t,stack:Ve(t)}}var Xi=[],Zi=0,Qi=null,N=0,P=[],$i=0,ea=null,ta=1,na=``;function ra(e,t){Xi[Zi++]=N,Xi[Zi++]=Qi,Qi=e,N=t}function ia(e,t,n){P[$i++]=ta,P[$i++]=na,P[$i++]=ea,ea=e;var r=ta;e=na;var i=32-at(r)-1;r&=~(1<<i),n+=1;var a=32-at(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ta=1<<32-at(t)+i|n<<i|r,na=a+e}else ta=1<<a|n<<i|r,na=e}function aa(e){e.return!==null&&(ra(e,1),ia(e,1,0))}function oa(e){for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,N=Xi[--Zi],Xi[Zi]=null;for(;e===ea;)ea=P[--$i],P[$i]=null,na=P[--$i],P[$i]=null,ta=P[--$i],P[$i]=null}function sa(e,t){P[$i++]=ta,P[$i++]=na,P[$i++]=ea,ta=t.id,na=t.overflow,ea=e}var ca=null,la=null,F=!1,ua=null,da=!1,fa=Error(i(519));function pa(e){throw ya(Yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),fa}function ma(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[kt]=e,t[At]=r,n){case`dialog`:V(`cancel`,t),V(`close`,t);break;case`iframe`:case`object`:case`embed`:V(`load`,t);break;case`video`:case`audio`:for(n=0;n<Xf.length;n++)V(Xf[n],t);break;case`source`:V(`error`,t);break;case`img`:case`image`:case`link`:V(`error`,t),V(`load`,t);break;case`details`:V(`toggle`,t);break;case`input`:V(`invalid`,t),pn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:V(`invalid`,t);break;case`textarea`:V(`invalid`,t),_n(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||dp(t.textContent,n)?(r.popover!=null&&(V(`beforetoggle`,t),V(`toggle`,t)),r.onScroll!=null&&V(`scroll`,t),r.onScrollEnd!=null&&V(`scrollend`,t),r.onClick!=null&&(t.onclick=En),t=!0):t=!1,t||pa(e,!0)}function ha(e){for(ca=e.return;ca;)switch(ca.tag){case 5:case 31:case 13:da=!1;return;case 27:case 3:da=!0;return;default:ca=ca.return}}function ga(e){if(e!==ca)return!1;if(!F)return ha(e),F=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Tp(e.type,e.memoizedProps)),n=!n),n&&la&&pa(e),ha(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));la=Cm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));la=Cm(e)}else t===27?(t=la,Pp(e.type)?(e=Sm,Sm=null,la=e):la=t):la=ca?xm(e.stateNode.nextSibling):null;return!0}function _a(){la=ca=null,F=!1}function va(){var e=ua;return e!==null&&(Sd===null?Sd=e:Sd.push.apply(Sd,e),ua=null),e}function ya(e){ua===null?ua=[e]:ua.push(e)}var ba=we(null),xa=null,Sa=null;function Ca(e,t,n){Ee(ba,t._currentValue),t._currentValue=n}function wa(e){e._currentValue=ba.current,Te(ba)}function Ta(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ta(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ta(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Ta(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Da(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Yr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ae.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[vh]:e.push(vh))}a=a.return}return e!==null&&Ea(t,e,n,r),t.flags|=262144,e!==null}function Oa(e){for(e=e.firstContext;e!==null;){if(!Yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ka(e){xa=e,Sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Aa(e){return Ma(xa,e)}function ja(e,t){return xa===null&&ka(e),Ma(e,t)}function Ma(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Sa===null){if(e===null)throw Error(i(308));Sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sa=Sa.next=t;return n}var Na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Pa=t.unstable_scheduleCallback,Fa=t.unstable_NormalPriority,Ia={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function La(){return{controller:new Na,data:new Map,refCount:0}}function Ra(e){e.refCount--,e.refCount===0&&Pa(Fa,function(){e.controller.abort()})}function za(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ba=null;function Va(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ha=null,Ua=0,Wa=0,Ga=null;function Ka(e,t){if(Ha===null){var n=Ha=[];Ua=0,Wa=Gf(),Ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ua++,t.then(qa,qa),t}function qa(){if(--Ua===0&&(Ba=null,Ha!==null)){Ga!==null&&(Ga.status=`fulfilled`);var e=Ha;Ha=null,Wa=0,Ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ja(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ya=A.S;A.S=function(e,t){if(Td=qe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ka(e,t),Ba!==null)for(var n=jf;n!==null;)za(n,Ba),n=n.next;if(n=e.types,n!==null){for(var r=jf;r!==null;)za(r,n),r=r.next;if(Wa!==0){r=Ba,r===null&&(r=Ba=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ya!==null&&Ya(e,t)};var Xa=we(null);function Za(){var e=Xa.current;return e===null?cd.pooledCache:e}function Qa(e,t){t===null?Ee(Xa,Xa.current):Ee(Xa,t.pool)}function $a(){var e=Za();return e===null?null:{parent:Ia._currentValue,pool:e}}var eo=Error(i(460)),to=Error(i(474)),no=Error(i(542)),ro={then:function(){}};function io(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ao(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(En,En),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,lo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(En,En);else{if(e=cd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,lo(e),e}throw so=t,eo}}function oo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(so=e,eo):e}}var so=null;function co(){if(so===null)throw Error(i(459));var e=so;return so=null,e}function lo(e){if(e===eo||e===no)throw Error(i(483))}var uo=null,fo=0;function po(e){var t=fo;return fo+=1,uo===null&&(uo=[]),ao(uo,e,t)}function mo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ho(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function go(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Hi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Gi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===re?(e=d(e,t,n.props.children,r,n.key),mo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===fe&&oo(i)===t.type)?(t=a(t,n.props),mo(t,n),t.return=e,t):(t=M(n.type,n.key,n.props,null,e.mode,r),mo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=qi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Wi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Gi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=M(t.type,t.key,t.props,null,e.mode,n),mo(n,t),n.return=e,n;case D:return t=qi(t,e.mode,n),t.return=e,t;case fe:return t=oo(t),f(e,t,n)}if(be(t)||_e(t))return t=Wi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,po(t),n);if(t.$$typeof===se)return f(e,ja(e,t),n);ho(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case E:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case fe:return n=oo(n),p(e,t,n,r)}if(be(n)||_e(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,po(n),r);if(n.$$typeof===se)return p(e,t,ja(e,n),r);ho(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case E:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case fe:return r=oo(r),m(e,t,n,r,i)}if(be(r)||_e(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,po(r),i);if(r.$$typeof===se)return m(e,t,n,ja(t,r),i);ho(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),F&&ra(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return F&&ra(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),F&&ra(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),F&&ra(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return F&&ra(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),F&&ra(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),mo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===fe&&oo(l)===r.type){n(e,r.sibling),c=a(r,o.props),mo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=Wi(o.props.children,e.mode,c,o.key),mo(c,o),c.return=e,e=c):(c=M(o.type,o.key,o.props,null,e.mode,c),mo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=qi(o,e.mode,c),c.return=e,e=c}return s(e);case fe:return o=oo(o),_(e,r,o,c)}if(be(o))return h(e,r,o,c);if(_e(o)){if(l=_e(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,po(o),c);if(o.$$typeof===se)return _(e,r,ja(e,o),c);ho(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Gi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{fo=0;var i=_(e,t,n,r);return uo=null,i}catch(t){if(t===eo||t===no)throw t;var a=Bi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var _o=go(!0),vo=go(!1),yo=!1;function bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function So(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,sd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Li(e),Ii(e,null,n),t}return Ni(e,r,t,n),Li(e)}function wo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,St(e,n)}}function To(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Eo=!1;function Do(){if(Eo){var e=Ga;if(e!==null)throw e}}function Oo(e,t,n,r){Eo=!1;var i=e.updateQueue;yo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(B&f)===f:(r&f)===f){f!==0&&f===Wa&&(Eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=w({},d,f);break a;case 2:yo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),gd|=o,e.lanes=o,e.memoizedState=d}}function ko(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ao(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ko(n[e],t)}var jo=we(null),Mo=we(0);function No(e,t){e=md,Ee(Mo,e),Ee(jo,t),md=e|t.baseLanes}function Po(){Ee(Mo,md),Ee(jo,jo.current)}function Fo(){md=Mo.current,Te(jo),Te(Mo)}var Io=we(null),Lo=null;function Ro(e){var t=e.alternate;Ee(Uo,Uo.current&1),Ee(Io,e),Lo===null&&(t===null||jo.current!==null||t.memoizedState!==null)&&(Lo=e)}function zo(e){Ee(Uo,Uo.current),Ee(Io,e),Lo===null&&(Lo=e)}function Bo(e){e.tag===22?(Ee(Uo,Uo.current),Ee(Io,e),Lo===null&&(Lo=e)):Vo()}function Vo(){Ee(Uo,Uo.current),Ee(Io,Io.current)}function Ho(e){Te(Io),Lo===e&&(Lo=null),Te(Uo)}var Uo=we(0);function Wo(e,t){Ee(Io,Io.current),Ee(Uo,t)}function Go(e){Te(Uo),Te(Io),Lo===e&&(Lo=null)}function Ko(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||vm(n)||ym(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 qo=0,I=null,Jo=null,Yo=null,Xo=!1,Zo=!1,Qo=!1,$o=0,es=0,ts=null,ns=0;function rs(){throw Error(i(321))}function is(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function as(e,t,n,r,i,a){return qo=a,I=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?xc:Sc,Qo=!1,a=n(r,i),Qo=!1,Zo&&(a=ss(t,n,r,i)),os(e),a}function os(e){A.H=bc;var t=Jo!==null&&Jo.next!==null;if(qo=0,Yo=Jo=I=null,Xo=!1,es=0,ts=null,t)throw Error(i(300));e===null||zc||(e=e.dependencies,e!==null&&Oa(e)&&(zc=!0))}function ss(e,t,n,r){I=e;var a=0;do{if(Zo&&(ts=null),es=0,Zo=!1,25<=a)throw Error(i(301));if(a+=1,Yo=Jo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=Cc,o=t(n,r)}while(Zo);return o}function cs(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?hs(t):t,e=e.useState()[0],(Jo===null?null:Jo.memoizedState)!==e&&(I.flags|=1024),t}function ls(){var e=$o!==0;return $o=0,e}function us(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ds(e){if(Xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Xo=!1}qo=0,Yo=Jo=I=null,Zo=!1,es=$o=0,ts=null}function fs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yo===null?I.memoizedState=Yo=e:Yo=Yo.next=e,Yo}function ps(){if(Jo===null){var e=I.alternate;e=e===null?null:e.memoizedState}else e=Jo.next;var t=Yo===null?I.memoizedState:Yo.next;if(t!==null)Yo=t,Jo=e;else{if(e===null)throw I.alternate===null?Error(i(467)):Error(i(310));Jo=e,e={memoizedState:Jo.memoizedState,baseState:Jo.baseState,baseQueue:Jo.baseQueue,queue:Jo.queue,next:null},Yo===null?I.memoizedState=Yo=e:Yo=Yo.next=e}return Yo}function ms(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hs(e){var t=es;return es+=1,ts===null&&(ts=[]),e=ao(ts,e,t),t=I,(Yo===null?t.memoizedState:Yo.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?xc:Sc),e}function gs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return hs(e);if(e.$$typeof===ge)return;if(e.$$typeof===se)return Aa(e)}throw Error(i(438,String(e)))}function _s(e){var t=null,n=I.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=I.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ms(),I.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=me;return t.index++,n}function vs(e,t){return typeof t==`function`?t(e):t}function ys(e){return L(ps(),Jo,e)}function L(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(qo&f)===f:(B&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Wa&&(d=!0);else if((qo&p)===p){u=u.next,p===Wa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,I.lanes|=p,gd|=p;f=u.action,Qo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,I.lanes|=f,gd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Yr(o,e.memoizedState)&&(zc=!0,d&&(n=Ga,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function bs(e){var t=ps(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Yr(o,t.memoizedState)||(zc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function xs(e,t,n){var r=I,a=ps(),o=F;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Yr((Jo||a).memoizedState,n);if(s&&(a.memoizedState=n,zc=!0),a=a.queue,Ks(ws.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Yo!==null&&!!(Yo.memoizedState.tag&1),Vs(e?9:8,{destroy:void 0},Cs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,cd===null)throw Error(i(349));o||qo&127||Ss(r,t,n)}return n}function Ss(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=I.updateQueue,t===null?(t=ms(),I.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Cs(e,t,n,r){t.value=n,t.getSnapshot=r,Ts(t)&&Es(e)}function ws(e,t,n){return n(function(){Ts(t)&&Es(e)})}function Ts(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yr(e,n)}catch{return!0}}function Es(e){var t=Fi(e,2);t!==null&&Wd(t,e,2)}function Ds(e){var t=fs();if(typeof e==`function`){var n=e;if(e=n(),Qo){it(!0);try{n()}finally{it(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:e},t}function Os(e,t,n,r){return e.baseState=n,L(e,Jo,typeof r==`function`?r:vs)}function ks(e,t,n,r,a){if(_c(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,As(t,o)):(o.next=n.next,t.pending=n.next=o)}}function As(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};o.types=a===null?null:a.types,A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),js(e,t,s)}catch(n){Ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),js(e,t,a)}catch(n){Ns(e,t,n)}}function js(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ms(e,t,n)},function(n){return Ns(e,t,n)}):Ms(e,t,n)}function Ms(e,t,n){t.status=`fulfilled`,t.value=n,Ps(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,As(e,n)))}function Ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ps(t),t=t.next;while(t!==r)}e.action=null}function Ps(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fs(e,t){return t}function Is(e,t){if(F){var n=cd.formState;if(n!==null){a:{var r=I;if(F){if(la){b:{for(var i=la,a=da;i.nodeType!==8;)if(!a||(i=xm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){la=xm(i.nextSibling),r=i.data===`F!`;break a}}pa(r)}r=!1}r&&(t=n[0])}}return n=fs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fs,lastRenderedState:t},n.queue=r,n=mc.bind(null,I,r),r.dispatch=n,r=Ds(!1),a=gc.bind(null,I,!1,r.queue),r=fs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ks.bind(null,I,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ls(e){return Rs(ps(),Jo,e)}function Rs(e,t,n){if(t=L(e,t,Fs)[0],e=ys(vs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=hs(t)}catch(e){throw e===eo?no:e}else r=t;t=ps();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(I.flags|=2048,Vs(9,{destroy:void 0},zs.bind(null,i,n),null)),[r,a,e]}function zs(e,t){e.action=t}function Bs(e){var t=ps(),n=Jo;if(n!==null)return Rs(t,n,e);ps(),t=t.memoizedState,n=ps();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Vs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=I.updateQueue,t===null&&(t=ms(),I.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Hs(){return ps().memoizedState}function Us(e,t,n,r){var i=fs();I.flags|=e,i.memoizedState=Vs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ws(e,t,n,r){var i=ps();r=r===void 0?null:r;var a=i.memoizedState.inst;Jo!==null&&r!==null&&is(r,Jo.memoizedState.deps)?i.memoizedState=Vs(t,a,n,r):(I.flags|=e,i.memoizedState=Vs(1|t,a,n,r))}function Gs(e,t){Us(8390656,8,e,t)}function Ks(e,t){Ws(2048,8,e,t)}function qs(e){I.flags|=4;var t=I.updateQueue;if(t===null)t=ms(),I.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Js(e){var t=ps().memoizedState;return qs({ref:t,nextImpl:e}),function(){if(sd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ys(e,t){return Ws(4,2,e,t)}function Xs(e,t){return Ws(4,4,e,t)}function Zs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qs(e,t,n){n=n==null?null:n.concat([e]),Ws(4,4,Zs.bind(null,t,e),n)}function $s(){}function ec(e,t){var n=ps();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&is(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function tc(e,t){var n=ps();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&is(t,r[1]))return r[0];if(r=e(),Qo){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r}function nc(e,t,n){return n===void 0||qo&1073741824&&!(B&261930)?e.memoizedState=t:(e.memoizedState=n,e=Hd(),I.lanes|=e,gd|=e,n)}function rc(e,t,n,r){return Yr(n,t)?n:jo.current===null?!(qo&106)||qo&1073741824&&!(B&261930)?(zc=!0,e.memoizedState=n):(e=Hd(),I.lanes|=e,gd|=e,t):(e=nc(e,n,r),Yr(e,t)||(zc=!0),e)}function ic(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};s.types=o===null?null:o.types,A.T=s,gc(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?hc(e,t,Ja(c,r),Vd(e)):hc(e,t,r,Vd(e))}catch(n){hc(e,t,{then:function(){},status:`rejected`,reason:n},Vd())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function ac(){}function oc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=sc(e).queue;ic(e,a,t,xe,n===null?ac:function(){return cc(e),n(r)})}function sc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:xe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cc(e){var t=sc(e);t.next===null&&(t=e.alternate.memoizedState),hc(e,t.next.queue,{},Vd())}function lc(){return Aa(vh)}function uc(){return ps().memoizedState}function dc(){return ps().memoizedState}function fc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vd();e=So(n);var r=Co(t,e,n);r!==null&&(Wd(r,t,n),wo(r,t,n)),t={cache:La()},e.payload=t;return}t=t.return}}function pc(e,t,n){var r=Vd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_c(e)?vc(t,n):(n=Pi(e,t,n,r),n!==null&&(Wd(n,e,r),yc(n,t,r)))}function mc(e,t,n){hc(e,t,n,Vd())}function hc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_c(e))vc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Yr(s,o))return Ni(e,t,i,0),cd===null&&Mi(),!1}catch{}if(n=Pi(e,t,i,r),n!==null)return Wd(n,e,r),yc(n,t,r),!0}return!1}function gc(e,t,n,r){if(r={lane:2,revertLane:Gf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},_c(e)){if(t)throw Error(i(479))}else t=Pi(e,n,r,2),t!==null&&Wd(t,e,2)}function _c(e){var t=e.alternate;return e===I||t!==null&&t===I}function vc(e,t){Zo=Xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,St(e,n)}}var bc={readContext:Aa,use:gs,useCallback:rs,useContext:rs,useEffect:rs,useImperativeHandle:rs,useLayoutEffect:rs,useInsertionEffect:rs,useMemo:rs,useReducer:rs,useRef:rs,useState:rs,useDebugValue:rs,useDeferredValue:rs,useTransition:rs,useSyncExternalStore:rs,useId:rs,useHostTransitionStatus:rs,useFormState:rs,useActionState:rs,useOptimistic:rs,useMemoCache:rs,useCacheRefresh:rs,useEffectEvent:rs},xc={readContext:Aa,use:gs,useCallback:function(e,t){return fs().memoizedState=[e,t===void 0?null:t],e},useContext:Aa,useEffect:Gs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Us(4194308,4,Zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Us(4194308,4,e,t)},useInsertionEffect:function(e,t){Us(4,2,e,t)},useMemo:function(e,t){var n=fs();t=t===void 0?null:t;var r=e();if(Qo){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=fs();if(n!==void 0){var i=n(t);if(Qo){it(!0);try{n(t)}finally{it(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=pc.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=fs();return e={current:e},t.memoizedState=e},useState:function(e){e=Ds(e);var t=e.queue,n=mc.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$s,useDeferredValue:function(e,t){return nc(fs(),e,t)},useTransition:function(){var e=Ds(!1);return e=ic.bind(null,I,e.queue,!0,!1),fs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,a=fs();if(F){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),cd===null)throw Error(i(349));B&127||Ss(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Gs(ws.bind(null,r,o,e),[e]),r.flags|=2048,Vs(9,{destroy:void 0},Cs.bind(null,r,o,n,t),null),n},useId:function(){var e=fs(),t=cd.identifierPrefix;if(F){var n=na,r=ta;n=(r&~(1<<32-at(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=$o++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ns++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:lc,useFormState:Is,useActionState:Is,useOptimistic:function(e){var t=fs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gc.bind(null,I,!0,n),n.dispatch=t,[e,t]},useMemoCache:_s,useCacheRefresh:function(){return fs().memoizedState=fc.bind(null,I)},useEffectEvent:function(e){var t=fs(),n={impl:e};return t.memoizedState=n,function(){if(sd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Sc={readContext:Aa,use:gs,useCallback:ec,useContext:Aa,useEffect:Ks,useImperativeHandle:Qs,useInsertionEffect:Ys,useLayoutEffect:Xs,useMemo:tc,useReducer:ys,useRef:Hs,useState:function(){return ys(vs)},useDebugValue:$s,useDeferredValue:function(e,t){return rc(ps(),Jo.memoizedState,e,t)},useTransition:function(){var e=ys(vs)[0],t=ps().memoizedState;return[typeof e==`boolean`?e:hs(e),t]},useSyncExternalStore:xs,useId:uc,useHostTransitionStatus:lc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){return Os(ps(),Jo,e,t)},useMemoCache:_s,useCacheRefresh:dc,useEffectEvent:Js},Cc={readContext:Aa,use:gs,useCallback:ec,useContext:Aa,useEffect:Ks,useImperativeHandle:Qs,useInsertionEffect:Ys,useLayoutEffect:Xs,useMemo:tc,useReducer:bs,useRef:Hs,useState:function(){return bs(vs)},useDebugValue:$s,useDeferredValue:function(e,t){var n=ps();return Jo===null?nc(n,e,t):rc(n,Jo.memoizedState,e,t)},useTransition:function(){var e=bs(vs)[0],t=ps().memoizedState;return[typeof e==`boolean`?e:hs(e),t]},useSyncExternalStore:xs,useId:uc,useHostTransitionStatus:lc,useFormState:Bs,useActionState:Bs,useOptimistic:function(e,t){var n=ps();return Jo===null?(n.baseState=e,[e,n.queue.dispatch]):Os(n,Jo,e,t)},useMemoCache:_s,useCacheRefresh:dc,useEffectEvent:Js};function wc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:w({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vd(),i=So(r);i.payload=t,n!=null&&(i.callback=n),t=Co(e,i,r),t!==null&&(Wd(t,e,r),wo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vd(),i=So(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Co(e,i,r),t!==null&&(Wd(t,e,r),wo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vd(),r=So(n);r.tag=2,t!=null&&(r.callback=t),t=Co(e,r,n),t!==null&&(Wd(t,e,n),wo(t,e,n))}};function Ec(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Xr(n,r)||!Xr(i,a):!0}function Dc(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&&Tc.enqueueReplaceState(t,t.state,null)}function Oc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=w({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function kc(e){Oi(e)}function Ac(e){console.error(e)}function jc(e){Oi(e)}function Mc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Nc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Pc(e,t,n){return n=So(n),n.tag=3,n.payload={element:null},n.callback=function(){Mc(e,t)},n}function Fc(e){return e=So(e),e.tag=3,e}function Ic(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Nc(t,n,r),typeof i!=`function`&&(Od===null?Od=new Set([this]):Od.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Lc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Da(t,n,a,!0),n=Io.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Lo===null?nf():n.alternate===null&&hd===0&&(hd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ro?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Tf(e,r,a)),!1;case 22:return n.flags|=65536,r===ro?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Tf(e,r,a)),!1}throw Error(i(435,n.tag))}return Tf(e,r,a),nf(),!1}if(F)return t=Io.current,t===null?(r!==fa&&(t=Error(i(423),{cause:r}),ya(Yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Yi(r,n),a=Pc(e.stateNode,r,a),To(e,a),hd!==4&&(hd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==fa&&(e=Error(i(422),{cause:r}),ya(Yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Yi(o,n),xd===null?xd=[o]:xd.push(o),hd!==4&&(hd=2),t===null)return!0;r=Yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Pc(n.stateNode,r,e),To(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Od===null||!Od.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Fc(a),Ic(a,e,n,r),To(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Rc=Error(i(461)),zc=!1;function Bc(e,t,n,r){t.child=e===null?vo(t,null,n,r):_o(t,e.child,n,r)}function Vc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ka(t),r=as(e,t,n,o,a,i),s=ls(),e!==null&&!zc?(us(e,t,i),R(e,t,i)):(F&&s&&aa(t),t.flags|=1,Bc(e,t,r,i),t.child)}function Hc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Vi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Uc(e,t,a,r,i)):(e=M(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!hl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Xr:n,n(o,r)&&e.ref===t.ref)return R(e,t,i)}return t.flags|=1,e=Hi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Xr(a,r)&&e.ref===t.ref){if(zc=!1,t.pendingProps=r=a,hl(e,i))e.flags&131072&&(zc=!0);else return t.lanes=e.lanes,R(e,t,i)}}return Zc(e,t,n,r,i)}function Wc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Kc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Qa(t,a===null?null:a.cachePool),a===null?Po():No(t,a),Bo(t);else return r=t.lanes=536870912,Kc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Qa(t,null),Po(),Vo()):(Qa(t,a.cachePool),No(t,a),Vo(),t.memoizedState=null);return Bc(e,t,i,n),t.child}function Gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kc(e,t,n,r,i){var a=Za();return a=a===null?null:{parent:Ia._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Qa(t,null),Po(),Bo(t),e!==null&&Da(e,t,r,!0),t.childLanes=i,null}function qc(e,t){return t=ol({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jc(e,t,n){return _o(t,e.child,null,n),e=qc(t,t.pendingProps),e.flags|=2,Ho(t),t.memoizedState=null,e}function Yc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(F){if(r.mode===`hidden`)return e=qc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Gc(null,e);if(zo(t),(e=la)?(e=_m(e,da),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ea===null?null:{id:ta,overflow:na},retryLane:536870912,hydrationErrors:null},n=Ki(e),n.return=t,t.child=n,ca=t,la=null)):e=null,e===null)throw pa(t);return t.lanes=536870912,null}return qc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(zo(t),a){if(t.flags&256)t.flags&=-257,t=Jc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(zc||Da(e,t,n,!1),a=(n&e.childLanes)!==0,zc||a){if(jo.current===null){if(r=cd,r!==null&&(s=Ct(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Fi(e,s),Wd(r,e,s),Rc;nf()}t=Jc(e,t,n)}else e=o.treeContext,la=xm(s.nextSibling),ca=t,F=!0,ua=null,da=!1,e!==null&&sa(t,e),t=qc(t,r),t.flags|=134221824;return t}return e=Hi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Zc(e,t,n,r,i){return ka(t),n=as(e,t,n,r,void 0,i),r=ls(),e!==null&&!zc?(us(e,t,i),R(e,t,i)):(F&&r&&aa(t),t.flags|=1,Bc(e,t,n,i),t.child)}function Qc(e,t,n,r,i,a){return ka(t),t.updateQueue=null,n=ss(t,r,n,i),os(e),r=ls(),e!==null&&!zc?(us(e,t,a),R(e,t,a)):(F&&r&&aa(t),t.flags|=1,Bc(e,t,n,a),t.child)}function $c(e,t,n,r,i){if(ka(t),t.stateNode===null){var a=Ri,o=n.contextType;typeof o==`object`&&o&&(a=Aa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Tc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},bo(t),o=n.contextType,a.context=typeof o==`object`&&o?Aa(o):Ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(wc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Tc.enqueueReplaceState(a,a.state,null),Oo(t,r,a,i),Do(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Oc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ri,typeof u==`object`&&u&&(o=Aa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Dc(t,a,r,o),yo=!1;var f=t.memoizedState;a.state=f,Oo(t,r,a,i),Do(),l=t.memoizedState,s||f!==l||yo?(typeof d==`function`&&(wc(t,n,d,r),l=t.memoizedState),(c=yo||Ec(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,xo(e,t),o=t.memoizedProps,u=Oc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ri,typeof l==`object`&&l&&(c=Aa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Dc(t,a,r,c),yo=!1,f=t.memoizedState,a.state=f,Oo(t,r,a,i),Do();var p=t.memoizedState;o!==d||f!==p||yo||e!==null&&e.dependencies!==null&&Oa(e.dependencies)?(typeof s==`function`&&(wc(t,n,s,r),p=t.memoizedState),(u=yo||Ec(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Oa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Xc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=_o(t,e.child,null,i),t.child=_o(t,null,n,i)):Bc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=R(e,t,i),e}function el(e,t,n,r){return _a(),t.flags|=256,Bc(e,t,n,r),t.child}var tl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nl(e){return{baseLanes:e,cachePool:$a()}}function rl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=yd),e}function il(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Uo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(F){if(i?Ro(t):Vo(),(e=la)?(e=_m(e,da),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ea===null?null:{id:ta,overflow:na},retryLane:536870912,hydrationErrors:null},n=Ki(e),n.return=t,t.child=n,ca=t,la=null)):e=null,e===null)throw pa(t);return t.lanes=ym(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Vo(),i=t.mode,a=ol({mode:`hidden`,children:a},i),r=Wi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=nl(n),r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(null,r)):(Ro(t),al(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return cl(e,t,a,o,r,c,s,n)}return i?(Vo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Hi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Wi(i,a,n,null),i.flags|=2):i=Hi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Gc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=nl(n):(a=i.cachePool,a===null?a=$a():(s=Ia._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(e.child,r)):(Ro(t),n=e.child,e=n.sibling,n=Hi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function al(e,t){return t=ol({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function ol(e,t){return e=Bi(22,e,null,t),e.lanes=0,e}function sl(e,t,n){return _o(t,e.child,null,n),e=al(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ro(t),t.flags&=-257,sl(e,t,c)):t.memoizedState===null?(Vo(),o=a.fallback,s=t.mode,a=ol({mode:`visible`,children:a.children},s),o=Wi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,_o(t,e.child,null,c),a=t.child,a.memoizedState=nl(c),a.childLanes=rl(e,r,c),t.memoizedState=tl,Gc(null,a)):(Vo(),t.child=e.child,t.flags|=128,null);if(Ro(t),ym(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ya({value:a,source:null,stack:null})),sl(e,t,c)}if(zc||Da(e,t,c,!1),r=(c&e.childLanes)!==0,zc||r){if(jo.current!==null)return sl(e,t,c);if(r=cd,r!==null&&(a=Ct(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Fi(e,a),Wd(r,e,a),Rc;return vm(o)||nf(),sl(e,t,c)}return vm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,la=xm(o.nextSibling),ca=t,F=!0,ua=null,da=!1,e!==null&&sa(t,e),t=al(t,a.children),t.flags|=134221824,t)}function ll(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ta(e.return,t,n)}function ul(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ko(n)===null&&(t=e),e=e.sibling}return t}function dl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function fl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function pl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Uo.current;if(t.flags&128)return Wo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Wo(t,o),i===`backwards`&&e!==null?(fl(e),Bc(e,t,r,n),fl(e)):Bc(e,t,r,n),r=F?N:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ll(e,n,t);else if(e.tag===19)ll(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ul(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,fl(t)),dl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ko(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}dl(t,!0,n,null,a,r);break;case`together`:dl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ul(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),dl(t,!1,i,n,a,r)}return t.child}function ml(e,t,n){var r=t.pendingProps;return Ca(t,t.type,r.value),Bc(e,t,r.children,n),t.child}function R(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Da(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Oa(e)))}function gl(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),Ca(t,Ia,e.memoizedState.cache),_a();break;case 27:case 5:Ne(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:Ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ro(t),t.flags|=128,null;r=Da(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?il(e,t,n):(Ro(t),e=R(e,t,n),e===null?null:e.sibling)}Ro(t);break;case 19:if(t.flags&128)return pl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Da(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return pl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Wo(t,Uo.current),r)break;return null;case 22:return t.lanes=0,Wc(e,t,n,t.pendingProps);case 24:Ca(t,Ia,e.memoizedState.cache)}return R(e,t,n)}function _l(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)zc=!0;else{if(!hl(e,n)&&!(t.flags&128))return zc=!1,gl(e,t,n);zc=!!(e.flags&131072)}}else zc=!1,F&&t.flags&1048576&&ia(t,N,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=oo(t.elementType),t.type=e,typeof e==`function`)Vi(e)?(r=Oc(e,r),t.tag=1,t=$c(null,t,e,r,n)):(t.tag=0,t=Zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ce){t.tag=11,t=Vc(null,t,e,r,n);break a}if(a===de){t.tag=14,t=Hc(null,t,e,r,n);break a}if(a===se){t.tag=10,t.type=e,t=ml(null,t,n);break a}}throw t=ye(e)||e,Error(i(306,t,``))}}return t;case 0:return Zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Oc(r,t.pendingProps),$c(e,t,r,a,n);case 3:a:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,xo(e,t),Oo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ca(t,Ia,r),r!==o.cache&&Ea(t,[Ia],n,!0),Do(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=el(e,t,r,n);break a}if(r!==a){a=Yi(Error(i(424)),t),ya(a),t=el(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(la=xm(e.firstChild),ca=t,F=!0,ua=null,da=!0,n=vo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(_a(),r===a){t=R(e,t,n);break a}Bc(e,t,r,n)}t=t.child}return t;case 26:return Xc(e,t),e===null?(n=Wm(t.type,null,t.pendingProps,null))?t.memoizedState=n:F||(t.stateNode=wp(t.type,t.pendingProps,ke.current,t)):t.memoizedState=Wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&F&&(r=t.stateNode=H(t.type,t.pendingProps,ke.current),ca=t,da=!0,a=la,Pp(t.type)?(Sm=a,la=xm(r.firstChild)):la=a),Bc(e,t,t.pendingProps.children,n),Xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&F&&((a=r=la)&&(r=hm(r,t.type,t.pendingProps,da),r===null?a=!1:(t.stateNode=r,ca=t,la=xm(r.firstChild),da=!1,a=!0)),a||pa(t)),Ne(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Tp(a,o)?r=null:s!==null&&Tp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=as(e,t,cs,null,null,n),vh._currentValue=a),Xc(e,t),Bc(e,t,r,n),t.child;case 6:return e===null&&F&&((e=n=la)&&(n=gm(n,t.pendingProps,da),n===null?e=!1:(t.stateNode=n,ca=t,la=null,e=!0)),e||pa(t)),null;case 13:return il(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_o(t,null,r,n):Bc(e,t,r,n),t.child;case 11:return Vc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Xc(e,t),Bc(e,t,r,n),t.child;case 8:return Bc(e,t,t.pendingProps.children,n),t.child;case 12:return Bc(e,t,t.pendingProps.children,n),t.child;case 10:return ml(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ka(t),a=Aa(a),r=r(a),t.flags|=1,Bc(e,t,r,n),t.child;case 14:return Hc(e,t,t.type,t.pendingProps,n);case 15:return Uc(e,t,t.type,t.pendingProps,n);case 19:return pl(e,t,n);case 31:return Yc(e,t,n);case 22:return Wc(e,t,n,t.pendingProps);case 24:return ka(t),r=Aa(Ia),e===null?(a=Za(),a===null&&(a=cd,o=La(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},bo(t),Ca(t,Ia,a)):((e.lanes&n)!==0&&(xo(e,t),Oo(t,null,null,n),Do()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ca(t,Ia,r),r!==a.cache&&Ea(t,[Ia],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ca(t,Ia,r))),Bc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:F&&aa(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Xc(e,t),Bc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function vl(e){e.flags|=4}function yl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ah(t,r):ah(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if($d())e.flags|=8192;else throw so=ro,to}}else e.flags&=-16777217}function bl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!oh(t)){if($d())e.flags|=8192;else throw so=ro,to}}function xl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:_t(),e.lanes|=t,bd|=t)}function Sl(e,t){if(!F)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Cl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function wl(e,t,n){var r=t.pendingProps;switch(oa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cl(t),null;case 1:return Cl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),wa(Ia),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ga(t)?vl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,va())),Cl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(vl(t),o===null?(Cl(t),yl(t,a,null,r,n)):(Cl(t),bl(t,o))):o?o===e.memoizedState?(Cl(t),t.flags&=-16777217):(vl(t),Cl(t),bl(t,o)):(e=e.memoizedProps,e!==r&&vl(t),Cl(t),yl(t,a,e,r,n)),null;case 27:if(Pe(t),n=ke.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Cl(t),t.subtreeFlags&=-33554433,null}e=De.current,ga(t)?ma(t,e):(e=H(a,r,n),t.stateNode=e,vl(t))}return Cl(t),t.subtreeFlags&=-33554433,null;case 5:if(Pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Cl(t),t.subtreeFlags&=-33554433,null}if(o=De.current,ga(t))ma(t,o);else{var s=xp(ke.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[kt]=t,o[At]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(mp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&vl(t)}}return Cl(t),t.subtreeFlags&=-33554433,yl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ke.current,ga(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ca,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[kt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||dp(e.nodeValue,n)),e||pa(t,!0)}else e=xp(e).createTextNode(r),e[kt]=t,t.stateNode=e}return Cl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ga(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[kt]=t}else _a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),e=!1}else n=va(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ho(t),t):(Ho(t),null);if(t.flags&128)throw Error(i(558))}return Cl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ga(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[kt]=t}else _a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),a=!1}else a=va(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ho(t),t):(Ho(t),null)}return Ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),xl(t,t.updateQueue),Cl(t),null);case 4:return Me(),e===null&&tp(t.stateNode.containerInfo),t.flags|=67108864,Cl(t),null;case 10:return wa(t.type),Cl(t),null;case 19:if(Go(t),r=t.memoizedState,r===null)return Cl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Sl(r,!1);else{if(hd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ko(e),o!==null){for(t.flags|=128,Sl(r,!1),e=o.updateQueue,t.updateQueue=e,xl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ui(n,e),n=n.sibling;return Wo(t,Uo.current&1|2),F&&ra(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&qe()>Ed&&(t.flags|=128,a=!0,Sl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ko(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,xl(t,e),Sl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!F)return Cl(t),null}else 2*qe()-r.renderingStartTime>Ed&&n!==536870912&&(t.flags|=128,a=!0,Sl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=qe(),e.sibling=null,o=Uo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||F?Wo(t,o):(n=o,Ee(Io,t),Ee(Uo,n),Lo===null&&(Lo=t)),F&&ra(t,r.treeForkCount),e}return Cl(t),null;case 22:case 23:return Ho(t),Fo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Cl(t),t.subtreeFlags&6&&(t.flags|=8192)):Cl(t),n=t.updateQueue,n!==null&&xl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Te(Xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),wa(Ia),Cl(t),null;case 25:return null;case 30:return t.flags|=33554432,Cl(t),null}throw Error(i(156,t.tag))}function Tl(e,t){switch(oa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wa(Ia),Me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pe(t),null;case 31:if(t.memoizedState!==null){if(Ho(t),t.alternate===null)throw Error(i(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Go(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return wa(t.type),null;case 22:case 23:return Ho(t),Fo(),e!==null&&Te(Xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return wa(Ia),null;case 25:return null;default:return null}}function El(e,t){switch(oa(t),t.tag){case 3:wa(Ia),Me();break;case 26:case 27:case 5:Pe(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Ho(t);break;case 13:Ho(t);break;case 19:Go(t);break;case 10:wa(t.type);break;case 22:case 23:Ho(t),Fo(),e!==null&&Te(Xa);break;case 24:wa(Ia)}}function Dl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){wf(t,t.return,e)}}function Ol(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){wf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){wf(t,t.return,e)}}function kl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ao(t,n)}catch(t){wf(e,e.return,t)}}}function Al(e,t,n){n.props=Oc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){wf(e,t,n)}}function jl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Ti(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Kp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new qp(e);f(e.child,!1,um,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){wf(e,t,n)}}function Ml(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){wf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){wf(e,t,n)}else n.current=null}}function Nl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)fm(e.stateNode,t[n])}function Pl(e){for(var t=e.return;t!==null&&(Ll(t)&&fm(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Fl(e){for(var t=e.return;t!==null&&(Ll(t)&&pm(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Il(e){return e.tag===5||e.tag===3||e.tag===27}function Ll(e){return e&&e.tag===7&&e.stateNode!==null}function Rl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){wf(e,e.return,t)}}function zl(e,t,n){try{var r=e.stateNode;gp(r,e.type,n,t),r[At]=t}catch(t){wf(e,e.return,t)}}function Bl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Pp(e.type)||e.tag===4}function Vl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bl(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.tag===27&&Pp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=En)),Nl(e,r),$t=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Pp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Hl(e,t,n,r),e=e.sibling;e!==null;)Hl(e,t,n,r),e=e.sibling}function Ul(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Nl(e,r),$t=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Pp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ul(e,t,n,r),e=e.sibling;e!==null;)Ul(e,t,n,r),e=e.sibling}function Wl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);mp(t,r,n),t[kt]=e,t[At]=n}catch(t){wf(e,e.return,t)}}var Gl=!1,Kl=null;function ql(e){(e.tag===30||e.subtreeFlags&33554432)&&(Gl=!0)}var Jl=null;function Yl(){var e=Jl;return Jl=null,e}var Xl=0;function Zl(e,t,n,r,i){return Xl=0,Ql(e.child,t,n,r,i)}function Ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Bp(o);r.push(s),s.view&&(a=!0)}else a||Bp(o).view&&(a=!0);Gl=!0,Lp(o,Xl===0?t:t+`_`+Xl,n),Xl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Ql(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function $l(e,t){for(;e!==null;)e.tag===5?Rp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||$l(e.child,t),e=e.sibling}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(eu(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Di(t.default,t.share),t!==`none`&&(Zl(e,n,t,null,!1)||$l(e.child,!1))}e=e.sibling}}function tu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Ti(r,n),a=Di(r.default,n.paired?r.share:r.enter);a===`none`?eu(e):Zl(e,i,a,null,!1)?(eu(e),n.paired||t||Ud(e,r.onEnter)):$l(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e,t),e=e.sibling;else eu(e)}function nu(e){if(Kl!==null&&Kl.size!==0){var t=Kl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Di(n.default,n.share);if(a!==`none`&&(Zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ud(e,n.onShare)):$l(e.child,!1)),t.delete(r),t.size===0)break}}}nu(e)}e=e.sibling}}}function ru(e){if(e.tag===30){var t=e.memoizedProps,n=Ti(t,e.stateNode),r=Kl===null?void 0:Kl.get(n),i=Di(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Zl(e,n,i,null,!1)?r===void 0?Ud(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Kl.delete(n),Ud(e,t.onShare)):$l(e.child,!1)),Kl!==null&&nu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else Kl!==null&&nu(e)}function iu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ti(t,e.stateNode);t=Di(t.default,t.update),e.flags&=-5,t!==`none`&&Zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&iu(e);e=e.sibling}}function au(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,$l(e.child,!1))}au(e)}e=e.sibling}}function ou(e){if(e.tag===30)e.stateNode.paired=null,$l(e.child,!1),au(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ou(e),e=e.sibling;else au(e)}function su(e){for(e=e.child;e!==null;)e.tag===30?$l(e.child,!1):e.subtreeFlags&33554432&&su(e),e=e.sibling}function cu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Xl<a.length){var l=a[Xl],u=Bp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Lp(c,Xl===0?n:n+`_`+Xl,i),s&&e.flags&4||(Jl===null&&(Jl=[]),Jl.push(c,Xl===0?r:r+`_`+Xl,t.memoizedProps)),Xl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:cu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function lu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Ti(n,r),a=Di(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Vp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Xl=0,i=cu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ud(e,n.onUpdate))}else e.subtreeFlags&33554432&&lu(e,t);e=e.sibling}}var uu=!1,du=!1,fu=!1,pu=!1,mu=typeof WeakSet==`function`?WeakSet:Set,hu=null,gu=!1,_u=!1,vu=!1,yu=!1;function bu(e,t,n){if(e=e.containerInfo,yp=Dh,e=ti(e),ni(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(bp={focusedElem:e,selectionRange:r},Dh=!1,n=(n&335544064)===n,hu=t,t=n?9270:1024;hu!==null;){if(e=hu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ru(r[a]);if(e.alternate===null&&e.flags&2)n&&ql(e),xu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ru(r),xu(n);continue}if(r!==null&&r.memoizedState!==null){n&&ql(e),xu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,hu=r):(n&&iu(e),xu(n))}}Kl=null}function xu(e){for(;hu!==null;){var t=hu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Oc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){wf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)mm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:mm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Ti(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Di(a.default,a.update),a!==`none`&&Zl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,hu=r;break}hu=t.return}}function Su(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Hu(e,n),r&4&&Dl(5,n);break;case 1:if(Hu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){wf(n,n.return,e)}else{var i=Oc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){wf(n,n.return,e)}}}r&64&&kl(n),r&512&&jl(n,n.return);break;case 3:if(Hu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ao(e,t)}catch(e){wf(n,n.return,e)}}break;case 27:t===null&&r&4&&Wl(n);case 26:case 5:Hu(e,n),t===null&&r&4&&Rl(n),r&512&&jl(n,n.return);break;case 12:Hu(e,n);break;case 31:Hu(e,n),r&4&&ju(e,n);break;case 13:Hu(e,n),r&4&&Mu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Of.bind(null,n),bm(e,n))));break;case 22:if(r=n.memoizedState!==null||uu,!r){var a=t!==null&&t.memoizedState!==null||du;t=uu,i=du,uu=r,(du=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Wu(e,n,r)):Hu(e,n),uu=t,du=i}break;case 30:Hu(e,n),r&512&&jl(n,n.return);break;case 7:r&512&&jl(n,n.return);default:Hu(e,n)}}function Cu(e,t){for(e=e.child;e!==null;)wu(e,t),e=e.sibling}function wu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){wf(e,e.return,t)}Tu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,$t=!0}catch(t){wf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ip(s,!0):Ip(e.stateNode,!1)}catch(t){wf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Cu(e,t);break;default:Cu(e,t)}}function Tu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:wu(n,r);break a;case 22:n.memoizedState===null&&Tu(n,r);break a;default:Tu(n,r)}}e=e.sibling}}function Eu(e){var t=e.alternate;t!==null&&(e.alternate=null,Eu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Du=null,Ou=!1;function ku(e,t,n){for(n=n.child;n!==null;)Au(e,t,n),n=n.sibling}function Au(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount==`function`)try{rt.onCommitFiberUnmount(nt,n)}catch{}switch(n.tag){case 26:du||Ml(n,t),ku(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!du&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:du||Ml(n,t),Fl(n);var r=Du,i=Ou;Pp(n.type)&&(Du=n.stateNode,Ou=!1),ku(e,t,n),Dm(n.stateNode,n.type,n.memoizedProps),Du=r,Ou=i;break;case 5:du||Ml(n,t),Fl(n);case 6:if(n.tag===6&&Fl(n),r=Du,i=Ou,Du=null,ku(e,t,n),Du=r,Ou=i,Du!==null){if(Ou)try{(Du.nodeType===9?Du.body:Du.nodeName===`HTML`?Du.ownerDocument.body:Du).removeChild(n.stateNode),$t=!0}catch(e){wf(n,t,e)}else try{Du.removeChild(n.stateNode),$t=!0}catch(e){wf(n,t,e)}}break;case 18:Du!==null&&(Ou?(e=Du,Fp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),W(e)):Fp(Du,n.stateNode));break;case 4:r=Du,i=Ou,Du=n.stateNode.containerInfo,Ou=!0,ku(e,t,n),Du=r,Ou=i;break;case 0:case 11:case 14:case 15:Ol(2,n,t),du||Ol(4,n,t),ku(e,t,n);break;case 1:du||(Ml(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Al(n,t,r)),ku(e,t,n);break;case 21:ku(e,t,n);break;case 22:du=(r=du)||n.memoizedState!==null,ku(e,t,n),du=r;break;case 30:Ml(n,t),ku(e,t,n);break;case 7:du||Ml(n,t),ku(e,t,n);break;default:ku(e,t,n)}}function ju(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{W(e)}catch(e){wf(t,t.return,e)}}}function Mu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{W(e)}catch(e){wf(t,t.return,e)}}function Nu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mu),t;default:throw Error(i(435,e.tag))}}function Pu(e,t){var n=Nu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=kf.bind(null,e,t);t.then(r,r)}})}function Fu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Pp(l.type)){Du=l.stateNode,Ou=!1;break a}break;case 5:Du=l.stateNode,Ou=!1;break a;case 3:case 4:Du=l.stateNode.containerInfo,Ou=!0;break a}l=l.return}if(Du===null)throw Error(i(160));Au(s,c,o),Du=null,Ou=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Lu(t,e,n),t=t.sibling}var Iu=null;function Lu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Fu(t,e,n),Ru(e),a&4&&(Ol(3,e,e.return),Dl(3,e),Ol(5,e,e.return));break;case 1:Fu(t,e,n),Ru(e),a&512&&(du||r===null||Ml(r,r.return)),a&64&&uu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Iu,Fu(t,e,n),Ru(e),a&512&&(du||r===null||Ml(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(uu)e.stateNode=wp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[It]||r[kt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),mp(r,t,n),r[kt]=e,Ut(r),t=r;break a;case`link`:if(o=nh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),mp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=nh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),mp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[kt]=e,Ut(r),t=r}e.stateNode=t}}else uu||rh(o,e.type,e.stateNode)}else e.stateNode=Zm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&zl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||du||t.parentNode.removeChild(t)):a.count--,n===null?uu||rh(o,e.type,e.stateNode):Zm(o,n,e.memoizedProps))}break;case 27:Fu(t,e,n),Ru(e),a&512&&(du||r===null||Ml(r,r.return)),r!==null&&a&4&&zl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=fu,fu=!1,Fu(t,e,n),fu=o,Ru(e),a&512&&(du||r===null||Ml(r,r.return)),e.flags&32){t=e.stateNode;try{vn(t,``),$t=!0}catch(t){wf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,zl(e,t,r===null?t:r.memoizedProps)),a&1024&&(pu=!0);break;case 6:if(Fu(t,e,n),Ru(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,$t=!0}catch(t){wf(e,e.return,t)}}break;case 3:if($t=!1,th=null,o=Iu,Iu=jm(t.containerInfo),Fu(t,e,n),Iu=o,Ru(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{W(t.containerInfo)}catch(t){wf(e,e.return,t)}pu&&(pu=!1,zu(e)),$t=!1;break;case 4:a=fu,fu=uu,r=en(),o=Iu,Iu=jm(e.stateNode.containerInfo),Fu(t,e,n),Ru(e),Iu=o,$t&&_u&&(vu=!0),$t=r,fu=a;break;case 12:Fu(t,e,n),Ru(e);break;case 31:Fu(t,e,n),Ru(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 13:Fu(t,e,n),Ru(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(wd=qe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=uu,l=du,u=fu;uu=c||o,fu=u||o,du=l||s,Fu(t,e,n),du=l,fu=u,uu=c,Ru(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||uu||du||(t=s||du,n=uu,r=du,uu=o||uu,du=t,Uu(e,2),uu=n,du=r),!o&&fu||Cu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Pu(e,n))));break;case 19:Fu(t,e,n),Ru(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 30:a&512&&(du||r===null||Ml(r,r.return)),a=en(),o=_u,s=(n&335544064)===n,c=e.memoizedProps,_u=s&&Di(c.default,c.update)!==`none`,Fu(t,e,n),Ru(e),s&&r!==null&&$t&&(e.flags|=4),_u=o,$t=a;break;case 21:break;case 7:a&512&&(du||r===null||Ml(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Fu(t,e,n),Ru(e)}}function Ru(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Bl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ll(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Il(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ul(e,Vl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(vn(l,``),n.flags&=-33),Ul(e,Vl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Hl(e,Vl(e),u,s);break;default:throw Error(i(161))}}catch(t){wf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Dh=!0,t.reset(),Dh=!1),e=e.sibling}}function Bu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Vu(t,e),t=t.sibling;else lu(t,!1)}function Vu(e,t){var n=e.alternate;if(n===null)tu(e,!1);else switch(e.tag){case 3:if(yu=gu=!1,Yl(),Bu(t,e),!gu&&!vu){if(e=Jl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Rp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),yu=!0}Jl=null;break;case 5:Bu(t,e);break;case 4:r=gu,gu=!1,Bu(t,e),gu&&(vu=!0),gu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Bu(t,e):tu(e,!1));break;case 30:r=gu,i=Yl(),gu=!1,Bu(t,e),gu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Ti(a,o),o=Ti(n.memoizedProps,o);var s=Di(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Xl=0,t=cu(e,n,t,o,s,a,!0),Xl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ud(e,e.memoizedProps.onUpdate),Jl=i):i!==null&&(i.push.apply(i,Jl),Jl=i),gu=e.flags&32?!0:r;break;default:Bu(t,e)}}function Hu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Su(e,t.alternate,t),t=t.sibling}function Uu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ol(4,n,n.return),Uu(n,r);break;case 1:Ml(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Al(n,n.return,i),Uu(n,r);break;case 27:r&2&&Dm(n.stateNode,n.type,n.memoizedProps);case 5:Ml(n,n.return),n.tag!==5&&n.tag!==27||Fl(n),Uu(n,r);break;case 6:Fl(n);break;case 26:Ml(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||du||i.parentNode.removeChild(i),Uu(n,r);break;case 22:n.memoizedState===null&&Uu(n,r);break;case 30:Ml(n,n.return),Uu(n,r);break;case 7:Ml(n,n.return);default:Uu(n,r)}e=e.sibling}}function Wu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Wu(i,a,n),Dl(4,a);break;case 1:if(Wu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){wf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)ko(l[i],c)}catch(e){wf(r,r.return,e)}}s&&o&64&&kl(a),jl(a,a.return);break;case 27:n&2&&Wl(a);case 5:a.tag!==5&&a.tag!==27||Pl(a),Wu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 6:Pl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||uu||rh(jm(c.ownerDocument),a.type,c),Wu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 12:Wu(i,a,n);break;case 31:Wu(i,a,n),s&&o&4&&ju(i,a);break;case 13:Wu(i,a,n),s&&o&4&&Mu(i,a);break;case 22:a.memoizedState===null&&Wu(i,a,n),jl(a,a.return);break;case 30:Wu(i,a,n),jl(a,a.return);break;case 7:jl(a,a.return);default:Wu(i,a,n)}t=t.sibling}}function Gu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ra(n))}function Ku(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ra(e))}function qu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ju(e,t,n,r),t=t.sibling;else i&&su(t)}function Ju(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ou(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:qu(e,t,n,r),a&2048&&Dl(9,t);break;case 1:qu(e,t,n,r);break;case 3:qu(e,t,n,r),i&&yu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ra(a)));break;case 12:if(a&2048){qu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){wf(t,t.return,e)}}else qu(e,t,n,r);break;case 31:qu(e,t,n,r);break;case 13:qu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ou(t),o._visibility&2?qu(e,t,n,r):(o._visibility|=2,Yu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ou(s),o._visibility&2?qu(e,t,n,r):Xu(e,t)),a&2048&&Gu(s,t);break;case 24:qu(e,t,n,r),a&2048&&Ku(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&($l(a.child,!0),$l(t.child,!0))),qu(e,t,n,r);break;default:qu(e,t,n,r)}}function Yu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Yu(a,o,s,c,i),Dl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Yu(a,o,s,c,i)):u._visibility&2?Yu(a,o,s,c,i):Xu(a,o),i&&l&2048&&Gu(o.alternate,o);break;case 24:Yu(a,o,s,c,i),i&&l&2048&&Ku(o.alternate,o);break;default:Yu(a,o,s,c,i)}t=t.sibling}}function Xu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Xu(n,r),i&2048&&Gu(r.alternate,r);break;case 24:Xu(n,r),i&2048&&Ku(r.alternate,r);break;default:Xu(n,r)}t=t.sibling}}var Zu=8192;function Qu(e,t,n){if(e.subtreeFlags&Zu)for(e=e.child;e!==null;)$u(e,t,n),e=e.sibling}function $u(e,t,n){switch(e.tag){case 26:Qu(e,t,n),e.flags&Zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ch(n,e)):lh(n,Iu,e.memoizedState,e.memoizedProps));break;case 5:Qu(e,t,n),e.flags&Zu&&(e=e.stateNode,(t&335544128)===t&&ch(n,e));break;case 3:case 4:var r=Iu;Iu=jm(e.stateNode.containerInfo),Qu(e,t,n),Iu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zu,Zu=16777216,Qu(e,t,n),Zu=r):Qu(e,t,n));break;case 30:if((e.flags&Zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Kl===null&&(Kl=new Map),Kl.set(r,i)}Qu(e,t,n);break;default:Qu(e,t,n)}}function ed(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function td(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hu=r,id(r,e)}ed(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)nd(e),e=e.sibling}function nd(e){switch(e.tag){case 0:case 11:case 15:td(e),e.flags&2048&&Ol(9,e,e.return);break;case 3:td(e);break;case 12:td(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,rd(e)):td(e);break;default:td(e)}}function rd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hu=r,id(r,e)}ed(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ol(8,t,t.return),rd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,rd(t));break;default:rd(t)}e=e.sibling}}function id(e,t){for(;hu!==null;){var n=hu;switch(n.tag){case 0:case 11:case 15:Ol(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,hu=r;else a:for(n=e;hu!==null;){r=hu;var i=r.sibling,a=r.return;if(Eu(r),r===n){hu=null;break a}if(i!==null){i.return=a,hu=i;break a}hu=a}}}var ad={getCacheForType:function(e){var t=Aa(Ia),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Aa(Ia).controller.signal}},od=typeof WeakMap==`function`?WeakMap:Map,sd=0,cd=null,z=null,B=0,ld=0,ud=null,dd=!1,fd=!1,pd=!1,md=0,hd=0,gd=0,_d=0,vd=0,yd=0,bd=0,xd=null,Sd=null,Cd=!1,wd=0,Td=0,Ed=1/0,Dd=null,Od=null,kd=0,Ad=null,jd=null,Md=0,Nd=0,Pd=null,Fd=null,Id=null,Ld=null,Rd=null,zd=0,Bd=null;function Vd(){return sd&2&&B!==0?B&-B:A.T===null?Et():Gf()}function Hd(){if(yd===0){if(!(B&536870912)||F){var e=ut;ut<<=1,!(ut&3932160)&&(ut=262144),yd=e}else yd=536870912}return e=Io.current,e!==null&&(e.flags|=32),yd}function Ud(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Kp(Ti(e.memoizedProps,n))),Ld===null&&(Ld=[]),Ld.push(t.bind(null,r))}}function Wd(e,t,n){(e===cd&&(ld===2||ld===9)||e.cancelPendingCommit!==null)&&(Zd(e,0),Jd(e,B,yd,!1)),yt(e,n),sd&2&&e===cd||(e===cd&&(!(sd&2)&&(_d|=n),hd===4&&Jd(e,B,yd,!1)),Lf(e))}function Gd(e,t,n){if(sd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||mt(e,t),a=r?of(e,t):rf(e,t,!0),o=r;do{if(a===0){fd&&!r&&Jd(e,t,0,!1);break}if(n=e.current.alternate,o&&!qd(n))a=rf(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=xd;var l=c.current.memoizedState.isDehydrated;if(l&&(Zd(c,s).flags|=256),s=rf(c,s,!1),s!==2&&s!==6){if(pd&&!l){c.errorRecoveryDisabledLanes|=o,_d|=o,a=4;break a}o=Sd,Sd=a,o!==null&&(Sd===null?Sd=o:Sd.push.apply(Sd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Zd(e,0),Jd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Jd(r,t,yd,!dd);break a;case 2:Sd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=wd+300-qe(),10<a)){if(Jd(r,t,yd,!dd),pt(r,0,!0)!==0)break a;Md=t,r.timeoutHandle=Op(Kd.bind(null,r,n,Sd,Dd,Cd,t,yd,_d,bd,dd,o,`Throttled`,-0,0),a);break a}Kd(r,n,Sd,Dd,Cd,t,yd,_d,bd,dd,o,null,-0,0)}break}}while(1);Lf(e)}function Kd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:En},Kl=null,$u(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ph.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?wd-qe():(a&4194048)===a?Td-qe():0,m=dh(d,m),m!==null)?(Md=a,e.cancelPendingCommit=m(pf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Jd(e,a,o,!l)):pf(e,t,a,n,r,i,o,s,c,l,u,d)}function qd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Yr(a(),i))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 Jd(e,t,n,r){t=ht(e,t),t&=~vd,t&=~_d,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-at(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&xt(e,n,t)}function Yd(){return sd&6?!0:(Rf(0,!1),!1)}function Xd(){if(z!==null){if(ld===0)var e=z.return;else e=z,Sa=xa=null,ds(e),uo=null,fo=0,e=z;for(;e!==null;)El(e.alternate,e),e=e.return;z=null}}function Zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,kp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Md=0,Xd(),cd=e,z=n=Hi(e.current,null),B=t,ld=0,ud=null,dd=!1,fd=mt(e,t),pd=!1,bd=yd=vd=_d=gd=hd=0,Sd=xd=null,Cd=!1,md=ht(e,t),Mi(),n}function Qd(e,t){I=null,A.H=bc,t===eo||t===no?(t=co(),ld=3):t===to?(t=co(),ld=4):ld=t===Rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ud=t,z===null&&(hd=1,Mc(e,Yi(t,e.current)))}function $d(){var e=Io.current;return e===null?!0:(B&4194048)===B?Lo===null:(B&62914560)===B||B&536870912?e===Lo:!1}function ef(){var e=A.H;return A.H=bc,e===null?bc:e}function tf(){var e=A.A;return A.A=ad,e}function nf(){hd=4,dd||(B&4194048)!==B&&Io.current!==null||(fd=!0),!(gd&134217727)&&!(_d&134217727)||cd===null||Jd(cd,B,yd,!1)}function rf(e,t,n){var r=sd;sd|=2;var i=ef(),a=tf();(cd!==e||B!==t)&&(Dd=null,Zd(e,t)),t=!1;var o=hd;a:do try{if(ld!==0&&z!==null){var s=z,c=ud;switch(ld){case 8:Xd(),o=6;break a;case 3:case 2:case 9:case 6:Io.current===null&&(t=!0);var l=ld;if(ld=0,ud=null,uf(e,s,c,l),n&&fd){o=0;break a}break;default:l=ld,ld=0,ud=null,uf(e,s,c,l)}}af(),o=hd;break}catch(t){Qd(e,t)}while(1);return t&&e.shellSuspendCounter++,Sa=xa=null,sd=r,A.H=i,A.A=a,z===null&&(cd=null,B=0,Mi()),o}function af(){for(;z!==null;)cf(z)}function of(e,t){var n=sd;sd|=2;var r=ef(),a=tf();cd!==e||B!==t?(Dd=null,Ed=qe()+500,Zd(e,t)):fd=mt(e,t);a:do try{if(ld!==0&&z!==null){t=z;var o=ud;b:switch(ld){case 1:ld=0,ud=null,uf(e,t,o,1);break;case 2:case 9:if(io(o)){ld=0,ud=null,lf(t);break}t=function(){ld!==2&&ld!==9||cd!==e||(ld=7),Lf(e)},o.then(t,t);break a;case 3:ld=7;break a;case 4:ld=5;break a;case 7:io(o)?(ld=0,ud=null,lf(t)):(ld=0,ud=null,uf(e,t,o,7));break;case 5:var s=null;switch(z.tag){case 26:s=z.memoizedState;case 5:case 27:var c=z;if(s?oh(s):c.stateNode.complete){ld=0,ud=null;var l=c.sibling;if(l!==null)z=l;else{var u=c.return;u===null?z=null:(z=u,df(u))}break b}}ld=0,ud=null,uf(e,t,o,5);break;case 6:ld=0,ud=null,uf(e,t,o,6);break;case 8:Xd(),hd=6;break a;default:throw Error(i(462))}}sf();break}catch(t){Qd(e,t)}while(1);return Sa=xa=null,A.H=r,A.A=a,sd=n,z===null?(cd=null,B=0,Mi(),hd):0}function sf(){for(;z!==null&&!Ge();)cf(z)}function cf(e){var t=_l(e.alternate,e,md);e.memoizedProps=e.pendingProps,t===null?df(e):z=t}function lf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qc(n,t,t.pendingProps,t.type,void 0,B);break;case 11:t=Qc(n,t,t.pendingProps,t.type.render,t.ref,B);break;case 5:ds(t);var r=t;r===ca&&(F?(ha(r),r.tag===5&&r.stateNode!=null&&(la=r.stateNode)):(ha(r),F=!0));default:El(n,t),t=z=Ui(t,md),t=_l(n,t,md)}e.memoizedProps=e.pendingProps,t===null?df(e):z=t}function uf(e,t,n,r){Sa=xa=null,ds(t),uo=null,fo=0;var i=t.return;try{if(Lc(e,i,t,n,B)){hd=1,Mc(e,Yi(n,e.current)),z=null;return}}catch(t){if(i!==null)throw z=i,t;hd=1,Mc(e,Yi(n,e.current)),z=null;return}t.flags&32768?(F||r===1?e=!0:fd||B&536870912?e=!1:(dd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Io.current,r!==null&&r.tag===13&&(r.flags|=16384))),ff(t,e)):df(t)}function df(e){var t=e;do{if(t.flags&32768){ff(t,dd);return}e=t.return;var n=wl(t.alternate,t,md);if(n!==null){z=n;return}if(t=t.sibling,t!==null){z=t;return}z=t=e}while(t!==null);hd===0&&(hd=5)}function ff(e,t){do{var n=Tl(e.alternate,e);if(n!==null){n.flags&=32767,z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){z=e;return}z=e=n}while(e!==null);hd=6,z=null}function pf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do xf();while(kd!==0);if(sd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===cd&&(z=cd=null,B=0),jd=t,Ad=e,Md=n,Pd=a,Fd=r,mf(e,t,n,s,c,l,f)}}function mf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Nd=s,s|=ji,bt(e,n,s,r,i,a),Ld=null,(n&335544064)===n?(Rd=Va(e),r=10262):(Rd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Af(Ze,function(){return Sf(),null})):(e.callbackNode=null,e.callbackPriority=0),Gl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,i=j.p,j.p=2,a=sd,sd|=4;try{bu(e,t,n)}finally{sd=a,j.p=i,A.T=r}}kd=1,Gl?Id=Wp(o,e.containerInfo,Rd,_f,vf,gf,yf,Sf,hf,null,null):(_f(),vf(),yf())}function hf(e){if(kd!==0){var t=Ad.onRecoverableError;t(e,{componentStack:null})}}function gf(){kd===3&&(kd=0,Vu(jd,Ad),kd=4)}function _f(){if(kd===1){kd=0;var e=Ad,t=jd,n=Md,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=A.T,A.T=null;var i=j.p;j.p=2;var a=sd;sd|=4;try{_u=vu=!1,Lu(t,e,n),n=bp;var o=ti(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&ei(s.ownerDocument.documentElement,s)){if(c!==null&&ni(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=$r(s,h),v=$r(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Dh=!!yp,bp=yp=null}finally{sd=a,j.p=i,A.T=r}}e.current=t,kd=2}}function vf(){if(kd===2){kd=0;var e=Ad,t=jd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=sd;sd|=4;try{Su(e,t.alternate,t)}finally{sd=i,j.p=r,A.T=n}}kd=3}}function yf(){if(kd===4||kd===3){kd=0;var e=Id;Id=null,Ke();var t=Ad,n=jd,r=Md,i=Fd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?kd=5:(kd=0,jd=Ad=null,bf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Od=null),Tt(r),n=n.stateNode,rt&&typeof rt.onCommitFiberRoot==`function`)try{rt.onCommitFiberRoot(nt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=A.T,a=j.p,j.p=2,A.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{A.T=n,j.p=a}}if(i=Ld,o=Rd,Rd=null,i!==null&&(Ld=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Md&3&&xf(),Lf(t),a=t.pendingLanes,r&261930&&a&42?t===Bd?zd++:(zd=0,Bd=t):(zd=0,Bd=null),Rf(0,!1)}}function bf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ra(t)))}function xf(){return Id!==null&&(Id.skipTransition(),Id=null),_f(),vf(),yf(),Sf()}function Sf(){if(kd!==5)return!1;var e=Ad,t=Nd;Nd=0;var n=Tt(Md),r=A.T,a=j.p;try{j.p=32>n?32:n,A.T=null,n=Pd,Pd=null;var o=Ad,s=Md;if(kd=0,jd=Ad=null,Md=0,sd&6)throw Error(i(331));var c=sd;if(sd|=4,nd(o.current),Ju(o,o.current,s,n),sd=c,Rf(0,!1),rt&&typeof rt.onPostCommitFiberRoot==`function`)try{rt.onPostCommitFiberRoot(nt,o)}catch{}return!0}finally{j.p=a,A.T=r,bf(e,t)}}function Cf(e,t,n){t=Yi(n,t),t=Pc(e.stateNode,t,2),e=Co(e,t,2),e!==null&&(yt(e,2),Lf(e))}function wf(e,t,n){if(e.tag===3)Cf(e,e,n);else for(;t!==null;){if(t.tag===3){Cf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Od===null||!Od.has(r))){e=Yi(n,e),n=Fc(2),r=Co(t,n,2),r!==null&&(Ic(n,r,t,e),yt(r,2),Lf(r));break}}t=t.return}}function Tf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new od;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(pd=!0,i.add(n),e=Ef.bind(null,e,t,n),t.then(e,e))}function Ef(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,cd===e&&(B&n)===n&&(hd===4||hd===3&&(B&62914560)===B&&300>qe()-wd?sd&2?vd|=n:Zd(e,0):vd|=n,bd===B&&(bd=0)),Lf(e)}function Df(e,t){t===0&&(t=_t()),e=Fi(e,t),e!==null&&(yt(e,t),Lf(e))}function Of(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Df(e,n)}function kf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Df(e,n)}function Af(e,t){return Ue(e,t)}var jf=null,Mf=null,Nf=!1,Pf=!1,Ff=!1,If=0;function Lf(e){e!==Mf&&e.next===null&&(Mf===null?jf=Mf=e:Mf=Mf.next=e),Pf=!0,Nf||(Nf=!0,Wf())}function Rf(e,t){if(!Ff&&Pf){Ff=!0;do for(var n=!1,r=jf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-at(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Uf(r,a))}else a=B,a=pt(r,r===cd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||mt(r,a)||(n=!0,Uf(r,a))}r=r.next}while(n);Ff=!1}}function zf(){Bf()}function Bf(){Pf=Nf=!1;var e=0;If!==0&&Dp()&&(e=If);for(var t=qe(),n=null,r=jf;r!==null;){var i=r.next,a=Vf(r,t);a===0?(r.next=null,n===null?jf=i:n.next=i,i===null&&(Mf=n)):(n=r,(e!==0||a&3)&&(Pf=!0)),r=i}kd!==0&&kd!==5||Rf(e,!1),If!==0&&(If=0)}function Vf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-at(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=gt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=cd,n=B,n=pt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ld===2||ld===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&We(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||mt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&We(r),Tt(n)){case 2:case 8:n=Xe;break;case 32:n=Ze;break;case 268435456:n=$e;break;default:n=Ze}return r=Hf.bind(null,e),n=Ue(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&We(r),e.callbackPriority=2,e.callbackNode=null,2}function Hf(e,t){if(kd!==0&&kd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xf()&&e.callbackNode!==n)return null;var r=B;return r=pt(e,e===cd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Gd(e,r,t),Vf(e,qe()),e.callbackNode!=null&&e.callbackNode===n?Hf.bind(null,e):null)}function Uf(e,t){if(xf())return null;Gd(e,t,!0)}function Wf(){Mp(function(){sd&6?Ue(Ye,zf):Bf()})}function Gf(){if(If===0){var e=Wa;e===0&&(e=lt,lt<<=1,!(lt&261888)&&(lt=256)),If=e}return If}function Kf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Tn(e)}function qf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Kf((i[At]||null).action),o=r.submitter;o&&(t=(t=o[At]||null)?Kf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new qn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(If!==0){var e=new FormData(i,o);oc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),oc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Jf=0;Jf<Si.length;Jf++){var Yf=Si[Jf];Ci(Yf.toLowerCase(),`on`+(Yf[0].toUpperCase()+Yf.slice(1)))}Ci(mi,`onAnimationEnd`),Ci(hi,`onAnimationIteration`),Ci(gi,`onAnimationStart`),Ci(`dblclick`,`onDoubleClick`),Ci(`focusin`,`onFocus`),Ci(`focusout`,`onBlur`),Ci(_i,`onTransitionRun`),Ci(vi,`onTransitionStart`),Ci(yi,`onTransitionCancel`),Ci(bi,`onTransitionEnd`),Jt(`onMouseEnter`,[`mouseout`,`mouseover`]),Jt(`onMouseLeave`,[`mouseout`,`mouseover`]),Jt(`onPointerEnter`,[`pointerout`,`pointerover`]),Jt(`onPointerLeave`,[`pointerout`,`pointerover`]),qt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),qt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),qt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),qt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),qt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),qt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Xf=`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(` `),Zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Xf));function Qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Oi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Oi(e)}i.currentTarget=null,a=c}}}}function V(e,t){var n=t[Mt];n===void 0&&(n=t[Mt]=new Set);var r=e+`__bubble`;n.has(r)||(np(t,e,2,!1),n.add(r))}function $f(e,t,n){var r=0;t&&(r|=4),np(n,e,r,t)}var ep=`_reactListening`+Math.random().toString(36).slice(2);function tp(e){if(!e[ep]){e[ep]=!0,Gt.forEach(function(t){t!==`selectionchange`&&(Zf.has(t)||$f(t,!1,e),$f(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ep]||(t[ep]=!0,$f(`selectionchange`,!1,t))}}function np(e,t,n,r){switch(Ph(t)){case 2:var i=Oh;break;case 8:i=kh;break;default:i=Ah}n=i.bind(null,t,n,e),i=void 0,!In||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function rp(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=zt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Nn(function(){var r=a,i=On(n),s=[];a:{var c=xi.get(e);if(c!==void 0){var l=qn,u=e;switch(e){case`keypress`:if(Hn(n)===0)break a;case`keydown`:case`keyup`:l=dr;break;case`focusin`:u=`focus`,l=nr;break;case`focusout`:u=`blur`,l=nr;break;case`beforeblur`:case`afterblur`:l=nr;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=er;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=tr;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=mr;break;case mi:case hi:case gi:l=rr;break;case bi:l=hr;break;case`scroll`:case`scrollend`:l=Yn;break;case`wheel`:l=gr;break;case`copy`:case`cut`:case`paste`:l=ir;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=fr;break;case`submit`:l=pr;break;case`toggle`:case`beforetoggle`:l=_r}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Pn(m,p),g!=null&&d.push(ip(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Dn&&(u=n.relatedTarget||n.fromElement)&&(zt(u)||u[jt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?zt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=er,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=fr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Vt(c),h=l==null?u:Vt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,zt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?C(c,l,op):null,c!==null&&sp(s,u,c,d,!1),l!==null&&f!==null&&sp(s,f,l,d,!0)))}a:{if(c=r?Vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Lr;else if(jr(c)){if(Rr)_=qr;else{_=Gr;var v=Wr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Sn(r.elementType)&&(_=Lr):_=Kr;if(_&&=_(e,r)){Mr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Vt(r):window,e){case`focusin`:(jr(v)||v.contentEditable===`true`)&&(ii=v,ai=r,oi=null);break;case`focusout`:oi=ai=ii=null;break;case`mousedown`:si=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:si=!1,ci(s,n,i);break;case`selectionchange`:if(ri)break;case`keydown`:case`keyup`:ci(s,n,i)}var y;if(yr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Dr?Tr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(Sr&&n.locale!==`ko`&&(Dr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Dr&&(y=Vn()):(Rn=i,zn=`value`in Rn?Rn.value:Rn.textContent,Dr=!0)),v=ap(r,b),0<v.length&&(b=new ar(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Er(n),y!==null&&(b.data=y)))),(y=xr?Or(e,n):kr(e,n))&&(b=ap(r,`onBeforeInput`),0<b.length&&(v=new ar(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),qf(s,e,r,n,i)}Qf(s,t)})}function ip(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ap(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Pn(e,n),i!=null&&r.unshift(ip(e,i,a)),i=Pn(e,t),i!=null&&r.push(ip(e,i,a))),e.tag===3)return r;e=e.return}return[]}function op(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Pn(n,a),l!=null&&o.unshift(ip(n,l,c))):i||(l=Pn(n,a),l!=null&&o.push(ip(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var cp=/\r\n?/g,lp=/\u0000|\uFFFD/g;function up(e){return(typeof e==`string`?e:``+e).replace(cp,`
|
|
10
|
-
`).replace(lp,``)}function dp(e,t){return t=up(t),up(e)===t}function fp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&vn(e,``+r);else return;break;case`className`:nn(e,`class`,r);break;case`tabIndex`:nn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:nn(e,n,r);break;case`style`:xn(e,r,o);return;case`data`:if(t!==`object`){nn(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&fp(e,t,`name`,a.name,a,null),fp(e,t,`formEncType`,a.formEncType,a,null),fp(e,t,`formMethod`,a.formMethod,a,null),fp(e,t,`formTarget`,a.formTarget,a,null)):(fp(e,t,`encType`,a.encType,a,null),fp(e,t,`method`,a.method,a,null),fp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=En);return;case`onScroll`:r!=null&&V(`scroll`,e);return;case`onScrollEnd`:r!=null&&V(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Tn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:V(`beforetoggle`,e),V(`toggle`,e),tn(e,`popover`,r);break;case`xlinkActuate`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:tn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=Cn.get(n)||n,tn(e,n,r);else return}$t=!0}function pp(e,t,n,r,a,o){switch(n){case`style`:xn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)vn(e,``+r);else return;break;case`onScroll`:r!=null&&V(`scroll`,e);return;case`onScrollEnd`:r!=null&&V(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=En);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Kt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[At]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}$t=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):tn(e,n,r)}return}$t=!0}function mp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:V(`error`,e),V(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:fp(e,t,o,s,n,null)}}a&&fp(e,t,`srcSet`,n.srcSet,n,null),r&&fp(e,t,`src`,n.src,n,null);return;case`input`:V(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:fp(e,t,r,d,n,null)}}pn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in V(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:fp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&hn(e,!!r,n,!0):hn(e,!!r,t,!1);return;case`textarea`:for(s in V(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:fp(e,t,s,c,n,null)}_n(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:fp(e,t,l,r,n,null)}return;case`dialog`:V(`beforetoggle`,e),V(`toggle`,e),V(`cancel`,e),V(`close`,e);break;case`iframe`:case`object`:V(`load`,e);break;case`video`:case`audio`:for(r=0;r<Xf.length;r++)V(Xf[r],e);break;case`image`:V(`error`,e),V(`load`,e);break;case`details`:V(`toggle`,e);break;case`embed`:case`source`:case`link`:V(`error`,e),V(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:fp(e,t,u,r,n,null)}return;default:if(Sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&pp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&fp(e,t,c,r,n,null))}var hp={};function gp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||fp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&($t=!0),o=m;break;case`name`:m!==f&&($t=!0),a=m;break;case`checked`:m!==f&&($t=!0),u=m;break;case`defaultChecked`:m!==f&&($t=!0),d=m;break;case`value`:m!==f&&($t=!0),s=m;break;case`defaultValue`:m!==f&&($t=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&fp(e,t,p,m,r,f)}}fn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||fp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&($t=!0),p=o;break;case`defaultValue`:o!==l&&($t=!0),c=o;break;case`multiple`:o!==l&&($t=!0),s=o;default:o!==l&&fp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?hn(e,!!n,n?[]:``,!1):hn(e,!!n,t,!0)):hn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:fp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&($t=!0),p=a;break;case`defaultValue`:a!==o&&($t=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&fp(e,t,s,a,r,o)}gn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:fp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&($t=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:fp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&fp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:fp(e,t,u,p,r,m)}return;default:if(Sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&pp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||pp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&fp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||fp(e,t,f,p,r,m)}function _p(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function vp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&_p(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&_p(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var yp=null,bp=null;function xp(e){return e.nodeType===9?e:e.ownerDocument}function Sp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Cp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function wp(e,t,n,r){return n=xp(n).createElement(e),n[kt]=r,n[At]=t,mp(n,e,t),Ut(n),n}function Tp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ep=null;function Dp(){var e=window.event;return e&&e.type===`popstate`?e!==Ep&&(Ep=e,!0):(Ep=null,!1)}var Op=typeof setTimeout==`function`?setTimeout:void 0,kp=typeof clearTimeout==`function`?clearTimeout:void 0,Ap=typeof Promise==`function`?Promise:void 0,jp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Op,Mp=typeof queueMicrotask==`function`?queueMicrotask:Ap===void 0?Op:function(e){return Ap.resolve(null).then(e).catch(Np)};function Np(e){setTimeout(function(){throw e})}function Pp(e){return e===`head`}function Fp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),W(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Om(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Om(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[It]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Om(e.ownerDocument.body)}n=i}while(n);W(t)}function Ip(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Lp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Rp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function zp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Bp(e){return zp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Vp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return zp(t,n,e)}function Hp(e){return e.documentElement.clientHeight}function Up(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Wp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Hp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=sh(f),u>uh){s.length=o;break}f=new Promise(Up.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Gp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Gp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Gp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Gp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Kp(e){return{name:e,group:new Gp(`group`,e),imagePair:new Gp(`image-pair`,e),old:new Gp(`old`,e),new:new Gp(`new`,e)}}function qp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}qp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Qp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Xp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Jp,e,s,r)}this._eventListeners=a}};function Jp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}qp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Qp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Xp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Yp,e,n,i),r.splice(t,1),a!==null&&a()}};function Yp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Xp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Qp(e,t,n,r){if(e.length===0)return-1;r=Zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Zp(a.optionsOrUseCapture)===r)return i}return-1}qp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Xp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Xp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},qp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,$p,e,void 0,void 0)};function $p(e,t){return e.tag!==6&&(e=_(e),Tm(e,t))}qp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,em,t,void 0,void 0);for(var n=t.length-1;0<=n&&!$p(t[n],e);n--);};function em(e,t){return t.push(e),!1}qp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=xp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,tm,e,void 0,void 0))};function tm(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}qp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,nm,e,void 0,void 0)};function nm(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}qp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,rm,e,void 0,void 0);for(var n=t=0;n<im.length;n++){var r=im[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):im[t++]=r}im.length=t}};function rm(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var im=[],am=!1;function om(e,t,n){im.push({fragmentInstance:e,observer:t,instance:n}),am||(am=!0,Em(function(){am=!1;var e=im;im=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}qp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,sm,e,void 0,void 0),e};function sm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}qp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},qp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,em,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||cm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function cm(e,t,n,r,i){var a=zt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function lm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}qp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,em,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),lm(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),lm(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function um(e,t){return e=_(e),dm(e,t),!1}function dm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function fm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Xp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<im.length;i++){var a=im[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(im[r++]=a)}im.length=r,n.observe(e)}),dm(e,t))}function pm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Xp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?om(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function mm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:mm(n),Rt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function hm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[It])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=xm(e.nextSibling),e===null)break}return null}function gm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=xm(e.nextSibling),e===null))return null;return e}function _m(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=xm(e.nextSibling),e===null))return null;return e}function vm(e){return e.data===`$?`||e.data===`$~`}function ym(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function bm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function xm(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Sm=null;function Cm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return xm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function wm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Tm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Em(e){jp(function(){jp(function(t){return e(t)})})}function H(e,t,n){switch(t=xp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Dm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&fp(e,t,r,null,hp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===En&&(e.onclick=null),Rt(e)}function Om(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rt(e)}var km=new Map,Am=new Set;function jm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Mm=j.d;j.d={f:Nm,r:Pm,D:Lm,C:Rm,L:zm,m:Bm,X:Hm,S:Vm,M:Um};function Nm(){var e=Mm.f(),t=Yd();return e||t}function Pm(e){var t=Bt(e);t!==null&&t.tag===5&&t.type===`form`?cc(t):Mm.r(e)}var Fm=typeof document>`u`?null:document;function Im(e,t,n){var r=Fm;if(r&&typeof t==`string`&&t){var i=dn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Am.has(i)||(Am.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),mp(t,`link`,e),Ut(t),r.head.appendChild(t)))}}function Lm(e){Mm.D(e),Im(`dns-prefetch`,e,null)}function Rm(e,t){Mm.C(e,t),Im(`preconnect`,e,t)}function zm(e,t,n){Mm.L(e,t,n);var r=Fm;if(r&&e&&t){var i=`link[rel="preload"][as="`+dn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+dn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+dn(n.imageSizes)+`"]`)):i+=`[href="`+dn(e)+`"]`;var a=i;switch(t){case`style`:a=Gm(e);break;case`script`:a=Ym(e)}if(!(km.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),km.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Km(a))||t===`script`&&r.querySelector(Xm(a))))){var o=r.createElement(`link`);mp(o,`link`,e),t===`style`&&(o[Lt]=!0,o.onload=o.onerror=function(){Wt(o)}),Ut(o),r.head.appendChild(o)}}}function Bm(e,t){Mm.m(e,t);var n=Fm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+dn(r)+`"][href="`+dn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ym(e)}if(!km.has(a)&&(e=w({rel:`modulepreload`,href:e},t),km.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xm(a)))return}r=n.createElement(`link`),mp(r,`link`,e),Ut(r),n.head.appendChild(r)}}}function Vm(e,t,n){Mm.S(e,t,n);var r=Fm;if(r&&e){var i=Ht(r).hoistableStyles,a=Gm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Km(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=km.get(a))&&$m(e,n);var c=o=r.createElement(`link`);Ut(c),mp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hm(e,t){Mm.X(e,t);var n=Fm;if(n&&e){var r=Ht(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=w({src:e,async:!0},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Ut(a),mp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t){Mm.M(e,t);var n=Fm;if(n&&e){var r=Ht(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Ut(a),mp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wm(e,t,n,r){var a=(a=ke.current)?jm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Gm(n.href),t=Ht(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Gm(n.href);var o=Ht(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Km(e)))?o._p||(s.instance=o,s.state.loading=5):(o=km.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},km.set(e,o)),Jm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Ym(n),t=Ht(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Gm(e){return`href="`+dn(e)+`"`}function Km(e){return`link[rel="stylesheet"][`+e+`]`}function qm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Jm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Lt]){r.loading=1;return}}else t=e.createElement(`link`),t[Lt]=!0,t.onload=t.onerror=Wt.bind(null,t),mp(t,`link`,n),Ut(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Ym(e){return`[src="`+dn(e)+`"]`}function Xm(e){return`script[async]`+e}function Zm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+dn(n.href)+`"]`);if(r)return t.instance=r,Ut(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ut(r),mp(r,`style`,a),Qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Gm(n.href);var o=e.querySelector(Km(a));if(o)return t.state.loading|=4,t.instance=o,Ut(o),o;r=qm(n),(a=km.get(a))&&$m(r,a),o=(e.ownerDocument||e).createElement(`link`),Ut(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),mp(o,`link`,r),t.state.loading|=4,Qm(o,n.precedence,e),t.instance=o;case`script`:return o=Ym(n.src),(a=e.querySelector(Xm(o)))?(t.instance=a,Ut(a),a):(r=n,(a=km.get(o))&&(r=w({},n),eh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ut(a),mp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Qm(r,n.precedence,e));return t.instance}function Qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function eh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var th=null;function nh(e,t,n){if(th===null){var r=new Map,i=th=new Map;i.set(n,r)}else i=th,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[It]||a[kt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function rh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ih(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ah(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function oh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function sh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ch(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=sh(t),e.suspenseyImages.push(t)),e=mh.bind(e),t.decode().then(e,e))}function lh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Gm(r.href),a=t.querySelector(Km(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ph.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ut(a);return}a=t.ownerDocument||t,r=qm(r),(i=km.get(i))&&$m(r,i),a=a.createElement(`link`),Ut(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),mp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ph.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var uh=0;function dh(e,t){return e.stylesheets&&e.count===0&&gh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&uh===0&&(uh=62500*vp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>uh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)gh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ph(){this.count--,fh(this)}function mh(){this.imgCount--,fh(this)}var hh=null;function gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hh=new Map,t.forEach(_h,e),hh=null,ph.call(e))}function _h(e,t){if(!(t.state.loading&4)){var n=hh.get(e);if(n)var r=n.get(null);else{n=new Map,hh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ph.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var vh={$$typeof:se,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function yh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function bh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new yh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Bi(3,null,null,t),e.current=a,a.stateNode=e,t=La(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},bo(a),e}function xh(e){return e?(e=Ri,e):Ri}function Sh(e,t,n,r,i,a){i=xh(i),r.context===null?r.context=i:r.pendingContext=i,r=So(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Co(e,r,t),n!==null&&(Wd(n,e,t),wo(n,e,t))}function Ch(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wh(e,t){Ch(e,t),(e=e.alternate)&&Ch(e,t)}function Th(e){if(e.tag===13||e.tag===31){var t=Fi(e,67108864);t!==null&&Wd(t,e,67108864),wh(e,67108864)}}function Eh(e){if(e.tag===13||e.tag===31){var t=Vd();t=wt(t);var n=Fi(e,t);n!==null&&Wd(n,e,t),wh(e,t)}}var Dh=!0;function Oh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,Ah(e,t,n,r)}finally{j.p=a,A.T=i}}function kh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,Ah(e,t,n,r)}finally{j.p=a,A.T=i}}function Ah(e,t,n,r){if(Dh){var i=jh(r);if(i===null)rp(e,t,r,Mh,n),Uh(e,r);else if(Gh(i,e,t,n,r))r.stopPropagation();else if(Uh(e,r),t&4&&-1<Hh.indexOf(e)){for(;i!==null;){var a=Bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ft(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-at(o);s.entanglements[1]|=c,o&=~c}Lf(a),!(sd&6)&&(Ed=qe()+500,Rf(0,!1))}}break;case 31:case 13:s=Fi(a,2),s!==null&&Wd(s,a,2),Yd(),wh(a,2)}if(a=jh(r),a===null&&rp(e,t,r,Mh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else rp(e,t,r,null,n)}}function jh(e){return e=On(e),Nh(e)}var Mh=null;function Nh(e){if(Mh=null,e=zt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 Mh=e,null}function Ph(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Je()){case Ye:return 2;case Xe:return 8;case Ze:case Qe:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Fh=!1,Ih=null,Lh=null,Rh=null,zh=new Map,Bh=new Map,Vh=[],Hh=`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`.split(` `);function Uh(e,t){switch(e){case`focusin`:case`focusout`:Ih=null;break;case`dragenter`:case`dragleave`:Lh=null;break;case`mouseover`:case`mouseout`:Rh=null;break;case`pointerover`:case`pointerout`:zh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Bh.delete(t.pointerId)}}function Wh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Bt(t),t!==null&&Th(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Gh(e,t,n,r,i){switch(t){case`focusin`:return Ih=Wh(Ih,e,t,n,r,i),!0;case`dragenter`:return Lh=Wh(Lh,e,t,n,r,i),!0;case`mouseover`:return Rh=Wh(Rh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return zh.set(a,Wh(zh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Bh.set(a,Wh(Bh.get(a)||null,e,t,n,r,i)),!0}return!1}function Kh(e){var t=zt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){Eh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){Eh(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 qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=jh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Dn=r,n.target.dispatchEvent(r),Dn=null}else return t=Bt(n),t!==null&&Th(t),e.blockedOn=n,!1;t.shift()}return!0}function Jh(e,t,n){qh(e)&&n.delete(t)}function Yh(){Fh=!1,Ih!==null&&qh(Ih)&&(Ih=null),Lh!==null&&qh(Lh)&&(Lh=null),Rh!==null&&qh(Rh)&&(Rh=null),zh.forEach(Jh),Bh.forEach(Jh)}function U(e,n){e.blockedOn===n&&(e.blockedOn=null,Fh||(Fh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Yh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Nh(r||n)===null)continue;break}var a=Bt(n);a!==null&&(e.splice(t,3),t-=3,oc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function W(e){function t(t){return U(t,e)}Ih!==null&&U(Ih,e),Lh!==null&&U(Lh,e),Rh!==null&&U(Rh,e),zh.forEach(t),Bh.forEach(t);for(var n=0;n<Vh.length;n++){var r=Vh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Vh.length&&(n=Vh[0],n.blockedOn===null);)Kh(n),n.blockedOn===null&&Vh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[At]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[At]||null)s=o.formAction;else if(Nh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function Qh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function G(e){this._internalRoot=e}$h.prototype.render=G.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Sh(n,Vd(),e,t,null,null)},$h.prototype.unmount=G.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sh(e.current,2,null,e,null,null),Yd(),t[jt]=null}};function $h(e){this._internalRoot=e}$h.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vh.length&&t!==0&&t<Vh[n].priority;n++);Vh.splice(n,0,e),n===0&&Kh(e)}};var eg=n.version;if(eg!==`19.3.1`)throw Error(i(527,eg,`19.3.1`));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var tg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{nt=ng.inject(tg),rt=ng}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=kc,s=Ac,c=jc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=bh(e,1,!1,null,null,n,r,null,o,s,c,Qh),e[jt]=t.current,tp(e),new G(t)}})),re=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=D()})),ie=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function ae(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:ie(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var oe=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},se=e=>{let t=oe(e);return t.charAt(0).toUpperCase()+t.slice(1)},ce=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},le={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ue(e){return e!=null}function de(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??le.width,a=e.size??e.height??le.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ce(...c):ce(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??le[`stroke-width`])*Number(e.size??e.width??le.width)/Number(t.size??t.width??le.width):t.strokeWidth??le[`stroke-width`];return[`svg`,{...Object.entries(le).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ue(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ue(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ue(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function fe(e,t={}){return de(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var pe=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},O=T(),me=(0,O.createContext)({}),he=()=>(0,O.useContext)(me),ge=(0,O.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=he()??{},y=!!c||pe(d),[b,x,S=[]]=fe(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:ce(v,s),hasA11yProp:y,attributes:d});return(0,O.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,O.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function k(e,t=[],n=[]){let r=typeof e==`string`?ae(e,t,n):e,i=(0,O.forwardRef)(({className:e,...t},n)=>(0,O.createElement)(ge,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=se(r.name)),i}var _e={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};_e.node;var ve=k(_e),ye={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};ye.node;var be=k(ye),A={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};A.node;var j=k(A),xe={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};xe.node;var Se=k(xe),Ce={name:`box`,size:24,node:[[`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`}]]};Ce.node;var we=k(Ce),Te={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};Te.node;var Ee=k(Te),De={name:`building`,size:24,node:[[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M12 6h.01`,key:`1vi96p`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M16 6h.01`,key:`1x0f13`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M8 6h.01`,key:`1dz90k`}],[`path`,{d:`M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3`,key:`cabbwy`}],[`rect`,{x:`4`,y:`2`,width:`16`,height:`20`,rx:`2`,key:`1uxh74`}]]};De.node;var Oe=k(De),ke={name:`camera`,size:24,node:[[`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`}]]};ke.node;var Ae=k(ke),je={name:`castle`,size:24,node:[[`path`,{d:`M10 5V3`,key:`1y54qe`}],[`path`,{d:`M14 5V3`,key:`m6isi`}],[`path`,{d:`M15 21v-3a3 3 0 0 0-6 0v3`,key:`lbp5hj`}],[`path`,{d:`M18 3v8`,key:`2ollhf`}],[`path`,{d:`M18 5H6`,key:`98imr9`}],[`path`,{d:`M22 11H2`,key:`1lmjae`}],[`path`,{d:`M22 9v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9`,key:`1rly83`}],[`path`,{d:`M6 3v8`,key:`csox7g`}]]};je.node;var Me=k(je),Ne={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ne.node;var Pe=k(Ne),Fe={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Fe.node;var Ie=k(Fe),Le={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Le.node;var Re=k(Le),ze={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};ze.node;var Be=k(ze),Ve={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ve.node;var He=k(Ve),Ue={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ue.node;var We=k(Ue),Ge={name:`circle-exclamation-point`,size:24,node:[[`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`}]],aliases:[`alert-circle`,`circle-alert`]};Ge.node;var Ke=k(Ge),qe={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};qe.node;var Je=k(qe),Ye={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};Ye.node;var Xe=k(Ye),Ze={name:`cloud-rain`,size:24,node:[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 14v6`,key:`1j4efv`}],[`path`,{d:`M8 14v6`,key:`17c4r9`}],[`path`,{d:`M12 16v6`,key:`c8a4gj`}]]};Ze.node;var Qe=k(Ze),$e={name:`cloud-sun`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}],[`path`,{d:`M15.947 12.65a4 4 0 0 0-5.925-4.128`,key:`dpwdj0`}],[`path`,{d:`M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z`,key:`s09mg5`}]]};$e.node;var et=k($e),tt={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};tt.node;var nt=k(tt),rt={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};rt.node;var it=k(rt),at={name:`cone`,size:24,node:[[`path`,{d:`m20.9 18.55-8-15.98a1 1 0 0 0-1.8 0l-8 15.98`,key:`53pte7`}],[`ellipse`,{cx:`12`,cy:`19`,rx:`9`,ry:`3`,key:`1ji25f`}]]};at.node;var ot=k(at),st={name:`copy`,size:24,node:[[`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`}]]};st.node;var ct=k(st),lt={name:`cylinder`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5v14a9 3 0 0 0 18 0V5`,key:`aqi0yr`}]]};lt.node;var ut=k(lt),dt={name:`diamond`,size:24,node:[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]};dt.node;var ft=k(dt),pt={name:`donut`,size:24,node:[[`path`,{d:`M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3`,key:`19sr3x`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};pt.node;var mt=k(pt),ht={name:`download`,size:24,node:[[`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`}]]};ht.node;var gt=k(ht),_t={name:`droplets`,size:24,node:[[`path`,{d:`M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z`,key:`1ptgy4`}],[`path`,{d:`M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97`,key:`1sl1rz`}]]};_t.node;var vt=k(_t),yt={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};yt.node;var bt=k(yt),xt={name:`eye-off`,size:24,node:[[`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`}]]};xt.node;var St=k(xt),Ct={name:`eye`,size:24,node:[[`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`}]]};Ct.node;var wt=k(Ct),Tt={name:`file-code`,size:24,node:[[`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 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};Tt.node;var Et=k(Tt),Dt={name:`film`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]};Dt.node;var Ot=k(Dt),kt={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};kt.node;var At=k(kt),jt={name:`flame`,size:24,node:[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]};jt.node;var Mt=k(jt),Nt={name:`focus`,size:24,node:[[`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`}]]};Nt.node;var Pt=k(Nt),Ft={name:`folder-open`,size:24,node:[[`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`}]]};Ft.node;var It=k(Ft),Lt={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Lt.node;var Rt=k(Lt),zt={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};zt.node;var Bt=k(zt),Vt={name:`gem`,size:24,node:[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]};Vt.node;var Ht=k(Vt),Ut={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Ut.node;var Wt=k(Ut),Gt={name:`grid-2x2`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]],aliases:[`grid-2-x-2`]};Gt.node;var Kt=k(Gt),qt={name:`grid-3x3`,size:24,node:[[`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`}]],aliases:[`grid`,`grid-3-x-3`]};qt.node;var Jt=k(qt),Yt={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};Yt.node;var Xt=k(Yt),Zt={name:`hand`,size:24,node:[[`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`}]]};Zt.node;var Qt=k(Zt),$t={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};$t.node;var en=k($t),tn={name:`heart`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]};tn.node;var nn=k(tn),rn={name:`hexagon`,size:24,node:[[`path`,{d:`M21 16V8a2 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:`yt0hxn`}]]};rn.node;var an=k(rn),on={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};on.node;var sn=k(on),cn={name:`images`,size:24,node:[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]};cn.node;var ln=k(cn),un={name:`infinity`,size:24,node:[[`path`,{d:`M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8`,key:`18ogeb`}]]};un.node;var dn=k(un),fn={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};fn.node;var pn=k(fn),mn={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};mn.node;var hn=k(mn),gn={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};gn.node;var _n=k(gn),vn={name:`lamp`,size:24,node:[[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`M4.077 10.615A1 1 0 0 0 5 12h14a1 1 0 0 0 .923-1.385l-3.077-7.384A2 2 0 0 0 15 2H9a2 2 0 0 0-1.846 1.23Z`,key:`1l7kg2`}],[`path`,{d:`M8 20a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1z`,key:`1mmzpi`}]]};vn.node;var yn=k(vn),bn={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};bn.node;var xn=k(bn),Sn={name:`library`,size:24,node:[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]};Sn.node;var Cn=k(Sn),wn={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};wn.node;var Tn=k(wn),En={name:`link-2-off`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]};En.node;var Dn=k(En),On={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};On.node;var kn=k(On),An={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};An.node;var jn=k(An),Mn={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Mn.node;var Nn=k(Mn),Pn={name:`magnet`,size:24,node:[[`path`,{d:`m12 15 4 4`,key:`lnac28`}],[`path`,{d:`M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z`,key:`nlhkjb`}],[`path`,{d:`m5 8 4 4`,key:`j6kj7e`}]]};Pn.node;var Fn=k(Pn),In={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};In.node;var Ln=k(In),Rn={name:`mountain`,size:24,node:[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]};Rn.node;var zn=k(Rn),Bn={name:`mouse-pointer-2`,size:24,node:[[`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`}]]};Bn.node;var Vn=k(Bn),Hn={name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]};Hn.node;var Un=k(Hn),Wn={name:`move-3d`,size:24,node:[[`path`,{d:`M5 3v16h16`,key:`1mqmf9`}],[`path`,{d:`m5 19 6-6`,key:`jh6hbb`}],[`path`,{d:`m2 6 3-3 3 3`,key:`tkyvxa`}],[`path`,{d:`m18 16 3 3-3 3`,key:`1d4glt`}]],aliases:[`move-3-d`]};Wn.node;var Gn=k(Wn),Kn={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};Kn.node;var qn=k(Kn),Jn={name:`party-popper`,size:24,node:[[`path`,{d:`M5.8 11.3 2 22l10.7-3.79`,key:`gwxi1d`}],[`path`,{d:`M4 3h.01`,key:`1vcuye`}],[`path`,{d:`M22 8h.01`,key:`1mrtc2`}],[`path`,{d:`M15 2h.01`,key:`1cjtqr`}],[`path`,{d:`M22 20h.01`,key:`1mrys2`}],[`path`,{d:`m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10`,key:`hbicv8`}],[`path`,{d:`m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17`,key:`1i94pl`}],[`path`,{d:`m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7`,key:`1cofks`}],[`path`,{d:`M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z`,key:`4kbmks`}]]};Jn.node;var Yn=k(Jn),Xn={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Xn.node;var Zn=k(Xn),Qn={name:`pen-tool`,size:24,node:[[`path`,{d:`m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18`,key:`93nyr4`}],[`path`,{d:`M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z`,key:`lnux7s`}],[`path`,{d:`m3 3 6.586 6.586`,key:`1igwcn`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]};Qn.node;var $n=k(Qn),er={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};er.node;var tr=k(er),nr={name:`person-standing`,size:24,node:[[`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`}]]};nr.node;var rr=k(nr),ir={name:`pill`,size:24,node:[[`path`,{d:`m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z`,key:`wa1lgi`}],[`path`,{d:`m8.5 8.5 7 7`,key:`rvfmvr`}]]};ir.node;var ar=k(ir),or={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};or.node;var sr=k(or),cr={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};cr.node;var lr=k(cr),ur={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]};ur.node;var dr=k(ur),fr={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};fr.node;var pr=k(fr),mr={name:`rewind`,size:24,node:[[`path`,{d:`M12 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 12 18z`,key:`2a1g8i`}],[`path`,{d:`M22 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 22 18z`,key:`rg3s36`}]]};mr.node;var hr=k(mr),gr={name:`rotate-3d`,size:24,node:[[`path`,{d:`m15.194 13.707 3.814 1.86-1.86 3.814`,key:`16shm9`}],[`path`,{d:`M16.47214 7.52786 A 5 10 0 1 0 13 21.79796`,key:`1245p8`}],[`path`,{d:`M21.79796 11 A 10 5 0 1 0 19 15.57071`,key:`1i40ks`}]],aliases:[`rotate-3-d`]};gr.node;var _r=k(gr),vr={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};vr.node;var yr=k(vr),br={name:`route`,size:24,node:[[`path`,{d:`M9 5h8.5a1 1 0 010 7h-11a1 1 0 000 7H15`,key:`1r1aam`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`circle`,{cx:`6`,cy:`5`,r:`3`,key:`151irh`}]]};br.node;var xr=k(br),Sr={name:`scale-3d`,size:24,node:[[`path`,{d:`M5 7v11a1 1 0 0 0 1 1h11`,key:`13dt1j`}],[`path`,{d:`M5.293 18.707 11 13`,key:`ezgbsx`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,key:`1gwv83`}]],aliases:[`scale-3-d`]};Sr.node;var Cr=k(Sr),wr={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};wr.node;var Tr=k(wr),Er={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};Er.node;var Dr=k(Er),Or={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Or.node;var kr=k(Or),Ar={name:`shapes`,size:24,node:[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]};Ar.node;var jr=k(Ar),Mr={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Mr.node;var Nr=k(Mr),Pr={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};Pr.node;var Fr=k(Pr),Ir={name:`snowflake`,size:24,node:[[`path`,{d:`m10 20-1.25-2.5L6 18`,key:`18frcb`}],[`path`,{d:`M10 4 8.75 6.5 6 6`,key:`7mghy3`}],[`path`,{d:`m14 20 1.25-2.5L18 18`,key:`1chtki`}],[`path`,{d:`m14 4 1.25 2.5L18 6`,key:`1b4wsy`}],[`path`,{d:`m17 21-3-6h-4`,key:`15hhxa`}],[`path`,{d:`m17 3-3 6 1.5 3`,key:`11697g`}],[`path`,{d:`M2 12h6.5L10 9`,key:`kv9z4n`}],[`path`,{d:`m20 10-1.5 2 1.5 2`,key:`1swlpi`}],[`path`,{d:`M22 12h-6.5L14 15`,key:`1mxi28`}],[`path`,{d:`m4 10 1.5 2L4 14`,key:`k9enpj`}],[`path`,{d:`m7 21 3-6-1.5-3`,key:`j8hb9u`}],[`path`,{d:`m7 3 3 6h4`,key:`1otusx`}]]};Ir.node;var Lr=k(Ir),Rr={name:`sparkle`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}]]};Rr.node;var zr=k(Rr),Br={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Br.node;var Vr=k(Br),Hr={name:`spline`,size:24,node:[[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}],[`path`,{d:`M5 17A12 12 0 0 1 17 5`,key:`1okkup`}]]};Hr.node;var Ur=k(Hr),Wr={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};Wr.node;var Gr=k(Wr),Kr={name:`square-round-corner`,size:24,node:[[`path`,{d:`M21 11a8 8 0 0 0-8-8`,key:`1lxwo5`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1dv2y5`}]]};Kr.node;var qr=k(Kr),Jr={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Jr.node;var Yr=k(Jr),Xr={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Xr.node;var Zr=k(Xr),Qr={name:`sun-dim`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M20 12h.01`,key:`1ykeid`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M4 12h.01`,key:`158zrr`}],[`path`,{d:`M17.657 6.343h.01`,key:`31pqzk`}],[`path`,{d:`M17.657 17.657h.01`,key:`jehnf4`}],[`path`,{d:`M6.343 17.657h.01`,key:`gdk6ow`}],[`path`,{d:`M6.343 6.343h.01`,key:`1uurf0`}]]};Qr.node;var $r=k(Qr),ei={name:`sun`,size:24,node:[[`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`}]]};ei.node;var ti=k(ei),ni={name:`switch-camera`,size:24,node:[[`path`,{d:`M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5`,key:`mtk2lu`}],[`path`,{d:`M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5`,key:`120jsl`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m18 22-3-3 3-3`,key:`kgdoj7`}],[`path`,{d:`m6 2 3 3-3 3`,key:`1fnbkv`}]]};ni.node;var ri=k(ni),ii={name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]};ii.node;var ai=k(ii),oi={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};oi.node;var si=k(oi),ci={name:`trash`,size:24,node:[[`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`}]],aliases:[`trash-2`]};ci.node;var li=k(ci),ui={name:`tree-pine`,size:24,node:[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]};ui.node;var di=k(ui),fi={name:`trees`,size:24,node:[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]};fi.node;var pi=k(fi),mi={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};mi.node;var hi=k(mi),gi={name:`triangle`,size:24,node:[[`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`}]]};gi.node;var _i=k(gi),vi={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};vi.node;var yi=k(vi),bi={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};bi.node;var xi=k(bi),Si={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Si.node;var Ci=k(Si),wi={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};wi.node;var Ti=k(wi),Ei={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Ei.node;var Di=k(Ei),Oi={name:`wind`,size:24,node:[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]};Oi.node;var ki=k(Oi),Ai={name:`wine`,size:24,node:[[`path`,{d:`M8 22h8`,key:`rmew8v`}],[`path`,{d:`M7 10h10`,key:`1101jm`}],[`path`,{d:`M12 15v7`,key:`t2xh3l`}],[`path`,{d:`M12 15a5 5 0 0 0 5-5c0-2-.5-4-2-8H9c-1.5 4-2 6-2 8a5 5 0 0 0 5 5Z`,key:`10ffi3`}]]};Ai.node;var ji=k(Ai),Mi={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Mi.node;var Ni=k(Mi),Pi={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Pi.node;var Fi=k(Pi),Ii={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Ii.node;var Li=k(Ii),Ri=re(),zi=class{files=new Map;constructor(e){for(let[t,n]of Object.entries(e??{}))this.files.set(Vi(t),typeof n==`string`?new TextEncoder().encode(n):n)}async readText(e){return new TextDecoder().decode(await this.readBytes(e))}async readBytes(e){let t=this.files.get(Vi(e));if(!t)throw new Bi(`notFound`,`File not found: ${e}`);return t}async writeText(e,t){this.files.set(Vi(e),new TextEncoder().encode(t))}async writeBytes(e,t){this.files.set(Vi(e),t)}async exists(e){return this.files.has(Vi(e))}async list(e=``){let t=e?Vi(e).replace(/\/?$/,`/`):``;return[...this.files.keys()].filter(e=>e.startsWith(t)).sort()}async remove(e){this.files.delete(Vi(e))}async size(e){return(await this.readBytes(e)).byteLength}},Bi=class extends Error{code;name=`FsError`;constructor(e,t){super(t),this.code=e}};function Vi(e){let t=e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/\/+/g,`/`);if(t.startsWith(`/`)||t.split(`/`).includes(`..`)||/^[a-zA-Z]:/.test(t))throw new Bi(`invalidPath`,`Invalid project path: ${e}`);return t}var Hi=`0.5.0`,Ui=Hi,M=class extends Error{code;hint;details;name=`OpsError`;constructor(e,t,n,r){super(t),this.code=e,this.hint=n,this.details=r}toJSON(){return{code:this.code,message:this.message,...this.hint?{hint:this.hint}:{},...this.details===void 0?{}:{details:this.details}}}};function Wi(e,t,n){let r=t.filter(e=>e.severity===`error`),i=r[0];return new M(`validation`,`${e} ${r.length} error${r.length===1?``:`s`}${i?`, first: ${i.path?`${i.path}: `:``}${i.message}`:``}`,n??i?.hint??`Fix the listed issues (details.issues) and retry.`,{issues:t})}var Gi=e=>e.some(e=>e.severity===`error`);function Ki(){return new Date().toISOString()}async function qi(e,t,n){let r;try{r=await e.readText(t)}catch(e){throw e instanceof Bi&&e.code===`notFound`?new M(`notFound`,`${n} not found (${t}).`,t===`agent3d.json`||t===`scene.json`?"This folder is not an Agent3D project: create one with `agent3d new <dir>` (tool project_create) or pass --project <dir>.":void 0):new M(`io`,`Cannot read ${t}: ${e.message}`)}try{return JSON.parse(r)}catch(e){throw new M(`invalid`,`${t} is not valid JSON: ${e.message}`,`Fix the JSON syntax in ${t} (trailing commas and comments are not allowed).`)}}async function Ji(e,t,n){await e.writeText(t,`${JSON.stringify(n,null,2)}\n`)}async function Yi(e,t,n){return await e.exists(t)?qi(e,t,t):n}var Xi=e=>Math.round(e/1024*10)/10;function Zi(e,t){if(e===t)return 0;if(!e.length)return t.length;if(!t.length)return e.length;let n=Array.from({length:t.length+1},(e,t)=>t);for(let r=1;r<=e.length;r++){let i=[r];for(let a=1;a<=t.length;a++)i[a]=Math.min(n[a]+1,i[a-1]+1,n[a-1]+(e[r-1]===t[a-1]?0:1));n=i}return n[t.length]}function Qi(e,t){let n=e.toLowerCase(),r,i=1/0;for(let e of t){let t=e.toLowerCase();if(t===n)return e;let a=Zi(n,t);t.startsWith(n)||n.startsWith(t)?a=Math.min(a,1.5):n.length>=4&&(t.includes(n)||n.includes(t))&&(a=Math.min(a,2)),a<i&&(i=a,r=e)}let a=Math.max(2,Math.floor(n.length/3));return i<=a?r:void 0}function N(e,t){let n=Qi(e,t);return n?`Did you mean "${n}"? `:``}function P(e,t=40){let n=e.slice(0,t).map(e=>`"${e}"`).join(`, `);return e.length>t?`${n}, … (${e.length} total)`:n}var $i=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function ea(e){return typeof e==`string`&&$i.test(e)}function ta(e,t=`item`){let n=e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``).replace(/-{2,}/g,`-`);return n?/^[a-z]/.test(n)?n:`${t}-${n}`:t}function na(e,t){let n=new Set(t),r=ea(e)?e:ta(e);if(!n.has(r))return r;for(let e=2;;e++)if(!n.has(`${r}-${e}`))return`${r}-${e}`}var ra=/^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/;function ia(e){if(typeof e!=`string`)return null;let t=ra.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return!(n>0)||!(r>0)?null:{width:n,height:r,ratio:n/r}}function aa(e){return ia(e)!==null}function oa(e,t){let n=ia(e)??{ratio:16/9};return{width:Math.round(t),height:Math.max(1,Math.round(t/n.ratio))}}var sa={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`00ffff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000000`,blanchedalmond:`ffebcd`,blue:`0000ff`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`00ffff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`ff00ff`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`778899`,lightslategrey:`778899`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`00ff00`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`ff00ff`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`ff0000`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`ffffff`,whitesmoke:`f5f5f5`,yellow:`ffff00`,yellowgreen:`9acd32`},ca=(e,t,n)=>Math.min(n,Math.max(t,e));function la(e){if(!/^[0-9a-f]+$/i.test(e)||((e.length===3||e.length===4)&&(e=[...e].map(e=>e+e).join(``)),e.length!==6&&e.length!==8))return null;let t=t=>parseInt(e.slice(t,t+2),16);return{r:t(0),g:t(2),b:t(4),a:e.length===8?t(6)/255:1}}function F(e,t){let n=/^(-?\d*\.?\d+(?:e-?\d+)?)(%?)$/i.exec(e.trim());if(!n)return null;let r=Number(n[1]);return n[2]?r/100*t:r}function ua(e){let t=/^(-?\d*\.?\d+)(deg|rad|turn|grad)?$/i.exec(e.trim());if(!t)return null;let n=Number(t[1]);switch((t[2]??`deg`).toLowerCase()){case`rad`:return n*180/Math.PI;case`turn`:return n*360;case`grad`:return n*.9;default:return n}}function da(e){let t=e.split(`/`);if(t.length>2)return null;let n=(t[0].includes(`,`)?t[0].split(`,`):t[0].trim().split(/\s+/)).map(e=>e.trim()).filter(e=>e!==``);return t.length===2&&n.push(t[1].trim()),n}function fa(e,t,n){e=(e%360+360)%360;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,[o,s,c]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i];return[(o+a)*255,(s+a)*255,(c+a)*255]}function pa(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();if(!t)return null;if(t.startsWith(`#`))return la(t.slice(1));if(t===`transparent`)return{r:0,g:0,b:0,a:0};let n=sa[t];if(n)return la(n);let r=/^(rgba?|hsla?)\((.*)\)$/.exec(t);if(!r)return null;let i=da(r[2]);if(!i||i.length!==3&&i.length!==4)return null;let a=i.length===4?F(i[3],1):1;if(a===null)return null;if(r[1].startsWith(`rgb`)){let[e,t,n]=i.slice(0,3).map(e=>F(e,255));return e===null||t===null||n===null?null:{r:ca(e,0,255),g:ca(t,0,255),b:ca(n,0,255),a:ca(a,0,1)}}let o=ua(i[0]),s=F(i[1],1),c=F(i[2],1);if(o===null||s===null||c===null||!i[1].trim().endsWith(`%`)||!i[2].trim().endsWith(`%`))return null;let[l,u,d]=fa(o,ca(s,0,1),ca(c,0,1));return{r:l,g:u,b:d,a:ca(a,0,1)}}function ma(e){return pa(e)!==null}function ha({r:e,g:t,b:n}){return`#`+[e,t,n].map(e=>Math.round(ca(e,0,255)).toString(16).padStart(2,`0`)).join(``)}function ga(e){let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function _a(e,t){let n=ga(e),r=ga(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function va(e){let t=pa(e);return t?_a(t,{r:255,g:255,b:255,a:1})>=_a(t,{r:17,g:19,b:24,a:1})?`#ffffff`:`#111318`:`#ffffff`}var ya=[`linear`,...[`Quad`,`Cubic`,`Quart`,`Quint`,`Sine`,`Expo`,`Circ`,`Back`,`Elastic`,`Bounce`].flatMap(e=>[`in${e}`,`out${e}`,`inOut${e}`]),`step`],ba=[`outCubic`,`inOutSine`,`outBack`,`cubicBezier(0.22, 1, 0.36, 1)`,`spring(170, 18)`,`steps(4)`],xa=new Map;function Sa(e,t){let n=RegExp(`^${t}\\s*\\(([^)]*)\\)$`).exec(e);return n?n[1].split(`,`).map(e=>e.trim()):null}var Ca=e=>e!==``&&Number.isFinite(Number(e));function wa(e){let t=xa.get(e);if(t)return t;let n=Ta(e.trim());return xa.size<500&&xa.set(e,n),n}function Ta(e){if(ya.includes(e))return{kind:`named`,name:e};if(e.startsWith(`cubicBezier`)){let t=Sa(e,`cubicBezier`);if(!t||t.length!==4||!t.every(Ca))return{error:`cubicBezier needs 4 numbers: "cubicBezier(x1, y1, x2, y2)", e.g. "cubicBezier(0.22, 1, 0.36, 1)".`};let[n,r,i,a]=t.map(Number);return n<0||n>1||i<0||i>1?{error:`cubicBezier x1 and x2 must be between 0 and 1 (y1, y2 may overshoot).`}:{kind:`cubicBezier`,x1:n,y1:r,x2:i,y2:a}}if(e===`spring`)return{kind:`spring`,stiffness:170,damping:18,mass:1};if(e.startsWith(`spring`)){let t=Sa(e,`spring`);if(!t||t.length<2||t.length>3||!t.every(Ca))return{error:`spring takes stiffness, damping (and optional mass): "spring(170, 18)" (lower damping = more bounce).`};let[n,r,i=1]=t.map(Number);return!(n>0)||!(r>0)||!(i>0)?{error:`spring stiffness, damping and mass must be > 0.`}:{kind:`spring`,stiffness:n,damping:r,mass:i}}if(e.startsWith(`steps`)){let t=Sa(e,`steps`);return!t||t.length<1||t.length>2||!Ca(t[0])||!Number.isInteger(Number(t[0]))||Number(t[0])<1||t[1]!==void 0&&t[1]!==`start`&&t[1]!==`end`?{error:`steps takes a whole number ≥ 1 and optionally "start" or "end": "steps(4)", "steps(4, start)".`}:{kind:`steps`,count:Number(t[0]),jumpStart:t[1]===`start`}}return{error:`Unknown easing "${e}".`}}function Ea(e){return typeof e==`string`&&e.startsWith(`library:`)}function Da(e){return e.slice(8)}function Oa(e,t){return e?.assets.find(e=>e.id===t)}var ka=(e,t,n)=>({type:`number`,default:e,min:t,max:n}),Aa={fog:{needsDepth:!0,params:{color:{type:`color`,default:`#ffffff`},amount:ka(.6,0,1),start:ka(.7,0,1),end:ka(0,0,1),drift:ka(.3,0)}},light:{needsDepth:!1,params:{color:{type:`color`,default:`#ffffff`},intensity:ka(1,0),ambient:ka(.75,0,1),position:{type:`vec2`,default:[.4,.4],min:-1,max:1},height:ka(.6,0),radius:ka(.8,0),relief:ka(1,0),specular:ka(.25,0,1),follow:{type:`enum`,default:`pointer`,options:[`pointer`,`auto`,`none`],animatable:!1}}},reveal:{needsDepth:!0,alpha:!0,params:{progress:ka(1,0,1),from:{type:`enum`,default:`far`,options:[`near`,`far`],animatable:!1},softness:ka(.15,0,1),duration:ka(void 0,0),delay:ka(0,0)}},blur:{needsDepth:!1,params:{focus:ka(void 0,0,1),amount:ka(.6,0,5),range:ka(.1,0,1),to:ka(void 0,0,1),duration:ka(void 0,0),delay:ka(0,0)}},frame:{needsDepth:!1,alpha:!0,params:{inset:{type:`vec2`,default:[.12,.12],min:0,max:.45,scalar:!0},threshold:ka(.6,0,1),softness:ka(.04,0,1),border:ka(.015,0,.2),color:{type:`color`,default:`#ffffff`},shadow:ka(.35,0,1)}}},ja=Object.keys(Aa),Ma=[`low`,`medium`,`high`,`ultra`],Na={low:1,medium:1.5,high:2,ultra:3};function Pa(e,t={}){return e&&e!==`auto`?e:t.deterministic?`high`:t.gpu&&/swiftshader|llvmpipe|softpipe|software|microsoft basic render/i.test(t.gpu)?`low`:t.mobile?(t.memoryGb??4)<=2||(t.cores??8)<=4?`low`:`medium`:t.cores!==void 0&&t.cores<=2||t.memoryGb!==void 0&&t.memoryGb<=2?`low`:t.cores!==void 0&&t.cores<=4||t.memoryGb!==void 0&&t.memoryGb<=4||t.gpu&&/intel|mali|adreno|powervr/i.test(t.gpu)?`medium`:`high`}var Fa=new Set([`strength`,`intensity`,`darkness`,`amount`,`toning`,`streaks`,`ghosts`,`halo`,`bleach`,`scanlines`]);function Ia(e){if(!e?.length)return[];let t=new Map,n=new Map;for(let r of e){if(!r||typeof r.type!=`string`)continue;if(r.type!==`look`){t.has(r.type)||t.set(r.type,r);continue}let e=p[String(r.preset??`cinematic`)];if(!e)continue;let i=typeof r.intensity==`number`?Math.max(0,Math.min(1,r.intensity)):1;for(let t of e.effects){if(n.has(t.type))continue;let e={...t};if(i!==1){for(let[n,r]of Object.entries(t))Fa.has(n)&&typeof r==`number`&&(e[n]=r*i);t.type===`grading`&&t.look&&(e.intensity=i)}n.set(t.type,e)}}let r=[],i=new Set,a=e=>{if(i.has(e))return;i.add(e);let a=t.get(e),o=n.get(e);r.push(a&&o?{...o,...a}:a??o)};for(let n of e)if(n&&typeof n.type==`string`){if(n.type!==`look`)a(n.type);else for(let e of p[String(n.preset??`cinematic`)]?.effects??[])t.has(e.type)||a(e.type)}return r}function La(e){let t={exposure:0,contrast:1,saturation:1,vibrance:0,temperature:0,tint:0,lift:0,gamma:1,gain:1,toning:0,bleach:0},n=e.look&&e.look!==`none`?f[e.look]:void 0,r=typeof e.intensity==`number`?Math.max(0,Math.min(1,e.intensity)):1,i={...t};if(n)for(let[e,a]of Object.entries(n.values))i[e]=typeof a==`number`?t[e]+(a-t[e])*r:a;for(let[t,n]of Object.entries(e))t!==`type`&&t!==`look`&&t!==`intensity`&&(typeof n==`number`||typeof n==`string`)&&(i[t]=n);return i}var Ra={low:0,medium:1,high:2};function za(e){switch(e){case`low`:return{tier:e,dprCap:Na.low,msaa:0,effectScale:.5,maxCost:`medium`,aoSamples:8,dofSamples:16,rays:24,maxStillSamples:4};case`medium`:return{tier:e,dprCap:Na.medium,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:12,dofSamples:24,rays:32,maxStillSamples:8};case`ultra`:return{tier:e,dprCap:Na.ultra,msaa:8,effectScale:1,maxCost:`high`,aoSamples:24,dofSamples:64,rays:64,maxStillSamples:64};default:return{tier:`high`,dprCap:Na.high,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:16,dofSamples:40,rays:48,maxStillSamples:32}}}function Ba(e){let t=Ma.indexOf(e);return t>0?Ma[t-1]:null}function Va(e){return v(`postfx`,e)?.gpu??`low`}function Ha(e,t){let n=Ra[za(t).maxCost],r=[],i=[];for(let t of Ia(e))Ra[Va(t.type)]>n?i.push(t.type):r.push(t);return{active:r,dropped:i}}var Ua={ao:5,dof:4,bloom:3,smaa:3,godrays:2,lensflare:2,outline:1,tiltshift:2,fxaa:1,pixelate:1,halftone:1,ascii:1,glitch:1,taa:0,grading:0,vignette:0,film:0,chromatic:0,sharpen:0},Wa=3,Ga=new Set([`grading`,`vignette`,`film`,`chromatic`,`sharpen`]),Ka=new Set([`ao`,`dof`,`godrays`,`outline`]);function qa(e){let t=Ia(e),n=t.map(e=>({type:e.type,gpu:Va(e.type),passes:Ua[e.type]??1})),r=t.some(e=>Ka.has(e.type)),i=t.length?2:0;for(let e of n)i+=e.passes;r&&(i+=Wa),t.some(e=>Ga.has(e.type))&&(i+=.5);let a=t.length?i<=6?`light`:i<=14?`moderate`:`heavy`:`none`;return{effects:n,passes:Math.round(i*10)/10,scenePrepass:r,level:a,dropped:{low:Ha(e,`low`).dropped}}}var Ja=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Ya=e=>typeof e==`number`&&Number.isFinite(e),Xa=e=>{let t=JSON.stringify(e);return t===void 0?String(e):t.length>60?`${t.slice(0,57)}…`:t},Za=[`duration`,`loop`,`autoplay`,`trigger`,`speed`,`markers`,`segments`,`scroll`,`tracks`],Qa=[`target`,`keys`,`ease`,`stagger`,`staggerFrom`,`colorSpace`],$a=[`oklch`,`oklab`,`rgb`,`hsl`],eo=[`start`,`end`,`center`,`edges`,`random`],to=[`click`,`hover`,`hoverEnd`,`visible`,`scroll`,`key`,`event`],no=[`play`,`toggle`,`seek`,`set`,`emit`,`openUrl`,`playClip`],ro=[`dolly`,`pushIn`,`pullOut`,`truck`,`pedestal`,`crane`,`orbit`,`zoom`,`move`,`path`,`lookAt`,`focus`],io=[`type`,`at`,`duration`,`ease`,`distance`,`height`,`angle`,`elevation`,`fov`,`position`,`target`,`points`,`lookAhead`,`lookAt`,`object`,`focus`],ao=[`position`,`rotation`,`scale`],oo=[`x`,`y`,`z`],so={opacity:`number`,color:`color`,emissive:`color`,emissiveIntensity:`number`,metalness:`number`,roughness:`number`,transmission:`number`,thickness:`number`,ior:`number`,iridescence:`number`,iridescenceIOR:`number`,clearcoat:`number`,clearcoatRoughness:`number`,sheen:`number`,sheenColor:`color`,sheenRoughness:`number`,specularIntensity:`number`,specularColor:`color`,envMapIntensity:`number`,attenuationColor:`color`,attenuationDistance:`number`,dispersion:`number`,anisotropy:`number`,anisotropyRotation:`number`,wireframe:`boolean`},co={position:`vec3`,target:`vec3`,fov:`number`,zoom:`number`,focus:`number`},lo={intensity:`number`,color:`color`,position:`vec3`,target:`vec3`,visible:`boolean`,angle:`number`,penumbra:`number`,distance:`number`,decay:`number`,groundColor:`color`,width:`number`,height:`number`},uo={"fog.color":`color`,"fog.near":`number`,"fog.far":`number`,"fog.density":`number`,lightingIntensity:`number`,exposure:`number`,background:`color`},fo=/^\s*[+\-*]=\s*-?\d*\.?\d+(?:e[+-]?\d+)?\s*$/i,po=e=>typeof e==`string`&&fo.test(e);function mo(e,t){let n=e.indexOf(`.`);if(n<1)return{error:{message:`Track target "${e}" must be "<id>.<property>".`,hint:`Examples: "logo.position", "logo.rotation.y", "logo.material.opacity", "camera.position", "key.intensity", "tag:letter.position.y".`}};let r=e.slice(0,n),i=e.slice(n+1);if(r===`camera`){let e=co[i];return/^(position|target)\.[xyz]$/.test(i)?{kind:`number`}:e?{kind:e}:{error:{message:`Camera property "${i}" is not animatable.`,hint:`${N(i,Object.keys(co))}Use one of: ${P(Object.keys(co))} (or position.x …).`}}}if(r===`environment`){let e=uo[i];return e?{kind:e}:{error:{message:`Environment property "${i}" is not animatable.`,hint:`${N(i,Object.keys(uo))}Use one of: ${P(Object.keys(uo))}.`}}}if(r===`postfx`){let[n,r,...a]=i.split(`.`),o=d.postfx.find(e=>e.id===n);if(!o||!r||a.length)return{error:{message:`Post effect track "${e}" must be "postfx.<type>.<param>".`,hint:`${n?N(n,d.postfx.map(e=>e.id)):``}Example: "postfx.bloom.strength", "postfx.dof.focus".`}};if(t.postfx&&!t.postfx.has(n))return{error:{message:`"${e}" animates post effect "${n}", which is not in scene.postfx (nor brought by a look preset).`,hint:`Add { "type": "${n}" } to postfx first (or a look that includes it — see agent3d catalog postfx look).`}};let s=o.params.find(e=>e.name===r);if(!s||s.type!==`number`&&s.type!==`integer`&&s.type!==`color`){let e=o.params.filter(e=>e.type===`number`||e.type===`integer`||e.type===`color`).map(e=>e.name);return{error:{message:`Parameter "${r}" of post effect "${n}" is not animatable.`,hint:`${N(r,e)}Animatable: ${P(e)}.`}}}return{kind:s.type===`color`?`color`:`number`}}let a;if(r.startsWith(`tag:`)){let e=r.slice(4);if(t.tags&&!t.tags.has(e))return{error:{message:`No object has the tag "${e}" (selector "${r}").`,hint:`${N(e,t.tags)}Add "tags": ["${e}"] to the objects to animate.`}};a=[]}else if(r.startsWith(`children:`)){let e=r.slice(9);if(!t.objects.has(e))return{error:{message:`Selector "${r}" refers to "${e}", which is not an object id.`,hint:`${N(e,t.objects)}Use "children:<group id>".`}};if(t.parents&&!t.parents.has(e))return{error:{message:`"${e}" has no children (selector "${r}").`,hint:`Use children:<id> on a group with children (text letters count too).`}};a=[]}else a=r.split(`,`).map(e=>e.trim());let o;for(let n of a){let r=ho(n,i,t,e);if(r.error)return r;o??=r.warning}return a.length?{kind:ho(a[0],i,t,e).kind,...o?{warning:o}:{}}:_o(i,!0)}function ho(e,t,n,r){if(n.lights.has(e)&&!n.objects.has(e)){let e=lo[t];return/^(position|target)\.[xyz]$/.test(t)?{kind:`number`}:e?{kind:e}:{error:{message:`Light property "${t}" is not animatable.`,hint:`${N(t,Object.keys(lo))}Use one of: ${P(Object.keys(lo))}.`}}}let i=e,a=/^([a-zA-Z][a-zA-Z0-9_-]*)\/(\d+)$/.exec(e);if(a){if(!n.objects.has(a[1]))return{error:{message:`Track target "${r}" refers to letter ${a[2]} of "${a[1]}", which is not an object id.`,hint:`${N(a[1],n.objects)}Letters are addressed "<textId>/<n>" (n = 0, 1, … over non-space characters).`}};if(n.letters&&!n.letters.has(a[1]))return{error:{message:`"${a[1]}" is not split into letters, so "${e}" does not exist.`,hint:`Set "splitLetters": true (or a "reveal") on the text object "${a[1]}".`}};i=a[1];let o=n.letterCounts?.get(a[1]);if(o!==void 0&&Number(a[2])>=o){let r=mo(`${a[1]}.${t}`,n);return r.error?r:{kind:r.kind,warning:{message:`"${e}" is out of range: "${a[1]}" has ${o} letter${o===1?``:`s`} (${a[1]}/0 … ${a[1]}/${Math.max(0,o-1)}), so this target animates nothing.`,hint:`Letters are numbered from 0 over non-space characters. Use ${a[1]}/${Math.max(0,o-1)} for the last one, or "children:${a[1]}.${t}" for all of them.`}}}}if(!n.objects.has(i)){let t=[...n.objects,...n.lights,`camera`,`environment`,`postfx`];return{error:{message:`Track target "${r}" refers to "${e}", which is not an object id, a light id, "camera", "environment" or "postfx".`,hint:`${N(e,t)}Known ids: ${P(t)}. Several targets: "a,b,c.<prop>", "tag:<tag>.<prop>", "children:<id>.<prop>".`}}}let o=t.split(`.`);return o[0]===`morph`||o[0]===`animation`?n.models&&!n.models.has(i)?{error:{message:`"${t}" needs a model object; "${i}" is not one.`,hint:`morph.<name> and animation.<clip>.weight|speed|time animate glTF models (kind "model").`}}:o[0]===`morph`&&o.length>=2||o[0]===`animation`&&o.length>=3&&[`weight`,`speed`,`time`].includes(o[o.length-1])?{kind:`number`}:{error:{message:`Invalid model track "${t}".`,hint:`Use "morph.<name>" (0..1) or "animation.<clip>.weight" | ".speed" | ".time".`}}:o[0]===`effects`?go(i,o.slice(1),n):o[0]===`motion`?n.photos&&!n.photos.has(i)?{error:{message:`"${t}" needs a photo object; "${i}" is not one.`,hint:`motion.progress (0..1) drives the auto move of a 3D photo (kind "photo").`}}:t===`motion.progress`?{kind:`number`}:{error:{message:`Photo motion property "${t}" is not animatable.`,hint:`${N(t,[`motion.progress`])}Use "motion.progress" (0..1 along the photo's motion.auto move).`}}:_o(t,!1)}function go(e,t,n){let r=n.photoEffects?.get(e);if(n.photoEffects&&!r)return{error:{message:`"${e}" is not a 3D photo: effects.* tracks animate photo effects.`,hint:`Use "<photoId>.effects.<effect>.<param>" on a kind "photo" object.`}};let[i,a,o,...s]=t,c=Aa[i];if(!c)return{error:{message:`Unknown photo effect "${i??``}".`,hint:`${N(i??``,ja)}Effects: ${P(ja)}.`}};if(r&&!r.has(i))return{error:{message:`"${e}" has no ${i} effect, so this track animates nothing.`,hint:`Add "effects": { "${i}": {} } to the photo "${e}" first.`}};let l=c.params,u=Object.keys(l).filter(e=>l[e].animatable!==!1),d=a?l[a]:void 0;return!d||d.animatable===!1||s.length?{error:{message:`Photo effect property "${i}.${a??``}" is not animatable.`,hint:`${N(a??``,u)}Animatable ${i} params: ${P(u)}.`}}:o===void 0?{kind:d.type===`vec2`?`vec2`:d.type===`color`?`color`:`number`}:d.type===`vec2`&&(o===`x`||o===`y`)?{kind:`number`}:{error:{message:`"${i}.${a}.${o}" is not animatable.`,hint:d.type===`vec2`?`Use ".x" or ".y".`:`Animate "${i}.${a}" itself.`}}}function _o(e,t){let n=e.split(`.`);if(ao.includes(n[0])){if(n.length===1)return{kind:n[0]===`scale`?`number|vec3`:`vec3`};if(n.length===2&&oo.includes(n[1]))return{kind:`number`}}if(e===`visible`)return{kind:`boolean`};if(n[0]===`material`){if(n.length===2&&so[n[1]])return{kind:so[n[1]]};if(n.length===3&&n[1]===`uniforms`)return{kind:`number`}}if(t&&(n[0]===`morph`||n[0]===`animation`||e===`motion.progress`))return{kind:`number`};let r=[`position`,`position.x`,`rotation`,`rotation.y`,`scale`,`visible`,...Object.keys(so).map(e=>`material.${e}`),`material.uniforms.<name>`,`morph.<name>`,`animation.<clip>.weight`,`motion.progress`];return{error:{message:`Property "${e}" is not animatable.`,hint:`${N(e,r)}Animatable: ${P(r)}.`}}}function vo(e,t){let n=e=>Ya(e)||po(e),r=e=>Array.isArray(e)&&e.length===3&&e.every(n);switch(e){case`vec3`:return r(t)||po(t);case`vec2`:return Array.isArray(t)&&t.length===2&&t.every(n);case`number`:return n(t);case`color`:return ma(t);case`boolean`:return typeof t==`boolean`;case`number|vec3`:return n(t)||r(t)}}var yo={vec3:`[0, 1, 0] or ["+=0", "+=1", "+=0"]`,vec2:`[0.4, -0.2]`,number:`1.5 or "+=1"`,color:`"#ff8800"`,boolean:`true`,"number|vec3":`1.2, [1, 2, 1] or "*=1.2"`},bo=class{issues=[];add(e,t,n,r,i){this.issues.push(i?{severity:e,code:t,path:n,message:r,hint:i}:{severity:e,code:t,path:n,message:r})}error(e,t,n,r){this.add(`error`,e,t,n,r)}warn(e,t,n,r){this.add(`warning`,e,t,n,r)}unknownKeys(e,t,n,r){for(let i of Object.keys(e)){if(t.includes(i))continue;let e=Qi(i,t);this.warn(`unknown-field`,`${n}.${i}`,`Unknown field "${i}" on ${r} (ignored by the runtime).`,e?`Did you mean "${e}"? Otherwise remove it.`:`Remove it. Valid fields: ${P(t)}.`)}}number(e,t,n={}){return e===void 0?!0:Ya(e)?n.min!==void 0&&(n.exclusiveMin?e<=n.min:e<n.min)?(this.error(`range`,t,`${e} is below the minimum (${n.exclusiveMin?`>`:`≥`} ${n.min}).`),!1):n.max!==void 0&&e>n.max?(this.error(`range`,t,`${e} is above the maximum (${n.max}).`),!1):!0:(this.error(`type`,t,`Expected a number, got ${Xa(e)}.`),!1)}vec(e,t){return e===void 0||Array.isArray(e)&&e.length===3&&e.every(Ya)?!0:(this.error(`vec`,t,`Expected [x, y, z] (3 numbers), got ${Xa(e)}.`,`Write it as an array of 3 numbers, e.g. [0, 1.5, 0].`),!1)}ease(e,t){if(e===void 0)return;if(typeof e!=`string`)return this.error(`type`,t,`Expected an easing name, got ${Xa(e)}.`,`Examples: ${ba.map(e=>`"${e}"`).join(`, `)}.`);let n=wa(e);`error`in n&&this.error(`enum`,t,`Invalid easing ${Xa(e)}: ${n.error}`,`${N(e,ya)}Named: ${P(ya)}; parametric: "cubicBezier(x1, y1, x2, y2)", "spring(stiffness, damping)", "steps(n)".`)}loop(e,t){e!==void 0&&typeof e!=`boolean`&&e!==`pingpong`&&this.error(`enum`,t,`Invalid loop ${Xa(e)}.`,`Use true, false or "pingpong".`)}};function xo(e,t){let n=new Set,r=new Set,i=new Set,a=new Set,o=new Map,s=e=>{if(Array.isArray(e)){for(let t of e)if(Ja(t)&&typeof t.id==`string`){if(Array.isArray(t.tags))for(let e of t.tags)typeof e==`string`&&n.add(e);t.kind===`model`&&r.add(t.id),t.kind===`photo`&&o.set(t.id,new Set(Ja(t.effects)?Object.keys(t.effects):[])),t.kind===`photo`&&a.add(t.id),(Array.isArray(t.children)&&t.children.length||t.kind===`text`&&(t.splitLetters===!0||Ja(t.reveal)))&&i.add(t.id),s(t.children)}}};s(e.objects);let c=new Set;if(Array.isArray(e.postfx))for(let t of Ia(e.postfx.filter(e=>Ja(e)&&typeof e.type==`string`)))c.add(t.type);return{...t,tags:n,models:r,photos:a,parents:i,postfx:c,photoEffects:o}}var So=[`load`,`visible`,`hover`,`click`,`scroll`,`manual`],Co=/^(top|center|bottom|-?\d*\.?\d+%|-?\d*\.?\d+px)\s+(top|center|bottom|-?\d*\.?\d+%|-?\d*\.?\d+px)$/;function wo(e,t,n){if(!Ja(t))return e.error(`type`,`timeline`,`timeline must be an object.`,`Example: { "duration": 4, "loop": true, "tracks": [] }.`);e.unknownKeys(t,Za,`timeline`,`the timeline`),t.duration===void 0||t.duration===null?e.error(`required`,`timeline.duration`,`Missing required field "duration" (length in seconds).`,`Add "duration": length in seconds.`):e.number(t.duration,`timeline.duration`,{min:0,exclusiveMin:!0}),e.loop(t.loop,`timeline.loop`);let r=Ya(t.duration)?t.duration:1/0,i=Ja(t.markers)?t.markers:{},a=Ja(t.segments)?t.segments:{};if(t.trigger!==void 0&&!So.includes(t.trigger)&&e.error(`enum`,`timeline.trigger`,`Invalid value ${Xa(t.trigger)}.`,`${typeof t.trigger==`string`?N(t.trigger,So):``}Valid values: ${P(So)}.`),t.autoplay!==void 0&&typeof t.autoplay!=`boolean`&&(typeof t.autoplay==`string`?t.autoplay in a||e.error(`unknown-ref`,`timeline.autoplay`,`autoplay "${t.autoplay}" is not a segment.`,`${N(t.autoplay,Object.keys(a))}Define it in timeline.segments, e.g. "segments": { "${t.autoplay}": { "from": 0, "to": 2 } }.`):e.error(`type`,`timeline.autoplay`,`Expected true, false or a segment name, got ${Xa(t.autoplay)}.`)),e.number(t.speed,`timeline.speed`,{min:0,exclusiveMin:!0}),t.markers!==void 0){if(!Ja(t.markers))e.error(`type`,`timeline.markers`,`markers must be an object { name: time }.`,`Example: "markers": { "reveal": 1.2, "end": 4 }.`);else for(let[t,n]of Object.entries(i))e.number(n,`timeline.markers.${t}`,{min:0})&&Ya(n)&&n>r&&e.warn(`range`,`timeline.markers.${t}`,`Marker "${t}" (${n}s) is after timeline.duration (${r}s).`,`Move it inside the timeline.`)}let o=(t,n)=>{Ya(t)?(t<0||t>r)&&e.error(`range`,n,`${t}s is outside the timeline (0..${r}s).`):typeof t==`string`?t in i||e.error(`unknown-ref`,n,`"${t}" is not a marker.`,`${N(t,Object.keys(i))}Use seconds or a name from timeline.markers (${P(Object.keys(i))}).`):e.error(`type`,n,`Expected seconds or a marker name, got ${Xa(t)}.`)};if(t.segments!==void 0){if(!Ja(t.segments))e.error(`type`,`timeline.segments`,`segments must be an object { name: { from, to } }.`,`Example: "segments": { "intro": { "from": 0, "to": 2 }, "hover-in": [2, 2.6] }.`);else for(let[t,n]of Object.entries(a)){let r=`timeline.segments.${t}`;t===`timeline`&&e.error(`reserved`,r,`"timeline" is reserved (it plays the whole timeline).`,`Rename the segment.`),Array.isArray(n)?n.length===2?(o(n[0],`${r}[0]`),o(n[1],`${r}[1]`)):e.error(`type`,r,`A segment array is [from, to], got ${Xa(n)}.`):Ja(n)?(e.unknownKeys(n,[`from`,`to`,`loop`,`speed`],r,`a segment`),o(n.from,`${r}.from`),o(n.to,`${r}.to`),e.loop(n.loop,`${r}.loop`),e.number(n.speed,`${r}.speed`,{min:0,exclusiveMin:!0})):e.error(`type`,r,`Expected { "from", "to" } or [from, to], got ${Xa(n)}.`)}}if(t.scroll!==void 0){if(!Ja(t.scroll))e.error(`type`,`timeline.scroll`,`scroll must be an object.`,`Example: { "start": "top bottom", "end": "bottom top", "smoothing": 0.8 }.`);else{e.unknownKeys(t.scroll,[`start`,`end`,`smoothing`],`timeline.scroll`,`timeline.scroll`);for(let n of[`start`,`end`]){let r=t.scroll[n];r===void 0||typeof r==`string`&&Co.test(r.trim())||e.error(`type`,`timeline.scroll.${n}`,`Invalid scroll position ${Xa(r)}.`,`"<element edge> <viewport edge>", edges top | center | bottom | N% | Npx, e.g. "top bottom", "center center", "bottom 20%".`)}e.number(t.scroll.smoothing,`timeline.scroll.smoothing`,{min:0,max:.99}),t.trigger!==`scroll`&&e.warn(`ignored`,`timeline.scroll`,`timeline.scroll only applies with "trigger": "scroll".`,`Set "trigger": "scroll" or remove scroll.`)}}if(t.tracks===void 0||t.tracks===null)return e.error(`required`,`timeline.tracks`,`Missing required field "tracks" (an array of tracks).`,`Add "tracks": [].`);if(!Array.isArray(t.tracks))return e.error(`type`,`timeline.tracks`,`tracks must be an array.`);let s=new Set;t.tracks.forEach((t,i)=>To(e,t,`timeline.tracks[${i}]`,r,s,n))}function To(e,t,n,r,i,a){if(!Ja(t))return e.error(`type`,n,`A track must be an object.`,`Example: { "target": "logo.rotation.y", "keys": [[0, 0], [4, 360]], "ease": "inOutSine" }.`);e.unknownKeys(t,Qa,n,`a track`),e.ease(t.ease,`${n}.ease`),e.number(t.stagger,`${n}.stagger`,{min:0}),t.staggerFrom!==void 0&&!eo.includes(t.staggerFrom)&&e.error(`enum`,`${n}.staggerFrom`,`Invalid value ${Xa(t.staggerFrom)}.`,`Valid values: ${P(eo)}.`),t.colorSpace!==void 0&&!$a.includes(t.colorSpace)&&e.error(`enum`,`${n}.colorSpace`,`Invalid value ${Xa(t.colorSpace)}.`,`Valid values: ${P($a)} (default "oklch").`);let o;if(t.target===void 0||t.target===null)e.error(`required`,`${n}.target`,`Missing required field "target" ("<id>.<property>").`,`Add "target": "<id>.<property>".`);else if(typeof t.target!=`string`)e.error(`type`,`${n}.target`,`Expected a string, got ${Xa(t.target)}.`);else{let r=t.target;i.has(r)&&e.warn(`duplicate-track`,`${n}.target`,`Another track already animates "${r}"; the last one wins.`,`Merge the keys into a single track.`),i.add(r);let s=mo(r,a);s.error&&e.error(`track-target`,`${n}.target`,s.error.message,s.error.hint),s.warning&&e.warn(`track-target`,`${n}.target`,s.warning.message,s.warning.hint),o=s.kind;let c=r.slice(0,Math.max(r.indexOf(`.`),0)),l=c.includes(`,`)||c.startsWith(`tag:`)||c.startsWith(`children:`);t.stagger!==void 0&&!l&&e.warn(`ignored`,`${n}.stagger`,`stagger only applies to multi-target selectors.`,`Use "a,b,c.<prop>", "tag:<tag>.<prop>" or "children:<id>.<prop>".`)}if(t.keys===void 0||t.keys===null)return e.error(`required`,`${n}.keys`,`Missing required field "keys" ([[time, value], …]).`,`Add "keys": [[time, value], …].`);if(!Array.isArray(t.keys)||t.keys.length===0)return e.error(`type`,`${n}.keys`,`keys must be a non-empty array of [time, value].`,`Example: [[0, [0, 0, 0]], [2, [0, 1, 0]]].`);let s=-1/0,c=!0;t.keys.forEach((i,a)=>{let l=`${n}.keys[${a}]`;if(!Array.isArray(i)||i.length<2||i.length>3||!Ya(i[0]))return e.error(`type`,l,`Expected [time, value] or [time, value, ease], got ${Xa(i)}.`,`Example: [1.5, ${o?yo[o].split(` or `)[0]:`1`}] or [1.5, 1, "outBack"].`);let u=i[0];u<0&&e.error(`range`,`${l}[0]`,`Key time ${u} is negative.`,`Times are seconds from 0.`),u<s&&(c=!1),s=Math.max(s,u),u>r&&e.warn(`range`,`${l}[0]`,`Key time ${u}s is after timeline.duration (${r}s) and is never reached.`,`Increase timeline.duration to ≥ ${u} or move the key.`),o&&!vo(o,i[1])&&e.error(`track-value`,`${l}[1]`,`Value ${Xa(i[1])} does not match "${String(t.target)}" (expects ${o}).`,`Use a value like ${yo[o]}${o===`vec3`&&String(t.target).match(/rotation$/)?` (degrees)`:``}.`),i.length===3&&e.ease(i[2],`${l}[2]`)}),c||e.error(`track-order`,`${n}.keys`,`Keys are not sorted by time.`,`Sort the [time, value] pairs by ascending time.`)}function Eo(e){if(typeof e!=`string`||!e.trim())return!1;let t=e.trim(),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);return n?/^https?$/i.test(n[1])&&/^https?:\/\/[^/\s]+/i.test(t):!t.startsWith(`//`)&&!/\s/.test(t)}function Do(e,t,n,r){if(!Array.isArray(t))return e.error(`type`,`interactions`,`interactions must be an array.`,`Example: [{ "on": "click", "target": "product", "do": [{ "openUrl": "https://shop.example/p/1" }] }].`);let i=Ja(n.timeline)?n.timeline:null,a=i&&Ja(i.segments)?Object.keys(i.segments):[],o=i&&Ja(i.markers)?i.markers:{};t.forEach((t,n)=>{let i=`interactions[${n}]`;if(!Ja(t))return e.error(`type`,i,`An interaction must be an object.`,`Example: { "on": "hover", "target": "card", "do": [{ "play": "hover-in" }] }.`);e.unknownKeys(t,[`on`,`target`,`key`,`event`,`at`,`once`,`do`],i,`an interaction`),to.includes(t.on)||e.error(t.on===void 0?`required`:`enum`,`${i}.on`,`Invalid "on" ${Xa(t.on)}.`,`${typeof t.on==`string`?N(t.on,to):``}Valid values: ${P(to)}.`);let s=t.on;if(t.target!==void 0&&(typeof t.target!=`string`||!r.objects.has(t.target)?e.error(`unknown-ref`,`${i}.target`,`target ${Xa(t.target)} is not an object id.`,`${typeof t.target==`string`?N(t.target,r.objects):``}Object ids: ${P([...r.objects])}.`):[`click`,`hover`,`hoverEnd`].includes(s)||e.warn(`ignored`,`${i}.target`,`target is ignored for on "${s}".`,`Targets apply to click, hover and hoverEnd.`)),s!==`key`||typeof t.key==`string`&&t.key||e.error(`required`,`${i}.key`,`on "key" needs "key": a KeyboardEvent.code.`,`Example: "key": "Space", "ArrowRight", "KeyE".`),s!==`event`||typeof t.event==`string`&&t.event||e.error(`required`,`${i}.event`,`on "event" needs "event": a marker or emitted event name.`,`Markers: ${P(Object.keys(o))}.`),s===`scroll`&&(t.at===void 0?e.error(`required`,`${i}.at`,`on "scroll" needs "at": the scroll progress (0..1) to cross.`,`Example: "at": 0.5.`):e.number(t.at,`${i}.at`,{min:0,max:1})),t.once!==void 0&&typeof t.once!=`boolean`&&e.error(`type`,`${i}.once`,`once must be true or false.`),!Array.isArray(t.do)||!t.do.length)return e.error(`required`,`${i}.do`,`"do" must be a non-empty array of actions.`,`Actions: ${no.map(e=>`{ "${e}": … }`).join(`, `)}.`);t.do.forEach((t,n)=>Oo(e,t,`${i}.do[${n}]`,s,a,o,r))})}function Oo(e,t,n,r,i,a,o){if(!Ja(t))return e.error(`type`,n,`An action must be an object.`,`Example: { "play": "intro" }.`);let s=no.filter(e=>e in t);if(s.length!==1)return e.error(`type`,n,s.length?`An action has exactly one of ${P(no)}; got ${P(s)}.`:`Unknown action ${Xa(t)}.`,`Actions: ${no.map(e=>`{ "${e}": … }`).join(`, `)}.`);let c=s[0],l=(t,n)=>{if(typeof t!=`string`)return e.error(`type`,n,`Expected a segment name, got ${Xa(t)}.`);t!==`timeline`&&!i.includes(t)&&e.error(`unknown-ref`,n,`"${t}" is not a timeline segment.`,`${N(t,i)}Segments: ${P([`timeline`,...i])} — define it in timeline.segments.`)};switch(c){case`play`:e.unknownKeys(t,[`play`,`reverse`],n,`a play action`),l(t.play,`${n}.play`),t.reverse!==void 0&&typeof t.reverse!=`boolean`&&e.error(`type`,`${n}.reverse`,`reverse must be true or false.`);break;case`toggle`:e.unknownKeys(t,[`toggle`],n,`a toggle action`),l(t.toggle,`${n}.toggle`);break;case`seek`:e.unknownKeys(t,[`seek`],n,`a seek action`),!Ya(t.seek)&&!(typeof t.seek==`string`&&t.seek in a)&&e.error(`type`,`${n}.seek`,`seek needs seconds or a marker name, got ${Xa(t.seek)}.`,`Markers: ${P(Object.keys(a))}.`);break;case`set`:{e.unknownKeys(t,[`set`,`duration`,`ease`],n,`a set action`);let r=t.set;if(!Ja(r)||typeof r.path!=`string`||r.value===void 0){e.error(`type`,`${n}.set`,`set needs { "path": "<id>.<property>", "value": … }.`,`Example: { "set": { "path": "logo.material.color", "value": "#ff3366" }, "duration": 0.4, "ease": "outCubic" }.`);break}e.unknownKeys(r,[`path`,`value`],`${n}.set`,`set`);let i=mo(r.path,o);i.error&&e.error(`track-target`,`${n}.set.path`,i.error.message,i.error.hint),i.warning?e.warn(`track-target`,`${n}.set.path`,i.warning.message,i.warning.hint):i.kind&&!vo(i.kind,r.value)&&e.error(`track-value`,`${n}.set.value`,`Value ${Xa(r.value)} does not match "${r.path}" (expects ${i.kind}).`,`Use a value like ${yo[i.kind]}.`),e.number(t.duration,`${n}.duration`,{min:0}),e.ease(t.ease,`${n}.ease`);break}case`emit`:e.unknownKeys(t,[`emit`,`payload`],n,`an emit action`),typeof t.emit==`string`&&t.emit||e.error(`type`,`${n}.emit`,`emit needs an event name.`);break;case`openUrl`:e.unknownKeys(t,[`openUrl`,`newTab`],n,`an openUrl action`),Eo(t.openUrl)||e.error(`url`,`${n}.openUrl`,`openUrl ${Xa(t.openUrl)} is not allowed.`,`Only http(s) URLs ("https://shop.example/p/1") or page-relative paths ("/shop") can be opened.`),r!==`click`&&r!==`key`&&e.error(`gesture`,`${n}.openUrl`,`openUrl only works on "click" or "key" interactions (a user gesture), not "${r}".`,`Move it to an { "on": "click", "target": … } interaction.`),t.newTab!==void 0&&typeof t.newTab!=`boolean`&&e.error(`type`,`${n}.newTab`,`newTab must be true or false.`);break;case`playClip`:e.unknownKeys(t,[`playClip`,`target`,`loop`,`speed`,`crossfade`],n,`a playClip action`),typeof t.target==`string`&&o.models?.has(t.target)||e.error(`unknown-ref`,`${n}.target`,`playClip needs "target": a model object id, got ${Xa(t.target)}.`,`Models: ${P([...o.models??[]])}.`),typeof t.playClip!=`string`&&!(Ya(t.playClip)&&Number.isInteger(t.playClip)&&t.playClip>=0)&&e.error(`type`,`${n}.playClip`,`playClip is a clip name or index.`),e.number(t.speed,`${n}.speed`),e.number(t.crossfade,`${n}.crossfade`,{min:0}),t.loop!==void 0&&typeof t.loop!=`boolean`&&e.error(`type`,`${n}.loop`,`loop must be true or false.`)}}function ko(e,t,n){if(Ja(t)&&(t.lookAt===void 0||typeof t.lookAt==`string`&&n.objects.has(t.lookAt)||e.error(`unknown-ref`,`camera.lookAt`,`camera.lookAt ${Xa(t.lookAt)} is not an object id.`,`${typeof t.lookAt==`string`?N(t.lookAt,n.objects):``}Object ids: ${P([...n.objects])}.`),t.shake!==void 0&&(Ja(t.shake)?(e.unknownKeys(t.shake,[`amount`,`rotation`,`speed`,`seed`],`camera.shake`,`camera.shake`),e.number(t.shake.amount,`camera.shake.amount`,{min:0}),e.number(t.shake.rotation,`camera.shake.rotation`,{min:0}),e.number(t.shake.speed,`camera.shake.speed`,{min:0}),e.number(t.shake.seed,`camera.shake.seed`)):e.error(`type`,`camera.shake`,`shake must be an object.`,`Example: { "amount": 0.03, "rotation": 0.4, "speed": 0.5 }.`)),t.shots!==void 0)){if(!Array.isArray(t.shots))return e.error(`type`,`camera.shots`,`shots must be an array.`,`Example: [{ "type": "pushIn", "at": 0, "duration": 3 }].`);t.shots.forEach((t,r)=>{let i=`camera.shots[${r}]`;if(!Ja(t))return e.error(`type`,i,`A shot must be an object.`);e.unknownKeys(t,io,i,`a camera shot`),ro.includes(t.type)||e.error(t.type===void 0?`required`:`enum`,`${i}.type`,`Invalid shot type ${Xa(t.type)}.`,`${typeof t.type==`string`?N(t.type,ro):``}Types: ${P(ro)}.`),t.at===void 0?e.error(`required`,`${i}.at`,`Missing "at" (start time in seconds).`):e.number(t.at,`${i}.at`,{min:0}),t.duration===void 0?e.error(`required`,`${i}.duration`,`Missing "duration" (seconds).`):e.number(t.duration,`${i}.duration`,{min:0}),e.ease(t.ease,`${i}.ease`);for(let n of[`distance`,`height`,`angle`,`elevation`])e.number(t[n],`${i}.${n}`);e.number(t.fov,`${i}.fov`,{min:1,max:179}),e.number(t.focus,`${i}.focus`,{min:0}),e.number(t.lookAhead,`${i}.lookAhead`,{min:0,max:.5}),e.vec(t.position,`${i}.position`),e.vec(t.target,`${i}.target`);for(let r of[`object`,`lookAt`]){let a=t[r];typeof a==`string`&&!n.objects.has(a)&&e.error(`unknown-ref`,`${i}.${r}`,`"${a}" is not an object id.`,`${N(a,n.objects)}Object ids: ${P([...n.objects])}.`)}Array.isArray(t.lookAt)&&e.vec(t.lookAt,`${i}.lookAt`),t.type===`path`&&(!Array.isArray(t.points)||!t.points.length?e.error(`required`,`${i}.points`,`A "path" shot needs "points": [[x, y, z], …] (the camera starts from where it is).`):t.points.forEach((t,n)=>e.vec(t,`${i}.points[${n}]`))),(t.type===`lookAt`&&t.object===void 0&&t.target===void 0||t.type===`focus`&&t.object===void 0&&t.focus===void 0)&&e.error(`required`,i,`A "${t.type}" shot needs ${t.type===`lookAt`?`"object" (or "target": [x, y, z])`:`"object" or "focus" (distance)`}.`),t.type===`focus`&&n.postfx&&!n.postfx.has(`dof`)&&e.warn(`ignored`,i,`A "focus" shot drives the dof post effect, which is not in scene.postfx.`,`Add { "type": "dof" } to postfx.`),t.type===`zoom`&&t.fov===void 0&&e.error(`required`,`${i}.fov`,`A "zoom" shot needs "fov" (target field of view, degrees).`),t.type===`move`&&t.position===void 0&&t.target===void 0&&t.fov===void 0&&e.error(`required`,i,`A "move" shot needs "position", "target" and/or "fov".`)})}}function Ao(e,t,n){Array.isArray(t)&&t.forEach((t,r)=>{if(!Ja(t))return;let i=typeof t.id==`string`?`objects#${t.id}`:`${n}[${r}]`;if(t.kind===`model`){if(t.morph!==void 0){if(!Ja(t.morph))e.error(`type`,`${i}.morph`,`morph must be an object { targetName: 0..1 }.`,`Example: "morph": { "smile": 0.6 }.`);else for(let[n,r]of Object.entries(t.morph))e.number(r,`${i}.morph.${n}`)}let n=t.animation;if(Ja(n)&&(e.number(n.offset,`${i}.animation.offset`,{min:0}),n.blend!==void 0)){if(!Ja(n.blend))e.error(`type`,`${i}.animation.blend`,`blend must be an object { clipName: weight }.`,`Example: "blend": { "Wave": 0.5 }.`);else for(let[t,r]of Object.entries(n.blend))e.number(r,`${i}.animation.blend.${t}`,{min:0})}}Ao(e,t.children,`${i}.children`)})}function jo(e,t){let n=new bo,r=xo(e,t);return e.timeline!==void 0&&wo(n,e.timeline,r),e.interactions!==void 0&&Do(n,e.interactions,e,r),ko(n,e.camera,r),Ao(n,e.objects,`objects`),n.issues}var Mo=[`banner`,`hero`,`card`,`square`,`fullscreen`,`inline`,`game`],No=[`mesh`,`text`,`model`,`group`,`generator`,`particles`,`instances`,`svg`,`photo`],Po=[`ambient`,`directional`,`point`,`spot`,`hemisphere`,`rect`],Fo=[`standard`,`physical`,`basic`,`lambert`,`toon`,`normal`,`matcap`,`gradient`,`shader`],Io=[`studio`,`soft`,`sunset`,`night`,`neutral`,`sky`,`none`],Lo=[`sunrise`,`morning`,`noon`,`afternoon`,`golden-hour`,`sunset`,`dusk`],Ro=[`map`,`normalMap`,`roughnessMap`,`metalnessMap`,`aoMap`,`emissiveMap`,`bumpMap`,`displacementMap`,`alphaMap`],zo=[`none`,`orbit`,`parallax`,`scroll`,`follow`],Bo=[`top-left`,`top`,`top-right`,`left`,`center`,`right`,`bottom-left`,`bottom`,`bottom-right`],Vo=[`always`,`hover`,`click`,`visible`,`scroll`],Ho=So,Uo=[`none`,`aces`,`agx`,`neutral`,`reinhard`],Wo={banner:`4:1`,hero:`16:9`,card:`4:5`,square:`1:1`,inline:`16:9`,fullscreen:`16:9`,game:`16:9`},Go={banner:600,hero:1500,card:400,square:600,inline:600,fullscreen:4e3,game:4e3},Ko=[`.glb`,`.gltf`],qo=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.ktx2`,`.avif`],I=[`.hdr`,`.exr`,`.jpg`,`.jpeg`,`.png`,`.webp`],Jo=[`.mp3`,`.ogg`,`.wav`,`.m4a`,`.aac`,`.opus`,`.webm`],Yo=[`.svg`],Xo=[`.jpg`,`.jpeg`,`.png`,`.webp`],Zo=[`parallax`,`mesh`,`layers`],Qo=[`none`,`sway`,`orbit`,`zoom`,`dolly`,`pan`,`rise`,`vertigo`],$o=[`pointer`,`scroll`,`gyro`,`auto`,`speed`,`smoothing`,`loop`,`duration`,`progress`],es=[`opacity`,`color`,`emissiveIntensity`],ts=[`id`,`kind`,`name`,`visible`,`castShadow`,`receiveShadow`,`behaviours`,`children`,`tags`,`body`,`href`,`userData`,`attach`,`position`,`rotation`,`scale`],ns={mesh:[`geometry`,`material`],text:[`text`,`font`,`size`,`depth`,`bevel`,`align`,`letterSpacing`,`lineHeight`,`kerning`,`maxWidth`,`curveSegments`,`outline`,`splitLetters`,`reveal`,`material`],model:[`src`,`fit`,`center`,`animation`,`morph`,`material`],group:[],generator:[`generator`,`params`,`seed`,`material`],particles:[`preset`,...l.map(e=>e.name)],instances:[`geometry`,`material`,`layout`,`colors`],svg:[`src`,`size`,`fit`,`depth`,`bevel`,`keepColors`,`strokes`,`curveSegments`,`layerGap`,`material`],photo:[`src`,`depth`,`plate`,`plateDepth`,`mode`,`width`,`height`,`strength`,`focus`,`segments`,`layers`,`edgeCut`,`occlude`,`motion`,`material`,`effects`]},rs=[`version`,`id`,`title`,`description`,`target`,`camera`,`environment`,`lights`,`objects`,`timeline`,`interactions`,`postfx`,`physics`,`scripts`,`ui`,`audio`,`data`,`ariaLabel`,`seed`],is=[`kind`,`aspect`,`budgetKb`,`height`,`transparent`,`lazy`,`pauseOffscreen`,`maxDpr`,`reducedMotion`,`posterTime`,`antialias`,`shadows`,`toneMapping`,`exposure`,`quality`],as={radialSegments:[`segments`],widthSegments:[`segments`],capSegments:[`segments`],heightSegments:[`segments`],tubularSegments:[`segments`],thetaLength:[`arc`]},os=[`type`,`fov`,`zoom`,`position`,`target`,`near`,`far`,`controls`,`autoRotate`,`orbitZoom`,`orbitLimits`,`parallax`,`scrollPath`,`follow`,`lookAt`,`shake`,`shots`],ss=[`background`,`lighting`,`lightingIntensity`,`fog`,`ground`,`rig`,`contactShadows`,`shadows`],cs=[`id`,`type`,`color`,`intensity`,`position`,`target`,`castShadow`,`skyColor`,`groundColor`,`distance`,`decay`,`angle`,`penumbra`,`width`,`height`,`panel`,`volumetric`,`shadow`,`behaviours`],ls=`preset.type.color.metalness.roughness.emissive.emissiveIntensity.opacity.transparent.wireframe.flatShading.side.transmission.thickness.ior.clearcoat.iridescence.sheen.map.normalMap.roughnessMap.repeat.gradient.shader.uniforms.clearcoatRoughness.sheenColor.sheenRoughness.anisotropy.anisotropyRotation.attenuationColor.attenuationDistance.specularIntensity.specularColor.dispersion.iridescenceIOR.iridescenceThicknessRange.envMapIntensity.metalnessMap.aoMap.emissiveMap.bumpMap.displacementMap.alphaMap.normalScale.bumpScale.aoMapIntensity.displacementScale.triplanar.gradientEmissive`.split(`.`),us=[`type`,`shape`,`size`,`radius`,`height`,`shapes`,`offset`,`mass`,`restitution`,`friction`,`material`,`velocity`,`angularVelocity`,`linearDamping`,`angularDamping`,`gravityScale`,`fixedRotation`,`character`,`sleep`,`ccd`,`layer`,`collidesWith`],ds=[`static`,`dynamic`,`kinematic`,`trigger`],fs=[`box`,`sphere`,`auto`,`cylinder`,`capsule`,`convex`,`trimesh`,`heightfield`,`compound`],ps=[`box`,`sphere`,`cylinder`,`capsule`],ms=[`hinge`,`point`,`distance`,`lock`,`spring`],hs=[`gravity`,`step`,`substeps`,`iterations`,`sleep`,`debug`,`materials`,`contacts`,`layers`,`joints`],gs=[`id`,`type`,`a`,`b`,`pivot`,`axis`,`distance`,`restLength`,`stiffness`,`damping`,`motor`,`limits`,`maxForce`,`collideConnected`],_s=new WeakMap,vs=[`id`,`type`,`text`,`anchor`,`style`,`value`,`action`,`visible`,`color`,`background`],ys={"geometries.lathe.points":{dims:2,min:2},"geometries.extrude.shape":{dims:2,min:3},"geometries.tube.points":{dims:3,min:2},"behaviours.path.points":{dims:3,min:2}},L=e=>!!e&&typeof e==`object`&&!Array.isArray(e),bs=e=>typeof e==`number`&&Number.isFinite(e),xs=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,Ss=e=>{let t=JSON.stringify(e);return t===void 0?String(e):t.length>60?`${t.slice(0,57)}…`:t},Cs=class{issues=[];ids=new Map;objectIds=new Set;lightIds=new Set;letterTexts=new Set;letterCounts=new Map;add(e,t,n,r,i){this.issues.push(i?{severity:e,code:t,path:n,message:r,hint:i}:{severity:e,code:t,path:n,message:r})}error(e,t,n,r){this.add(`error`,e,t,n,r)}warn(e,t,n,r){this.add(`warning`,e,t,n,r)}info(e,t,n,r){this.add(`info`,e,t,n,r)}required(e,t,n,r){return e[t]===void 0||e[t]===null?(this.error(`required`,ws(n,t),`Missing required field "${t}" (${r}).`,`Add "${t}": ${r}.`),!1):!0}number(e,t,n={}){return e===void 0?!0:bs(e)?n.integer&&!Number.isInteger(e)?(this.error(`type`,t,`Expected an integer, got ${e}.`,`Use a whole number, e.g. ${Math.round(e)}.`),!1):n.min!==void 0&&(n.exclusiveMin?e<=n.min:e<n.min)?(this.error(`range`,t,`${e} is below the minimum (${n.exclusiveMin?`>`:`≥`} ${n.min}).`,`Use a value${Es(n)}.`),!1):n.max!==void 0&&e>n.max?(this.error(`range`,t,`${e} is above the maximum (${n.max}).`,`Use a value${Es(n)}.`),!1):!0:(this.error(`type`,t,`Expected a number, got ${xs(e)} ${Ss(e)}.`,`Set ${Ts(t)} to a number${Es(n)}.`),!1)}boolean(e,t){return e===void 0||typeof e==`boolean`||(this.error(`type`,t,`Expected true or false, got ${xs(e)} ${Ss(e)}.`,`Set ${Ts(t)} to true or false.`),!1)}string(e,t,n={}){return e===void 0?!0:typeof e==`string`?n.nonEmpty&&!e.trim()?(this.error(`required`,t,`Must not be empty.`),!1):!0:(this.error(`type`,t,`Expected a string, got ${xs(e)} ${Ss(e)}.`),!1)}enumOf(e,t,n){if(e===void 0||typeof e==`string`&&t.includes(e))return!0;let r=typeof e==`string`?N(e,t):``;return this.error(`enum`,n,`Invalid value ${Ss(e)}.`,`${r}Valid values: ${P(t)}.`),!1}color(e,t){return e===void 0||ma(e)?!0:(this.error(`color`,t,`Invalid colour ${Ss(e)}.`,`Use a CSS colour: "#ff8800", "#f80", "rgb(255,136,0)", "hsl(30 100% 50%)" or a CSS name like "tomato".`),!1)}colors(e,t,n=1){if(e===void 0)return!0;if(!Array.isArray(e))return this.error(`type`,t,`Expected an array of colours, got ${xs(e)}.`,`Example: ["#ff006e", "#3a86ff"].`),!1;e.length<n&&this.error(`required`,t,`Needs at least ${n} colour${n>1?`s`:``}.`,`Example: ["#ff006e", "#3a86ff"].`);let r=e.length>=n;return e.forEach((e,n)=>r=this.color(e,`${t}[${n}]`)&&r),r}vec(e,t,n){if(e===void 0)return!0;if(!Array.isArray(e)||e.length!==t||!e.every(bs)){let r=t===3?`[0, 1.5, 0]`:`[1, 1]`;return this.error(`vec`,n,`Expected [${t===3?`x, y, z`:`x, y`}] (${t} numbers), got ${Ss(e)}.`,`Write it as an array of ${t} numbers, e.g. ${r}.`),!1}return!0}stringArray(e,t){return e===void 0?!0:!Array.isArray(e)||!e.every(e=>typeof e==`string`)?(this.error(`type`,t,`Expected an array of strings, got ${Ss(e)}.`),!1):!0}unknownKeys(e,t,n,r){for(let i of Object.keys(e)){if(t.includes(i))continue;let e=Qi(i,t);this.warn(`unknown-field`,ws(n,i),`Unknown field "${i}" on ${r} (ignored by the runtime).`,e?`Did you mean "${e}"? Otherwise remove it.`:`Remove it. Valid fields: ${P(t)}.`)}}assetPath(e,t,n,r){if(e===void 0)return!0;if(typeof e!=`string`||!e.trim())return this.error(`type`,t,`Expected an asset path string for ${r}, got ${Ss(e)}.`,`Use a project path like "assets/models/fox.glb" or a library id like "library:models/nature/pine-tree.glb".`),!1;let i=Os(e);if(i)return this.error(`asset-path`,t,`Invalid asset path "${e}": ${i.message}`,i.hint),!1;if(!Ea(e)){let i=e.toLowerCase().split(`?`)[0];if(!n.some(e=>i.endsWith(e)))return this.error(`asset-path`,t,`"${e}" does not look like ${r} (expected ${n.join(`, `)}).`,`Point ${Ts(t)} at a ${n.join(` / `)} file.`),!1}return!0}declareId(e,t,n){if(typeof e!=`string`||!$i.test(e))return this.error(`invalid-id`,t,`Invalid ${n} id ${Ss(e)}.`,`Ids start with a letter and use letters, digits, "_" or "-" (regex ${$i.source}), e.g. "logo" or "tree-1".`),!1;if(n!==`ui`){let r=this.ids.get(e);if(r)return this.error(`duplicate-id`,t,`Duplicate id "${e}" (already used at ${r}).`,`Ids are unique across objects (including children) and lights. Rename this one, e.g. "${e}-2".`),!1;this.ids.set(e,t),(n===`object`?this.objectIds:this.lightIds).add(e)}return!0}params(e,t,n,r,i=[]){let a=t.params.map(e=>e.name);for(let i of t.params){let a=n[i.name],o=ws(r,i.name);a===void 0?i.required&&this.error(`required`,o,`${Ds(e)} "${t.id}" requires "${i.name}" (${i.description}).`,`Add "${i.name}" (${i.type}).`):e===`generators`&&JSON.stringify(a).includes(`{data.`)||this.param(`${e}.${t.id}.${i.name}`,i,a,o,t.id)}for(let o of Object.keys(n)){if(a.includes(o)||i.includes(o))continue;let n=e===`geometries`?as[o]?.find(e=>a.includes(e)):void 0;if(n){this.warn(`unknown-param`,ws(r,o),`"${o}" is not a parameter of ${Ds(e)} "${t.id}": it is called "${n}" here (the value is ignored as written).`,`Rename "${o}" to "${n}".`);continue}let s=Qi(o,a);this.warn(`unknown-param`,ws(r,o),`Unknown parameter "${o}" for ${Ds(e)} "${t.id}" (ignored).`,`${s?`Did you mean "${s}"? `:``}${a.length?`Valid parameters: ${P(a)}.`:`"${t.id}" takes no parameters — remove it.`}`)}}param(e,t,n,r,i){if(n===null&&/null/.test(t.description))return!0;let a=ys[e];if(a)return this.points(n,a.dims,a.min,r);switch(t.type){case`number`:return this.number(n,r,{min:t.min,max:t.max});case`integer`:return this.number(n,r,{min:t.min,max:t.max,integer:!0});case`boolean`:return this.boolean(n,r);case`string`:return this.string(n,r);case`color`:return this.color(n,r);case`colors`:return this.colors(n,r);case`vec2`:return this.vec(n,2,r);case`vec3`:return this.vec(n,3,r);case`enum`:return!!this.enumOf(n,t.options??[],r);case`object`:return L(n)?!0:(this.error(`type`,r,`Expected an object for "${t.name}" of "${i}", got ${xs(n)}.`),!1);case`array`:return Array.isArray(n)?!t.options||n.every((e,n)=>this.enumOf(e,t.options??[],`${r}[${n}]`)):(this.error(`type`,r,`Expected an array for "${t.name}" of "${i}", got ${xs(n)}.`,t.description),!1)}return!0}points(e,t,n,r){if(!Array.isArray(e))return this.error(`type`,r,`Expected an array of [${t===2?`x, y`:`x, y, z`}] points, got ${xs(e)}.`,t===2?`Example: [[0, 0], [0.5, 0.2], [0.3, 1]].`:`Example: [[0, 0, 0], [1, 1, 0], [2, 0, 1]].`),!1;e.length<n&&this.error(`required`,r,`Needs at least ${n} points, got ${e.length}.`);let i=e.length>=n;return e.forEach((e,n)=>i=this.vec(e,t,`${r}[${n}]`)&&i),i}};function ws(e,t){return e?`${e}.${t}`:t}function Ts(e){let t=/([^.#[\]]+)(?:\[\d+\])*$/.exec(e);return t?`"${t[1]}"`:`the value`}function Es(e){return e.min!==void 0&&e.max!==void 0?` between ${e.min} and ${e.max}`:e.min===void 0?e.max===void 0?``:` ≤ ${e.max}`:e.exclusiveMin?` greater than ${e.min}`:` ≥ ${e.min}`}function Ds(e){return{geometries:`geometry`,materialPresets:`material preset`,shaders:`shader`,behaviours:`behaviour`,generators:`generator`,particlePresets:`particle preset`,instanceLayouts:`instance layout`,postfx:`post effect`,fonts:`font`,sounds:`sound`,textures:`procedural texture`,lightRigs:`light rig`}[e]}function Os(e){if(Ea(e)){let t=Da(e);return!/^[a-z0-9][a-z0-9._/-]*$/i.test(t)||t.includes(`..`)||t.endsWith(`/`)?{message:`library ids look like "library:<path in the library>".`,hint:`List valid ids with library_list (CLI: agent3d assets library), e.g. "library:models/nature/pine-tree.glb".`}:null}return/^[a-z][a-z0-9+.-]*:\/\//i.test(e)||e.startsWith(`//`)?{message:`remote URLs are not allowed (exports never hotlink).`,hint:`Download the file into the project first (assets_search + assets_add, CLI: agent3d assets search|add) and use its assets/… path.`}:e.startsWith(`data:`)||e.startsWith(`blob:`)?{message:`inline data URIs are not allowed in scene.json.`,hint:`Save the file under assets/ and reference its path.`}:e.startsWith(`/`)||/^[a-zA-Z]:/.test(e)||e.includes(`\\`)?{message:`paths must be relative to the project folder, with forward slashes.`,hint:`Use e.g. "assets/textures/wood.jpg".`}:e.split(`/`).includes(`..`)?{message:`".." is not allowed: assets must live inside the project.`,hint:`Copy the file into assets/ and reference it from there.`}:null}function ks(e){let t=new Cs;if(!L(e))return t.error(`type`,``,`A scene must be a JSON object, got ${xs(e)}.`,"Start from scene_get / `agent3d scene get` or a template."),t.issues;let n=e;t.unknownKeys(n,rs,``,`the scene`),n.version!==1&&t.error(n.version===void 0?`required`:`enum`,`version`,`Scene "version" must be 1, got ${Ss(n.version)}.`,`Set "version": 1.`),t.required(n,`id`,``,`a short identifier, e.g. "spring-banner"`)&&t.string(n.id,`id`,{nonEmpty:!0}),t.required(n,`title`,``,`a human title`)&&t.string(n.title,`title`,{nonEmpty:!0}),t.string(n.description,`description`),t.string(n.ariaLabel,`ariaLabel`),t.number(n.seed,`seed`,{integer:!0}),n.data!==void 0&&!L(n.data)&&t.error(`type`,`data`,`scene.data must be an object.`,`Example: "data": { "levels": [] }.`),t.required(n,`target`,``,`{ "kind": "banner", "aspect": "4:1" }`)&&js(t,n.target),t.required(n,`camera`,``,`{ "type": "perspective", "position": [0, 0, 8] }`)&&Ms(t,n.camera,`camera`),t.required(n,`environment`,``,`{ "background": "#101020" }`)&&Ps(t,n.environment),n.lights===void 0?t.error(`required`,`lights`,`Missing "lights" array.`,`Add "lights": [] (or lights like { "type": "directional", "position": [5, 8, 5] }).`):Array.isArray(n.lights)||t.error(`type`,`lights`,`lights must be an array.`),n.objects===void 0?t.error(`required`,`objects`,`Missing "objects" array.`,`Add "objects": [].`):Array.isArray(n.objects)||t.error(`type`,`objects`,`objects must be an array.`);let r=Array.isArray(n.lights)?n.lights:[];r.forEach((e,n)=>Ls(t,e,`lights[${n}]`));let i=Array.isArray(n.objects)?n.objects:[];zs.set(t,new Set(i.filter(L))),i.forEach((e,n)=>Bs(t,e,`objects[${n}]`)),Ns(t,n.camera),t.issues.push(...jo(n,{objects:t.objectIds,lights:t.lightIds,letters:t.letterTexts,letterCounts:t.letterCounts})),n.postfx!==void 0&&rc(t,n.postfx),n.physics!==void 0&&ic(t,n.physics),n.scripts!==void 0&&ac(t,n.scripts),n.ui!==void 0&&oc(t,n.ui),n.audio!==void 0&&sc(t,n.audio);let a=L(n.environment)&&(n.environment.rig!==void 0||L(n.environment.background)&&L(n.environment.background.sky)&&(n.environment.background.sky.preset!==void 0||n.environment.background.sky.physical===!0)&&n.environment.lighting!==`none`);return r.length===0&&!a&&L(n.environment)&&(n.environment.lighting===`none`||n.environment.lighting===void 0)&&As(i)&&t.warn(`no-lights`,`lights`,`The scene has no lights and no environment lighting: lit materials (standard, physical, toon…) will render black.`,`Add lights (e.g. { "type": "hemisphere", "intensity": 1 } and a directional key light) or set environment.lighting to "studio".`),t.issues}function As(e){return e.some(e=>L(e)&&(e.kind!==`photo`&&e.kind!==`group`||Array.isArray(e.children)&&As(e.children)))}function js(e,t){if(!L(t))return e.error(`type`,`target`,`target must be an object.`,`Example: { "kind": "banner", "aspect": "4:1" }.`);e.unknownKeys(t,is,`target`,`target`),e.required(t,`kind`,`target`,`one of ${P(Mo)}`)&&e.enumOf(t.kind,Mo,`target.kind`),e.required(t,`aspect`,`target`,`"W:H", e.g. "4:1"`)&&(aa(t.aspect)||e.error(`aspect`,`target.aspect`,`Invalid aspect ${Ss(t.aspect)}.`,`Use "W:H" with positive numbers, e.g. "4:1" (banner), "16:9" (hero), "1:1" (square)${typeof t.kind==`string`&&t.kind in Wo?`; default for ${t.kind}: "${Wo[t.kind]}"`:``}.`)),e.number(t.budgetKb,`target.budgetKb`,{min:0,exclusiveMin:!0}),t.height===void 0||typeof t.height==`string`&&/^\d+(\.\d+)?(px|vh|vw|rem|em|%|svh|dvh|lvh)$/.test(t.height.trim())||e.error(`type`,`target.height`,`Invalid CSS height ${Ss(t.height)}.`,`Use a CSS length like "320px", "60vh" or "20rem" — or remove it to keep the aspect ratio.`);for(let n of[`transparent`,`lazy`,`pauseOffscreen`,`antialias`,`shadows`])e.boolean(t[n],`target.${n}`);e.number(t.maxDpr,`target.maxDpr`,{min:.5,max:4}),e.enumOf(t.reducedMotion,[`static`,`slow`,`ignore`],`target.reducedMotion`),e.number(t.posterTime,`target.posterTime`,{min:0}),e.enumOf(t.quality,[`auto`,`low`,`medium`,`high`,`ultra`],`target.quality`),e.enumOf(t.toneMapping,Uo,`target.toneMapping`),e.number(t.exposure,`target.exposure`,{min:0,exclusiveMin:!0,max:10})}function Ms(e,t,n){if(!L(t))return e.error(`type`,n,`camera must be an object.`,`Example: { "type": "perspective", "fov": 40, "position": [0, 1, 8], "target": [0, 0, 0] }.`);e.unknownKeys(t,os,n,`the camera`),e.required(t,`type`,n,`"perspective" or "orthographic"`)&&e.enumOf(t.type,[`perspective`,`orthographic`],`${n}.type`),e.required(t,`position`,n,`[x, y, z] in units`)&&e.vec(t.position,3,`${n}.position`),e.vec(t.target,3,`${n}.target`),e.number(t.fov,`${n}.fov`,{min:1,max:179}),t.fov!==void 0&&t.type===`orthographic`&&e.warn(`ignored`,`${n}.fov`,`fov is ignored by an orthographic camera.`,`Use "zoom" (world units visible vertically) instead.`),e.number(t.zoom,`${n}.zoom`,{min:0,exclusiveMin:!0}),e.number(t.near,`${n}.near`,{min:0,exclusiveMin:!0}),e.number(t.far,`${n}.far`,{min:0,exclusiveMin:!0}),bs(t.near)&&bs(t.far)&&t.far<=t.near&&e.error(`range`,`${n}.far`,`far (${t.far}) must be greater than near (${t.near}).`,`Typical values: near 0.1, far 1000.`),Array.isArray(t.position)&&Array.isArray(t.target)&&t.position.length===3&&t.target.length===3&&t.position.every((e,n)=>e===t.target[n])&&e.error(`range`,`${n}.position`,`camera.position equals camera.target: the camera has no direction.`,`Move the camera back, e.g. position [0, 1, 8] looking at [0, 0, 0].`),e.enumOf(t.controls,zo,`${n}.controls`),e.number(t.autoRotate,`${n}.autoRotate`),e.boolean(t.orbitZoom,`${n}.orbitZoom`),t.orbitLimits!==void 0&&(L(t.orbitLimits)?(e.unknownKeys(t.orbitLimits,[`minDistance`,`maxDistance`,`minPolar`,`maxPolar`,`minAzimuth`,`maxAzimuth`],`${n}.orbitLimits`,`orbitLimits`),e.number(t.orbitLimits.minDistance,`${n}.orbitLimits.minDistance`,{min:0}),e.number(t.orbitLimits.maxDistance,`${n}.orbitLimits.maxDistance`,{min:0}),e.number(t.orbitLimits.minPolar,`${n}.orbitLimits.minPolar`,{min:0,max:180}),e.number(t.orbitLimits.maxPolar,`${n}.orbitLimits.maxPolar`,{min:0,max:180}),e.number(t.orbitLimits.minAzimuth,`${n}.orbitLimits.minAzimuth`,{min:-360,max:360}),e.number(t.orbitLimits.maxAzimuth,`${n}.orbitLimits.maxAzimuth`,{min:-360,max:360})):e.error(`type`,`${n}.orbitLimits`,`orbitLimits must be an object.`)),t.parallax!==void 0&&(L(t.parallax)?(e.unknownKeys(t.parallax,[`strength`,`smoothing`],`${n}.parallax`,`parallax`),e.number(t.parallax.strength,`${n}.parallax.strength`,{min:0}),e.number(t.parallax.smoothing,`${n}.parallax.smoothing`,{min:0,max:.99})):e.error(`type`,`${n}.parallax`,`parallax must be an object.`,`Example: { "strength": 0.5, "smoothing": 0.9 }.`)),t.scrollPath!==void 0&&(Array.isArray(t.scrollPath)?t.scrollPath.forEach((t,r)=>{let i=`${n}.scrollPath[${r}]`;if(!L(t))return e.error(`type`,i,`Expected { position: [x,y,z], target?: [x,y,z] }.`);e.required(t,`position`,i,`[x, y, z]`)&&e.vec(t.position,3,`${i}.position`),e.vec(t.target,3,`${i}.target`)}):e.error(`type`,`${n}.scrollPath`,`scrollPath must be an array of { position, target? }.`)),t.controls===`scroll`&&(!Array.isArray(t.scrollPath)||t.scrollPath.length<2)&&e.error(`required`,`${n}.scrollPath`,`controls "scroll" needs a scrollPath with at least 2 points.`,`Add "scrollPath": [{ "position": [0, 1, 8] }, { "position": [4, 2, 4], "target": [0, 0, 0] }].`),t.follow!==void 0&&(L(t.follow)?(e.unknownKeys(t.follow,[`target`,`offset`,`smoothing`,`lookAhead`],`${n}.follow`,`follow`),e.required(t.follow,`target`,`${n}.follow`,`the id of the object to follow`)&&e.string(t.follow.target,`${n}.follow.target`),e.vec(t.follow.offset,3,`${n}.follow.offset`),e.number(t.follow.smoothing,`${n}.follow.smoothing`,{min:0,max:.99}),e.number(t.follow.lookAhead,`${n}.follow.lookAhead`,{min:0})):e.error(`type`,`${n}.follow`,`follow must be an object.`,`Example: { "target": "player", "offset": [0, 3, 6] }.`)),t.controls===`follow`&&t.follow===void 0&&e.error(`required`,`${n}.follow`,`controls "follow" needs camera.follow.`,`Add "follow": { "target": "<object id>", "offset": [0, 3, 6] }.`)}function Ns(e,t){L(t)&&L(t.follow)&&typeof t.follow.target==`string`&&(e.objectIds.has(t.follow.target)||e.error(`unknown-ref`,`camera.follow.target`,`camera.follow.target "${t.follow.target}" is not an object id.`,`${N(t.follow.target,e.objectIds)}Object ids: ${P([...e.objectIds])}.`))}function Ps(e,t){if(!L(t))return e.error(`type`,`environment`,`environment must be an object.`,`Example: { "background": { "gradient": ["#0f0c29", "#302b63"] }, "lighting": "studio" }.`);if(e.unknownKeys(t,ss,`environment`,`environment`),e.required(t,`background`,`environment`,`a colour, "transparent", { gradient: [...] }, { radial: [...] }, { sky: {...} } or { hdri: "assets/…" }`)&&Is(e,t.background),t.lighting!==void 0&&(typeof t.lighting==`string`?e.enumOf(t.lighting,Io,`environment.lighting`):L(t.lighting)?(e.unknownKeys(t.lighting,[`hdri`,`intensity`,`rotation`],`environment.lighting`,`environment.lighting`),e.number(t.lighting.rotation,`environment.lighting.rotation`),e.required(t.lighting,`hdri`,`environment.lighting`,`an .hdr/.exr path or library id`)&&e.assetPath(t.lighting.hdri,`environment.lighting.hdri`,I,`an HDRI`),e.number(t.lighting.intensity,`environment.lighting.intensity`,{min:0})):e.error(`type`,`environment.lighting`,`Invalid lighting ${Ss(t.lighting)}.`,`Use a preset (${P(Io)}) or { "hdri": "assets/hdris/x.hdr" }.`)),e.number(t.lightingIntensity,`environment.lightingIntensity`,{min:0}),t.fog!==void 0){let n=t.fog;L(n)?(e.unknownKeys(n,[`color`,`near`,`far`,`density`,`height`,`falloff`],`environment.fog`,`fog`),e.color(n.color,`environment.fog.color`),n.density!==void 0&&e.number(n.density,`environment.fog.density`,{min:0,max:1}),e.number(n.height,`environment.fog.height`),e.number(n.falloff,`environment.fog.falloff`,{min:0,exclusiveMin:!0}),(n.height!==void 0||n.falloff!==void 0)&&n.density===void 0&&e.warn(`ignored`,`environment.fog.height`,`Height fog needs an exponential fog (density).`,`Use { "density": 0.04, "height": 0, "falloff": 0.3 }.`),e.number(n.near,`environment.fog.near`,{min:0}),e.number(n.far,`environment.fog.far`,{min:0}),bs(n.near)&&bs(n.far)&&n.far<=n.near&&e.error(`range`,`environment.fog.far`,`fog.far must be greater than fog.near.`)):e.error(`type`,`environment.fog`,`fog must be an object.`,`Use { "color": "#ccd", "near": 10, "far": 50 } (linear) or { "color": "#ccd", "density": 0.03 } (exponential).`)}if(t.ground!==void 0){let n=t.ground;L(n)?(e.unknownKeys(n,[`y`,`size`,`color`,`shadowOnly`,`grid`,`roughness`,`opacity`],`environment.ground`,`ground`),e.number(n.opacity,`environment.ground.opacity`,{min:0,max:1}),e.number(n.y,`environment.ground.y`),e.number(n.size,`environment.ground.size`,{min:0,exclusiveMin:!0}),e.color(n.color,`environment.ground.color`),e.boolean(n.shadowOnly,`environment.ground.shadowOnly`),e.boolean(n.grid,`environment.ground.grid`),e.number(n.roughness,`environment.ground.roughness`,{min:0,max:1})):e.error(`type`,`environment.ground`,`ground must be an object.`,`Example: { "y": 0, "shadowOnly": true }.`)}if(t.rig!==void 0){let n=t.rig,r=d.lightRigs.map(e=>e.id),i=typeof n==`string`?n:L(n)?n.preset:void 0;if(!(typeof n==`string`||L(n)))e.error(`type`,`environment.rig`,`Invalid rig ${Ss(n)}.`,`Use a rig id (${P(r)}) or { "preset": "softbox", "intensity": 1 }.`);else if(typeof i!=`string`)e.error(`required`,`environment.rig.preset`,`rig needs a "preset" id.`,`One of ${P(r)}.`);else{let t=Ws(e,`lightRigs`,i,typeof n==`string`?`environment.rig`:`environment.rig.preset`);t&&L(n)&&e.params(`lightRigs`,t,n,`environment.rig`,[`preset`])}}if(t.contactShadows!==void 0&&typeof t.contactShadows!=`boolean`){let n=t.contactShadows,r=`environment.contactShadows`;L(n)?(e.unknownKeys(n,[`y`,`size`,`center`,`opacity`,`blur`,`far`,`resolution`,`color`,`frames`],r,`contactShadows`),e.vec(n.center,2,`${r}.center`),e.number(n.y,`${r}.y`),e.number(n.size,`${r}.size`,{min:0,exclusiveMin:!0}),e.number(n.opacity,`${r}.opacity`,{min:0,max:1}),e.number(n.blur,`${r}.blur`,{min:0,max:20}),e.number(n.far,`${r}.far`,{min:0,exclusiveMin:!0}),e.number(n.resolution,`${r}.resolution`,{min:64,max:2048,integer:!0}),e.color(n.color,`${r}.color`),e.number(n.frames,`${r}.frames`,{min:0,integer:!0})):e.error(`type`,r,`contactShadows must be true or an object.`,`Example: { "opacity": 0.6, "blur": 2.5 }.`)}if(t.shadows!==void 0){let n=t.shadows;L(n)?(e.unknownKeys(n,[`type`,`softness`,`mapSize`,`intensity`],`environment.shadows`,`shadows`),e.enumOf(n.type,[`pcf`,`vsm`],`environment.shadows.type`),Fs(e,n,`environment.shadows`)):e.error(`type`,`environment.shadows`,`shadows must be an object.`,`Example: { "type": "vsm", "softness": 6 }.`)}}function Fs(e,t,n){e.number(t.softness,`${n}.softness`,{min:0,max:30}),e.number(t.mapSize,`${n}.mapSize`,{min:256,max:4096,integer:!0}),e.number(t.intensity,`${n}.intensity`,{min:0,max:1})}function Is(e,t){let n=`environment.background`;if(typeof t==`string`){t!==`transparent`&&e.color(t,n);return}if(!L(t))return e.error(`type`,n,`Invalid background ${Ss(t)}.`,`Use a colour ("#101020"), "transparent", { "gradient": ["#a", "#b"], "angle": 0 }, { "radial": [...] }, { "meshGradient": [...] }, { "sky": {...} } or { "hdri": "assets/hdris/x.hdr" }.`);let r=Object.keys(t),i=[`gradient`,`radial`,`meshGradient`,`sky`,`hdri`].find(e=>e in t);if(!i)return e.error(`type`,n,`Background object needs one of "gradient", "radial", "meshGradient", "sky" or "hdri" (got keys ${P(r)}).`,`Example: { "gradient": ["#0f0c29", "#302b63", "#24243e"], "angle": 0 }.`);if(i===`gradient`)e.unknownKeys(t,[`gradient`,`angle`,`grain`],n,`a gradient background`),e.colors(t.gradient,`${n}.gradient`,2),e.number(t.angle,`${n}.angle`),e.number(t.grain,`${n}.grain`,{min:0,max:1});else if(i===`radial`)e.unknownKeys(t,[`radial`,`center`,`radius`,`grain`],n,`a radial background`),e.colors(t.radial,`${n}.radial`,2),e.vec(t.center,2,`${n}.center`),e.number(t.radius,`${n}.radius`,{min:0,exclusiveMin:!0}),e.number(t.grain,`${n}.grain`,{min:0,max:1});else if(i===`meshGradient`)e.unknownKeys(t,[`meshGradient`,`speed`,`scale`,`seed`,`grain`],n,`a mesh-gradient background`),e.colors(t.meshGradient,`${n}.meshGradient`,2),Array.isArray(t.meshGradient)&&t.meshGradient.length>6&&e.warn(`ignored`,`${n}.meshGradient`,`Only the first 6 colours are used.`),e.number(t.speed,`${n}.speed`,{min:0}),e.number(t.scale,`${n}.scale`,{min:.05}),e.number(t.seed,`${n}.seed`),e.number(t.grain,`${n}.grain`,{min:0,max:1});else if(i===`sky`){e.unknownKeys(t,[`sky`],n,`a sky background`);let r=t.sky;if(!L(r))return e.error(`type`,`${n}.sky`,`sky must be an object.`,`Example: { "top": "#4a90d9", "horizon": "#f6d6a8", "sun": { "direction": [1, 0.4, 0.2] } }.`);e.unknownKeys(r,[`top`,`horizon`,`bottom`,`sun`,`stars`,`physical`,`preset`,`turbidity`,`rayleigh`,`mieCoefficient`,`mieDirectionalG`,`exposure`,`clouds`],`${n}.sky`,`sky`),e.boolean(r.physical,`${n}.sky.physical`),e.enumOf(r.preset,Lo,`${n}.sky.preset`),e.number(r.turbidity,`${n}.sky.turbidity`,{min:0,max:30}),e.number(r.rayleigh,`${n}.sky.rayleigh`,{min:0,max:6}),e.number(r.mieCoefficient,`${n}.sky.mieCoefficient`,{min:0,max:.1}),e.number(r.mieDirectionalG,`${n}.sky.mieDirectionalG`,{min:0,max:.999}),e.number(r.exposure,`${n}.sky.exposure`,{min:0}),e.number(r.clouds,`${n}.sky.clouds`,{min:0,max:1});let i=r.physical===!0||r.preset!==void 0||r.turbidity!==void 0||r.rayleigh!==void 0;if(i)for(let t of[`top`,`horizon`,`bottom`])r[t]!==void 0&&e.warn(`ignored`,`${n}.sky.${t}`,`"${t}" is ignored by the physical sky (preset / physical).`,`Remove it, or drop preset/physical for a colour-gradient sky.`);if(e.color(r.top,`${n}.sky.top`),e.color(r.horizon,`${n}.sky.horizon`),e.color(r.bottom,`${n}.sky.bottom`),e.number(r.stars,`${n}.sky.stars`,{min:0,integer:!0,max:1e5}),r.sun!==void 0&&r.sun!==!1){if(!L(r.sun))e.error(`type`,`${n}.sky.sun`,`sun must be an object or false.`);else if(e.unknownKeys(r.sun,[`direction`,`elevation`,`azimuth`,`color`,`size`,`light`,`intensity`,`castShadow`],`${n}.sky.sun`,`sun`),e.vec(r.sun.direction,3,`${n}.sky.sun.direction`),e.number(r.sun.elevation,`${n}.sky.sun.elevation`,{min:-90,max:90}),e.number(r.sun.azimuth,`${n}.sky.sun.azimuth`),e.color(r.sun.color,`${n}.sky.sun.color`),e.number(r.sun.size,`${n}.sky.sun.size`,{min:0}),e.boolean(r.sun.light,`${n}.sky.sun.light`),e.number(r.sun.intensity,`${n}.sky.sun.intensity`,{min:0}),e.boolean(r.sun.castShadow,`${n}.sky.sun.castShadow`),!i)for(let t of[`light`,`intensity`,`castShadow`])r.sun[t]!==void 0&&e.warn(`ignored`,`${n}.sky.sun.${t}`,`sun.${t} only applies to the physical sky (it adds a sun light).`,`Set "preset" (e.g. "golden-hour") or "physical": true, or add a directional light yourself.`)}}else{e.unknownKeys(t,[`hdri`,`blur`,`intensity`,`rotation`,`groundProjection`],n,`an HDRI background`),e.assetPath(t.hdri,`${n}.hdri`,I,`an HDRI`),e.number(t.blur,`${n}.blur`,{min:0,max:1}),e.number(t.intensity,`${n}.intensity`,{min:0}),e.number(t.rotation,`${n}.rotation`);let r=t.groundProjection;r!==void 0&&typeof r!=`boolean`&&(L(r)?(e.unknownKeys(r,[`height`,`radius`],`${n}.groundProjection`,`groundProjection`),e.number(r.height,`${n}.groundProjection.height`,{min:0,exclusiveMin:!0}),e.number(r.radius,`${n}.groundProjection.radius`,{min:0,exclusiveMin:!0})):e.error(`type`,`${n}.groundProjection`,`groundProjection must be true or { height, radius }.`)),r&&t.blur&&e.warn(`ignored`,`${n}.blur`,`blur is ignored with groundProjection (the photo is projected sharp).`)}}function Ls(e,t,n){if(!L(t))return e.error(`type`,n,`A light must be an object.`,`Example: { "type": "directional", "position": [5, 8, 5], "intensity": 2 }.`);let r=t.id!==void 0&&ea(t.id)?`lights#${t.id}`:n;t.id!==void 0&&e.declareId(t.id,`${r}.id`,`light`),e.unknownKeys(t,cs,r,`a ${typeof t.type==`string`?t.type:``} light`.replace(` `,` `)),e.required(t,`type`,r,`one of ${P(Po)}`)&&e.enumOf(t.type,Po,`${r}.type`),e.color(t.color,`${r}.color`),e.number(t.intensity,`${r}.intensity`,{min:0}),e.vec(t.position,3,`${r}.position`),e.vec(t.target,3,`${r}.target`),e.boolean(t.castShadow,`${r}.castShadow`),e.color(t.skyColor,`${r}.skyColor`),e.color(t.groundColor,`${r}.groundColor`),e.number(t.distance,`${r}.distance`,{min:0}),e.number(t.decay,`${r}.decay`,{min:0}),e.number(t.angle,`${r}.angle`,{min:0,max:90}),e.number(t.penumbra,`${r}.penumbra`,{min:0,max:1}),e.number(t.width,`${r}.width`,{min:0}),e.number(t.height,`${r}.height`,{min:0}),e.boolean(t.panel,`${r}.panel`),t.panel&&t.type!==`rect`&&e.warn(`ignored`,`${r}.panel`,`panel only applies to rect lights.`),t.volumetric!==void 0&&typeof t.volumetric!=`boolean`&&(L(t.volumetric)?(e.unknownKeys(t.volumetric,[`intensity`,`length`,`color`],`${r}.volumetric`,`volumetric`),e.number(t.volumetric.intensity,`${r}.volumetric.intensity`,{min:0}),e.number(t.volumetric.length,`${r}.volumetric.length`,{min:0,exclusiveMin:!0}),e.color(t.volumetric.color,`${r}.volumetric.color`)):e.error(`type`,`${r}.volumetric`,`volumetric must be true or { intensity, length, color }.`)),t.volumetric&&t.type!==`spot`&&e.warn(`ignored`,`${r}.volumetric`,`volumetric only applies to spot lights.`,`Use "type": "spot" (with "angle" and "target") for a light cone.`),t.shadow!==void 0&&(L(t.shadow)?(e.unknownKeys(t.shadow,[`softness`,`mapSize`,`bias`,`normalBias`,`intensity`],`${r}.shadow`,`shadow`),Fs(e,t.shadow,`${r}.shadow`),e.number(t.shadow.bias,`${r}.shadow.bias`,{min:-.1,max:.1}),e.number(t.shadow.normalBias,`${r}.shadow.normalBias`,{min:0,max:1}),t.castShadow||e.info(`ignored`,`${r}.shadow`,`shadow settings only apply when castShadow is true.`)):e.error(`type`,`${r}.shadow`,`shadow must be an object.`,`Example: { "softness": 6, "mapSize": 2048 }.`)),(t.type===`directional`||t.type===`spot`||t.type===`point`||t.type===`rect`)&&t.position===void 0&&e.info(`default`,`${r}.position`,`This ${t.type} light has no position (the runtime uses a default).`,`Set position [x, y, z] explicitly so lighting is predictable, e.g. [5, 8, 5].`),t.castShadow&&(t.type===`ambient`||t.type===`hemisphere`||t.type===`rect`)&&e.warn(`ignored`,`${r}.castShadow`,`${t.type} lights cannot cast shadows.`,`Use a directional, spot or point light for shadows.`),Js(e,t.behaviours,`${r}.behaviours`)}function Rs(e,t){return ea(e.id)?`objects#${e.id}`:t}var zs=new WeakMap;function Bs(e,t,n){if(!L(t))return e.error(`type`,n,`An object must be a JSON object.`,`Example: { "id": "box", "kind": "mesh", "geometry": { "type": "box" } }.`);let r=Rs(t,n);e.declareId(t.id,`${r}.id`,`object`);let a=t.kind;if(!e.required(t,`kind`,r,`one of ${P(No)}`))return;if(!No.includes(a)){e.error(`enum`,`${r}.kind`,`Unknown object kind ${Ss(a)}.`,`${typeof a==`string`?N(a,No):``}Valid kinds: ${P(No)}.`);return}let o=a;if(e.unknownKeys(t,[...ts,...ns[o]],r,`a "${o}" object`),e.string(t.name,`${r}.name`),e.boolean(t.visible,`${r}.visible`),e.boolean(t.castShadow,`${r}.castShadow`),e.boolean(t.receiveShadow,`${r}.receiveShadow`),e.vec(t.position,3,`${r}.position`),e.vec(t.rotation,3,`${r}.rotation`),Array.isArray(t.rotation)&&t.rotation.every(bs)&&t.rotation.some(e=>e!==0)&&t.rotation.every(e=>Math.abs(e)<=2*Math.PI+1e-6)&&t.rotation.some(e=>!Number.isInteger(e))&&e.warn(`radians`,`${r}.rotation`,`rotation ${Ss(t.rotation)} looks like radians.`,`Angles are in DEGREES. E.g. ${Ss(t.rotation.map(e=>Math.round(e*180/Math.PI)))}.`),t.scale!==void 0&&(bs(t.scale)?e.number(t.scale,`${r}.scale`,{min:0,exclusiveMin:!0}):e.vec(t.scale,3,`${r}.scale`)),e.stringArray(t.tags,`${r}.tags`),t.href!==void 0&&(typeof t.href!=`string`||!t.href.trim()?e.error(`type`,`${r}.href`,`href must be a URL string.`):/^\s*javascript:/i.test(t.href)&&e.error(`forbidden`,`${r}.href`,`javascript: links are not allowed.`,`Use an http(s) URL, a relative page path or "#anchor".`)),t.userData!==void 0&&!L(t.userData)&&e.error(`type`,`${r}.userData`,`userData must be an object.`),t.attach!==void 0&&(e.enumOf(t.attach,[`camera`],`${r}.attach`),t.attach===`camera`)){zs.get(e)?.has(t)||e.error(`invalid`,`${r}.attach`,`Only top-level objects can be attached to the camera.`,`Move the object (or its group) to the root of objects[] and set attach there.`);let n=t.position;Array.isArray(n)&&bs(n[2])&&n[2]>-.2?e.warn(`framing`,`${r}.position`,`A camera-attached object at z = ${String(n[2])} is behind or inside the lens: camera space looks down -z.`,`Use a negative z, e.g. [${bs(n[0])?n[0]:0}, ${bs(n[1])?n[1]:0}, -6] (6 units in front of the camera).`):n===void 0&&e.warn(`framing`,`${r}.position`,`A camera-attached object without position sits inside the lens.`,`Set position in camera space, e.g. [0, -1.5, -6] (6 units in front, a bit below centre).`)}if(t.body!==void 0&&($s(e,t.body,`${r}.body`),Xs(e,t,`${r}.body`),L(t.body)&&typeof t.id==`string`)){let n=_s.get(e)??[];n.push({id:t.id,path:`${r}.body`,body:t.body}),_s.set(e,n)}switch(Js(e,t.behaviours,`${r}.behaviours`),o){case`mesh`:e.required(t,`geometry`,r,`{ "type": "box" } (see catalog geometries)`)&&Gs(e,t.geometry,`${r}.geometry`),Ks(e,t.material,`${r}.material`);break;case`text`:e.required(t,`text`,r,`the text to display`)&&e.string(t.text,`${r}.text`,{nonEmpty:!0}),typeof t.font==`string`&&(t.font.includes(`/`)||t.font.includes(`:`))?e.assetPath(t.font,`${r}.font`,[`.json`],`a three.js typeface JSON font (scripts/convert-font.mjs)`):t.font!==void 0&&Ws(e,`fonts`,t.font,`${r}.font`),e.number(t.size,`${r}.size`,{min:0,exclusiveMin:!0}),e.number(t.depth,`${r}.depth`,{min:0}),e.number(t.bevel,`${r}.bevel`,{min:0}),e.enumOf(t.align,[`left`,`center`,`right`],`${r}.align`),e.number(t.letterSpacing,`${r}.letterSpacing`),e.number(t.lineHeight,`${r}.lineHeight`,{min:0,exclusiveMin:!0}),nc(e,t,r),Ks(e,t.material,`${r}.material`);break;case`model`:if(e.required(t,`src`,r,`a .glb/.gltf path ("assets/models/fox.glb") or "library:<id>"`)&&e.assetPath(t.src,`${r}.src`,Ko,`a glTF model`),e.number(t.fit,`${r}.fit`,{min:0,exclusiveMin:!0}),e.boolean(t.center,`${r}.center`),t.animation!==void 0){let n=t.animation;L(n)?(e.unknownKeys(n,[`clip`,`loop`,`speed`,`crossfade`,`offset`,`blend`],`${r}.animation`,`animation`),n.clip!==void 0&&typeof n.clip!=`string`&&!(bs(n.clip)&&Number.isInteger(n.clip)&&n.clip>=0)&&e.error(`type`,`${r}.animation.clip`,`clip must be a clip name or a clip index (integer ≥ 0).`),e.boolean(n.loop,`${r}.animation.loop`),e.number(n.speed,`${r}.animation.speed`),e.number(n.crossfade,`${r}.animation.crossfade`,{min:0})):e.error(`type`,`${r}.animation`,`animation must be an object.`,`Example: { "clip": "Walk", "loop": true }.`)}Ks(e,t.material,`${r}.material`);break;case`group`:Array.isArray(t.children)&&t.children.length||e.info(`empty-group`,r,`Group "${String(t.id)}" has no children.`,`Add children or remove the group.`);break;case`generator`:{if(!e.required(t,`generator`,r,`a catalog generator id (${P(d.generators.map(e=>e.id))})`))break;let n=Ws(e,`generators`,t.generator,`${r}.generator`);if(t.params!==void 0&&!L(t.params)?e.error(`type`,`${r}.params`,`params must be an object.`):n&&e.params(`generators`,n,t.params??{},`${r}.params`),e.number(t.seed,`${r}.seed`,{integer:!0}),t.material!==void 0&&(Ks(e,t.material,`${r}.material`),n&&!n.material)){let t=d.generators.filter(e=>e.material).map(e=>e.id);e.warn(`ignored`,`${r}.material`,`The "${n.id}" generator ignores "material" (it uses its colour params).`,`Use its colour params (agent3d catalog generators ${n.id}); material overrides work on: ${P(t)}.`)}break}case`particles`:t.preset!==void 0&&Ws(e,`particlePresets`,t.preset,`${r}.preset`),e.number(t.count,`${r}.count`,{integer:!0,min:1,max:2e5}),e.vec(t.area,3,`${r}.area`),e.number(t.size,`${r}.size`,{min:0,exclusiveMin:!0}),Array.isArray(t.color)?e.colors(t.color,`${r}.color`):e.color(t.color,`${r}.color`),e.number(t.speed,`${r}.speed`,{min:0}),e.vec(t.direction,3,`${r}.direction`),e.number(t.spread,`${r}.spread`,{min:0,max:1}),e.number(t.lifetime,`${r}.lifetime`,{min:0,exclusiveMin:!0}),e.number(t.opacity,`${r}.opacity`,{min:0,max:1}),e.enumOf(t.blending,[`normal`,`additive`],`${r}.blending`),e.enumOf(t.shape,i,`${r}.shape`),e.number(t.seed,`${r}.seed`,{integer:!0}),t.preset===void 0&&t.count===void 0&&e.info(`default`,r,`Particles without preset or count use runtime defaults.`,`Set a preset (${P(d.particlePresets.map(e=>e.id))}) and/or count.`);break;case`instances`:e.required(t,`geometry`,r,`{ "type": "box" }`)&&Gs(e,t.geometry,`${r}.geometry`),Ks(e,t.material,`${r}.material`),e.required(t,`layout`,r,`{ "type": "grid" | "scatter" | "circle" | "list", … }`)&&Ys(e,t.layout,`${r}.layout`),e.colors(t.colors,`${r}.colors`);break;case`svg`:e.required(t,`src`,r,`inline "<svg …>" markup or a project .svg path`)&&(typeof t.src==`string`?/^\s*(<svg|<\?xml)/i.test(t.src)||e.assetPath(t.src,`${r}.src`,Yo,`an SVG file`):e.error(`type`,`${r}.src`,`src must be a string.`)),e.number(t.size,`${r}.size`,{min:0,exclusiveMin:!0}),e.number(t.depth,`${r}.depth`,{min:0}),e.number(t.bevel,`${r}.bevel`,{min:0}),e.enumOf(t.fit,[`width`,`height`,`max`],`${r}.fit`),e.boolean(t.keepColors,`${r}.keepColors`),e.boolean(t.strokes,`${r}.strokes`),e.number(t.curveSegments,`${r}.curveSegments`,{integer:!0,min:1,max:64}),e.number(t.layerGap,`${r}.layerGap`,{min:0}),Ks(e,t.material,`${r}.material`);break;case`photo`:Vs(e,t,r)}t.children!==void 0&&(Array.isArray(t.children)?t.children.forEach((t,n)=>Bs(e,t,`${r}.children[${n}]`)):e.error(`type`,`${r}.children`,`children must be an array of objects.`))}function Vs(e,t,n){if(e.required(t,`src`,n,`an image path ("assets/textures/photo.jpg") or "library:<id>" (.jpg / .png / .webp)`)&&e.assetPath(t.src,`${n}.src`,Xo,`an image (.jpg / .png / .webp)`),e.assetPath(t.depth,`${n}.depth`,Xo,`a depth map image (grayscale PNG, white = near)`),e.assetPath(t.plate,`${n}.plate`,Xo,`a background plate image (.webp / .png / .jpg)`),e.assetPath(t.plateDepth,`${n}.plateDepth`,Xo,`the plate depth map (grayscale PNG, white = near)`),t.plate===void 0!=(t.plateDepth===void 0)){let r=t.plate===void 0?`plateDepth`:`plate`,i=r===`plate`?`plateDepth`:`plate`;e.warn(`photo-plate`,`${n}.${i}`,`Photo "${String(t.id)}" has ${r} but no ${i}: the plate is ignored (it needs both).`,`Set both from \`agent3d assets plate ${typeof t.src==`string`?t.src:`<image>`}\` (it returns { plate, plateDepth }).`)}else t.plate!==void 0&&t.depth===void 0&&e.info(`ignored`,`${n}.plate`,`plate only applies to a photo with a depth map (this one is flat).`,`Set depth too, or remove plate / plateDepth.`);e.enumOf(t.mode,Zo,`${n}.mode`),e.number(t.width,`${n}.width`,{min:0,exclusiveMin:!0}),e.number(t.height,`${n}.height`,{min:0,exclusiveMin:!0});for(let r of[`strength`,`focus`,`edgeCut`])e.number(t[r],`${n}.${r}`,{min:0,max:1});e.number(t.segments,`${n}.segments`,{integer:!0,min:8,max:1024}),e.number(t.layers,`${n}.layers`,{integer:!0,min:2,max:16});let r=typeof t.mode==`string`?t.mode:`parallax`;if(e.boolean(t.occlude,`${n}.occlude`),t.occlude===!0&&t.depth===void 0&&e.info(`ignored`,`${n}.occlude`,`occlude needs a depth map: photo "${String(t.id)}" is flat (it already hides what is behind its plane).`,`Set ${n}.depth (\`agent3d assets depth ${String(t.src??`<image>`)}\`), or remove occlude.`),t.segments!==void 0&&r!==`mesh`&&e.info(`ignored`,`${n}.segments`,`segments only applies to mode "mesh" (this photo is "${r}").`,`Set mode: "mesh", or remove segments.`),t.layers!==void 0&&r!==`layers`&&e.info(`ignored`,`${n}.layers`,`layers only applies to mode "layers" (this photo is "${r}").`,`Set mode: "layers", or remove layers.`),t.depth===void 0&&typeof t.src==`string`&&Zo.includes(r)&&e.warn(`photo-flat`,n,`Photo "${String(t.id)}" has no depth map: it renders flat (mode "${r}" needs one).`,`Run \`agent3d assets depth ${t.src}\` (writes a depth PNG next to it), then set ${n}.depth to its path.`),t.motion!==void 0){let r=t.motion;L(r)?(e.unknownKeys(r,$o,`${n}.motion`,`photo motion`),e.number(r.pointer,`${n}.motion.pointer`,{min:0,max:1}),e.number(r.scroll,`${n}.motion.scroll`,{min:0,max:1}),e.boolean(r.gyro,`${n}.motion.gyro`),e.enumOf(r.auto,Qo,`${n}.motion.auto`),e.number(r.speed,`${n}.motion.speed`,{min:0}),e.number(r.smoothing,`${n}.motion.smoothing`,{min:0,max:1}),e.boolean(r.loop,`${n}.motion.loop`),e.number(r.duration,`${n}.motion.duration`,{min:.1,max:600}),e.number(r.progress,`${n}.motion.progress`,{min:0,max:1}),r.duration!==void 0&&r.loop!==!1&&e.info(`ignored`,`${n}.motion.duration`,`motion.duration only applies to one-way moves (loop: false); a loop lasts 10 / speed seconds.`,`Set "loop": false for a one-way move, or change speed (cycles per 10 s).`),r.auto===`none`&&(r.loop!==void 0||r.duration!==void 0||r.progress!==void 0)&&e.info(`ignored`,`${n}.motion`,`loop / duration / progress shape the auto move, but this photo has auto "none".`,`Set "auto" to a move: "dolly", "pan", "rise", "vertigo", "zoom", "sway" or "orbit".`)):e.error(`type`,`${n}.motion`,`motion must be an object.`,`Example: { "pointer": 1, "scroll": 0, "auto": "sway", "speed": 1 }.`)}if(t.effects!==void 0&&Us(e,t.effects,`${n}.effects`,t.depth!==void 0),t.material!==void 0){let r=t.material;if(!L(r))e.error(`type`,`${n}.material`,`material must be an object.`,`A photo material only takes { "opacity", "color", "emissiveIntensity" }, e.g. { "opacity": 0.9 }.`);else{for(let t of Object.keys(r)){if(es.includes(t))continue;let r=Qi(t,es);e.warn(`unknown-field`,`${n}.material.${t}`,`"${t}" is not supported on a photo material (ignored by the runtime).`,`${r?`Did you mean "${r}"? `:``}A photo is unlit: only ${P(es)} apply.`)}e.number(r.opacity,`${n}.material.opacity`,{min:0,max:1}),e.color(r.color,`${n}.material.color`),e.number(r.emissiveIntensity,`${n}.material.emissiveIntensity`,{min:0})}}}var Hs=`{ "fog": { "color": "#dfe8f2", "amount": 0.6 }, "light": { "follow": "pointer" }, "reveal": { "duration": 2 } }`;function Us(e,t,n,r){if(!L(t))return e.error(`type`,n,`effects must be an object.`,`Example: ${Hs}.`);e.unknownKeys(t,ja,n,`photo effects`);for(let i of ja){let a=t[i];if(a===void 0)continue;let o=`${n}.${i}`;if(!L(a)){e.error(`type`,o,`effects.${i} must be an object (use {} for the defaults).`,`Example: ${Hs}.`);continue}let s=Aa[i],c=s.params;e.unknownKeys(a,Object.keys(c),o,`the ${i} effect`);for(let[t,n]of Object.entries(c)){let r=a[t];if(r===void 0)continue;let i=`${o}.${t}`,s=n;s.type===`number`?e.number(r,i,{min:s.min,max:s.max}):s.type===`color`?e.color(r,i):s.type===`enum`?e.enumOf(r,s.options??[],i):s.type===`vec2`&&s.scalar&&typeof r==`number`?e.number(r,i,{min:s.min,max:s.max}):s.type===`vec2`&&e.vec(r,2,i)&&r.some(e=>e<(s.min??-1/0)||e>(s.max??1/0))&&e.error(`range`,i,`${JSON.stringify(r)} is out of range (each coordinate in ${s.min}..${s.max}${s.min===-1?`, photo space: -1 left / bottom, 1 right / top`:``}).`)}s.needsDepth&&!r&&e.info(`ignored`,o,`The ${i} effect needs a depth map: this photo has none, so it is ignored.`,`Set the photo's depth (agent3d assets depth <image>), or remove effects.${i}.`)}let i=t.reveal;L(i)&&i.duration!==void 0&&i.progress!==void 0&&e.info(`ignored`,`${n}.reveal.progress`,`reveal.progress is ignored when reveal.duration is set (progress animates 0 → 1 from delay).`,`Remove duration to drive progress yourself (e.g. a timeline track on effects.reveal.progress).`);let a=t.blur;L(a)&&a.to===void 0!=(a.duration===void 0)&&e.info(`ignored`,`${n}.blur.${a.to===void 0?`duration`:`to`}`,"The blur racks focus only with both `to` and `duration`: this one is ignored.",`Set both (e.g. { "focus": 0.9, "to": 0.1, "duration": 3 }) or drive effects.blur.focus from a timeline track.`),L(a)&&!r&&e.info(`flat`,`${n}.blur`,`On a photo without a depth map the blur is even over the whole image (its depth is 0.5).`,`Set the photo's depth (agent3d assets depth <image>) for a depth-of-field blur.`);let o=t.frame;L(o)&&!r&&e.info(`flat`,`${n}.frame`,`On a photo without a depth map nothing pops out of the frame (its depth is 0.5): the photo is just framed.`,`Set the photo's depth (agent3d assets depth <image>) for the out-of-frame pop-out.`)}function Ws(e,t,n,r){let i=d[t].map(e=>e.id);if(typeof n!=`string`){e.error(`type`,r,`Expected a ${Ds(t)} id string, got ${xs(n)}.`,`Valid ids: ${P(i)}.`);return}let a=v(t,n);return a||e.error(`unknown-id`,r,`Unknown ${Ds(t)} "${n}".`,`${N(n,i)}Valid ids: ${P(i)} (catalog_get section "${t}").`),a}function Gs(e,t,n){if(!L(t))return e.error(`type`,n,`geometry must be an object.`,`Example: { "type": "sphere", "radius": 0.5 }.`);if(!e.required(t,`type`,n,`a catalog geometry (${P(d.geometries.map(e=>e.id))})`))return;let r=Ws(e,`geometries`,t.type,`${n}.type`);r&&e.params(`geometries`,r,t,n,[`type`])}function Ks(e,t,n){if(t===void 0)return;if(typeof t==`string`){let r=y(t);return e.error(`type`,n,`material must be an object, got the string ${Ss(t)}.`,r?`Write { "preset": "${t}" }.`:ma(t)?`Write { "color": "${t}" }.`:`Write { "preset": "plastic", "color": "#ff8800" }.`)}if(!L(t))return e.error(`type`,n,`material must be an object.`,`Example: { "preset": "gold" } or { "color": "#ff8800", "roughness": 0.4 }.`);if(e.unknownKeys(t,ls,n,`a material`),t.preset!==void 0){let r=d.materialPresets.map(e=>e.id);typeof t.preset==`string`&&y(t.preset)||e.error(`unknown-id`,`${n}.preset`,`Unknown material preset ${Ss(t.preset)}.`,`${typeof t.preset==`string`?N(t.preset,r):``}Valid presets: ${P(r)}.`)}e.enumOf(t.type,Fo,`${n}.type`),e.color(t.color,`${n}.color`),e.color(t.emissive,`${n}.emissive`),e.number(t.emissiveIntensity,`${n}.emissiveIntensity`,{min:0});for(let r of[`metalness`,`roughness`,`opacity`,`transmission`,`clearcoat`,`iridescence`,`sheen`])e.number(t[r],`${n}.${r}`,{min:0,max:1});e.number(t.thickness,`${n}.thickness`,{min:0}),e.number(t.ior,`${n}.ior`,{min:1,max:2.333});for(let r of[`transparent`,`wireframe`,`flatShading`])e.boolean(t[r],`${n}.${r}`);e.enumOf(t.side,[`front`,`back`,`double`],`${n}.side`);for(let r of Ro)qs(e,t[r],`${n}.${r}`);e.vec(t.repeat,2,`${n}.repeat`);for(let r of[`clearcoatRoughness`,`sheenRoughness`,`anisotropy`,`specularIntensity`,`aoMapIntensity`])e.number(t[r],`${n}.${r}`,{min:0,max:1});for(let r of[`sheenColor`,`attenuationColor`,`specularColor`])e.color(t[r],`${n}.${r}`);e.number(t.anisotropyRotation,`${n}.anisotropyRotation`),e.number(t.attenuationDistance,`${n}.attenuationDistance`,{min:0,exclusiveMin:!0}),e.number(t.dispersion,`${n}.dispersion`,{min:0,max:10}),e.number(t.iridescenceIOR,`${n}.iridescenceIOR`,{min:1,max:2.333}),e.vec(t.iridescenceThicknessRange,2,`${n}.iridescenceThicknessRange`),e.number(t.envMapIntensity,`${n}.envMapIntensity`,{min:0}),e.number(t.normalScale,`${n}.normalScale`,{min:-10,max:10}),e.number(t.bumpScale,`${n}.bumpScale`,{min:-10,max:10}),e.number(t.displacementScale,`${n}.displacementScale`),t.triplanar!==void 0&&typeof t.triplanar!=`boolean`&&e.number(t.triplanar,`${n}.triplanar`,{min:0,exclusiveMin:!0}),e.boolean(t.gradientEmissive,`${n}.gradientEmissive`);let r=[`transmission`,`thickness`,`ior`,`clearcoat`,`iridescence`,`sheen`,`clearcoatRoughness`,`sheenColor`,`sheenRoughness`,`anisotropy`,`anisotropyRotation`,`attenuationColor`,`attenuationDistance`,`specularIntensity`,`specularColor`,`dispersion`,`iridescenceIOR`,`iridescenceThicknessRange`],i=t.type??(typeof t.preset==`string`?y(t.preset)?.props.type:void 0);if(i!==void 0&&i!==`physical`)for(let a of r)t[a]!==void 0&&e.warn(`ignored`,`${n}.${a}`,`"${a}" needs a physical material (type is ${Ss(i)}).`,`Set "type": "physical".`);t.gradient!==void 0&&e.colors(t.gradient,`${n}.gradient`,2),t.type===`gradient`&&t.gradient===void 0&&e.error(`required`,`${n}.gradient`,`material type "gradient" needs a "gradient" colour list.`,`Add "gradient": ["#ff7eb3", "#7afcff"].`),bs(t.opacity)&&t.opacity<1&&t.transparent!==!0&&t.transmission===void 0&&e.info(`opacity`,`${n}.opacity`,`opacity ${t.opacity} has no effect unless "transparent": true.`,`Add "transparent": true to the material.`);let a=t.type===`shader`;if(t.shader!==void 0){let r=Ws(e,`shaders`,t.shader,`${n}.shader`);a||e.warn(`ignored`,`${n}.shader`,`"shader" is only used when material.type is "shader" (type is ${Ss(t.type??`unset`)}).`,`Set "type": "shader".`),r&&t.uniforms!==void 0&&(L(t.uniforms)?e.params(`shaders`,r,t.uniforms,`${n}.uniforms`):e.error(`type`,`${n}.uniforms`,`uniforms must be an object.`))}else a?e.error(`required`,`${n}.shader`,`material type "shader" needs a "shader" id.`,`Add "shader": one of ${P(d.shaders.map(e=>e.id))}.`):t.uniforms!==void 0&&e.warn(`ignored`,`${n}.uniforms`,`uniforms are only used by shader materials.`,`Set "type": "shader" and "shader": "<id>", or remove uniforms.`)}function qs(e,t,n){if(t!==void 0){if(L(t)){if(!e.required(t,`procedural`,n,`a procedural texture id (${P(d.textures.map(e=>e.id))})`))return;let r=Ws(e,`textures`,t.procedural,`${n}.procedural`);r&&e.params(`textures`,r,t,n,[`procedural`])}else e.assetPath(t,n,qo,`a texture image`)}}function Js(e,t,n){if(t!==void 0){if(!Array.isArray(t))return e.error(`type`,n,`behaviours must be an array.`,`Example: [{ "type": "rotate", "speed": 30 }].`);t.forEach((t,r)=>{let i=`${n}[${r}]`;if(!L(t))return e.error(`type`,i,`A behaviour must be an object.`,`Example: { "type": "float", "amplitude": 0.2 }.`);if(!e.required(t,`type`,i,`a catalog behaviour (${P(d.behaviours.map(e=>e.id))})`))return;let a=Ws(e,`behaviours`,t.type,`${i}.type`);e.enumOf(t.when,Vo,`${i}.when`),e.number(t.delay,`${i}.delay`,{min:0}),a&&e.params(`behaviours`,a,t,i,[`type`,`when`,`delay`])})}}function Ys(e,t,n){if(!L(t))return e.error(`type`,n,`layout must be an object.`,'Example: { "type": "grid", "count": [5, 1, 5], "spacing": [1.2, 0, 1.2] }. See `agent3d catalog instanceLayouts`.');let r=d.instanceLayouts.map(e=>e.id);if(!e.required(t,`type`,n,P(r))||!e.enumOf(t.type,r,`${n}.type`))return;let i=v(`instanceLayouts`,t.type);switch(e.params(`instanceLayouts`,i,t,n,[`type`]),t.type){case`grid`:Array.isArray(t.count)&&t.count.length===3&&!t.count.every(e=>Number.isInteger(e)&&e>=1)&&e.error(`range`,`${n}.count`,`grid count values must be integers ≥ 1.`,`Use 1 for a flat axis, e.g. [8, 1, 8].`);break;case`scatter`:bs(t.minScale)&&bs(t.maxScale)&&t.minScale>t.maxScale&&e.warn(`range`,`${n}.minScale`,`minScale (${t.minScale}) is larger than maxScale (${t.maxScale}).`,`Swap them.`);break;case`list`:if(!Array.isArray(t.items))break;t.items.forEach((t,r)=>{let i=`${n}.items[${r}]`;if(!L(t))return e.error(`type`,i,`Expected { position?, rotation?, scale? }.`);e.unknownKeys(t,[`position`,`rotation`,`scale`],i,`a transform`),e.vec(t.position,3,`${i}.position`),e.vec(t.rotation,3,`${i}.rotation`),t.scale!==void 0&&!bs(t.scale)&&e.vec(t.scale,3,`${i}.scale`)})}}function Xs(e,t,n){let r=t.body,i=t.geometry;if(!L(r)||!Array.isArray(r.size)||r.size.length!==3||!r.size.every(bs)||!L(i))return;let a=(e,t)=>bs(e)?e:t,o=i.type===`plane`?[a(i.width,1),a(i.height,1),0]:i.type===`box`?[a(i.width,1),a(i.height,1),a(i.depth,1)]:null;if(!o)return;let s=e=>{let t=e.indexOf(Math.min(...e)),n=e.filter((e,n)=>n!==t);return e[t]<=.5*Math.min(...n)?t:-1},c=s(o),l=s(r.size);if(c<0||l<0||c===l)return;let u=[`x`,`y`,`z`],d=[...r.size];[d[c],d[l]]=[d[l],d[c]];let f=Array.isArray(t.rotation)&&t.rotation.some(e=>bs(e)&&Math.abs(e)>1);e.warn(`body-frame`,`${n}.size`,`body.size ${JSON.stringify(r.size)} is thin on ${u[l]}, but this ${i.type}'s own thin axis is ${u[c]}: the size is applied in the object's frame${f?` (before its rotation)`:``}, so the collider ${i.type===`plane`&&f?`stands up like a wall`:`does not match the mesh`}.`,`Write it in the object's frame: "size": ${JSON.stringify(d)} — or drop size to fit the geometry automatically.`)}var Zs=new Set([`true`,`false`,`null`,`undefined`]);function Qs(e,t,n){let r=/([A-Za-z_$][\w$.]*)\s*(===|!==|==|!=)\s*([A-Za-z_$][\w$.]*)/g,i=t.replace(/'[^']*'|"[^"]*"/g,e=>` `.repeat(e.length));for(let a=r.exec(i);a;a=r.exec(i)){let[,r,i,o]=a;Zs.has(o)||Zs.has(r)||o.startsWith(`state.`)||e.warn(`expr-bare-word`,n,`"${r} ${i} ${o}" compares two state values: "${o}" is read as state.${o.replace(/^state\./,``)} (probably undefined), not as the text "${o}".`,`Quote the text: ${JSON.stringify(t.replace(a[0],`${r} ${i} '${o}'`))} (or write state.${o.replace(/^state\./,``)} to compare two state keys on purpose).`)}}function $s(e,t,n){if(!L(t))return e.error(`type`,n,`body must be an object.`,`Example: { "type": "dynamic", "shape": "box", "mass": 1 }.`);e.unknownKeys(t,us,n,`a physics body`),e.required(t,`type`,n,`"static" | "dynamic" | "kinematic" | "trigger"`)&&e.enumOf(t.type,ds,`${n}.type`),e.enumOf(t.shape,fs,`${n}.shape`),e.vec(t.size,3,`${n}.size`),e.number(t.radius,`${n}.radius`,{min:0,exclusiveMin:!0}),e.number(t.height,`${n}.height`,{min:0,exclusiveMin:!0}),e.vec(t.offset,3,`${n}.offset`),e.number(t.mass,`${n}.mass`,{min:0}),e.number(t.restitution,`${n}.restitution`,{min:0,max:1}),e.number(t.friction,`${n}.friction`,{min:0}),e.string(t.material,`${n}.material`,{nonEmpty:!0}),e.vec(t.velocity,3,`${n}.velocity`),e.vec(t.angularVelocity,3,`${n}.angularVelocity`),e.number(t.linearDamping,`${n}.linearDamping`,{min:0,max:1}),e.number(t.angularDamping,`${n}.angularDamping`,{min:0,max:1}),e.number(t.gravityScale,`${n}.gravityScale`),e.boolean(t.fixedRotation,`${n}.fixedRotation`),e.boolean(t.character,`${n}.character`),e.boolean(t.sleep,`${n}.sleep`),e.boolean(t.ccd,`${n}.ccd`),e.string(t.layer,`${n}.layer`,{nonEmpty:!0}),e.stringArray(t.collidesWith,`${n}.collidesWith`),t.shapes!==void 0&&(!Array.isArray(t.shapes)||t.shapes.length===0?e.error(`type`,`${n}.shapes`,`shapes must be a non-empty array of colliders.`,`Example: [{ "shape": "box", "size": [1, 0.2, 1] }, { "shape": "sphere", "radius": 0.3, "offset": [0, 0.5, 0] }].`):t.shapes.forEach((t,r)=>{let i=`${n}.shapes[${r}]`;if(!L(t))return e.error(`type`,i,`A collider must be an object.`,`Example: { "shape": "box", "size": [1, 1, 1], "offset": [0, 0.5, 0] }.`);e.unknownKeys(t,[`shape`,`size`,`radius`,`height`,`offset`,`rotation`],i,`a collider`),e.required(t,`shape`,i,P(ps))&&e.enumOf(t.shape,ps,`${i}.shape`),e.vec(t.size,3,`${i}.size`),e.number(t.radius,`${i}.radius`,{min:0,exclusiveMin:!0}),e.number(t.height,`${i}.height`,{min:0,exclusiveMin:!0}),e.vec(t.offset,3,`${i}.offset`),e.vec(t.rotation,3,`${i}.rotation`)}),t.shape!==void 0&&t.shape!==`compound`&&e.warn(`ignored`,`${n}.shapes`,`shapes is only used with shape "compound" (shape is ${Ss(t.shape)}).`,`Set "shape": "compound" or remove "shapes".`)),t.shape===`compound`&&t.shapes===void 0&&e.error(`required`,`${n}.shapes`,`shape "compound" needs a "shapes" array.`,`Example: "shapes": [{ "shape": "box", "size": [1, 0.2, 1] }, { "shape": "sphere", "radius": 0.3, "offset": [0, 0.5, 0] }].`),(t.shape===`trimesh`||t.shape===`heightfield`)&&t.type===`dynamic`&&e.error(`invalid`,`${n}.shape`,`shape "${t.shape}" only works for static (or kinematic) bodies.`,`Use "convex" (hull of the mesh) or "box" / "compound" for dynamic bodies.`),t.mass!==void 0&&t.type!==void 0&&t.type!==`dynamic`&&e.info(`ignored`,`${n}.mass`,`mass is ignored on ${Ss(t.type)} bodies (they have infinite mass).`)}function ec(e,t,n,r){if(!L(t))return e.error(`type`,n,`A joint must be an object.`,`Example: { "type": "hinge", "a": "door", "pivot": [1, 1, 0], "axis": [0, 1, 0] }.`);e.unknownKeys(t,gs,n,`a joint`),e.required(t,`type`,n,P(ms))&&e.enumOf(t.type,ms,`${n}.type`),e.string(t.id,`${n}.id`,{nonEmpty:!0});let i=i=>{let a=t[i];if(a!==void 0){if(typeof a!=`string`)return e.error(`type`,`${n}.${i}`,`${i} must be an object id.`);if(!e.objectIds.has(a))return e.error(`unknown-ref`,`${n}.${i}`,`Joint ${i} "${a}" is not an object id.`,`${N(a,e.objectIds)}Object ids: ${P([...e.objectIds])}.`);if(!r.has(a))return e.error(`invalid`,`${n}.${i}`,`Object "${a}" has no body: joints connect physics bodies.`,`Add "body": { "type": "dynamic" } to "${a}".`)}};e.required(t,`a`,n,`the id of an object with a body`)&&i(`a`),i(`b`),typeof t.a==`string`&&t.a===t.b&&e.error(`invalid`,`${n}.b`,`A joint needs two different bodies.`,`Omit b to anchor the body to the world.`);let a=typeof t.a==`string`?r.get(t.a)?.type:void 0,o=typeof t.b==`string`?r.get(t.b)?.type:void 0;if(a&&a!==`dynamic`&&(t.b===void 0||o&&o!==`dynamic`)&&e.warn(`no-dynamic`,n,`This joint connects no dynamic body: it will have no visible effect.`,`Make "a" (or "b") a dynamic body.`),e.vec(t.pivot,3,`${n}.pivot`),e.vec(t.axis,3,`${n}.axis`),Array.isArray(t.axis)&&t.axis.every(bs)&&t.axis.every(e=>e===0)&&e.error(`range`,`${n}.axis`,`axis must not be [0, 0, 0].`,`Example: [0, 1, 0] (vertical hinge, a door) or [0, 0, 1] (a pendulum swinging in the XY plane).`),e.number(t.distance,`${n}.distance`,{min:0}),e.number(t.restLength,`${n}.restLength`,{min:0}),e.number(t.stiffness,`${n}.stiffness`,{min:0}),e.number(t.damping,`${n}.damping`,{min:0}),e.number(t.maxForce,`${n}.maxForce`,{min:0,exclusiveMin:!0}),e.boolean(t.collideConnected,`${n}.collideConnected`),t.motor!==void 0&&(L(t.motor)?(e.unknownKeys(t.motor,[`speed`,`maxForce`],`${n}.motor`,`a motor`),e.required(t.motor,`speed`,`${n}.motor`,`degrees / s`)&&e.number(t.motor.speed,`${n}.motor.speed`),e.number(t.motor.maxForce,`${n}.motor.maxForce`,{min:0,exclusiveMin:!0})):e.error(`type`,`${n}.motor`,`motor must be an object.`,`Example: { "speed": 90, "maxForce": 50 } (degrees / s).`),t.type!==`hinge`&&e.warn(`ignored`,`${n}.motor`,`motor only drives hinge joints (this one is ${Ss(t.type)}).`)),t.limits!==void 0){let r=t.limits;!Array.isArray(r)||r.length!==2||!r.every(bs)?e.error(`type`,`${n}.limits`,`limits must be [minDegrees, maxDegrees].`,`Example: [0, 110] (a door opening one way) or [-45, 45] (a flipper).`):r[0]>r[1]?e.error(`range`,`${n}.limits`,`limits min (${r[0]}) is greater than max (${r[1]}).`,`Write [${r[1]}, ${r[0]}].`):(r[0]<-360||r[1]>360)&&e.error(`range`,`${n}.limits`,`limits must stay within -360 … 360 degrees.`,`Angles are relative to the start pose, e.g. [-90, 90].`)}for(let[r,i]of Object.entries({distance:[`distance`],restLength:[`spring`],stiffness:[`spring`],damping:[`spring`],axis:[`hinge`],limits:[`hinge`]}))t[r]!==void 0&&typeof t.type==`string`&&!i.includes(t.type)&&e.warn(`ignored`,`${n}.${r}`,`${r} is ignored on ${Ss(t.type)} joints (used by ${i.join(`, `)}).`)}var tc=[`rise`,`fade`,`scale`,`spin`,`drop`];function nc(e,t,n){if(e.boolean(t.kerning,`${n}.kerning`),e.number(t.maxWidth,`${n}.maxWidth`,{min:0,exclusiveMin:!0}),e.number(t.curveSegments,`${n}.curveSegments`,{integer:!0,min:1,max:32}),e.boolean(t.splitLetters,`${n}.splitLetters`),t.outline!==void 0&&typeof t.outline!=`boolean`){if(!L(t.outline))e.error(`type`,`${n}.outline`,`outline must be true or an object.`,`Example: { "width": 0.06, "color": "#1a1033" }.`);else{let r=t.outline;e.unknownKeys(r,[`width`,`color`,`depth`,`material`],`${n}.outline`,`outline`),e.number(r.width,`${n}.outline.width`,{min:0,exclusiveMin:!0}),e.color(r.color,`${n}.outline.color`),e.number(r.depth,`${n}.outline.depth`,{min:0,exclusiveMin:!0}),Ks(e,r.material,`${n}.outline.material`)}}if(t.reveal!==void 0){if(!L(t.reveal))e.error(`type`,`${n}.reveal`,`reveal must be an object.`,`Example: { "effect": "rise", "stagger": 0.04, "duration": 0.6 }.`);else{let r=t.reveal;if(e.unknownKeys(r,[`effect`,`stagger`,`duration`,`delay`,`ease`,`order`],`${n}.reveal`,`reveal`),e.enumOf(r.effect,tc,`${n}.reveal.effect`),e.number(r.stagger,`${n}.reveal.stagger`,{min:0}),e.number(r.duration,`${n}.reveal.duration`,{min:0,exclusiveMin:!0}),e.number(r.delay,`${n}.reveal.delay`,{min:0}),e.enumOf(r.order,[`forward`,`reverse`,`center`,`random`],`${n}.reveal.order`),r.ease!==void 0){let t=typeof r.ease==`string`?wa(r.ease):{error:`ease must be a string.`};`error`in t&&e.error(`enum`,`${n}.reveal.ease`,`Invalid easing ${Ss(r.ease)}: ${t.error}`,`Examples: ${ba.join(`, `)}.`)}}}(t.splitLetters===!0||L(t.reveal))&&typeof t.id==`string`&&(e.letterTexts.add(t.id),typeof t.text==`string`&&!/\{data\./.test(t.text)&&e.letterCounts.set(t.id,Array.from(t.text).filter(e=>e.trim()).length))}function rc(e,t){if(!Array.isArray(t))return e.error(`type`,`postfx`,`postfx must be an array.`,`Example: [{ "type": "bloom", "strength": 0.8 }].`);let n=new Set;t.forEach((t,r)=>{let i=`postfx[${r}]`;if(!L(t))return e.error(`type`,i,`A post effect must be an object.`);if(!e.required(t,`type`,i,`a catalog post effect (${P(d.postfx.map(e=>e.id))})`))return;let a=Ws(e,`postfx`,t.type,`${i}.type`);typeof t.type==`string`&&(n.has(t.type)&&e.warn(`duplicate`,`${i}.type`,`Post effect "${t.type}" appears twice.`,`Keep a single entry.`),n.add(t.type)),a&&e.params(`postfx`,a,t,i,[`type`]),t.type===`dof`&&typeof t.focusOn==`string`&&!e.objectIds.has(t.focusOn)&&e.error(`unknown-ref`,`${i}.focusOn`,`dof.focusOn "${t.focusOn}" is not an object id.`,`${N(t.focusOn,e.objectIds)}Object ids: ${P([...e.objectIds])}.`),t.type===`godrays`&&typeof t.source==`string`&&t.source!==`auto`&&t.source!==`sun`&&!e.lightIds.has(t.source)&&e.error(`unknown-ref`,`${i}.source`,`godrays.source "${t.source}" is not "auto", "sun" or a light id.`,`${N(t.source,e.lightIds)}Light ids: ${P([...e.lightIds])}.`)});let r=t.map(e=>L(e)?e.type:void 0);r.includes(`fxaa`)&&r.includes(`smaa`)&&e.warn(`duplicate`,`postfx`,`Both fxaa and smaa are set: they do the same job.`,`Keep smaa (sharper) or fxaa (cheaper).`)}function ic(e,t){if(!L(t))return e.error(`type`,`physics`,`physics must be an object.`,`Example: { "gravity": [0, -9.81, 0] }.`);e.unknownKeys(t,hs,`physics`,`physics`),e.vec(t.gravity,3,`physics.gravity`),e.number(t.step,`physics.step`,{min:0,exclusiveMin:!0,max:.1}),e.number(t.substeps,`physics.substeps`,{min:1,max:8,integer:!0}),e.number(t.iterations,`physics.iterations`,{min:1,max:100,integer:!0}),e.boolean(t.sleep,`physics.sleep`),e.boolean(t.debug,`physics.debug`);let n=_s.get(e)??[],r=new Map(n.map(e=>[e.id,e.body])),i=new Set;if(t.materials!==void 0){if(!L(t.materials))e.error(`type`,`physics.materials`,`materials must be an object { name: { friction, restitution } }.`,`Example: { "ice": { "friction": 0.02 }, "rubber": { "friction": 0.9, "restitution": 0.8 } }.`);else for(let[n,r]of Object.entries(t.materials)){let t=`physics.materials.${n}`;i.add(n),L(r)?(e.unknownKeys(r,[`friction`,`restitution`],t,`a physics material`),e.number(r.friction,`${t}.friction`,{min:0}),e.number(r.restitution,`${t}.restitution`,{min:0,max:1})):e.error(`type`,t,`A physics material must be an object.`,`Example: { "friction": 0.4, "restitution": 0.2 }.`)}}t.contacts!==void 0&&(Array.isArray(t.contacts)?t.contacts.forEach((t,n)=>{let r=`physics.contacts[${n}]`;if(!L(t))return e.error(`type`,r,`A contact must be an object.`,`Example: { "a": "ice", "b": "rubber", "friction": 0.05, "restitution": 0 }.`);e.unknownKeys(t,[`a`,`b`,`friction`,`restitution`],r,`a contact material`);for(let n of[`a`,`b`])e.required(t,n,r,`a physics.materials name`)&&(typeof t[n]==`string`&&i.has(t[n])||e.error(`unknown-ref`,`${r}.${n}`,`Unknown physics material ${Ss(t[n])}.`,i.size?`${N(String(t[n]),i)}Materials: ${P([...i])}.`:`Declare it in physics.materials first, e.g. "materials": { "ice": { "friction": 0.02 } }.`));e.number(t.friction,`${r}.friction`,{min:0}),e.number(t.restitution,`${r}.restitution`,{min:0,max:1})}):e.error(`type`,`physics.contacts`,`contacts must be an array.`,`Example: [{ "a": "ice", "b": "rubber", "friction": 0.05 }].`)),t.layers!==void 0&&e.stringArray(t.layers,`physics.layers`)&&Array.isArray(t.layers)&&new Set([`default`,...t.layers]).size>16&&e.error(`range`,`physics.layers`,`At most 16 collision layers (including "default").`);let a=new Set([`default`,...Array.isArray(t.layers)?t.layers.filter(e=>typeof e==`string`):[]]);for(let t of n)typeof t.body.material==`string`&&!i.has(t.body.material)&&e.error(`unknown-ref`,`${t.path}.material`,`Unknown physics material "${t.body.material}".`,i.size?`${N(t.body.material,i)}Materials: ${P([...i])}.`:`Declare it in physics.materials, e.g. "materials": { "ice": { "friction": 0.02 } }.`),typeof t.body.layer==`string`&&a.add(t.body.layer);a.size>16&&e.error(`range`,`physics.layers`,`Too many collision layers (${a.size}, max 16).`,`Reuse layer names: a layer is a group like "player", "enemy", "debris".`);for(let t of n)Array.isArray(t.body.collidesWith)&&t.body.collidesWith.forEach((n,r)=>{typeof n==`string`&&!a.has(n)&&e.warn(`unknown-ref`,`${t.path}.collidesWith[${r}]`,`Layer "${n}" is not used by any body.`,`${N(n,a)}Layers: ${P([...a])}.`)});t.joints!==void 0&&(Array.isArray(t.joints)?t.joints.forEach((t,n)=>ec(e,t,`physics.joints[${n}]`,r)):e.error(`type`,`physics.joints`,`joints must be an array.`,`Example: [{ "type": "hinge", "a": "door", "pivot": [1, 1, 0], "axis": [0, 1, 0] }].`))}function ac(e,t){if(!Array.isArray(t))return e.error(`type`,`scripts`,`scripts must be an array of paths.`,`Example: ["scripts/game.js"].`);let n=new Set;t.forEach((t,r)=>{let i=`scripts[${r}]`;if(typeof t!=`string`)return e.error(`type`,i,`A script entry must be a path string.`,`Example: "scripts/game.js".`);if(!/^scripts\/[A-Za-z0-9_\-./]+\.(m?js)$/.test(t)||t.split(`/`).includes(`..`))return e.error(`script-path`,i,`Invalid script path "${t}".`,`Scripts live under scripts/ and end with .js or .mjs, e.g. "scripts/game.js".`);n.has(t)&&e.warn(`duplicate`,i,`Script "${t}" is listed twice (it would run twice).`,`Remove the duplicate.`),n.add(t)})}function oc(e,t){if(!L(t))return e.error(`type`,`ui`,`ui must be an object.`,`Example: { "elements": [{ "id": "score", "type": "text", "text": "Score: {score}", "anchor": "top-left" }] }.`);if(e.unknownKeys(t,[`elements`,`font`,`color`,`accent`,`buttonText`],`ui`,`ui`),e.string(t.font,`ui.font`),typeof t.font==`string`&&/url\(|@import|https?:/i.test(t.font)&&e.error(`forbidden`,`ui.font`,`ui.font must be a CSS font-family list (no web fonts).`,`Use a system stack, e.g. "system-ui, sans-serif".`),e.color(t.color,`ui.color`),e.color(t.accent,`ui.accent`),e.color(t.buttonText,`ui.buttonText`),!e.required(t,`elements`,`ui`,`an array of HUD elements`))return;if(!Array.isArray(t.elements))return e.error(`type`,`ui.elements`,`elements must be an array.`);let n=new Set;t.elements.forEach((t,r)=>{let i=`ui.elements[${r}]`;if(!L(t))return e.error(`type`,i,`A UI element must be an object.`);ea(t.id)&&(i=`ui.elements#${t.id}`),e.declareId(t.id,`${i}.id`,`ui`)&&(n.has(t.id)&&e.error(`duplicate-id`,`${i}.id`,`Duplicate UI element id "${String(t.id)}".`,`Give each HUD element a unique id.`),n.add(t.id)),e.unknownKeys(t,vs,i,`a UI element`),e.required(t,`type`,i,`"text" | "button" | "bar"`)&&e.enumOf(t.type,[`text`,`button`,`bar`],`${i}.type`),e.string(t.text,`${i}.text`),e.enumOf(t.anchor,Bo,`${i}.anchor`),e.enumOf(t.style,[`plain`,`pill`,`title`,`subtitle`,`panel`],`${i}.style`),e.color(t.color,`${i}.color`),e.color(t.background,`${i}.background`),e.string(t.value,`${i}.value`),e.string(t.action,`${i}.action`),t.visible!==void 0&&typeof t.visible!=`boolean`&&typeof t.visible!=`string`&&e.error(`type`,`${i}.visible`,`visible must be a boolean or a state expression string.`),typeof t.visible==`string`&&Qs(e,t.visible,`${i}.visible`),t.type===`bar`&&t.value===void 0&&e.error(`required`,`${i}.value`,`A "bar" needs "value": the state key holding 0..1.`,`Add "value": "health" and set api.state.health in a script.`),t.type===`button`&&t.action===void 0&&e.error(`required`,`${i}.action`,`A "button" needs "action": the event name sent to scripts.`,`Add "action": "start" and handle it with api.on("start", …).`),(t.type===`text`||t.type===`button`)&&t.text===void 0&&e.warn(`required`,`${i}.text`,`A "${String(t.type)}" element without text shows nothing.`,`Add "text", e.g. "Score: {score}".`)})}function sc(e,t){if(!L(t))return e.error(`type`,`audio`,`audio must be an object.`,`Example: { "sounds": { "coin": { "preset": "coin" } } }.`);e.unknownKeys(t,[`sounds`,`music`,`muted`],`audio`,`audio`),e.boolean(t.muted,`audio.muted`);let n=d.sounds.map(e=>e.id),r=(t,r,i)=>{if(!L(t))return e.error(`type`,r,`Expected { "preset": "coin" } or { "src": "assets/audio/x.mp3" }.`);if(e.unknownKeys(t,i?[`src`,`preset`,`volume`,`loop`]:[`src`,`preset`,`volume`],r,i?`music`:`a sound`),t.preset===void 0&&t.src===void 0)return e.error(`required`,r,`Needs "preset" (synth) or "src" (audio file).`,`Synth presets: ${P(n)}.`);t.preset!==void 0&&t.src!==void 0&&e.warn(`ambiguous`,r,`Both "preset" and "src" are set; "src" wins.`,`Keep only one.`),t.preset!==void 0&&Ws(e,`sounds`,t.preset,`${r}.preset`),t.src!==void 0&&e.assetPath(t.src,`${r}.src`,Jo,`an audio file`),e.number(t.volume,`${r}.volume`,{min:0,max:1}),i&&e.boolean(t.loop,`${r}.loop`)};if(t.sounds!==void 0){if(!L(t.sounds))e.error(`type`,`audio.sounds`,`sounds must be an object keyed by sound name.`);else for(let[e,n]of Object.entries(t.sounds))r(n,`audio.sounds.${e}`,!1)}t.music!==void 0&&r(t.music,`audio.music`,!0)}function cc(e){if(!L(e))return e;let t=JSON.parse(JSON.stringify(e));return t.version===void 0&&(t.version=1),t.lights===void 0&&(t.lights=[]),t.objects===void 0&&(t.objects=[]),L(t.timeline)&&t.timeline.tracks===void 0&&(t.timeline.tracks=[]),L(t.ui)&&t.ui.elements===void 0&&(t.ui.elements=[]),t}var lc=(e=1)=>[{id:`fill`,type:`hemisphere`,skyColor:`#e8ecff`,groundColor:`#3a2f5c`,intensity:.6*e},{id:`key`,type:`directional`,position:[4,6,6],intensity:1.6*e,castShadow:!0},{id:`rim`,type:`point`,position:[-5,2,-3],color:`#7cc8ff`,intensity:18*e,distance:20}],uc=1,dc=1.5;function fc(e,t,n={}){return{id:`title`,kind:`text`,text:e,font:`sans-bold`,size:t,depth:t*.3,bevel:t*.03,material:{preset:`plastic`,color:`#ebe3f7`,roughness:.4},behaviours:[{type:`appear`,effect:`rise`,duration:uc},{type:`float`,amplitude:.08,speed:.4}],...n}}var pc=(e,t,n,r,i={},a=0)=>({id:e,kind:`mesh`,geometry:{type:t,...i},material:{preset:`plastic`,color:r},position:n,rotation:[20,30,0],behaviours:[{type:`float`,amplitude:.2,speed:.3,phase:a},{type:`rotate`,axis:[.3,1,.2],speed:18}]});function mc(e){return{camera:{type:`perspective`,fov:30,position:[0,0,12],target:[0,0,0],controls:`parallax`,parallax:{strength:.4,smoothing:.92}},environment:{background:{gradient:[`#1b1446`,`#4a2a8f`,`#ff7ab6`],angle:20},lighting:`studio`,lightingIntensity:.6},lights:lc(),objects:[fc(e,.8),pc(`torus`,`torus`,[-7.6,.5,-1.5],`#ff9ccf`,{radius:.6,tube:.22}),pc(`gem`,`icosahedron`,[7.8,-.5,-1],`#7cc8ff`,{radius:.7,detail:0},.4),pc(`pill`,`capsule`,[5.9,1.6,-2.5],`#ffd36e`,{radius:.25,length:.5},.7),pc(`block`,`roundedBox`,[-5.8,-1.6,-2.5],`#b9a2ff`,{width:.6,height:.6,depth:.6,radius:.1},.2),{id:`dust`,kind:`particles`,preset:`dust`,count:120,area:[26,7,6],size:.05,color:`#ffffff`,opacity:.6}],postfx:[{type:`bloom`,strength:.25,radius:.5,threshold:1.5}]}}function hc(e){return{camera:{type:`perspective`,fov:35,position:[0,.3,10],target:[0,0,0],controls:`parallax`,parallax:{strength:.5}},environment:{background:{radial:[`#2b1f63`,`#0c0a1f`]},lighting:`studio`,lightingIntensity:.6},lights:lc(.8),objects:[{id:`blob`,kind:`generator`,generator:`blob`,params:{radius:1.4,noise:.3,speed:.35},position:[0,-1.05,-1.5]},fc(e,.7,{position:[0,1.75,.5]}),{id:`sparkles`,kind:`particles`,preset:`dust`,count:160,area:[16,9,6],size:.05,color:`#cfc6ff`,opacity:.7}],postfx:[{type:`bloom`,strength:.25,radius:.5,threshold:1.5},{type:`vignette`,darkness:.9}]}}function gc(e){return{camera:{type:`perspective`,fov:35,position:[0,1.2,7],target:[0,.4,0]},environment:{background:{gradient:[`#fdf2e9`,`#f6c6c6`],angle:0},lighting:`soft`,ground:{y:-1,shadowOnly:!0}},lights:lc(),objects:[{id:`pedestal`,kind:`mesh`,geometry:{type:`cylinder`,radiusTop:1.2,radiusBottom:1.3,height:.4,segments:64},material:{preset:`clay`,color:`#fff4ea`},position:[0,-.8,0],receiveShadow:!0,castShadow:!0},{id:`knot`,kind:`mesh`,geometry:{type:`torusKnot`,radius:.55,tube:.18},material:{preset:`pearl`,color:`#ff9fb8`},position:[0,.45,0],castShadow:!0,behaviours:[{type:`rotate`,speed:25},{type:`float`,amplitude:.1,speed:.4},{type:`hoverScale`,scale:1.1}]},fc(e,.24,{position:[0,1.75,0],material:{preset:`matte`,color:`#5a3e5d`}})]}}function _c(e){return{camera:{type:`perspective`,fov:35,position:[0,.4,7],target:[0,0,0],controls:`orbit`,orbitZoom:!1},environment:{background:{radial:[`#3a1c71`,`#0f0c29`]},lighting:`studio`,lightingIntensity:.6},lights:lc(.8),objects:[{id:`gem`,kind:`mesh`,geometry:{type:`icosahedron`,radius:1,detail:0},material:{preset:`holographic`},position:[0,.5,0],behaviours:[{type:`rotate`,axis:[.2,1,0],speed:20},{type:`float`,amplitude:.12,speed:.4}]},fc(e,.28,{position:[0,-1.25,.5]}),{id:`stars`,kind:`particles`,preset:`stars`,count:200,area:[12,12,8],size:.04}],postfx:[{type:`bloom`,strength:.35,radius:.4,threshold:1.5}]}}function vc(e){return{camera:{type:`perspective`,fov:45,position:[0,9,26],target:[0,1,0],controls:`orbit`,autoRotate:4,orbitLimits:{minDistance:10,maxDistance:45,maxPolar:85}},environment:{background:{sky:{top:`#3d7dd8`,horizon:`#f7d9b0`,sun:{direction:[.6,.35,.4]}}},lighting:`sunset`,fog:{color:`#f2dcc0`,near:30,far:90}},lights:[{id:`sky`,type:`hemisphere`,skyColor:`#cfe6ff`,groundColor:`#6b5a3a`,intensity:.9},{id:`sun`,type:`directional`,position:[20,18,12],color:`#ffe2b8`,intensity:2.5,castShadow:!0}],objects:[{id:`terrain`,kind:`generator`,generator:`terrain`,params:{size:60,height:7,shape:`island`,waterLevel:.8},seed:7,receiveShadow:!0},{id:`trees`,kind:`generator`,generator:`trees`,params:{count:60,area:[40,0,40],style:`mixed`},seed:3,castShadow:!0},{id:`clouds`,kind:`generator`,generator:`clouds`,params:{count:7,height:14}},fc(e,1.1,{position:[0,8.8,10],material:{preset:`plastic`,color:`#25406b`,roughness:.4},behaviours:[{type:`appear`,effect:`rise`,duration:uc},{type:`billboard`},{type:`float`,amplitude:.15,speed:.3}]})]}}function yc(e){return{camera:{type:`perspective`,fov:50,position:[0,6,9],target:[0,0,0],controls:`follow`,follow:{target:`player`,offset:[0,6,9],smoothing:.9}},environment:{background:{gradient:[`#8ec5fc`,`#e0c3fc`],angle:0},lighting:`soft`},lights:[{id:`fill`,type:`hemisphere`,skyColor:`#ffffff`,groundColor:`#8a7fb0`,intensity:1},{id:`sun`,type:`directional`,position:[6,10,4],intensity:2,castShadow:!0}],objects:[{id:`floor`,kind:`mesh`,geometry:{type:`box`,width:20,height:.5,depth:20},material:{preset:`matte`,color:`#b8e0a8`},position:[0,-.25,0],receiveShadow:!0,body:{type:`static`}},{id:`player`,kind:`mesh`,geometry:{type:`roundedBox`,width:.8,height:.8,depth:.8,radius:.15},material:{preset:`plastic`,color:`#ff6b6b`},position:[0,.4,0],castShadow:!0,body:{type:`kinematic`},tags:[`player`]},{id:`coins`,kind:`group`,children:[-4,-1.5,2,4.5].map((e,t)=>({id:`coin-${t+1}`,kind:`mesh`,geometry:{type:`cylinder`,radiusTop:.3,radiusBottom:.3,height:.08},material:{preset:`gold`},position:[e,.6,t%2?-3:3],rotation:[90,0,0],tags:[`coin`],body:{type:`trigger`},behaviours:[{type:`rotate`,axis:[0,0,1],speed:120}]}))},fc(e,.6,{position:[0,3,-6],material:{preset:`plastic`,color:`#5b3fd1`,roughness:.35},behaviours:[{type:`float`,amplitude:.1,speed:.4}]})],scripts:[`scripts/game.js`],ui:{elements:[{id:`score`,type:`text`,text:`Coins: {score}`,anchor:`top-left`,style:`pill`}],color:`#2b2340`},physics:{gravity:[0,-9.81,0]},audio:{sounds:{coin:{preset:`coin`}}}}}var bc=`// Move the player with the arrow keys / WASD, or swipe on a phone (the
|
|
10
|
+
`).replace(lp,``)}function dp(e,t){return t=up(t),up(e)===t}function fp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&vn(e,``+r);else return;break;case`className`:nn(e,`class`,r);break;case`tabIndex`:nn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:nn(e,n,r);break;case`style`:xn(e,r,o);return;case`data`:if(t!==`object`){nn(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&fp(e,t,`name`,a.name,a,null),fp(e,t,`formEncType`,a.formEncType,a,null),fp(e,t,`formMethod`,a.formMethod,a,null),fp(e,t,`formTarget`,a.formTarget,a,null)):(fp(e,t,`encType`,a.encType,a,null),fp(e,t,`method`,a.method,a,null),fp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=En);return;case`onScroll`:r!=null&&V(`scroll`,e);return;case`onScrollEnd`:r!=null&&V(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Tn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:V(`beforetoggle`,e),V(`toggle`,e),tn(e,`popover`,r);break;case`xlinkActuate`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:tn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=Cn.get(n)||n,tn(e,n,r);else return}$t=!0}function pp(e,t,n,r,a,o){switch(n){case`style`:xn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)vn(e,``+r);else return;break;case`onScroll`:r!=null&&V(`scroll`,e);return;case`onScrollEnd`:r!=null&&V(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=En);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Kt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[At]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}$t=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):tn(e,n,r)}return}$t=!0}function mp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:V(`error`,e),V(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:fp(e,t,o,s,n,null)}}a&&fp(e,t,`srcSet`,n.srcSet,n,null),r&&fp(e,t,`src`,n.src,n,null);return;case`input`:V(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:fp(e,t,r,d,n,null)}}pn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in V(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:fp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&hn(e,!!r,n,!0):hn(e,!!r,t,!1);return;case`textarea`:for(s in V(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:fp(e,t,s,c,n,null)}_n(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:fp(e,t,l,r,n,null)}return;case`dialog`:V(`beforetoggle`,e),V(`toggle`,e),V(`cancel`,e),V(`close`,e);break;case`iframe`:case`object`:V(`load`,e);break;case`video`:case`audio`:for(r=0;r<Xf.length;r++)V(Xf[r],e);break;case`image`:V(`error`,e),V(`load`,e);break;case`details`:V(`toggle`,e);break;case`embed`:case`source`:case`link`:V(`error`,e),V(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:fp(e,t,u,r,n,null)}return;default:if(Sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&pp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&fp(e,t,c,r,n,null))}var hp={};function gp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||fp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&($t=!0),o=m;break;case`name`:m!==f&&($t=!0),a=m;break;case`checked`:m!==f&&($t=!0),u=m;break;case`defaultChecked`:m!==f&&($t=!0),d=m;break;case`value`:m!==f&&($t=!0),s=m;break;case`defaultValue`:m!==f&&($t=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&fp(e,t,p,m,r,f)}}fn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||fp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&($t=!0),p=o;break;case`defaultValue`:o!==l&&($t=!0),c=o;break;case`multiple`:o!==l&&($t=!0),s=o;default:o!==l&&fp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?hn(e,!!n,n?[]:``,!1):hn(e,!!n,t,!0)):hn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:fp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&($t=!0),p=a;break;case`defaultValue`:a!==o&&($t=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&fp(e,t,s,a,r,o)}gn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:fp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&($t=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:fp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&fp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:fp(e,t,u,p,r,m)}return;default:if(Sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&pp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||pp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&fp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||fp(e,t,f,p,r,m)}function _p(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function vp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&_p(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&_p(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var yp=null,bp=null;function xp(e){return e.nodeType===9?e:e.ownerDocument}function Sp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Cp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function wp(e,t,n,r){return n=xp(n).createElement(e),n[kt]=r,n[At]=t,mp(n,e,t),Ut(n),n}function Tp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ep=null;function Dp(){var e=window.event;return e&&e.type===`popstate`?e!==Ep&&(Ep=e,!0):(Ep=null,!1)}var Op=typeof setTimeout==`function`?setTimeout:void 0,kp=typeof clearTimeout==`function`?clearTimeout:void 0,Ap=typeof Promise==`function`?Promise:void 0,jp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Op,Mp=typeof queueMicrotask==`function`?queueMicrotask:Ap===void 0?Op:function(e){return Ap.resolve(null).then(e).catch(Np)};function Np(e){setTimeout(function(){throw e})}function Pp(e){return e===`head`}function Fp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),W(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Om(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Om(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[It]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Om(e.ownerDocument.body)}n=i}while(n);W(t)}function Ip(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Lp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Rp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function zp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Bp(e){return zp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Vp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return zp(t,n,e)}function Hp(e){return e.documentElement.clientHeight}function Up(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Wp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Hp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=sh(f),u>uh){s.length=o;break}f=new Promise(Up.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Gp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Gp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Gp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Gp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Kp(e){return{name:e,group:new Gp(`group`,e),imagePair:new Gp(`image-pair`,e),old:new Gp(`old`,e),new:new Gp(`new`,e)}}function qp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}qp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Qp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Xp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Jp,e,s,r)}this._eventListeners=a}};function Jp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}qp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Qp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Xp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Yp,e,n,i),r.splice(t,1),a!==null&&a()}};function Yp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Xp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Qp(e,t,n,r){if(e.length===0)return-1;r=Zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Zp(a.optionsOrUseCapture)===r)return i}return-1}qp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Xp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Xp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},qp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,$p,e,void 0,void 0)};function $p(e,t){return e.tag!==6&&(e=_(e),Tm(e,t))}qp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,em,t,void 0,void 0);for(var n=t.length-1;0<=n&&!$p(t[n],e);n--);};function em(e,t){return t.push(e),!1}qp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=xp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,tm,e,void 0,void 0))};function tm(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}qp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,nm,e,void 0,void 0)};function nm(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}qp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,rm,e,void 0,void 0);for(var n=t=0;n<im.length;n++){var r=im[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):im[t++]=r}im.length=t}};function rm(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var im=[],am=!1;function om(e,t,n){im.push({fragmentInstance:e,observer:t,instance:n}),am||(am=!0,Em(function(){am=!1;var e=im;im=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}qp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,sm,e,void 0,void 0),e};function sm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}qp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},qp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,em,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||cm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function cm(e,t,n,r,i){var a=zt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function lm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}qp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,em,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),lm(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),lm(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function um(e,t){return e=_(e),dm(e,t),!1}function dm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function fm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Xp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<im.length;i++){var a=im[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(im[r++]=a)}im.length=r,n.observe(e)}),dm(e,t))}function pm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Xp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?om(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function mm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:mm(n),Rt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function hm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[It])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=xm(e.nextSibling),e===null)break}return null}function gm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=xm(e.nextSibling),e===null))return null;return e}function _m(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=xm(e.nextSibling),e===null))return null;return e}function vm(e){return e.data===`$?`||e.data===`$~`}function ym(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function bm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function xm(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Sm=null;function Cm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return xm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function wm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Tm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Em(e){jp(function(){jp(function(t){return e(t)})})}function H(e,t,n){switch(t=xp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Dm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&fp(e,t,r,null,hp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===En&&(e.onclick=null),Rt(e)}function Om(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rt(e)}var km=new Map,Am=new Set;function jm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Mm=j.d;j.d={f:Nm,r:Pm,D:Lm,C:Rm,L:zm,m:Bm,X:Hm,S:Vm,M:Um};function Nm(){var e=Mm.f(),t=Yd();return e||t}function Pm(e){var t=Bt(e);t!==null&&t.tag===5&&t.type===`form`?cc(t):Mm.r(e)}var Fm=typeof document>`u`?null:document;function Im(e,t,n){var r=Fm;if(r&&typeof t==`string`&&t){var i=dn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Am.has(i)||(Am.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),mp(t,`link`,e),Ut(t),r.head.appendChild(t)))}}function Lm(e){Mm.D(e),Im(`dns-prefetch`,e,null)}function Rm(e,t){Mm.C(e,t),Im(`preconnect`,e,t)}function zm(e,t,n){Mm.L(e,t,n);var r=Fm;if(r&&e&&t){var i=`link[rel="preload"][as="`+dn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+dn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+dn(n.imageSizes)+`"]`)):i+=`[href="`+dn(e)+`"]`;var a=i;switch(t){case`style`:a=Gm(e);break;case`script`:a=Ym(e)}if(!(km.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),km.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Km(a))||t===`script`&&r.querySelector(Xm(a))))){var o=r.createElement(`link`);mp(o,`link`,e),t===`style`&&(o[Lt]=!0,o.onload=o.onerror=function(){Wt(o)}),Ut(o),r.head.appendChild(o)}}}function Bm(e,t){Mm.m(e,t);var n=Fm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+dn(r)+`"][href="`+dn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ym(e)}if(!km.has(a)&&(e=w({rel:`modulepreload`,href:e},t),km.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xm(a)))return}r=n.createElement(`link`),mp(r,`link`,e),Ut(r),n.head.appendChild(r)}}}function Vm(e,t,n){Mm.S(e,t,n);var r=Fm;if(r&&e){var i=Ht(r).hoistableStyles,a=Gm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Km(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=km.get(a))&&$m(e,n);var c=o=r.createElement(`link`);Ut(c),mp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hm(e,t){Mm.X(e,t);var n=Fm;if(n&&e){var r=Ht(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=w({src:e,async:!0},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Ut(a),mp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t){Mm.M(e,t);var n=Fm;if(n&&e){var r=Ht(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Ut(a),mp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wm(e,t,n,r){var a=(a=ke.current)?jm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Gm(n.href),t=Ht(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Gm(n.href);var o=Ht(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Km(e)))?o._p||(s.instance=o,s.state.loading=5):(o=km.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},km.set(e,o)),Jm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Ym(n),t=Ht(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Gm(e){return`href="`+dn(e)+`"`}function Km(e){return`link[rel="stylesheet"][`+e+`]`}function qm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Jm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Lt]){r.loading=1;return}}else t=e.createElement(`link`),t[Lt]=!0,t.onload=t.onerror=Wt.bind(null,t),mp(t,`link`,n),Ut(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Ym(e){return`[src="`+dn(e)+`"]`}function Xm(e){return`script[async]`+e}function Zm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+dn(n.href)+`"]`);if(r)return t.instance=r,Ut(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ut(r),mp(r,`style`,a),Qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Gm(n.href);var o=e.querySelector(Km(a));if(o)return t.state.loading|=4,t.instance=o,Ut(o),o;r=qm(n),(a=km.get(a))&&$m(r,a),o=(e.ownerDocument||e).createElement(`link`),Ut(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),mp(o,`link`,r),t.state.loading|=4,Qm(o,n.precedence,e),t.instance=o;case`script`:return o=Ym(n.src),(a=e.querySelector(Xm(o)))?(t.instance=a,Ut(a),a):(r=n,(a=km.get(o))&&(r=w({},n),eh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ut(a),mp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Qm(r,n.precedence,e));return t.instance}function Qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function eh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var th=null;function nh(e,t,n){if(th===null){var r=new Map,i=th=new Map;i.set(n,r)}else i=th,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[It]||a[kt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function rh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ih(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ah(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function oh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function sh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ch(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=sh(t),e.suspenseyImages.push(t)),e=mh.bind(e),t.decode().then(e,e))}function lh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Gm(r.href),a=t.querySelector(Km(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ph.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ut(a);return}a=t.ownerDocument||t,r=qm(r),(i=km.get(i))&&$m(r,i),a=a.createElement(`link`),Ut(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),mp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ph.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var uh=0;function dh(e,t){return e.stylesheets&&e.count===0&&gh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&uh===0&&(uh=62500*vp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>uh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)gh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ph(){this.count--,fh(this)}function mh(){this.imgCount--,fh(this)}var hh=null;function gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hh=new Map,t.forEach(_h,e),hh=null,ph.call(e))}function _h(e,t){if(!(t.state.loading&4)){var n=hh.get(e);if(n)var r=n.get(null);else{n=new Map,hh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ph.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var vh={$$typeof:se,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function yh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function bh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new yh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Bi(3,null,null,t),e.current=a,a.stateNode=e,t=La(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},bo(a),e}function xh(e){return e?(e=Ri,e):Ri}function Sh(e,t,n,r,i,a){i=xh(i),r.context===null?r.context=i:r.pendingContext=i,r=So(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Co(e,r,t),n!==null&&(Wd(n,e,t),wo(n,e,t))}function Ch(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wh(e,t){Ch(e,t),(e=e.alternate)&&Ch(e,t)}function Th(e){if(e.tag===13||e.tag===31){var t=Fi(e,67108864);t!==null&&Wd(t,e,67108864),wh(e,67108864)}}function Eh(e){if(e.tag===13||e.tag===31){var t=Vd();t=wt(t);var n=Fi(e,t);n!==null&&Wd(n,e,t),wh(e,t)}}var Dh=!0;function Oh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,Ah(e,t,n,r)}finally{j.p=a,A.T=i}}function kh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,Ah(e,t,n,r)}finally{j.p=a,A.T=i}}function Ah(e,t,n,r){if(Dh){var i=jh(r);if(i===null)rp(e,t,r,Mh,n),Uh(e,r);else if(Gh(i,e,t,n,r))r.stopPropagation();else if(Uh(e,r),t&4&&-1<Hh.indexOf(e)){for(;i!==null;){var a=Bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ft(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-at(o);s.entanglements[1]|=c,o&=~c}Lf(a),!(sd&6)&&(Ed=qe()+500,Rf(0,!1))}}break;case 31:case 13:s=Fi(a,2),s!==null&&Wd(s,a,2),Yd(),wh(a,2)}if(a=jh(r),a===null&&rp(e,t,r,Mh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else rp(e,t,r,null,n)}}function jh(e){return e=On(e),Nh(e)}var Mh=null;function Nh(e){if(Mh=null,e=zt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 Mh=e,null}function Ph(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Je()){case Ye:return 2;case Xe:return 8;case Ze:case Qe:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Fh=!1,Ih=null,Lh=null,Rh=null,zh=new Map,Bh=new Map,Vh=[],Hh=`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`.split(` `);function Uh(e,t){switch(e){case`focusin`:case`focusout`:Ih=null;break;case`dragenter`:case`dragleave`:Lh=null;break;case`mouseover`:case`mouseout`:Rh=null;break;case`pointerover`:case`pointerout`:zh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Bh.delete(t.pointerId)}}function Wh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Bt(t),t!==null&&Th(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Gh(e,t,n,r,i){switch(t){case`focusin`:return Ih=Wh(Ih,e,t,n,r,i),!0;case`dragenter`:return Lh=Wh(Lh,e,t,n,r,i),!0;case`mouseover`:return Rh=Wh(Rh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return zh.set(a,Wh(zh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Bh.set(a,Wh(Bh.get(a)||null,e,t,n,r,i)),!0}return!1}function Kh(e){var t=zt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){Eh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){Eh(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 qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=jh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Dn=r,n.target.dispatchEvent(r),Dn=null}else return t=Bt(n),t!==null&&Th(t),e.blockedOn=n,!1;t.shift()}return!0}function Jh(e,t,n){qh(e)&&n.delete(t)}function Yh(){Fh=!1,Ih!==null&&qh(Ih)&&(Ih=null),Lh!==null&&qh(Lh)&&(Lh=null),Rh!==null&&qh(Rh)&&(Rh=null),zh.forEach(Jh),Bh.forEach(Jh)}function U(e,n){e.blockedOn===n&&(e.blockedOn=null,Fh||(Fh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Yh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Nh(r||n)===null)continue;break}var a=Bt(n);a!==null&&(e.splice(t,3),t-=3,oc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function W(e){function t(t){return U(t,e)}Ih!==null&&U(Ih,e),Lh!==null&&U(Lh,e),Rh!==null&&U(Rh,e),zh.forEach(t),Bh.forEach(t);for(var n=0;n<Vh.length;n++){var r=Vh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Vh.length&&(n=Vh[0],n.blockedOn===null);)Kh(n),n.blockedOn===null&&Vh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[At]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[At]||null)s=o.formAction;else if(Nh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function Qh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function G(e){this._internalRoot=e}$h.prototype.render=G.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Sh(n,Vd(),e,t,null,null)},$h.prototype.unmount=G.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sh(e.current,2,null,e,null,null),Yd(),t[jt]=null}};function $h(e){this._internalRoot=e}$h.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vh.length&&t!==0&&t<Vh[n].priority;n++);Vh.splice(n,0,e),n===0&&Kh(e)}};var eg=n.version;if(eg!==`19.3.1`)throw Error(i(527,eg,`19.3.1`));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var tg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{nt=ng.inject(tg),rt=ng}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=kc,s=Ac,c=jc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=bh(e,1,!1,null,null,n,r,null,o,s,c,Qh),e[jt]=t.current,tp(e),new G(t)}})),re=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=D()})),ie=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function ae(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:ie(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var oe=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},se=e=>{let t=oe(e);return t.charAt(0).toUpperCase()+t.slice(1)},ce=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},le={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ue(e){return e!=null}function de(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??le.width,a=e.size??e.height??le.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ce(...c):ce(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??le[`stroke-width`])*Number(e.size??e.width??le.width)/Number(t.size??t.width??le.width):t.strokeWidth??le[`stroke-width`];return[`svg`,{...Object.entries(le).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ue(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ue(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ue(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function fe(e,t={}){return de(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var pe=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},O=T(),me=(0,O.createContext)({}),he=()=>(0,O.useContext)(me),ge=(0,O.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=he()??{},y=!!c||pe(d),[b,x,S=[]]=fe(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:ce(v,s),hasA11yProp:y,attributes:d});return(0,O.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,O.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function k(e,t=[],n=[]){let r=typeof e==`string`?ae(e,t,n):e,i=(0,O.forwardRef)(({className:e,...t},n)=>(0,O.createElement)(ge,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=se(r.name)),i}var _e={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};_e.node;var ve=k(_e),ye={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};ye.node;var be=k(ye),A={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};A.node;var j=k(A),xe={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};xe.node;var Se=k(xe),Ce={name:`box`,size:24,node:[[`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`}]]};Ce.node;var we=k(Ce),Te={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};Te.node;var Ee=k(Te),De={name:`building`,size:24,node:[[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M12 6h.01`,key:`1vi96p`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M16 6h.01`,key:`1x0f13`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M8 6h.01`,key:`1dz90k`}],[`path`,{d:`M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3`,key:`cabbwy`}],[`rect`,{x:`4`,y:`2`,width:`16`,height:`20`,rx:`2`,key:`1uxh74`}]]};De.node;var Oe=k(De),ke={name:`camera`,size:24,node:[[`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`}]]};ke.node;var Ae=k(ke),je={name:`castle`,size:24,node:[[`path`,{d:`M10 5V3`,key:`1y54qe`}],[`path`,{d:`M14 5V3`,key:`m6isi`}],[`path`,{d:`M15 21v-3a3 3 0 0 0-6 0v3`,key:`lbp5hj`}],[`path`,{d:`M18 3v8`,key:`2ollhf`}],[`path`,{d:`M18 5H6`,key:`98imr9`}],[`path`,{d:`M22 11H2`,key:`1lmjae`}],[`path`,{d:`M22 9v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9`,key:`1rly83`}],[`path`,{d:`M6 3v8`,key:`csox7g`}]]};je.node;var Me=k(je),Ne={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ne.node;var Pe=k(Ne),Fe={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Fe.node;var Ie=k(Fe),Le={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Le.node;var Re=k(Le),ze={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};ze.node;var Be=k(ze),Ve={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ve.node;var He=k(Ve),Ue={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ue.node;var We=k(Ue),Ge={name:`circle-exclamation-point`,size:24,node:[[`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`}]],aliases:[`alert-circle`,`circle-alert`]};Ge.node;var Ke=k(Ge),qe={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};qe.node;var Je=k(qe),Ye={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};Ye.node;var Xe=k(Ye),Ze={name:`cloud-rain`,size:24,node:[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 14v6`,key:`1j4efv`}],[`path`,{d:`M8 14v6`,key:`17c4r9`}],[`path`,{d:`M12 16v6`,key:`c8a4gj`}]]};Ze.node;var Qe=k(Ze),$e={name:`cloud-sun`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}],[`path`,{d:`M15.947 12.65a4 4 0 0 0-5.925-4.128`,key:`dpwdj0`}],[`path`,{d:`M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z`,key:`s09mg5`}]]};$e.node;var et=k($e),tt={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};tt.node;var nt=k(tt),rt={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};rt.node;var it=k(rt),at={name:`cone`,size:24,node:[[`path`,{d:`m20.9 18.55-8-15.98a1 1 0 0 0-1.8 0l-8 15.98`,key:`53pte7`}],[`ellipse`,{cx:`12`,cy:`19`,rx:`9`,ry:`3`,key:`1ji25f`}]]};at.node;var ot=k(at),st={name:`copy`,size:24,node:[[`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`}]]};st.node;var ct=k(st),lt={name:`cylinder`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5v14a9 3 0 0 0 18 0V5`,key:`aqi0yr`}]]};lt.node;var ut=k(lt),dt={name:`diamond`,size:24,node:[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]};dt.node;var ft=k(dt),pt={name:`donut`,size:24,node:[[`path`,{d:`M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3`,key:`19sr3x`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};pt.node;var mt=k(pt),ht={name:`download`,size:24,node:[[`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`}]]};ht.node;var gt=k(ht),_t={name:`droplets`,size:24,node:[[`path`,{d:`M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z`,key:`1ptgy4`}],[`path`,{d:`M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97`,key:`1sl1rz`}]]};_t.node;var vt=k(_t),yt={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};yt.node;var bt=k(yt),xt={name:`eye-off`,size:24,node:[[`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`}]]};xt.node;var St=k(xt),Ct={name:`eye`,size:24,node:[[`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`}]]};Ct.node;var wt=k(Ct),Tt={name:`file-code`,size:24,node:[[`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 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};Tt.node;var Et=k(Tt),Dt={name:`film`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]};Dt.node;var Ot=k(Dt),kt={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};kt.node;var At=k(kt),jt={name:`flame`,size:24,node:[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]};jt.node;var Mt=k(jt),Nt={name:`focus`,size:24,node:[[`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`}]]};Nt.node;var Pt=k(Nt),Ft={name:`folder-open`,size:24,node:[[`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`}]]};Ft.node;var It=k(Ft),Lt={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Lt.node;var Rt=k(Lt),zt={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};zt.node;var Bt=k(zt),Vt={name:`gem`,size:24,node:[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]};Vt.node;var Ht=k(Vt),Ut={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Ut.node;var Wt=k(Ut),Gt={name:`grid-2x2`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]],aliases:[`grid-2-x-2`]};Gt.node;var Kt=k(Gt),qt={name:`grid-3x3`,size:24,node:[[`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`}]],aliases:[`grid`,`grid-3-x-3`]};qt.node;var Jt=k(qt),Yt={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};Yt.node;var Xt=k(Yt),Zt={name:`hand`,size:24,node:[[`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`}]]};Zt.node;var Qt=k(Zt),$t={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};$t.node;var en=k($t),tn={name:`heart`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]};tn.node;var nn=k(tn),rn={name:`hexagon`,size:24,node:[[`path`,{d:`M21 16V8a2 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:`yt0hxn`}]]};rn.node;var an=k(rn),on={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};on.node;var sn=k(on),cn={name:`images`,size:24,node:[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]};cn.node;var ln=k(cn),un={name:`infinity`,size:24,node:[[`path`,{d:`M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8`,key:`18ogeb`}]]};un.node;var dn=k(un),fn={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};fn.node;var pn=k(fn),mn={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};mn.node;var hn=k(mn),gn={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};gn.node;var _n=k(gn),vn={name:`lamp`,size:24,node:[[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`M4.077 10.615A1 1 0 0 0 5 12h14a1 1 0 0 0 .923-1.385l-3.077-7.384A2 2 0 0 0 15 2H9a2 2 0 0 0-1.846 1.23Z`,key:`1l7kg2`}],[`path`,{d:`M8 20a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1z`,key:`1mmzpi`}]]};vn.node;var yn=k(vn),bn={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};bn.node;var xn=k(bn),Sn={name:`library`,size:24,node:[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]};Sn.node;var Cn=k(Sn),wn={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};wn.node;var Tn=k(wn),En={name:`link-2-off`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]};En.node;var Dn=k(En),On={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};On.node;var kn=k(On),An={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};An.node;var jn=k(An),Mn={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Mn.node;var Nn=k(Mn),Pn={name:`magnet`,size:24,node:[[`path`,{d:`m12 15 4 4`,key:`lnac28`}],[`path`,{d:`M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z`,key:`nlhkjb`}],[`path`,{d:`m5 8 4 4`,key:`j6kj7e`}]]};Pn.node;var Fn=k(Pn),In={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};In.node;var Ln=k(In),Rn={name:`mountain`,size:24,node:[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]};Rn.node;var zn=k(Rn),Bn={name:`mouse-pointer-2`,size:24,node:[[`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`}]]};Bn.node;var Vn=k(Bn),Hn={name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]};Hn.node;var Un=k(Hn),Wn={name:`move-3d`,size:24,node:[[`path`,{d:`M5 3v16h16`,key:`1mqmf9`}],[`path`,{d:`m5 19 6-6`,key:`jh6hbb`}],[`path`,{d:`m2 6 3-3 3 3`,key:`tkyvxa`}],[`path`,{d:`m18 16 3 3-3 3`,key:`1d4glt`}]],aliases:[`move-3-d`]};Wn.node;var Gn=k(Wn),Kn={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};Kn.node;var qn=k(Kn),Jn={name:`party-popper`,size:24,node:[[`path`,{d:`M5.8 11.3 2 22l10.7-3.79`,key:`gwxi1d`}],[`path`,{d:`M4 3h.01`,key:`1vcuye`}],[`path`,{d:`M22 8h.01`,key:`1mrtc2`}],[`path`,{d:`M15 2h.01`,key:`1cjtqr`}],[`path`,{d:`M22 20h.01`,key:`1mrys2`}],[`path`,{d:`m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10`,key:`hbicv8`}],[`path`,{d:`m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17`,key:`1i94pl`}],[`path`,{d:`m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7`,key:`1cofks`}],[`path`,{d:`M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z`,key:`4kbmks`}]]};Jn.node;var Yn=k(Jn),Xn={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Xn.node;var Zn=k(Xn),Qn={name:`pen-tool`,size:24,node:[[`path`,{d:`m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18`,key:`93nyr4`}],[`path`,{d:`M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z`,key:`lnux7s`}],[`path`,{d:`m3 3 6.586 6.586`,key:`1igwcn`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]};Qn.node;var $n=k(Qn),er={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};er.node;var tr=k(er),nr={name:`person-standing`,size:24,node:[[`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`}]]};nr.node;var rr=k(nr),ir={name:`pill`,size:24,node:[[`path`,{d:`m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z`,key:`wa1lgi`}],[`path`,{d:`m8.5 8.5 7 7`,key:`rvfmvr`}]]};ir.node;var ar=k(ir),or={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};or.node;var sr=k(or),cr={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};cr.node;var lr=k(cr),ur={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]};ur.node;var dr=k(ur),fr={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};fr.node;var pr=k(fr),mr={name:`rewind`,size:24,node:[[`path`,{d:`M12 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 12 18z`,key:`2a1g8i`}],[`path`,{d:`M22 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 22 18z`,key:`rg3s36`}]]};mr.node;var hr=k(mr),gr={name:`rotate-3d`,size:24,node:[[`path`,{d:`m15.194 13.707 3.814 1.86-1.86 3.814`,key:`16shm9`}],[`path`,{d:`M16.47214 7.52786 A 5 10 0 1 0 13 21.79796`,key:`1245p8`}],[`path`,{d:`M21.79796 11 A 10 5 0 1 0 19 15.57071`,key:`1i40ks`}]],aliases:[`rotate-3-d`]};gr.node;var _r=k(gr),vr={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};vr.node;var yr=k(vr),br={name:`route`,size:24,node:[[`path`,{d:`M9 5h8.5a1 1 0 010 7h-11a1 1 0 000 7H15`,key:`1r1aam`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`circle`,{cx:`6`,cy:`5`,r:`3`,key:`151irh`}]]};br.node;var xr=k(br),Sr={name:`scale-3d`,size:24,node:[[`path`,{d:`M5 7v11a1 1 0 0 0 1 1h11`,key:`13dt1j`}],[`path`,{d:`M5.293 18.707 11 13`,key:`ezgbsx`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,key:`1gwv83`}]],aliases:[`scale-3-d`]};Sr.node;var Cr=k(Sr),wr={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};wr.node;var Tr=k(wr),Er={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};Er.node;var Dr=k(Er),Or={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Or.node;var kr=k(Or),Ar={name:`shapes`,size:24,node:[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]};Ar.node;var jr=k(Ar),Mr={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Mr.node;var Nr=k(Mr),Pr={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};Pr.node;var Fr=k(Pr),Ir={name:`snowflake`,size:24,node:[[`path`,{d:`m10 20-1.25-2.5L6 18`,key:`18frcb`}],[`path`,{d:`M10 4 8.75 6.5 6 6`,key:`7mghy3`}],[`path`,{d:`m14 20 1.25-2.5L18 18`,key:`1chtki`}],[`path`,{d:`m14 4 1.25 2.5L18 6`,key:`1b4wsy`}],[`path`,{d:`m17 21-3-6h-4`,key:`15hhxa`}],[`path`,{d:`m17 3-3 6 1.5 3`,key:`11697g`}],[`path`,{d:`M2 12h6.5L10 9`,key:`kv9z4n`}],[`path`,{d:`m20 10-1.5 2 1.5 2`,key:`1swlpi`}],[`path`,{d:`M22 12h-6.5L14 15`,key:`1mxi28`}],[`path`,{d:`m4 10 1.5 2L4 14`,key:`k9enpj`}],[`path`,{d:`m7 21 3-6-1.5-3`,key:`j8hb9u`}],[`path`,{d:`m7 3 3 6h4`,key:`1otusx`}]]};Ir.node;var Lr=k(Ir),Rr={name:`sparkle`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}]]};Rr.node;var zr=k(Rr),Br={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Br.node;var Vr=k(Br),Hr={name:`spline`,size:24,node:[[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}],[`path`,{d:`M5 17A12 12 0 0 1 17 5`,key:`1okkup`}]]};Hr.node;var Ur=k(Hr),Wr={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};Wr.node;var Gr=k(Wr),Kr={name:`square-round-corner`,size:24,node:[[`path`,{d:`M21 11a8 8 0 0 0-8-8`,key:`1lxwo5`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1dv2y5`}]]};Kr.node;var qr=k(Kr),Jr={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Jr.node;var Yr=k(Jr),Xr={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Xr.node;var Zr=k(Xr),Qr={name:`sun-dim`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M20 12h.01`,key:`1ykeid`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M4 12h.01`,key:`158zrr`}],[`path`,{d:`M17.657 6.343h.01`,key:`31pqzk`}],[`path`,{d:`M17.657 17.657h.01`,key:`jehnf4`}],[`path`,{d:`M6.343 17.657h.01`,key:`gdk6ow`}],[`path`,{d:`M6.343 6.343h.01`,key:`1uurf0`}]]};Qr.node;var $r=k(Qr),ei={name:`sun`,size:24,node:[[`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`}]]};ei.node;var ti=k(ei),ni={name:`switch-camera`,size:24,node:[[`path`,{d:`M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5`,key:`mtk2lu`}],[`path`,{d:`M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5`,key:`120jsl`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m18 22-3-3 3-3`,key:`kgdoj7`}],[`path`,{d:`m6 2 3 3-3 3`,key:`1fnbkv`}]]};ni.node;var ri=k(ni),ii={name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]};ii.node;var ai=k(ii),oi={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};oi.node;var si=k(oi),ci={name:`trash`,size:24,node:[[`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`}]],aliases:[`trash-2`]};ci.node;var li=k(ci),ui={name:`tree-pine`,size:24,node:[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]};ui.node;var di=k(ui),fi={name:`trees`,size:24,node:[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]};fi.node;var pi=k(fi),mi={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};mi.node;var hi=k(mi),gi={name:`triangle`,size:24,node:[[`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`}]]};gi.node;var _i=k(gi),vi={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};vi.node;var yi=k(vi),bi={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};bi.node;var xi=k(bi),Si={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Si.node;var Ci=k(Si),wi={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};wi.node;var Ti=k(wi),Ei={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Ei.node;var Di=k(Ei),Oi={name:`wind`,size:24,node:[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]};Oi.node;var ki=k(Oi),Ai={name:`wine`,size:24,node:[[`path`,{d:`M8 22h8`,key:`rmew8v`}],[`path`,{d:`M7 10h10`,key:`1101jm`}],[`path`,{d:`M12 15v7`,key:`t2xh3l`}],[`path`,{d:`M12 15a5 5 0 0 0 5-5c0-2-.5-4-2-8H9c-1.5 4-2 6-2 8a5 5 0 0 0 5 5Z`,key:`10ffi3`}]]};Ai.node;var ji=k(Ai),Mi={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Mi.node;var Ni=k(Mi),Pi={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Pi.node;var Fi=k(Pi),Ii={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Ii.node;var Li=k(Ii),Ri=re(),zi=class{files=new Map;constructor(e){for(let[t,n]of Object.entries(e??{}))this.files.set(Vi(t),typeof n==`string`?new TextEncoder().encode(n):n)}async readText(e){return new TextDecoder().decode(await this.readBytes(e))}async readBytes(e){let t=this.files.get(Vi(e));if(!t)throw new Bi(`notFound`,`File not found: ${e}`);return t}async writeText(e,t){this.files.set(Vi(e),new TextEncoder().encode(t))}async writeBytes(e,t){this.files.set(Vi(e),t)}async exists(e){return this.files.has(Vi(e))}async list(e=``){let t=e?Vi(e).replace(/\/?$/,`/`):``;return[...this.files.keys()].filter(e=>e.startsWith(t)).sort()}async remove(e){this.files.delete(Vi(e))}async size(e){return(await this.readBytes(e)).byteLength}},Bi=class extends Error{code;name=`FsError`;constructor(e,t){super(t),this.code=e}};function Vi(e){let t=e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/\/+/g,`/`);if(t.startsWith(`/`)||t.split(`/`).includes(`..`)||/^[a-zA-Z]:/.test(t))throw new Bi(`invalidPath`,`Invalid project path: ${e}`);return t}var Hi=`0.5.2`,Ui=Hi,M=class extends Error{code;hint;details;name=`OpsError`;constructor(e,t,n,r){super(t),this.code=e,this.hint=n,this.details=r}toJSON(){return{code:this.code,message:this.message,...this.hint?{hint:this.hint}:{},...this.details===void 0?{}:{details:this.details}}}};function Wi(e,t,n){let r=t.filter(e=>e.severity===`error`),i=r[0];return new M(`validation`,`${e} ${r.length} error${r.length===1?``:`s`}${i?`, first: ${i.path?`${i.path}: `:``}${i.message}`:``}`,n??i?.hint??`Fix the listed issues (details.issues) and retry.`,{issues:t})}var Gi=e=>e.some(e=>e.severity===`error`);function Ki(){return new Date().toISOString()}async function qi(e,t,n){let r;try{r=await e.readText(t)}catch(e){throw e instanceof Bi&&e.code===`notFound`?new M(`notFound`,`${n} not found (${t}).`,t===`agent3d.json`||t===`scene.json`?"This folder is not an Agent3D project: create one with `agent3d new <dir>` (tool project_create) or pass --project <dir>.":void 0):new M(`io`,`Cannot read ${t}: ${e.message}`)}try{return JSON.parse(r)}catch(e){throw new M(`invalid`,`${t} is not valid JSON: ${e.message}`,`Fix the JSON syntax in ${t} (trailing commas and comments are not allowed).`)}}async function Ji(e,t,n){await e.writeText(t,`${JSON.stringify(n,null,2)}\n`)}async function Yi(e,t,n){return await e.exists(t)?qi(e,t,t):n}var Xi=e=>Math.round(e/1024*10)/10;function Zi(e,t){if(e===t)return 0;if(!e.length)return t.length;if(!t.length)return e.length;let n=Array.from({length:t.length+1},(e,t)=>t);for(let r=1;r<=e.length;r++){let i=[r];for(let a=1;a<=t.length;a++)i[a]=Math.min(n[a]+1,i[a-1]+1,n[a-1]+(e[r-1]===t[a-1]?0:1));n=i}return n[t.length]}function Qi(e,t){let n=e.toLowerCase(),r,i=1/0;for(let e of t){let t=e.toLowerCase();if(t===n)return e;let a=Zi(n,t);t.startsWith(n)||n.startsWith(t)?a=Math.min(a,1.5):n.length>=4&&(t.includes(n)||n.includes(t))&&(a=Math.min(a,2)),a<i&&(i=a,r=e)}let a=Math.max(2,Math.floor(n.length/3));return i<=a?r:void 0}function N(e,t){let n=Qi(e,t);return n?`Did you mean "${n}"? `:``}function P(e,t=40){let n=e.slice(0,t).map(e=>`"${e}"`).join(`, `);return e.length>t?`${n}, … (${e.length} total)`:n}var $i=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function ea(e){return typeof e==`string`&&$i.test(e)}function ta(e,t=`item`){let n=e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``).replace(/-{2,}/g,`-`);return n?/^[a-z]/.test(n)?n:`${t}-${n}`:t}function na(e,t){let n=new Set(t),r=ea(e)?e:ta(e);if(!n.has(r))return r;for(let e=2;;e++)if(!n.has(`${r}-${e}`))return`${r}-${e}`}var ra=/^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/;function ia(e){if(typeof e!=`string`)return null;let t=ra.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return!(n>0)||!(r>0)?null:{width:n,height:r,ratio:n/r}}function aa(e){return ia(e)!==null}function oa(e,t){let n=ia(e)??{ratio:16/9};return{width:Math.round(t),height:Math.max(1,Math.round(t/n.ratio))}}var sa={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`00ffff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000000`,blanchedalmond:`ffebcd`,blue:`0000ff`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`00ffff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`ff00ff`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`778899`,lightslategrey:`778899`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`00ff00`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`ff00ff`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`ff0000`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`ffffff`,whitesmoke:`f5f5f5`,yellow:`ffff00`,yellowgreen:`9acd32`},ca=(e,t,n)=>Math.min(n,Math.max(t,e));function la(e){if(!/^[0-9a-f]+$/i.test(e)||((e.length===3||e.length===4)&&(e=[...e].map(e=>e+e).join(``)),e.length!==6&&e.length!==8))return null;let t=t=>parseInt(e.slice(t,t+2),16);return{r:t(0),g:t(2),b:t(4),a:e.length===8?t(6)/255:1}}function F(e,t){let n=/^(-?\d*\.?\d+(?:e-?\d+)?)(%?)$/i.exec(e.trim());if(!n)return null;let r=Number(n[1]);return n[2]?r/100*t:r}function ua(e){let t=/^(-?\d*\.?\d+)(deg|rad|turn|grad)?$/i.exec(e.trim());if(!t)return null;let n=Number(t[1]);switch((t[2]??`deg`).toLowerCase()){case`rad`:return n*180/Math.PI;case`turn`:return n*360;case`grad`:return n*.9;default:return n}}function da(e){let t=e.split(`/`);if(t.length>2)return null;let n=(t[0].includes(`,`)?t[0].split(`,`):t[0].trim().split(/\s+/)).map(e=>e.trim()).filter(e=>e!==``);return t.length===2&&n.push(t[1].trim()),n}function fa(e,t,n){e=(e%360+360)%360;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,[o,s,c]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i];return[(o+a)*255,(s+a)*255,(c+a)*255]}function pa(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();if(!t)return null;if(t.startsWith(`#`))return la(t.slice(1));if(t===`transparent`)return{r:0,g:0,b:0,a:0};let n=sa[t];if(n)return la(n);let r=/^(rgba?|hsla?)\((.*)\)$/.exec(t);if(!r)return null;let i=da(r[2]);if(!i||i.length!==3&&i.length!==4)return null;let a=i.length===4?F(i[3],1):1;if(a===null)return null;if(r[1].startsWith(`rgb`)){let[e,t,n]=i.slice(0,3).map(e=>F(e,255));return e===null||t===null||n===null?null:{r:ca(e,0,255),g:ca(t,0,255),b:ca(n,0,255),a:ca(a,0,1)}}let o=ua(i[0]),s=F(i[1],1),c=F(i[2],1);if(o===null||s===null||c===null||!i[1].trim().endsWith(`%`)||!i[2].trim().endsWith(`%`))return null;let[l,u,d]=fa(o,ca(s,0,1),ca(c,0,1));return{r:l,g:u,b:d,a:ca(a,0,1)}}function ma(e){return pa(e)!==null}function ha({r:e,g:t,b:n}){return`#`+[e,t,n].map(e=>Math.round(ca(e,0,255)).toString(16).padStart(2,`0`)).join(``)}function ga(e){let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function _a(e,t){let n=ga(e),r=ga(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function va(e){let t=pa(e);return t?_a(t,{r:255,g:255,b:255,a:1})>=_a(t,{r:17,g:19,b:24,a:1})?`#ffffff`:`#111318`:`#ffffff`}var ya=[`linear`,...[`Quad`,`Cubic`,`Quart`,`Quint`,`Sine`,`Expo`,`Circ`,`Back`,`Elastic`,`Bounce`].flatMap(e=>[`in${e}`,`out${e}`,`inOut${e}`]),`step`],ba=[`outCubic`,`inOutSine`,`outBack`,`cubicBezier(0.22, 1, 0.36, 1)`,`spring(170, 18)`,`steps(4)`],xa=new Map;function Sa(e,t){let n=RegExp(`^${t}\\s*\\(([^)]*)\\)$`).exec(e);return n?n[1].split(`,`).map(e=>e.trim()):null}var Ca=e=>e!==``&&Number.isFinite(Number(e));function wa(e){let t=xa.get(e);if(t)return t;let n=Ta(e.trim());return xa.size<500&&xa.set(e,n),n}function Ta(e){if(ya.includes(e))return{kind:`named`,name:e};if(e.startsWith(`cubicBezier`)){let t=Sa(e,`cubicBezier`);if(!t||t.length!==4||!t.every(Ca))return{error:`cubicBezier needs 4 numbers: "cubicBezier(x1, y1, x2, y2)", e.g. "cubicBezier(0.22, 1, 0.36, 1)".`};let[n,r,i,a]=t.map(Number);return n<0||n>1||i<0||i>1?{error:`cubicBezier x1 and x2 must be between 0 and 1 (y1, y2 may overshoot).`}:{kind:`cubicBezier`,x1:n,y1:r,x2:i,y2:a}}if(e===`spring`)return{kind:`spring`,stiffness:170,damping:18,mass:1};if(e.startsWith(`spring`)){let t=Sa(e,`spring`);if(!t||t.length<2||t.length>3||!t.every(Ca))return{error:`spring takes stiffness, damping (and optional mass): "spring(170, 18)" (lower damping = more bounce).`};let[n,r,i=1]=t.map(Number);return!(n>0)||!(r>0)||!(i>0)?{error:`spring stiffness, damping and mass must be > 0.`}:{kind:`spring`,stiffness:n,damping:r,mass:i}}if(e.startsWith(`steps`)){let t=Sa(e,`steps`);return!t||t.length<1||t.length>2||!Ca(t[0])||!Number.isInteger(Number(t[0]))||Number(t[0])<1||t[1]!==void 0&&t[1]!==`start`&&t[1]!==`end`?{error:`steps takes a whole number ≥ 1 and optionally "start" or "end": "steps(4)", "steps(4, start)".`}:{kind:`steps`,count:Number(t[0]),jumpStart:t[1]===`start`}}return{error:`Unknown easing "${e}".`}}function Ea(e){return typeof e==`string`&&e.startsWith(`library:`)}function Da(e){return e.slice(8)}function Oa(e,t){return e?.assets.find(e=>e.id===t)}var ka=(e,t,n)=>({type:`number`,default:e,min:t,max:n}),Aa={fog:{needsDepth:!0,params:{color:{type:`color`,default:`#ffffff`},amount:ka(.6,0,1),start:ka(.7,0,1),end:ka(0,0,1),drift:ka(.3,0)}},light:{needsDepth:!1,params:{color:{type:`color`,default:`#ffffff`},intensity:ka(1,0),ambient:ka(.75,0,1),position:{type:`vec2`,default:[.4,.4],min:-1,max:1},height:ka(.6,0),radius:ka(.8,0),relief:ka(1,0),specular:ka(.25,0,1),follow:{type:`enum`,default:`pointer`,options:[`pointer`,`auto`,`none`],animatable:!1}}},reveal:{needsDepth:!0,alpha:!0,params:{progress:ka(1,0,1),from:{type:`enum`,default:`far`,options:[`near`,`far`],animatable:!1},softness:ka(.15,0,1),duration:ka(void 0,0),delay:ka(0,0)}},blur:{needsDepth:!1,params:{focus:ka(void 0,0,1),amount:ka(.6,0,5),range:ka(.1,0,1),to:ka(void 0,0,1),duration:ka(void 0,0),delay:ka(0,0)}},frame:{needsDepth:!1,alpha:!0,params:{inset:{type:`vec2`,default:[.12,.12],min:0,max:.45,scalar:!0},threshold:ka(.6,0,1),softness:ka(.04,0,1),border:ka(.015,0,.2),color:{type:`color`,default:`#ffffff`},shadow:ka(.35,0,1)}}},ja=Object.keys(Aa),Ma=[`low`,`medium`,`high`,`ultra`],Na={low:1,medium:1.5,high:2,ultra:3};function Pa(e,t={}){return e&&e!==`auto`?e:t.deterministic?`high`:t.gpu&&/swiftshader|llvmpipe|softpipe|software|microsoft basic render/i.test(t.gpu)?`low`:t.mobile?(t.memoryGb??4)<=2||(t.cores??8)<=4?`low`:`medium`:t.cores!==void 0&&t.cores<=2||t.memoryGb!==void 0&&t.memoryGb<=2?`low`:t.cores!==void 0&&t.cores<=4||t.memoryGb!==void 0&&t.memoryGb<=4||t.gpu&&/intel|mali|adreno|powervr/i.test(t.gpu)?`medium`:`high`}var Fa=new Set([`strength`,`intensity`,`darkness`,`amount`,`toning`,`streaks`,`ghosts`,`halo`,`bleach`,`scanlines`]);function Ia(e){if(!e?.length)return[];let t=new Map,n=new Map;for(let r of e){if(!r||typeof r.type!=`string`)continue;if(r.type!==`look`){t.has(r.type)||t.set(r.type,r);continue}let e=p[String(r.preset??`cinematic`)];if(!e)continue;let i=typeof r.intensity==`number`?Math.max(0,Math.min(1,r.intensity)):1;for(let t of e.effects){if(n.has(t.type))continue;let e={...t};if(i!==1){for(let[n,r]of Object.entries(t))Fa.has(n)&&typeof r==`number`&&(e[n]=r*i);t.type===`grading`&&t.look&&(e.intensity=i)}n.set(t.type,e)}}let r=[],i=new Set,a=e=>{if(i.has(e))return;i.add(e);let a=t.get(e),o=n.get(e);r.push(a&&o?{...o,...a}:a??o)};for(let n of e)if(n&&typeof n.type==`string`){if(n.type!==`look`)a(n.type);else for(let e of p[String(n.preset??`cinematic`)]?.effects??[])t.has(e.type)||a(e.type)}return r}function La(e){let t={exposure:0,contrast:1,saturation:1,vibrance:0,temperature:0,tint:0,lift:0,gamma:1,gain:1,toning:0,bleach:0},n=e.look&&e.look!==`none`?f[e.look]:void 0,r=typeof e.intensity==`number`?Math.max(0,Math.min(1,e.intensity)):1,i={...t};if(n)for(let[e,a]of Object.entries(n.values))i[e]=typeof a==`number`?t[e]+(a-t[e])*r:a;for(let[t,n]of Object.entries(e))t!==`type`&&t!==`look`&&t!==`intensity`&&(typeof n==`number`||typeof n==`string`)&&(i[t]=n);return i}var Ra={low:0,medium:1,high:2};function za(e){switch(e){case`low`:return{tier:e,dprCap:Na.low,msaa:0,effectScale:.5,maxCost:`medium`,aoSamples:8,dofSamples:16,rays:24,maxStillSamples:4};case`medium`:return{tier:e,dprCap:Na.medium,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:12,dofSamples:24,rays:32,maxStillSamples:8};case`ultra`:return{tier:e,dprCap:Na.ultra,msaa:8,effectScale:1,maxCost:`high`,aoSamples:24,dofSamples:64,rays:64,maxStillSamples:64};default:return{tier:`high`,dprCap:Na.high,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:16,dofSamples:40,rays:48,maxStillSamples:32}}}function Ba(e){let t=Ma.indexOf(e);return t>0?Ma[t-1]:null}function Va(e){return v(`postfx`,e)?.gpu??`low`}function Ha(e,t){let n=Ra[za(t).maxCost],r=[],i=[];for(let t of Ia(e))Ra[Va(t.type)]>n?i.push(t.type):r.push(t);return{active:r,dropped:i}}var Ua={ao:5,dof:4,bloom:3,smaa:3,godrays:2,lensflare:2,outline:1,tiltshift:2,fxaa:1,pixelate:1,halftone:1,ascii:1,glitch:1,taa:0,grading:0,vignette:0,film:0,chromatic:0,sharpen:0},Wa=3,Ga=new Set([`grading`,`vignette`,`film`,`chromatic`,`sharpen`]),Ka=new Set([`ao`,`dof`,`godrays`,`outline`]);function qa(e){let t=Ia(e),n=t.map(e=>({type:e.type,gpu:Va(e.type),passes:Ua[e.type]??1})),r=t.some(e=>Ka.has(e.type)),i=t.length?2:0;for(let e of n)i+=e.passes;r&&(i+=Wa),t.some(e=>Ga.has(e.type))&&(i+=.5);let a=t.length?i<=6?`light`:i<=14?`moderate`:`heavy`:`none`;return{effects:n,passes:Math.round(i*10)/10,scenePrepass:r,level:a,dropped:{low:Ha(e,`low`).dropped}}}var Ja=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Ya=e=>typeof e==`number`&&Number.isFinite(e),Xa=e=>{let t=JSON.stringify(e);return t===void 0?String(e):t.length>60?`${t.slice(0,57)}…`:t},Za=[`duration`,`loop`,`autoplay`,`trigger`,`speed`,`markers`,`segments`,`scroll`,`tracks`],Qa=[`target`,`keys`,`ease`,`stagger`,`staggerFrom`,`colorSpace`],$a=[`oklch`,`oklab`,`rgb`,`hsl`],eo=[`start`,`end`,`center`,`edges`,`random`],to=[`click`,`hover`,`hoverEnd`,`visible`,`scroll`,`key`,`event`],no=[`play`,`toggle`,`seek`,`set`,`emit`,`openUrl`,`playClip`],ro=[`dolly`,`pushIn`,`pullOut`,`truck`,`pedestal`,`crane`,`orbit`,`zoom`,`move`,`path`,`lookAt`,`focus`],io=[`type`,`at`,`duration`,`ease`,`distance`,`height`,`angle`,`elevation`,`fov`,`position`,`target`,`points`,`lookAhead`,`lookAt`,`object`,`focus`],ao=[`position`,`rotation`,`scale`],oo=[`x`,`y`,`z`],so={opacity:`number`,color:`color`,emissive:`color`,emissiveIntensity:`number`,metalness:`number`,roughness:`number`,transmission:`number`,thickness:`number`,ior:`number`,iridescence:`number`,iridescenceIOR:`number`,clearcoat:`number`,clearcoatRoughness:`number`,sheen:`number`,sheenColor:`color`,sheenRoughness:`number`,specularIntensity:`number`,specularColor:`color`,envMapIntensity:`number`,attenuationColor:`color`,attenuationDistance:`number`,dispersion:`number`,anisotropy:`number`,anisotropyRotation:`number`,wireframe:`boolean`},co={position:`vec3`,target:`vec3`,fov:`number`,zoom:`number`,focus:`number`},lo={intensity:`number`,color:`color`,position:`vec3`,target:`vec3`,visible:`boolean`,angle:`number`,penumbra:`number`,distance:`number`,decay:`number`,groundColor:`color`,width:`number`,height:`number`},uo={"fog.color":`color`,"fog.near":`number`,"fog.far":`number`,"fog.density":`number`,lightingIntensity:`number`,exposure:`number`,background:`color`},fo=/^\s*[+\-*]=\s*-?\d*\.?\d+(?:e[+-]?\d+)?\s*$/i,po=e=>typeof e==`string`&&fo.test(e);function mo(e,t){let n=e.indexOf(`.`);if(n<1)return{error:{message:`Track target "${e}" must be "<id>.<property>".`,hint:`Examples: "logo.position", "logo.rotation.y", "logo.material.opacity", "camera.position", "key.intensity", "tag:letter.position.y".`}};let r=e.slice(0,n),i=e.slice(n+1);if(r===`camera`){let e=co[i];return/^(position|target)\.[xyz]$/.test(i)?{kind:`number`}:e?{kind:e}:{error:{message:`Camera property "${i}" is not animatable.`,hint:`${N(i,Object.keys(co))}Use one of: ${P(Object.keys(co))} (or position.x …).`}}}if(r===`environment`){let e=uo[i];return e?{kind:e}:{error:{message:`Environment property "${i}" is not animatable.`,hint:`${N(i,Object.keys(uo))}Use one of: ${P(Object.keys(uo))}.`}}}if(r===`postfx`){let[n,r,...a]=i.split(`.`),o=d.postfx.find(e=>e.id===n);if(!o||!r||a.length)return{error:{message:`Post effect track "${e}" must be "postfx.<type>.<param>".`,hint:`${n?N(n,d.postfx.map(e=>e.id)):``}Example: "postfx.bloom.strength", "postfx.dof.focus".`}};if(t.postfx&&!t.postfx.has(n))return{error:{message:`"${e}" animates post effect "${n}", which is not in scene.postfx (nor brought by a look preset).`,hint:`Add { "type": "${n}" } to postfx first (or a look that includes it — see agent3d catalog postfx look).`}};let s=o.params.find(e=>e.name===r);if(!s||s.type!==`number`&&s.type!==`integer`&&s.type!==`color`){let e=o.params.filter(e=>e.type===`number`||e.type===`integer`||e.type===`color`).map(e=>e.name);return{error:{message:`Parameter "${r}" of post effect "${n}" is not animatable.`,hint:`${N(r,e)}Animatable: ${P(e)}.`}}}return{kind:s.type===`color`?`color`:`number`}}let a;if(r.startsWith(`tag:`)){let e=r.slice(4);if(t.tags&&!t.tags.has(e))return{error:{message:`No object has the tag "${e}" (selector "${r}").`,hint:`${N(e,t.tags)}Add "tags": ["${e}"] to the objects to animate.`}};a=[]}else if(r.startsWith(`children:`)){let e=r.slice(9);if(!t.objects.has(e))return{error:{message:`Selector "${r}" refers to "${e}", which is not an object id.`,hint:`${N(e,t.objects)}Use "children:<group id>".`}};if(t.parents&&!t.parents.has(e))return{error:{message:`"${e}" has no children (selector "${r}").`,hint:`Use children:<id> on a group with children (text letters count too).`}};a=[]}else a=r.split(`,`).map(e=>e.trim());let o;for(let n of a){let r=ho(n,i,t,e);if(r.error)return r;o??=r.warning}return a.length?{kind:ho(a[0],i,t,e).kind,...o?{warning:o}:{}}:_o(i,!0)}function ho(e,t,n,r){if(n.lights.has(e)&&!n.objects.has(e)){let e=lo[t];return/^(position|target)\.[xyz]$/.test(t)?{kind:`number`}:e?{kind:e}:{error:{message:`Light property "${t}" is not animatable.`,hint:`${N(t,Object.keys(lo))}Use one of: ${P(Object.keys(lo))}.`}}}let i=e,a=/^([a-zA-Z][a-zA-Z0-9_-]*)\/(\d+)$/.exec(e);if(a){if(!n.objects.has(a[1]))return{error:{message:`Track target "${r}" refers to letter ${a[2]} of "${a[1]}", which is not an object id.`,hint:`${N(a[1],n.objects)}Letters are addressed "<textId>/<n>" (n = 0, 1, … over non-space characters).`}};if(n.letters&&!n.letters.has(a[1]))return{error:{message:`"${a[1]}" is not split into letters, so "${e}" does not exist.`,hint:`Set "splitLetters": true (or a "reveal") on the text object "${a[1]}".`}};i=a[1];let o=n.letterCounts?.get(a[1]);if(o!==void 0&&Number(a[2])>=o){let r=mo(`${a[1]}.${t}`,n);return r.error?r:{kind:r.kind,warning:{message:`"${e}" is out of range: "${a[1]}" has ${o} letter${o===1?``:`s`} (${a[1]}/0 … ${a[1]}/${Math.max(0,o-1)}), so this target animates nothing.`,hint:`Letters are numbered from 0 over non-space characters. Use ${a[1]}/${Math.max(0,o-1)} for the last one, or "children:${a[1]}.${t}" for all of them.`}}}}if(!n.objects.has(i)){let t=[...n.objects,...n.lights,`camera`,`environment`,`postfx`];return{error:{message:`Track target "${r}" refers to "${e}", which is not an object id, a light id, "camera", "environment" or "postfx".`,hint:`${N(e,t)}Known ids: ${P(t)}. Several targets: "a,b,c.<prop>", "tag:<tag>.<prop>", "children:<id>.<prop>".`}}}let o=t.split(`.`);return o[0]===`morph`||o[0]===`animation`?n.models&&!n.models.has(i)?{error:{message:`"${t}" needs a model object; "${i}" is not one.`,hint:`morph.<name> and animation.<clip>.weight|speed|time animate glTF models (kind "model").`}}:o[0]===`morph`&&o.length>=2||o[0]===`animation`&&o.length>=3&&[`weight`,`speed`,`time`].includes(o[o.length-1])?{kind:`number`}:{error:{message:`Invalid model track "${t}".`,hint:`Use "morph.<name>" (0..1) or "animation.<clip>.weight" | ".speed" | ".time".`}}:o[0]===`effects`?go(i,o.slice(1),n):o[0]===`motion`?n.photos&&!n.photos.has(i)?{error:{message:`"${t}" needs a photo object; "${i}" is not one.`,hint:`motion.progress (0..1) drives the auto move of a 3D photo (kind "photo").`}}:t===`motion.progress`?{kind:`number`}:{error:{message:`Photo motion property "${t}" is not animatable.`,hint:`${N(t,[`motion.progress`])}Use "motion.progress" (0..1 along the photo's motion.auto move).`}}:_o(t,!1)}function go(e,t,n){let r=n.photoEffects?.get(e);if(n.photoEffects&&!r)return{error:{message:`"${e}" is not a 3D photo: effects.* tracks animate photo effects.`,hint:`Use "<photoId>.effects.<effect>.<param>" on a kind "photo" object.`}};let[i,a,o,...s]=t,c=Aa[i];if(!c)return{error:{message:`Unknown photo effect "${i??``}".`,hint:`${N(i??``,ja)}Effects: ${P(ja)}.`}};if(r&&!r.has(i))return{error:{message:`"${e}" has no ${i} effect, so this track animates nothing.`,hint:`Add "effects": { "${i}": {} } to the photo "${e}" first.`}};let l=c.params,u=Object.keys(l).filter(e=>l[e].animatable!==!1),d=a?l[a]:void 0;return!d||d.animatable===!1||s.length?{error:{message:`Photo effect property "${i}.${a??``}" is not animatable.`,hint:`${N(a??``,u)}Animatable ${i} params: ${P(u)}.`}}:o===void 0?{kind:d.type===`vec2`?`vec2`:d.type===`color`?`color`:`number`}:d.type===`vec2`&&(o===`x`||o===`y`)?{kind:`number`}:{error:{message:`"${i}.${a}.${o}" is not animatable.`,hint:d.type===`vec2`?`Use ".x" or ".y".`:`Animate "${i}.${a}" itself.`}}}function _o(e,t){let n=e.split(`.`);if(ao.includes(n[0])){if(n.length===1)return{kind:n[0]===`scale`?`number|vec3`:`vec3`};if(n.length===2&&oo.includes(n[1]))return{kind:`number`}}if(e===`visible`)return{kind:`boolean`};if(n[0]===`material`){if(n.length===2&&so[n[1]])return{kind:so[n[1]]};if(n.length===3&&n[1]===`uniforms`)return{kind:`number`}}if(t&&(n[0]===`morph`||n[0]===`animation`||e===`motion.progress`))return{kind:`number`};let r=[`position`,`position.x`,`rotation`,`rotation.y`,`scale`,`visible`,...Object.keys(so).map(e=>`material.${e}`),`material.uniforms.<name>`,`morph.<name>`,`animation.<clip>.weight`,`motion.progress`];return{error:{message:`Property "${e}" is not animatable.`,hint:`${N(e,r)}Animatable: ${P(r)}.`}}}function vo(e,t){let n=e=>Ya(e)||po(e),r=e=>Array.isArray(e)&&e.length===3&&e.every(n);switch(e){case`vec3`:return r(t)||po(t);case`vec2`:return Array.isArray(t)&&t.length===2&&t.every(n);case`number`:return n(t);case`color`:return ma(t);case`boolean`:return typeof t==`boolean`;case`number|vec3`:return n(t)||r(t)}}var yo={vec3:`[0, 1, 0] or ["+=0", "+=1", "+=0"]`,vec2:`[0.4, -0.2]`,number:`1.5 or "+=1"`,color:`"#ff8800"`,boolean:`true`,"number|vec3":`1.2, [1, 2, 1] or "*=1.2"`},bo=class{issues=[];add(e,t,n,r,i){this.issues.push(i?{severity:e,code:t,path:n,message:r,hint:i}:{severity:e,code:t,path:n,message:r})}error(e,t,n,r){this.add(`error`,e,t,n,r)}warn(e,t,n,r){this.add(`warning`,e,t,n,r)}unknownKeys(e,t,n,r){for(let i of Object.keys(e)){if(t.includes(i))continue;let e=Qi(i,t);this.warn(`unknown-field`,`${n}.${i}`,`Unknown field "${i}" on ${r} (ignored by the runtime).`,e?`Did you mean "${e}"? Otherwise remove it.`:`Remove it. Valid fields: ${P(t)}.`)}}number(e,t,n={}){return e===void 0?!0:Ya(e)?n.min!==void 0&&(n.exclusiveMin?e<=n.min:e<n.min)?(this.error(`range`,t,`${e} is below the minimum (${n.exclusiveMin?`>`:`≥`} ${n.min}).`),!1):n.max!==void 0&&e>n.max?(this.error(`range`,t,`${e} is above the maximum (${n.max}).`),!1):!0:(this.error(`type`,t,`Expected a number, got ${Xa(e)}.`),!1)}vec(e,t){return e===void 0||Array.isArray(e)&&e.length===3&&e.every(Ya)?!0:(this.error(`vec`,t,`Expected [x, y, z] (3 numbers), got ${Xa(e)}.`,`Write it as an array of 3 numbers, e.g. [0, 1.5, 0].`),!1)}ease(e,t){if(e===void 0)return;if(typeof e!=`string`)return this.error(`type`,t,`Expected an easing name, got ${Xa(e)}.`,`Examples: ${ba.map(e=>`"${e}"`).join(`, `)}.`);let n=wa(e);`error`in n&&this.error(`enum`,t,`Invalid easing ${Xa(e)}: ${n.error}`,`${N(e,ya)}Named: ${P(ya)}; parametric: "cubicBezier(x1, y1, x2, y2)", "spring(stiffness, damping)", "steps(n)".`)}loop(e,t){e!==void 0&&typeof e!=`boolean`&&e!==`pingpong`&&this.error(`enum`,t,`Invalid loop ${Xa(e)}.`,`Use true, false or "pingpong".`)}};function xo(e,t){let n=new Set,r=new Set,i=new Set,a=new Set,o=new Map,s=e=>{if(Array.isArray(e)){for(let t of e)if(Ja(t)&&typeof t.id==`string`){if(Array.isArray(t.tags))for(let e of t.tags)typeof e==`string`&&n.add(e);t.kind===`model`&&r.add(t.id),t.kind===`photo`&&o.set(t.id,new Set(Ja(t.effects)?Object.keys(t.effects):[])),t.kind===`photo`&&a.add(t.id),(Array.isArray(t.children)&&t.children.length||t.kind===`text`&&(t.splitLetters===!0||Ja(t.reveal)))&&i.add(t.id),s(t.children)}}};s(e.objects);let c=new Set;if(Array.isArray(e.postfx))for(let t of Ia(e.postfx.filter(e=>Ja(e)&&typeof e.type==`string`)))c.add(t.type);return{...t,tags:n,models:r,photos:a,parents:i,postfx:c,photoEffects:o}}var So=[`load`,`visible`,`hover`,`click`,`scroll`,`manual`],Co=/^(top|center|bottom|-?\d*\.?\d+%|-?\d*\.?\d+px)\s+(top|center|bottom|-?\d*\.?\d+%|-?\d*\.?\d+px)$/;function wo(e,t,n){if(!Ja(t))return e.error(`type`,`timeline`,`timeline must be an object.`,`Example: { "duration": 4, "loop": true, "tracks": [] }.`);e.unknownKeys(t,Za,`timeline`,`the timeline`),t.duration===void 0||t.duration===null?e.error(`required`,`timeline.duration`,`Missing required field "duration" (length in seconds).`,`Add "duration": length in seconds.`):e.number(t.duration,`timeline.duration`,{min:0,exclusiveMin:!0}),e.loop(t.loop,`timeline.loop`);let r=Ya(t.duration)?t.duration:1/0,i=Ja(t.markers)?t.markers:{},a=Ja(t.segments)?t.segments:{};if(t.trigger!==void 0&&!So.includes(t.trigger)&&e.error(`enum`,`timeline.trigger`,`Invalid value ${Xa(t.trigger)}.`,`${typeof t.trigger==`string`?N(t.trigger,So):``}Valid values: ${P(So)}.`),t.autoplay!==void 0&&typeof t.autoplay!=`boolean`&&(typeof t.autoplay==`string`?t.autoplay in a||e.error(`unknown-ref`,`timeline.autoplay`,`autoplay "${t.autoplay}" is not a segment.`,`${N(t.autoplay,Object.keys(a))}Define it in timeline.segments, e.g. "segments": { "${t.autoplay}": { "from": 0, "to": 2 } }.`):e.error(`type`,`timeline.autoplay`,`Expected true, false or a segment name, got ${Xa(t.autoplay)}.`)),e.number(t.speed,`timeline.speed`,{min:0,exclusiveMin:!0}),t.markers!==void 0){if(!Ja(t.markers))e.error(`type`,`timeline.markers`,`markers must be an object { name: time }.`,`Example: "markers": { "reveal": 1.2, "end": 4 }.`);else for(let[t,n]of Object.entries(i))e.number(n,`timeline.markers.${t}`,{min:0})&&Ya(n)&&n>r&&e.warn(`range`,`timeline.markers.${t}`,`Marker "${t}" (${n}s) is after timeline.duration (${r}s).`,`Move it inside the timeline.`)}let o=(t,n)=>{Ya(t)?(t<0||t>r)&&e.error(`range`,n,`${t}s is outside the timeline (0..${r}s).`):typeof t==`string`?t in i||e.error(`unknown-ref`,n,`"${t}" is not a marker.`,`${N(t,Object.keys(i))}Use seconds or a name from timeline.markers (${P(Object.keys(i))}).`):e.error(`type`,n,`Expected seconds or a marker name, got ${Xa(t)}.`)};if(t.segments!==void 0){if(!Ja(t.segments))e.error(`type`,`timeline.segments`,`segments must be an object { name: { from, to } }.`,`Example: "segments": { "intro": { "from": 0, "to": 2 }, "hover-in": [2, 2.6] }.`);else for(let[t,n]of Object.entries(a)){let r=`timeline.segments.${t}`;t===`timeline`&&e.error(`reserved`,r,`"timeline" is reserved (it plays the whole timeline).`,`Rename the segment.`),Array.isArray(n)?n.length===2?(o(n[0],`${r}[0]`),o(n[1],`${r}[1]`)):e.error(`type`,r,`A segment array is [from, to], got ${Xa(n)}.`):Ja(n)?(e.unknownKeys(n,[`from`,`to`,`loop`,`speed`],r,`a segment`),o(n.from,`${r}.from`),o(n.to,`${r}.to`),e.loop(n.loop,`${r}.loop`),e.number(n.speed,`${r}.speed`,{min:0,exclusiveMin:!0})):e.error(`type`,r,`Expected { "from", "to" } or [from, to], got ${Xa(n)}.`)}}if(t.scroll!==void 0){if(!Ja(t.scroll))e.error(`type`,`timeline.scroll`,`scroll must be an object.`,`Example: { "start": "top bottom", "end": "bottom top", "smoothing": 0.8 }.`);else{e.unknownKeys(t.scroll,[`start`,`end`,`smoothing`],`timeline.scroll`,`timeline.scroll`);for(let n of[`start`,`end`]){let r=t.scroll[n];r===void 0||typeof r==`string`&&Co.test(r.trim())||e.error(`type`,`timeline.scroll.${n}`,`Invalid scroll position ${Xa(r)}.`,`"<element edge> <viewport edge>", edges top | center | bottom | N% | Npx, e.g. "top bottom", "center center", "bottom 20%".`)}e.number(t.scroll.smoothing,`timeline.scroll.smoothing`,{min:0,max:.99}),t.trigger!==`scroll`&&e.warn(`ignored`,`timeline.scroll`,`timeline.scroll only applies with "trigger": "scroll".`,`Set "trigger": "scroll" or remove scroll.`)}}if(t.tracks===void 0||t.tracks===null)return e.error(`required`,`timeline.tracks`,`Missing required field "tracks" (an array of tracks).`,`Add "tracks": [].`);if(!Array.isArray(t.tracks))return e.error(`type`,`timeline.tracks`,`tracks must be an array.`);let s=new Set;t.tracks.forEach((t,i)=>To(e,t,`timeline.tracks[${i}]`,r,s,n))}function To(e,t,n,r,i,a){if(!Ja(t))return e.error(`type`,n,`A track must be an object.`,`Example: { "target": "logo.rotation.y", "keys": [[0, 0], [4, 360]], "ease": "inOutSine" }.`);e.unknownKeys(t,Qa,n,`a track`),e.ease(t.ease,`${n}.ease`),e.number(t.stagger,`${n}.stagger`,{min:0}),t.staggerFrom!==void 0&&!eo.includes(t.staggerFrom)&&e.error(`enum`,`${n}.staggerFrom`,`Invalid value ${Xa(t.staggerFrom)}.`,`Valid values: ${P(eo)}.`),t.colorSpace!==void 0&&!$a.includes(t.colorSpace)&&e.error(`enum`,`${n}.colorSpace`,`Invalid value ${Xa(t.colorSpace)}.`,`Valid values: ${P($a)} (default "oklch").`);let o;if(t.target===void 0||t.target===null)e.error(`required`,`${n}.target`,`Missing required field "target" ("<id>.<property>").`,`Add "target": "<id>.<property>".`);else if(typeof t.target!=`string`)e.error(`type`,`${n}.target`,`Expected a string, got ${Xa(t.target)}.`);else{let r=t.target;i.has(r)&&e.warn(`duplicate-track`,`${n}.target`,`Another track already animates "${r}"; the last one wins.`,`Merge the keys into a single track.`),i.add(r);let s=mo(r,a);s.error&&e.error(`track-target`,`${n}.target`,s.error.message,s.error.hint),s.warning&&e.warn(`track-target`,`${n}.target`,s.warning.message,s.warning.hint),o=s.kind;let c=r.slice(0,Math.max(r.indexOf(`.`),0)),l=c.includes(`,`)||c.startsWith(`tag:`)||c.startsWith(`children:`);t.stagger!==void 0&&!l&&e.warn(`ignored`,`${n}.stagger`,`stagger only applies to multi-target selectors.`,`Use "a,b,c.<prop>", "tag:<tag>.<prop>" or "children:<id>.<prop>".`)}if(t.keys===void 0||t.keys===null)return e.error(`required`,`${n}.keys`,`Missing required field "keys" ([[time, value], …]).`,`Add "keys": [[time, value], …].`);if(!Array.isArray(t.keys)||t.keys.length===0)return e.error(`type`,`${n}.keys`,`keys must be a non-empty array of [time, value].`,`Example: [[0, [0, 0, 0]], [2, [0, 1, 0]]].`);let s=-1/0,c=!0;t.keys.forEach((i,a)=>{let l=`${n}.keys[${a}]`;if(!Array.isArray(i)||i.length<2||i.length>3||!Ya(i[0]))return e.error(`type`,l,`Expected [time, value] or [time, value, ease], got ${Xa(i)}.`,`Example: [1.5, ${o?yo[o].split(` or `)[0]:`1`}] or [1.5, 1, "outBack"].`);let u=i[0];u<0&&e.error(`range`,`${l}[0]`,`Key time ${u} is negative.`,`Times are seconds from 0.`),u<s&&(c=!1),s=Math.max(s,u),u>r&&e.warn(`range`,`${l}[0]`,`Key time ${u}s is after timeline.duration (${r}s) and is never reached.`,`Increase timeline.duration to ≥ ${u} or move the key.`),o&&!vo(o,i[1])&&e.error(`track-value`,`${l}[1]`,`Value ${Xa(i[1])} does not match "${String(t.target)}" (expects ${o}).`,`Use a value like ${yo[o]}${o===`vec3`&&String(t.target).match(/rotation$/)?` (degrees)`:``}.`),i.length===3&&e.ease(i[2],`${l}[2]`)}),c||e.error(`track-order`,`${n}.keys`,`Keys are not sorted by time.`,`Sort the [time, value] pairs by ascending time.`)}function Eo(e){if(typeof e!=`string`||!e.trim())return!1;let t=e.trim(),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);return n?/^https?$/i.test(n[1])&&/^https?:\/\/[^/\s]+/i.test(t):!t.startsWith(`//`)&&!/\s/.test(t)}function Do(e,t,n,r){if(!Array.isArray(t))return e.error(`type`,`interactions`,`interactions must be an array.`,`Example: [{ "on": "click", "target": "product", "do": [{ "openUrl": "https://shop.example/p/1" }] }].`);let i=Ja(n.timeline)?n.timeline:null,a=i&&Ja(i.segments)?Object.keys(i.segments):[],o=i&&Ja(i.markers)?i.markers:{};t.forEach((t,n)=>{let i=`interactions[${n}]`;if(!Ja(t))return e.error(`type`,i,`An interaction must be an object.`,`Example: { "on": "hover", "target": "card", "do": [{ "play": "hover-in" }] }.`);e.unknownKeys(t,[`on`,`target`,`key`,`event`,`at`,`once`,`do`],i,`an interaction`),to.includes(t.on)||e.error(t.on===void 0?`required`:`enum`,`${i}.on`,`Invalid "on" ${Xa(t.on)}.`,`${typeof t.on==`string`?N(t.on,to):``}Valid values: ${P(to)}.`);let s=t.on;if(t.target!==void 0&&(typeof t.target!=`string`||!r.objects.has(t.target)?e.error(`unknown-ref`,`${i}.target`,`target ${Xa(t.target)} is not an object id.`,`${typeof t.target==`string`?N(t.target,r.objects):``}Object ids: ${P([...r.objects])}.`):[`click`,`hover`,`hoverEnd`].includes(s)||e.warn(`ignored`,`${i}.target`,`target is ignored for on "${s}".`,`Targets apply to click, hover and hoverEnd.`)),s!==`key`||typeof t.key==`string`&&t.key||e.error(`required`,`${i}.key`,`on "key" needs "key": a KeyboardEvent.code.`,`Example: "key": "Space", "ArrowRight", "KeyE".`),s!==`event`||typeof t.event==`string`&&t.event||e.error(`required`,`${i}.event`,`on "event" needs "event": a marker or emitted event name.`,`Markers: ${P(Object.keys(o))}.`),s===`scroll`&&(t.at===void 0?e.error(`required`,`${i}.at`,`on "scroll" needs "at": the scroll progress (0..1) to cross.`,`Example: "at": 0.5.`):e.number(t.at,`${i}.at`,{min:0,max:1})),t.once!==void 0&&typeof t.once!=`boolean`&&e.error(`type`,`${i}.once`,`once must be true or false.`),!Array.isArray(t.do)||!t.do.length)return e.error(`required`,`${i}.do`,`"do" must be a non-empty array of actions.`,`Actions: ${no.map(e=>`{ "${e}": … }`).join(`, `)}.`);t.do.forEach((t,n)=>Oo(e,t,`${i}.do[${n}]`,s,a,o,r))})}function Oo(e,t,n,r,i,a,o){if(!Ja(t))return e.error(`type`,n,`An action must be an object.`,`Example: { "play": "intro" }.`);let s=no.filter(e=>e in t);if(s.length!==1)return e.error(`type`,n,s.length?`An action has exactly one of ${P(no)}; got ${P(s)}.`:`Unknown action ${Xa(t)}.`,`Actions: ${no.map(e=>`{ "${e}": … }`).join(`, `)}.`);let c=s[0],l=(t,n)=>{if(typeof t!=`string`)return e.error(`type`,n,`Expected a segment name, got ${Xa(t)}.`);t!==`timeline`&&!i.includes(t)&&e.error(`unknown-ref`,n,`"${t}" is not a timeline segment.`,`${N(t,i)}Segments: ${P([`timeline`,...i])} — define it in timeline.segments.`)};switch(c){case`play`:e.unknownKeys(t,[`play`,`reverse`],n,`a play action`),l(t.play,`${n}.play`),t.reverse!==void 0&&typeof t.reverse!=`boolean`&&e.error(`type`,`${n}.reverse`,`reverse must be true or false.`);break;case`toggle`:e.unknownKeys(t,[`toggle`],n,`a toggle action`),l(t.toggle,`${n}.toggle`);break;case`seek`:e.unknownKeys(t,[`seek`],n,`a seek action`),!Ya(t.seek)&&!(typeof t.seek==`string`&&t.seek in a)&&e.error(`type`,`${n}.seek`,`seek needs seconds or a marker name, got ${Xa(t.seek)}.`,`Markers: ${P(Object.keys(a))}.`);break;case`set`:{e.unknownKeys(t,[`set`,`duration`,`ease`],n,`a set action`);let r=t.set;if(!Ja(r)||typeof r.path!=`string`||r.value===void 0){e.error(`type`,`${n}.set`,`set needs { "path": "<id>.<property>", "value": … }.`,`Example: { "set": { "path": "logo.material.color", "value": "#ff3366" }, "duration": 0.4, "ease": "outCubic" }.`);break}e.unknownKeys(r,[`path`,`value`],`${n}.set`,`set`);let i=mo(r.path,o);i.error&&e.error(`track-target`,`${n}.set.path`,i.error.message,i.error.hint),i.warning?e.warn(`track-target`,`${n}.set.path`,i.warning.message,i.warning.hint):i.kind&&!vo(i.kind,r.value)&&e.error(`track-value`,`${n}.set.value`,`Value ${Xa(r.value)} does not match "${r.path}" (expects ${i.kind}).`,`Use a value like ${yo[i.kind]}.`),e.number(t.duration,`${n}.duration`,{min:0}),e.ease(t.ease,`${n}.ease`);break}case`emit`:e.unknownKeys(t,[`emit`,`payload`],n,`an emit action`),typeof t.emit==`string`&&t.emit||e.error(`type`,`${n}.emit`,`emit needs an event name.`);break;case`openUrl`:e.unknownKeys(t,[`openUrl`,`newTab`],n,`an openUrl action`),Eo(t.openUrl)||e.error(`url`,`${n}.openUrl`,`openUrl ${Xa(t.openUrl)} is not allowed.`,`Only http(s) URLs ("https://shop.example/p/1") or page-relative paths ("/shop") can be opened.`),r!==`click`&&r!==`key`&&e.error(`gesture`,`${n}.openUrl`,`openUrl only works on "click" or "key" interactions (a user gesture), not "${r}".`,`Move it to an { "on": "click", "target": … } interaction.`),t.newTab!==void 0&&typeof t.newTab!=`boolean`&&e.error(`type`,`${n}.newTab`,`newTab must be true or false.`);break;case`playClip`:e.unknownKeys(t,[`playClip`,`target`,`loop`,`speed`,`crossfade`],n,`a playClip action`),typeof t.target==`string`&&o.models?.has(t.target)||e.error(`unknown-ref`,`${n}.target`,`playClip needs "target": a model object id, got ${Xa(t.target)}.`,`Models: ${P([...o.models??[]])}.`),typeof t.playClip!=`string`&&!(Ya(t.playClip)&&Number.isInteger(t.playClip)&&t.playClip>=0)&&e.error(`type`,`${n}.playClip`,`playClip is a clip name or index.`),e.number(t.speed,`${n}.speed`),e.number(t.crossfade,`${n}.crossfade`,{min:0}),t.loop!==void 0&&typeof t.loop!=`boolean`&&e.error(`type`,`${n}.loop`,`loop must be true or false.`)}}function ko(e,t,n){if(Ja(t)&&(t.lookAt===void 0||typeof t.lookAt==`string`&&n.objects.has(t.lookAt)||e.error(`unknown-ref`,`camera.lookAt`,`camera.lookAt ${Xa(t.lookAt)} is not an object id.`,`${typeof t.lookAt==`string`?N(t.lookAt,n.objects):``}Object ids: ${P([...n.objects])}.`),t.shake!==void 0&&(Ja(t.shake)?(e.unknownKeys(t.shake,[`amount`,`rotation`,`speed`,`seed`],`camera.shake`,`camera.shake`),e.number(t.shake.amount,`camera.shake.amount`,{min:0}),e.number(t.shake.rotation,`camera.shake.rotation`,{min:0}),e.number(t.shake.speed,`camera.shake.speed`,{min:0}),e.number(t.shake.seed,`camera.shake.seed`)):e.error(`type`,`camera.shake`,`shake must be an object.`,`Example: { "amount": 0.03, "rotation": 0.4, "speed": 0.5 }.`)),t.shots!==void 0)){if(!Array.isArray(t.shots))return e.error(`type`,`camera.shots`,`shots must be an array.`,`Example: [{ "type": "pushIn", "at": 0, "duration": 3 }].`);t.shots.forEach((t,r)=>{let i=`camera.shots[${r}]`;if(!Ja(t))return e.error(`type`,i,`A shot must be an object.`);e.unknownKeys(t,io,i,`a camera shot`),ro.includes(t.type)||e.error(t.type===void 0?`required`:`enum`,`${i}.type`,`Invalid shot type ${Xa(t.type)}.`,`${typeof t.type==`string`?N(t.type,ro):``}Types: ${P(ro)}.`),t.at===void 0?e.error(`required`,`${i}.at`,`Missing "at" (start time in seconds).`):e.number(t.at,`${i}.at`,{min:0}),t.duration===void 0?e.error(`required`,`${i}.duration`,`Missing "duration" (seconds).`):e.number(t.duration,`${i}.duration`,{min:0}),e.ease(t.ease,`${i}.ease`);for(let n of[`distance`,`height`,`angle`,`elevation`])e.number(t[n],`${i}.${n}`);e.number(t.fov,`${i}.fov`,{min:1,max:179}),e.number(t.focus,`${i}.focus`,{min:0}),e.number(t.lookAhead,`${i}.lookAhead`,{min:0,max:.5}),e.vec(t.position,`${i}.position`),e.vec(t.target,`${i}.target`);for(let r of[`object`,`lookAt`]){let a=t[r];typeof a==`string`&&!n.objects.has(a)&&e.error(`unknown-ref`,`${i}.${r}`,`"${a}" is not an object id.`,`${N(a,n.objects)}Object ids: ${P([...n.objects])}.`)}Array.isArray(t.lookAt)&&e.vec(t.lookAt,`${i}.lookAt`),t.type===`path`&&(!Array.isArray(t.points)||!t.points.length?e.error(`required`,`${i}.points`,`A "path" shot needs "points": [[x, y, z], …] (the camera starts from where it is).`):t.points.forEach((t,n)=>e.vec(t,`${i}.points[${n}]`))),(t.type===`lookAt`&&t.object===void 0&&t.target===void 0||t.type===`focus`&&t.object===void 0&&t.focus===void 0)&&e.error(`required`,i,`A "${t.type}" shot needs ${t.type===`lookAt`?`"object" (or "target": [x, y, z])`:`"object" or "focus" (distance)`}.`),t.type===`focus`&&n.postfx&&!n.postfx.has(`dof`)&&e.warn(`ignored`,i,`A "focus" shot drives the dof post effect, which is not in scene.postfx.`,`Add { "type": "dof" } to postfx.`),t.type===`zoom`&&t.fov===void 0&&e.error(`required`,`${i}.fov`,`A "zoom" shot needs "fov" (target field of view, degrees).`),t.type===`move`&&t.position===void 0&&t.target===void 0&&t.fov===void 0&&e.error(`required`,i,`A "move" shot needs "position", "target" and/or "fov".`)})}}function Ao(e,t,n){Array.isArray(t)&&t.forEach((t,r)=>{if(!Ja(t))return;let i=typeof t.id==`string`?`objects#${t.id}`:`${n}[${r}]`;if(t.kind===`model`){if(t.morph!==void 0){if(!Ja(t.morph))e.error(`type`,`${i}.morph`,`morph must be an object { targetName: 0..1 }.`,`Example: "morph": { "smile": 0.6 }.`);else for(let[n,r]of Object.entries(t.morph))e.number(r,`${i}.morph.${n}`)}let n=t.animation;if(Ja(n)&&(e.number(n.offset,`${i}.animation.offset`,{min:0}),n.blend!==void 0)){if(!Ja(n.blend))e.error(`type`,`${i}.animation.blend`,`blend must be an object { clipName: weight }.`,`Example: "blend": { "Wave": 0.5 }.`);else for(let[t,r]of Object.entries(n.blend))e.number(r,`${i}.animation.blend.${t}`,{min:0})}}Ao(e,t.children,`${i}.children`)})}function jo(e,t){let n=new bo,r=xo(e,t);return e.timeline!==void 0&&wo(n,e.timeline,r),e.interactions!==void 0&&Do(n,e.interactions,e,r),ko(n,e.camera,r),Ao(n,e.objects,`objects`),n.issues}var Mo=[`banner`,`hero`,`card`,`square`,`fullscreen`,`inline`,`game`],No=[`mesh`,`text`,`model`,`group`,`generator`,`particles`,`instances`,`svg`,`photo`],Po=[`ambient`,`directional`,`point`,`spot`,`hemisphere`,`rect`],Fo=[`standard`,`physical`,`basic`,`lambert`,`toon`,`normal`,`matcap`,`gradient`,`shader`],Io=[`studio`,`soft`,`sunset`,`night`,`neutral`,`sky`,`none`],Lo=[`sunrise`,`morning`,`noon`,`afternoon`,`golden-hour`,`sunset`,`dusk`],Ro=[`map`,`normalMap`,`roughnessMap`,`metalnessMap`,`aoMap`,`emissiveMap`,`bumpMap`,`displacementMap`,`alphaMap`],zo=[`none`,`orbit`,`parallax`,`scroll`,`follow`],Bo=[`top-left`,`top`,`top-right`,`left`,`center`,`right`,`bottom-left`,`bottom`,`bottom-right`],Vo=[`always`,`hover`,`click`,`visible`,`scroll`],Ho=So,Uo=[`none`,`aces`,`agx`,`neutral`,`reinhard`],Wo={banner:`4:1`,hero:`16:9`,card:`4:5`,square:`1:1`,inline:`16:9`,fullscreen:`16:9`,game:`16:9`},Go={banner:600,hero:1500,card:400,square:600,inline:600,fullscreen:4e3,game:4e3},Ko=[`.glb`,`.gltf`],qo=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.ktx2`,`.avif`],I=[`.hdr`,`.exr`,`.jpg`,`.jpeg`,`.png`,`.webp`],Jo=[`.mp3`,`.ogg`,`.wav`,`.m4a`,`.aac`,`.opus`,`.webm`],Yo=[`.svg`],Xo=[`.jpg`,`.jpeg`,`.png`,`.webp`],Zo=[`parallax`,`mesh`,`layers`],Qo=[`none`,`sway`,`orbit`,`zoom`,`dolly`,`pan`,`rise`,`vertigo`],$o=[`pointer`,`scroll`,`gyro`,`auto`,`speed`,`smoothing`,`loop`,`duration`,`progress`],es=[`opacity`,`color`,`emissiveIntensity`],ts=[`id`,`kind`,`name`,`visible`,`castShadow`,`receiveShadow`,`behaviours`,`children`,`tags`,`body`,`href`,`userData`,`attach`,`position`,`rotation`,`scale`],ns={mesh:[`geometry`,`material`],text:[`text`,`font`,`size`,`depth`,`bevel`,`align`,`letterSpacing`,`lineHeight`,`kerning`,`maxWidth`,`curveSegments`,`outline`,`splitLetters`,`reveal`,`material`],model:[`src`,`fit`,`center`,`animation`,`morph`,`material`],group:[],generator:[`generator`,`params`,`seed`,`material`],particles:[`preset`,...l.map(e=>e.name)],instances:[`geometry`,`material`,`layout`,`colors`],svg:[`src`,`size`,`fit`,`depth`,`bevel`,`keepColors`,`strokes`,`curveSegments`,`layerGap`,`material`],photo:[`src`,`depth`,`plate`,`plateDepth`,`mode`,`width`,`height`,`strength`,`focus`,`segments`,`layers`,`edgeCut`,`occlude`,`motion`,`material`,`effects`]},rs=[`version`,`id`,`title`,`description`,`target`,`camera`,`environment`,`lights`,`objects`,`timeline`,`interactions`,`postfx`,`physics`,`scripts`,`ui`,`audio`,`data`,`ariaLabel`,`seed`],is=[`kind`,`aspect`,`budgetKb`,`height`,`transparent`,`lazy`,`pauseOffscreen`,`maxDpr`,`reducedMotion`,`posterTime`,`antialias`,`shadows`,`toneMapping`,`exposure`,`quality`],as={radialSegments:[`segments`],widthSegments:[`segments`],capSegments:[`segments`],heightSegments:[`segments`],tubularSegments:[`segments`],thetaLength:[`arc`]},os=[`type`,`fov`,`zoom`,`position`,`target`,`near`,`far`,`controls`,`autoRotate`,`orbitZoom`,`orbitLimits`,`parallax`,`scrollPath`,`follow`,`lookAt`,`shake`,`shots`],ss=[`background`,`lighting`,`lightingIntensity`,`fog`,`ground`,`rig`,`contactShadows`,`shadows`],cs=[`id`,`type`,`color`,`intensity`,`position`,`target`,`castShadow`,`skyColor`,`groundColor`,`distance`,`decay`,`angle`,`penumbra`,`width`,`height`,`panel`,`volumetric`,`shadow`,`behaviours`],ls=`preset.type.color.metalness.roughness.emissive.emissiveIntensity.opacity.transparent.wireframe.flatShading.side.transmission.thickness.ior.clearcoat.iridescence.sheen.map.normalMap.roughnessMap.repeat.gradient.shader.uniforms.clearcoatRoughness.sheenColor.sheenRoughness.anisotropy.anisotropyRotation.attenuationColor.attenuationDistance.specularIntensity.specularColor.dispersion.iridescenceIOR.iridescenceThicknessRange.envMapIntensity.metalnessMap.aoMap.emissiveMap.bumpMap.displacementMap.alphaMap.normalScale.bumpScale.aoMapIntensity.displacementScale.triplanar.gradientEmissive`.split(`.`),us=[`type`,`shape`,`size`,`radius`,`height`,`shapes`,`offset`,`mass`,`restitution`,`friction`,`material`,`velocity`,`angularVelocity`,`linearDamping`,`angularDamping`,`gravityScale`,`fixedRotation`,`character`,`sleep`,`ccd`,`layer`,`collidesWith`],ds=[`static`,`dynamic`,`kinematic`,`trigger`],fs=[`box`,`sphere`,`auto`,`cylinder`,`capsule`,`convex`,`trimesh`,`heightfield`,`compound`],ps=[`box`,`sphere`,`cylinder`,`capsule`],ms=[`hinge`,`point`,`distance`,`lock`,`spring`],hs=[`gravity`,`step`,`substeps`,`iterations`,`sleep`,`debug`,`materials`,`contacts`,`layers`,`joints`],gs=[`id`,`type`,`a`,`b`,`pivot`,`axis`,`distance`,`restLength`,`stiffness`,`damping`,`motor`,`limits`,`maxForce`,`collideConnected`],_s=new WeakMap,vs=[`id`,`type`,`text`,`anchor`,`style`,`value`,`action`,`visible`,`color`,`background`],ys={"geometries.lathe.points":{dims:2,min:2},"geometries.extrude.shape":{dims:2,min:3},"geometries.tube.points":{dims:3,min:2},"behaviours.path.points":{dims:3,min:2}},L=e=>!!e&&typeof e==`object`&&!Array.isArray(e),bs=e=>typeof e==`number`&&Number.isFinite(e),xs=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,Ss=e=>{let t=JSON.stringify(e);return t===void 0?String(e):t.length>60?`${t.slice(0,57)}…`:t},Cs=class{issues=[];ids=new Map;objectIds=new Set;lightIds=new Set;letterTexts=new Set;letterCounts=new Map;add(e,t,n,r,i){this.issues.push(i?{severity:e,code:t,path:n,message:r,hint:i}:{severity:e,code:t,path:n,message:r})}error(e,t,n,r){this.add(`error`,e,t,n,r)}warn(e,t,n,r){this.add(`warning`,e,t,n,r)}info(e,t,n,r){this.add(`info`,e,t,n,r)}required(e,t,n,r){return e[t]===void 0||e[t]===null?(this.error(`required`,ws(n,t),`Missing required field "${t}" (${r}).`,`Add "${t}": ${r}.`),!1):!0}number(e,t,n={}){return e===void 0?!0:bs(e)?n.integer&&!Number.isInteger(e)?(this.error(`type`,t,`Expected an integer, got ${e}.`,`Use a whole number, e.g. ${Math.round(e)}.`),!1):n.min!==void 0&&(n.exclusiveMin?e<=n.min:e<n.min)?(this.error(`range`,t,`${e} is below the minimum (${n.exclusiveMin?`>`:`≥`} ${n.min}).`,`Use a value${Es(n)}.`),!1):n.max!==void 0&&e>n.max?(this.error(`range`,t,`${e} is above the maximum (${n.max}).`,`Use a value${Es(n)}.`),!1):!0:(this.error(`type`,t,`Expected a number, got ${xs(e)} ${Ss(e)}.`,`Set ${Ts(t)} to a number${Es(n)}.`),!1)}boolean(e,t){return e===void 0||typeof e==`boolean`||(this.error(`type`,t,`Expected true or false, got ${xs(e)} ${Ss(e)}.`,`Set ${Ts(t)} to true or false.`),!1)}string(e,t,n={}){return e===void 0?!0:typeof e==`string`?n.nonEmpty&&!e.trim()?(this.error(`required`,t,`Must not be empty.`),!1):!0:(this.error(`type`,t,`Expected a string, got ${xs(e)} ${Ss(e)}.`),!1)}enumOf(e,t,n){if(e===void 0||typeof e==`string`&&t.includes(e))return!0;let r=typeof e==`string`?N(e,t):``;return this.error(`enum`,n,`Invalid value ${Ss(e)}.`,`${r}Valid values: ${P(t)}.`),!1}color(e,t){return e===void 0||ma(e)?!0:(this.error(`color`,t,`Invalid colour ${Ss(e)}.`,`Use a CSS colour: "#ff8800", "#f80", "rgb(255,136,0)", "hsl(30 100% 50%)" or a CSS name like "tomato".`),!1)}colors(e,t,n=1){if(e===void 0)return!0;if(!Array.isArray(e))return this.error(`type`,t,`Expected an array of colours, got ${xs(e)}.`,`Example: ["#ff006e", "#3a86ff"].`),!1;e.length<n&&this.error(`required`,t,`Needs at least ${n} colour${n>1?`s`:``}.`,`Example: ["#ff006e", "#3a86ff"].`);let r=e.length>=n;return e.forEach((e,n)=>r=this.color(e,`${t}[${n}]`)&&r),r}vec(e,t,n){if(e===void 0)return!0;if(!Array.isArray(e)||e.length!==t||!e.every(bs)){let r=t===3?`[0, 1.5, 0]`:`[1, 1]`;return this.error(`vec`,n,`Expected [${t===3?`x, y, z`:`x, y`}] (${t} numbers), got ${Ss(e)}.`,`Write it as an array of ${t} numbers, e.g. ${r}.`),!1}return!0}stringArray(e,t){return e===void 0?!0:!Array.isArray(e)||!e.every(e=>typeof e==`string`)?(this.error(`type`,t,`Expected an array of strings, got ${Ss(e)}.`),!1):!0}unknownKeys(e,t,n,r){for(let i of Object.keys(e)){if(t.includes(i))continue;let e=Qi(i,t);this.warn(`unknown-field`,ws(n,i),`Unknown field "${i}" on ${r} (ignored by the runtime).`,e?`Did you mean "${e}"? Otherwise remove it.`:`Remove it. Valid fields: ${P(t)}.`)}}assetPath(e,t,n,r){if(e===void 0)return!0;if(typeof e!=`string`||!e.trim())return this.error(`type`,t,`Expected an asset path string for ${r}, got ${Ss(e)}.`,`Use a project path like "assets/models/fox.glb" or a library id like "library:models/nature/pine-tree.glb".`),!1;let i=Os(e);if(i)return this.error(`asset-path`,t,`Invalid asset path "${e}": ${i.message}`,i.hint),!1;if(!Ea(e)){let i=e.toLowerCase().split(`?`)[0];if(!n.some(e=>i.endsWith(e)))return this.error(`asset-path`,t,`"${e}" does not look like ${r} (expected ${n.join(`, `)}).`,`Point ${Ts(t)} at a ${n.join(` / `)} file.`),!1}return!0}declareId(e,t,n){if(typeof e!=`string`||!$i.test(e))return this.error(`invalid-id`,t,`Invalid ${n} id ${Ss(e)}.`,`Ids start with a letter and use letters, digits, "_" or "-" (regex ${$i.source}), e.g. "logo" or "tree-1".`),!1;if(n!==`ui`){let r=this.ids.get(e);if(r)return this.error(`duplicate-id`,t,`Duplicate id "${e}" (already used at ${r}).`,`Ids are unique across objects (including children) and lights. Rename this one, e.g. "${e}-2".`),!1;this.ids.set(e,t),(n===`object`?this.objectIds:this.lightIds).add(e)}return!0}params(e,t,n,r,i=[]){let a=t.params.map(e=>e.name);for(let i of t.params){let a=n[i.name],o=ws(r,i.name);a===void 0?i.required&&this.error(`required`,o,`${Ds(e)} "${t.id}" requires "${i.name}" (${i.description}).`,`Add "${i.name}" (${i.type}).`):e===`generators`&&JSON.stringify(a).includes(`{data.`)||this.param(`${e}.${t.id}.${i.name}`,i,a,o,t.id)}for(let o of Object.keys(n)){if(a.includes(o)||i.includes(o))continue;let n=e===`geometries`?as[o]?.find(e=>a.includes(e)):void 0;if(n){this.warn(`unknown-param`,ws(r,o),`"${o}" is not a parameter of ${Ds(e)} "${t.id}": it is called "${n}" here (the value is ignored as written).`,`Rename "${o}" to "${n}".`);continue}let s=Qi(o,a);this.warn(`unknown-param`,ws(r,o),`Unknown parameter "${o}" for ${Ds(e)} "${t.id}" (ignored).`,`${s?`Did you mean "${s}"? `:``}${a.length?`Valid parameters: ${P(a)}.`:`"${t.id}" takes no parameters — remove it.`}`)}}param(e,t,n,r,i){if(n===null&&/null/.test(t.description))return!0;let a=ys[e];if(a)return this.points(n,a.dims,a.min,r);switch(t.type){case`number`:return this.number(n,r,{min:t.min,max:t.max});case`integer`:return this.number(n,r,{min:t.min,max:t.max,integer:!0});case`boolean`:return this.boolean(n,r);case`string`:return this.string(n,r);case`color`:return this.color(n,r);case`colors`:return this.colors(n,r);case`vec2`:return this.vec(n,2,r);case`vec3`:return this.vec(n,3,r);case`enum`:return!!this.enumOf(n,t.options??[],r);case`object`:return L(n)?!0:(this.error(`type`,r,`Expected an object for "${t.name}" of "${i}", got ${xs(n)}.`),!1);case`array`:return Array.isArray(n)?!t.options||n.every((e,n)=>this.enumOf(e,t.options??[],`${r}[${n}]`)):(this.error(`type`,r,`Expected an array for "${t.name}" of "${i}", got ${xs(n)}.`,t.description),!1)}return!0}points(e,t,n,r){if(!Array.isArray(e))return this.error(`type`,r,`Expected an array of [${t===2?`x, y`:`x, y, z`}] points, got ${xs(e)}.`,t===2?`Example: [[0, 0], [0.5, 0.2], [0.3, 1]].`:`Example: [[0, 0, 0], [1, 1, 0], [2, 0, 1]].`),!1;e.length<n&&this.error(`required`,r,`Needs at least ${n} points, got ${e.length}.`);let i=e.length>=n;return e.forEach((e,n)=>i=this.vec(e,t,`${r}[${n}]`)&&i),i}};function ws(e,t){return e?`${e}.${t}`:t}function Ts(e){let t=/([^.#[\]]+)(?:\[\d+\])*$/.exec(e);return t?`"${t[1]}"`:`the value`}function Es(e){return e.min!==void 0&&e.max!==void 0?` between ${e.min} and ${e.max}`:e.min===void 0?e.max===void 0?``:` ≤ ${e.max}`:e.exclusiveMin?` greater than ${e.min}`:` ≥ ${e.min}`}function Ds(e){return{geometries:`geometry`,materialPresets:`material preset`,shaders:`shader`,behaviours:`behaviour`,generators:`generator`,particlePresets:`particle preset`,instanceLayouts:`instance layout`,postfx:`post effect`,fonts:`font`,sounds:`sound`,textures:`procedural texture`,lightRigs:`light rig`}[e]}function Os(e){if(Ea(e)){let t=Da(e);return!/^[a-z0-9][a-z0-9._/-]*$/i.test(t)||t.includes(`..`)||t.endsWith(`/`)?{message:`library ids look like "library:<path in the library>".`,hint:`List valid ids with library_list (CLI: agent3d assets library), e.g. "library:models/nature/pine-tree.glb".`}:null}return/^[a-z][a-z0-9+.-]*:\/\//i.test(e)||e.startsWith(`//`)?{message:`remote URLs are not allowed (exports never hotlink).`,hint:`Download the file into the project first (assets_search + assets_add, CLI: agent3d assets search|add) and use its assets/… path.`}:e.startsWith(`data:`)||e.startsWith(`blob:`)?{message:`inline data URIs are not allowed in scene.json.`,hint:`Save the file under assets/ and reference its path.`}:e.startsWith(`/`)||/^[a-zA-Z]:/.test(e)||e.includes(`\\`)?{message:`paths must be relative to the project folder, with forward slashes.`,hint:`Use e.g. "assets/textures/wood.jpg".`}:e.split(`/`).includes(`..`)?{message:`".." is not allowed: assets must live inside the project.`,hint:`Copy the file into assets/ and reference it from there.`}:null}function ks(e){let t=new Cs;if(!L(e))return t.error(`type`,``,`A scene must be a JSON object, got ${xs(e)}.`,"Start from scene_get / `agent3d scene get` or a template."),t.issues;let n=e;t.unknownKeys(n,rs,``,`the scene`),n.version!==1&&t.error(n.version===void 0?`required`:`enum`,`version`,`Scene "version" must be 1, got ${Ss(n.version)}.`,`Set "version": 1.`),t.required(n,`id`,``,`a short identifier, e.g. "spring-banner"`)&&t.string(n.id,`id`,{nonEmpty:!0}),t.required(n,`title`,``,`a human title`)&&t.string(n.title,`title`,{nonEmpty:!0}),t.string(n.description,`description`),t.string(n.ariaLabel,`ariaLabel`),t.number(n.seed,`seed`,{integer:!0}),n.data!==void 0&&!L(n.data)&&t.error(`type`,`data`,`scene.data must be an object.`,`Example: "data": { "levels": [] }.`),t.required(n,`target`,``,`{ "kind": "banner", "aspect": "4:1" }`)&&js(t,n.target),t.required(n,`camera`,``,`{ "type": "perspective", "position": [0, 0, 8] }`)&&Ms(t,n.camera,`camera`),t.required(n,`environment`,``,`{ "background": "#101020" }`)&&Ps(t,n.environment),n.lights===void 0?t.error(`required`,`lights`,`Missing "lights" array.`,`Add "lights": [] (or lights like { "type": "directional", "position": [5, 8, 5] }).`):Array.isArray(n.lights)||t.error(`type`,`lights`,`lights must be an array.`),n.objects===void 0?t.error(`required`,`objects`,`Missing "objects" array.`,`Add "objects": [].`):Array.isArray(n.objects)||t.error(`type`,`objects`,`objects must be an array.`);let r=Array.isArray(n.lights)?n.lights:[];r.forEach((e,n)=>Ls(t,e,`lights[${n}]`));let i=Array.isArray(n.objects)?n.objects:[];zs.set(t,new Set(i.filter(L))),i.forEach((e,n)=>Bs(t,e,`objects[${n}]`)),Ns(t,n.camera),t.issues.push(...jo(n,{objects:t.objectIds,lights:t.lightIds,letters:t.letterTexts,letterCounts:t.letterCounts})),n.postfx!==void 0&&rc(t,n.postfx),n.physics!==void 0&&ic(t,n.physics),n.scripts!==void 0&&ac(t,n.scripts),n.ui!==void 0&&oc(t,n.ui),n.audio!==void 0&&sc(t,n.audio);let a=L(n.environment)&&(n.environment.rig!==void 0||L(n.environment.background)&&L(n.environment.background.sky)&&(n.environment.background.sky.preset!==void 0||n.environment.background.sky.physical===!0)&&n.environment.lighting!==`none`);return r.length===0&&!a&&L(n.environment)&&(n.environment.lighting===`none`||n.environment.lighting===void 0)&&As(i)&&t.warn(`no-lights`,`lights`,`The scene has no lights and no environment lighting: lit materials (standard, physical, toon…) will render black.`,`Add lights (e.g. { "type": "hemisphere", "intensity": 1 } and a directional key light) or set environment.lighting to "studio".`),t.issues}function As(e){return e.some(e=>L(e)&&(e.kind!==`photo`&&e.kind!==`group`||Array.isArray(e.children)&&As(e.children)))}function js(e,t){if(!L(t))return e.error(`type`,`target`,`target must be an object.`,`Example: { "kind": "banner", "aspect": "4:1" }.`);e.unknownKeys(t,is,`target`,`target`),e.required(t,`kind`,`target`,`one of ${P(Mo)}`)&&e.enumOf(t.kind,Mo,`target.kind`),e.required(t,`aspect`,`target`,`"W:H", e.g. "4:1"`)&&(aa(t.aspect)||e.error(`aspect`,`target.aspect`,`Invalid aspect ${Ss(t.aspect)}.`,`Use "W:H" with positive numbers, e.g. "4:1" (banner), "16:9" (hero), "1:1" (square)${typeof t.kind==`string`&&t.kind in Wo?`; default for ${t.kind}: "${Wo[t.kind]}"`:``}.`)),e.number(t.budgetKb,`target.budgetKb`,{min:0,exclusiveMin:!0}),t.height===void 0||typeof t.height==`string`&&/^\d+(\.\d+)?(px|vh|vw|rem|em|%|svh|dvh|lvh)$/.test(t.height.trim())||e.error(`type`,`target.height`,`Invalid CSS height ${Ss(t.height)}.`,`Use a CSS length like "320px", "60vh" or "20rem" — or remove it to keep the aspect ratio.`);for(let n of[`transparent`,`lazy`,`pauseOffscreen`,`antialias`,`shadows`])e.boolean(t[n],`target.${n}`);e.number(t.maxDpr,`target.maxDpr`,{min:.5,max:4}),e.enumOf(t.reducedMotion,[`static`,`slow`,`ignore`],`target.reducedMotion`),e.number(t.posterTime,`target.posterTime`,{min:0}),e.enumOf(t.quality,[`auto`,`low`,`medium`,`high`,`ultra`],`target.quality`),e.enumOf(t.toneMapping,Uo,`target.toneMapping`),e.number(t.exposure,`target.exposure`,{min:0,exclusiveMin:!0,max:10})}function Ms(e,t,n){if(!L(t))return e.error(`type`,n,`camera must be an object.`,`Example: { "type": "perspective", "fov": 40, "position": [0, 1, 8], "target": [0, 0, 0] }.`);e.unknownKeys(t,os,n,`the camera`),e.required(t,`type`,n,`"perspective" or "orthographic"`)&&e.enumOf(t.type,[`perspective`,`orthographic`],`${n}.type`),e.required(t,`position`,n,`[x, y, z] in units`)&&e.vec(t.position,3,`${n}.position`),e.vec(t.target,3,`${n}.target`),e.number(t.fov,`${n}.fov`,{min:1,max:179}),t.fov!==void 0&&t.type===`orthographic`&&e.warn(`ignored`,`${n}.fov`,`fov is ignored by an orthographic camera.`,`Use "zoom" (world units visible vertically) instead.`),e.number(t.zoom,`${n}.zoom`,{min:0,exclusiveMin:!0}),e.number(t.near,`${n}.near`,{min:0,exclusiveMin:!0}),e.number(t.far,`${n}.far`,{min:0,exclusiveMin:!0}),bs(t.near)&&bs(t.far)&&t.far<=t.near&&e.error(`range`,`${n}.far`,`far (${t.far}) must be greater than near (${t.near}).`,`Typical values: near 0.1, far 1000.`),Array.isArray(t.position)&&Array.isArray(t.target)&&t.position.length===3&&t.target.length===3&&t.position.every((e,n)=>e===t.target[n])&&e.error(`range`,`${n}.position`,`camera.position equals camera.target: the camera has no direction.`,`Move the camera back, e.g. position [0, 1, 8] looking at [0, 0, 0].`),e.enumOf(t.controls,zo,`${n}.controls`),e.number(t.autoRotate,`${n}.autoRotate`),e.boolean(t.orbitZoom,`${n}.orbitZoom`),t.orbitLimits!==void 0&&(L(t.orbitLimits)?(e.unknownKeys(t.orbitLimits,[`minDistance`,`maxDistance`,`minPolar`,`maxPolar`,`minAzimuth`,`maxAzimuth`],`${n}.orbitLimits`,`orbitLimits`),e.number(t.orbitLimits.minDistance,`${n}.orbitLimits.minDistance`,{min:0}),e.number(t.orbitLimits.maxDistance,`${n}.orbitLimits.maxDistance`,{min:0}),e.number(t.orbitLimits.minPolar,`${n}.orbitLimits.minPolar`,{min:0,max:180}),e.number(t.orbitLimits.maxPolar,`${n}.orbitLimits.maxPolar`,{min:0,max:180}),e.number(t.orbitLimits.minAzimuth,`${n}.orbitLimits.minAzimuth`,{min:-360,max:360}),e.number(t.orbitLimits.maxAzimuth,`${n}.orbitLimits.maxAzimuth`,{min:-360,max:360})):e.error(`type`,`${n}.orbitLimits`,`orbitLimits must be an object.`)),t.parallax!==void 0&&(L(t.parallax)?(e.unknownKeys(t.parallax,[`strength`,`smoothing`],`${n}.parallax`,`parallax`),e.number(t.parallax.strength,`${n}.parallax.strength`,{min:0}),e.number(t.parallax.smoothing,`${n}.parallax.smoothing`,{min:0,max:.99})):e.error(`type`,`${n}.parallax`,`parallax must be an object.`,`Example: { "strength": 0.5, "smoothing": 0.9 }.`)),t.scrollPath!==void 0&&(Array.isArray(t.scrollPath)?t.scrollPath.forEach((t,r)=>{let i=`${n}.scrollPath[${r}]`;if(!L(t))return e.error(`type`,i,`Expected { position: [x,y,z], target?: [x,y,z] }.`);e.required(t,`position`,i,`[x, y, z]`)&&e.vec(t.position,3,`${i}.position`),e.vec(t.target,3,`${i}.target`)}):e.error(`type`,`${n}.scrollPath`,`scrollPath must be an array of { position, target? }.`)),t.controls===`scroll`&&(!Array.isArray(t.scrollPath)||t.scrollPath.length<2)&&e.error(`required`,`${n}.scrollPath`,`controls "scroll" needs a scrollPath with at least 2 points.`,`Add "scrollPath": [{ "position": [0, 1, 8] }, { "position": [4, 2, 4], "target": [0, 0, 0] }].`),t.follow!==void 0&&(L(t.follow)?(e.unknownKeys(t.follow,[`target`,`offset`,`smoothing`,`lookAhead`],`${n}.follow`,`follow`),e.required(t.follow,`target`,`${n}.follow`,`the id of the object to follow`)&&e.string(t.follow.target,`${n}.follow.target`),e.vec(t.follow.offset,3,`${n}.follow.offset`),e.number(t.follow.smoothing,`${n}.follow.smoothing`,{min:0,max:.99}),e.number(t.follow.lookAhead,`${n}.follow.lookAhead`,{min:0})):e.error(`type`,`${n}.follow`,`follow must be an object.`,`Example: { "target": "player", "offset": [0, 3, 6] }.`)),t.controls===`follow`&&t.follow===void 0&&e.error(`required`,`${n}.follow`,`controls "follow" needs camera.follow.`,`Add "follow": { "target": "<object id>", "offset": [0, 3, 6] }.`)}function Ns(e,t){L(t)&&L(t.follow)&&typeof t.follow.target==`string`&&(e.objectIds.has(t.follow.target)||e.error(`unknown-ref`,`camera.follow.target`,`camera.follow.target "${t.follow.target}" is not an object id.`,`${N(t.follow.target,e.objectIds)}Object ids: ${P([...e.objectIds])}.`))}function Ps(e,t){if(!L(t))return e.error(`type`,`environment`,`environment must be an object.`,`Example: { "background": { "gradient": ["#0f0c29", "#302b63"] }, "lighting": "studio" }.`);if(e.unknownKeys(t,ss,`environment`,`environment`),e.required(t,`background`,`environment`,`a colour, "transparent", { gradient: [...] }, { radial: [...] }, { sky: {...} } or { hdri: "assets/…" }`)&&Is(e,t.background),t.lighting!==void 0&&(typeof t.lighting==`string`?e.enumOf(t.lighting,Io,`environment.lighting`):L(t.lighting)?(e.unknownKeys(t.lighting,[`hdri`,`intensity`,`rotation`],`environment.lighting`,`environment.lighting`),e.number(t.lighting.rotation,`environment.lighting.rotation`),e.required(t.lighting,`hdri`,`environment.lighting`,`an .hdr/.exr path or library id`)&&e.assetPath(t.lighting.hdri,`environment.lighting.hdri`,I,`an HDRI`),e.number(t.lighting.intensity,`environment.lighting.intensity`,{min:0})):e.error(`type`,`environment.lighting`,`Invalid lighting ${Ss(t.lighting)}.`,`Use a preset (${P(Io)}) or { "hdri": "assets/hdris/x.hdr" }.`)),e.number(t.lightingIntensity,`environment.lightingIntensity`,{min:0}),t.fog!==void 0){let n=t.fog;L(n)?(e.unknownKeys(n,[`color`,`near`,`far`,`density`,`height`,`falloff`],`environment.fog`,`fog`),e.color(n.color,`environment.fog.color`),n.density!==void 0&&e.number(n.density,`environment.fog.density`,{min:0,max:1}),e.number(n.height,`environment.fog.height`),e.number(n.falloff,`environment.fog.falloff`,{min:0,exclusiveMin:!0}),(n.height!==void 0||n.falloff!==void 0)&&n.density===void 0&&e.warn(`ignored`,`environment.fog.height`,`Height fog needs an exponential fog (density).`,`Use { "density": 0.04, "height": 0, "falloff": 0.3 }.`),e.number(n.near,`environment.fog.near`,{min:0}),e.number(n.far,`environment.fog.far`,{min:0}),bs(n.near)&&bs(n.far)&&n.far<=n.near&&e.error(`range`,`environment.fog.far`,`fog.far must be greater than fog.near.`)):e.error(`type`,`environment.fog`,`fog must be an object.`,`Use { "color": "#ccd", "near": 10, "far": 50 } (linear) or { "color": "#ccd", "density": 0.03 } (exponential).`)}if(t.ground!==void 0){let n=t.ground;L(n)?(e.unknownKeys(n,[`y`,`size`,`color`,`shadowOnly`,`grid`,`roughness`,`opacity`],`environment.ground`,`ground`),e.number(n.opacity,`environment.ground.opacity`,{min:0,max:1}),e.number(n.y,`environment.ground.y`),e.number(n.size,`environment.ground.size`,{min:0,exclusiveMin:!0}),e.color(n.color,`environment.ground.color`),e.boolean(n.shadowOnly,`environment.ground.shadowOnly`),e.boolean(n.grid,`environment.ground.grid`),e.number(n.roughness,`environment.ground.roughness`,{min:0,max:1})):e.error(`type`,`environment.ground`,`ground must be an object.`,`Example: { "y": 0, "shadowOnly": true }.`)}if(t.rig!==void 0){let n=t.rig,r=d.lightRigs.map(e=>e.id),i=typeof n==`string`?n:L(n)?n.preset:void 0;if(!(typeof n==`string`||L(n)))e.error(`type`,`environment.rig`,`Invalid rig ${Ss(n)}.`,`Use a rig id (${P(r)}) or { "preset": "softbox", "intensity": 1 }.`);else if(typeof i!=`string`)e.error(`required`,`environment.rig.preset`,`rig needs a "preset" id.`,`One of ${P(r)}.`);else{let t=Ws(e,`lightRigs`,i,typeof n==`string`?`environment.rig`:`environment.rig.preset`);t&&L(n)&&e.params(`lightRigs`,t,n,`environment.rig`,[`preset`])}}if(t.contactShadows!==void 0&&typeof t.contactShadows!=`boolean`){let n=t.contactShadows,r=`environment.contactShadows`;L(n)?(e.unknownKeys(n,[`y`,`size`,`center`,`opacity`,`blur`,`far`,`resolution`,`color`,`frames`],r,`contactShadows`),e.vec(n.center,2,`${r}.center`),e.number(n.y,`${r}.y`),e.number(n.size,`${r}.size`,{min:0,exclusiveMin:!0}),e.number(n.opacity,`${r}.opacity`,{min:0,max:1}),e.number(n.blur,`${r}.blur`,{min:0,max:20}),e.number(n.far,`${r}.far`,{min:0,exclusiveMin:!0}),e.number(n.resolution,`${r}.resolution`,{min:64,max:2048,integer:!0}),e.color(n.color,`${r}.color`),e.number(n.frames,`${r}.frames`,{min:0,integer:!0})):e.error(`type`,r,`contactShadows must be true or an object.`,`Example: { "opacity": 0.6, "blur": 2.5 }.`)}if(t.shadows!==void 0){let n=t.shadows;L(n)?(e.unknownKeys(n,[`type`,`softness`,`mapSize`,`intensity`],`environment.shadows`,`shadows`),e.enumOf(n.type,[`pcf`,`vsm`],`environment.shadows.type`),Fs(e,n,`environment.shadows`)):e.error(`type`,`environment.shadows`,`shadows must be an object.`,`Example: { "type": "vsm", "softness": 6 }.`)}}function Fs(e,t,n){e.number(t.softness,`${n}.softness`,{min:0,max:30}),e.number(t.mapSize,`${n}.mapSize`,{min:256,max:4096,integer:!0}),e.number(t.intensity,`${n}.intensity`,{min:0,max:1})}function Is(e,t){let n=`environment.background`;if(typeof t==`string`){t!==`transparent`&&e.color(t,n);return}if(!L(t))return e.error(`type`,n,`Invalid background ${Ss(t)}.`,`Use a colour ("#101020"), "transparent", { "gradient": ["#a", "#b"], "angle": 0 }, { "radial": [...] }, { "meshGradient": [...] }, { "sky": {...} } or { "hdri": "assets/hdris/x.hdr" }.`);let r=Object.keys(t),i=[`gradient`,`radial`,`meshGradient`,`sky`,`hdri`].find(e=>e in t);if(!i)return e.error(`type`,n,`Background object needs one of "gradient", "radial", "meshGradient", "sky" or "hdri" (got keys ${P(r)}).`,`Example: { "gradient": ["#0f0c29", "#302b63", "#24243e"], "angle": 0 }.`);if(i===`gradient`)e.unknownKeys(t,[`gradient`,`angle`,`grain`],n,`a gradient background`),e.colors(t.gradient,`${n}.gradient`,2),e.number(t.angle,`${n}.angle`),e.number(t.grain,`${n}.grain`,{min:0,max:1});else if(i===`radial`)e.unknownKeys(t,[`radial`,`center`,`radius`,`grain`],n,`a radial background`),e.colors(t.radial,`${n}.radial`,2),e.vec(t.center,2,`${n}.center`),e.number(t.radius,`${n}.radius`,{min:0,exclusiveMin:!0}),e.number(t.grain,`${n}.grain`,{min:0,max:1});else if(i===`meshGradient`)e.unknownKeys(t,[`meshGradient`,`speed`,`scale`,`seed`,`grain`],n,`a mesh-gradient background`),e.colors(t.meshGradient,`${n}.meshGradient`,2),Array.isArray(t.meshGradient)&&t.meshGradient.length>6&&e.warn(`ignored`,`${n}.meshGradient`,`Only the first 6 colours are used.`),e.number(t.speed,`${n}.speed`,{min:0}),e.number(t.scale,`${n}.scale`,{min:.05}),e.number(t.seed,`${n}.seed`),e.number(t.grain,`${n}.grain`,{min:0,max:1});else if(i===`sky`){e.unknownKeys(t,[`sky`],n,`a sky background`);let r=t.sky;if(!L(r))return e.error(`type`,`${n}.sky`,`sky must be an object.`,`Example: { "top": "#4a90d9", "horizon": "#f6d6a8", "sun": { "direction": [1, 0.4, 0.2] } }.`);e.unknownKeys(r,[`top`,`horizon`,`bottom`,`sun`,`stars`,`physical`,`preset`,`turbidity`,`rayleigh`,`mieCoefficient`,`mieDirectionalG`,`exposure`,`clouds`],`${n}.sky`,`sky`),e.boolean(r.physical,`${n}.sky.physical`),e.enumOf(r.preset,Lo,`${n}.sky.preset`),e.number(r.turbidity,`${n}.sky.turbidity`,{min:0,max:30}),e.number(r.rayleigh,`${n}.sky.rayleigh`,{min:0,max:6}),e.number(r.mieCoefficient,`${n}.sky.mieCoefficient`,{min:0,max:.1}),e.number(r.mieDirectionalG,`${n}.sky.mieDirectionalG`,{min:0,max:.999}),e.number(r.exposure,`${n}.sky.exposure`,{min:0}),e.number(r.clouds,`${n}.sky.clouds`,{min:0,max:1});let i=r.physical===!0||r.preset!==void 0||r.turbidity!==void 0||r.rayleigh!==void 0;if(i)for(let t of[`top`,`horizon`,`bottom`])r[t]!==void 0&&e.warn(`ignored`,`${n}.sky.${t}`,`"${t}" is ignored by the physical sky (preset / physical).`,`Remove it, or drop preset/physical for a colour-gradient sky.`);if(e.color(r.top,`${n}.sky.top`),e.color(r.horizon,`${n}.sky.horizon`),e.color(r.bottom,`${n}.sky.bottom`),e.number(r.stars,`${n}.sky.stars`,{min:0,integer:!0,max:1e5}),r.sun!==void 0&&r.sun!==!1){if(!L(r.sun))e.error(`type`,`${n}.sky.sun`,`sun must be an object or false.`);else if(e.unknownKeys(r.sun,[`direction`,`elevation`,`azimuth`,`color`,`size`,`light`,`intensity`,`castShadow`],`${n}.sky.sun`,`sun`),e.vec(r.sun.direction,3,`${n}.sky.sun.direction`),e.number(r.sun.elevation,`${n}.sky.sun.elevation`,{min:-90,max:90}),e.number(r.sun.azimuth,`${n}.sky.sun.azimuth`),e.color(r.sun.color,`${n}.sky.sun.color`),e.number(r.sun.size,`${n}.sky.sun.size`,{min:0}),e.boolean(r.sun.light,`${n}.sky.sun.light`),e.number(r.sun.intensity,`${n}.sky.sun.intensity`,{min:0}),e.boolean(r.sun.castShadow,`${n}.sky.sun.castShadow`),!i)for(let t of[`light`,`intensity`,`castShadow`])r.sun[t]!==void 0&&e.warn(`ignored`,`${n}.sky.sun.${t}`,`sun.${t} only applies to the physical sky (it adds a sun light).`,`Set "preset" (e.g. "golden-hour") or "physical": true, or add a directional light yourself.`)}}else{e.unknownKeys(t,[`hdri`,`blur`,`intensity`,`rotation`,`groundProjection`],n,`an HDRI background`),e.assetPath(t.hdri,`${n}.hdri`,I,`an HDRI`),e.number(t.blur,`${n}.blur`,{min:0,max:1}),e.number(t.intensity,`${n}.intensity`,{min:0}),e.number(t.rotation,`${n}.rotation`);let r=t.groundProjection;r!==void 0&&typeof r!=`boolean`&&(L(r)?(e.unknownKeys(r,[`height`,`radius`],`${n}.groundProjection`,`groundProjection`),e.number(r.height,`${n}.groundProjection.height`,{min:0,exclusiveMin:!0}),e.number(r.radius,`${n}.groundProjection.radius`,{min:0,exclusiveMin:!0})):e.error(`type`,`${n}.groundProjection`,`groundProjection must be true or { height, radius }.`)),r&&t.blur&&e.warn(`ignored`,`${n}.blur`,`blur is ignored with groundProjection (the photo is projected sharp).`)}}function Ls(e,t,n){if(!L(t))return e.error(`type`,n,`A light must be an object.`,`Example: { "type": "directional", "position": [5, 8, 5], "intensity": 2 }.`);let r=t.id!==void 0&&ea(t.id)?`lights#${t.id}`:n;t.id!==void 0&&e.declareId(t.id,`${r}.id`,`light`),e.unknownKeys(t,cs,r,`a ${typeof t.type==`string`?t.type:``} light`.replace(` `,` `)),e.required(t,`type`,r,`one of ${P(Po)}`)&&e.enumOf(t.type,Po,`${r}.type`),e.color(t.color,`${r}.color`),e.number(t.intensity,`${r}.intensity`,{min:0}),e.vec(t.position,3,`${r}.position`),e.vec(t.target,3,`${r}.target`),e.boolean(t.castShadow,`${r}.castShadow`),e.color(t.skyColor,`${r}.skyColor`),e.color(t.groundColor,`${r}.groundColor`),e.number(t.distance,`${r}.distance`,{min:0}),e.number(t.decay,`${r}.decay`,{min:0}),e.number(t.angle,`${r}.angle`,{min:0,max:90}),e.number(t.penumbra,`${r}.penumbra`,{min:0,max:1}),e.number(t.width,`${r}.width`,{min:0}),e.number(t.height,`${r}.height`,{min:0}),e.boolean(t.panel,`${r}.panel`),t.panel&&t.type!==`rect`&&e.warn(`ignored`,`${r}.panel`,`panel only applies to rect lights.`),t.volumetric!==void 0&&typeof t.volumetric!=`boolean`&&(L(t.volumetric)?(e.unknownKeys(t.volumetric,[`intensity`,`length`,`color`],`${r}.volumetric`,`volumetric`),e.number(t.volumetric.intensity,`${r}.volumetric.intensity`,{min:0}),e.number(t.volumetric.length,`${r}.volumetric.length`,{min:0,exclusiveMin:!0}),e.color(t.volumetric.color,`${r}.volumetric.color`)):e.error(`type`,`${r}.volumetric`,`volumetric must be true or { intensity, length, color }.`)),t.volumetric&&t.type!==`spot`&&e.warn(`ignored`,`${r}.volumetric`,`volumetric only applies to spot lights.`,`Use "type": "spot" (with "angle" and "target") for a light cone.`),t.shadow!==void 0&&(L(t.shadow)?(e.unknownKeys(t.shadow,[`softness`,`mapSize`,`bias`,`normalBias`,`intensity`],`${r}.shadow`,`shadow`),Fs(e,t.shadow,`${r}.shadow`),e.number(t.shadow.bias,`${r}.shadow.bias`,{min:-.1,max:.1}),e.number(t.shadow.normalBias,`${r}.shadow.normalBias`,{min:0,max:1}),t.castShadow||e.info(`ignored`,`${r}.shadow`,`shadow settings only apply when castShadow is true.`)):e.error(`type`,`${r}.shadow`,`shadow must be an object.`,`Example: { "softness": 6, "mapSize": 2048 }.`)),(t.type===`directional`||t.type===`spot`||t.type===`point`||t.type===`rect`)&&t.position===void 0&&e.info(`default`,`${r}.position`,`This ${t.type} light has no position (the runtime uses a default).`,`Set position [x, y, z] explicitly so lighting is predictable, e.g. [5, 8, 5].`),t.castShadow&&(t.type===`ambient`||t.type===`hemisphere`||t.type===`rect`)&&e.warn(`ignored`,`${r}.castShadow`,`${t.type} lights cannot cast shadows.`,`Use a directional, spot or point light for shadows.`),Js(e,t.behaviours,`${r}.behaviours`)}function Rs(e,t){return ea(e.id)?`objects#${e.id}`:t}var zs=new WeakMap;function Bs(e,t,n){if(!L(t))return e.error(`type`,n,`An object must be a JSON object.`,`Example: { "id": "box", "kind": "mesh", "geometry": { "type": "box" } }.`);let r=Rs(t,n);e.declareId(t.id,`${r}.id`,`object`);let a=t.kind;if(!e.required(t,`kind`,r,`one of ${P(No)}`))return;if(!No.includes(a)){e.error(`enum`,`${r}.kind`,`Unknown object kind ${Ss(a)}.`,`${typeof a==`string`?N(a,No):``}Valid kinds: ${P(No)}.`);return}let o=a;if(e.unknownKeys(t,[...ts,...ns[o]],r,`a "${o}" object`),e.string(t.name,`${r}.name`),e.boolean(t.visible,`${r}.visible`),e.boolean(t.castShadow,`${r}.castShadow`),e.boolean(t.receiveShadow,`${r}.receiveShadow`),e.vec(t.position,3,`${r}.position`),e.vec(t.rotation,3,`${r}.rotation`),Array.isArray(t.rotation)&&t.rotation.every(bs)&&t.rotation.some(e=>e!==0)&&t.rotation.every(e=>Math.abs(e)<=2*Math.PI+1e-6)&&t.rotation.some(e=>!Number.isInteger(e))&&e.warn(`radians`,`${r}.rotation`,`rotation ${Ss(t.rotation)} looks like radians.`,`Angles are in DEGREES. E.g. ${Ss(t.rotation.map(e=>Math.round(e*180/Math.PI)))}.`),t.scale!==void 0&&(bs(t.scale)?e.number(t.scale,`${r}.scale`,{min:0,exclusiveMin:!0}):e.vec(t.scale,3,`${r}.scale`)),e.stringArray(t.tags,`${r}.tags`),t.href!==void 0&&(typeof t.href!=`string`||!t.href.trim()?e.error(`type`,`${r}.href`,`href must be a URL string.`):/^\s*javascript:/i.test(t.href)&&e.error(`forbidden`,`${r}.href`,`javascript: links are not allowed.`,`Use an http(s) URL, a relative page path or "#anchor".`)),t.userData!==void 0&&!L(t.userData)&&e.error(`type`,`${r}.userData`,`userData must be an object.`),t.attach!==void 0&&(e.enumOf(t.attach,[`camera`],`${r}.attach`),t.attach===`camera`)){zs.get(e)?.has(t)||e.error(`invalid`,`${r}.attach`,`Only top-level objects can be attached to the camera.`,`Move the object (or its group) to the root of objects[] and set attach there.`);let n=t.position;Array.isArray(n)&&bs(n[2])&&n[2]>-.2?e.warn(`framing`,`${r}.position`,`A camera-attached object at z = ${String(n[2])} is behind or inside the lens: camera space looks down -z.`,`Use a negative z, e.g. [${bs(n[0])?n[0]:0}, ${bs(n[1])?n[1]:0}, -6] (6 units in front of the camera).`):n===void 0&&e.warn(`framing`,`${r}.position`,`A camera-attached object without position sits inside the lens.`,`Set position in camera space, e.g. [0, -1.5, -6] (6 units in front, a bit below centre).`)}if(t.body!==void 0&&($s(e,t.body,`${r}.body`),Xs(e,t,`${r}.body`),L(t.body)&&typeof t.id==`string`)){let n=_s.get(e)??[];n.push({id:t.id,path:`${r}.body`,body:t.body}),_s.set(e,n)}switch(Js(e,t.behaviours,`${r}.behaviours`),o){case`mesh`:e.required(t,`geometry`,r,`{ "type": "box" } (see catalog geometries)`)&&Gs(e,t.geometry,`${r}.geometry`),Ks(e,t.material,`${r}.material`);break;case`text`:e.required(t,`text`,r,`the text to display`)&&e.string(t.text,`${r}.text`,{nonEmpty:!0}),typeof t.font==`string`&&(t.font.includes(`/`)||t.font.includes(`:`))?e.assetPath(t.font,`${r}.font`,[`.json`],`a three.js typeface JSON font (scripts/convert-font.mjs)`):t.font!==void 0&&Ws(e,`fonts`,t.font,`${r}.font`),e.number(t.size,`${r}.size`,{min:0,exclusiveMin:!0}),e.number(t.depth,`${r}.depth`,{min:0}),e.number(t.bevel,`${r}.bevel`,{min:0}),e.enumOf(t.align,[`left`,`center`,`right`],`${r}.align`),e.number(t.letterSpacing,`${r}.letterSpacing`),e.number(t.lineHeight,`${r}.lineHeight`,{min:0,exclusiveMin:!0}),nc(e,t,r),Ks(e,t.material,`${r}.material`);break;case`model`:if(e.required(t,`src`,r,`a .glb/.gltf path ("assets/models/fox.glb") or "library:<id>"`)&&e.assetPath(t.src,`${r}.src`,Ko,`a glTF model`),e.number(t.fit,`${r}.fit`,{min:0,exclusiveMin:!0}),e.boolean(t.center,`${r}.center`),t.animation!==void 0){let n=t.animation;L(n)?(e.unknownKeys(n,[`clip`,`loop`,`speed`,`crossfade`,`offset`,`blend`],`${r}.animation`,`animation`),n.clip!==void 0&&typeof n.clip!=`string`&&!(bs(n.clip)&&Number.isInteger(n.clip)&&n.clip>=0)&&e.error(`type`,`${r}.animation.clip`,`clip must be a clip name or a clip index (integer ≥ 0).`),e.boolean(n.loop,`${r}.animation.loop`),e.number(n.speed,`${r}.animation.speed`),e.number(n.crossfade,`${r}.animation.crossfade`,{min:0})):e.error(`type`,`${r}.animation`,`animation must be an object.`,`Example: { "clip": "Walk", "loop": true }.`)}Ks(e,t.material,`${r}.material`);break;case`group`:Array.isArray(t.children)&&t.children.length||e.info(`empty-group`,r,`Group "${String(t.id)}" has no children.`,`Add children or remove the group.`);break;case`generator`:{if(!e.required(t,`generator`,r,`a catalog generator id (${P(d.generators.map(e=>e.id))})`))break;let n=Ws(e,`generators`,t.generator,`${r}.generator`);if(t.params!==void 0&&!L(t.params)?e.error(`type`,`${r}.params`,`params must be an object.`):n&&e.params(`generators`,n,t.params??{},`${r}.params`),e.number(t.seed,`${r}.seed`,{integer:!0}),t.material!==void 0&&(Ks(e,t.material,`${r}.material`),n&&!n.material)){let t=d.generators.filter(e=>e.material).map(e=>e.id);e.warn(`ignored`,`${r}.material`,`The "${n.id}" generator ignores "material" (it uses its colour params).`,`Use its colour params (agent3d catalog generators ${n.id}); material overrides work on: ${P(t)}.`)}break}case`particles`:t.preset!==void 0&&Ws(e,`particlePresets`,t.preset,`${r}.preset`),e.number(t.count,`${r}.count`,{integer:!0,min:1,max:2e5}),e.vec(t.area,3,`${r}.area`),e.number(t.size,`${r}.size`,{min:0,exclusiveMin:!0}),Array.isArray(t.color)?e.colors(t.color,`${r}.color`):e.color(t.color,`${r}.color`),e.number(t.speed,`${r}.speed`,{min:0}),e.vec(t.direction,3,`${r}.direction`),e.number(t.spread,`${r}.spread`,{min:0,max:1}),e.number(t.lifetime,`${r}.lifetime`,{min:0,exclusiveMin:!0}),e.number(t.opacity,`${r}.opacity`,{min:0,max:1}),e.enumOf(t.blending,[`normal`,`additive`],`${r}.blending`),e.enumOf(t.shape,i,`${r}.shape`),e.number(t.seed,`${r}.seed`,{integer:!0}),t.preset===void 0&&t.count===void 0&&e.info(`default`,r,`Particles without preset or count use runtime defaults.`,`Set a preset (${P(d.particlePresets.map(e=>e.id))}) and/or count.`);break;case`instances`:e.required(t,`geometry`,r,`{ "type": "box" }`)&&Gs(e,t.geometry,`${r}.geometry`),Ks(e,t.material,`${r}.material`),e.required(t,`layout`,r,`{ "type": "grid" | "scatter" | "circle" | "list", … }`)&&Ys(e,t.layout,`${r}.layout`),e.colors(t.colors,`${r}.colors`);break;case`svg`:e.required(t,`src`,r,`inline "<svg …>" markup or a project .svg path`)&&(typeof t.src==`string`?/^\s*(<svg|<\?xml)/i.test(t.src)||e.assetPath(t.src,`${r}.src`,Yo,`an SVG file`):e.error(`type`,`${r}.src`,`src must be a string.`)),e.number(t.size,`${r}.size`,{min:0,exclusiveMin:!0}),e.number(t.depth,`${r}.depth`,{min:0}),e.number(t.bevel,`${r}.bevel`,{min:0}),e.enumOf(t.fit,[`width`,`height`,`max`],`${r}.fit`),e.boolean(t.keepColors,`${r}.keepColors`),e.boolean(t.strokes,`${r}.strokes`),e.number(t.curveSegments,`${r}.curveSegments`,{integer:!0,min:1,max:64}),e.number(t.layerGap,`${r}.layerGap`,{min:0}),Ks(e,t.material,`${r}.material`);break;case`photo`:Vs(e,t,r)}t.children!==void 0&&(Array.isArray(t.children)?t.children.forEach((t,n)=>Bs(e,t,`${r}.children[${n}]`)):e.error(`type`,`${r}.children`,`children must be an array of objects.`))}function Vs(e,t,n){if(e.required(t,`src`,n,`an image path ("assets/textures/photo.jpg") or "library:<id>" (.jpg / .png / .webp)`)&&e.assetPath(t.src,`${n}.src`,Xo,`an image (.jpg / .png / .webp)`),e.assetPath(t.depth,`${n}.depth`,Xo,`a depth map image (grayscale PNG, white = near)`),e.assetPath(t.plate,`${n}.plate`,Xo,`a background plate image (.webp / .png / .jpg)`),e.assetPath(t.plateDepth,`${n}.plateDepth`,Xo,`the plate depth map (grayscale PNG, white = near)`),t.plate===void 0!=(t.plateDepth===void 0)){let r=t.plate===void 0?`plateDepth`:`plate`,i=r===`plate`?`plateDepth`:`plate`;e.warn(`photo-plate`,`${n}.${i}`,`Photo "${String(t.id)}" has ${r} but no ${i}: the plate is ignored (it needs both).`,`Set both from \`agent3d assets plate ${typeof t.src==`string`?t.src:`<image>`}\` (it returns { plate, plateDepth }).`)}else t.plate!==void 0&&t.depth===void 0&&e.info(`ignored`,`${n}.plate`,`plate only applies to a photo with a depth map (this one is flat).`,`Set depth too, or remove plate / plateDepth.`);e.enumOf(t.mode,Zo,`${n}.mode`),e.number(t.width,`${n}.width`,{min:0,exclusiveMin:!0}),e.number(t.height,`${n}.height`,{min:0,exclusiveMin:!0});for(let r of[`strength`,`focus`,`edgeCut`])e.number(t[r],`${n}.${r}`,{min:0,max:1});e.number(t.segments,`${n}.segments`,{integer:!0,min:8,max:1024}),e.number(t.layers,`${n}.layers`,{integer:!0,min:2,max:16});let r=typeof t.mode==`string`?t.mode:`parallax`;if(e.boolean(t.occlude,`${n}.occlude`),t.occlude===!0&&t.depth===void 0&&e.info(`ignored`,`${n}.occlude`,`occlude needs a depth map: photo "${String(t.id)}" is flat (it already hides what is behind its plane).`,`Set ${n}.depth (\`agent3d assets depth ${String(t.src??`<image>`)}\`), or remove occlude.`),t.segments!==void 0&&r!==`mesh`&&e.info(`ignored`,`${n}.segments`,`segments only applies to mode "mesh" (this photo is "${r}").`,`Set mode: "mesh", or remove segments.`),t.layers!==void 0&&r!==`layers`&&e.info(`ignored`,`${n}.layers`,`layers only applies to mode "layers" (this photo is "${r}").`,`Set mode: "layers", or remove layers.`),t.depth===void 0&&typeof t.src==`string`&&Zo.includes(r)&&e.warn(`photo-flat`,n,`Photo "${String(t.id)}" has no depth map: it renders flat (mode "${r}" needs one).`,`Run \`agent3d assets depth ${t.src}\` (writes a depth PNG next to it), then set ${n}.depth to its path.`),t.motion!==void 0){let r=t.motion;L(r)?(e.unknownKeys(r,$o,`${n}.motion`,`photo motion`),e.number(r.pointer,`${n}.motion.pointer`,{min:0,max:1}),e.number(r.scroll,`${n}.motion.scroll`,{min:0,max:1}),e.boolean(r.gyro,`${n}.motion.gyro`),e.enumOf(r.auto,Qo,`${n}.motion.auto`),e.number(r.speed,`${n}.motion.speed`,{min:0}),e.number(r.smoothing,`${n}.motion.smoothing`,{min:0,max:1}),e.boolean(r.loop,`${n}.motion.loop`),e.number(r.duration,`${n}.motion.duration`,{min:.1,max:600}),e.number(r.progress,`${n}.motion.progress`,{min:0,max:1}),r.duration!==void 0&&r.loop!==!1&&e.info(`ignored`,`${n}.motion.duration`,`motion.duration only applies to one-way moves (loop: false); a loop lasts 10 / speed seconds.`,`Set "loop": false for a one-way move, or change speed (cycles per 10 s).`),r.auto===`none`&&(r.loop!==void 0||r.duration!==void 0||r.progress!==void 0)&&e.info(`ignored`,`${n}.motion`,`loop / duration / progress shape the auto move, but this photo has auto "none".`,`Set "auto" to a move: "dolly", "pan", "rise", "vertigo", "zoom", "sway" or "orbit".`)):e.error(`type`,`${n}.motion`,`motion must be an object.`,`Example: { "pointer": 1, "scroll": 0, "auto": "sway", "speed": 1 }.`)}if(t.effects!==void 0&&Us(e,t.effects,`${n}.effects`,t.depth!==void 0),t.material!==void 0){let r=t.material;if(!L(r))e.error(`type`,`${n}.material`,`material must be an object.`,`A photo material only takes { "opacity", "color", "emissiveIntensity" }, e.g. { "opacity": 0.9 }.`);else{for(let t of Object.keys(r)){if(es.includes(t))continue;let r=Qi(t,es);e.warn(`unknown-field`,`${n}.material.${t}`,`"${t}" is not supported on a photo material (ignored by the runtime).`,`${r?`Did you mean "${r}"? `:``}A photo is unlit: only ${P(es)} apply.`)}e.number(r.opacity,`${n}.material.opacity`,{min:0,max:1}),e.color(r.color,`${n}.material.color`),e.number(r.emissiveIntensity,`${n}.material.emissiveIntensity`,{min:0})}}}var Hs=`{ "fog": { "color": "#dfe8f2", "amount": 0.6 }, "light": { "follow": "pointer" }, "reveal": { "duration": 2 } }`;function Us(e,t,n,r){if(!L(t))return e.error(`type`,n,`effects must be an object.`,`Example: ${Hs}.`);e.unknownKeys(t,ja,n,`photo effects`);for(let i of ja){let a=t[i];if(a===void 0)continue;let o=`${n}.${i}`;if(!L(a)){e.error(`type`,o,`effects.${i} must be an object (use {} for the defaults).`,`Example: ${Hs}.`);continue}let s=Aa[i],c=s.params;e.unknownKeys(a,Object.keys(c),o,`the ${i} effect`);for(let[t,n]of Object.entries(c)){let r=a[t];if(r===void 0)continue;let i=`${o}.${t}`,s=n;s.type===`number`?e.number(r,i,{min:s.min,max:s.max}):s.type===`color`?e.color(r,i):s.type===`enum`?e.enumOf(r,s.options??[],i):s.type===`vec2`&&s.scalar&&typeof r==`number`?e.number(r,i,{min:s.min,max:s.max}):s.type===`vec2`&&e.vec(r,2,i)&&r.some(e=>e<(s.min??-1/0)||e>(s.max??1/0))&&e.error(`range`,i,`${JSON.stringify(r)} is out of range (each coordinate in ${s.min}..${s.max}${s.min===-1?`, photo space: -1 left / bottom, 1 right / top`:``}).`)}s.needsDepth&&!r&&e.info(`ignored`,o,`The ${i} effect needs a depth map: this photo has none, so it is ignored.`,`Set the photo's depth (agent3d assets depth <image>), or remove effects.${i}.`)}let i=t.reveal;L(i)&&i.duration!==void 0&&i.progress!==void 0&&e.info(`ignored`,`${n}.reveal.progress`,`reveal.progress is ignored when reveal.duration is set (progress animates 0 → 1 from delay).`,`Remove duration to drive progress yourself (e.g. a timeline track on effects.reveal.progress).`);let a=t.blur;L(a)&&a.to===void 0!=(a.duration===void 0)&&e.info(`ignored`,`${n}.blur.${a.to===void 0?`duration`:`to`}`,"The blur racks focus only with both `to` and `duration`: this one is ignored.",`Set both (e.g. { "focus": 0.9, "to": 0.1, "duration": 3 }) or drive effects.blur.focus from a timeline track.`),L(a)&&!r&&e.info(`flat`,`${n}.blur`,`On a photo without a depth map the blur is even over the whole image (its depth is 0.5).`,`Set the photo's depth (agent3d assets depth <image>) for a depth-of-field blur.`);let o=t.frame;L(o)&&!r&&e.info(`flat`,`${n}.frame`,`On a photo without a depth map nothing pops out of the frame (its depth is 0.5): the photo is just framed.`,`Set the photo's depth (agent3d assets depth <image>) for the out-of-frame pop-out.`)}function Ws(e,t,n,r){let i=d[t].map(e=>e.id);if(typeof n!=`string`){e.error(`type`,r,`Expected a ${Ds(t)} id string, got ${xs(n)}.`,`Valid ids: ${P(i)}.`);return}let a=v(t,n);return a||e.error(`unknown-id`,r,`Unknown ${Ds(t)} "${n}".`,`${N(n,i)}Valid ids: ${P(i)} (catalog_get section "${t}").`),a}function Gs(e,t,n){if(!L(t))return e.error(`type`,n,`geometry must be an object.`,`Example: { "type": "sphere", "radius": 0.5 }.`);if(!e.required(t,`type`,n,`a catalog geometry (${P(d.geometries.map(e=>e.id))})`))return;let r=Ws(e,`geometries`,t.type,`${n}.type`);r&&e.params(`geometries`,r,t,n,[`type`])}function Ks(e,t,n){if(t===void 0)return;if(typeof t==`string`){let r=y(t);return e.error(`type`,n,`material must be an object, got the string ${Ss(t)}.`,r?`Write { "preset": "${t}" }.`:ma(t)?`Write { "color": "${t}" }.`:`Write { "preset": "plastic", "color": "#ff8800" }.`)}if(!L(t))return e.error(`type`,n,`material must be an object.`,`Example: { "preset": "gold" } or { "color": "#ff8800", "roughness": 0.4 }.`);if(e.unknownKeys(t,ls,n,`a material`),t.preset!==void 0){let r=d.materialPresets.map(e=>e.id);typeof t.preset==`string`&&y(t.preset)||e.error(`unknown-id`,`${n}.preset`,`Unknown material preset ${Ss(t.preset)}.`,`${typeof t.preset==`string`?N(t.preset,r):``}Valid presets: ${P(r)}.`)}e.enumOf(t.type,Fo,`${n}.type`),e.color(t.color,`${n}.color`),e.color(t.emissive,`${n}.emissive`),e.number(t.emissiveIntensity,`${n}.emissiveIntensity`,{min:0});for(let r of[`metalness`,`roughness`,`opacity`,`transmission`,`clearcoat`,`iridescence`,`sheen`])e.number(t[r],`${n}.${r}`,{min:0,max:1});e.number(t.thickness,`${n}.thickness`,{min:0}),e.number(t.ior,`${n}.ior`,{min:1,max:2.333});for(let r of[`transparent`,`wireframe`,`flatShading`])e.boolean(t[r],`${n}.${r}`);e.enumOf(t.side,[`front`,`back`,`double`],`${n}.side`);for(let r of Ro)qs(e,t[r],`${n}.${r}`);e.vec(t.repeat,2,`${n}.repeat`);for(let r of[`clearcoatRoughness`,`sheenRoughness`,`anisotropy`,`specularIntensity`,`aoMapIntensity`])e.number(t[r],`${n}.${r}`,{min:0,max:1});for(let r of[`sheenColor`,`attenuationColor`,`specularColor`])e.color(t[r],`${n}.${r}`);e.number(t.anisotropyRotation,`${n}.anisotropyRotation`),e.number(t.attenuationDistance,`${n}.attenuationDistance`,{min:0,exclusiveMin:!0}),e.number(t.dispersion,`${n}.dispersion`,{min:0,max:10}),e.number(t.iridescenceIOR,`${n}.iridescenceIOR`,{min:1,max:2.333}),e.vec(t.iridescenceThicknessRange,2,`${n}.iridescenceThicknessRange`),e.number(t.envMapIntensity,`${n}.envMapIntensity`,{min:0}),e.number(t.normalScale,`${n}.normalScale`,{min:-10,max:10}),e.number(t.bumpScale,`${n}.bumpScale`,{min:-10,max:10}),e.number(t.displacementScale,`${n}.displacementScale`),t.triplanar!==void 0&&typeof t.triplanar!=`boolean`&&e.number(t.triplanar,`${n}.triplanar`,{min:0,exclusiveMin:!0}),e.boolean(t.gradientEmissive,`${n}.gradientEmissive`);let r=[`transmission`,`thickness`,`ior`,`clearcoat`,`iridescence`,`sheen`,`clearcoatRoughness`,`sheenColor`,`sheenRoughness`,`anisotropy`,`anisotropyRotation`,`attenuationColor`,`attenuationDistance`,`specularIntensity`,`specularColor`,`dispersion`,`iridescenceIOR`,`iridescenceThicknessRange`],i=t.type??(typeof t.preset==`string`?y(t.preset)?.props.type:void 0);if(i!==void 0&&i!==`physical`)for(let a of r)t[a]!==void 0&&e.warn(`ignored`,`${n}.${a}`,`"${a}" needs a physical material (type is ${Ss(i)}).`,`Set "type": "physical".`);t.gradient!==void 0&&e.colors(t.gradient,`${n}.gradient`,2),t.type===`gradient`&&t.gradient===void 0&&e.error(`required`,`${n}.gradient`,`material type "gradient" needs a "gradient" colour list.`,`Add "gradient": ["#ff7eb3", "#7afcff"].`),bs(t.opacity)&&t.opacity<1&&t.transparent!==!0&&t.transmission===void 0&&e.info(`opacity`,`${n}.opacity`,`opacity ${t.opacity} has no effect unless "transparent": true.`,`Add "transparent": true to the material.`);let a=t.type===`shader`;if(t.shader!==void 0){let r=Ws(e,`shaders`,t.shader,`${n}.shader`);a||e.warn(`ignored`,`${n}.shader`,`"shader" is only used when material.type is "shader" (type is ${Ss(t.type??`unset`)}).`,`Set "type": "shader".`),r&&t.uniforms!==void 0&&(L(t.uniforms)?e.params(`shaders`,r,t.uniforms,`${n}.uniforms`):e.error(`type`,`${n}.uniforms`,`uniforms must be an object.`))}else a?e.error(`required`,`${n}.shader`,`material type "shader" needs a "shader" id.`,`Add "shader": one of ${P(d.shaders.map(e=>e.id))}.`):t.uniforms!==void 0&&e.warn(`ignored`,`${n}.uniforms`,`uniforms are only used by shader materials.`,`Set "type": "shader" and "shader": "<id>", or remove uniforms.`)}function qs(e,t,n){if(t!==void 0){if(L(t)){if(!e.required(t,`procedural`,n,`a procedural texture id (${P(d.textures.map(e=>e.id))})`))return;let r=Ws(e,`textures`,t.procedural,`${n}.procedural`);r&&e.params(`textures`,r,t,n,[`procedural`])}else e.assetPath(t,n,qo,`a texture image`)}}function Js(e,t,n){if(t!==void 0){if(!Array.isArray(t))return e.error(`type`,n,`behaviours must be an array.`,`Example: [{ "type": "rotate", "speed": 30 }].`);t.forEach((t,r)=>{let i=`${n}[${r}]`;if(!L(t))return e.error(`type`,i,`A behaviour must be an object.`,`Example: { "type": "float", "amplitude": 0.2 }.`);if(!e.required(t,`type`,i,`a catalog behaviour (${P(d.behaviours.map(e=>e.id))})`))return;let a=Ws(e,`behaviours`,t.type,`${i}.type`);e.enumOf(t.when,Vo,`${i}.when`),e.number(t.delay,`${i}.delay`,{min:0}),a&&e.params(`behaviours`,a,t,i,[`type`,`when`,`delay`])})}}function Ys(e,t,n){if(!L(t))return e.error(`type`,n,`layout must be an object.`,'Example: { "type": "grid", "count": [5, 1, 5], "spacing": [1.2, 0, 1.2] }. See `agent3d catalog instanceLayouts`.');let r=d.instanceLayouts.map(e=>e.id);if(!e.required(t,`type`,n,P(r))||!e.enumOf(t.type,r,`${n}.type`))return;let i=v(`instanceLayouts`,t.type);switch(e.params(`instanceLayouts`,i,t,n,[`type`]),t.type){case`grid`:Array.isArray(t.count)&&t.count.length===3&&!t.count.every(e=>Number.isInteger(e)&&e>=1)&&e.error(`range`,`${n}.count`,`grid count values must be integers ≥ 1.`,`Use 1 for a flat axis, e.g. [8, 1, 8].`);break;case`scatter`:bs(t.minScale)&&bs(t.maxScale)&&t.minScale>t.maxScale&&e.warn(`range`,`${n}.minScale`,`minScale (${t.minScale}) is larger than maxScale (${t.maxScale}).`,`Swap them.`);break;case`list`:if(!Array.isArray(t.items))break;t.items.forEach((t,r)=>{let i=`${n}.items[${r}]`;if(!L(t))return e.error(`type`,i,`Expected { position?, rotation?, scale? }.`);e.unknownKeys(t,[`position`,`rotation`,`scale`],i,`a transform`),e.vec(t.position,3,`${i}.position`),e.vec(t.rotation,3,`${i}.rotation`),t.scale!==void 0&&!bs(t.scale)&&e.vec(t.scale,3,`${i}.scale`)})}}function Xs(e,t,n){let r=t.body,i=t.geometry;if(!L(r)||!Array.isArray(r.size)||r.size.length!==3||!r.size.every(bs)||!L(i))return;let a=(e,t)=>bs(e)?e:t,o=i.type===`plane`?[a(i.width,1),a(i.height,1),0]:i.type===`box`?[a(i.width,1),a(i.height,1),a(i.depth,1)]:null;if(!o)return;let s=e=>{let t=e.indexOf(Math.min(...e)),n=e.filter((e,n)=>n!==t);return e[t]<=.5*Math.min(...n)?t:-1},c=s(o),l=s(r.size);if(c<0||l<0||c===l)return;let u=[`x`,`y`,`z`],d=[...r.size];[d[c],d[l]]=[d[l],d[c]];let f=Array.isArray(t.rotation)&&t.rotation.some(e=>bs(e)&&Math.abs(e)>1);e.warn(`body-frame`,`${n}.size`,`body.size ${JSON.stringify(r.size)} is thin on ${u[l]}, but this ${i.type}'s own thin axis is ${u[c]}: the size is applied in the object's frame${f?` (before its rotation)`:``}, so the collider ${i.type===`plane`&&f?`stands up like a wall`:`does not match the mesh`}.`,`Write it in the object's frame: "size": ${JSON.stringify(d)} — or drop size to fit the geometry automatically.`)}var Zs=new Set([`true`,`false`,`null`,`undefined`]);function Qs(e,t,n){let r=/([A-Za-z_$][\w$.]*)\s*(===|!==|==|!=)\s*([A-Za-z_$][\w$.]*)/g,i=t.replace(/'[^']*'|"[^"]*"/g,e=>` `.repeat(e.length));for(let a=r.exec(i);a;a=r.exec(i)){let[,r,i,o]=a;Zs.has(o)||Zs.has(r)||o.startsWith(`state.`)||e.warn(`expr-bare-word`,n,`"${r} ${i} ${o}" compares two state values: "${o}" is read as state.${o.replace(/^state\./,``)} (probably undefined), not as the text "${o}".`,`Quote the text: ${JSON.stringify(t.replace(a[0],`${r} ${i} '${o}'`))} (or write state.${o.replace(/^state\./,``)} to compare two state keys on purpose).`)}}function $s(e,t,n){if(!L(t))return e.error(`type`,n,`body must be an object.`,`Example: { "type": "dynamic", "shape": "box", "mass": 1 }.`);e.unknownKeys(t,us,n,`a physics body`),e.required(t,`type`,n,`"static" | "dynamic" | "kinematic" | "trigger"`)&&e.enumOf(t.type,ds,`${n}.type`),e.enumOf(t.shape,fs,`${n}.shape`),e.vec(t.size,3,`${n}.size`),e.number(t.radius,`${n}.radius`,{min:0,exclusiveMin:!0}),e.number(t.height,`${n}.height`,{min:0,exclusiveMin:!0}),e.vec(t.offset,3,`${n}.offset`),e.number(t.mass,`${n}.mass`,{min:0}),e.number(t.restitution,`${n}.restitution`,{min:0,max:1}),e.number(t.friction,`${n}.friction`,{min:0}),e.string(t.material,`${n}.material`,{nonEmpty:!0}),e.vec(t.velocity,3,`${n}.velocity`),e.vec(t.angularVelocity,3,`${n}.angularVelocity`),e.number(t.linearDamping,`${n}.linearDamping`,{min:0,max:1}),e.number(t.angularDamping,`${n}.angularDamping`,{min:0,max:1}),e.number(t.gravityScale,`${n}.gravityScale`),e.boolean(t.fixedRotation,`${n}.fixedRotation`),e.boolean(t.character,`${n}.character`),e.boolean(t.sleep,`${n}.sleep`),e.boolean(t.ccd,`${n}.ccd`),e.string(t.layer,`${n}.layer`,{nonEmpty:!0}),e.stringArray(t.collidesWith,`${n}.collidesWith`),t.shapes!==void 0&&(!Array.isArray(t.shapes)||t.shapes.length===0?e.error(`type`,`${n}.shapes`,`shapes must be a non-empty array of colliders.`,`Example: [{ "shape": "box", "size": [1, 0.2, 1] }, { "shape": "sphere", "radius": 0.3, "offset": [0, 0.5, 0] }].`):t.shapes.forEach((t,r)=>{let i=`${n}.shapes[${r}]`;if(!L(t))return e.error(`type`,i,`A collider must be an object.`,`Example: { "shape": "box", "size": [1, 1, 1], "offset": [0, 0.5, 0] }.`);e.unknownKeys(t,[`shape`,`size`,`radius`,`height`,`offset`,`rotation`],i,`a collider`),e.required(t,`shape`,i,P(ps))&&e.enumOf(t.shape,ps,`${i}.shape`),e.vec(t.size,3,`${i}.size`),e.number(t.radius,`${i}.radius`,{min:0,exclusiveMin:!0}),e.number(t.height,`${i}.height`,{min:0,exclusiveMin:!0}),e.vec(t.offset,3,`${i}.offset`),e.vec(t.rotation,3,`${i}.rotation`)}),t.shape!==void 0&&t.shape!==`compound`&&e.warn(`ignored`,`${n}.shapes`,`shapes is only used with shape "compound" (shape is ${Ss(t.shape)}).`,`Set "shape": "compound" or remove "shapes".`)),t.shape===`compound`&&t.shapes===void 0&&e.error(`required`,`${n}.shapes`,`shape "compound" needs a "shapes" array.`,`Example: "shapes": [{ "shape": "box", "size": [1, 0.2, 1] }, { "shape": "sphere", "radius": 0.3, "offset": [0, 0.5, 0] }].`),(t.shape===`trimesh`||t.shape===`heightfield`)&&t.type===`dynamic`&&e.error(`invalid`,`${n}.shape`,`shape "${t.shape}" only works for static (or kinematic) bodies.`,`Use "convex" (hull of the mesh) or "box" / "compound" for dynamic bodies.`),t.mass!==void 0&&t.type!==void 0&&t.type!==`dynamic`&&e.info(`ignored`,`${n}.mass`,`mass is ignored on ${Ss(t.type)} bodies (they have infinite mass).`)}function ec(e,t,n,r){if(!L(t))return e.error(`type`,n,`A joint must be an object.`,`Example: { "type": "hinge", "a": "door", "pivot": [1, 1, 0], "axis": [0, 1, 0] }.`);e.unknownKeys(t,gs,n,`a joint`),e.required(t,`type`,n,P(ms))&&e.enumOf(t.type,ms,`${n}.type`),e.string(t.id,`${n}.id`,{nonEmpty:!0});let i=i=>{let a=t[i];if(a!==void 0){if(typeof a!=`string`)return e.error(`type`,`${n}.${i}`,`${i} must be an object id.`);if(!e.objectIds.has(a))return e.error(`unknown-ref`,`${n}.${i}`,`Joint ${i} "${a}" is not an object id.`,`${N(a,e.objectIds)}Object ids: ${P([...e.objectIds])}.`);if(!r.has(a))return e.error(`invalid`,`${n}.${i}`,`Object "${a}" has no body: joints connect physics bodies.`,`Add "body": { "type": "dynamic" } to "${a}".`)}};e.required(t,`a`,n,`the id of an object with a body`)&&i(`a`),i(`b`),typeof t.a==`string`&&t.a===t.b&&e.error(`invalid`,`${n}.b`,`A joint needs two different bodies.`,`Omit b to anchor the body to the world.`);let a=typeof t.a==`string`?r.get(t.a)?.type:void 0,o=typeof t.b==`string`?r.get(t.b)?.type:void 0;if(a&&a!==`dynamic`&&(t.b===void 0||o&&o!==`dynamic`)&&e.warn(`no-dynamic`,n,`This joint connects no dynamic body: it will have no visible effect.`,`Make "a" (or "b") a dynamic body.`),e.vec(t.pivot,3,`${n}.pivot`),e.vec(t.axis,3,`${n}.axis`),Array.isArray(t.axis)&&t.axis.every(bs)&&t.axis.every(e=>e===0)&&e.error(`range`,`${n}.axis`,`axis must not be [0, 0, 0].`,`Example: [0, 1, 0] (vertical hinge, a door) or [0, 0, 1] (a pendulum swinging in the XY plane).`),e.number(t.distance,`${n}.distance`,{min:0}),e.number(t.restLength,`${n}.restLength`,{min:0}),e.number(t.stiffness,`${n}.stiffness`,{min:0}),e.number(t.damping,`${n}.damping`,{min:0}),e.number(t.maxForce,`${n}.maxForce`,{min:0,exclusiveMin:!0}),e.boolean(t.collideConnected,`${n}.collideConnected`),t.motor!==void 0&&(L(t.motor)?(e.unknownKeys(t.motor,[`speed`,`maxForce`],`${n}.motor`,`a motor`),e.required(t.motor,`speed`,`${n}.motor`,`degrees / s`)&&e.number(t.motor.speed,`${n}.motor.speed`),e.number(t.motor.maxForce,`${n}.motor.maxForce`,{min:0,exclusiveMin:!0})):e.error(`type`,`${n}.motor`,`motor must be an object.`,`Example: { "speed": 90, "maxForce": 50 } (degrees / s).`),t.type!==`hinge`&&e.warn(`ignored`,`${n}.motor`,`motor only drives hinge joints (this one is ${Ss(t.type)}).`)),t.limits!==void 0){let r=t.limits;!Array.isArray(r)||r.length!==2||!r.every(bs)?e.error(`type`,`${n}.limits`,`limits must be [minDegrees, maxDegrees].`,`Example: [0, 110] (a door opening one way) or [-45, 45] (a flipper).`):r[0]>r[1]?e.error(`range`,`${n}.limits`,`limits min (${r[0]}) is greater than max (${r[1]}).`,`Write [${r[1]}, ${r[0]}].`):(r[0]<-360||r[1]>360)&&e.error(`range`,`${n}.limits`,`limits must stay within -360 … 360 degrees.`,`Angles are relative to the start pose, e.g. [-90, 90].`)}for(let[r,i]of Object.entries({distance:[`distance`],restLength:[`spring`],stiffness:[`spring`],damping:[`spring`],axis:[`hinge`],limits:[`hinge`]}))t[r]!==void 0&&typeof t.type==`string`&&!i.includes(t.type)&&e.warn(`ignored`,`${n}.${r}`,`${r} is ignored on ${Ss(t.type)} joints (used by ${i.join(`, `)}).`)}var tc=[`rise`,`fade`,`scale`,`spin`,`drop`];function nc(e,t,n){if(e.boolean(t.kerning,`${n}.kerning`),e.number(t.maxWidth,`${n}.maxWidth`,{min:0,exclusiveMin:!0}),e.number(t.curveSegments,`${n}.curveSegments`,{integer:!0,min:1,max:32}),e.boolean(t.splitLetters,`${n}.splitLetters`),t.outline!==void 0&&typeof t.outline!=`boolean`){if(!L(t.outline))e.error(`type`,`${n}.outline`,`outline must be true or an object.`,`Example: { "width": 0.06, "color": "#1a1033" }.`);else{let r=t.outline;e.unknownKeys(r,[`width`,`color`,`depth`,`material`],`${n}.outline`,`outline`),e.number(r.width,`${n}.outline.width`,{min:0,exclusiveMin:!0}),e.color(r.color,`${n}.outline.color`),e.number(r.depth,`${n}.outline.depth`,{min:0,exclusiveMin:!0}),Ks(e,r.material,`${n}.outline.material`)}}if(t.reveal!==void 0){if(!L(t.reveal))e.error(`type`,`${n}.reveal`,`reveal must be an object.`,`Example: { "effect": "rise", "stagger": 0.04, "duration": 0.6 }.`);else{let r=t.reveal;if(e.unknownKeys(r,[`effect`,`stagger`,`duration`,`delay`,`ease`,`order`],`${n}.reveal`,`reveal`),e.enumOf(r.effect,tc,`${n}.reveal.effect`),e.number(r.stagger,`${n}.reveal.stagger`,{min:0}),e.number(r.duration,`${n}.reveal.duration`,{min:0,exclusiveMin:!0}),e.number(r.delay,`${n}.reveal.delay`,{min:0}),e.enumOf(r.order,[`forward`,`reverse`,`center`,`random`],`${n}.reveal.order`),r.ease!==void 0){let t=typeof r.ease==`string`?wa(r.ease):{error:`ease must be a string.`};`error`in t&&e.error(`enum`,`${n}.reveal.ease`,`Invalid easing ${Ss(r.ease)}: ${t.error}`,`Examples: ${ba.join(`, `)}.`)}}}(t.splitLetters===!0||L(t.reveal))&&typeof t.id==`string`&&(e.letterTexts.add(t.id),typeof t.text==`string`&&!/\{data\./.test(t.text)&&e.letterCounts.set(t.id,Array.from(t.text).filter(e=>e.trim()).length))}function rc(e,t){if(!Array.isArray(t))return e.error(`type`,`postfx`,`postfx must be an array.`,`Example: [{ "type": "bloom", "strength": 0.8 }].`);let n=new Set;t.forEach((t,r)=>{let i=`postfx[${r}]`;if(!L(t))return e.error(`type`,i,`A post effect must be an object.`);if(!e.required(t,`type`,i,`a catalog post effect (${P(d.postfx.map(e=>e.id))})`))return;let a=Ws(e,`postfx`,t.type,`${i}.type`);typeof t.type==`string`&&(n.has(t.type)&&e.warn(`duplicate`,`${i}.type`,`Post effect "${t.type}" appears twice.`,`Keep a single entry.`),n.add(t.type)),a&&e.params(`postfx`,a,t,i,[`type`]),t.type===`dof`&&typeof t.focusOn==`string`&&!e.objectIds.has(t.focusOn)&&e.error(`unknown-ref`,`${i}.focusOn`,`dof.focusOn "${t.focusOn}" is not an object id.`,`${N(t.focusOn,e.objectIds)}Object ids: ${P([...e.objectIds])}.`),t.type===`godrays`&&typeof t.source==`string`&&t.source!==`auto`&&t.source!==`sun`&&!e.lightIds.has(t.source)&&e.error(`unknown-ref`,`${i}.source`,`godrays.source "${t.source}" is not "auto", "sun" or a light id.`,`${N(t.source,e.lightIds)}Light ids: ${P([...e.lightIds])}.`)});let r=t.map(e=>L(e)?e.type:void 0);r.includes(`fxaa`)&&r.includes(`smaa`)&&e.warn(`duplicate`,`postfx`,`Both fxaa and smaa are set: they do the same job.`,`Keep smaa (sharper) or fxaa (cheaper).`)}function ic(e,t){if(!L(t))return e.error(`type`,`physics`,`physics must be an object.`,`Example: { "gravity": [0, -9.81, 0] }.`);e.unknownKeys(t,hs,`physics`,`physics`),e.vec(t.gravity,3,`physics.gravity`),e.number(t.step,`physics.step`,{min:0,exclusiveMin:!0,max:.1}),e.number(t.substeps,`physics.substeps`,{min:1,max:8,integer:!0}),e.number(t.iterations,`physics.iterations`,{min:1,max:100,integer:!0}),e.boolean(t.sleep,`physics.sleep`),e.boolean(t.debug,`physics.debug`);let n=_s.get(e)??[],r=new Map(n.map(e=>[e.id,e.body])),i=new Set;if(t.materials!==void 0){if(!L(t.materials))e.error(`type`,`physics.materials`,`materials must be an object { name: { friction, restitution } }.`,`Example: { "ice": { "friction": 0.02 }, "rubber": { "friction": 0.9, "restitution": 0.8 } }.`);else for(let[n,r]of Object.entries(t.materials)){let t=`physics.materials.${n}`;i.add(n),L(r)?(e.unknownKeys(r,[`friction`,`restitution`],t,`a physics material`),e.number(r.friction,`${t}.friction`,{min:0}),e.number(r.restitution,`${t}.restitution`,{min:0,max:1})):e.error(`type`,t,`A physics material must be an object.`,`Example: { "friction": 0.4, "restitution": 0.2 }.`)}}t.contacts!==void 0&&(Array.isArray(t.contacts)?t.contacts.forEach((t,n)=>{let r=`physics.contacts[${n}]`;if(!L(t))return e.error(`type`,r,`A contact must be an object.`,`Example: { "a": "ice", "b": "rubber", "friction": 0.05, "restitution": 0 }.`);e.unknownKeys(t,[`a`,`b`,`friction`,`restitution`],r,`a contact material`);for(let n of[`a`,`b`])e.required(t,n,r,`a physics.materials name`)&&(typeof t[n]==`string`&&i.has(t[n])||e.error(`unknown-ref`,`${r}.${n}`,`Unknown physics material ${Ss(t[n])}.`,i.size?`${N(String(t[n]),i)}Materials: ${P([...i])}.`:`Declare it in physics.materials first, e.g. "materials": { "ice": { "friction": 0.02 } }.`));e.number(t.friction,`${r}.friction`,{min:0}),e.number(t.restitution,`${r}.restitution`,{min:0,max:1})}):e.error(`type`,`physics.contacts`,`contacts must be an array.`,`Example: [{ "a": "ice", "b": "rubber", "friction": 0.05 }].`)),t.layers!==void 0&&e.stringArray(t.layers,`physics.layers`)&&Array.isArray(t.layers)&&new Set([`default`,...t.layers]).size>16&&e.error(`range`,`physics.layers`,`At most 16 collision layers (including "default").`);let a=new Set([`default`,...Array.isArray(t.layers)?t.layers.filter(e=>typeof e==`string`):[]]);for(let t of n)typeof t.body.material==`string`&&!i.has(t.body.material)&&e.error(`unknown-ref`,`${t.path}.material`,`Unknown physics material "${t.body.material}".`,i.size?`${N(t.body.material,i)}Materials: ${P([...i])}.`:`Declare it in physics.materials, e.g. "materials": { "ice": { "friction": 0.02 } }.`),typeof t.body.layer==`string`&&a.add(t.body.layer);a.size>16&&e.error(`range`,`physics.layers`,`Too many collision layers (${a.size}, max 16).`,`Reuse layer names: a layer is a group like "player", "enemy", "debris".`);for(let t of n)Array.isArray(t.body.collidesWith)&&t.body.collidesWith.forEach((n,r)=>{typeof n==`string`&&!a.has(n)&&e.warn(`unknown-ref`,`${t.path}.collidesWith[${r}]`,`Layer "${n}" is not used by any body.`,`${N(n,a)}Layers: ${P([...a])}.`)});t.joints!==void 0&&(Array.isArray(t.joints)?t.joints.forEach((t,n)=>ec(e,t,`physics.joints[${n}]`,r)):e.error(`type`,`physics.joints`,`joints must be an array.`,`Example: [{ "type": "hinge", "a": "door", "pivot": [1, 1, 0], "axis": [0, 1, 0] }].`))}function ac(e,t){if(!Array.isArray(t))return e.error(`type`,`scripts`,`scripts must be an array of paths.`,`Example: ["scripts/game.js"].`);let n=new Set;t.forEach((t,r)=>{let i=`scripts[${r}]`;if(typeof t!=`string`)return e.error(`type`,i,`A script entry must be a path string.`,`Example: "scripts/game.js".`);if(!/^scripts\/[A-Za-z0-9_\-./]+\.(m?js)$/.test(t)||t.split(`/`).includes(`..`))return e.error(`script-path`,i,`Invalid script path "${t}".`,`Scripts live under scripts/ and end with .js or .mjs, e.g. "scripts/game.js".`);n.has(t)&&e.warn(`duplicate`,i,`Script "${t}" is listed twice (it would run twice).`,`Remove the duplicate.`),n.add(t)})}function oc(e,t){if(!L(t))return e.error(`type`,`ui`,`ui must be an object.`,`Example: { "elements": [{ "id": "score", "type": "text", "text": "Score: {score}", "anchor": "top-left" }] }.`);if(e.unknownKeys(t,[`elements`,`font`,`color`,`accent`,`buttonText`],`ui`,`ui`),e.string(t.font,`ui.font`),typeof t.font==`string`&&/url\(|@import|https?:/i.test(t.font)&&e.error(`forbidden`,`ui.font`,`ui.font must be a CSS font-family list (no web fonts).`,`Use a system stack, e.g. "system-ui, sans-serif".`),e.color(t.color,`ui.color`),e.color(t.accent,`ui.accent`),e.color(t.buttonText,`ui.buttonText`),!e.required(t,`elements`,`ui`,`an array of HUD elements`))return;if(!Array.isArray(t.elements))return e.error(`type`,`ui.elements`,`elements must be an array.`);let n=new Set;t.elements.forEach((t,r)=>{let i=`ui.elements[${r}]`;if(!L(t))return e.error(`type`,i,`A UI element must be an object.`);ea(t.id)&&(i=`ui.elements#${t.id}`),e.declareId(t.id,`${i}.id`,`ui`)&&(n.has(t.id)&&e.error(`duplicate-id`,`${i}.id`,`Duplicate UI element id "${String(t.id)}".`,`Give each HUD element a unique id.`),n.add(t.id)),e.unknownKeys(t,vs,i,`a UI element`),e.required(t,`type`,i,`"text" | "button" | "bar"`)&&e.enumOf(t.type,[`text`,`button`,`bar`],`${i}.type`),e.string(t.text,`${i}.text`),e.enumOf(t.anchor,Bo,`${i}.anchor`),e.enumOf(t.style,[`plain`,`pill`,`title`,`subtitle`,`panel`],`${i}.style`),e.color(t.color,`${i}.color`),e.color(t.background,`${i}.background`),e.string(t.value,`${i}.value`),e.string(t.action,`${i}.action`),t.visible!==void 0&&typeof t.visible!=`boolean`&&typeof t.visible!=`string`&&e.error(`type`,`${i}.visible`,`visible must be a boolean or a state expression string.`),typeof t.visible==`string`&&Qs(e,t.visible,`${i}.visible`),t.type===`bar`&&t.value===void 0&&e.error(`required`,`${i}.value`,`A "bar" needs "value": the state key holding 0..1.`,`Add "value": "health" and set api.state.health in a script.`),t.type===`button`&&t.action===void 0&&e.error(`required`,`${i}.action`,`A "button" needs "action": the event name sent to scripts.`,`Add "action": "start" and handle it with api.on("start", …).`),(t.type===`text`||t.type===`button`)&&t.text===void 0&&e.warn(`required`,`${i}.text`,`A "${String(t.type)}" element without text shows nothing.`,`Add "text", e.g. "Score: {score}".`)})}function sc(e,t){if(!L(t))return e.error(`type`,`audio`,`audio must be an object.`,`Example: { "sounds": { "coin": { "preset": "coin" } } }.`);e.unknownKeys(t,[`sounds`,`music`,`muted`],`audio`,`audio`),e.boolean(t.muted,`audio.muted`);let n=d.sounds.map(e=>e.id),r=(t,r,i)=>{if(!L(t))return e.error(`type`,r,`Expected { "preset": "coin" } or { "src": "assets/audio/x.mp3" }.`);if(e.unknownKeys(t,i?[`src`,`preset`,`volume`,`loop`]:[`src`,`preset`,`volume`],r,i?`music`:`a sound`),t.preset===void 0&&t.src===void 0)return e.error(`required`,r,`Needs "preset" (synth) or "src" (audio file).`,`Synth presets: ${P(n)}.`);t.preset!==void 0&&t.src!==void 0&&e.warn(`ambiguous`,r,`Both "preset" and "src" are set; "src" wins.`,`Keep only one.`),t.preset!==void 0&&Ws(e,`sounds`,t.preset,`${r}.preset`),t.src!==void 0&&e.assetPath(t.src,`${r}.src`,Jo,`an audio file`),e.number(t.volume,`${r}.volume`,{min:0,max:1}),i&&e.boolean(t.loop,`${r}.loop`)};if(t.sounds!==void 0){if(!L(t.sounds))e.error(`type`,`audio.sounds`,`sounds must be an object keyed by sound name.`);else for(let[e,n]of Object.entries(t.sounds))r(n,`audio.sounds.${e}`,!1)}t.music!==void 0&&r(t.music,`audio.music`,!0)}function cc(e){if(!L(e))return e;let t=JSON.parse(JSON.stringify(e));return t.version===void 0&&(t.version=1),t.lights===void 0&&(t.lights=[]),t.objects===void 0&&(t.objects=[]),L(t.timeline)&&t.timeline.tracks===void 0&&(t.timeline.tracks=[]),L(t.ui)&&t.ui.elements===void 0&&(t.ui.elements=[]),t}var lc=(e=1)=>[{id:`fill`,type:`hemisphere`,skyColor:`#e8ecff`,groundColor:`#3a2f5c`,intensity:.6*e},{id:`key`,type:`directional`,position:[4,6,6],intensity:1.6*e,castShadow:!0},{id:`rim`,type:`point`,position:[-5,2,-3],color:`#7cc8ff`,intensity:18*e,distance:20}],uc=1,dc=1.5;function fc(e,t,n={}){return{id:`title`,kind:`text`,text:e,font:`sans-bold`,size:t,depth:t*.3,bevel:t*.03,material:{preset:`plastic`,color:`#ebe3f7`,roughness:.4},behaviours:[{type:`appear`,effect:`rise`,duration:uc},{type:`float`,amplitude:.08,speed:.4}],...n}}var pc=(e,t,n,r,i={},a=0)=>({id:e,kind:`mesh`,geometry:{type:t,...i},material:{preset:`plastic`,color:r},position:n,rotation:[20,30,0],behaviours:[{type:`float`,amplitude:.2,speed:.3,phase:a},{type:`rotate`,axis:[.3,1,.2],speed:18}]});function mc(e){return{camera:{type:`perspective`,fov:30,position:[0,0,12],target:[0,0,0],controls:`parallax`,parallax:{strength:.4,smoothing:.92}},environment:{background:{gradient:[`#1b1446`,`#4a2a8f`,`#ff7ab6`],angle:20},lighting:`studio`,lightingIntensity:.6},lights:lc(),objects:[fc(e,.8),pc(`torus`,`torus`,[-7.6,.5,-1.5],`#ff9ccf`,{radius:.6,tube:.22}),pc(`gem`,`icosahedron`,[7.8,-.5,-1],`#7cc8ff`,{radius:.7,detail:0},.4),pc(`pill`,`capsule`,[5.9,1.6,-2.5],`#ffd36e`,{radius:.25,length:.5},.7),pc(`block`,`roundedBox`,[-5.8,-1.6,-2.5],`#b9a2ff`,{width:.6,height:.6,depth:.6,radius:.1},.2),{id:`dust`,kind:`particles`,preset:`dust`,count:120,area:[26,7,6],size:.05,color:`#ffffff`,opacity:.6}],postfx:[{type:`bloom`,strength:.25,radius:.5,threshold:1.5}]}}function hc(e){return{camera:{type:`perspective`,fov:35,position:[0,.3,10],target:[0,0,0],controls:`parallax`,parallax:{strength:.5}},environment:{background:{radial:[`#2b1f63`,`#0c0a1f`]},lighting:`studio`,lightingIntensity:.6},lights:lc(.8),objects:[{id:`blob`,kind:`generator`,generator:`blob`,params:{radius:1.4,noise:.3,speed:.35},position:[0,-1.05,-1.5]},fc(e,.7,{position:[0,1.75,.5]}),{id:`sparkles`,kind:`particles`,preset:`dust`,count:160,area:[16,9,6],size:.05,color:`#cfc6ff`,opacity:.7}],postfx:[{type:`bloom`,strength:.25,radius:.5,threshold:1.5},{type:`vignette`,darkness:.9}]}}function gc(e){return{camera:{type:`perspective`,fov:35,position:[0,1.2,7],target:[0,.4,0]},environment:{background:{gradient:[`#fdf2e9`,`#f6c6c6`],angle:0},lighting:`soft`,ground:{y:-1,shadowOnly:!0}},lights:lc(),objects:[{id:`pedestal`,kind:`mesh`,geometry:{type:`cylinder`,radiusTop:1.2,radiusBottom:1.3,height:.4,segments:64},material:{preset:`clay`,color:`#fff4ea`},position:[0,-.8,0],receiveShadow:!0,castShadow:!0},{id:`knot`,kind:`mesh`,geometry:{type:`torusKnot`,radius:.55,tube:.18},material:{preset:`pearl`,color:`#ff9fb8`},position:[0,.45,0],castShadow:!0,behaviours:[{type:`rotate`,speed:25},{type:`float`,amplitude:.1,speed:.4},{type:`hoverScale`,scale:1.1}]},fc(e,.24,{position:[0,1.75,0],material:{preset:`matte`,color:`#5a3e5d`}})]}}function _c(e){return{camera:{type:`perspective`,fov:35,position:[0,.4,7],target:[0,0,0],controls:`orbit`,orbitZoom:!1},environment:{background:{radial:[`#3a1c71`,`#0f0c29`]},lighting:`studio`,lightingIntensity:.6},lights:lc(.8),objects:[{id:`gem`,kind:`mesh`,geometry:{type:`icosahedron`,radius:1,detail:0},material:{preset:`holographic`},position:[0,.5,0],behaviours:[{type:`rotate`,axis:[.2,1,0],speed:20},{type:`float`,amplitude:.12,speed:.4}]},fc(e,.28,{position:[0,-1.25,.5]}),{id:`stars`,kind:`particles`,preset:`stars`,count:200,area:[12,12,8],size:.04}],postfx:[{type:`bloom`,strength:.35,radius:.4,threshold:1.5}]}}function vc(e){return{camera:{type:`perspective`,fov:45,position:[0,9,26],target:[0,1,0],controls:`orbit`,autoRotate:4,orbitLimits:{minDistance:10,maxDistance:45,maxPolar:85}},environment:{background:{sky:{top:`#3d7dd8`,horizon:`#f7d9b0`,sun:{direction:[.6,.35,.4]}}},lighting:`sunset`,fog:{color:`#f2dcc0`,near:30,far:90}},lights:[{id:`sky`,type:`hemisphere`,skyColor:`#cfe6ff`,groundColor:`#6b5a3a`,intensity:.9},{id:`sun`,type:`directional`,position:[20,18,12],color:`#ffe2b8`,intensity:2.5,castShadow:!0}],objects:[{id:`terrain`,kind:`generator`,generator:`terrain`,params:{size:60,height:7,shape:`island`,waterLevel:.8},seed:7,receiveShadow:!0},{id:`trees`,kind:`generator`,generator:`trees`,params:{count:60,area:[40,0,40],style:`mixed`},seed:3,castShadow:!0},{id:`clouds`,kind:`generator`,generator:`clouds`,params:{count:7,height:14}},fc(e,1.1,{position:[0,8.8,10],material:{preset:`plastic`,color:`#25406b`,roughness:.4},behaviours:[{type:`appear`,effect:`rise`,duration:uc},{type:`billboard`},{type:`float`,amplitude:.15,speed:.3}]})]}}function yc(e){return{camera:{type:`perspective`,fov:50,position:[0,6,9],target:[0,0,0],controls:`follow`,follow:{target:`player`,offset:[0,6,9],smoothing:.9}},environment:{background:{gradient:[`#8ec5fc`,`#e0c3fc`],angle:0},lighting:`soft`},lights:[{id:`fill`,type:`hemisphere`,skyColor:`#ffffff`,groundColor:`#8a7fb0`,intensity:1},{id:`sun`,type:`directional`,position:[6,10,4],intensity:2,castShadow:!0}],objects:[{id:`floor`,kind:`mesh`,geometry:{type:`box`,width:20,height:.5,depth:20},material:{preset:`matte`,color:`#b8e0a8`},position:[0,-.25,0],receiveShadow:!0,body:{type:`static`}},{id:`player`,kind:`mesh`,geometry:{type:`roundedBox`,width:.8,height:.8,depth:.8,radius:.15},material:{preset:`plastic`,color:`#ff6b6b`},position:[0,.4,0],castShadow:!0,body:{type:`kinematic`},tags:[`player`]},{id:`coins`,kind:`group`,children:[-4,-1.5,2,4.5].map((e,t)=>({id:`coin-${t+1}`,kind:`mesh`,geometry:{type:`cylinder`,radiusTop:.3,radiusBottom:.3,height:.08},material:{preset:`gold`},position:[e,.6,t%2?-3:3],rotation:[90,0,0],tags:[`coin`],body:{type:`trigger`},behaviours:[{type:`rotate`,axis:[0,0,1],speed:120}]}))},fc(e,.6,{position:[0,3,-6],material:{preset:`plastic`,color:`#5b3fd1`,roughness:.35},behaviours:[{type:`float`,amplitude:.1,speed:.4}]})],scripts:[`scripts/game.js`],ui:{elements:[{id:`score`,type:`text`,text:`Coins: {score}`,anchor:`top-left`,style:`pill`}],color:`#2b2340`},physics:{gravity:[0,-9.81,0]},audio:{sounds:{coin:{preset:`coin`}}}}}var bc=`// Move the player with the arrow keys / WASD, or swipe on a phone (the
|
|
11
11
|
// player keeps going that way; tap to stop); collect the coins.
|
|
12
12
|
// Scripts only get \`api\` (see ScriptApi in the Agent3D docs).
|
|
13
13
|
export default function (api) {
|
|
@@ -474,6 +474,6 @@ Rules:
|
|
|
474
474
|
- Run check before suggesting an export.
|
|
475
475
|
- Be concise: say what you changed in one or two sentences.`,uv=`agent3d.studio.anthropicKey`,dv=`agent3d.studio.model`,fv=e=>{try{return localStorage.getItem(e)??``}catch{return``}},pv=(e,t)=>{try{t===null?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}},mv=new Map,hv=0,gv=()=>`i${Date.now().toString(36)}${(hv++).toString(36)}`;function _v(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}function vv(e){if(!e||typeof e!=`object`)return;let t=e;if(t.plan?.summary)return`${t.status??``} · ${t.plan.summary}`;if(t.status)return t.status}function yv(e,t){if(e===`scene_patch`&&Array.isArray(t.ops))return t.ops.map(e=>`${e.op} ${e.path??e.id??``}`.trim()).slice(0,3).join(`, `)+(t.ops.length>3?`…`:``);if(e===`catalog_get`)return[t.section,t.id].filter(Boolean).join(` / `);if(e===`object_update`||e===`object_remove`)return String(t.id??``);if(e===`object_add`)return String(t.object?.id??``);let n=JSON.stringify(t);return n===`{}`?``:n.slice(0,80)}function bv({text:e}){let t=(e,t)=>e.split(/(`[^`]+`|\*\*[^*]+\*\*)/g).map((e,n)=>e.startsWith("`")&&e.endsWith("`")?(0,G.jsx)(`code`,{className:`rounded bg-ink-3 px-1 font-mono text-2xs`,children:e.slice(1,-1)},`${t}${n}`):e.startsWith(`**`)&&e.endsWith(`**`)?(0,G.jsx)(`strong`,{children:e.slice(2,-2)},`${t}${n}`):e);return(0,G.jsx)(`div`,{className:`space-y-1.5`,children:e.split(/\n{2,}/).map((e,n)=>/^\s*[-*] /.test(e)?(0,G.jsx)(`ul`,{className:`list-disc space-y-0.5 pl-4`,children:e.split(`
|
|
476
476
|
`).map((e,r)=>(0,G.jsx)(`li`,{children:t(e.replace(/^\s*[-*] /,``),`${n}-${r}-`)},r))},n):(0,G.jsx)(`p`,{className:`whitespace-pre-wrap`,children:t(e,`${n}-`)},n))})}function xv(){let{t:e}=U(),{backend:t,store:n,tools:r,reloadScene:i,ui:a}=Q(),o=t.location??`default`,[s,c]=(0,O.useState)(()=>mv.get(o)??{messages:[],items:[]}),[l,u]=(0,O.useState)(()=>fv(uv)),[d,f]=(0,O.useState)(()=>fv(dv)||`claude-sonnet-5-5`),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(``),[_,v]=(0,O.useState)(!1),y=(0,O.useRef)(null),b=(0,O.useRef)(null),x=(0,O.useRef)(s);x.current=s,(0,O.useEffect)(()=>{mv.set(o,s)},[s,o]),(0,O.useEffect)(()=>{b.current?.scrollIntoView({block:`end`})},[s.items.length]),(0,O.useEffect)(()=>()=>y.current?.abort(),[]);let S=e=>c(t=>({...t,items:e(t.items)})),C=(e,t)=>S(n=>n.map(n=>n.kind===`tool`&&n.id===e?{...n,...t}:n)),w=async()=>{let a=h.trim();if(!a||_||!l)return;g(``),v(!0);let o=new AbortController;y.current=o;let s=n.getSnapshot().selection,u=`[Studio] Project: ${t.projectTitle()}.${s?` Selected object: "${s}".`:` Nothing selected.`}`,f=[...x.current.messages,{role:`user`,content:[{type:`text`,text:u},{type:`text`,text:a}]}];c(e=>({messages:f,items:[...e.items,{kind:`user`,id:gv(),text:a}]})),await n.flush();let p=new Set(r.filter(e=>e.mutating).map(e=>e.name)),m=new Map,b=``,w=await cv({apiKey:l,model:d,system:lv,messages:f,tools:r,signal:o.signal,callTool:async(e,r)=>{let a=b;if(p.has(e)){await n.flush();let e=n.getSnapshot().scene;e&&m.set(a,e)}let o=await t.call(e,r);return p.has(e)&&await i({toast:!1}).catch(()=>void 0),o},readImage:async e=>_v(await t.readFile(e)),onEvent:n=>{n.type===`text`?S(e=>[...e,{kind:`assistant`,id:gv(),text:n.text}]):n.type===`tool_start`?(b=n.id,S(e=>[...e,{kind:`tool`,id:n.id,name:n.name,input:n.input,status:`running`,mutating:p.has(n.name)}])):n.type===`tool_end`?(async()=>{let e=n.image?await t.fileUrl(n.image).catch(()=>void 0):void 0;C(n.id,{status:n.error?`error`:`done`,error:n.error,summary:vv(n.result),image:e,before:m.get(n.id)})})():n.type===`refusal`&&S(t=>[...t,{kind:`notice`,id:gv(),text:n.explanation??e(`assistant.refused`),tone:`error`}])}});y.current=null,v(!1),c(t=>({messages:w.messages,items:[...t.items,...w.status===`error`?[{kind:`notice`,id:gv(),text:w.error??`Error`,tone:`error`}]:[],...w.status===`aborted`?[{kind:`notice`,id:gv(),text:e(`assistant.stopped`)}]:[],...w.status===`max_iterations`?[{kind:`notice`,id:gv(),text:e(`assistant.maxIterations`)}]:[]]}))},T=!!l;return(0,G.jsxs)(`aside`,{className:`flex w-[360px] shrink-0 flex-col border-l border-line bg-ink-1`,"aria-label":e(`assistant.title`),children:[(0,G.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center gap-1.5 border-b border-line pl-3 pr-1.5`,children:[(0,G.jsx)(Se,{size:15,className:`text-agent`}),(0,G.jsx)(`span`,{className:`text-sm font-semibold`,children:e(`assistant.title`)}),(0,G.jsx)(`select`,{value:d,onChange:e=>(f(e.target.value),pv(dv,e.target.value)),"aria-label":e(`assistant.model`),className:`ml-1 h-6 rounded bg-transparent px-1 text-2xs text-fg-muted outline-none hover:bg-ink-3`,children:nv.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),(0,G.jsxs)(`div`,{className:`ml-auto flex`,children:[(0,G.jsx)(Y,{label:e(`assistant.newChat`),disabled:_,onClick:()=>c({messages:[],items:[]}),children:(0,G.jsx)(Gr,{size:14})}),(0,G.jsx)(Y,{label:e(`assistant.settings`),active:p,onClick:()=>m(e=>!e),children:(0,G.jsx)(kr,{size:14})}),(0,G.jsx)(Y,{label:e(`assistant.close`),onClick:()=>a.set({assistant:!1}),children:(0,G.jsx)(Fi,{size:14})})]})]}),(!T||p)&&(0,G.jsx)(Sv,{apiKey:l,onSave:e=>(u(e),pv(uv,e||null),m(!1))}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2.5 overflow-auto px-3 py-3 text-sm`,children:[!s.items.length&&T&&(0,G.jsxs)(`div`,{className:`space-y-2 pt-4 text-center`,children:[(0,G.jsx)(`div`,{className:`text-sm text-fg-muted`,children:e(`assistant.emptyTitle`)}),(0,G.jsx)(`div`,{className:`flex flex-col gap-1`,children:[e(`assistant.example1`),e(`assistant.example2`),e(`assistant.example3`)].map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>g(e),className:`rounded-md border border-line px-2.5 py-1.5 text-left text-xs text-fg-muted hover:border-fg-faint hover:text-fg`,children:e},e))})]}),s.items.map(t=>t.kind===`user`?(0,G.jsx)(`div`,{className:`ml-8 rounded-lg bg-accent/15 px-3 py-2 text-fg`,children:t.text},t.id):t.kind===`assistant`?(0,G.jsx)(`div`,{className:`leading-relaxed text-fg`,children:(0,G.jsx)(bv,{text:t.text})},t.id):t.kind===`notice`?(0,G.jsx)(`div`,{className:W(`rounded-md px-2.5 py-1.5 text-xs`,t.tone===`error`?`bg-danger/10 text-danger`:`bg-ink-2 text-fg-muted`),children:t.text},t.id):(0,G.jsxs)(`div`,{className:W(`rounded-md border bg-ink-0/40`,t.mutating&&t.status===`done`?`border-agent/30`:`border-line`),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2.5 py-1.5`,children:[t.status===`running`?(0,G.jsx)(Nn,{size:12,className:`animate-spin text-fg-muted`}):t.status===`error`?(0,G.jsx)(Ke,{size:12,className:`text-danger`}):t.status===`undone`?(0,G.jsx)(yr,{size:12,className:`text-fg-faint`}):t.mutating?(0,G.jsx)(tr,{size:12,className:`text-agent`}):(0,G.jsx)(Pe,{size:12,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:`font-mono text-2xs text-fg`,children:t.name}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-2xs text-fg-faint`,children:yv(t.name,t.input)}),t.mutating&&t.status===`done`&&t.before&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>{n.replace(t.before),C(t.id,{status:`undone`})},className:`rounded px-1.5 py-0.5 text-2xs font-medium text-accent hover:bg-ink-3`,children:e(`assistant.undo`)})]}),(t.summary||t.error)&&(0,G.jsx)(`div`,{className:W(`border-t border-line/70 px-2.5 py-1 text-2xs`,t.error?`text-danger`:`text-fg-muted`),children:t.error??t.summary}),t.image&&(0,G.jsx)(`img`,{src:t.image,alt:e(`assistant.renderAlt`),className:`block w-full rounded-b-md border-t border-line/70`})]},t.id)),_&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,G.jsx)(Nn,{size:12,className:`animate-spin`}),` `,e(`assistant.working`)]}),(0,G.jsx)(`div`,{ref:b})]}),(0,G.jsxs)(`div`,{className:`shrink-0 border-t border-line p-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-1.5 rounded-lg border border-line bg-ink-2 p-1.5 focus-within:border-accent/60`,children:[(0,G.jsx)(`textarea`,{value:h,rows:2,disabled:!T,placeholder:e(T?`assistant.placeholder`:`assistant.needKey`),onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),w())},className:`max-h-40 min-h-[36px] flex-1 resize-none bg-transparent px-1 text-sm outline-none placeholder:text-fg-faint`}),_?(0,G.jsx)(Y,{label:e(`assistant.stop`),onClick:()=>y.current?.abort(),children:(0,G.jsx)(Yr,{size:13,fill:`currentColor`})}):(0,G.jsx)(Y,{label:e(`assistant.send`),disabled:!h.trim()||!T,onClick:()=>void w(),className:`text-accent`,children:(0,G.jsx)(Dr,{size:14})})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex items-center gap-1 px-1 text-2xs text-fg-faint`,children:[(0,G.jsx)(Ni,{size:10}),` `,e(`assistant.toolsCount`,{n:r.length})]})]})]})}function Sv({apiKey:e,onSave:t}){let{t:n}=U(),[r,i]=(0,O.useState)(e),[a,o]=(0,O.useState)(!1);return(0,G.jsxs)(`div`,{className:`shrink-0 space-y-2.5 border-b border-line bg-ink-0/40 p-3 text-xs`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(hn,{size:14,className:`mt-0.5 shrink-0 text-key`}),(0,G.jsxs)(`div`,{className:`space-y-1 text-fg-muted`,children:[(0,G.jsx)(`p`,{className:`font-medium text-fg`,children:n(`assistant.keyTitle`)}),(0,G.jsx)(`p`,{children:n(`assistant.keyBody1`)}),(0,G.jsx)(`p`,{children:n(`assistant.keyBody2`)})]})]}),(0,G.jsxs)(`div`,{className:`flex gap-1`,children:[(0,G.jsxs)(`div`,{className:`relative flex-1`,children:[(0,G.jsx)(`input`,{type:a?`text`:`password`,value:r,onChange:e=>i(e.target.value),placeholder:`sk-ant-…`,autoComplete:`off`,spellCheck:!1,"aria-label":n(`assistant.keyLabel`),className:`field h-7 pr-7 font-mono`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":n(a?`assistant.hideKey`:`assistant.showKey`),onClick:()=>o(e=>!e),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-fg-faint hover:text-fg`,children:a?(0,G.jsx)(St,{size:12}):(0,G.jsx)(wt,{size:12})})]}),(0,G.jsx)(G_,{size:`sm`,variant:`primary`,disabled:!r.trim()||r.trim()===e,onClick:()=>t(r.trim()),children:n(`assistant.saveKey`)})]}),e&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>(i(``),t(``)),className:`text-2xs text-fg-faint hover:text-danger`,children:n(`assistant.forgetKey`)})]})}var Cv=1.70158,wv=Cv*1.525,Tv=2.70158,Ev=2*Math.PI/3,Dv=2*Math.PI/4.5;function Ov(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}function kv(e){return[e,t=>1-e(1-t),t=>t<.5?e(2*t)/2:1-e(2-2*t)/2]}var[Av,jv,Mv]=kv(e=>e*e),[Nv,Pv,Fv]=kv(e=>e*e*e),[Iv,Lv,Rv]=kv(e=>e*e*e*e),[zv,Bv,Vv]=kv(e=>e*e*e*e*e),[Hv,Uv,Wv]=kv(e=>1-Math.sqrt(1-Math.min(e*e,1))),Gv={linear:e=>e,inQuad:Av,outQuad:jv,inOutQuad:Mv,inCubic:Nv,outCubic:Pv,inOutCubic:Fv,inQuart:Iv,outQuart:Lv,inOutQuart:Rv,inQuint:zv,outQuint:Bv,inOutQuint:Vv,inSine:e=>1-Math.cos(e*Math.PI/2),outSine:e=>Math.sin(e*Math.PI/2),inOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,inExpo:e=>e<=0?0:2**(10*e-10),outExpo:e=>e>=1?1:1-2**(-10*e),inOutExpo:e=>e<=0?0:e>=1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,inCirc:Hv,outCirc:Uv,inOutCirc:Wv,inBack:e=>Tv*e*e*e-Cv*e*e,outBack:e=>1+Tv*(e-1)**3+Cv*(e-1)**2,inOutBack:e=>e<.5?(2*e)**2*(7.189819*e-wv)/2:((2*e-2)**2*(3.5949095*(e*2-2)+wv)+2)/2,inElastic:e=>e<=0?0:e>=1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*Ev),outElastic:e=>e<=0?0:e>=1?1:2**(-10*e)*Math.sin((e*10-.75)*Ev)+1,inOutElastic:e=>e<=0?0:e>=1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Dv))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Dv)/2+1,inBounce:e=>1-Ov(1-e),outBounce:Ov,inOutBounce:e=>e<.5?(1-Ov(1-2*e))/2:(1+Ov(2*e-1))/2,step:e=>+(e>=1)};function Kv(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c,u=e=>((o*e+a)*e+i)*e,d=e=>((l*e+c)*e+s)*e,f=e=>(3*o*e+2*a)*e+i;return e=>{if(e<=0)return 0;if(e>=1)return 1;let t=e;for(let n=0;n<8;n++){let n=u(t)-e;if(Math.abs(n)<1e-6)return d(t);let r=f(t);if(Math.abs(r)<1e-6)break;t-=n/r}let n=0,r=1;t=e;for(let i=0;i<40;i++){let i=u(t);if(Math.abs(i-e)<1e-6)break;i<e?n=t:r=t,t=(n+r)/2}return d(t)}}function qv(e,t,n=1){let r=Math.sqrt(e/n),i=t/(2*Math.sqrt(e*n)),a=i<1?6.9/(i*r):6.9/(r*(i-Math.sqrt(Math.max(i*i-1,0))||.001)),o=Math.min(Math.max(a,.001),60),s;if(i<1){let e=r*Math.sqrt(1-i*i);s=t=>1-Math.exp(-i*r*t)*(Math.cos(e*t)+i*r/e*Math.sin(e*t))}else if(i===1)s=e=>1-Math.exp(-r*e)*(1+r*e);else{let e=Math.sqrt(i*i-1),t=-r*(i-e),n=-r*(i+e);s=e=>1-(n*Math.exp(t*e)-t*Math.exp(n*e))/(n-t)}let c=s(o);return e=>e<=0?0:e>=1?1:s(e*o)+(1-c)*e}function Jv(e,t=!1){let n=Math.max(1,Math.floor(e));return e=>e>=1?1:e<=0?0:Math.min(1,(t?Math.ceil(e*n):Math.floor(e*n))/n)}function Yv(e){switch(e.kind){case`named`:return Gv[e.name]??Gv.linear;case`cubicBezier`:return Kv(e.x1,e.y1,e.x2,e.y2);case`spring`:return qv(e.stiffness,e.damping,e.mass);case`steps`:return Jv(e.count,e.jumpStart)}}var Xv=new Map;function Zv(e){let t=e??`linear`,n=Xv.get(t);if(!n){let e=wa(t);n=`error`in e?Gv.linear:Yv(e),Xv.size<500&&Xv.set(t,n)}return n}function Qv(e,t){let n=t<=0?0:t>=1?1:t;return Zv(e)(n)}var $v=(e,t=3)=>String(Number(e.toFixed(t)));function ey(e){switch(e.kind){case`named`:return e.name;case`cubicBezier`:return`cubicBezier(${$v(e.x1)}, ${$v(e.y1)}, ${$v(e.x2)}, ${$v(e.y2)})`;case`spring`:return e.mass===1?`spring(${$v(e.stiffness,1)}, ${$v(e.damping,1)})`:`spring(${$v(e.stiffness,1)}, ${$v(e.damping,1)}, ${$v(e.mass,2)})`;case`steps`:return e.jumpStart?`steps(${e.count}, start)`:`steps(${e.count})`}}function ty(e,t=`linear`){let n=wa(e??t);return`error`in n?{kind:`named`,name:t}:n}var ny={named:{kind:`named`,name:`inOutCubic`},cubicBezier:{kind:`cubicBezier`,x1:.22,y1:1,x2:.36,y2:1},spring:{kind:`spring`,stiffness:170,damping:18,mass:1},steps:{kind:`steps`,count:4,jumpStart:!1}},ry=[{name:`ease`,v:[.25,.1,.25,1]},{name:`easeOut`,v:[0,0,.58,1]},{name:`expo`,v:[.16,1,.3,1]},{name:`snappy`,v:[.22,1,.36,1]},{name:`anticipate`,v:[.68,-.6,.32,1.6]}];function iy(e,t,n,r={}){let i=Zv(e),a=r.pad??2,[o,s]=r.range??[0,1],c=r.samples??48,l=[];for(let e=0;e<=c;e++){let r=e/c,u=i(r),d=a+r*(t-2*a),f=n-a-(u-o)/(s-o||1)*(n-2*a);l.push(`${e?`L`:`M`}${d.toFixed(1)} ${f.toFixed(1)}`)}return l.join(``)}function ay(e){let t=Zv(e),n=0,r=1;for(let e=0;e<=64;e++){let i=t(e/64);Number.isFinite(i)&&(n=Math.min(n,i),r=Math.max(r,i))}return[n,r]}function oy(e){if(e.default!==void 0)return e.default;switch(e.type){case`number`:case`integer`:return e.min===void 0?0:e.min;case`boolean`:return!1;case`color`:return`#ffffff`;case`colors`:return[`#ffffff`];case`vec2`:return[0,0];case`vec3`:return[0,0,0];case`enum`:return e.options?.[0];case`array`:return[];case`object`:return{};default:return``}}function sy(e,t){return t===void 0?oy(e):t}function cy(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e==`string`&&e.trim()!==``){let t=Number(e.trim().replace(`,`,`.`));return Number.isFinite(t)?t:null}return null}function ly(e,t){let n=Array.isArray(e)?e:typeof e==`string`?e.split(/[\s,;]+/).filter(Boolean):null;if(!n||n.length!==t)return null;let r=n.map(cy);return r.every(e=>e!==null)?r:null}function uy(e,t){let n=t;return e.min!==void 0&&(n=Math.max(e.min,n)),e.max!==void 0&&(n=Math.min(e.max,n)),e.type===`integer`&&(n=Math.round(n)),n}function dy(e,t){switch(e.type){case`number`:case`integer`:{let n=cy(t);return n===null?{ok:!1,error:`number`}:{ok:!0,value:uy(e,n)}}case`boolean`:return{ok:!0,value:t===!0||t===`true`||t===1||t===`1`};case`string`:return{ok:!0,value:t==null?``:String(t)};case`color`:return typeof t==`string`&&ma(t.trim())?{ok:!0,value:t.trim()}:{ok:!1,error:`color`};case`colors`:{let e=Array.isArray(t)?t:typeof t==`string`?t.split(/[\s,;]+/).filter(Boolean):null;return!e||!e.length||!e.every(e=>typeof e==`string`&&ma(e))?{ok:!1,error:`colors`}:{ok:!0,value:e.map(e=>String(e))}}case`vec2`:case`vec3`:{let n=ly(t,e.type===`vec2`?2:3);return n?{ok:!0,value:n}:{ok:!1,error:e.type}}case`enum`:return typeof t==`string`&&(e.options??[]).includes(t)?{ok:!0,value:t}:{ok:!1,error:`enum`};case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return{ok:!1,error:`json`}}return(e.type===`array`?!Array.isArray(n):!n||typeof n!=`object`||Array.isArray(n))?{ok:!1,error:e.type}:{ok:!0,value:n}}}}function fy(e,t){return JSON.stringify(e)===JSON.stringify(t)}function py(e,t,{keepDefault:n=!1}={}){let r=dy(e,t);return r.ok&&!n&&e.default!==void 0&&fy(r.value,e.default)?{...r,drop:!0}:r}function my(e,t=3){if(!Number.isFinite(e))return`0`;let n=Number(e.toFixed(t));return Object.is(n,-0)?`0`:String(n)}function hy({value:e,onChange:t,label:n,labelClass:r,step:i,min:a,max:o,integer:s,suffix:c,placeholder:l,empty:u,ariaLabel:d,className:f}){let[p,m]=(0,O.useState)(null),h=(0,O.useRef)(null),g=(0,O.useRef)(null),_=i??(s?1:Math.abs(e)>=10?.1:.01),v=e=>uy({min:a,max:o,type:s?`integer`:`number`},e);(0,O.useEffect)(()=>{m(null)},[e]);let y=()=>{if(p===null)return;let n=Number(p.replace(`,`,`.`));m(null),Number.isFinite(n)&&n!==e&&t(v(n),!0)},b=t=>{t.button===0&&(t.target.setPointerCapture(t.pointerId),h.current={x:t.clientX,start:e,moved:!1,last:e},t.preventDefault())},x=e=>{let n=h.current;if(!n)return;let r=e.clientX-n.x;if(!n.moved&&Math.abs(r)<2)return;n.moved=!0;let i=e.shiftKey?10:e.altKey?.1:1,a=n.start+r*_*i,o=s?0:Math.max(0,Math.ceil(-Math.log10(_*i))),c=v(Number(a.toFixed(Math.min(o,6))));c!==n.last&&(n.last=c,t(c,!1))},S=e=>{let n=h.current;h.current=null,e.target.releasePointerCapture?.(e.pointerId),n&&(n.moved?t(n.last,!0):g.current?.focus())};return(0,G.jsxs)(`div`,{className:W(`flex h-6 min-w-0 flex-1 items-center rounded-[5px] border border-transparent bg-ink-2 focus-within:border-accent/70 focus-within:bg-ink-1 hover:border-line`,f),children:[n!==void 0&&(0,G.jsx)(`span`,{onPointerDown:b,onPointerMove:x,onPointerUp:S,className:W(`flex h-full w-4 shrink-0 cursor-ew-resize select-none items-center justify-center text-2xs font-semibold`,r??`text-fg-faint`),children:n}),(0,G.jsx)(`input`,{ref:g,"aria-label":d??n,inputMode:`decimal`,value:p??(u?``:my(e,s?0:3)),placeholder:u?`auto`:void 0,onPointerDown:n===void 0?b:void 0,onPointerMove:n===void 0?x:void 0,onPointerUp:n===void 0?S:void 0,onFocus:t=>{m(my(e,s?0:3)),requestAnimationFrame(()=>t.target.select())},onChange:e=>m(e.target.value),onBlur:y,onKeyDown:n=>{if(n.key===`Enter`)n.target.blur();else if(n.key===`Escape`)m(null),requestAnimationFrame(()=>n.target.blur());else if(n.key===`ArrowUp`||n.key===`ArrowDown`){n.preventDefault();let r=v(Number(((Number(p??e)||0)+(n.key===`ArrowUp`?1:-1)*_*(n.shiftKey?10:1)).toFixed(6)));m(my(r,s?0:3)),t(r,!0)}},className:W(`h-full w-full min-w-0 bg-transparent px-1 text-sm tabular-nums outline-none`,n===void 0&&`cursor-ew-resize focus:cursor-text`,l&&p===null?`text-fg-faint`:`text-fg`)}),c&&(0,G.jsx)(`span`,{className:`pr-1.5 text-2xs text-fg-faint`,children:c})]})}var gy=[`text-[#f2766d]`,`text-[#7bd88f]`,`text-[#6fa8ff]`];function _y({value:e,onChange:t,labels:n=[`X`,`Y`,`Z`],step:r,suffix:i,placeholder:a,min:o}){return(0,G.jsx)(`div`,{className:`flex min-w-0 flex-1 gap-1`,children:e.map((s,c)=>(0,G.jsx)(hy,{label:n[c],labelClass:gy[c],value:s,step:r,min:o,suffix:i,placeholder:a,onChange:(n,r)=>{let i=[...e];i[c]=n,t(i,r)}},c))})}function vy({value:e,min:t,max:n,onChange:r,integer:i,placeholder:a,empty:o,ariaLabel:s,step:c}){let l=n-t||1,u=c??(i?1:l<=2?.01:l<=20?.05:l/200),d=o?0:Math.max(0,Math.min(1,(e-t)/l))*100;return(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`relative flex h-6 min-w-0 flex-1 items-center`,children:[(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 h-[3px] rounded-full bg-ink-4`,children:(0,G.jsx)(`div`,{className:W(`h-full rounded-full`,a?`bg-fg-faint/50`:`bg-accent`),style:{width:`${d}%`}})}),(0,G.jsx)(`input`,{type:`range`,min:t,max:n,step:u,value:Number.isFinite(e)?e:t,"aria-label":s,onChange:e=>r(uy({min:t,max:n,type:i?`integer`:`number`},Number(e.target.value)),!1),onPointerUp:e=>r(uy({min:t,max:n,type:i?`integer`:`number`},Number(e.target.value)),!0),onKeyUp:e=>r(uy({min:t,max:n,type:i?`integer`:`number`},Number(e.target.value)),!0),className:W(`slider relative h-6 w-full cursor-pointer appearance-none bg-transparent`,o&&`opacity-40`)})]}),(0,G.jsx)(hy,{value:e,min:t,max:n,integer:i,placeholder:a,empty:o,onChange:r,ariaLabel:s,className:`w-[52px] flex-none`,step:u})]})}var yy=ne();function by({trigger:e,children:t,width:n=280,align:r=`end`}){let[i,a]=(0,O.useState)(!1),o=(0,O.useRef)(null),s=(0,O.useRef)(null),[c,l]=(0,O.useState)(null);return(0,O.useLayoutEffect)(()=>{if(!i||!o.current)return;let e=()=>{let e=o.current.getBoundingClientRect(),t=window.innerWidth,i=window.innerHeight,a=r===`end`?e.right-n:e.left;a=Math.max(8,Math.min(t-n-8,a));let c=i-e.bottom-12,u=e.top-12,d=s.current?.scrollHeight??320;l(c>=Math.min(d,260)||c>=u?{left:a,top:e.bottom+4,maxHeight:c}:{left:a,top:Math.max(8,e.top-4-Math.min(d,u)),maxHeight:u})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[i,n,r]),(0,O.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;!o.current?.contains(t)&&!s.current?.contains(t)&&a(!1)},t=e=>e.key===`Escape`&&(e.stopPropagation(),a(!1));return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t,!0),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t,!0)}},[i]),(0,G.jsxs)(`div`,{ref:o,className:`flex min-w-0 flex-1`,children:[e(()=>a(e=>!e),i),i&&(0,yy.createPortal)((0,G.jsx)(`div`,{ref:s,className:`toast-in fixed z-50 overflow-auto rounded-lg border border-line bg-ink-1 shadow-xl shadow-black/50`,style:{width:n,left:c?.left??-9999,top:c?.top??-9999,maxHeight:c?.maxHeight??400},children:t(()=>a(!1))}),document.body)]})}function xy({onClick:e,children:t,open:n,ariaLabel:r}){return(0,G.jsx)(`button`,{type:`button`,"aria-label":r,"aria-expanded":n,onClick:e,className:`field flex items-center gap-1.5 text-left ${n?`border-accent/70 bg-ink-1`:``}`,style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23989fae' fill='none' stroke-width='1.2'/%3E%3C/svg%3E")`,backgroundRepeat:`no-repeat`,backgroundPosition:`right 6px center`,paddingRight:18},children:t})}function Sy({spec:e,size:t=14,className:n}){let r=ay(e);return(0,G.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:W(`shrink-0`,n),"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:iy(e,t,t,{pad:1.5,range:r,samples:32}),fill:`none`,stroke:`currentColor`,strokeWidth:1.3,strokeLinecap:`round`})})}var Cy=[`Sine`,`Quad`,`Cubic`,`Quart`,`Quint`,`Expo`,`Circ`,`Back`,`Elastic`,`Bounce`];function wy({value:e,onChange:t,placeholder:n=`linear`,allowInherit:r,compact:i,ariaLabel:a}){let{t:o}=U(),s=e??n;return(0,G.jsx)(by,{width:300,align:`start`,trigger:(t,n)=>i?(0,G.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":a??o(`ease.title`),title:s,className:W(`flex h-5 min-w-0 max-w-full items-center gap-1 rounded px-1 text-2xs hover:bg-ink-3`,e?`text-fg-muted`:`text-fg-faint`,n&&`bg-ink-3`),children:[(0,G.jsx)(Sy,{spec:s,size:12}),(0,G.jsx)(`span`,{className:`truncate`,children:s})]}):(0,G.jsxs)(xy,{onClick:t,open:n,ariaLabel:a??o(`ease.title`),children:[(0,G.jsx)(Sy,{spec:s,className:`text-key`}),(0,G.jsx)(`span`,{className:W(`truncate font-mono text-xs`,!e&&`text-fg-faint`),children:s})]}),children:()=>(0,G.jsx)(Ty,{value:e,placeholder:n,onChange:t,allowInherit:r})})}function Ty({value:e,placeholder:t,onChange:n,allowInherit:r}){let{t:i}=U(),a=ty(e,t),o=e=>n(ey(e));return(0,G.jsxs)(`div`,{className:`p-2`,children:[(0,G.jsx)(`div`,{className:`mb-2 flex gap-0.5 rounded-md bg-ink-2 p-0.5`,role:`tablist`,children:[`named`,`cubicBezier`,`spring`,`steps`].map(e=>(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a.kind===e,onClick:()=>a.kind!==e&&o(ny[e]),className:W(`h-6 flex-1 rounded text-2xs font-medium`,a.kind===e?`bg-ink-4 text-fg`:`text-fg-muted hover:text-fg`),children:i(`ease.${e}`)},e))}),r!==void 0&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(void 0),className:W(`mb-2 w-full rounded-md border px-2 py-1 text-left text-2xs`,e===void 0?`border-accent/60 bg-accent/10 text-accent`:`border-line text-fg-muted hover:text-fg`),children:r}),a.kind===`named`&&(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-1`,children:[`linear`,`step`].map(e=>(0,G.jsx)(Dy,{name:e,active:a.name===e,onPick:()=>o({kind:`named`,name:e})},e))}),(0,G.jsxs)(`div`,{className:`grid grid-cols-[52px_repeat(3,1fr)] items-center gap-1`,children:[(0,G.jsx)(`span`,{}),[`in`,`out`,`inOut`].map(e=>(0,G.jsx)(`span`,{className:`text-center text-2xs text-fg-faint`,children:e},e)),Cy.map(e=>(0,G.jsx)(Oy,{family:e,current:a.name,onPick:e=>o({kind:`named`,name:e})},e))]})]}),a.kind===`cubicBezier`&&(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(Ay,{value:[a.x1,a.y1,a.x2,a.y2],onChange:([e,t,n,r])=>o({kind:`cubicBezier`,x1:e,y1:t,x2:n,y2:r})}),(0,G.jsx)(`div`,{className:`grid grid-cols-4 gap-1`,children:[`x1`,`y1`,`x2`,`y2`].map((e,t)=>(0,G.jsx)(hy,{label:e[0].toUpperCase(),value:[a.x1,a.y1,a.x2,a.y2][t],min:t%2==0?0:-2,max:t%2==0?1:3,step:.01,onChange:t=>o({...a,[e]:t}),ariaLabel:e},e))}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:ry.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o({kind:`cubicBezier`,x1:e.v[0],y1:e.v[1],x2:e.v[2],y2:e.v[3]}),className:`flex h-5 items-center gap-1 rounded border border-line px-1.5 text-2xs text-fg-muted hover:border-fg-faint hover:text-fg`,children:[(0,G.jsx)(Sy,{spec:`cubicBezier(${e.v.join(`, `)})`,size:10}),e.name]},e.name))})]}),a.kind===`spring`&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(ky,{spec:ey(a)}),(0,G.jsx)(Ey,{label:i(`ease.stiffness`),children:(0,G.jsx)(vy,{value:a.stiffness,min:10,max:600,step:1,onChange:e=>o({...a,stiffness:e}),ariaLabel:i(`ease.stiffness`)})}),(0,G.jsx)(Ey,{label:i(`ease.damping`),children:(0,G.jsx)(vy,{value:a.damping,min:1,max:60,step:.5,onChange:e=>o({...a,damping:e}),ariaLabel:i(`ease.damping`)})}),(0,G.jsx)(Ey,{label:i(`ease.mass`),children:(0,G.jsx)(vy,{value:a.mass,min:.1,max:5,step:.1,onChange:e=>o({...a,mass:e}),ariaLabel:i(`ease.mass`)})}),(0,G.jsx)(`p`,{className:`text-2xs leading-snug text-fg-faint`,children:i(`ease.springHint`)})]}),a.kind===`steps`&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(ky,{spec:ey(a)}),(0,G.jsx)(Ey,{label:i(`ease.count`),children:(0,G.jsx)(vy,{value:a.count,min:1,max:24,integer:!0,onChange:e=>o({...a,count:Math.max(1,Math.round(e))}),ariaLabel:i(`ease.count`)})}),(0,G.jsx)(Ey,{label:i(`ease.jumpStart`),children:(0,G.jsx)(q_,{checked:a.jumpStart,onChange:e=>o({...a,jumpStart:e}),ariaLabel:i(`ease.jumpStart`)})})]}),(0,G.jsx)(`div`,{className:`mt-2 truncate rounded bg-ink-0 px-2 py-1 font-mono text-2xs text-fg-muted`,children:e??t})]})}function Ey({label:e,children:t}){return(0,G.jsxs)(`div`,{className:`grid grid-cols-[70px_1fr] items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-2xs text-fg-muted`,children:e}),(0,G.jsx)(`div`,{className:`flex min-w-0`,children:t})]})}function Dy({name:e,active:t,onPick:n,label:r}){return(0,G.jsxs)(`button`,{type:`button`,title:e,"aria-pressed":t,onClick:n,className:W(`flex h-6 items-center justify-center gap-1 rounded border text-2xs`,t?`border-accent/70 bg-accent/15 text-accent`:`border-line text-fg-muted hover:border-fg-faint hover:text-fg`),children:[(0,G.jsx)(Sy,{spec:e,size:14}),r??e]})}function Oy({family:e,current:t,onPick:n}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`text-2xs text-fg-muted`,children:e}),[`in`,`out`,`inOut`].map(r=>{let i=`${r}${e}`;return ya.includes(i)?(0,G.jsx)(`button`,{type:`button`,title:i,"aria-label":i,"aria-pressed":t===i,onClick:()=>n(i),className:W(`flex h-6 items-center justify-center rounded border`,t===i?`border-accent/70 bg-accent/15 text-accent`:`border-line text-fg-muted hover:border-fg-faint hover:text-fg`),children:(0,G.jsx)(Sy,{spec:i,size:16})},r):(0,G.jsx)(`span`,{},r)})]})}function ky({spec:e}){let t=ay(e),n=e=>66-(e-t[0])/(t[1]-t[0]||1)*62;return(0,G.jsxs)(`svg`,{width:284,height:70,className:`block rounded-md bg-ink-0`,"aria-hidden":!0,children:[(0,G.jsx)(`line`,{style:{stroke:`rgb(var(--line))`},x1:4,x2:280,y1:n(1),y2:n(1),strokeDasharray:`3 3`}),(0,G.jsx)(`line`,{style:{stroke:`rgb(var(--line))`},x1:4,x2:280,y1:n(0),y2:n(0)}),(0,G.jsx)(`path`,{style:{stroke:`rgb(var(--key))`},d:iy(e,284,70,{pad:4,range:t,samples:96}),fill:`none`,strokeWidth:1.6})]})}function Ay({value:e,onChange:t}){let n=(0,O.useRef)(null),r=(0,O.useRef)(null),i=e=>12+e*180,a=e=>50+(1-e)*180,[o,s,c,l]=e,u=e=>{let t=n.current.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-t.left-12)/180)),i=Math.max(-50/180,Math.min(1.2777777777777777,1-(e.clientY-t.top-50)/180));return[Math.round(r*100)/100,Math.round(i*100)/100]},d=e=>{if(r.current===null)return;let[n,i]=u(e);t(r.current===0?[n,i,c,l]:[o,s,n,i])},f=(e,t,n,o,s)=>(0,G.jsxs)(`g`,{children:[(0,G.jsx)(`line`,{style:{stroke:`rgb(var(--accent))`},x1:i(o),y1:a(s),x2:i(t),y2:a(n),strokeWidth:1,opacity:.7}),(0,G.jsx)(`circle`,{style:{fill:`rgb(var(--ink-1))`,stroke:`rgb(var(--accent))`},cx:i(t),cy:a(n),r:6,strokeWidth:2,className:`cursor-grab active:cursor-grabbing`,onPointerDown:t=>{t.stopPropagation(),t.target.setPointerCapture(t.pointerId),r.current=e},role:`slider`,"aria-label":`handle ${e+1}`,"aria-valuenow":t})]});return(0,G.jsxs)(`svg`,{ref:n,width:204,height:280,className:`mx-auto block touch-none select-none rounded-md bg-ink-0`,onPointerMove:d,onPointerUp:()=>r.current=null,children:[(0,G.jsx)(`rect`,{style:{stroke:`rgb(var(--line))`},x:12,y:50,width:180,height:180,fill:`none`}),[.25,.5,.75].map(e=>(0,G.jsxs)(`g`,{style:{stroke:`rgb(var(--line))`},strokeDasharray:`2 4`,children:[(0,G.jsx)(`line`,{x1:i(e),x2:i(e),y1:50,y2:230}),(0,G.jsx)(`line`,{y1:a(e),y2:a(e),x1:12,x2:192})]},e)),(0,G.jsx)(`line`,{style:{stroke:`rgb(var(--fg-faint))`},x1:i(0),y1:a(0),x2:i(1),y2:a(1),strokeDasharray:`3 3`,opacity:.5}),(0,G.jsx)(`path`,{style:{stroke:`rgb(var(--key))`},d:`M${i(0)} ${a(0)} C${i(o)} ${a(s)} ${i(c)} ${a(l)} ${i(1)} ${a(1)}`,fill:`none`,strokeWidth:2}),f(0,o,s,0,0),f(1,c,l,1,1)]})}function jy(e){let t=e?pa(e):null;return t?ha(t):`#000000`}function My({value:e,onChange:t,final:n,className:r,ariaLabel:i}){let a=(0,O.useRef)(null);return(0,G.jsx)(`label`,{className:W(`relative h-6 w-6 shrink-0 cursor-pointer overflow-hidden rounded-[5px] border border-white/10`,r),style:{background:ma(e)?e:`transparent`},title:e,children:(0,G.jsx)(`input`,{ref:a,type:`color`,"aria-label":i??`Colour`,value:jy(e),onInput:e=>t(e.target.value,!!n),onChange:e=>t(e.target.value,!0),className:`absolute inset-0 h-full w-full cursor-pointer opacity-0`})})}function Ny({value:e,onChange:t,placeholder:n}){return(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,G.jsx)(My,{value:e,onChange:t}),(0,G.jsx)(K_,{value:e,onCommit:e=>ma(e.trim())&&t(e.trim(),!0),className:W(`font-mono text-xs`,n&&`text-fg-faint`),ariaLabel:Yh(`ui.colourValue`)})]})}function Py({value:e,onChange:t}){return(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1`,children:[e.map((n,r)=>(0,G.jsxs)(`div`,{className:`group/sw relative`,children:[(0,G.jsx)(My,{value:n,onChange:(n,i)=>{let a=[...e];a[r]=n,t(a,i)}}),e.length>1&&(0,G.jsx)(`button`,{type:`button`,"aria-label":Yh(`ui.removeColour`),onClick:()=>t(e.filter((e,t)=>t!==r),!0),className:`absolute -right-1 -top-1 hidden h-3.5 w-3.5 items-center justify-center rounded-full bg-ink-4 text-fg group-hover/sw:flex`,children:(0,G.jsx)(Fi,{size:9})})]},r)),(0,G.jsx)(`button`,{type:`button`,"aria-label":Yh(`ui.addColour`),onClick:()=>t([...e,e[e.length-1]??`#ffffff`],!0),className:`flex h-6 w-6 items-center justify-center rounded-[5px] border border-dashed border-line text-fg-faint hover:border-fg-faint hover:text-fg`,children:(0,G.jsx)(lr,{size:11})})]})}var Fy=[`position`,`rotation`,`scale`,`visible`,`material.opacity`,`material.color`,`material.emissiveIntensity`],Iy=[`camera.position`,`camera.target`,`camera.fov`],Ly={position:[0,0,0],rotation:[0,0,0],scale:1,visible:!0,"material.opacity":1,"material.color":`#ffffff`,"material.emissiveIntensity":1,"camera.target":[0,0,0],"camera.fov":45,intensity:1,color:`#ffffff`};function Ry(e,t){try{return Nf(e,t)}catch{return}}function zy(e){let t=e.indexOf(`.`);return t<0?{id:e,prop:``}:{id:e.slice(0,t),prop:e.slice(t+1)}}function By(e,t){let{id:n,prop:r}=zy(t);if(n===`camera`)return Ry(e.camera,r)??Ly[t];let i=Nc(e.objects,n)?.object??(e.lights??[]).find(e=>e.id===n);if(!i)return;let a=/^(position|rotation|scale)\.([xyz])$/.exec(r);if(a){let e=Ry(i,a[1]),t=`xyz`.indexOf(a[2]);return Array.isArray(e)?e[t]:typeof e==`number`?e:+(a[1]===`scale`)}let o=Ry(i,r);return r===`scale`&&Array.isArray(o)&&(o=o[0]),o??Ly[r]}var Vy=.001,Hy=e=>Math.round(e*1e3)/1e3;function Uy(e,t,n){let r=Hy(Math.max(0,t)),i=e.keys.find(e=>Math.abs(e[0]-r)<=Vy),a=e.keys.filter(e=>Math.abs(e[0]-r)>Vy);return a.push(i?.length===3?[r,n,i[2]]:[r,n]),a.sort((e,t)=>e[0]-t[0]),{...e,keys:a}}function Wy(e,t,n){let r=e.keys[t];if(!r)return{track:e,index:t};let i=r.length===3?[Hy(Math.max(0,n)),r[1],r[2]]:[Hy(Math.max(0,n)),r[1]],a=e.keys.filter((e,n)=>n!==t);return a.push(i),a.sort((e,t)=>e[0]-t[0]),{track:{...e,keys:a},index:a.indexOf(i)}}function Gy(e,t){return{...e,keys:e.keys.filter((e,n)=>n!==t)}}function Ky(e,t=.05,n=!1){return Hy(n?e:Math.round(e/t)*t)}var qy=[.1,.25,.5,1,2,5,10,15,30,60,120,300,600];function Jy(e,t=1/0,n=48){let r=e>0?e:1,i=Number.isFinite(t)&&t>0?t/r:1/0;for(let e of qy)if(r/e<=16&&e*i>=n)return e;return qy[qy.length-1]}var Yy=e=>Array.isArray(e)?{from:e[0],to:e[1]}:e;function Xy(e,t){let n=new Set(t);if(!n.has(e))return e;let r=2;for(;n.has(`${e}${r}`);)r++;return`${e}${r}`}var Zy=/^[A-Za-z][\w-]*$/;function Qy(e,t,n){let r=[{op:`set`,path:`timeline`,value:t}];return n&&JSON.stringify(n)!==JSON.stringify(e.interactions??[])&&r.push({op:`set`,path:`interactions`,value:n}),r}var $y=e=>{let t={...e};return t.markers&&!Object.keys(t.markers).length&&delete t.markers,t.segments&&!Object.keys(t.segments).length&&delete t.segments,t};function eb(e,t,n){let r=e.timeline;return r?[{op:`set`,path:`timeline.markers`,value:{...r.markers??{},[t]:Math.round(Math.max(0,Math.min(r.duration,n))*1e3)/1e3}}]:[]}function tb(e,t){let n=Xy(`marker`,Object.keys(e.timeline?.markers??{}));return{ops:eb(e,n,t),name:n}}function nb(e,t,n){let r=e.timeline;if(!r?.markers||!(t in r.markers)||t===n||!Zy.test(n)||n in r.markers)return[];let i=Object.fromEntries(Object.entries(r.markers).map(([e,r])=>[e===t?n:e,r])),a=e=>e===t?n:e,o=r.segments?Object.fromEntries(Object.entries(r.segments).map(([e,t])=>{let n=Yy(t);return[e,Array.isArray(t)?[a(t[0]),a(t[1])]:{...n,from:a(n.from),to:a(n.to)}]})):void 0,s=e.interactions?.map(e=>({...e,...e.on===`event`&&e.event===t?{event:n}:{},do:e.do.map(e=>`seek`in e&&e.seek===t?{...e,seek:n}:e)}));return Qy(e,$y({...r,markers:i,...o?{segments:o}:{}}),s)}function rb(e,t){let n=e.timeline;if(!n?.markers||!(t in n.markers))return[];let r=n.markers[t],i={...n.markers};delete i[t];let a=e=>e===t?r:e,o=n.segments?Object.fromEntries(Object.entries(n.segments).map(([e,t])=>[e,Array.isArray(t)?[a(t[0]),a(t[1])]:{...t,from:a(t.from),to:a(t.to)}])):void 0,s=e.interactions?.map(e=>({...e,do:e.do.map(e=>`seek`in e&&e.seek===t?{...e,seek:r}:e)}));return Qy(e,$y({...n,markers:i,...o?{segments:o}:{}}),s)}function ib(e,t){let n=e.timeline;if(!n)return{ops:[],name:``};let r=Xy(`segment`,Object.keys(n.segments??{})),i=Math.round(Math.min(t,Math.max(0,n.duration-.5))*100)/100,a=Math.round(Math.min(n.duration,i+Math.min(1,n.duration))*100)/100;return{ops:[{op:`set`,path:`timeline.segments`,value:{...n.segments??{},[r]:{from:i,to:a}}}],name:r}}function ab(e,t,n){let r=e.timeline;if(!r?.segments||!(t in r.segments)||t===n||!Zy.test(n)||n in r.segments||n===`timeline`)return[];let i=Object.fromEntries(Object.entries(r.segments).map(([e,r])=>[e===t?n:e,r])),a=e.interactions?.map(e=>({...e,do:e.do.map(e=>`play`in e&&e.play===t?{...e,play:n}:`toggle`in e&&e.toggle===t?{...e,toggle:n}:e)}));return Qy(e,{...r,segments:i,...r.autoplay===t?{autoplay:n}:{}},a)}function ob(e,t){let n=e.timeline;if(!n?.segments||!(t in n.segments))return[];let r={...n.segments};delete r[t];let i=$y({...n,segments:r});return i.autoplay===t&&delete i.autoplay,[{op:`set`,path:`timeline`,value:i}]}function sb(e,t){return typeof e==`number`?e:t.markers?.[e]??0}var cb=[`#7c8cff`,`#4fd1a5`,`#f26d9b`,`#6fc3ff`,`#c39bff`,`#f2b654`],lb=26,ub=236;function db(){let{t:e}=U(),{edit:t,player:n,store:r}=Q(),i=ev(),a=i.scene,o=a.timeline,s=o?.tracks??[],c=o?.duration||4,[l,u]=(0,O.useState)(0),[d,f]=(0,O.useState)(null),[p,m]=(0,O.useState)(`position`),[h,g]=(0,O.useState)(null),_=o?.markers??{},v=o?.segments??{},y=Object.keys(v),b=y.length?6+y.length*5:0,x=24+(o?16:0)+b,S=(0,O.useRef)(null);(0,O.useEffect)(()=>n.onTime(u),[n]);let C=i.selection,w=C?Fy:Iy;(0,O.useEffect)(()=>{w.includes(p)||m(w[0])},[w,p]);let T=C?`${C}.${p}`:p,ee=(e,n)=>t([{op:`addTrack`,track:e}],n?{coalesce:n}:void 0),te=()=>{let e=By(a,T);if(e===void 0)return;let n=s.find(e=>e.target===T)??{target:T,keys:[],ease:`inOutCubic`},i=Ky(l),c=[];o||c.push({op:`set`,path:`timeline`,value:{duration:Math.max(4,i),loop:!0,tracks:[]}}),c.push({op:`addTrack`,track:Uy(n,i,e)}),t(c);let u=r.getSnapshot().scene?.timeline?.tracks.find(e=>e.target===T);u&&f({target:T,index:u.keys.findIndex(e=>Math.abs(e[0]-i)<.001)})},E=(e,t)=>e/c*t,[ne,D]=(0,O.useState)(600);(0,O.useEffect)(()=>{let e=S.current;if(!e)return;let t=new ResizeObserver(()=>D(e.clientWidth-40));return t.observe(e),()=>t.disconnect()},[]);let re=Jy(c,ne),ie=(0,O.useMemo)(()=>{let e=[];for(let t=0;t<=c+1e-6;t+=re)e.push(Number(t.toFixed(3)));return e},[c,re]),ae=e=>{let t=S.current.getBoundingClientRect();return Math.max(0,Math.min(c,(e-t.left-8)/ne*c))},oe=d?s.find(e=>e.target===d.target):void 0,se=oe&&d?oe.keys[d.index]:void 0;return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line px-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(X,{value:p,options:w.map(e=>({value:e,label:C?`${C}.${e}`:e})),onChange:m,className:`w-[170px]`,ariaLabel:e(`timeline.property`)}),(0,G.jsxs)(G_,{size:`xs`,variant:`subtle`,onClick:te,title:e(`timeline.addKeyHint`),children:[(0,G.jsx)(ft,{size:11,className:`text-key`,fill:`currentColor`}),` `,e(`timeline.addKey`,{t:Ky(l).toFixed(2)})]})]}),(0,G.jsx)(`div`,{className:`ml-auto flex items-center gap-2 text-xs text-fg-muted`,children:o?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`label`,{className:`flex items-center gap-1`,children:[e(`timeline.duration`),(0,G.jsx)(hy,{value:o.duration,min:.1,step:.1,suffix:`s`,className:`w-[70px] flex-none`,onChange:(e,n)=>t([{op:`set`,path:`timeline.duration`,value:e}],{coalesce:n?void 0:`tl:duration`}),ariaLabel:e(`timeline.duration`)})]}),(0,G.jsx)(X,{value:o.loop===`pingpong`?`pingpong`:o.loop?`loop`:`once`,options:[{value:`once`,label:e(`timeline.once`)},{value:`loop`,label:e(`timeline.loop`)},{value:`pingpong`,label:e(`timeline.pingpong`)}],onChange:e=>t([{op:`set`,path:`timeline.loop`,value:e===`pingpong`?`pingpong`:e===`loop`}]),className:`w-[96px]`,ariaLabel:e(`timeline.loop`)}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1`,title:e(`timeline.speedHint`),children:[e(`timeline.speed`),(0,G.jsx)(hy,{value:o.speed??1,min:.05,max:10,step:.05,suffix:`×`,placeholder:o.speed===void 0,className:`w-[58px] flex-none`,onChange:(e,n)=>t(e===1?o.speed===void 0?[]:[{op:`remove`,path:`timeline.speed`}]:[{op:`set`,path:`timeline.speed`,value:e}],{coalesce:n?void 0:`tl:speed`}),ariaLabel:e(`timeline.speed`)})]}),(0,G.jsx)(X,{value:o.trigger??`visible`,options:Ho.map(t=>({value:t,label:e(`trigger.${t}`)})),onChange:e=>t([{op:`set`,path:`timeline.trigger`,value:e}]),className:`w-[124px]`,ariaLabel:e(`timeline.trigger`)}),(0,G.jsx)(X,{value:o.autoplay===!1?`__off`:typeof o.autoplay==`string`?o.autoplay:`__on`,options:[{value:`__on`,label:e(`timeline.autoplayOn`)},{value:`__off`,label:e(`timeline.autoplayOff`)},...y.map(t=>({value:t,label:e(`timeline.autoplaySegment`,{name:t})}))],onChange:e=>t(e===`__on`?o.autoplay===void 0?[]:[{op:`remove`,path:`timeline.autoplay`}]:[{op:`set`,path:`timeline.autoplay`,value:e!==`__off`&&e}]),className:`w-[112px]`,ariaLabel:e(`timeline.autoplay`)}),(0,G.jsx)(Y,{label:e(`timeline.remove`),onClick:()=>t([{op:`remove`,path:`timeline`}]),children:(0,G.jsx)(li,{size:13})})]}):(0,G.jsx)(`span`,{className:`text-fg-faint`,children:e(`timeline.none`)})})]}),oe&&se&&d&&(0,G.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-line bg-ink-0/40 px-2`,children:[(0,G.jsxs)(`span`,{className:`truncate text-2xs text-fg-faint`,children:[oe.target,` · `,e(`timeline.keyN`,{n:d.index+1,total:oe.keys.length})]}),(0,G.jsx)(gb,{track:oe,index:d.index,onChange:(e,t,n)=>{ee(e,n?void 0:`key:${e.target}`),f({target:e.target,index:t})},onDelete:()=>{let e=Gy(oe,d.index);t(e.keys.length?[{op:`addTrack`,track:e}]:[{op:`removeTrack`,target:e.target}]),f(null)}})]}),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`sticky left-0 z-10 shrink-0 border-r border-line bg-ink-1`,style:{width:ub},children:[(0,G.jsxs)(`div`,{className:`flex flex-col justify-end border-b border-line pb-0.5 pl-2 text-2xs text-fg-faint`,style:{height:x},children:[o&&(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,style:{height:16},children:[(0,G.jsx)(At,{size:9}),` `,e(`timeline.markers`)]}),b>0&&(0,G.jsx)(`span`,{style:{height:b},children:e(`timeline.segments`)})]}),s.map(n=>{let{id:i,prop:a}=zy(n.target);return(0,G.jsxs)(`div`,{className:W(`group flex items-center gap-1 border-b border-line/60 pl-2 pr-1`,C===i&&`bg-accent/5`),style:{height:lb},children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i!==`camera`&&r.select(i),className:`min-w-0 flex-1 truncate text-left text-xs`,children:[(0,G.jsx)(`span`,{className:W(C===i?`text-accent`:`text-fg`),children:i}),(0,G.jsxs)(`span`,{className:`text-fg-faint`,children:[`.`,a]})]}),(0,G.jsx)(`div`,{className:`w-[92px] shrink-0`,children:(0,G.jsx)(wy,{compact:!0,value:n.ease,placeholder:`linear`,onChange:e=>ee({...n,ease:e}),ariaLabel:e(`timeline.ease`)})}),(0,G.jsx)(Y,{label:e(`timeline.removeTrack`),className:`h-5 w-5 opacity-0 group-hover:opacity-100`,onClick:()=>t([{op:`removeTrack`,target:n.target}]),children:(0,G.jsx)(Fi,{size:11})})]},n.target)})]}),(0,G.jsxs)(`div`,{ref:S,className:`relative min-w-[300px] flex-1`,children:[(0,G.jsxs)(`div`,{className:`sticky top-0 z-[5] border-b border-line bg-ink-1`,style:{height:x},children:[(0,G.jsx)(`div`,{className:`relative cursor-pointer`,style:{height:24},onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),n.seek(ae(e.clientX))},onPointerMove:e=>e.buttons===1&&void n.seek(ae(e.clientX)),children:ie.map(e=>(0,G.jsxs)(`div`,{className:`pointer-events-none absolute top-0 h-full`,style:{left:8+E(e,ne)},children:[(0,G.jsx)(`div`,{className:`h-2 w-px bg-fg-faint/60`}),(0,G.jsxs)(`div`,{className:`absolute left-1 top-1.5 text-2xs tabular-nums text-fg-faint`,children:[e,`s`]})]},e))}),o&&(0,G.jsx)(`div`,{className:`relative border-t border-line/50`,style:{height:16},title:e(`timeline.markerLaneHint`),onDoubleClick:e=>{if(e.target!==e.currentTarget)return;let n=tb(a,Ky(ae(e.clientX)));t(n.ops),g(n.name)},children:Object.entries(_).map(([e,i])=>(0,G.jsx)(fb,{name:e,x:8+E(i,ne),selected:h===e,onSelect:()=>{g(e),n.seek(i)},onDrag:(n,i,a)=>t(eb(r.getSnapshot().scene,e,Ky(ae(n),.05,i)),a?void 0:{coalesce:`marker:${e}`})},e))}),b>0&&o&&(0,G.jsx)(`div`,{className:`relative border-t border-line/50`,style:{height:b},children:y.map((e,t)=>{let r=Yy(v[e]),i=sb(r.from,o),a=sb(r.to,o),s=Math.min(i,a);return(0,G.jsx)(`button`,{type:`button`,title:`${e}: ${i}s → ${a}s`,onClick:()=>n.playSegment(e),className:`absolute h-[4px] rounded-full opacity-80 hover:opacity-100`,style:{top:3+t*5,left:8+E(s,ne),width:Math.max(3,E(Math.abs(a-i),ne)),background:cb[t%cb.length]}},e)})})]}),s.map(e=>(0,G.jsxs)(`div`,{className:`relative border-b border-line/60`,style:{height:lb},onPointerDown:e=>e.target===e.currentTarget&&f(null),children:[e.keys.length>1&&(0,G.jsx)(`div`,{className:`absolute top-1/2 h-px bg-key/30`,style:{left:8+E(e.keys[0][0],ne),width:E(e.keys[e.keys.length-1][0]-e.keys[0][0],ne)}}),e.keys.map((i,a)=>(0,G.jsx)(hb,{x:8+E(i[0],ne),selected:d?.target===e.target&&d.index===a,title:`${i[0]}s · ${JSON.stringify(i[1])}`,onSelect:()=>{f({target:e.target,index:a}),n.seek(i[0])},onDrag:(t,n,i)=>{let o=r.getSnapshot().scene?.timeline?.tracks.find(t=>t.target===e.target);if(!o)return;let s=d?.target===e.target?d.index:a,c=Wy(o,Math.min(s,o.keys.length-1),Ky(ae(t),.05,n));ee(c.track,i?void 0:`key:${e.target}`),f({target:e.target,index:c.index})},onDelete:()=>{let n=Gy(e,a);t(n.keys.length?[{op:`addTrack`,track:n}]:[{op:`removeTrack`,target:e.target}]),f(null)}},a))]},e.target)),!s.length&&(0,G.jsxs)(`div`,{className:`flex h-24 items-center justify-center gap-2 text-xs text-fg-faint`,children:[(0,G.jsx)(lr,{size:12}),` `,C?e(`timeline.emptySelected`,{id:C}):e(`timeline.empty`)]}),Object.entries(_).map(([e,t])=>(0,G.jsx)(`div`,{className:W(`pointer-events-none absolute bottom-0 z-[3] w-px`,h===e?`bg-key/70`:`bg-key/25`),style:{left:8+E(t,ne),top:x}},e)),(0,G.jsx)(`div`,{className:`pointer-events-none absolute bottom-0 top-0 z-[6] w-px bg-accent`,style:{left:8+E(Math.min(l,c),ne)},children:(0,G.jsx)(`div`,{className:`absolute -left-[5px] top-0 h-0 w-0 border-x-[5px] border-t-[7px] border-x-transparent border-t-accent`})})]})]}),o&&(0,G.jsx)(pb,{tl:o,time:l,selMarker:h,onSelectMarker:g})]})]})}function fb({name:e,x:t,selected:n,onSelect:r,onDrag:i}){let a=(0,O.useRef)(null);return(0,G.jsxs)(`button`,{type:`button`,title:e,"aria-label":e,"aria-pressed":n,onPointerDown:e=>{e.stopPropagation(),e.target.setPointerCapture(e.pointerId),a.current={x:e.clientX,moved:!1},r()},onPointerMove:e=>{let t=a.current;!t||!t.moved&&Math.abs(e.clientX-t.x)<3||(t.moved=!0,i(e.clientX,e.altKey,!1))},onPointerUp:e=>{let t=a.current;a.current=null,t?.moved&&i(e.clientX,e.altKey,!0)},className:`absolute top-0 z-[4] flex h-full cursor-ew-resize items-center outline-none`,style:{left:t},children:[(0,G.jsx)(`span`,{className:W(`absolute left-0 top-0 h-full w-px`,n?`bg-key`:`bg-key/60`)}),(0,G.jsx)(`span`,{className:W(`ml-px max-w-[90px] truncate rounded-r-sm px-1 text-[9px] font-medium leading-[13px]`,n?`bg-key text-ink-0`:`bg-key/25 text-key`),children:e})]})}function pb({tl:e,time:t,selMarker:n,onSelectMarker:r}){let{t:i}=U(),{edit:a,player:o,store:s}=Q(),c=()=>s.getSnapshot().scene,l=Object.entries(e.markers??{}).sort((e,t)=>e[1]-t[1]),u=Object.entries(e.segments??{}),d=l.map(([e])=>e);return(0,G.jsxs)(`div`,{className:`flex w-[300px] shrink-0 flex-col overflow-y-auto border-l border-line bg-ink-1`,children:[(0,G.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-1 border-b border-line/60 pl-2.5 pr-1 text-2xs font-semibold text-fg-muted`,children:[(0,G.jsx)(At,{size:10,className:`text-key`}),(0,G.jsx)(`span`,{className:`flex-1`,children:i(`timeline.markers`)}),(0,G.jsx)(Y,{label:i(`timeline.addMarker`),className:`h-5 w-5`,onClick:()=>{let e=tb(c(),Ky(t));a(e.ops),r(e.name)},children:(0,G.jsx)(lr,{size:11})})]}),l.map(([t,o])=>(0,G.jsxs)(`div`,{className:W(`flex items-center gap-1 px-2 py-0.5`,n===t&&`bg-key/10`),onClick:()=>r(t),children:[(0,G.jsx)(K_,{value:t,onCommit:e=>{let n=nb(c(),t,e.trim());n.length&&(a(n),r(e.trim()))},mono:!0,className:`text-2xs`,ariaLabel:i(`timeline.markerName`)}),(0,G.jsx)(hy,{value:o,min:0,max:e.duration,step:.05,suffix:`s`,className:`w-[70px] flex-none`,onChange:(e,n)=>a(eb(c(),t,e),n?void 0:{coalesce:`marker:${t}`}),ariaLabel:i(`timeline.markerTime`)}),(0,G.jsx)(Y,{label:i(`timeline.removeMarker`),className:`h-5 w-5`,onClick:()=>a(rb(c(),t)),children:(0,G.jsx)(Fi,{size:11})})]},t)),!l.length&&(0,G.jsx)(`div`,{className:`px-2.5 py-1 text-2xs leading-snug text-fg-faint`,children:i(`timeline.noMarkers`)}),(0,G.jsxs)(`div`,{className:`mt-1 flex h-7 shrink-0 items-center gap-1 border-y border-line/60 pl-2.5 pr-1 text-2xs font-semibold text-fg-muted`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-accent`}),(0,G.jsx)(`span`,{className:`flex-1`,children:i(`timeline.segments`)}),(0,G.jsx)(Y,{label:i(`timeline.addSegment`),className:`h-5 w-5`,onClick:()=>a(ib(c(),t).ops),children:(0,G.jsx)(lr,{size:11})})]}),u.map(([t,n],r)=>{let s=Yy(n),l=`timeline.segments.${t}`,u=e=>{let t={...s,...e};for(let e of Object.keys(t))t[e]===void 0&&delete t[e];a([{op:`set`,path:l,value:t}])},f=o.segment?.name===t;return(0,G.jsxs)(`div`,{className:`border-b border-line/40 px-2 py-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full`,style:{background:cb[r%cb.length]}}),(0,G.jsx)(K_,{value:t,onCommit:e=>{let n=ab(c(),t,e.trim());n.length&&a(n)},mono:!0,className:`text-2xs`,ariaLabel:i(`timeline.segmentName`)}),(0,G.jsx)(Y,{label:i(`timeline.playSegment`),active:f,className:`h-5 w-5`,onClick:()=>o.playSegment(t),children:(0,G.jsx)(sr,{size:10})}),(0,G.jsx)(Y,{label:i(`timeline.playReverse`),className:`h-5 w-5`,onClick:()=>o.playSegment(t,{reverse:!0}),children:(0,G.jsx)(hr,{size:10})}),(0,G.jsx)(Y,{label:i(`timeline.removeSegment`),className:`h-5 w-5`,onClick:()=>a(ob(c(),t)),children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsxs)(`div`,{className:`mt-1 grid grid-cols-2 gap-1`,children:[(0,G.jsx)(mb,{label:i(`timeline.from`),value:s.from,markers:d,max:e.duration,onChange:e=>u({from:e})}),(0,G.jsx)(mb,{label:i(`timeline.to`),value:s.to,markers:d,max:e.duration,onChange:e=>u({to:e})})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,G.jsx)(X,{value:s.loop===`pingpong`?`pingpong`:s.loop?`loop`:`once`,options:[{value:`once`,label:i(`timeline.once`)},{value:`loop`,label:i(`timeline.loop`)},{value:`pingpong`,label:i(`timeline.pingpong`)}],onChange:e=>u({loop:e===`once`?void 0:e!==`pingpong`||`pingpong`}),className:`flex-1`,ariaLabel:i(`timeline.loop`)}),(0,G.jsx)(hy,{label:`×`,value:s.speed??1,min:.05,max:10,step:.05,placeholder:s.speed===void 0,className:`w-[70px] flex-none`,onChange:e=>u({speed:e===1?void 0:e}),ariaLabel:i(`timeline.speed`)})]})]},t)}),!u.length&&(0,G.jsx)(`div`,{className:`px-2.5 py-1 text-2xs leading-snug text-fg-faint`,children:i(`timeline.noSegments`)})]})}function mb({label:e,value:t,markers:n,max:r,onChange:i}){let a=typeof t==`string`;return(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-0.5`,children:[(0,G.jsx)(`span`,{className:`w-6 shrink-0 text-2xs text-fg-faint`,children:e}),a?(0,G.jsx)(X,{value:t,options:n.includes(t)?n:[t,...n],onChange:i,className:`text-2xs`,ariaLabel:e}):(0,G.jsx)(hy,{value:t,min:0,max:r,step:.05,suffix:`s`,onChange:e=>i(e),ariaLabel:e}),n.length>0&&(0,G.jsx)(`button`,{type:`button`,title:a?`s`:`marker`,onClick:()=>i(a?0:n[0]),className:W(`flex h-5 w-4 shrink-0 items-center justify-center rounded`,a?`text-key`:`text-fg-faint hover:text-fg`),children:(0,G.jsx)(At,{size:9})})]})}function hb({x:e,selected:t,title:n,onSelect:r,onDrag:i,onDelete:a}){let o=(0,O.useRef)(null);return(0,G.jsx)(`button`,{type:`button`,title:n,"aria-label":n,"aria-pressed":t,onPointerDown:e=>{e.stopPropagation(),e.target.setPointerCapture(e.pointerId),o.current={x:e.clientX,moved:!1},r()},onPointerMove:e=>{let t=o.current;!t||!t.moved&&Math.abs(e.clientX-t.x)<3||(t.moved=!0,i(e.clientX,e.altKey,!1))},onPointerUp:e=>{let t=o.current;o.current=null,t?.moved&&i(e.clientX,e.altKey,!0)},onKeyDown:e=>{(e.key===`Delete`||e.key===`Backspace`)&&(e.stopPropagation(),e.preventDefault(),a())},className:`absolute top-1/2 z-[4] flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 cursor-ew-resize items-center justify-center outline-none`,style:{left:e},children:(0,G.jsx)(`span`,{className:W(`block h-2.5 w-2.5 rotate-45 rounded-[2px] border transition-transform`,t?`scale-125 border-white bg-key`:`border-key/80 bg-key/80 hover:bg-key`)})})}function gb({track:e,index:t,onChange:n,onDelete:r}){let{t:i}=U(),a=e.keys[t];if(!a)return null;let[o,s]=a,c=(r,i)=>{let a=e.keys.map((e,n)=>n===t?e.length===3?[e[0],r,e[2]]:[e[0],r]:e);n({...e,keys:a},t,i)};return(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 rounded-md bg-ink-2 py-0.5 pl-2 pr-0.5 text-xs`,children:[(0,G.jsx)(ft,{size:10,className:`text-key`,fill:`currentColor`}),(0,G.jsx)(hy,{value:o,min:0,step:.01,suffix:`s`,className:`w-[64px] flex-none bg-ink-1`,onChange:(r,i)=>{let a=Wy(e,t,r);n(a.track,a.index,i)},ariaLabel:i(`timeline.keyTime`)}),(0,G.jsx)(`div`,{className:`flex w-[200px] min-w-0 items-center`,children:typeof s==`number`?(0,G.jsx)(hy,{value:s,onChange:(e,t)=>c(e,t),className:`bg-ink-1`,ariaLabel:i(`timeline.keyValue`)}):typeof s==`boolean`?(0,G.jsx)(q_,{checked:s,onChange:e=>c(e,!0),ariaLabel:i(`timeline.keyValue`)}):Array.isArray(s)?(0,G.jsx)(_y,{value:s.map(e=>typeof e==`number`?e:0),onChange:(e,t)=>c(e,t)}):(0,G.jsx)(Ny,{value:String(s),onChange:(e,t)=>c(e,t)})}),(0,G.jsx)(`div`,{className:`w-[120px] min-w-0`,title:i(`timeline.keyEaseHint`),children:t>0&&(0,G.jsx)(wy,{compact:!0,value:a[2],placeholder:e.ease??`linear`,allowInherit:i(`timeline.trackEase`,{ease:e.ease??`linear`}),onChange:r=>{let i=e.keys.map((e,n)=>n===t?r?[e[0],e[1],r]:[e[0],e[1]]:e);n({...e,keys:i},t,!0)},ariaLabel:i(`timeline.keyEase`)})}),(0,G.jsx)(Y,{label:i(`timeline.deleteKey`),className:`h-6 w-6`,onClick:r,children:(0,G.jsx)(li,{size:12})})]})}function _b(e){return/objects#([A-Za-z][\w-]*)/.exec(e)?.[1]??null}function vb({issues:e,dense:t}){let{store:n}=Q();return(0,G.jsx)(`ul`,{className:`divide-y divide-line/70`,children:e.map((e,r)=>{let i=_b(e.path),a=i&&n.getSnapshot().scene&&Nc(n.getSnapshot().scene.objects,i),o=e.severity===`error`?Ke:e.severity===`warning`?hi:pn;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,disabled:!a,onClick:()=>a&&n.select(i),className:W(`flex w-full items-start gap-2 px-3 text-left enabled:hover:bg-ink-2`,t?`py-1`:`py-1.5`),children:[(0,G.jsx)(o,{size:13,className:W(`mt-0.5 shrink-0`,e.severity===`error`?`text-danger`:e.severity===`warning`?`text-warn`:`text-accent`)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-xs text-fg`,children:e.message}),e.hint&&(0,G.jsx)(`div`,{className:`text-2xs text-fg-muted`,children:e.hint}),(0,G.jsxs)(`div`,{className:`font-mono text-2xs text-fg-faint`,children:[e.code,` · `,e.path||`scene`]})]})]})},r)})})}function yb({label:e,value:t,max:n,unit:r}){let i=n?Math.min(1,t/n):0,a=n!==void 0&&t>n;return(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between text-2xs text-fg-muted`,children:[(0,G.jsx)(`span`,{children:e}),(0,G.jsxs)(`span`,{className:W(`tabular-nums`,a?`text-danger`:`text-fg`),children:[t.toLocaleString(),` `,r,n?(0,G.jsxs)(`span`,{className:`text-fg-faint`,children:[` / `,n.toLocaleString()]}):null]})]}),n?(0,G.jsx)(`div`,{className:`mt-1 h-1 overflow-hidden rounded-full bg-ink-3`,children:(0,G.jsx)(`div`,{className:W(`h-full rounded-full`,a?`bg-danger`:i>.8?`bg-warn`:`bg-agent`),style:{width:`${i*100}%`}})}):null]})}function bb(){let{t:e}=U(),{runCheck:t}=Q(),n=tv(e=>e.check),r=tv(e=>e.checkRunning);if(!n)return(0,G.jsxs)(X_,{icon:(0,G.jsx)(Nr,{size:22}),title:e(`check.emptyTitle`),children:[(0,G.jsx)(`p`,{className:`mb-3 max-w-sm`,children:e(`check.emptyBody`)}),(0,G.jsxs)(G_,{variant:`primary`,size:`xs`,onClick:()=>void t(),disabled:r,children:[r?(0,G.jsx)(Nn,{size:11,className:`animate-spin`}):(0,G.jsx)(Nr,{size:11}),` `,e(`check.run`)]})]});let i=n.budget;return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,G.jsxs)(`div`,{className:`w-[300px] shrink-0 space-y-3 overflow-auto border-r border-line p-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`div`,{className:W(`rounded-md px-2 py-0.5 text-xs font-semibold`,n.ok?`bg-agent/15 text-agent`:`bg-danger/15 text-danger`),children:n.ok?e(`check.ready`):e(`check.notReady`)}),(0,G.jsx)(`span`,{className:`text-2xs text-fg-faint`,children:new Date(n.at).toLocaleTimeString()}),(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,className:`ml-auto`,onClick:()=>void t(),disabled:r,children:[r?(0,G.jsx)(Nn,{size:11,className:`animate-spin`}):(0,G.jsx)(pr,{size:11}),` `,e(`check.rerun`)]})]}),(0,G.jsxs)(`div`,{className:`flex gap-3 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-danger`,children:e(`check.errors`,{n:n.counts?.errors??0})}),(0,G.jsx)(`span`,{className:`text-warn`,children:e(`check.warnings`,{n:n.counts?.warnings??0})}),(0,G.jsx)(`span`,{className:`text-fg-muted`,children:e(`check.infos`,{n:n.counts?.infos??0})})]}),i&&(0,G.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,G.jsx)(yb,{label:e(`check.triangles`),value:i.estimatedTriangles??0,unit:``}),(0,G.jsx)(yb,{label:e(`check.weight`),value:Math.round(i.totalKb??0),max:i.budgetKb,unit:`KB`}),i.runtimeKb?(0,G.jsx)(yb,{label:e(`check.runtime`),value:Math.round(i.runtimeKb),unit:`KB`}):null]}),i?.heaviestObjects?.length?(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-2xs text-fg-muted`,children:e(`check.heaviest`)}),i.heaviestObjects.slice(0,5).map(e=>(0,G.jsxs)(`div`,{className:`flex justify-between text-2xs`,children:[(0,G.jsx)(`span`,{className:`font-mono text-fg`,children:e.id}),(0,G.jsx)(`span`,{className:`tabular-nums text-fg-faint`,children:e.triangles.toLocaleString()})]},e.id))]}):null,n.licences?.length?(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-2xs text-fg-muted`,children:e(`check.licences`)}),n.licences.map(e=>(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:e.attribution},e.path))]}):null]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:n.issues.length?(0,G.jsx)(vb,{issues:n.issues}):(0,G.jsx)(`div`,{className:`p-4 text-xs text-agent`,children:e(`check.clean`)})})]})}function xb(e){return Jh(`fields.${e}`)??Cb(e)}var Sb={kb:`KB`,dpr:`DPR`,ior:`IOR`,svg:`SVG`,hdri:`HDRI`,fov:`FOV`,ui:`UI`,id:`ID`,url:`URL`};function Cb(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).toLowerCase().split(` `).filter(Boolean).map(e=>Sb[e]??e);if(!t.length)return e;let n=t[0];return t[0]=n===n.toUpperCase()?n:n[0].toUpperCase()+n.slice(1),t.join(` `)}function wb({spec:e,value:t,onChange:n}){let r=sy(e,t),i=t===void 0,a=i&&e.default===void 0,o=(t,r)=>{let i=py(e,t);i.ok&&n(i.drop?void 0:i.value,r)};switch(e.type){case`number`:case`integer`:return e.min!==void 0&&e.max!==void 0&&e.max-e.min<=1e4?(0,G.jsx)(vy,{value:Number(r)||0,min:e.min,max:e.max,integer:e.type===`integer`,placeholder:i,empty:a,onChange:(e,t)=>o(e,t),ariaLabel:e.name}):(0,G.jsx)(hy,{value:Number(r)||0,min:e.min,max:e.max,integer:e.type===`integer`,placeholder:i,empty:a,onChange:(e,t)=>o(e,t),ariaLabel:e.name});case`boolean`:return(0,G.jsx)(q_,{checked:!!r,onChange:e=>o(e,!0),ariaLabel:e.name});case`color`:return(0,G.jsx)(Ny,{value:String(r),placeholder:i,onChange:(e,t)=>o(e,t)});case`colors`:return(0,G.jsx)(Py,{value:Array.isArray(r)?r:[],onChange:(e,t)=>o(e,t)});case`vec2`:case`vec3`:return(0,G.jsx)(_y,{value:Array.isArray(r)?r:e.type===`vec2`?[0,0]:[0,0,0],labels:e.type===`vec2`?[`X`,`Y`]:void 0,placeholder:i,onChange:(e,t)=>o(e,t)});case`enum`:return(0,G.jsx)(X,{value:String(r??``),options:e.options??[],onChange:e=>o(e,!0),ariaLabel:e.name});case`array`:return e.options?.length?(0,G.jsx)(Tb,{value:Array.isArray(r)?r:[],options:e.options,onChange:e=>o(e,!0)}):(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,G.jsx)(Eb,{value:r,onCommit:e=>o(e,!0)}),e.description&&(0,G.jsx)(`span`,{className:`text-[10px] leading-snug text-fg-faint`,children:e.description})]});case`string`:return(0,G.jsx)(K_,{value:String(r??``),onCommit:e=>n(e===``?void 0:e,!0),ariaLabel:e.name});default:return(0,G.jsx)(Eb,{value:r,onCommit:e=>o(e,!0)})}}function Tb({value:e,options:t,onChange:n}){return(0,G.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-wrap gap-1 py-0.5`,children:t.map(t=>{let r=e.includes(t);return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>n(r?e.filter(e=>e!==t):[...e,t]),className:`h-5 rounded-full border px-2 text-2xs transition-colors ${r?`border-accent/60 bg-accent/15 text-accent`:`border-line text-fg-muted hover:border-fg-faint hover:text-fg`}`,children:t},t)})})}function Eb({value:e,onCommit:t,rows:n=3}){let r=JSON.stringify(e??null),[i,a]=(0,O.useState)(r),[o,s]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{a(r),s(!1)},[r]),(0,G.jsx)(`textarea`,{value:i,rows:n,spellCheck:!1,onChange:e=>a(e.target.value),onBlur:()=>{try{let e=JSON.parse(i);s(!1),JSON.stringify(e)!==r&&t(e)}catch{s(!0)}},className:`field h-auto resize-y py-1 font-mono text-2xs leading-snug ${o?`border-danger/70`:``}`})}function Db({spec:e,value:t,onChange:n}){return U(),(0,G.jsx)(Z,{label:xb(e.name),hint:e.description,overridden:t!==void 0,onReset:()=>n(void 0,!0),align:e.type===`array`&&!e.options?.length||e.type===`object`?`start`:`center`,children:(0,G.jsx)(wb,{spec:e,value:t,onChange:n})})}function $({specs:e,base:t,values:n,skip:r}){let i=Ob();return(0,G.jsx)(G.Fragment,{children:e.filter(e=>!r?.includes(e.name)).map(e=>(0,G.jsx)(Db,{spec:e,value:n?.[e.name],onChange:(n,r)=>i(t?`${t}.${e.name}`:e.name,n,r)},e.name))})}function Ob(){let{edit:e,store:t}=Q();return ev(),(n,r,i=!0,a=[])=>{let o=t.getSnapshot().scene;if(!o)return;let s=[...y_(o,n,r),...a];s.length&&e(s,{coalesce:`field:${n}`})}}var kb=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function Ab({specs:e,path:t,value:n,expand:r,collapse:i,skip:a}){let o=Ob(),s=kb(n)?n:r?r(n):{};return(0,G.jsx)(G.Fragment,{children:e.filter(e=>!a?.includes(e.name)).map(e=>(0,G.jsx)(Db,{spec:e,value:s[e.name],onChange:(n,r)=>{let a={...s};n===void 0?delete a[e.name]:a[e.name]=n,o(t,i?i(a):a,r)}},e.name))})}function jb(e){let t=no.filter(t=>t in e);return t.length===1?t[0]:null}var Mb=[`click`,`hover`,`hoverEnd`],Nb=[`click`,`key`];function Pb(e){return[`timeline`,...Object.keys(e.timeline?.segments??{})]}function Fb(e){let t=[];return Pc(e.objects,e=>void(e.kind===`model`&&t.push(e.id))),t}function Ib(e,t){let n=Pb(t);switch(e){case`play`:return{play:n[1]??`timeline`};case`toggle`:return{toggle:n[1]??`timeline`};case`seek`:return{seek:Object.keys(t.timeline?.markers??{})[0]??0};case`set`:{let e=t.objects[0]?.id??`camera`;return Pc(t.objects,n=>void(n.kind!==`group`&&e===t.objects[0]?.id&&(e=n.id))),{set:{path:`${e}.scale`,value:1.1},duration:.3,ease:`outCubic`}}case`emit`:return{emit:`clicked`};case`openUrl`:return{openUrl:`https://example.com`,newTab:!0};case`playClip`:return{playClip:0,target:Fb(t)[0]??``}}}function Lb(e,t=`click`){let n=e.objects[0]?.id,r={on:t,do:[Ib(e.timeline?.segments?`play`:`emit`,e)]};return Mb.includes(t)&&n&&(r.target=n),t===`key`&&(r.key=`Space`),t===`event`&&(r.event=Object.keys(e.timeline?.markers??{})[0]??`clicked`),t===`scroll`&&(r.at=.5),r}function Rb(e,t,n){let r={on:t,do:e.do,...e.once===void 0?{}:{once:e.once}};return Mb.includes(t)&&e.target&&(r.target=e.target),t===`key`&&(r.key=e.key??`Space`),t===`event`&&(r.event=e.event??Object.keys(n.timeline?.markers??{})[0]??`clicked`),t===`scroll`&&(r.at=e.at??.5),r}function zb(e,t){if(`openUrl`in e){if(!Eo(e.openUrl))return`url`;if(!Nb.includes(t))return`gesture`}return null}function Bb(e){let t=[];Pc(e.objects,e=>{t.push(`${e.id}.position`,`${e.id}.rotation`,`${e.id}.scale`,`${e.id}.visible`),(`material`in e||e.kind===`mesh`||e.kind===`text`)&&t.push(`${e.id}.material.color`,`${e.id}.material.emissiveIntensity`,`${e.id}.material.opacity`)});for(let n of e.lights??[])n.id&&t.push(`${n.id}.intensity`,`${n.id}.color`);return t.push(`camera.position`,`camera.target`,`camera.fov`),t}function Vb(){let{t:e}=U(),{edit:t}=Q(),n=ev().scene,r=n.interactions??[],i=(e,n)=>t(e.length?[{op:`set`,path:`interactions`,value:e}]:r.length?[{op:`remove`,path:`interactions`}]:[],n?{coalesce:n}:void 0),a=(e,t,n)=>i(r.map((n,r)=>r===e?t:n),n);return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line px-3`,children:[(0,G.jsx)(Li,{size:12,className:`text-accent`}),(0,G.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e(`interactions.intro`)}),(0,G.jsxs)(G_,{size:`xs`,variant:`subtle`,className:`ml-auto`,onClick:()=>i([...r,Lb(n)]),children:[(0,G.jsx)(lr,{size:11}),` `,e(`interactions.add`)]})]}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[!r.length&&(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-1 text-center text-xs text-fg-faint`,children:[(0,G.jsx)(Un,{size:18}),(0,G.jsx)(`div`,{children:e(`interactions.empty`)}),(0,G.jsx)(`div`,{className:`max-w-md text-2xs`,children:e(`interactions.emptyHint`)})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(420px,1fr))] gap-2`,children:r.map((e,t)=>(0,G.jsx)(Hb,{it:e,index:t,onChange:(e,n)=>a(t,e,n),onRemove:()=>i(r.filter((e,n)=>n!==t))},t))})]})]})}function Hb({it:e,index:t,onChange:n,onRemove:r}){let{t:i}=U(),{player:a}=Q(),o=ev().scene,s=Rc(o),c=Object.keys(o.timeline?.markers??{}),l=e.on,u=(t,r,i)=>n({...e,do:e.do.map((e,n)=>n===t?r:e)},i);return(0,G.jsxs)(`div`,{className:`rounded-lg border border-line bg-ink-0/40`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b border-line/60 px-2 py-1.5`,children:[(0,G.jsx)(`span`,{className:`text-2xs font-semibold uppercase tracking-wide text-fg-faint`,children:i(`interactions.when`)}),(0,G.jsx)(X,{value:l,options:to.map(e=>({value:e,label:i(`interactions.on.${e}`)})),onChange:t=>n(Rb(e,t,o)),className:`w-[118px] flex-none`,ariaLabel:i(`interactions.when`)}),Mb.includes(l)&&(0,G.jsx)(X,{value:e.target??``,placeholder:i(`interactions.anywhere`),options:s,onChange:t=>n({...e,target:t||void 0}),className:`w-[130px] flex-none`,ariaLabel:i(`interactions.target`)}),l===`key`&&(0,G.jsx)(K_,{value:e.key??``,placeholder:`Space, KeyE, ArrowRight`,onCommit:t=>n({...e,key:t.trim()}),mono:!0,className:`w-[130px] flex-none`,ariaLabel:i(`interactions.key`)}),l===`event`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K_,{value:e.event??``,placeholder:i(`interactions.eventName`),onCommit:t=>n({...e,event:t.trim()}),mono:!0,className:`w-[110px] flex-none`,ariaLabel:i(`interactions.eventName`)}),c.length>0&&(0,G.jsx)(X,{value:``,placeholder:i(`interactions.marker`),options:c,onChange:t=>t&&n({...e,event:t}),className:`w-[90px] flex-none`,ariaLabel:i(`interactions.marker`)})]}),l===`scroll`&&(0,G.jsx)(`div`,{className:`flex w-[150px] items-center`,children:(0,G.jsx)(vy,{value:e.at??.5,min:0,max:1,onChange:(r,i)=>n({...e,at:r},i?void 0:`ix:${t}:at`),ariaLabel:i(`interactions.at`)})}),(0,G.jsxs)(`label`,{className:`ml-auto flex items-center gap-1 text-2xs text-fg-muted`,title:i(`interactions.onceHint`),children:[i(`interactions.once`),(0,G.jsx)(q_,{checked:!!e.once,onChange:t=>n({...e,once:t||void 0}),ariaLabel:i(`interactions.once`)})]}),(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,title:i(`interactions.testHint`),onClick:()=>a.player?.trigger?.(l,l===`key`?e.key:l===`event`?e.event:e.target),children:[(0,G.jsx)(Li,{size:11}),` `,i(`interactions.test`)]}),(0,G.jsx)(Y,{label:i(`interactions.remove`),className:`h-6 w-6`,onClick:r,children:(0,G.jsx)(Fi,{size:12})})]}),(0,G.jsxs)(`div`,{className:`space-y-1 p-2`,children:[e.do.map((r,i)=>(0,G.jsx)(Ub,{action:r,on:l,index:t,j:i,onChange:(e,t)=>u(i,e,t),onRemove:e.do.length>1?()=>n({...e,do:e.do.filter((e,t)=>t!==i)}):void 0},i)),(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,onClick:()=>n({...e,do:[...e.do,Ib(`emit`,o)]}),children:[(0,G.jsx)(lr,{size:11}),` `,i(`interactions.addAction`)]})]})]})}function Ub({action:e,on:t,index:n,j:r,onChange:i,onRemove:a}){let{t:o}=U(),s=ev().scene,c=jb(e),l=Pb(s),u=Object.keys(s.timeline?.markers??{}),d=zb(e,t),f=`ix:${n}:${r}`;return(0,G.jsxs)(`div`,{className:W(`rounded-md border px-1.5 py-1`,d?`border-danger/50 bg-danger/5`:`border-line/70`),children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`w-5 text-center text-2xs text-fg-faint`,children:r===0?`→`:`+`}),(0,G.jsx)(X,{value:c??``,options:no.map(e=>({value:e,label:o(`interactions.do.${e}`)})),onChange:e=>i(Ib(e,s)),className:`w-[128px] flex-none`,ariaLabel:o(`interactions.action`)}),`play`in e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(X,{value:e.play,options:l,onChange:t=>i({...e,play:t}),className:`w-[120px] flex-none`,ariaLabel:o(`interactions.segment`)}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1 text-2xs text-fg-muted`,children:[o(`interactions.reverse`),(0,G.jsx)(q_,{checked:!!e.reverse,onChange:t=>i({play:e.play,...t?{reverse:!0}:{}}),ariaLabel:o(`interactions.reverse`)})]})]}),`toggle`in e&&(0,G.jsx)(X,{value:e.toggle,options:l,onChange:e=>i({toggle:e}),className:`w-[120px] flex-none`,ariaLabel:o(`interactions.segment`)}),`seek`in e&&(0,G.jsxs)(G.Fragment,{children:[typeof e.seek==`number`?(0,G.jsx)(hy,{value:e.seek,min:0,step:.05,suffix:`s`,className:`w-[80px] flex-none`,onChange:e=>i({seek:e}),ariaLabel:o(`interactions.seek`)}):(0,G.jsx)(X,{value:e.seek,options:u.includes(e.seek)?u:[e.seek,...u],onChange:e=>i({seek:e}),className:`w-[110px] flex-none`,ariaLabel:o(`interactions.seek`)}),u.length>0&&(0,G.jsx)(G_,{size:`xs`,variant:`ghost`,onClick:()=>i({seek:typeof e.seek==`number`?u[0]:0}),children:typeof e.seek==`number`?o(`interactions.useMarker`):o(`interactions.useSeconds`)})]}),`emit`in e&&(0,G.jsx)(K_,{value:e.emit,onCommit:t=>i({...e,emit:t.trim()}),mono:!0,className:`w-[140px] flex-none`,ariaLabel:o(`interactions.eventName`)}),`openUrl`in e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Wb,{value:e.openUrl,onCommit:t=>i({...e,openUrl:t})}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1 text-2xs text-fg-muted`,children:[o(`interactions.newTab`),(0,G.jsx)(q_,{checked:e.newTab!==!1&&e.newTab!==void 0,onChange:t=>i({openUrl:e.openUrl,...t?{newTab:!0}:{}}),ariaLabel:o(`interactions.newTab`)})]})]}),`playClip`in e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(X,{value:e.target,placeholder:`—`,options:Fb(s),onChange:t=>i({...e,target:t}),className:`w-[110px] flex-none`,ariaLabel:o(`interactions.model`)}),(0,G.jsx)(K_,{value:String(e.playClip),onCommit:t=>i({...e,playClip:/^\d+$/.test(t.trim())?Number(t.trim()):t.trim()}),mono:!0,className:`w-[90px] flex-none`,ariaLabel:o(`interactions.clip`),placeholder:`clip`}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1 text-2xs text-fg-muted`,children:[o(`timeline.loop`),(0,G.jsx)(q_,{checked:e.loop!==!1,onChange:t=>i({...e,loop:t?void 0:!1}),ariaLabel:o(`timeline.loop`)})]})]}),a&&(0,G.jsx)(Y,{label:o(`interactions.removeAction`),className:`ml-auto h-5 w-5`,onClick:a,children:(0,G.jsx)(Fi,{size:11})})]}),`set`in e&&(0,G.jsx)(Gb,{action:e,onChange:i,coalesce:f}),`emit`in e&&(0,G.jsxs)(`div`,{className:`mt-1 flex items-start gap-1 pl-6`,children:[(0,G.jsx)(`span`,{className:`w-14 pt-1 text-2xs text-fg-faint`,children:o(`interactions.payload`)}),(0,G.jsx)(Eb,{value:e.payload??null,rows:1,onCommit:t=>i(t===null?{emit:e.emit}:{emit:e.emit,payload:t})})]}),d&&(0,G.jsxs)(`div`,{className:`mt-1 flex items-center gap-1 pl-6 text-2xs text-danger`,children:[(0,G.jsx)(hi,{size:10}),` `,o(d===`url`?`interactions.badUrl`:`interactions.needsGesture`)]})]})}function Wb({value:e,onCommit:t}){let{t:n}=U(),[r,i]=(0,O.useState)(e),[a,o]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{i(e),o(!1)},[e]),(0,G.jsxs)(`div`,{className:`flex min-w-[160px] flex-1 flex-col`,children:[(0,G.jsx)(`input`,{value:r,spellCheck:!1,"aria-label":`URL`,"aria-invalid":a,placeholder:n(`ui.urlPlaceholder`),onChange:e=>i(e.target.value),onBlur:()=>{let n=r.trim();if(n===e)return o(!1);if(!Eo(n))return o(!0);o(!1),t(n)},onKeyDown:t=>{t.key===`Enter`&&t.target.blur(),t.key===`Escape`&&i(e)},className:W(`field font-mono text-xs`,a&&`!border-danger/70`)}),a&&(0,G.jsx)(`span`,{className:`mt-0.5 text-2xs text-danger`,children:n(`interactions.badUrl`)})]})}function Gb({action:e,onChange:t,coalesce:n}){let{t:r}=U(),i=ev().scene,a=`set-paths-${n}`,o=e.set.value;return(0,G.jsxs)(`div`,{className:`mt-1 space-y-1 pl-6`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`w-14 text-2xs text-fg-faint`,children:r(`interactions.path`)}),(0,G.jsx)(`input`,{list:a,defaultValue:e.set.path,onBlur:n=>n.target.value.trim()!==e.set.path&&t({...e,set:{...e.set,path:n.target.value.trim()}}),onKeyDown:e=>e.key===`Enter`&&e.target.blur(),spellCheck:!1,className:`field font-mono text-xs`,"aria-label":r(`interactions.path`)},e.set.path),(0,G.jsx)(`datalist`,{id:a,children:Bb(i).map(e=>(0,G.jsx)(`option`,{value:e},e))})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`w-14 text-2xs text-fg-faint`,children:r(`interactions.value`)}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,G.jsx)(Eb,{value:o,rows:1,onCommit:n=>t({...e,set:{...e.set,value:n}})})})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`w-14 text-2xs text-fg-faint`,children:r(`interactions.tween`)}),(0,G.jsx)(hy,{value:e.duration??0,min:0,step:.05,suffix:`s`,className:`w-[72px] flex-none`,placeholder:e.duration===void 0,onChange:(r,i)=>t({...e,duration:r||void 0},i?void 0:n),ariaLabel:r(`interactions.tween`)}),(0,G.jsx)(`div`,{className:`w-[150px]`,children:(0,G.jsx)(wy,{value:e.ease,placeholder:`linear`,onChange:n=>t({...e,ease:n})})})]})]})}function Kb(){let{t:e}=U(),{store:t}=Q(),n=ev(),r=(0,O.useMemo)(()=>JSON.stringify(n.scene,null,2),[n.scene]),[i,a]=(0,O.useState)(r),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)({issues:n.issues,scene:n.scene}),u=(0,O.useRef)(null);(0,O.useEffect)(()=>{o||(a(r),l({issues:n.issues,scene:n.scene}))},[r,o,n.issues,n.scene]);let d=e=>{a(e),s(e!==r),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{try{let t=JSON.parse(e);l({scene:t,issues:ks(t)})}catch(e){l({error:e.message,issues:[]})}},250)},f=c.issues.filter(e=>e.severity===`error`).length,p=i.split(`
|
|
477
|
-
`).length;return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,G.jsxs)(`div`,{className:`relative flex min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{"aria-hidden":!0,className:`w-10 shrink-0 select-none overflow-hidden border-r border-line bg-ink-0/40 pt-2 text-right font-mono text-2xs leading-[18px] text-fg-faint`,children:Array.from({length:Math.min(p,5e3)},(e,t)=>(0,G.jsx)(`div`,{className:`pr-2`,children:t+1},t))}),(0,G.jsx)(`textarea`,{value:i,spellCheck:!1,wrap:`off`,"aria-label":`scene.json`,onChange:e=>d(e.target.value),onScroll:e=>{let t=e.currentTarget.previousElementSibling;t.scrollTop=e.currentTarget.scrollTop},onKeyDown:e=>{if(e.key===`Tab`){e.preventDefault();let t=e.currentTarget,{selectionStart:n,selectionEnd:r}=t,a=i.slice(0,n)+` `+i.slice(r);d(a),requestAnimationFrame(()=>t.setSelectionRange(n+2,n+2))}},className:`min-w-0 flex-1 resize-none overflow-auto whitespace-pre bg-transparent p-2 font-mono text-xs leading-[18px] text-fg outline-none`})]}),(0,G.jsxs)(`div`,{className:`flex w-[340px] shrink-0 flex-col border-l border-line`,children:[(0,G.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-1.5 border-b border-line px-2`,children:[(0,G.jsx)(`span`,{className:W(`text-xs`,c.error||f?`text-danger`:`text-agent`),children:c.error?e(`json.invalidJson`):f?e(`json.errors`,{n:f}):e(`json.valid`)}),(0,G.jsxs)(`div`,{className:`ml-auto flex gap-1`,children:[(0,G.jsx)(G_,{size:`xs`,variant:`ghost`,disabled:!!c.error,title:e(`json.format`),onClick:()=>c.scene&&d(JSON.stringify(c.scene,null,2)),children:(0,G.jsx)(Di,{size:11})}),(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,disabled:!o,onClick:()=>(s(!1),a(r)),children:[(0,G.jsx)(yr,{size:11}),` `,e(`json.revert`)]}),(0,G.jsxs)(G_,{size:`xs`,variant:`primary`,disabled:!o||!!c.error||f>0,title:f?e(`json.fixFirst`):void 0,onClick:()=>{c.scene&&(t.replace(c.scene),s(!1))},children:[(0,G.jsx)(Pe,{size:11}),` `,e(`json.apply`)]})]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:c.error?(0,G.jsx)(`div`,{className:`p-3 font-mono text-xs text-danger`,children:c.error}):c.issues.length?(0,G.jsx)(vb,{issues:c.issues,dense:!0}):(0,G.jsx)(`div`,{className:`p-3 text-xs text-fg-faint`,children:e(`json.noIssues`)})}),o&&(0,G.jsx)(`div`,{className:`border-t border-line px-3 py-1.5 text-2xs text-key`,children:e(`json.unapplied`)})]})]})}var qb=[{id:`timeline`,label:`bottom.timeline`,icon:jn,key:`T`},{id:`interactions`,label:`bottom.interactions`,icon:Un,key:``},{id:`json`,label:`bottom.json`,icon:Ee,key:`J`},{id:`check`,label:`bottom.check`,icon:Nr,key:``}];function Jb(){let{t:e}=U(),{ui:t}=Q(),n=ev(),r=tv(e=>e.bottom),i=tv(e=>e.bottomHeight),a=tv(e=>e.check),o=(0,O.useRef)(null),s=n.scene?.timeline?.tracks.length??0,c=n.issues.filter(e=>e.severity===`error`).length;return(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-col border-t border-line bg-ink-1`,style:{height:r?i:34},children:[r&&(0,G.jsx)(`div`,{className:`h-1 shrink-0 cursor-ns-resize hover:bg-accent/40`,onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),o.current={y:e.clientY,h:i}},onPointerMove:e=>{o.current&&t.set({bottomHeight:Math.max(140,Math.min(window.innerHeight*.7,o.current.h-(e.clientY-o.current.y)))})},onPointerUp:()=>o.current=null}),(0,G.jsxs)(`div`,{className:`flex h-[33px] shrink-0 items-center gap-0.5 border-b border-line px-1.5`,role:`tablist`,children:[qb.map(i=>{let o=i.icon,l=i.id===`timeline`?s:i.id===`interactions`?n.scene?.interactions?.length??0:i.id===`json`?c:a?(a.counts?.errors??0)+(a.counts?.warnings??0):0;return(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r===i.id,title:i.key?`${e(i.label)} (${i.key})`:e(i.label),onClick:()=>t.set({bottom:r===i.id?null:i.id}),className:W(`flex h-6 items-center gap-1.5 rounded-md px-2 text-xs`,r===i.id?`bg-ink-3 text-fg`:`text-fg-muted hover:text-fg`),children:[(0,G.jsx)(o,{size:12}),e(i.label),l>0&&(0,G.jsx)(`span`,{className:W(`rounded px-1 text-2xs`,i.id===`json`?`bg-danger/20 text-danger`:i.id===`check`?`bg-warn/20 text-warn`:`bg-ink-4 text-fg-muted`),children:l})]},i.id)}),(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(Y,{label:e(r?`bottom.collapse`:`bottom.expand`),onClick:()=>t.set({bottom:r?null:`timeline`}),className:`h-6 w-6`,children:r?(0,G.jsx)(Ie,{size:13}):(0,G.jsx)(He,{size:13})})})]}),r&&(0,G.jsxs)(`div`,{className:`min-h-0 flex-1`,children:[r===`timeline`&&(0,G.jsx)(db,{}),r===`interactions`&&(0,G.jsx)(Vb,{}),r===`json`&&(0,G.jsx)(Kb,{}),r===`check`&&(0,G.jsx)(bb,{})]})]})}function Yb({title:e,onClose:t,children:n,footer:r,width:i=560}){let a=(0,O.useRef)(null);return(0,O.useEffect)(()=>{let e=document.activeElement;a.current?.focus();let n=e=>e.key===`Escape`&&t();return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e?.focus?.()}},[t]),(0,G.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/55 p-4`,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,G.jsxs)(`div`,{ref:a,tabIndex:-1,role:`dialog`,"aria-modal":`true`,className:`toast-in flex max-h-[86vh] w-full flex-col overflow-hidden rounded-xl border border-line bg-ink-1 shadow-2xl shadow-black/50 outline-none focus-visible:outline-none`,style:{maxWidth:i},children:[(0,G.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-line pl-4 pr-2`,children:[(0,G.jsx)(`div`,{className:`text-base font-semibold`,children:e}),(0,G.jsx)(Y,{label:Yh(`ui.close`),onClick:t,children:(0,G.jsx)(Fi,{size:15})})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:n}),r&&(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-line px-4 py-2.5`,children:r})]})})}function Xb(e,t,n=`application/octet-stream`){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),setTimeout(()=>URL.revokeObjectURL(i),2e3)}function Zb(e){let t=e.split(`,`)[1]??``,n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}async function Qb(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}var $b=(e,t,n)=>e<t?t:e>n?n:e;function ex(e,t,n){if(!(t>0))return 0;if(!n)return Math.min(Math.max(e,0),t);if(n===`pingpong`){let n=e%(2*t);return n>t?2*t-n:n}return e%t}function tx(e,t,n){return typeof e==`number`&&Number.isFinite(e)?e:typeof e==`string`&&t&&typeof t[e]==`number`?t[e]:n}function nx(e,t){let n=Math.max(e.duration||0,.001);if(t===`timeline`)return{from:0,to:n,loop:e.loop,speed:1};let r=e.segments?.[t];if(!r)return null;let i=Array.isArray(r)?{from:r[0],to:r[1]}:r;return{from:$b(tx(i.from,e.markers,0),0,n),to:$b(tx(i.to,e.markers,n),0,n),loop:i.loop??!1,speed:typeof i.speed==`number`&&i.speed>0?i.speed:1}}function rx(e,t){let n=Math.abs(e.to-e.from),r=e.to>=e.from?1:-1;return e.from+r*(n<=0?0:ex(Math.max(0,t*e.speed),n,e.loop))}var ix=e=>e&&typeof e.speed==`number`&&e.speed>0?e.speed:1;function ax(e,t,n){let r=t?.timeline;return!r||!(r.duration>0)?e:$b(n?rx(n.range,Math.max(0,e-n.start)):rx({from:0,to:r.duration,loop:r.loop,speed:ix(r)},e),0,r.duration)}function ox(e,t){let n=t?.timeline;return!n||!(n.duration>0)?Math.max(0,e):$b(e,0,n.duration)/ix(n)}function sx(e){let t=e.timeline,n=!t||(t.trigger===void 0||t.trigger===`load`||t.trigger===`visible`)&&t.autoplay===void 0,r=!!e.scripts?.length;if(n&&!r)return e;let i=e;if(!n&&t){let{autoplay:e,...n}=t;i={...i,timeline:{...n,trigger:`load`}}}if(r){let{scripts:e,...t}=i;i=t}return i}var cx=null;function lx(){return cx||=Hl(()=>import(`./runtime-5Ti8UJJR.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),cx}var ux=class{player=null;sceneEditor=null;issues=[];playing=!1;latest=null;updating=!1;raf=0;timeListeners=new Set;stateListeners=new Set;scene=null;disposed=!1;interact=!1;segment=null;ready=!1;async mount(e,t,n,r){this.dispose(),this.disposed=!1,this.issues=[],this.ready=!1,this.scene=t,this.segment=null;let i=await lx();if(!this.disposed){this.player=i.mountScene(e,this.view(t),{...n,editor:r.editor,reducedMotion:!1,onError:e=>{this.issues=[...this.issues.slice(-30),e],this.notify()}});try{await this.player.ready}catch{}if(this.ready=!0,this.playing)this.player?.play();else{this.player?.pause();let e=t.target?.posterTime;e&&e>0&&await this.player?.seek(e).catch(()=>void 0)}this.loop(),this.notify()}}loop=()=>{cancelAnimationFrame(this.raf);let e=()=>{if(!this.player)return;let t=this.player.time();t<0&&!this.updating&&this.player.seek(0);let n=ax(Math.max(0,t),this.scene,this.segment);this.timeListeners.forEach(e=>e(n)),this.raf=requestAnimationFrame(e)};this.raf=requestAnimationFrame(e)};view(e){return this.interact?e:sx(e)}setInteract(e){this.interact!==e&&(this.interact=e,this.scene&&this.update(this.scene),e?this.play():this.pause())}update(e){this.segment=null,this.scene=e,this.latest=e,!this.updating&&this.player&&this.drain()}async drain(){for(this.updating=!0;this.latest&&this.player;){let e=this.latest;this.latest=null;let t=this.player.time();try{await this.player.update(this.view(e)),this.playing||await this.player.seek(t)}catch{}}this.updating=!1}play(){this.playing=!0,this.player?.play(),this.notify()}pause(){this.playing=!1,this.player?.pause(),this.notify()}toggle(){this.playing?this.pause():this.play()}async seek(e){this.playing&&this.pause(),this.segment&&(this.segment=null,await this.player?.seek(0));let t=ox(e,this.scene);await this.player?.seek(t),this.timeListeners.forEach(e=>e(ax(t,this.scene)))}playSegment(e,t={}){let n=this.scene?.timeline,r=n?nx(n,e):null;return!r||!this.player?.playSegment?!1:(this.player.playSegment(e,t),this.segment={name:e,range:t.reverse?{...r,from:r.to,to:r.from}:r,start:this.player.time()},this.play(),!0)}stats(){try{return this.player?.stats()??null}catch{return null}}pick(e,t){try{return this.player?.pick?.(e,t)??null}catch{return null}}snapshot(){try{return this.player?.snapshot(`image/png`)??null}catch{return null}}onTime(e){return this.timeListeners.add(e),()=>this.timeListeners.delete(e)}onState(e){return this.stateListeners.add(e),()=>this.stateListeners.delete(e)}notify(){this.stateListeners.forEach(e=>e())}dispose(){this.disposed=!0,cancelAnimationFrame(this.raf),this.sceneEditor?.dispose(),this.sceneEditor=null,this.player?.dispose(),this.player=null}};async function dx(e,t,n,r,i){let a=await lx(),o=document.createElement(`div`);o.style.cssText=`position:fixed;left:-10000px;top:0;width:${r}px;height:${i}px;`,document.body.appendChild(o);let s=a.mountScene(o,e,{...t,deterministic:!0,pixelRatio:1});try{return await s.ready,await s.seek(n),s.snapshot(`image/png`)}finally{s.dispose(),o.remove()}}var fx={mp4:30,webm:30,gif:15,webp:20,poster:0},px={mp4:`mp4`,webm:`webm`,gif:`gif`,webp:`webp`,poster:`webp`};function mx(e=`mp4`){return{kind:e,quality:`standard`,transparent:!1,image:`webp`}}function hx(e,t){let n=e.width&&e.height?`${Math.round(e.width)}x${Math.round(e.height)}`:void 0,r={out:t,...e.quality===`standard`?{}:{quality:e.quality},...n?{size:n}:{}};if(e.kind===`poster`)return{format:`poster`,image:e.image,...e.time===void 0?{}:{time:e.time},...e.transparent?{transparent:!0}:{},...r};let i={...e.fps?{fps:e.fps}:{},...e.duration?{duration:e.duration}:{}};return e.kind===`mp4`||e.kind===`webm`?{format:`video`,codec:e.kind,...i,...r}:{format:e.kind===`gif`?`gif`:`animated-webp`,...i,...e.transparent?{transparent:!0}:{},...r}}function gx({label:e,children:t,hint:n}){return(0,G.jsxs)(`label`,{className:`flex flex-col gap-1`,title:n,children:[(0,G.jsx)(`span`,{className:`text-2xs font-medium text-fg-muted`,children:e}),(0,G.jsx)(`div`,{className:`flex min-w-0 items-center gap-1`,children:t})]})}function _x({value:e,kinds:t,onChange:n}){let{t:r}=U();return(0,G.jsx)(`div`,{className:`flex gap-0.5 rounded-md bg-ink-2 p-0.5`,role:`radiogroup`,children:t.map(t=>(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e===t,onClick:()=>n(t),className:W(`h-7 flex-1 rounded px-2 text-xs font-medium`,e===t?`bg-ink-4 text-fg`:`text-fg-muted hover:text-fg`),children:r(`media.kind.${t}`)},t))})}function vx({value:e,onChange:t,scene:n}){let{t:r}=U(),i=n=>t({...e,...n}),a=e.kind!==`poster`,o=e.kind===`gif`||e.kind===`webp`||e.kind===`poster`,s=n.timeline?.duration&&n.timeline.duration>0?n.timeline.duration:5;return(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2.5 sm:grid-cols-4`,children:[(0,G.jsx)(gx,{label:r(`media.quality`),hint:r(`media.qualityHint`),children:(0,G.jsx)(X,{value:e.quality,options:[`draft`,`standard`,`high`,`ultra`].map(e=>({value:e,label:r(`media.q.${e}`)})),onChange:e=>i({quality:e}),ariaLabel:r(`media.quality`)})}),a?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(gx,{label:r(`media.fps`),children:(0,G.jsx)(hy,{value:e.fps??fx[e.kind],placeholder:e.fps===void 0,integer:!0,min:1,max:60,onChange:t=>i({fps:t===fx[e.kind]?void 0:t}),ariaLabel:r(`media.fps`)})}),(0,G.jsx)(gx,{label:r(`media.duration`),children:(0,G.jsx)(hy,{value:e.duration??s,placeholder:e.duration===void 0,min:.1,max:120,step:.1,suffix:`s`,onChange:e=>i({duration:e===s?void 0:e}),ariaLabel:r(`media.duration`)})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(gx,{label:r(`media.time`),children:(0,G.jsx)(hy,{value:e.time??n.target.posterTime??0,placeholder:e.time===void 0,min:0,step:.05,suffix:`s`,onChange:e=>i({time:e}),ariaLabel:r(`media.time`)})}),(0,G.jsx)(gx,{label:r(`media.image`),children:(0,G.jsx)(X,{value:e.image,options:[`webp`,`png`],onChange:e=>i({image:e}),ariaLabel:r(`media.image`)})})]}),(0,G.jsxs)(gx,{label:r(`media.size`),hint:r(`media.sizeHint`),children:[(0,G.jsx)(hy,{label:`W`,value:e.width??0,placeholder:!e.width,empty:!e.width,integer:!0,min:0,max:4096,onChange:e=>i({width:e||void 0}),ariaLabel:r(`media.width`)}),(0,G.jsx)(hy,{label:`H`,value:e.height??0,placeholder:!e.height,empty:!e.height,integer:!0,min:0,max:4096,onChange:e=>i({height:e||void 0}),ariaLabel:r(`media.height`)})]}),o&&(0,G.jsx)(gx,{label:r(`media.transparent`),hint:r(`media.transparentHint`),children:(0,G.jsx)(q_,{checked:e.transparent,onChange:e=>i({transparent:e}),ariaLabel:r(`media.transparent`)})})]})}var yx=[{id:`embed`,icon:it,title:`export.embed`,body:`export.embedBody`},{id:`zip`,icon:be,title:`export.zip`,body:`export.zipBody`},{id:`single-html`,icon:Et,title:`export.single`,body:`export.singleBody`},{id:`poster`,icon:sn,title:`export.poster`,body:`export.posterBody`},{id:`video`,icon:Ti,title:`export.video`,body:`export.videoBody`},{id:`gif`,icon:Ot,title:`export.gif`,body:`export.gifBody`}];function bx({label:e,hint:t,children:n}){return(0,G.jsxs)(`div`,{className:`grid grid-cols-[120px_1fr] items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-xs text-fg-muted`,title:t,children:e}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[n,t&&(0,G.jsx)(`span`,{className:`truncate text-2xs text-fg-faint`,children:t})]})]})}function xx(){let{t:e}=U(),{ui:t,backend:n,store:r}=Q(),i=ev().scene,a=n.capabilities,[o,s]=(0,O.useState)(a.exportFormats[0]??`poster`),[c,l]=(0,O.useState)(i.id),[u,d]=(0,O.useState)(a.render),[f,p]=(0,O.useState)(a.render),[m,h]=(0,O.useState)(``),[g,_]=(0,O.useState)(!1),[v,y]=(0,O.useState)(!0),[b,x]=(0,O.useState)(!1),[S,C]=(0,O.useState)(mx(`mp4`)),[w,T]=(0,O.useState)(!1),[ee,te]=(0,O.useState)(null),[E,ne]=(0,O.useState)(null),[D,re]=(0,O.useState)(null),[ie,ae]=(0,O.useState)(null),[oe,se]=(0,O.useState)(!1),ce=e=>a.exportFormats.includes(e),le=o===`embed`||o===`zip`,ue=le||o===`single-html`,de=o===`video`||o===`gif`||o===`poster`&&a.render,fe=async()=>{let e=oa(i.target.aspect,1200),t=await dx(i,await n.mountConfig(),i.target.posterTime??0,e.width,e.height),r=`renders/poster.png`;return await n.writeFile(r,Zb(t)),ae({url:t,dataUrl:t,path:r}),r},pe=async()=>{if(!a.render)return fe();let e=(await n.call(`render_preview`,{frames:[i.target.posterTime??0],sheet:!1})).frames[0]?.path;return e&&ae({url:await n.fileUrl(e),path:e}),e},me=async()=>{T(!0),te(null),ne(null),re(null),ae(null);try{if(await r.flush(),o===`poster`&&!a.render)await fe();else if(de){let e=o===`gif`?{...S,kind:`gif`}:o===`poster`?{...S,kind:`poster`}:S.kind===`mp4`||S.kind===`webm`?S:{...S,kind:`mp4`},t=e.kind===`poster`?e.image:e.kind===`gif`?`gif`:e.kind,r=e.kind===`poster`?`dist/poster.${t}`:e.kind===`gif`?`dist/animation.gif`:`dist/video.${t}`,i=await n.call(`export`,hx(e,r));re({url:await n.fileUrl(i.path),out:i})}else{let e=ue&&u?await pe():void 0,t=await n.call(`export`,{format:o,...c?{name:c}:{},...e?{poster:e}:{},...le&&m.trim()?{baseUrl:m.trim()}:{},...le&&g?{cacheBust:!0}:{},...le&&!v?{integrity:!1}:{},...b?{optimize:!0}:{},...le&&f&&a.render?{og:!0}:{}});ne(t)}}catch(e){let t=e;te({message:t.message,issues:t.details?.issues})}finally{T(!1)}},he=async e=>{await Qb(e)&&(se(!0),setTimeout(()=>se(!1),1500))};return(0,G.jsx)(Yb,{title:e(`export.title`),width:700,onClose:()=>t.set({dialog:null}),footer:(0,G.jsxs)(G.Fragment,{children:[n.mode===`local`&&E&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:async()=>Xb(E.entry.split(`/`).pop(),await n.readFile(E.entry),`text/html`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.download`)]}),n.mode===`cli`&&E&&o===`zip`&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:async()=>Xb(E.entry.split(`/`).pop(),await n.readFile(E.entry),`application/zip`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.download`)]}),D&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:async()=>Xb(D.out.path.split(`/`).pop(),await n.readFile(D.out.path),`application/octet-stream`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.download`)]}),ie?.dataUrl&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:()=>Xb(`${i.id}-poster.png`,Zb(ie.dataUrl),`image/png`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.downloadPoster`)]}),(0,G.jsxs)(G_,{variant:`primary`,onClick:()=>void me(),disabled:w||!ce(o),children:[w?(0,G.jsx)(Nn,{size:13,className:`animate-spin`}):(0,G.jsx)(Ci,{size:13}),` `,e(`export.run`)]})]}),children:(0,G.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,G.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,role:`radiogroup`,children:yx.map(t=>{let n=t.icon,r=ce(t.id);return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o===t.id,disabled:!r,onClick:()=>{s(t.id),ne(null),re(null),ae(null),te(null)},className:W(`flex gap-2.5 rounded-lg border p-3 text-left transition-colors`,o===t.id?`border-accent bg-accent/10`:`border-line hover:border-fg-faint`,!r&&`cursor-not-allowed opacity-45`),children:[(0,G.jsx)(n,{size:16,className:W(`shrink-0`,o===t.id?`text-accent`:`text-fg-muted`)}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:e(t.title)}),(0,G.jsx)(`div`,{className:`text-2xs leading-snug text-fg-muted`,children:e(r?t.body:`export.needsCli`)})]})]},t.id)})}),ue&&(0,G.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-line p-3`,children:[(0,G.jsx)(bx,{label:e(`export.name`),children:(0,G.jsx)(K_,{value:c,onCommit:l,ariaLabel:e(`export.name`),className:`max-w-[220px]`})}),le&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bx,{label:e(`export.baseUrl`),hint:e(`export.baseUrlHint`),children:(0,G.jsx)(K_,{value:m,placeholder:`./`,onCommit:h,mono:!0,ariaLabel:e(`export.baseUrl`),className:`max-w-[220px]`})}),(0,G.jsx)(bx,{label:e(`export.cacheBust`),hint:e(`export.cacheBustHint`),children:(0,G.jsx)(q_,{checked:g,onChange:_,ariaLabel:e(`export.cacheBust`)})}),(0,G.jsx)(bx,{label:e(`export.integrity`),hint:e(`export.integrityHint`),children:(0,G.jsx)(q_,{checked:v,onChange:y,ariaLabel:e(`export.integrity`)})})]}),a.render&&(0,G.jsx)(bx,{label:e(`export.optimize`),hint:e(`export.optimizeHint`),children:(0,G.jsx)(q_,{checked:b,onChange:x,ariaLabel:e(`export.optimize`)})}),(0,G.jsx)(bx,{label:e(`export.withPoster`),hint:e(`export.withPosterHint`),children:(0,G.jsx)(q_,{checked:u,onChange:d,ariaLabel:e(`export.withPoster`)})}),le&&a.render&&(0,G.jsx)(bx,{label:e(`export.og`),hint:e(`export.ogHint`),children:(0,G.jsx)(q_,{checked:f,onChange:p,ariaLabel:e(`export.og`)})})]}),de&&(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-line p-3`,children:[o===`video`&&(0,G.jsx)(_x,{value:S.kind===`webm`?`webm`:`mp4`,kinds:[`mp4`,`webm`],onChange:e=>C({...S,kind:e})}),(0,G.jsx)(vx,{value:{...S,kind:o===`gif`?`gif`:o===`poster`?`poster`:S.kind===`webm`?`webm`:`mp4`},onChange:e=>C({...e,kind:o===`video`?e.kind:S.kind}),scene:i})]}),n.mode===`local`&&(0,G.jsx)(`p`,{className:`text-2xs text-fg-faint`,children:e(`export.localNote`)}),ee&&(0,G.jsxs)(`div`,{className:`rounded-md bg-danger/10 text-xs text-danger`,children:[(0,G.jsx)(`div`,{className:`px-3 py-2`,children:ee.message}),ee.issues&&(0,G.jsx)(vb,{issues:ee.issues,dense:!0})]}),ie&&!E&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`img`,{src:ie.url,alt:e(`export.poster`),className:`block w-full rounded-md border border-line`}),ie.path&&(0,G.jsx)(`div`,{className:`mt-1 font-mono text-2xs text-fg-faint`,children:ie.path})]}),D&&(0,G.jsxs)(`div`,{className:`space-y-1`,children:[D.out.format===`video`?(0,G.jsx)(`video`,{src:D.url,controls:!0,autoPlay:!0,loop:!0,muted:!0,className:`block w-full rounded-md border border-line`}):(0,G.jsx)(`img`,{src:D.url,alt:D.out.path,className:`block w-full rounded-md border border-line`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(Pe,{size:13,className:`text-agent`}),(0,G.jsx)(`span`,{className:`font-mono text-2xs text-fg`,children:n.location&&n.mode===`cli`?`${n.location}/${D.out.path}`:D.out.path}),(0,G.jsxs)(`span`,{className:`text-2xs text-fg-faint`,children:[D.out.size.width,`×`,D.out.size.height,` · `,D.out.kb,` KB`]})]})]}),E&&(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(Pe,{size:13,className:`text-agent`}),(0,G.jsx)(`span`,{children:e(`export.done`,{files:E.files,kb:Math.round(E.totalKb)})}),E.optimized&&(0,G.jsx)(`span`,{className:`text-2xs text-fg-faint`,children:e(`export.optimized`,{before:E.optimized.beforeKb,after:E.optimized.afterKb})}),E.ogImage&&(0,G.jsx)(`span`,{className:`rounded bg-ink-3 px-1.5 text-2xs text-fg-muted`,children:`og-image.png`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-[100px_1fr] gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted`,children:e(`export.output`)}),(0,G.jsx)(`span`,{className:`break-all font-mono text-fg`,children:n.location&&n.mode===`cli`?`${n.location}/${E.entry}`:E.entry})]}),o!==`zip`&&(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap break-all rounded-md border border-line bg-ink-0 p-3 pr-20 font-mono text-2xs leading-relaxed text-fg`,children:E.snippet}),(0,G.jsxs)(G_,{size:`xs`,variant:`subtle`,className:`absolute right-2 top-2`,onClick:()=>void he(E.snippet),children:[oe?(0,G.jsx)(Pe,{size:11}):(0,G.jsx)(Xe,{size:11}),` `,e(oe?`export.copied`:`export.copy`)]})]}),E.hint&&(0,G.jsx)(`div`,{className:`text-2xs text-warn`,children:E.hint}),!!E.credits?.length&&(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:E.credits.map(e=>e.attribution??`${e.path} (${e.license})`).join(` · `)}),!!E.issues?.length&&(0,G.jsx)(`div`,{className:`rounded-md border border-line`,children:(0,G.jsx)(vb,{issues:E.issues,dense:!0})})]})]})})}function Sx(){let{t:e}=U(),{ui:t,backend:n,store:r,player:i}=Q(),a=ev().scene,[o,s]=(0,O.useState)(`frames`),[c,l]=(0,O.useState)(4),[u,d]=(0,O.useState)(mx(`mp4`)),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(null),[g,_]=(0,O.useState)(null),[v,y]=(0,O.useState)(null),b=n.capabilities.render,x=async()=>{p(!0),h(null);try{if(o===`media`){await r.flush();let e=new Date().toISOString().replace(/[-:]/g,``).replace(/\..+/,``).replace(`T`,`-`),t=await n.call(`export`,hx(u,`renders/${a.id}-${e}.${px[u.kind]}`));y({url:await n.fileUrl(t.path),out:t})}else if(b){await r.flush();let e=await n.call(`render_preview`,{count:c,sheet:!0}),t=e.sheet??e.frames[0]?.path;_({img:t?await n.fileUrl(t):``,out:e,path:t})}else{let e=oa(a.target.aspect,1200),t=await dx(a,await n.mountConfig(),i.player?.time()??0,e.width,e.height);_({img:t})}}catch(e){h(e.message)}finally{p(!1)}};return(0,G.jsx)(Yb,{title:e(`render.title`),width:880,onClose:()=>t.set({dialog:null}),footer:(0,G.jsxs)(G.Fragment,{children:[o===`frames`&&b&&(0,G.jsxs)(`label`,{className:`mr-auto flex items-center gap-2 text-xs text-fg-muted`,children:[e(`render.frames`),(0,G.jsx)(`select`,{value:c,onChange:e=>l(Number(e.target.value)),className:`field w-16`,children:[1,2,4,6,8,12].map(e=>(0,G.jsx)(`option`,{children:e},e))})]}),o===`media`&&v&&(0,G.jsxs)(G_,{variant:`ghost`,className:`mr-auto`,onClick:async()=>Xb(v.out.path.split(`/`).pop(),await n.readFile(v.out.path),v.out.format===`video`?`video/${v.out.path.endsWith(`.mp4`)?`mp4`:`webm`}`:`image/${v.out.path.split(`.`).pop()}`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.download`)]}),g&&!b&&o===`frames`&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:()=>Xb(`${a.id}.png`,Zb(g.img),`image/png`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`render.download`)]}),(0,G.jsxs)(G_,{variant:`primary`,onClick:()=>void x(),disabled:f||o===`media`&&!b,children:[f?(0,G.jsx)(Nn,{size:13,className:`animate-spin`}):o===`media`?(0,G.jsx)(Ot,{size:13}):(0,G.jsx)(Ae,{size:13}),` `,f?e(`render.rendering`):o===`media`?e(`render.renderMedia`,{kind:e(`media.kind.${u.kind}`)}):e(g?`render.again`:`render.run`)]})]}),children:(0,G.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,G.jsx)(`div`,{className:`flex gap-1 border-b border-line`,role:`tablist`,children:[{id:`frames`,icon:ln,label:e(`render.tabFrames`)},{id:`media`,icon:Ot,label:e(`render.tabMedia`)}].map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":o===e.id,onClick:()=>s(e.id),className:W(`-mb-px flex items-center gap-1.5 border-b-2 px-3 pb-2 text-sm`,o===e.id?`border-accent text-fg`:`border-transparent text-fg-muted hover:text-fg`),children:[(0,G.jsx)(e.icon,{size:13}),` `,e.label]},e.id))}),m&&(0,G.jsx)(`div`,{className:`rounded-md bg-danger/10 px-3 py-2 text-xs text-danger`,children:m}),o===`frames`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e(b?`render.intro`:`render.localIntro`)}),g?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-line bg-black`,children:g.img&&(0,G.jsx)(`img`,{src:g.img,alt:e(`render.sheetAlt`),className:`block w-full`})}),g.path&&(0,G.jsx)(`div`,{className:`font-mono text-2xs text-fg-faint`,children:g.path}),g.out?.stats&&(0,G.jsx)(`div`,{className:`text-xs text-fg-muted`,children:e(`render.stats`,{tris:g.out.stats.triangles.toLocaleString(),calls:g.out.stats.drawCalls})}),!!g.out?.issues?.length&&(0,G.jsx)(`div`,{className:`rounded-md border border-line`,children:(0,G.jsx)(vb,{issues:g.out.issues,dense:!0})}),!!g.out?.consoleErrors?.length&&(0,G.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-md bg-ink-0 p-2 text-2xs text-danger`,children:g.out.consoleErrors.join(`
|
|
478
|
-
`)})]}):(0,G.jsx)(`div`,{className:`flex aspect-[3/1] items-center justify-center rounded-lg border border-dashed border-line text-xs text-fg-faint`,children:e(f?`render.rendering`:`render.placeholder`)})]}),o===`media`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e(b?`render.mediaIntro`:`render.mediaNeedsCli`)}),(0,G.jsx)(_x,{value:u.kind,kinds:[`mp4`,`webm`,`gif`,`webp`],onChange:e=>d({...u,kind:e,fps:void 0,transparent:e===`gif`||e===`webp`?u.transparent:!1})}),(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:e(`media.about.${u.kind}`)}),(0,G.jsx)(vx,{value:u,onChange:d,scene:a}),v?(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-line`,style:{background:`repeating-conic-gradient(#2a2e38 0 25%, #1f222a 0 50%) 0 0 / 16px 16px`},children:v.out.format===`video`?(0,G.jsx)(`video`,{src:v.url,controls:!0,autoPlay:!0,loop:!0,muted:!0,className:`block w-full`}):(0,G.jsx)(`img`,{src:v.url,alt:v.out.path,className:`block w-full`})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 font-mono text-2xs text-fg-faint`,children:[(0,G.jsx)(`span`,{children:v.out.path}),(0,G.jsxs)(`span`,{children:[v.out.size.width,`×`,v.out.size.height]}),v.out.frames!==void 0&&(0,G.jsxs)(`span`,{children:[v.out.frames,` `,e(`render.framesUnit`),` @ `,v.out.fps,` fps · `,v.out.duration,`s`]}),v.out.codec&&(0,G.jsx)(`span`,{children:v.out.codec}),(0,G.jsxs)(`span`,{children:[v.out.kb,` KB`]})]})]}):(0,G.jsx)(`div`,{className:`flex aspect-[3/1] items-center justify-center rounded-lg border border-dashed border-line text-xs text-fg-faint`,children:e(f?`render.renderingMedia`:`render.mediaPlaceholder`)})]})]})})}var Cx=typeof navigator<`u`&&/Mac/.test(navigator.platform)?`⌘`:`Ctrl`,wx=[[[`Q`],`keys.selectTool`],[[`W`],`keys.move`],[[`E`],`keys.rotate`],[[`R`],`keys.scale`],[[`X`],`keys.space`],[[`Shift`,`drag`],`keys.snapHold`],[[`F`],`keys.frame`],[[`C`],`keys.cameraView`],[[`G`],`keys.grid`],[[`drag`,`right-drag`],`keys.orbit`],[[`wheel`],`keys.zoom`]],Tx=[[[Cx,`Z`],`keys.undo`],[[Cx,`⇧`,`Z`],`keys.redo`],[[Cx,`S`],`keys.save`],[[Cx,`D`],`keys.duplicate`],[[`Del`],`keys.delete`],[[`H`],`keys.hide`],[[`Esc`],`keys.deselect`],[[`Space`],`keys.play`],[[`T`],`keys.timeline`],[[`J`],`keys.json`],[[`I`],`keys.interact`],[[`A`],`keys.assistant`],[[`Shift`,`drag`],`keys.dragFast`],[[`Alt`,`drag`],`keys.dragFine`]];function Ex(){let{t:e}=U(),{ui:t}=Q();return(0,G.jsx)(Yb,{title:e(`keys.title`),width:680,onClose:()=>t.set({dialog:null}),children:(0,G.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-6 px-4 py-2 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`pb-1 pt-1.5 text-2xs font-semibold uppercase tracking-wide text-fg-faint`,children:e(`keys.general`)}),(0,G.jsx)(Dx,{rows:Tx})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`pb-1 pt-1.5 text-2xs font-semibold uppercase tracking-wide text-fg-faint`,children:e(`viewport.tools`)}),(0,G.jsx)(Dx,{rows:wx})]})]})})}function Dx({rows:e}){let{t}=U();return(0,G.jsx)(`div`,{className:`divide-y divide-line`,children:e.map(([e,n])=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted`,children:t(n)}),(0,G.jsx)(`span`,{className:`flex shrink-0 gap-1`,children:e.map(e=>(0,G.jsx)(Y_,{children:e},e))})]},n))})}var Ox=`application/x-agent3d-add`;function kx(e,t){e.dataTransfer&&(e.dataTransfer.setData(Ox,JSON.stringify(t)),e.dataTransfer.effectAllowed=`copy`)}function Ax(e){return!!e.dataTransfer&&Array.from(e.dataTransfer.types).includes(`application/x-agent3d-add`)}function jx(e){try{let t=e.dataTransfer?.getData(Ox);if(!t)return null;let n=JSON.parse(t);return n&&typeof n==`object`&&(`object`in n||`light`in n)?n:null}catch{return null}}function Mx(e,t){let n=e=>Math.round(e*100)/100||0,[r,i,a]=t;return e.type===`ambient`||e.type===`hemisphere`?e:e.type===`point`?{...e,position:[n(r),n(i+1.5),n(a)]}:{...e,position:[n(r+2),n(i+4),n(a+3)],target:[n(r),n(i),n(a)]}}var Nx=null;function Px(){let{backend:e}=Q(),[t,n]=(0,O.useState)(null);return(0,O.useEffect)(()=>{let t=!0;return Nx||=e.mountConfig().then(e=>(e.libraryBase??`./library/`).replace(/\/?$/,`/`)),Nx.then(e=>t&&n(e)).catch(()=>void 0),()=>{t=!1}},[e]),t}function Fx(e,t){return e+t.replace(/^library:/,``).split(`/`).map(encodeURIComponent).join(`/`)}var Ix=`__path__`;function Lx(e=!0){let{backend:t}=Q(),[n,r]=(0,O.useState)(void 0),i=(0,O.useCallback)(()=>{t.call(`assets_list`,{}).then(e=>r(e.assets??[])).catch(()=>r([]))},[t]);return(0,O.useEffect)(()=>{e&&i()},[i,e]),{assets:n,reload:i}}function Rx({label:e,hint:t,value:n,onChange:r,projectAssets:i,onOpen:a,library:o=!0,ariaLabel:s}){let{t:c}=U(),{library:l,backend:u}=Q(),d=Px(),[f,p]=(0,O.useState)(!1),m=(0,O.useMemo)(()=>u_(i,l,n,{library:o}),[i,l,n,o]),[h,g]=(0,O.useState)(null);(0,O.useEffect)(()=>{let e=!0;if(g(null),n)return n.startsWith(`library:`)?g(d?Fx(d,n):null):u.fileUrl(n).then(t=>e&&g(t)).catch(()=>void 0),()=>{e=!1}},[n,d,u]);let _=e=>m.filter(t=>t.group===e);return(0,G.jsxs)(Z,{label:e,hint:t,overridden:n!==void 0,onReset:()=>r(void 0),children:[h&&(0,G.jsx)(`img`,{src:h,alt:``,className:`h-6 w-6 shrink-0 rounded object-cover`,onError:()=>g(null)}),f?(0,G.jsx)(K_,{value:n??``,placeholder:c(`photo.pathPlaceholder`),mono:!0,onCommit:e=>{p(!1),r(e.trim()||void 0)},ariaLabel:s}):(0,G.jsxs)(`select`,{"aria-label":s,value:n??``,onFocus:a,onChange:e=>{e.target.value===Ix?p(!0):r(e.target.value||void 0)},className:`field min-w-0 flex-1`,children:[(0,G.jsx)(`option`,{value:``,children:c(`photo.none`)}),_(`current`).map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value)),_(`project`).length>0&&(0,G.jsx)(`optgroup`,{label:c(`photo.projectImages`),children:_(`project`).map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))}),_(`library`).length>0&&(0,G.jsx)(`optgroup`,{label:c(`photo.libraryImages`),children:_(`library`).map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,G.jsx)(`option`,{value:Ix,children:c(`photo.typePath`)})]})]})}var zx={box:we,roundedBox:qr,sphere:Je,cylinder:ut,cone:ot,capsule:ar,torus:mt,torusKnot:dn,plane:Yr,circle:Je,ring:We,icosahedron:Ht,dodecahedron:an,octahedron:ft,tetrahedron:_i,lathe:ji,extrude:Zr,tube:Ur},Bx={terrain:zn,trees:pi,rocks:jr,grass:di,flowers:zr,water:vt,clouds:nt,city:Oe,character:rr,planet:Wt,starfield:Vr,blob:Je,waveGrid:ve,maze:Jt,road:xr},Vx={stars:Vr,snow:Lr,rain:Qe,fireflies:zr,confetti:Yn,sparks:Mt,dust:ki,bubbles:Je,embers:Mt,hearts:nn},Hx=[{type:`directional`,icon:ti,def:{type:`directional`,color:`#ffffff`,intensity:2,position:[4,6,5]}},{type:`point`,icon:Tn,def:{type:`point`,color:`#ffd9a8`,intensity:8,position:[0,2,2],distance:12}},{type:`spot`,icon:yn,def:{type:`spot`,color:`#ffffff`,intensity:20,position:[0,5,3],target:[0,0,0],angle:30,penumbra:.4}},{type:`hemisphere`,icon:et,def:{type:`hemisphere`,skyColor:`#dfe9ff`,groundColor:`#3a3f4a`,intensity:.8}},{type:`ambient`,icon:$r,def:{type:`ambient`,color:`#ffffff`,intensity:.3}},{type:`rect`,icon:Yr,def:{type:`rect`,color:`#ffffff`,intensity:4,position:[0,3,3],target:[0,0,0],width:3,height:1.5}}],Ux=[{id:`primitives`,icon:we,label:`add.primitives`},{id:`text`,icon:yi,label:`add.text`},{id:`generators`,icon:zn,label:`add.generators`},{id:`particles`,icon:Vr,label:`add.particles`},{id:`library`,icon:Cn,label:`add.library`},{id:`photo`,icon:sn,label:`add.photo`},{id:`lights`,icon:Tn,label:`add.lights`}];function Wx(){let{t:e}=U(),{ui:t,edit:r,library:i}=Q(),a=ev(),o=a.scene,s=tv(e=>e.addTab),[l,u]=(0,O.useState)(`Hello`),[d,f]=(0,O.useState)(``),[p,h]=(0,O.useState)(null),g=e=>{let t=a.selection?Nc(o.objects,a.selection):null,n=t?.object.kind===`group`?t.object.id:void 0,i=C_(o,e);r([{op:`addObject`,object:i,...n?{parent:n}:{}}],{select:i.id})},v=e=>{let t=na(e.type,b_(o));r([{op:`set`,path:`lights[${(o.lights??[]).length}]`,value:{id:t,...e}}],{select:null})},y=Lx(s===`photo`),[b,x]=(0,O.useState)(``),S=d_(a.selection?Nc(o.objects,a.selection)?.object:null),C=(0,O.useMemo)(()=>u_(y.assets,void 0,void 0,{library:!1}),[y.assets]),w=(0,O.useMemo)(()=>i.assets.filter(e=>e.kind===`model`),[i]),T=(0,O.useMemo)(()=>{let e=new Map;for(let t of w)for(let n of t.tags)e.set(n,(e.get(n)??0)+1);return[...e.entries()].sort((e,t)=>t[1]-e[1]).slice(0,14).map(([e])=>e)},[w]),ee=(0,O.useMemo)(()=>{let e=d.toLowerCase().split(/\s+/).filter(Boolean);return w.filter(t=>(!p||t.tags.includes(p))&&e.every(e=>t.id.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))))},[w,d,p]),te;switch(s){case`primitives`:te=(0,G.jsx)(Gx,{children:n.map(e=>(0,G.jsx)(Kx,{icon:zx[e.id]??we,label:Cb(e.id),hint:e.description,drag:{object:{kind:`mesh`,geometry:e.id}},onClick:()=>g({kind:`mesh`,geometry:e.id})},e.id))});break;case`text`:te=(0,G.jsxs)(`div`,{className:`space-y-2 p-2.5`,children:[(0,G.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),className:`field h-7`,"aria-label":e(`add.textValue`),placeholder:e(`add.textValue`)}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:m.map(e=>(0,G.jsxs)(`button`,{type:`button`,title:e.description,draggable:!0,onDragStart:t=>kx(t,{object:{kind:`text`,text:l||`Text`,font:e.id}}),onClick:()=>g({kind:`text`,text:l||`Text`,font:e.id}),className:`flex h-12 flex-col items-start justify-center rounded-md bg-ink-2 px-2 text-left hover:bg-ink-3`,children:[(0,G.jsx)(`span`,{className:W(`text-base leading-none`,e.id.includes(`serif`)&&`font-serif`,e.id===`mono`&&`font-mono`,e.id.includes(`bold`)&&`font-bold`,e.id===`display`&&`font-black tracking-tight`),children:`Aa`}),(0,G.jsx)(`span`,{className:`mt-1 text-2xs text-fg-faint`,children:e.id})]},e.id))})]});break;case`generators`:te=(0,G.jsx)(Gx,{children:c.map(e=>(0,G.jsx)(Kx,{icon:Bx[e.id]??Me,label:Cb(e.id),hint:e.description,drag:{object:{kind:`generator`,generator:e.id}},onClick:()=>g({kind:`generator`,generator:e.id})},e.id))});break;case`particles`:te=(0,G.jsx)(Gx,{children:_.map(e=>(0,G.jsx)(Kx,{icon:Vx[e.id]??Vr,label:Cb(e.id),hint:e.description,drag:{object:{kind:`particles`,preset:e.id}},onClick:()=>g({kind:`particles`,preset:e.id})},e.id))});break;case`library`:te=(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5 border-b border-line p-2`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(Tr,{size:12,className:`absolute left-2 top-1/2 -translate-y-1/2 text-fg-faint`}),(0,G.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:e(`add.searchModels`,{n:w.length}),className:`field h-7 pl-6`,"aria-label":e(`add.searchModels`,{n:w.length})})]}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:T.map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>h(p===e?null:e),className:W(`rounded px-1.5 py-0.5 text-2xs`,p===e?`bg-accent/20 text-accent`:`bg-ink-2 text-fg-muted hover:text-fg`),children:e},e))})]}),(0,G.jsxs)(`div`,{className:`py-1`,children:[ee.slice(0,120).map(e=>(0,G.jsxs)(`button`,{type:`button`,title:`${e.description}\n${e.license}${e.author?` · ${e.author}`:``}`,draggable:!0,onDragStart:t=>kx(t,{object:{kind:`model`,src:`library:${e.id}`,name:e.id.split(`/`).pop()}}),onClick:()=>g({kind:`model`,src:`library:${e.id}`,name:e.id.split(`/`).pop()}),className:`flex w-full items-center gap-2 px-2.5 py-1 text-left hover:bg-ink-2`,children:[(0,G.jsx)(we,{size:12,className:`shrink-0 text-fg-faint`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e.id.split(`/`).pop()}),(0,G.jsx)(`span`,{className:`shrink-0 text-2xs text-fg-faint`,children:e.id.split(`/`)[0]})]},e.id)),!ee.length&&(0,G.jsx)(`div`,{className:`px-3 py-3 text-xs text-fg-faint`,children:w.length?e(`add.noMatch`):e(`add.noLibrary`)})]})]});break;case`photo`:te=(0,G.jsxs)(`div`,{className:`space-y-1 py-1.5`,children:[(0,G.jsx)(`div`,{className:`px-2.5 pb-1 text-2xs leading-snug text-fg-faint`,children:e(`add.photoHint`)}),S&&(0,G.jsxs)(`button`,{type:`button`,title:S,onClick:()=>g({kind:`photo`,src:S}),className:`flex w-full items-center gap-2 px-2.5 py-1 text-left hover:bg-ink-2`,children:[(0,G.jsx)(sn,{size:12,className:`shrink-0 text-accent`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e(`add.photoSelected`)}),(0,G.jsx)(`span`,{className:`shrink-0 truncate text-2xs text-fg-faint`,children:S.split(`/`).pop()})]}),C.map(e=>(0,G.jsxs)(`button`,{type:`button`,title:e.value,draggable:!0,onDragStart:t=>kx(t,{object:{kind:`photo`,src:e.value}}),onClick:()=>g({kind:`photo`,src:e.value}),className:`flex w-full items-center gap-2 px-2.5 py-1 text-left hover:bg-ink-2`,children:[(0,G.jsx)(sn,{size:12,className:`shrink-0 text-fg-faint`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e.label})]},e.value)),y.assets&&!C.length&&(0,G.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-faint`,children:e(`add.photoNone`)}),(0,G.jsxs)(`form`,{className:`flex gap-1 px-2.5 pt-1`,onSubmit:e=>{e.preventDefault();let t=b.trim();t&&(g({kind:`photo`,src:t}),x(``))},children:[(0,G.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),className:`field h-7 font-mono`,"aria-label":e(`photo.typePath`),placeholder:e(`photo.pathPlaceholder`)}),(0,G.jsx)(`button`,{type:`submit`,disabled:!b.trim(),title:e(`add.photoAdd`),"aria-label":e(`add.photoAdd`),className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-ink-3 text-fg hover:bg-ink-4 disabled:opacity-40`,children:(0,G.jsx)(lr,{size:13})})]})]});break;default:te=(0,G.jsx)(Gx,{children:Hx.map(t=>(0,G.jsx)(Kx,{icon:t.icon,label:Cb(t.type),hint:e(`add.lightHint`),drag:{light:t.def},onClick:()=>v(t.def)},t.type))})}return(0,G.jsxs)(`div`,{className:`flex h-[44%] min-h-[220px] shrink-0 flex-col border-t border-line`,children:[(0,G.jsx)(`div`,{className:`flex h-9 shrink-0 items-center gap-0.5 border-b border-line px-1.5`,role:`tablist`,children:Ux.map(n=>{let r=n.icon,i=s===n.id;return(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":i,title:e(n.label),onClick:()=>t.set({addTab:n.id}),className:W(`flex h-7 items-center gap-1 rounded-md px-1.5 text-xs`,i?`bg-ink-3 text-fg`:`text-fg-faint hover:text-fg`),children:[(0,G.jsx)(r,{size:13,strokeWidth:1.75}),i&&(0,G.jsx)(`span`,{className:`font-medium`,children:e(n.label)})]},n.id)})}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:te})]})}function Gx({children:e}){return(0,G.jsx)(`div`,{className:`grid grid-cols-3 gap-1 p-1.5`,children:e})}function Kx({icon:e,label:t,hint:n,onClick:r,drag:i}){return(0,G.jsxs)(`button`,{type:`button`,title:n,onClick:r,draggable:!!i,onDragStart:i?e=>kx(e,i):void 0,className:`flex h-[60px] flex-col items-center justify-center gap-1.5 rounded-md text-fg-muted transition-colors hover:bg-ink-3 hover:text-fg active:bg-ink-4`,children:[(0,G.jsx)(e,{size:18,strokeWidth:1.5}),(0,G.jsx)(`span`,{className:`w-full truncate px-1 text-center text-2xs`,children:t})]})}var qx={mesh:we,text:yi,model:qn,group:Bt,generator:zn,particles:Vr,instances:xn,svg:$n,photo:sn},Jx={ambient:$r,directional:ti,point:Tn,spot:yn,hemisphere:et,rect:Yr};function Yx({kind:e,size:t=13,className:n}){let r=qx[e]??we;return(0,G.jsx)(r,{size:t,className:n,strokeWidth:1.75})}function Xx(){let{t:e}=U(),{store:t,edit:n}=Q(),r=ev(),i=r.scene,a=tv(e=>e.flash),[o,s]=(0,O.useState)(new Set),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(null),f=r.selection,p=(0,O.useMemo)(()=>{let e=new Map;for(let t of r.issues){let n=/objects#([\w-]+)/.exec(t.path)?.[1];n&&t.severity!==`info`&&e.get(n)!==`error`&&e.set(n,t.severity)}return e},[r.issues]),m=[],h=(e,t)=>{for(let n of e)m.push({o:n,depth:t}),n.children?.length&&!o.has(n.id)&&h(n.children,t+1)};return h(i.objects??[],0),(0,G.jsxs)(`div`,{className:`flex min-h-[140px] flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between border-b border-line pl-3 pr-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-semibold`,children:e(`outliner.title`)}),(0,G.jsxs)(`div`,{className:`flex`,children:[(0,G.jsx)(Y,{label:e(`outliner.addGroup`),onClick:()=>{let e=C_(i,{kind:`group`});n([{op:`addObject`,object:e}],{select:e.id})},children:(0,G.jsx)(Rt,{size:14})}),(0,G.jsx)(Y,{label:e(`outliner.duplicate`),shortcut:`⌘D`,disabled:!f,onClick:()=>{if(!f)return;let e=w_(i,f);e&&n(e.ops,{select:e.newId})},children:(0,G.jsx)(ct,{size:13})}),(0,G.jsx)(Y,{label:e(`outliner.delete`),shortcut:`Del`,disabled:!f,onClick:()=>f&&n([{op:`removeObject`,id:f}]),children:(0,G.jsx)(li,{size:13})})]})]}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto py-1`,role:`tree`,"aria-label":e(`outliner.title`),children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t.select(null),className:W(`flex h-7 w-full items-center gap-2 px-3 text-left text-sm`,f===null?`bg-accent/15 text-fg`:`text-fg-muted hover:bg-ink-2`),children:[(0,G.jsx)(bt,{size:13,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:`flex-1 truncate`,children:e(`outliner.scene`)}),(0,G.jsx)(`span`,{className:`flex gap-0.5 text-fg-faint`,children:(i.lights??[]).slice(0,4).map((e,t)=>{let n=Jx[e.type]??Jx.point;return(0,G.jsx)(n,{size:11,"aria-label":e.type},t)})})]}),m.map(({o:r,depth:m})=>{let h=!!r.children?.length,g=r.id===f,_=r.visible===!1,v=p.get(r.id),y=u?.id===r.id?u.where:null;return(0,G.jsxs)(`div`,{role:`treeitem`,"aria-selected":g,"aria-expanded":h?!o.has(r.id):void 0,draggable:!0,onDragStart:e=>{l(r.id),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,r.id)},onDragEnd:()=>{l(null),d(null)},onDragOver:e=>{if(!c||c===r.id)return;e.preventDefault();let t=e.currentTarget.getBoundingClientRect(),n=(e.clientY-t.top)/t.height;d({id:r.id,where:n<.28?`before`:n>.72?`after`:`inside`})},onDragLeave:()=>d(e=>e?.id===r.id?null:e),onDrop:e=>{if(e.preventDefault(),c&&u){let e=T_(i,c,u.id,u.where);e.length&&n(e),u.where===`inside`&&s(e=>new Set([...e].filter(e=>e!==u.id)))}l(null),d(null)},onClick:()=>t.select(r.id),className:W(`group relative flex h-7 cursor-default items-center gap-1.5 pr-1 text-sm`,a?.ids.includes(r.id)&&`row-flash`,g?`bg-accent/15 text-fg`:`text-fg-muted hover:bg-ink-2 hover:text-fg`,c===r.id&&`opacity-40`,y===`inside`&&`ring-1 ring-inset ring-accent`),style:{paddingLeft:8+m*14},children:[y===`before`&&(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-x-2 top-0 h-0.5 rounded bg-accent`}),y===`after`&&(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-x-2 bottom-0 h-0.5 rounded bg-accent`}),(0,G.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":o.has(r.id)?e(`outliner.expand`):e(`outliner.collapse`),onClick:e=>{e.stopPropagation(),s(e=>{let t=new Set(e);return t.has(r.id)?t.delete(r.id):t.add(r.id),t})},className:W(`flex h-4 w-4 items-center justify-center text-fg-faint`,!h&&`invisible`),children:o.has(r.id)?(0,G.jsx)(Be,{size:11}):(0,G.jsx)(Ie,{size:11})}),(0,G.jsx)(Yx,{kind:r.kind,className:g?`text-accent`:`text-fg-faint`}),(0,G.jsx)(`span`,{className:W(`truncate`,_&&`opacity-50`),children:r.name||r.id}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-2xs text-fg-faint`,children:r.kind===`group`?``:Ic(r).replace(/^"|"$/g,``)}),v&&(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,v===`error`?`bg-danger`:`bg-warn`),title:v}),(0,G.jsx)(`button`,{type:`button`,"aria-label":e(_?`outliner.show`:`outliner.hide`),title:`${e(_?`outliner.show`:`outliner.hide`)} (H)`,onClick:e=>{e.stopPropagation(),n(_?[{op:`remove`,path:`objects#${r.id}.visible`}]:[{op:`set`,path:`objects#${r.id}.visible`,value:!1}])},className:W(`flex h-5 w-5 shrink-0 items-center justify-center rounded text-fg-faint hover:text-fg`,_?`opacity-100`:`opacity-0 group-hover:opacity-100`),children:_?(0,G.jsx)(St,{size:12}):(0,G.jsx)(wt,{size:12})})]},`${r.id}-${a?.ids.includes(r.id)?a.at:0}`)}),!m.length&&(0,G.jsx)(`div`,{className:`px-3 py-4 text-xs text-fg-faint`,children:e(`outliner.empty`)})]})]})}function Zx(){return(0,G.jsxs)(`aside`,{className:`flex w-[268px] shrink-0 flex-col border-r border-line bg-ink-1`,children:[(0,G.jsx)(Xx,{}),(0,G.jsx)(Wx,{})]})}function Qx(){let{t:e,lang:t,setLang:n}=U(),{store:r,ui:i,backend:a,closeProject:o,runCheck:s}=Q(),c=ev(),l=tv(e=>e.assistant),u=tv(e=>e.check),d=tv(e=>e.checkRunning),f=c.issues.filter(e=>e.severity===`error`).length,p=u?(u.counts?.errors??0)+(u.counts?.warnings??0):f,m=typeof navigator<`u`&&/Mac/.test(navigator.platform)?`⌘`:`Ctrl+`;return(0,G.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-line bg-ink-1 px-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,style:{width:268},children:[(0,G.jsx)(Y,{label:e(`top.projects`),onClick:o,children:(0,G.jsx)(Re,{size:15})}),(0,G.jsx)(eS,{}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`truncate text-sm font-semibold leading-tight`,children:c.scene?.title||a.projectTitle()}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1 truncate text-2xs text-fg-faint`,title:a.location??``,children:[a.mode===`cli`?(0,G.jsx)(en,{size:10}):(0,G.jsx)(nt,{size:10}),(0,G.jsx)(`span`,{className:`truncate`,children:a.mode===`cli`?$x(a.location):e(`top.inBrowser`)})]})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsx)(Y,{label:e(`top.undo`),shortcut:`${m}Z`,disabled:!c.canUndo,onClick:()=>r.undo(),children:(0,G.jsx)(xi,{size:15})}),(0,G.jsx)(Y,{label:e(`top.redo`),shortcut:`${m}⇧Z`,disabled:!c.canRedo,onClick:()=>r.redo(),children:(0,G.jsx)(dr,{size:15})}),(0,G.jsx)(tS,{})]}),(0,G.jsx)(nS,{}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,G.jsxs)(G_,{variant:`ghost`,onClick:()=>void s(),title:e(`top.checkHint`),children:[d?(0,G.jsx)(Nn,{size:14,className:`animate-spin`}):(0,G.jsx)(Nr,{size:14}),e(`top.check`),p>0&&(0,G.jsx)(`span`,{className:W(`rounded px-1 text-2xs font-semibold`,(u?.counts?.errors??f)>0?`bg-danger/20 text-danger`:`bg-warn/20 text-warn`),children:p})]}),(0,G.jsxs)(G_,{variant:`ghost`,onClick:()=>i.set({dialog:`render`}),title:e(`top.renderHint`),children:[(0,G.jsx)(Ae,{size:14}),e(`top.render`)]}),(0,G.jsxs)(G_,{variant:`primary`,onClick:()=>i.set({dialog:`export`}),children:[(0,G.jsx)(Ci,{size:14}),e(`top.export`)]}),(0,G.jsx)(`div`,{className:`mx-1 h-5 w-px bg-line`}),(0,G.jsx)(Y,{label:e(`top.assistant`),shortcut:`A`,active:l,onClick:()=>i.set({assistant:!l}),children:(0,G.jsx)(Se,{size:16})}),(0,G.jsx)(Y,{label:e(`top.shortcuts`),shortcut:`?`,onClick:()=>i.set({dialog:`shortcuts`}),children:(0,G.jsx)(_n,{size:15})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(t===`en`?`fr`:`en`),title:e(`top.language`),className:`h-7 rounded-md px-1.5 text-2xs font-semibold text-fg-muted hover:bg-ink-3 hover:text-fg`,children:t.toUpperCase()})]})]})}function $x(e){if(!e)return``;let t=e.split(`/`).filter(Boolean);return t.length>2?`…/${t.slice(-2).join(`/`)}`:e}function eS({size:e=20}){let t=(0,O.useId)().replace(/:/g,``);return(0,G.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 32 32`,"aria-hidden":!0,className:`shrink-0`,children:[(0,G.jsxs)(`defs`,{children:[(0,G.jsxs)(`linearGradient`,{id:`${t}bg`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,G.jsx)(`stop`,{offset:`0`,stopColor:`#2a2a30`}),(0,G.jsx)(`stop`,{offset:`1`,stopColor:`#0c0c0f`})]}),(0,G.jsxs)(`linearGradient`,{id:`${t}dot`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,G.jsx)(`stop`,{offset:`0`,stopColor:`#7aa5ff`}),(0,G.jsx)(`stop`,{offset:`1`,stopColor:`#3d6bff`})]}),(0,G.jsxs)(`radialGradient`,{id:`${t}glow`,cx:`0.5`,cy:`0.5`,r:`0.5`,children:[(0,G.jsx)(`stop`,{offset:`0`,stopColor:`#598bff`,stopOpacity:`0.55`}),(0,G.jsx)(`stop`,{offset:`1`,stopColor:`#598bff`,stopOpacity:`0`})]})]}),(0,G.jsx)(`rect`,{width:`32`,height:`32`,rx:`7.5`,fill:`url(#${t}bg)`}),(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`31`,height:`31`,rx:`7`,fill:`none`,stroke:`#ffffff`,strokeOpacity:`0.12`}),(0,G.jsx)(`circle`,{cx:`16`,cy:`16.6`,r:`5`,fill:`url(#${t}glow)`}),(0,G.jsx)(`path`,{d:`M16 8L23.45 12.3L23.45 20.9L16 25.2L8.55 20.9L8.55 12.3ZM12.62 14.65L8.55 12.3M19.38 14.65L23.45 12.3M16 20.5L16 25.2`,fill:`none`,stroke:`#fff`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,G.jsx)(`circle`,{cx:`16`,cy:`16.6`,r:`2.2`,fill:`url(#${t}dot)`})]})}function tS(){let{t:e}=U(),t=ev().save,n=t.state===`saved`?e(`save.saved`):t.state===`saving`?e(`save.saving`):t.state===`pending`?e(`save.pending`):e(`save.error`);return(0,G.jsxs)(`div`,{className:W(`ml-1 flex h-6 items-center gap-1 rounded-md px-1.5 text-2xs`,t.state===`error`?`bg-danger/15 text-danger`:`text-fg-faint`),title:t.state===`error`?`${t.message??``}\n${e(`save.errorHint`)}`:n,children:[t.state===`error`?(0,G.jsx)(Ke,{size:11}):(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 rounded-full`,t.state===`saved`?`bg-agent/70`:`bg-key animate-pulse`)}),n]})}function nS(){let{t:e}=U(),{player:t}=Q(),n=ev(),r=(0,O.useSyncExternalStore)(e=>t.onState(e),()=>t.playing),[i,a]=(0,O.useState)(0),o=(0,O.useRef)(0);(0,O.useEffect)(()=>t.onTime(e=>{Math.abs(e-o.current)>.015&&(o.current=e,a(e))}),[t]);let s=n.scene?.timeline?.duration||10;return(0,G.jsxs)(`div`,{className:`mx-auto flex min-w-0 max-w-[460px] flex-1 items-center gap-2`,children:[(0,G.jsx)(Y,{label:e(r?`top.pause`:`top.play`),shortcut:`Space`,onClick:()=>t.toggle(),className:`text-fg`,children:r?(0,G.jsx)(Zn,{size:15,fill:`currentColor`}):(0,G.jsx)(sr,{size:15,fill:`currentColor`})}),(0,G.jsxs)(`div`,{className:`w-[86px] shrink-0 text-xs tabular-nums text-fg-muted`,children:[(0,G.jsx)(`span`,{className:`text-fg`,children:i.toFixed(2)}),(0,G.jsxs)(`span`,{className:`text-fg-faint`,children:[` / `,s.toFixed(2),`s`]})]}),(0,G.jsx)(rS,{value:i,max:s,onSeek:e=>void t.seek(e),ariaLabel:e(`top.scrub`)})]})}function rS({value:e,max:t,onSeek:n,ariaLabel:r}){let i=(0,O.useRef)(null),a=e=>{let r=i.current.getBoundingClientRect();n(Math.max(0,Math.min(1,(e-r.left)/r.width))*t)},o=Math.max(0,Math.min(1,e/t))*100;return(0,G.jsxs)(`div`,{ref:i,role:`slider`,tabIndex:0,"aria-label":r,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":Number(e.toFixed(2)),onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),a(e.clientX)},onPointerMove:e=>e.buttons===1&&a(e.clientX),onKeyDown:r=>{r.key===`ArrowLeft`&&n(Math.max(0,e-(r.shiftKey?1:.1))),r.key===`ArrowRight`&&n(Math.min(t,e+(r.shiftKey?1:.1)))},className:`group relative h-6 min-w-[80px] flex-1 cursor-pointer`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-ink-3`}),(0,G.jsx)(`div`,{className:`absolute left-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-accent/60`,style:{width:`${o}%`}}),(0,G.jsx)(`div`,{className:`absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-ink-1 bg-fg shadow`,style:{left:`${o}%`}})]})}var iS={tl:`left-2 top-2`,tr:`right-2 top-2`,bl:`left-2 bottom-2`,br:`right-2 bottom-2`};function aS(e){let t=new Set;for(let n of e?.elements??[]){if(n.visible===!1)continue;let e=n.anchor??`top-left`;e===`top-left`?t.add(`tl`):e===`top-right`?t.add(`tr`):e===`bottom-left`?t.add(`bl`):e===`bottom-right`?t.add(`br`):e===`top`?t.add(`tl`).add(`tr`):e===`bottom`&&t.add(`bl`).add(`br`)}return t}function oS(e){let t=aS(e),n=(e,n)=>e.find(e=>!t.has(e)&&e!==n)??e.find(e=>e!==n)??e[0],r=n([`tr`,`br`,`tl`,`bl`]);return{camera:r,selection:n([`tl`,`bl`,`tr`,`br`],r)}}var sS={desktop:0,tablet:820,phone:390},cS=new Map,lS=new Set([`mesh`,`text`,`model`,`svg`]);function uS(){let{t:e}=U(),{player:t,backend:n,ui:r,store:i,edit:a}=Q(),o=ev(),s=o.scene,c=tv(e=>e.device),l=tv(e=>e.helpers),u=tv(e=>e.interact),d=tv(e=>e.agentPulse),f=tv(e=>e.gizmo),p=tv(e=>e.space),m=tv(e=>e.snap),h=tv(e=>e.view),g=tv(e=>e.lightSel),_=(0,O.useRef)(null),v=(0,O.useRef)(null),y=(0,O.useRef)(null),[b,x]=(0,O.useState)({w:800,h:500}),[S,C]=(0,O.useState)(null),[w,T]=(0,O.useState)([]),[ee,te]=(0,O.useState)(!1),[E,ne]=(0,O.useState)(null),[D,re]=(0,O.useState)(!1),ie=(0,O.useRef)(-1),ae=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{let e=_.current;if(!e)return;let t=new ResizeObserver(()=>x({w:e.clientWidth,h:e.clientHeight}));return t.observe(e),x({w:e.clientWidth,h:e.clientHeight}),()=>t.disconnect()},[]);let oe=(0,O.useCallback)((e,n)=>{let r=i.getSnapshot().scene;if(!r)return;let o=e.kind===`object`&&n.transform?V_(r,e.id,n.transform):e.kind===`light`&&n.point?H_(r,e.id,e.part,n.point):[];o.length?a(o):t.update(r)},[i,a,t]);(0,O.useEffect)(()=>{let e=v.current;if(!e)return;let o=!1,s=null,c=()=>{};(async()=>{let l=await n.mountConfig();if(o)return;let u=i.getSnapshot();if(ie.current=u.revision,await t.mount(e,u.scene,l,{editor:!0}),o)return;let d=i.getSnapshot();d.revision!==ie.current&&t.update(d.scene);let f=t.player?.editor,p=y.current;if(!f||!p)return;let{SceneEditor:m}=await Hl(async()=>{let{SceneEditor:e}=await import(`./editor-V--luWVq.js`);return{SceneEditor:e}},__vite__mapDeps([8,9,2,1,4,5]),import.meta.url);if(o)return;let h=d.scene?.id??`scene`;s=new m({bridge:f,dom:p,initialPose:cS.get(h)??null,onCameraChange:e=>cS.set(h,e),onPick:e=>{e?`light`in e?(i.select(null),r.set({lightSel:{id:e.light,part:e.part}})):(r.set({lightSel:null}),i.select(W_(e.chain,i.getSnapshot().selection))):(i.select(null),r.set({lightSel:null}))},onTransformEnd:(e,t)=>oe(e,t)}),c=f.onWorld(()=>{let e=ae.current;if(!e||!s||(ae.current=null,Date.now()-e.at>5e3))return;let t=s.objectBox(e.id),n=i.getSnapshot().scene;if(!t||!n)return;let r=e.y-t.min[1];if(r<.005||r>50)return;let o=n.objects.find(t=>t.id===e.id);if(!o)return;let c=o.position??[0,0,0];a([{op:`set`,path:`objects#${e.id}.position`,value:[c[0],Math.round((c[1]+r)*1e3)/1e3,c[2]]}],{coalesce:e.key})}),t.sceneEditor=s,ne(s)})();let l=t.onState(()=>T([...t.issues]));return()=>{o=!0,l(),c(),s?.dispose(),t.sceneEditor===s&&(t.sceneEditor=null),ne(null),t.dispose(),e.replaceChildren()}},[n,t,i,r,a,oe]),(0,O.useEffect)(()=>{o.revision!==ie.current&&t.update(s)},[o.revision,s,t]),(0,O.useEffect)(()=>{let e=setInterval(()=>C(t.stats()),1e3);return()=>clearInterval(e)},[t]);let se=o.selection;(0,O.useEffect)(()=>{se&&g&&r.set({lightSel:null})},[se,g,r]),(0,O.useEffect)(()=>{E?.setSelection(g&&!se?{kind:`light`,...g}:se?{kind:`object`,id:se}:null)},[E,se,g,o.revision]),(0,O.useEffect)(()=>E?.setMode(f),[E,f]),(0,O.useEffect)(()=>E?.setSpace(p),[E,p]),(0,O.useEffect)(()=>E?.setSnap(m),[E,m]),(0,O.useEffect)(()=>E?.setHelpers(l),[E,l]),(0,O.useEffect)(()=>E?.setView(u?`camera`:h),[E,h,u]),(0,O.useEffect)(()=>E?.setEnabled(!u),[E,u]),(0,O.useEffect)(()=>t.setInteract(u),[t,u]);let ce=ia(s.target?.aspect)??{width:16,height:9},le=ce.width/ce.height,ue=Math.max(50,b.w-104),de=Math.max(50,b.h-56),fe=sS[c],pe=fe||ue,me=pe/le,he=1;fe?he=Math.min(1,ue/pe,de/me):me>de&&(me=de,pe=me*le);let ge=e=>{let t=y.current;if(!t)return null;let n=t.getBoundingClientRect();return[(e.clientX-n.left)/n.width*2-1,-((e.clientY-n.top)/n.height*2-1)]},k=e=>{Ax(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,D||re(!0))},_e=e=>{re(!1);let t=jx(e),n=ge(e),o=i.getSnapshot().scene;if(!t||!n||!o)return;e.preventDefault();let s=E?E.dropPoint(n[0],n[1]):[0,0,0],c=.25,l=s.map((e,t)=>(m&&t!==1?Math.round(e/c)*c:Math.round(e*100)/100)||0);if(`light`in t){let e=na(t.light.type,b_(o));a([{op:`set`,path:`lights[${(o.lights??[]).length}]`,value:{id:e,...Mx(t.light,l)}}],{select:null}),r.set({lightSel:{id:e,part:`position`},interact:!1});return}let u=C_(o,t.object,l),d=`drop:${u.id}`;lS.has(u.kind)&&(ae.current={id:u.id,y:l[1],key:d,at:Date.now()}),a([{op:`addObject`,object:u}],{select:u.id,coalesce:d}),r.set({lightSel:null,interact:!1})},ve=()=>{let t=i.getSnapshot().scene;if(!E||!t)return;let n=E.pose(),r=U_(t,n.position,n.target);r.length&&(a(r),rg({tone:`success`,title:e(`viewport.cameraSet`),detail:e(`viewport.cameraSetDetail`)}))},ye=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e),be=g&&!se&&B_(s,g.id)!==null,A=se??(be?`${g.id}${g.part===`target`?` · target`:``}`:null),j=u?`camera`:h,xe=oS(o.scene?.ui),Se=(t,n,i,a)=>(0,G.jsx)(dS,{label:e(n),shortcut:i,active:!u&&f===t,disabled:u,onClick:()=>r.set({gizmo:t,interact:!1}),children:a});return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line bg-ink-1 px-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-fg-muted`,children:[(0,G.jsx)(`span`,{className:`rounded bg-ink-3 px-1.5 py-0.5 font-medium text-fg`,children:s.target?.kind}),(0,G.jsx)(`span`,{className:`tabular-nums`,children:s.target?.aspect}),(0,G.jsxs)(`span`,{className:`hidden text-fg-faint tabular-nums lg:inline`,children:[Math.round(pe),`×`,Math.round(me)]})]}),(0,G.jsx)(`div`,{className:`mx-auto flex items-center rounded-md bg-ink-2 p-0.5`,role:`radiogroup`,"aria-label":e(`viewport.device`),children:[[`desktop`,Ln],[`tablet`,ai],[`phone`,Fr]].map(([t,n])=>(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":c===t,title:e(`viewport.${t}`),onClick:()=>r.set({device:t}),className:W(`flex h-6 w-8 items-center justify-center rounded`,c===t?`bg-ink-4 text-fg`:`text-fg-faint hover:text-fg`),children:(0,G.jsx)(n,{size:13})},t))}),(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center rounded-md bg-ink-2 p-0.5`,role:`radiogroup`,"aria-label":e(`viewport.view`),children:[(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":j===`editor`,disabled:u,title:`${e(`viewport.editorCamera`)} (C)`,onClick:()=>r.set({view:`editor`}),className:W(`flex h-6 items-center gap-1 rounded px-1.5 text-2xs font-medium disabled:opacity-40`,j===`editor`?`bg-ink-4 text-fg`:`text-fg-faint hover:text-fg`),children:[(0,G.jsx)(Ti,{size:12}),` `,(0,G.jsx)(`span`,{className:`hidden xl:inline`,children:e(`viewport.editorShort`)})]}),(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":j===`camera`,title:`${e(`viewport.sceneCamera`)} (C)`,onClick:()=>r.set({view:`camera`}),className:W(`flex h-6 items-center gap-1 rounded px-1.5 text-2xs font-medium`,j===`camera`?`bg-ink-4 text-fg`:`text-fg-faint hover:text-fg`),children:[(0,G.jsx)(Ae,{size:12}),` `,(0,G.jsx)(`span`,{className:`hidden xl:inline`,children:e(`viewport.cameraShort`)})]})]}),(0,G.jsx)(Y,{label:e(`viewport.setCamera`),disabled:j!==`editor`||!E,onClick:ve,children:(0,G.jsx)(ri,{size:14})}),(0,G.jsx)(Y,{label:e(`viewport.frame`),shortcut:`F`,disabled:!E,onClick:()=>{h===`camera`&&r.set({view:`editor`,interact:!1}),E?.frameSelection()},children:(0,G.jsx)(Pt,{size:14})}),(0,G.jsx)(`div`,{className:`mx-1 h-4 w-px bg-line`}),(0,G.jsx)(Y,{label:e(`viewport.helpers`),shortcut:`G`,active:l,onClick:()=>r.set({helpers:!l}),children:(0,G.jsx)(Kt,{size:14})})]})]}),(0,G.jsxs)(`div`,{ref:_,className:`viewport-stage relative flex min-h-0 flex-1 items-center justify-center overflow-hidden`,children:[(0,G.jsxs)(`div`,{style:{width:pe,height:me,transform:he===1?void 0:`scale(${he})`},className:`relative shrink-0`,onDragOver:k,onDragLeave:()=>re(!1),onDrop:_e,children:[d>0&&(0,G.jsx)(`div`,{className:`agent-pulse pointer-events-none absolute inset-0 rounded-[3px]`},d),(0,G.jsxs)(`div`,{className:W(`absolute inset-0 overflow-hidden rounded-[3px] shadow-[0_0_0_1px_rgb(255_255_255/0.08),0_20px_60px_-20px_rgb(0_0_0/0.8)]`,D&&`ring-2 ring-accent`),children:[(0,G.jsx)(`div`,{ref:v,className:`absolute inset-0`}),j===`camera`&&!u&&l&&(0,G.jsx)(fS,{}),(0,G.jsx)(`div`,{ref:y,"data-testid":`viewport-surface`,className:W(`absolute inset-0 select-none`,u&&`pointer-events-none`),style:{touchAction:`none`},"aria-label":e(`viewport.clickToSelect`)}),A&&!u&&(0,G.jsxs)(`div`,{className:W(`pointer-events-none absolute z-10 flex max-w-[60%] items-center gap-1 truncate rounded-[4px] bg-ink-0/75 px-1.5 py-0.5 text-2xs font-medium text-accent backdrop-blur`,iS[xe.selection]),children:[be?(0,G.jsx)(Tn,{size:10}):(0,G.jsx)(we,{size:10}),(0,G.jsx)(`span`,{className:`truncate`,children:A})]}),!u&&(0,G.jsxs)(`div`,{className:W(`pointer-events-none absolute z-10 flex items-center gap-1 rounded-[4px] bg-ink-0/60 px-1.5 py-0.5 text-2xs text-fg-muted backdrop-blur`,iS[xe.camera]),children:[j===`camera`?(0,G.jsx)(Ae,{size:10}):(0,G.jsx)(Ti,{size:10}),e(j===`camera`?`viewport.sceneCamera`:`viewport.editorCamera`)]}),D&&(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-3 mx-auto w-fit rounded-md bg-accent px-2 py-1 text-2xs font-medium text-ink-0`,children:e(`viewport.dropHere`)})]})]}),(0,G.jsxs)(`div`,{className:`absolute left-2 top-2 flex flex-col gap-0.5 rounded-lg border border-line bg-ink-1/90 p-0.5 shadow-lg shadow-black/30 backdrop-blur`,role:`toolbar`,"aria-label":e(`viewport.tools`),children:[(0,G.jsx)(dS,{label:e(`viewport.select`),shortcut:`Q`,active:!u,onClick:()=>r.set({interact:!1}),children:(0,G.jsx)(Vn,{size:14})}),(0,G.jsx)(dS,{label:e(`viewport.interact`),shortcut:`I`,active:u,onClick:()=>r.set({interact:!0}),children:(0,G.jsx)(Qt,{size:14})}),(0,G.jsx)(`div`,{className:`mx-1 my-0.5 h-px bg-line`}),Se(`translate`,`viewport.move`,`W`,(0,G.jsx)(Gn,{size:14})),Se(`rotate`,`viewport.rotate`,`E`,(0,G.jsx)(_r,{size:14})),Se(`scale`,`viewport.scale`,`R`,(0,G.jsx)(Cr,{size:14})),(0,G.jsx)(`div`,{className:`mx-1 my-0.5 h-px bg-line`}),(0,G.jsx)(dS,{label:e(p===`world`?`viewport.world`:`viewport.local`),shortcut:`X`,active:!1,disabled:u,onClick:()=>r.set({space:p===`world`?`local`:`world`}),children:p===`world`?(0,G.jsx)(Wt,{size:14}):(0,G.jsx)(we,{size:14})}),(0,G.jsx)(dS,{label:e(`viewport.snap`),shortcut:`⇧`,active:m,disabled:u,onClick:()=>r.set({snap:!m}),children:(0,G.jsx)(Fn,{size:14})})]}),(0,G.jsxs)(`div`,{className:`pointer-events-none absolute bottom-2 left-2 flex gap-2 rounded-md bg-ink-0/70 px-2 py-1 text-2xs tabular-nums text-fg-muted backdrop-blur`,children:[S?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`b`,{className:`font-semibold text-fg`,children:ye(S.triangles)}),` `,e(`viewport.tris`)]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`b`,{className:`font-semibold text-fg`,children:S.drawCalls}),` `,e(`viewport.calls`)]}),S.fps?(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`b`,{className:`font-semibold text-fg`,children:S.fps}),` fps`]}):null]}):(0,G.jsx)(`span`,{children:e(`viewport.starting`)}),!u&&(0,G.jsx)(`span`,{className:`hidden border-l border-line pl-2 text-fg-faint md:inline`,children:e(j===`editor`?`viewport.navHint`:`viewport.cameraHint`)})]}),w.length>0&&(0,G.jsxs)(`div`,{className:`absolute bottom-2 right-2`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>te(e=>!e),className:`flex items-center gap-1 rounded-md bg-warn/15 px-2 py-1 text-2xs font-medium text-warn backdrop-blur hover:bg-warn/25`,children:[(0,G.jsx)(hi,{size:11}),` `,e(`viewport.runtimeIssues`,{n:w.length})]}),ee&&(0,G.jsx)(`div`,{className:`absolute bottom-8 right-0 max-h-60 w-80 overflow-auto rounded-lg border border-line bg-ink-1 p-2 text-xs shadow-xl`,children:w.map((e,t)=>(0,G.jsxs)(`div`,{className:`border-b border-line py-1 last:border-0`,children:[(0,G.jsx)(`div`,{className:`font-mono text-2xs text-warn`,children:e.code}),(0,G.jsx)(`div`,{className:`text-fg-muted`,children:e.message})]},t))})]})]})]})}function dS({label:e,shortcut:t,active:n,disabled:r,onClick:i,children:a}){return(0,G.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":n,title:t?`${e} (${t})`:e,disabled:r,onClick:i,className:W(`flex h-7 w-7 items-center justify-center rounded-md transition-colors disabled:pointer-events-none disabled:opacity-35`,n?`bg-accent/20 text-accent`:`text-fg-muted hover:bg-ink-3 hover:text-fg`),children:a})}function fS(){return(0,G.jsxs)(`div`,{className:`pointer-events-none absolute inset-0`,children:[(0,G.jsx)(`div`,{className:`absolute inset-[5%] rounded-[2px] border border-dashed border-white/25`}),[33.333,66.666].map(e=>(0,G.jsx)(`div`,{className:`absolute inset-y-0 w-px bg-white/10`,style:{left:`${e}%`}},`v${e}`)),[33.333,66.666].map(e=>(0,G.jsx)(`div`,{className:`absolute inset-x-0 h-px bg-white/10`,style:{top:`${e}%`}},`h${e}`)),(0,G.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-3 w-px -translate-x-1/2 -translate-y-1/2 bg-white/30`}),(0,G.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-px w-3 -translate-x-1/2 -translate-y-1/2 bg-white/30`})]})}function pS({trigger:e,items:t,onPick:n,placeholder:r,align:i=`right`}){let[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(0),d=(0,O.useRef)(null),f=(0,O.useMemo)(()=>{let e=s.trim().toLowerCase();return e?t.filter(t=>t.label.toLowerCase().includes(e)||t.hint?.toLowerCase().includes(e)):t},[t,s]);(0,O.useEffect)(()=>{if(!a)return;let e=e=>!d.current?.contains(e.target)&&o(!1);return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]);let p=e=>{o(!1),c(``),n(e)};return(0,G.jsxs)(`div`,{ref:d,className:`relative`,children:[e(()=>{o(e=>!e),u(0)}),a&&(0,G.jsxs)(`div`,{className:`toast-in absolute top-full z-30 mt-1 w-64 overflow-hidden rounded-lg border border-line bg-ink-1 shadow-xl shadow-black/50 ${i===`right`?`right-0`:`left-0`}`,children:[(0,G.jsx)(`input`,{autoFocus:!0,value:s,placeholder:r,onChange:e=>{c(e.target.value),u(0)},onKeyDown:e=>{if(e.key===`ArrowDown`)u(e=>Math.min(f.length-1,e+1));else if(e.key===`ArrowUp`)u(e=>Math.max(0,e-1));else if(e.key===`Enter`&&f[l])p(f[l].id);else if(e.key===`Escape`)o(!1);else return;e.preventDefault()},className:`h-8 w-full border-b border-line bg-transparent px-2.5 text-sm outline-none placeholder:text-fg-faint`}),(0,G.jsxs)(`div`,{className:`max-h-72 overflow-auto py-1`,children:[f.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,onMouseEnter:()=>u(t),onClick:()=>p(e.id),className:`block w-full px-2.5 py-1 text-left ${t===l?`bg-ink-3`:``}`,children:[(0,G.jsx)(`div`,{className:`text-sm`,children:e.label}),e.hint&&(0,G.jsx)(`div`,{className:`truncate text-2xs text-fg-faint`,children:e.hint})]},e.id)),!f.length&&(0,G.jsx)(`div`,{className:`px-2.5 py-2 text-xs text-fg-faint`,children:`—`})]})]})]})}var mS=e=>Math.round(e*10)/10;function hS(e,t,n=1){let r=e.trim().split(/\s+/),i=[],a=e=>mS(t+Number(e)*n),o=e=>mS(-Number(e)*n);for(let e=0;e<r.length;){let t=r[e++];if(t===`m`||t===`l`)i.push(`${t===`m`?`M`:`L`}${a(r[e])} ${o(r[e+1])}`),e+=2;else if(t===`q`)i.push(`Q${a(r[e+2])} ${o(r[e+3])} ${a(r[e])} ${o(r[e+1])}`),e+=4;else if(t===`b`)i.push(`C${a(r[e+2])} ${o(r[e+3])} ${a(r[e+4])} ${o(r[e+5])} ${a(r[e])} ${o(r[e+1])}`),e+=6;else if(t===`z`)i.push(`Z`);else break}return i.join(``)}function gS(e,t,n=1){let r=0,i=[];for(let a of t){let t=e.glyphs[a]??e.glyphs[`?`];t?(t.o&&i.push(hS(t.o,r,n)),r+=t.ha*n):r+=(e.resolution??1e3)*.3*n}let a=e.resolution??1e3;return{d:i.join(``),width:r,ascent:(e.ascender??a*.8)*n,descent:Math.abs(e.descender??-a*.2)*n}}var _S=new Map;function vS(e,t){let n=_S.get(t);return n||(n=fetch(Fx(e,`fonts/${t}.typeface.json`)).then(e=>e.ok?e.json():null).catch(()=>null),_S.set(t,n)),n}var yS={"sans-bold":`Inter Bold`,sans:`Inter`,"inter-black":`Inter Black`,"montserrat-extrabold":`Montserrat`,"space-grotesk-bold":`Space Grotesk`,"bebas-neue":`BEBAS NEUE`,anton:`ANTON`,"serif-bold":`Playfair Bold`,serif:`Playfair`,mono:`JetBrains Mono`,display:`Fredoka`,pacifico:`Pacifico`,lobster:`Lobster`},bS=e=>yS[e]??e;function xS({id:e,height:t=18,className:n}){let r=Px(),[i,a]=(0,O.useState)(null);(0,O.useEffect)(()=>{let t=!0;return r&&vS(r,e).then(e=>t&&a(e)),()=>{t=!1}},[r,e]);let o=bS(e);if(!i)return(0,G.jsx)(`span`,{className:W(`truncate text-sm text-fg-muted`,n),children:o});let s=gS(i,o),c=s.ascent+s.descent;return(0,G.jsx)(`svg`,{viewBox:`0 ${-s.ascent} ${Math.max(1,s.width)} ${c}`,height:t,className:W(`block max-w-full fill-current`,n),preserveAspectRatio:`xMinYMid meet`,"aria-label":o,role:`img`,children:(0,G.jsx)(`path`,{d:s.d})})}function SS({value:e,onChange:t}){return(0,G.jsx)(by,{width:268,trigger:(t,n)=>(0,G.jsx)(xy,{onClick:t,open:n,ariaLabel:xb(`font`),children:(0,G.jsx)(xS,{id:e,height:15,className:`text-fg`})}),children:n=>(0,G.jsx)(`div`,{className:`py-1`,role:`listbox`,children:m.map(r=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":r.id===e,title:r.description,onClick:()=>{t(r.id),n()},className:W(`flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-ink-3`,r.id===e&&`bg-accent/10`),children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(xS,{id:r.id,height:20,className:r.id===e?`text-accent`:`text-fg`}),(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-2xs text-fg-faint`,children:r.description.split(` — `)[1]??r.description})]}),r.id===e&&(0,G.jsx)(Pe,{size:12,className:`shrink-0 text-accent`})]},r.id))})})}var CS=(e,t)=>{let n=typeof e==`string`?pa(e):null;return n?ha(n):t};function wS(e,t,n){let r=pa(e),i=pa(t);return!r||!i?e:ha({r:r.r+(i.r-r.r)*n,g:r.g+(i.g-r.g)*n,b:r.b+(i.b-r.b)*n,a:1})}function TS(e){let t=(t,n)=>typeof e[t]==`number`?e[t]:n,n=t(`metalness`,0),r=t(`roughness`,.5),i=t(`transmission`,0),a=Array.isArray(e.gradient)?e.gradient.map(e=>CS(e,`#888888`)):null;if(e.type===`normal`)return`radial-gradient(circle at 35% 30%, #ffffff 0 4%, transparent 30%), conic-gradient(from 200deg, #8080ff, #ff8080, #80ff80, #8080ff)`;let o=a?a[Math.floor(a.length/2)]:CS(e.color,`#d0d0d0`),s=typeof e.emissive==`string`&&t(`emissiveIntensity`,1)>0?CS(e.emissive,`#000000`):null,c=s&&s!==`#000000`?wS(o,s,.6):o,l=wS(c,`#000000`,n>.5?.82:.6),u=wS(c,n>.5?`#000000`:`#ffffff`,n>.5?.25:.05),d=Math.round(4+r*22),f=`radial-gradient(circle at 34% 28%, rgba(255,255,255,${((1-r*.7)*(n>.5?1:.85)).toFixed(2)}) 0 ${d*.35}%, rgba(255,255,255,0) ${d+6}%)`,p=a?`linear-gradient(180deg, ${a.join(`, `)})`:`radial-gradient(circle at 38% 32%, ${u} 0%, ${c} 35%, ${l} 100%)`,m=[f];return n>.5&&m.push(`radial-gradient(circle at 60% 80%, ${wS(c,`#ffffff`,.35)} 0 6%, transparent 30%)`),s&&m.push(`radial-gradient(circle at 50% 50%, ${s}66 0 40%, transparent 72%)`),i>0&&m.push(`radial-gradient(circle at 55% 60%, rgba(255,255,255,0.08) 0 45%, rgba(255,255,255,0.35) 62%, rgba(255,255,255,0) 72%)`),m.push(i>0?`radial-gradient(circle at 40% 35%, ${wS(c,`#9fb7d0`,.3)}55 0%, #1b2030 100%)`:p),e.wireframe?`repeating-linear-gradient(45deg, ${o} 0 1px, transparent 1px 6px), repeating-linear-gradient(-45deg, ${o} 0 1px, #0e1015 1px 6px)`:m.join(`, `)}function ES(e){return TS(e?.props??{color:`#cfd3da`,roughness:.5})}var DS={cols:8,cell:72,spacing:2.5};function OS(e=r){let{cols:t,cell:n,spacing:i}=DS,a=Math.ceil(e.length/t),o={},s=e.map((e,r)=>{let s=r%t,c=Math.floor(r/t);return o[e.id]={x:s*n,y:c*n},{id:`s${r}`,kind:`mesh`,position:[(s-(t-1)/2)*i,((a-1)/2-c)*i,0],geometry:{type:`sphere`,radius:1,segments:48},material:{preset:e.id}}});return{scene:{version:1,id:`preset-sheet`,title:`Material presets`,target:{kind:`card`,aspect:`${t}:${a}`,toneMapping:`aces`,lazy:!1,quality:`high`},camera:{type:`orthographic`,zoom:a*i,position:[0,0,20],target:[0,0,0]},environment:{background:`#1c2029`,lighting:`studio`},lights:[{id:`key`,type:`directional`,position:[4,6,8],intensity:2.2},{id:`fill`,type:`ambient`,intensity:.35}],objects:s},width:t*n,height:a*n,cells:o}}var kS=`agent3d.studio.presetSheet.v1.${r.map(e=>e.id).join(`,`).length}`,AS=null;function jS(){let{backend:e}=Q(),[t,n]=(0,O.useState)(()=>{try{return localStorage.getItem(kS)}catch{return null}});return(0,O.useEffect)(()=>{if(t)return;let r=!0;return AS||=(async()=>{let{scene:t,width:n,height:r}=OS(),i=await dx(t,{libraryBase:(await e.mountConfig()).libraryBase},0,n,r);try{localStorage.setItem(kS,i)}catch{}return i})().catch(()=>null),AS.then(e=>r&&e&&n(e)),()=>{r=!1}},[e,t]),t}function MS({id:e,size:t=36,sheet:n,className:r}){let i=e?y(e):void 0,{cells:a,width:o,height:s}=NS,c=e?a[e]:void 0,l=t/DS.cell,u=n&&c?{backgroundImage:`url(${n})`,backgroundSize:`${o*l}px ${s*l}px`,backgroundPosition:`${-c.x*l}px ${-c.y*l}px`}:{background:ES(i),borderRadius:999,transform:`scale(0.8)`};return(0,G.jsx)(`span`,{className:W(`block shrink-0 overflow-hidden rounded-md`,r),style:{width:t,height:t,...u},"aria-hidden":!0})}var NS=OS();function PS({value:e,onChange:t}){let{t:n}=U(),i=jS(),a=e?y(e):void 0;return(0,G.jsx)(by,{width:348,trigger:(t,r)=>(0,G.jsxs)(xy,{onClick:t,open:r,ariaLabel:n(`inspector.preset`),children:[a?(0,G.jsx)(MS,{id:e,size:16,sheet:i,className:`rounded`}):(0,G.jsx)(j,{size:12,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:W(`truncate`,!a&&`text-fg-faint`),children:a?Cb(a.id):n(`inspector.noPreset`)})]}),children:a=>(0,G.jsxs)(`div`,{className:`p-2`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-5 gap-1`,children:[(0,G.jsx)(FS,{active:!e,label:n(`inspector.noPreset`),onPick:()=>{t(void 0),a()},children:(0,G.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-md border border-dashed border-line text-fg-faint`,children:(0,G.jsx)(j,{size:14})})}),r.map(n=>(0,G.jsx)(FS,{active:e===n.id,label:Cb(n.id),hint:n.description,onPick:()=>{t(n.id),a()},children:(0,G.jsx)(MS,{id:n.id,size:44,sheet:i})},n.id))]}),!i&&(0,G.jsx)(`div`,{className:`mt-2 text-center text-2xs text-fg-faint`,children:n(`inspector.renderingPresets`)})]})})}function FS({active:e,label:t,hint:n,onPick:r,children:i}){return(0,G.jsxs)(`button`,{type:`button`,title:n?`${t} — ${n}`:t,"aria-pressed":e,onClick:r,className:W(`relative flex flex-col items-center gap-1 rounded-md p-1 transition-colors`,e?`bg-accent/15 ring-1 ring-accent/70`:`hover:bg-ink-3`),children:[i,(0,G.jsx)(`span`,{className:W(`w-full truncate text-center text-[10px] leading-tight`,e?`text-accent`:`text-fg-muted`),children:t}),e&&(0,G.jsx)(Pe,{size:10,className:`absolute right-1 top-1 text-accent`})]})}function IS(e){return e===void 0?`none`:typeof e==`object`?`procedural`:e.startsWith(`library:`)?`library`:`file`}function LS({slot:e,value:n,path:r,onChange:i}){let{t:a}=U(),{library:o}=Q(),s=Px(),c=IS(n),l=(0,O.useMemo)(()=>o.assets.filter(e=>e.kind===`texture`),[o]),u=/normal/i.test(e)?`normal`:/rough|metal|ao|bump|displacement|alpha/i.test(e)?`roughness`:`color`,d=(0,O.useMemo)(()=>[...l].sort((e,t)=>Number(!e.tags?.includes(u))-Number(!t.tags?.includes(u))||e.id.localeCompare(t.id)),[l,u]),f=typeof n==`object`?n:null,p=f?v(`textures`,f.procedural):void 0;return(0,G.jsxs)(`div`,{className:W(`rounded-md`,c!==`none`&&`bg-ink-0/40 pb-1`),children:[(0,G.jsxs)(Z,{label:xb(e),overridden:n!==void 0,onReset:()=>i(void 0),children:[(0,G.jsx)(X,{value:c,options:[`none`,`file`,`library`,`procedural`].map(e=>({value:e,label:a(`texture.${e}`)})),onChange:e=>i(e===`none`?void 0:e===`file`?`assets/textures/`:e===`library`?`library:${d[0]?.id??`textures/concrete-color.jpg`}`:{procedural:u===`normal`?`flakes`:`noise`}),className:`w-[86px] flex-none`,ariaLabel:e}),c===`file`&&(0,G.jsx)(K_,{value:String(n),onCommit:e=>i(e.trim()||void 0),mono:!0,ariaLabel:`${e} path`}),c===`library`&&(0,G.jsxs)(G.Fragment,{children:[s&&(0,G.jsx)(`img`,{src:Fx(s,String(n)),alt:``,className:`h-6 w-6 shrink-0 rounded object-cover`}),(0,G.jsx)(X,{value:String(n).replace(/^library:/,``),options:d.map(e=>({value:e.id,label:e.id.replace(/^textures\//,``).replace(/\.\w+$/,``)})),onChange:e=>i(`library:${e}`),ariaLabel:`${e} library`})]}),c===`procedural`&&f&&(0,G.jsx)(X,{value:f.procedural,options:t.map(e=>({value:e.id,label:Cb(e.id)})),onChange:e=>i({procedural:e}),ariaLabel:`${e} procedural`})]}),f&&p&&(0,G.jsx)($,{specs:p.params,base:r,values:f})]})}function RS(e,t){if(!t)return t;let n=Aa[e].params,r={...t};for(let[e,t]of Object.entries(n))t.type===`vec2`&&typeof r[e]==`number`&&(r[e]=[r[e],r[e]]);return r}function zS({object:e}){let{t}=U(),n=Ob(),r=e.effects??{},i=ja.filter(e=>r[e]),a=(t,r)=>{!r&&i.length===1&&i[0]===t?n(J(e.id,`effects`),void 0):n(J(e.id,`effects.${t}`),r?{}:void 0)};return(0,G.jsx)(J_,{title:t(`photo.effects`),id:`photo-effects`,defaultOpen:i.length>0,children:ja.map(n=>{let i=!!r[n],o=t(`photo.effect.${n}`);return(0,G.jsxs)(`div`,{className:`border-t border-line/40 first:border-t-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-1`,children:[(0,G.jsx)(`span`,{className:`text-xs text-fg`,title:t(`photo.effect.${n}Hint`),children:o}),(0,G.jsx)(q_,{checked:i,onChange:e=>a(n,e),ariaLabel:o})]}),i&&!e.depth&&Aa[n].needsDepth&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:t(`photo.effectNeedsDepth`)}),i&&(0,G.jsx)($,{specs:Cg[n],base:J(e.id,`effects.${n}`),values:RS(n,r[n])})]},n)})})}function BS({object:e}){let{t}=U(),n=Ob(),{backend:r,tools:i}=Q(),a=Lx(),[o,s]=(0,O.useState)(!1),c=J(e.id,``),l=e,u=__(r.capabilities)&&i.some(e=>e.name===`image_depth`),d=async()=>{s(!0);try{let i=g_(await r.call(m_,h_(e)));if(!i)throw new Dh(`io`,t(`photo.depthNoPath`));n(J(e.id,`depth`),i),a.reload(),rg({tone:`success`,title:t(`photo.depthDone`),detail:i})}catch(e){let n=e;rg({tone:`error`,title:t(`photo.depthFailed`),detail:[n.message,n.hint].filter(Boolean).join(` `)},8e3)}finally{s(!1)}};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J_,{title:t(`kinds.photo`),id:`photo`,children:[(0,G.jsx)(Rx,{label:t(`photo.image`),hint:t(`photo.imageHint`),value:e.src,onChange:t=>t&&n(J(e.id,`src`),t),projectAssets:a.assets,onOpen:a.reload,ariaLabel:t(`photo.image`)}),(0,G.jsx)(Rx,{label:t(`photo.depth`),hint:t(`photo.depthHint`),value:e.depth,onChange:t=>n(J(e.id,`depth`),t),projectAssets:a.assets,onOpen:a.reload,library:!1,ariaLabel:t(`photo.depth`)}),(0,G.jsx)(`div`,{className:`flex items-center gap-2 px-3 py-1`,children:(0,G.jsx)(`span`,{title:t(u?`photo.generateDepthHint`:`photo.depthNeedsCli`),className:`inline-flex`,children:(0,G.jsxs)(G_,{size:`xs`,disabled:!u||o,onClick:()=>void d(),children:[o?(0,G.jsx)(Nn,{size:11,className:`animate-spin`}):(0,G.jsx)(Di,{size:11}),` `,t(o?`photo.generatingDepth`:`photo.generateDepth`)]})})}),!e.depth&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:t(u?`photo.flatHint`:`photo.depthNeedsCli`)}),(e.depth||e.plate)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Rx,{label:t(`photo.plate`),hint:t(`photo.plateHint`),value:e.plate,onChange:t=>n(J(e.id,`plate`),t),projectAssets:a.assets,onOpen:a.reload,library:!1,ariaLabel:t(`photo.plate`)}),(0,G.jsx)(Rx,{label:t(`photo.plateDepth`),hint:t(`photo.plateDepthHint`),value:e.plateDepth,onChange:t=>n(J(e.id,`plateDepth`),t),projectAssets:a.assets,onOpen:a.reload,library:!1,ariaLabel:t(`photo.plateDepth`)})]}),(0,G.jsx)(Db,{spec:yg,value:e.mode,onChange:t=>n(J(e.id,`mode`),t)}),(0,G.jsx)($,{specs:l_(e),base:c,values:l})]}),(0,G.jsx)(J_,{title:t(`photo.motion`),id:`photo-motion`,children:(0,G.jsx)($,{specs:xg,base:J(e.id,`motion`),values:e.motion})}),(0,G.jsx)(zS,{object:e}),(0,G.jsx)(J_,{title:t(`inspector.material`),id:`photo-material`,defaultOpen:!!e.material,children:(0,G.jsx)($,{specs:wg,base:J(e.id,`material`),values:e.material})})]})}var VS={lathe:{points:[[0,0],[.4,0],[.5,.3],[.3,.8],[.35,1.2],[0,1.2]]},extrude:{shape:[[0,.5],[.15,.15],[.5,.1],[.2,-.12],[.3,-.5],[0,-.25],[-.3,-.5],[-.2,-.12],[-.5,.1],[-.15,.15]]},tube:{points:[[-1.5,0,0],[-.5,.6,.3],[.5,-.4,-.3],[1.5,.2,0]]}};function HS({object:e}){let{t}=U(),{edit:n,store:r}=Q(),i=Ob(),a=t=>J(e.id,t);return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line px-3 py-2.5`,children:[(0,G.jsx)(`div`,{className:`flex h-7 w-7 items-center justify-center rounded-md bg-accent/15 text-accent`,children:(0,G.jsx)(Yx,{kind:e.kind,size:14})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate font-mono text-xs text-fg`,title:t(`inspector.idHint`),children:e.id}),(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:t(`kinds.${e.kind}`)})]}),(0,G.jsx)(Y,{label:t(`outliner.delete`),onClick:()=>n([{op:`removeObject`,id:e.id}]),children:(0,G.jsx)(li,{size:13})}),(0,G.jsx)(Y,{label:t(`inspector.deselect`),shortcut:`Esc`,onClick:()=>r.select(null),children:(0,G.jsx)(Fi,{size:14})})]}),(0,G.jsxs)(`div`,{className:`border-b border-line py-1.5`,children:[(0,G.jsx)(Z,{label:t(`inspector.name`),children:(0,G.jsx)(K_,{value:e.name??``,placeholder:e.id,onCommit:e=>i(a(`name`),e.trim()||void 0),ariaLabel:t(`inspector.name`)})}),(0,G.jsx)(Z,{label:t(`inspector.visible`),children:(0,G.jsx)(q_,{checked:e.visible!==!1,onChange:e=>i(a(`visible`),e?void 0:!1),ariaLabel:t(`inspector.visible`)})})]}),(0,G.jsxs)(J_,{title:t(`inspector.transform`),id:`transform`,children:[(0,G.jsx)(Z,{label:t(`inspector.position`),children:(0,G.jsx)(_y,{value:e.position??[0,0,0],placeholder:!e.position,step:.01,onChange:(e,t)=>i(a(`position`),e,t)})}),(0,G.jsx)(Z,{label:t(`inspector.rotation`),children:(0,G.jsx)(_y,{value:e.rotation??[0,0,0],placeholder:!e.rotation,step:.5,suffix:`°`,onChange:(e,t)=>i(a(`rotation`),e,t)})}),(0,G.jsx)(US,{object:e})]}),(0,G.jsx)(WS,{object:e}),D_.has(e.kind)&&(0,G.jsx)(KS,{object:e}),(0,G.jsx)(JS,{object:e}),(0,G.jsx)(XS,{object:e}),(0,G.jsxs)(J_,{title:t(`inspector.advanced`),id:`advanced`,defaultOpen:!1,children:[(r.getSnapshot().scene?.objects??[]).some(t=>t.id===e.id)&&(0,G.jsx)($,{specs:[Ig],base:J(e.id,``),values:e}),(0,G.jsx)($,{specs:Lg,base:J(e.id,``),values:e}),(0,G.jsx)(Z,{label:t(`inspector.tags`),hint:t(`inspector.tagsHint`),children:(0,G.jsx)(K_,{value:(e.tags??[]).join(`, `),onCommit:e=>i(a(`tags`),e.trim()?e.split(/[\s,]+/).filter(Boolean):void 0),ariaLabel:t(`inspector.tags`)})})]})]})}function US({object:e}){let{t}=U(),n=Ob(),r=e.scale===void 0||typeof e.scale==`number`,i=J(e.id,`scale`),a=typeof e.scale==`number`?[e.scale,e.scale,e.scale]:e.scale??[1,1,1];return(0,G.jsxs)(Z,{label:t(`inspector.scale`),children:[r?(0,G.jsx)(hy,{label:`⇔`,value:typeof e.scale==`number`?e.scale:1,placeholder:e.scale===void 0,step:.01,min:0,onChange:(e,t)=>n(i,e===1?void 0:e,t),ariaLabel:t(`inspector.scale`)}):(0,G.jsx)(_y,{value:a,step:.01,onChange:(e,t)=>n(i,e,t)}),(0,G.jsx)(Y,{label:t(r?`inspector.scaleSplit`:`inspector.scaleUniform`),className:`h-6 w-6`,onClick:()=>n(i,r?a:a[0]===1?void 0:a[0]),children:r?(0,G.jsx)(kn,{size:12}):(0,G.jsx)(Dn,{size:12})})]})}function WS({object:e}){let{t}=U(),r=Ob(),i=e,a=J(e.id,``);switch(e.kind){case`mesh`:case`instances`:{let i=v(`geometries`,e.geometry?.type);return(0,G.jsxs)(J_,{title:t(`inspector.geometry`),id:`geometry`,children:[(0,G.jsx)(Z,{label:t(`inspector.type`),children:(0,G.jsx)(X,{value:e.geometry?.type??``,options:n.map(e=>({value:e.id,label:Cb(e.id)})),onChange:t=>r(J(e.id,`geometry`),{type:t,...VS[t]??{}}),ariaLabel:t(`inspector.type`)})}),i&&(0,G.jsx)($,{specs:i.params,base:J(e.id,`geometry`),values:e.geometry}),e.kind===`instances`&&(0,G.jsx)(Z,{label:t(`inspector.layout`),align:`start`,children:(0,G.jsx)(Eb,{value:e.layout,rows:4,onCommit:t=>r(J(e.id,`layout`),t)})})]})}case`text`:return(0,G.jsx)(GS,{object:e});case`model`:return(0,G.jsxs)(J_,{title:t(`kinds.model`),id:`model`,children:[(0,G.jsx)($,{specs:hg,base:a,values:i}),(0,G.jsx)($,{specs:gg,base:J(e.id,`animation`),values:e.animation})]});case`generator`:{let n=v(`generators`,e.generator);return(0,G.jsxs)(J_,{title:t(`kinds.generator`),id:`generator`,children:[(0,G.jsx)(Z,{label:t(`inspector.type`),children:(0,G.jsx)(X,{value:e.generator,options:c.map(e=>({value:e.id,label:Cb(e.id)})),onChange:t=>r(J(e.id,`generator`),t,!0,e.params?[{op:`remove`,path:J(e.id,`params`)}]:[]),ariaLabel:t(`inspector.type`)})}),n&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:n.description}),(0,G.jsx)(Z,{label:t(`inspector.seed`),children:(0,G.jsx)(hy,{value:e.seed??1,integer:!0,placeholder:e.seed===void 0,onChange:(t,n)=>r(J(e.id,`seed`),t,n),ariaLabel:t(`inspector.seed`)})}),n&&(0,G.jsx)($,{specs:n.params,base:J(e.id,`params`),values:e.params})]})}case`particles`:return(0,G.jsx)(J_,{title:t(`kinds.particles`),id:`particles`,children:(0,G.jsx)($,{specs:_g,base:a,values:i})});case`svg`:return(0,G.jsxs)(J_,{title:t(`kinds.svg`),id:`svg`,children:[(0,G.jsx)(Z,{label:`SVG`,align:`start`,children:(0,G.jsx)(K_,{multiline:!0,mono:!0,value:e.src,onCommit:t=>r(J(e.id,`src`),t),ariaLabel:`SVG`})}),(0,G.jsx)($,{specs:vg.map(t=>t.name===`keepColors`?{...t,default:!e.material}:t),base:a,values:i})]});case`photo`:return(0,G.jsx)(BS,{object:e});default:return null}}function GS({object:e}){let{t}=U(),n=Ob(),r=J(e.id,``),i=e,a=e.outline,o=e.reveal;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J_,{title:t(`kinds.text`),id:`text`,children:[(0,G.jsx)(Z,{label:t(`inspector.text`),align:`start`,children:(0,G.jsx)(K_,{multiline:!0,value:e.text,onCommit:t=>n(J(e.id,`text`),t),ariaLabel:t(`inspector.text`)})}),(0,G.jsx)(Z,{label:t(`inspector.font`),overridden:e.font!==void 0,onReset:()=>n(J(e.id,`font`),void 0),children:(0,G.jsx)(SS,{value:e.font??`sans-bold`,onChange:t=>n(J(e.id,`font`),t===`sans-bold`?void 0:t)})}),(0,G.jsx)($,{specs:fg,base:r,values:i,skip:[`font`,`splitLetters`]})]}),(0,G.jsx)(J_,{title:t(`inspector.outline`),id:`text-outline`,defaultOpen:!!a,actions:(0,G.jsx)(q_,{checked:!!a,onChange:t=>n(J(e.id,`outline`),t?!0:void 0),ariaLabel:t(`inspector.outline`)}),children:a?(0,G.jsx)(Ab,{specs:pg,path:J(e.id,`outline`),value:a,collapse:e=>!Object.keys(e).length||e}):(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`inspector.outlineHint`)})}),(0,G.jsx)(J_,{title:t(`inspector.reveal`),id:`text-reveal`,defaultOpen:!!o,actions:(0,G.jsx)(q_,{checked:!!o,onChange:t=>n(J(e.id,`reveal`),t?{effect:`rise`}:void 0),ariaLabel:t(`inspector.reveal`)}),children:o?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{specs:mg,base:J(e.id,`reveal`),values:o}),(0,G.jsx)(Z,{label:t(`inspector.ease`),overridden:o.ease!==void 0,onReset:()=>n(J(e.id,`reveal.ease`),void 0),children:(0,G.jsx)(wy,{value:o.ease,placeholder:o.effect===`scale`||o.effect===`spin`?`outBack`:`outCubic`,onChange:t=>n(J(e.id,`reveal.ease`),t)})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:xb(`splitLetters`),hint:fg.find(e=>e.name===`splitLetters`)?.description,children:(0,G.jsx)(q_,{checked:!!e.splitLetters,onChange:t=>n(J(e.id,`splitLetters`),t||void 0),ariaLabel:xb(`splitLetters`)})}),(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`inspector.revealHint`)})]})})]})}function KS({object:e}){let{t}=U(),n=Ob(),[r,i]=(0,O.useState)(!1),a=e.material??{},o=J(e.id,`material`),c=a.preset?y(a.preset):void 0,l=e=>e.map(e=>c&&c.props[e.name]!==void 0?{...e,default:c.props[e.name]}:e),u=a.type===`shader`&&a.shader?v(`shaders`,a.shader):void 0,d=a.type??c?.props.type??`standard`,f={...c?.props??{},...a},p=d===`physical`,m=d!==`shader`&&d!==`normal`,h=Ro.filter(e=>a[e]!==void 0||r),g=Ro.some(e=>f[e]!==void 0);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J_,{title:t(`inspector.material`),id:`material`,children:[(0,G.jsx)(Z,{label:t(`inspector.preset`),children:(0,G.jsx)(PS,{value:a.preset,onChange:e=>n(`${o}.preset`,e)})}),c&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:c.description}),(0,G.jsx)(Db,{spec:c?.props.type?{...Ag,default:c.props.type}:Ag,value:a.type,onChange:e=>n(`${o}.type`,e)}),a.type===`shader`&&(0,G.jsx)(Z,{label:t(`inspector.shader`),children:(0,G.jsx)(X,{value:a.shader??``,placeholder:`—`,options:s.map(e=>({value:e.id,label:Cb(e.id)})),onChange:e=>n(`${o}.shader`,e||void 0),ariaLabel:t(`inspector.shader`)})}),u&&(0,G.jsx)($,{specs:u.params,base:`${o}.uniforms`,values:a.uniforms}),a.type!==`shader`&&(0,G.jsx)($,{specs:l(Tg),base:o,values:a}),d===`gradient`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Db,{spec:{name:`gradient`,type:`colors`,description:`Vertical colour ramp.`,default:c?.props.gradient??[`#ff7eb3`,`#7afcff`]},value:a.gradient,onChange:e=>n(`${o}.gradient`,e)}),(0,G.jsx)(Db,{spec:{name:`gradientEmissive`,type:`boolean`,description:`The ramp drives the emissive glow too.`,default:c?.props.gradientEmissive??!1},value:a.gradientEmissive,onChange:e=>n(`${o}.gradientEmissive`,e)})]}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`mx-3 mt-1 text-2xs text-fg-faint hover:text-fg`,children:t(r?`inspector.lessOptions`:`inspector.moreOptions`)}),r&&(0,G.jsx)($,{specs:l(Eg),base:o,values:a})]}),m&&(p||r)&&(0,G.jsxs)(J_,{title:t(`inspector.physicalLayers`),id:`material-physical`,defaultOpen:p,children:[!p&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs text-fg-faint`,children:t(`inspector.physicalHint`)}),Dg.map(e=>{let n=e.specs.some(e=>typeof f[e.name]==`number`&&f[e.name]>0&&e.default===0);return(0,G.jsx)(qS,{title:t(`matgroup.${e.id}`),active:n,specs:l(e.specs),base:o,values:a},e.id)})]}),m&&(0,G.jsxs)(J_,{title:t(`inspector.textures`),id:`material-textures`,defaultOpen:g,children:[(r?Ro:h.length?h:[`map`,`normalMap`,`roughnessMap`]).map(e=>{let r=Og[e],i=c?.props[e];return(0,G.jsxs)(`div`,{className:`px-1`,children:[(0,G.jsx)(LS,{slot:e,value:a[e],path:`${o}.${e}`,onChange:t=>n(`${o}.${e}`,t)}),a[e]===void 0&&i!==void 0&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs text-fg-faint`,children:t(`inspector.fromPreset`,{v:typeof i==`string`?i:`procedural ${i.procedural}`})}),r&&f[e]!==void 0&&(0,G.jsx)(Db,{spec:l([r])[0],value:a[r.name],onChange:(e,t)=>n(`${o}.${r.name}`,e,t)})]},e)}),g&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{specs:l(kg),base:o,values:a}),(0,G.jsxs)(Z,{label:xb(`triplanar`),hint:t(`inspector.triplanarHint`),overridden:a.triplanar!==void 0,onReset:()=>n(`${o}.triplanar`,void 0),children:[(0,G.jsx)(q_,{checked:!!(a.triplanar??c?.props.triplanar),onChange:e=>n(`${o}.triplanar`,e?typeof c?.props.triplanar!=`number`||c.props.triplanar:!c?.props.triplanar&&void 0),ariaLabel:xb(`triplanar`)}),typeof(a.triplanar??c?.props.triplanar)==`number`&&(0,G.jsx)(hy,{value:Number(a.triplanar??c?.props.triplanar),min:.01,onChange:(e,t)=>n(`${o}.triplanar`,e,t),className:`w-[60px] flex-none`,ariaLabel:t(`ui.triplanarScale`)})]})]}),!r&&(0,G.jsx)(`div`,{className:`px-3 pt-1 text-2xs text-fg-faint`,children:t(`inspector.moreSlots`)})]})]})}function qS({title:e,active:t,specs:n,base:r,values:i}){let[a,o]=(0,O.useState)(t),s=n.some(e=>i[e.name]!==void 0);return(0,G.jsxs)(`div`,{className:`mx-2 mb-1 rounded-md border border-line/70`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex h-6 w-full items-center gap-1.5 px-2 text-left text-2xs font-medium text-fg-muted hover:text-fg`,children:[(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 rounded-full`,t||s?`bg-accent`:`bg-ink-4`)}),(0,G.jsx)(`span`,{className:`flex-1`,children:e}),(0,G.jsx)(`span`,{className:`text-fg-faint`,children:a?`−`:`+`})]}),a&&(0,G.jsx)(`div`,{className:`pb-1`,children:(0,G.jsx)($,{specs:n,base:r,values:i})})]})}function JS({object:e,pathBase:t}){let{t:n}=U(),{edit:r}=Q();ev();let i=e.behaviours??[],a=t??J(e.id,`behaviours`);return(0,G.jsxs)(J_,{title:(0,G.jsxs)(`span`,{children:[n(`inspector.behaviours`),` `,i.length>0&&(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:i.length})]}),id:`behaviours`,actions:(0,G.jsx)(pS,{placeholder:n(`inspector.searchBehaviours`),items:g.map(e=>({id:e.id,label:Cb(e.id),hint:e.description})),onPick:t=>{let n=v(`behaviours`,t);e.id?r([{op:`addBehaviour`,id:e.id,behaviour:E_(n)}]):r([{op:`set`,path:`${a}[${i.length}]`,value:E_(n)}])},trigger:e=>(0,G.jsx)(Y,{label:n(`inspector.addBehaviour`),onClick:e,className:`h-6 w-6`,children:(0,G.jsx)(lr,{size:13})})}),children:[!i.length&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:n(`inspector.noBehaviours`)}),(0,G.jsx)(`div`,{className:`space-y-1.5 px-2`,children:i.map((e,t)=>(0,G.jsx)(YS,{behaviour:e,path:`${a}[${t}]`,onRemove:()=>r([{op:`remove`,path:`${a}[${t}]`}])},`${e.type}-${t}`))})]})}function YS({behaviour:e,path:t,onRemove:n}){let{t:r}=U(),i=Ob(),a=v(`behaviours`,e.type),[o,s]=(0,O.useState)(!0);return(0,G.jsxs)(`div`,{className:`rounded-md border border-line bg-ink-0/40`,children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-1 pl-2 pr-1`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`min-w-0 flex-1 truncate text-left text-xs font-medium`,title:a?.description,children:Cb(e.type)}),(0,G.jsx)(`select`,{value:e.when??`always`,onChange:e=>i(`${t}.when`,e.target.value===`always`?void 0:e.target.value),"aria-label":r(`inspector.when`),className:`h-5 rounded bg-transparent px-1 text-2xs text-fg-muted outline-none hover:bg-ink-3`,children:Vo.map(e=>(0,G.jsx)(`option`,{value:e,children:r(`when.${e}`)},e))}),(0,G.jsx)(Y,{label:r(`inspector.removeBehaviour`),onClick:n,className:`h-5 w-5`,children:(0,G.jsx)(Fi,{size:11})})]}),o&&a&&(0,G.jsxs)(`div`,{className:`pb-1.5`,children:[(0,G.jsx)($,{specs:a.params,base:t,values:e}),(0,G.jsx)(Db,{spec:{name:`delay`,type:`number`,description:`Seconds before it starts.`,default:0,min:0},value:e.delay,onChange:(e,n)=>i(`${t}.delay`,e,n)})]}),!a&&(0,G.jsx)(`div`,{className:`px-2 pb-1.5 text-2xs text-danger`,children:r(`inspector.unknownBehaviour`)})]})}function XS({object:e}){let{t}=U(),n=Ob(),r=J(e.id,`body`),i=e.body,a=i,o=i?.shape??`box`,s=jg.filter(e=>e.name===`size`?o===`box`:e.name===`radius`?o===`sphere`||o===`cylinder`||o===`capsule`:e.name!==`height`||o===`cylinder`||o===`capsule`),c=i?.type===`dynamic`,l=Object.keys(ev().scene?.physics?.materials??{}),u=Mg.map(e=>e.name===`material`&&l.length?{...e,type:`enum`,options:[``,...l],default:``}:e);return(0,G.jsx)(J_,{title:t(`inspector.physics`),id:`body`,defaultOpen:!!i,children:i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{specs:s,base:r,values:a}),o===`compound`&&(0,G.jsx)(ZS,{list:i.shapes??[],path:`${r}.shapes`}),(o===`trimesh`||o===`heightfield`)&&c&&(0,G.jsx)(`div`,{className:`mx-3 my-1 rounded bg-danger/10 px-2 py-1 text-2xs text-danger`,children:t(`inspector.staticOnlyShape`)}),(0,G.jsx)(`div`,{className:`mx-3 mb-1 mt-1.5 text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:t(`inspector.bodyMotion`)}),(0,G.jsx)($,{specs:u.filter(e=>c||![`mass`,`linearDamping`,`angularDamping`,`gravityScale`,`velocity`,`angularVelocity`].includes(e.name)||a?.[e.name]!==void 0),base:r,values:a}),(0,G.jsx)($,{specs:Ng,base:r,values:a}),(0,G.jsx)(Z,{label:xb(`collidesWith`),hint:t(`inspector.collidesWithHint`),overridden:i.collidesWith!==void 0,onReset:()=>n(`${r}.collidesWith`,void 0),children:(0,G.jsx)(K_,{value:(i.collidesWith??[]).join(`, `),placeholder:t(`inspector.allLayers`),onCommit:e=>n(`${r}.collidesWith`,e.trim()?e.split(/[\s,]+/).filter(Boolean):void 0),ariaLabel:xb(`collidesWith`)})}),(0,G.jsx)(`div`,{className:`px-3 pt-1`,children:(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,onClick:()=>n(r,void 0),children:[(0,G.jsx)(li,{size:11}),` `,t(`inspector.removeBody`)]})})]}):(0,G.jsxs)(`div`,{className:`flex gap-1 px-3`,children:[(0,G.jsxs)(G_,{size:`xs`,onClick:()=>n(r,{type:`static`}),children:[(0,G.jsx)(lr,{size:11}),` `,t(`inspector.addStaticBody`)]}),(0,G.jsxs)(G_,{size:`xs`,onClick:()=>n(r,{type:`dynamic`,mass:1}),children:[(0,G.jsx)(lr,{size:11}),` `,t(`inspector.addDynamicBody`)]})]})})}function ZS({list:e,path:t}){let{t:n}=U(),{edit:r}=Q();return(0,G.jsxs)(`div`,{className:`space-y-1 px-2 py-1`,children:[e.map((e,i)=>{let a=Pg.filter(t=>t.name===`size`?e.shape===`box`:t.name===`radius`?e.shape!==`box`:t.name!==`height`||e.shape===`cylinder`||e.shape===`capsule`);return(0,G.jsxs)(`div`,{className:`rounded-md border border-line bg-ink-0/40 pb-1`,children:[(0,G.jsxs)(`div`,{className:`flex h-6 items-center gap-1 pl-2 pr-1 text-2xs text-fg-muted`,children:[(0,G.jsx)(`span`,{className:`flex-1`,children:n(`inspector.collider`,{n:i+1})}),(0,G.jsx)(Y,{label:n(`inspector.removeCollider`),className:`h-5 w-5`,onClick:()=>r([{op:`remove`,path:`${t}[${i}]`}]),children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsx)($,{specs:a,base:`${t}[${i}]`,values:e})]},i)}),(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,onClick:()=>r([{op:`set`,path:`${t}[${e.length}]`,value:{shape:`box`,size:[1,1,1]}}]),children:[(0,G.jsx)(lr,{size:11}),` `,n(`inspector.addCollider`)]})]})}function QS(){let{library:e}=Q();return(0,O.useMemo)(()=>{let t=new Set(e.assets.map(e=>e.id));return e.assets.filter(e=>e.kind===`hdri`&&/\.(hdr|exr)$/i.test(e.id)).map(e=>{let n=e.id.replace(/\.(hdr|exr)$/i,`.jpg`);return{id:e.id,ref:`library:${e.id}`,name:e.id.replace(/^hdri\//,``).replace(/\.\w+$/,``),preview:t.has(n)?n:null,description:e.description,tags:e.tags??[]}})},[e])}function $S({value:e,onChange:t}){let{t:n}=U(),r=Px(),i=QS(),a=i.find(t=>t.ref===e||t.ref.replace(/\.hdr$/,``)===e);return(0,G.jsx)(by,{width:320,trigger:(t,n)=>(0,G.jsxs)(xy,{onClick:t,open:n,ariaLabel:`HDRI`,children:[a?.preview&&r?(0,G.jsx)(`img`,{src:Fx(r,a.preview),alt:``,className:`h-4 w-7 shrink-0 rounded-sm object-cover`}):(0,G.jsx)(zn,{size:12,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:`truncate`,children:a?.name??e.split(`/`).pop()})]}),children:o=>(0,G.jsxs)(`div`,{className:`space-y-2 p-2`,children:[(0,G.jsx)(`div`,{className:`grid grid-cols-3 gap-1.5`,children:i.map(e=>(0,G.jsxs)(`button`,{type:`button`,title:e.description,"aria-pressed":a?.id===e.id,onClick:()=>{t(e.ref),o()},className:W(`group relative overflow-hidden rounded-md text-left ring-1`,a?.id===e.id?`ring-accent`:`ring-line hover:ring-fg-faint`),children:[e.preview&&r?(0,G.jsx)(`img`,{src:Fx(r,e.preview),alt:``,loading:`lazy`,className:`block aspect-[2/1] w-full object-cover`}):(0,G.jsx)(`div`,{className:`aspect-[2/1] w-full bg-ink-3`}),(0,G.jsx)(`span`,{className:`absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/80 to-transparent px-1.5 pb-0.5 pt-2 text-[10px] text-white`,children:e.name}),a?.id===e.id&&(0,G.jsx)(Pe,{size:11,className:`absolute right-1 top-1 text-white drop-shadow`})]},e.id))}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-2xs text-fg-faint`,children:n(`env.hdriPath`)}),(0,G.jsx)(K_,{value:e,onCommit:e=>e.trim()&&t(e.trim()),mono:!0,ariaLabel:n(`env.hdriPath`)})]})]})})}var eC=e=>e,tC=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function nC(e){return e===`transparent`?`transparent`:typeof e==`string`?`color`:`gradient`in e?`gradient`:`radial`in e?`radial`:`meshGradient`in e?`meshGradient`:`sky`in e?e.sky.physical||e.sky.preset?`physicalSky`:`sky`:`hdri`}var rC={color:`#15171c`,gradient:{gradient:[`#141e30`,`#243b55`],angle:0},radial:{radial:[`#2b3350`,`#0d0f16`]},meshGradient:{meshGradient:[`#ff6ec4`,`#7873f5`,`#4adede`,`#ffd86f`],speed:.2},sky:{sky:{top:`#3a7bd5`,horizon:`#f6d5a8`,bottom:`#d1d7e0`}},physicalSky:{sky:{preset:`golden-hour`}},hdri:{hdri:`library:hdri/studio.hdr`,blur:.5},transparent:`transparent`},iC={sunrise:[`#f8b878`,`#8fb6e8`],morning:[`#dfeaf5`,`#6fa3dc`],noon:[`#cfe6ff`,`#3d82d6`],afternoon:[`#f3e2c4`,`#5b93d1`],"golden-hour":[`#ffb56b`,`#6e8fc9`],sunset:[`#ff7a45`,`#4b4f8f`],dusk:[`#b26a8a`,`#1f2550`]};function aC({scene:e}){let{t}=U(),n=Ob(),r=e.environment??{background:`#000000`},i=r.background,a=nC(i),o=`environment.background`,s=tC(i)&&`sky`in i?i.sky:{};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J_,{title:t(`scene.environment`),id:`environment`,children:[(0,G.jsx)(Z,{label:t(`scene.background`),children:(0,G.jsx)(X,{value:a,options:Object.keys(rC).map(e=>({value:e,label:t(`bg.${e}`)})),onChange:e=>n(o,rC[e]),ariaLabel:t(`scene.background`)})}),a===`color`&&(0,G.jsx)(Z,{label:t(`scene.color`),children:(0,G.jsx)(Ny,{value:i,onChange:(e,t)=>n(o,e,t)})}),(a===`gradient`||a===`radial`||a===`meshGradient`)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:t(`scene.colors`),children:(0,G.jsx)(Py,{value:eC(i)?.[a]??[],onChange:(e,t)=>n(`${o}.${a}`,e,t)})}),a===`gradient`&&(0,G.jsx)($,{specs:[{name:`angle`,type:`number`,description:`Degrees, 0 = bottom → top.`,default:0,min:-180,max:180},{name:`grain`,type:`number`,description:`Film grain.`,default:0,min:0,max:1}],base:o,values:eC(i)}),a===`radial`&&(0,G.jsx)($,{specs:[{name:`center`,type:`vec2`,description:`0..1 (default centre).`,default:[.5,.5]},{name:`radius`,type:`number`,description:``,default:1,min:.05,max:3},{name:`grain`,type:`number`,description:`Film grain.`,default:0,min:0,max:1}],base:o,values:eC(i)}),a===`meshGradient`&&(0,G.jsx)($,{specs:Jg,base:o,values:eC(i)})]}),a===`sky`&&(0,G.jsx)($,{specs:Ug,base:`${o}.sky`,values:eC(s)}),a===`physicalSky`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`grid grid-cols-4 gap-1 px-3 py-1`,role:`radiogroup`,"aria-label":t(`env.skyPreset`),children:Lo.map(e=>{let[t,r]=iC[e]??[`#888`,`#444`],i=s.preset===e;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":i,title:Cb(e),onClick:()=>n(`${o}.sky.preset`,e),className:W(`overflow-hidden rounded-md text-left ring-1 transition`,i?`ring-accent`:`ring-line hover:ring-fg-faint`),children:[(0,G.jsx)(`span`,{className:`block h-6 w-full`,style:{background:`linear-gradient(0deg, ${t}, ${r})`}}),(0,G.jsx)(`span`,{className:W(`block truncate px-1 py-0.5 text-[10px]`,i?`text-accent`:`text-fg-muted`),children:Cb(e)})]},e)})}),(0,G.jsx)(`div`,{className:`mx-3 mb-0.5 mt-1.5 text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:t(`env.sun`)}),s.sun===!1?(0,G.jsx)(Z,{label:t(`env.sun`),children:(0,G.jsx)(q_,{checked:!1,onChange:()=>n(`${o}.sky.sun`,void 0),ariaLabel:t(`env.sun`)})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ab,{specs:Gg,path:`${o}.sky.sun`,value:s.sun,collapse:e=>Object.keys(e).length?e:void 0}),(0,G.jsx)(Z,{label:t(`env.noSun`),children:(0,G.jsx)(q_,{checked:!1,onChange:()=>n(`${o}.sky.sun`,!1),ariaLabel:t(`env.noSun`)})})]}),(0,G.jsx)(`div`,{className:`mx-3 mb-0.5 mt-1.5 text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:t(`env.atmosphere`)}),(0,G.jsx)($,{specs:Wg,base:`${o}.sky`,values:eC(s),skip:[`preset`]})]}),a===`hdri`&&tC(i)&&`hdri`in i&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:`HDRI`,children:(0,G.jsx)($S,{value:i.hdri,onChange:e=>n(`${o}.hdri`,e)})}),(0,G.jsx)($,{specs:Kg,base:o,values:eC(i)}),(0,G.jsx)(Z,{label:t(`env.groundProjection`),hint:t(`env.groundProjectionHint`),children:(0,G.jsx)(q_,{checked:!!i.groundProjection,onChange:e=>n(`${o}.groundProjection`,e||void 0),ariaLabel:t(`env.groundProjection`)})}),i.groundProjection&&(0,G.jsx)(Ab,{specs:qg,path:`${o}.groundProjection`,value:i.groundProjection,collapse:e=>!Object.keys(e).length||e})]})]}),(0,G.jsx)(oC,{env:r}),(0,G.jsx)(sC,{env:r}),(0,G.jsx)(cC,{env:r})]})}function oC({env:e}){let{t}=U(),n=Ob(),r=tC(e.lighting)?`hdri`:e.lighting??`none`,i=e.rig,a=typeof i==`string`?i:i?.preset,o=a?v(`lightRigs`,a):void 0;return(0,G.jsxs)(J_,{title:t(`env.lighting`),id:`env-lighting`,children:[(0,G.jsx)(Z,{label:t(`scene.lighting`),hint:t(`scene.lightingHint`),children:(0,G.jsx)(X,{value:r,options:[...Io.map(e=>({value:e,label:t(`lighting.${e}`)})),{value:`hdri`,label:t(`lighting.hdri`)}],onChange:e=>n(`environment.lighting`,e===`hdri`?{hdri:`library:hdri/studio.hdr`}:e),ariaLabel:t(`scene.lighting`)})}),tC(e.lighting)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:`HDRI`,children:(0,G.jsx)($S,{value:e.lighting.hdri,onChange:e=>n(`environment.lighting.hdri`,e)})}),(0,G.jsx)($,{specs:$g,base:`environment.lighting`,values:eC(e.lighting)})]}),(0,G.jsx)(Z,{label:t(`env.lightingIntensity`),hint:t(`scene.lightingHint`),overridden:e.lightingIntensity!==void 0,onReset:()=>n(`environment.lightingIntensity`,void 0),children:(0,G.jsx)(vy,{value:e.lightingIntensity??1,min:0,max:4,placeholder:e.lightingIntensity===void 0,onChange:(e,t)=>n(`environment.lightingIntensity`,e===1?void 0:e,t),ariaLabel:t(`scene.intensity`)})}),(0,G.jsx)(Z,{label:t(`env.rig`),hint:t(`env.rigHint`),children:(0,G.jsx)(X,{value:a??``,placeholder:t(`scene.none`),options:h.map(e=>({value:e.id,label:Cb(e.id)})),onChange:e=>n(`environment.rig`,e?tC(i)?{...i,preset:e}:e:void 0),ariaLabel:t(`env.rig`)})}),o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:o.description}),(0,G.jsx)(Ab,{specs:o.params,path:`environment.rig`,value:i,expand:e=>({preset:e}),collapse:e=>Object.keys(e).length===1?e.preset:e})]})]})}function sC({env:e}){let{t}=U(),n=Ob(),r=e.contactShadows;return(0,G.jsxs)(J_,{title:t(`env.shadows`),id:`env-shadows`,defaultOpen:!!r||!!e.shadows,children:[(0,G.jsx)(Z,{label:t(`env.contactShadows`),hint:t(`env.contactShadowsHint`),children:(0,G.jsx)(q_,{checked:!!r,onChange:e=>n(`environment.contactShadows`,e||void 0),ariaLabel:t(`env.contactShadows`)})}),r&&(0,G.jsx)(Ab,{specs:Yg,path:`environment.contactShadows`,value:r,collapse:e=>!Object.keys(e).length||e}),(0,G.jsx)(Z,{label:t(`env.shadowQuality`),hint:t(`env.shadowQualityHint`),children:(0,G.jsx)(q_,{checked:!!e.shadows,onChange:e=>n(`environment.shadows`,e?{type:`vsm`,softness:4}:void 0),ariaLabel:t(`env.shadowQuality`)})}),e.shadows&&(0,G.jsx)($,{specs:Xg,base:`environment.shadows`,values:eC(e.shadows)})]})}function cC({env:e}){let{t}=U(),n=Ob(),r=e.fog,i=r?`density`in r?`height`in r&&r.height!==void 0?`height`:`exp`:`linear`:`off`;return(0,G.jsxs)(J_,{title:t(`env.atmosphereGround`),id:`env-fog`,defaultOpen:!!r||!!e.ground,children:[(0,G.jsx)(Z,{label:t(`scene.fog`),children:(0,G.jsx)(X,{value:i,options:[{value:`off`,label:t(`scene.off`)},{value:`linear`,label:t(`scene.fogLinear`)},{value:`exp`,label:t(`scene.fogDensity`)},{value:`height`,label:t(`env.fogHeight`)}],onChange:e=>n(`environment.fog`,e===`off`?void 0:e===`linear`?{color:r?.color??`#a0b4c8`,near:10,far:40}:e===`exp`?{color:r?.color??`#a0b4c8`,density:.03}:{color:r?.color??`#c8d2dc`,density:.06,height:.5,falloff:.6}),ariaLabel:t(`scene.fog`)})}),r&&(0,G.jsx)($,{specs:`density`in r?Qg.filter(e=>i===`height`||e.name!==`height`&&e.name!==`falloff`):Zg,base:`environment.fog`,values:eC(r)}),(0,G.jsx)(Z,{label:t(`scene.ground`),children:(0,G.jsx)(q_,{checked:!!e.ground,onChange:e=>n(`environment.ground`,e?{y:0,shadowOnly:!0}:void 0),ariaLabel:t(`scene.ground`)})}),e.ground&&(0,G.jsx)($,{specs:e_,base:`environment.ground`,values:eC(e.ground)})]})}var lC=e=>e,uC={axis:[`hinge`],distance:[`distance`],restLength:[`spring`],stiffness:[`spring`],damping:[`spring`]};function dC({scene:e}){let{t}=U(),n=Ob(),{edit:r}=Q(),i=e.physics,a=[];Pc(e.objects,e=>void(e.body&&a.push(e.id)));let o=i?.joints??[],s=i?.materials??{};return(0,G.jsx)(J_,{title:t(`scene.physics`),id:`physics`,defaultOpen:!!i,children:i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{specs:t_,base:`physics`,values:lC(i)}),(0,G.jsx)(Z,{label:t(`physics.layers`),hint:t(`physics.layersHint`),overridden:i.layers!==void 0,onReset:()=>n(`physics.layers`,void 0),children:(0,G.jsx)(K_,{value:(i.layers??[]).join(`, `),placeholder:`default, player, enemies`,onCommit:e=>n(`physics.layers`,e.trim()?e.split(/[\s,]+/).filter(Boolean):void 0),ariaLabel:t(`physics.layers`)})}),(0,G.jsxs)(`div`,{className:`mx-3 mb-0.5 mt-2 flex items-center text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:[(0,G.jsx)(`span`,{className:`flex-1`,children:t(`physics.materials`)}),(0,G.jsx)(Y,{label:t(`physics.addMaterial`),className:`h-5 w-5`,onClick:()=>{let e=1;for(;s[`surface${e}`];)e++;n(`physics.materials`,{...s,[`surface${e}`]:{friction:.5,restitution:0}})},children:(0,G.jsx)(lr,{size:11})})]}),Object.entries(s).map(([e,t])=>(0,G.jsx)(fC,{name:e,m:t,onRename:t=>t&&t!==e&&!s[t]&&n(`physics.materials`,Object.fromEntries(Object.entries(s).map(([n,r])=>[n===e?t:n,r]))),onRemove:()=>{let t={...s};delete t[e],n(`physics.materials`,Object.keys(t).length?t:void 0)}},e)),!Object.keys(s).length&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`physics.noMaterials`)}),(i.contacts!==void 0||Object.keys(s).length>1)&&(0,G.jsx)(Z,{label:t(`physics.contacts`),hint:t(`physics.contactsHint`),align:`start`,children:(0,G.jsx)(Eb,{value:i.contacts??[],rows:2,onCommit:e=>n(`physics.contacts`,Array.isArray(e)&&e.length?e:void 0)})}),(0,G.jsxs)(`div`,{className:`mx-3 mb-0.5 mt-2 flex items-center text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:[(0,G.jsxs)(`span`,{className:`flex-1`,children:[t(`physics.joints`),` `,o.length>0&&(0,G.jsx)(`span`,{className:`font-normal`,children:o.length})]}),(0,G.jsx)(Y,{label:t(`physics.addJoint`),className:`h-5 w-5`,disabled:!a.length,onClick:()=>r([{op:`set`,path:`physics.joints[${o.length}]`,value:{type:`hinge`,a:a[0],...a[1]?{b:a[1]}:{}}}]),children:(0,G.jsx)(lr,{size:11})})]}),(0,G.jsx)(`div`,{className:`space-y-1 px-2`,children:o.map((e,t)=>(0,G.jsx)(pC,{joint:e,index:t,bodies:a,onRemove:()=>r(o.length===1?[{op:`remove`,path:`physics.joints`}]:[{op:`remove`,path:`physics.joints[${t}]`}])},t))}),!o.length&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:a.length?t(`physics.noJoints`):t(`physics.noBodies`)}),(0,G.jsx)(`div`,{className:`px-3 pt-2`,children:(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,onClick:()=>n(`physics`,void 0),children:[(0,G.jsx)(li,{size:11}),` `,t(`scene.disable`)]})})]}):(0,G.jsx)(`div`,{className:`px-3`,children:(0,G.jsxs)(G_,{size:`xs`,onClick:()=>n(`physics`,{gravity:[0,-9.81,0]}),children:[(0,G.jsx)(lr,{size:11}),` `,t(`scene.enablePhysics`)]})})})}function fC({name:e,m:t,onRename:n,onRemove:r}){let{t:i}=U(),a=Ob(),o=`physics.materials.${e}`;return(0,G.jsxs)(`div`,{className:`flex items-center gap-1 px-3 py-[3px]`,children:[(0,G.jsx)(K_,{value:e,onCommit:e=>n(e.trim()),className:`w-[84px] flex-none font-mono text-xs`,ariaLabel:i(`physics.materialName`)}),(0,G.jsx)(hy,{label:`μ`,value:t.friction??.5,min:0,max:2,placeholder:t.friction===void 0,onChange:(e,t)=>a(`${o}.friction`,e,t),ariaLabel:xb(`friction`)}),(0,G.jsx)(hy,{label:`e`,value:t.restitution??0,min:0,max:1,placeholder:t.restitution===void 0,onChange:(e,t)=>a(`${o}.restitution`,e,t),ariaLabel:xb(`restitution`)}),(0,G.jsx)(Y,{label:i(`physics.removeMaterial`),className:`h-5 w-5`,onClick:r,children:(0,G.jsx)(Fi,{size:11})})]})}function pC({joint:e,index:t,bodies:n,onRemove:r}){let{t:i}=U(),a=Ob(),o=`physics.joints[${t}]`,s=Fg.filter(t=>t.name!==`type`&&(!uC[t.name]||uC[t.name].includes(e.type)));return(0,G.jsxs)(`div`,{className:`rounded-md border border-line bg-ink-0/40 pb-1`,children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-1 pl-2 pr-1`,children:[(0,G.jsx)(X,{value:e.type,options:Fg[0].options.map(e=>({value:e,label:Cb(e)})),onChange:e=>a(`${o}.type`,e),className:`w-[92px] flex-none`,ariaLabel:i(`physics.jointType`)}),(0,G.jsxs)(`span`,{className:`flex-1 truncate font-mono text-2xs text-fg-faint`,children:[e.a,` ↔ `,e.b??i(`physics.world`)]}),(0,G.jsx)(Y,{label:i(`physics.removeJoint`),className:`h-5 w-5`,onClick:r,children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsx)(Z,{label:`A`,children:(0,G.jsx)(X,{value:e.a,options:n,onChange:e=>a(`${o}.a`,e),ariaLabel:`a`})}),(0,G.jsx)(Z,{label:`B`,children:(0,G.jsx)(X,{value:e.b??``,placeholder:i(`physics.world`),options:n.filter(t=>t!==e.a),onChange:e=>a(`${o}.b`,e||void 0),ariaLabel:`b`})}),(0,G.jsx)($,{specs:s,base:o,values:lC(e)}),e.type===`hinge`&&(0,G.jsxs)(Z,{label:i(`physics.motor`),hint:i(`physics.motorHint`),overridden:e.motor!==void 0,onReset:()=>a(`${o}.motor`,void 0),children:[(0,G.jsx)(hy,{label:`°/s`,value:e.motor?.speed??0,placeholder:!e.motor,onChange:(t,n)=>a(`${o}.motor`,t?{...e.motor??{},speed:t}:void 0,n),ariaLabel:i(`physics.motor`)}),(0,G.jsx)(hy,{label:`F`,value:e.motor?.maxForce??1e6,min:0,placeholder:e.motor?.maxForce===void 0,onChange:(t,n)=>e.motor&&a(`${o}.motor.maxForce`,t,n),ariaLabel:xb(`maxForce`)})]})]})}function mC(e){let t=e.findIndex(e=>e.type===`look`);if(t<0)return null;let n=e[t];return{index:t,preset:typeof n.preset==`string`?n.preset:void 0,intensity:typeof n.intensity==`number`?n.intensity:void 0}}function hC(e,t){let n=mC(e),r=e.filter(e=>e.type!==`look`);return t?[{type:`look`,preset:t,...n?.intensity===void 0?{}:{intensity:n.intensity}},...r]:r}function gC(e,t,n){if(t===n||t<0||t>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return r.splice(Math.max(0,Math.min(r.length,n)),0,i),r}function _C(e,t){return e.filter((e,n)=>n!==t)}function vC(e,t){return[...e,{type:t}]}var yC={low:`bg-agent/15 text-agent`,medium:`bg-warn/15 text-warn`,high:`bg-danger/15 text-danger`};function bC({scene:e}){let{t}=U(),{edit:n}=Q(),r=Ob(),i=e.postfx??[],o=mC(i),s=e=>n(e.length?[{op:`set`,path:`postfx`,value:e}]:i.length?[{op:`remove`,path:`postfx`}]:[]),c=qa(i),[l,d]=(0,O.useState)(null),[f,m]=(0,O.useState)(null),h=i.map((e,t)=>({fx:e,i:t})).filter(e=>e.fx.type!==`look`);return(0,G.jsxs)(J_,{title:(0,G.jsxs)(`span`,{children:[t(`scene.postfx`),` `,h.length>0&&(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:h.length})]}),id:`postfx`,defaultOpen:i.length>0,actions:(0,G.jsx)(pS,{placeholder:t(`scene.searchEffects`),items:a.filter(e=>e.id!==`look`).map(e=>({id:e.id,label:Cb(e.id),hint:e.description})),onPick:e=>s(vC(i,e)),trigger:e=>(0,G.jsx)(Y,{label:t(`scene.addEffect`),onClick:e,className:`h-6 w-6`,children:(0,G.jsx)(lr,{size:13})})}),children:[(0,G.jsx)(Z,{label:t(`postfx.look`),hint:t(`postfx.lookHint`),children:(0,G.jsx)(X,{value:o?.preset??``,placeholder:t(`scene.none`),options:u.map(e=>({value:e,label:Cb(e)})),onChange:e=>s(hC(i,e||null)),ariaLabel:t(`postfx.look`)})}),o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:[p[o.preset]?.description,` `,(0,G.jsx)(`span`,{className:`text-fg-muted`,children:p[o.preset]?.effects.map(e=>e.type).join(` · `)})]}),(0,G.jsx)(Z,{label:t(`scene.intensity`),overridden:o.intensity!==void 0,onReset:()=>r(`postfx[${o.index}].intensity`,void 0),children:(0,G.jsx)(vy,{value:o.intensity??1,min:0,max:1,placeholder:o.intensity===void 0,onChange:(e,t)=>r(`postfx[${o.index}].intensity`,e===1?void 0:e,t),ariaLabel:t(`scene.intensity`)})})]}),(0,G.jsxs)(`div`,{className:`space-y-1 px-2 pt-1`,onDragOver:e=>e.preventDefault(),children:[h.map(({fx:e,i:t})=>(0,G.jsx)(xC,{fx:e,index:t,first:t===h[0]?.i,last:t===h[h.length-1]?.i,dropTarget:f===t&&l!==null&&l!==t,onMove:e=>s(gC(i,t,e)),onRemove:()=>s(_C(i,t)),onDragStart:()=>d(t),onDragEnter:()=>m(t),onDrop:()=>{l!==null&&l!==t&&s(gC(i,l,t)),d(null),m(null)},onDragEnd:()=>{d(null),m(null)}},`${e.type}-${t}`)),!i.length&&(0,G.jsx)(`div`,{className:`px-1 text-2xs text-fg-faint`,children:t(`scene.noEffects`)})]}),i.length>0&&(0,G.jsxs)(`div`,{className:`mx-3 mt-1.5 flex items-center gap-1.5 text-2xs text-fg-faint`,title:t(`postfx.costHint`),children:[(0,G.jsx)(`span`,{className:W(`rounded px-1 font-medium`,c.level===`heavy`?yC.high:c.level===`moderate`?yC.medium:yC.low),children:t(`postfx.level.${c.level}`)}),t(`postfx.passes`,{n:c.passes}),c.dropped.low.length>0&&(0,G.jsxs)(`span`,{className:`truncate`,children:[`· `,t(`postfx.droppedLow`,{list:c.dropped.low.join(`, `)})]})]})]})}function xC(e){let{t}=U(),{fx:n,index:r}=e,i=v(`postfx`,n.type),[a,o]=(0,O.useState)(!0),s=(0,O.useRef)(!1),c=Va(n.type);return(0,G.jsxs)(`div`,{draggable:!0,onDragStart:t=>{if(!s.current)return t.preventDefault();t.dataTransfer.effectAllowed=`move`,e.onDragStart()},onDragEnter:e.onDragEnter,onDrop:e.onDrop,onDragEnd:()=>{s.current=!1,e.onDragEnd()},className:W(`rounded-md border bg-ink-0/40 pb-0.5 transition-colors`,e.dropTarget?`border-accent`:`border-line`),children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-0.5 pl-0.5 pr-1`,children:[(0,G.jsx)(`span`,{onPointerDown:()=>s.current=!0,onPointerUp:()=>s.current=!1,className:`flex h-6 w-4 cursor-grab items-center justify-center text-fg-faint hover:text-fg`,title:t(`postfx.drag`),children:(0,G.jsx)(Xt,{size:12})}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex min-w-0 flex-1 items-center gap-1 text-left text-xs font-medium`,title:i?.description,children:[a?(0,G.jsx)(Ie,{size:11,className:`text-fg-faint`}):(0,G.jsx)(Be,{size:11,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:`truncate`,children:Cb(n.type)})]}),(0,G.jsx)(`span`,{className:W(`rounded px-1 text-[10px]`,yC[c]),title:t(`postfx.gpuHint`),children:t(`postfx.gpu.${c}`)}),(0,G.jsx)(Y,{label:t(`postfx.up`),className:`h-5 w-5`,disabled:e.first,onClick:()=>e.onMove(r-1),children:(0,G.jsx)(He,{size:11})}),(0,G.jsx)(Y,{label:t(`postfx.down`),className:`h-5 w-5`,disabled:e.last,onClick:()=>e.onMove(r+1),children:(0,G.jsx)(Ie,{size:11})}),(0,G.jsx)(Y,{label:t(`scene.removeEffect`),className:`h-5 w-5`,onClick:e.onRemove,children:(0,G.jsx)(Fi,{size:11})})]}),a&&i&&i.params.length>0&&(0,G.jsx)($,{specs:i.params,base:`postfx[${r}]`,values:n}),a&&i&&!i.params.length&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs text-fg-faint`,children:i.description}),!i&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs text-danger`,children:t(`postfx.unknown`)})]})}var SC=(e,t,n,r,i)=>({name:e,type:`number`,description:t,default:n,min:r,max:i}),CC=(e,t)=>({name:e,type:`vec3`,description:t}),wC=SC(`fov`,`Field of view to reach (degrees).`,void 0,1,179),TC={dolly:[SC(`distance`,`Units along the view axis (+ = forward).`,void 0),wC],pushIn:[SC(`distance`,`Units closer (default: 25 % of the distance).`,void 0,0),wC],pullOut:[SC(`distance`,`Units back (default: 33 % of the distance).`,void 0,0),wC],truck:[SC(`distance`,`Units sideways (+ = right).`,1),wC],pedestal:[SC(`distance`,`Units up (- = down); the target follows.`,1),wC],crane:[SC(`height`,`Rise (units) while the target stays.`,2),SC(`distance`,`Units toward the target.`,void 0),wC],orbit:[SC(`angle`,`Yaw around the target (degrees).`,90,-720,720),SC(`elevation`,`Elevation change (degrees).`,0,-89,89),SC(`distance`,`Distance change (units).`,void 0),wC],zoom:[{...wC,required:!0}],move:[CC(`position`,`Camera position to reach.`),CC(`target`,`Look-at point to reach.`),wC],path:[SC(`lookAhead`,`Look ahead along the path (0..0.5).`,.05,0,.5),wC],lookAt:[CC(`target`,`Point to pan to (or pick an object).`),wC],focus:[SC(`focus`,`Focus distance (or pick an object).`,void 0,0)]},EC={lookAt:`object`,focus:`object`,path:`lookAt`};function DC(e,t,n){let r=(e.camera.shots??[]).reduce((e,t)=>Math.max(e,(t.at??0)+(t.duration??0)),0),i={type:t,at:Math.round((n??r)*100)/100,duration:2},a=e.camera.position;switch(t){case`zoom`:i.fov=Math.max(10,(e.camera.fov??45)-15);break;case`move`:i.position=[a[0]+2,a[1]+1,a[2]];break;case`path`:i.points=[[a[0]+2,a[1]+.5,a[2]-1],[a[0]+3,a[1]+1,a[2]-3]];break;case`lookAt`:i.target=e.camera.target??[0,0,0];break;case`focus`:i.focus=5}return i}function OC(e){return(e??[]).reduce((e,t)=>Math.max(e,(t.at??0)+(t.duration??0)),0)}var kC=[`#7c8cff`,`#f2b654`,`#4fd1a5`,`#f26d9b`,`#6fc3ff`,`#c39bff`];function AC({scene:e}){let{t}=U(),{edit:n,player:r}=Q(),i=e.camera.shots??[],[a,o]=(0,O.useState)(0);(0,O.useEffect)(()=>r.onTime(o),[r]);let s=Math.max(e.timeline?.duration??0,OC(i),1),c=e=>n(e.length?[{op:`set`,path:`camera.shots`,value:e}]:[{op:`remove`,path:`camera.shots`}]);return(0,G.jsxs)(J_,{title:(0,G.jsxs)(`span`,{children:[t(`shots.title`),` `,i.length>0&&(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:i.length})]}),id:`camera-shots`,defaultOpen:i.length>0,actions:(0,G.jsx)(pS,{placeholder:t(`shots.search`),items:ro.map(e=>({id:e,label:Cb(e),hint:t(`shots.type.${e}`)})),onPick:t=>c([...i,DC(e,t)]),trigger:e=>(0,G.jsx)(Y,{label:t(`shots.add`),onClick:e,className:`h-6 w-6`,children:(0,G.jsx)(lr,{size:13})})}),children:[i.length>0&&(0,G.jsxs)(`div`,{className:`relative mx-3 mb-1.5 h-5 overflow-hidden rounded bg-ink-0`,title:t(`shots.laneHint`),children:[i.map((e,t)=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>void r.seek(e.at),className:`absolute top-0.5 h-4 rounded-sm text-left text-[9px] leading-4 text-ink-0`,style:{left:`${e.at/s*100}%`,width:`${Math.max(1.5,e.duration/s*100)}%`,background:kC[t%kC.length],opacity:.85},children:(0,G.jsx)(`span`,{className:`block truncate px-1`,children:Cb(e.type)})},t)),(0,G.jsx)(`div`,{className:`pointer-events-none absolute bottom-0 top-0 w-px bg-white`,style:{left:`${Math.min(1,a/s)*100}%`}})]}),(0,G.jsx)(`div`,{className:`space-y-1 px-2`,children:i.map((t,n)=>(0,G.jsx)(jC,{scene:e,shot:t,index:n,hue:kC[n%kC.length],time:a,onRemove:()=>c(i.filter((e,t)=>t!==n))},n))}),!i.length&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`shots.empty`)})]})}function jC({scene:e,shot:t,index:n,hue:r,time:i,onRemove:a}){let{t:o}=U(),{player:s}=Q(),c=Ob(),l=`camera.shots[${n}]`,u=EC[t.type],d=Rc(e),f=i>=t.at&&i<=t.at+t.duration,p=t.duration>0?Math.min(1,Math.max(0,(i-t.at)/t.duration)):0,m=typeof t.lookAt==`string`?t.lookAt:``;return(0,G.jsxs)(`div`,{className:W(`rounded-md border bg-ink-0/40 pb-1`,f?`border-accent/50`:`border-line`),children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-1 pl-2 pr-1`,children:[(0,G.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-sm`,style:{background:r}}),(0,G.jsx)(X,{value:t.type,options:ro.map(e=>({value:e,label:Cb(e)})),onChange:n=>c(l,{type:n,at:t.at,duration:t.duration,...t.ease?{ease:t.ease}:{},...MC(e,n)}),className:`w-[96px] flex-none`,ariaLabel:o(`shots.typeLabel`)}),(0,G.jsx)(`span`,{className:`flex-1 truncate text-2xs text-fg-faint`,children:o(`shots.type.${t.type}`)}),(0,G.jsx)(Y,{label:o(`shots.play`),className:`h-5 w-5`,onClick:async()=>{await s.seek(t.at),s.play()},children:(0,G.jsx)(sr,{size:10})}),(0,G.jsx)(Y,{label:o(`shots.remove`),className:`h-5 w-5`,onClick:a,children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsxs)(Z,{label:o(`shots.timing`),children:[(0,G.jsx)(hy,{label:`@`,value:t.at,min:0,step:.05,suffix:`s`,onChange:(e,t)=>c(`${l}.at`,e,t),ariaLabel:o(`shots.at`)}),(0,G.jsx)(hy,{label:`↔`,value:t.duration,min:.05,step:.05,suffix:`s`,onChange:(e,t)=>c(`${l}.duration`,e,t),ariaLabel:o(`shots.duration`)})]}),(0,G.jsx)(Z,{label:o(`inspector.ease`),overridden:t.ease!==void 0,onReset:()=>c(`${l}.ease`,void 0),children:(0,G.jsx)(wy,{value:t.ease,placeholder:`inOutCubic`,onChange:e=>c(`${l}.ease`,e)})}),(0,G.jsx)($,{specs:TC[t.type].map(n=>n.name===`fov`&&t.type!==`zoom`?{...n,default:e.camera.fov??45}:n),base:l,values:t}),u&&(0,G.jsx)(Z,{label:o(`shots.object`),hint:o(`shots.objectHint`),children:(0,G.jsx)(X,{value:u===`object`?t.object??``:m,placeholder:`—`,options:d,onChange:e=>c(`${l}.${u}`,e||void 0),ariaLabel:o(`shots.object`)})}),t.type===`path`&&(0,G.jsx)(Z,{label:o(`shots.points`),align:`start`,children:(0,G.jsx)(Eb,{value:t.points??[],rows:3,onCommit:e=>Array.isArray(e)&&c(`${l}.points`,e)})}),(0,G.jsx)(Z,{label:o(`shots.preview`),hint:o(`shots.previewHint`),children:(0,G.jsx)(`input`,{type:`range`,min:0,max:1,step:.01,value:f?p:0,onChange:e=>void s.seek(t.at+Number(e.target.value)*t.duration),"aria-label":o(`shots.preview`),className:`slider h-5 w-full cursor-pointer appearance-none rounded-full bg-ink-3`})})]})}function MC(e,t){let{type:n,at:r,duration:i,...a}=DC(e,t);return a}var NC=e=>e;function PC(){let{t:e}=U(),t=ev().scene,n=Ob();return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`border-b border-line px-3 py-2.5`,children:[(0,G.jsx)(`div`,{className:`text-sm font-semibold`,children:e(`scene.title`)}),(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:e(`scene.subtitle`)})]}),(0,G.jsx)(J_,{title:e(`scene.meta`),id:`meta`,children:(0,G.jsx)($,{specs:i_,base:``,values:NC(t)})}),(0,G.jsxs)(J_,{title:e(`scene.target`),id:`target`,children:[(0,G.jsx)(Z,{label:e(`scene.kind`),children:(0,G.jsx)(X,{value:t.target.kind,options:Mo,onChange:e=>n(`target`,{...t.target,kind:e,aspect:Wo[e]??t.target.aspect}),ariaLabel:e(`scene.kind`)})}),(0,G.jsx)($,{specs:Rg,base:`target`,values:NC(t.target)})]}),(0,G.jsx)(J_,{title:e(`scene.camera`),id:`camera`,children:(0,G.jsx)($,{specs:zg.filter(e=>t.camera.type===`orthographic`?e.name!==`fov`:e.name!==`zoom`),base:`camera`,values:NC(t.camera)})}),(0,G.jsx)(AC,{scene:t}),(0,G.jsx)(aC,{scene:t}),(0,G.jsx)(FC,{scene:t}),(0,G.jsx)(bC,{scene:t}),(0,G.jsx)(dC,{scene:t}),(0,G.jsx)(LC,{scene:t}),(0,G.jsx)(RC,{scene:t})]})}function FC({scene:e}){let{t}=U(),{edit:n,ui:r}=Q(),i=e.lights??[],a=tv(e=>e.lightSel),o=(0,O.useRef)(new Map);return(0,O.useEffect)(()=>{a&&o.current.get(a.id)?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[a]),(0,G.jsx)(J_,{title:(0,G.jsxs)(`span`,{children:[t(`scene.lights`),` `,(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:i.length})]}),id:`lights`,actions:(0,G.jsx)(pS,{placeholder:t(`scene.lightType`),items:Object.keys(Bg).map(e=>({id:e,label:Cb(e)})),onPick:t=>{let r={id:na(t,b_(e)),type:t,intensity:t===`ambient`||t===`hemisphere`?.6:2,...t===`ambient`||t===`hemisphere`?{}:{position:[3,5,4]}};n([{op:`set`,path:`lights[${i.length}]`,value:r}])},trigger:e=>(0,G.jsx)(Y,{label:t(`scene.addLight`),onClick:e,className:`h-6 w-6`,children:(0,G.jsx)(lr,{size:13})})}),children:(0,G.jsxs)(`div`,{className:`space-y-1.5 px-2`,children:[i.map((e,i)=>{let s=Jx[e.type]??Jx.point,c=e.id?`lights#${e.id}`:`lights[${i}]`,l=e.id??`light${i}`,u=a?.id===l,d=e.type!==`ambient`&&e.type!==`hemisphere`;return(0,G.jsxs)(`div`,{ref:e=>{e?o.current.set(l,e):o.current.delete(l)},className:W(`rounded-md border bg-ink-0/40 pb-1`,u?`border-accent/70`:`border-line`),children:[(0,G.jsxs)(`div`,{className:W(`flex h-7 items-center gap-1.5 pl-2 pr-1`,d&&`cursor-pointer`),onClick:d?()=>r.set({lightSel:u?null:{id:l,part:`position`}}):void 0,children:[(0,G.jsx)(s,{size:12,className:`text-key`}),(0,G.jsx)(`span`,{className:`flex-1 truncate text-xs font-medium`,children:e.id??`${e.type} ${i+1}`}),(0,G.jsx)(`span`,{className:`text-2xs text-fg-faint`,children:e.type}),(0,G.jsx)(Y,{label:t(`scene.removeLight`),className:`h-5 w-5`,onClick:e=>{e.stopPropagation(),n([{op:`remove`,path:`lights[${i}]`}])},children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsx)($,{specs:Bg[e.type]??[],base:c,values:NC(e)}),(0,G.jsx)(IC,{light:e,path:c})]},`${e.id??i}`)}),!i.length&&(0,G.jsx)(`div`,{className:`px-1 text-2xs text-fg-faint`,children:t(`scene.noLights`)})]})})}function IC({light:e,path:t}){let{t:n}=U(),r=Ob(),[i,a]=(0,O.useState)(!!e.shadow),o=e.castShadow&&(e.type===`directional`||e.type===`spot`||e.type===`point`);return(0,G.jsxs)(G.Fragment,{children:[e.type===`spot`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:n(`lights.volumetric`),hint:n(`lights.volumetricHint`),children:(0,G.jsx)(q_,{checked:!!e.volumetric,onChange:e=>r(`${t}.volumetric`,e||void 0),ariaLabel:n(`lights.volumetric`)})}),e.volumetric&&(0,G.jsx)(Ab,{specs:Hg,path:`${t}.volumetric`,value:e.volumetric,collapse:e=>!Object.keys(e).length||e})]}),o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`mx-3 mt-0.5 text-2xs text-fg-faint hover:text-fg`,children:[i?`−`:`+`,` `,n(`lights.shadow`),e.shadow&&(0,G.jsx)(`span`,{className:`ml-1 text-accent`,children:`•`})]}),i&&(0,G.jsx)(Ab,{specs:Vg,path:`${t}.shadow`,value:e.shadow,collapse:e=>Object.keys(e).length?e:void 0})]})]})}function LC({scene:e}){let{t}=U(),n=Ob(),r=e.audio,i=r?.music,a=o.filter(e=>/music|loop|pad/.test(e.description.toLowerCase())||e.id.includes(`loop`)||e.id.includes(`pad`));return(0,G.jsxs)(J_,{title:t(`scene.audio`),id:`audio`,defaultOpen:!!r,children:[(0,G.jsx)(Z,{label:t(`scene.music`),children:(0,G.jsx)(X,{value:i?.preset??``,placeholder:t(`scene.none`),options:a.map(e=>e.id),onChange:e=>n(`audio.music`,e?{preset:e,volume:i?.volume??.5,loop:!0}:void 0),ariaLabel:t(`scene.music`)})}),i&&(0,G.jsx)(Z,{label:t(`scene.volume`),children:(0,G.jsx)(hy,{value:i.volume??1,min:0,max:1,onChange:(e,t)=>n(`audio.music.volume`,e,t),ariaLabel:t(`scene.volume`)})}),(0,G.jsx)(Z,{label:t(`scene.muted`),children:(0,G.jsx)(q_,{checked:r?.muted??!0,onChange:e=>n(`audio.muted`,e),ariaLabel:t(`scene.muted`)})}),r?.sounds&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`scene.sounds`,{list:Object.keys(r.sounds).join(`, `)})})]})}function RC({scene:e}){let{t}=U(),{edit:n}=Q(),r=e.ui?.elements??[];return(0,G.jsxs)(J_,{title:(0,G.jsxs)(`span`,{children:[t(`scene.hud`),` `,r.length>0&&(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:r.length})]}),id:`ui`,defaultOpen:r.length>0,actions:(0,G.jsx)(Y,{label:t(`scene.addHud`),className:`h-6 w-6`,onClick:()=>{let t=na(`label`,b_(e));n(e.ui?[{op:`set`,path:`ui.elements[${r.length}]`,value:{id:t,type:`text`,text:`Hello`,anchor:`top-left`}}]:[{op:`set`,path:`ui`,value:{elements:[{id:t,type:`text`,text:`Hello`,anchor:`top-left`}]}}])},children:(0,G.jsx)(lr,{size:13})}),children:[e.ui&&(0,G.jsx)($,{specs:n_,base:`ui`,values:NC(e.ui)}),(0,G.jsx)(`div`,{className:`space-y-1.5 px-2 pt-1`,children:r.map((e,r)=>(0,G.jsxs)(`div`,{className:`rounded-md border border-line bg-ink-0/40 pb-1`,children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-1 pl-2 pr-1`,children:[(0,G.jsx)(`span`,{className:`flex-1 truncate font-mono text-2xs`,children:e.id}),(0,G.jsx)(Y,{label:t(`scene.removeHud`),className:`h-5 w-5`,onClick:()=>n([{op:`remove`,path:`ui.elements[${r}]`}]),children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsx)($,{specs:r_,base:`ui.elements[${r}]`,values:NC(e)})]},e.id))})]})}function zC(){let e=ev(),t=e.selection&&e.scene?Nc(e.scene.objects,e.selection):null;return(0,G.jsx)(`aside`,{className:`flex w-[300px] shrink-0 flex-col border-l border-line bg-ink-1`,children:(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden`,children:t?(0,G.jsx)(HS,{object:t.object},t.object.id):(0,G.jsx)(PC,{})})})}var BC=class{persist;snap={scene:null,selection:null,issues:[],save:{state:`saved`},canUndo:!1,canRedo:!1,revision:0,source:`load`};listeners=new Set;past=[];future=[];pendingOps=[];needsFull=!1;timer=null;chain=Promise.resolve();lastCoalesce=null;opts;constructor(e,t={}){this.persist=e,this.opts={debounceMs:300,historyLimit:100,coalesceMs:1e3,now:()=>Date.now(),validate:ks,...t}}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snap;emit(e){this.snap={...this.snap,...e,canUndo:this.past.length>0,canRedo:this.future.length>0},this.listeners.forEach(e=>e())}setScene(e,t,n={}){let r=this.snap.selection&&Nc(e.objects,this.snap.selection)?this.snap.selection:null;this.emit({scene:e,source:t,selection:r,issues:this.opts.validate(e),revision:this.snap.revision+1,...n})}pushHistory(e){this.past.push(e),this.past.length>this.opts.historyLimit&&this.past.shift(),this.future=[]}load(e){this.past=[],this.future=[],this.pendingOps=[],this.needsFull=!1,this.lastCoalesce=null,this.setScene(e,`load`,{save:{state:`saved`}})}select(e){e!==this.snap.selection&&this.emit({selection:e})}edit(e,t={}){let n=this.snap.scene;if(!n||!e.length)return null;let r;try{r=Wm(n,e)}catch(e){return e.message}let i=this.opts.now();t.coalesce&&this.lastCoalesce?.key===t.coalesce&&i-this.lastCoalesce.at<this.opts.coalesceMs||this.pushHistory(n),this.lastCoalesce=t.coalesce?{key:t.coalesce,at:i}:null;for(let t of e)this.queue(t);return this.setScene(r,`edit`,{save:{state:`pending`},...t.select===void 0?{}:{selection:t.select}}),this.schedule(),null}queue(e){let t=this.pendingOps[this.pendingOps.length-1];t&&t.op===`set`&&e.op===`set`&&t.path===e.path||t&&t.op===`addTrack`&&e.op===`addTrack`&&t.track.target===e.track.target?this.pendingOps[this.pendingOps.length-1]=e:this.pendingOps.push(e)}replace(e){let t=this.snap.scene;t&&Vf(t,e)||(t&&this.pushHistory(t),this.lastCoalesce=null,this.needsFull=!0,this.pendingOps=[],this.setScene(e,`replace`,{save:{state:`pending`}}),this.schedule(0))}undo(){let e=this.past.pop();e&&this.snap.scene&&(this.future.push(this.snap.scene),this.historyMove(e))}redo(){let e=this.future.pop();e&&this.snap.scene&&(this.past.push(this.snap.scene),this.historyMove(e))}historyMove(e){this.lastCoalesce=null,this.needsFull=!0,this.pendingOps=[],this.setScene(e,`history`,{save:{state:`pending`}}),this.schedule(0)}external(e){let t=this.snap.scene;if(t&&Vf(t,e))return!1;let n=e;if(this.pendingOps.length&&!this.needsFull)try{n=Wm(e,this.pendingOps)}catch{this.pendingOps=[]}else this.pendingOps=[],this.needsFull=!1;return t&&this.pushHistory(t),this.lastCoalesce=null,this.setScene(n,`external`,{save:this.pendingOps.length?this.snap.save:{state:`saved`}}),!0}schedule(e=this.opts.debounceMs){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=null,this.flush()},e)}get dirty(){return this.needsFull||this.pendingOps.length>0}flush(){return this.timer&&=(clearTimeout(this.timer),null),this.chain=this.chain.then(()=>this.sendOnce()),this.chain}async sendOnce(){let e=this.snap.scene;if(!e||!this.dirty)return;let t=this.needsFull?{kind:`apply`,scene:e}:{kind:`patch`,ops:this.pendingOps};this.pendingOps=[],this.needsFull=!1,this.emit({save:{state:`saving`}});try{let e=await this.persist(t);if(e.status===`refused`){this.needsFull=!0;let t=(e.issues??[]).filter(e=>e.severity===`error`);this.emit({save:{state:`error`,message:t[0]?.message??e.hint,issues:t}})}else this.dirty?this.emit({save:{state:`pending`}}):this.emit({save:{state:`saved`}})}catch(e){this.needsFull=!0,this.emit({save:{state:`error`,message:e.message}})}}};function VC(){let e=Xh(`panel`),t=Xh(`dialog`),n=Xh(`device`);return{bottom:e===`timeline`||e===`interactions`||e===`json`||e===`check`?e:null,bottomHeight:248,assistant:Xh(`assistant`)===`1`,device:n===`tablet`||n===`phone`?n:`desktop`,helpers:!0,interact:!1,gizmo:`translate`,space:`world`,snap:!1,view:Xh(`view`)===`camera`?`camera`:`editor`,lightSel:null,dialog:t===`export`||t===`render`||t===`shortcuts`?t:null,flash:null,agentPulse:0,check:null,checkRunning:!1,addTab:Xh(`add`)??`primitives`}}var HC=e=>{let t=e.target;return!!t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable)};function UC({backend:e,onClose:t}){let[n,r]=(0,O.useState)(null),[i,a]=(0,O.useState)(null);return(0,O.useEffect)(()=>{let n=!1,i=new BC(t=>e.call(t.kind===`patch`?`scene_patch`:`scene_apply`,t.kind===`patch`?{ops:t.ops}:{scene:t.scene})),o=new ux,s=Z_(VC()),c=async()=>void 0;(async()=>{try{let[a,l,u]=await Promise.all([e.loadScene(),e.tools().catch(()=>[]),e.library().catch(()=>({assets:[]}))]);if(n)return;i.load(a);let d=Xh(`select`);d&&i.select(d),r({backend:e,store:i,player:o,ui:s,tools:l,library:u,edit(e,t){let n=i.edit(e,t);n&&rg({tone:`error`,title:Yh(`edit.failed`),detail:n})},async runCheck(){s.set({checkRunning:!0,bottom:`check`});try{await i.flush();let t=await e.call(`check`,{});s.set({check:{...t,at:Date.now()}})}catch(e){rg({tone:`error`,title:Yh(`check.failed`),detail:e.message})}finally{s.set({checkRunning:!1})}},reloadScene:e=>c(e),closeProject(){i.flush().then(t)}})}catch(e){n||a(e.message)}})();let l=async(t={})=>{let n=await e.loadScene(),r=i.getSnapshot().scene;if(!i.external(n))return;let a=Rm(r,n),o=[...a.objects.added,...a.objects.changed.map(e=>e.id),...a.objects.moved.map(e=>e.id)];s.set(e=>({flash:{ids:o,at:Date.now()},agentPulse:e.agentPulse+1})),t.toast!==!1&&rg({tone:`agent`,title:Yh(`external.title`),detail:a.summary,action:{label:Yh(`external.undo`),run:()=>i.undo()}},6e3)};c=l;let u=Xh(`events`)===`0`?()=>void 0:e.onChange(e=>{e.includes(`scene.json`)?l().catch(()=>void 0):e.some(e=>e.startsWith(`assets/`)||e.startsWith(`scripts/`))&&(s.set(e=>({agentPulse:e.agentPulse+1})),rg({tone:`agent`,title:Yh(`external.files`),detail:e.slice(0,4).join(`, `)}))}),d=e=>{i.dirty&&(i.flush(),e.preventDefault())};return window.addEventListener(`beforeunload`,d),()=>{n=!0,u(),window.removeEventListener(`beforeunload`,d),i.flush(),o.dispose()}},[e,t]),i?(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-center`,children:[(0,G.jsx)(`div`,{className:`text-base font-medium`,children:Yh(`app.loadFailed`)}),(0,G.jsx)(`div`,{className:`max-w-md text-sm text-fg-muted`,children:i})]}):n?(0,G.jsx)($_.Provider,{value:n,children:(0,G.jsx)(WC,{})}):(0,G.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-fg-muted`,children:[(0,G.jsx)(Nn,{size:16,className:`animate-spin`}),` `,Yh(`app.loadingScene`)]})}function WC(){let e=tv(e=>e.assistant),t=tv(e=>e.dialog);return qC(),(0,G.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,G.jsx)(Qx,{}),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,G.jsx)(Zx,{}),(0,G.jsxs)(`div`,{className:`relative flex min-w-0 flex-1 flex-col`,children:[(0,G.jsx)(uS,{}),(0,G.jsx)(Jb,{}),(0,G.jsx)(og,{})]}),(0,G.jsx)(zC,{}),e&&(0,G.jsx)(xv,{})]}),t===`export`&&(0,G.jsx)(xx,{}),t===`render`&&(0,G.jsx)(Sx,{}),t===`shortcuts`&&(0,G.jsx)(Ex,{})]})}function GC(e){return(0,O.useMemo)(()=>t=>{let n=t.metaKey||t.ctrlKey,{store:r,ui:i,player:a}=e;if(n&&t.key.toLowerCase()===`z`){if(HC(t))return;t.preventDefault(),t.shiftKey?r.redo():r.undo();return}if(n&&t.key.toLowerCase()===`y`){if(HC(t))return;t.preventDefault(),r.redo();return}if(n&&t.key.toLowerCase()===`s`){t.preventDefault(),r.flush();return}if(HC(t))return;let o=r.getSnapshot(),s=o.selection;if(n&&t.key.toLowerCase()===`d`&&s&&o.scene){t.preventDefault();let n=w_(o.scene,s);n&&e.edit(n.ops,{select:n.newId})}else if(!n)switch(t.key){case` `:t.preventDefault(),a.toggle(),i.set({});break;case`Escape`:r.select(null),i.set({lightSel:null});break;case`Delete`:case`Backspace`:{let n=i.get().lightSel;if(s)t.preventDefault(),e.edit([{op:`removeObject`,id:s}]);else if(n&&o.scene){let r=z_(o.scene,n.id);r>=0&&(t.preventDefault(),e.edit([{op:`remove`,path:`lights[${r}]`}]),i.set({lightSel:null}))}break}case`w`:case`e`:case`r`:i.set({gizmo:t.key===`w`?`translate`:t.key===`e`?`rotate`:`scale`,interact:!1});break;case`q`:i.set({interact:!1});break;case`x`:i.set(e=>({space:e.space===`world`?`local`:`world`}));break;case`c`:i.set(e=>({view:e.view===`editor`?`camera`:`editor`,interact:!1}));break;case`g`:i.set(e=>({helpers:!e.helpers}));break;case`f`:i.get().view===`camera`&&i.set({view:`editor`,interact:!1}),a.sceneEditor?.frameSelection();break;case`h`:if(s&&o.scene){let t=o.scene.objects&&KC(o.scene,s);e.edit(t===!1?[{op:`remove`,path:`objects#${s}.visible`}]:[{op:`set`,path:`objects#${s}.visible`,value:!1}])}break;case`t`:i.set(e=>({bottom:e.bottom===`timeline`?null:`timeline`}));break;case`j`:i.set(e=>({bottom:e.bottom===`json`?null:`json`}));break;case`a`:i.set(e=>({assistant:!e.assistant}));break;case`i`:i.set(e=>({interact:!e.interact}));break;case`?`:i.set({dialog:`shortcuts`})}},[e])}function KC(e,t){let n=!0,r=e=>{for(let i of e)i.id===t&&(n=i.visible!==!1),i.children&&r(i.children)};return r(e.objects),n}function qC(){let e=GC(Q());(0,O.useEffect)(()=>(window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)),[e])}var JC={banner:`linear-gradient(120deg,#1d2b64,#7c8cff 60%,#f8cdda)`,hero:`radial-gradient(circle at 30% 40%,#ff7eb3,#7a5cff 45%,#141629 80%)`,card:`linear-gradient(160deg,#2b2e3a,#545a6e 50%,#e9dccb)`,square:`conic-gradient(from 210deg at 50% 50%,#38f9ff,#7c8cff,#ff7eb3,#38f9ff)`,fullscreen:`linear-gradient(180deg,#5aa9e6 0%,#f6d5a8 55%,#4f8a4b 56%,#2d5a2a 100%)`,inline:`linear-gradient(135deg,#232526,#414345)`,game:`linear-gradient(135deg,#0f2027,#2c5364 60%,#f2b654)`},YC=[`banner`,`hero`,`card`,`square`,`fullscreen`,`game`];function XC({src:e,kind:t,aspect:n}){let[r,i]=(0,O.useState)(!e),[a,o]=n.split(`:`).map(Number);return(0,G.jsxs)(`div`,{className:`relative aspect-[16/10] overflow-hidden rounded-md bg-ink-2`,children:[!r&&e?(0,G.jsx)(`img`,{src:e,alt:``,className:`h-full w-full object-cover`,onError:()=>i(!0)}):(0,G.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,style:{background:JC[t]??JC.inline},children:(0,G.jsx)(`div`,{className:`rounded-[3px] border border-white/40 bg-white/10 shadow-lg backdrop-blur-sm`,style:{width:a>=o?`70%`:`${70*a/o/1.6}%`,aspectRatio:`${a} / ${o}`}})}),(0,G.jsxs)(`span`,{className:`absolute bottom-1.5 left-1.5 rounded bg-black/55 px-1.5 py-0.5 text-2xs font-medium text-white/90 backdrop-blur`,children:[t,` · `,n]})]})}function ZC({backend:e,onOpened:t}){let{t:n}=U(),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)([]),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(`all`);(0,O.useEffect)(()=>{e.templates().then(i),e.recent().then(o)},[e]);let p=async(r,i)=>{if(e.mode!==`cli`||!e.hasProject()||window.confirm(n(`start.replaceConfirm`,{dir:e.location??``}))){c(r),u(null);try{await e.createProject({name:i.title,title:i.title,template:i.template,kind:i.kind}),t()}catch(e){u(e.message)}finally{c(null)}}},m=[`all`,...new Set((r??[]).map(e=>e.kind))],h=(r??[]).filter(e=>d===`all`||e.kind===d),g=e.canCreate();return(0,G.jsx)(`div`,{className:`h-full overflow-auto`,children:(0,G.jsxs)(`div`,{className:`mx-auto max-w-[1180px] px-8 py-10`,children:[(0,G.jsxs)(`header`,{className:`mb-10 flex items-end justify-between gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(eS,{size:34}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`text-[22px] font-semibold leading-tight tracking-tight`,children:`Agent3D Studio`}),(0,G.jsx)(`p`,{className:`mt-0.5 max-w-xl text-sm text-fg-muted`,children:n(`start.tagline`)})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.hasProject()&&(0,G.jsxs)(`button`,{type:`button`,onClick:t,className:`flex h-8 items-center gap-1.5 rounded-md bg-accent px-3 text-sm font-medium text-ink-0 hover:bg-accent/90`,children:[(0,G.jsx)(It,{size:14}),` `,n(`start.continue`,{title:e.projectTitle()})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-xs text-fg-muted`,children:[e.mode===`cli`?(0,G.jsx)(en,{size:12}):(0,G.jsx)(nt,{size:12}),e.mode===`cli`?n(`start.cliMode`,{v:e.version??``}):n(`start.localMode`)]})]})]}),!g&&(0,G.jsxs)(`div`,{className:`mb-8 flex gap-3 rounded-lg border border-line bg-ink-1 p-4`,children:[(0,G.jsx)(si,{size:16,className:`mt-0.5 shrink-0 text-accent`}),(0,G.jsxs)(`div`,{className:`text-sm`,children:[(0,G.jsx)(`div`,{className:`font-medium`,children:n(`start.noFolderTitle`)}),(0,G.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:n(`start.noFolderBody`)}),(0,G.jsxs)(`pre`,{className:`mt-2 rounded bg-ink-0 px-2 py-1.5 font-mono text-2xs text-fg`,children:[`agent3d new my-banner --template `,r?.[0]?.id??`<id>`,`
|
|
477
|
+
`).length;return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,G.jsxs)(`div`,{className:`relative flex min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{"aria-hidden":!0,className:`w-10 shrink-0 select-none overflow-hidden border-r border-line bg-ink-0/40 pt-2 text-right font-mono text-2xs leading-[18px] text-fg-faint`,children:Array.from({length:Math.min(p,5e3)},(e,t)=>(0,G.jsx)(`div`,{className:`pr-2`,children:t+1},t))}),(0,G.jsx)(`textarea`,{value:i,spellCheck:!1,wrap:`off`,"aria-label":`scene.json`,onChange:e=>d(e.target.value),onScroll:e=>{let t=e.currentTarget.previousElementSibling;t.scrollTop=e.currentTarget.scrollTop},onKeyDown:e=>{if(e.key===`Tab`){e.preventDefault();let t=e.currentTarget,{selectionStart:n,selectionEnd:r}=t,a=i.slice(0,n)+` `+i.slice(r);d(a),requestAnimationFrame(()=>t.setSelectionRange(n+2,n+2))}},className:`min-w-0 flex-1 resize-none overflow-auto whitespace-pre bg-transparent p-2 font-mono text-xs leading-[18px] text-fg outline-none`})]}),(0,G.jsxs)(`div`,{className:`flex w-[340px] shrink-0 flex-col border-l border-line`,children:[(0,G.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-1.5 border-b border-line px-2`,children:[(0,G.jsx)(`span`,{className:W(`text-xs`,c.error||f?`text-danger`:`text-agent`),children:c.error?e(`json.invalidJson`):f?e(`json.errors`,{n:f}):e(`json.valid`)}),(0,G.jsxs)(`div`,{className:`ml-auto flex gap-1`,children:[(0,G.jsx)(G_,{size:`xs`,variant:`ghost`,disabled:!!c.error,title:e(`json.format`),onClick:()=>c.scene&&d(JSON.stringify(c.scene,null,2)),children:(0,G.jsx)(Di,{size:11})}),(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,disabled:!o,onClick:()=>(s(!1),a(r)),children:[(0,G.jsx)(yr,{size:11}),` `,e(`json.revert`)]}),(0,G.jsxs)(G_,{size:`xs`,variant:`primary`,disabled:!o||!!c.error||f>0,title:f?e(`json.fixFirst`):void 0,onClick:()=>{c.scene&&(t.replace(c.scene),s(!1))},children:[(0,G.jsx)(Pe,{size:11}),` `,e(`json.apply`)]})]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:c.error?(0,G.jsx)(`div`,{className:`p-3 font-mono text-xs text-danger`,children:c.error}):c.issues.length?(0,G.jsx)(vb,{issues:c.issues,dense:!0}):(0,G.jsx)(`div`,{className:`p-3 text-xs text-fg-faint`,children:e(`json.noIssues`)})}),o&&(0,G.jsx)(`div`,{className:`border-t border-line px-3 py-1.5 text-2xs text-key`,children:e(`json.unapplied`)})]})]})}var qb=[{id:`timeline`,label:`bottom.timeline`,icon:jn,key:`T`},{id:`interactions`,label:`bottom.interactions`,icon:Un,key:``},{id:`json`,label:`bottom.json`,icon:Ee,key:`J`},{id:`check`,label:`bottom.check`,icon:Nr,key:``}];function Jb(){let{t:e}=U(),{ui:t}=Q(),n=ev(),r=tv(e=>e.bottom),i=tv(e=>e.bottomHeight),a=tv(e=>e.check),o=(0,O.useRef)(null),s=n.scene?.timeline?.tracks.length??0,c=n.issues.filter(e=>e.severity===`error`).length;return(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-col border-t border-line bg-ink-1`,style:{height:r?i:34},children:[r&&(0,G.jsx)(`div`,{className:`h-1 shrink-0 cursor-ns-resize hover:bg-accent/40`,onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),o.current={y:e.clientY,h:i}},onPointerMove:e=>{o.current&&t.set({bottomHeight:Math.max(140,Math.min(window.innerHeight*.7,o.current.h-(e.clientY-o.current.y)))})},onPointerUp:()=>o.current=null}),(0,G.jsxs)(`div`,{className:`flex h-[33px] shrink-0 items-center gap-0.5 border-b border-line px-1.5`,role:`tablist`,children:[qb.map(i=>{let o=i.icon,l=i.id===`timeline`?s:i.id===`interactions`?n.scene?.interactions?.length??0:i.id===`json`?c:a?(a.counts?.errors??0)+(a.counts?.warnings??0):0;return(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r===i.id,title:i.key?`${e(i.label)} (${i.key})`:e(i.label),onClick:()=>t.set({bottom:r===i.id?null:i.id}),className:W(`flex h-6 items-center gap-1.5 rounded-md px-2 text-xs`,r===i.id?`bg-ink-3 text-fg`:`text-fg-muted hover:text-fg`),children:[(0,G.jsx)(o,{size:12}),e(i.label),l>0&&(0,G.jsx)(`span`,{className:W(`rounded px-1 text-2xs`,i.id===`json`?`bg-danger/20 text-danger`:i.id===`check`?`bg-warn/20 text-warn`:`bg-ink-4 text-fg-muted`),children:l})]},i.id)}),(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(Y,{label:e(r?`bottom.collapse`:`bottom.expand`),onClick:()=>t.set({bottom:r?null:`timeline`}),className:`h-6 w-6`,children:r?(0,G.jsx)(Ie,{size:13}):(0,G.jsx)(He,{size:13})})})]}),r&&(0,G.jsxs)(`div`,{className:`min-h-0 flex-1`,children:[r===`timeline`&&(0,G.jsx)(db,{}),r===`interactions`&&(0,G.jsx)(Vb,{}),r===`json`&&(0,G.jsx)(Kb,{}),r===`check`&&(0,G.jsx)(bb,{})]})]})}function Yb({title:e,onClose:t,children:n,footer:r,width:i=560}){let a=(0,O.useRef)(null);return(0,O.useEffect)(()=>{let e=document.activeElement;a.current?.focus();let n=e=>e.key===`Escape`&&t();return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e?.focus?.()}},[t]),(0,G.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/55 p-4`,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,G.jsxs)(`div`,{ref:a,tabIndex:-1,role:`dialog`,"aria-modal":`true`,className:`toast-in flex max-h-[86vh] w-full flex-col overflow-hidden rounded-xl border border-line bg-ink-1 shadow-2xl shadow-black/50 outline-none focus-visible:outline-none`,style:{maxWidth:i},children:[(0,G.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-line pl-4 pr-2`,children:[(0,G.jsx)(`div`,{className:`text-base font-semibold`,children:e}),(0,G.jsx)(Y,{label:Yh(`ui.close`),onClick:t,children:(0,G.jsx)(Fi,{size:15})})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:n}),r&&(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-line px-4 py-2.5`,children:r})]})})}function Xb(e,t,n=`application/octet-stream`){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),setTimeout(()=>URL.revokeObjectURL(i),2e3)}function Zb(e){let t=e.split(`,`)[1]??``,n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}async function Qb(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}var $b=(e,t,n)=>e<t?t:e>n?n:e;function ex(e,t,n){if(!(t>0))return 0;if(!n)return Math.min(Math.max(e,0),t);if(n===`pingpong`){let n=e%(2*t);return n>t?2*t-n:n}return e%t}function tx(e,t,n){return typeof e==`number`&&Number.isFinite(e)?e:typeof e==`string`&&t&&typeof t[e]==`number`?t[e]:n}function nx(e,t){let n=Math.max(e.duration||0,.001);if(t===`timeline`)return{from:0,to:n,loop:e.loop,speed:1};let r=e.segments?.[t];if(!r)return null;let i=Array.isArray(r)?{from:r[0],to:r[1]}:r;return{from:$b(tx(i.from,e.markers,0),0,n),to:$b(tx(i.to,e.markers,n),0,n),loop:i.loop??!1,speed:typeof i.speed==`number`&&i.speed>0?i.speed:1}}function rx(e,t){let n=Math.abs(e.to-e.from),r=e.to>=e.from?1:-1;return e.from+r*(n<=0?0:ex(Math.max(0,t*e.speed),n,e.loop))}var ix=e=>e&&typeof e.speed==`number`&&e.speed>0?e.speed:1;function ax(e,t,n){let r=t?.timeline;return!r||!(r.duration>0)?e:$b(n?rx(n.range,Math.max(0,e-n.start)):rx({from:0,to:r.duration,loop:r.loop,speed:ix(r)},e),0,r.duration)}function ox(e,t){let n=t?.timeline;return!n||!(n.duration>0)?Math.max(0,e):$b(e,0,n.duration)/ix(n)}function sx(e){let t=e.timeline,n=!t||(t.trigger===void 0||t.trigger===`load`||t.trigger===`visible`)&&t.autoplay===void 0,r=!!e.scripts?.length;if(n&&!r)return e;let i=e;if(!n&&t){let{autoplay:e,...n}=t;i={...i,timeline:{...n,trigger:`load`}}}if(r){let{scripts:e,...t}=i;i=t}return i}var cx=null;function lx(){return cx||=Hl(()=>import(`./runtime-ByR4qfyV.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),cx}var ux=class{player=null;sceneEditor=null;issues=[];playing=!1;latest=null;updating=!1;raf=0;timeListeners=new Set;stateListeners=new Set;scene=null;disposed=!1;interact=!1;segment=null;ready=!1;async mount(e,t,n,r){this.dispose(),this.disposed=!1,this.issues=[],this.ready=!1,this.scene=t,this.segment=null;let i=await lx();if(!this.disposed){this.player=i.mountScene(e,this.view(t),{...n,editor:r.editor,reducedMotion:!1,onError:e=>{this.issues=[...this.issues.slice(-30),e],this.notify()}});try{await this.player.ready}catch{}if(this.ready=!0,this.playing)this.player?.play();else{this.player?.pause();let e=t.target?.posterTime;e&&e>0&&await this.player?.seek(e).catch(()=>void 0)}this.loop(),this.notify()}}loop=()=>{cancelAnimationFrame(this.raf);let e=()=>{if(!this.player)return;let t=this.player.time();t<0&&!this.updating&&this.player.seek(0);let n=ax(Math.max(0,t),this.scene,this.segment);this.timeListeners.forEach(e=>e(n)),this.raf=requestAnimationFrame(e)};this.raf=requestAnimationFrame(e)};view(e){return this.interact?e:sx(e)}setInteract(e){this.interact!==e&&(this.interact=e,this.scene&&this.update(this.scene),e?this.play():this.pause())}update(e){this.segment=null,this.scene=e,this.latest=e,!this.updating&&this.player&&this.drain()}async drain(){for(this.updating=!0;this.latest&&this.player;){let e=this.latest;this.latest=null;let t=this.player.time();try{await this.player.update(this.view(e)),this.playing||await this.player.seek(t)}catch{}}this.updating=!1}play(){this.playing=!0,this.player?.play(),this.notify()}pause(){this.playing=!1,this.player?.pause(),this.notify()}toggle(){this.playing?this.pause():this.play()}async seek(e){this.playing&&this.pause(),this.segment&&(this.segment=null,await this.player?.seek(0));let t=ox(e,this.scene);await this.player?.seek(t),this.timeListeners.forEach(e=>e(ax(t,this.scene)))}playSegment(e,t={}){let n=this.scene?.timeline,r=n?nx(n,e):null;return!r||!this.player?.playSegment?!1:(this.player.playSegment(e,t),this.segment={name:e,range:t.reverse?{...r,from:r.to,to:r.from}:r,start:this.player.time()},this.play(),!0)}stats(){try{return this.player?.stats()??null}catch{return null}}pick(e,t){try{return this.player?.pick?.(e,t)??null}catch{return null}}snapshot(){try{return this.player?.snapshot(`image/png`)??null}catch{return null}}onTime(e){return this.timeListeners.add(e),()=>this.timeListeners.delete(e)}onState(e){return this.stateListeners.add(e),()=>this.stateListeners.delete(e)}notify(){this.stateListeners.forEach(e=>e())}dispose(){this.disposed=!0,cancelAnimationFrame(this.raf),this.sceneEditor?.dispose(),this.sceneEditor=null,this.player?.dispose(),this.player=null}};async function dx(e,t,n,r,i){let a=await lx(),o=document.createElement(`div`);o.style.cssText=`position:fixed;left:-10000px;top:0;width:${r}px;height:${i}px;`,document.body.appendChild(o);let s=a.mountScene(o,e,{...t,deterministic:!0,pixelRatio:1});try{return await s.ready,await s.seek(n),s.snapshot(`image/png`)}finally{s.dispose(),o.remove()}}var fx={mp4:30,webm:30,gif:15,webp:20,poster:0},px={mp4:`mp4`,webm:`webm`,gif:`gif`,webp:`webp`,poster:`webp`};function mx(e=`mp4`){return{kind:e,quality:`standard`,transparent:!1,image:`webp`}}function hx(e,t){let n=e.width&&e.height?`${Math.round(e.width)}x${Math.round(e.height)}`:void 0,r={out:t,...e.quality===`standard`?{}:{quality:e.quality},...n?{size:n}:{}};if(e.kind===`poster`)return{format:`poster`,image:e.image,...e.time===void 0?{}:{time:e.time},...e.transparent?{transparent:!0}:{},...r};let i={...e.fps?{fps:e.fps}:{},...e.duration?{duration:e.duration}:{}};return e.kind===`mp4`||e.kind===`webm`?{format:`video`,codec:e.kind,...i,...r}:{format:e.kind===`gif`?`gif`:`animated-webp`,...i,...e.transparent?{transparent:!0}:{},...r}}function gx({label:e,children:t,hint:n}){return(0,G.jsxs)(`label`,{className:`flex flex-col gap-1`,title:n,children:[(0,G.jsx)(`span`,{className:`text-2xs font-medium text-fg-muted`,children:e}),(0,G.jsx)(`div`,{className:`flex min-w-0 items-center gap-1`,children:t})]})}function _x({value:e,kinds:t,onChange:n}){let{t:r}=U();return(0,G.jsx)(`div`,{className:`flex gap-0.5 rounded-md bg-ink-2 p-0.5`,role:`radiogroup`,children:t.map(t=>(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e===t,onClick:()=>n(t),className:W(`h-7 flex-1 rounded px-2 text-xs font-medium`,e===t?`bg-ink-4 text-fg`:`text-fg-muted hover:text-fg`),children:r(`media.kind.${t}`)},t))})}function vx({value:e,onChange:t,scene:n}){let{t:r}=U(),i=n=>t({...e,...n}),a=e.kind!==`poster`,o=e.kind===`gif`||e.kind===`webp`||e.kind===`poster`,s=n.timeline?.duration&&n.timeline.duration>0?n.timeline.duration:5;return(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2.5 sm:grid-cols-4`,children:[(0,G.jsx)(gx,{label:r(`media.quality`),hint:r(`media.qualityHint`),children:(0,G.jsx)(X,{value:e.quality,options:[`draft`,`standard`,`high`,`ultra`].map(e=>({value:e,label:r(`media.q.${e}`)})),onChange:e=>i({quality:e}),ariaLabel:r(`media.quality`)})}),a?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(gx,{label:r(`media.fps`),children:(0,G.jsx)(hy,{value:e.fps??fx[e.kind],placeholder:e.fps===void 0,integer:!0,min:1,max:60,onChange:t=>i({fps:t===fx[e.kind]?void 0:t}),ariaLabel:r(`media.fps`)})}),(0,G.jsx)(gx,{label:r(`media.duration`),children:(0,G.jsx)(hy,{value:e.duration??s,placeholder:e.duration===void 0,min:.1,max:120,step:.1,suffix:`s`,onChange:e=>i({duration:e===s?void 0:e}),ariaLabel:r(`media.duration`)})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(gx,{label:r(`media.time`),children:(0,G.jsx)(hy,{value:e.time??n.target.posterTime??0,placeholder:e.time===void 0,min:0,step:.05,suffix:`s`,onChange:e=>i({time:e}),ariaLabel:r(`media.time`)})}),(0,G.jsx)(gx,{label:r(`media.image`),children:(0,G.jsx)(X,{value:e.image,options:[`webp`,`png`],onChange:e=>i({image:e}),ariaLabel:r(`media.image`)})})]}),(0,G.jsxs)(gx,{label:r(`media.size`),hint:r(`media.sizeHint`),children:[(0,G.jsx)(hy,{label:`W`,value:e.width??0,placeholder:!e.width,empty:!e.width,integer:!0,min:0,max:4096,onChange:e=>i({width:e||void 0}),ariaLabel:r(`media.width`)}),(0,G.jsx)(hy,{label:`H`,value:e.height??0,placeholder:!e.height,empty:!e.height,integer:!0,min:0,max:4096,onChange:e=>i({height:e||void 0}),ariaLabel:r(`media.height`)})]}),o&&(0,G.jsx)(gx,{label:r(`media.transparent`),hint:r(`media.transparentHint`),children:(0,G.jsx)(q_,{checked:e.transparent,onChange:e=>i({transparent:e}),ariaLabel:r(`media.transparent`)})})]})}var yx=[{id:`embed`,icon:it,title:`export.embed`,body:`export.embedBody`},{id:`zip`,icon:be,title:`export.zip`,body:`export.zipBody`},{id:`single-html`,icon:Et,title:`export.single`,body:`export.singleBody`},{id:`poster`,icon:sn,title:`export.poster`,body:`export.posterBody`},{id:`video`,icon:Ti,title:`export.video`,body:`export.videoBody`},{id:`gif`,icon:Ot,title:`export.gif`,body:`export.gifBody`}];function bx({label:e,hint:t,children:n}){return(0,G.jsxs)(`div`,{className:`grid grid-cols-[120px_1fr] items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-xs text-fg-muted`,title:t,children:e}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[n,t&&(0,G.jsx)(`span`,{className:`truncate text-2xs text-fg-faint`,children:t})]})]})}function xx(){let{t:e}=U(),{ui:t,backend:n,store:r}=Q(),i=ev().scene,a=n.capabilities,[o,s]=(0,O.useState)(a.exportFormats[0]??`poster`),[c,l]=(0,O.useState)(i.id),[u,d]=(0,O.useState)(a.render),[f,p]=(0,O.useState)(a.render),[m,h]=(0,O.useState)(``),[g,_]=(0,O.useState)(!1),[v,y]=(0,O.useState)(!0),[b,x]=(0,O.useState)(!1),[S,C]=(0,O.useState)(mx(`mp4`)),[w,T]=(0,O.useState)(!1),[ee,te]=(0,O.useState)(null),[E,ne]=(0,O.useState)(null),[D,re]=(0,O.useState)(null),[ie,ae]=(0,O.useState)(null),[oe,se]=(0,O.useState)(!1),ce=e=>a.exportFormats.includes(e),le=o===`embed`||o===`zip`,ue=le||o===`single-html`,de=o===`video`||o===`gif`||o===`poster`&&a.render,fe=async()=>{let e=oa(i.target.aspect,1200),t=await dx(i,await n.mountConfig(),i.target.posterTime??0,e.width,e.height),r=`renders/poster.png`;return await n.writeFile(r,Zb(t)),ae({url:t,dataUrl:t,path:r}),r},pe=async()=>{if(!a.render)return fe();let e=(await n.call(`render_preview`,{frames:[i.target.posterTime??0],sheet:!1})).frames[0]?.path;return e&&ae({url:await n.fileUrl(e),path:e}),e},me=async()=>{T(!0),te(null),ne(null),re(null),ae(null);try{if(await r.flush(),o===`poster`&&!a.render)await fe();else if(de){let e=o===`gif`?{...S,kind:`gif`}:o===`poster`?{...S,kind:`poster`}:S.kind===`mp4`||S.kind===`webm`?S:{...S,kind:`mp4`},t=e.kind===`poster`?e.image:e.kind===`gif`?`gif`:e.kind,r=e.kind===`poster`?`dist/poster.${t}`:e.kind===`gif`?`dist/animation.gif`:`dist/video.${t}`,i=await n.call(`export`,hx(e,r));re({url:await n.fileUrl(i.path),out:i})}else{let e=ue&&u?await pe():void 0,t=await n.call(`export`,{format:o,...c?{name:c}:{},...e?{poster:e}:{},...le&&m.trim()?{baseUrl:m.trim()}:{},...le&&g?{cacheBust:!0}:{},...le&&!v?{integrity:!1}:{},...b?{optimize:!0}:{},...le&&f&&a.render?{og:!0}:{}});ne(t)}}catch(e){let t=e;te({message:t.message,issues:t.details?.issues})}finally{T(!1)}},he=async e=>{await Qb(e)&&(se(!0),setTimeout(()=>se(!1),1500))};return(0,G.jsx)(Yb,{title:e(`export.title`),width:700,onClose:()=>t.set({dialog:null}),footer:(0,G.jsxs)(G.Fragment,{children:[n.mode===`local`&&E&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:async()=>Xb(E.entry.split(`/`).pop(),await n.readFile(E.entry),`text/html`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.download`)]}),n.mode===`cli`&&E&&o===`zip`&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:async()=>Xb(E.entry.split(`/`).pop(),await n.readFile(E.entry),`application/zip`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.download`)]}),D&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:async()=>Xb(D.out.path.split(`/`).pop(),await n.readFile(D.out.path),`application/octet-stream`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.download`)]}),ie?.dataUrl&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:()=>Xb(`${i.id}-poster.png`,Zb(ie.dataUrl),`image/png`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.downloadPoster`)]}),(0,G.jsxs)(G_,{variant:`primary`,onClick:()=>void me(),disabled:w||!ce(o),children:[w?(0,G.jsx)(Nn,{size:13,className:`animate-spin`}):(0,G.jsx)(Ci,{size:13}),` `,e(`export.run`)]})]}),children:(0,G.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,G.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,role:`radiogroup`,children:yx.map(t=>{let n=t.icon,r=ce(t.id);return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o===t.id,disabled:!r,onClick:()=>{s(t.id),ne(null),re(null),ae(null),te(null)},className:W(`flex gap-2.5 rounded-lg border p-3 text-left transition-colors`,o===t.id?`border-accent bg-accent/10`:`border-line hover:border-fg-faint`,!r&&`cursor-not-allowed opacity-45`),children:[(0,G.jsx)(n,{size:16,className:W(`shrink-0`,o===t.id?`text-accent`:`text-fg-muted`)}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:e(t.title)}),(0,G.jsx)(`div`,{className:`text-2xs leading-snug text-fg-muted`,children:e(r?t.body:`export.needsCli`)})]})]},t.id)})}),ue&&(0,G.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-line p-3`,children:[(0,G.jsx)(bx,{label:e(`export.name`),children:(0,G.jsx)(K_,{value:c,onCommit:l,ariaLabel:e(`export.name`),className:`max-w-[220px]`})}),le&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bx,{label:e(`export.baseUrl`),hint:e(`export.baseUrlHint`),children:(0,G.jsx)(K_,{value:m,placeholder:`./`,onCommit:h,mono:!0,ariaLabel:e(`export.baseUrl`),className:`max-w-[220px]`})}),(0,G.jsx)(bx,{label:e(`export.cacheBust`),hint:e(`export.cacheBustHint`),children:(0,G.jsx)(q_,{checked:g,onChange:_,ariaLabel:e(`export.cacheBust`)})}),(0,G.jsx)(bx,{label:e(`export.integrity`),hint:e(`export.integrityHint`),children:(0,G.jsx)(q_,{checked:v,onChange:y,ariaLabel:e(`export.integrity`)})})]}),a.render&&(0,G.jsx)(bx,{label:e(`export.optimize`),hint:e(`export.optimizeHint`),children:(0,G.jsx)(q_,{checked:b,onChange:x,ariaLabel:e(`export.optimize`)})}),(0,G.jsx)(bx,{label:e(`export.withPoster`),hint:e(`export.withPosterHint`),children:(0,G.jsx)(q_,{checked:u,onChange:d,ariaLabel:e(`export.withPoster`)})}),le&&a.render&&(0,G.jsx)(bx,{label:e(`export.og`),hint:e(`export.ogHint`),children:(0,G.jsx)(q_,{checked:f,onChange:p,ariaLabel:e(`export.og`)})})]}),de&&(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-line p-3`,children:[o===`video`&&(0,G.jsx)(_x,{value:S.kind===`webm`?`webm`:`mp4`,kinds:[`mp4`,`webm`],onChange:e=>C({...S,kind:e})}),(0,G.jsx)(vx,{value:{...S,kind:o===`gif`?`gif`:o===`poster`?`poster`:S.kind===`webm`?`webm`:`mp4`},onChange:e=>C({...e,kind:o===`video`?e.kind:S.kind}),scene:i})]}),n.mode===`local`&&(0,G.jsx)(`p`,{className:`text-2xs text-fg-faint`,children:e(`export.localNote`)}),ee&&(0,G.jsxs)(`div`,{className:`rounded-md bg-danger/10 text-xs text-danger`,children:[(0,G.jsx)(`div`,{className:`px-3 py-2`,children:ee.message}),ee.issues&&(0,G.jsx)(vb,{issues:ee.issues,dense:!0})]}),ie&&!E&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`img`,{src:ie.url,alt:e(`export.poster`),className:`block w-full rounded-md border border-line`}),ie.path&&(0,G.jsx)(`div`,{className:`mt-1 font-mono text-2xs text-fg-faint`,children:ie.path})]}),D&&(0,G.jsxs)(`div`,{className:`space-y-1`,children:[D.out.format===`video`?(0,G.jsx)(`video`,{src:D.url,controls:!0,autoPlay:!0,loop:!0,muted:!0,className:`block w-full rounded-md border border-line`}):(0,G.jsx)(`img`,{src:D.url,alt:D.out.path,className:`block w-full rounded-md border border-line`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(Pe,{size:13,className:`text-agent`}),(0,G.jsx)(`span`,{className:`font-mono text-2xs text-fg`,children:n.location&&n.mode===`cli`?`${n.location}/${D.out.path}`:D.out.path}),(0,G.jsxs)(`span`,{className:`text-2xs text-fg-faint`,children:[D.out.size.width,`×`,D.out.size.height,` · `,D.out.kb,` KB`]})]})]}),E&&(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(Pe,{size:13,className:`text-agent`}),(0,G.jsx)(`span`,{children:e(`export.done`,{files:E.files,kb:Math.round(E.totalKb)})}),E.optimized&&(0,G.jsx)(`span`,{className:`text-2xs text-fg-faint`,children:e(`export.optimized`,{before:E.optimized.beforeKb,after:E.optimized.afterKb})}),E.ogImage&&(0,G.jsx)(`span`,{className:`rounded bg-ink-3 px-1.5 text-2xs text-fg-muted`,children:`og-image.png`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-[100px_1fr] gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted`,children:e(`export.output`)}),(0,G.jsx)(`span`,{className:`break-all font-mono text-fg`,children:n.location&&n.mode===`cli`?`${n.location}/${E.entry}`:E.entry})]}),o!==`zip`&&(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap break-all rounded-md border border-line bg-ink-0 p-3 pr-20 font-mono text-2xs leading-relaxed text-fg`,children:E.snippet}),(0,G.jsxs)(G_,{size:`xs`,variant:`subtle`,className:`absolute right-2 top-2`,onClick:()=>void he(E.snippet),children:[oe?(0,G.jsx)(Pe,{size:11}):(0,G.jsx)(Xe,{size:11}),` `,e(oe?`export.copied`:`export.copy`)]})]}),E.hint&&(0,G.jsx)(`div`,{className:`text-2xs text-warn`,children:E.hint}),!!E.credits?.length&&(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:E.credits.map(e=>e.attribution??`${e.path} (${e.license})`).join(` · `)}),!!E.issues?.length&&(0,G.jsx)(`div`,{className:`rounded-md border border-line`,children:(0,G.jsx)(vb,{issues:E.issues,dense:!0})})]})]})})}function Sx(){let{t:e}=U(),{ui:t,backend:n,store:r,player:i}=Q(),a=ev().scene,[o,s]=(0,O.useState)(`frames`),[c,l]=(0,O.useState)(4),[u,d]=(0,O.useState)(mx(`mp4`)),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(null),[g,_]=(0,O.useState)(null),[v,y]=(0,O.useState)(null),b=n.capabilities.render,x=async()=>{p(!0),h(null);try{if(o===`media`){await r.flush();let e=new Date().toISOString().replace(/[-:]/g,``).replace(/\..+/,``).replace(`T`,`-`),t=await n.call(`export`,hx(u,`renders/${a.id}-${e}.${px[u.kind]}`));y({url:await n.fileUrl(t.path),out:t})}else if(b){await r.flush();let e=await n.call(`render_preview`,{count:c,sheet:!0}),t=e.sheet??e.frames[0]?.path;_({img:t?await n.fileUrl(t):``,out:e,path:t})}else{let e=oa(a.target.aspect,1200),t=await dx(a,await n.mountConfig(),i.player?.time()??0,e.width,e.height);_({img:t})}}catch(e){h(e.message)}finally{p(!1)}};return(0,G.jsx)(Yb,{title:e(`render.title`),width:880,onClose:()=>t.set({dialog:null}),footer:(0,G.jsxs)(G.Fragment,{children:[o===`frames`&&b&&(0,G.jsxs)(`label`,{className:`mr-auto flex items-center gap-2 text-xs text-fg-muted`,children:[e(`render.frames`),(0,G.jsx)(`select`,{value:c,onChange:e=>l(Number(e.target.value)),className:`field w-16`,children:[1,2,4,6,8,12].map(e=>(0,G.jsx)(`option`,{children:e},e))})]}),o===`media`&&v&&(0,G.jsxs)(G_,{variant:`ghost`,className:`mr-auto`,onClick:async()=>Xb(v.out.path.split(`/`).pop(),await n.readFile(v.out.path),v.out.format===`video`?`video/${v.out.path.endsWith(`.mp4`)?`mp4`:`webm`}`:`image/${v.out.path.split(`.`).pop()}`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`export.download`)]}),g&&!b&&o===`frames`&&(0,G.jsxs)(G_,{variant:`ghost`,onClick:()=>Xb(`${a.id}.png`,Zb(g.img),`image/png`),children:[(0,G.jsx)(gt,{size:13}),` `,e(`render.download`)]}),(0,G.jsxs)(G_,{variant:`primary`,onClick:()=>void x(),disabled:f||o===`media`&&!b,children:[f?(0,G.jsx)(Nn,{size:13,className:`animate-spin`}):o===`media`?(0,G.jsx)(Ot,{size:13}):(0,G.jsx)(Ae,{size:13}),` `,f?e(`render.rendering`):o===`media`?e(`render.renderMedia`,{kind:e(`media.kind.${u.kind}`)}):e(g?`render.again`:`render.run`)]})]}),children:(0,G.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,G.jsx)(`div`,{className:`flex gap-1 border-b border-line`,role:`tablist`,children:[{id:`frames`,icon:ln,label:e(`render.tabFrames`)},{id:`media`,icon:Ot,label:e(`render.tabMedia`)}].map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":o===e.id,onClick:()=>s(e.id),className:W(`-mb-px flex items-center gap-1.5 border-b-2 px-3 pb-2 text-sm`,o===e.id?`border-accent text-fg`:`border-transparent text-fg-muted hover:text-fg`),children:[(0,G.jsx)(e.icon,{size:13}),` `,e.label]},e.id))}),m&&(0,G.jsx)(`div`,{className:`rounded-md bg-danger/10 px-3 py-2 text-xs text-danger`,children:m}),o===`frames`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e(b?`render.intro`:`render.localIntro`)}),g?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-line bg-black`,children:g.img&&(0,G.jsx)(`img`,{src:g.img,alt:e(`render.sheetAlt`),className:`block w-full`})}),g.path&&(0,G.jsx)(`div`,{className:`font-mono text-2xs text-fg-faint`,children:g.path}),g.out?.stats&&(0,G.jsx)(`div`,{className:`text-xs text-fg-muted`,children:e(`render.stats`,{tris:g.out.stats.triangles.toLocaleString(),calls:g.out.stats.drawCalls})}),!!g.out?.issues?.length&&(0,G.jsx)(`div`,{className:`rounded-md border border-line`,children:(0,G.jsx)(vb,{issues:g.out.issues,dense:!0})}),!!g.out?.consoleErrors?.length&&(0,G.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-md bg-ink-0 p-2 text-2xs text-danger`,children:g.out.consoleErrors.join(`
|
|
478
|
+
`)})]}):(0,G.jsx)(`div`,{className:`flex aspect-[3/1] items-center justify-center rounded-lg border border-dashed border-line text-xs text-fg-faint`,children:e(f?`render.rendering`:`render.placeholder`)})]}),o===`media`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e(b?`render.mediaIntro`:`render.mediaNeedsCli`)}),(0,G.jsx)(_x,{value:u.kind,kinds:[`mp4`,`webm`,`gif`,`webp`],onChange:e=>d({...u,kind:e,fps:void 0,transparent:e===`gif`||e===`webp`?u.transparent:!1})}),(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:e(`media.about.${u.kind}`)}),(0,G.jsx)(vx,{value:u,onChange:d,scene:a}),v?(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-line`,style:{background:`repeating-conic-gradient(#2a2e38 0 25%, #1f222a 0 50%) 0 0 / 16px 16px`},children:v.out.format===`video`?(0,G.jsx)(`video`,{src:v.url,controls:!0,autoPlay:!0,loop:!0,muted:!0,className:`block w-full`}):(0,G.jsx)(`img`,{src:v.url,alt:v.out.path,className:`block w-full`})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 font-mono text-2xs text-fg-faint`,children:[(0,G.jsx)(`span`,{children:v.out.path}),(0,G.jsxs)(`span`,{children:[v.out.size.width,`×`,v.out.size.height]}),v.out.frames!==void 0&&(0,G.jsxs)(`span`,{children:[v.out.frames,` `,e(`render.framesUnit`),` @ `,v.out.fps,` fps · `,v.out.duration,`s`]}),v.out.codec&&(0,G.jsx)(`span`,{children:v.out.codec}),(0,G.jsxs)(`span`,{children:[v.out.kb,` KB`]})]})]}):(0,G.jsx)(`div`,{className:`flex aspect-[3/1] items-center justify-center rounded-lg border border-dashed border-line text-xs text-fg-faint`,children:e(f?`render.renderingMedia`:`render.mediaPlaceholder`)})]})]})})}var Cx=typeof navigator<`u`&&/Mac/.test(navigator.platform)?`⌘`:`Ctrl`,wx=[[[`Q`],`keys.selectTool`],[[`W`],`keys.move`],[[`E`],`keys.rotate`],[[`R`],`keys.scale`],[[`X`],`keys.space`],[[`Shift`,`drag`],`keys.snapHold`],[[`F`],`keys.frame`],[[`C`],`keys.cameraView`],[[`G`],`keys.grid`],[[`drag`,`right-drag`],`keys.orbit`],[[`wheel`],`keys.zoom`]],Tx=[[[Cx,`Z`],`keys.undo`],[[Cx,`⇧`,`Z`],`keys.redo`],[[Cx,`S`],`keys.save`],[[Cx,`D`],`keys.duplicate`],[[`Del`],`keys.delete`],[[`H`],`keys.hide`],[[`Esc`],`keys.deselect`],[[`Space`],`keys.play`],[[`T`],`keys.timeline`],[[`J`],`keys.json`],[[`I`],`keys.interact`],[[`A`],`keys.assistant`],[[`Shift`,`drag`],`keys.dragFast`],[[`Alt`,`drag`],`keys.dragFine`]];function Ex(){let{t:e}=U(),{ui:t}=Q();return(0,G.jsx)(Yb,{title:e(`keys.title`),width:680,onClose:()=>t.set({dialog:null}),children:(0,G.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-6 px-4 py-2 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`pb-1 pt-1.5 text-2xs font-semibold uppercase tracking-wide text-fg-faint`,children:e(`keys.general`)}),(0,G.jsx)(Dx,{rows:Tx})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`pb-1 pt-1.5 text-2xs font-semibold uppercase tracking-wide text-fg-faint`,children:e(`viewport.tools`)}),(0,G.jsx)(Dx,{rows:wx})]})]})})}function Dx({rows:e}){let{t}=U();return(0,G.jsx)(`div`,{className:`divide-y divide-line`,children:e.map(([e,n])=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted`,children:t(n)}),(0,G.jsx)(`span`,{className:`flex shrink-0 gap-1`,children:e.map(e=>(0,G.jsx)(Y_,{children:e},e))})]},n))})}var Ox=`application/x-agent3d-add`;function kx(e,t){e.dataTransfer&&(e.dataTransfer.setData(Ox,JSON.stringify(t)),e.dataTransfer.effectAllowed=`copy`)}function Ax(e){return!!e.dataTransfer&&Array.from(e.dataTransfer.types).includes(`application/x-agent3d-add`)}function jx(e){try{let t=e.dataTransfer?.getData(Ox);if(!t)return null;let n=JSON.parse(t);return n&&typeof n==`object`&&(`object`in n||`light`in n)?n:null}catch{return null}}function Mx(e,t){let n=e=>Math.round(e*100)/100||0,[r,i,a]=t;return e.type===`ambient`||e.type===`hemisphere`?e:e.type===`point`?{...e,position:[n(r),n(i+1.5),n(a)]}:{...e,position:[n(r+2),n(i+4),n(a+3)],target:[n(r),n(i),n(a)]}}var Nx=null;function Px(){let{backend:e}=Q(),[t,n]=(0,O.useState)(null);return(0,O.useEffect)(()=>{let t=!0;return Nx||=e.mountConfig().then(e=>(e.libraryBase??`./library/`).replace(/\/?$/,`/`)),Nx.then(e=>t&&n(e)).catch(()=>void 0),()=>{t=!1}},[e]),t}function Fx(e,t){return e+t.replace(/^library:/,``).split(`/`).map(encodeURIComponent).join(`/`)}var Ix=`__path__`;function Lx(e=!0){let{backend:t}=Q(),[n,r]=(0,O.useState)(void 0),i=(0,O.useCallback)(()=>{t.call(`assets_list`,{}).then(e=>r(e.assets??[])).catch(()=>r([]))},[t]);return(0,O.useEffect)(()=>{e&&i()},[i,e]),{assets:n,reload:i}}function Rx({label:e,hint:t,value:n,onChange:r,projectAssets:i,onOpen:a,library:o=!0,ariaLabel:s}){let{t:c}=U(),{library:l,backend:u}=Q(),d=Px(),[f,p]=(0,O.useState)(!1),m=(0,O.useMemo)(()=>u_(i,l,n,{library:o}),[i,l,n,o]),[h,g]=(0,O.useState)(null);(0,O.useEffect)(()=>{let e=!0;if(g(null),n)return n.startsWith(`library:`)?g(d?Fx(d,n):null):u.fileUrl(n).then(t=>e&&g(t)).catch(()=>void 0),()=>{e=!1}},[n,d,u]);let _=e=>m.filter(t=>t.group===e);return(0,G.jsxs)(Z,{label:e,hint:t,overridden:n!==void 0,onReset:()=>r(void 0),children:[h&&(0,G.jsx)(`img`,{src:h,alt:``,className:`h-6 w-6 shrink-0 rounded object-cover`,onError:()=>g(null)}),f?(0,G.jsx)(K_,{value:n??``,placeholder:c(`photo.pathPlaceholder`),mono:!0,onCommit:e=>{p(!1),r(e.trim()||void 0)},ariaLabel:s}):(0,G.jsxs)(`select`,{"aria-label":s,value:n??``,onFocus:a,onChange:e=>{e.target.value===Ix?p(!0):r(e.target.value||void 0)},className:`field min-w-0 flex-1`,children:[(0,G.jsx)(`option`,{value:``,children:c(`photo.none`)}),_(`current`).map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value)),_(`project`).length>0&&(0,G.jsx)(`optgroup`,{label:c(`photo.projectImages`),children:_(`project`).map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))}),_(`library`).length>0&&(0,G.jsx)(`optgroup`,{label:c(`photo.libraryImages`),children:_(`library`).map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,G.jsx)(`option`,{value:Ix,children:c(`photo.typePath`)})]})]})}var zx={box:we,roundedBox:qr,sphere:Je,cylinder:ut,cone:ot,capsule:ar,torus:mt,torusKnot:dn,plane:Yr,circle:Je,ring:We,icosahedron:Ht,dodecahedron:an,octahedron:ft,tetrahedron:_i,lathe:ji,extrude:Zr,tube:Ur},Bx={terrain:zn,trees:pi,rocks:jr,grass:di,flowers:zr,water:vt,clouds:nt,city:Oe,character:rr,planet:Wt,starfield:Vr,blob:Je,waveGrid:ve,maze:Jt,road:xr},Vx={stars:Vr,snow:Lr,rain:Qe,fireflies:zr,confetti:Yn,sparks:Mt,dust:ki,bubbles:Je,embers:Mt,hearts:nn},Hx=[{type:`directional`,icon:ti,def:{type:`directional`,color:`#ffffff`,intensity:2,position:[4,6,5]}},{type:`point`,icon:Tn,def:{type:`point`,color:`#ffd9a8`,intensity:8,position:[0,2,2],distance:12}},{type:`spot`,icon:yn,def:{type:`spot`,color:`#ffffff`,intensity:20,position:[0,5,3],target:[0,0,0],angle:30,penumbra:.4}},{type:`hemisphere`,icon:et,def:{type:`hemisphere`,skyColor:`#dfe9ff`,groundColor:`#3a3f4a`,intensity:.8}},{type:`ambient`,icon:$r,def:{type:`ambient`,color:`#ffffff`,intensity:.3}},{type:`rect`,icon:Yr,def:{type:`rect`,color:`#ffffff`,intensity:4,position:[0,3,3],target:[0,0,0],width:3,height:1.5}}],Ux=[{id:`primitives`,icon:we,label:`add.primitives`},{id:`text`,icon:yi,label:`add.text`},{id:`generators`,icon:zn,label:`add.generators`},{id:`particles`,icon:Vr,label:`add.particles`},{id:`library`,icon:Cn,label:`add.library`},{id:`photo`,icon:sn,label:`add.photo`},{id:`lights`,icon:Tn,label:`add.lights`}];function Wx(){let{t:e}=U(),{ui:t,edit:r,library:i}=Q(),a=ev(),o=a.scene,s=tv(e=>e.addTab),[l,u]=(0,O.useState)(`Hello`),[d,f]=(0,O.useState)(``),[p,h]=(0,O.useState)(null),g=e=>{let t=a.selection?Nc(o.objects,a.selection):null,n=t?.object.kind===`group`?t.object.id:void 0,i=C_(o,e);r([{op:`addObject`,object:i,...n?{parent:n}:{}}],{select:i.id})},v=e=>{let t=na(e.type,b_(o));r([{op:`set`,path:`lights[${(o.lights??[]).length}]`,value:{id:t,...e}}],{select:null})},y=Lx(s===`photo`),[b,x]=(0,O.useState)(``),S=d_(a.selection?Nc(o.objects,a.selection)?.object:null),C=(0,O.useMemo)(()=>u_(y.assets,void 0,void 0,{library:!1}),[y.assets]),w=(0,O.useMemo)(()=>i.assets.filter(e=>e.kind===`model`),[i]),T=(0,O.useMemo)(()=>{let e=new Map;for(let t of w)for(let n of t.tags)e.set(n,(e.get(n)??0)+1);return[...e.entries()].sort((e,t)=>t[1]-e[1]).slice(0,14).map(([e])=>e)},[w]),ee=(0,O.useMemo)(()=>{let e=d.toLowerCase().split(/\s+/).filter(Boolean);return w.filter(t=>(!p||t.tags.includes(p))&&e.every(e=>t.id.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))))},[w,d,p]),te;switch(s){case`primitives`:te=(0,G.jsx)(Gx,{children:n.map(e=>(0,G.jsx)(Kx,{icon:zx[e.id]??we,label:Cb(e.id),hint:e.description,drag:{object:{kind:`mesh`,geometry:e.id}},onClick:()=>g({kind:`mesh`,geometry:e.id})},e.id))});break;case`text`:te=(0,G.jsxs)(`div`,{className:`space-y-2 p-2.5`,children:[(0,G.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),className:`field h-7`,"aria-label":e(`add.textValue`),placeholder:e(`add.textValue`)}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:m.map(e=>(0,G.jsxs)(`button`,{type:`button`,title:e.description,draggable:!0,onDragStart:t=>kx(t,{object:{kind:`text`,text:l||`Text`,font:e.id}}),onClick:()=>g({kind:`text`,text:l||`Text`,font:e.id}),className:`flex h-12 flex-col items-start justify-center rounded-md bg-ink-2 px-2 text-left hover:bg-ink-3`,children:[(0,G.jsx)(`span`,{className:W(`text-base leading-none`,e.id.includes(`serif`)&&`font-serif`,e.id===`mono`&&`font-mono`,e.id.includes(`bold`)&&`font-bold`,e.id===`display`&&`font-black tracking-tight`),children:`Aa`}),(0,G.jsx)(`span`,{className:`mt-1 text-2xs text-fg-faint`,children:e.id})]},e.id))})]});break;case`generators`:te=(0,G.jsx)(Gx,{children:c.map(e=>(0,G.jsx)(Kx,{icon:Bx[e.id]??Me,label:Cb(e.id),hint:e.description,drag:{object:{kind:`generator`,generator:e.id}},onClick:()=>g({kind:`generator`,generator:e.id})},e.id))});break;case`particles`:te=(0,G.jsx)(Gx,{children:_.map(e=>(0,G.jsx)(Kx,{icon:Vx[e.id]??Vr,label:Cb(e.id),hint:e.description,drag:{object:{kind:`particles`,preset:e.id}},onClick:()=>g({kind:`particles`,preset:e.id})},e.id))});break;case`library`:te=(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5 border-b border-line p-2`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(Tr,{size:12,className:`absolute left-2 top-1/2 -translate-y-1/2 text-fg-faint`}),(0,G.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:e(`add.searchModels`,{n:w.length}),className:`field h-7 pl-6`,"aria-label":e(`add.searchModels`,{n:w.length})})]}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:T.map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>h(p===e?null:e),className:W(`rounded px-1.5 py-0.5 text-2xs`,p===e?`bg-accent/20 text-accent`:`bg-ink-2 text-fg-muted hover:text-fg`),children:e},e))})]}),(0,G.jsxs)(`div`,{className:`py-1`,children:[ee.slice(0,120).map(e=>(0,G.jsxs)(`button`,{type:`button`,title:`${e.description}\n${e.license}${e.author?` · ${e.author}`:``}`,draggable:!0,onDragStart:t=>kx(t,{object:{kind:`model`,src:`library:${e.id}`,name:e.id.split(`/`).pop()}}),onClick:()=>g({kind:`model`,src:`library:${e.id}`,name:e.id.split(`/`).pop()}),className:`flex w-full items-center gap-2 px-2.5 py-1 text-left hover:bg-ink-2`,children:[(0,G.jsx)(we,{size:12,className:`shrink-0 text-fg-faint`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e.id.split(`/`).pop()}),(0,G.jsx)(`span`,{className:`shrink-0 text-2xs text-fg-faint`,children:e.id.split(`/`)[0]})]},e.id)),!ee.length&&(0,G.jsx)(`div`,{className:`px-3 py-3 text-xs text-fg-faint`,children:w.length?e(`add.noMatch`):e(`add.noLibrary`)})]})]});break;case`photo`:te=(0,G.jsxs)(`div`,{className:`space-y-1 py-1.5`,children:[(0,G.jsx)(`div`,{className:`px-2.5 pb-1 text-2xs leading-snug text-fg-faint`,children:e(`add.photoHint`)}),S&&(0,G.jsxs)(`button`,{type:`button`,title:S,onClick:()=>g({kind:`photo`,src:S}),className:`flex w-full items-center gap-2 px-2.5 py-1 text-left hover:bg-ink-2`,children:[(0,G.jsx)(sn,{size:12,className:`shrink-0 text-accent`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e(`add.photoSelected`)}),(0,G.jsx)(`span`,{className:`shrink-0 truncate text-2xs text-fg-faint`,children:S.split(`/`).pop()})]}),C.map(e=>(0,G.jsxs)(`button`,{type:`button`,title:e.value,draggable:!0,onDragStart:t=>kx(t,{object:{kind:`photo`,src:e.value}}),onClick:()=>g({kind:`photo`,src:e.value}),className:`flex w-full items-center gap-2 px-2.5 py-1 text-left hover:bg-ink-2`,children:[(0,G.jsx)(sn,{size:12,className:`shrink-0 text-fg-faint`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e.label})]},e.value)),y.assets&&!C.length&&(0,G.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-faint`,children:e(`add.photoNone`)}),(0,G.jsxs)(`form`,{className:`flex gap-1 px-2.5 pt-1`,onSubmit:e=>{e.preventDefault();let t=b.trim();t&&(g({kind:`photo`,src:t}),x(``))},children:[(0,G.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),className:`field h-7 font-mono`,"aria-label":e(`photo.typePath`),placeholder:e(`photo.pathPlaceholder`)}),(0,G.jsx)(`button`,{type:`submit`,disabled:!b.trim(),title:e(`add.photoAdd`),"aria-label":e(`add.photoAdd`),className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-ink-3 text-fg hover:bg-ink-4 disabled:opacity-40`,children:(0,G.jsx)(lr,{size:13})})]})]});break;default:te=(0,G.jsx)(Gx,{children:Hx.map(t=>(0,G.jsx)(Kx,{icon:t.icon,label:Cb(t.type),hint:e(`add.lightHint`),drag:{light:t.def},onClick:()=>v(t.def)},t.type))})}return(0,G.jsxs)(`div`,{className:`flex h-[44%] min-h-[220px] shrink-0 flex-col border-t border-line`,children:[(0,G.jsx)(`div`,{className:`flex h-9 shrink-0 items-center gap-0.5 border-b border-line px-1.5`,role:`tablist`,children:Ux.map(n=>{let r=n.icon,i=s===n.id;return(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":i,title:e(n.label),onClick:()=>t.set({addTab:n.id}),className:W(`flex h-7 items-center gap-1 rounded-md px-1.5 text-xs`,i?`bg-ink-3 text-fg`:`text-fg-faint hover:text-fg`),children:[(0,G.jsx)(r,{size:13,strokeWidth:1.75}),i&&(0,G.jsx)(`span`,{className:`font-medium`,children:e(n.label)})]},n.id)})}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:te})]})}function Gx({children:e}){return(0,G.jsx)(`div`,{className:`grid grid-cols-3 gap-1 p-1.5`,children:e})}function Kx({icon:e,label:t,hint:n,onClick:r,drag:i}){return(0,G.jsxs)(`button`,{type:`button`,title:n,onClick:r,draggable:!!i,onDragStart:i?e=>kx(e,i):void 0,className:`flex h-[60px] flex-col items-center justify-center gap-1.5 rounded-md text-fg-muted transition-colors hover:bg-ink-3 hover:text-fg active:bg-ink-4`,children:[(0,G.jsx)(e,{size:18,strokeWidth:1.5}),(0,G.jsx)(`span`,{className:`w-full truncate px-1 text-center text-2xs`,children:t})]})}var qx={mesh:we,text:yi,model:qn,group:Bt,generator:zn,particles:Vr,instances:xn,svg:$n,photo:sn},Jx={ambient:$r,directional:ti,point:Tn,spot:yn,hemisphere:et,rect:Yr};function Yx({kind:e,size:t=13,className:n}){let r=qx[e]??we;return(0,G.jsx)(r,{size:t,className:n,strokeWidth:1.75})}function Xx(){let{t:e}=U(),{store:t,edit:n}=Q(),r=ev(),i=r.scene,a=tv(e=>e.flash),[o,s]=(0,O.useState)(new Set),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(null),f=r.selection,p=(0,O.useMemo)(()=>{let e=new Map;for(let t of r.issues){let n=/objects#([\w-]+)/.exec(t.path)?.[1];n&&t.severity!==`info`&&e.get(n)!==`error`&&e.set(n,t.severity)}return e},[r.issues]),m=[],h=(e,t)=>{for(let n of e)m.push({o:n,depth:t}),n.children?.length&&!o.has(n.id)&&h(n.children,t+1)};return h(i.objects??[],0),(0,G.jsxs)(`div`,{className:`flex min-h-[140px] flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between border-b border-line pl-3 pr-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-semibold`,children:e(`outliner.title`)}),(0,G.jsxs)(`div`,{className:`flex`,children:[(0,G.jsx)(Y,{label:e(`outliner.addGroup`),onClick:()=>{let e=C_(i,{kind:`group`});n([{op:`addObject`,object:e}],{select:e.id})},children:(0,G.jsx)(Rt,{size:14})}),(0,G.jsx)(Y,{label:e(`outliner.duplicate`),shortcut:`⌘D`,disabled:!f,onClick:()=>{if(!f)return;let e=w_(i,f);e&&n(e.ops,{select:e.newId})},children:(0,G.jsx)(ct,{size:13})}),(0,G.jsx)(Y,{label:e(`outliner.delete`),shortcut:`Del`,disabled:!f,onClick:()=>f&&n([{op:`removeObject`,id:f}]),children:(0,G.jsx)(li,{size:13})})]})]}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto py-1`,role:`tree`,"aria-label":e(`outliner.title`),children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t.select(null),className:W(`flex h-7 w-full items-center gap-2 px-3 text-left text-sm`,f===null?`bg-accent/15 text-fg`:`text-fg-muted hover:bg-ink-2`),children:[(0,G.jsx)(bt,{size:13,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:`flex-1 truncate`,children:e(`outliner.scene`)}),(0,G.jsx)(`span`,{className:`flex gap-0.5 text-fg-faint`,children:(i.lights??[]).slice(0,4).map((e,t)=>{let n=Jx[e.type]??Jx.point;return(0,G.jsx)(n,{size:11,"aria-label":e.type},t)})})]}),m.map(({o:r,depth:m})=>{let h=!!r.children?.length,g=r.id===f,_=r.visible===!1,v=p.get(r.id),y=u?.id===r.id?u.where:null;return(0,G.jsxs)(`div`,{role:`treeitem`,"aria-selected":g,"aria-expanded":h?!o.has(r.id):void 0,draggable:!0,onDragStart:e=>{l(r.id),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,r.id)},onDragEnd:()=>{l(null),d(null)},onDragOver:e=>{if(!c||c===r.id)return;e.preventDefault();let t=e.currentTarget.getBoundingClientRect(),n=(e.clientY-t.top)/t.height;d({id:r.id,where:n<.28?`before`:n>.72?`after`:`inside`})},onDragLeave:()=>d(e=>e?.id===r.id?null:e),onDrop:e=>{if(e.preventDefault(),c&&u){let e=T_(i,c,u.id,u.where);e.length&&n(e),u.where===`inside`&&s(e=>new Set([...e].filter(e=>e!==u.id)))}l(null),d(null)},onClick:()=>t.select(r.id),className:W(`group relative flex h-7 cursor-default items-center gap-1.5 pr-1 text-sm`,a?.ids.includes(r.id)&&`row-flash`,g?`bg-accent/15 text-fg`:`text-fg-muted hover:bg-ink-2 hover:text-fg`,c===r.id&&`opacity-40`,y===`inside`&&`ring-1 ring-inset ring-accent`),style:{paddingLeft:8+m*14},children:[y===`before`&&(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-x-2 top-0 h-0.5 rounded bg-accent`}),y===`after`&&(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-x-2 bottom-0 h-0.5 rounded bg-accent`}),(0,G.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":o.has(r.id)?e(`outliner.expand`):e(`outliner.collapse`),onClick:e=>{e.stopPropagation(),s(e=>{let t=new Set(e);return t.has(r.id)?t.delete(r.id):t.add(r.id),t})},className:W(`flex h-4 w-4 items-center justify-center text-fg-faint`,!h&&`invisible`),children:o.has(r.id)?(0,G.jsx)(Be,{size:11}):(0,G.jsx)(Ie,{size:11})}),(0,G.jsx)(Yx,{kind:r.kind,className:g?`text-accent`:`text-fg-faint`}),(0,G.jsx)(`span`,{className:W(`truncate`,_&&`opacity-50`),children:r.name||r.id}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-2xs text-fg-faint`,children:r.kind===`group`?``:Ic(r).replace(/^"|"$/g,``)}),v&&(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,v===`error`?`bg-danger`:`bg-warn`),title:v}),(0,G.jsx)(`button`,{type:`button`,"aria-label":e(_?`outliner.show`:`outliner.hide`),title:`${e(_?`outliner.show`:`outliner.hide`)} (H)`,onClick:e=>{e.stopPropagation(),n(_?[{op:`remove`,path:`objects#${r.id}.visible`}]:[{op:`set`,path:`objects#${r.id}.visible`,value:!1}])},className:W(`flex h-5 w-5 shrink-0 items-center justify-center rounded text-fg-faint hover:text-fg`,_?`opacity-100`:`opacity-0 group-hover:opacity-100`),children:_?(0,G.jsx)(St,{size:12}):(0,G.jsx)(wt,{size:12})})]},`${r.id}-${a?.ids.includes(r.id)?a.at:0}`)}),!m.length&&(0,G.jsx)(`div`,{className:`px-3 py-4 text-xs text-fg-faint`,children:e(`outliner.empty`)})]})]})}function Zx(){return(0,G.jsxs)(`aside`,{className:`flex w-[268px] shrink-0 flex-col border-r border-line bg-ink-1`,children:[(0,G.jsx)(Xx,{}),(0,G.jsx)(Wx,{})]})}function Qx(){let{t:e,lang:t,setLang:n}=U(),{store:r,ui:i,backend:a,closeProject:o,runCheck:s}=Q(),c=ev(),l=tv(e=>e.assistant),u=tv(e=>e.check),d=tv(e=>e.checkRunning),f=c.issues.filter(e=>e.severity===`error`).length,p=u?(u.counts?.errors??0)+(u.counts?.warnings??0):f,m=typeof navigator<`u`&&/Mac/.test(navigator.platform)?`⌘`:`Ctrl+`;return(0,G.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-line bg-ink-1 px-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,style:{width:268},children:[(0,G.jsx)(Y,{label:e(`top.projects`),onClick:o,children:(0,G.jsx)(Re,{size:15})}),(0,G.jsx)(eS,{}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`truncate text-sm font-semibold leading-tight`,children:c.scene?.title||a.projectTitle()}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1 truncate text-2xs text-fg-faint`,title:a.location??``,children:[a.mode===`cli`?(0,G.jsx)(en,{size:10}):(0,G.jsx)(nt,{size:10}),(0,G.jsx)(`span`,{className:`truncate`,children:a.mode===`cli`?$x(a.location):e(`top.inBrowser`)})]})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsx)(Y,{label:e(`top.undo`),shortcut:`${m}Z`,disabled:!c.canUndo,onClick:()=>r.undo(),children:(0,G.jsx)(xi,{size:15})}),(0,G.jsx)(Y,{label:e(`top.redo`),shortcut:`${m}⇧Z`,disabled:!c.canRedo,onClick:()=>r.redo(),children:(0,G.jsx)(dr,{size:15})}),(0,G.jsx)(tS,{})]}),(0,G.jsx)(nS,{}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,G.jsxs)(G_,{variant:`ghost`,onClick:()=>void s(),title:e(`top.checkHint`),children:[d?(0,G.jsx)(Nn,{size:14,className:`animate-spin`}):(0,G.jsx)(Nr,{size:14}),e(`top.check`),p>0&&(0,G.jsx)(`span`,{className:W(`rounded px-1 text-2xs font-semibold`,(u?.counts?.errors??f)>0?`bg-danger/20 text-danger`:`bg-warn/20 text-warn`),children:p})]}),(0,G.jsxs)(G_,{variant:`ghost`,onClick:()=>i.set({dialog:`render`}),title:e(`top.renderHint`),children:[(0,G.jsx)(Ae,{size:14}),e(`top.render`)]}),(0,G.jsxs)(G_,{variant:`primary`,onClick:()=>i.set({dialog:`export`}),children:[(0,G.jsx)(Ci,{size:14}),e(`top.export`)]}),(0,G.jsx)(`div`,{className:`mx-1 h-5 w-px bg-line`}),(0,G.jsx)(Y,{label:e(`top.assistant`),shortcut:`A`,active:l,onClick:()=>i.set({assistant:!l}),children:(0,G.jsx)(Se,{size:16})}),(0,G.jsx)(Y,{label:e(`top.shortcuts`),shortcut:`?`,onClick:()=>i.set({dialog:`shortcuts`}),children:(0,G.jsx)(_n,{size:15})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(t===`en`?`fr`:`en`),title:e(`top.language`),className:`h-7 rounded-md px-1.5 text-2xs font-semibold text-fg-muted hover:bg-ink-3 hover:text-fg`,children:t.toUpperCase()})]})]})}function $x(e){if(!e)return``;let t=e.split(`/`).filter(Boolean);return t.length>2?`…/${t.slice(-2).join(`/`)}`:e}function eS({size:e=20}){let t=(0,O.useId)().replace(/:/g,``);return(0,G.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 32 32`,"aria-hidden":!0,className:`shrink-0`,children:[(0,G.jsxs)(`defs`,{children:[(0,G.jsxs)(`linearGradient`,{id:`${t}bg`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,G.jsx)(`stop`,{offset:`0`,stopColor:`#2a2a30`}),(0,G.jsx)(`stop`,{offset:`1`,stopColor:`#0c0c0f`})]}),(0,G.jsxs)(`linearGradient`,{id:`${t}dot`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,G.jsx)(`stop`,{offset:`0`,stopColor:`#7aa5ff`}),(0,G.jsx)(`stop`,{offset:`1`,stopColor:`#3d6bff`})]}),(0,G.jsxs)(`radialGradient`,{id:`${t}glow`,cx:`0.5`,cy:`0.5`,r:`0.5`,children:[(0,G.jsx)(`stop`,{offset:`0`,stopColor:`#598bff`,stopOpacity:`0.55`}),(0,G.jsx)(`stop`,{offset:`1`,stopColor:`#598bff`,stopOpacity:`0`})]})]}),(0,G.jsx)(`rect`,{width:`32`,height:`32`,rx:`7.5`,fill:`url(#${t}bg)`}),(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`31`,height:`31`,rx:`7`,fill:`none`,stroke:`#ffffff`,strokeOpacity:`0.12`}),(0,G.jsx)(`circle`,{cx:`16`,cy:`16.6`,r:`5`,fill:`url(#${t}glow)`}),(0,G.jsx)(`path`,{d:`M16 8L23.45 12.3L23.45 20.9L16 25.2L8.55 20.9L8.55 12.3ZM12.62 14.65L8.55 12.3M19.38 14.65L23.45 12.3M16 20.5L16 25.2`,fill:`none`,stroke:`#fff`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,G.jsx)(`circle`,{cx:`16`,cy:`16.6`,r:`2.2`,fill:`url(#${t}dot)`})]})}function tS(){let{t:e}=U(),t=ev().save,n=t.state===`saved`?e(`save.saved`):t.state===`saving`?e(`save.saving`):t.state===`pending`?e(`save.pending`):e(`save.error`);return(0,G.jsxs)(`div`,{className:W(`ml-1 flex h-6 items-center gap-1 rounded-md px-1.5 text-2xs`,t.state===`error`?`bg-danger/15 text-danger`:`text-fg-faint`),title:t.state===`error`?`${t.message??``}\n${e(`save.errorHint`)}`:n,children:[t.state===`error`?(0,G.jsx)(Ke,{size:11}):(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 rounded-full`,t.state===`saved`?`bg-agent/70`:`bg-key animate-pulse`)}),n]})}function nS(){let{t:e}=U(),{player:t}=Q(),n=ev(),r=(0,O.useSyncExternalStore)(e=>t.onState(e),()=>t.playing),[i,a]=(0,O.useState)(0),o=(0,O.useRef)(0);(0,O.useEffect)(()=>t.onTime(e=>{Math.abs(e-o.current)>.015&&(o.current=e,a(e))}),[t]);let s=n.scene?.timeline?.duration||10;return(0,G.jsxs)(`div`,{className:`mx-auto flex min-w-0 max-w-[460px] flex-1 items-center gap-2`,children:[(0,G.jsx)(Y,{label:e(r?`top.pause`:`top.play`),shortcut:`Space`,onClick:()=>t.toggle(),className:`text-fg`,children:r?(0,G.jsx)(Zn,{size:15,fill:`currentColor`}):(0,G.jsx)(sr,{size:15,fill:`currentColor`})}),(0,G.jsxs)(`div`,{className:`w-[86px] shrink-0 text-xs tabular-nums text-fg-muted`,children:[(0,G.jsx)(`span`,{className:`text-fg`,children:i.toFixed(2)}),(0,G.jsxs)(`span`,{className:`text-fg-faint`,children:[` / `,s.toFixed(2),`s`]})]}),(0,G.jsx)(rS,{value:i,max:s,onSeek:e=>void t.seek(e),ariaLabel:e(`top.scrub`)})]})}function rS({value:e,max:t,onSeek:n,ariaLabel:r}){let i=(0,O.useRef)(null),a=e=>{let r=i.current.getBoundingClientRect();n(Math.max(0,Math.min(1,(e-r.left)/r.width))*t)},o=Math.max(0,Math.min(1,e/t))*100;return(0,G.jsxs)(`div`,{ref:i,role:`slider`,tabIndex:0,"aria-label":r,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":Number(e.toFixed(2)),onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),a(e.clientX)},onPointerMove:e=>e.buttons===1&&a(e.clientX),onKeyDown:r=>{r.key===`ArrowLeft`&&n(Math.max(0,e-(r.shiftKey?1:.1))),r.key===`ArrowRight`&&n(Math.min(t,e+(r.shiftKey?1:.1)))},className:`group relative h-6 min-w-[80px] flex-1 cursor-pointer`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-ink-3`}),(0,G.jsx)(`div`,{className:`absolute left-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-accent/60`,style:{width:`${o}%`}}),(0,G.jsx)(`div`,{className:`absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-ink-1 bg-fg shadow`,style:{left:`${o}%`}})]})}var iS={tl:`left-2 top-2`,tr:`right-2 top-2`,bl:`left-2 bottom-2`,br:`right-2 bottom-2`};function aS(e){let t=new Set;for(let n of e?.elements??[]){if(n.visible===!1)continue;let e=n.anchor??`top-left`;e===`top-left`?t.add(`tl`):e===`top-right`?t.add(`tr`):e===`bottom-left`?t.add(`bl`):e===`bottom-right`?t.add(`br`):e===`top`?t.add(`tl`).add(`tr`):e===`bottom`&&t.add(`bl`).add(`br`)}return t}function oS(e){let t=aS(e),n=(e,n)=>e.find(e=>!t.has(e)&&e!==n)??e.find(e=>e!==n)??e[0],r=n([`tr`,`br`,`tl`,`bl`]);return{camera:r,selection:n([`tl`,`bl`,`tr`,`br`],r)}}var sS={desktop:0,tablet:820,phone:390},cS=new Map,lS=new Set([`mesh`,`text`,`model`,`svg`]);function uS(){let{t:e}=U(),{player:t,backend:n,ui:r,store:i,edit:a}=Q(),o=ev(),s=o.scene,c=tv(e=>e.device),l=tv(e=>e.helpers),u=tv(e=>e.interact),d=tv(e=>e.agentPulse),f=tv(e=>e.gizmo),p=tv(e=>e.space),m=tv(e=>e.snap),h=tv(e=>e.view),g=tv(e=>e.lightSel),_=(0,O.useRef)(null),v=(0,O.useRef)(null),y=(0,O.useRef)(null),[b,x]=(0,O.useState)({w:800,h:500}),[S,C]=(0,O.useState)(null),[w,T]=(0,O.useState)([]),[ee,te]=(0,O.useState)(!1),[E,ne]=(0,O.useState)(null),[D,re]=(0,O.useState)(!1),ie=(0,O.useRef)(-1),ae=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{let e=_.current;if(!e)return;let t=new ResizeObserver(()=>x({w:e.clientWidth,h:e.clientHeight}));return t.observe(e),x({w:e.clientWidth,h:e.clientHeight}),()=>t.disconnect()},[]);let oe=(0,O.useCallback)((e,n)=>{let r=i.getSnapshot().scene;if(!r)return;let o=e.kind===`object`&&n.transform?V_(r,e.id,n.transform):e.kind===`light`&&n.point?H_(r,e.id,e.part,n.point):[];o.length?a(o):t.update(r)},[i,a,t]);(0,O.useEffect)(()=>{let e=v.current;if(!e)return;let o=!1,s=null,c=()=>{};(async()=>{let l=await n.mountConfig();if(o)return;let u=i.getSnapshot();if(ie.current=u.revision,await t.mount(e,u.scene,l,{editor:!0}),o)return;let d=i.getSnapshot();d.revision!==ie.current&&t.update(d.scene);let f=t.player?.editor,p=y.current;if(!f||!p)return;let{SceneEditor:m}=await Hl(async()=>{let{SceneEditor:e}=await import(`./editor-BZLIZJC8.js`);return{SceneEditor:e}},__vite__mapDeps([8,9,2,1,4,5]),import.meta.url);if(o)return;let h=d.scene?.id??`scene`;s=new m({bridge:f,dom:p,initialPose:cS.get(h)??null,onCameraChange:e=>cS.set(h,e),onPick:e=>{e?`light`in e?(i.select(null),r.set({lightSel:{id:e.light,part:e.part}})):(r.set({lightSel:null}),i.select(W_(e.chain,i.getSnapshot().selection))):(i.select(null),r.set({lightSel:null}))},onTransformEnd:(e,t)=>oe(e,t)}),c=f.onWorld(()=>{let e=ae.current;if(!e||!s||(ae.current=null,Date.now()-e.at>5e3))return;let t=s.objectBox(e.id),n=i.getSnapshot().scene;if(!t||!n)return;let r=e.y-t.min[1];if(r<.005||r>50)return;let o=n.objects.find(t=>t.id===e.id);if(!o)return;let c=o.position??[0,0,0];a([{op:`set`,path:`objects#${e.id}.position`,value:[c[0],Math.round((c[1]+r)*1e3)/1e3,c[2]]}],{coalesce:e.key})}),t.sceneEditor=s,ne(s)})();let l=t.onState(()=>T([...t.issues]));return()=>{o=!0,l(),c(),s?.dispose(),t.sceneEditor===s&&(t.sceneEditor=null),ne(null),t.dispose(),e.replaceChildren()}},[n,t,i,r,a,oe]),(0,O.useEffect)(()=>{o.revision!==ie.current&&t.update(s)},[o.revision,s,t]),(0,O.useEffect)(()=>{let e=setInterval(()=>C(t.stats()),1e3);return()=>clearInterval(e)},[t]);let se=o.selection;(0,O.useEffect)(()=>{se&&g&&r.set({lightSel:null})},[se,g,r]),(0,O.useEffect)(()=>{E?.setSelection(g&&!se?{kind:`light`,...g}:se?{kind:`object`,id:se}:null)},[E,se,g,o.revision]),(0,O.useEffect)(()=>E?.setMode(f),[E,f]),(0,O.useEffect)(()=>E?.setSpace(p),[E,p]),(0,O.useEffect)(()=>E?.setSnap(m),[E,m]),(0,O.useEffect)(()=>E?.setHelpers(l),[E,l]),(0,O.useEffect)(()=>E?.setView(u?`camera`:h),[E,h,u]),(0,O.useEffect)(()=>E?.setEnabled(!u),[E,u]),(0,O.useEffect)(()=>t.setInteract(u),[t,u]);let ce=ia(s.target?.aspect)??{width:16,height:9},le=ce.width/ce.height,ue=Math.max(50,b.w-104),de=Math.max(50,b.h-56),fe=sS[c],pe=fe||ue,me=pe/le,he=1;fe?he=Math.min(1,ue/pe,de/me):me>de&&(me=de,pe=me*le);let ge=e=>{let t=y.current;if(!t)return null;let n=t.getBoundingClientRect();return[(e.clientX-n.left)/n.width*2-1,-((e.clientY-n.top)/n.height*2-1)]},k=e=>{Ax(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,D||re(!0))},_e=e=>{re(!1);let t=jx(e),n=ge(e),o=i.getSnapshot().scene;if(!t||!n||!o)return;e.preventDefault();let s=E?E.dropPoint(n[0],n[1]):[0,0,0],c=.25,l=s.map((e,t)=>(m&&t!==1?Math.round(e/c)*c:Math.round(e*100)/100)||0);if(`light`in t){let e=na(t.light.type,b_(o));a([{op:`set`,path:`lights[${(o.lights??[]).length}]`,value:{id:e,...Mx(t.light,l)}}],{select:null}),r.set({lightSel:{id:e,part:`position`},interact:!1});return}let u=C_(o,t.object,l),d=`drop:${u.id}`;lS.has(u.kind)&&(ae.current={id:u.id,y:l[1],key:d,at:Date.now()}),a([{op:`addObject`,object:u}],{select:u.id,coalesce:d}),r.set({lightSel:null,interact:!1})},ve=()=>{let t=i.getSnapshot().scene;if(!E||!t)return;let n=E.pose(),r=U_(t,n.position,n.target);r.length&&(a(r),rg({tone:`success`,title:e(`viewport.cameraSet`),detail:e(`viewport.cameraSetDetail`)}))},ye=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e),be=g&&!se&&B_(s,g.id)!==null,A=se??(be?`${g.id}${g.part===`target`?` · target`:``}`:null),j=u?`camera`:h,xe=oS(o.scene?.ui),Se=(t,n,i,a)=>(0,G.jsx)(dS,{label:e(n),shortcut:i,active:!u&&f===t,disabled:u,onClick:()=>r.set({gizmo:t,interact:!1}),children:a});return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line bg-ink-1 px-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-fg-muted`,children:[(0,G.jsx)(`span`,{className:`rounded bg-ink-3 px-1.5 py-0.5 font-medium text-fg`,children:s.target?.kind}),(0,G.jsx)(`span`,{className:`tabular-nums`,children:s.target?.aspect}),(0,G.jsxs)(`span`,{className:`hidden text-fg-faint tabular-nums lg:inline`,children:[Math.round(pe),`×`,Math.round(me)]})]}),(0,G.jsx)(`div`,{className:`mx-auto flex items-center rounded-md bg-ink-2 p-0.5`,role:`radiogroup`,"aria-label":e(`viewport.device`),children:[[`desktop`,Ln],[`tablet`,ai],[`phone`,Fr]].map(([t,n])=>(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":c===t,title:e(`viewport.${t}`),onClick:()=>r.set({device:t}),className:W(`flex h-6 w-8 items-center justify-center rounded`,c===t?`bg-ink-4 text-fg`:`text-fg-faint hover:text-fg`),children:(0,G.jsx)(n,{size:13})},t))}),(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center rounded-md bg-ink-2 p-0.5`,role:`radiogroup`,"aria-label":e(`viewport.view`),children:[(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":j===`editor`,disabled:u,title:`${e(`viewport.editorCamera`)} (C)`,onClick:()=>r.set({view:`editor`}),className:W(`flex h-6 items-center gap-1 rounded px-1.5 text-2xs font-medium disabled:opacity-40`,j===`editor`?`bg-ink-4 text-fg`:`text-fg-faint hover:text-fg`),children:[(0,G.jsx)(Ti,{size:12}),` `,(0,G.jsx)(`span`,{className:`hidden xl:inline`,children:e(`viewport.editorShort`)})]}),(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":j===`camera`,title:`${e(`viewport.sceneCamera`)} (C)`,onClick:()=>r.set({view:`camera`}),className:W(`flex h-6 items-center gap-1 rounded px-1.5 text-2xs font-medium`,j===`camera`?`bg-ink-4 text-fg`:`text-fg-faint hover:text-fg`),children:[(0,G.jsx)(Ae,{size:12}),` `,(0,G.jsx)(`span`,{className:`hidden xl:inline`,children:e(`viewport.cameraShort`)})]})]}),(0,G.jsx)(Y,{label:e(`viewport.setCamera`),disabled:j!==`editor`||!E,onClick:ve,children:(0,G.jsx)(ri,{size:14})}),(0,G.jsx)(Y,{label:e(`viewport.frame`),shortcut:`F`,disabled:!E,onClick:()=>{h===`camera`&&r.set({view:`editor`,interact:!1}),E?.frameSelection()},children:(0,G.jsx)(Pt,{size:14})}),(0,G.jsx)(`div`,{className:`mx-1 h-4 w-px bg-line`}),(0,G.jsx)(Y,{label:e(`viewport.helpers`),shortcut:`G`,active:l,onClick:()=>r.set({helpers:!l}),children:(0,G.jsx)(Kt,{size:14})})]})]}),(0,G.jsxs)(`div`,{ref:_,className:`viewport-stage relative flex min-h-0 flex-1 items-center justify-center overflow-hidden`,children:[(0,G.jsxs)(`div`,{style:{width:pe,height:me,transform:he===1?void 0:`scale(${he})`},className:`relative shrink-0`,onDragOver:k,onDragLeave:()=>re(!1),onDrop:_e,children:[d>0&&(0,G.jsx)(`div`,{className:`agent-pulse pointer-events-none absolute inset-0 rounded-[3px]`},d),(0,G.jsxs)(`div`,{className:W(`absolute inset-0 overflow-hidden rounded-[3px] shadow-[0_0_0_1px_rgb(255_255_255/0.08),0_20px_60px_-20px_rgb(0_0_0/0.8)]`,D&&`ring-2 ring-accent`),children:[(0,G.jsx)(`div`,{ref:v,className:`absolute inset-0`}),j===`camera`&&!u&&l&&(0,G.jsx)(fS,{}),(0,G.jsx)(`div`,{ref:y,"data-testid":`viewport-surface`,className:W(`absolute inset-0 select-none`,u&&`pointer-events-none`),style:{touchAction:`none`},"aria-label":e(`viewport.clickToSelect`)}),A&&!u&&(0,G.jsxs)(`div`,{className:W(`pointer-events-none absolute z-10 flex max-w-[60%] items-center gap-1 truncate rounded-[4px] bg-ink-0/75 px-1.5 py-0.5 text-2xs font-medium text-accent backdrop-blur`,iS[xe.selection]),children:[be?(0,G.jsx)(Tn,{size:10}):(0,G.jsx)(we,{size:10}),(0,G.jsx)(`span`,{className:`truncate`,children:A})]}),!u&&(0,G.jsxs)(`div`,{className:W(`pointer-events-none absolute z-10 flex items-center gap-1 rounded-[4px] bg-ink-0/60 px-1.5 py-0.5 text-2xs text-fg-muted backdrop-blur`,iS[xe.camera]),children:[j===`camera`?(0,G.jsx)(Ae,{size:10}):(0,G.jsx)(Ti,{size:10}),e(j===`camera`?`viewport.sceneCamera`:`viewport.editorCamera`)]}),D&&(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-3 mx-auto w-fit rounded-md bg-accent px-2 py-1 text-2xs font-medium text-ink-0`,children:e(`viewport.dropHere`)})]})]}),(0,G.jsxs)(`div`,{className:`absolute left-2 top-2 flex flex-col gap-0.5 rounded-lg border border-line bg-ink-1/90 p-0.5 shadow-lg shadow-black/30 backdrop-blur`,role:`toolbar`,"aria-label":e(`viewport.tools`),children:[(0,G.jsx)(dS,{label:e(`viewport.select`),shortcut:`Q`,active:!u,onClick:()=>r.set({interact:!1}),children:(0,G.jsx)(Vn,{size:14})}),(0,G.jsx)(dS,{label:e(`viewport.interact`),shortcut:`I`,active:u,onClick:()=>r.set({interact:!0}),children:(0,G.jsx)(Qt,{size:14})}),(0,G.jsx)(`div`,{className:`mx-1 my-0.5 h-px bg-line`}),Se(`translate`,`viewport.move`,`W`,(0,G.jsx)(Gn,{size:14})),Se(`rotate`,`viewport.rotate`,`E`,(0,G.jsx)(_r,{size:14})),Se(`scale`,`viewport.scale`,`R`,(0,G.jsx)(Cr,{size:14})),(0,G.jsx)(`div`,{className:`mx-1 my-0.5 h-px bg-line`}),(0,G.jsx)(dS,{label:e(p===`world`?`viewport.world`:`viewport.local`),shortcut:`X`,active:!1,disabled:u,onClick:()=>r.set({space:p===`world`?`local`:`world`}),children:p===`world`?(0,G.jsx)(Wt,{size:14}):(0,G.jsx)(we,{size:14})}),(0,G.jsx)(dS,{label:e(`viewport.snap`),shortcut:`⇧`,active:m,disabled:u,onClick:()=>r.set({snap:!m}),children:(0,G.jsx)(Fn,{size:14})})]}),(0,G.jsxs)(`div`,{className:`pointer-events-none absolute bottom-2 left-2 flex gap-2 rounded-md bg-ink-0/70 px-2 py-1 text-2xs tabular-nums text-fg-muted backdrop-blur`,children:[S?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`b`,{className:`font-semibold text-fg`,children:ye(S.triangles)}),` `,e(`viewport.tris`)]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`b`,{className:`font-semibold text-fg`,children:S.drawCalls}),` `,e(`viewport.calls`)]}),S.fps?(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`b`,{className:`font-semibold text-fg`,children:S.fps}),` fps`]}):null]}):(0,G.jsx)(`span`,{children:e(`viewport.starting`)}),!u&&(0,G.jsx)(`span`,{className:`hidden border-l border-line pl-2 text-fg-faint md:inline`,children:e(j===`editor`?`viewport.navHint`:`viewport.cameraHint`)})]}),w.length>0&&(0,G.jsxs)(`div`,{className:`absolute bottom-2 right-2`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>te(e=>!e),className:`flex items-center gap-1 rounded-md bg-warn/15 px-2 py-1 text-2xs font-medium text-warn backdrop-blur hover:bg-warn/25`,children:[(0,G.jsx)(hi,{size:11}),` `,e(`viewport.runtimeIssues`,{n:w.length})]}),ee&&(0,G.jsx)(`div`,{className:`absolute bottom-8 right-0 max-h-60 w-80 overflow-auto rounded-lg border border-line bg-ink-1 p-2 text-xs shadow-xl`,children:w.map((e,t)=>(0,G.jsxs)(`div`,{className:`border-b border-line py-1 last:border-0`,children:[(0,G.jsx)(`div`,{className:`font-mono text-2xs text-warn`,children:e.code}),(0,G.jsx)(`div`,{className:`text-fg-muted`,children:e.message})]},t))})]})]})]})}function dS({label:e,shortcut:t,active:n,disabled:r,onClick:i,children:a}){return(0,G.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":n,title:t?`${e} (${t})`:e,disabled:r,onClick:i,className:W(`flex h-7 w-7 items-center justify-center rounded-md transition-colors disabled:pointer-events-none disabled:opacity-35`,n?`bg-accent/20 text-accent`:`text-fg-muted hover:bg-ink-3 hover:text-fg`),children:a})}function fS(){return(0,G.jsxs)(`div`,{className:`pointer-events-none absolute inset-0`,children:[(0,G.jsx)(`div`,{className:`absolute inset-[5%] rounded-[2px] border border-dashed border-white/25`}),[33.333,66.666].map(e=>(0,G.jsx)(`div`,{className:`absolute inset-y-0 w-px bg-white/10`,style:{left:`${e}%`}},`v${e}`)),[33.333,66.666].map(e=>(0,G.jsx)(`div`,{className:`absolute inset-x-0 h-px bg-white/10`,style:{top:`${e}%`}},`h${e}`)),(0,G.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-3 w-px -translate-x-1/2 -translate-y-1/2 bg-white/30`}),(0,G.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-px w-3 -translate-x-1/2 -translate-y-1/2 bg-white/30`})]})}function pS({trigger:e,items:t,onPick:n,placeholder:r,align:i=`right`}){let[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(0),d=(0,O.useRef)(null),f=(0,O.useMemo)(()=>{let e=s.trim().toLowerCase();return e?t.filter(t=>t.label.toLowerCase().includes(e)||t.hint?.toLowerCase().includes(e)):t},[t,s]);(0,O.useEffect)(()=>{if(!a)return;let e=e=>!d.current?.contains(e.target)&&o(!1);return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]);let p=e=>{o(!1),c(``),n(e)};return(0,G.jsxs)(`div`,{ref:d,className:`relative`,children:[e(()=>{o(e=>!e),u(0)}),a&&(0,G.jsxs)(`div`,{className:`toast-in absolute top-full z-30 mt-1 w-64 overflow-hidden rounded-lg border border-line bg-ink-1 shadow-xl shadow-black/50 ${i===`right`?`right-0`:`left-0`}`,children:[(0,G.jsx)(`input`,{autoFocus:!0,value:s,placeholder:r,onChange:e=>{c(e.target.value),u(0)},onKeyDown:e=>{if(e.key===`ArrowDown`)u(e=>Math.min(f.length-1,e+1));else if(e.key===`ArrowUp`)u(e=>Math.max(0,e-1));else if(e.key===`Enter`&&f[l])p(f[l].id);else if(e.key===`Escape`)o(!1);else return;e.preventDefault()},className:`h-8 w-full border-b border-line bg-transparent px-2.5 text-sm outline-none placeholder:text-fg-faint`}),(0,G.jsxs)(`div`,{className:`max-h-72 overflow-auto py-1`,children:[f.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,onMouseEnter:()=>u(t),onClick:()=>p(e.id),className:`block w-full px-2.5 py-1 text-left ${t===l?`bg-ink-3`:``}`,children:[(0,G.jsx)(`div`,{className:`text-sm`,children:e.label}),e.hint&&(0,G.jsx)(`div`,{className:`truncate text-2xs text-fg-faint`,children:e.hint})]},e.id)),!f.length&&(0,G.jsx)(`div`,{className:`px-2.5 py-2 text-xs text-fg-faint`,children:`—`})]})]})]})}var mS=e=>Math.round(e*10)/10;function hS(e,t,n=1){let r=e.trim().split(/\s+/),i=[],a=e=>mS(t+Number(e)*n),o=e=>mS(-Number(e)*n);for(let e=0;e<r.length;){let t=r[e++];if(t===`m`||t===`l`)i.push(`${t===`m`?`M`:`L`}${a(r[e])} ${o(r[e+1])}`),e+=2;else if(t===`q`)i.push(`Q${a(r[e+2])} ${o(r[e+3])} ${a(r[e])} ${o(r[e+1])}`),e+=4;else if(t===`b`)i.push(`C${a(r[e+2])} ${o(r[e+3])} ${a(r[e+4])} ${o(r[e+5])} ${a(r[e])} ${o(r[e+1])}`),e+=6;else if(t===`z`)i.push(`Z`);else break}return i.join(``)}function gS(e,t,n=1){let r=0,i=[];for(let a of t){let t=e.glyphs[a]??e.glyphs[`?`];t?(t.o&&i.push(hS(t.o,r,n)),r+=t.ha*n):r+=(e.resolution??1e3)*.3*n}let a=e.resolution??1e3;return{d:i.join(``),width:r,ascent:(e.ascender??a*.8)*n,descent:Math.abs(e.descender??-a*.2)*n}}var _S=new Map;function vS(e,t){let n=_S.get(t);return n||(n=fetch(Fx(e,`fonts/${t}.typeface.json`)).then(e=>e.ok?e.json():null).catch(()=>null),_S.set(t,n)),n}var yS={"sans-bold":`Inter Bold`,sans:`Inter`,"inter-black":`Inter Black`,"montserrat-extrabold":`Montserrat`,"space-grotesk-bold":`Space Grotesk`,"bebas-neue":`BEBAS NEUE`,anton:`ANTON`,"serif-bold":`Playfair Bold`,serif:`Playfair`,mono:`JetBrains Mono`,display:`Fredoka`,pacifico:`Pacifico`,lobster:`Lobster`},bS=e=>yS[e]??e;function xS({id:e,height:t=18,className:n}){let r=Px(),[i,a]=(0,O.useState)(null);(0,O.useEffect)(()=>{let t=!0;return r&&vS(r,e).then(e=>t&&a(e)),()=>{t=!1}},[r,e]);let o=bS(e);if(!i)return(0,G.jsx)(`span`,{className:W(`truncate text-sm text-fg-muted`,n),children:o});let s=gS(i,o),c=s.ascent+s.descent;return(0,G.jsx)(`svg`,{viewBox:`0 ${-s.ascent} ${Math.max(1,s.width)} ${c}`,height:t,className:W(`block max-w-full fill-current`,n),preserveAspectRatio:`xMinYMid meet`,"aria-label":o,role:`img`,children:(0,G.jsx)(`path`,{d:s.d})})}function SS({value:e,onChange:t}){return(0,G.jsx)(by,{width:268,trigger:(t,n)=>(0,G.jsx)(xy,{onClick:t,open:n,ariaLabel:xb(`font`),children:(0,G.jsx)(xS,{id:e,height:15,className:`text-fg`})}),children:n=>(0,G.jsx)(`div`,{className:`py-1`,role:`listbox`,children:m.map(r=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":r.id===e,title:r.description,onClick:()=>{t(r.id),n()},className:W(`flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-ink-3`,r.id===e&&`bg-accent/10`),children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(xS,{id:r.id,height:20,className:r.id===e?`text-accent`:`text-fg`}),(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-2xs text-fg-faint`,children:r.description.split(` — `)[1]??r.description})]}),r.id===e&&(0,G.jsx)(Pe,{size:12,className:`shrink-0 text-accent`})]},r.id))})})}var CS=(e,t)=>{let n=typeof e==`string`?pa(e):null;return n?ha(n):t};function wS(e,t,n){let r=pa(e),i=pa(t);return!r||!i?e:ha({r:r.r+(i.r-r.r)*n,g:r.g+(i.g-r.g)*n,b:r.b+(i.b-r.b)*n,a:1})}function TS(e){let t=(t,n)=>typeof e[t]==`number`?e[t]:n,n=t(`metalness`,0),r=t(`roughness`,.5),i=t(`transmission`,0),a=Array.isArray(e.gradient)?e.gradient.map(e=>CS(e,`#888888`)):null;if(e.type===`normal`)return`radial-gradient(circle at 35% 30%, #ffffff 0 4%, transparent 30%), conic-gradient(from 200deg, #8080ff, #ff8080, #80ff80, #8080ff)`;let o=a?a[Math.floor(a.length/2)]:CS(e.color,`#d0d0d0`),s=typeof e.emissive==`string`&&t(`emissiveIntensity`,1)>0?CS(e.emissive,`#000000`):null,c=s&&s!==`#000000`?wS(o,s,.6):o,l=wS(c,`#000000`,n>.5?.82:.6),u=wS(c,n>.5?`#000000`:`#ffffff`,n>.5?.25:.05),d=Math.round(4+r*22),f=`radial-gradient(circle at 34% 28%, rgba(255,255,255,${((1-r*.7)*(n>.5?1:.85)).toFixed(2)}) 0 ${d*.35}%, rgba(255,255,255,0) ${d+6}%)`,p=a?`linear-gradient(180deg, ${a.join(`, `)})`:`radial-gradient(circle at 38% 32%, ${u} 0%, ${c} 35%, ${l} 100%)`,m=[f];return n>.5&&m.push(`radial-gradient(circle at 60% 80%, ${wS(c,`#ffffff`,.35)} 0 6%, transparent 30%)`),s&&m.push(`radial-gradient(circle at 50% 50%, ${s}66 0 40%, transparent 72%)`),i>0&&m.push(`radial-gradient(circle at 55% 60%, rgba(255,255,255,0.08) 0 45%, rgba(255,255,255,0.35) 62%, rgba(255,255,255,0) 72%)`),m.push(i>0?`radial-gradient(circle at 40% 35%, ${wS(c,`#9fb7d0`,.3)}55 0%, #1b2030 100%)`:p),e.wireframe?`repeating-linear-gradient(45deg, ${o} 0 1px, transparent 1px 6px), repeating-linear-gradient(-45deg, ${o} 0 1px, #0e1015 1px 6px)`:m.join(`, `)}function ES(e){return TS(e?.props??{color:`#cfd3da`,roughness:.5})}var DS={cols:8,cell:72,spacing:2.5};function OS(e=r){let{cols:t,cell:n,spacing:i}=DS,a=Math.ceil(e.length/t),o={},s=e.map((e,r)=>{let s=r%t,c=Math.floor(r/t);return o[e.id]={x:s*n,y:c*n},{id:`s${r}`,kind:`mesh`,position:[(s-(t-1)/2)*i,((a-1)/2-c)*i,0],geometry:{type:`sphere`,radius:1,segments:48},material:{preset:e.id}}});return{scene:{version:1,id:`preset-sheet`,title:`Material presets`,target:{kind:`card`,aspect:`${t}:${a}`,toneMapping:`aces`,lazy:!1,quality:`high`},camera:{type:`orthographic`,zoom:a*i,position:[0,0,20],target:[0,0,0]},environment:{background:`#1c2029`,lighting:`studio`},lights:[{id:`key`,type:`directional`,position:[4,6,8],intensity:2.2},{id:`fill`,type:`ambient`,intensity:.35}],objects:s},width:t*n,height:a*n,cells:o}}var kS=`agent3d.studio.presetSheet.v1.${r.map(e=>e.id).join(`,`).length}`,AS=null;function jS(){let{backend:e}=Q(),[t,n]=(0,O.useState)(()=>{try{return localStorage.getItem(kS)}catch{return null}});return(0,O.useEffect)(()=>{if(t)return;let r=!0;return AS||=(async()=>{let{scene:t,width:n,height:r}=OS(),i=await dx(t,{libraryBase:(await e.mountConfig()).libraryBase},0,n,r);try{localStorage.setItem(kS,i)}catch{}return i})().catch(()=>null),AS.then(e=>r&&e&&n(e)),()=>{r=!1}},[e,t]),t}function MS({id:e,size:t=36,sheet:n,className:r}){let i=e?y(e):void 0,{cells:a,width:o,height:s}=NS,c=e?a[e]:void 0,l=t/DS.cell,u=n&&c?{backgroundImage:`url(${n})`,backgroundSize:`${o*l}px ${s*l}px`,backgroundPosition:`${-c.x*l}px ${-c.y*l}px`}:{background:ES(i),borderRadius:999,transform:`scale(0.8)`};return(0,G.jsx)(`span`,{className:W(`block shrink-0 overflow-hidden rounded-md`,r),style:{width:t,height:t,...u},"aria-hidden":!0})}var NS=OS();function PS({value:e,onChange:t}){let{t:n}=U(),i=jS(),a=e?y(e):void 0;return(0,G.jsx)(by,{width:348,trigger:(t,r)=>(0,G.jsxs)(xy,{onClick:t,open:r,ariaLabel:n(`inspector.preset`),children:[a?(0,G.jsx)(MS,{id:e,size:16,sheet:i,className:`rounded`}):(0,G.jsx)(j,{size:12,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:W(`truncate`,!a&&`text-fg-faint`),children:a?Cb(a.id):n(`inspector.noPreset`)})]}),children:a=>(0,G.jsxs)(`div`,{className:`p-2`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-5 gap-1`,children:[(0,G.jsx)(FS,{active:!e,label:n(`inspector.noPreset`),onPick:()=>{t(void 0),a()},children:(0,G.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-md border border-dashed border-line text-fg-faint`,children:(0,G.jsx)(j,{size:14})})}),r.map(n=>(0,G.jsx)(FS,{active:e===n.id,label:Cb(n.id),hint:n.description,onPick:()=>{t(n.id),a()},children:(0,G.jsx)(MS,{id:n.id,size:44,sheet:i})},n.id))]}),!i&&(0,G.jsx)(`div`,{className:`mt-2 text-center text-2xs text-fg-faint`,children:n(`inspector.renderingPresets`)})]})})}function FS({active:e,label:t,hint:n,onPick:r,children:i}){return(0,G.jsxs)(`button`,{type:`button`,title:n?`${t} — ${n}`:t,"aria-pressed":e,onClick:r,className:W(`relative flex flex-col items-center gap-1 rounded-md p-1 transition-colors`,e?`bg-accent/15 ring-1 ring-accent/70`:`hover:bg-ink-3`),children:[i,(0,G.jsx)(`span`,{className:W(`w-full truncate text-center text-[10px] leading-tight`,e?`text-accent`:`text-fg-muted`),children:t}),e&&(0,G.jsx)(Pe,{size:10,className:`absolute right-1 top-1 text-accent`})]})}function IS(e){return e===void 0?`none`:typeof e==`object`?`procedural`:e.startsWith(`library:`)?`library`:`file`}function LS({slot:e,value:n,path:r,onChange:i}){let{t:a}=U(),{library:o}=Q(),s=Px(),c=IS(n),l=(0,O.useMemo)(()=>o.assets.filter(e=>e.kind===`texture`),[o]),u=/normal/i.test(e)?`normal`:/rough|metal|ao|bump|displacement|alpha/i.test(e)?`roughness`:`color`,d=(0,O.useMemo)(()=>[...l].sort((e,t)=>Number(!e.tags?.includes(u))-Number(!t.tags?.includes(u))||e.id.localeCompare(t.id)),[l,u]),f=typeof n==`object`?n:null,p=f?v(`textures`,f.procedural):void 0;return(0,G.jsxs)(`div`,{className:W(`rounded-md`,c!==`none`&&`bg-ink-0/40 pb-1`),children:[(0,G.jsxs)(Z,{label:xb(e),overridden:n!==void 0,onReset:()=>i(void 0),children:[(0,G.jsx)(X,{value:c,options:[`none`,`file`,`library`,`procedural`].map(e=>({value:e,label:a(`texture.${e}`)})),onChange:e=>i(e===`none`?void 0:e===`file`?`assets/textures/`:e===`library`?`library:${d[0]?.id??`textures/concrete-color.jpg`}`:{procedural:u===`normal`?`flakes`:`noise`}),className:`w-[86px] flex-none`,ariaLabel:e}),c===`file`&&(0,G.jsx)(K_,{value:String(n),onCommit:e=>i(e.trim()||void 0),mono:!0,ariaLabel:`${e} path`}),c===`library`&&(0,G.jsxs)(G.Fragment,{children:[s&&(0,G.jsx)(`img`,{src:Fx(s,String(n)),alt:``,className:`h-6 w-6 shrink-0 rounded object-cover`}),(0,G.jsx)(X,{value:String(n).replace(/^library:/,``),options:d.map(e=>({value:e.id,label:e.id.replace(/^textures\//,``).replace(/\.\w+$/,``)})),onChange:e=>i(`library:${e}`),ariaLabel:`${e} library`})]}),c===`procedural`&&f&&(0,G.jsx)(X,{value:f.procedural,options:t.map(e=>({value:e.id,label:Cb(e.id)})),onChange:e=>i({procedural:e}),ariaLabel:`${e} procedural`})]}),f&&p&&(0,G.jsx)($,{specs:p.params,base:r,values:f})]})}function RS(e,t){if(!t)return t;let n=Aa[e].params,r={...t};for(let[e,t]of Object.entries(n))t.type===`vec2`&&typeof r[e]==`number`&&(r[e]=[r[e],r[e]]);return r}function zS({object:e}){let{t}=U(),n=Ob(),r=e.effects??{},i=ja.filter(e=>r[e]),a=(t,r)=>{!r&&i.length===1&&i[0]===t?n(J(e.id,`effects`),void 0):n(J(e.id,`effects.${t}`),r?{}:void 0)};return(0,G.jsx)(J_,{title:t(`photo.effects`),id:`photo-effects`,defaultOpen:i.length>0,children:ja.map(n=>{let i=!!r[n],o=t(`photo.effect.${n}`);return(0,G.jsxs)(`div`,{className:`border-t border-line/40 first:border-t-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-1`,children:[(0,G.jsx)(`span`,{className:`text-xs text-fg`,title:t(`photo.effect.${n}Hint`),children:o}),(0,G.jsx)(q_,{checked:i,onChange:e=>a(n,e),ariaLabel:o})]}),i&&!e.depth&&Aa[n].needsDepth&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:t(`photo.effectNeedsDepth`)}),i&&(0,G.jsx)($,{specs:Cg[n],base:J(e.id,`effects.${n}`),values:RS(n,r[n])})]},n)})})}function BS({object:e}){let{t}=U(),n=Ob(),{backend:r,tools:i}=Q(),a=Lx(),[o,s]=(0,O.useState)(!1),c=J(e.id,``),l=e,u=__(r.capabilities)&&i.some(e=>e.name===`image_depth`),d=async()=>{s(!0);try{let i=g_(await r.call(m_,h_(e)));if(!i)throw new Dh(`io`,t(`photo.depthNoPath`));n(J(e.id,`depth`),i),a.reload(),rg({tone:`success`,title:t(`photo.depthDone`),detail:i})}catch(e){let n=e;rg({tone:`error`,title:t(`photo.depthFailed`),detail:[n.message,n.hint].filter(Boolean).join(` `)},8e3)}finally{s(!1)}};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J_,{title:t(`kinds.photo`),id:`photo`,children:[(0,G.jsx)(Rx,{label:t(`photo.image`),hint:t(`photo.imageHint`),value:e.src,onChange:t=>t&&n(J(e.id,`src`),t),projectAssets:a.assets,onOpen:a.reload,ariaLabel:t(`photo.image`)}),(0,G.jsx)(Rx,{label:t(`photo.depth`),hint:t(`photo.depthHint`),value:e.depth,onChange:t=>n(J(e.id,`depth`),t),projectAssets:a.assets,onOpen:a.reload,library:!1,ariaLabel:t(`photo.depth`)}),(0,G.jsx)(`div`,{className:`flex items-center gap-2 px-3 py-1`,children:(0,G.jsx)(`span`,{title:t(u?`photo.generateDepthHint`:`photo.depthNeedsCli`),className:`inline-flex`,children:(0,G.jsxs)(G_,{size:`xs`,disabled:!u||o,onClick:()=>void d(),children:[o?(0,G.jsx)(Nn,{size:11,className:`animate-spin`}):(0,G.jsx)(Di,{size:11}),` `,t(o?`photo.generatingDepth`:`photo.generateDepth`)]})})}),!e.depth&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:t(u?`photo.flatHint`:`photo.depthNeedsCli`)}),(e.depth||e.plate)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Rx,{label:t(`photo.plate`),hint:t(`photo.plateHint`),value:e.plate,onChange:t=>n(J(e.id,`plate`),t),projectAssets:a.assets,onOpen:a.reload,library:!1,ariaLabel:t(`photo.plate`)}),(0,G.jsx)(Rx,{label:t(`photo.plateDepth`),hint:t(`photo.plateDepthHint`),value:e.plateDepth,onChange:t=>n(J(e.id,`plateDepth`),t),projectAssets:a.assets,onOpen:a.reload,library:!1,ariaLabel:t(`photo.plateDepth`)})]}),(0,G.jsx)(Db,{spec:yg,value:e.mode,onChange:t=>n(J(e.id,`mode`),t)}),(0,G.jsx)($,{specs:l_(e),base:c,values:l})]}),(0,G.jsx)(J_,{title:t(`photo.motion`),id:`photo-motion`,children:(0,G.jsx)($,{specs:xg,base:J(e.id,`motion`),values:e.motion})}),(0,G.jsx)(zS,{object:e}),(0,G.jsx)(J_,{title:t(`inspector.material`),id:`photo-material`,defaultOpen:!!e.material,children:(0,G.jsx)($,{specs:wg,base:J(e.id,`material`),values:e.material})})]})}var VS={lathe:{points:[[0,0],[.4,0],[.5,.3],[.3,.8],[.35,1.2],[0,1.2]]},extrude:{shape:[[0,.5],[.15,.15],[.5,.1],[.2,-.12],[.3,-.5],[0,-.25],[-.3,-.5],[-.2,-.12],[-.5,.1],[-.15,.15]]},tube:{points:[[-1.5,0,0],[-.5,.6,.3],[.5,-.4,-.3],[1.5,.2,0]]}};function HS({object:e}){let{t}=U(),{edit:n,store:r}=Q(),i=Ob(),a=t=>J(e.id,t);return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line px-3 py-2.5`,children:[(0,G.jsx)(`div`,{className:`flex h-7 w-7 items-center justify-center rounded-md bg-accent/15 text-accent`,children:(0,G.jsx)(Yx,{kind:e.kind,size:14})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate font-mono text-xs text-fg`,title:t(`inspector.idHint`),children:e.id}),(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:t(`kinds.${e.kind}`)})]}),(0,G.jsx)(Y,{label:t(`outliner.delete`),onClick:()=>n([{op:`removeObject`,id:e.id}]),children:(0,G.jsx)(li,{size:13})}),(0,G.jsx)(Y,{label:t(`inspector.deselect`),shortcut:`Esc`,onClick:()=>r.select(null),children:(0,G.jsx)(Fi,{size:14})})]}),(0,G.jsxs)(`div`,{className:`border-b border-line py-1.5`,children:[(0,G.jsx)(Z,{label:t(`inspector.name`),children:(0,G.jsx)(K_,{value:e.name??``,placeholder:e.id,onCommit:e=>i(a(`name`),e.trim()||void 0),ariaLabel:t(`inspector.name`)})}),(0,G.jsx)(Z,{label:t(`inspector.visible`),children:(0,G.jsx)(q_,{checked:e.visible!==!1,onChange:e=>i(a(`visible`),e?void 0:!1),ariaLabel:t(`inspector.visible`)})})]}),(0,G.jsxs)(J_,{title:t(`inspector.transform`),id:`transform`,children:[(0,G.jsx)(Z,{label:t(`inspector.position`),children:(0,G.jsx)(_y,{value:e.position??[0,0,0],placeholder:!e.position,step:.01,onChange:(e,t)=>i(a(`position`),e,t)})}),(0,G.jsx)(Z,{label:t(`inspector.rotation`),children:(0,G.jsx)(_y,{value:e.rotation??[0,0,0],placeholder:!e.rotation,step:.5,suffix:`°`,onChange:(e,t)=>i(a(`rotation`),e,t)})}),(0,G.jsx)(US,{object:e})]}),(0,G.jsx)(WS,{object:e}),D_.has(e.kind)&&(0,G.jsx)(KS,{object:e}),(0,G.jsx)(JS,{object:e}),(0,G.jsx)(XS,{object:e}),(0,G.jsxs)(J_,{title:t(`inspector.advanced`),id:`advanced`,defaultOpen:!1,children:[(r.getSnapshot().scene?.objects??[]).some(t=>t.id===e.id)&&(0,G.jsx)($,{specs:[Ig],base:J(e.id,``),values:e}),(0,G.jsx)($,{specs:Lg,base:J(e.id,``),values:e}),(0,G.jsx)(Z,{label:t(`inspector.tags`),hint:t(`inspector.tagsHint`),children:(0,G.jsx)(K_,{value:(e.tags??[]).join(`, `),onCommit:e=>i(a(`tags`),e.trim()?e.split(/[\s,]+/).filter(Boolean):void 0),ariaLabel:t(`inspector.tags`)})})]})]})}function US({object:e}){let{t}=U(),n=Ob(),r=e.scale===void 0||typeof e.scale==`number`,i=J(e.id,`scale`),a=typeof e.scale==`number`?[e.scale,e.scale,e.scale]:e.scale??[1,1,1];return(0,G.jsxs)(Z,{label:t(`inspector.scale`),children:[r?(0,G.jsx)(hy,{label:`⇔`,value:typeof e.scale==`number`?e.scale:1,placeholder:e.scale===void 0,step:.01,min:0,onChange:(e,t)=>n(i,e===1?void 0:e,t),ariaLabel:t(`inspector.scale`)}):(0,G.jsx)(_y,{value:a,step:.01,onChange:(e,t)=>n(i,e,t)}),(0,G.jsx)(Y,{label:t(r?`inspector.scaleSplit`:`inspector.scaleUniform`),className:`h-6 w-6`,onClick:()=>n(i,r?a:a[0]===1?void 0:a[0]),children:r?(0,G.jsx)(kn,{size:12}):(0,G.jsx)(Dn,{size:12})})]})}function WS({object:e}){let{t}=U(),r=Ob(),i=e,a=J(e.id,``);switch(e.kind){case`mesh`:case`instances`:{let i=v(`geometries`,e.geometry?.type);return(0,G.jsxs)(J_,{title:t(`inspector.geometry`),id:`geometry`,children:[(0,G.jsx)(Z,{label:t(`inspector.type`),children:(0,G.jsx)(X,{value:e.geometry?.type??``,options:n.map(e=>({value:e.id,label:Cb(e.id)})),onChange:t=>r(J(e.id,`geometry`),{type:t,...VS[t]??{}}),ariaLabel:t(`inspector.type`)})}),i&&(0,G.jsx)($,{specs:i.params,base:J(e.id,`geometry`),values:e.geometry}),e.kind===`instances`&&(0,G.jsx)(Z,{label:t(`inspector.layout`),align:`start`,children:(0,G.jsx)(Eb,{value:e.layout,rows:4,onCommit:t=>r(J(e.id,`layout`),t)})})]})}case`text`:return(0,G.jsx)(GS,{object:e});case`model`:return(0,G.jsxs)(J_,{title:t(`kinds.model`),id:`model`,children:[(0,G.jsx)($,{specs:hg,base:a,values:i}),(0,G.jsx)($,{specs:gg,base:J(e.id,`animation`),values:e.animation})]});case`generator`:{let n=v(`generators`,e.generator);return(0,G.jsxs)(J_,{title:t(`kinds.generator`),id:`generator`,children:[(0,G.jsx)(Z,{label:t(`inspector.type`),children:(0,G.jsx)(X,{value:e.generator,options:c.map(e=>({value:e.id,label:Cb(e.id)})),onChange:t=>r(J(e.id,`generator`),t,!0,e.params?[{op:`remove`,path:J(e.id,`params`)}]:[]),ariaLabel:t(`inspector.type`)})}),n&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:n.description}),(0,G.jsx)(Z,{label:t(`inspector.seed`),children:(0,G.jsx)(hy,{value:e.seed??1,integer:!0,placeholder:e.seed===void 0,onChange:(t,n)=>r(J(e.id,`seed`),t,n),ariaLabel:t(`inspector.seed`)})}),n&&(0,G.jsx)($,{specs:n.params,base:J(e.id,`params`),values:e.params})]})}case`particles`:return(0,G.jsx)(J_,{title:t(`kinds.particles`),id:`particles`,children:(0,G.jsx)($,{specs:_g,base:a,values:i})});case`svg`:return(0,G.jsxs)(J_,{title:t(`kinds.svg`),id:`svg`,children:[(0,G.jsx)(Z,{label:`SVG`,align:`start`,children:(0,G.jsx)(K_,{multiline:!0,mono:!0,value:e.src,onCommit:t=>r(J(e.id,`src`),t),ariaLabel:`SVG`})}),(0,G.jsx)($,{specs:vg.map(t=>t.name===`keepColors`?{...t,default:!e.material}:t),base:a,values:i})]});case`photo`:return(0,G.jsx)(BS,{object:e});default:return null}}function GS({object:e}){let{t}=U(),n=Ob(),r=J(e.id,``),i=e,a=e.outline,o=e.reveal;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J_,{title:t(`kinds.text`),id:`text`,children:[(0,G.jsx)(Z,{label:t(`inspector.text`),align:`start`,children:(0,G.jsx)(K_,{multiline:!0,value:e.text,onCommit:t=>n(J(e.id,`text`),t),ariaLabel:t(`inspector.text`)})}),(0,G.jsx)(Z,{label:t(`inspector.font`),overridden:e.font!==void 0,onReset:()=>n(J(e.id,`font`),void 0),children:(0,G.jsx)(SS,{value:e.font??`sans-bold`,onChange:t=>n(J(e.id,`font`),t===`sans-bold`?void 0:t)})}),(0,G.jsx)($,{specs:fg,base:r,values:i,skip:[`font`,`splitLetters`]})]}),(0,G.jsx)(J_,{title:t(`inspector.outline`),id:`text-outline`,defaultOpen:!!a,actions:(0,G.jsx)(q_,{checked:!!a,onChange:t=>n(J(e.id,`outline`),t?!0:void 0),ariaLabel:t(`inspector.outline`)}),children:a?(0,G.jsx)(Ab,{specs:pg,path:J(e.id,`outline`),value:a,collapse:e=>!Object.keys(e).length||e}):(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`inspector.outlineHint`)})}),(0,G.jsx)(J_,{title:t(`inspector.reveal`),id:`text-reveal`,defaultOpen:!!o,actions:(0,G.jsx)(q_,{checked:!!o,onChange:t=>n(J(e.id,`reveal`),t?{effect:`rise`}:void 0),ariaLabel:t(`inspector.reveal`)}),children:o?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{specs:mg,base:J(e.id,`reveal`),values:o}),(0,G.jsx)(Z,{label:t(`inspector.ease`),overridden:o.ease!==void 0,onReset:()=>n(J(e.id,`reveal.ease`),void 0),children:(0,G.jsx)(wy,{value:o.ease,placeholder:o.effect===`scale`||o.effect===`spin`?`outBack`:`outCubic`,onChange:t=>n(J(e.id,`reveal.ease`),t)})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:xb(`splitLetters`),hint:fg.find(e=>e.name===`splitLetters`)?.description,children:(0,G.jsx)(q_,{checked:!!e.splitLetters,onChange:t=>n(J(e.id,`splitLetters`),t||void 0),ariaLabel:xb(`splitLetters`)})}),(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`inspector.revealHint`)})]})})]})}function KS({object:e}){let{t}=U(),n=Ob(),[r,i]=(0,O.useState)(!1),a=e.material??{},o=J(e.id,`material`),c=a.preset?y(a.preset):void 0,l=e=>e.map(e=>c&&c.props[e.name]!==void 0?{...e,default:c.props[e.name]}:e),u=a.type===`shader`&&a.shader?v(`shaders`,a.shader):void 0,d=a.type??c?.props.type??`standard`,f={...c?.props??{},...a},p=d===`physical`,m=d!==`shader`&&d!==`normal`,h=Ro.filter(e=>a[e]!==void 0||r),g=Ro.some(e=>f[e]!==void 0);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J_,{title:t(`inspector.material`),id:`material`,children:[(0,G.jsx)(Z,{label:t(`inspector.preset`),children:(0,G.jsx)(PS,{value:a.preset,onChange:e=>n(`${o}.preset`,e)})}),c&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:c.description}),(0,G.jsx)(Db,{spec:c?.props.type?{...Ag,default:c.props.type}:Ag,value:a.type,onChange:e=>n(`${o}.type`,e)}),a.type===`shader`&&(0,G.jsx)(Z,{label:t(`inspector.shader`),children:(0,G.jsx)(X,{value:a.shader??``,placeholder:`—`,options:s.map(e=>({value:e.id,label:Cb(e.id)})),onChange:e=>n(`${o}.shader`,e||void 0),ariaLabel:t(`inspector.shader`)})}),u&&(0,G.jsx)($,{specs:u.params,base:`${o}.uniforms`,values:a.uniforms}),a.type!==`shader`&&(0,G.jsx)($,{specs:l(Tg),base:o,values:a}),d===`gradient`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Db,{spec:{name:`gradient`,type:`colors`,description:`Vertical colour ramp.`,default:c?.props.gradient??[`#ff7eb3`,`#7afcff`]},value:a.gradient,onChange:e=>n(`${o}.gradient`,e)}),(0,G.jsx)(Db,{spec:{name:`gradientEmissive`,type:`boolean`,description:`The ramp drives the emissive glow too.`,default:c?.props.gradientEmissive??!1},value:a.gradientEmissive,onChange:e=>n(`${o}.gradientEmissive`,e)})]}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`mx-3 mt-1 text-2xs text-fg-faint hover:text-fg`,children:t(r?`inspector.lessOptions`:`inspector.moreOptions`)}),r&&(0,G.jsx)($,{specs:l(Eg),base:o,values:a})]}),m&&(p||r)&&(0,G.jsxs)(J_,{title:t(`inspector.physicalLayers`),id:`material-physical`,defaultOpen:p,children:[!p&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs text-fg-faint`,children:t(`inspector.physicalHint`)}),Dg.map(e=>{let n=e.specs.some(e=>typeof f[e.name]==`number`&&f[e.name]>0&&e.default===0);return(0,G.jsx)(qS,{title:t(`matgroup.${e.id}`),active:n,specs:l(e.specs),base:o,values:a},e.id)})]}),m&&(0,G.jsxs)(J_,{title:t(`inspector.textures`),id:`material-textures`,defaultOpen:g,children:[(r?Ro:h.length?h:[`map`,`normalMap`,`roughnessMap`]).map(e=>{let r=Og[e],i=c?.props[e];return(0,G.jsxs)(`div`,{className:`px-1`,children:[(0,G.jsx)(LS,{slot:e,value:a[e],path:`${o}.${e}`,onChange:t=>n(`${o}.${e}`,t)}),a[e]===void 0&&i!==void 0&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs text-fg-faint`,children:t(`inspector.fromPreset`,{v:typeof i==`string`?i:`procedural ${i.procedural}`})}),r&&f[e]!==void 0&&(0,G.jsx)(Db,{spec:l([r])[0],value:a[r.name],onChange:(e,t)=>n(`${o}.${r.name}`,e,t)})]},e)}),g&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{specs:l(kg),base:o,values:a}),(0,G.jsxs)(Z,{label:xb(`triplanar`),hint:t(`inspector.triplanarHint`),overridden:a.triplanar!==void 0,onReset:()=>n(`${o}.triplanar`,void 0),children:[(0,G.jsx)(q_,{checked:!!(a.triplanar??c?.props.triplanar),onChange:e=>n(`${o}.triplanar`,e?typeof c?.props.triplanar!=`number`||c.props.triplanar:!c?.props.triplanar&&void 0),ariaLabel:xb(`triplanar`)}),typeof(a.triplanar??c?.props.triplanar)==`number`&&(0,G.jsx)(hy,{value:Number(a.triplanar??c?.props.triplanar),min:.01,onChange:(e,t)=>n(`${o}.triplanar`,e,t),className:`w-[60px] flex-none`,ariaLabel:t(`ui.triplanarScale`)})]})]}),!r&&(0,G.jsx)(`div`,{className:`px-3 pt-1 text-2xs text-fg-faint`,children:t(`inspector.moreSlots`)})]})]})}function qS({title:e,active:t,specs:n,base:r,values:i}){let[a,o]=(0,O.useState)(t),s=n.some(e=>i[e.name]!==void 0);return(0,G.jsxs)(`div`,{className:`mx-2 mb-1 rounded-md border border-line/70`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex h-6 w-full items-center gap-1.5 px-2 text-left text-2xs font-medium text-fg-muted hover:text-fg`,children:[(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 rounded-full`,t||s?`bg-accent`:`bg-ink-4`)}),(0,G.jsx)(`span`,{className:`flex-1`,children:e}),(0,G.jsx)(`span`,{className:`text-fg-faint`,children:a?`−`:`+`})]}),a&&(0,G.jsx)(`div`,{className:`pb-1`,children:(0,G.jsx)($,{specs:n,base:r,values:i})})]})}function JS({object:e,pathBase:t}){let{t:n}=U(),{edit:r}=Q();ev();let i=e.behaviours??[],a=t??J(e.id,`behaviours`);return(0,G.jsxs)(J_,{title:(0,G.jsxs)(`span`,{children:[n(`inspector.behaviours`),` `,i.length>0&&(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:i.length})]}),id:`behaviours`,actions:(0,G.jsx)(pS,{placeholder:n(`inspector.searchBehaviours`),items:g.map(e=>({id:e.id,label:Cb(e.id),hint:e.description})),onPick:t=>{let n=v(`behaviours`,t);e.id?r([{op:`addBehaviour`,id:e.id,behaviour:E_(n)}]):r([{op:`set`,path:`${a}[${i.length}]`,value:E_(n)}])},trigger:e=>(0,G.jsx)(Y,{label:n(`inspector.addBehaviour`),onClick:e,className:`h-6 w-6`,children:(0,G.jsx)(lr,{size:13})})}),children:[!i.length&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:n(`inspector.noBehaviours`)}),(0,G.jsx)(`div`,{className:`space-y-1.5 px-2`,children:i.map((e,t)=>(0,G.jsx)(YS,{behaviour:e,path:`${a}[${t}]`,onRemove:()=>r([{op:`remove`,path:`${a}[${t}]`}])},`${e.type}-${t}`))})]})}function YS({behaviour:e,path:t,onRemove:n}){let{t:r}=U(),i=Ob(),a=v(`behaviours`,e.type),[o,s]=(0,O.useState)(!0);return(0,G.jsxs)(`div`,{className:`rounded-md border border-line bg-ink-0/40`,children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-1 pl-2 pr-1`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`min-w-0 flex-1 truncate text-left text-xs font-medium`,title:a?.description,children:Cb(e.type)}),(0,G.jsx)(`select`,{value:e.when??`always`,onChange:e=>i(`${t}.when`,e.target.value===`always`?void 0:e.target.value),"aria-label":r(`inspector.when`),className:`h-5 rounded bg-transparent px-1 text-2xs text-fg-muted outline-none hover:bg-ink-3`,children:Vo.map(e=>(0,G.jsx)(`option`,{value:e,children:r(`when.${e}`)},e))}),(0,G.jsx)(Y,{label:r(`inspector.removeBehaviour`),onClick:n,className:`h-5 w-5`,children:(0,G.jsx)(Fi,{size:11})})]}),o&&a&&(0,G.jsxs)(`div`,{className:`pb-1.5`,children:[(0,G.jsx)($,{specs:a.params,base:t,values:e}),(0,G.jsx)(Db,{spec:{name:`delay`,type:`number`,description:`Seconds before it starts.`,default:0,min:0},value:e.delay,onChange:(e,n)=>i(`${t}.delay`,e,n)})]}),!a&&(0,G.jsx)(`div`,{className:`px-2 pb-1.5 text-2xs text-danger`,children:r(`inspector.unknownBehaviour`)})]})}function XS({object:e}){let{t}=U(),n=Ob(),r=J(e.id,`body`),i=e.body,a=i,o=i?.shape??`box`,s=jg.filter(e=>e.name===`size`?o===`box`:e.name===`radius`?o===`sphere`||o===`cylinder`||o===`capsule`:e.name!==`height`||o===`cylinder`||o===`capsule`),c=i?.type===`dynamic`,l=Object.keys(ev().scene?.physics?.materials??{}),u=Mg.map(e=>e.name===`material`&&l.length?{...e,type:`enum`,options:[``,...l],default:``}:e);return(0,G.jsx)(J_,{title:t(`inspector.physics`),id:`body`,defaultOpen:!!i,children:i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{specs:s,base:r,values:a}),o===`compound`&&(0,G.jsx)(ZS,{list:i.shapes??[],path:`${r}.shapes`}),(o===`trimesh`||o===`heightfield`)&&c&&(0,G.jsx)(`div`,{className:`mx-3 my-1 rounded bg-danger/10 px-2 py-1 text-2xs text-danger`,children:t(`inspector.staticOnlyShape`)}),(0,G.jsx)(`div`,{className:`mx-3 mb-1 mt-1.5 text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:t(`inspector.bodyMotion`)}),(0,G.jsx)($,{specs:u.filter(e=>c||![`mass`,`linearDamping`,`angularDamping`,`gravityScale`,`velocity`,`angularVelocity`].includes(e.name)||a?.[e.name]!==void 0),base:r,values:a}),(0,G.jsx)($,{specs:Ng,base:r,values:a}),(0,G.jsx)(Z,{label:xb(`collidesWith`),hint:t(`inspector.collidesWithHint`),overridden:i.collidesWith!==void 0,onReset:()=>n(`${r}.collidesWith`,void 0),children:(0,G.jsx)(K_,{value:(i.collidesWith??[]).join(`, `),placeholder:t(`inspector.allLayers`),onCommit:e=>n(`${r}.collidesWith`,e.trim()?e.split(/[\s,]+/).filter(Boolean):void 0),ariaLabel:xb(`collidesWith`)})}),(0,G.jsx)(`div`,{className:`px-3 pt-1`,children:(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,onClick:()=>n(r,void 0),children:[(0,G.jsx)(li,{size:11}),` `,t(`inspector.removeBody`)]})})]}):(0,G.jsxs)(`div`,{className:`flex gap-1 px-3`,children:[(0,G.jsxs)(G_,{size:`xs`,onClick:()=>n(r,{type:`static`}),children:[(0,G.jsx)(lr,{size:11}),` `,t(`inspector.addStaticBody`)]}),(0,G.jsxs)(G_,{size:`xs`,onClick:()=>n(r,{type:`dynamic`,mass:1}),children:[(0,G.jsx)(lr,{size:11}),` `,t(`inspector.addDynamicBody`)]})]})})}function ZS({list:e,path:t}){let{t:n}=U(),{edit:r}=Q();return(0,G.jsxs)(`div`,{className:`space-y-1 px-2 py-1`,children:[e.map((e,i)=>{let a=Pg.filter(t=>t.name===`size`?e.shape===`box`:t.name===`radius`?e.shape!==`box`:t.name!==`height`||e.shape===`cylinder`||e.shape===`capsule`);return(0,G.jsxs)(`div`,{className:`rounded-md border border-line bg-ink-0/40 pb-1`,children:[(0,G.jsxs)(`div`,{className:`flex h-6 items-center gap-1 pl-2 pr-1 text-2xs text-fg-muted`,children:[(0,G.jsx)(`span`,{className:`flex-1`,children:n(`inspector.collider`,{n:i+1})}),(0,G.jsx)(Y,{label:n(`inspector.removeCollider`),className:`h-5 w-5`,onClick:()=>r([{op:`remove`,path:`${t}[${i}]`}]),children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsx)($,{specs:a,base:`${t}[${i}]`,values:e})]},i)}),(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,onClick:()=>r([{op:`set`,path:`${t}[${e.length}]`,value:{shape:`box`,size:[1,1,1]}}]),children:[(0,G.jsx)(lr,{size:11}),` `,n(`inspector.addCollider`)]})]})}function QS(){let{library:e}=Q();return(0,O.useMemo)(()=>{let t=new Set(e.assets.map(e=>e.id));return e.assets.filter(e=>e.kind===`hdri`&&/\.(hdr|exr)$/i.test(e.id)).map(e=>{let n=e.id.replace(/\.(hdr|exr)$/i,`.jpg`);return{id:e.id,ref:`library:${e.id}`,name:e.id.replace(/^hdri\//,``).replace(/\.\w+$/,``),preview:t.has(n)?n:null,description:e.description,tags:e.tags??[]}})},[e])}function $S({value:e,onChange:t}){let{t:n}=U(),r=Px(),i=QS(),a=i.find(t=>t.ref===e||t.ref.replace(/\.hdr$/,``)===e);return(0,G.jsx)(by,{width:320,trigger:(t,n)=>(0,G.jsxs)(xy,{onClick:t,open:n,ariaLabel:`HDRI`,children:[a?.preview&&r?(0,G.jsx)(`img`,{src:Fx(r,a.preview),alt:``,className:`h-4 w-7 shrink-0 rounded-sm object-cover`}):(0,G.jsx)(zn,{size:12,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:`truncate`,children:a?.name??e.split(`/`).pop()})]}),children:o=>(0,G.jsxs)(`div`,{className:`space-y-2 p-2`,children:[(0,G.jsx)(`div`,{className:`grid grid-cols-3 gap-1.5`,children:i.map(e=>(0,G.jsxs)(`button`,{type:`button`,title:e.description,"aria-pressed":a?.id===e.id,onClick:()=>{t(e.ref),o()},className:W(`group relative overflow-hidden rounded-md text-left ring-1`,a?.id===e.id?`ring-accent`:`ring-line hover:ring-fg-faint`),children:[e.preview&&r?(0,G.jsx)(`img`,{src:Fx(r,e.preview),alt:``,loading:`lazy`,className:`block aspect-[2/1] w-full object-cover`}):(0,G.jsx)(`div`,{className:`aspect-[2/1] w-full bg-ink-3`}),(0,G.jsx)(`span`,{className:`absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/80 to-transparent px-1.5 pb-0.5 pt-2 text-[10px] text-white`,children:e.name}),a?.id===e.id&&(0,G.jsx)(Pe,{size:11,className:`absolute right-1 top-1 text-white drop-shadow`})]},e.id))}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-2xs text-fg-faint`,children:n(`env.hdriPath`)}),(0,G.jsx)(K_,{value:e,onCommit:e=>e.trim()&&t(e.trim()),mono:!0,ariaLabel:n(`env.hdriPath`)})]})]})})}var eC=e=>e,tC=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function nC(e){return e===`transparent`?`transparent`:typeof e==`string`?`color`:`gradient`in e?`gradient`:`radial`in e?`radial`:`meshGradient`in e?`meshGradient`:`sky`in e?e.sky.physical||e.sky.preset?`physicalSky`:`sky`:`hdri`}var rC={color:`#15171c`,gradient:{gradient:[`#141e30`,`#243b55`],angle:0},radial:{radial:[`#2b3350`,`#0d0f16`]},meshGradient:{meshGradient:[`#ff6ec4`,`#7873f5`,`#4adede`,`#ffd86f`],speed:.2},sky:{sky:{top:`#3a7bd5`,horizon:`#f6d5a8`,bottom:`#d1d7e0`}},physicalSky:{sky:{preset:`golden-hour`}},hdri:{hdri:`library:hdri/studio.hdr`,blur:.5},transparent:`transparent`},iC={sunrise:[`#f8b878`,`#8fb6e8`],morning:[`#dfeaf5`,`#6fa3dc`],noon:[`#cfe6ff`,`#3d82d6`],afternoon:[`#f3e2c4`,`#5b93d1`],"golden-hour":[`#ffb56b`,`#6e8fc9`],sunset:[`#ff7a45`,`#4b4f8f`],dusk:[`#b26a8a`,`#1f2550`]};function aC({scene:e}){let{t}=U(),n=Ob(),r=e.environment??{background:`#000000`},i=r.background,a=nC(i),o=`environment.background`,s=tC(i)&&`sky`in i?i.sky:{};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J_,{title:t(`scene.environment`),id:`environment`,children:[(0,G.jsx)(Z,{label:t(`scene.background`),children:(0,G.jsx)(X,{value:a,options:Object.keys(rC).map(e=>({value:e,label:t(`bg.${e}`)})),onChange:e=>n(o,rC[e]),ariaLabel:t(`scene.background`)})}),a===`color`&&(0,G.jsx)(Z,{label:t(`scene.color`),children:(0,G.jsx)(Ny,{value:i,onChange:(e,t)=>n(o,e,t)})}),(a===`gradient`||a===`radial`||a===`meshGradient`)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:t(`scene.colors`),children:(0,G.jsx)(Py,{value:eC(i)?.[a]??[],onChange:(e,t)=>n(`${o}.${a}`,e,t)})}),a===`gradient`&&(0,G.jsx)($,{specs:[{name:`angle`,type:`number`,description:`Degrees, 0 = bottom → top.`,default:0,min:-180,max:180},{name:`grain`,type:`number`,description:`Film grain.`,default:0,min:0,max:1}],base:o,values:eC(i)}),a===`radial`&&(0,G.jsx)($,{specs:[{name:`center`,type:`vec2`,description:`0..1 (default centre).`,default:[.5,.5]},{name:`radius`,type:`number`,description:``,default:1,min:.05,max:3},{name:`grain`,type:`number`,description:`Film grain.`,default:0,min:0,max:1}],base:o,values:eC(i)}),a===`meshGradient`&&(0,G.jsx)($,{specs:Jg,base:o,values:eC(i)})]}),a===`sky`&&(0,G.jsx)($,{specs:Ug,base:`${o}.sky`,values:eC(s)}),a===`physicalSky`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`grid grid-cols-4 gap-1 px-3 py-1`,role:`radiogroup`,"aria-label":t(`env.skyPreset`),children:Lo.map(e=>{let[t,r]=iC[e]??[`#888`,`#444`],i=s.preset===e;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":i,title:Cb(e),onClick:()=>n(`${o}.sky.preset`,e),className:W(`overflow-hidden rounded-md text-left ring-1 transition`,i?`ring-accent`:`ring-line hover:ring-fg-faint`),children:[(0,G.jsx)(`span`,{className:`block h-6 w-full`,style:{background:`linear-gradient(0deg, ${t}, ${r})`}}),(0,G.jsx)(`span`,{className:W(`block truncate px-1 py-0.5 text-[10px]`,i?`text-accent`:`text-fg-muted`),children:Cb(e)})]},e)})}),(0,G.jsx)(`div`,{className:`mx-3 mb-0.5 mt-1.5 text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:t(`env.sun`)}),s.sun===!1?(0,G.jsx)(Z,{label:t(`env.sun`),children:(0,G.jsx)(q_,{checked:!1,onChange:()=>n(`${o}.sky.sun`,void 0),ariaLabel:t(`env.sun`)})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ab,{specs:Gg,path:`${o}.sky.sun`,value:s.sun,collapse:e=>Object.keys(e).length?e:void 0}),(0,G.jsx)(Z,{label:t(`env.noSun`),children:(0,G.jsx)(q_,{checked:!1,onChange:()=>n(`${o}.sky.sun`,!1),ariaLabel:t(`env.noSun`)})})]}),(0,G.jsx)(`div`,{className:`mx-3 mb-0.5 mt-1.5 text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:t(`env.atmosphere`)}),(0,G.jsx)($,{specs:Wg,base:`${o}.sky`,values:eC(s),skip:[`preset`]})]}),a===`hdri`&&tC(i)&&`hdri`in i&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:`HDRI`,children:(0,G.jsx)($S,{value:i.hdri,onChange:e=>n(`${o}.hdri`,e)})}),(0,G.jsx)($,{specs:Kg,base:o,values:eC(i)}),(0,G.jsx)(Z,{label:t(`env.groundProjection`),hint:t(`env.groundProjectionHint`),children:(0,G.jsx)(q_,{checked:!!i.groundProjection,onChange:e=>n(`${o}.groundProjection`,e||void 0),ariaLabel:t(`env.groundProjection`)})}),i.groundProjection&&(0,G.jsx)(Ab,{specs:qg,path:`${o}.groundProjection`,value:i.groundProjection,collapse:e=>!Object.keys(e).length||e})]})]}),(0,G.jsx)(oC,{env:r}),(0,G.jsx)(sC,{env:r}),(0,G.jsx)(cC,{env:r})]})}function oC({env:e}){let{t}=U(),n=Ob(),r=tC(e.lighting)?`hdri`:e.lighting??`none`,i=e.rig,a=typeof i==`string`?i:i?.preset,o=a?v(`lightRigs`,a):void 0;return(0,G.jsxs)(J_,{title:t(`env.lighting`),id:`env-lighting`,children:[(0,G.jsx)(Z,{label:t(`scene.lighting`),hint:t(`scene.lightingHint`),children:(0,G.jsx)(X,{value:r,options:[...Io.map(e=>({value:e,label:t(`lighting.${e}`)})),{value:`hdri`,label:t(`lighting.hdri`)}],onChange:e=>n(`environment.lighting`,e===`hdri`?{hdri:`library:hdri/studio.hdr`}:e),ariaLabel:t(`scene.lighting`)})}),tC(e.lighting)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:`HDRI`,children:(0,G.jsx)($S,{value:e.lighting.hdri,onChange:e=>n(`environment.lighting.hdri`,e)})}),(0,G.jsx)($,{specs:$g,base:`environment.lighting`,values:eC(e.lighting)})]}),(0,G.jsx)(Z,{label:t(`env.lightingIntensity`),hint:t(`scene.lightingHint`),overridden:e.lightingIntensity!==void 0,onReset:()=>n(`environment.lightingIntensity`,void 0),children:(0,G.jsx)(vy,{value:e.lightingIntensity??1,min:0,max:4,placeholder:e.lightingIntensity===void 0,onChange:(e,t)=>n(`environment.lightingIntensity`,e===1?void 0:e,t),ariaLabel:t(`scene.intensity`)})}),(0,G.jsx)(Z,{label:t(`env.rig`),hint:t(`env.rigHint`),children:(0,G.jsx)(X,{value:a??``,placeholder:t(`scene.none`),options:h.map(e=>({value:e.id,label:Cb(e.id)})),onChange:e=>n(`environment.rig`,e?tC(i)?{...i,preset:e}:e:void 0),ariaLabel:t(`env.rig`)})}),o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:o.description}),(0,G.jsx)(Ab,{specs:o.params,path:`environment.rig`,value:i,expand:e=>({preset:e}),collapse:e=>Object.keys(e).length===1?e.preset:e})]})]})}function sC({env:e}){let{t}=U(),n=Ob(),r=e.contactShadows;return(0,G.jsxs)(J_,{title:t(`env.shadows`),id:`env-shadows`,defaultOpen:!!r||!!e.shadows,children:[(0,G.jsx)(Z,{label:t(`env.contactShadows`),hint:t(`env.contactShadowsHint`),children:(0,G.jsx)(q_,{checked:!!r,onChange:e=>n(`environment.contactShadows`,e||void 0),ariaLabel:t(`env.contactShadows`)})}),r&&(0,G.jsx)(Ab,{specs:Yg,path:`environment.contactShadows`,value:r,collapse:e=>!Object.keys(e).length||e}),(0,G.jsx)(Z,{label:t(`env.shadowQuality`),hint:t(`env.shadowQualityHint`),children:(0,G.jsx)(q_,{checked:!!e.shadows,onChange:e=>n(`environment.shadows`,e?{type:`vsm`,softness:4}:void 0),ariaLabel:t(`env.shadowQuality`)})}),e.shadows&&(0,G.jsx)($,{specs:Xg,base:`environment.shadows`,values:eC(e.shadows)})]})}function cC({env:e}){let{t}=U(),n=Ob(),r=e.fog,i=r?`density`in r?`height`in r&&r.height!==void 0?`height`:`exp`:`linear`:`off`;return(0,G.jsxs)(J_,{title:t(`env.atmosphereGround`),id:`env-fog`,defaultOpen:!!r||!!e.ground,children:[(0,G.jsx)(Z,{label:t(`scene.fog`),children:(0,G.jsx)(X,{value:i,options:[{value:`off`,label:t(`scene.off`)},{value:`linear`,label:t(`scene.fogLinear`)},{value:`exp`,label:t(`scene.fogDensity`)},{value:`height`,label:t(`env.fogHeight`)}],onChange:e=>n(`environment.fog`,e===`off`?void 0:e===`linear`?{color:r?.color??`#a0b4c8`,near:10,far:40}:e===`exp`?{color:r?.color??`#a0b4c8`,density:.03}:{color:r?.color??`#c8d2dc`,density:.06,height:.5,falloff:.6}),ariaLabel:t(`scene.fog`)})}),r&&(0,G.jsx)($,{specs:`density`in r?Qg.filter(e=>i===`height`||e.name!==`height`&&e.name!==`falloff`):Zg,base:`environment.fog`,values:eC(r)}),(0,G.jsx)(Z,{label:t(`scene.ground`),children:(0,G.jsx)(q_,{checked:!!e.ground,onChange:e=>n(`environment.ground`,e?{y:0,shadowOnly:!0}:void 0),ariaLabel:t(`scene.ground`)})}),e.ground&&(0,G.jsx)($,{specs:e_,base:`environment.ground`,values:eC(e.ground)})]})}var lC=e=>e,uC={axis:[`hinge`],distance:[`distance`],restLength:[`spring`],stiffness:[`spring`],damping:[`spring`]};function dC({scene:e}){let{t}=U(),n=Ob(),{edit:r}=Q(),i=e.physics,a=[];Pc(e.objects,e=>void(e.body&&a.push(e.id)));let o=i?.joints??[],s=i?.materials??{};return(0,G.jsx)(J_,{title:t(`scene.physics`),id:`physics`,defaultOpen:!!i,children:i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{specs:t_,base:`physics`,values:lC(i)}),(0,G.jsx)(Z,{label:t(`physics.layers`),hint:t(`physics.layersHint`),overridden:i.layers!==void 0,onReset:()=>n(`physics.layers`,void 0),children:(0,G.jsx)(K_,{value:(i.layers??[]).join(`, `),placeholder:`default, player, enemies`,onCommit:e=>n(`physics.layers`,e.trim()?e.split(/[\s,]+/).filter(Boolean):void 0),ariaLabel:t(`physics.layers`)})}),(0,G.jsxs)(`div`,{className:`mx-3 mb-0.5 mt-2 flex items-center text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:[(0,G.jsx)(`span`,{className:`flex-1`,children:t(`physics.materials`)}),(0,G.jsx)(Y,{label:t(`physics.addMaterial`),className:`h-5 w-5`,onClick:()=>{let e=1;for(;s[`surface${e}`];)e++;n(`physics.materials`,{...s,[`surface${e}`]:{friction:.5,restitution:0}})},children:(0,G.jsx)(lr,{size:11})})]}),Object.entries(s).map(([e,t])=>(0,G.jsx)(fC,{name:e,m:t,onRename:t=>t&&t!==e&&!s[t]&&n(`physics.materials`,Object.fromEntries(Object.entries(s).map(([n,r])=>[n===e?t:n,r]))),onRemove:()=>{let t={...s};delete t[e],n(`physics.materials`,Object.keys(t).length?t:void 0)}},e)),!Object.keys(s).length&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`physics.noMaterials`)}),(i.contacts!==void 0||Object.keys(s).length>1)&&(0,G.jsx)(Z,{label:t(`physics.contacts`),hint:t(`physics.contactsHint`),align:`start`,children:(0,G.jsx)(Eb,{value:i.contacts??[],rows:2,onCommit:e=>n(`physics.contacts`,Array.isArray(e)&&e.length?e:void 0)})}),(0,G.jsxs)(`div`,{className:`mx-3 mb-0.5 mt-2 flex items-center text-2xs font-medium uppercase tracking-wide text-fg-faint`,children:[(0,G.jsxs)(`span`,{className:`flex-1`,children:[t(`physics.joints`),` `,o.length>0&&(0,G.jsx)(`span`,{className:`font-normal`,children:o.length})]}),(0,G.jsx)(Y,{label:t(`physics.addJoint`),className:`h-5 w-5`,disabled:!a.length,onClick:()=>r([{op:`set`,path:`physics.joints[${o.length}]`,value:{type:`hinge`,a:a[0],...a[1]?{b:a[1]}:{}}}]),children:(0,G.jsx)(lr,{size:11})})]}),(0,G.jsx)(`div`,{className:`space-y-1 px-2`,children:o.map((e,t)=>(0,G.jsx)(pC,{joint:e,index:t,bodies:a,onRemove:()=>r(o.length===1?[{op:`remove`,path:`physics.joints`}]:[{op:`remove`,path:`physics.joints[${t}]`}])},t))}),!o.length&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:a.length?t(`physics.noJoints`):t(`physics.noBodies`)}),(0,G.jsx)(`div`,{className:`px-3 pt-2`,children:(0,G.jsxs)(G_,{size:`xs`,variant:`ghost`,onClick:()=>n(`physics`,void 0),children:[(0,G.jsx)(li,{size:11}),` `,t(`scene.disable`)]})})]}):(0,G.jsx)(`div`,{className:`px-3`,children:(0,G.jsxs)(G_,{size:`xs`,onClick:()=>n(`physics`,{gravity:[0,-9.81,0]}),children:[(0,G.jsx)(lr,{size:11}),` `,t(`scene.enablePhysics`)]})})})}function fC({name:e,m:t,onRename:n,onRemove:r}){let{t:i}=U(),a=Ob(),o=`physics.materials.${e}`;return(0,G.jsxs)(`div`,{className:`flex items-center gap-1 px-3 py-[3px]`,children:[(0,G.jsx)(K_,{value:e,onCommit:e=>n(e.trim()),className:`w-[84px] flex-none font-mono text-xs`,ariaLabel:i(`physics.materialName`)}),(0,G.jsx)(hy,{label:`μ`,value:t.friction??.5,min:0,max:2,placeholder:t.friction===void 0,onChange:(e,t)=>a(`${o}.friction`,e,t),ariaLabel:xb(`friction`)}),(0,G.jsx)(hy,{label:`e`,value:t.restitution??0,min:0,max:1,placeholder:t.restitution===void 0,onChange:(e,t)=>a(`${o}.restitution`,e,t),ariaLabel:xb(`restitution`)}),(0,G.jsx)(Y,{label:i(`physics.removeMaterial`),className:`h-5 w-5`,onClick:r,children:(0,G.jsx)(Fi,{size:11})})]})}function pC({joint:e,index:t,bodies:n,onRemove:r}){let{t:i}=U(),a=Ob(),o=`physics.joints[${t}]`,s=Fg.filter(t=>t.name!==`type`&&(!uC[t.name]||uC[t.name].includes(e.type)));return(0,G.jsxs)(`div`,{className:`rounded-md border border-line bg-ink-0/40 pb-1`,children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-1 pl-2 pr-1`,children:[(0,G.jsx)(X,{value:e.type,options:Fg[0].options.map(e=>({value:e,label:Cb(e)})),onChange:e=>a(`${o}.type`,e),className:`w-[92px] flex-none`,ariaLabel:i(`physics.jointType`)}),(0,G.jsxs)(`span`,{className:`flex-1 truncate font-mono text-2xs text-fg-faint`,children:[e.a,` ↔ `,e.b??i(`physics.world`)]}),(0,G.jsx)(Y,{label:i(`physics.removeJoint`),className:`h-5 w-5`,onClick:r,children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsx)(Z,{label:`A`,children:(0,G.jsx)(X,{value:e.a,options:n,onChange:e=>a(`${o}.a`,e),ariaLabel:`a`})}),(0,G.jsx)(Z,{label:`B`,children:(0,G.jsx)(X,{value:e.b??``,placeholder:i(`physics.world`),options:n.filter(t=>t!==e.a),onChange:e=>a(`${o}.b`,e||void 0),ariaLabel:`b`})}),(0,G.jsx)($,{specs:s,base:o,values:lC(e)}),e.type===`hinge`&&(0,G.jsxs)(Z,{label:i(`physics.motor`),hint:i(`physics.motorHint`),overridden:e.motor!==void 0,onReset:()=>a(`${o}.motor`,void 0),children:[(0,G.jsx)(hy,{label:`°/s`,value:e.motor?.speed??0,placeholder:!e.motor,onChange:(t,n)=>a(`${o}.motor`,t?{...e.motor??{},speed:t}:void 0,n),ariaLabel:i(`physics.motor`)}),(0,G.jsx)(hy,{label:`F`,value:e.motor?.maxForce??1e6,min:0,placeholder:e.motor?.maxForce===void 0,onChange:(t,n)=>e.motor&&a(`${o}.motor.maxForce`,t,n),ariaLabel:xb(`maxForce`)})]})]})}function mC(e){let t=e.findIndex(e=>e.type===`look`);if(t<0)return null;let n=e[t];return{index:t,preset:typeof n.preset==`string`?n.preset:void 0,intensity:typeof n.intensity==`number`?n.intensity:void 0}}function hC(e,t){let n=mC(e),r=e.filter(e=>e.type!==`look`);return t?[{type:`look`,preset:t,...n?.intensity===void 0?{}:{intensity:n.intensity}},...r]:r}function gC(e,t,n){if(t===n||t<0||t>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return r.splice(Math.max(0,Math.min(r.length,n)),0,i),r}function _C(e,t){return e.filter((e,n)=>n!==t)}function vC(e,t){return[...e,{type:t}]}var yC={low:`bg-agent/15 text-agent`,medium:`bg-warn/15 text-warn`,high:`bg-danger/15 text-danger`};function bC({scene:e}){let{t}=U(),{edit:n}=Q(),r=Ob(),i=e.postfx??[],o=mC(i),s=e=>n(e.length?[{op:`set`,path:`postfx`,value:e}]:i.length?[{op:`remove`,path:`postfx`}]:[]),c=qa(i),[l,d]=(0,O.useState)(null),[f,m]=(0,O.useState)(null),h=i.map((e,t)=>({fx:e,i:t})).filter(e=>e.fx.type!==`look`);return(0,G.jsxs)(J_,{title:(0,G.jsxs)(`span`,{children:[t(`scene.postfx`),` `,h.length>0&&(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:h.length})]}),id:`postfx`,defaultOpen:i.length>0,actions:(0,G.jsx)(pS,{placeholder:t(`scene.searchEffects`),items:a.filter(e=>e.id!==`look`).map(e=>({id:e.id,label:Cb(e.id),hint:e.description})),onPick:e=>s(vC(i,e)),trigger:e=>(0,G.jsx)(Y,{label:t(`scene.addEffect`),onClick:e,className:`h-6 w-6`,children:(0,G.jsx)(lr,{size:13})})}),children:[(0,G.jsx)(Z,{label:t(`postfx.look`),hint:t(`postfx.lookHint`),children:(0,G.jsx)(X,{value:o?.preset??``,placeholder:t(`scene.none`),options:u.map(e=>({value:e,label:Cb(e)})),onChange:e=>s(hC(i,e||null)),ariaLabel:t(`postfx.look`)})}),o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`px-3 pb-1 text-2xs leading-snug text-fg-faint`,children:[p[o.preset]?.description,` `,(0,G.jsx)(`span`,{className:`text-fg-muted`,children:p[o.preset]?.effects.map(e=>e.type).join(` · `)})]}),(0,G.jsx)(Z,{label:t(`scene.intensity`),overridden:o.intensity!==void 0,onReset:()=>r(`postfx[${o.index}].intensity`,void 0),children:(0,G.jsx)(vy,{value:o.intensity??1,min:0,max:1,placeholder:o.intensity===void 0,onChange:(e,t)=>r(`postfx[${o.index}].intensity`,e===1?void 0:e,t),ariaLabel:t(`scene.intensity`)})})]}),(0,G.jsxs)(`div`,{className:`space-y-1 px-2 pt-1`,onDragOver:e=>e.preventDefault(),children:[h.map(({fx:e,i:t})=>(0,G.jsx)(xC,{fx:e,index:t,first:t===h[0]?.i,last:t===h[h.length-1]?.i,dropTarget:f===t&&l!==null&&l!==t,onMove:e=>s(gC(i,t,e)),onRemove:()=>s(_C(i,t)),onDragStart:()=>d(t),onDragEnter:()=>m(t),onDrop:()=>{l!==null&&l!==t&&s(gC(i,l,t)),d(null),m(null)},onDragEnd:()=>{d(null),m(null)}},`${e.type}-${t}`)),!i.length&&(0,G.jsx)(`div`,{className:`px-1 text-2xs text-fg-faint`,children:t(`scene.noEffects`)})]}),i.length>0&&(0,G.jsxs)(`div`,{className:`mx-3 mt-1.5 flex items-center gap-1.5 text-2xs text-fg-faint`,title:t(`postfx.costHint`),children:[(0,G.jsx)(`span`,{className:W(`rounded px-1 font-medium`,c.level===`heavy`?yC.high:c.level===`moderate`?yC.medium:yC.low),children:t(`postfx.level.${c.level}`)}),t(`postfx.passes`,{n:c.passes}),c.dropped.low.length>0&&(0,G.jsxs)(`span`,{className:`truncate`,children:[`· `,t(`postfx.droppedLow`,{list:c.dropped.low.join(`, `)})]})]})]})}function xC(e){let{t}=U(),{fx:n,index:r}=e,i=v(`postfx`,n.type),[a,o]=(0,O.useState)(!0),s=(0,O.useRef)(!1),c=Va(n.type);return(0,G.jsxs)(`div`,{draggable:!0,onDragStart:t=>{if(!s.current)return t.preventDefault();t.dataTransfer.effectAllowed=`move`,e.onDragStart()},onDragEnter:e.onDragEnter,onDrop:e.onDrop,onDragEnd:()=>{s.current=!1,e.onDragEnd()},className:W(`rounded-md border bg-ink-0/40 pb-0.5 transition-colors`,e.dropTarget?`border-accent`:`border-line`),children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-0.5 pl-0.5 pr-1`,children:[(0,G.jsx)(`span`,{onPointerDown:()=>s.current=!0,onPointerUp:()=>s.current=!1,className:`flex h-6 w-4 cursor-grab items-center justify-center text-fg-faint hover:text-fg`,title:t(`postfx.drag`),children:(0,G.jsx)(Xt,{size:12})}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex min-w-0 flex-1 items-center gap-1 text-left text-xs font-medium`,title:i?.description,children:[a?(0,G.jsx)(Ie,{size:11,className:`text-fg-faint`}):(0,G.jsx)(Be,{size:11,className:`text-fg-faint`}),(0,G.jsx)(`span`,{className:`truncate`,children:Cb(n.type)})]}),(0,G.jsx)(`span`,{className:W(`rounded px-1 text-[10px]`,yC[c]),title:t(`postfx.gpuHint`),children:t(`postfx.gpu.${c}`)}),(0,G.jsx)(Y,{label:t(`postfx.up`),className:`h-5 w-5`,disabled:e.first,onClick:()=>e.onMove(r-1),children:(0,G.jsx)(He,{size:11})}),(0,G.jsx)(Y,{label:t(`postfx.down`),className:`h-5 w-5`,disabled:e.last,onClick:()=>e.onMove(r+1),children:(0,G.jsx)(Ie,{size:11})}),(0,G.jsx)(Y,{label:t(`scene.removeEffect`),className:`h-5 w-5`,onClick:e.onRemove,children:(0,G.jsx)(Fi,{size:11})})]}),a&&i&&i.params.length>0&&(0,G.jsx)($,{specs:i.params,base:`postfx[${r}]`,values:n}),a&&i&&!i.params.length&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs text-fg-faint`,children:i.description}),!i&&(0,G.jsx)(`div`,{className:`px-3 pb-1 text-2xs text-danger`,children:t(`postfx.unknown`)})]})}var SC=(e,t,n,r,i)=>({name:e,type:`number`,description:t,default:n,min:r,max:i}),CC=(e,t)=>({name:e,type:`vec3`,description:t}),wC=SC(`fov`,`Field of view to reach (degrees).`,void 0,1,179),TC={dolly:[SC(`distance`,`Units along the view axis (+ = forward).`,void 0),wC],pushIn:[SC(`distance`,`Units closer (default: 25 % of the distance).`,void 0,0),wC],pullOut:[SC(`distance`,`Units back (default: 33 % of the distance).`,void 0,0),wC],truck:[SC(`distance`,`Units sideways (+ = right).`,1),wC],pedestal:[SC(`distance`,`Units up (- = down); the target follows.`,1),wC],crane:[SC(`height`,`Rise (units) while the target stays.`,2),SC(`distance`,`Units toward the target.`,void 0),wC],orbit:[SC(`angle`,`Yaw around the target (degrees).`,90,-720,720),SC(`elevation`,`Elevation change (degrees).`,0,-89,89),SC(`distance`,`Distance change (units).`,void 0),wC],zoom:[{...wC,required:!0}],move:[CC(`position`,`Camera position to reach.`),CC(`target`,`Look-at point to reach.`),wC],path:[SC(`lookAhead`,`Look ahead along the path (0..0.5).`,.05,0,.5),wC],lookAt:[CC(`target`,`Point to pan to (or pick an object).`),wC],focus:[SC(`focus`,`Focus distance (or pick an object).`,void 0,0)]},EC={lookAt:`object`,focus:`object`,path:`lookAt`};function DC(e,t,n){let r=(e.camera.shots??[]).reduce((e,t)=>Math.max(e,(t.at??0)+(t.duration??0)),0),i={type:t,at:Math.round((n??r)*100)/100,duration:2},a=e.camera.position;switch(t){case`zoom`:i.fov=Math.max(10,(e.camera.fov??45)-15);break;case`move`:i.position=[a[0]+2,a[1]+1,a[2]];break;case`path`:i.points=[[a[0]+2,a[1]+.5,a[2]-1],[a[0]+3,a[1]+1,a[2]-3]];break;case`lookAt`:i.target=e.camera.target??[0,0,0];break;case`focus`:i.focus=5}return i}function OC(e){return(e??[]).reduce((e,t)=>Math.max(e,(t.at??0)+(t.duration??0)),0)}var kC=[`#7c8cff`,`#f2b654`,`#4fd1a5`,`#f26d9b`,`#6fc3ff`,`#c39bff`];function AC({scene:e}){let{t}=U(),{edit:n,player:r}=Q(),i=e.camera.shots??[],[a,o]=(0,O.useState)(0);(0,O.useEffect)(()=>r.onTime(o),[r]);let s=Math.max(e.timeline?.duration??0,OC(i),1),c=e=>n(e.length?[{op:`set`,path:`camera.shots`,value:e}]:[{op:`remove`,path:`camera.shots`}]);return(0,G.jsxs)(J_,{title:(0,G.jsxs)(`span`,{children:[t(`shots.title`),` `,i.length>0&&(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:i.length})]}),id:`camera-shots`,defaultOpen:i.length>0,actions:(0,G.jsx)(pS,{placeholder:t(`shots.search`),items:ro.map(e=>({id:e,label:Cb(e),hint:t(`shots.type.${e}`)})),onPick:t=>c([...i,DC(e,t)]),trigger:e=>(0,G.jsx)(Y,{label:t(`shots.add`),onClick:e,className:`h-6 w-6`,children:(0,G.jsx)(lr,{size:13})})}),children:[i.length>0&&(0,G.jsxs)(`div`,{className:`relative mx-3 mb-1.5 h-5 overflow-hidden rounded bg-ink-0`,title:t(`shots.laneHint`),children:[i.map((e,t)=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>void r.seek(e.at),className:`absolute top-0.5 h-4 rounded-sm text-left text-[9px] leading-4 text-ink-0`,style:{left:`${e.at/s*100}%`,width:`${Math.max(1.5,e.duration/s*100)}%`,background:kC[t%kC.length],opacity:.85},children:(0,G.jsx)(`span`,{className:`block truncate px-1`,children:Cb(e.type)})},t)),(0,G.jsx)(`div`,{className:`pointer-events-none absolute bottom-0 top-0 w-px bg-white`,style:{left:`${Math.min(1,a/s)*100}%`}})]}),(0,G.jsx)(`div`,{className:`space-y-1 px-2`,children:i.map((t,n)=>(0,G.jsx)(jC,{scene:e,shot:t,index:n,hue:kC[n%kC.length],time:a,onRemove:()=>c(i.filter((e,t)=>t!==n))},n))}),!i.length&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`shots.empty`)})]})}function jC({scene:e,shot:t,index:n,hue:r,time:i,onRemove:a}){let{t:o}=U(),{player:s}=Q(),c=Ob(),l=`camera.shots[${n}]`,u=EC[t.type],d=Rc(e),f=i>=t.at&&i<=t.at+t.duration,p=t.duration>0?Math.min(1,Math.max(0,(i-t.at)/t.duration)):0,m=typeof t.lookAt==`string`?t.lookAt:``;return(0,G.jsxs)(`div`,{className:W(`rounded-md border bg-ink-0/40 pb-1`,f?`border-accent/50`:`border-line`),children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-1 pl-2 pr-1`,children:[(0,G.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-sm`,style:{background:r}}),(0,G.jsx)(X,{value:t.type,options:ro.map(e=>({value:e,label:Cb(e)})),onChange:n=>c(l,{type:n,at:t.at,duration:t.duration,...t.ease?{ease:t.ease}:{},...MC(e,n)}),className:`w-[96px] flex-none`,ariaLabel:o(`shots.typeLabel`)}),(0,G.jsx)(`span`,{className:`flex-1 truncate text-2xs text-fg-faint`,children:o(`shots.type.${t.type}`)}),(0,G.jsx)(Y,{label:o(`shots.play`),className:`h-5 w-5`,onClick:async()=>{await s.seek(t.at),s.play()},children:(0,G.jsx)(sr,{size:10})}),(0,G.jsx)(Y,{label:o(`shots.remove`),className:`h-5 w-5`,onClick:a,children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsxs)(Z,{label:o(`shots.timing`),children:[(0,G.jsx)(hy,{label:`@`,value:t.at,min:0,step:.05,suffix:`s`,onChange:(e,t)=>c(`${l}.at`,e,t),ariaLabel:o(`shots.at`)}),(0,G.jsx)(hy,{label:`↔`,value:t.duration,min:.05,step:.05,suffix:`s`,onChange:(e,t)=>c(`${l}.duration`,e,t),ariaLabel:o(`shots.duration`)})]}),(0,G.jsx)(Z,{label:o(`inspector.ease`),overridden:t.ease!==void 0,onReset:()=>c(`${l}.ease`,void 0),children:(0,G.jsx)(wy,{value:t.ease,placeholder:`inOutCubic`,onChange:e=>c(`${l}.ease`,e)})}),(0,G.jsx)($,{specs:TC[t.type].map(n=>n.name===`fov`&&t.type!==`zoom`?{...n,default:e.camera.fov??45}:n),base:l,values:t}),u&&(0,G.jsx)(Z,{label:o(`shots.object`),hint:o(`shots.objectHint`),children:(0,G.jsx)(X,{value:u===`object`?t.object??``:m,placeholder:`—`,options:d,onChange:e=>c(`${l}.${u}`,e||void 0),ariaLabel:o(`shots.object`)})}),t.type===`path`&&(0,G.jsx)(Z,{label:o(`shots.points`),align:`start`,children:(0,G.jsx)(Eb,{value:t.points??[],rows:3,onCommit:e=>Array.isArray(e)&&c(`${l}.points`,e)})}),(0,G.jsx)(Z,{label:o(`shots.preview`),hint:o(`shots.previewHint`),children:(0,G.jsx)(`input`,{type:`range`,min:0,max:1,step:.01,value:f?p:0,onChange:e=>void s.seek(t.at+Number(e.target.value)*t.duration),"aria-label":o(`shots.preview`),className:`slider h-5 w-full cursor-pointer appearance-none rounded-full bg-ink-3`})})]})}function MC(e,t){let{type:n,at:r,duration:i,...a}=DC(e,t);return a}var NC=e=>e;function PC(){let{t:e}=U(),t=ev().scene,n=Ob();return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`border-b border-line px-3 py-2.5`,children:[(0,G.jsx)(`div`,{className:`text-sm font-semibold`,children:e(`scene.title`)}),(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:e(`scene.subtitle`)})]}),(0,G.jsx)(J_,{title:e(`scene.meta`),id:`meta`,children:(0,G.jsx)($,{specs:i_,base:``,values:NC(t)})}),(0,G.jsxs)(J_,{title:e(`scene.target`),id:`target`,children:[(0,G.jsx)(Z,{label:e(`scene.kind`),children:(0,G.jsx)(X,{value:t.target.kind,options:Mo,onChange:e=>n(`target`,{...t.target,kind:e,aspect:Wo[e]??t.target.aspect}),ariaLabel:e(`scene.kind`)})}),(0,G.jsx)($,{specs:Rg,base:`target`,values:NC(t.target)})]}),(0,G.jsx)(J_,{title:e(`scene.camera`),id:`camera`,children:(0,G.jsx)($,{specs:zg.filter(e=>t.camera.type===`orthographic`?e.name!==`fov`:e.name!==`zoom`),base:`camera`,values:NC(t.camera)})}),(0,G.jsx)(AC,{scene:t}),(0,G.jsx)(aC,{scene:t}),(0,G.jsx)(FC,{scene:t}),(0,G.jsx)(bC,{scene:t}),(0,G.jsx)(dC,{scene:t}),(0,G.jsx)(LC,{scene:t}),(0,G.jsx)(RC,{scene:t})]})}function FC({scene:e}){let{t}=U(),{edit:n,ui:r}=Q(),i=e.lights??[],a=tv(e=>e.lightSel),o=(0,O.useRef)(new Map);return(0,O.useEffect)(()=>{a&&o.current.get(a.id)?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[a]),(0,G.jsx)(J_,{title:(0,G.jsxs)(`span`,{children:[t(`scene.lights`),` `,(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:i.length})]}),id:`lights`,actions:(0,G.jsx)(pS,{placeholder:t(`scene.lightType`),items:Object.keys(Bg).map(e=>({id:e,label:Cb(e)})),onPick:t=>{let r={id:na(t,b_(e)),type:t,intensity:t===`ambient`||t===`hemisphere`?.6:2,...t===`ambient`||t===`hemisphere`?{}:{position:[3,5,4]}};n([{op:`set`,path:`lights[${i.length}]`,value:r}])},trigger:e=>(0,G.jsx)(Y,{label:t(`scene.addLight`),onClick:e,className:`h-6 w-6`,children:(0,G.jsx)(lr,{size:13})})}),children:(0,G.jsxs)(`div`,{className:`space-y-1.5 px-2`,children:[i.map((e,i)=>{let s=Jx[e.type]??Jx.point,c=e.id?`lights#${e.id}`:`lights[${i}]`,l=e.id??`light${i}`,u=a?.id===l,d=e.type!==`ambient`&&e.type!==`hemisphere`;return(0,G.jsxs)(`div`,{ref:e=>{e?o.current.set(l,e):o.current.delete(l)},className:W(`rounded-md border bg-ink-0/40 pb-1`,u?`border-accent/70`:`border-line`),children:[(0,G.jsxs)(`div`,{className:W(`flex h-7 items-center gap-1.5 pl-2 pr-1`,d&&`cursor-pointer`),onClick:d?()=>r.set({lightSel:u?null:{id:l,part:`position`}}):void 0,children:[(0,G.jsx)(s,{size:12,className:`text-key`}),(0,G.jsx)(`span`,{className:`flex-1 truncate text-xs font-medium`,children:e.id??`${e.type} ${i+1}`}),(0,G.jsx)(`span`,{className:`text-2xs text-fg-faint`,children:e.type}),(0,G.jsx)(Y,{label:t(`scene.removeLight`),className:`h-5 w-5`,onClick:e=>{e.stopPropagation(),n([{op:`remove`,path:`lights[${i}]`}])},children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsx)($,{specs:Bg[e.type]??[],base:c,values:NC(e)}),(0,G.jsx)(IC,{light:e,path:c})]},`${e.id??i}`)}),!i.length&&(0,G.jsx)(`div`,{className:`px-1 text-2xs text-fg-faint`,children:t(`scene.noLights`)})]})})}function IC({light:e,path:t}){let{t:n}=U(),r=Ob(),[i,a]=(0,O.useState)(!!e.shadow),o=e.castShadow&&(e.type===`directional`||e.type===`spot`||e.type===`point`);return(0,G.jsxs)(G.Fragment,{children:[e.type===`spot`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:n(`lights.volumetric`),hint:n(`lights.volumetricHint`),children:(0,G.jsx)(q_,{checked:!!e.volumetric,onChange:e=>r(`${t}.volumetric`,e||void 0),ariaLabel:n(`lights.volumetric`)})}),e.volumetric&&(0,G.jsx)(Ab,{specs:Hg,path:`${t}.volumetric`,value:e.volumetric,collapse:e=>!Object.keys(e).length||e})]}),o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`mx-3 mt-0.5 text-2xs text-fg-faint hover:text-fg`,children:[i?`−`:`+`,` `,n(`lights.shadow`),e.shadow&&(0,G.jsx)(`span`,{className:`ml-1 text-accent`,children:`•`})]}),i&&(0,G.jsx)(Ab,{specs:Vg,path:`${t}.shadow`,value:e.shadow,collapse:e=>Object.keys(e).length?e:void 0})]})]})}function LC({scene:e}){let{t}=U(),n=Ob(),r=e.audio,i=r?.music,a=o.filter(e=>/music|loop|pad/.test(e.description.toLowerCase())||e.id.includes(`loop`)||e.id.includes(`pad`));return(0,G.jsxs)(J_,{title:t(`scene.audio`),id:`audio`,defaultOpen:!!r,children:[(0,G.jsx)(Z,{label:t(`scene.music`),children:(0,G.jsx)(X,{value:i?.preset??``,placeholder:t(`scene.none`),options:a.map(e=>e.id),onChange:e=>n(`audio.music`,e?{preset:e,volume:i?.volume??.5,loop:!0}:void 0),ariaLabel:t(`scene.music`)})}),i&&(0,G.jsx)(Z,{label:t(`scene.volume`),children:(0,G.jsx)(hy,{value:i.volume??1,min:0,max:1,onChange:(e,t)=>n(`audio.music.volume`,e,t),ariaLabel:t(`scene.volume`)})}),(0,G.jsx)(Z,{label:t(`scene.muted`),children:(0,G.jsx)(q_,{checked:r?.muted??!0,onChange:e=>n(`audio.muted`,e),ariaLabel:t(`scene.muted`)})}),r?.sounds&&(0,G.jsx)(`div`,{className:`px-3 text-2xs text-fg-faint`,children:t(`scene.sounds`,{list:Object.keys(r.sounds).join(`, `)})})]})}function RC({scene:e}){let{t}=U(),{edit:n}=Q(),r=e.ui?.elements??[];return(0,G.jsxs)(J_,{title:(0,G.jsxs)(`span`,{children:[t(`scene.hud`),` `,r.length>0&&(0,G.jsx)(`span`,{className:`font-normal text-fg-faint`,children:r.length})]}),id:`ui`,defaultOpen:r.length>0,actions:(0,G.jsx)(Y,{label:t(`scene.addHud`),className:`h-6 w-6`,onClick:()=>{let t=na(`label`,b_(e));n(e.ui?[{op:`set`,path:`ui.elements[${r.length}]`,value:{id:t,type:`text`,text:`Hello`,anchor:`top-left`}}]:[{op:`set`,path:`ui`,value:{elements:[{id:t,type:`text`,text:`Hello`,anchor:`top-left`}]}}])},children:(0,G.jsx)(lr,{size:13})}),children:[e.ui&&(0,G.jsx)($,{specs:n_,base:`ui`,values:NC(e.ui)}),(0,G.jsx)(`div`,{className:`space-y-1.5 px-2 pt-1`,children:r.map((e,r)=>(0,G.jsxs)(`div`,{className:`rounded-md border border-line bg-ink-0/40 pb-1`,children:[(0,G.jsxs)(`div`,{className:`flex h-7 items-center gap-1 pl-2 pr-1`,children:[(0,G.jsx)(`span`,{className:`flex-1 truncate font-mono text-2xs`,children:e.id}),(0,G.jsx)(Y,{label:t(`scene.removeHud`),className:`h-5 w-5`,onClick:()=>n([{op:`remove`,path:`ui.elements[${r}]`}]),children:(0,G.jsx)(Fi,{size:11})})]}),(0,G.jsx)($,{specs:r_,base:`ui.elements[${r}]`,values:NC(e)})]},e.id))})]})}function zC(){let e=ev(),t=e.selection&&e.scene?Nc(e.scene.objects,e.selection):null;return(0,G.jsx)(`aside`,{className:`flex w-[300px] shrink-0 flex-col border-l border-line bg-ink-1`,children:(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden`,children:t?(0,G.jsx)(HS,{object:t.object},t.object.id):(0,G.jsx)(PC,{})})})}var BC=class{persist;snap={scene:null,selection:null,issues:[],save:{state:`saved`},canUndo:!1,canRedo:!1,revision:0,source:`load`};listeners=new Set;past=[];future=[];pendingOps=[];needsFull=!1;timer=null;chain=Promise.resolve();lastCoalesce=null;opts;constructor(e,t={}){this.persist=e,this.opts={debounceMs:300,historyLimit:100,coalesceMs:1e3,now:()=>Date.now(),validate:ks,...t}}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snap;emit(e){this.snap={...this.snap,...e,canUndo:this.past.length>0,canRedo:this.future.length>0},this.listeners.forEach(e=>e())}setScene(e,t,n={}){let r=this.snap.selection&&Nc(e.objects,this.snap.selection)?this.snap.selection:null;this.emit({scene:e,source:t,selection:r,issues:this.opts.validate(e),revision:this.snap.revision+1,...n})}pushHistory(e){this.past.push(e),this.past.length>this.opts.historyLimit&&this.past.shift(),this.future=[]}load(e){this.past=[],this.future=[],this.pendingOps=[],this.needsFull=!1,this.lastCoalesce=null,this.setScene(e,`load`,{save:{state:`saved`}})}select(e){e!==this.snap.selection&&this.emit({selection:e})}edit(e,t={}){let n=this.snap.scene;if(!n||!e.length)return null;let r;try{r=Wm(n,e)}catch(e){return e.message}let i=this.opts.now();t.coalesce&&this.lastCoalesce?.key===t.coalesce&&i-this.lastCoalesce.at<this.opts.coalesceMs||this.pushHistory(n),this.lastCoalesce=t.coalesce?{key:t.coalesce,at:i}:null;for(let t of e)this.queue(t);return this.setScene(r,`edit`,{save:{state:`pending`},...t.select===void 0?{}:{selection:t.select}}),this.schedule(),null}queue(e){let t=this.pendingOps[this.pendingOps.length-1];t&&t.op===`set`&&e.op===`set`&&t.path===e.path||t&&t.op===`addTrack`&&e.op===`addTrack`&&t.track.target===e.track.target?this.pendingOps[this.pendingOps.length-1]=e:this.pendingOps.push(e)}replace(e){let t=this.snap.scene;t&&Vf(t,e)||(t&&this.pushHistory(t),this.lastCoalesce=null,this.needsFull=!0,this.pendingOps=[],this.setScene(e,`replace`,{save:{state:`pending`}}),this.schedule(0))}undo(){let e=this.past.pop();e&&this.snap.scene&&(this.future.push(this.snap.scene),this.historyMove(e))}redo(){let e=this.future.pop();e&&this.snap.scene&&(this.past.push(this.snap.scene),this.historyMove(e))}historyMove(e){this.lastCoalesce=null,this.needsFull=!0,this.pendingOps=[],this.setScene(e,`history`,{save:{state:`pending`}}),this.schedule(0)}external(e){let t=this.snap.scene;if(t&&Vf(t,e))return!1;let n=e;if(this.pendingOps.length&&!this.needsFull)try{n=Wm(e,this.pendingOps)}catch{this.pendingOps=[]}else this.pendingOps=[],this.needsFull=!1;return t&&this.pushHistory(t),this.lastCoalesce=null,this.setScene(n,`external`,{save:this.pendingOps.length?this.snap.save:{state:`saved`}}),!0}schedule(e=this.opts.debounceMs){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=null,this.flush()},e)}get dirty(){return this.needsFull||this.pendingOps.length>0}flush(){return this.timer&&=(clearTimeout(this.timer),null),this.chain=this.chain.then(()=>this.sendOnce()),this.chain}async sendOnce(){let e=this.snap.scene;if(!e||!this.dirty)return;let t=this.needsFull?{kind:`apply`,scene:e}:{kind:`patch`,ops:this.pendingOps};this.pendingOps=[],this.needsFull=!1,this.emit({save:{state:`saving`}});try{let e=await this.persist(t);if(e.status===`refused`){this.needsFull=!0;let t=(e.issues??[]).filter(e=>e.severity===`error`);this.emit({save:{state:`error`,message:t[0]?.message??e.hint,issues:t}})}else this.dirty?this.emit({save:{state:`pending`}}):this.emit({save:{state:`saved`}})}catch(e){this.needsFull=!0,this.emit({save:{state:`error`,message:e.message}})}}};function VC(){let e=Xh(`panel`),t=Xh(`dialog`),n=Xh(`device`);return{bottom:e===`timeline`||e===`interactions`||e===`json`||e===`check`?e:null,bottomHeight:248,assistant:Xh(`assistant`)===`1`,device:n===`tablet`||n===`phone`?n:`desktop`,helpers:!0,interact:!1,gizmo:`translate`,space:`world`,snap:!1,view:Xh(`view`)===`camera`?`camera`:`editor`,lightSel:null,dialog:t===`export`||t===`render`||t===`shortcuts`?t:null,flash:null,agentPulse:0,check:null,checkRunning:!1,addTab:Xh(`add`)??`primitives`}}var HC=e=>{let t=e.target;return!!t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable)};function UC({backend:e,onClose:t}){let[n,r]=(0,O.useState)(null),[i,a]=(0,O.useState)(null);return(0,O.useEffect)(()=>{let n=!1,i=new BC(t=>e.call(t.kind===`patch`?`scene_patch`:`scene_apply`,t.kind===`patch`?{ops:t.ops}:{scene:t.scene})),o=new ux,s=Z_(VC()),c=async()=>void 0;(async()=>{try{let[a,l,u]=await Promise.all([e.loadScene(),e.tools().catch(()=>[]),e.library().catch(()=>({assets:[]}))]);if(n)return;i.load(a);let d=Xh(`select`);d&&i.select(d),r({backend:e,store:i,player:o,ui:s,tools:l,library:u,edit(e,t){let n=i.edit(e,t);n&&rg({tone:`error`,title:Yh(`edit.failed`),detail:n})},async runCheck(){s.set({checkRunning:!0,bottom:`check`});try{await i.flush();let t=await e.call(`check`,{});s.set({check:{...t,at:Date.now()}})}catch(e){rg({tone:`error`,title:Yh(`check.failed`),detail:e.message})}finally{s.set({checkRunning:!1})}},reloadScene:e=>c(e),closeProject(){i.flush().then(t)}})}catch(e){n||a(e.message)}})();let l=async(t={})=>{let n=await e.loadScene(),r=i.getSnapshot().scene;if(!i.external(n))return;let a=Rm(r,n),o=[...a.objects.added,...a.objects.changed.map(e=>e.id),...a.objects.moved.map(e=>e.id)];s.set(e=>({flash:{ids:o,at:Date.now()},agentPulse:e.agentPulse+1})),t.toast!==!1&&rg({tone:`agent`,title:Yh(`external.title`),detail:a.summary,action:{label:Yh(`external.undo`),run:()=>i.undo()}},6e3)};c=l;let u=Xh(`events`)===`0`?()=>void 0:e.onChange(e=>{e.includes(`scene.json`)?l().catch(()=>void 0):e.some(e=>e.startsWith(`assets/`)||e.startsWith(`scripts/`))&&(s.set(e=>({agentPulse:e.agentPulse+1})),rg({tone:`agent`,title:Yh(`external.files`),detail:e.slice(0,4).join(`, `)}))}),d=e=>{i.dirty&&(i.flush(),e.preventDefault())};return window.addEventListener(`beforeunload`,d),()=>{n=!0,u(),window.removeEventListener(`beforeunload`,d),i.flush(),o.dispose()}},[e,t]),i?(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-center`,children:[(0,G.jsx)(`div`,{className:`text-base font-medium`,children:Yh(`app.loadFailed`)}),(0,G.jsx)(`div`,{className:`max-w-md text-sm text-fg-muted`,children:i})]}):n?(0,G.jsx)($_.Provider,{value:n,children:(0,G.jsx)(WC,{})}):(0,G.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-fg-muted`,children:[(0,G.jsx)(Nn,{size:16,className:`animate-spin`}),` `,Yh(`app.loadingScene`)]})}function WC(){let e=tv(e=>e.assistant),t=tv(e=>e.dialog);return qC(),(0,G.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,G.jsx)(Qx,{}),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,G.jsx)(Zx,{}),(0,G.jsxs)(`div`,{className:`relative flex min-w-0 flex-1 flex-col`,children:[(0,G.jsx)(uS,{}),(0,G.jsx)(Jb,{}),(0,G.jsx)(og,{})]}),(0,G.jsx)(zC,{}),e&&(0,G.jsx)(xv,{})]}),t===`export`&&(0,G.jsx)(xx,{}),t===`render`&&(0,G.jsx)(Sx,{}),t===`shortcuts`&&(0,G.jsx)(Ex,{})]})}function GC(e){return(0,O.useMemo)(()=>t=>{let n=t.metaKey||t.ctrlKey,{store:r,ui:i,player:a}=e;if(n&&t.key.toLowerCase()===`z`){if(HC(t))return;t.preventDefault(),t.shiftKey?r.redo():r.undo();return}if(n&&t.key.toLowerCase()===`y`){if(HC(t))return;t.preventDefault(),r.redo();return}if(n&&t.key.toLowerCase()===`s`){t.preventDefault(),r.flush();return}if(HC(t))return;let o=r.getSnapshot(),s=o.selection;if(n&&t.key.toLowerCase()===`d`&&s&&o.scene){t.preventDefault();let n=w_(o.scene,s);n&&e.edit(n.ops,{select:n.newId})}else if(!n)switch(t.key){case` `:t.preventDefault(),a.toggle(),i.set({});break;case`Escape`:r.select(null),i.set({lightSel:null});break;case`Delete`:case`Backspace`:{let n=i.get().lightSel;if(s)t.preventDefault(),e.edit([{op:`removeObject`,id:s}]);else if(n&&o.scene){let r=z_(o.scene,n.id);r>=0&&(t.preventDefault(),e.edit([{op:`remove`,path:`lights[${r}]`}]),i.set({lightSel:null}))}break}case`w`:case`e`:case`r`:i.set({gizmo:t.key===`w`?`translate`:t.key===`e`?`rotate`:`scale`,interact:!1});break;case`q`:i.set({interact:!1});break;case`x`:i.set(e=>({space:e.space===`world`?`local`:`world`}));break;case`c`:i.set(e=>({view:e.view===`editor`?`camera`:`editor`,interact:!1}));break;case`g`:i.set(e=>({helpers:!e.helpers}));break;case`f`:i.get().view===`camera`&&i.set({view:`editor`,interact:!1}),a.sceneEditor?.frameSelection();break;case`h`:if(s&&o.scene){let t=o.scene.objects&&KC(o.scene,s);e.edit(t===!1?[{op:`remove`,path:`objects#${s}.visible`}]:[{op:`set`,path:`objects#${s}.visible`,value:!1}])}break;case`t`:i.set(e=>({bottom:e.bottom===`timeline`?null:`timeline`}));break;case`j`:i.set(e=>({bottom:e.bottom===`json`?null:`json`}));break;case`a`:i.set(e=>({assistant:!e.assistant}));break;case`i`:i.set(e=>({interact:!e.interact}));break;case`?`:i.set({dialog:`shortcuts`})}},[e])}function KC(e,t){let n=!0,r=e=>{for(let i of e)i.id===t&&(n=i.visible!==!1),i.children&&r(i.children)};return r(e.objects),n}function qC(){let e=GC(Q());(0,O.useEffect)(()=>(window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)),[e])}var JC={banner:`linear-gradient(120deg,#1d2b64,#7c8cff 60%,#f8cdda)`,hero:`radial-gradient(circle at 30% 40%,#ff7eb3,#7a5cff 45%,#141629 80%)`,card:`linear-gradient(160deg,#2b2e3a,#545a6e 50%,#e9dccb)`,square:`conic-gradient(from 210deg at 50% 50%,#38f9ff,#7c8cff,#ff7eb3,#38f9ff)`,fullscreen:`linear-gradient(180deg,#5aa9e6 0%,#f6d5a8 55%,#4f8a4b 56%,#2d5a2a 100%)`,inline:`linear-gradient(135deg,#232526,#414345)`,game:`linear-gradient(135deg,#0f2027,#2c5364 60%,#f2b654)`},YC=[`banner`,`hero`,`card`,`square`,`fullscreen`,`game`];function XC({src:e,kind:t,aspect:n}){let[r,i]=(0,O.useState)(!e),[a,o]=n.split(`:`).map(Number);return(0,G.jsxs)(`div`,{className:`relative aspect-[16/10] overflow-hidden rounded-md bg-ink-2`,children:[!r&&e?(0,G.jsx)(`img`,{src:e,alt:``,className:`h-full w-full object-cover`,onError:()=>i(!0)}):(0,G.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,style:{background:JC[t]??JC.inline},children:(0,G.jsx)(`div`,{className:`rounded-[3px] border border-white/40 bg-white/10 shadow-lg backdrop-blur-sm`,style:{width:a>=o?`70%`:`${70*a/o/1.6}%`,aspectRatio:`${a} / ${o}`}})}),(0,G.jsxs)(`span`,{className:`absolute bottom-1.5 left-1.5 rounded bg-black/55 px-1.5 py-0.5 text-2xs font-medium text-white/90 backdrop-blur`,children:[t,` · `,n]})]})}function ZC({backend:e,onOpened:t}){let{t:n}=U(),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)([]),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(`all`);(0,O.useEffect)(()=>{e.templates().then(i),e.recent().then(o)},[e]);let p=async(r,i)=>{if(e.mode!==`cli`||!e.hasProject()||window.confirm(n(`start.replaceConfirm`,{dir:e.location??``}))){c(r),u(null);try{await e.createProject({name:i.title,title:i.title,template:i.template,kind:i.kind}),t()}catch(e){u(e.message)}finally{c(null)}}},m=[`all`,...new Set((r??[]).map(e=>e.kind))],h=(r??[]).filter(e=>d===`all`||e.kind===d),g=e.canCreate();return(0,G.jsx)(`div`,{className:`h-full overflow-auto`,children:(0,G.jsxs)(`div`,{className:`mx-auto max-w-[1180px] px-8 py-10`,children:[(0,G.jsxs)(`header`,{className:`mb-10 flex items-end justify-between gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(eS,{size:34}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`text-[22px] font-semibold leading-tight tracking-tight`,children:`Agent3D Studio`}),(0,G.jsx)(`p`,{className:`mt-0.5 max-w-xl text-sm text-fg-muted`,children:n(`start.tagline`)})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.hasProject()&&(0,G.jsxs)(`button`,{type:`button`,onClick:t,className:`flex h-8 items-center gap-1.5 rounded-md bg-accent px-3 text-sm font-medium text-ink-0 hover:bg-accent/90`,children:[(0,G.jsx)(It,{size:14}),` `,n(`start.continue`,{title:e.projectTitle()})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-xs text-fg-muted`,children:[e.mode===`cli`?(0,G.jsx)(en,{size:12}):(0,G.jsx)(nt,{size:12}),e.mode===`cli`?n(`start.cliMode`,{v:e.version??``}):n(`start.localMode`)]})]})]}),!g&&(0,G.jsxs)(`div`,{className:`mb-8 flex gap-3 rounded-lg border border-line bg-ink-1 p-4`,children:[(0,G.jsx)(si,{size:16,className:`mt-0.5 shrink-0 text-accent`}),(0,G.jsxs)(`div`,{className:`text-sm`,children:[(0,G.jsx)(`div`,{className:`font-medium`,children:n(`start.noFolderTitle`)}),(0,G.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:n(`start.noFolderBody`)}),(0,G.jsxs)(`pre`,{className:`mt-2 rounded bg-ink-0 px-2 py-1.5 font-mono text-2xs text-fg`,children:[`agent3d new my-banner --template `,r?.[0]?.id??`<id>`,`
|
|
479
479
|
`,`agent3d studio --project my-banner`]})]})]}),l&&(0,G.jsx)(`div`,{className:`mb-6 rounded-md bg-danger/10 px-3 py-2 text-sm text-danger`,children:l}),(0,G.jsxs)(`div`,{className:`grid grid-cols-[1fr_260px] gap-10`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 space-y-10`,children:[(0,G.jsxs)(`section`,{children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-baseline justify-between`,children:[(0,G.jsx)(`h2`,{className:`text-base font-semibold`,children:n(`start.starters`)}),(0,G.jsx)(`span`,{className:`text-xs text-fg-faint`,children:n(`start.startersHint`)})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-3 gap-3 xl:grid-cols-6`,children:YC.map(e=>(0,G.jsxs)(`button`,{type:`button`,disabled:!g||!!s,onClick:()=>void p(`kind:${e}`,{kind:e,title:n(`start.untitled.${e}`)}),className:`group rounded-lg p-1.5 text-left transition-colors hover:bg-ink-2 disabled:opacity-50`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(XC,{src:null,kind:e,aspect:Wo[e]}),(0,G.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100`,children:(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-ink-0/80 text-fg`,children:s===`kind:${e}`?(0,G.jsx)(Nn,{size:14,className:`animate-spin`}):(0,G.jsx)(lr,{size:15})})})]}),(0,G.jsx)(`div`,{className:`mt-1.5 text-sm font-medium capitalize`,children:e}),(0,G.jsx)(`div`,{className:`text-2xs text-fg-faint`,children:n(`start.kinds.${e}`)})]},e))})]}),(0,G.jsxs)(`section`,{children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,G.jsx)(`h2`,{className:`text-base font-semibold`,children:n(`start.templates`)}),m.length>2&&(0,G.jsx)(`div`,{className:`flex gap-1`,children:m.map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:W(`rounded-md px-2 py-0.5 text-xs capitalize`,d===e?`bg-ink-3 text-fg`:`text-fg-muted hover:text-fg`),children:e===`all`?n(`start.all`):e},e))})]}),r===null?(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,G.jsx)(Nn,{size:14,className:`animate-spin`}),` `,n(`app.loading`)]}):h.length?(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-4 lg:grid-cols-3`,children:h.map(t=>(0,G.jsxs)(`button`,{type:`button`,disabled:!g||!!s,onClick:()=>void p(t.id,{template:t.id,title:t.title}),className:`group rounded-lg p-2 text-left transition-colors hover:bg-ink-2 disabled:opacity-60`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(XC,{src:e.templatePreview(t.id),kind:t.kind,aspect:t.aspect??Wo[t.kind]??`16:9`}),s===t.id&&(0,G.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40`,children:(0,G.jsx)(Nn,{size:18,className:`animate-spin`})})]}),(0,G.jsx)(`div`,{className:`mt-2 text-sm font-medium`,children:t.title}),(0,G.jsx)(`div`,{className:`line-clamp-2 text-xs text-fg-muted`,children:t.description}),!!t.tags?.length&&(0,G.jsx)(`div`,{className:`mt-1 truncate text-2xs text-fg-faint`,children:t.tags.join(`, `)})]},t.id))}):(0,G.jsx)(`div`,{className:`rounded-lg border border-dashed border-line px-4 py-6 text-center text-xs text-fg-faint`,children:e.mode===`cli`?n(`start.noTemplates`):n(`start.noTemplatesLocal`)})]})]}),(0,G.jsxs)(`aside`,{children:[(0,G.jsx)(`h2`,{className:`mb-3 text-base font-semibold`,children:n(`start.recent`)}),a.length?(0,G.jsx)(`ul`,{className:`space-y-0.5`,children:a.map(r=>(0,G.jsxs)(`li`,{className:`group flex items-center gap-1`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:async()=>{e.mode===`cli`?r.id===e.location&&e.hasProject()&&t():(await e.open(r.id),t())},className:W(`flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-ink-2`,e.mode===`cli`&&r.id!==e.location&&`cursor-default opacity-60`),title:e.mode===`cli`&&r.id!==e.location?n(`start.otherFolder`,{dir:r.id}):r.id,children:[(0,G.jsx)(It,{size:13,className:`shrink-0 text-fg-faint`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`truncate text-sm`,children:r.title}),(0,G.jsx)(`div`,{className:`truncate text-2xs text-fg-faint`,children:e.mode===`cli`?r.id:r.updatedAt?new Date(r.updatedAt).toLocaleString():``})]})]}),e.remove&&(0,G.jsx)(`button`,{type:`button`,"aria-label":n(`start.remove`),title:n(`start.remove`),onClick:async()=>(await e.remove(r.id),o(await e.recent())),className:`rounded p-1 text-fg-faint opacity-0 hover:text-danger group-hover:opacity-100`,children:(0,G.jsx)(li,{size:12})})]},r.id))}):(0,G.jsx)(`p`,{className:`text-xs text-fg-faint`,children:n(`start.noRecent`)}),(0,G.jsxs)(`div`,{className:`mt-8 rounded-lg border border-line p-3 text-xs leading-relaxed text-fg-muted`,children:[(0,G.jsx)(`div`,{className:`mb-1 font-medium text-fg`,children:n(`start.agentTitle`)}),n(`start.agentBody`)]})]})]})]})})}function QC(){let{t:e}=U(),[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(0);(0,O.useEffect)(()=>{let e=!1;return(async()=>{let t=await Nh(),r;if(t)r=new Fh(t);else{let e=new jh;await e.init();let t=Xh(`project`);t&&await e.open(t).catch(()=>void 0),r=e}e||(n(r),i(r.hasProject()&&Xh(`start`)!==`1`))})(),()=>{e=!0}},[]);let s=(0,O.useCallback)(()=>{o(e=>e+1),i(!0)},[]);return t?r?(0,G.jsx)(UC,{backend:t,onClose:()=>i(!1)},a):(0,G.jsx)(ZC,{backend:t,onOpened:s}):(0,G.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-fg-muted`,children:[(0,G.jsx)(Nn,{size:16,className:`animate-spin`}),` `,e(`app.loading`)]})}document.documentElement.lang=Gh(),(0,Ri.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(O.StrictMode,{children:(0,G.jsx)(QC,{})}));export{Aa as C,Hi as E,Pa as S,va as T,Ha as _,R_ as a,za as b,A_ as c,L_ as d,mp as f,Hl as g,Sf as h,I_ as i,M_ as l,xf as m,k_ as n,F_ as o,wf as p,P_ as r,N_ as s,Qv as t,j_ as u,Ia as v,ja as w,La as x,Ba as y};
|