shapewall 0.3.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/CHANGELOG.md +357 -0
  2. package/NOTICE +7 -0
  3. package/README.md +50 -4
  4. package/THIRD_PARTY.md +39 -0
  5. package/dist/agent/package-lock.json +2 -2
  6. package/dist/client/assets/BoardChat-DdwBcb2N.js +27 -0
  7. package/dist/client/assets/BuzzDialog-DpUcnU6S.js +1 -0
  8. package/dist/client/assets/ChecksPanel-CngYV4yz.js +1 -0
  9. package/dist/client/assets/History-CD0saQA5.js +1 -0
  10. package/dist/client/assets/LocalSettings-MZy2baig.js +1 -0
  11. package/dist/client/assets/{Management-DmTh1-tA.js → Management-CSvZ-SHO.js} +1 -1
  12. package/dist/client/assets/QuickConnect-foLh2QUm.js +1 -0
  13. package/dist/client/assets/ShareDialog-DPWDftoL.js +2 -0
  14. package/dist/client/assets/app-update-dialog-CtiXpTRD.js +1 -0
  15. package/dist/client/assets/{circle-x-3UxAvczM.js → circle-x-CteRBtXC.js} +1 -1
  16. package/dist/client/assets/index-Cxz1UVcV.css +2 -0
  17. package/dist/client/assets/index-uUZVBYUS.js +37 -0
  18. package/dist/client/assets/play-BjRNIGSf.js +1 -0
  19. package/dist/client/assets/{refresh-cw-BRHNyCnY.js → refresh-cw-r_tZiFfB.js} +1 -1
  20. package/dist/client/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  21. package/dist/client/assets/{runtime-Bft6x_6E.js → runtime-Bvq10IhH.js} +1 -1
  22. package/dist/client/assets/ui-zQpn-PdL.js +41 -0
  23. package/dist/client/build-info.json +1 -1
  24. package/dist/client/index.html +4 -3
  25. package/dist/client/sw.js +2 -2
  26. package/dist/console/assets/{LocalAccountsApp-IvHd9zWN.js → LocalAccountsApp-DIdy1KnN.js} +1 -1
  27. package/dist/console/assets/{LocalConsole-DOyLou56.js → LocalConsole-DfcQztF-.js} +1 -1
  28. package/dist/console/assets/{app-update-dialog-Da46CJpv.js → app-update-dialog-ttl9lF5A.js} +1 -1
  29. package/dist/console/assets/console-OqAjD0kV.js +55 -0
  30. package/dist/console/assets/console-kvjrAArQ.css +2 -0
  31. package/dist/console/build-info.json +1 -1
  32. package/dist/console/console.html +2 -2
  33. package/docs/agent-hardening.md +192 -0
  34. package/docs/agent-recipes.md +23 -0
  35. package/docs/agent-workflow.md +5 -0
  36. package/docs/agents.md +74 -6
  37. package/docs/config.md +1 -1
  38. package/docs/deployment.md +2 -0
  39. package/docs/design-system.md +20 -15
  40. package/docs/hosted.md +815 -3
  41. package/docs/where-to-run.md +123 -0
  42. package/package.json +2 -1
  43. package/src/agent/agent-logos.js +81 -0
  44. package/src/agent/backends/acp.js +528 -25
  45. package/src/agent/branch-mode.js +17 -3
  46. package/src/agent/card-hash.js +65 -0
  47. package/src/agent/config.js +27 -2
  48. package/src/agent/context.js +41 -0
  49. package/src/agent/exec-paths.js +105 -0
  50. package/src/agent/icon-store.js +100 -0
  51. package/src/agent/identity.js +77 -0
  52. package/src/agent/owner-mcp.js +19 -3
  53. package/src/agent/routes.js +82 -22
  54. package/src/agent/run.js +14 -2
  55. package/src/agent/settings-routes.js +233 -14
  56. package/src/agent/starter/cli.js +6 -1
  57. package/src/agent/test-timing.js +14 -0
  58. package/src/agent/tools.js +4 -2
  59. package/src/agent/turn-changes.js +70 -8
  60. package/src/agent/user-settings.js +51 -3
  61. package/src/capture/element-map.js +61 -4
  62. package/src/cli/args.js +13 -0
  63. package/src/cli/commands.js +20 -5
  64. package/src/cli/help.js +36 -1
  65. package/src/hosted/admin.js +7 -0
  66. package/src/hosted/agent-approvals.js +28 -3
  67. package/src/hosted/agent-link.js +1032 -0
  68. package/src/hosted/agent-policy.js +10 -3
  69. package/src/hosted/agent-presence.js +81 -0
  70. package/src/hosted/agent-routes.js +135 -0
  71. package/src/hosted/agents.js +1199 -0
  72. package/src/hosted/app.js +94 -4
  73. package/src/hosted/board-routes.js +134 -3
  74. package/src/hosted/chat-frames.js +256 -0
  75. package/src/hosted/chat-job.js +204 -0
  76. package/src/hosted/chat-permissions.js +191 -0
  77. package/src/hosted/chat-routes.js +1009 -0
  78. package/src/hosted/chat-store.js +460 -0
  79. package/src/hosted/comment-files.js +8 -1
  80. package/src/hosted/comments.js +1 -1
  81. package/src/hosted/console-routes.js +58 -1
  82. package/src/hosted/db.js +165 -0
  83. package/src/hosted/device-routes.js +64 -8
  84. package/src/hosted/device.js +35 -4
  85. package/src/hosted/events.js +8 -6
  86. package/src/hosted/membership.js +9 -1
  87. package/src/hosted/pages.js +2 -0
  88. package/src/hosted/permissions.js +38 -0
  89. package/src/hosted/presence.js +18 -1
  90. package/src/hosted/projects.js +60 -2
  91. package/src/hosted/ratelimit.js +8 -0
  92. package/src/hosted/tenancy.js +18 -0
  93. package/src/hosted/token-api.js +118 -15
  94. package/src/hosted/token-events.js +7 -2
  95. package/src/hosted/tokens.js +24 -7
  96. package/src/hosted/turn-hub.js +152 -0
  97. package/src/mcp.js +10 -2
  98. package/src/remote/agent-connect.js +433 -0
  99. package/src/remote/agent-fix.js +611 -0
  100. package/src/remote/agent-job.js +216 -0
  101. package/src/remote/agent-link.js +904 -0
  102. package/src/remote/agent-policy-file.js +242 -0
  103. package/src/remote/credentials.js +35 -1
  104. package/src/remote/login.js +12 -2
  105. package/src/store.js +5 -0
  106. package/dist/client/assets/BoardChat-BeRp6007.js +0 -27
  107. package/dist/client/assets/BuzzDialog-CrYy48hh.js +0 -1
  108. package/dist/client/assets/ChecksPanel-CB820mhj.js +0 -1
  109. package/dist/client/assets/History-Ba909bGJ.js +0 -1
  110. package/dist/client/assets/LocalSettings-ChMi9Zir.js +0 -1
  111. package/dist/client/assets/QuickConnect-CrVweWZB.js +0 -1
  112. package/dist/client/assets/ShareDialog-DO2HhY6g.js +0 -2
  113. package/dist/client/assets/app-update-dialog-C09ODdUQ.js +0 -1
  114. package/dist/client/assets/index-BIjfZKnp.js +0 -37
  115. package/dist/client/assets/index-CXtuJi1K.css +0 -2
  116. package/dist/client/assets/shield-check-DMpniYP6.js +0 -1
  117. package/dist/client/assets/ui-mhL9gsne.js +0 -41
  118. package/dist/console/assets/console-CIBv7cXU.js +0 -55
  119. package/dist/console/assets/console-Fp4k9iyx.css +0 -2
@@ -0,0 +1,55 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LocalAccountsApp-DIdy1KnN.js","assets/LocalConsole-DfcQztF-.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(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 l=document.querySelector(`meta[name="sw-nonce"]`)?.getAttribute(`content`);l&&l!==`__SW_NONCE__`&&(globalThis.__webpack_nonce__=l);var u=o((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},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ee(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+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+M(a,u),c+=te(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+M(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(ee(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 N(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(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 ne=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 re(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,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ie(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 re(ie.bind(null,e))}var ae={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ae,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=ie,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)!E.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 D(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)E.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 D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=re,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`})),d=o(((e,t)=>{t.exports=u()})),f=o((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,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){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&&E());){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&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();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`})),h=o(((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=m()})),g=o((e=>{var t=p(),n=d(),r=h();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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(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)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(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 _(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 v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(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)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(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 x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(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 E(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 D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),te=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),ne=Symbol.for(`react.suspense`),re=Symbol.for(`react.suspense_list`),ie=Symbol.for(`react.memo`),ae=Symbol.for(`react.lazy`),F=Symbol.for(`react.activity`),oe=Symbol.for(`react.legacy_hidden`),se=Symbol.for(`react.memo_cache_sentinel`),ce=Symbol.for(`react.view_transition`),le=Symbol.for(`react.recoverable`),ue=Symbol.iterator;function de(e){return typeof e!=`object`||!e?null:(e=ue&&e[ue]||e[`@@iterator`],typeof e==`function`?e:null)}var fe=Symbol.for(`react.client.reference`);function pe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case ee:return`Profiler`;case M:return`StrictMode`;case ne:return`Suspense`;case re:return`SuspenseList`;case F:return`Activity`;case ce:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case N:return e.displayName||`Context`;case te:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ie:return t=e.displayName||null,t===null?pe(e.type)||`Memo`:t;case ae:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}var me=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function xe(e,t){ve++,_e[ve]=e.current,e.current=t}var Se=ye(null),Ce=ye(null),we=ye(null),Te=ye(null);function Ee(e,t){switch(xe(we,t),xe(Ce,e),xe(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=_p(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(Se),xe(Se,e)}function De(){be(Se),be(Ce),be(we)}function Oe(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,xe(Te,e)),t=Se.current;var n=_p(t,e.type);t!==n&&(xe(Ce,e),xe(Se,n))}function ke(e){Ce.current===e&&(be(Se),be(Ce)),Te.current===e&&(be(Te),ph._currentValue=ge)}var Ae,je;function Me(e){if(Ae===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||``,je=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+Ae+e+je}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!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(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
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{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var Le=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,Be=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,We=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Ke=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Je=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,Qe=null;function $e(e){if(typeof Ye==`function`&&Xe(e),Qe&&typeof Qe.setStrictMode==`function`)try{Qe.setStrictMode(Ze,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(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 ct(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=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(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 lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(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-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(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 ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(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-et(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&&gt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(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 bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=he.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function St(e,t){var n=he.p;try{return he.p=e,t()}finally{he.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[wt])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Le.call(Kt,e)?!0:Le.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var Jt=!1;function Yt(){var e=Jt;return Jt=!1,e}function Xt(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 Zt(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 Qt(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 $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(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 nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(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=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(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=``+$t(s):e.removeAttribute(`name`)}function cn(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)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(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),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(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=``+$t(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 dn(e,t,n){t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(me(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=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 hn(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||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(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]=``,Jt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),Jt=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(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 vn=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`]]),yn=/^[\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 bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(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="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));sn(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&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Hd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||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 An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.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 Fn=i.slice(e,1<r?1-r:void 0)}function Ln(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 Rn(){return!0}function zn(){return!1}function Bn(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)?Rn:zn,this.isPropagationStopped=zn,this}return D(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=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=D({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=D({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(D({},Jn,{dataTransfer:0})),Zn=Bn(D({},Un,{relatedTarget:0})),Qn=Bn(D({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(D({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(D({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(D({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(D({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(D({},Vn,{submitter:0})),lr=Bn(D({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(D({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(D({},Jn,{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})),fr=Bn(D({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!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 _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={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 Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=$f(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function L(e){Gf(e,0)}function Ar(e){if(rn(It(e)))return e}function jr(e,t){if(e===`change`)return t}var Mr=!1;if(An){var Nr;if(An){var Pr=`oninput`in document;if(!Pr){var Fr=document.createElement(`div`);Fr.setAttribute(`oninput`,`return;`),Pr=typeof Fr.oninput==`function`}Nr=Pr}else Nr=!1;Mr=Nr&&(!document.documentMode||9<document.documentMode)}function Ir(){Or&&(Or.detachEvent(`onpropertychange`,Lr),kr=Or=null)}function Lr(e){if(e.propertyName===`value`&&Ar(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(L,t)}}function Rr(e,t,n){e===`focusin`?(Ir(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Lr)):e===`focusout`&&Ir()}function zr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ar(kr)}function Br(e,t){if(e===`click`)return Ar(t)}function R(e,t){if(e===`input`||e===`change`)return Ar(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(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(!Le.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(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 Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(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=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function z(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(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=Wr(e.document)}return t}function Jr(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 Yr=An&&`documentMode`in document&&11>=document.documentMode,Xr=null,Zr=null,Qr=null,$r=!1;function ei(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$r||Xr==null||Xr!==Wr(r)||(r=Xr,`selectionStart`in r&&Jr(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}),Qr&&Ur(Qr,r)||(Qr=r,r=$f(Zr,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Xr)))}function ti(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ni={animationend:ti(`Animation`,`AnimationEnd`),animationiteration:ti(`Animation`,`AnimationIteration`),animationstart:ti(`Animation`,`AnimationStart`),transitionrun:ti(`Transition`,`TransitionRun`),transitionstart:ti(`Transition`,`TransitionStart`),transitioncancel:ti(`Transition`,`TransitionCancel`),transitionend:ti(`Transition`,`TransitionEnd`)},ri={},ii={};An&&(ii=document.createElement(`div`).style,`AnimationEvent`in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),`TransitionEvent`in window||delete ni.transitionend.transition);function ai(e){if(ri[e])return ri[e];if(!ni[e])return e;var t=ni[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ii)return ri[e]=t[n];return e}var oi=ai(`animationend`),si=ai(`animationiteration`),ci=ai(`animationstart`),li=ai(`transitionrun`),ui=ai(`transitionstart`),di=ai(`transitioncancel`),fi=ai(`transitionend`),pi=new Map,mi=`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(` `);mi.push(`scrollEnd`);function hi(e,t){pi.set(e,t),Ht(t,[e])}var gi=0;function _i(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Cd.identifierPrefix;var n=gi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function B(e){if(e==null||typeof e==`string`)return e;var t=null,n=jd;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 vi(e,t){return e=B(e),t=B(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var yi=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)},bi=[],xi=0,Si=0;function Ci(){for(var e=xi,t=Si=xi=0;t<e;){var n=bi[t];bi[t++]=null;var r=bi[t];bi[t++]=null;var i=bi[t];bi[t++]=null;var a=bi[t];if(bi[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&&Di(n,i,a)}}function wi(e,t,n,r){bi[xi++]=e,bi[xi++]=t,bi[xi++]=n,bi[xi++]=r,Si|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ti(e,t,n,r){return wi(e,t,n,r),Oi(e)}function Ei(e,t){return wi(e,null,null,t),Oi(e)}function Di(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-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Oi(e){if(50<Md)throw Md=0,Nd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ki={};function Ai(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 ji(e,t,n,r){return new Ai(e,t,n,r)}function Mi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ni(e,t){var n=e.alternate;return n===null?(n=ji(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 Pi(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 Fi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Mi(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case F:return e=ji(31,n,t,a),e.elementType=F,e.lanes=o,e;case j:return Ii(n.children,a,o,t);case M:s=8,a|=24;break;case ee:return e=ji(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case ne:return e=ji(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=ji(19,n,t,a),e.elementType=re,e.lanes=o,e;case oe:case ce:return e=a|32,e=ji(30,n,t,e),e.elementType=ce,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case te:s=9;break a;case P:s=11;break a;case ie:s=14;break a;case ae:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ji(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ii(e,t,n,r){return e=ji(7,e,r,t),e.lanes=n,e}function Li(e,t,n){return e=ji(6,e,null,t),e.lanes=n,e}function Ri(e){var t=ji(18,null,null,0);return t.stateNode=e,t}function zi(e,t,n){return t=ji(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bi=new WeakMap;function Vi(e,t){if(typeof e==`object`&&e){var n=Bi.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Bi.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var Hi=[],Ui=0,Wi=null,Gi=0,Ki=[],qi=0,Ji=null,Yi=1,V=``;function Xi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Wi,Wi=e,Gi=t}function Zi(e,t,n){Ki[qi++]=Yi,Ki[qi++]=V,Ki[qi++]=Ji,Ji=e;var r=Yi;e=V;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Yi=1<<32-et(t)+i|n<<i|r,V=a+e}else Yi=1<<a|n<<i|r,V=e}function Qi(e){e.return!==null&&(Xi(e,1),Zi(e,1,0))}function $i(e){for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null;for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,V=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null}function ea(e,t){Ki[qi++]=Yi,Ki[qi++]=V,Ki[qi++]=Ji,Yi=t.id,V=t.overflow,Ji=e}var ta=null,na=null,ra=!1,ia=null,aa=!1,oa=Error(i(519));function sa(e){throw pa(Vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),oa}function ca(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:Kf(`cancel`,t),Kf(`close`,t);break;case`iframe`:case`object`:case`embed`:Kf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Uf.length;n++)Kf(Uf[n],t);break;case`source`:Kf(`error`,t);break;case`img`:case`image`:case`link`:Kf(`error`,t),Kf(`load`,t);break;case`details`:Kf(`toggle`,t);break;case`input`:Kf(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Kf(`invalid`,t);break;case`textarea`:Kf(`invalid`,t),fn(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||ap(t.textContent,n)?(r.popover!=null&&(Kf(`beforetoggle`,t),Kf(`toggle`,t)),r.onScroll!=null&&Kf(`scroll`,t),r.onScrollEnd!=null&&Kf(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||sa(e,!0)}function la(e){for(ta=e.return;ta;)switch(ta.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:ta=ta.return}}function ua(e){if(e!==ta)return!1;if(!ra)return la(e),ra=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||yp(e.type,e.memoizedProps)),n=!n),n&&na&&sa(e),la(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=_m(e)}else t===27?(t=na,Op(e.type)?(e=gm,gm=null,na=e):na=t):na=ta?hm(e.stateNode.nextSibling):null;return!0}function da(){na=ta=null,ra=!1}function fa(){var e=ia;return e!==null&&(hd===null?hd=e:hd.push.apply(hd,e),ia=null),e}function pa(e){ia===null?ia=[e]:ia.push(e)}var ma=ye(null),ha=null,ga=null;function _a(e,t,n){xe(ma,t._currentValue),t._currentValue=n}function va(e){e._currentValue=ma.current,be(ma)}function H(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 ya(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),H(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),H(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),H(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 ba(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;Hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Te.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}a=a.return}return e!==null&&ya(t,e,n,r),t.flags|=262144,e!==null}function xa(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Sa(e){ha=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function U(e){return wa(ha,e)}function Ca(e,t){return ha===null&&Sa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ga===null){if(e===null)throw Error(i(308));ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ga=ga.next=t;return n}var Ta=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()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(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 Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=Rf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(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 Va=I.S;I.S=function(e,t){if(vd=He(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=wf;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=wf;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=ye(null);function Ua(){var e=Ha.current;return e===null?$u.pooledCache:e}function W(e,t){t===null?xe(Ha,Ha.current):xe(Ha,t.pool)}function Wa(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ga=Error(i(460)),Ka=Error(i(474)),qa=Error(i(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=$u,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,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(i(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(i(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(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=Ni(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=Li(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===j?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ae&&Za(i)===t.type)?(t=a(t,n.props),io(t,n),t.return=e,t):(t=Fi(n.type,n.key,n.props,null,e.mode,r),io(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=zi(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=Ii(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=Li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Fi(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=zi(t,e.mode,n),t.return=e,t;case ae:return t=Za(t),f(e,t,n)}if(me(t)||de(t))return t=Ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===N)return f(e,Ca(e,t),n);ao(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ae:return n=Za(n),p(e,t,n,r)}if(me(n)||de(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===N)return p(e,t,Ca(e,n),r);ao(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ae:return r=Za(r),m(e,t,n,r,i)}if(me(r)||de(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===N)return m(e,t,n,Ca(t,r),i);ao(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),ra&&Xi(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 ra&&Xi(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)}),ra&&Xi(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),ra&&Xi(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 ra&&Xi(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)}),ra&&Xi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),io(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ae&&Za(l)===r.type){n(e,r.sibling),c=a(r,o.props),io(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ii(o.props.children,e.mode,c,o.key),io(c,o),c.return=e,e=c):(c=Fi(o.type,o.key,o.props,null,e.mode,c),io(c,o),c.return=e,e=c)}return s(e);case A: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=zi(o,e.mode,c),c.return=e,e=c}return s(e);case ae:return o=Za(o),_(e,r,o,c)}if(me(o))return h(e,r,o,c);if(de(o)){if(l=de(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,ro(o),c);if(o.$$typeof===N)return _(e,r,Ca(e,o),c);ao(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=Li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=ji(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(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 po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Qu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Oi(e),Di(e,null,n),t}return wi(e,r,t,n),Oi(e)}function ho(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,_t(e,n)}}function go(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 _o=!1;function vo(){if(_o){var e=La;if(e!==null)throw e}}function G(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!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?(td&f)===f:(r&f)===f){f!==0&&f===Ia&&(_o=!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=D({},d,f);break a;case 2:lo=!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),ld|=o,e.lanes=o,e.memoizedState=d}}function yo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yo(n[e],t)}var xo=ye(null),So=ye(0);function Co(e,t){e=sd,xe(So,e),xe(xo,t),sd=e|t.baseLanes}function wo(){xe(So,sd),xe(xo,xo.current)}function To(){sd=So.current,be(xo),be(So)}var Eo=ye(null),Do=null;function Oo(e){var t=e.alternate;xe(No,No.current&1),xe(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){xe(No,No.current),xe(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(xe(No,No.current),xe(Eo,e),Do===null&&(Do=e)):jo()}function jo(){xe(No,No.current),xe(Eo,Eo.current)}function Mo(e){be(Eo),Do===e&&(Do=null),be(No)}var No=ye(0);function Po(e,t){xe(Eo,Eo.current),xe(No,t)}function Fo(e){be(No),be(Eo),Do===e&&(Do=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(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 Lo=0,K=null,q=null,Ro=null,zo=!1,Bo=!1,Vo=!1,Ho=0,Uo=0,Wo=null,Go=0;function Ko(){throw Error(i(321))}function qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function Jo(e,t,n,r,i,a){return Lo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?dc:fc,Vo=!1,a=n(r,i),Vo=!1,Bo&&(a=Xo(t,n,r,i)),Yo(e),a}function Yo(e){I.H=uc;var t=q!==null&&q.next!==null;if(Lo=0,Ro=q=K=null,zo=!1,Uo=0,Wo=null,t)throw Error(i(300));e===null||kc||(e=e.dependencies,e!==null&&xa(e)&&(kc=!0))}function Xo(e,t,n,r){K=e;var a=0;do{if(Bo&&(Wo=null),Uo=0,Bo=!1,25<=a)throw Error(i(301));if(a+=1,Ro=q=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=pc,o=t(n,r)}while(Bo);return o}function Zo(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?is(t):t,e=e.useState()[0],(q===null?null:q.memoizedState)!==e&&(K.flags|=1024),t}function Qo(){var e=Ho!==0;return Ho=0,e}function $o(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function es(e){if(zo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}zo=!1}Lo=0,Ro=q=K=null,Bo=!1,Uo=Ho=0,Wo=null}function ts(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ro===null?K.memoizedState=Ro=e:Ro=Ro.next=e,Ro}function ns(){if(q===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=q.next;var t=Ro===null?K.memoizedState:Ro.next;if(t!==null)Ro=t,q=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));q=e,e={memoizedState:q.memoizedState,baseState:q.baseState,baseQueue:q.baseQueue,queue:q.queue,next:null},Ro===null?K.memoizedState=Ro=e:Ro=Ro.next=e}return Ro}function rs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function is(e){var t=Uo;return Uo+=1,Wo===null&&(Wo=[]),e=Xa(Wo,e,t),t=K,(Ro===null?t.memoizedState:Ro.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?dc:fc),e}function as(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return is(e);if(e.$$typeof===le)return;if(e.$$typeof===N)return U(e)}throw Error(i(438,String(e)))}function os(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.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=rs(),K.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]=se;return t.index++,n}function ss(e,t){return typeof t==`function`?t(e):t}function cs(e){return ls(ns(),q,e)}function ls(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?(Lo&f)===f:(td&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===Ia&&(d=!0);else if((Lo&p)===p){u=u.next,p===Ia&&(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,K.lanes|=p,ld|=p;f=u.action,Vo&&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,K.lanes|=f,ld|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(kc=!0,d&&(n=La,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 us(e){var t=ns(),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);Hr(o,t.memoizedState)||(kc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ds(e,t,n){var r=K,a=ns(),o=ra;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((q||a).memoizedState,n);if(s&&(a.memoizedState=n,kc=!0),a=a.queue,Is(ms.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ro!==null&&!!(Ro.memoizedState.tag&1),js(e?9:8,{destroy:void 0},ps.bind(null,r,a,n,t),null),e){if(r.flags|=2048,$u===null)throw Error(i(349));o||Lo&127||fs(r,t,n)}return n}function fs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=rs(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ps(e,t,n,r){t.value=n,t.getSnapshot=r,hs(t)&&gs(e)}function ms(e,t,n){return n(function(){hs(t)&&gs(e)})}function hs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function gs(e){var t=Ei(e,2);t!==null&&Ld(t,e,2)}function _s(e){var t=ts();if(typeof e==`function`){var n=e;if(e=n(),Vo){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:e},t}function vs(e,t,n,r){return e.baseState=n,ls(e,q,typeof r==`function`?r:ss)}function ys(e,t,n,r,a){if(sc(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)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,bs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function bs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};o.types=a===null?null:a.types,I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),xs(e,t,s)}catch(n){Cs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),xs(e,t,a)}catch(n){Cs(e,t,n)}}function xs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ss(e,t,n)},function(n){return Cs(e,t,n)}):Ss(e,t,n)}function Ss(e,t,n){t.status=`fulfilled`,t.value=n,ws(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,bs(e,n)))}function Cs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ws(t),t=t.next;while(t!==r)}e.action=null}function ws(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ts(e,t){return t}function Es(e,t){if(ra){var n=$u.formState;if(n!==null){a:{var r=K;if(ra){if(na){b:{for(var i=na,a=aa;i.nodeType!==8;)if(!a||(i=hm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){na=hm(i.nextSibling),r=i.data===`F!`;break a}}sa(r)}r=!1}r&&(t=n[0])}}return n=ts(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:t},n.queue=r,n=ic.bind(null,K,r),r.dispatch=n,r=_s(!1),a=oc.bind(null,K,!1,r.queue),r=ts(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ys.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ds(e){return Os(ns(),q,e)}function Os(e,t,n){if(t=ls(e,t,Ts)[0],e=cs(ss)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=is(t)}catch(e){throw e===Ga?qa:e}else r=t;t=ns();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,js(9,{destroy:void 0},ks.bind(null,i,n),null)),[r,a,e]}function ks(e,t){e.action=t}function As(e){var t=ns(),n=q;if(n!==null)return Os(t,n,e);ns(),t=t.memoizedState,n=ns();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function js(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=rs(),K.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 Ms(){return ns().memoizedState}function Ns(e,t,n,r){var i=ts();K.flags|=e,i.memoizedState=js(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ps(e,t,n,r){var i=ns();r=r===void 0?null:r;var a=i.memoizedState.inst;q!==null&&r!==null&&qo(r,q.memoizedState.deps)?i.memoizedState=js(t,a,n,r):(K.flags|=e,i.memoizedState=js(1|t,a,n,r))}function Fs(e,t){Ns(8390656,8,e,t)}function Is(e,t){Ps(2048,8,e,t)}function Ls(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=rs(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Rs(e){var t=ns().memoizedState;return Ls({ref:t,nextImpl:e}),function(){if(Qu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function zs(e,t){return Ps(4,2,e,t)}function Bs(e,t){return Ps(4,4,e,t)}function Vs(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 Hs(e,t,n){n=n==null?null:n.concat([e]),Ps(4,4,Vs.bind(null,t,e),n)}function Us(){}function Ws(e,t){var n=ns();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gs(e,t){var n=ns();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&qo(t,r[1]))return r[0];if(r=e(),Vo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Ks(e,t,n){return n===void 0||Lo&1073741824&&!(td&261930)?e.memoizedState=t:(e.memoizedState=n,e=Fd(),K.lanes|=e,ld|=e,n)}function qs(e,t,n,r){return Hr(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(td&261930)?(kc=!0,e.memoizedState=n):(e=Fd(),K.lanes|=e,ld|=e,t):(e=Ks(e,n,r),Hr(e,t)||(kc=!0),e)}function Js(e,t,n,r,i){var a=he.p;he.p=a!==0&&8>a?a:8;var o=I.T,s={};s.types=o===null?null:o.types,I.T=s,oc(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ac(e,t,Ba(c,r),Pd(e)):ac(e,t,r,Pd(e))}catch(n){ac(e,t,{then:function(){},status:`rejected`,reason:n},Pd())}finally{he.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function Ys(){}function Xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Zs(e).queue;Js(e,a,t,ge,n===null?Ys:function(){return Qs(e),n(r)})}function Zs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qs(e){var t=Zs(e);t.next===null&&(t=e.alternate.memoizedState),ac(e,t.next.queue,{},Pd())}function $s(){return U(ph)}function ec(){return ns().memoizedState}function tc(){return ns().memoizedState}function nc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Pd();e=po(n);var r=mo(t,e,n);r!==null&&(Ld(r,t,n),ho(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function rc(e,t,n){var r=Pd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e)?cc(t,n):(n=Ti(e,t,n,r),n!==null&&(Ld(n,e,r),lc(n,t,r)))}function ic(e,t,n){ac(e,t,n,Pd())}function ac(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))cc(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,Hr(s,o))return wi(e,t,i,0),$u===null&&Ci(),!1}catch{}if(n=Ti(e,t,i,r),n!==null)return Ld(n,e,r),lc(n,t,r),!0}return!1}function oc(e,t,n,r){if(r={lane:2,revertLane:Rf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sc(e)){if(t)throw Error(i(479))}else t=Ti(e,n,r,2),t!==null&&Ld(t,e,2)}function sc(e){var t=e.alternate;return e===K||t!==null&&t===K}function cc(e,t){Bo=zo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var uc={readContext:U,use:as,useCallback:Ko,useContext:Ko,useEffect:Ko,useImperativeHandle:Ko,useLayoutEffect:Ko,useInsertionEffect:Ko,useMemo:Ko,useReducer:Ko,useRef:Ko,useState:Ko,useDebugValue:Ko,useDeferredValue:Ko,useTransition:Ko,useSyncExternalStore:Ko,useId:Ko,useHostTransitionStatus:Ko,useFormState:Ko,useActionState:Ko,useOptimistic:Ko,useMemoCache:Ko,useCacheRefresh:Ko,useEffectEvent:Ko},dc={readContext:U,use:as,useCallback:function(e,t){return ts().memoizedState=[e,t===void 0?null:t],e},useContext:U,useEffect:Fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ns(4194308,4,Vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ns(4194308,4,e,t)},useInsertionEffect:function(e,t){Ns(4,2,e,t)},useMemo:function(e,t){var n=ts();t=t===void 0?null:t;var r=e();if(Vo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ts();if(n!==void 0){var i=n(t);if(Vo){$e(!0);try{n(t)}finally{$e(!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=rc.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=ts();return e={current:e},t.memoizedState=e},useState:function(e){e=_s(e);var t=e.queue,n=ic.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Us,useDeferredValue:function(e,t){return Ks(ts(),e,t)},useTransition:function(){var e=_s(!1);return e=Js.bind(null,K,e.queue,!0,!1),ts().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=ts();if(ra){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),$u===null)throw Error(i(349));td&127||fs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Fs(ms.bind(null,r,o,e),[e]),r.flags|=2048,js(9,{destroy:void 0},ps.bind(null,r,o,n,t),null),n},useId:function(){var e=ts(),t=$u.identifierPrefix;if(ra){var n=V,r=Yi;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:$s,useFormState:Es,useActionState:Es,useOptimistic:function(e){var t=ts();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=oc.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:os,useCacheRefresh:function(){return ts().memoizedState=nc.bind(null,K)},useEffectEvent:function(e){var t=ts(),n={impl:e};return t.memoizedState=n,function(){if(Qu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:U,use:as,useCallback:Ws,useContext:U,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:cs,useRef:Ms,useState:function(){return cs(ss)},useDebugValue:Us,useDeferredValue:function(e,t){return qs(ns(),q.memoizedState,e,t)},useTransition:function(){var e=cs(ss)[0],t=ns().memoizedState;return[typeof e==`boolean`?e:is(e),t]},useSyncExternalStore:ds,useId:ec,useHostTransitionStatus:$s,useFormState:Ds,useActionState:Ds,useOptimistic:function(e,t){return vs(ns(),q,e,t)},useMemoCache:os,useCacheRefresh:tc,useEffectEvent:Rs},pc={readContext:U,use:as,useCallback:Ws,useContext:U,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:us,useRef:Ms,useState:function(){return us(ss)},useDebugValue:Us,useDeferredValue:function(e,t){var n=ns();return q===null?Ks(n,e,t):qs(n,q.memoizedState,e,t)},useTransition:function(){var e=us(ss)[0],t=ns().memoizedState;return[typeof e==`boolean`?e:is(e),t]},useSyncExternalStore:ds,useId:ec,useHostTransitionStatus:$s,useFormState:As,useActionState:As,useOptimistic:function(e,t){var n=ns();return q===null?(n.baseState=e,[e,n.queue.dispatch]):vs(n,q,e,t)},useMemoCache:os,useCacheRefresh:tc,useEffectEvent:Rs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Ld(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Ld(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Ld(t,e,n),ho(t,e,n))}};function gc(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?!Ur(n,r)||!Ur(i,a):!0}function _c(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&&hc.enqueueReplaceState(t,t.state,null)}function vc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function yc(e){yi(e)}function bc(e){console.error(e)}function xc(e){yi(e)}function Sc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Cc(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 wc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Sc(e,t)},n}function Tc(e){return e=po(e),e.tag=3,e}function Ec(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(){Cc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Cc(t,n,r),typeof i!=`function`&&(xd===null?xd=new Set([this]):xd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Dc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ba(t,n,a,!0),n=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Yd():n.alternate===null&&cd===0&&(cd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),vf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ja?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)),vf(e,r,a)),!1}throw Error(i(435,n.tag))}return vf(e,r,a),Yd(),!1}if(ra)return t=Eo.current,t===null?(r!==oa&&(t=Error(i(423),{cause:r}),pa(Vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Vi(r,n),a=wc(e.stateNode,r,a),go(e,a),cd!==4&&(cd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==oa&&(e=Error(i(422),{cause:r}),pa(Vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Vi(o,n),md===null?md=[o]:md.push(o),cd!==4&&(cd=2),t===null)return!0;r=Vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=wc(n.stateNode,r,e),go(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`&&(xd===null||!xd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Tc(a),Ec(a,e,n,r),go(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Oc=Error(i(461)),kc=!1;function Ac(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function jc(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 Sa(t),r=Jo(e,t,n,o,a,i),s=Qo(),e!==null&&!kc?($o(e,t,i),al(e,t,i)):(ra&&s&&Qi(t),t.flags|=1,Ac(e,t,r,i),t.child)}function Mc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Mi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Nc(e,t,a,r,i)):(e=Fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ol(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return al(e,t,i)}return t.flags|=1,e=Ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function Nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(kc=!1,t.pendingProps=r=a,ol(e,i))e.flags&131072&&(kc=!0);else return t.lanes=e.lanes,al(e,t,i)}}return Vc(e,t,n,r,i)}function Pc(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 Ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&W(t,a===null?null:a.cachePool),a===null?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&W(t,null),wo(),jo()):(W(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return Ac(e,t,i,n),t.child}function Fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ic(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&W(t,null),wo(),Ao(t),e!==null&&ba(e,t,r,!0),t.childLanes=i,null}function Lc(e,t){return t=Xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Rc(e,t,n){return so(t,e.child,null,n),e=Lc(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function zc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ra){if(r.mode===`hidden`)return e=Lc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Fc(null,e);if(ko(t),(e=na)?(e=dm(e,aa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:V},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return Lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),a){if(t.flags&256)t.flags&=-257,t=Rc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(kc||ba(e,t,n,!1),a=(n&e.childLanes)!==0,kc||a){if(xo.current===null){if(r=$u,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ei(e,s),Ld(r,e,s),Oc;Yd()}t=Rc(e,t,n)}else e=o.treeContext,na=hm(s.nextSibling),ta=t,ra=!0,ia=null,aa=!1,e!==null&&ea(t,e),t=Lc(t,r),t.flags|=134221824;return t}return e=Ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bc(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 Vc(e,t,n,r,i){return Sa(t),n=Jo(e,t,n,r,void 0,i),r=Qo(),e!==null&&!kc?($o(e,t,i),al(e,t,i)):(ra&&r&&Qi(t),t.flags|=1,Ac(e,t,n,i),t.child)}function Hc(e,t,n,r,i,a){return Sa(t),t.updateQueue=null,n=Xo(t,r,n,i),Yo(e),r=Qo(),e!==null&&!kc?($o(e,t,a),al(e,t,a)):(ra&&r&&Qi(t),t.flags|=1,Ac(e,t,n,a),t.child)}function Uc(e,t,n,r,i){if(Sa(t),t.stateNode===null){var a=ki,o=n.contextType;typeof o==`object`&&o&&(a=U(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?U(o):ki,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(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&&hc.enqueueReplaceState(a,a.state,null),G(t,r,a,i),vo(),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=vc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ki,typeof u==`object`&&u&&(o=U(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)&&_c(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,G(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=lo||gc(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,fo(e,t),o=t.memoizedProps,u=vc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ki,typeof l==`object`&&l&&(c=U(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)&&_c(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,G(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&xa(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=lo||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&xa(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,Bc(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=so(t,e.child,null,i),t.child=so(t,null,n,i)):Ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=al(e,t,i),e}function Wc(e,t,n,r){return da(),t.flags|=256,Ac(e,t,n,r),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Wa()}}function qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=fd),e}function Jc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ra){if(i?Oo(t):jo(),(e=na)?(e=dm(e,aa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:V},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw sa(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Xc({mode:`hidden`,children:a},i),r=Ii(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Kc(n),r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(null,r)):(Oo(t),Yc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Qc(e,t,a,o,r,c,s,n)}return i?(jo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ni(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ii(i,a,n,null),i.flags|=2):i=Ni(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Fc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Kc(n):(a=i.cachePool,a===null?a=Wa():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(e.child,r)):(Oo(t),n=e.child,e=n.sibling,n=Ni(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 Yc(e,t){return t=Xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Xc(e,t){return e=ji(22,e,null,t),e.lanes=0,e}function Zc(e,t,n){return so(t,e.child,null,n),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,Zc(e,t,c)):t.memoizedState===null?(jo(),o=a.fallback,s=t.mode,a=Xc({mode:`visible`,children:a.children},s),o=Ii(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,so(t,e.child,null,c),a=t.child,a.memoizedState=Kc(c),a.childLanes=qc(e,r,c),t.memoizedState=Gc,Fc(null,a)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(t),pm(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,pa({value:a,source:null,stack:null})),Zc(e,t,c)}if(kc||ba(e,t,c,!1),r=(c&e.childLanes)!==0,kc||r){if(xo.current!==null)return Zc(e,t,c);if(r=$u,r!==null&&(a=vt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ei(e,a),Ld(r,e,a),Oc;return fm(o)||Yd(),Zc(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,na=hm(o.nextSibling),ta=t,ra=!0,ia=null,aa=!1,e!==null&&ea(t,e),t=Yc(t,a.children),t.flags|=134221824,t)}function $c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),H(e.return,t,n)}function el(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function tl(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 nl(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 rl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(nl(e),Ac(e,t,r,n),nl(e)):Ac(e,t,r,n),r=ra?Gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$c(e,n,t);else if(e.tag===19)$c(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=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,nl(t)),tl(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&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tl(t,!0,n,null,a,r);break;case`together`:tl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tl(t,!1,i,n,a,r)}return t.child}function il(e,t,n){var r=t.pendingProps;return _a(t,t.type,r.value),Ac(e,t,r.children,n),t.child}function al(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ld|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ba(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=Ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ol(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&xa(e)))}function sl(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),_a(t,Oa,e.memoizedState.cache),da();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=ba(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Jc(e,t,n):(Oo(t),e=al(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return rl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ba(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return rl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Pc(e,t,n,t.pendingProps);case 24:_a(t,Oa,e.memoizedState.cache)}return al(e,t,n)}function cl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)kc=!0;else{if(!ol(e,n)&&!(t.flags&128))return kc=!1,sl(e,t,n);kc=!!(e.flags&131072)}}else kc=!1,ra&&t.flags&1048576&&Zi(t,Gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Mi(e)?(r=vc(e,r),t.tag=1,t=Uc(null,t,e,r,n)):(t.tag=0,t=Vc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===P){t.tag=11,t=jc(null,t,e,r,n);break a}if(a===ie){t.tag=14,t=Mc(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=il(null,t,n);break a}}throw t=pe(e)||e,Error(i(306,t,``))}}return t;case 0:return Vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=vc(r,t.pendingProps),Uc(e,t,r,a,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,fo(e,t),G(t,r,null,n);var s=t.memoizedState;if(r=s.cache,_a(t,Oa,r),r!==o.cache&&ya(t,[Oa],n,!0),vo(),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=Wc(e,t,r,n);break a}if(r!==a){a=Vi(Error(i(424)),t),pa(a),t=Wc(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(na=hm(e.firstChild),ta=t,ra=!0,ia=null,aa=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(da(),r===a){t=al(e,t,n);break a}Ac(e,t,r,n)}t=t.child}return t;case 26:return Bc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ra||(t.stateNode=vp(t.type,t.pendingProps,we.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&ra&&(r=t.stateNode=xm(t.type,t.pendingProps,we.current),ta=t,aa=!0,a=na,Op(t.type)?(gm=a,na=hm(r.firstChild)):na=a),Ac(e,t,t.pendingProps.children,n),Bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ra&&((a=r=na)&&(r=lm(r,t.type,t.pendingProps,aa),r===null?a=!1:(t.stateNode=r,ta=t,na=hm(r.firstChild),aa=!1,a=!0)),a||sa(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,yp(a,o)?r=null:s!==null&&yp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Jo(e,t,Zo,null,null,n),ph._currentValue=a),Bc(e,t),Ac(e,t,r,n),t.child;case 6:return e===null&&ra&&((e=n=na)&&(n=um(n,t.pendingProps,aa),n===null?e=!1:(t.stateNode=n,ta=t,na=null,e=!0)),e||sa(t)),null;case 13:return Jc(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Ac(e,t,r,n),t.child;case 11:return jc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Bc(e,t),Ac(e,t,r,n),t.child;case 8:return Ac(e,t,t.pendingProps.children,n),t.child;case 12:return Ac(e,t,t.pendingProps.children,n),t.child;case 10:return il(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Sa(t),a=U(a),r=r(a),t.flags|=1,Ac(e,t,r,n),t.child;case 14:return Mc(e,t,t.type,t.pendingProps,n);case 15:return Nc(e,t,t.type,t.pendingProps,n);case 19:return rl(e,t,n);case 31:return zc(e,t,n);case 22:return Pc(e,t,n,t.pendingProps);case 24:return Sa(t),r=U(Oa),e===null?(a=Ua(),a===null&&(a=$u,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},uo(t),_a(t,Oa,a)):((e.lanes&n)!==0&&(fo(e,t),G(t,null,null,n),vo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,_a(t,Oa,r),r!==a.cache&&ya(t,[Oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),_a(t,Oa,r))),Ac(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:ra&&Qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Bc(e,t),Ac(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ll(e){e.flags|=4}function ul(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(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(Kd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function dl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(Kd())e.flags|=8192;else throw Qa=Ja,Ka}}function fl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,pd|=t)}function pl(e,t){if(!ra)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 ml(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 hl(e,t,n){var r=t.pendingProps;switch($i(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ml(t),null;case 1:return ml(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),va(Oa),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ua(t)?ll(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fa())),ml(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ll(t),o===null?(ml(t),ul(t,a,null,r,n)):(ml(t),dl(t,o))):o?o===e.memoizedState?(ml(t),t.flags&=-16777217):(ll(t),ml(t),dl(t,o)):(e=e.memoizedProps,e!==r&&ll(t),ml(t),ul(t,a,e,r,n)),null;case 27:if(ke(t),n=we.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ml(t),t.subtreeFlags&=-33554433,null}e=Se.current,ua(t)?ca(t,e):(e=xm(a,r,n),t.stateNode=e,ll(t))}return ml(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ml(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,ua(t))ca(t,o);else{var s=hp(we.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[wt]=t,o[Tt]=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(cp(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&&ll(t)}}return ml(t),t.subtreeFlags&=-33554433,ul(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=we.current,ua(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ta,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ap(e.nodeValue,n)),e||sa(t,!0)}else e=hp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ua(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[wt]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(i(558))}return ml(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ua(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[wt]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),a=!1}else a=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(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),fl(t,t.updateQueue),ml(t),null);case 4:return De(),e===null&&Yf(t.stateNode.containerInfo),t.flags|=67108864,ml(t),null;case 10:return va(t.type),ml(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return ml(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)pl(r,!1);else{if(cd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,pl(r,!1),e=o.updateQueue,t.updateQueue=e,fl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Pi(n,e),n=n.sibling;return Po(t,No.current&1|2),ra&&Xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&He()>yd&&(t.flags|=128,a=!0,pl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,fl(t,e),pl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ra)return ml(t),null}else 2*He()-r.renderingStartTime>yd&&n!==536870912&&(t.flags|=128,a=!0,pl(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=He(),e.sibling=null,o=No.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ra?Po(t,o):(n=o,xe(Eo,t),xe(No,n),Do===null&&(Do=t)),ra&&Xi(t,r.treeForkCount),e}return ml(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ml(t),t.subtreeFlags&6&&(t.flags|=8192)):ml(t),n=t.updateQueue,n!==null&&fl(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&&be(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Oa),ml(t),null;case 25:return null;case 30:return t.flags|=33554432,ml(t),null}throw Error(i(156,t.tag))}function gl(e,t){switch($i(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Oa),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Mo(t),t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(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 De(),null;case 10:return va(t.type),null;case 22:case 23:return Mo(t),To(),e!==null&&be(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Oa),null;case 25:return null;default:return null}}function _l(e,t){switch($i(t),t.tag){case 3:va(Oa),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:va(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&be(Ha);break;case 24:va(Oa)}}function vl(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){_f(t,t.return,e)}}function yl(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){_f(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){_f(t,t.return,e)}}function bl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){_f(e,e.return,t)}}}function xl(e,t,n){n.props=vc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){_f(e,t,n)}}function Sl(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=_i(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);m(e.child,!1,im,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){_f(e,t,n)}}function Cl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){_f(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){_f(e,t,n)}else n.current=null}}function wl(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++)om(e.stateNode,t[n])}function Tl(e){for(var t=e.return;t!==null&&(Ol(t)&&om(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function El(e){for(var t=e.return;t!==null&&(Ol(t)&&sm(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function Dl(e){return e.tag===5||e.tag===3||e.tag===27}function Ol(e){return e&&e.tag===7&&e.stateNode!==null}function kl(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){_f(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;up(r,e.type,n,t),r[Tt]=t}catch(t){_f(e,e.return,t)}}function jl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Ml(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||jl(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&&Op(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 Nl(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=xn)),wl(e,r),Jt=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),wl(e,r),Jt=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);cp(t,r,n),t[wt]=e,t[Tt]=n}catch(t){_f(e,e.return,t)}}var Il=!1,Ll=null;function Rl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Il=!0)}var zl=null;function Bl(){var e=zl;return zl=null,e}var Vl=0;function Hl(e,t,n,r,i){return Vl=0,Ul(e.child,t,n,r,i)}function Ul(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);Il=!0,jp(o,Vl===0?t:t+`_`+Vl,n),Vl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Ul(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Wl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Wl(e.child,t),e=e.sibling}function Gl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Gl(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=vi(t.default,t.share),t!==`none`&&(Hl(e,n,t,null,!1)||Wl(e.child,!1))}e=e.sibling}}function Kl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=_i(r,n),a=vi(r.default,n.paired?r.share:r.enter);a===`none`?Gl(e):Hl(e,i,a,null,!1)?(Gl(e),n.paired||t||Id(e,r.onEnter)):Wl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e,t),e=e.sibling;else Gl(e)}function ql(e){if(Ll!==null&&Ll.size!==0){var t=Ll;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=vi(n.default,n.share);if(a!==`none`&&(Hl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Id(e,n.onShare)):Wl(e.child,!1)),t.delete(r),t.size===0)break}}}ql(e)}e=e.sibling}}}function Jl(e){if(e.tag===30){var t=e.memoizedProps,n=_i(t,e.stateNode),r=Ll===null?void 0:Ll.get(n),i=vi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Hl(e,n,i,null,!1)?r===void 0?Id(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ll.delete(n),Id(e,t.onShare)):Wl(e.child,!1)),Ll!==null&&ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else Ll!==null&&ql(e)}function Yl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=_i(t,e.stateNode);t=vi(t.default,t.update),e.flags&=-5,t!==`none`&&Hl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Yl(e);e=e.sibling}}function Xl(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,Wl(e.child,!1))}Xl(e)}e=e.sibling}}function Zl(e){if(e.tag===30)e.stateNode.paired=null,Wl(e.child,!1),Xl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Xl(e)}function Ql(e){for(e=e.child;e!==null;)e.tag===30?Wl(e.child,!1):e.subtreeFlags&33554432&&Ql(e),e=e.sibling}function $l(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Vl<a.length){var l=a[Vl],u=Pp(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&&jp(c,Vl===0?n:n+`_`+Vl,i),s&&e.flags&4||(zl===null&&(zl=[]),zl.push(c,Vl===0?r:r+`_`+Vl,t.memoizedProps)),Vl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:$l(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function eu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=_i(n,r),a=vi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Vl=0,i=$l(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Id(e,n.onUpdate))}else e.subtreeFlags&33554432&&eu(e,t);e=e.sibling}}var tu=!1,nu=!1,ru=!1,iu=!1,au=typeof WeakSet==`function`?WeakSet:Set,ou=null,su=!1,cu=!1,lu=!1,uu=!1;function du(e,t,n){if(e=e.containerInfo,pp=Sh,e=z(e),Jr(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(mp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,ou=t,t=n?9270:1024;ou!==null;){if(e=ou,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Jl(r[a]);if(e.alternate===null&&e.flags&2)n&&Rl(e),fu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Jl(r),fu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Rl(e),fu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ou=r):(n&&Yl(e),fu(n))}}Ll=null}function fu(e){for(;ou!==null;){var t=ou,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=vc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){_f(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(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=_i(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=vi(a.default,a.update),a!==`none`&&Hl(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,ou=r;break}ou=t.return}}function pu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Nu(e,n),r&4&&vl(5,n);break;case 1:if(Nu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){_f(n,n.return,e)}else{var i=vc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){_f(n,n.return,e)}}}r&64&&bl(n),r&512&&Sl(n,n.return);break;case 3:if(Nu(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{bo(e,t)}catch(e){_f(n,n.return,e)}}break;case 27:t===null&&r&4&&Fl(n);case 26:case 5:Nu(e,n),t===null&&r&4&&kl(n),r&512&&Sl(n,n.return);break;case 12:Nu(e,n);break;case 31:Nu(e,n),r&4&&Su(e,n);break;case 13:Nu(e,n),r&4&&Cu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||tu,!r){var a=t!==null&&t.memoizedState!==null||nu;t=tu,i=nu,tu=r,(nu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Fu(e,n,r)):Nu(e,n),tu=t,nu=i}break;case 30:Nu(e,n),r&512&&Sl(n,n.return);break;case 7:r&512&&Sl(n,n.return);default:Nu(e,n)}}function mu(e,t){for(e=e.child;e!==null;)hu(e,t),e=e.sibling}function hu(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){_f(e,e.return,t)}gu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Jt=!0}catch(t){_f(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){_f(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&mu(e,t);break;default:mu(e,t)}}function gu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:hu(n,r);break a;case 22:n.memoizedState===null&&gu(n,r);break a;default:gu(n,r)}}e=e.sibling}}function _u(e){var t=e.alternate;t!==null&&(e.alternate=null,_u(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(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 vu=null,yu=!1;function bu(e,t,n){for(n=n.child;n!==null;)xu(e,t,n),n=n.sibling}function xu(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount==`function`)try{Qe.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:nu||Cl(n,t),bu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!nu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nu||Cl(n,t),El(n);var r=vu,i=yu;Op(n.type)&&(vu=n.stateNode,yu=!1),bu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),vu=r,yu=i;break;case 5:nu||Cl(n,t),El(n);case 6:if(n.tag===6&&El(n),r=vu,i=yu,vu=null,bu(e,t,n),vu=r,yu=i,vu!==null){if(yu)try{(vu.nodeType===9?vu.body:vu.nodeName===`HTML`?vu.ownerDocument.body:vu).removeChild(n.stateNode),Jt=!0}catch(e){_f(n,t,e)}else try{vu.removeChild(n.stateNode),Jt=!0}catch(e){_f(n,t,e)}}break;case 18:vu!==null&&(yu?(e=vu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):kp(vu,n.stateNode));break;case 4:r=vu,i=yu,vu=n.stateNode.containerInfo,yu=!0,bu(e,t,n),vu=r,yu=i;break;case 0:case 11:case 14:case 15:yl(2,n,t),nu||yl(4,n,t),bu(e,t,n);break;case 1:nu||(Cl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&xl(n,t,r)),bu(e,t,n);break;case 21:bu(e,t,n);break;case 22:nu=(r=nu)||n.memoizedState!==null,bu(e,t,n),nu=r;break;case 30:Cl(n,t),bu(e,t,n);break;case 7:nu||Cl(n,t),bu(e,t,n);break;default:bu(e,t,n)}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){_f(t,t.return,e)}}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){_f(t,t.return,e)}}function wu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new au),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new au),t;default:throw Error(i(435,e.tag))}}function Tu(e,t){var n=wu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Sf.bind(null,e,t);t.then(r,r)}})}function Eu(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(Op(l.type)){vu=l.stateNode,yu=!1;break a}break;case 5:vu=l.stateNode,yu=!1;break a;case 3:case 4:vu=l.stateNode.containerInfo,yu=!0;break a}l=l.return}if(vu===null)throw Error(i(160));xu(s,c,o),vu=null,yu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ou(t,e,n),t=t.sibling}var Du=null;function Ou(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}Eu(t,e,n),ku(e),a&4&&(yl(3,e,e.return),vl(3,e),yl(5,e,e.return));break;case 1:Eu(t,e,n),ku(e),a&512&&(nu||r===null||Cl(r,r.return)),a&64&&tu&&(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=Du,Eu(t,e,n),ku(e),a&512&&(nu||r===null||Cl(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(tu)e.stateNode=vp(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[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),cp(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=Zm(`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),cp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Zm(`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),cp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else tu||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Al(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||nu||t.parentNode.removeChild(t)):a.count--,n===null?tu||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:Eu(t,e,n),ku(e),a&512&&(nu||r===null||Cl(r,r.return)),r!==null&&a&4&&Al(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ru,ru=!1,Eu(t,e,n),ru=o,ku(e),a&512&&(nu||r===null||Cl(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),Jt=!0}catch(t){_f(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Al(e,t,r===null?t:r.memoizedProps)),a&1024&&(iu=!0);break;case 6:if(Eu(t,e,n),ku(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Jt=!0}catch(t){_f(e,e.return,t)}}break;case 3:if(Jt=!1,Xm=null,o=Du,Du=Em(t.containerInfo),Eu(t,e,n),Du=o,ku(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){_f(e,e.return,t)}iu&&(iu=!1,Au(e)),Jt=!1;break;case 4:a=ru,ru=tu,r=Yt(),o=Du,Du=Em(e.stateNode.containerInfo),Eu(t,e,n),ku(e),Du=o,Jt&&cu&&(lu=!0),Jt=r,ru=a;break;case 12:Eu(t,e,n),ku(e);break;case 31:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 13:Eu(t,e,n),ku(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(_d=He()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=tu,l=nu,u=ru;tu=c||o,ru=u||o,nu=l||s,Eu(t,e,n),nu=l,ru=u,tu=c,ku(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||tu||nu||(t=s||nu,n=tu,r=nu,tu=o||tu,nu=t,Pu(e,2),tu=n,nu=r),!o&&ru||mu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Tu(e,n))));break;case 19:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 30:a&512&&(nu||r===null||Cl(r,r.return)),a=Yt(),o=cu,s=(n&335544064)===n,c=e.memoizedProps,cu=s&&vi(c.default,c.update)!==`none`,Eu(t,e,n),ku(e),s&&r!==null&&Jt&&(e.flags|=4),cu=o,Jt=a;break;case 21:break;case 7:a&512&&(nu||r===null||Cl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Eu(t,e,n),ku(e)}}function ku(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(jl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ol(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Dl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Pl(e,Ml(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),Pl(e,Ml(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Nl(e,Ml(e),u,s);break;default:throw Error(i(161))}}catch(t){_f(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Au(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Au(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function ju(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Mu(t,e),t=t.sibling;else eu(t,!1)}function Mu(e,t){var n=e.alternate;if(n===null)Kl(e,!1);else switch(e.tag){case 3:if(uu=su=!1,Bl(),ju(t,e),!su&&!lu){if(e=zl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(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`})),uu=!0}zl=null;break;case 5:ju(t,e);break;case 4:r=su,su=!1,ju(t,e),su&&(lu=!0),su=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ju(t,e):Kl(e,!1));break;case 30:r=su,i=Bl(),su=!1,ju(t,e),su&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=_i(a,o),o=_i(n.memoizedProps,o);var s=vi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Vl=0,t=$l(e,n,t,o,s,a,!0),Vl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Id(e,e.memoizedProps.onUpdate),zl=i):i!==null&&(i.push.apply(i,zl),zl=i),su=e.flags&32?!0:r;break;default:ju(t,e)}}function Nu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pu(e,t.alternate,t),t=t.sibling}function Pu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:yl(4,n,n.return),Pu(n,r);break;case 1:Cl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&xl(n,n.return,i),Pu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:Cl(n,n.return),n.tag!==5&&n.tag!==27||El(n),Pu(n,r);break;case 6:El(n);break;case 26:Cl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||nu||i.parentNode.removeChild(i),Pu(n,r);break;case 22:n.memoizedState===null&&Pu(n,r);break;case 30:Cl(n,n.return),Pu(n,r);break;case 7:Cl(n,n.return);default:Pu(n,r)}e=e.sibling}}function Fu(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:Fu(i,a,n),vl(4,a);break;case 1:if(Fu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){_f(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++)yo(l[i],c)}catch(e){_f(r,r.return,e)}}s&&o&64&&bl(a),Sl(a,a.return);break;case 27:n&2&&Fl(a);case 5:a.tag!==5&&a.tag!==27||Tl(a),Fu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 6:Tl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||tu||Qm(Em(c.ownerDocument),a.type,c),Fu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 12:Fu(i,a,n);break;case 31:Fu(i,a,n),s&&o&4&&Su(i,a);break;case 13:Fu(i,a,n),s&&o&4&&Cu(i,a);break;case 22:a.memoizedState===null&&Fu(i,a,n),Sl(a,a.return);break;case 30:Fu(i,a,n),Sl(a,a.return);break;case 7:Sl(a,a.return);default:Fu(i,a,n)}t=t.sibling}}function Iu(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&&Aa(n))}function Lu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Ru(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)zu(e,t,n,r),t=t.sibling;else i&&Ql(t)}function zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Zl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ru(e,t,n,r),a&2048&&vl(9,t);break;case 1:Ru(e,t,n,r);break;case 3:Ru(e,t,n,r),i&&uu&&(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&&Aa(a)));break;case 12:if(a&2048){Ru(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){_f(t,t.return,e)}}else Ru(e,t,n,r);break;case 31:Ru(e,t,n,r);break;case 13:Ru(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&&Zl(t),o._visibility&2?Ru(e,t,n,r):(o._visibility|=2,Bu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Zl(s),o._visibility&2?Ru(e,t,n,r):Vu(e,t)),a&2048&&Iu(s,t);break;case 24:Ru(e,t,n,r),a&2048&&Lu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Wl(a.child,!0),Wl(t.child,!0))),Ru(e,t,n,r);break;default:Ru(e,t,n,r)}}function Bu(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:Bu(a,o,s,c,i),vl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Bu(a,o,s,c,i)):u._visibility&2?Bu(a,o,s,c,i):Vu(a,o),i&&l&2048&&Iu(o.alternate,o);break;case 24:Bu(a,o,s,c,i),i&&l&2048&&Lu(o.alternate,o);break;default:Bu(a,o,s,c,i)}t=t.sibling}}function Vu(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:Vu(n,r),i&2048&&Iu(r.alternate,r);break;case 24:Vu(n,r),i&2048&&Lu(r.alternate,r);break;default:Vu(n,r)}t=t.sibling}}var Hu=8192;function Uu(e,t,n){if(e.subtreeFlags&Hu)for(e=e.child;e!==null;)Wu(e,t,n),e=e.sibling}function Wu(e,t,n){switch(e.tag){case 26:Uu(e,t,n),e.flags&Hu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Du,e.memoizedState,e.memoizedProps));break;case 5:Uu(e,t,n),e.flags&Hu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Du;Du=Em(e.stateNode.containerInfo),Uu(e,t,n),Du=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Hu,Hu=16777216,Uu(e,t,n),Hu=r):Uu(e,t,n));break;case 30:if((e.flags&Hu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ll===null&&(Ll=new Map),Ll.set(r,i)}Uu(e,t,n);break;default:Uu(e,t,n)}}function Gu(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 Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ou=r,Yu(r,e)}Gu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qu(e),e=e.sibling}function qu(e){switch(e.tag){case 0:case 11:case 15:Ku(e),e.flags&2048&&yl(9,e,e.return);break;case 3:Ku(e);break;case 12:Ku(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ju(e)):Ku(e);break;default:Ku(e)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ou=r,Yu(r,e)}Gu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:yl(8,t,t.return),Ju(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ju(t));break;default:Ju(t)}e=e.sibling}}function Yu(e,t){for(;ou!==null;){var n=ou;switch(n.tag){case 0:case 11:case 15:yl(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:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ou=r;else a:for(n=e;ou!==null;){r=ou;var i=r.sibling,a=r.return;if(_u(r),r===n){ou=null;break a}if(i!==null){i.return=a,ou=i;break a}ou=a}}}var Xu={getCacheForType:function(e){var t=U(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return U(Oa).controller.signal}},Zu=typeof WeakMap==`function`?WeakMap:Map,Qu=0,$u=null,ed=null,td=0,nd=0,rd=null,id=!1,ad=!1,od=!1,sd=0,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=null,hd=null,gd=!1,_d=0,vd=0,yd=1/0,bd=null,xd=null,Sd=0,Cd=null,wd=null,Td=0,Ed=0,Dd=null,Od=null,kd=null,Ad=null,jd=null,Md=0,Nd=null;function Pd(){return Qu&2&&td!==0?td&-td:I.T===null?xt():Rf()}function Fd(){if(fd===0){if(!(td&536870912)||ra){var e=at;at<<=1,!(at&3932160)&&(at=262144),fd=e}else fd=536870912}return e=Eo.current,e!==null&&(e.flags|=32),fd}function Id(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(_i(e.memoizedProps,n))),Ad===null&&(Ad=[]),Ad.push(t.bind(null,r))}}function Ld(e,t,n){(e===$u&&(nd===2||nd===9)||e.cancelPendingCommit!==null)&&(Wd(e,0),Vd(e,td,fd,!1)),mt(e,n),Qu&2&&e===$u||(e===$u&&(!(Qu&2)&&(ud|=n),cd===4&&Vd(e,td,fd,!1)),Af(e))}function Rd(e,t,n){if(Qu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),a=r?Qd(e,t):Xd(e,t,!0),o=r;do{if(a===0){ad&&!r&&Vd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Bd(n))a=Xd(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=md;var l=c.current.memoizedState.isDehydrated;if(l&&(Wd(c,s).flags|=256),s=Xd(c,s,!1),s!==2&&s!==6){if(od&&!l){c.errorRecoveryDisabledLanes|=o,ud|=o,a=4;break a}o=hd,hd=a,o!==null&&(hd===null?hd=o:hd.push.apply(hd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Wd(e,0),Vd(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:Vd(r,t,fd,!id);break a;case 2:hd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=_d+300-He(),10<a)){if(Vd(r,t,fd,!id),ct(r,0,!0)!==0)break a;Td=t,r.timeoutHandle=Sp(zd.bind(null,r,n,hd,bd,gd,t,fd,ud,pd,id,o,`Throttled`,-0,0),a);break a}zd(r,n,hd,bd,gd,t,fd,ud,pd,id,o,null,-0,0)}break}}while(1);Af(e)}function zd(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:xn},Ll=null,Wu(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=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?_d-He():(a&4194048)===a?vd-He():0,m=oh(d,m),m!==null)?(Td=a,e.cancelPendingCommit=m(of.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Vd(e,a,o,!l)):of(e,t,a,n,r,i,o,s,c,l,u,d)}function Bd(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(!Hr(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 Vd(e,t,n,r){t=ut(e,t),t&=~dd,t&=~ud,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&gt(e,n,t)}function Hd(){return Qu&6?!0:(jf(0,!1),!1)}function Ud(){if(ed!==null){if(nd===0)var e=ed.return;else e=ed,ga=ha=null,es(e),to=null,no=0,e=ed;for(;e!==null;)_l(e.alternate,e),e=e.return;ed=null}}function Wd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Td=0,Ud(),$u=e,ed=n=Ni(e.current,null),td=t,nd=0,rd=null,id=!1,ad=lt(e,t),od=!1,pd=fd=dd=ud=ld=cd=0,hd=md=null,gd=!1,sd=ut(e,t),Ci(),n}function Gd(e,t){K=null,I.H=uc,t===Ga||t===qa?(t=$a(),nd=3):t===Ka?(t=$a(),nd=4):nd=t===Oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,rd=t,ed===null&&(cd=1,Sc(e,Vi(t,e.current)))}function Kd(){var e=Eo.current;return e===null?!0:(td&4194048)===td?Do===null:(td&62914560)===td||td&536870912?e===Do:!1}function qd(){var e=I.H;return I.H=uc,e===null?uc:e}function Jd(){var e=I.A;return I.A=Xu,e}function Yd(){cd=4,id||(td&4194048)!==td&&Eo.current!==null||(ad=!0),!(ld&134217727)&&!(ud&134217727)||$u===null||Vd($u,td,fd,!1)}function Xd(e,t,n){var r=Qu;Qu|=2;var i=qd(),a=Jd();($u!==e||td!==t)&&(bd=null,Wd(e,t)),t=!1;var o=cd;a:do try{if(nd!==0&&ed!==null){var s=ed,c=rd;switch(nd){case 8:Ud(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=nd;if(nd=0,rd=null,nf(e,s,c,l),n&&ad){o=0;break a}break;default:l=nd,nd=0,rd=null,nf(e,s,c,l)}}Zd(),o=cd;break}catch(t){Gd(e,t)}while(1);return t&&e.shellSuspendCounter++,ga=ha=null,Qu=r,I.H=i,I.A=a,ed===null&&($u=null,td=0,Ci()),o}function Zd(){for(;ed!==null;)ef(ed)}function Qd(e,t){var n=Qu;Qu|=2;var r=qd(),a=Jd();$u!==e||td!==t?(bd=null,yd=He()+500,Wd(e,t)):ad=lt(e,t);a:do try{if(nd!==0&&ed!==null){t=ed;var o=rd;b:switch(nd){case 1:nd=0,rd=null,nf(e,t,o,1);break;case 2:case 9:if(Ya(o)){nd=0,rd=null,tf(t);break}t=function(){nd!==2&&nd!==9||$u!==e||(nd=7),Af(e)},o.then(t,t);break a;case 3:nd=7;break a;case 4:nd=5;break a;case 7:Ya(o)?(nd=0,rd=null,tf(t)):(nd=0,rd=null,nf(e,t,o,7));break;case 5:var s=null;switch(ed.tag){case 26:s=ed.memoizedState;case 5:case 27:var c=ed;if(s?th(s):c.stateNode.complete){nd=0,rd=null;var l=c.sibling;if(l!==null)ed=l;else{var u=c.return;u===null?ed=null:(ed=u,rf(u))}break b}}nd=0,rd=null,nf(e,t,o,5);break;case 6:nd=0,rd=null,nf(e,t,o,6);break;case 8:Ud(),cd=6;break a;default:throw Error(i(462))}}$d();break}catch(t){Gd(e,t)}while(1);return ga=ha=null,I.H=r,I.A=a,Qu=n,ed===null?($u=null,td=0,Ci(),cd):0}function $d(){for(;ed!==null&&!Be();)ef(ed)}function ef(e){var t=cl(e.alternate,e,sd);e.memoizedProps=e.pendingProps,t===null?rf(e):ed=t}function tf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Hc(n,t,t.pendingProps,t.type,void 0,td);break;case 11:t=Hc(n,t,t.pendingProps,t.type.render,t.ref,td);break;case 5:es(t);var r=t;r===ta&&(ra?(la(r),r.tag===5&&r.stateNode!=null&&(na=r.stateNode)):(la(r),ra=!0));default:_l(n,t),t=ed=Pi(t,sd),t=cl(n,t,sd)}e.memoizedProps=e.pendingProps,t===null?rf(e):ed=t}function nf(e,t,n,r){ga=ha=null,es(t),to=null,no=0;var i=t.return;try{if(Dc(e,i,t,n,td)){cd=1,Sc(e,Vi(n,e.current)),ed=null;return}}catch(t){if(i!==null)throw ed=i,t;cd=1,Sc(e,Vi(n,e.current)),ed=null;return}t.flags&32768?(ra||r===1?e=!0:ad||td&536870912?e=!1:(id=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),af(t,e)):rf(t)}function rf(e){var t=e;do{if(t.flags&32768){af(t,id);return}e=t.return;var n=hl(t.alternate,t,sd);if(n!==null){ed=n;return}if(t=t.sibling,t!==null){ed=t;return}ed=t=e}while(t!==null);cd===0&&(cd=5)}function af(e,t){do{var n=gl(e.alternate,e);if(n!==null){n.flags&=32767,ed=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ed=e;return}ed=e=n}while(e!==null);cd=6,ed=null}function of(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do mf();while(Sd!==0);if(Qu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===$u&&(ed=$u=null,td=0),wd=t,Cd=e,Td=n,Dd=a,Od=r,sf(e,t,n,s,c,l,f)}}function sf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ed=s,s|=Si,ht(e,n,s,r,i,a),Ad=null,(n&335544064)===n?(jd=Na(e),r=10262):(jd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Cf(Ke,function(){return hf(),null})):(e.callbackNode=null,e.callbackPriority=0),Il=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,i=he.p,he.p=2,a=Qu,Qu|=4;try{du(e,t,n)}finally{Qu=a,he.p=i,I.T=r}}Sd=1,Il?kd=Rp(o,e.containerInfo,jd,uf,df,lf,ff,hf,cf,null,null):(uf(),df(),ff())}function cf(e){if(Sd!==0){var t=Cd.onRecoverableError;t(e,{componentStack:null})}}function lf(){Sd===3&&(Sd=0,Mu(wd,Cd),Sd=4)}function uf(){if(Sd===1){Sd=0;var e=Cd,t=wd,n=Td,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=I.T,I.T=null;var i=he.p;he.p=2;var a=Qu;Qu|=4;try{cu=lu=!1,Ou(t,e,n),n=mp;var o=z(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Jr(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 _=Kr(s,h),v=Kr(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}}Sh=!!pp,mp=pp=null}finally{Qu=a,he.p=i,I.T=r}}e.current=t,Sd=2}}function df(){if(Sd===2){Sd=0;var e=Cd,t=wd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=he.p;he.p=2;var i=Qu;Qu|=4;try{pu(e,t.alternate,t)}finally{Qu=i,he.p=r,I.T=n}}Sd=3}}function ff(){if(Sd===4||Sd===3){Sd=0;var e=kd;kd=null,Ve();var t=Cd,n=wd,r=Td,i=Od,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Sd=5:(Sd=0,wd=Cd=null,pf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(xd=null),bt(r),n=n.stateNode,Qe&&typeof Qe.onCommitFiberRoot==`function`)try{Qe.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=I.T,a=he.p,he.p=2,I.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{I.T=n,he.p=a}}if(i=Ad,o=jd,jd=null,i!==null&&(Ad=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);Td&3&&mf(),Af(t),a=t.pendingLanes,r&261930&&a&42?t===Nd?Md++:(Md=0,Nd=t):(Md=0,Nd=null),jf(0,!1)}}function pf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function mf(){return kd!==null&&(kd.skipTransition(),kd=null),uf(),df(),ff(),hf()}function hf(){if(Sd!==5)return!1;var e=Cd,t=Ed;Ed=0;var n=bt(Td),r=I.T,a=he.p;try{he.p=32>n?32:n,I.T=null,n=Dd,Dd=null;var o=Cd,s=Td;if(Sd=0,wd=Cd=null,Td=0,Qu&6)throw Error(i(331));var c=Qu;if(Qu|=4,qu(o.current),zu(o,o.current,s,n),Qu=c,jf(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot==`function`)try{Qe.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{he.p=a,I.T=r,pf(e,t)}}function gf(e,t,n){t=Vi(n,t),t=wc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(mt(e,2),Af(e))}function _f(e,t,n){if(e.tag===3)gf(e,e,n);else for(;t!==null;){if(t.tag===3){gf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(xd===null||!xd.has(r))){e=Vi(n,e),n=Tc(2),r=mo(t,n,2),r!==null&&(Ec(n,r,t,e),mt(r,2),Af(r));break}}t=t.return}}function vf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Zu;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)||(od=!0,i.add(n),e=yf.bind(null,e,t,n),t.then(e,e))}function yf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$u===e&&(td&n)===n&&(cd===4||cd===3&&(td&62914560)===td&&300>He()-_d?Qu&2?dd|=n:Wd(e,0):dd|=n,pd===td&&(pd=0)),Af(e)}function bf(e,t){t===0&&(t=ft()),e=Ei(e,t),e!==null&&(mt(e,t),Af(e))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bf(e,n)}function Sf(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),bf(e,n)}function Cf(e,t){return Re(e,t)}var wf=null,Tf=null,Ef=!1,Df=!1,Of=!1,kf=0;function Af(e){e!==Tf&&e.next===null&&(Tf===null?wf=Tf=e:Tf=Tf.next=e),Df=!0,Ef||(Ef=!0,Lf())}function jf(e,t){if(!Of&&Df){Of=!0;do for(var n=!1,r=wf;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-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,If(r,a))}else a=td,a=ct(r,r===$u?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,If(r,a))}r=r.next}while(n);Of=!1}}function Mf(){Nf()}function Nf(){Df=Ef=!1;var e=0;kf!==0&&xp()&&(e=kf);for(var t=He(),n=null,r=wf;r!==null;){var i=r.next,a=Pf(r,t);a===0?(r.next=null,n===null?wf=i:n.next=i,i===null&&(Tf=n)):(n=r,(e!==0||a&3)&&(Df=!0)),r=i}Sd!==0&&Sd!==5||jf(e,!1),kf!==0&&(kf=0)}function Pf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=$u,n=td,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(nd===2||nd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ze(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ze(r),bt(n)){case 2:case 8:n=Ge;break;case 32:n=Ke;break;case 268435456:n=Je;break;default:n=Ke}return r=Ff.bind(null,e),n=Re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ze(r),e.callbackPriority=2,e.callbackNode=null,2}function Ff(e,t){if(Sd!==0&&Sd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(mf()&&e.callbackNode!==n)return null;var r=td;return r=ct(e,e===$u?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Rd(e,r,t),Pf(e,He()),e.callbackNode!=null&&e.callbackNode===n?Ff.bind(null,e):null)}function If(e,t){if(mf())return null;Rd(e,t,!0)}function Lf(){Ep(function(){Qu&6?Re(We,Mf):Nf()})}function Rf(){if(kf===0){var e=Ia;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),kf=e}return kf}function zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function Bf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=zf((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(kf!==0){var e=new FormData(i,o);Xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Vf=0;Vf<mi.length;Vf++){var Hf=mi[Vf];hi(Hf.toLowerCase(),`on`+(Hf[0].toUpperCase()+Hf.slice(1)))}hi(oi,`onAnimationEnd`),hi(si,`onAnimationIteration`),hi(ci,`onAnimationStart`),hi(`dblclick`,`onDoubleClick`),hi(`focusin`,`onFocus`),hi(`focusout`,`onBlur`),hi(li,`onTransitionRun`),hi(ui,`onTransitionStart`),hi(di,`onTransitionCancel`),hi(fi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Uf=`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(` `),Wf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Uf));function Gf(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){yi(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){yi(e)}i.currentTarget=null,a=c}}}}function Kf(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Xf(t,e,2,!1),n.add(r))}function qf(e,t,n){var r=0;t&&(r|=4),Xf(n,e,r,t)}var Jf=`_reactListening`+Math.random().toString(36).slice(2);function Yf(e){if(!e[Jf]){e[Jf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Wf.has(t)||qf(t,!1,e),qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jf]||(t[Jf]=!0,qf(`selectionchange`,!1,t))}}function Xf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!jn||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 Zf(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=Pt(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}On(function(){var r=a,i=Cn(n),s=[];a:{var c=pi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;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=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case oi:case si:case ci:l=Qn;break;case fi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}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=kn(m,p),g!=null&&d.push(Qf(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!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))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?Pt(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=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ep):null,c!==null&&tp(s,u,c,d,!1),l!==null&&f!==null&&tp(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=jr;else if(Er(c)){if(Mr)_=R;else{_=zr;var v=Rr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=jr):_=Br;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&(Xr=v,Zr=r,Qr=null);break;case`focusout`:Qr=Zr=Xr=null;break;case`mousedown`:$r=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:$r=!1,ei(s,n,i);break;case`selectionchange`:if(Yr)break;case`keydown`:case`keyup`:ei(s,n,i)}var y;if(mr)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 Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=$f(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=$f(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Bf(s,e,r,n,i)}Gf(s,t)})}function Qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $f(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=kn(e,n),i!=null&&r.unshift(Qf(e,i,a)),i=kn(e,t),i!=null&&r.push(Qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ep(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tp(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=kn(n,a),l!=null&&o.unshift(Qf(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(Qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var np=/\r\n?/g,rp=/\u0000|\uFFFD/g;function ip(e){return(typeof e==`string`?e:``+e).replace(np,`
10
+ `).replace(rp,``)}function ap(e,t){return t=ip(t),ip(e)===t}function op(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(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=bn(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`&&op(e,t,`name`,a.name,a,null),op(e,t,`formEncType`,a.formEncType,a,null),op(e,t,`formMethod`,a.formMethod,a,null),op(e,t,`formTarget`,a.formTarget,a,null)):(op(e,t,`encType`,a.encType,a,null),op(e,t,`method`,a.method,a,null),op(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Kf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Kf(`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=bn(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`:Kf(`beforetoggle`,e),Kf(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(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=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function sp(e,t,n,r,a,o){switch(n){case`style`:gn(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`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&Kf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Kf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.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[Tt]||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}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Kf(`error`,e),Kf(`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:op(e,t,o,s,n,null)}}a&&op(e,t,`srcSet`,n.srcSet,n,null),r&&op(e,t,`src`,n.src,n,null);return;case`input`:Kf(`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:op(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Kf(`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:op(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in Kf(`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:op(e,t,s,c,n,null)}fn(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:op(e,t,l,r,n,null)}return;case`dialog`:Kf(`beforetoggle`,e),Kf(`toggle`,e),Kf(`cancel`,e),Kf(`close`,e);break;case`iframe`:case`object`:Kf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Uf.length;r++)Kf(Uf[r],e);break;case`image`:Kf(`error`,e),Kf(`load`,e);break;case`details`:Kf(`toggle`,e);break;case`embed`:case`source`:case`link`:Kf(`error`,e),Kf(`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:op(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&op(e,t,c,r,n,null))}var lp={};function up(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)||op(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&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&op(e,t,p,m,r,f)}}sn(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)||op(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&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&op(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(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:op(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&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&op(e,t,s,a,r,o)}dn(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:op(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&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:op(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)&&op(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:op(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(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||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&op(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||op(e,t,f,p,r,m)}function dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){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&&dp(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&&dp(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 pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(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 _p(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 vp(e,t,n,r){return n=hp(n).createElement(e),n[wt]=r,n[Tt]=t,cp(n,e,t),Rt(n),n}function yp(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 bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(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),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(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 jp(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 Mp(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 Np(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 Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(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`&&(Ip(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+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.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 zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.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},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.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(Kp(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=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(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,Wp(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,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=b(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=hp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(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=b(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(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=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(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=b(n[0]),i=b(n[n.length-1]);var a=_(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||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Pt(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=g(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=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function rm(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)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),rm(e,n);return}if(r=b(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=b(a),rm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=b(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(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,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(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,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(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`:cm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(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[jt])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=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(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 hm(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 gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(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 ym(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 bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(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 Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&op(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Nt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var wm=new Map,Tm=new Set;function Em(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 Dm=he.d;he.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Hd();return e||t}function km(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?Qs(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),cp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);cp(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),cp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=Lt(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);Rt(c),cp(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 Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=Lt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=D({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Rt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=Lt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Rt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=we.current)?Em(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=Bm(n.href),t=Lt(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=Bm(n.href);var o=Lt(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(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.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},wm.set(e,o)),Um(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=Wm(n),t=Lt(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 Bm(e){return`href="`+on(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),cp(t,`link`,n),Rt(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 Wm(e){return`[src="`+on(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),cp(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,Rt(a),a):(r=n,(a=wm.get(o))&&(r=D({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),cp(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 Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,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[jt]||a[wt]||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 Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(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 eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(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=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(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=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.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=ch.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 ph={$$typeof:N,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function mh(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=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(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 hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ji(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function gh(e){return e?(e=ki,e):ki}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Ld(n,e,t),ho(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Ei(e,67108864);t!==null&&Ld(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Pd();t=yt(t);var n=Ei(e,t);n!==null&&Ld(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=I.T;I.T=null;var a=he.p;try{he.p=2,Th(e,t,n,r)}finally{he.p=a,I.T=i}}function wh(e,t,n,r){var i=I.T;I.T=null;var a=he.p;try{he.p=8,Th(e,t,n,r)}finally{he.p=a,I.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Zf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Af(a),!(Qu&6)&&(yd=He()+500,jf(0,!1))}}break;case 31:case 13:s=Ei(a,2),s!==null&&Ld(s,a,2),Hd(),yh(a,2)}if(a=Eh(r),a===null&&Zf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Zf(e,t,r,null,n)}}function Eh(e){return e=Cn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Pt(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 Dh=e,null}function kh(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(Ue()){case We:return 2;case Ge:return 8;case Ke:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(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=Ft(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Pt(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,St(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){xh(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 Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=Ft(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=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(Oh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,Xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.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[Tt]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){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 Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;_h(n,Pd(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Hd(),t[Et]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.1`)throw Error(i(527,Qh,`19.3.1`));he.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:f(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Ze=eg.inject($h),Qe=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=yc,s=bc,c=xc;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=hh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[Et]=t.current,Yf(e),new Xh(t)}})),_=o(((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=g()})),v=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function y(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:v(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var b=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},x=e=>{let t=b(e);return t.charAt(0).toUpperCase()+t.slice(1)},S=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),C={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 w(e){return e!=null}function T(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??C.width,a=e.size??e.height??C.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?S(...c):S(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??C[`stroke-width`])*Number(e.size??e.width??C.width)/Number(t.size??t.width??C.width):t.strokeWidth??C[`stroke-width`];return[`svg`,{...Object.entries(C).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&w(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&w(t.width)&&{[r(`width`)]:t.width},...`height`in t&&w(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 E(e,t={}){return T(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var D=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},O=c(d(),1),k=(0,O.createContext)({}),A=()=>(0,O.useContext)(k),j=(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=``}=A()??{},y=!!c||D(d),[b,x,C=[]]=E(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:S(v,s),hasA11yProp:y,attributes:d});return(0,O.createElement)(b,{ref:f,...x},[...C.map(([e,t])=>(0,O.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function M(e,t=[],n=[]){let r=typeof e==`string`?y(e,t,n):e,i=(0,O.forwardRef)(({className:e,...t},n)=>(0,O.createElement)(j,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=x(r.name)),i}var ee={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};ee.node;var te=M(ee),N={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};N.node;var P=M(N),ne={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};ne.node;var re=M(ne),ie={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`}]]};ie.node;var ae=M(ie),F={name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]};F.node;var oe=M(F),se={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`}]]};se.node;var ce=M(se),le={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};le.node;var ue=M(le),de={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};de.node;var fe=M(de),pe={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};pe.node;var me=M(pe),I={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};I.node;var he=M(I),ge={name:`circle-alert`,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`]};ge.node;var _e=M(ge),ve={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};ve.node;var ye=M(ve),be={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};be.node;var xe=M(be),Se={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`}]]};Se.node;var Ce=M(Se),we={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`}]]};we.node;var Te=M(we),Ee={name:`door-open`,size:24,node:[[`path`,{d:`M10 21H2`,key:`1sthdo`}],[`path`,{d:`M10 3H7a2 2 0 00-2 2v16`,key:`15gt7x`}],[`path`,{d:`M14 12h.01`,key:`1jfl7z`}],[`path`,{d:`M19 21V5a2 2 0 00-1.675-1.974l-6.163-1.013A1 1 0 0010 3v18a1 1 0 001.124.992z`,key:`tyvg9a`}],[`path`,{d:`M22 21h-3`,key:`1ec3tr`}]]};Ee.node;var De=M(Ee),Oe={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`}]]};Oe.node;var ke=M(Oe),Ae={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Ae.node;var je=M(Ae),Me={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Me.node;var Ne=M(Me),Pe={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`}]]};Pe.node;var Fe=M(Pe),Ie={name:`folder-kanban`,size:24,node:[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]};Ie.node;var Le=M(Ie),Re={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Re.node;var ze=M(Re),Be={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`}]]};Be.node;var Ve=M(Be),He={name:`image-up`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};He.node;var Ue=M(He),We={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`}]]};We.node;var Ge=M(We),Ke={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`}]]};Ke.node;var qe=M(Ke),Je={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};Je.node;var Ye=M(Je),Xe={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Xe.node;var Ze=M(Xe),Qe={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Qe.node;var $e=M(Qe),et={name:`life-buoy`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]};et.node;var tt=M(et),nt={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`}]]};nt.node;var rt=M(nt),it={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`}]]};it.node;var at=M(it),ot={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};ot.node;var st=M(ot),ct={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};ct.node,M(ct);var lt={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};lt.node;var ut=M(lt),dt={name:`mail-plus`,size:24,node:[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M16 19h6`,key:`xwg31i`}]]};dt.node;var ft=M(dt),pt={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};pt.node;var mt=M(pt),ht={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};ht.node;var gt=M(ht),_t={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};_t.node;var vt=M(_t),yt={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};yt.node;var bt=M(yt),xt={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};xt.node;var St=M(xt),Ct={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`}]]};Ct.node;var wt=M(Ct),Tt={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Tt.node;var Et=M(Tt),Dt={name:`move-right`,size:24,node:[[`path`,{d:`M18 8L22 12L18 16`,key:`1r0oui`}],[`path`,{d:`M2 12H22`,key:`1m8cig`}]]};Dt.node;var Ot=M(Dt),kt={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};kt.node;var At=M(kt),jt={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};jt.node;var Mt=M(jt),Nt={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`}]]};Nt.node;var Pt=M(Nt),Ft={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`}]]};Ft.node;var It=M(Ft),Lt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Lt.node;var Rt=M(Lt),zt={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};zt.node;var Bt=M(zt),Vt={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`}]]};Vt.node;var Ht=M(Vt),Ut={name:`rotate-ccw-clock`,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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Ut.node;var Wt=M(Ut),Gt={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`}]]};Gt.node;var Kt=M(Gt),qt={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};qt.node;var Jt=M(qt),Yt={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Yt.node;var Xt=M(Yt),Zt={name:`server-cog`,size:24,node:[[`path`,{d:`m10.852 14.772-.383.923`,key:`11vil6`}],[`path`,{d:`M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923`,key:`1v3clb`}],[`path`,{d:`m13.148 9.228.383-.923`,key:`t2zzyc`}],[`path`,{d:`m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544`,key:`1bxfiv`}],[`path`,{d:`m14.772 10.852.923-.383`,key:`k9m8cz`}],[`path`,{d:`m14.772 13.148.923.383`,key:`1xvhww`}],[`path`,{d:`M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5`,key:`tn8das`}],[`path`,{d:`M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5`,key:`1g2pve`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M6 6h.01`,key:`1utrut`}],[`path`,{d:`m9.228 10.852-.923-.383`,key:`1wtb30`}],[`path`,{d:`m9.228 13.148-.923.383`,key:`1a830x`}]]};Zt.node;var Qt=M(Zt),$t={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`}]]};$t.node;var en=M($t),tn={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};tn.node;var nn=M(tn),rn={name:`shield-alert`,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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};rn.node;var an=M(rn),on={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`}]]};on.node;var sn=M(on),cn={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`}]]};cn.node;var ln=M(cn),un={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`}]]};un.node;var dn=M(un),fn={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`}]]};fn.node;var pn=M(fn),mn={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};mn.node;var hn=M(mn),gn={name:`thumbs-down`,size:24,node:[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]};gn.node;var _n=M(gn),vn={name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]};vn.node;var yn=M(vn),bn={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`]};bn.node;var xn=M(bn),Sn={name:`triangle-alert`,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`]};Sn.node;var Cn=M(Sn),wn={name:`user-minus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};wn.node;var Tn=M(wn),En={name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};En.node;var Dn=M(En),On={name:`user-round-check`,size:24,node:[[`path`,{d:`M2 21a8 8 0 0 1 13.292-6`,key:`bjp14o`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]],aliases:[`user-check-2`]};On.node;var kn=M(On),An={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};An.node;var jn=M(An),Mn={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Mn.node;var Nn=M(Mn),Pn={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`}]]};Pn.node;var Fn=M(Pn),In={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};In.node;var Ln=M(In),Rn=_();function zn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=zn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Bn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zn(e))&&(r&&(r+=` `),r+=t);return r}var Vn=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Hn=(e,t)=>({classGroupId:e,validator:t}),Un=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wn=`-`,Gn=[],Kn=`arbitrary..`,qn=e=>{let t=Xn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Yn(e);let n=e.split(Wn);return Jn(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Vn(i,t):t:i||Gn}return n[e]||Gn}}},Jn=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Jn(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Wn):e.slice(t).join(Wn),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Yn=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Kn+r:void 0})(),Xn=e=>{let{theme:t,classGroups:n}=e;return Zn(n,t)},Zn=(e,t)=>{let n=Un();for(let r in e){let i=e[r];Qn(i,n,r,t)}return n},Qn=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];$n(i,t,n,r)}},$n=(e,t,n,r)=>{typeof e==`string`?er(e,t,n):typeof e==`function`?tr(e,t,n,r):nr(e,t,n,r)},er=(e,t,n)=>{let r=e===``?t:rr(t,e);r.classGroupId=n},tr=(e,t,n,r)=>{ir(e)?Qn(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Hn(n,e)))},nr=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Qn(o,rr(t,a),n,r)}},rr=(e,t)=>{let n=e,r=t.split(Wn),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Un(),n.nextPart.set(t,i)),n=i}return n},ir=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ar=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},or=`!`,sr=`:`,cr=[],lr=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ur=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===sr){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(or)?(c=s.slice(0,-1),l=!0):s.startsWith(or)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return lr(t,l,c,u)};if(t){let e=t+sr,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):lr(cr,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},dr=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},fr=e=>({cache:ar(e.cacheSize),parseClassName:ur(e),sortModifiers:dr(e),postfixLookupClassGroupIds:pr(e),...qn(e)}),pr=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},mr=/\s+/,hr=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(mr),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+or:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},gr=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=_r(n))&&(i&&(i+=` `),i+=r);return i},_r=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=_r(e[r]))&&(n&&(n+=` `),n+=t);return n},vr=(e,...t)=>{let n,r,i,a,o=o=>(n=fr(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=hr(e,n);return i(e,a),a};return a=o,(...e)=>a(gr(...e))},yr=[],br=e=>{let t=t=>t[e]||yr;return t.isThemeGetter=!0,t.themeKey=e,t},xr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Er=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Dr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Or=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kr=e=>Cr.test(e),L=e=>!!e&&!Number.isNaN(Number(e)),Ar=e=>!!e&&Number.isInteger(Number(e)),jr=e=>e.endsWith(`%`)&&L(e.slice(0,-1)),Mr=e=>wr.test(e),Nr=()=>!0,Pr=e=>Tr.test(e)&&!Er.test(e),Fr=()=>!1,Ir=e=>Dr.test(e),Lr=e=>Or.test(e),Rr=e=>!R(e)&&!z(e),zr=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Br=e=>ti(e,ai,Fr),R=e=>xr.test(e),Vr=e=>ti(e,oi,Pr),Hr=e=>ti(e,si,L),Ur=e=>ti(e,li,Nr),Wr=e=>ti(e,ci,Fr),Gr=e=>ti(e,ri,Fr),Kr=e=>ti(e,ii,Lr),qr=e=>ti(e,ui,Ir),z=e=>Sr.test(e),Jr=e=>ni(e,oi),Yr=e=>ni(e,ci),Xr=e=>ni(e,ri),Zr=e=>ni(e,ai),Qr=e=>ni(e,ii),$r=e=>ni(e,ui,!0),ei=e=>ni(e,li,!0),ti=(e,t,n)=>{let r=xr.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ni=(e,t,n=!1)=>{let r=Sr.exec(e);return r?r[1]?t(r[1]):n:!1},ri=e=>e===`position`||e===`percentage`,ii=e=>e===`image`||e===`url`,ai=e=>e===`length`||e===`size`||e===`bg-size`,oi=e=>e===`length`,si=e=>e===`number`,ci=e=>e===`family-name`,li=e=>e===`number`||e===`weight`,ui=e=>e===`shadow`,di=()=>{let e=br(`color`),t=br(`font`),n=br(`text`),r=br(`font-weight`),i=br(`tracking`),a=br(`leading`),o=br(`breakpoint`),s=br(`container`),c=br(`spacing`),l=br(`radius`),u=br(`shadow`),d=br(`inset-shadow`),f=br(`text-shadow`),p=br(`drop-shadow`),m=br(`blur`),h=br(`perspective`),g=br(`aspect`),_=br(`ease`),v=br(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),z,R],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[z,R,c],T=()=>[kr,`full`,`auto`,...w()],E=()=>[Ar,`none`,`subgrid`,z,R],D=()=>[`auto`,{span:[`full`,Ar,z,R]},Ar,z,R],O=()=>[Ar,`auto`,z,R],k=()=>[`auto`,`min`,`max`,`fr`,z,R],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],ee=()=>[kr,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[s,kr,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],N=()=>[kr,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,z,R],ne=()=>[...b(),Xr,Gr,{position:[z,R]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Zr,Br,{size:[z,R]}],ae=()=>[jr,Jr,Vr],F=()=>[``,`none`,`full`,l,z,R],oe=()=>[``,L,Jr,Vr],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[L,jr,Xr,Gr],ue=()=>[``,`none`,m,z,R],de=()=>[`none`,L,z,R],fe=()=>[`none`,L,z,R],pe=()=>[L,z,R],me=()=>[kr,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Mr],breakpoint:[Mr],color:[Nr],container:[Mr],"drop-shadow":[Mr],ease:[`in`,`out`,`in-out`],font:[Rr],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Mr],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Mr],shadow:[Mr],spacing:[`px`,L],text:[Mr],"text-shadow":[Mr],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,kr,R,z,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,z,R]}],"container-named":[zr],columns:[{columns:[L,`auto`,R,z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ar,`auto`,z,R]}],basis:[{basis:[kr,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[L,kr,`auto`,`initial`,`none`,R]}],grow:[{grow:[``,L,z,R]}],shrink:[{shrink:[``,L,z,R]}],order:[{order:[Ar,`first`,`last`,`none`,z,R]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ee()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...N()]}],"min-block-size":[{"min-block":[`auto`,...N()]}],"max-block-size":[{"max-block":[`none`,...N()]}],w:[{w:[s,`screen`,...ee()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ee()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ee()]}],h:[{h:[`screen`,`lh`,...ee()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ee()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...ee()]}],"font-size":[{text:[`base`,n,Jr,Vr]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ei,Ur]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,jr,R]}],"font-family":[{font:[Yr,Wr,t]}],"font-features":[{"font-features":[R]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,z,R]}],"line-clamp":[{"line-clamp":[L,`none`,z,Hr]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,z,R]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,z,R]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[L,`from-font`,`auto`,z,Vr]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[L,`auto`,z,R]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ar,z,R]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,z,R]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,z,R]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ar,z,R],radial:[``,z,R],conic:[``,Ar,z,R]},Qr,Kr]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[L,z,R]}],"outline-w":[{outline:[``,L,Jr,Vr]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`inner`,`none`,u,$r,qr]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,$r,qr]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[L,Vr]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,$r,qr]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[L,z,R]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[L]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[z,R]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[L]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,z,R]}],filter:[{filter:[``,`none`,z,R]}],blur:[{blur:ue()}],brightness:[{brightness:[L,z,R]}],contrast:[{contrast:[L,z,R]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,$r,qr]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,L,z,R]}],"hue-rotate":[{"hue-rotate":[L,z,R]}],invert:[{invert:[``,L,z,R]}],saturate:[{saturate:[L,z,R]}],sepia:[{sepia:[``,L,z,R]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,z,R]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[L,z,R]}],"backdrop-contrast":[{"backdrop-contrast":[L,z,R]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,L,z,R]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[L,z,R]}],"backdrop-invert":[{"backdrop-invert":[``,L,z,R]}],"backdrop-opacity":[{"backdrop-opacity":[L,z,R]}],"backdrop-saturate":[{"backdrop-saturate":[L,z,R]}],"backdrop-sepia":[{"backdrop-sepia":[``,L,z,R]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,z,R]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[L,`initial`,z,R]}],ease:[{ease:[`linear`,`initial`,_,z,R]}],delay:[{delay:[L,z,R]}],animate:[{animate:[`none`,v,z,R]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,z,R]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[z,R,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ar,z,R]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,z,R]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,z,R]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[L,Jr,Vr,Hr]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},fi=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(pi(e,`cacheSize`,t),pi(e,`prefix`,n),pi(e,`experimentalParseClassName`,r),mi(e.theme,a.theme),mi(e.classGroups,a.classGroups),mi(e.conflictingClassGroups,a.conflictingClassGroups),mi(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),pi(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),pi(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),hi(e.theme,i.theme),hi(e.classGroups,i.classGroups),hi(e.conflictingClassGroups,i.conflictingClassGroups),hi(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),gi(e,i,`postfixLookupClassGroups`),gi(e,i,`orderSensitiveModifiers`),e),pi=(e,t,n)=>{n!==void 0&&(e[t]=n)},mi=(e,t)=>{if(t)for(let n in t)pi(e,n,t[n])},hi=(e,t)=>{if(t)for(let n in t)gi(e,t,n)},gi=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},_i=((e,...t)=>typeof e==`function`?vr(di,e,...t):vr(()=>fi(di(),e),...t))({extend:{theme:{text:[`caption`,`ui`,`title`,`heading`,`display`],shadow:[`card`,`pop`,`lift`,`thumb`]}}});function B(...e){return _i(Bn(e))}var vi=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]],yi=null,bi=0;function xi(e){let t=new Date(e).getTime();return Number.isFinite(t)?yi!==null&&t<=yi?t+bi:t:NaN}function Si(e,t=Date.now()){let n=xi(e);if(!Number.isFinite(n))return``;let r=Math.round((n-t)/1e3),i=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`});for(let[e,t]of vi)if(Math.abs(r)>=t)return i.format(Math.round(r/t),e);return`just now`}var Ci=new Map,wi=new Set,Ti=e=>String(e||``).trim().toLowerCase(),Ei=new Map,Di=e=>(wi.add(e),()=>wi.delete(e)),Oi=()=>Ci;function ki(e,t=null){let n=(0,O.useSyncExternalStore)(Di,Oi,Oi),r=t?Ei.get(t):null;if(r)return{icon:r.icon,tint:r.tint,logo:r.logo};let i=n.get(Ti(e));if(i)return i;for(let t of Ei.values())if(t.label&&Ti(t.label)===Ti(e))return{icon:t.icon,tint:t.tint,logo:t.logo};return null}var Ai=[`boxy`,`dot`,`cyclops`,`ghost`,`cat`,`owl`,`bear`,`alien`,`cloud`,`planet`,`hex`,`drop`],ji=[`blue`,`violet`,`pink`,`amber`,`green`,`cyan`,`indigo`,`magenta`],Mi=/^upload:([0-9a-f]{32})$/,Ni=[[0,31],[127,159],[8203,8207],[8232,8238],[8288,8297],[65279,65279]],Pi=e=>[...e].some(e=>Ni.some(([t,n])=>e.codePointAt(0)>=t&&e.codePointAt(0)<=n));function Fi(e){if(e==null)return{name:null,problem:null};if(typeof e!=`string`)return{name:null,problem:`name: text, 1 to 40 characters`};if(Pi(e))return{name:null,problem:`name: one line of plain text, without control characters`};let t=e.trim();return t?[...t].length>40?{name:null,problem:`name: at most 40 characters`}:{name:t,problem:null}:{name:null,problem:null}}var Ii=e=>typeof e==`string`&&Mi.test(e),Li=e=>typeof e==`string`&&Mi.exec(e)?.[1]||null,Ri=`Simple Icons 16.37.0 (https://simpleicons.org), CC0 1.0`,zi=[{id:`claude`,name:`Claude`,owner:`Anthropic, PBC`,agents:[`claude`],viewBox:`0 0 24 24`,path:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`,source:`${Ri}, icons/claude.svg`},{id:`openai`,name:`OpenAI`,owner:`OpenAI`,agents:[`codex`],viewBox:`0 0 24 24`,path:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,source:`Simple Icons 15.22.0 (https://simpleicons.org), CC0 1.0, icons/openai.svg`},{id:`goose`,name:`goose`,owner:`LF Projects, LLC`,agents:[`goose`],viewBox:`0 0 45 45`,path:`M43.2098 39.2492L39.8118 36.4522C37.9646 34.9318 36.3923 33.1051 35.1631 31.0529C33.4647 28.2172 31.1178 25.8243 28.3164 24.071L26.9482 23.2744C26.4794 22.9485 26.1525 22.4405 26.106 21.8675C26.0762 21.4981 26.1647 21.1678 26.3712 20.8771C27.0837 19.873 30.9617 15.6995 31.6365 15.1411C32.5056 14.4228 33.4739 13.8253 34.3724 13.1412C34.5001 13.0438 34.6283 12.9469 34.7545 12.8481C34.7589 12.8437 34.7653 12.8403 34.7692 12.8363C35.0574 12.6088 35.3295 12.3671 35.5458 12.0803C36.5993 10.8604 36.5783 9.82938 36.5783 9.82938C36.5783 9.82938 36.5793 9.8284 36.5798 9.82791C36.4677 9.5534 36.0645 8.69902 35.2449 8.29825C35.9696 8.28406 36.7872 8.55564 37.1582 8.91873C37.6039 8.21947 37.8922 7.76585 38.3404 7.00347C38.4471 6.82241 38.5038 6.48771 38.2998 6.30029C38.2998 6.30029 38.2988 6.30029 38.2978 6.30029C38.2978 6.30029 38.2978 6.29931 38.2978 6.29833C38.2939 6.29442 38.289 6.29148 38.2851 6.28757C38.2812 6.28365 38.2787 6.27925 38.2743 6.27485C38.2743 6.27485 38.2734 6.27485 38.2724 6.27485C38.2724 6.27485 38.2724 6.27387 38.2724 6.27289C38.2641 6.26457 38.2548 6.25821 38.246 6.25038C38.2406 6.245 38.2362 6.23864 38.2313 6.23276C38.2254 6.22787 38.219 6.22347 38.2137 6.21808C38.2053 6.20977 38.2 6.19949 38.1911 6.19166C38.1911 6.19166 38.1897 6.19117 38.1892 6.19166C38.1892 6.19166 38.1892 6.19068 38.1892 6.1897C38.1853 6.18579 38.1804 6.18285 38.1765 6.17894C38.1726 6.17502 38.1696 6.17013 38.1657 6.16621C38.1657 6.16621 38.1642 6.16572 38.1637 6.16621C38.1637 6.16621 38.1637 6.16524 38.1637 6.16426C37.9763 5.9602 37.6416 6.01697 37.4606 6.12364C36.4692 6.70693 35.5047 7.33475 34.6351 7.88525C34.6351 7.88525 33.6046 7.86372 32.3842 8.91775C32.097 9.13452 31.8552 9.4066 31.6282 9.69433C31.6238 9.69873 31.6199 9.7046 31.6164 9.70901C31.5171 9.83476 31.4202 9.96297 31.3233 10.0912C30.6387 10.9901 30.0417 11.958 29.3234 12.8271C28.7656 13.5023 24.5915 17.3798 23.5874 18.0923C23.2967 18.2988 22.9669 18.3879 22.597 18.3575C22.0245 18.3115 21.5161 17.9842 21.1902 17.5154L20.3935 16.1472C18.6402 13.3448 16.2474 10.9989 13.4117 9.30041C11.3594 8.0712 9.5332 6.49847 8.01234 4.65172L5.2153 1.25377C5.0773 1.08642 4.81306 1.11382 4.71422 1.30662C4.39615 1.92612 3.78888 3.23411 3.32353 4.99327C3.31227 5.03487 3.32206 5.07891 3.34946 5.11218C3.92786 5.81095 5.26717 7.35089 6.8624 8.65351C6.97348 8.74403 6.88246 8.92313 6.74447 8.88496C5.36846 8.51013 4.03062 7.90825 3.02944 7.39542C2.94772 7.35383 2.84887 7.4057 2.83713 7.49672C2.68152 8.74354 2.64139 10.1127 2.80581 11.5562C2.8107 11.6032 2.84055 11.6438 2.8841 11.6629C4.02572 12.1596 5.85143 12.8804 7.76816 13.3389C7.90713 13.3722 7.90273 13.5723 7.76229 13.5992C6.26982 13.8801 4.70688 13.9427 3.43656 13.9261C3.3475 13.9251 3.28193 14.0093 3.30591 14.0949C3.56085 14.9958 3.90632 15.9118 4.3619 16.8342C4.55029 17.2487 4.75532 17.6553 4.97504 18.0532C5.01271 18.1212 5.08562 18.1618 5.16343 18.1584C6.21207 18.107 7.47946 17.9964 8.75369 17.7713C8.97095 17.7331 9.08741 18.0189 8.90391 18.1417C8.03877 18.7201 7.11588 19.2183 6.25758 19.6283C6.14259 19.6836 6.1054 19.8304 6.18125 19.9327C6.69114 20.6236 7.25191 21.2774 7.86114 21.8866C7.86114 21.8866 10.8608 24.9763 10.9425 25.2185C12.6928 23.4261 15.5701 21.4394 18.7474 19.7047C14.4921 23.1672 12.1198 25.7235 10.9258 27.1758L10.0935 28.3439C9.66091 28.9507 9.2856 29.5951 8.97193 30.2709C7.92231 32.5292 6.19201 37.0966 6.19201 37.0966C6.0594 37.4543 6.16755 37.8072 6.39753 38.0371C6.40292 38.0425 6.4083 38.0479 6.41417 38.0528C6.41955 38.0582 6.42445 38.0641 6.42983 38.0694C6.66031 38.2999 7.01263 38.4076 7.37033 38.275C7.37033 38.275 11.9368 36.5447 14.1961 35.495C14.8719 35.1814 15.5168 34.8056 16.1231 34.3735L17.4095 33.457C18.0907 32.9715 19.0234 33.0489 19.615 33.6405L22.5804 36.6058C23.1896 37.2151 23.8433 37.7758 24.5343 38.2857C24.637 38.3611 24.7833 38.3244 24.8386 38.2094C25.2492 37.3516 25.7473 36.4277 26.3252 35.5631C26.4481 35.3796 26.7343 35.4965 26.6957 35.7133C26.4701 36.988 26.3605 38.2554 26.3086 39.3035C26.3047 39.3809 26.3458 39.4543 26.4138 39.4919C26.8112 39.7121 27.2178 39.9172 27.6327 40.1051C28.5551 40.5606 29.4717 40.9066 30.3721 41.1611C30.4577 41.185 30.5419 41.1195 30.5409 41.0304C30.5237 39.7596 30.5864 38.1967 30.8677 36.7047C30.8942 36.5638 31.0943 36.5593 31.1281 36.6988C31.5861 38.616 32.3069 40.4417 32.8041 41.5829C32.8231 41.6264 32.8633 41.6558 32.9107 41.6612C34.3543 41.8256 35.7234 41.7855 36.9703 41.6298C37.0618 41.6186 37.1136 41.5197 37.0715 41.4375C36.5587 40.4364 35.9568 39.0975 35.582 37.7225C35.5443 37.584 35.7229 37.4935 35.8135 37.6046C37.1161 39.1998 38.656 40.5391 39.3548 41.1175C39.3881 41.1449 39.4326 41.1542 39.4737 41.1434C41.2333 40.6786 42.5413 40.0713 43.1604 39.7528C43.3532 39.6539 43.3806 39.3897 43.2132 39.2517L43.2098 39.2492Z`,source:`github.com/aaif-goose/goose at 0c5b5e2f2e7933fca4de5377d239645dcbe4cbb3, documentation/static/img/goose.svg (Apache 2.0; LF Projects trademark policy)`},{id:`gemini`,name:`Google Gemini`,owner:`Google LLC`,agents:[`gemini`],viewBox:`0 0 24 24`,path:`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,source:`${Ri}, icons/googlegemini.svg`}],Bi=e=>zi.find(t=>t.id===e)||null,Vi=e=>zi.find(t=>t.agents.includes(e))?.id||null;function Hi(e){let t=Array.isArray(e?.profiles)?e.profiles:[],n=e?.profileId||`default`,r=t.find(e=>e.id==="default"),i=r?.sameAs||`default`,a=t.filter(e=>!(e.id==="default"&&e.sameAs)).map(e=>({id:e.id,label:e.label||(e.id==="default"?`Default connection`:e.id),configured:e.configured!==!1,state:e.configured===!1?`unavailable`:e.state||`ready`,loginHint:e.loginHint||null,line:typeof e.line==`string`&&e.line?e.line:null,isDefault:e.id===i,icon:e.icon||null,tint:e.tint||null,logo:e.logo||null})),o=n==="default"&&r?.sameAs?r.sameAs:n,s=a.some(e=>e.id===o);return{show:t.length>0&&(a.length>1||!s),value:o,known:s,options:a}}var Ui={ready:`Ready`,login:`Not signed in`,starting:`Starting`,testing:`Testing the connection`,"not-responding":`Not responding`,unavailable:`Not set up`},Wi={ready:`bg-ok`,login:`bg-warn`,starting:`bg-accent motion-safe:animate-pulse`,testing:`bg-accent motion-safe:animate-pulse`,"not-responding":`bg-bad`,unavailable:`bg-faint`};function Gi(e){return e?`Sign in: ${String(e).split(/, or /)[0]}`:null}function Ki(e){if(e?.line)return e.line;let t=Ui[e?.state]||Ui.ready;return e?.state===`login`&&e.loginHint?`${t}. ${Gi(e.loginHint)}`:t}function qi(e){let t=String(e||`?`).trim().split(/\s+/).filter(Boolean);if(!t.length)return`?`;if(t.length>1)return(t[0][0]+t[1][0]).toUpperCase();let n=t[0];return n[0].toUpperCase()+(n[1]||``).toLowerCase()}var Ji=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Yi=o(((e,t)=>{t.exports=Ji()})),V=Yi(),Xi=e=>ca[ji.indexOf(e)]||null,Zi={blue:`Blue`,violet:`Violet`,pink:`Pink`,amber:`Amber`,green:`Green`,cyan:`Cyan`,indigo:`Indigo`,magenta:`Magenta`},Qi=`#fff`,$i=`currentColor`,ea=(e=26)=>(0,V.jsx)(`path`,{d:`M16.5 ${e}q3.5 2.8 7 0`,fill:`none`,stroke:$i,strokeWidth:`1.8`,strokeLinecap:`round`}),ta={boxy:{name:`Square robot`,tint:`blue`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M20 13V8`,stroke:Qi,strokeWidth:`2.4`,strokeLinecap:`round`}),(0,V.jsx)(`circle`,{cx:`20`,cy:`7`,r:`2.6`,fill:Qi}),(0,V.jsx)(`rect`,{x:`5.5`,y:`18.5`,width:`4`,height:`7`,rx:`2`,fill:Qi,opacity:`.75`}),(0,V.jsx)(`rect`,{x:`30.5`,y:`18.5`,width:`4`,height:`7`,rx:`2`,fill:Qi,opacity:`.75`}),(0,V.jsx)(`rect`,{x:`9`,y:`12.5`,width:`22`,height:`19`,rx:`5.5`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`15.5`,cy:`20.5`,r:`2.3`,fill:$i}),(0,V.jsx)(`circle`,{cx:`24.5`,cy:`20.5`,r:`2.3`,fill:$i}),(0,V.jsx)(`rect`,{x:`15.5`,y:`25.5`,width:`9`,height:`2.2`,rx:`1.1`,fill:$i})]})},dot:{name:`Round robot`,tint:`green`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M13.5 13.5 11 8.5M26.5 13.5 29 8.5`,stroke:Qi,strokeWidth:`2.2`,strokeLinecap:`round`}),(0,V.jsx)(`circle`,{cx:`10.6`,cy:`7.6`,r:`2.2`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`29.4`,cy:`7.6`,r:`2.2`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`20`,cy:`22`,r:`11.5`,fill:Qi}),(0,V.jsx)(`rect`,{x:`11.5`,y:`17`,width:`17`,height:`8`,rx:`4`,fill:$i}),(0,V.jsx)(`circle`,{cx:`16.3`,cy:`21`,r:`1.7`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`23.7`,cy:`21`,r:`1.7`,fill:Qi})]})},cyclops:{name:`One-eyed robot`,tint:`violet`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{x:`8`,y:`8.5`,width:`24`,height:`24`,rx:`9`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`20`,cy:`18.5`,r:`6.2`,fill:$i}),(0,V.jsx)(`circle`,{cx:`20`,cy:`18.5`,r:`2.6`,fill:Qi}),(0,V.jsx)(`rect`,{x:`16`,y:`27.3`,width:`8`,height:`2`,rx:`1`,fill:$i})]})},ghost:{name:`Ghost`,tint:`indigo`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M9 32V19a11 11 0 0 1 22 0v13l-3.7-3.2-3.6 3.2-3.7-3.2-3.7 3.2-3.6-3.2z`,fill:Qi}),(0,V.jsx)(`ellipse`,{cx:`15.8`,cy:`18.8`,rx:`2.2`,ry:`2.9`,fill:$i}),(0,V.jsx)(`ellipse`,{cx:`24.2`,cy:`18.8`,rx:`2.2`,ry:`2.9`,fill:$i})]})},cat:{name:`Cat`,tint:`amber`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M8.5 8.5 16 13.2h8l7.5-4.7V23a11.5 9.5 0 0 1-23 0z`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`15.3`,cy:`21`,r:`2.2`,fill:$i}),(0,V.jsx)(`circle`,{cx:`24.7`,cy:`21`,r:`2.2`,fill:$i}),(0,V.jsx)(`path`,{d:`M18.3 25.2h3.4L20 27.2z`,fill:$i})]})},owl:{name:`Owl`,tint:`cyan`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M9 9.5 15 13h10l6-3.5V22a11 11 0 0 1-22 0z`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`15`,cy:`19.5`,r:`4.6`,fill:$i}),(0,V.jsx)(`circle`,{cx:`25`,cy:`19.5`,r:`4.6`,fill:$i}),(0,V.jsx)(`circle`,{cx:`15`,cy:`19.5`,r:`1.9`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`25`,cy:`19.5`,r:`1.9`,fill:Qi}),(0,V.jsx)(`path`,{d:`M18.2 24.6h3.6L20 28z`,fill:$i})]})},bear:{name:`Bear`,tint:`pink`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`10.8`,cy:`12`,r:`4.6`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`29.2`,cy:`12`,r:`4.6`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`20`,cy:`21.5`,r:`11`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`15.3`,cy:`19.5`,r:`2`,fill:$i}),(0,V.jsx)(`circle`,{cx:`24.7`,cy:`19.5`,r:`2`,fill:$i}),(0,V.jsx)(`ellipse`,{cx:`20`,cy:`25.6`,rx:`4.4`,ry:`3.2`,fill:$i,opacity:`.28`}),(0,V.jsx)(`ellipse`,{cx:`20`,cy:`24.4`,rx:`1.9`,ry:`1.4`,fill:$i})]})},alien:{name:`Alien`,tint:`green`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M20 7.5c7 0 11.5 4.6 11.5 11 0 7-6 14-11.5 14S8.5 25.5 8.5 18.5c0-6.4 4.5-11 11.5-11z`,fill:Qi}),(0,V.jsx)(`ellipse`,{cx:`14.9`,cy:`19`,rx:`2.9`,ry:`4.3`,transform:`rotate(-24 14.9 19)`,fill:$i}),(0,V.jsx)(`ellipse`,{cx:`25.1`,cy:`19`,rx:`2.9`,ry:`4.3`,transform:`rotate(24 25.1 19)`,fill:$i}),(0,V.jsx)(`rect`,{x:`18`,y:`27`,width:`4`,height:`1.8`,rx:`.9`,fill:$i})]})},cloud:{name:`Cloud`,tint:`magenta`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`13.5`,cy:`22.5`,r:`6.5`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`20.5`,cy:`17`,r:`8.5`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`27.5`,cy:`22`,r:`6.5`,fill:Qi}),(0,V.jsx)(`rect`,{x:`7`,y:`20.5`,width:`27`,height:`9`,rx:`4.5`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`16.5`,cy:`20.5`,r:`1.9`,fill:$i}),(0,V.jsx)(`circle`,{cx:`24`,cy:`20.5`,r:`1.9`,fill:$i}),(0,V.jsx)(`path`,{d:`M17 24.6q3.3 2.6 6.6 0`,fill:`none`,stroke:$i,strokeWidth:`1.8`,strokeLinecap:`round`})]})},planet:{name:`Planet`,tint:`indigo`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`ellipse`,{cx:`20`,cy:`21`,rx:`15.5`,ry:`4.8`,transform:`rotate(-18 20 21)`,fill:`none`,stroke:Qi,strokeWidth:`2.4`,opacity:`.7`}),(0,V.jsx)(`circle`,{cx:`20`,cy:`20`,r:`9.5`,fill:Qi}),(0,V.jsx)(`path`,{d:`M5.6 25.7c3.2 1.4 10-.2 17.4-2.6 5.2-1.7 9.3-3.7 11.4-5.5`,fill:`none`,stroke:Qi,strokeWidth:`2.4`,strokeLinecap:`round`}),(0,V.jsx)(`circle`,{cx:`16.5`,cy:`17.3`,r:`1.8`,fill:$i}),(0,V.jsx)(`circle`,{cx:`23.3`,cy:`16.3`,r:`1.8`,fill:$i})]})},hex:{name:`Hexagon`,tint:`cyan`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M20 5.5 32.6 12.7v14.6L20 34.5 7.4 27.3V12.7z`,fill:Qi,stroke:Qi,strokeWidth:`2`,strokeLinejoin:`round`}),(0,V.jsx)(`circle`,{cx:`15.5`,cy:`18.5`,r:`2.2`,fill:$i}),(0,V.jsx)(`circle`,{cx:`24.5`,cy:`18.5`,r:`2.2`,fill:$i}),ea(24)]})},drop:{name:`Drop`,tint:`blue`,art:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M20 5c5.5 7.3 11 11.7 11 18a11 11 0 0 1-22 0c0-6.3 5.5-10.7 11-18z`,fill:Qi}),(0,V.jsx)(`circle`,{cx:`15.8`,cy:`21.5`,r:`2.1`,fill:$i}),(0,V.jsx)(`circle`,{cx:`24.2`,cy:`21.5`,r:`2.1`,fill:$i}),ea(26.5)]})}},na=Ai,ra=e=>{let t=Li(e);return t?`api/agent/icons/${t}`:null},ia={xs:`h-4 w-4 rounded-[4px] text-[8px]`,sm:`h-5 w-5 rounded-[5px] text-[9px]`,md:`h-7 w-7 rounded-md text-[11px]`,lg:`h-10 w-10 rounded-lg text-sm`,xl:`h-14 w-14 rounded-xl text-lg`};function aa({label:e,icon:t=null,tint:n=null,logo:r=null,size:i=`md`,round:a=!1,src:o=null,className:s,...c}){let l=B(`relative inline-flex shrink-0 items-center justify-center overflow-hidden select-none`,ia[i],a&&`rounded-full`),u=o||ra(t),d=!u&&t?ta[t]:null,f=!u&&!d&&!t?Bi(r):null,p={"aria-hidden":`true`,"data-sw-agent-avatar":u?`upload`:d?t:f?`logo:${f.id}`:`initials`,...c};if(u)return(0,V.jsx)(`span`,{className:B(l,`bg-surface-2`,s),...p,children:(0,V.jsx)(`img`,{src:u,alt:``,className:`h-full w-full object-cover`,draggable:`false`})});if(d){let e=Xi(n)||Xi(d.tint);return(0,V.jsx)(`span`,{className:B(l,s),style:{background:e,color:e},...p,children:(0,V.jsx)(`svg`,{viewBox:`0 0 40 40`,className:`h-full w-full`,focusable:`false`,children:d.art})})}if(f)return(0,V.jsx)(`span`,{className:B(l,`border border-line bg-surface-2 text-fg`,s),...p,children:(0,V.jsx)(`svg`,{viewBox:f.viewBox,className:`h-[62%] w-[62%]`,fill:`currentColor`,focusable:`false`,children:(0,V.jsx)(`path`,{d:f.path})})});let m=Xi(n);return(0,V.jsx)(`span`,{className:B(l,`font-semibold`,m?`text-white`:`border border-line bg-surface-2 text-fg`,s),style:m?{background:m}:void 0,...p,children:qi(e)})}var oa=e=>({icon:e?.icon||null,tint:e?.tint||null,logo:e?.logo||null});function sa(e){let t=String(e||`?`).replace(/\(guest\)/i,``).trim().split(/\s+/).filter(Boolean);return((t[0]?.[0]||`?`)+(t.length>1?t.at(-1)[0]:``)).toUpperCase()}var ca=[`#1d4ed8`,`#6d28d9`,`#be185d`,`#b45309`,`#047857`,`#0e7490`,`#4338ca`,`#a21caf`],la=`#3f3f46`;function ua(e){let t=String(e||``).toLowerCase(),n=0;for(let e=0;e<t.length;e+=1)n=n*31+t.charCodeAt(e)>>>0;return ca[n%ca.length]}var da={xs:`h-5 w-5 text-[9px]`,sm:`h-6 w-6 text-[10px]`,md:`h-7 w-7 text-[11px]`,lg:`h-9 w-9 text-xs`};function fa({name:e,src:t=null,className:n,person:r=!1,agent:i=!1,agentId:a=null,colorKey:o,color:s=null,size:c=`lg`}){return t&&!i?(0,V.jsx)(ma,{src:t,name:e,className:n,person:r,colorKey:o,size:c},t):i?(0,V.jsx)(pa,{name:e,agentId:a,className:n,size:c}):r?(0,V.jsx)(`span`,{className:B(`inline-flex shrink-0 items-center justify-center rounded-full font-semibold text-white select-none`,da[c],n),style:{background:s||ua(o||e)},"aria-hidden":`true`,children:sa(e)}):(0,V.jsx)(`span`,{className:B(`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-accent/15 text-xs font-semibold text-accent select-none`,n),"aria-hidden":`true`,children:sa(e)})}function pa({name:e,agentId:t,className:n,size:r}){let i=ki(e,t);return i?(0,V.jsx)(aa,{label:e,...i,round:!0,className:B(da[r],n)}):(0,V.jsx)(`span`,{className:B(`inline-flex shrink-0 items-center justify-center rounded-full font-semibold text-white select-none`,da[r],n),style:{background:la},"aria-hidden":`true`,children:(0,V.jsx)(ae,{size:r===`xs`?11:13})})}function ma({src:e,name:t,className:n,person:r,colorKey:i,size:a}){let[o,s]=(0,O.useState)(!1);return o?(0,V.jsx)(fa,{name:t,className:n,person:r,colorKey:i,size:a}):(0,V.jsx)(`span`,{className:B(`inline-flex shrink-0 overflow-hidden rounded-full bg-surface-2`,r?da[a]:`h-9 w-9`,n),"aria-hidden":`true`,children:(0,V.jsx)(`img`,{src:e,alt:``,className:`h-full w-full object-cover`,onError:()=>s(!0),"data-sw-avatar-image":!0})})}var ha=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ga=Bn,_a=(e,t)=>n=>{if(t?.variants==null)return ga(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ha(t)||ha(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ga(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},va=_a(`inline-flex shrink-0 items-center gap-1 font-medium whitespace-nowrap`,{variants:{tone:{neutral:`border-line bg-surface-2 text-muted`,accent:`border-accent/40 bg-accent/10 text-accent`,ok:`border-ok/40 bg-ok/10 text-fg`,warn:`border-warn/50 bg-warn/15 text-fg`,bad:`border-bad/40 bg-bad/10 text-bad`,solid:`border-transparent bg-accent text-accent-fg`},shape:{chip:`rounded-full border px-1.5 text-[10.5px] leading-4`,count:`h-5 rounded-full border-0 px-1.5 text-[10px] font-semibold`,tag:`rounded border-0 px-1 text-[10px] uppercase`}},defaultVariants:{tone:`neutral`,shape:`chip`}});function H({tone:e,shape:t,className:n,...r}){return(0,V.jsx)(`span`,{className:B(va({tone:e,shape:t}),n),...r})}var ya=Object.defineProperty,ba=(e,t)=>ya(e,`name`,{value:t,configurable:!0});function xa(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ba(xa,`setRef`);function Sa(...e){return t=>{let n=!1,r=e.map(e=>{let r=xa(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():xa(e[t],null)}}}}ba(Sa,`composeRefs`);function U(...e){return O.useCallback(Sa(...e),e)}ba(U,`useComposedRefs`);var Ca=Object.defineProperty,wa=(e,t)=>Ca(e,`name`,{value:t,configurable:!0});function Ta(e){let t=O.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Ia(r),O.Children.forEach(r,e=>{if(Ma(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;Pa(n)&&typeof Ba==`function`;)n=Ba(n._payload);a=ka(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=O.cloneElement(a,void 0,s):!o&&O.Children.count(r)===1&&O.isValidElement(r)&&(a=r);let c=a?ja(a):void 0,l=U(n,c);if(!a){if(r||r===0)throw Error(o?za(e):Ra(e));return r}let u=Aa(i,a.props??{});return a.type!==O.Fragment&&(u.ref=n?l:c),O.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}wa(Ta,`createSlot`);var Ea=Ta(`Slot`),Da=Symbol.for(`radix.slottable`);function Oa(e){let t=wa(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Da,t}wa(Oa,`createSlottable`);var ka=wa((e,t)=>`child`in e.props?O.isValidElement(t)?O.cloneElement(t,void 0,e.props.children(t.props.children)):null:O.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function Aa(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=La(a,i))}return{...e,...n}}wa(Aa,`mergeProps`);function ja(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}wa(ja,`getElementRef`);function Ma(e){return O.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Da}wa(Ma,`isSlottable`);var Na=Symbol.for(`react.lazy`);function Pa(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Na&&`_payload`in e&&Fa(e._payload)}wa(Pa,`isLazyComponent`);function Fa(e){return typeof e==`object`&&!!e&&`then`in e}wa(Fa,`isPromiseLike`);function Ia(e){let t=e;for(;Pa(t)&&typeof Ba==`function`;)t=Ba(t._payload);return t}wa(Ia,`useUnwrappedLazy`);function La(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}wa(La,`concatAriaDescribedby`);var Ra=wa(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),za=wa(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ba=O.use,Va=c(h(),1),Ha=Object.defineProperty,Ua=(e,t)=>Ha(e,`name`,{value:t,configurable:!0}),W=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ta(`Primitive.${t}`),r=O.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wa(e,t){e&&Va.flushSync(()=>e.dispatchEvent(t))}Ua(Wa,`dispatchDiscreteCustomEvent`);var Ga=Object.defineProperty,Ka=(e,t)=>Ga(e,`name`,{value:t,configurable:!0}),qa=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ja=O.forwardRef(Ka(function(e,t){return(0,V.jsx)(W.span,{...e,ref:t,style:{...qa,...e.style}})},`VisuallyHidden`)),Ya=Object.defineProperty,Xa=(e,t)=>Ya(e,`name`,{value:t,configurable:!0});function Za(e,t){let n=O.createContext(t);n.displayName=e+`Context`;let r=Xa(e=>{let{children:t,...r}=e,i=O.useMemo(()=>r,Object.values(r));return(0,V.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=O.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Xa(i,`useContext`),[r,i]}Xa(Za,`createContext`);function Qa(e,t=[]){let n=[];function r(t,r){let i=O.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Xa(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=O.useMemo(()=>o,Object.values(o));return(0,V.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=O.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Xa(s,`useContext`),[o,s]}Xa(r,`createContext`);let i=Xa(()=>{let t=n.map(e=>O.createContext(e));return Xa(function(n){let r=n?.[e]||t;return O.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,$a(i,...t)]}Xa(Qa,`createContextScope`);function $a(...e){let t=e[0];if(e.length===1)return t;let n=Xa(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Xa(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Xa($a,`composeContextScopes`);var eo=globalThis?.document?O.useLayoutEffect:()=>{},to=Object.defineProperty,no=(e,t)=>to(e,`name`,{value:t,configurable:!0});function ro(e){let t=e+`CollectionProvider`,[n,r]=Qa(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=no(e=>{let{scope:t,children:n}=e,r=O.useRef(null),a=O.useRef(new Map).current;return(0,V.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Ta(s),l=O.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=U(t,a(s,n).collectionRef);return(0,V.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Ta(u),p=O.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=O.useRef(null),s=U(t,o),c=a(u,n);return O.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,V.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return O.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return no(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}no(ro,`createCollection`);var io=new WeakMap,ao=class e extends Map{static{no(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],io.set(this,!0)}set(e,t){return io.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=co(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=oo(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=oo(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return oo(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function oo(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=so(e,t);return n===-1?void 0:e[n]}no(oo,`at`);function so(e,t){let n=e.length,r=co(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}no(so,`toSafeIndex`);function co(e){return e!==e||e===0?0:Math.trunc(e)}no(co,`toSafeInteger`);function lo(e){let t=e+`CollectionProvider`,[n,r]=Qa(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=no(({state:e,...t})=>e?(0,V.jsx)(u,{...t,state:e}):(0,V.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=no(e=>{let t=_();return(0,V.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=no(e=>{let{scope:t,children:n,state:r}=e,a=O.useRef(null),[s,c]=O.useState(null),l=U(a,c),[u,d]=r,f=O.useRef(new ao),p=O.useCallback(()=>{let e=f.current;return po(e)||e.sort(mo),e},[]);return O.useEffect(()=>{if(!s)return;let e=ho(()=>{d(e=>{let t=e.toSorted(mo);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,V.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,V.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=Ta(d),p=O.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=U(t,a(d,n).collectionElementRef);return(0,V.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Ta(m),g=O.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=O.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=O.useRef(i);uo(l.current,i)||(l.current=i);let u=l.current,d=U(t,O.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);eo(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=O.useRef(null);return O.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new ao(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(mo)}))}),O.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new ao(t);return n.delete(e.element),n})},[s]),(0,V.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return O.useState(new ao)}no(_,`useInitCollection`);function v(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}no(v,`useCollection`);function y(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return no(y,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useGetCollection:y,useInitCollection:_}]}no(lo,`createCollection`);function uo(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}no(uo,`shallowEqual`);function fo(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}no(fo,`isElementPreceding`);function po(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}no(po,`isInDocumentOrder`);function mo(e,t){return!e[1].element||!t[1].element?0:fo(e[1].element,t[1].element)?-1:1}no(mo,`sortByDocumentPosition`);function ho(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}no(ho,`getChildListObserver`);var go=Object.defineProperty,_o=(e,t)=>go(e,`name`,{value:t,configurable:!0}),vo=!!(typeof window<`u`&&window.document&&window.document.createElement);function G(e,t,{checkForDefaultPrevented:n=!0}={}){return _o(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}_o(G,`composeEventHandlers`);function yo(e){if(!vo)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}_o(yo,`getOwnerWindow`);function bo(e){if(!vo)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}_o(bo,`getOwnerDocument`);function xo(e,t=!1){let{activeElement:n}=bo(e);if(!n?.nodeName)return null;if(So(n)&&n.contentDocument)return xo(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=bo(n).getElementById(e);if(t)return t}}return n}_o(xo,`getActiveElement`);function So(e){return e.tagName===`IFRAME`}_o(So,`isFrame`);var Co=Object.defineProperty,wo=(e,t)=>Co(e,`name`,{value:t,configurable:!0}),To=O.useEffectEvent,Eo=O.useInsertionEffect;function Do(e){if(typeof To==`function`)return To(e);let t=O.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Eo==`function`?Eo(()=>{t.current=e}):eo(()=>{t.current=e}),O.useMemo(()=>((...e)=>t.current?.(...e)),[])}wo(Do,`useEffectEvent`);var Oo=Object.defineProperty,ko=(e,t)=>Oo(e,`name`,{value:t,configurable:!0}),Ao=O.useInsertionEffect||eo;function jo({prop:e,defaultProp:t,onChange:n=ko(()=>{},`onChange`),caller:r}){let[i,a,o]=Mo({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,O.useCallback(t=>{if(s){let n=No(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ko(jo,`useControllableState`);function Mo({defaultProp:e,onChange:t}){let[n,r]=O.useState(e),i=O.useRef(n),a=O.useRef(t);return Ao(()=>{a.current=t},[t]),O.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ko(Mo,`useUncontrolledState`);function No(e){return typeof e==`function`}ko(No,`isFunction`);var Po=Symbol(`RADIX:SYNC_STATE`);function Fo(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Do(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=O.useReducer((t,n)=>{if(n.type===Po)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=O.useRef(p);O.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=O.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return O.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Po,state:i})},[i,d.state,c]),[h,f]}ko(Fo,`useControllableStateReducer`);var Io=Object.defineProperty,Lo=(e,t)=>Io(e,`name`,{value:t,configurable:!0});function K(e,t){return O.useReducer((e,n)=>t[e][n]??e,e)}Lo(K,`useStateMachine`);var q=Lo(e=>{let{present:t,children:n}=e,r=Ro(t),i=typeof n==`function`?n({present:r.isPresent}):O.Children.only(n),a=Bo(r.ref,Ho(i));return typeof n==`function`||r.isPresent?O.cloneElement(i,{ref:a}):null},`Presence`);function Ro(e){let[t,n]=O.useState(),r=O.useRef(null),i=O.useRef(e),a=O.useRef(`none`),o=O.useRef(void 0),[s,c]=K(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return O.useEffect(()=>{s===`mounted`?(a.current=o.current??Vo(r.current),o.current=void 0):a.current=`none`},[s]),eo(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Vo(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),eo(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Lo(a=>{let o=Vo(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Lo(e=>{e.target===t&&(a.current=Vo(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:O.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Vo(t)}else r.current=null;n(e)},[])}}Lo(Ro,`usePresence`);function zo(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Lo(zo,`setRef`);function Bo(...e){let t=O.useRef(e);return t.current=e,O.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=zo(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():zo(n[e],null)}}},[])}Lo(Bo,`useStableComposedRefs`);function Vo(e){return e?.animationName||`none`}Lo(Vo,`getAnimationName`);function Ho(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Lo(Ho,`getElementRef`);var Uo=Object.defineProperty,Wo=(e,t)=>Uo(e,`name`,{value:t,configurable:!0}),Go=O.useId||(()=>void 0),Ko=0;function qo(e){let[t,n]=O.useState(Go());return eo(()=>{e||n(e=>e??String(Ko++))},[e]),e||(t?`radix-${t}`:``)}Wo(qo,`useId`);var Jo=Object.defineProperty,Yo=(e,t)=>Jo(e,`name`,{value:t,configurable:!0}),Xo=`Collapsible`,[Zo,Qo]=Qa(Xo),[$o,es]=Zo(Xo),ts=O.forwardRef(Yo(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=jo({prop:r,defaultProp:i??!1,onChange:o,caller:Xo});return(0,V.jsx)($o,{scope:n,disabled:a,contentId:qo(),open:c,onOpenToggle:O.useCallback(()=>l(e=>!e),[l]),children:(0,V.jsx)(W.div,{"data-state":ss(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),ns=`CollapsibleTrigger`,rs=O.forwardRef(Yo(function(e,t){let{__scopeCollapsible:n,...r}=e,i=es(ns,n);return(0,V.jsx)(W.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":ss(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:G(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),is=`CollapsibleContent`,as=O.forwardRef(Yo(function(e,t){let{forceMount:n,...r}=e,i=es(is,e.__scopeCollapsible);return(0,V.jsx)(q,{present:n||i.open,children:({present:e})=>(0,V.jsx)(os,{...r,ref:t,present:e})})},`CollapsibleContent`)),os=O.forwardRef(Yo(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=es(is,n),[s,c]=O.useState(r),l=O.useRef(null),u=U(t,l),d=O.useRef(0),f=d.current,p=O.useRef(0),m=p.current,h=o.open||s,g=O.useRef(h),_=O.useRef(void 0);return O.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),eo(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,V.jsx)(W.div,{"data-state":ss(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})},`CollapsibleContentImpl`));function ss(e){return e?`open`:`closed`}Yo(ss,`getState`);var cs=Object.defineProperty,ls=(e,t)=>cs(e,`name`,{value:t,configurable:!0}),us={LTR:`ltr`,RTL:`rtl`},ds=O.createContext(void 0);function fs(e){let t=O.useContext(ds);return e||t||us.LTR}ls(fs,`useDirection`);var ps=Object.defineProperty,ms=(e,t)=>ps(e,`name`,{value:t,configurable:!0}),hs=O.useInsertionEffect;function gs(e){let t=O.useRef(e);return typeof hs==`function`?hs(()=>{t.current=e}):eo(()=>{t.current=e}),O.useMemo(()=>((...e)=>t.current?.(...e)),[])}ms(gs,`useCallbackRef`);var _s=Object.defineProperty,vs=(e,t)=>_s(e,`name`,{value:t,configurable:!0}),ys=`dismissableLayer.update`,bs=`dismissableLayer.pointerDownOutside`,xs=`dismissableLayer.focusOutside`,Ss,Cs=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ws=O.forwardRef(vs(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=O.useContext(Cs),[d,f]=O.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=O.useState({}),h=U(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=O.useRef(!1),C=Ds(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:O.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Os(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=gs(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return O.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),O.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ss=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ks(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Ss))}},[d,p,n,u]),O.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ks())},[d,u]),O.useEffect(()=>{let e=vs(()=>m({}),`handleUpdate`);return document.addEventListener(ys,e),()=>document.removeEventListener(ys,e)},[]),(0,V.jsx)(W.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:G(e.onFocusCapture,w.onFocusCapture),onBlurCapture:G(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Ts(){let e=O.useContext(Cs),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}vs(Ts,`useDismissableLayerSurface`);var Es=vs(()=>!0,`IS_TRUE`);function Ds(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Es}=t,s=gs(e),c=O.useRef(!1),l=O.useRef(!1),u=O.useRef(new Map),d=O.useRef(()=>{});return O.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}vs(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}vs(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}vs(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}vs(p,`handleInteractionBubble`);let m=vs(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||As(bs,s,p,{discrete:!0})};if(vs(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:vs(()=>c.current=!0,`onPointerDownCapture`)}}vs(Ds,`usePointerDownOutside`);function Os(e,t=globalThis?.document){let n=gs(e),r=O.useRef(!1);return O.useEffect(()=>{let e=vs(e=>{e.target&&!r.current&&As(xs,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:vs(()=>r.current=!0,`onFocusCapture`),onBlurCapture:vs(()=>r.current=!1,`onBlurCapture`)}}vs(Os,`useFocusOutside`);function ks(){let e=new CustomEvent(ys);document.dispatchEvent(e)}vs(ks,`dispatchUpdate`);function As(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Wa(i,a):i.dispatchEvent(a)}vs(As,`handleAndDispatchCustomEvent`);var js=Object.defineProperty,Ms=(e,t)=>js(e,`name`,{value:t,configurable:!0}),Ns=`focusScope.autoFocusOnMount`,Ps=`focusScope.autoFocusOnUnmount`,Fs={bubbles:!1,cancelable:!0},Is=O.forwardRef(Ms(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=O.useState(null),u=gs(a),d=gs(o),f=O.useRef(null),p=U(t,l),m=O.useRef(i);O.useEffect(()=>{m.current=i});let h=O.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:qs(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||qs(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&qs(c)};Ms(e,`handleFocusIn`),Ms(t,`handleFocusOut`),Ms(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),O.useEffect(()=>{if(c){Js.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Ns,Fs);c.addEventListener(Ns,u),c.dispatchEvent(t),t.defaultPrevented||(Vs(Zs(Us(c)),{select:!0}),document.activeElement===e&&qs(c))}return()=>{c.removeEventListener(Ns,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Ps,Fs);c.addEventListener(Ps,d),c.dispatchEvent(r),r.defaultPrevented||qs(e??t.body,{select:!0}),c.removeEventListener(Ps,d),Js.remove(g)},0)}}},[c,u,d,g]);let _=O.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Hs(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&qs(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&qs(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,V.jsx)(W.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),Ls=O.createContext(null);function Rs({registry:e,children:t}){return e?(0,V.jsx)(Ls.Provider,{value:e,children:t}):t}Ms(Rs,`FocusScopeBranchProvider`);function zs(){let[e,t]=O.useState([]);return{nodes:e,registry:O.useMemo(()=>({add:Ms(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Ms(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Ms(zs,`useFocusScopeBranchRegistry`);function Bs(e){let t=O.useContext(Ls);O.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Ms(Bs,`useFocusScopeBranch`);function Vs(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(qs(r,{select:t}),document.activeElement!==n)return}Ms(Vs,`focusFirst`);function Hs(e){let t=Us(e);return[Ws(t,e),Ws(t.reverse(),e)]}Ms(Hs,`getTabbableEdges`);function Us(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ms(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Ms(Us,`getTabbableCandidates`);function Ws(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Gs(r,{upTo:t})))return r}Ms(Ws,`findVisible`);function Gs(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Ms(Gs,`isHidden`);function Ks(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Ms(Ks,`isSelectableInput`);function qs(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Ks(e)&&t&&e.select()}}Ms(qs,`focus`);var Js=Ys();function Ys(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Xs(e,t),e.unshift(t)},remove(t){e=Xs(e,t),e[0]?.resume()}}}Ms(Ys,`createFocusScopesStack`);function Xs(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ms(Xs,`arrayRemove`);function Zs(e){return e.filter(e=>e.tagName!==`A`)}Ms(Zs,`removeLinks`);var Qs=Object.defineProperty,$s=O.forwardRef(((e,t)=>Qs(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=O.useState(!1);eo(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Va.createPortal((0,V.jsx)(W.div,{...r,ref:t}),o):null},`Portal`)),ec=Object.defineProperty,tc=(e,t)=>ec(e,`name`,{value:t,configurable:!0}),nc=0,rc=null;function ic(e){return ac(),e.children}tc(ic,`FocusGuards`);function ac(){O.useEffect(()=>{rc||={start:oc(),end:oc()};let{start:e,end:t}=rc;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),nc++,()=>{nc===1&&(rc?.start.remove(),rc?.end.remove(),rc=null),nc=Math.max(0,nc-1)}},[])}tc(ac,`useFocusGuards`);function oc(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}tc(oc,`createFocusGuard`);var sc=function(){return sc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},sc.apply(this,arguments)};function cc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function lc(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var uc=`right-scroll-bar-position`,dc=`width-before-scroll-bar`,fc=`with-scroll-bars-hidden`,pc=`--removed-body-scroll-bar-size`;function mc(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function hc(e,t){var n=(0,O.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var gc=typeof window<`u`?O.useLayoutEffect:O.useEffect,_c=new WeakMap;function vc(e,t){var n=hc(t||null,function(t){return e.forEach(function(e){return mc(e,t)})});return gc(function(){var t=_c.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||mc(e,null)}),i.forEach(function(e){r.has(e)||mc(e,a)})}_c.set(n,e)},[e]),n}function yc(e){return e}function bc(e,t){t===void 0&&(t=yc);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function xc(e){e===void 0&&(e={});var t=bc(null);return t.options=sc({async:!0,ssr:!1},e),t}var Sc=function(e){var t=e.sideCar,n=cc(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return O.createElement(r,sc({},n))};Sc.isSideCarExport=!0;function Cc(e,t){return e.useMedium(t),Sc}var wc=xc(),Tc=function(){},Ec=O.forwardRef(function(e,t){var n=O.useRef(null),r=O.useState({onScrollCapture:Tc,onWheelCapture:Tc,onTouchMoveCapture:Tc}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=cc(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=vc([n,t]),C=sc(sc({},b),i);return O.createElement(O.Fragment,null,u&&O.createElement(x,{sideCar:wc,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?O.cloneElement(O.Children.only(s),sc(sc({},C),{ref:S})):O.createElement(v,sc({},C,{className:c,ref:S}),s))});Ec.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ec.classNames={fullWidth:dc,zeroRight:uc};var Dc=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Oc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Dc();return t&&e.setAttribute(`nonce`,t),e}function kc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ac(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var jc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Oc())&&(kc(t,n),Ac(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Mc=function(){var e=jc();return function(t,n){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Nc=function(){var e=Mc();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Pc={left:0,top:0,right:0,gap:0},Fc=function(e){return parseInt(e||``,10)||0},Ic=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Fc(n),Fc(r),Fc(i)]},Lc=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Pc;var t=Ic(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Rc=Nc(),zc=`data-scroll-locked`,Bc=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
11
+ .${fc} {
12
+ overflow: hidden ${r};
13
+ padding-right: ${s}px ${r};
14
+ }
15
+ body[${zc}] {
16
+ overflow: hidden ${r};
17
+ overscroll-behavior: contain;
18
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
19
+ padding-left: ${i}px;
20
+ padding-top: ${a}px;
21
+ padding-right: ${o}px;
22
+ margin-left:0;
23
+ margin-top:0;
24
+ margin-right: ${s}px ${r};
25
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
26
+ }
27
+
28
+ .${uc} {
29
+ right: ${s}px ${r};
30
+ }
31
+
32
+ .${dc} {
33
+ margin-right: ${s}px ${r};
34
+ }
35
+
36
+ .${uc} .${uc} {
37
+ right: 0 ${r};
38
+ }
39
+
40
+ .${dc} .${dc} {
41
+ margin-right: 0 ${r};
42
+ }
43
+
44
+ body[${zc}] {
45
+ ${pc}: ${s}px;
46
+ }
47
+ `},Vc=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Hc=function(){O.useEffect(function(){return document.body.setAttribute(zc,(Vc()+1).toString()),function(){var e=Vc()-1;e<=0?document.body.removeAttribute(zc):document.body.setAttribute(zc,e.toString())}},[])},Uc=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Hc();var a=O.useMemo(function(){return Lc(i)},[i]);return O.createElement(Rc,{styles:Bc(a,!t,i,n?``:`!important`)})},Wc=!1;if(typeof window<`u`)try{var Gc=Object.defineProperty({},"passive",{get:function(){return Wc=!0,!0}});window.addEventListener(`test`,Gc,Gc),window.removeEventListener(`test`,Gc,Gc)}catch{Wc=!1}var Kc=Wc?{passive:!1}:!1,qc=function(e){return e.tagName===`TEXTAREA`},Jc=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!qc(e)&&n[t]===`visible`)},Yc=function(e){return Jc(e,`overflowY`)},Xc=function(e){return Jc(e,`overflowX`)},Zc=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),el(e,r)){var i=tl(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qc=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},$c=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},el=function(e,t){return e===`v`?Yc(t):Xc(t)},tl=function(e,t){return e===`v`?Qc(t):$c(t)},nl=function(e,t){return e===`h`&&t===`rtl`?-1:1},rl=function(e,t,n,r,i){var a=nl(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=tl(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&el(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},il=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},al=function(e){return[e.deltaX,e.deltaY]},ol=function(e){return e&&`current`in e?e.current:e},sl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cl=function(e){return`
48
+ .block-interactivity-${e} {pointer-events: none;}
49
+ .allow-interactivity-${e} {pointer-events: all;}
50
+ `},ll=0,ul=[];function dl(e){var t=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),i=O.useState(ll++)[0],a=O.useState(Nc)[0],o=O.useRef(e);O.useEffect(function(){o.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=lc([e.lockRef.current],(e.shards||[]).map(ol),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=O.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=il(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Zc(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Zc(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return rl(h,t,e,h===`h`?s:c,!0)},[]),c=O.useCallback(function(e){var n=e;if(ul.length&&ul[ul.length-1]===a){var r=`deltaY`in n?al(n):il(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&sl(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(ol).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=O.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:fl(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=O.useCallback(function(e){n.current=il(e),r.current=void 0},[]),d=O.useCallback(function(t){l(t.type,al(t),t.target,s(t,e.lockRef.current))},[]),f=O.useCallback(function(t){l(t.type,il(t),t.target,s(t,e.lockRef.current))},[]);O.useEffect(function(){return ul.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Kc),document.addEventListener(`touchmove`,c,Kc),document.addEventListener(`touchstart`,u,Kc),function(){ul=ul.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Kc),document.removeEventListener(`touchmove`,c,Kc),document.removeEventListener(`touchstart`,u,Kc)}},[]);var p=e.removeScrollBar,m=e.inert;return O.createElement(O.Fragment,null,m?O.createElement(a,{styles:cl(i)}):null,p?O.createElement(Uc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var pl=Cc(wc,dl),ml=O.forwardRef(function(e,t){return O.createElement(Ec,sc({},e,{ref:t,sideCar:pl}))});ml.classNames=Ec.classNames;var hl=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},gl=new WeakMap,_l=new WeakMap,vl={},yl=0,bl=function(e){return e&&(e.host||bl(e.parentNode))},xl=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=bl(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Sl=function(e,t,n,r){var i=xl(t,Array.isArray(e)?e:[e]);vl[n]||(vl[n]=new WeakMap);var a=vl[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(gl.get(e)||0)+1,l=(a.get(e)||0)+1;gl.set(e,c),a.set(e,l),o.push(e),c===1&&i&&_l.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),yl++,function(){o.forEach(function(e){var t=gl.get(e)-1,i=a.get(e)-1;gl.set(e,t),a.set(e,i),t||(_l.has(e)||e.removeAttribute(r),_l.delete(e)),i||e.removeAttribute(n)}),yl--,yl||(gl=new WeakMap,gl=new WeakMap,_l=new WeakMap,vl={})}},Cl=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||hl(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Sl(r,i,n,`aria-hidden`)):function(){return null}},wl=Object.defineProperty,Tl=(e,t)=>wl(e,`name`,{value:t,configurable:!0}),El=`Dialog`,[Dl,Ol]=Qa(El),[kl,Al]=Dl(El),jl=Tl(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=O.useRef(null),c=O.useRef(null),{nodes:l,registry:u}=zs(),[d,f]=jo({prop:r,defaultProp:i??!1,onChange:a,caller:El}),[p,m]=O.useState(0),[h,g]=O.useState(0);return(0,V.jsx)(kl,{scope:t,triggerRef:s,contentRef:c,contentId:qo(),titleId:qo(),descriptionId:qo(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:O.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Ml=`DialogPortal`,[Nl,Pl]=Dl(Ml,{forceMount:void 0}),Fl=Tl(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Al(Ml,t);return(0,V.jsx)(Nl,{scope:t,forceMount:n,children:O.Children.map(r,e=>(0,V.jsx)(q,{present:n||a.open,children:(0,V.jsx)($s,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Il=`DialogOverlay`,Ll=O.forwardRef(Tl(function(e,t){let n=Pl(Il,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Al(Il,e.__scopeDialog);return a.modal?(0,V.jsx)(q,{present:r||a.open,children:(0,V.jsx)(zl,{...i,ref:t})}):null},`DialogOverlay`)),Rl=Ta(`DialogOverlay.RemoveScroll`),zl=O.forwardRef(Tl(function(e,t){let{__scopeDialog:n,...r}=e,i=Al(Il,n),a=U(t,Ts());return(0,V.jsx)(ml,{as:Rl,allowPinchZoom:!0,shards:O.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,V.jsx)(W.div,{"data-state":Xl(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Bl=`DialogContent`,Vl=O.forwardRef(Tl(function(e,t){let n=Pl(Bl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Al(Bl,e.__scopeDialog);return(0,V.jsx)(q,{present:r||a.open,children:a.modal?(0,V.jsx)(Hl,{...i,ref:t}):(0,V.jsx)(Ul,{...i,ref:t})})},`DialogContent`)),Hl=O.forwardRef(Tl(function(e,t){let n=Al(Bl,e.__scopeDialog),r=O.useRef(null),i=U(t,n.contentRef,r);return O.useEffect(()=>{let e=r.current;if(e)return Cl(e)},[]),(0,V.jsx)(Wl,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ul=O.forwardRef(Tl(function(e,t){let n=Al(Bl,e.__scopeDialog),r=O.useRef(!1),i=O.useRef(!1);return(0,V.jsx)(Wl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Wl=O.forwardRef(Tl(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Al(Bl,n);return ac(),(0,V.jsx)(Rs,{registry:l.branchRegistry,children:(0,V.jsx)(Is,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,V.jsx)(ws,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Yl(o,l.descriptionId):o,"data-state":Xl(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Gl=O.forwardRef(Tl(function(e,t){let{__scopeDialog:n,...r}=e,i=Al(`DialogTitle`,n),{setTitleCount:a}=i;return eo(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,V.jsx)(W.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Kl=O.forwardRef(Tl(function(e,t){let{__scopeDialog:n,...r}=e,i=Al(`DialogDescription`,n),{setDescriptionCount:a}=i;return eo(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,V.jsx)(W.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ql=`DialogClose`,Jl=O.forwardRef(Tl(function(e,t){let{__scopeDialog:n,...r}=e,i=Al(ql,n);return(0,V.jsx)(W.button,{type:`button`,...r,ref:t,onClick:G(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Yl(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Tl(Yl,`concatAriaDescribedby`);function Xl(e){return e?`open`:`closed`}Tl(Xl,`getState`);var Zl=Object.defineProperty,Ql=(e,t)=>Zl(e,`name`,{value:t,configurable:!0});function $l(e){let[t,n]=O.useState(void 0);return eo(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Ql($l,`useSize`);var eu=[`top`,`right`,`bottom`,`left`],tu=Math.min,nu=Math.max,ru=Math.round,iu=Math.floor,au=e=>({x:e,y:e}),ou={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function su(e,t,n){return nu(e,tu(t,n))}function cu(e,t){return typeof e==`function`?e(t):e}function lu(e){return e.split(`-`)[0]}function uu(e){return e.split(`-`)[1]}function du(e){return e===`x`?`y`:`x`}function fu(e){return e===`y`?`height`:`width`}function pu(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function mu(e){return du(pu(e))}function hu(e,t,n){n===void 0&&(n=!1);let r=uu(e),i=mu(e),a=fu(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=wu(o)),[o,wu(o)]}function gu(e){let t=wu(e);return[_u(e),t,_u(t)]}function _u(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var vu=[`left`,`right`],yu=[`right`,`left`],bu=[`top`,`bottom`],xu=[`bottom`,`top`];function Su(e,t,n){switch(e){case`top`:case`bottom`:return n?t?yu:vu:t?vu:yu;case`left`:case`right`:return t?bu:xu;default:return[]}}function Cu(e,t,n,r){let i=uu(e),a=Su(lu(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_u)))),a}function wu(e){let t=lu(e);return ou[t]+e.slice(t.length)}function Tu(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Eu(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Tu(e)}function Du(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ou(e,t,n){let{reference:r,floating:i}=e,a=pu(t),o=mu(t),s=fu(o),c=lu(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=uu(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ku(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=cu(t,e),p=Eu(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Du(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Du(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Au=50,ju=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ku},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ou(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Au&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ou(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Mu=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=cu(e,t)||{};if(l==null)return{};let d=Eu(u),f={x:n,y:r},p=mu(i),m=fu(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=tu(d[_],T),D=tu(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=su(E,k,O),j=!c.arrow&&uu(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Nu=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=cu(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=lu(r),_=pu(o),v=lu(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[wu(o)]:gu(o)),x=p!==`none`;!d&&x&&b.push(...Cu(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=hu(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===pu(t)||T.every(e=>pu(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=pu(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Pu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fu(e){return eu.some(t=>e[t]>=0)}var Iu=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=cu(e,t);switch(i){case`referenceHidden`:{let e=Pu(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Fu(e)}}}case`escaped`:{let e=Pu(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Fu(e)}}}default:return{}}}}},Lu=new Set([`left`,`top`]);async function Ru(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=lu(n),s=uu(n),c=pu(n)===`y`,l=Lu.has(o)?-1:1,u=a&&c?-1:1,d=cu(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var zu=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ru(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Bu=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=cu(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=pu(i),p=du(f),m=u[p],h=u[f],g=(e,t)=>su(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Vu=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=cu(e,t),u={x:n,y:r},d=pu(i),f=du(d),p=u[f],m=u[d],h=cu(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Lu.has(lu(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Hu=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=cu(e,t),c=await i.detectOverflow(t,s),l=lu(n),u=uu(n),d=pu(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=tu(p-c[m],g),y=tu(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*nu(c.left,c.right):S=p-2*nu(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Uu(){return typeof window<`u`}function Wu(e){return qu(e)?(e.nodeName||``).toLowerCase():`#document`}function Gu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ku(e){return((qu(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function qu(e){return Uu()?e instanceof Node||e instanceof Gu(e).Node:!1}function Ju(e){return Uu()?e instanceof Element||e instanceof Gu(e).Element:!1}function Yu(e){return Uu()?e instanceof HTMLElement||e instanceof Gu(e).HTMLElement:!1}function Xu(e){return!Uu()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Gu(e).ShadowRoot}function Zu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=cd(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Qu(e){return/^(table|td|th)$/.test(Wu(e))}function $u(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ed=/transform|translate|scale|rotate|perspective|filter/,td=/paint|layout|strict|content/,nd=e=>!!e&&e!==`none`,rd;function id(e){let t=Ju(e)?cd(e):e;return nd(t.transform)||nd(t.translate)||nd(t.scale)||nd(t.rotate)||nd(t.perspective)||!od()&&(nd(t.backdropFilter)||nd(t.filter))||ed.test(t.willChange||``)||td.test(t.contain||``)}function ad(e){let t=ud(e);for(;Yu(t)&&!sd(t);){if(id(t))return t;if($u(t))return null;t=ud(t)}return null}function od(){return rd??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),rd}function sd(e){return/^(html|body|#document)$/.test(Wu(e))}function cd(e){return Gu(e).getComputedStyle(e)}function ld(e){return Ju(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ud(e){if(Wu(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Xu(e)&&e.host||Ku(e);return Xu(t)?t.host:t}function dd(e){let t=ud(e);return sd(t)?(e.ownerDocument||e).body:Yu(t)&&Zu(t)?t:dd(t)}function fd(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=dd(e),i=r===e.ownerDocument?.body,a=Gu(r);if(i){let e=pd(a);return t.concat(a,a.visualViewport||[],Zu(r)?r:[],e&&n?fd(e):[])}return t.concat(r,fd(r,[],n))}function pd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function md(e){let t=cd(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Yu(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ru(n)!==a||ru(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function hd(e){return Ju(e)?e:e.contextElement}function gd(e){let t=hd(e);if(!Yu(t))return au(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=md(t),o=(a?ru(n.width):n.width)/r,s=(a?ru(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var _d=au(0);function vd(e){let t=Gu(e);return!od()||!t.visualViewport?_d:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yd(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Gu(e)}function bd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=hd(e),o=au(1);t&&(r?Ju(r)&&(o=gd(r)):o=gd(e));let s=yd(a,n,r)?vd(a):au(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Gu(a),t=Ju(r)?Gu(r):r,n=e,i=pd(n);for(;i&&t!==n;){let e=gd(i),t=i.getBoundingClientRect(),r=cd(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Gu(i),i=pd(n)}}return Du({width:u,height:d,x:c,y:l})}function xd(e,t){let n=ld(e).scrollLeft;return t?t.left+n:bd(Ku(e)).left+n}function Sd(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xd(e,n),y:n.top+t.scrollTop}}function Cd(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ku(r),s=t?$u(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=au(1),u=au(0),d=Yu(r);if((d||!a)&&((Wu(r)!==`body`||Zu(o))&&(c=ld(r)),d)){let e=bd(r);l=gd(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Sd(o,c):au(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function wd(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Td(e){let t=ld(e),n=e.ownerDocument.body,r=nu(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=nu(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+xd(e),o=-t.scrollTop;return cd(n).direction===`rtl`&&(a+=nu(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ed=25;function Dd(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Gu(e),a=Ku(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!od()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(xd(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ed&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Od(e,t){let n=bd(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=gd(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function kd(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Dd(e,n,t);else if(t===`document`)r=Td(Ku(e));else if(Ju(t))r=Od(t,n);else{let n=vd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Du(r)}function Ad(e,t){let n=t.get(e);if(n)return n;let r=fd(e,[],!1).filter(e=>Ju(e)&&Wu(e)!==`body`),i=null,a=cd(e).position===`fixed`,o=a?ud(e):e;for(;Ju(o)&&!sd(o);){let e=cd(o),t=id(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ud(o)}return t.set(e,r),r}function jd(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?$u(t)?[]:Ad(t,this._c):[].concat(n),r],o=kd(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=kd(t,a[e],i);s=nu(n.top,s),c=tu(n.right,c),l=tu(n.bottom,l),u=nu(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Md(e){let{width:t,height:n}=md(e);return{width:t,height:n}}function Nd(e,t,n){let r=Yu(t),i=Ku(t),a=n===`fixed`,o=bd(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=au(0);if((r||!a)&&((Wu(t)!==`body`||Zu(i))&&(s=ld(t)),r)){let e=bd(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=xd(i));let l=i&&!r&&!a?Sd(i,s):au(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Pd(e){return cd(e).position===`static`}function Fd(e,t){if(!Yu(e)||cd(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ku(e)===n&&(n=n.ownerDocument.body),n}function Id(e,t){let n=Gu(e);if($u(e))return n;if(!Yu(e)){let t=ud(e);for(;t&&!sd(t);){if(Ju(t)&&!Pd(t))return t;t=ud(t)}return n}let r=Fd(e,t);for(;r&&Qu(r)&&Pd(r);)r=Fd(r,t);return r&&sd(r)&&Pd(r)&&!id(r)?n:r||ad(e)||n}var Ld=async function(e){let t=this.getOffsetParent||Id,n=this.getDimensions,r=await n(e.floating);return{reference:Nd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Rd(e){return cd(e).direction===`rtl`}var zd={convertOffsetParentRelativeRectToViewportRelativeRect:Cd,getDocumentElement:Ku,getClippingRect:jd,getOffsetParent:Id,getElementRects:Ld,getClientRects:wd,getDimensions:Md,getScale:gd,isElement:Ju,isRTL:Rd};function Bd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vd(e,t,n){let r=null,i,a=Ku(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=iu(d),h=iu(a.clientWidth-(u+f)),g=iu(a.clientHeight-(d+p)),_=iu(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:nu(0,tu(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Bd(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Gu(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Hd(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=hd(e),u=i||a?[...l?fd(l):[],...t?fd(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Vd(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?bd(e):null;c&&g();function g(){let t=bd(e);h&&!Bd(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ud=zu,Wd=Bu,Gd=Nu,Kd=Hu,qd=Iu,Jd=Mu,Yd=Vu,Xd=(e,t,n)=>{let r=new Map,i=n??{},a={...zd,...i.platform,_c:r};return ju(e,t,{...i,platform:a})},Zd=typeof document<`u`?O.useLayoutEffect:function(){};function Qd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qd(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Qd(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $d(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ef(e,t){let n=$d(e);return Math.round(t*n)/n}function tf(e){let t=O.useRef(e);return Zd(()=>{t.current=e}),t}function nf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=O.useState(r);Qd(f,r)||p(r);let[m,h]=O.useState(null),[g,_]=O.useState(null),v=O.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=O.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=O.useRef(null),C=O.useRef(null),w=O.useRef(u),T=c!=null,E=tf(c),D=tf(i),k=tf(l),A=O.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Xd(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Qd(w.current,t)&&(w.current=t,Va.flushSync(()=>{d(t)}))})},[f,t,n,D,k]);Zd(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=O.useRef(!1);Zd(()=>(j.current=!0,()=>{j.current=!1}),[]),Zd(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,A);A()}},[b,x,A,E,T]);let M=O.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ee=O.useMemo(()=>({reference:b,floating:x}),[b,x]),te=O.useMemo(()=>{let e={position:n,left:0,top:0};if(!ee.floating)return e;let t=ef(ee.floating,u.x),r=ef(ee.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...$d(ee.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ee.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:A,refs:M,elements:ee,floatingStyles:te}),[u,A,M,ee,te])}var rf=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Jd({element:r.current,padding:i}).fn(n):r?Jd({element:r,padding:i}).fn(n):{}}}},af=(e,t)=>{let n=Ud(e);return{name:n.name,fn:n.fn,options:[e,t]}},of=(e,t)=>{let n=Wd(e);return{name:n.name,fn:n.fn,options:[e,t]}},sf=(e,t)=>({fn:Yd(e).fn,options:[e,t]}),cf=(e,t)=>{let n=Gd(e);return{name:n.name,fn:n.fn,options:[e,t]}},lf=(e,t)=>{let n=Kd(e);return{name:n.name,fn:n.fn,options:[e,t]}},uf=(e,t)=>{let n=qd(e);return{name:n.name,fn:n.fn,options:[e,t]}},df=(e,t)=>{let n=rf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ff=Object.defineProperty,pf=(e,t)=>ff(e,`name`,{value:t,configurable:!0}),mf={Partial:`partial`,Always:`always`},hf={Optimized:`optimized`,Always:`always`},gf=`Popper`,[_f,vf]=Qa(gf),[yf,bf]=_f(gf),xf=pf(e=>{let{__scopePopper:t,children:n}=e,[r,i]=O.useState(null),[a,o]=O.useState(void 0);return(0,V.jsx)(yf,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Sf=`PopperAnchor`,Cf=O.forwardRef(pf(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=bf(Sf,n),o=O.useRef(null),s=a.onAnchorChange,c=U(t,O.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=O.useRef(null);O.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Af(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,V.jsx)(W.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),wf=`PopperContent`,[Tf,Ef]=_f(wf),Df=O.forwardRef(pf(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=mf.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=hf.Optimized,onPlaced:m,...h}=e,g=bf(wf,n),[_,v]=O.useState(null),y=U(t,v),[b,x]=O.useState(null),S=$l(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],k=D.length>0,A={padding:E,boundary:D.filter(Of),altBoundary:k},{refs:j,floatingStyles:M,placement:ee,isPositioned:te,middlewareData:N}=nf({strategy:`fixed`,placement:T,whileElementsMounted:pf((...e)=>Hd(...e,{animationFrame:p===hf.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[af({mainAxis:i+w,alignmentAxis:o}),c&&of({mainAxis:!0,crossAxis:!1,...d===mf.Partial?{limiter:sf()}:{},...A}),c&&cf({...A}),lf({...A,apply:pf(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&df({element:b,padding:s}),kf({arrowWidth:C,arrowHeight:w}),f&&uf(k?{strategy:`referenceHidden`,...A}:{strategy:`referenceHidden`,padding:A.padding,altBoundary:A.altBoundary})]}),P=g.setPlacementState;eo(()=>(P(ee),()=>{P(void 0)}),[ee,P]);let[ne,re]=Af(ee),ie=gs(m);eo(()=>{te&&ie?.()},[te,ie]);let ae=N.arrow?.x,F=N.arrow?.y,oe=N.arrow?.centerOffset!==0,[se,ce]=O.useState();return eo(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,V.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:te?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(` `),...N.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,V.jsx)(Tf,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:x,arrowX:ae,arrowY:F,shouldHideArrow:oe,children:(0,V.jsx)(W.div,{"data-side":ne,"data-align":re,...h,ref:y,style:{...h.style,animation:te?h.style?.animation:`none`}})})})},`PopperContent`));function Of(e){return e!==null}pf(Of,`isNotNull`);var kf=pf(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Af(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Af(e){let[t,n=`center`]=e.split(`-`);return[t,n]}pf(Af,`getSideAndAlignFromPlacement`);var jf=Object.defineProperty,Mf=(e,t)=>jf(e,`name`,{value:t,configurable:!0}),Nf=!1;function Pf(){let[e,t]=O.useState(Nf);return O.useEffect(()=>{Nf||(Nf=!0,t(!0))},[]),e}Mf(Pf,`useIsHydrated`);var Ff=O.useSyncExternalStore;function If(){return()=>{}}Mf(If,`subscribe`);function Lf(){return Ff(If,()=>!0,()=>!1)}Mf(Lf,`useIsHydratedModern`);var Rf=typeof Ff==`function`?Lf:Pf,zf=Object.defineProperty,Bf=(e,t)=>zf(e,`name`,{value:t,configurable:!0}),Vf=`rovingFocusGroup.onEntryFocus`,Hf={bubbles:!1,cancelable:!0},Uf=`RovingFocusGroup`,[Wf,Gf,Kf]=ro(Uf),[qf,Jf]=Qa(Uf,[Kf]),Yf={Vertical:`vertical`,Horizontal:`horizontal`},Xf={LTR:`ltr`,RTL:`rtl`},[Zf,Qf]=qf(Uf),$f=O.forwardRef(Bf(function(e,t){return(0,V.jsx)(Wf.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,V.jsx)(Wf.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,V.jsx)(ep,{...e,ref:t})})})},`RovingFocusGroup`)),ep=O.forwardRef(Bf(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=O.useRef(null),p=U(t,f),m=fs(a),[h,g]=jo({prop:o,defaultProp:s??null,onChange:c,caller:Uf}),[_,v]=O.useState(!1),y=gs(l),b=Gf(n),x=O.useRef(!1),[S,C]=O.useState(0);return O.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Vf,y),()=>e.removeEventListener(Vf,y)},[y]),(0,V.jsx)(Zf,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:O.useCallback(e=>g(e),[g]),onItemShiftTab:O.useCallback(()=>v(!0),[]),onFocusableItemAdd:O.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:O.useCallback(()=>C(e=>e-1),[]),children:(0,V.jsx)(W.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:G(e.onMouseDown,()=>{x.current=!0}),onFocus:G(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Vf,Hf);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);op([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:G(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),tp=`RovingFocusGroupItem`,np=O.forwardRef(Bf(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=qo(),l=a||c,u=Qf(tp,n),d=u.currentTabStopId===l,f=Gf(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Rf();return eo(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),O.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,V.jsx)(Wf.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,V.jsx)(W.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:G(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:G(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:G(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ap(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?sp(n,r+1):n.slice(r+1)}setTimeout(()=>op(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),rp={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ip(e,t){return t===Xf.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Bf(ip,`getDirectionAwareKey`);function ap(e,t,n){let r=ip(e.key,n);if(!(t===Yf.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Yf.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return rp[r]}Bf(ap,`getFocusIntent`);function op(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Bf(op,`focusFirst`);function sp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Bf(sp,`wrapArray`);var cp=Object.defineProperty,lp=(e,t)=>cp(e,`name`,{value:t,configurable:!0}),up=[`Enter`,` `],dp=[`ArrowDown`,`PageUp`,`Home`],fp=[`ArrowUp`,`PageDown`,`End`],pp=[...dp,...fp];[...up],[...up];var mp=`Menu`,[hp,gp,_p]=ro(mp),[vp,yp]=Qa(mp,[_p,vf,Jf]),bp=vf(),xp=Jf(),[Sp,Cp]=vp(mp),[wp,Tp]=vp(mp),Ep=lp(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=bp(t),[c,l]=O.useState(null),u=O.useRef(!1),d=gs(a),f=fs(i);return O.useEffect(()=>{let e=lp(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=lp(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),O.useEffect(()=>{if(!n)return;let e=lp(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,V.jsx)(xf,{...s,children:(0,V.jsx)(Sp,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,V.jsx)(wp,{scope:t,onClose:O.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Dp=O.forwardRef(lp(function(e,t){let{__scopeMenu:n,...r}=e,i=bp(n);return(0,V.jsx)(Cf,{...i,...r,ref:t})},`MenuAnchor`)),Op=`MenuPortal`,[kp,Ap]=vp(Op,{forceMount:void 0}),jp=lp(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Cp(Op,t);return(0,V.jsx)(kp,{scope:t,forceMount:n,children:(0,V.jsx)(q,{present:n||a.open,children:(0,V.jsx)($s,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Mp=`MenuContent`,[Np,Pp]=vp(Mp),Fp=O.forwardRef(lp(function(e,t){let n=Ap(Mp,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Cp(Mp,e.__scopeMenu),o=Tp(Mp,e.__scopeMenu);return(0,V.jsx)(hp.Provider,{scope:e.__scopeMenu,children:(0,V.jsx)(q,{present:r||a.open,children:(0,V.jsx)(hp.Slot,{scope:e.__scopeMenu,children:o.modal?(0,V.jsx)(Ip,{...i,ref:t}):(0,V.jsx)(Lp,{...i,ref:t})})})})},`MenuContent`)),Ip=O.forwardRef(lp(function(e,t){let n=Cp(Mp,e.__scopeMenu),r=O.useRef(null),i=U(t,r);return O.useEffect(()=>{let e=r.current;if(e)return Cl(e)},[]),(0,V.jsx)(zp,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Lp=O.forwardRef(lp(function(e,t){let n=Cp(Mp,e.__scopeMenu);return(0,V.jsx)(zp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Rp=Ta(`MenuContent.ScrollLock`),zp=O.forwardRef(lp(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Cp(Mp,n),_=Tp(Mp,n),v=bp(n),y=xp(n),b=gp(n),[x,S]=O.useState(null),C=O.useRef(null),[w,T]=O.useState(null);Bs(w);let{nodes:E,registry:D}=zs(),k=!!(i||m),A=U(t,C,g.onContentChange,T),j=O.useRef(0),M=O.useRef(``),ee=O.useRef(0),te=O.useRef(null),N=O.useRef(`right`),P=O.useRef(0),ne=O.useMemo(()=>m?[C,...E.map(e=>({current:e}))]:[],[C,E,m]),re=m?ml:O.Fragment,ie=m?{as:Rp,allowPinchZoom:!0,shards:ne}:void 0,ae=lp(e=>{let t=M.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=lm(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){M.current=e,window.clearTimeout(j.current),e!==``&&(j.current=window.setTimeout(()=>s(``),1e3))}lp(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);O.useEffect(()=>()=>window.clearTimeout(j.current),[]),ac();let F=O.useCallback(e=>N.current===te.current?.side&&dm(e,te.current?.area),[]);return(0,V.jsx)(Np,{scope:n,searchRef:M,onItemEnter:O.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:O.useCallback(e=>{F(e)||(C.current?.focus(),S(null))},[F]),onTriggerLeave:O.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:O.useCallback(e=>{te.current=e},[]),children:(0,V.jsx)(Rs,{registry:k?D:null,children:(0,V.jsx)(re,{...ie,children:(0,V.jsx)(Is,{asChild:!0,trapped:i,branches:E,onMountAutoFocus:G(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,V.jsx)(ws,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,V.jsx)($f,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:G(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,V.jsx)(Df,{role:`menu`,"aria-orientation":`vertical`,"data-state":im(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:A,style:{outline:`none`,...h.style},onKeyDown:G(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ae(e.key));let i=C.current;if(e.target!==i||!pp.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);fp.includes(e.key)&&a.reverse(),sm(a)}),onBlur:G(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),M.current=``)}),onPointerMove:G(e.onPointerMove,fm(e=>{let t=e.target,n=P.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>P.current?`right`:`left`;N.current=t,P.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Bp=O.forwardRef(lp(function(e,t){let{__scopeMenu:n,...r}=e;return(0,V.jsx)(W.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Vp=O.forwardRef(lp(function(e,t){let{__scopeMenu:n,...r}=e;return(0,V.jsx)(W.div,{...r,ref:t})},`MenuLabel`)),Hp=`MenuItem`,Up=`menu.itemSelect`,Wp=O.forwardRef(lp(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=O.useRef(null),o=Tp(Hp,e.__scopeMenu),s=Pp(Hp,e.__scopeMenu),c=U(t,a),l=O.useRef(!1),u=lp(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Up,{bubbles:!0,cancelable:!0});e.addEventListener(Up,e=>r?.(e),{once:!0}),Wa(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,V.jsx)(Gp,{...i,ref:c,disabled:n,onClick:G(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:G(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:G(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&up.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Gp=O.forwardRef(lp(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Pp(Hp,n),s=xp(n),c=O.useRef(null),l=U(t,c),[u,d]=O.useState(!1),[f,p]=O.useState(``);return O.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,V.jsx)(hp.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,V.jsx)(np,{asChild:!0,...s,focusable:!r,children:(0,V.jsx)(W.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:G(e.onPointerMove,fm(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,fm(e=>o.onItemLeave(e))),onFocus:G(e.onFocus,()=>d(!0)),onBlur:G(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Kp,qp]=vp(`MenuRadioGroup`,{value:void 0,onValueChange:lp(()=>{},`onValueChange`)}),Jp=O.forwardRef(lp(function(e,t){let{value:n,onValueChange:r,...i}=e,a=gs(r);return(0,V.jsx)(Kp,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,V.jsx)(Bp,{...i,ref:t})})},`MenuRadioGroup`)),Yp=`MenuRadioItem`,Xp=O.forwardRef(lp(function(e,t){let{value:n,...r}=e,i=qp(Yp,e.__scopeMenu),a=n===i.value;return(0,V.jsx)(Qp,{scope:e.__scopeMenu,checked:a,children:(0,V.jsx)(Wp,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":om(a),onSelect:G(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Zp=`MenuItemIndicator`,[Qp,$p]=vp(Zp,{checked:!1}),em=O.forwardRef(lp(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=$p(Zp,n);return(0,V.jsx)(q,{present:r||am(a.checked)||a.checked===!0,children:(0,V.jsx)(W.span,{...i,ref:t,"data-state":om(a.checked)})})},`MenuItemIndicator`)),tm=O.forwardRef(lp(function(e,t){let{__scopeMenu:n,...r}=e;return(0,V.jsx)(W.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[nm,rm]=vp(`MenuSub`);function im(e){return e?`open`:`closed`}lp(im,`getOpenState`);function am(e){return e===`indeterminate`}lp(am,`isIndeterminate`);function om(e){return am(e)?`indeterminate`:e?`checked`:`unchecked`}lp(om,`getCheckedState`);function sm(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}lp(sm,`focusFirst`);function cm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}lp(cm,`wrapArray`);function lm(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=cm(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}lp(lm,`getNextMatch`);function um(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}lp(um,`isPointInPolygon`);function dm(e,t){return t?um({x:e.clientX,y:e.clientY},t):!1}lp(dm,`isPointerInGraceArea`);function fm(e){return t=>t.pointerType===`mouse`?e(t):void 0}lp(fm,`whenMouse`);var pm=Object.defineProperty,mm=(e,t)=>pm(e,`name`,{value:t,configurable:!0}),hm=`DropdownMenu`,[gm,_m]=Qa(hm,[yp]),vm=yp(),[ym,bm]=gm(hm),xm=mm(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=vm(t),l=O.useRef(null),[u,d]=jo({prop:i,defaultProp:a??!1,onChange:o,caller:hm});return(0,V.jsx)(ym,{scope:t,triggerId:qo(),triggerRef:l,contentId:qo(),open:u,onOpenChange:d,onOpenToggle:O.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,V.jsx)(Ep,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Sm=`DropdownMenuTrigger`,Cm=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=bm(Sm,n),o=vm(n),s=U(t,a.triggerRef);return(0,V.jsx)(Dp,{asChild:!0,...o,children:(0,V.jsx)(W.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:G(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:G(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),wm=mm(e=>{let{__scopeDropdownMenu:t,...n}=e,r=vm(t);return(0,V.jsx)(jp,{...r,...n})},`DropdownMenuPortal`),Tm=`DropdownMenuContent`,Em=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=bm(Tm,n),a=vm(n),o=O.useRef(!1);return(0,V.jsx)(Fp,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:G(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Dm=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=vm(n);return(0,V.jsx)(Bp,{...i,...r,ref:t})},`DropdownMenuGroup`)),Om=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=vm(n);return(0,V.jsx)(Vp,{...i,...r,ref:t})},`DropdownMenuLabel`)),km=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=vm(n);return(0,V.jsx)(Wp,{...i,...r,ref:t})},`DropdownMenuItem`)),Am=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=vm(n);return(0,V.jsx)(Jp,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),jm=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=vm(n);return(0,V.jsx)(Xp,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Mm=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=vm(n);return(0,V.jsx)(em,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Nm=O.forwardRef(mm(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=vm(n);return(0,V.jsx)(tm,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Pm=Object.defineProperty,Fm=(e,t)=>Pm(e,`name`,{value:t,configurable:!0}),Im=`HoverCard`,[Lm,Rm]=Qa(Im,[vf]);vf();var[zm,Bm]=Lm(Im),[Vm,Hm]=Lm(`HoverCardPortal`,{forceMount:void 0});function Um(e){return t=>t.pointerType===`touch`?void 0:e()}Fm(Um,`excludeTouch`);function Wm(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Fm(e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Fm(Wm,`getTabbableNodes`);var Gm=Object.defineProperty,Km=(e,t)=>Gm(e,`name`,{value:t,configurable:!0});function qm(e,[t,n]){return Math.min(n,Math.max(t,e))}Km(qm,`clamp`);var Jm=Object.defineProperty,Ym=(e,t)=>Jm(e,`name`,{value:t,configurable:!0}),Xm=`Popover`,[Zm,Qm]=Qa(Xm,[vf]),$m=vf(),[eh,th]=Zm(Xm),nh=Ym(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=$m(t),c=O.useRef(null),[l,u]=O.useState(!1),[d,f]=O.useState(0),[p,m]=O.useState(0),[h,g]=jo({prop:r,defaultProp:i??!1,onChange:a,caller:Xm});return(0,V.jsx)(xf,{...s,children:(0,V.jsx)(eh,{scope:t,contentId:qo(),titleId:qo(),descriptionId:qo(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:O.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:O.useCallback(()=>u(!0),[]),onCustomAnchorRemove:O.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),rh=`PopoverAnchor`,ih=O.forwardRef(Ym(function(e,t){let{__scopePopover:n,...r}=e,i=th(rh,n),a=$m(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return O.useEffect(()=>(o(),()=>s()),[o,s]),(0,V.jsx)(Cf,{...a,...r,ref:t})},`PopoverAnchor`)),ah=`PopoverPortal`,[oh,sh]=Zm(ah,{forceMount:void 0}),ch=Ym(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=th(ah,t);return(0,V.jsx)(oh,{scope:t,forceMount:n,children:(0,V.jsx)(q,{present:n||a.open,children:(0,V.jsx)($s,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),lh=`PopoverContent`,uh=O.forwardRef(Ym(function(e,t){let n=sh(lh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=th(lh,e.__scopePopover);return(0,V.jsx)(q,{present:r||a.open,children:a.modal?(0,V.jsx)(fh,{...i,ref:t}):(0,V.jsx)(ph,{...i,ref:t})})},`PopoverContent`)),dh=Ta(`PopoverContent.RemoveScroll`),fh=O.forwardRef(Ym(function(e,t){let n=th(lh,e.__scopePopover),r=O.useRef(null),i=U(t,r),a=O.useRef(!1),{nodes:o,registry:s}=zs();return O.useEffect(()=>{let e=r.current;if(e)return Cl(e)},[]),(0,V.jsx)(ml,{as:dh,allowPinchZoom:!0,shards:O.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,V.jsx)(mh,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),ph=O.forwardRef(Ym(function(e,t){let n=th(lh,e.__scopePopover),r=O.useRef(!1),i=O.useRef(!1);return(0,V.jsx)(mh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),mh=O.forwardRef(Ym(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=th(lh,n),g=$m(n),[_,v]=O.useState(null),y=U(t,v);return Bs(_),ac(),(0,V.jsx)(Rs,{registry:p,children:(0,V.jsx)(Is,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,V.jsx)(ws,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,V.jsx)(Df,{"data-state":hh(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?gh(d,h.descriptionId):d,...g,...m,ref:y,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function hh(e){return e?`open`:`closed`}Ym(hh,`getState`);function gh(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ym(gh,`concatAriaDescribedby`);var _h=Object.defineProperty,vh=(e,t)=>_h(e,`name`,{value:t,configurable:!0}),yh={ItemAligned:`item-aligned`,Popper:`popper`},bh={LTR:`ltr`,RTL:`rtl`},xh=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Sh=[` `,`Enter`],Ch=`Select`,[wh,Th,Eh]=ro(Ch),[Dh,Oh]=Qa(Ch,[Eh,vf]),kh=vf(),[Ah,jh]=Dh(Ch),[Mh,Nh]=Dh(Ch);function Ph(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=kh(t),[_,v]=O.useState(null),[y,b]=O.useState(null),[x,S]=O.useState(!1),C=fs(l),[w,T]=jo({prop:r,defaultProp:i??!1,onChange:a,caller:Ch}),[E,D]=jo({prop:o,defaultProp:s,onChange:c,caller:Ch}),k=O.useRef(null),A=O.useRef(!1),[j,M]=O.useState(null),ee=vh(e=>{M({value:e,hasConsumerStoppedPropagation:A.current}),D(e)},`handleUserSelect`),te=O.useRef(E);O.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=vh(()=>D(te.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,D]);let N=!_||!!m||!!_.closest(`form`),[P,ne]=O.useState(new Set),re=qo(),ie=Array.from(P).map(e=>e.props.value).join(`;`),ae=O.useCallback(e=>{ne(t=>new Set(t).add(e))},[]),F=O.useCallback(e=>{ne(t=>{let n=new Set(t);return n.delete(e),n})},[]),oe={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:re,value:E,onValueChange:D,hasConsumerStoppedPropagationRef:A,userSelection:j,onUserSelect:ee,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:P,nativeSelectKey:ie,isFormControl:N};return(0,V.jsx)(xf,{...g,children:(0,V.jsx)(Ah,{scope:t,...oe,children:(0,V.jsx)(wh.Provider,{scope:t,children:(0,V.jsx)(Mh,{scope:t,onNativeOptionAdd:ae,onNativeOptionRemove:F,children:yg(h)?h(oe):n})})})})}vh(Ph,`SelectProvider`);var Fh=vh(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,V.jsx)(Ph,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,V.jsxs)(V.Fragment,{children:[n,e?(0,V.jsx)(vg,{__scopeSelect:t}):null]})})},`Select`),Ih=`SelectTrigger`,Lh=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=kh(n),o=jh(Ih,n),s=o.disabled||r,c=U(t,o.onTriggerChange),l=Th(n),u=O.useRef(`touch`),[d,f,p]=xg(e=>{let t=l().filter(e=>!e.disabled),n=Sg(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),m=vh(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,V.jsx)(Cf,{asChild:!0,...a,children:(0,V.jsx)(W.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":bg(o.value)?``:void 0,...i,ref:c,onClick:G(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:G(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:G(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),f(e.key)),t&&e.key===` `||xh.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),Rh=`SelectValue`,zh=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=jh(Rh,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=U(t,c.onValueNodeChange);eo(()=>{l(u)},[l,u]);let f=bg(c.value);return(0,V.jsx)(W.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,V.jsx)(O.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),Bh=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,V.jsx)(W.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Vh,Hh]=Dh(`SelectPortal`,{forceMount:void 0}),Uh=vh(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,V.jsx)(Vh,{scope:e.__scopeSelect,forceMount:n,children:(0,V.jsx)($s,{asChild:!0,...r})})},`SelectPortal`),Wh=`SelectContent`,Gh=O.forwardRef(vh(function(e,t){let n=Hh(Wh,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=jh(Wh,e.__scopeSelect),[o,s]=O.useState();return eo(()=>{s(new DocumentFragment)},[]),(0,V.jsx)(q,{present:r||a.open,children:({present:e})=>e?(0,V.jsx)(Zh,{...i,ref:t}):(0,V.jsx)(Kh,{...i,fragment:o})})},`SelectContent`)),Kh=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Va.createPortal((0,V.jsx)(Jh,{scope:n,children:(0,V.jsx)(wh.Slot,{scope:n,children:(0,V.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),qh=10,[Jh,Yh]=Dh(Wh),Xh=Ta(`SelectContent.RemoveScroll`),Zh=O.forwardRef(vh(function(e,t){let{__scopeSelect:n}=e,{position:r=yh.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=jh(Wh,n),[y,b]=O.useState(null),[x,S]=O.useState(null),C=U(t,b),[w,T]=O.useState(null),[E,D]=O.useState(null),k=Th(n),[A,j]=O.useState(!1),M=O.useRef(!1),ee=O.useRef(!1),te=O.useRef(!1);O.useEffect(()=>{if(y)return Cl(y)},[y]),ac();let N=O.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,x]),P=O.useCallback(()=>N([w,y]),[N,w,y]);O.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:ne,triggerPointerDownPosRef:re}=v;O.useEffect(()=>{if(y){let e={x:0,y:0},t=vh(t=>{e={x:Math.abs(Math.round(t.pageX)-(re.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(re.current?.y??0))}},`handlePointerMove`),n=vh(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||ne(!1),document.removeEventListener(`pointermove`,t),re.current=null},`handlePointerUp`);return re.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,ne,re]),O.useEffect(()=>{let e=vh(()=>ne(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ne]);let[ie,ae]=xg(e=>{let t=k().filter(e=>!e.disabled),n=Sg(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),F=O.useCallback((e,t,n)=>{let r=!ee.current;r&&(ee.current=!0);let i=!M.current&&!n;v.value!==void 0&&v.value===t||i?(T(e),i&&(M.current=!0)):r&&T(e)},[v.value]),oe=O.useCallback(()=>y?.focus(),[y]),se=O.useCallback((e,t,n)=>{if(!e)return;let r=!te.current;r&&(te.current=!0);let i=!M.current&&!n;(v.value!==void 0&&v.value===t||i||r)&&D(e)},[v.value]),ce=r===yh.Popper?$h:Qh,le=ce===$h?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,V.jsx)(Jh,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:F,selectedItem:w,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:P,selectedItemText:E,position:r,isPositioned:A,searchRef:ie,children:(0,V.jsx)(ml,{as:Xh,allowPinchZoom:!0,children:(0,V.jsx)(Is,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:G(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,V.jsx)(ws,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,V.jsx)(ce,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>j(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:G(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ae(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Qh=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=jh(Wh,n),o=Yh(Wh,n),[s,c]=O.useState(null),[l,u]=O.useState(null),d=U(t,u),f=Th(n),p=O.useRef(!1),m=O.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=O.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==bh.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-qh,d=qm(a,[qh,Math.max(qh,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-qh,d=qm(a,[qh,Math.max(qh,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-qh*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-qh,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${qh}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);eo(()=>y(),[y]);let[b,x]=O.useState();eo(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let S=O.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,V.jsx)(eg,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,V.jsx)(W.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),$h=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=qh,...a}=e,o=kh(n);return(0,V.jsx)(Df,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[eg,tg]=Dh(Wh,{}),ng=`SelectViewport`,rg=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Yh(ng,n),o=tg(ng,n),s=U(t,a.onViewportChange),c=O.useRef(0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,V.jsx)(wh.Slot,{scope:n,children:(0,V.jsx)(W.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:G(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-qh*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[ig,ag]=Dh(`SelectGroup`),og=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,...r}=e,i=qo();return(0,V.jsx)(ig,{scope:n,id:i,children:(0,V.jsx)(W.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})},`SelectGroup`)),sg=`SelectLabel`,cg=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,...r}=e,i=ag(sg,n);return(0,V.jsx)(W.div,{id:i.id,...r,ref:t})},`SelectLabel`)),lg=`SelectItem`,[ug,dg]=Dh(lg),fg=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=jh(lg,n),c=Yh(lg,n),l=s.value===r,[u,d]=O.useState(a??``),[f,p]=O.useState(!1),m=U(t,gs(e=>c.itemRefCallback?.(e,r,i))),h=qo(),g=O.useRef(`touch`);function _(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return vh(_,`handleSelect`),(0,V.jsx)(ug,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:O.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,V.jsx)(wh.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,V.jsx)(W.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:G(o.onFocus,()=>p(!0)),onBlur:G(o.onBlur,()=>p(!1)),onClick:G(o.onClick,e=>{i||g.current!==`mouse`&&_(e)}),onPointerUp:G(o.onPointerUp,e=>{i||g.current===`mouse`&&_(e)}),onPointerDown:G(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:G(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:G(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Sh.includes(e.key)&&_(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),pg=`SelectItemText`,mg=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=jh(pg,n),s=Yh(pg,n),c=dg(pg,n),l=Nh(pg,n),[u,d]=O.useState(null),f=gs(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=U(t,d,c.onItemTextChange,f),m=u?.textContent,h=O.useMemo(()=>(0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return eo(()=>(g(h),()=>_(h)),[g,_,h]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(W.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!bg(o.value)?Va.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),hg=`SelectItemIndicator`,gg=O.forwardRef(vh(function(e,t){let{__scopeSelect:n,...r}=e;return dg(hg,n).isSelected?(0,V.jsx)(W.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),_g=`SelectBubbleInput`,vg=O.forwardRef(vh(function({__scopeSelect:e,...t},n){let r=jh(_g,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=O.useRef(null),h=U(n,m),g=i??``,_=O.useRef(g),v=O.useRef(d),y=O.useRef(!1),b=Array.from(f).some(e=>(e.props.value??``)===``);return O.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=d!==null&&d!==v.current;v.current=d;let i=_.current!==g;_.current=g;let a=r&&i;if(r&&!i&&d.value!==g&&!d.hasConsumerStoppedPropagation&&n){y.current=!0;try{n.call(e,d.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{y.current=!1,n.call(e,g)}return}let o=a&&!d.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,g),e.dispatchEvent(t)}},[g,d]),(0,V.jsxs)(W.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{y.current||a(e.target.value)},...t,style:{...qa,...t.style},ref:h,defaultValue:g,children:[bg(i)&&!b?(0,V.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function yg(e){return typeof e==`function`}vh(yg,`isFunction`);function bg(e){return e===``||e===void 0}vh(bg,`shouldShowPlaceholder`);function xg(e){let t=gs(e),n=O.useRef(``),r=O.useRef(0),i=O.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}vh(a,`updateSearch`),a(i)},[t]),a=O.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return O.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}vh(xg,`useTypeaheadSearch`);function Sg(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Cg(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}vh(Sg,`findNextItem`);function Cg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}vh(Cg,`wrapArray`);var wg=Object.defineProperty,Tg=(e,t)=>wg(e,`name`,{value:t,configurable:!0}),Eg={Automatic:`automatic`,Manual:`manual`},Dg=`Tabs`,[Og,kg]=Qa(Dg,[Jf]),Ag=Jf(),[jg,Mg]=Og(Dg),Ng=O.forwardRef(Tg(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=Eg.Automatic,...l}=e,u=fs(s),[d,f]=jo({prop:r,onChange:i,defaultProp:a??``,caller:Dg});return(0,V.jsx)(jg,{scope:n,baseId:qo(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,V.jsx)(W.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Pg=`TabsList`,Fg=O.forwardRef(Tg(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Mg(Pg,n),o=Ag(n);return(0,V.jsx)($f,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,V.jsx)(W.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Ig=`TabsTrigger`,Lg=O.forwardRef(Tg(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Mg(Ig,n),s=Ag(n),c=Bg(o.baseId,r),l=Vg(o.baseId,r),u=r===o.value;return(0,V.jsx)(np,{asChild:!0,...s,focusable:!i,active:u,children:(0,V.jsx)(W.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:G(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:G(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:G(e.onFocus,()=>{let e=o.activationMode!==Eg.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Rg=`TabsContent`,zg=O.forwardRef(Tg(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Mg(Rg,n),c=Bg(s.baseId,r),l=Vg(s.baseId,r),u=r===s.value,d=O.useRef(u);return O.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,V.jsx)(q,{present:i||u,children:({present:n})=>(0,V.jsx)(W.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Bg(e,t){return`${e}-trigger-${t}`}Tg(Bg,`makeTriggerId`);function Vg(e,t){return`${e}-content-${t}`}Tg(Vg,`makeContentId`);var Hg=Object.defineProperty,Ug=(e,t)=>Hg(e,`name`,{value:t,configurable:!0}),Wg=`Toggle`,Gg=O.forwardRef(Ug(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=jo({prop:n,onChange:i,defaultProp:r??!1,caller:Wg});return(0,V.jsx)(W.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:G(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Kg=Object.defineProperty,qg=(e,t)=>Kg(e,`name`,{value:t,configurable:!0}),Jg=`ToggleGroup`,Yg={Single:`single`,Multiple:`multiple`},[Xg,Zg]=Qa(Jg,[Jf]),Qg=Jf(),$g=O.forwardRef(qg(function(e,t){let{type:n,...r}=e;if(n===Yg.Single)return(0,V.jsx)(n_,{role:`radiogroup`,...r,ref:t});if(n===Yg.Multiple)return(0,V.jsx)(r_,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Jg}\``)},`ToggleGroup`)),[e_,t_]=Xg(Jg),n_=O.forwardRef(qg(function(e,t){let{value:n,defaultValue:r,onValueChange:i=qg(()=>{},`onValueChange`),...a}=e,[o,s]=jo({prop:n,defaultProp:r??``,onChange:i,caller:Jg});return(0,V.jsx)(e_,{scope:e.__scopeToggleGroup,type:Yg.Single,value:O.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:O.useCallback(()=>s(``),[s]),children:(0,V.jsx)(o_,{...a,ref:t})})},`ToggleGroupImplSingle`)),r_=O.forwardRef(qg(function(e,t){let{value:n,defaultValue:r,onValueChange:i=qg(()=>{},`onValueChange`),...a}=e,[o,s]=jo({prop:n,defaultProp:r??[],onChange:i,caller:Jg}),c=O.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=O.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,V.jsx)(e_,{scope:e.__scopeToggleGroup,type:Yg.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,V.jsx)(o_,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[i_,a_]=Xg(Jg),o_=O.forwardRef(qg(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Qg(n),u=fs(o),d={dir:u,...c};return(0,V.jsx)(i_,{scope:n,rovingFocus:i,disabled:r,children:i?(0,V.jsx)($f,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,V.jsx)(W.div,{...d,ref:t})}):(0,V.jsx)(W.div,{...d,ref:t})})},`ToggleGroupImpl`)),s_=`ToggleGroupItem`,c_=O.forwardRef(qg(function(e,t){let n=t_(s_,e.__scopeToggleGroup),r=a_(s_,e.__scopeToggleGroup),i=Qg(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=O.useRef(null);return r.rovingFocus?(0,V.jsx)(np,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,V.jsx)(l_,{...s,ref:t})}):(0,V.jsx)(l_,{...s,ref:t})},`ToggleGroupItem`)),l_=O.forwardRef(qg(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=t_(s_,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===Yg.Single?o:void 0;return(0,V.jsx)(Gg,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),u_=Object.defineProperty,d_=(e,t)=>u_(e,`name`,{value:t,configurable:!0}),[f_,p_]=Qa(`Tooltip`,[vf]),m_=vf(),h_=`TooltipProvider`,g_=700,__=`tooltip.open`,[v_,y_]=f_(h_),b_=d_(e=>{let{__scopeTooltip:t,delayDuration:n=g_,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=O.useRef(!0),s=O.useRef(!1),c=O.useRef(0);return O.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,V.jsx)(v_,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:O.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:O.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:O.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),x_=`Tooltip`,[S_,C_]=f_(x_),w_=d_(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=y_(x_,e.__scopeTooltip),l=m_(t),[u,d]=O.useState(null),[f,p]=O.useState(void 0),m=qo(),h=O.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=O.useRef(!1),[y,b]=jo({prop:r,defaultProp:i??!1,onChange:d_(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(__))):c.onClose(),a?.(e)},`onChange`),caller:x_}),x=O.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=O.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=O.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=O.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);O.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,V.jsx)(xf,{...l,children:(0,V.jsx)(S_,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:O.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:O.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),T_=`TooltipTrigger`,E_=O.forwardRef(d_(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=C_(T_,n),o=y_(T_,n),s=m_(n),c=U(t,O.useRef(null),a.onTriggerChange),l=O.useRef(!1),u=O.useRef(!1),d=O.useCallback(()=>l.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,V.jsx)(Cf,{asChild:!0,...s,children:(0,V.jsx)(W.button,{"aria-describedby":a.open?H_(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:G(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:G(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:G(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:G(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:G(e.onBlur,a.onClose),onClick:G(e.onClick,a.onClose)})})},`TooltipTrigger`)),D_=`TooltipPortal`,[O_,k_]=f_(D_,{forceMount:void 0}),A_=d_(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=C_(D_,t);return(0,V.jsx)(O_,{scope:t,forceMount:n,children:(0,V.jsx)(q,{present:n||a.open,children:(0,V.jsx)($s,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),j_=`TooltipContent`,M_=O.forwardRef(d_(function(e,t){let n=k_(j_,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=C_(j_,e.__scopeTooltip);return(0,V.jsx)(q,{present:r||o.open,children:o.disableHoverableContent?(0,V.jsx)(F_,{side:i,...a,ref:t}):(0,V.jsx)(N_,{side:i,...a,ref:t})})},`TooltipContent`)),N_=O.forwardRef(d_(function(e,t){let n=C_(j_,e.__scopeTooltip),r=y_(j_,e.__scopeTooltip),i=O.useRef(null),a=U(t,i),[o,s]=O.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=O.useCallback(()=>{s(null),d(!1)},[d]),p=O.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=L_(r,I_(r,n.getBoundingClientRect())),a=R_(t.getBoundingClientRect()),o=B_([...i,...a]);s(o),d(!0)},[d]);return O.useEffect(()=>()=>f(),[f]),O.useEffect(()=>{if(c&&u){let e=d_(e=>p(e,u),`handleTriggerLeave`),t=d_(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),O.useEffect(()=>{if(o){let e=d_(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!z_(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,V.jsx)(F_,{...e,ref:a})},`TooltipContentHoverable`)),P_=Oa(`TooltipContent`),F_=O.forwardRef(d_(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=C_(j_,n),u=m_(n),{onClose:d}=l,[f,p]=O.useState(null),m=U(t,p);Bs(f),O.useEffect(()=>(document.addEventListener(__,d),()=>document.removeEventListener(__,d)),[d]),O.useEffect(()=>{if(l.trigger){let e=d_(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return eo(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,V.jsx)(ws,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,V.jsxs)(Df,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,V.jsx)(P_,{children:r}),i?(0,V.jsx)(Ja,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function I_(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}d_(I_,`getExitSideFromRect`);function L_(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}d_(L_,`getPaddedExitPoints`);function R_(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}d_(R_,`getPointsFromRect`);function z_(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}d_(z_,`isPointInPolygon`);function B_(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),V_(t)}d_(B_,`getHull`);function V_(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}d_(V_,`getHullPresorted`);function H_(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}d_(H_,`concatAriaDescribedby`);function U_({delayDuration:e=400,...t}){return(0,V.jsx)(b_,{delayDuration:e,...t})}var W_=w_,G_=E_;function K_(e){let t=document.activeElement;e&&(e.style.animation=`none`);let n=0,r=()=>{n+=1,e?.isConnected&&n<20?window.requestAnimationFrame(r):(t?.isConnected?t:document.body).dispatchEvent(new KeyboardEvent(`keydown`,{key:`Escape`,code:`Escape`,bubbles:!0,cancelable:!0}))};window.requestAnimationFrame(r)}function q_({className:e,sideOffset:t=6,children:n,onEscapeKeyDown:r,...i}){let a=(0,O.useRef)(null);return(0,V.jsx)(A_,{children:(0,V.jsx)(M_,{ref:a,sideOffset:t,collisionPadding:8,onEscapeKeyDown:e=>{r?.(e),e.defaultPrevented||K_(a.current)},className:B(`z-[70] max-w-64 animate-fade-in data-[state=closed]:animate-fade-out rounded-md bg-fg px-2 py-1 text-xs font-medium text-surface shadow-pop select-none`,e),...i,children:n})})}function J_({content:e,side:t=`top`,align:n,children:r,...i}){return e?(0,V.jsxs)(W_,{...i,children:[(0,V.jsx)(G_,{asChild:!0,children:r}),(0,V.jsx)(q_,{side:t,align:n,children:e})]}):r}var Y_=_a(`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-md font-medium whitespace-nowrap transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-accent text-accent-fg shadow-card hover:bg-accent/90`,soft:`bg-accent/8 text-accent ring-1 ring-accent/40 ring-inset hover:bg-accent/12`,secondary:`border border-line bg-surface text-fg shadow-card hover:bg-surface-2`,ghost:`text-muted hover:bg-surface-2 hover:text-fg`,danger:`text-bad hover:bg-bad/10`,link:`px-0 text-accent underline-offset-2 hover:underline`,inverse:`text-current hover:bg-white/15`},size:{xs:`h-7 px-2 text-xs`,sm:`h-8 px-2.5 text-xs`,md:`h-10 px-3 text-sm`,touch:`h-11 min-w-11 px-3 text-sm`,"icon-xs":`h-7 w-7 p-0`,"icon-sm":`h-8 w-8 p-0`,icon:`h-11 w-11 p-0`}},defaultVariants:{variant:`secondary`,size:`sm`}});function J({variant:e,size:t,asChild:n=!1,className:r,type:i=`button`,...a}){let o=n?Ea:`button`;return(0,V.jsx)(o,{type:n?void 0:i,className:B(Y_({variant:e,size:t}),r),...a})}function X_({label:e,tooltip:t,side:n,variant:r=`ghost`,size:i=`icon-sm`,children:a,...o}){return(0,V.jsx)(J_,{content:t??e,side:n,children:(0,V.jsx)(J,{variant:r,size:i,"aria-label":e,...o,children:a})})}var Z_=ts;function Q_({className:e,children:t,chevron:n=!0,...r}){return(0,V.jsxs)(rs,{className:B(`group/collapsible flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left text-ui font-medium text-fg transition-colors hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent lg:min-h-8`,e),...r,children:[n?(0,V.jsx)(me,{size:14,className:`shrink-0 text-faint transition-transform duration-(--motion-fast) ease-standard group-data-[state=open]/collapsible:rotate-90`,"aria-hidden":`true`}):null,t]})}function $_({className:e,...t}){return(0,V.jsx)(as,{className:B(`overflow-hidden data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down`,e),...t})}function ev({title:e,meta:t,children:n,defaultOpen:r=!1,open:i,onOpenChange:a,className:o,triggerClassName:s,contentClassName:c,...l}){return(0,V.jsxs)(Z_,{defaultOpen:r,open:i,onOpenChange:a,className:o,...l,children:[(0,V.jsxs)(Q_,{className:s,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),t==null?null:(0,V.jsx)(`span`,{className:`shrink-0 text-caption font-normal text-faint tabular-nums`,children:t})]}),(0,V.jsx)($_,{children:(0,V.jsx)(`div`,{className:B(`px-2 pt-1 pb-2`,c),children:n})})]})}var tv=/(^|[^\w@.])@([a-z][\w.-]{0,39})/gi,nv=e=>e.replace(/[.-]+$/,``);function rv(e){let t=[];if(typeof e!=`string`||!e.includes(`@`))return t;for(let n of e.matchAll(tv)){let e=nv(n[2]).toLowerCase();e&&!t.includes(e)&&t.push(e)}return t}function iv(e){let t=rv(e?.body);for(let n of Array.isArray(e?.replies)?e.replies:[])for(let e of rv(n?.body))t.includes(e)||t.push(e);return t}var av=[`👍`,`❤️`,`🎉`,`😄`,`👀`,`🚀`],ov=e=>typeof e==`string`&&av.includes(e),sv=e=>typeof e==`string`?e.replace(/[\u0000-\u001f\u007f]+/g,` `).replace(/\s+/g,` `).trim().slice(0,80):``;function cv(e){return!e||typeof e!=`object`?``:typeof e.user==`string`&&e.user?`u:${e.user}`:`n:${sv(e.name).toLowerCase()}`}function lv(e){let t=sv(e?.name);return t?{name:t,...typeof e.handle==`string`&&/^[a-z][\w.-]{0,39}$/.test(e.handle)?{handle:e.handle}:{},...typeof e.user==`string`&&e.user?{user:e.user.slice(0,80)}:{}}:null}function uv(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e){if(!n||!ov(n.emoji)||!Array.isArray(n.by))continue;let e=t.get(n.emoji)||[],r=new Set(e.map(cv));for(let t of n.by){let n=lv(t);!n||r.has(cv(n))||e.length>=200||(r.add(cv(n)),e.push(n))}t.set(n.emoji,e)}return av.filter(e=>t.get(e)?.length).map(e=>({emoji:e,by:t.get(e)}))}function dv(e,t,n){if(!ov(t))throw Object.assign(Error(`Reactions are ${av.join(` `)}.`),{code:`invalid_reaction`});let r=lv(n);if(!r)throw Object.assign(Error(`A reaction needs a name.`),{code:`invalid_reaction`});let i=cv(r),a=uv(e),o=a.find(e=>e.emoji===t),s=!!o?.by.some(e=>cv(e)===i);if(!s&&(o?.by.length||0)>=200)throw Object.assign(Error(`That reaction is full.`),{code:`too_many_reactions`});return{reactions:uv(s?a.map(e=>e.emoji===t?{...e,by:e.by.filter(e=>cv(e)!==i)}:e):o?a.map(e=>e.emoji===t?{...e,by:[...e.by,r]}:e):[...a,{emoji:t,by:[r]}]),added:!s}}function fv(e){return uv(e).map(e=>({emoji:e.emoji,count:e.by.length,by:e.by.map(e=>({name:e.name,...e.handle?{handle:e.handle}:{}}))}))}var pv=String.raw`(?:#(?:[A-Za-z0-9_\u0080-￿-]|\\[0-9a-fA-F]{6} ?|\\[0-9a-fA-F]{1,5}(?![0-9a-fA-F]) ?|\\[^0-9a-fA-F\n\r\f])+|[a-z][a-z0-9-]{0,40}(?:\[(?:data-testid|aria-label)="(?:[^"\\\n]|\\.){0,200}"\]|:nth-of-type\([1-9][0-9]{0,4}\)))`;RegExp(`^${pv}(?: > ${pv}){0,79}$`);function mv(e){return e===`queued`||e===`working`?`done`:e===`needs-human`?null:e??null}var hv=2e3,gv=60,_v=200,vv=500,yv=class extends Error{constructor(e,t,n){super(n),this.status=e,this.code=t}},bv=e=>`shapewall-browser-comments:${window.location.pathname}:${e}`;function xv(e){try{let t=JSON.parse(window.localStorage.getItem(bv(e))||`null`);return t&&Array.isArray(t.comments)?t:null}catch{return null}}function Sv(e,t){try{window.localStorage.setItem(bv(e),JSON.stringify(t))}catch{throw new yv(507,`storage_full`,`This browser would not save the comment (storage is full or blocked).`)}}async function Cv(e,t){let n=xv(e);if(n)return n;let r=await t(`data/boards/${e}/comments.json`),i=Array.isArray(r?.comments)?r.comments:[];return{nextId:Math.max(0,...i.map(e=>Number(e.id)||0))+1,comments:i}}function wv(e){let t=typeof e==`string`?e.trim():``;if(!t)throw new yv(400,`empty_body`,`Write something first.`);if(t.length>hv)throw new yv(400,`body_too_long`,`Comments are limited to ${hv} characters.`);return t}function Tv(e,t){let n=mv(e.agentStatus);if(n===(e.agentStatus??null))return e;let r={...e,agentStatus:n,agentStatusAt:n?t:null};return delete r.agentBranch,r}var Ev=e=>(typeof e==`string`?e.replace(/\s+/g,` `).trim().slice(0,gv):``)||`anonymous`;function Dv(e){let t=(Array.isArray(e.replies)?e.replies:[]).map(e=>({...e,reactions:fv(e.reactions)}));return{...e,replies:t,reactions:fv(e.reactions),editedAt:typeof e.editedAt==`string`?e.editedAt:null,reopenCount:Number(e.reopenCount)>0?Number(e.reopenCount):0,reopenedAt:typeof e.reopenedAt==`string`?e.reopenedAt:null,mentions:iv({body:e.body,replies:t})}}function Ov(e){let t={};for(let n of e)t[n.pageId]=t[n.pageId]||{open:0,resolved:0},t[n.pageId][n.status]=(t[n.pageId][n.status]||0)+1;return t}async function kv(e,t,n,r){let[i]=t.split(`?`),a=/^\/api\/boards\/([a-z0-9-]+)(\/comments(?:\/(\d+)(?:\/(resolve|reopen|replies|reactions))?)?)?$/.exec(i);if(!a)return;let[,o,s,c,l]=a;if(!s){if(e!==`GET`)return;let[t,n]=await Promise.all([r(`data/boards/${o}.json`),Cv(o,r)]);return{...t,commentCounts:Ov(n.comments)}}let u=await Cv(o,r),d=new Date().toISOString();if(!c){if(e===`GET`)return{comments:u.comments.map(Dv).sort((e,t)=>e.createdAt<t.createdAt?1:e.createdAt>t.createdAt?-1:t.id-e.id)};if(e!==`POST`)return;if(u.comments.length>=vv)throw new yv(409,`too_many_comments`,`That is a lot of comments for a demo.`);let t=Number(n?.x),r=Number(n?.y);if(!Number.isFinite(t)||!Number.isFinite(r)||t<0||t>100||r<0||r>100)throw new yv(400,`invalid_position`,`The pin must sit on the page.`);let i={id:u.nextId,pageId:String(n?.pageId||``),viewport:String(n?.viewport||``),x:Math.round(t*100)/100,y:Math.round(r*100)/100,body:wv(n?.body),author:Ev(n?.author),...n?.anchor&&typeof n.anchor==`object`?{anchor:n.anchor}:{},captureVersion:null,status:`open`,createdAt:d,updatedAt:d,resolvedAt:null,resolution:null,replies:[],agentStatus:null,agentStatusAt:null};return Sv(o,{nextId:u.nextId+1,comments:[...u.comments,i]}),{comment:Dv(i)}}let f=Number(c),p=u.comments.find(e=>e.id===f);if(!p)throw new yv(404,`unknown_comment`,`That comment does not exist.`);if(e===`DELETE`&&!l)return Sv(o,{...u,comments:u.comments.filter(e=>e.id!==f)}),{ok:!0};let m=null,h=null;if(e===`POST`&&(l===`resolve`||l===`reopen`)){let e=l===`resolve`,t=!e&&p.status===`resolved`;m={...p,status:e?`resolved`:`open`,resolvedAt:e?d:null},e?p.status!==`resolved`&&(m=Tv(m,d)):m={...m,resolution:null,agentStatus:null,agentStatusAt:null},t&&(m={...m,reopenCount:(Number(p.reopenCount)||0)+1,reopenedAt:d})}else if(e===`POST`&&l===`replies`){let e=Array.isArray(p.replies)?p.replies:[];if(e.length>=_v)throw new yv(409,`too_many_replies`,`A comment holds at most ${_v} replies.`);h={id:Math.max(0,...e.map(e=>Number(e.id)||0))+1,author:Ev(n?.author),body:wv(n?.body),createdAt:d},m={...p,replies:[...e,h]}}else if(e===`POST`&&l===`reactions`){let e=n?.replyId??null,t=Array.isArray(p.replies)?p.replies:[],r=e===null?p:t.find(t=>Number(t.id)===Number(e));if(!r)throw new yv(404,`unknown_reply`,`That reply does not exist.`);let i;try{i=dv(r.reactions,n?.emoji,{name:Ev(n?.author)})}catch(e){throw new yv(400,e.code||`invalid_reaction`,e.message)}let a=e===null?{...p,reactions:i.reactions}:{...p,replies:t.map(e=>e===r?{...e,reactions:i.reactions}:e)};return Sv(o,{...u,comments:u.comments.map(e=>e.id===f?a:e)}),{comment:Dv(a),added:i.added}}else if(e===`PATCH`&&!l){if(m={...p},n?.body!==void 0){let e=wv(n.body);e!==p.body&&(m={...m,body:e,editedAt:d})}(n?.status===`open`||n?.status===`resolved`)&&n.status!==p.status&&(m.status=n.status,m.resolvedAt=n.status===`resolved`?d:null,n.status===`open`?(m.resolution=null,m.reopenCount=(Number(p.reopenCount)||0)+1,m.reopenedAt=d):m=Tv(m,d))}else return;return m.updatedAt=d,Sv(o,{...u,comments:u.comments.map(e=>e.id===f?m:e)}),h?{comment:Dv(m),reply:h}:{comment:Dv(m)}}var Av=!1,jv=null,Mv=new Set,Nv=e=>(Mv.add(e),()=>Mv.delete(e)),Pv=()=>0;function Fv(){return(0,O.useSyncExternalStore)(Nv,Pv,Pv),jv}var Iv=e=>typeof document<`u`&&!!document.querySelector(`meta[name="${e}"]`),Lv=Iv(`shapewall-static`),Rv=Lv&&Iv(`shapewall-browser-comments`),zv=`shapewall-settings-token`,Bv=`X-Shapewall-Settings-Token`;function Vv(){if(typeof window>`u`||Lv)return null;try{let e=new URLSearchParams(window.location.hash.replace(/^#/,``)),t=e.get(`settings-token`);if(t){window.sessionStorage.setItem(zv,t),e.delete(`settings-token`);let n=e.toString();window.history.replaceState(window.history.state,``,`${window.location.pathname}${window.location.search}${n?`#${n}`:``}`)}return window.sessionStorage.getItem(zv)}catch{return null}}var Hv=Vv();typeof window<`u`&&!Lv&&window.addEventListener(`hashchange`,()=>{if(!new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`settings-token`))return;let e=Vv();e&&!new URLSearchParams(window.location.hash.replace(/^#/,``)).has(`settings-token`)&&(Hv=e,window.location.reload())});function Uv(){Hv=null;try{window.sessionStorage.removeItem(zv)}catch{}}var Wv=()=>Hv?{[Bv]:Hv}:{},Gv=(e,t)=>e===`/api/info`||e.startsWith(`/api/app-update`)||e.startsWith(`/api/agent/settings`)||e===`/api/agent/status`||e.startsWith(`/api/agent/feedback`)||e.startsWith(`/api/agent/branches`)||/^\/?api\/agent\/boards\//.test(e)&&e.includes(`/threads`)||/^\/?api\/agent\/boards\/[a-z0-9-]+\/batch(\/|$)/.test(e)||e.startsWith(`/api/devices`)||e.startsWith(`/api/share/`)||/^\/api\/boards\/[a-z0-9-]+\/checks\/run$/.test(e)||t!==`GET`&&e.startsWith(`/api/agent/boards/`)&&e.includes(`/threads/`);function Kv(e){let[t,n=``]=e.split(`?`);if(t===`/api/info`)return`data/info.json`;if(t===`/api/boards`)return`data/boards.json`;let r=/^\/api\/boards\/([a-z0-9-]+)$/.exec(t);if(r)return`data/boards/${r[1]}.json`;if(r=/^\/api\/boards\/([a-z0-9-]+)\/checks$/.exec(t),r){let e=new URLSearchParams(n).get(`env`);return e&&/^[a-z0-9][a-z0-9-]{0,63}$/.test(e)?`data/boards/${r[1]}/checks-${e}.json`:`data/boards/${r[1]}/checks.json`}if(r=/^\/api\/boards\/([a-z0-9-]+)\/comments$/.exec(t),r)return`data/boards/${r[1]}/comments.json`;if(r=/^\/api\/boards\/([a-z0-9-]+)\/journeys$/.exec(t),r)return`data/boards/${r[1]}/journeys.json`;if(r=/^\/api\/boards\/([a-z0-9-]+)\/compare$/.exec(t),r){let e=new URLSearchParams(n),[t,i]=[e.get(`a`)||``,e.get(`b`)||``];if(/^[a-z0-9-]+$/.test(t)&&/^[a-z0-9-]+$/.test(i))return`data/boards/${r[1]}/compare/${t}_${i}.json`}return null}var qv=class extends Error{constructor(e,t,n,{details:r=null,retryAfter:i=null}={}){super(n),this.status=e,this.code=t,this.details=r,this.retryAfter=i}},Jv=(e,t)=>new qv(e,t?.error?.code||`http_error`,t?.error?.message||`Request failed (${e})`,{details:t?.error?.details||null});async function Yv(e){let t=await fetch(e,{headers:{Accept:`application/json`},cache:`no-store`});if(!t.ok)throw new qv(t.status,`http_error`,`Request failed (${t.status})`);return t.json()}var Xv=1e3,Zv=e=>new Promise(t=>setTimeout(t,e));async function Qv(e,t,n){for(let r=0;;r+=Xv)try{return await $v(e,t,n)}catch(t){if(e===`GET`||t?.status!==409||t.code!==`test_running`||r>=45e3)throw t;await Zv(Xv)}}async function $v(e,t,n){if(Rv){let r=await kv(e,t,n,Yv);if(r!==void 0)return r}let r=Lv?Kv(t):Iv(`shapewall-local-console`)?t:t.replace(/^\//,``);if(!r||Lv&&e!==`GET`)throw new qv(404,`static`,`Not available in a static export.`);let i=n===void 0?{Accept:`application/json`}:{Accept:`application/json`,"Content-Type":`application/json`};Hv&&Gv(t,e)&&(i[Bv]=Hv);let a=await fetch(r,{method:e,headers:i,body:n===void 0?void 0:JSON.stringify(n),cache:`no-store`}),o=null;try{o=await a.json()}catch{o=null}if(!a.ok)throw ny(a.status,o?.error?.code),Jv(a.status,o);return o}var ey=`shapewall:access-lost`,ty={share_ended:`share`,signed_out:`signed_out`,unknown_workspace:`removed`,unknown_project:`removed`};function ny(e,t){if(Lv||typeof window>`u`)return;e===401&&t===`pairing_required`&&window.dispatchEvent(new CustomEvent(`shapewall:pairing-required`));let n=(e===401||e===404)&&ty[t];n&&window.dispatchEvent(new CustomEvent(ey,{detail:{kind:n}}))}var ry={get:e=>Qv(`GET`,e),post:(e,t={})=>Qv(`POST`,e,t),patch:(e,t={})=>Qv(`PATCH`,e,t),delete:e=>Qv(`DELETE`,e)};function iy(e,{pollMs:t=0}={}){let[n,r]=(0,O.useState)({data:null,error:null,loading:!0}),i=(0,O.useRef)(0),a=(0,O.useRef)(null),o=(0,O.useCallback)(async()=>{if(!e)return null;let t=++i.current;try{let n=await ry.get(e);if(t===i.current){let e=JSON.stringify(n),t=e===a.current;a.current=e,r(e=>t&&!e.error&&!e.loading?e:{data:n,error:null,loading:!1})}return n}catch(e){return t===i.current&&r(t=>({data:t.data,error:e,loading:!1})),null}},[e]);(0,O.useEffect)(()=>{a.current=null,r({data:null,error:null,loading:!0}),o()},[o]),(0,O.useEffect)(()=>{if(!t||!e)return;let n=window.setInterval(()=>{document.visibilityState===`visible`&&o()},t);return()=>window.clearInterval(n)},[t,o,e]);let s=(0,O.useCallback)(e=>{i.current+=1,a.current=null,r(t=>({...t,data:typeof e==`function`?e(t.data):e}))},[]);return{...n,refetch:o,setData:s}}function ay(e){let t=(0,O.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]);return(0,O.useSyncExternalStore)(t,()=>window.matchMedia(e).matches,()=>!1)}var oy=new Set,sy=()=>oy.forEach(e=>e()),cy=null,ly=typeof window<`u`?window.location.search:``;function uy(e){ly=e,window.location.search!==e&&window.history.replaceState(window.history.state,``,`${window.location.pathname}${e}`),sy()}function dy(e){if(my>0){cy={...cy||{},...e};return}let t=new URLSearchParams(ly);for(let[n,r]of Object.entries(e))r==null||r===``?t.delete(n):t.set(n,String(r));let n=t.toString();uy(n?`?${n}`:``)}function fy(){let e=(0,O.useSyncExternalStore)(e=>(oy.add(e),()=>oy.delete(e)),()=>ly,()=>``);return[new URLSearchParams(e),(0,O.useCallback)(e=>dy(e),[])]}var py=[],my=0,hy=[],gy=0;function _y(){gy===0&&(my+=1,queueMicrotask(()=>{let e=gy;gy=0,window.history.go(-e)})),gy+=1}function vy(e){e.pushed=!0,window.history.pushState({...window.history.state||{},shapewallOverlay:py.length},``,window.location.href)}typeof window<`u`&&window.addEventListener(`popstate`,()=>{if(uy(ly),my>0){if(--my,my===0){if(cy){let e=cy;cy=null,dy(e)}let e=hy;hy=[];for(let t of e)py.includes(t)&&vy(t);let t=yy;yy=[];for(let e of t)e()}return}let e=py.pop();e&&e.close()});var yy=[];function by(e){let t=typeof e==`string`?()=>window.location.assign(e):e;setTimeout(()=>{my>0||gy>0?yy.push(t):t()},30)}function xy(e,t){let n=(0,O.useRef)(t);(0,O.useEffect)(()=>{n.current=t}),(0,O.useEffect)(()=>{if(!e)return;let t={close:()=>n.current(),pushed:!1};return py.push(t),my>0?hy.push(t):vy(t),()=>{let e=py.indexOf(t);e<0||(py.splice(e,1),t.pushed?_y():hy=hy.filter(e=>e!==t))}},[e])}var Sy=_a(`fixed inset-x-0 bottom-0 z-50 flex max-h-[88dvh] w-full animate-sheet-in flex-col overflow-hidden rounded-t-2xl border border-line bg-surface text-fg shadow-pop outline-none sm:inset-auto sm:top-1/2 sm:left-1/2 sm:max-h-[calc(100dvh-3rem)] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:animate-pop-in sm:rounded-xl`,{variants:{size:{sm:`sm:max-w-md`,md:`sm:max-w-xl`,lg:`sm:max-w-5xl`}},defaultVariants:{size:`sm`}});function Cy({className:e,...t}){return(0,V.jsx)(Ll,{className:B(`fixed inset-0 z-50 animate-fade-in bg-black/40`,e),...t})}function wy(e){e.preventDefault();let t=e.currentTarget;(t.querySelector(`[data-autofocus]`)||t.querySelector(`textarea, input, button:not([data-dialog-close]), [href]`)||t).focus()}function Ty({open:e,onClose:t,title:n,description:r,wrapDescription:i=!1,children:a,footer:o,size:s=`sm`,className:c,onCloseAutoFocus:l,sticky:u=!1}){return xy(e,t),(0,V.jsx)(jl,{open:e,onOpenChange:e=>e?null:t(),children:(0,V.jsxs)(Fl,{children:[(0,V.jsx)(Cy,{}),(0,V.jsxs)(Vl,{className:B(Sy({size:s}),c),style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`},onOpenAutoFocus:wy,onCloseAutoFocus:l,onEscapeKeyDown:e=>{(u||e.target?.closest?.(`[data-sw-own-escape="true"]`))&&e.preventDefault()},onInteractOutside:e=>{u&&e.preventDefault()},...r?{}:{"aria-describedby":void 0},children:[(0,V.jsxs)(`div`,{className:B(`flex gap-3 border-b border-line px-5 py-3.5`,i?`items-start`:`items-center`),children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(Gl,{className:`text-[15px] font-semibold text-fg`,children:n}),r?(0,V.jsx)(Kl,{className:B(`mt-0.5 text-xs text-muted`,i?`text-pretty`:`truncate`),children:r}):null]}),(0,V.jsx)(Jl,{"data-dialog-close":!0,className:`-mr-2 inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md text-muted hover:bg-surface-2 hover:text-fg focus-visible:outline-2 focus-visible:outline-accent`,"aria-label":`Close`,children:(0,V.jsx)(Ln,{size:18,"aria-hidden":`true`})})]}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:a}),o?(0,V.jsx)(`div`,{className:`flex justify-end gap-2 border-t border-line px-5 py-3`,children:o}):null]})]})})}function Ey(e,t,n=!1){let[r,i]=(0,O.useState)(n),a=e!==void 0,o=a?e:r,s=(0,O.useCallback)(e=>{a||i(e),t?.(e)},[a,t]);return xy(o,()=>s(!1)),[o,s]}function Dy({open:e,onOpenChange:t,defaultOpen:n,...r}){let[i,a]=Ey(e,t,n);return(0,V.jsx)(xm,{open:i,onOpenChange:a,...r})}var Oy=Cm,ky=Dm;function Ay({className:e,sideOffset:t=4,align:n=`end`,...r}){return(0,V.jsx)(wm,{children:(0,V.jsx)(Em,{sideOffset:t,align:n,collisionPadding:8,className:B(`z-[60] max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-44 overflow-y-auto data-[state=open]:animate-pop-in rounded-lg border border-line bg-surface p-1 text-fg shadow-pop`,e),...r})})}var jy=`relative flex h-11 w-full cursor-default items-center gap-2 rounded-md px-2 text-sm text-fg outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-2 lg:h-8 lg:text-[13px] [&_svg]:shrink-0 [&_svg]:text-muted`;function My({className:e,tone:t,...n}){return(0,V.jsx)(km,{className:B(jy,t===`danger`&&`text-bad [&_svg]:text-bad`,e),...n})}function Ny({className:e,...t}){return(0,V.jsx)(Om,{className:B(`px-2 pt-2 pb-1 text-[11px] font-medium tracking-wide text-faint uppercase`,e),...t})}function Py({className:e,...t}){return(0,V.jsx)(Nm,{className:B(`-mx-1 my-1 h-px bg-line`,e),...t})}var Fy=Am;function Iy({className:e,children:t,indicator:n=!0,...r}){return(0,V.jsxs)(jm,{className:B(jy,n&&`pr-8`,`data-[state=checked]:font-medium`,e),...r,children:[t,n?(0,V.jsx)(Mm,{className:`absolute right-2 inline-flex items-center text-accent`,children:(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,className:`!text-accent`,children:(0,V.jsx)(`path`,{d:`M3.5 8.5l3 3 6-7`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}):null]})}function Ly({icon:e,title:t,children:n,action:r=null,details:i=null,tone:a=`default`,size:o=`md`,className:s,...c}){let l=o===`lg`;return(0,V.jsxs)(`div`,{className:B(`flex flex-col items-center px-6 text-center`,l?`m-auto w-full max-w-md animate-rise-in gap-3 py-12`:`gap-2 py-10`,s),...c,children:[e?l?(0,V.jsx)(`span`,{className:B(`mb-1 inline-flex h-12 w-12 items-center justify-center rounded-xl border`,a===`bad`?`border-bad/25 bg-bad/10 text-bad`:`border-line bg-surface text-muted shadow-card`),children:(0,V.jsx)(e,{size:22,"aria-hidden":`true`})}):(0,V.jsx)(e,{size:22,className:a===`bad`?`text-bad`:`text-faint`,"aria-hidden":`true`}):null,(0,V.jsx)(`p`,{className:B(`font-medium text-fg`,l?`text-heading font-semibold`:`text-sm`),children:t}),n?(0,V.jsx)(`div`,{className:B(`text-muted`,l?`max-w-sm text-sm`:`max-w-xs text-xs`),children:n}):null,r?(0,V.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center justify-center gap-2`,children:r}):null,i?(0,V.jsx)(ev,{title:`Details`,className:`mt-2 w-full max-w-sm text-left`,triggerClassName:`mx-auto w-auto text-muted`,"data-sw-error-details":!0,children:(0,V.jsx)(`pre`,{className:`rounded-md break-all border border-line bg-surface-2 px-3 py-2 font-mono text-caption whitespace-pre-wrap text-muted`,children:i})}):null]})}var Ry=_a(`block w-full min-w-0 rounded-md border border-line bg-surface text-fg outline-none placeholder:text-faint focus:border-accent disabled:opacity-50`,{variants:{size:{xs:`h-7 px-2 text-xs`,sm:`h-8 px-2 text-[13px]`,touch:`h-11 px-2.5 text-base`}},defaultVariants:{size:`sm`}});function zy({size:e,icon:t,className:n,wrapperClassName:r,...i}){return t?(0,V.jsxs)(`span`,{className:B(`relative block`,r),children:[(0,V.jsx)(t,{size:13,className:`pointer-events-none absolute top-1/2 left-2 -translate-y-1/2 text-faint`,"aria-hidden":`true`}),(0,V.jsx)(`input`,{className:B(Ry({size:e}),`pl-7`,n),...i})]}):(0,V.jsx)(`input`,{className:B(Ry({size:e}),n),...i})}function By({className:e,...t}){return(0,V.jsx)(`kbd`,{className:B(`inline-flex h-4 min-w-4 items-center justify-center rounded border border-current/25 px-1 font-sans text-[10px] font-medium opacity-80`,e),...t})}function Vy({open:e,onOpenChange:t,defaultOpen:n,...r}){let[i,a]=Ey(e,t,n);return(0,V.jsx)(Fh,{open:i,onOpenChange:a,...r})}var Hy=og;function Uy(e){return(0,V.jsx)(zh,{...e})}var Wy=_a(`inline-flex min-w-0 items-center justify-between gap-1.5 rounded-md border bg-surface text-left font-medium text-fg shadow-card outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:pointer-events-none disabled:opacity-50 data-[placeholder]:text-muted`,{variants:{size:{xs:`h-7 px-2 text-xs`,sm:`h-8 px-2 text-[13px]`,touch:`h-11 px-3 text-sm`},tone:{default:`border-line`,active:`border-warn`}},defaultVariants:{size:`sm`,tone:`default`}}),Gy=new WeakSet;function Ky({size:e,tone:t,className:n,children:r,onKeyDown:i,...a}){return(0,V.jsxs)(Lh,{className:B(Wy({size:e,tone:t}),n),onKeyDown:e=>{i?.(e),e.defaultPrevented||e.ctrlKey||e.altKey||e.metaKey||e.key.length===1&&e.key!==` `&&(Gy.add(e.nativeEvent),e.preventDefault())},...a,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r}),(0,V.jsx)(Bh,{asChild:!0,children:(0,V.jsx)(fe,{size:14,className:`shrink-0 text-faint`,"aria-hidden":`true`})})]})}function qy({className:e,children:t,align:n=`start`,...r}){return(0,V.jsx)(Uh,{children:(0,V.jsx)(Gh,{position:`popper`,sideOffset:4,align:n,collisionPadding:8,className:B(`z-[60] max-h-[min(var(--radix-select-content-available-height),24rem)] min-w-[max(var(--radix-select-trigger-width),10rem)] max-w-[calc(100vw-16px)] animate-pop-in overflow-hidden rounded-lg border border-line bg-surface text-fg shadow-pop`,e),...r,children:(0,V.jsx)(rg,{className:`p-1`,nonce:globalThis.__webpack_nonce__,children:t})})})}function Jy({className:e,...t}){return(0,V.jsx)(cg,{className:B(`px-2 pt-2 pb-1 text-[11px] font-medium tracking-wide text-faint uppercase`,e),...t})}function Yy({className:e,children:t,value:n,...r}){return(0,V.jsxs)(fg,{value:n,className:B(`relative flex h-11 w-full cursor-default items-center gap-2 rounded-md py-0 pr-2 pl-7 text-sm text-fg outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-2 lg:h-8 lg:text-[13px]`,e),"data-sw-option":n,...r,children:[(0,V.jsx)(`span`,{className:`absolute left-2 inline-flex w-4 items-center justify-center`,children:(0,V.jsx)(gg,{children:(0,V.jsx)(ue,{size:14,className:`text-accent`,"aria-hidden":`true`})})}),(0,V.jsx)(mg,{children:t})]})}function Xy({className:e,...t}){return(0,V.jsx)(`div`,{"aria-hidden":`true`,className:B(`sw-skeleton animate-shimmer rounded-md`,e),...t})}function Y({size:e=14}){return(0,V.jsx)(`span`,{className:`inline-block animate-spin rounded-full border-2 border-current border-t-transparent`,style:{width:e,height:e},"aria-hidden":`true`})}var Zy=Ng,Qy={segmented:`flex rounded-md border border-line bg-surface-2 p-0.5`,underline:`flex gap-4 overflow-x-auto border-b border-line [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`},$y=`text-xs font-medium whitespace-nowrap text-muted outline-none hover:text-fg disabled:opacity-50`;function eb(e,t,n){return e===`underline`?B($y,`relative inline-flex shrink-0 items-center justify-center rounded-sm px-0.5 transition-colors duration-(--motion-fast) ease-standard focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent`,`after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:rounded-full after:bg-transparent after:content-['']`,n===`on`?`data-[state=on]:text-fg data-[state=on]:after:bg-accent`:`data-[state=active]:text-fg data-[state=active]:after:bg-accent`,t?`h-11 min-w-11`:`h-11 lg:h-8`):B($y,`flex-1 rounded px-2.5 focus-visible:outline-2 focus-visible:outline-accent`,n===`on`?`data-[state=on]:bg-surface data-[state=on]:text-fg data-[state=on]:shadow-card`:`data-[state=active]:bg-surface data-[state=active]:text-fg data-[state=active]:shadow-card`,t?`h-11 min-w-11`:`h-7`)}var tb=(0,O.createContext)(`segmented`);function nb({className:e,variant:t=`segmented`,...n}){return(0,V.jsx)(tb.Provider,{value:t,children:(0,V.jsx)(Fg,{className:B(Qy[t],e),"data-sw-tabs-variant":t,...n})})}function rb({className:e,large:t=!1,...n}){let r=(0,O.useContext)(tb);return(0,V.jsx)(Lg,{className:B(eb(r,t,`active`),e),...n})}function ib({className:e,...t}){return(0,V.jsx)(zg,{className:B(`outline-none`,e),...t})}var ab=_a(`block w-full min-w-0 resize-y rounded-md border border-line bg-surface text-fg outline-none placeholder:text-faint focus:border-accent disabled:opacity-50`,{variants:{size:{sm:`px-2 py-1.5 text-[13px]`,md:`px-3 py-2 text-[13px]`,touch:`min-h-11 px-2.5 py-2 text-base`}},defaultVariants:{size:`sm`}});function ob({size:e,className:t,...n}){return(0,V.jsx)(`textarea`,{className:B(ab({size:e}),t),...n})}var sb=_a(`inline-flex shrink-0 items-center justify-center gap-1.5 font-medium whitespace-nowrap transition-colors outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{outline:`rounded-md border border-line text-muted hover:text-fg data-[state=on]:border-accent data-[state=on]:bg-accent/10 data-[state=on]:text-fg`,flat:`relative rounded-md text-muted hover:bg-fg/[0.05] hover:text-fg focus-visible:z-10 focus-visible:outline-offset-0 aria-pressed:bg-surface-2 aria-pressed:text-fg aria-pressed:shadow-card aria-pressed:ring-1 aria-pressed:ring-line-strong/70 aria-pressed:ring-inset`,segment:`relative rounded text-muted hover:text-fg focus-visible:z-10 focus-visible:outline-offset-0 aria-pressed:bg-surface aria-pressed:text-fg aria-pressed:shadow-card`,pill:`max-w-full rounded-full border border-line text-muted hover:text-fg data-[state=on]:border-warn data-[state=on]:bg-warn/15 data-[state=on]:text-fg`},size:{xs:`h-7 px-2.5 text-xs`,sm:`h-8 px-2.5 text-xs`,touch:`h-11 px-3 text-xs`}},defaultVariants:{variant:`outline`,size:`sm`}});function cb({variant:e,size:t,className:n,...r}){return(0,V.jsx)(Gg,{className:B(sb({variant:e,size:t}),n),...r})}function lb({label:e,options:t,value:n,onChange:r,large:i=!1,disabled:a=!1,variant:o=`segmented`,className:s,itemClassName:c}){return(0,V.jsx)($g,{type:`single`,value:n,disabled:a,onValueChange:e=>e?r(e):null,"aria-label":e,className:B(Qy[o],s),"data-sw-tabs-variant":o,children:t.map(e=>(0,V.jsx)(J_,{content:e.tooltip,side:`bottom`,children:(0,V.jsxs)(c_,{value:e.id,className:B(eb(o,i,`on`),c),"data-sw-option":e.id,children:[e.label,e.count===void 0?null:(0,V.jsx)(`span`,{className:`tabular ml-1 text-faint`,children:e.count})]})},e.id))})}var ub=[`viewer`,`member`,`admin`,`owner`],db=(e,t)=>ub.indexOf(e)>=ub.indexOf(t)&&ub.includes(e),fb={workspace:`viewer`,members:`viewer`,leave:`viewer`,rename:`admin`,settings:`admin`,invites:`admin`,changeRole:`admin`,projects:`admin`,tokens:`admin`,shares:`admin`,access:`admin`,audit:`admin`,export:`admin`,deleteWorkspace:`owner`},pb=(e,t)=>db(e,fb[t]),mb=e=>db(e,fb.tokens),hb=(e,t)=>mb(e)&&db(e,t?.approvalChangeRole||`admin`),gb=e=>e===`owner`;function _b(e,t,n=null){return e===`owner`?!0:e!==`admin`||[`owner`,`admin`].includes(t)?!1:n===null||n!==`owner`}function vb(e,t){return ub.filter(n=>_b(e,t,n)&&db(e,`admin`))}var yb=(e,t,{self:n=!1}={})=>n||_b(e,t),bb=(e,t)=>pb(e,`invites`)&&ub.includes(t)&&(t!==`owner`||e===`owner`),xb=e=>ub.filter(t=>bb(e,t));function Sb(e){if(!e)return``;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`}):``}function Cb(e){if(!e)return``;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):``}var wb={viewer:`Viewer`,member:`Member`,admin:`Admin`,owner:`Owner`,guest:`Guest`},Tb={viewer:`Sees projects, boards and comments.`,member:`Comments, replies and resolves.`,admin:`Manages projects, tokens, invites, share links and members.`,owner:`Everything, including admins, owners and deleting the workspace.`},Eb=[[`See projects, boards and comments`,`viewer`],[`Comment, reply, resolve and reopen`,`member`],[`Edit and delete their own comments`,`member`],[`Create and delete projects`,`admin`],[`Create and revoke API tokens`,`admin`],[`Invite people (up to admin) and revoke invites`,`admin`],[`Create and revoke share links`,`admin`],[`Change and remove members and viewers`,`admin`],[`Delete any comment`,`admin`],[`Read the audit log`,`admin`],[`Change or remove admins and owners`,`owner`],[`Invite owners`,`owner`],[`Delete the workspace`,`owner`]],Db={own:`Owner`,manage:`Manage`,comment:`Comment`,view:`View`},Ob=[[`read`,`Read`,`Pages, comments, screenshots and live HTML. Without Take agent work: every comment, whoever it was sent to`],[`reply`,`Reply`,`Post agent replies`],[`status`,`Set agent status`,`Mark a comment as in progress, done or needing a person`],[`claim`,`Take agent work`,`Pick up the comments sent to an agent`],[`resolve`,`Resolve`,`Resolve and reopen`],[`push`,`Push`,`Upload captures`]],kb=e=>`${e} ${e===1?`day`:`days`}`,Ab=e=>e===1?`1 day`:e===7?`1 week`:e===14?`2 weeks`:e===30?`30 days`:kb(e),jb={owner:`only the person who connected it`,members:`named members`,trusted:`everyone the agent policy trusts`};function Mb(e){let t=e.detail||{},n=e.targetLabel||e.target||``,r=e=>wb[e]?.toLowerCase()||e,i=e=>`${/^[aeiou]/.test(r(e)||``)?`an`:`a`} ${r(e)}`,a=(e,t,n)=>`${e} ${e===1?t:n}`;switch(e.action){case`workspace_created`:return`created the workspace`;case`workspace_renamed`:return t.from&&t.to?`renamed the workspace from ${t.from} to ${t.to}`:`renamed the workspace`;case`workspace_exported`:return`exported the workspace${typeof t.projects==`number`?` (${a(t.projects,`project`,`projects`)})`:``}`;case`invite_created`:return`created an invite link for ${i(t.role)}${t.note?` (${t.note})`:``}${t.emailed?` and emailed it`:``}`;case`invite_revoked`:return`revoked an invite link`;case`invite_accepted`:return`joined as ${r(t.role)} from an invite`;case`member_role_changed`:return`changed ${n}'s role from ${r(t.from)} to ${r(t.to)}`;case`member_removed`:return`removed ${n} (${r(t.role)})`;case`member_left`:return t.accountDeleted?`deleted their account and left the workspace`:`left the workspace`;case`member_grants_revoked`:{let e=[t.invites?a(t.invites,`pending invite`,`pending invites`):null,t.shares?a(t.shares,`share link`,`share links`):null,t.tokens?a(t.tokens,`API token`,`API tokens`):null].filter(Boolean),r=e.length>1?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:e[0]||`access`;return`revoked ${n?`${n}'s`:`their`} ${r}`}case`project_created`:return`created the project ${n}`;case`project_deleted`:return`deleted the project ${t.name||n}`;case`board_removed`:return`removed the board ${String(n||``).split(`/`).pop()}${t.project?` from ${t.project}`:``}${t.comments?` (${a(t.comments,`comment`,`comments`)})`:``}`;case`token_created`:return`created the API token ${n}${Array.isArray(t.scopes)?` (${t.scopes.join(`, `)})`:``}${t.via===`login`?` with shapewall login`:``}`;case`token_revoked`:return`revoked the API token ${n}`;case`token_renamed`:return`renamed the API token ${t.from?`${t.from} to `:``}${t.to||n}`;case`push_committed`:return`pushed ${t.files??`some`} files`;case`comment_resolved`:return`resolved comment ${String(e.target||``).replace(/^.*#/,`#`)}`;case`comment_deleted`:return`deleted comment ${String(e.target||``).replace(/^.*#/,`#`)}`;case`share_links_enabled`:return`turned share links on`;case`share_links_disabled`:return`turned share links off`;case`share_created`:return`created the ${t.mode===`comment`?`comment`:`view`} share link ${n}${t.passcode?` with a passcode`:``}`;case`share_revoked`:return`revoked the share link ${n}`;case`share_opened`:return`opened the share link ${n}${t.count>1?` (${t.count} times within the hour)`:``}`;case`share_passcode_failed`:return`tried a wrong passcode on ${n}${t.count>1?` (${t.count} times within the hour)`:``}`;case`guest_commented`:return`commented as a guest (${String(e.target||``).replace(/^.*#/,`#`)})`;case`agent_command_approved`:return`let an agent run a command (comment ${String(e.target||``).replace(/^.*#/,`#`)})`;case`agent_command_denied`:return`stopped an agent from running a command (comment ${String(e.target||``).replace(/^.*#/,`#`)})`;case`guest_replied`:return`replied as a guest (${String(e.target||``).replace(/^.*#/,`#`)})`;case`comment_vouched`:return`${t.approve?`approved the agent run for`:`sent`} comment ${String(e.target||``).replace(/^.*#/,`#`)}${t.approve?``:` to an agent`}`;case`agent_created`:return`connected the agent ${t.name||n}${t.machine?` (${t.machine})`:``}, for themselves only`;case`agent_first_seen`:return`was first seen as the agent ${t.name||n}`;case`agent_renamed`:return`renamed the agent ${t.from?`${t.from} to `:``}${t.to||n}`;case`agent_identity_changed`:return`changed how the agent ${t.name||n} looks`;case`agent_default_changed`:return t.after?`made ${t.afterName||`an agent`} the default agent of ${n}`:`cleared the default agent of ${n}${t.beforeName?` (it was ${t.beforeName})`:``}`;case`agent_audience_changed`:return`changed who may send work to ${t.name||n}: from ${jb[t.before?.audience]||`unknown`} to ${jb[t.after?.audience]||`unknown`}`;case`agent_approval_rule_changed`:return`changed the approval settings of ${t.name||n}`;case`agent_revoked`:return`revoked the agent ${t.name||n}${(t.released||0)+(t.held||0)?` (${a((t.released||0)+(t.held||0),`comment`,`comments`)} went to any agent)`:``}`;case`agent_queue_released`:return t.reason?`comment ${String(e.target||``).replace(/^.*#/,`#`)} went to any agent: ${t.fromName||`its agent`} ${{revoked:`was revoked`,expired:`expired`,inactive:`stopped working (its maker is no longer an admin)`}[t.reason]||`is gone`}${t.was===`working`?` while working on it`:``}`:`let any agent take comment ${String(e.target||``).replace(/^.*#/,`#`)}${t.fromName?` (it was waiting for ${t.fromName})`:``}`;default:return e.action.replace(/_/g,` `)}}var Nb=[[`any`,`Any time`,null],[`1d`,`Last 24 hours`,1],[`7d`,`Last 7 days`,7],[`30d`,`Last 30 days`,30],[`90d`,`Last 90 days`,90]];async function Pb(e,t,n){let r;try{r=await fetch(t,{method:e,credentials:`same-origin`,headers:{...n===void 0?{Accept:`application/json`}:{Accept:`application/json`,"Content-Type":`application/json`},...typeof document<`u`&&document.querySelector(`meta[name="shapewall-local-accounts"]`)&&t.startsWith(`/auth/`)?Wv():{}},body:n===void 0?void 0:JSON.stringify(n),cache:`no-store`})}catch{throw new qv(0,`offline`,`Could not reach the server. Check your connection and try again.`)}let i=null;try{i=await r.json()}catch{i=null}if(!r.ok){let e=Number(r.headers.get(`Retry-After`)),t=i?.error?.message||`Request failed (${r.status})`;throw new qv(r.status,i?.error?.code||`error`,r.status===429&&e>0?Ib(t,e):t,{retryAfter:r.status===429&&e>0?e:null})}return i}function Fb(e){return e>=5400?`${Math.ceil(e/3600)} hours`:e>=90?`${Math.ceil(e/60)} minutes`:e>60?`2 minutes`:e===1?`1 second`:`${e} seconds`}var Ib=(e,t)=>`${e.replace(/\s*Wait (a while|a moment) and try again\.?\s*$/i,``)} Try again in ${Fb(t)}.`,X={get:e=>Pb(`GET`,e),post:(e,t={})=>Pb(`POST`,e,t),patch:(e,t={})=>Pb(`PATCH`,e,t),put:(e,t={})=>Pb(`PUT`,e,t),delete:(e,t)=>Pb(`DELETE`,e,t)};async function Lb(e,t,n,r){let i;try{i=await fetch(t,{method:e,credentials:`same-origin`,headers:n===void 0?{}:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n),cache:`no-store`})}catch{throw new qv(0,`offline`,`Could not reach the server. Check your connection and try again.`)}if(!i.ok){let e=null;try{e=await i.json()}catch{e=null}throw new qv(i.status,e?.error?.code||`error`,e?.error?.message||`Request failed (${i.status})`)}let a=/filename="([^"]+)"/.exec(i.headers.get(`Content-Disposition`)||``)?.[1]||r,o=await i.blob();return Rb(o,a),{name:a,bytes:o.size}}function Rb(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e4)}var zb=(e,t=``)=>`/api/workspaces/${encodeURIComponent(e)}${t}`,Bb=()=>window.location.origin,Vb=e=>{let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t+`===`.slice((t.length+3)%4));return Uint8Array.from(n,e=>e.charCodeAt(0)).buffer},Hb=e=>btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);function Ub(){return typeof window.PublicKeyCredential==`function`&&window.isSecureContext}async function Wb(e){let t={...e,challenge:Vb(e.challenge),user:{...e.user,id:Vb(e.user.id)},excludeCredentials:(e.excludeCredentials||[]).map(e=>({...e,id:Vb(e.id)}))},n=await navigator.credentials.create({publicKey:t}),r=n.response;return{id:n.id,rawId:Hb(n.rawId),type:n.type,authenticatorAttachment:n.authenticatorAttachment||void 0,clientExtensionResults:n.getClientExtensionResults(),response:{clientDataJSON:Hb(r.clientDataJSON),attestationObject:Hb(r.attestationObject),transports:typeof r.getTransports==`function`?r.getTransports():[]}}}async function Gb(){try{return Ub()&&typeof PublicKeyCredential.isConditionalMediationAvailable==`function`?await PublicKeyCredential.isConditionalMediationAvailable():!1}catch{return!1}}async function Kb(e,{mediation:t,signal:n}={}){let r={...e,challenge:Vb(e.challenge),allowCredentials:(e.allowCredentials||[]).map(e=>({...e,id:Vb(e.id)}))},i=await navigator.credentials.get({publicKey:r,...t?{mediation:t}:{},...n?{signal:n}:{}}),a=i.response;return{id:i.id,rawId:Hb(i.rawId),type:i.type,authenticatorAttachment:i.authenticatorAttachment||void 0,clientExtensionResults:i.getClientExtensionResults(),response:{clientDataJSON:Hb(a.clientDataJSON),authenticatorData:Hb(a.authenticatorData),signature:Hb(a.signature),userHandle:a.userHandle?Hb(a.userHandle):void 0}}}function qb(e){return e?.name===`NotAllowedError`?`The passkey prompt was closed or timed out. Try again.`:e?.name===`InvalidStateError`?`This device already has a passkey for this account.`:e?.name===`SecurityError`?`Passkeys need a secure (https) page on this site.`:e?.name===`AbortError`?`The passkey prompt was cancelled. Try again.`:e?.message||`Something went wrong.`}var Jb=new Set,Yb=()=>Jb.forEach(e=>e());typeof window<`u`&&window.addEventListener(`popstate`,Yb);var Xb=e=>(Jb.add(e),()=>Jb.delete(e)),Zb=()=>window.location.pathname,Qb=()=>window.location.hash;function $b(){return(0,O.useSyncExternalStore)(Xb,Zb,()=>`/`)}var ex=e=>!/^\/(w\/[^/]+\/p|s)\//.test(e)&&!e.startsWith(`/_console/`);function tx(e,{replace:t=!1}={}){let n=new URL(e,window.location.origin);if(n.origin!==window.location.origin||!ex(n.pathname)){window.location.assign(n.href);return}let r=n.pathname+n.search+n.hash;t?window.history.replaceState(null,``,r):r!==window.location.pathname+window.location.search+window.location.hash&&window.history.pushState(null,``,r),window.scrollTo(0,0),Yb()}function nx(e){window.location.assign(e)}function rx(e){let t=!1,n=()=>{t||(t=!0,window.removeEventListener(`popstate`,n),window.setTimeout(()=>tx(e),0))};window.addEventListener(`popstate`,n),window.setTimeout(n,400)}function ix({to:e,onClick:t,children:n,...r}){let i=(0,O.useCallback)(n=>{t?.(n),n.defaultPrevented||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||ex(new URL(e,window.location.origin).pathname)&&(n.preventDefault(),tx(e))},[t,e]);return(0,V.jsx)(`a`,{href:e,onClick:i,...r,children:n})}var ax=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${t}=${encodeURIComponent(n)}`;function ox(e){return typeof e==`string`&&/^\/(?!\/)[\w\-./?=&%]*$/.test(e)?e:`/`}var sx=`shapewall:add-passkey`,cx=(0,O.createContext)(null);function lx({children:e}){let[t,n]=(0,O.useState)({me:null,anon:null,loading:!0,error:null}),r=(0,O.useCallback)(async()=>{try{let e=await X.get(`/auth/me`);return n({me:e.user?e:null,anon:e.user?null:e,loading:!1,error:null}),e.user?e:null}catch(e){return n(t=>({...t,loading:!1,error:e})),null}},[]);(0,O.useEffect)(()=>{r()},[r]);let i=(0,O.useMemo)(()=>({...t,refresh:r}),[t,r]);return(0,V.jsx)(cx.Provider,{value:i,children:e})}var ux=()=>(0,O.useContext)(cx),dx=(0,O.createContext)(()=>{});function fx({children:e}){let[t,n]=(0,O.useState)([]),r=(0,O.useRef)(0),i=(0,O.useCallback)((e,t=`ok`)=>{let i=++r.current;n(n=>[...n.slice(-2),{id:i,message:e,tone:t}]),window.setTimeout(()=>n(e=>e.filter(e=>e.id!==i)),4500)},[]);return(0,V.jsxs)(dx.Provider,{value:i,children:[e,(0,V.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-4 z-[80] flex flex-col items-center gap-2 px-4`,role:`status`,"aria-live":`polite`,"data-sw-toasts":!0,children:t.map(e=>(0,V.jsx)(`div`,{className:e.tone===`bad`?`pointer-events-auto max-w-md animate-pop-in rounded-lg border border-bad/40 bg-surface px-4 py-2.5 text-sm text-bad shadow-pop`:`pointer-events-auto max-w-md animate-pop-in rounded-lg border border-line bg-fg px-4 py-2.5 text-sm text-surface shadow-pop`,"data-sw-toast":e.tone,children:e.message},e.id))})]})}var px=()=>(0,O.useContext)(dx),mx=(0,O.createContext)(null);function hx({children:e}){let{me:t,refresh:n}=ux(),r=!!t?.viaRecovery,[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(null),f=(0,O.useCallback)(e=>new Promise((t,n)=>{d(null),a(!1),s({resolve:t,reject:n,message:e})}),[]),p=(0,O.useCallback)(async e=>{try{return await e()}catch(t){if(!(t instanceof qv)||t.code!==`reauth_required`)throw t;return await f(t.message),e()}},[f]),m=async()=>{l(!0),d(null);try{let{options:e}=await X.post(`/auth/reauth/options`,{}),t=await Kb(e);await X.post(`/auth/reauth/verify`,{response:t}),r&&await n();let i=o;s(null),i.resolve()}catch(e){d(qb(e))}finally{l(!1)}},h=()=>{if(c)return;let e=o;s(null),e?.reject(Object.assign(Error(`Cancelled.`),{cancelled:!0}))},g=()=>{h(),rx(`/account#add-passkey`),window.setTimeout(()=>window.dispatchEvent(new Event(sx)),450)},_=r&&!i,v=t?.passkeys?.map(e=>e.onHoldUntil).filter(Boolean).sort()[0]||null;return(0,V.jsxs)(mx.Provider,{value:p,children:[e,(0,V.jsx)(Ty,{open:!!o,onClose:h,title:_?`Add a passkey first`:`Confirm it's you`,footer:_?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:h,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{size:`touch`,variant:`default`,onClick:g,"data-sw-reauth-add-passkey":!0,className:`lg:h-10`,children:[(0,V.jsx)(qe,{size:16,"aria-hidden":`true`}),`Add a passkey`]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:h,disabled:c,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{size:`touch`,variant:`default`,onClick:m,disabled:c,"data-sw-reauth":!0,className:`lg:h-10`,children:[c?(0,V.jsx)(Y,{}):(0,V.jsx)(sn,{size:16,"aria-hidden":`true`}),`Use passkey`]})]}),children:(0,V.jsxs)(`div`,{className:`space-y-2 px-5 py-4 text-sm text-muted`,children:[_?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{"data-sw-reauth-recovery":!0,children:`You signed in with a recovery code, so there is no passkey to confirm this change with. Add a passkey first: for your safety, a passkey added this way can confirm changes like this one 24 hours after it is added.`}),v?(0,V.jsxs)(`p`,{children:[`Your new passkey can confirm changes from `,Cb(v),`.`]}):null,(0,V.jsx)(`button`,{type:`button`,className:`text-[13px] font-medium text-accent underline-offset-2 hover:underline`,onClick:()=>a(!0),children:`I still have a passkey: use it`})]}):(0,V.jsx)(`p`,{children:`This is a sensitive change, so Shapewall checks your passkey first (once every 10 minutes).`}),u?(0,V.jsx)(`p`,{className:`text-bad`,role:`alert`,children:u}):null]})})]})}var gx=()=>(0,O.useContext)(mx);function _x(){let e=gx(),[t,n]=(0,O.useState)(!1),[r,i]=(0,O.useState)(null),a=(0,O.useRef)(!1);return{run:(0,O.useCallback)(async t=>{if(!a.current){a.current=!0,n(!0),i(null);try{return await(e?e(t):t())}catch(e){e?.cancelled||i(qb(e));return}finally{a.current=!1,n(!1)}}},[e]),busy:t,error:r,setError:i}}function vx(e=`/signin`){let t=px();return(0,O.useCallback)(async()=>{try{await X.post(`/auth/logout`,{})}catch(e){t(`You are still signed in: ${qb(e)}`,`bad`);return}nx(e)},[t,e])}function yx(e){let[t,n]=(0,O.useState)({data:null,error:null,loading:!!e}),r=(0,O.useRef)(0),i=(0,O.useCallback)(async()=>{if(!e)return null;let t=++r.current;try{let i=await X.get(e);return t===r.current&&n({data:i,error:null,loading:!1}),i}catch(e){return t===r.current&&n(t=>({data:t.data,error:e,loading:!1})),null}},[e]);return(0,O.useEffect)(()=>{n({data:null,error:null,loading:!!e}),i()},[i,e]),{...t,reload:i,setData:e=>n(t=>({...t,data:e}))}}function bx(e,t){let[n,r]=(0,O.useState)({items:[],next:null,loading:!0,more:!1,error:null}),i=(0,O.useRef)(0),a=(0,O.useCallback)(async()=>{let n=++i.current;r(e=>({...e,loading:!0,error:null}));try{let a=await X.get(e());n===i.current&&r({items:a[t],next:a.next,loading:!1,more:!1,error:null})}catch(e){n===i.current&&r({items:[],next:null,loading:!1,more:!1,error:e})}},[e,t]);(0,O.useEffect)(()=>(a(),()=>{i.current+=1}),[a]);let o=n.next,s=(0,O.useCallback)(async()=>{if(!o)return;let n=i.current;r(e=>({...e,more:!0,error:null}));try{let a=await X.get(e(o));if(n!==i.current)return;r(e=>({...e,items:[...e.items,...a[t]],next:a.next,more:!1}))}catch(e){n===i.current&&r(t=>({...t,error:e,more:!1}))}},[e,t,o]);return{...n,reload:a,loadMore:s}}function xx({className:e}){return(0,V.jsxs)(`svg`,{viewBox:`0 0 32 32`,className:B(`h-7 w-7 shrink-0`,e),"aria-hidden":`true`,children:[(0,V.jsx)(`rect`,{width:`32`,height:`32`,rx:`8`,fill:`#0f766e`}),(0,V.jsx)(`rect`,{x:`6`,y:`6`,width:`9`,height:`12`,rx:`2`,fill:`#ffffff`}),(0,V.jsx)(`rect`,{x:`6`,y:`20`,width:`9`,height:`6`,rx:`2`,fill:`#ffffff`,fillOpacity:`0.72`}),(0,V.jsx)(`rect`,{x:`17`,y:`6`,width:`9`,height:`6`,rx:`2`,fill:`#f59e0b`}),(0,V.jsx)(`rect`,{x:`17`,y:`14`,width:`9`,height:`12`,rx:`2`,fill:`#ffffff`})]})}function Z({className:e,children:t,...n}){return(0,V.jsx)(`section`,{className:B(`rounded-xl border border-line bg-surface shadow-card`,e),...n,children:t})}function Sx({title:e,description:t,actions:n,icon:r,className:i}){return(0,V.jsxs)(`div`,{className:B(`flex flex-wrap items-start gap-3 border-b border-line px-4 py-3.5 sm:px-5`,i),children:[r?(0,V.jsx)(`span`,{className:`mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-surface-2 text-muted`,children:(0,V.jsx)(r,{size:16,"aria-hidden":`true`})}):null,(0,V.jsxs)(`div`,{className:`min-w-0 flex-[1_1_12rem]`,children:[(0,V.jsx)(`h2`,{className:`text-title font-semibold text-fg`,children:e}),t?(0,V.jsx)(`p`,{className:`mt-0.5 text-ui text-muted`,children:t}):null]}),n?(0,V.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n}):null]})}function Cx({title:e,description:t,actions:n,badge:r}){return(0,V.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-start gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-[1_1_16rem]`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`h1`,{className:`text-heading font-semibold text-fg sm:text-display`,children:e}),r]}),t?(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t}):null]}),n?(0,V.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n}):null]})}var wx={info:[`border-line bg-surface-2 text-fg`,Ge],ok:[`border-ok/40 bg-ok/10 text-fg`,ue],warn:[`border-warn/50 bg-warn/10 text-fg`,Cn],bad:[`border-bad/40 bg-bad/10 text-fg`,_e]};function Q({tone:e=`info`,title:t,children:n,action:r,className:i,...a}){let[o,s]=wx[e];return(0,V.jsxs)(`div`,{className:B(`flex gap-3 rounded-lg border px-3.5 py-3 text-sm`,o,i),role:e===`bad`?`alert`:void 0,...a,children:[(0,V.jsx)(s,{size:16,className:B(`mt-0.5 shrink-0`,e===`bad`?`text-bad`:e===`warn`?`text-warn`:`text-muted`),"aria-hidden":`true`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[t?(0,V.jsx)(`p`,{className:`font-medium`,children:t}):null,n?(0,V.jsx)(`div`,{className:B(`text-muted`,t&&`mt-0.5`),children:n}):null]}),r?(0,V.jsx)(`div`,{className:`shrink-0 self-center`,children:r}):null]})}function Tx({error:e}){return e?(0,V.jsx)(`p`,{className:`text-sm text-bad`,role:`alert`,"data-sw-error":!0,children:e}):null}function $({label:e,hint:t,error:n,children:r,className:i}){let a=(0,O.useId)(),o=[t?`${a}-hint`:null,n?`${a}-error`:null].filter(Boolean).join(` `),s=typeof r==`function`?r({id:a,"aria-describedby":o||void 0,...n?{"aria-invalid":!0}:{}}):r;return(0,V.jsxs)(`div`,{className:B(`space-y-1.5`,i),children:[(0,V.jsx)(`label`,{htmlFor:a,className:`block text-ui font-medium text-fg`,children:e}),s,t?(0,V.jsx)(`p`,{id:`${a}-hint`,className:`text-xs text-muted`,children:t}):null,n?(0,V.jsx)(`p`,{id:`${a}-error`,className:`text-xs text-bad`,role:`alert`,children:n}):null]})}var Ex={owner:`solid`,admin:`accent`,member:`neutral`,viewer:`neutral`,guest:`warn`};function Dx({role:e}){return(0,V.jsx)(H,{tone:Ex[e]||`neutral`,className:`px-2 py-0.5 text-caption`,"data-sw-role-badge":e,children:wb[e]||e})}function Ox({value:e,empty:t=`Never`,prefix:n=``}){return e?(0,V.jsx)(J_,{content:Cb(e),children:(0,V.jsxs)(`time`,{dateTime:e,children:[n,Si(e)]})}):(0,V.jsx)(`span`,{className:`text-faint`,children:t})}function kx({value:e,label:t=`Copy`,className:n,testId:r}){let[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(!1),c=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!i)return;let e=window.setTimeout(()=>a(!1),2e3);return()=>window.clearTimeout(e)},[i]),(0,V.jsxs)(`div`,{className:n,children:[(0,V.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[(0,V.jsx)(`code`,{ref:c,className:`sw-secret min-w-0 flex-1 rounded-md border border-line bg-surface-2 px-3 py-2.5 font-mono text-[12.5px] leading-5 text-fg select-all`,"data-sw-copy-value":r,"data-sw-secret":!0,children:e}),(0,V.jsxs)(J,{size:`touch`,variant:i?`secondary`:`default`,onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!1),a(!0)}catch{if(c.current){let e=document.createRange();e.selectNodeContents(c.current);let t=window.getSelection();t.removeAllRanges(),t.addRange(e)}s(!0)}},className:`lg:h-auto`,"data-sw-copy":r,children:[i?(0,V.jsx)(ue,{size:16,"aria-hidden":`true`}):(0,V.jsx)(Te,{size:16,"aria-hidden":`true`}),i?`Copied`:t]})]}),(0,V.jsx)(Ax,{shown:o})]})}function Ax({shown:e}){return e?(0,V.jsx)(`p`,{className:`mt-1.5 text-xs text-muted`,role:`status`,"data-sw-copy-fallback":!0,children:`This browser did not allow copying. The text is selected: press Ctrl+C (or long-press) to copy it.`}):null}var jx=e=>e;function Mx({open:e,onClose:t,busy:n,result:r,title:i,resultTitle:a,renderResult:o,resultProps:s,doneProps:c,children:l}){return(0,V.jsx)(Ty,{open:e,onClose:()=>n?null:t(),title:r?a:i,size:`md`,sticky:!!r,children:r?(0,V.jsxs)(`div`,{className:`space-y-4 px-5 py-4`,...s,children:[o(r),(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsx)(J,{size:`touch`,variant:`default`,onClick:t,className:`lg:h-10`,...c,children:`Done`})})]}):l})}function Nx(e,t){let[n,r]=(0,O.useState)(null),i=(0,O.useRef)(!1),a=(0,O.useRef)(t);return(0,O.useEffect)(()=>{a.current=t}),(0,O.useEffect)(()=>{e&&!i.current&&a.current(),e||r(null),i.current=e},[e]),[n,r]}function Px({label:e=`Loading`,rows:t=3}){return(0,V.jsxs)(`div`,{className:`space-y-4 px-4 py-5 sm:px-5`,role:`status`,"data-sw-loading":!0,children:[(0,V.jsx)(`span`,{className:`sr-only`,children:e}),Array.from({length:t},(e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,"aria-hidden":`true`,children:[(0,V.jsx)(Xy,{className:`h-8 w-8 shrink-0 rounded-lg`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,V.jsx)(Xy,{className:t%2?`h-3 w-1/3`:`h-3 w-2/5`}),(0,V.jsx)(Xy,{className:t%2?`h-3 w-3/5`:`h-3 w-1/2`})]})]},t))]})}function Fx({error:e,onRetry:t}){let n=gx();return e?.code===`reauth_required`&&t&&n?(0,V.jsx)(Q,{tone:`warn`,title:`Confirm it's you`,"data-sw-load-reauth":!0,action:(0,V.jsxs)(J,{size:`touch`,variant:`default`,onClick:()=>{let r=!0;n(async()=>{if(r)throw r=!1,e;return t()}).catch(()=>null)},className:`lg:h-8`,children:[(0,V.jsx)(qe,{size:14,"aria-hidden":`true`}),` Confirm`]}),children:e.message}):(0,V.jsx)(Q,{tone:`bad`,title:`This did not load`,action:t?(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:t,className:`lg:h-8`,children:[(0,V.jsx)(Ht,{size:14,"aria-hidden":`true`}),` Retry`]}):null,children:e?.message||`Something went wrong.`})}function Ix({open:e,onClose:t,title:n,children:r,confirmLabel:i=`Confirm`,tone:a=`default`,onConfirm:o,busy:s=!1,error:c=null,confirmText:l=null,disabled:u=!1}){let[d,f]=(0,O.useState)(``);(0,O.useEffect)(()=>{e&&f(``)},[e]);let p=l!==null&&d.trim()!==l;return(0,V.jsx)(Ty,{open:e,onClose:()=>s?null:t(),title:n,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:t,disabled:s,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{size:`touch`,variant:a===`danger`?`secondary`:`default`,className:B(`lg:h-10`,a===`danger`&&`border-bad/50 bg-bad text-white hover:bg-bad/90`),onClick:o,disabled:s||p||u,"data-sw-confirm":!0,children:[s?(0,V.jsx)(Y,{}):null,i]})]}),children:(0,V.jsxs)(`div`,{className:`space-y-3 px-5 py-4 text-sm text-muted`,children:[r,l===null?null:(0,V.jsx)($,{label:`Type "${l}" to confirm`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:d,onChange:e=>f(e.target.value),autoComplete:`off`,spellCheck:!1,"data-sw-confirm-input":!0})}),(0,V.jsx)(Tx,{error:c})]})})}function Lx({checked:e,onChange:t,disabled:n,label:r,id:i}){return(0,V.jsx)(`button`,{type:`button`,id:i,role:`switch`,"aria-checked":e,"aria-label":r,disabled:n,onClick:()=>t(!e),className:`group inline-flex h-11 w-12 shrink-0 items-center outline-none disabled:opacity-50 lg:h-7`,"data-sw-switch":e?`on`:`off`,children:(0,V.jsx)(`span`,{className:B(`relative inline-flex h-7 w-12 items-center rounded-full border transition-colors group-focus-visible:outline-2 group-focus-visible:outline-offset-2 group-focus-visible:outline-accent`,e?`border-accent bg-accent`:`border-line bg-surface-2`),children:(0,V.jsx)(`span`,{className:B(`inline-block h-5 w-5 rounded-full bg-surface shadow-card transition-transform`,e?`translate-x-[22px]`:`translate-x-[3px]`)})})})}function Rx({checked:e,onChange:t,children:n,id:r}){return(0,V.jsxs)(`button`,{type:`button`,id:r,role:`checkbox`,"aria-checked":e,onClick:()=>t(!e),className:`flex min-h-11 w-full items-center gap-3 rounded-lg border border-line px-3 text-left text-sm text-fg outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent`,children:[(0,V.jsx)(`span`,{className:B(`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border`,e?`border-accent bg-accent text-accent-fg`:`border-line bg-surface`),"aria-hidden":`true`,children:e?(0,V.jsx)(ue,{size:14}):null}),n]})}var zx=`https://shapewall.com/contact`,Bx={version:`0.6.0`,revision:`272b8d851ef5dfdc6cb771785fd62a276453dc7b`},Vx=e=>`v${e?.version||Bx.version}${e?.revision?` · ${e.revision.slice(0,7)}`:``}`,Hx=`modulepreload`,Ux=function(e){return`/_console/`+e},Wx={},Gx=function(e){return e.pathname.endsWith(`.css`)},Kx=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},qx=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ux(t,n);let r=s(t),i=Gx(r);return Kx(Wx,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Hx,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Jx=(0,O.lazy)(()=>qx(()=>import(`./app-update-dialog-ttl9lF5A.js`),[])),Yx=`shapewall:open-about`;function Xx(e=null){window.dispatchEvent(new CustomEvent(Yx,{detail:{opener:e}}))}function Zx({transport:e,className:t,placement:n=`menu`,ref:r}){let[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(!1),c=(0,O.useRef)(null),l=(0,O.useRef)(null),u=e=>{l.current=e||null,s(!0),a(!0)};(0,O.useImperativeHandle)(r,()=>({open:()=>u(document.activeElement)}),[]),(0,O.useEffect)(()=>{let e=e=>u(e.detail?.opener||null);return window.addEventListener(Yx,e),()=>window.removeEventListener(Yx,e)},[]);let d=()=>a(!1),f=e=>{e.preventDefault(),[l.current,c.current,document.querySelector(`[data-sw-profile-menu]`)].find(e=>e?.isConnected&&e!==document.body)?.focus()},p=`About Shapewall and updates, ${Vx(Bx)}, created by Dan Baruch`;return(0,V.jsxs)(V.Fragment,{children:[n===`footer`?(0,V.jsx)(`footer`,{className:B(`flex shrink-0 justify-center border-t border-line bg-surface text-muted`,t),style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`},children:(0,V.jsxs)(J,{variant:`ghost`,size:`touch`,className:`gap-2 rounded-none px-3 text-[10px] font-normal lg:h-6`,onClick:()=>u(c.current),"aria-label":p,"data-sw-app-about":`footer`,ref:c,children:[(0,V.jsx)(`span`,{children:`Created by Dan Baruch`}),(0,V.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,V.jsx)(`span`,{"data-sw-app-version":!0,children:Vx(Bx)})]})}):n===`link`?(0,V.jsxs)(`span`,{className:`inline-flex items-center`,children:[(0,V.jsx)(J,{asChild:!0,variant:`ghost`,size:`touch`,className:`px-2 text-caption font-normal text-faint hover:text-fg lg:h-8`,"data-sw-app-contact":`link`,children:(0,V.jsx)(`a`,{href:zx,target:`_blank`,rel:`noopener noreferrer`,children:`Contact`})}),(0,V.jsxs)(J,{variant:`ghost`,size:`touch`,className:B(`gap-1.5 px-2 text-caption font-normal text-faint hover:text-fg lg:h-8`,t),onClick:()=>u(c.current),"aria-label":p,"data-sw-app-about":`link`,ref:c,children:[(0,V.jsx)(`span`,{children:`About Shapewall`}),(0,V.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,V.jsxs)(`span`,{className:`tabular-nums`,"data-sw-app-version":!0,children:[`v`,Bx.version]})]})]}):null,o?(0,V.jsx)(O.Suspense,{fallback:(0,V.jsx)(`span`,{role:`status`,className:`sr-only`,children:`Opening About & Updates…`}),children:(0,V.jsx)(Jx,{open:i,onClose:d,onCloseAutoFocus:f,transport:e})}):null]})}function Qx({className:e}){let[t,n]=(0,O.useState)(null);if((0,O.useEffect)(()=>{if(document.querySelector(`meta[name="shapewall-local-console"]`))return;let e=!0;return X.get(`/api/legal`).then(t=>{e&&n(t)}).catch(()=>{}),()=>{e=!1}},[]),!t)return null;let r=[[`terms`,`Terms`],[`privacy`,`Privacy`],[`acceptableUse`,`Acceptable use`],[`subprocessors`,`Subprocessors`],[`report`,`Report abuse`]].filter(([e])=>t[e]&&(/^https?:\/\//.test(t[e])||t[e]===`/report`));return(0,V.jsx)(`nav`,{"aria-label":`Legal`,className:B(`mt-6 flex flex-wrap justify-center gap-x-4 gap-y-2 text-xs text-muted`,e),children:r.map(([e,n])=>(0,V.jsx)(`a`,{href:t[e],className:`inline-flex min-h-11 items-center px-2 underline underline-offset-2`,children:n},e))})}function $x({transport:e,legal:t=!0,updatesRef:n,className:r}){return(0,V.jsxs)(`footer`,{className:B(`mx-auto flex w-full max-w-6xl flex-col items-center gap-1 px-1 pt-8 sm:flex-row sm:justify-between sm:px-4`,r),style:{paddingBottom:`max(env(safe-area-inset-bottom, 0px), 1rem)`},"data-sw-console-footer":!0,children:[t?(0,V.jsx)(Qx,{className:`mt-0 justify-start gap-x-1 text-caption text-faint`}):(0,V.jsx)(`span`,{}),(0,V.jsx)(Zx,{ref:n,transport:e,placement:`link`})]})}var eS=Object.freeze({id:null,pinned:!1,via:null,swap:!1});function tS({onChange:e,openDelay:t=150,closeDelay:n=250,setTimer:r=(e,t)=>setTimeout(e,t),clearTimer:i=e=>clearTimeout(e)}={}){let a=eS,o=null,s=()=>{o!==null&&i(o),o=null},c=(e,t)=>{s(),o=r(()=>{o=null,e()},t)},l=t=>{a=t,e?.(a)},u=()=>{s(),a.id!==null&&l(eS)};return{get state(){return a},enterIcon(e){a.pinned||(s(),a.id!==e&&(a.id===null?c(()=>l({id:e,pinned:!1,via:`hover`,swap:!1}),t):l({id:e,pinned:!1,via:`hover`,swap:!0})))},leave(){a.pinned||(a.id===null?s():c(u,n))},enterPanel(){a.pinned||s()},toggle(e,t=`click`){s(),a.id===e&&a.pinned?u():l({id:e,pinned:!0,via:t,swap:!1})},close:u,dispose:s}}function nS({anchorTop:e,viewportHeight:t,margin:n=8,minHeight:r=320}){let i=Math.max(0,t-n*2),a=t-Math.max(e,n)-n;return Math.round(Math.min(i,Math.max(a,Math.min(r,i))))}var rS=`shapewall.lastBoard`,iS=`shapewall.sidebar`,aS=`shapewall.sidebarWidth`,oS=208,sS=420,cS=16,lS=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent||``)?`⌘B`:`Ctrl B`;function uS(){try{let e=window.localStorage.getItem(rS);return e&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:null}catch{return null}}function dS(e){try{let t=window.localStorage.getItem(iS);return t===`expanded`||t!==`collapsed`&&e}catch{return e}}function fS(e){let t=Math.max(oS,Math.min(sS,Math.floor(window.innerWidth*.4)));return Math.min(t,Math.max(oS,Math.round(e)))}function pS(){try{let e=Number(window.localStorage.getItem(aS));return Number.isFinite(e)&&e>0?fS(e):256}catch{return 256}}function mS(e){try{e===256?window.localStorage.removeItem(aS):window.localStorage.setItem(aS,String(e))}catch{}}function hS(){let[e,t]=(0,O.useState)(pS),[n,r]=(0,O.useState)(!1),i=(0,O.useRef)(null);(0,O.useEffect)(()=>{let e=()=>t(e=>fS(e));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let a=e=>{let n=fS(e);t(n),mS(n)},o={onPointerDown:t=>{t.button===0&&(t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),i.current={x:t.clientX,width:e},r(!0))},onPointerMove:e=>{i.current&&t(fS(i.current.width+e.clientX-i.current.x))},onPointerUp:e=>{i.current&&(a(i.current.width+e.clientX-i.current.x),i.current=null,r(!1))},onDoubleClick:()=>a(256),onKeyDown:t=>{let n=t.shiftKey?64:cS;if(t.key===`ArrowRight`)a(e+n);else if(t.key===`ArrowLeft`)a(e-n);else if(t.key===`Home`)a(256);else return;t.preventDefault()}};return o.onPointerCancel=o.onPointerUp,{width:e,dragging:n,handle:o}}var gS=e=>!!(e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)||e.closest?.(`[contenteditable="true"]`)));function _S(e=!0,t=!0){let[n,r]=(0,O.useState)(()=>dS(t)),i=(0,O.useCallback)(()=>r(e=>{try{window.localStorage.setItem(iS,e?`collapsed`:`expanded`)}catch{}return!e}),[]);return(0,O.useEffect)(()=>{if(!e)return;let t=e=>{!(e.metaKey||e.ctrlKey)||e.altKey||e.shiftKey||e.key.toLowerCase()!==`b`||gS(e.target)||document.querySelector(`[role="dialog"]:not([data-sw-rail-flyout])`)||(e.preventDefault(),i())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,i]),[n,i,r]}function vS(e,t){return B(`relative flex items-center rounded-md outline-none transition-colors focus-visible:outline-2 focus-visible:outline-accent`,e?`h-8 w-full gap-2.5 px-2.5 text-left text-[13px] font-medium`:`h-10 w-10 justify-center rounded-lg`,t?`bg-accent/10 text-fg`:`text-muted hover:bg-surface-2 hover:text-fg`)}function yS({item:e,expanded:t,link:n,flyouts:r}){let{id:i,label:a,icon:o,href:s,to:c,onSelect:l,active:u,count:d,shortcut:f,flyout:p,...m}=e;if(!t&&p&&r)return(0,V.jsx)(CS,{item:e,flyouts:r});let h=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(o,{size:t?16:19,"aria-hidden":`true`,className:B(`shrink-0`,u&&`text-accent`)}),t?(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:a}):null,t&&d?(0,V.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-faint tabular`,children:d}):null]}),g={className:vS(t,u),"aria-label":t?void 0:a,"aria-current":u?`page`:void 0,"data-sw-rail-item":i,...m},_=c&&n?(0,V.jsx)(n,{to:c,...g,children:h}):s?(0,V.jsx)(`a`,{href:s,...g,children:h}):(0,V.jsx)(`button`,{type:`button`,onClick:l,...g,children:h});return(0,V.jsx)(`li`,{children:t?_:(0,V.jsx)(J_,{content:f?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[a,(0,V.jsx)(By,{children:f})]}):a,side:`right`,children:_})})}var bS=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,xS=e=>[...e.querySelectorAll(bS)].filter(e=>e.getClientRects().length>0);function SS(e,t){let n=xS(document).filter(e=>!t?.contains(e));(n[n.indexOf(e)+1]||e).focus()}function CS({item:e,flyouts:t}){let{id:n,label:r,icon:i,active:a,flyout:o,dot:s}=e,{state:c,intent:l,width:u,disabled:d}=t,f=Object.fromEntries(Object.entries(e).filter(([e])=>e.startsWith(`data-`))),p=(0,O.useId)(),m=(0,O.useRef)(null),h=(0,O.useRef)(null),g=c.id===n,[_,v]=(0,O.useState)(null);(0,O.useLayoutEffect)(()=>{if(!g)return;let e=()=>{let e=m.current?.getBoundingClientRect().top??0;v(nS({anchorTop:e,viewportHeight:window.innerHeight}))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[g]),(0,O.useEffect)(()=>{if(!g)return;let e=e=>{h.current?.contains(e.target)||m.current?.contains(e.target)||l.close()};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[g,l]);let y=g&&c.pinned;(0,O.useEffect)(()=>{if(!y)return;let e=requestAnimationFrame(()=>{let e=h.current;e&&!e.contains(document.activeElement)&&(xS(e)[0]||e).focus({preventScroll:!0})});return()=>cancelAnimationFrame(e)},[y]);let b=(0,O.useCallback)(()=>{let e=!!h.current?.contains(document.activeElement);l.close(),e&&m.current?.focus({preventScroll:!0})},[l]),x=e=>t=>{t.pointerType!==`touch`&&e()},S=e=>{if(e.key!==`Tab`||e.defaultPrevented)return;let t=xS(h.current);t.length&&(e.shiftKey&&document.activeElement===t[0]?(e.preventDefault(),m.current?.focus()):!e.shiftKey&&document.activeElement===t[t.length-1]&&(e.preventDefault(),l.close(),SS(m.current,h.current)))};return(0,V.jsx)(`li`,{children:(0,V.jsxs)(nh,{open:g,onOpenChange:e=>{e||l.close()},children:[(0,V.jsx)(ih,{asChild:!0,children:(0,V.jsxs)(`button`,{ref:m,type:`button`,className:vS(!1,a||g),"aria-label":r,"aria-haspopup":`dialog`,"aria-expanded":g,"aria-controls":g?p:void 0,"aria-current":a?`page`:void 0,"data-sw-rail-item":n,"data-sw-rail-flyout-trigger":n,"data-state":g?c.pinned?`pinned`:`open`:`closed`,...f,onPointerEnter:x(()=>!d&&l.enterIcon(n)),onPointerLeave:x(()=>l.leave()),onClick:e=>!d&&l.toggle(n,e.detail===0?`key`:`click`),onKeyDown:e=>{e.key!==`ArrowRight`||d||(e.preventDefault(),y||l.toggle(n,`key`))},children:[(0,V.jsx)(i,{size:19,"aria-hidden":`true`,className:B(`shrink-0`,a&&`text-accent`)}),s?(0,V.jsx)(`span`,{className:`pointer-events-none absolute top-1.5 right-1.5 h-2 w-2 rounded-full bg-accent ring-2 ring-surface`,"aria-hidden":`true`,"data-sw-rail-dot":n}):null]})}),(0,V.jsx)(ch,{children:(0,V.jsx)(uh,{ref:h,id:p,side:`right`,align:`start`,sideOffset:12,collisionPadding:8,"aria-label":r,tabIndex:-1,className:B(`sw-rail-flyout z-40 flex flex-col overflow-y-auto overscroll-contain rounded-lg border border-line bg-surface p-2 text-fg shadow-pop outline-none`,`[&_[data-sw-pages-sidebar]]:border-t-0 [&_[data-sw-pages-sidebar]]:pt-0`,c.swap&&`sw-rail-flyout-swap`),style:{width:u,maxHeight:_??void 0},"data-sw-rail-flyout":n,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{e.preventDefault();let t=c.pinned||h.current?.contains(document.activeElement);l.close(),t&&m.current?.focus({preventScroll:!0})},onInteractOutside:e=>{m.current?.contains(e.target)&&e.preventDefault()},onPointerEnter:x(()=>l.enterPanel()),onPointerLeave:x(()=>l.leave()),onKeyDown:S,children:o({close:b})})})]})})}function wS({items:e,expanded:t,link:n,label:r,flyouts:i,flush:a}){return e.length?(0,V.jsxs)(`div`,{className:B(`w-full`,!a&&`border-t border-line pt-2`),children:[t&&r?(0,V.jsx)(`p`,{className:`px-2.5 pb-1 text-xs font-semibold text-faint`,children:r}):null,(0,V.jsx)(`ul`,{className:B(`flex flex-col`,t?`gap-0.5`:`items-center gap-1`),children:e.map(e=>(0,V.jsx)(yS,{item:e,expanded:t,link:n,flyouts:i},e.id))})]}):null}function TS(e,t,n=!1){let[r,i]=(0,O.useState)(()=>({id:null,pinned:!1,via:null,swap:!1})),a=(0,O.useRef)(null);return a.current||=tS({onChange:i}),(0,O.useEffect)(()=>()=>a.current.dispose(),[]),(0,O.useEffect)(()=>{(e||n)&&a.current.close()},[e,n]),{state:r,intent:a.current,width:t,disabled:n}}function ES({expanded:e,onToggle:t,home:n,homeTo:r,homeLabel:i=`Shapewall`,title:a,logo:o,items:s=[],sections:c=[],sectionsLabel:l,link:u,profile:d,children:f,className:p,flyoutsDisabled:m=!1}){let h=r&&u?u:`a`,g=r&&u?{to:r}:{href:n},_=e?`Collapse sidebar`:`Expand sidebar`,{width:v,dragging:y,handle:b}=hS(),x=TS(e,v,m),S=e?[]:c.filter(e=>!e.flyout),C=S.length?s.find(e=>e.active):null,w=C?s.map(e=>e===C?{...e,flyout:({close:t})=>(0,V.jsx)(`div`,{onClick:e=>{e.target.closest?.(`[data-sw-rail-item]`)&&setTimeout(t,0)},children:(0,V.jsx)(wS,{items:S,expanded:!0,link:u,label:l||e.label,flush:!0})})}:e):s,T=C?c.filter(e=>e.flyout):c;return(0,V.jsxs)(`div`,{className:B(`relative flex shrink-0`,p),children:[(0,V.jsxs)(`nav`,{"aria-label":`Shapewall`,className:B(`flex flex-col gap-2 overflow-hidden border-r border-line bg-surface py-2`,e?`px-2`:`w-[52px] items-center`),style:e?{width:v}:void 0,"data-sw-app-rail":e?`expanded`:`collapsed`,children:[(0,V.jsxs)(`div`,{className:B(`flex shrink-0 items-center gap-1`,e?`h-10`:`flex-col`),children:[(0,V.jsx)(J_,{content:e?null:i,side:`right`,children:(0,V.jsx)(h,{...g,className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent`,"aria-label":i,"data-sw-rail-home":`true`,children:o})}),e?(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-fg`,"data-sw-rail-title":`true`,children:a||`Shapewall`}):null,(0,V.jsx)(J_,{content:(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[_,(0,V.jsx)(By,{children:lS})]}),side:`right`,children:(0,V.jsx)(`button`,{type:`button`,onClick:t,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted outline-none hover:bg-surface-2 hover:text-fg focus-visible:outline-2 focus-visible:outline-accent`,"aria-label":_,"aria-expanded":e,"data-sw-sidebar-toggle":`true`,children:e?(0,V.jsx)(At,{size:17,"aria-hidden":`true`}):(0,V.jsx)(Mt,{size:17,"aria-hidden":`true`})})})]}),(0,V.jsx)(wS,{items:w,expanded:e,link:u,flyouts:x}),(0,V.jsxs)(`div`,{className:B(`flex min-h-0 flex-1 flex-col gap-2`,e?`overflow-y-auto in-[.sw-scrollbars]:mr-[calc(-1*var(--scrollbar-size))]`:`w-full`),children:[(0,V.jsx)(wS,{items:T,expanded:e,link:u,label:l,flyouts:x}),e?f:null]}),d?(0,V.jsx)(`div`,{className:B(`w-full shrink-0 border-t border-line pt-2`,!e&&`flex justify-center`),children:d(e)}):null]}),e?(0,V.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,"aria-valuenow":v,"aria-valuemin":oS,"aria-valuemax":sS,tabIndex:0,"aria-description":`Drag or use the arrow keys to resize. Double-click or press Home to reset.`,className:`group absolute inset-y-0 -right-1.5 z-20 w-3 cursor-col-resize touch-none outline-none`,"data-sw-sidebar-handle":`true`,...b,children:(0,V.jsx)(`span`,{"aria-hidden":`true`,className:B(`absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 bg-accent opacity-0 transition-opacity group-hover:opacity-60 group-focus-visible:opacity-100`,y&&`opacity-100`)})}):null,y?(0,V.jsx)(`div`,{className:`fixed inset-0 z-50 cursor-col-resize`,"aria-hidden":`true`}):null]})}var DS=`shapewall.appearance`,OS=[{id:`light`,label:`Light`},{id:`dark`,label:`Dark`},{id:`system`,label:`System`}],kS=[{id:`default`,label:`Default`},{id:`ocean`,label:`Ocean`},{id:`forest`,label:`Forest`},{id:`contrast`,label:`High contrast`}],AS={mode:`system`,theme:`default`};function jS(e){return{mode:OS.some(t=>t.id===e?.mode)?e.mode:AS.mode,theme:kS.some(t=>t.id===e?.theme)?e.theme:AS.theme}}var MS=(e,t)=>e===`system`?t?`dark`:`light`:e,NS=typeof window<`u`,PS=()=>NS&&window.matchMedia?window.matchMedia(`(prefers-color-scheme: dark)`):null;function FS(){try{return jS(JSON.parse(window.localStorage.getItem(`shapewall.appearance`)||`null`))}catch{return{...AS}}}var IS=NS?FS():{...AS},LS=new Set;function RS(){let e=getComputedStyle(document.documentElement).getPropertyValue(`--surface`).trim();if(e)for(let t of document.querySelectorAll(`meta[name="theme-color"]`))t.removeAttribute(`media`),t.setAttribute(`content`,e)}function zS(e=IS){if(!NS)return;let t=document.documentElement;t.setAttribute(`data-mode`,MS(e.mode,!!PS()?.matches)),t.setAttribute(`data-theme`,e.theme),RS()}function BS(){return IS}function VS(e){IS=jS({...IS,...e});try{window.localStorage.setItem(DS,JSON.stringify(IS))}catch{}zS(),LS.forEach(e=>e())}NS&&(zS(),PS()?.addEventListener?.(`change`,()=>{IS.mode===`system`&&(zS(),LS.forEach(e=>e()))}),window.addEventListener(`storage`,e=>{e.key===`shapewall.appearance`&&(IS=FS(),zS(),LS.forEach(e=>e()))}));var HS=e=>(LS.add(e),()=>LS.delete(e));function US(){return[(0,O.useSyncExternalStore)(HS,BS,BS),VS]}var WS=e=>e.preventDefault(),GS={light:pn,dark:Et,system:wt},KS=`h-11 justify-center gap-1.5 rounded-md border border-transparent px-1 text-xs lg:h-9 data-[state=checked]:border-accent data-[state=checked]:bg-accent/10 data-[state=checked]:text-fg`;function qS({name:e,avatarUrl:t=null,detail:n=null,items:r=[],workspaces:i=null,viewAs:a=null,showName:o=!1,label:s=`Profile and appearance`,about:c=!0,triggerClassName:l,side:u=`bottom`,align:d=`end`,...f}){let[p,m]=US(),h=(0,O.useRef)(null);return(0,V.jsxs)(Dy,{children:[(0,V.jsx)(Oy,{asChild:!0,children:(0,V.jsxs)(J,{ref:h,variant:`ghost`,size:`touch`,className:B(`shrink-0 gap-2 px-1.5 lg:h-10`,l),"aria-label":e?`${s}: ${e}`:s,"data-sw-profile-menu":!0,...f,children:[(0,V.jsx)(fa,{name:e||`?`,src:t,className:`h-8 w-8`}),o&&e?(0,V.jsx)(`span`,{className:`hidden max-w-40 truncate text-sm text-fg md:inline`,children:e}):null]})}),(0,V.jsxs)(Ay,{className:`w-72`,side:u,align:d,"data-sw-profile-content":!0,children:[e||n?(0,V.jsxs)(Ny,{className:`normal-case`,children:[e?(0,V.jsx)(`span`,{className:`block truncate text-[13px] font-medium tracking-normal text-fg`,children:e}):null,n?(0,V.jsx)(`span`,{className:`block truncate text-xs font-normal tracking-normal text-muted`,children:n}):null]}):null,r.length?(0,V.jsxs)(V.Fragment,{children:[e||n?(0,V.jsx)(Py,{}):null,(0,V.jsx)(ky,{children:r.map(({id:e,label:t,icon:n,onSelect:r,tone:i,hint:a,...o})=>(0,V.jsxs)(O.Fragment,{children:[(0,V.jsxs)(My,{onSelect:r,tone:i,"data-sw-profile-item":e,"aria-describedby":a?`sw-profile-hint-`+e:void 0,...o,children:[n?(0,V.jsx)(n,{size:14,"aria-hidden":`true`}):null,` `,t]}),a?(0,V.jsx)(`p`,{id:`sw-profile-hint-`+e,className:`px-2 pb-1.5 text-xs text-muted`,"data-sw-profile-hint":e,children:a}):null]},e))})]}):null,i?.list?.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Py,{}),(0,V.jsx)(Ny,{children:`Workspace`}),i.list.map(e=>(0,V.jsxs)(My,{onSelect:()=>i.onPick(e.id),"data-sw-profile-workspace":e.id,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.roleLabel?(0,V.jsx)(`span`,{className:`text-xs text-faint`,children:e.roleLabel}):null,e.id===i.current?(0,V.jsx)(ue,{size:14,className:`!text-accent`,"aria-label":`Current`}):null]},e.id))]}):null,a?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Py,{}),(0,V.jsx)(Ny,{children:`View as (demo)`}),(0,V.jsx)(Fy,{value:a.value,onValueChange:a.onChange,children:a.options.map(e=>(0,V.jsxs)(Iy,{value:e.id,"data-sw-view-as":e.id,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.hint?(0,V.jsx)(`span`,{className:`truncate text-xs text-faint`,children:e.hint}):null]},e.id))})]}):null,(0,V.jsx)(Py,{}),(0,V.jsx)(Ny,{children:`Appearance`}),(0,V.jsx)(Fy,{value:p.mode,onValueChange:e=>m({mode:e}),className:`grid grid-cols-3 gap-1 px-1 pb-1`,"aria-label":`Mode`,children:OS.map(e=>{let t=GS[e.id];return(0,V.jsxs)(Iy,{value:e.id,indicator:!1,className:KS,onSelect:WS,"data-sw-appearance-mode":e.id,children:[(0,V.jsx)(t,{size:14,"aria-hidden":`true`}),` `,e.label]},e.id)})}),(0,V.jsx)(Fy,{value:p.theme,onValueChange:e=>m({theme:e}),className:`grid grid-cols-2 gap-1 px-1 pb-1`,"aria-label":`Theme`,children:kS.map(e=>(0,V.jsxs)(Iy,{value:e.id,indicator:!1,className:B(KS,`justify-start px-2`),onSelect:WS,"data-sw-theme-option":e.id,children:[(0,V.jsx)(`span`,{className:B(`h-4 w-4 shrink-0 rounded-full ring-1 ring-line`,`sw-swatch-${e.id}`),"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`truncate`,children:e.label})]},e.id))}),c?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Py,{}),(0,V.jsxs)(My,{onSelect:()=>Xx(h.current),"data-sw-app-about":`menu`,children:[(0,V.jsx)(Ge,{size:14,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`About Shapewall and updates`}),(0,V.jsxs)(`span`,{className:`text-caption text-faint tabular-nums`,"data-sw-app-version":!0,children:[`v`,Bx.version]})]}),(0,V.jsx)(My,{asChild:!0,"data-sw-app-contact":`menu`,children:(0,V.jsxs)(`a`,{href:zx,target:`_blank`,rel:`noopener noreferrer`,children:[(0,V.jsx)(mt,{size:14,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Contact`})]})})]}):null]})]})}function JS({demo:e,className:t,children:n,align:r=`start`}){return e.viewAs?(0,V.jsxs)(Dy,{children:[(0,V.jsx)(Oy,{asChild:!0,children:n}),(0,V.jsxs)(Ay,{align:r,className:B(`w-64`,t),children:[(0,V.jsx)(Ny,{children:`View as (demo)`}),(0,V.jsx)(Fy,{value:e.viewAs.value,onValueChange:e.viewAs.onChange,children:e.viewAs.options.map(e=>(0,V.jsxs)(Iy,{value:e.id,"data-sw-view-as":e.id,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.hint?(0,V.jsx)(`span`,{className:`truncate text-xs text-faint`,children:e.hint}):null]},e.id))})]})]}):n}var YS=()=>(0,V.jsxs)(`span`,{className:`inline-flex h-5 shrink-0 items-center gap-1.5 rounded-full bg-accent/12 px-2 text-caption font-semibold text-accent`,children:[(0,V.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-accent`,"aria-hidden":`true`}),`Demo`]});function XS({variant:e=`strip`,className:t}){let n=Fv();return n?e===`chip`?(0,V.jsxs)(`div`,{className:B(`flex shrink-0 items-center gap-0.5 rounded-full border border-line bg-surface-2/60 p-0.5`,t),role:`region`,"aria-label":`Demo`,"data-sw-demo-banner":n.role,children:[(0,V.jsx)(JS,{demo:n,align:`end`,children:(0,V.jsxs)(J,{variant:`ghost`,size:`touch`,className:`h-11 gap-1.5 rounded-full px-2 text-ui text-fg lg:h-8`,"aria-label":`Demo, viewing as `+n.roleLabel+`. Change who you view as`,"data-sw-demo-view-as":!0,children:[(0,V.jsx)(YS,{}),(0,V.jsx)(`span`,{className:`hidden max-w-28 truncate font-medium sm:inline`,children:n.roleLabel}),(0,V.jsx)(fe,{size:13,className:`text-faint`,"aria-hidden":`true`})]})}),(0,V.jsx)(X_,{label:`Reset the demo`,size:`icon`,className:`rounded-full text-muted max-lg:hidden lg:h-8 lg:w-8`,onClick:n.reset,"data-sw-demo-reset":!0,children:(0,V.jsx)(Kt,{size:14,"aria-hidden":`true`})}),(0,V.jsx)(ZS,{})]}):(0,V.jsxs)(`div`,{className:B(`flex shrink-0 items-center gap-2 border-b border-line bg-surface px-2 text-ui text-muted sm:px-3 lg:h-9`,t),role:`region`,"aria-label":`Demo`,"data-sw-demo-banner":n.role,children:[(0,V.jsx)(YS,{}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`hidden shrink-0 sm:inline`,children:`Viewing as`}),(0,V.jsx)(JS,{demo:n,children:(0,V.jsxs)(J,{variant:`ghost`,size:`touch`,className:`min-w-0 gap-1 px-1.5 text-ui text-fg lg:h-7`,"aria-label":`Viewing as `+n.roleLabel+`. Change who you view as`,"data-sw-demo-view-as":!0,children:[(0,V.jsx)(`span`,{className:`truncate font-semibold`,children:n.roleLabel}),(0,V.jsxs)(`span`,{className:`hidden truncate font-normal text-muted sm:inline`,children:[`(`,n.personaName,`)`]}),(0,V.jsx)(fe,{size:13,className:`shrink-0 text-faint`,"aria-hidden":`true`})]})}),(0,V.jsx)(`span`,{className:`hidden truncate text-faint md:inline`,children:`· Changes stay in this browser`})]}),(0,V.jsxs)(J,{variant:`ghost`,size:`touch`,className:`shrink-0 gap-1.5 px-2 text-ui text-muted lg:h-7`,onClick:n.reset,"data-sw-demo-reset":!0,children:[(0,V.jsx)(Kt,{size:13,"aria-hidden":`true`}),` Reset`]}),(0,V.jsx)(ZS,{})]}):null}function ZS(){let e=Fv();return e?(0,V.jsx)(Ty,{open:!!e.resetAsked,onClose:e.cancelReset,title:`Reset the demo?`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:e.cancelReset,className:`lg:h-10`,"data-sw-demo-reset-cancel":!0,children:`Cancel`}),(0,V.jsxs)(J,{size:`touch`,className:`border-bad/50 bg-bad text-bad-fg hover:bg-bad/90 lg:h-10`,onClick:e.resetNow,"data-sw-demo-reset-confirm":!0,children:[(0,V.jsx)(Kt,{size:14,"aria-hidden":`true`}),` Reset`]})]}),children:(0,V.jsx)(`p`,{className:`px-5 py-4 text-sm text-muted`,children:`Your comments, invites and changes in this browser go back to the start.`})}):null}function QS({notice:e,onSeen:t}){let{run:n,busy:r,error:i}=_x(),a=px();return(0,O.useEffect)(()=>{i&&a(i,`bad`)},[i,a]),(0,V.jsx)(`div`,{className:`mx-auto max-w-6xl px-3 pt-4 sm:px-6`,"data-sw-security-notice":!0,children:(0,V.jsxs)(Q,{tone:`warn`,title:`Someone signed in to your account with a recovery code`,action:(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(J,{size:`touch`,variant:`secondary`,onClick:()=>tx(`/account#activity`),className:`lg:h-8`,children:`Review activity`}),(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:()=>n(async()=>{await X.post(`/auth/security-notice/seen`,{}),await t()}),disabled:r,className:`lg:h-8`,"data-sw-security-notice-dismiss":!0,children:`That was me`})]}),children:[Cb(e.at),e.ip?` from ${e.ip}`:``,`. If that was not you, make new recovery codes and check your passkeys and devices.`]})})}var $S=(0,O.createContext)(()=>{});function eC({label:e,sections:t}){let n=(0,O.useContext)($S),r=t.map(e=>`${e.id}:${+!!e.active}`).join(`,`);return(0,O.useEffect)(()=>(n({label:e,sections:t}),()=>n(null)),[n,e,r]),null}function tC({children:e}){let{me:t,refresh:n}=ux(),r=Fv(),i=$b(),a=/^\/w\/(ws_[a-f0-9]{24})/.exec(i)?.[1]||null,o=t.workspaces.find(e=>e.id===a),s=ay(`(min-width: 1024px)`),[c,l]=_S(s),[u,d]=(0,O.useState)(null),f=uS()||(r?`index.html`:null),p=vx(),m=(e,n)=>(0,V.jsx)(qS,{name:t.user.displayName,avatarUrl:t.user.avatarUrl,detail:`@${t.user.handle}${o?` · ${wb[o.role]} in ${o.name}`:``}`,showName:n,side:e?`right`:void 0,triggerClassName:e?n?`w-full justify-start`:`w-10 min-w-10 px-0`:void 0,label:`Account menu`,"data-sw-account-menu":!0,items:[...r?r.consoleItems(a):[],{id:`account`,label:`Account and security`,icon:jn,onSelect:()=>rx(`/account`)},...r?[r.resetItem]:[],{id:`sign-out`,label:`Sign out`,icon:ut,onSelect:p,"data-sw-sign-out":!0}],workspaces:{list:t.workspaces.map(e=>({...e,roleLabel:wb[e.role]})),current:a,onPick:e=>rx(`/w/${e}`)},viewAs:r?.viewAs||null}),h=[...f?[{id:`board`,label:`Board`,icon:$e,href:f}]:[],{id:`workspace`,label:o?`Workspace: ${o.name}`:`Workspaces`,icon:oe,to:o?`/w/${o.id}`:`/`,active:i!==`/account`&&i!==`/device`},{id:`account`,label:`Account and security`,icon:jn,to:`/account`,active:i===`/account`}];return(0,V.jsx)($S.Provider,{value:d,children:(0,V.jsxs)(`div`,{className:`flex min-h-dvh`,children:[s?(0,V.jsx)(ES,{expanded:c,onToggle:l,homeTo:`/`,homeLabel:`Shapewall, your workspaces`,title:o?.name||`Shapewall`,link:ix,logo:(0,V.jsx)(xx,{}),items:h,sections:u?.sections||[],sectionsLabel:u?.label,profile:e=>m(!0,e),className:`sticky top-0 h-dvh`}):null,(0,V.jsxs)(`div`,{className:`flex min-h-dvh min-w-0 flex-1 flex-col`,children:[(0,V.jsx)(`header`,{className:`sticky top-0 z-40 border-b border-line bg-surface/95 backdrop-blur`,children:(0,V.jsxs)(`div`,{className:`mx-auto flex h-14 max-w-6xl items-center gap-2 px-3 sm:px-6`,children:[s?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(ix,{to:`/`,className:`flex shrink-0 items-center gap-2 rounded-md px-1 py-1 outline-none focus-visible:outline-2 focus-visible:outline-accent`,"aria-label":`Shapewall, your workspaces`,children:[(0,V.jsx)(xx,{}),(0,V.jsx)(`span`,{className:`hidden text-[15px] font-semibold text-fg sm:inline`,children:`Shapewall`})]}),(0,V.jsx)(`span`,{className:`hidden text-line sm:inline`,"aria-hidden":`true`,children:`/`})]}),(0,V.jsxs)(Dy,{children:[(0,V.jsx)(Oy,{asChild:!0,children:(0,V.jsxs)(J,{variant:`ghost`,size:`touch`,className:B(`min-w-0 shrink gap-2 px-2 text-fg lg:h-9`,s&&`-ml-2`),"data-sw-workspace-switcher":!0,children:[(0,V.jsx)(`span`,{className:`truncate font-semibold`,children:o?o.name:`Workspaces`}),(0,V.jsx)(he,{size:14,className:`shrink-0 text-faint`,"aria-hidden":`true`})]})}),(0,V.jsxs)(Ay,{align:`start`,className:`w-72`,children:[(0,V.jsx)(Ny,{children:`Your workspaces`}),t.workspaces.map(e=>(0,V.jsxs)(My,{onSelect:()=>rx(`/w/${e.id}`),"data-sw-workspace":e.id,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,V.jsx)(`span`,{className:`text-xs text-faint`,children:wb[e.role]}),e.id===a?(0,V.jsx)(ue,{size:14,className:`text-accent`,"aria-hidden":`true`}):null]},e.id)),(0,V.jsx)(Py,{}),(0,V.jsxs)(My,{onSelect:()=>rx(`/#new`),children:[(0,V.jsx)(Rt,{size:14,"aria-hidden":`true`}),` New workspace`]})]})]}),(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsx)(XS,{variant:`chip`}),s?null:m(!1,!0)]})}),t.viaRecovery?(0,V.jsx)(`div`,{className:`mx-auto max-w-6xl px-3 pt-4 sm:px-6`,children:(0,V.jsx)(Q,{tone:`warn`,title:`You signed in with a recovery code`,action:i===`/account`?null:(0,V.jsx)(J,{size:`touch`,variant:`secondary`,onClick:()=>tx(`/account#add-passkey`),className:`lg:h-8`,children:`Add a passkey`}),children:`Add a new passkey now. For the next 30 minutes this session can add one, and nothing else that is sensitive.`})}):null,t.securityNotice?(0,V.jsx)(QS,{notice:t.securityNotice,onSeen:n}):null,r?.storageFull?(0,V.jsx)(`div`,{className:`mx-auto max-w-6xl px-3 pt-4 sm:px-6`,"data-sw-demo-storage-full":!0,children:(0,V.jsx)(Q,{tone:`warn`,title:`The demo ran out of browser storage`,action:(0,V.jsx)(J,{size:`touch`,variant:`secondary`,onClick:r.reset,className:`lg:h-8`,children:`Reset the demo`}),children:`New changes last only until you leave this page. Resetting the demo frees the space.`})}):null,(0,V.jsx)(`main`,{className:`mx-auto w-full max-w-6xl flex-1 animate-fade-in px-3 pt-5 pb-10 sm:px-6 sm:pt-8`,id:`main`,children:e}),(0,V.jsx)($x,{transport:X})]})]})})}function nC({children:e,wide:t=!1}){return(0,V.jsxs)(`div`,{className:`flex min-h-dvh flex-col items-center px-4 pt-10 sm:pt-20`,children:[(0,V.jsxs)(ix,{to:`/`,className:`mb-6 flex items-center gap-2 rounded-md outline-none focus-visible:outline-2 focus-visible:outline-accent`,children:[(0,V.jsx)(xx,{className:`h-8 w-8`}),(0,V.jsx)(`span`,{className:`text-lg font-semibold text-fg`,children:`Shapewall`})]}),(0,V.jsx)(`main`,{className:t?`w-full max-w-lg flex-1 animate-fade-in`:`w-full max-w-md flex-1 animate-fade-in`,id:`main`,children:e}),(0,V.jsx)($x,{transport:X,className:`px-0 sm:px-0`})]})}function rC(e){try{return window.sessionStorage.getItem(e)||``}catch{return``}}function iC(e,t){try{t?window.sessionStorage.setItem(e,t):window.sessionStorage.removeItem(e)}catch{}}function aC({key:e,path:t,parse:n,valid:r,keepSearch:i=!1}){let a=(0,O.useCallback)(()=>{let a=n(window.location.hash.slice(1));if(a)return iC(e,a),window.history.replaceState(null,``,`${t}${i?window.location.search:``}`),a;let o=rC(e);return o&&(r?r(o):n(o)===o)?o:``},[e,t,n,r,i]),[o,s]=(0,O.useState)(a);return(0,O.useEffect)(()=>{let e=()=>{if(!window.location.hash)return;let e=a();e&&s(e)};return window.addEventListener(`hashchange`,e),window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`hashchange`,e),window.removeEventListener(`popstate`,e)}},[a]),{value:o,forget:(0,O.useCallback)(()=>{iC(e,``),s(``)},[e]),accept:(0,O.useCallback)(t=>{let i=String(t||``).trim(),a=i.includes(`#`)?i.slice(i.indexOf(`#`)+1):i,o=n(a)||(r&&r(a)?a:``);return o?(iC(e,o),s(o),!0):!1},[e,n,r])}}var oC=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,sC=null;function cC(){return window.turnstile?Promise.resolve(window.turnstile):(sC||=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=oC,n.async=!0,n.onload=()=>window.turnstile?e(window.turnstile):t(Error(`Turnstile did not load`)),n.onerror=()=>{sC=null,t(Error(`The bot check could not load. Check your connection and reload the page.`))},document.head.append(n)}),sC)}function lC({siteKey:e,onToken:t,onError:n}){let r=(0,O.useRef)(null),i=(0,O.useRef)({onToken:t,onError:n});return i.current={onToken:t,onError:n},(0,O.useEffect)(()=>{let t=null,n=!1;return cC().then(a=>{!n&&r.current&&(t=a.render(r.current,{sitekey:e,callback:e=>i.current.onToken(e),"expired-callback":()=>i.current.onToken(null),"error-callback":()=>i.current.onToken(null)}))}).catch(e=>i.current.onError?.(e)),()=>{n=!0,t!==null&&window.turnstile?.remove(t)}},[e]),(0,V.jsx)(`div`,{ref:r,className:`min-h-[65px]`,"data-sw-turnstile":!0})}var uC=/^[A-Za-z0-9_-]{20,100}$/,dC=`shapewall.invite`,fC=`shapewall.setup`,pC=e=>{try{return new URL(e).host}catch{return e}};function mC(){let{me:e,anon:t,refresh:n}=ux(),[r]=(0,O.useState)(()=>ox(new URLSearchParams(window.location.search).get(`next`))),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(``),[f,p]=(0,O.useState)(``),[m,h]=(0,O.useState)(!1),g=Ub(),_=(0,O.useRef)(null),v=(0,O.useRef)(null),y=(0,O.useRef)(!1),[b,x]=(0,O.useState)(0),S=e?.moving||t?.moving||null,C=e?.movedFrom||t?.movedFrom||null,w=(0,O.useCallback)(async()=>{if(r===`/`){let e=await X.get(`/auth/me`).catch(()=>null);if(e?.workspaces?.length===1&&!e.moving)return window.location.assign(`/w/${e.workspaces[0].id}`)}window.location.assign(r)},[r]),T=()=>{_.current?.abort(),_.current=null};(0,O.useEffect)(()=>{if(!g||c||e)return;let t=!1,n=null;return(async()=>{if(!await Gb()||t||y.current)return;h(!0);let e=new AbortController;_.current=e,n=window.setTimeout(()=>{e.abort(),x(e=>e+1)},27e4);try{let t=X.post(`/auth/login/options`,{});v.current=t;let{options:n}=await t;if(e.signal.aborted)return;let r=await Kb(n,{mediation:`conditional`,signal:e.signal});a(!0),await X.post(`/auth/login/verify`,{response:r}),await w()}catch(t){if(e.signal.aborted||t?.name===`AbortError`)return;s(qb(t)),a(!1),window.setTimeout(()=>x(e=>e+1),1e3)}finally{window.clearTimeout(n)}})(),()=>{t=!0,window.clearTimeout(n),T()}},[g,c,e,b,w]);let E=async({related:e=!1}={})=>{y.current=!0,T(),a(!0),s(null);try{await v.current?.catch(()=>{});let{options:t}=await X.post(`/auth/login/options`,e?{related:!0}:{}),n=await Kb(t);await X.post(`/auth/login/verify`,e?{response:n,related:!0}:{response:n}),await w()}catch(t){s(e&&t?.name===`NotAllowedError`?`This browser could not use a passkey from ${C?.rpId}. Use "Move my sign-in" on ${C?.origin}, or a recovery code.`:qb(t)),a(!1),y.current=!1,x(e=>e+1)}};return(0,V.jsxs)(nC,{children:[(0,V.jsxs)(Z,{className:`p-6 sm:p-8`,children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Sign in`}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`Use the passkey you made for Shapewall: on this device, in a password manager or on your phone.`}),S?(0,V.jsxs)(Q,{tone:`info`,className:`mt-4`,title:`This server is moving to ${pC(S.to)}`,"data-sw-moving-notice":!0,children:[`Sign in here with your passkey to move your sign-in to the new address (until `,Cb(S.endsAt),`), or`,` `,(0,V.jsxs)(`a`,{href:S.to,className:`font-medium text-accent underline-offset-2 hover:underline`,children:[`go to `,pC(S.to)]}),` `,`and use a recovery code.`]}):null,e?(0,V.jsxs)(Q,{tone:`info`,className:`mt-4`,children:[`You are signed in as @`,e.user.handle,`.`,` `,(0,V.jsx)(ix,{to:`/`,className:`font-medium text-accent underline-offset-2 hover:underline`,children:`Go to your workspaces`})]}):null,c?(0,V.jsxs)(`form`,{className:`mt-6 space-y-4`,onSubmit:async e=>{e.preventDefault(),T(),a(!0),s(null);try{await X.post(`/auth/recovery`,{handle:u,code:f}),await n(),window.location.assign(`/account`)}catch(e){s(qb(e)),a(!1)}},children:[(0,V.jsx)($,{label:`Handle`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:u,onChange:e=>d(e.target.value),autoComplete:`username`,autoCapitalize:`none`,spellCheck:!1,"data-sw-recovery-handle":!0})}),(0,V.jsx)($,{label:`Recovery code`,hint:`Each code works once. Add a new passkey right after.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:f,onChange:e=>p(e.target.value),autoComplete:`one-time-code`,autoCapitalize:`none`,spellCheck:!1,className:`font-mono`,"data-sw-recovery-code":!0})}),(0,V.jsx)(Tx,{error:o}),(0,V.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,children:[(0,V.jsx)(J,{variant:`ghost`,size:`touch`,onClick:()=>l(!1),children:`Back`}),(0,V.jsxs)(J,{type:`submit`,variant:`default`,size:`touch`,disabled:i||!u||!f,children:[i?(0,V.jsx)(Y,{}):null,`Sign in with the code`]})]})]}):(0,V.jsxs)(`div`,{className:`mt-6 space-y-3`,children:[g?(0,V.jsxs)(V.Fragment,{children:[m?(0,V.jsx)($,{label:`Handle`,hint:`Pick your passkey from the suggestions, or use the button.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:u,onChange:e=>d(e.target.value),autoComplete:`username webauthn`,autoCapitalize:`none`,spellCheck:!1,"data-sw-signin-autofill":!0})}):null,(0,V.jsxs)(J,{variant:`default`,size:`touch`,className:`w-full text-[15px]`,onClick:()=>E(),disabled:i,"data-sw-passkey-signin":!0,children:[i?(0,V.jsx)(Y,{}):(0,V.jsx)(qe,{size:17,"aria-hidden":`true`}),`Sign in with a passkey`]}),C?(0,V.jsxs)(J,{variant:`secondary`,size:`touch`,className:`w-full`,onClick:()=>E({related:!0}),disabled:i,"data-sw-passkey-related":!0,children:[(0,V.jsx)(qe,{size:16,"aria-hidden":`true`}),` Use a passkey from `,C.rpId]}):null]}):(0,V.jsx)(Q,{tone:`warn`,children:`This browser cannot use passkeys here. They need a secure (https) page.`}),(0,V.jsx)(Tx,{error:o}),(0,V.jsxs)(J,{variant:`ghost`,size:`touch`,className:`w-full`,onClick:()=>{T(),l(!0)},children:[(0,V.jsx)(tt,{size:16,"aria-hidden":`true`}),` Lost your passkey? Use a recovery code`]})]})]}),(0,V.jsx)(`p`,{className:`mt-5 text-center text-sm text-muted`,"data-sw-signin-new":!0,children:t?.signup===`open`?(0,V.jsxs)(V.Fragment,{children:[`New here?`,` `,(0,V.jsx)(ix,{to:`/signup`,className:`font-medium text-accent underline-offset-2 hover:underline`,children:`Create an account`})]}):`New here? Ask a workspace admin for an invite link.`})]})}function hC({codes:e,onDone:t,doneLabel:n=`Continue`}){let[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(!1),l=(0,O.useRef)(null);(0,O.useEffect)(()=>{if(!a)return;let e=window.setTimeout(()=>o(!1),2e3);return()=>window.clearTimeout(e)},[a]);let u=e.join(`
51
+ `);return(0,V.jsxs)(`div`,{className:`space-y-4`,"data-sw-recovery-codes":!0,children:[(0,V.jsx)(`p`,{className:`text-sm text-muted`,children:`If you lose every passkey, one of these gets you back in. Each works once. They are shown only now: save them in a password manager.`}),(0,V.jsx)(`ol`,{ref:l,className:`grid grid-cols-1 gap-1.5 rounded-lg border border-line bg-surface-2 p-3 font-mono text-[13px] text-fg sm:grid-cols-2`,children:e.map((e,t)=>(0,V.jsxs)(`li`,{className:`flex gap-2`,"data-sw-recovery-code-item":!0,children:[(0,V.jsxs)(`span`,{className:`w-5 text-right text-faint tabular`,children:[t+1,`.`]}),(0,V.jsx)(`span`,{className:`sw-secret select-all`,children:e})]},e))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:async()=>{try{await navigator.clipboard.writeText(u),c(!1),o(!0)}catch{if(l.current){let e=document.createRange();e.selectNodeContents(l.current);let t=window.getSelection();t.removeAllRanges(),t.addRange(e)}c(!0)}},className:`lg:h-9`,children:[(0,V.jsx)(Te,{size:15,"aria-hidden":`true`}),` `,a?`Copied`:`Copy all`]}),(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:()=>Rb(new Blob([`Shapewall recovery codes\n\n${u}\n`],{type:`text/plain`}),`shapewall-recovery-codes.txt`),className:`lg:h-9`,children:[(0,V.jsx)(ke,{size:15,"aria-hidden":`true`}),` Download`]})]}),(0,V.jsx)(Ax,{shown:s}),(0,V.jsx)(Rx,{checked:r,onChange:i,id:`saved`,children:`I saved these codes somewhere safe`}),(0,V.jsxs)(J,{variant:`default`,size:`touch`,className:`w-full sm:w-auto`,disabled:!r,onClick:t,"data-sw-codes-done":!0,children:[n,` `,(0,V.jsx)(P,{size:16,"aria-hidden":`true`})]})]})}var gC=/^[a-z][a-z0-9-]{2,31}$/;function _C(e){return e?/^[a-z]/.test(e)?/[^a-z0-9-]/.test(e)?`Only lowercase letters, digits and dashes.`:e.length<3?`At least 3 characters.`:gC.test(e)?null:`Up to 32 characters.`:`Start with a letter.`:null}var vC=e=>t=>{let n=new URLSearchParams(t).get(e)||``;return uC.test(n)?n:``},yC=vC(`invite`),bC=vC(`setup`),xC=e=>uC.test(e);function SC(){let{refresh:e,anon:t}=ux(),n=aC({key:dC,path:`/signup`,parse:yC,valid:xC}),r=aC({key:fC,path:`/signup`,parse:bC,valid:xC}),i={invite:n.value,setup:n.value?``:r.value},a=!!t?.turnstile&&!i.invite&&!i.setup,[o,s]=(0,O.useState)(i.invite?`loading`:null),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(``),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(``),[g,_]=(0,O.useState)(``),[v,y]=(0,O.useState)(!1),[b,x]=(0,O.useState)(!1),[S,C]=(0,O.useState)(null),[w,T]=(0,O.useState)(null),[E,D]=(0,O.useState)(null),[k,A]=(0,O.useState)(0);(0,O.useEffect)(()=>{if(!i.invite){s(null);return}let e=!0;return s(`loading`),l(null),X.post(`/api/invites/preview`,{token:i.invite}).then(t=>e&&s(t)).catch(t=>{e&&(s(null),l(t.message))}),()=>{e=!1}},[i.invite]);let j=m.trim()?`${m.trim()}'s workspace`:``,M=v?g:j,ee=_C(u),te=async e=>{if(e.preventDefault(),p(!0),!ee){x(!0),C(null);try{let{options:e}=await X.post(`/auth/register/options`,{handle:u,displayName:m,...i.invite?{invite:i.invite}:{},...i.setup?{setup:i.setup}:{},...!i.invite&&M.trim()?{workspaceName:M.trim()}:{},...a?{turnstileToken:E}:{}}),t=await Wb(e),o=await X.post(`/auth/register/verify`,{response:t});n.forget(),r.forget(),T(o)}catch(e){C(e instanceof qv?e.message:qb(e)),a&&(D(null),A(e=>e+1))}finally{x(!1)}}};if(w)return(0,V.jsx)(nC,{wide:!0,children:(0,V.jsxs)(Z,{className:`p-6 sm:p-8`,children:[(0,V.jsxs)(`h1`,{className:`text-xl font-semibold text-fg`,children:[`Welcome, `,w.user.displayName]}),(0,V.jsx)(`h2`,{className:`mt-5 mb-2 text-[15px] font-semibold text-fg`,children:`Your recovery codes`}),(0,V.jsx)(hC,{codes:w.recoveryCodes,onDone:async()=>{await e(),tx(`/w/${w.workspaceId}`)}})]})});let N=!i.invite&&!i.setup,P=t?.signup===`open`,ne=!i.invite;return(0,V.jsxs)(nC,{children:[(0,V.jsxs)(Z,{className:`p-6 sm:p-8`,children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:i.setup?`Set up this server`:`Create your account`}),i.setup?(0,V.jsx)(Q,{tone:`info`,className:`mt-4`,title:`You are creating this server's first owner account`,"data-sw-setup-notice":!0,children:`You will own the first workspace and can invite everyone else from it. The setup link works once.`}):null,o===`loading`?(0,V.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-sm text-muted`,children:[(0,V.jsx)(Y,{}),` Checking your invite`]}):o?(0,V.jsxs)(Q,{tone:`ok`,className:`mt-4`,title:`You're invited to ${o.workspace.name}`,children:[`You will join as `,wb[o.role].toLowerCase(),`. The link works once and expires `,Cb(o.expiresAt),`.`]}):null,c?(0,V.jsxs)(Q,{tone:`bad`,className:`mt-4`,title:`This invite does not work`,children:[c,` Ask whoever sent it for a new one.`]}):null,N&&!P?(0,V.jsx)(Q,{tone:`info`,className:`mt-4`,children:`Sign-up on this server needs an invite link from a workspace admin. If you have one, open it again.`}):null,(0,V.jsxs)(`form`,{className:`mt-6 space-y-4`,onSubmit:te,noValidate:!0,children:[(0,V.jsx)($,{label:`Handle`,hint:`Lowercase letters, digits and dashes, starting with a letter. People @mention you with it.`,error:f||u.length>=3?ee:null,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:u,onChange:e=>d(e.target.value.toLowerCase().replace(/\s+/g,`-`)),onBlur:()=>p(!0),"aria-invalid":ee&&(f||u.length>=3)?!0:void 0,autoComplete:`username`,autoCapitalize:`none`,spellCheck:!1,maxLength:32,"data-sw-signup-handle":!0})}),(0,V.jsx)($,{label:`Your name`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:m,onChange:e=>h(e.target.value),autoComplete:`name`,maxLength:60,"data-sw-signup-name":!0})}),ne?(0,V.jsx)($,{label:`Workspace name`,hint:`Your team's space for projects. You can rename it later.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:M,onChange:e=>{y(!0),_(e.target.value)},maxLength:60,"data-sw-signup-workspace":!0})}):null,a?(0,V.jsx)(lC,{siteKey:t.turnstile,onToken:D,onError:C},k):null,(0,V.jsx)(Tx,{error:S}),(0,V.jsxs)(J,{type:`submit`,variant:`default`,size:`touch`,className:`w-full text-[15px]`,disabled:b||!u||!!ee||!m||!!c||!Ub()||a&&!E,"data-sw-signup-submit":!0,children:[b?(0,V.jsx)(Y,{}):(0,V.jsx)(qe,{size:17,"aria-hidden":`true`}),`Create a passkey and sign up`]}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`No email and no password: your device or password manager keeps a passkey for this site.`})]})]}),(0,V.jsxs)(`p`,{className:`mt-5 text-center text-sm text-muted`,children:[`Already have an account?`,` `,(0,V.jsx)(ix,{to:i.invite?`/signin?next=%2Finvite`:`/signin`,className:`font-medium text-accent underline-offset-2 hover:underline`,children:`Sign in`})]})]})}var CC=`shapewall.share`,wC=e=>uC.test(e)?e:``;function TC({onPaste:e,label:t=`Paste the full link you were sent`,testId:n}){let[r,i]=(0,O.useState)(``),[a,o]=(0,O.useState)(!1);return(0,V.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),o(!e(r))},className:`mt-5 space-y-2 text-left`,children:[(0,V.jsx)($,{label:t,error:a?`That does not look like the whole link. It ends with a # and a long code.`:null,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:r,onChange:e=>{i(e.target.value),o(!1)},autoComplete:`off`,spellCheck:!1,placeholder:`https://...`,"data-sw-paste-link":n})}),(0,V.jsx)(J,{type:`submit`,size:`touch`,variant:`secondary`,className:`w-full`,disabled:!r.trim(),children:`Open this link`})]})}function EC(){let{value:e,forget:t,accept:n}=aC({key:CC,path:`/share`,parse:wC}),[r]=(0,O.useState)(()=>new URLSearchParams(window.location.search).has(`ended`)),[i,a]=(0,O.useState)(null),[o,s]=(0,O.useState)(e?`loading`:`missing`),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(``),[f,p]=(0,O.useState)(``),[m,h]=(0,O.useState)(!1),[g,_]=(0,O.useState)(null),[v,y]=(0,O.useState)(null),[b,x]=(0,O.useState)(0),S=(0,O.useRef)(0),C=(0,O.useCallback)(()=>{let n=++S.current;e?(s(`loading`),l(null),X.post(`/api/shares/preview`,{token:e}).then(e=>{n===S.current&&(a(e),s(`ready`))}).catch(e=>{n===S.current&&(l(e.message),e.status===404?(t(),s(`invalid`)):s(`error`))})):s(`missing`)},[e,t]);(0,O.useEffect)(()=>(window.location.search&&window.history.replaceState(null,``,`/share`),e&&C(),()=>{S.current+=1}),[C,e]);let w=async n=>{n.preventDefault(),h(!0),_(null);try{let n=await X.post(`/s/${i.id}/open`,{token:e,...f?{passcode:f}:{},...u.trim()?{name:u.trim()}:{},...v?{turnstileToken:v}:{}});t(),window.location.assign(n.url)}catch(e){_(e.message),h(!1),i?.turnstile&&(y(null),x(e=>e+1))}},T=i?.mode===`comment`,E=!!(T&&i?.turnstile);return(0,V.jsxs)(nC,{children:[(0,V.jsxs)(Z,{className:`p-6 sm:p-8`,children:[o===`loading`?(0,V.jsx)(Px,{label:`Opening the share link`}):null,o===`missing`?(0,V.jsxs)(`div`,{className:`text-center`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-11 w-11 items-center justify-center rounded-xl bg-surface-2 text-muted`,children:(0,V.jsx)(rt,{size:20,"aria-hidden":`true`})}),(0,V.jsx)(`h1`,{className:`mt-4 text-xl font-semibold text-fg`,children:r?`Your visit ended`:`This share link is incomplete`}),(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:r?`Guest visits last up to 12 hours, and end when the link is revoked or expires. Open the link you were sent again.`:`Open the full link you were sent. It ends with a # and a long code.`}),(0,V.jsx)(TC,{onPaste:n,testId:`share`})]}):null,o===`invalid`?(0,V.jsxs)(`div`,{className:`text-center`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-11 w-11 items-center justify-center rounded-xl bg-bad/10 text-bad`,children:(0,V.jsx)(rt,{size:20,"aria-hidden":`true`})}),(0,V.jsx)(`h1`,{className:`mt-4 text-xl font-semibold text-fg`,children:`This link does not work`}),(0,V.jsxs)(`p`,{className:`mt-2 text-sm text-muted`,children:[c,` Ask whoever shared it for a new one.`]})]}):null,o===`error`?(0,V.jsxs)(`div`,{className:`text-center`,"data-sw-share-retry":!0,children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`The link did not open`}),(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:c}),(0,V.jsxs)(J,{size:`touch`,variant:`default`,className:`mt-5 w-full`,onClick:C,children:[(0,V.jsx)(Ht,{size:15,"aria-hidden":`true`}),` Try again`]})]}):null,o===`ready`?(0,V.jsxs)(`form`,{onSubmit:w,className:`space-y-5`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(H,{tone:T?`accent`:`neutral`,className:`px-2 py-0.5 text-[11px]`,children:[T?(0,V.jsx)(vt,{size:12,"aria-hidden":`true`}):(0,V.jsx)(Fe,{size:12,"aria-hidden":`true`}),T?`View and comment`:`View only`]}),i.needsPasscode?(0,V.jsxs)(H,{tone:`warn`,className:`px-2 py-0.5 text-[11px]`,children:[(0,V.jsx)(st,{size:12,"aria-hidden":`true`}),` Passcode`]}):null]}),(0,V.jsx)(`h1`,{className:`mt-3 text-xl font-semibold text-fg`,"data-sw-share-title":!0,children:i.project?i.project.name:`A shared Shapewall board`}),i.workspace?(0,V.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`Shared from `,i.workspace.name]}):null,(0,V.jsxs)(`p`,{className:`mt-2 text-xs text-muted`,children:[`This link works until `,Cb(i.expiresAt),`.`]})]}),i.needsPasscode?(0,V.jsx)($,{label:`Passcode`,hint:`Whoever shared the link has it.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,type:`password`,value:f,onChange:e=>p(e.target.value),autoComplete:`off`,"data-sw-share-passcode":!0})}):null,(0,V.jsx)($,{label:T?`Your name`:`Your name (optional)`,hint:T?`Shown with your comments, marked as a guest.`:`So the team knows who looked.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:u,onChange:e=>d(e.target.value),autoComplete:`name`,maxLength:40,"data-sw-share-name":!0})}),T?(0,V.jsx)(Q,{tone:`info`,children:`Comments you leave are visible to the team that shared this board. Do not include passwords or private data.`}):null,E?(0,V.jsx)(lC,{siteKey:i.turnstile,onToken:y,onError:e=>_(e.message)},b):null,(0,V.jsx)(Tx,{error:g}),(0,V.jsxs)(J,{type:`submit`,variant:`default`,size:`touch`,className:`w-full`,disabled:m||T&&!u.trim()||i.needsPasscode&&!f||E&&!v,"data-sw-share-open":!0,children:[m?(0,V.jsx)(Y,{}):null,`Open the board`]})]}):null]}),(0,V.jsx)(`p`,{className:`mt-5 text-center text-xs text-muted`,children:`You are visiting as a guest. No account needed.`})]})}var DC=e=>uC.test(e)?e:``;function OC(){let{me:e,refresh:t}=ux(),{value:n,forget:r,accept:i}=aC({key:dC,path:`/invite`,parse:DC}),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(n?`loading`:`missing`),[l,u]=(0,O.useState)(null),d=_x(),f=(0,O.useRef)(0),p=(0,O.useCallback)(()=>{let e=++f.current;n?(c(`loading`),u(null),X.post(`/api/invites/preview`,{token:n}).then(t=>{e===f.current&&(o(t),t.alreadyMember&&r(),c(t.alreadyMember?`member`:`ready`))}).catch(t=>{e===f.current&&(u(t.message),t.status===404?(r(),c(`invalid`)):c(`error`))})):c(`missing`)},[n,r]);(0,O.useEffect)(()=>(n&&p(),()=>{f.current+=1}),[p,n,!!e]);let m=()=>d.run(async()=>{let e;try{e=await X.post(`/api/invites/accept`,{token:n})}catch(e){if(e.code===`already_member`)return p();throw e}return r(),await t(),tx(`/w/${e.workspaceId}`)}),h=async e=>{await t(),tx(`/w/${e}`)};return(0,V.jsx)(nC,{children:(0,V.jsxs)(Z,{className:`p-6 sm:p-8`,children:[s===`loading`?(0,V.jsx)(Px,{label:`Checking your invite`}):null,s===`missing`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Invite`}),(0,V.jsx)(Q,{tone:`warn`,className:`mt-4`,title:`This invite link is incomplete`,children:`Open the full link you were sent. It ends with a # and a long code.`}),(0,V.jsx)(TC,{onPaste:i,testId:`invite`})]}):null,s===`invalid`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Invite`}),(0,V.jsxs)(Q,{tone:`bad`,className:`mt-4`,title:`This invite does not work`,children:[l,` Ask whoever sent it for a new one.`]}),e?null:(0,V.jsxs)(`p`,{className:`mt-4 text-sm text-muted`,children:[`Already joined with it?`,` `,(0,V.jsx)(ix,{to:`/signin?next=%2F`,className:`font-medium text-accent underline-offset-2 hover:underline`,children:`Sign in`}),` `,`to get to your workspaces.`]})]}):null,s===`error`?(0,V.jsxs)(`div`,{"data-sw-invite-retry":!0,children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`The invite did not load`}),(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:l}),(0,V.jsxs)(J,{size:`touch`,variant:`default`,className:`mt-5 w-full`,onClick:p,children:[(0,V.jsx)(Ht,{size:15,"aria-hidden":`true`}),` Try again`]})]}):null,s===`member`?(0,V.jsxs)(`div`,{"data-sw-invite-member":!0,children:[(0,V.jsx)(`span`,{className:`inline-flex h-11 w-11 items-center justify-center rounded-xl bg-ok/10 text-ok`,children:(0,V.jsx)(ye,{size:20,"aria-hidden":`true`})}),(0,V.jsxs)(`h1`,{className:`mt-4 text-xl font-semibold text-fg`,children:[`You are already in `,a.workspace.name]}),(0,V.jsxs)(`p`,{className:`mt-2 text-sm text-muted`,children:[`You are signed in as @`,e?.user.handle,`, a `,wb[a.role].toLowerCase(),` there.`,a.usable?` The invite is still unused: send it to whoever it was meant for.`:``]}),(0,V.jsxs)(J,{size:`touch`,variant:`default`,className:`mt-5 w-full`,onClick:()=>h(a.workspace.id),"data-sw-invite-go":!0,children:[`Go to `,a.workspace.name,` `,(0,V.jsx)(P,{size:16,"aria-hidden":`true`})]})]}):null,s===`ready`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`inline-flex h-11 w-11 items-center justify-center rounded-xl bg-accent/10 text-accent`,children:(0,V.jsx)(Dn,{size:20,"aria-hidden":`true`})}),(0,V.jsxs)(`h1`,{className:`mt-4 text-xl font-semibold text-fg`,"data-sw-invite-title":!0,children:[`Join `,a.workspace.name]}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-sm text-muted`,children:[(0,V.jsx)(Dx,{role:a.role}),` `,Tb[a.role]]}),(0,V.jsxs)(`p`,{className:`mt-3 text-xs text-muted`,children:[`The link works once and expires `,Cb(a.expiresAt),`.`]}),(0,V.jsxs)(`div`,{className:`mt-6 space-y-2`,children:[e?(0,V.jsxs)(J,{variant:`default`,size:`touch`,className:`w-full`,onClick:m,disabled:d.busy,"data-sw-invite-accept":!0,children:[d.busy?(0,V.jsx)(Y,{}):null,`Join as @`,e.user.handle]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{variant:`default`,size:`touch`,className:`w-full`,onClick:()=>tx(`/signup#invite=${encodeURIComponent(n)}`),"data-sw-invite-signup":!0,children:`Create an account`}),(0,V.jsx)(J,{variant:`secondary`,size:`touch`,className:`w-full`,onClick:()=>tx(`/signin?next=%2Finvite`),children:`I have an account`})]}),(0,V.jsx)(Tx,{error:d.error})]})]}):null]})})}function kC(){let{me:e,refresh:t}=ux(),[n,r]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{Qb()===`#new`&&(tx(`/`,{replace:!0}),r(!0))},[]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`Workspaces`,description:`Projects, people and their access live in a workspace.`,actions:(0,V.jsxs)(J,{variant:`default`,size:`touch`,onClick:()=>r(!0),className:`lg:h-9`,"data-sw-new-workspace":!0,children:[(0,V.jsx)(Rt,{size:16,"aria-hidden":`true`}),` New workspace`]})}),e.workspaces.length?(0,V.jsx)(`div`,{className:`grid animate-fade-in gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:e.workspaces.map(e=>(0,V.jsx)(ix,{to:`/w/${e.id}`,className:`group rounded-xl border border-line bg-surface p-4 shadow-card transition-[box-shadow,border-color,translate] duration-(--motion-fast) ease-standard outline-none hover:-translate-y-px hover:border-line-strong hover:shadow-lift focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,"data-sw-workspace-card":e.id,children:(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent/10 text-ui font-semibold text-accent`,"aria-hidden":`true`,children:sa(e.name)}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-title font-semibold text-fg`,children:e.name}),(0,V.jsx)(`div`,{className:`mt-1`,children:(0,V.jsx)(Dx,{role:e.role})})]}),(0,V.jsx)(P,{size:16,className:`mt-1 text-faint transition-transform group-hover:translate-x-0.5`,"aria-hidden":`true`})]})},e.id))}):(0,V.jsx)(Z,{children:(0,V.jsx)(Ly,{icon:oe,title:`You are not in a workspace yet`,children:`Make one, or ask a workspace admin for an invite link.`})}),(0,V.jsx)(AC,{open:n,onClose:()=>r(!1),onCreated:async e=>{await t(),r(!1),rx(`/w/${e}`)}})]})}function AC({open:e,onClose:t,onCreated:n}){let[r,i]=(0,O.useState)(``),{run:a,busy:o,error:s,setError:c}=_x();return(0,O.useEffect)(()=>{e&&(i(``),c(null))},[e,c]),(0,V.jsx)(Ty,{open:e,onClose:()=>o?null:t(),title:`New workspace`,description:`You will be its owner.`,children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a(async()=>{await n((await X.post(`/api/workspaces`,{name:r})).workspace.id)})},className:`space-y-4 px-5 py-4`,children:[(0,V.jsx)($,{label:`Name`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:r,onChange:e=>i(e.target.value),maxLength:80,placeholder:`Acme design team`,"data-sw-workspace-name":!0})}),(0,V.jsx)(Tx,{error:s}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:t,disabled:o,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,disabled:o||!r.trim(),className:`lg:h-10`,children:[o?(0,V.jsx)(Y,{}):null,` Create workspace`]})]})]})})}async function jC(e,{maxBytes:t=5242880,maxLabel:n=`5 MB`}={}){if(!e||![`image/png`,`image/jpeg`,`image/webp`].includes(e.type))throw Error(`Choose a PNG, JPEG or WebP image.`);if(e.size>t)throw Error(`Choose an image smaller than ${n}.`);let r;try{if(r=await createImageBitmap(e,{imageOrientation:`from-image`}),!r.width||!r.height)throw Error(`empty image`);let t=document.createElement(`canvas`);t.width=256,t.height=256;let n=t.getContext(`2d`);if(!n)throw Error(`no canvas`);let i=Math.min(r.width,r.height);return n.drawImage(r,(r.width-i)/2,(r.height-i)/2,i,i,0,0,256,256),t.toDataURL(`image/png`).split(`,`)[1]}catch{throw Error(`This image could not be read. Try another PNG, JPEG or WebP image.`)}finally{r?.close()}}function MC({name:e,avatarUrl:t,transport:n,onSaved:r}){let i=(0,O.useRef)(null),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(``),d=async e=>{if(e){o(!0),c(``),u(``);try{let t=await jC(e);await n.put(`/auth/me/avatar`,{png:t}),await r(),u(`Profile photo saved.`)}catch(e){c(e.message||`The profile photo could not be saved.`)}finally{o(!1),i.current&&(i.current.value=``)}}};return(0,V.jsxs)(`div`,{className:`space-y-2 border-b border-line px-4 py-4 sm:px-5`,"data-sw-profile-photo":!0,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(fa,{name:e,src:t,className:`h-16 w-16 text-lg`}),(0,V.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:`Profile photo`}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,className:`lg:h-9`,disabled:a,onClick:()=>i.current?.click(),"data-sw-profile-photo-upload":!0,children:[a?(0,V.jsx)(Y,{}):(0,V.jsx)(ce,{size:15,"aria-hidden":`true`}),` Upload photo`]}),t?(0,V.jsxs)(J,{size:`touch`,variant:`ghost`,className:`lg:h-9`,disabled:a,onClick:async()=>{o(!0),c(``),u(``);try{await n.delete(`/auth/me/avatar`),await r(),u(`Profile photo removed.`)}catch(e){c(e.message||`The profile photo could not be removed.`)}finally{o(!1)}},"data-sw-profile-photo-remove":!0,children:[(0,V.jsx)(xn,{size:15,"aria-hidden":`true`}),` Remove photo`]}):null]}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`PNG, JPEG or WebP, up to 5 MB. Cropped to a square.`})]})]}),(0,V.jsx)(`input`,{ref:i,type:`file`,accept:`image/png,image/jpeg,image/webp`,className:`hidden`,"aria-label":`Choose profile photo`,onChange:e=>void d(e.target.files?.[0]),"data-sw-profile-photo-file":!0}),s?(0,V.jsx)(`p`,{className:`text-sm text-bad`,role:`alert`,children:s}):null,(0,V.jsx)(`p`,{className:`text-xs text-muted`,role:`status`,children:l})]})}function NC(){let{me:e,refresh:t}=ux(),n=px(),[r,i]=(0,O.useState)(e.user.displayName),{run:a,busy:o,error:s}=_x();return(0,V.jsxs)(Z,{id:`account-profile`,className:`scroll-mt-20`,children:[(0,V.jsx)(Sx,{icon:jn,title:`Profile`,description:`Your name signs your comments; people @mention your handle.`}),(0,V.jsx)(MC,{name:e.user.displayName,avatarUrl:e.user.avatarUrl,transport:X,onSaved:t}),(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a(async()=>{await X.patch(`/auth/me`,{displayName:r});let e=await t();e&&i(e.user.displayName),n(`Name saved`)})},className:`px-4 py-4 sm:px-5`,children:[(0,V.jsxs)(`div`,{className:`grid items-start gap-4 sm:grid-cols-2`,children:[(0,V.jsx)($,{label:`Name`,hint:`Shown on your comments and in mentions.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:r,onChange:e=>i(e.target.value),maxLength:60,"data-sw-profile-name":!0})}),(0,V.jsx)($,{label:`Handle`,hint:`Handles do not change.`,children:t=>(0,V.jsx)(zy,{...t,size:`touch`,value:`@${e.user.handle}`,readOnly:!0,disabled:!0})})]}),(0,V.jsx)(Tx,{error:s}),r===e.user.displayName?null:(0,V.jsxs)(`div`,{className:`mt-4 flex animate-rise-in justify-end gap-2`,"data-sw-profile-actions":!0,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,className:`lg:h-9`,disabled:o,onClick:()=>i(e.user.displayName),children:`Cancel`}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,className:`lg:h-9`,disabled:o||!r.trim(),children:[o?(0,V.jsx)(Y,{}):null,` Save`]})]})]})]})}var PC={synced:`Synced`,device:`This device only`,unsynced:`Not synced yet`},FC={internal:`built in`,hybrid:`phone`,usb:`security key (USB)`,nfc:`security key (NFC)`,ble:`Bluetooth`};function IC(e){return PC[e.storage]||(e.synced?PC.synced:PC.device)}function LC(e){return(e.transports||[]).map(e=>FC[e]).filter(Boolean).join(`, `)}function RC(){let{me:e,refresh:t}=ux(),n=px(),[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(null),l=_x(),u=e.passkeys,d=t=>!!(e.movedFrom&&t.rpId&&t.rpId!==e.rpId),f=!!e.movedFrom&&!u.some(e=>!d(e)),p=u.filter(e=>!d(e)),m=e=>p.length?p.length===1&&p[0].id===e.id:u.length===1,h=t=>m(t)&&e.recoveryCodesLeft===0,g=u.some(h),_=u.length===1&&!u[0].synced;return(0,O.useEffect)(()=>{let e=()=>{Qb()===`#add-passkey`&&(tx(`/account`,{replace:!0}),i(!0))};return e(),window.addEventListener(sx,e),()=>window.removeEventListener(sx,e)},[]),(0,V.jsxs)(Z,{id:`account-passkeys`,className:`scroll-mt-20`,"data-sw-passkeys":!0,children:[(0,V.jsx)(Sx,{icon:qe,title:`Passkeys`,description:jx(`Add one for each device or password manager you sign in from.`),actions:(0,V.jsxs)(J,{size:`touch`,variant:`default`,onClick:()=>i(!0),disabled:Av,className:`lg:h-9`,"data-sw-add-passkey":!0,children:[(0,V.jsx)(Rt,{size:16,"aria-hidden":`true`}),` Add a passkey`]})}),(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:u.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-3 sm:px-5`,"data-sw-passkey":e.nickname||`Passkey`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-surface-2 text-muted`,children:e.synced?(0,V.jsx)(Ce,{size:16,"aria-hidden":`true`}):(0,V.jsx)(ln,{size:16,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.nickname||`Passkey`}),(0,V.jsx)(H,{tone:e.synced?`accent`:`neutral`,className:`px-2 py-0.5 text-[11px]`,"data-sw-passkey-storage":e.storage,children:IC(e)}),e.onHoldUntil?(0,V.jsxs)(H,{tone:`warn`,className:`px-2 py-0.5 text-[11px]`,children:[`On hold until `,Cb(e.onHoldUntil)]}):null,d(e)?(0,V.jsxs)(H,{tone:`warn`,className:`px-2 py-0.5 text-[11px]`,"data-sw-passkey-old":!0,children:[`For `,e.rpId]}):null]}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,children:[LC(e)?`${LC(e)} · `:``,`Added `,(0,V.jsx)(Ox,{value:e.createdAt}),` · Last used`,` `,(0,V.jsx)(Ox,{value:e.lastUsedAt,empty:`never`})]})]}),(0,V.jsxs)(`div`,{className:`flex gap-1`,children:[(0,V.jsxs)(J,{size:`touch`,variant:`ghost`,onClick:()=>o(e),className:`lg:h-8`,"aria-label":`Rename ${e.nickname||`passkey`}`,children:[(0,V.jsx)(It,{size:15,"aria-hidden":`true`}),` `,(0,V.jsx)(`span`,{className:`hidden sm:inline`,children:`Rename`})]}),(0,V.jsxs)(J,{size:`touch`,variant:`danger`,onClick:()=>c(e),disabled:h(e),className:`lg:h-8`,"aria-label":`Remove ${e.nickname||`passkey`}`,children:[(0,V.jsx)(xn,{size:15,"aria-hidden":`true`}),` `,(0,V.jsx)(`span`,{className:`hidden sm:inline`,children:`Remove`})]})]})]},e.id))}),f?(0,V.jsx)(`div`,{className:`px-4 pb-4 sm:px-5`,children:(0,V.jsxs)(Q,{tone:`warn`,title:`Add a passkey for ${e.rpId}`,"data-sw-passkey-move-notice":!0,children:[`This server moved from `,e.movedFrom.rpId,`. Your passkeys belong to the old address and stop working after`,` `,Cb(e.movedFrom.endsAt),`. Add one for this address now.`]})}):null,_&&!f?(0,V.jsx)(`div`,{className:`px-4 pb-4 sm:px-5`,children:(0,V.jsx)(Q,{tone:`info`,title:`Add a passkey on another device`,"data-sw-passkey-another":!0,children:`Your only passkey lives on this device. Add one on your phone or in a password manager, so losing this device does not lock you out.`})}):null,g?(0,V.jsx)(`div`,{className:`px-4 pb-4 sm:px-5`,children:(0,V.jsxs)(Q,{tone:`warn`,children:[u.length===1?`This is your only passkey`:`Only one of your passkeys works at this address`,` and you have no recovery codes left, so it cannot be removed. Add another passkey first.`]})}):u.some(e=>e.onHoldUntil)?(0,V.jsx)(`div`,{className:`px-4 pb-4 sm:px-5`,children:(0,V.jsx)(Q,{tone:`info`,children:`A passkey added after a recovery-code sign-in signs you in at once, but confirms sensitive changes only after 24 hours.`})}):null,(0,V.jsx)(zC,{open:r,onClose:()=>i(!1),onAdded:async()=>{await t(),i(!1),n(`Passkey added`)}}),(0,V.jsx)(BC,{passkey:a,onClose:()=>o(null),onSaved:async()=>{await t(),o(null),n(`Passkey renamed`)}}),(0,V.jsxs)(Ix,{open:!!s,onClose:()=>c(null),title:`Remove ${s?.nickname||`this passkey`}?`,confirmLabel:`Remove passkey`,tone:`danger`,busy:l.busy,error:l.error,onConfirm:()=>l.run(async()=>{await X.delete(`/auth/passkeys/${encodeURIComponent(s.id)}`),await t(),c(null),n(`Passkey removed. Other devices were signed out.`)}),children:[(0,V.jsx)(`p`,{children:`It stops working at once, and every other device signed in to your account is signed out (this one stays).`}),s&&m(s)?(0,V.jsx)(`p`,{className:`text-warn`,children:`This is your last working passkey: after this you can only sign in with a recovery code.`}):null]})]})}function zC({open:e,onClose:t,onAdded:n}){let[r,i]=(0,O.useState)(``),{run:a,busy:o,error:s,setError:c}=_x();return(0,O.useEffect)(()=>{e&&(i(``),c(null))},[e,c]),(0,V.jsx)(Ty,{open:e,onClose:()=>o?null:t(),title:`Add a passkey`,description:`Your browser asks where to save it.`,children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a(async()=>{let{options:e}=await X.post(`/auth/passkeys/options`,{}),t=await Wb(e);await X.post(`/auth/passkeys/verify`,{response:t,nickname:r}),await n()})},className:`space-y-4 px-5 py-4`,children:[(0,V.jsx)($,{label:`Name`,hint:`So you can tell your passkeys apart.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:r,onChange:e=>i(e.target.value),maxLength:60,placeholder:`Work laptop`,"data-sw-passkey-name":!0})}),(0,V.jsx)(Tx,{error:s}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:t,disabled:o,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,disabled:o,className:`lg:h-10`,"data-sw-passkey-create":!0,children:[o?(0,V.jsx)(Y,{}):(0,V.jsx)(qe,{size:16,"aria-hidden":`true`}),` Create passkey`]})]})]})})}function BC({passkey:e,onClose:t,onSaved:n}){let[r,i]=(0,O.useState)(``),{run:a,busy:o,error:s}=_x();return(0,O.useEffect)(()=>{e&&i(e.nickname||``)},[e]),(0,V.jsx)(Ty,{open:!!e,onClose:()=>o?null:t(),title:`Rename passkey`,children:(0,V.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),a(async()=>{await X.patch(`/auth/passkeys/${encodeURIComponent(e.id)}`,{nickname:r}),await n()})},className:`space-y-4 px-5 py-4`,children:[(0,V.jsx)($,{label:`Name`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:r,onChange:e=>i(e.target.value),maxLength:60})}),(0,V.jsx)(Tx,{error:s}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:t,disabled:o,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,disabled:o,className:`lg:h-10`,children:[o?(0,V.jsx)(Y,{}):null,` Save`]})]})]})})}function VC(){let{me:e,refresh:t}=ux(),[n,r]=(0,O.useState)(!1),[i,a]=(0,O.useState)(null),{run:o,busy:s,error:c}=_x(),l=e.recoveryCodesLeft;return(0,V.jsxs)(Z,{id:`account-recovery`,className:`scroll-mt-20`,"data-sw-recovery":!0,children:[(0,V.jsx)(Sx,{icon:tt,title:`Recovery codes`,description:jx(`One-time codes for when you have lost every passkey.`),actions:i?null:(0,V.jsx)(J,{size:`touch`,variant:`secondary`,onClick:()=>r(!0),disabled:Av,className:`lg:h-9`,"data-sw-new-codes":!0,children:`Make new codes`})}),(0,V.jsx)(`div`,{className:`px-4 py-4 sm:px-5`,children:i?(0,V.jsx)(hC,{codes:i,doneLabel:`Done`,onDone:async()=>{a(null),await t()}}):l<=2?(0,V.jsx)(Q,{tone:`warn`,title:l===0?`No recovery codes left`:`Only ${l} recovery ${l===1?`code`:`codes`} left`,children:`Make new codes and save them, so a lost device does not lock you out.`}):(0,V.jsxs)(`p`,{className:`text-sm text-muted`,children:[(0,V.jsx)(`span`,{className:`font-semibold text-fg tabular`,children:l}),` of 10 unused. Each one signs you in once, then you add a new passkey.`]})}),(0,V.jsx)(Ix,{open:n,onClose:()=>r(!1),title:`Make new recovery codes?`,confirmLabel:`Make new codes`,busy:s,error:c,onConfirm:()=>o(async()=>{let e=await X.post(`/auth/recovery-codes`,{});r(!1),a(e.recoveryCodes)}),children:(0,V.jsx)(`p`,{children:`Your current codes stop working. The new ones are shown once.`})})]})}function HC(){let e=px(),t=yx(`/auth/sessions`),{me:n}=ux(),r=n.passkeys.length,i=t.reload,a=(0,O.useRef)(r);(0,O.useEffect)(()=>{a.current!==r&&(a.current=r,i())},[r,i]);let[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(!1),u=_x(),d=t.data?.sessions||[],f=d.filter(e=>!e.current),p=vx();return(0,V.jsxs)(Z,{id:`account-devices`,className:`scroll-mt-20`,"data-sw-sessions":!0,children:[(0,V.jsx)(Sx,{icon:wt,title:`Signed-in devices`,description:`Sessions last 30 days from last use (90 at most).`,actions:(0,V.jsxs)(V.Fragment,{children:[f.length?(0,V.jsx)(J,{size:`touch`,variant:`secondary`,onClick:()=>l(!0),className:`lg:h-9`,"data-sw-signout-others":!0,children:`Sign out other devices`}):null,(0,V.jsxs)(J,{size:`touch`,variant:`ghost`,onClick:p,className:`lg:h-9`,"data-sw-signout":!0,children:[(0,V.jsx)(ut,{size:15,"aria-hidden":`true`}),` Sign out`]})]})}),t.loading?(0,V.jsx)(Px,{}):null,t.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:t.error,onRetry:t.reload})}):null,(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:d.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-3 sm:px-5`,"data-sw-session":e.current?`current`:`other`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-surface-2 text-muted`,children:/iOS|Android/.test(e.device||``)?(0,V.jsx)(ln,{size:16,"aria-hidden":`true`}):(0,V.jsx)(wt,{size:16,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.device||`Unknown device`}),e.current?(0,V.jsx)(H,{tone:`ok`,className:`px-2 py-0.5 text-[11px]`,children:`This device`}):null,e.via===`recovery`?(0,V.jsxs)(H,{tone:`warn`,className:`px-2 py-0.5 text-[11px]`,children:[(0,V.jsx)(an,{size:11,"aria-hidden":`true`}),` Recovery code`]}):null]}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,children:[`Signed in `,(0,V.jsx)(Ox,{value:e.createdAt}),` · Active `,(0,V.jsx)(Ox,{value:e.lastSeenAt}),e.ip?` · ${e.ip}`:``]})]}),e.current?null:(0,V.jsx)(J,{size:`touch`,variant:`danger`,onClick:()=>s(e),className:`lg:h-8`,"data-sw-end-session":!0,children:`Sign out`})]},e.id))}),(0,V.jsx)(Ix,{open:!!o,onClose:()=>s(null),title:`Sign out ${o?.device||`this device`}?`,confirmLabel:`Sign it out`,tone:`danger`,busy:u.busy,error:u.error,onConfirm:()=>u.run(async()=>{let n=await X.delete(`/auth/sessions/${o.id}`);t.setData(n),s(null),e(`Signed out that device`)}),children:(0,V.jsx)(`p`,{children:`That browser has to sign in with a passkey again.`})}),(0,V.jsx)(Ix,{open:c,onClose:()=>l(!1),title:`Sign out every other device?`,confirmLabel:`Sign out others`,tone:`danger`,busy:u.busy,error:u.error,onConfirm:()=>u.run(async()=>{let n=await X.post(`/auth/sessions/revoke-others`,{});t.setData(n),l(!1),e(`Signed out everywhere else`)}),children:(0,V.jsx)(`p`,{children:`Only this browser stays signed in.`})})]})}var UC={account_created:()=>`Account created`,signed_in:e=>e.via===`recovery_code`?`Signed in with a recovery code`:e.via===`rebind`?`Signed in after moving to a new address`:e.newDevice?`Signed in on a new device`:`Signed in with a passkey`,passkey_added:e=>e.via===`rebind`?`Passkey added for the new address`:e.viaRecovery?`Passkey added after a recovery-code sign-in`:`Passkey added`,rebind_started:()=>`Started moving your sign-in to a new address`,passkey_removed:()=>`Passkey removed`,passkey_renamed:()=>`Passkey renamed`,recovery_codes_created:()=>`New recovery codes made`,sessions_revoked:()=>`Signed out every other device`,session_revoked:()=>`Signed out a device`,workspace_deleted:()=>`Deleted a workspace`};function WC(e){let t=UC[e.action];return t?t(e.detail||{}):e.action.replaceAll(`_`,` `)}function GC(e){let t=e.detail||{},n=[];return t.device&&n.push(t.device),t.otherSessionsEnded&&n.push(`other devices signed out`),typeof t.codesLeft==`number`&&n.push(`${t.codesLeft} ${t.codesLeft===1?`code`:`codes`} left`),e.ip&&n.push(e.ip),n.join(` · `)}var KC=e=>`/auth/security-log${e?`?before=${e}`:``}`;function qC(){let e=bx(KC,`events`),t=e.items;return(0,V.jsxs)(Z,{id:`activity`,className:`scroll-mt-20`,"data-sw-security-log":!0,children:[(0,V.jsx)(Sx,{icon:Wt,title:`Account activity`,description:`Sign-ins and security changes on your account.`}),e.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:e.error,onRetry:t.length?e.loadMore:e.reload})}):null,!e.loading&&!e.error&&!t.length?(0,V.jsx)(`p`,{className:`px-4 py-4 text-sm text-muted sm:px-5`,children:`Nothing yet.`}):null,(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:t.map(e=>{let t=e.action===`signed_in`&&(e.detail?.via===`recovery_code`||e.detail?.newDevice);return(0,V.jsxs)(`li`,{className:`flex items-start gap-3 px-4 py-3 sm:px-5`,"data-sw-security-event":e.action,children:[(0,V.jsx)(`span`,{className:t?`mt-0.5 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-warn/10 text-warn`:`mt-0.5 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-surface-2 text-muted`,children:t?(0,V.jsx)(an,{size:14,"aria-hidden":`true`}):(0,V.jsx)(sn,{size:14,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`text-sm text-fg`,children:WC(e)}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,children:[(0,V.jsx)(Ox,{value:e.at}),GC(e)?` · ${GC(e)}`:``]})]})]},e.id)})}),e.loading?(0,V.jsx)(Px,{}):null,e.next&&!e.loading?(0,V.jsx)(`div`,{className:`px-4 pb-4 sm:px-5`,children:(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:e.loadMore,disabled:e.more,className:`lg:h-9`,children:[e.more?(0,V.jsx)(Y,{}):null,` Show older`]})}):null]})}function JC(){let{me:e}=ux(),[t,n]=(0,O.useState)(!1),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(null),{run:s,busy:c,error:l}=_x(),u=(0,O.useRef)(0),d=async()=>{let e=++u.current;i(null),o(null),n(!0);try{let t=await X.post(`/auth/delete-account/preview`,{});e===u.current&&i(t)}catch(t){e===u.current&&o(t)}},f=!!r?.blocked.length,p=e=>e.map(e=>e.name).join(`, `);return e?.local?(0,V.jsx)(Z,{children:(0,V.jsx)(Sx,{icon:sn,title:`Installation account`,description:`At least one account must remain to protect this installation. Your boards and captures are stored separately.`})}):(0,V.jsxs)(Z,{"data-sw-delete-account":!0,children:[(0,V.jsx)(Sx,{icon:xn,title:`Delete account`,description:jx(`Removes your account, passkeys and sessions. Comments you wrote keep your name.`),actions:(0,V.jsx)(J,{size:`touch`,variant:`danger`,onClick:d,disabled:Av,className:`lg:h-9`,"data-sw-delete-account-open":!0,children:`Delete account`})}),(0,V.jsxs)(Ix,{open:t,onClose:()=>{u.current+=1,n(!1)},title:`Delete your account?`,confirmLabel:`Delete my account`,tone:`danger`,busy:c,disabled:!r||f,error:l,confirmText:r&&!f?e.user.handle:null,onConfirm:()=>s(async()=>{await X.delete(`/auth/me`,{confirm:e.user.handle}),nx(`/signin`)}),children:[a?(0,V.jsx)(Fx,{error:a,onRetry:d}):null,!r&&!a?(0,V.jsx)(Px,{}):null,r?(0,V.jsxs)(`div`,{className:`space-y-3`,"data-sw-delete-plan":!0,children:[f?(0,V.jsxs)(Q,{tone:`bad`,title:`Make someone else an owner first`,children:[`You are the only owner of `,p(r.blocked),`, and other people use it. Give one of them the owner role (Members page), then come back.`]}):null,r.deleted.length?(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`span`,{className:`font-medium text-fg`,children:`Deleted with your account`}),` (you are the only member): `,p(r.deleted),`. Every project, board and comment in `,r.deleted.length===1?`it`:`them`,` goes. Export it first from its Settings page if you want a copy.`]}):null,r.left.length?(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`span`,{className:`font-medium text-fg`,children:`You leave`}),`: `,p(r.left),`. Your pending invites, share links and API tokens there are revoked.`]}):null,f?null:(0,V.jsx)(`p`,{className:`text-bad`,children:`This cannot be undone. A fresh passkey check is needed.`})]}):null]})]})}function YC(){let{me:e}=ux(),t=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`});return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(eC,{label:`Account`,sections:XC.map(([e,n,r])=>({id:`account-nav-${e}`,label:n,icon:r,onSelect:()=>t(e),"data-sw-account-nav":e}))}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(Cx,{title:`Account and security`,description:`Your profile, the passkeys you sign in with, recovery codes and signed-in devices.`}),(0,V.jsxs)(`div`,{className:`grid gap-5`,children:[e?.local?(0,V.jsx)(Q,{title:`Security on this installation`,children:`Signing out ends your Shapewall session. Private-network access and device pairing are managed separately.`}):null,(0,V.jsx)(NC,{}),(0,V.jsx)(RC,{}),(0,V.jsx)(VC,{}),(0,V.jsx)(HC,{}),(0,V.jsx)(qC,{}),(0,V.jsx)(JC,{})]})]})]})}var XC=[[`account-profile`,`Profile`,jn],[`account-passkeys`,`Passkeys`,qe],[`account-recovery`,`Recovery codes`,tt],[`account-devices`,`Signed-in devices`,St],[`activity`,`Activity`,Wt]];function ZC({workspaceId:e,data:t,project:n=null,tokens:r=null,onNewProject:i,onNewToken:a}){let o=!!r?.some(e=>e.status===`active`&&e.scopes.includes(`push`)),s=!!n?.boards.length,c=t.members.length>1||t.invites.length>0,l=[{id:`project`,title:`Create a project`,body:`One per site or app.`,done:!!n||t.projects.length>0,action:i?(0,V.jsx)(J,{size:`touch`,variant:`default`,onClick:i,className:`lg:h-9`,"data-sw-start-project":!0,children:`New project`}):null},{id:`token`,title:`Make a push token`,body:`A token with the push scope lets the CLI or CI upload captures to this project.`,done:o,action:n&&a?(0,V.jsx)(J,{size:`touch`,variant:o?`secondary`:`default`,onClick:a,className:`lg:h-9`,"data-sw-start-token":!0,children:`Make a token`}):null},{id:`push`,title:`Push your captures`,body:`From the folder with shapewall.config.json, after a local capture. The token dialog has this command with the token filled in.`,done:s,extra:n?(0,V.jsx)(kx,{value:`shapewall push --remote ${Bb()}`,testId:`start-push`,className:`mt-2`}):null},{id:`invite`,title:`Invite your team`,body:`Teammates comment on the board; agents pick the comments up.`,done:c,action:(0,V.jsx)(J,{size:`touch`,variant:c?`secondary`:`default`,onClick:()=>tx(`/w/${e}/invites`),className:`lg:h-9`,"data-sw-start-invite":!0,children:`Invite people`})}],u=l.find(e=>!e.done)?.id;return(0,V.jsxs)(Z,{className:`p-4 sm:p-5`,"data-sw-getting-started":!0,children:[(0,V.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Get started`}),(0,V.jsx)(`ol`,{className:`mt-3 space-y-3`,children:l.map((e,t)=>(0,V.jsxs)(`li`,{className:`flex gap-3`,"data-sw-start-step":e.id,"data-done":e.done?`true`:`false`,children:[(0,V.jsx)(`span`,{className:B(`mt-0.5 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold tabular`,e.done?`border-ok bg-ok text-white`:e.id===u?`border-accent text-accent`:`border-line text-muted`),"aria-hidden":`true`,children:e.done?(0,V.jsx)(ue,{size:14}):t+1}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`p`,{className:B(`text-sm font-medium`,e.done?`text-muted line-through`:`text-fg`),children:[e.title,(0,V.jsx)(`span`,{className:`sr-only`,children:e.done?` (done)`:``})]}),e.done?null:(0,V.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:e.body}),!e.done&&e.extra?e.extra:null,!e.done&&e.action?(0,V.jsx)(`div`,{className:`mt-2`,children:e.action}):null]})]},e.id))})]})}function QC(){let{data:e,isAdmin:t,workspaceId:n,reload:r}=qE(),[i,a]=(0,O.useState)(!1),o=px();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`Projects`,description:`Each project holds the boards you push from your machine or CI, their comments, tokens and share links.`,actions:t?(0,V.jsxs)(J,{variant:`default`,size:`touch`,onClick:()=>a(!0),className:`lg:h-9`,"data-sw-new-project":!0,children:[(0,V.jsx)(Rt,{size:16,"aria-hidden":`true`}),` New project`]}):null}),e.projects.length?(0,V.jsx)(`div`,{className:`grid animate-fade-in gap-4 md:grid-cols-2`,"data-sw-project-grid":!0,children:e.projects.map(e=>(0,V.jsx)(ew,{project:e,isAdmin:t,workspaceId:n},e.id))}):t?(0,V.jsx)(ZC,{workspaceId:n,data:e,onNewProject:()=>a(!0)}):(0,V.jsx)(Z,{children:(0,V.jsx)(Ly,{icon:Le,title:`No projects yet`,children:`An admin creates projects. Boards appear here once someone pushes captures.`})}),(0,V.jsx)($C,{open:i,onClose:()=>a(!1),workspaceId:n,onCreated:async e=>{await r(),a(!1),o(`Created ${e.name}`),rx(`/w/${n}/projects/${e.id}`)}})]})}function $C({open:e,onClose:t,onCreated:n,workspaceId:r}){let[i,a]=(0,O.useState)(``),{run:o,busy:s,error:c,setError:l}=_x();return(0,O.useEffect)(()=>{e&&(a(``),l(null))},[e,l]),(0,V.jsx)(Ty,{open:e,onClose:()=>s?null:t(),title:`New project`,description:`Usually one per site or app.`,children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),o(async()=>{await n((await X.post(zb(r,`/projects`),{name:i})).project)})},className:`space-y-4 px-5 py-4`,children:[(0,V.jsx)($,{label:`Name`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:i,onChange:e=>a(e.target.value),maxLength:80,placeholder:`Marketing site`,"data-sw-project-name":!0})}),(0,V.jsx)(Tx,{error:c}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:t,disabled:s,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,disabled:s||!i.trim(),className:`lg:h-10`,"data-sw-project-create":!0,children:[s?(0,V.jsx)(Y,{}):null,` Create project`]})]})]})})}function ew({project:e,isAdmin:t,workspaceId:n}){let r=e.boards.map(e=>e.pushedAt).filter(Boolean).sort().at(-1),i=e.boards.map(e=>e.summary).filter(Boolean),a=i.find(e=>e.thumbnailUrl)?.thumbnailUrl||null,o=e=>i.reduce((t,n)=>t+(Number(n[e])||0),0),s=o(`pages`),c=o(`openComments`),l=o(`needsPerson`),u=e.boards.length>0;return(0,V.jsxs)(Z,{className:`group relative flex flex-col overflow-hidden transition-[box-shadow,border-color,translate] duration-(--motion-fast) ease-standard hover:-translate-y-px hover:border-line-strong hover:shadow-lift focus-within:border-line-strong`,"data-sw-project":e.name,children:[(0,V.jsx)(`div`,{className:`relative h-36 overflow-hidden border-b border-line bg-surface-2`,"aria-hidden":`true`,children:a?(0,V.jsx)(`img`,{src:a,alt:``,loading:`lazy`,className:`absolute inset-x-6 top-5 w-[calc(100%-3rem)] rounded-t-md object-cover object-top shadow-pop transition-transform duration-(--motion-base) ease-standard group-hover:-translate-y-0.5`}):(0,V.jsx)(`div`,{className:`sw-project-cover flex h-full items-center justify-center`,children:(0,V.jsx)(`span`,{className:`inline-flex h-12 w-12 items-center justify-center rounded-xl border border-line bg-surface text-accent shadow-card`,children:(0,V.jsx)(Le,{size:22})})})}),(0,V.jsxs)(`div`,{className:`flex flex-1 flex-col p-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`a`,{href:e.boardUrl,className:`flex min-h-11 items-center truncate text-title font-semibold text-fg outline-none lg:min-h-0 after:absolute after:inset-0 after:rounded-xl after:content-[''] focus-visible:after:outline-2 focus-visible:after:outline-offset-2 focus-visible:after:outline-accent`,"data-sw-project-link":e.name,children:e.name}),(0,V.jsx)(`p`,{className:`mt-0.5 text-ui text-muted`,children:u?(0,V.jsxs)(V.Fragment,{children:[e.boards.length,` `,e.boards.length===1?`board`:`boards`,s?` · ${s} ${s===1?`page`:`pages`}`:``,r?(0,V.jsxs)(V.Fragment,{children:[` · pushed `,(0,V.jsx)(`span`,{className:`relative z-10`,children:(0,V.jsx)(Ox,{value:r})})]}):null]}):`Nothing pushed yet`})]}),i.length?(0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,"data-sw-project-stats":!0,children:[(0,V.jsxs)(H,{tone:c?`accent`:`neutral`,className:`gap-1 tabular-nums`,children:[(0,V.jsx)(vt,{size:12,"aria-hidden":`true`}),c?`${c} open ${c===1?`comment`:`comments`}`:`No open comments`]}),l?(0,V.jsxs)(H,{tone:`warn`,className:`gap-1 tabular-nums`,children:[(0,V.jsx)(kn,{size:12,"aria-hidden":`true`}),l,` `,l===1?`needs`:`need`,` a person`]}):null]}):null,(0,V.jsxs)(`div`,{className:`relative z-10 mt-4 flex flex-wrap gap-2 pt-1`,children:[(0,V.jsx)(J,{asChild:!0,size:`touch`,variant:`default`,className:`lg:h-9`,children:(0,V.jsxs)(`a`,{href:e.boardUrl,"data-sw-open-board":e.name,children:[`Open board `,(0,V.jsx)(re,{size:15,"aria-hidden":`true`})]})}),t?(0,V.jsx)(J,{asChild:!0,size:`touch`,variant:`secondary`,className:`lg:h-9`,children:(0,V.jsxs)(ix,{to:`/w/${n}/projects/${e.id}`,"data-sw-manage-project":e.name,children:[(0,V.jsx)(en,{size:15,"aria-hidden":`true`}),` Tokens and sharing`]})}):null]})]})]})}function tw({mode:e}){return e===`comment`?(0,V.jsxs)(H,{tone:`accent`,className:`px-2 py-0.5 text-[11px]`,children:[(0,V.jsx)(vt,{size:11,"aria-hidden":`true`}),` Guests comment`]}):(0,V.jsxs)(H,{tone:`neutral`,className:`px-2 py-0.5 text-[11px]`,children:[(0,V.jsx)(Fe,{size:11,"aria-hidden":`true`}),` View only`]})}function nw({share:e,projectId:t,onClose:n}){let{workspaceId:r}=qE(),i=px(),a=zb(r,`/projects/${t}/shares/${e.id}/guests`),o=yx(a),s=_x(),c=o.data?.guests||[];return(0,V.jsx)(Ty,{open:!0,onClose:n,title:`Guests of "${e.name}"`,description:`One row per browser that opened the link`,size:`md`,children:(0,V.jsxs)(`div`,{className:`px-5 py-4`,"data-sw-guest-list":!0,children:[o.loading&&!o.data?(0,V.jsx)(Px,{}):null,o.error?(0,V.jsx)(Fx,{error:o.error,onRetry:o.reload}):null,o.data&&!c.length?(0,V.jsx)(`p`,{className:`text-sm text-muted`,children:`Nobody has opened this link yet.`}):null,c.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:c.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-2.5`,"data-sw-guest":e.name,"data-sw-guest-status":e.status,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.name}),e.status===`active`?null:(0,V.jsx)(H,{tone:`neutral`,className:`px-2 py-0.5 text-[11px]`,children:e.status===`ended`?`Ended`:`Expired`})]}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,children:[[e.device,e.ipPrefix].filter(Boolean).join(` · `),e.device||e.ipPrefix?` · `:``,`Opened `,(0,V.jsx)(Ox,{value:e.createdAt}),` · Last seen`,` `,(0,V.jsx)(Ox,{value:e.lastSeenAt})]})]}),e.status===`active`?(0,V.jsx)(J,{size:`touch`,variant:`danger`,className:`lg:h-8`,disabled:s.busy,"data-sw-end-guest":e.name,onClick:()=>s.run(async()=>{await X.delete(`${a}/${e.id}`),i(`Ended ${e.name}`),await o.reload()}),children:`End this guest`}):null]},e.id))}):null,(0,V.jsx)(Tx,{error:s.error}),(0,V.jsx)(`p`,{className:`mt-3 text-xs text-muted`,children:`Ending a guest signs that browser out at once; their comments stay. They can open the link again while it works: revoke the link to stop everyone.`})]})})}function rw({shares:e,onChanged:t,projectId:n}){let{workspaceId:r,data:i}=qE(),a=px(),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(null),u=!!i?.features?.guestSessions,d=_x();return e.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`ul`,{className:`divide-y divide-line`,"data-sw-share-list":!0,children:e.map(e=>(0,V.jsxs)(`li`,{className:`grid gap-2 px-4 py-3 sm:px-5 md:grid-cols-[1.6fr_1fr_1fr_auto] md:items-center`,"data-sw-share":e.name,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.name}),(0,V.jsx)(tw,{mode:e.mode}),e.includeChecks?(0,V.jsx)(H,{tone:`neutral`,className:`px-2 py-0.5 text-[11px]`,children:`Checks included`}):null,e.passcode?(0,V.jsxs)(H,{tone:`neutral`,className:`px-2 py-0.5 text-[11px]`,children:[(0,V.jsx)(st,{size:11,"aria-hidden":`true`}),` Passcode`]}):null,e.status===`active`?null:(0,V.jsx)(H,{tone:`neutral`,className:`px-2 py-0.5 text-[11px]`,children:e.status===`revoked`?`Revoked`:`Expired`})]}),(0,V.jsxs)(`p`,{className:`mt-1 text-xs text-muted`,children:[`By `,e.createdBy?e.createdBy.displayName||`@${e.createdBy.handle}`:`unknown`,` ·`,` `,(0,V.jsx)(Ox,{value:e.createdAt})]})]}),(0,V.jsxs)(`div`,{className:`text-xs text-muted`,children:[(0,V.jsxs)(`p`,{children:[`Opened `,e.opens,` `,e.opens===1?`time`:`times`]}),(0,V.jsxs)(`p`,{className:`mt-0.5`,children:[`Last `,(0,V.jsx)(Ox,{value:e.lastUsedAt,empty:`never`})]})]}),(0,V.jsx)(`div`,{className:`text-xs text-muted`,children:e.status===`revoked`?(0,V.jsx)(Ox,{value:e.revokedAt,prefix:`Revoked `}):(0,V.jsx)(Ox,{value:e.expiresAt,prefix:e.status===`expired`?`Expired `:`Expires `})}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:justify-end`,children:[u&&(n||e.projectId)?(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:()=>l(e),className:`lg:h-8`,"data-sw-share-guests":e.name,children:[(0,V.jsx)(Nn,{size:14,"aria-hidden":`true`}),` Guests`]}):null,e.status===`active`?(0,V.jsx)(J,{size:`touch`,variant:`danger`,onClick:()=>s(e),className:`lg:h-8`,"data-sw-revoke-share":e.name,children:`Revoke`}):null]})]},e.id))}),(0,V.jsx)(Ix,{open:!!o,onClose:()=>s(null),title:`Revoke "${o?.name}"?`,confirmLabel:`Revoke link`,tone:`danger`,busy:d.busy,error:d.error,onConfirm:()=>d.run(async()=>{await X.delete(zb(r,`/projects/${n||o.projectId}/shares/${o.id}`)),s(null),a(`Share link revoked`),await t()}),children:(0,V.jsx)(`p`,{children:`The link stops working at once, including for anyone who has the board open now. Their comments stay.`})}),c?(0,V.jsx)(nw,{share:c,projectId:n||c.projectId,onClose:()=>l(null)}):null]}):(0,V.jsx)(Ly,{icon:at,title:`No share links`,children:`Share links let people outside the workspace see this project's boards, and comment as guests if you allow it.`})}function iw({open:e,onClose:t,project:n,onCreated:r}){let{workspaceId:i,data:a}=qE(),o=a.features.shareDays,[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(`view`),[d,f]=(0,O.useState)(`7`),[p,m]=(0,O.useState)(``),[h,g]=(0,O.useState)(!1),{run:_,busy:v,error:y,setError:b}=_x(),[x,S]=Nx(e,()=>{c(``),u(`view`),f(`7`),m(``),g(!1),b(null)});return(0,V.jsx)(Mx,{open:e,onClose:t,busy:v,result:x,title:`Share ${n.name}`,resultTitle:`Share link created`,doneProps:{"data-sw-share-done":!0},renderResult:e=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Q,{tone:`warn`,title:`Copy it now: it is shown once`,children:[`Anyone with this link`,e.share.passcode?` and the passcode`:``,` can`,` `,e.share.mode===`comment`?`see and comment on`:`see`,` this project's boards until `,(0,V.jsx)(Ox,{value:e.share.expiresAt}),`.`,e.share.passcode?` Send the passcode separately.`:``]}),(0,V.jsx)(kx,{value:e.url,testId:`share`})]}),children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_(async()=>{let e=await X.post(zb(i,`/projects/${n.id}/shares`),{name:s,mode:l,expiresInDays:Number(d),includeChecks:h,...p?{passcode:p}:{}});S(e),await r?.()})},className:`space-y-4 px-5 py-4`,children:[(0,V.jsx)($,{label:`Name`,hint:`For you: who it is for. Guests do not see it.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:s,onChange:e=>c(e.target.value),maxLength:60,placeholder:`For the agency`,"data-sw-share-label":!0})}),(0,V.jsxs)(`fieldset`,{children:[(0,V.jsx)(`legend`,{className:`mb-1.5 block text-[13px] font-medium text-fg`,children:`Guests can`}),(0,V.jsx)(lb,{label:`Guests can`,value:l,onChange:u,className:`w-full`,itemClassName:`h-11 px-3 lg:h-9`,options:[{id:`view`,label:`View`},{id:`comment`,label:`View and comment`}]}),(0,V.jsx)(`p`,{className:`mt-1.5 text-xs text-muted`,children:l===`comment`?`Guests add comments and replies, signed "<name> (guest)". They cannot resolve, edit or delete, and their @mentions do nothing.`:`Guests see the boards and comments, and change nothing.`})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(cb,{size:`touch`,pressed:h,onPressedChange:g,"data-sw-share-checks":!0,children:`Include page checks`}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:h?`Guests can read every retained check report in this project, including history, metrics and findings. Revoking this link ends access.`:`Check reports stay private. Turn this on only when guests should see metrics, findings and report history.`})]}),(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,V.jsx)($,{label:`Expires after`,children:e=>(0,V.jsxs)(Vy,{value:d,onValueChange:f,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full`,...e,"data-sw-share-expiry":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:o.map(e=>(0,V.jsx)(Yy,{value:String(e),children:Ab(e)},e))})]})}),(0,V.jsx)($,{label:`Passcode (optional)`,hint:`4 to 64 characters.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,type:`password`,value:p,onChange:e=>m(e.target.value),maxLength:64,autoComplete:`new-password`,"data-sw-share-passcode-input":!0})})]}),(0,V.jsx)(Tx,{error:y}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:t,disabled:v,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,disabled:v||p&&p.length<4,className:`lg:h-10`,"data-sw-share-create":!0,children:[v?(0,V.jsx)(Y,{}):null,` Create link`]})]})]})})}function aw({isAdmin:e}){let{workspaceId:t}=qE();return(0,V.jsx)(Q,{tone:`info`,title:`Share links are off in this workspace`,action:e?(0,V.jsx)(J,{asChild:!0,size:`touch`,variant:`secondary`,className:`lg:h-8`,children:(0,V.jsx)(ix,{to:`/w/${t}/settings`,children:`Settings`})}):null,children:`An admin turns them on in Settings. Then you can share a project with people outside the workspace.`})}var ow={active:`ok`,inactive:`warn`,revoked:`neutral`,expired:`neutral`},sw={inactive:`Inactive`,revoked:`Revoked`,expired:`Expired`},cw=[`read`,`reply`,`status`,`resolve`],lw=[[`never`,`No expiry`,null],[`30`,`30 days`,30],[`90`,`90 days`,90],[`365`,`1 year`,365]];function uw(){let{workspaceId:e,data:t}=qE(),n=yx(zb(e,`/tokens`)),[r,i]=(0,O.useState)(`active`),[a,o]=(0,O.useState)(!1),s=n.data?.tokens||[],c=s.filter(e=>r===`all`?!0:r===`active`?e.status===`active`:e.status!==`active`),l=s.filter(e=>e.status===`inactive`);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`API tokens`,description:`Tokens let the CLI, CI and agents push captures and work on comments in one project.`,actions:(0,V.jsxs)(J,{variant:`default`,size:`touch`,onClick:()=>o(!0),className:`lg:h-9`,disabled:!t.projects.length,"data-sw-new-token":!0,children:[(0,V.jsx)(Rt,{size:16,"aria-hidden":`true`}),` New token`]})}),l.length?(0,V.jsx)(Q,{tone:`warn`,className:`mb-4`,title:`${l.length} ${l.length===1?`token stopped`:`tokens stopped`} working`,children:`A token works only while the person who made it is an admin or owner here. These were kept when their maker left or lost the admin role, and work again only if they come back as an admin. Revoke them, and make new ones where needed.`}):null,(0,V.jsx)(`div`,{className:`mb-3`,children:(0,V.jsx)(lb,{label:`Show tokens`,value:r,onChange:i,className:`w-full sm:inline-flex sm:w-auto`,itemClassName:`h-11 px-3 lg:h-8`,options:[{id:`active`,label:`Active`,count:s.filter(e=>e.status===`active`).length},{id:`inactive`,label:`Not working`,count:s.filter(e=>e.status!==`active`).length},{id:`all`,label:`All`,count:s.length}]})}),(0,V.jsxs)(Z,{children:[n.loading?(0,V.jsx)(Px,{}):null,n.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:n.error,onRetry:n.reload})}):null,!n.loading&&!n.error?c.length?(0,V.jsx)(fw,{tokens:c,onChanged:n.reload,showProject:!0}):(0,V.jsx)(Ly,{icon:qe,title:r===`active`?`No active tokens`:`Nothing here`,children:t.projects.length?`Make a token for a project to push captures or let an agent read comments.`:`Create a project first.`}):null]}),(0,V.jsx)(pw,{open:a,onClose:()=>o(!1),projects:t.projects,onCreated:n.reload})]})}function dw({scopes:e}){return(0,V.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.map(e=>(0,V.jsx)(H,{tone:e===`push`?`warn`:`neutral`,className:`px-1.5 py-0.5 text-[11px]`,children:e},e))})}function fw({tokens:e,onChanged:t,showProject:n=!1}){let{workspaceId:r}=qE(),i=px(),[a,o]=(0,O.useState)(null),s=_x(),[c,l]=(0,O.useState)(null),u=_x(),d=c?.name.trim()||``,f=()=>u.run(async()=>{await X.patch(zb(r,`/projects/${c.token.projectId}/tokens/${c.token.id}`),{name:d}),l(null),i(`Token renamed`),await t()});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`ul`,{className:`divide-y divide-line`,"data-sw-token-list":!0,children:e.map(e=>(0,V.jsxs)(`li`,{className:`grid gap-2 px-4 py-3 sm:px-5 md:grid-cols-[1.6fr_1fr_1fr_auto] md:items-center`,"data-sw-token":e.name,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.name}),(0,V.jsxs)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-[11px] text-muted`,children:[e.prefix,`…`]}),e.status===`active`?null:(0,V.jsx)(H,{tone:ow[e.status],className:`px-2 py-0.5 text-[11px]`,children:sw[e.status]||e.status})]}),(0,V.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-xs text-muted`,children:[n?(0,V.jsx)(`span`,{className:`font-medium text-fg`,children:e.projectName}):null,(0,V.jsx)(dw,{scopes:e.scopes})]})]}),(0,V.jsxs)(`div`,{className:`text-xs text-muted`,children:[(0,V.jsxs)(`p`,{children:[`By `,e.createdBy?e.createdBy.displayName||`@${e.createdBy.handle}`:`unknown`,` `,e.createdBy?.left?(0,V.jsxs)(H,{tone:`warn`,className:`ml-1 px-1.5 py-0.5 text-[10.5px]`,"data-sw-token-orphan":!0,children:[(0,V.jsx)(Cn,{size:10,"aria-hidden":`true`}),` Left the workspace`]}):e.status===`inactive`?(0,V.jsxs)(H,{tone:`warn`,className:`ml-1 px-1.5 py-0.5 text-[10.5px]`,"data-sw-token-orphan":!0,children:[(0,V.jsx)(Cn,{size:10,"aria-hidden":`true`}),` No longer an admin`]}):null]}),(0,V.jsxs)(`p`,{className:`mt-0.5`,children:[`Made `,(0,V.jsx)(Ox,{value:e.createdAt})]})]}),(0,V.jsxs)(`div`,{className:`text-xs text-muted`,children:[(0,V.jsxs)(`p`,{children:[`Last used `,(0,V.jsx)(Ox,{value:e.lastUsedAt,empty:`never`})]}),(0,V.jsx)(`p`,{className:`mt-0.5`,children:e.expiresAt?(0,V.jsx)(Ox,{value:e.expiresAt,prefix:e.status===`expired`?`Expired `:`Expires `}):`No expiry`})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 md:justify-end`,children:[e.status===`active`||e.status===`inactive`?(0,V.jsxs)(J,{size:`touch`,onClick:()=>{u.setError(null),l({token:e,name:e.name})},className:`lg:h-8`,"data-sw-rename-token":e.name,children:[(0,V.jsx)(It,{size:13,"aria-hidden":`true`}),` Rename`]}):null,e.status===`active`||e.status===`inactive`?(0,V.jsx)(J,{size:`touch`,variant:`danger`,onClick:()=>o(e),className:`lg:h-8`,"data-sw-revoke-token":e.name,children:`Revoke`}):null]})]},e.id))}),(0,V.jsx)(Ix,{open:!!a,onClose:()=>o(null),title:`Revoke "${a?.name}"?`,confirmLabel:`Revoke token`,tone:`danger`,busy:s.busy,error:s.error,onConfirm:()=>s.run(async()=>{await X.delete(zb(r,`/projects/${a.projectId}/tokens/${a.id}`)),o(null),i(`Token revoked`),await t()}),children:(0,V.jsx)(`p`,{children:`Anything using it (CI, an agent, a teammate's machine) stops working at once. This cannot be undone.`})}),(0,V.jsx)(Ty,{open:!!c,onClose:()=>u.busy?null:l(null),title:`Rename token`,description:`An agent that uses this token signs its replies with this name.`,wrapDescription:!0,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:`touch`,className:`lg:h-9`,onClick:()=>l(null),disabled:u.busy,children:`Cancel`}),(0,V.jsx)(J,{size:`touch`,variant:`default`,className:`lg:h-9`,onClick:f,disabled:u.busy||!d||d===c?.token.name,"data-sw-rename-token-save":!0,children:u.busy?`Saving...`:`Save`})]}),children:(0,V.jsxs)(`form`,{className:`space-y-2 p-5`,onSubmit:e=>{e.preventDefault(),d&&d!==c?.token.name&&!u.busy&&f()},children:[(0,V.jsx)(`label`,{htmlFor:`sw-rename-token`,className:`block text-xs font-medium text-fg`,children:`Name`}),(0,V.jsx)(zy,{id:`sw-rename-token`,size:`touch`,className:`lg:h-9`,value:c?.name||``,maxLength:60,onChange:e=>l(t=>t&&{...t,name:e.target.value}),"data-sw-rename-token-input":!0}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`What it already wrote keeps the old name. The token itself, its scopes and its expiry do not change.`}),u.error?(0,V.jsx)(`p`,{className:`text-sm text-bad`,role:`alert`,children:u.error}):null]})})]})}function pw({open:e,onClose:t,projects:n,projectId:r=null,onCreated:i,defaultScopes:a=cw}){let{workspaceId:o}=qE(),[s,c]=(0,O.useState)(r||``),[l,u]=(0,O.useState)(``),[d,f]=(0,O.useState)(a),[p,m]=(0,O.useState)(`90`),{run:h,busy:g,error:_,setError:v}=_x(),[y,b]=Nx(e,()=>{c(r||n[0]?.id||``),u(``),f(a),m(`90`),v(null)}),x=e=>f(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),S=(0,O.useMemo)(()=>n.find(e=>e.id===s)?.name,[n,s]);return(0,V.jsx)(Mx,{open:e,onClose:t,busy:g,result:y,title:`New API token`,resultTitle:`Token created`,doneProps:{"data-sw-token-done":!0},renderResult:e=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Q,{tone:`warn`,title:`Copy it now: it is shown once`,children:`Store it as SHAPEWALL_TOKEN in an environment variable or your CI secrets, never in a repository.`}),(0,V.jsx)(kx,{value:e.token,testId:`token`}),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`p`,{className:`mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted`,children:[(0,V.jsx)(hn,{size:13,"aria-hidden":`true`}),` Push from your project folder (this command includes the token)`]}),(0,V.jsx)(kx,{value:`SHAPEWALL_TOKEN=${e.token} shapewall push --remote ${Bb()}`,testId:`token-command`}),(0,V.jsxs)(`p`,{className:`mt-2 text-xs text-muted`,children:[`On your own machine, `,(0,V.jsxs)(`code`,{className:`font-mono text-fg`,children:[`shapewall login --remote `,Bb()]}),` makes and stores a token for you instead.`]})]})]}),children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h(async()=>{let e=lw.find(([e])=>e===p)[2],t=await X.post(zb(o,`/projects/${s}/tokens`),{name:l,scopes:d,...e?{expiresInDays:e}:{}});b(t),await i?.()})},className:`space-y-4 px-5 py-4`,children:[r?null:(0,V.jsx)($,{label:`Project`,children:e=>(0,V.jsxs)(Vy,{value:s,onValueChange:c,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full`,...e,"data-sw-token-project":!0,children:(0,V.jsx)(Uy,{placeholder:`Pick a project`})}),(0,V.jsx)(qy,{children:n.map(e=>(0,V.jsx)(Yy,{value:e.id,children:e.name},e.id))})]})}),(0,V.jsx)($,{label:`Name`,hint:`Where it is used, like GitHub Actions or Ada's agent.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:l,onChange:e=>u(e.target.value),maxLength:60,placeholder:`CI`,"data-sw-token-name":!0})}),(0,V.jsxs)(`fieldset`,{children:[(0,V.jsxs)(`legend`,{className:`mb-1.5 block text-[13px] font-medium text-fg`,children:[`What it can do`,S?` in ${S}`:``]}),(0,V.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:Ob.map(([e,t,n])=>(0,V.jsxs)(cb,{pressed:d.includes(e),onPressedChange:()=>x(e),size:`touch`,className:`h-auto min-h-11 w-full flex-col items-start justify-center gap-0 px-3 py-2 text-left whitespace-normal`,"data-sw-scope":e,children:[(0,V.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:t}),(0,V.jsx)(`span`,{className:`text-xs font-normal text-muted`,children:n})]},e))})]}),(0,V.jsx)($,{label:`Expires`,children:e=>(0,V.jsxs)(Vy,{value:p,onValueChange:m,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full sm:w-56`,...e,"data-sw-token-expiry":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:lw.map(([e,t])=>(0,V.jsx)(Yy,{value:e,children:t},e))})]})}),(0,V.jsx)(Tx,{error:_}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:t,disabled:g,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,disabled:g||!l.trim()||!d.length||!s,className:`lg:h-10`,"data-sw-token-create":!0,children:[g?(0,V.jsx)(Y,{}):null,` Create token`]})]})]})})}var mw=[[`dailyClaims`,`Runs per day (UTC)`,1e4,50],[`maxOpenClaims`,`Runs in progress at once`,100,3],[`dailyTurns`,`Chat turns per day (UTC)`,1e5,200]];function hw({workspaceId:e,projectId:t}){let n=zb(e,`/projects/${t}/agent`),r=yx(n);return(0,V.jsxs)(Z,{"data-sw-agent-policy":!0,children:[(0,V.jsx)(Sx,{icon:ae,title:`Agent policy`,description:`Who can send comments to an agent in this project, and how much the agent may run.`}),r.loading?(0,V.jsx)(Px,{}):r.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:r.error,onRetry:r.reload})}):r.data?(0,V.jsx)(gw,{policy:r.data.policy,url:n,onSaved:r.reload},JSON.stringify(r.data.policy)):null]})}function gw({policy:e,url:t,onSaved:n}){let r=px(),[i,a]=(0,O.useState)(e),[o,s]=(0,O.useState)(e.trustedHandles.join(`, `)),[c,l]=(0,O.useState)(()=>Object.fromEntries(mw.map(([t,,,n])=>[t,String(e[t]??n)]))),[u,d]=(0,O.useState)(JSON.stringify(e.boards||{},null,2)),f=_x(),p=(e,t)=>a({...i,[e]:t}),m=(e,t)=>{let n=c[e].trim(),r=Number(n);return n!==``&&Number.isInteger(r)&&r>=0&&r<=t?null:`A whole number from 0 to ${t}.`},h=null;try{let e=JSON.parse(u);(!e||typeof e!=`object`||Array.isArray(e))&&(h=`This must be a JSON object, such as {}.`)}catch{h=`This is not valid JSON.`}let g=!!h||mw.some(([e,,t])=>m(e,t));return(0,V.jsxs)(`form`,{className:`space-y-4 px-4 py-4 sm:px-5`,onSubmit:e=>{e.preventDefault(),g||f.run(async()=>{await X.put(t,{...i,...Object.fromEntries(mw.map(([e])=>[e,Number(c[e])])),trustedHandles:o.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),boards:JSON.parse(u)}),r(`Agent policy saved`),await n()})},noValidate:!0,children:[(0,V.jsx)($,{label:`Trusted handles (comma separated)`,hint:`People whose comments go to the agent, besides the roles below.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:o,onChange:e=>s(e.target.value),autoCapitalize:`none`,spellCheck:!1,placeholder:`ada, sam`})}),(0,V.jsxs)(`fieldset`,{children:[(0,V.jsx)(`legend`,{className:`mb-1.5 block text-ui font-medium text-fg`,children:`Trusted roles`}),(0,V.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[`member`,`admin`,`owner`].map(e=>(0,V.jsx)(Rx,{checked:i.trustedRoles.includes(e),onChange:t=>p(`trustedRoles`,t?[...i.trustedRoles,e]:i.trustedRoles.filter(t=>t!==e)),children:wb[e]||e},e))})]}),(0,V.jsx)(`div`,{className:`grid items-start gap-4 sm:grid-cols-2`,children:mw.map(([e,t,n])=>(0,V.jsx)($,{label:t,hint:e===`dailyTurns`?`0 stops chat with connected agents.`:`0 stops new runs.`,error:m(e,n),children:t=>(0,V.jsx)(zy,{...t,size:`touch`,type:`number`,inputMode:`numeric`,min:`0`,max:n,value:c[e],onChange:t=>l({...c,[e]:t.target.value})})},e))}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(Rx,{checked:i.onlyMentions,onChange:e=>p(`onlyMentions`,e),children:`Only comments that mention @agent`}),(0,V.jsx)(Rx,{checked:i.approveNonAdmin,onChange:e=>p(`approveNonAdmin`,e),children:`An admin approves runs that other people ask for`})]}),(0,V.jsxs)(Z_,{defaultOpen:Object.keys(e.boards||{}).length>0,children:[(0,V.jsx)(Q_,{className:`-mx-2 w-auto`,"data-sw-agent-overrides-toggle":!0,children:`Advanced: different rules for one board`}),(0,V.jsx)($_,{children:(0,V.jsx)(`div`,{className:`pt-2`,children:(0,V.jsx)($,{label:`Per-board rules (JSON)`,hint:`Keyed by board id. Leave it as {} unless one board needs different rules from the project.`,error:h,children:e=>(0,V.jsx)(ob,{...e,size:`touch`,className:`font-mono lg:text-sm`,rows:4,spellCheck:!1,value:u,onChange:e=>d(e.target.value)})})})})]}),(0,V.jsx)(Q,{children:`The agent never acts on guest comments or its own comments. Editing a comment clears its approval. Saving asks for your passkey.`}),(0,V.jsx)(Tx,{error:f.error}),(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,className:`lg:h-9`,disabled:f.busy||g,children:[f.busy?(0,V.jsx)(Y,{}):null,` Save agent policy`]})})]})}function _w({label:e,htmlFor:t,hint:n,problem:r,children:i,...a}){return(0,V.jsxs)(`div`,{className:`space-y-1`,...a,children:[t?(0,V.jsx)(`label`,{htmlFor:t,className:`block text-xs font-medium text-fg`,children:e}):(0,V.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:e}),i,r?(0,V.jsx)(`p`,{id:t?`${t}-problem`:void 0,className:`text-xs text-bad`,role:`alert`,"data-sw-settings-problem":`true`,children:r}):n?(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:n}):null]})}function vw({text:e,label:t,touch:n}){let[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(!1),s=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!r)return;let e=window.setTimeout(()=>i(!1),1500);return()=>window.clearTimeout(e)},[r]),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-line bg-sunken pl-2`,"data-sw-settings-export":t,children:[(0,V.jsx)(`code`,{ref:s,className:`min-w-0 flex-1 overflow-x-auto py-1.5 font-mono text-[11.5px] whitespace-nowrap text-fg`,children:e}),(0,V.jsx)(J,{variant:`ghost`,size:n?`icon`:`icon-sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),o(!1),i(!0)}catch{if(s.current){let e=document.createRange();e.selectNodeContents(s.current);let t=window.getSelection();t.removeAllRanges(),t.addRange(e)}o(!0)}},"aria-label":r?`Copied`:`Copy the ${t} line`,children:r?(0,V.jsx)(ue,{size:14,"aria-hidden":`true`}):(0,V.jsx)(Te,{size:14,"aria-hidden":`true`})})]}),a?(0,V.jsx)(`p`,{className:`mt-1 text-xs text-muted`,role:`status`,children:`This browser did not allow copying. The line is selected: press Ctrl+C (or long-press) to copy it.`}):null]})}function yw({children:e}){return(0,V.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-fg`,"data-sw-settings-override":`true`,children:[(0,V.jsx)(Cn,{size:13,className:`mt-px shrink-0 text-warn`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{children:e})]})}function bw({items:e,keyVar:t,onCancel:n,onConfirm:r,busy:i,touch:a,confirmLabel:o=`Allow and save`,children:s=null,blocked:c=!1}){let l=a?`touch`:`md`;return(0,V.jsxs)(Ty,{open:!!e,onClose:()=>i?null:n(),title:`Allow this?`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:l,onClick:n,disabled:i,children:`Cancel`}),(0,V.jsx)(J,{size:l,variant:`default`,onClick:r,disabled:i||c,"data-sw-settings-confirm":`true`,children:i?`Saving...`:o})]}),children:[e?s:null,(0,V.jsx)(`div`,{className:`space-y-3 p-5 text-sm`,"data-sw-settings-confirm-list":`true`,children:(e||[]).map(e=>e.kind===`command`?(0,V.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-confirm-item":`command`,children:[(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 font-medium text-fg`,children:[(0,V.jsx)(hn,{size:14,"aria-hidden":`true`}),` Run this command on this machine, as you`]}),(0,V.jsx)(`code`,{className:`block rounded-md border border-line bg-sunken p-2 font-mono text-xs break-all text-fg`,children:e.command}),e.projectRoot?(0,V.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Source folder for every board in this project:`,` `,(0,V.jsx)(`code`,{className:`font-mono break-all`,"data-sw-settings-confirm-root":!0,children:e.projectRoot})]}):null,(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`Shapewall starts it for each chat thread, with your login and a small environment. Anyone who can chat on this board drives it. Only allow a command you installed yourself.`})]},`command:${e.command}`):(0,V.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-confirm-item":`host`,children:[(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 font-medium text-fg`,children:[(0,V.jsx)(qe,{size:14,"aria-hidden":`true`}),` Send your API key to `,e.host]}),(0,V.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Every chat request carries the key in `,(0,V.jsx)(`code`,{className:`font-mono`,children:e.keyVar||t}),` to`,` `,(0,V.jsx)(`span`,{className:`font-medium text-fg`,children:e.host}),`. Allow it only if you trust that host with the key.`]})]},`host:${e.keyVar}@${e.host}`))})]})}function xw({result:e}){if(!e)return null;if(e.note)return(0,V.jsxs)(`p`,{className:`flex items-start gap-1.5 rounded-md border border-line bg-surface-2/60 p-3 text-xs text-muted`,role:`status`,"data-sw-settings-test-result":`note`,children:[(0,V.jsx)(Ge,{size:14,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{children:e.note})]});let t=e.ok?ye:xe;return(0,V.jsxs)(`div`,{className:B(`rounded-md border p-3 text-xs`,e.ok?`border-ok/40 bg-ok/10`:`border-bad/40 bg-bad/10`),role:`status`,"data-sw-settings-test-result":e.ok?`ok`:`failed`,children:[(0,V.jsxs)(`p`,{className:B(`flex items-start gap-1.5 font-medium`,e.ok?`text-fg`:`text-bad`),children:[(0,V.jsx)(t,{size:14,className:B(`mt-px shrink-0`,e.ok?`text-ok`:`text-bad`),"aria-hidden":`true`}),(0,V.jsx)(`span`,{children:e.message})]}),e.details?.length?(0,V.jsx)(`ul`,{className:`mt-1.5 list-disc space-y-0.5 pl-5 text-muted`,children:e.details.map(e=>(0,V.jsx)(`li`,{children:e},e))}):null]})}var Sw=2097152,Cw=`upload:pending`,ww=(e={})=>({name:e.label||``,icon:e.icon||null,tint:e.tint||null,png:null});function Tw(e,t){let n={};return t.name.trim()!==(e.label||``)&&(n.name=t.name.trim()),t.icon!==Cw&&t.icon!==(e.icon||null)&&(n.icon=t.icon),t.tint!==(e.tint||null)&&(n.tint=t.tint),Object.keys(n).length?n:null}async function Ew(e,t,n){let r=null,i=Tw(t,n);return i&&(r=await ry.post(`/api/agent/settings/identity`,{id:e,...i})),n.icon===Cw&&n.png&&(r=await ry.post(`/api/agent/settings/identity/icon`,{id:e,png:n.png})),r}function Dw({name:e,checked:t,onChange:n,label:r,children:i,className:a,...o}){return(0,V.jsxs)(`label`,{className:B(`relative inline-flex h-11 w-11 cursor-pointer items-center justify-center rounded-xl border-2 border-transparent`,`has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-1 has-[:focus-visible]:outline-accent`,t?`border-accent bg-accent/10`:`hover:border-line-strong`,a),title:r,...o,children:[(0,V.jsx)(`input`,{type:`radio`,name:e,className:`sr-only`,checked:t,onChange:n,"aria-label":r}),i]})}function Ow({value:e,onChange:t,label:n,logo:r=null,upload:i=!0,disabled:a=!1}){let o=(0,O.useId)(),s=(0,O.useRef)(null),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(``),f=Bi(r),p=e.png?`data:image/png;base64,${e.png}`:null,m=e.icon===Cw||Ii(e.icon),h=!m&&(e.icon||!f),g=async n=>{if(n){l(!0),d(``);try{let r=await jC(n,{maxBytes:Sw,maxLabel:`2 MB`});t({...e,icon:Cw,png:r})}catch(e){d(e.message||`This image could not be read.`)}finally{l(!1),s.current&&(s.current.value=``)}}},_=n=>t({...e,icon:n,png:null});return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`p`,{className:`text-xs font-medium text-fg`,id:`${o}-icons`,children:`Icon`}),(0,V.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`${o}-icons`,className:`flex flex-wrap gap-1`,"data-sw-agent-icon-options":!0,children:[(0,V.jsx)(Dw,{name:`${o}-icon`,checked:!e.icon,onChange:()=>_(null),label:f?`Default: the ${f.name} mark`:`Default: initials`,"data-sw-agent-icon-option":`default`,children:(0,V.jsx)(aa,{label:n,logo:r,tint:e.tint,size:`lg`,className:`h-9 w-9`})}),na.map(t=>(0,V.jsx)(Dw,{name:`${o}-icon`,checked:e.icon===t,onChange:()=>_(t),label:ta[t].name,"data-sw-agent-icon-option":t,children:(0,V.jsx)(aa,{label:n,icon:t,tint:e.tint,size:`lg`,className:`h-9 w-9`})},t)),m?(0,V.jsx)(Dw,{name:`${o}-icon`,checked:!0,onChange:()=>{},label:`Your picture`,"data-sw-agent-icon-option":`upload`,children:(0,V.jsx)(aa,{label:n,icon:e.icon===Cw?null:e.icon,src:p,size:`lg`,className:`h-9 w-9`})}):null]}),i?(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 pt-1`,children:[(0,V.jsxs)(J,{size:`touch`,className:`lg:h-8`,disabled:c||a,onClick:()=>s.current?.click(),children:[c?(0,V.jsx)(Y,{}):(0,V.jsx)(Ue,{size:14,"aria-hidden":`true`}),` Upload a picture`]}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`PNG, JPEG or WebP, up to 2 MB. Cropped to a square.`}),(0,V.jsx)(`input`,{ref:s,type:`file`,accept:`image/png,image/jpeg,image/webp`,className:`hidden`,"aria-label":`Choose a picture for the icon`,onChange:e=>void g(e.target.files?.[0]),"data-sw-agent-icon-upload":!0})]}):null,u?(0,V.jsx)(`p`,{className:`text-xs text-bad`,role:`alert`,"data-sw-agent-icon-problem":!0,children:u}):null]}),h?(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`p`,{className:`text-xs font-medium text-fg`,id:`${o}-tints`,children:`Colour`}),(0,V.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`${o}-tints`,className:`flex flex-wrap gap-1`,"data-sw-agent-tint-options":!0,children:[(0,V.jsx)(Dw,{name:`${o}-tint`,checked:!e.tint,onChange:()=>t({...e,tint:null}),label:`Default colour`,"data-sw-agent-tint-option":`default`,children:(0,V.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center rounded-full border border-line bg-surface-2 text-muted`,children:(0,V.jsx)(Kt,{size:13,"aria-hidden":`true`})})}),ji.map(n=>(0,V.jsx)(Dw,{name:`${o}-tint`,checked:e.tint===n,onChange:()=>t({...e,tint:n}),label:Zi[n],"data-sw-agent-tint-option":n,children:(0,V.jsx)(`span`,{className:`h-7 w-7 rounded-full`,style:{background:Xi(n)}})},n))]})]}):null]})}function kw({value:e,onChange:t,builtIn:n=``,touch:r=!1,id:i,problem:a=null,disabled:o=!1,hint:s=null}){return(0,V.jsx)(_w,{label:`Name`,htmlFor:i,problem:a,hint:s||(n?`Shown in chats, on its replies and on Fix buttons. Leave it empty for "${n}".`:`Shown in chats, on its replies and on Fix buttons.`),children:(0,V.jsx)(zy,{id:i,size:r?`touch`:`sm`,value:e.name,onChange:n=>t({...e,name:n.target.value}),placeholder:n||`Agent`,maxLength:40,autoComplete:`off`,spellCheck:!1,disabled:o,"aria-invalid":a?`true`:void 0,"aria-describedby":a?`${i}-problem`:void 0,"data-sw-agent-name-input":!0})})}function Aw(e){let{problem:t}=Fi(e);return t?/control/.test(t)?`One line of plain text, without control characters.`:`At most 40 characters.`:null}function jw({value:e,onChange:t,builtIn:n,logo:r=null,upload:i=!0,touch:a=!1,disabled:o=!1}){let s=(0,O.useId)();return(0,V.jsxs)(`div`,{className:`space-y-3 border-b border-line px-5 pt-5 pb-4`,"data-sw-connect-identity":!0,children:[(0,V.jsx)(kw,{id:`${s}-name`,value:e,onChange:t,builtIn:n,touch:a,problem:Aw(e.name),disabled:o}),(0,V.jsxs)(`details`,{className:`group`,"data-sw-connect-icon":!0,children:[(0,V.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-2 text-xs font-medium text-fg lg:min-h-8 [&::-webkit-details-marker]:hidden`,children:[(0,V.jsx)(me,{size:13,className:`text-muted transition-transform group-open:rotate-90`,"aria-hidden":`true`}),(0,V.jsx)(aa,{label:e.name||n,icon:e.icon===Cw?null:e.icon,tint:e.tint,logo:r,size:`sm`,src:e.png?`data:image/png;base64,${e.png}`:null}),`Icon (optional)`]}),(0,V.jsx)(`div`,{className:`pt-2`,children:(0,V.jsx)(Ow,{value:e,onChange:t,label:e.name||n,logo:r,upload:i,disabled:o})})]})]})}function Mw({agent:e,upload:t=!0,touch:n=!1,waiting:r=!1,onClose:i,onSaved:a}){let o=(0,O.useId)(),[s,c]=(0,O.useState)(ww()),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)(``),p=(0,O.useRef)(null);(0,O.useEffect)(()=>{e&&(p.current=e.id,c(ww(e)),f(``))},[e]);let m=n?`touch`:`md`,h=Aw(s.name),g=e&&!e.builtIn&&!s.name.trim()?`Give it a name.`:null,_=e?!!Tw(e,s)||!!s.png:!1,v=async()=>{u(!0),f(``);try{let t=await Ew(e.id,e,s);await a?.(t),i()}catch(e){f(e.message||`It could not be saved.`)}finally{u(!1)}},y=s.png?`data:image/png;base64,${s.png}`:null;return(0,V.jsx)(Ty,{open:!!e,onClose:()=>l?null:i(),title:`Name and icon`,description:`How this agent shows on the board. It keeps running; nothing is restarted.`,wrapDescription:!0,size:`md`,onCloseAutoFocus:e=>{let t=document.querySelector(`[data-sw-agent-edit="${CSS.escape(p.current||``)}"]`);t&&(e.preventDefault(),t.focus())},footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:m,onClick:i,disabled:l,children:`Cancel`}),(0,V.jsx)(J,{size:m,variant:`default`,onClick:v,disabled:l||!_||!!(h||g),"data-sw-agent-identity-save":!0,children:l?r?`Saving when the connection test finishes...`:`Saving...`:`Save`})]}),children:(0,V.jsxs)(`form`,{className:`space-y-4 p-5`,onSubmit:e=>{e.preventDefault(),!l&&_&&!h&&!g&&v()},"data-sw-agent-identity":e?.id,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(aa,{label:s.name||e?.builtIn||e?.label,icon:s.icon===Cw?null:s.icon,tint:s.tint,logo:e?.logo,src:y,size:`xl`,"data-sw-agent-identity-preview":!0}),(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(kw,{id:`${o}-name`,value:s,onChange:c,builtIn:e?.builtIn||``,touch:n,problem:h||g,disabled:l})})]}),(0,V.jsx)(Ow,{value:s,onChange:c,label:s.name||e?.builtIn||e?.label,logo:e?.logo,upload:t,disabled:l}),r&&!d?(0,V.jsx)(`p`,{className:`text-xs text-muted`,role:`status`,"data-sw-agent-identity-waiting":!0,children:`Its connection test is still running. Save waits for it to finish, then saves.`}):null,d?(0,V.jsx)(`p`,{className:`text-xs text-bad`,role:`alert`,"data-sw-agent-identity-error":!0,children:d}):null,(0,V.jsx)(`button`,{type:`submit`,className:`hidden`,tabIndex:-1,"aria-hidden":`true`})]})})}var Nw=`https://shapewall.com/docs/hosted#agents-on-a-hosted-board`,Pw={online:`Online`,busy:`Working`,offline:`Offline`,revoked:`Revoked`},Fw={online:`ok`,busy:`accent`,offline:`neutral`,revoked:`neutral`},Iw={watcher:`Watcher (shapewall watch)`,claude:`Claude Code`,codex:`Codex`,goose:`goose`,gemini:`Gemini CLI`,custom:`Another program`},Lw=[[`owner`,`Only the person who connected it`,`The default for a new agent.`],[`members`,`Named members`,`The person who connected it, and the people you choose.`],[`trusted`,`Everyone this project's agent policy trusts`,`The team case: whoever may send work to an agent here may use this one.`]],Rw=[`read`,`reply`,`status`,`claim`],zw=e=>e?.approval?.mode||`none`,Bw={none:`reads and answers only (no edits, no commands)`,ask:`makes fixes on a branch, each edit allowed by a person`,auto:`makes fixes on a branch, allowed without asking`},Vw={none:`Reads and answers`,ask:`Edits on a branch, asking every time`,auto:`Edits on a branch, allowed without asking`},Hw=e=>[e.includes(`edits`)?`edits`:null,e.includes(`commands`)?`the listed commands`:null].filter(Boolean).join(` and `),Uw=e=>[`edits`,`commands`].filter(t=>e?.approval?.rules?.[t]===`auto`),Ww=e=>e?.approval?.machine?.approvals===`owner`?`Only ${e.createdBy?Yw(e.createdBy):`the person who connected it`} answers`:`${wb[e?.approval?.answerRole||`admin`]}s and up answer`,Gw=`shapewall agent connect --approvals owner --auto edits`;function Kw(e){return!e||e.approval.autoAvailable?null:e.link?.connected?e.approval.machine.approvals===`none`?`${e.name}'s machine takes no approvals from the board, so there is nothing to allow. This is switched on on the agent's machine, never from here.`:`${e.name}'s machine did not say anything may go without asking. This is switched on on the agent's machine, never from here.`:`This agent takes comments on its own and asks before each command. Nothing here can go without asking.`}function qw({agent:e}){let t=e.approval.machine,n=[[`Approvals from the board`,t.approvals===`none`?`None. It reads and answers only.`:t.approvals===`owner`?`Only ${e.createdBy?Yw(e.createdBy):`the person who connected it`} may answer.`:`Admins of this project may answer.`,`approvals`,t.approvals],[`Commands it may ask to run`,t.commands.length?null:t.approvals===`none`?`None.`:`None. It only asks to edit files.`,`commands`,String(t.commands.length)],[`May go without asking`,t.auto.length?`${Hw(t.auto).replace(/^./,e=>e.toUpperCase())}, when the rule below says so.`:`Nothing.`,`auto`,t.auto.join(`,`)||`none`]];return(0,V.jsxs)(`section`,{className:`rounded-lg border border-line bg-surface-2/50 p-3`,"data-sw-agent-machine":t.approvals,children:[(0,V.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold text-fg`,children:[(0,V.jsx)(Ye,{size:13,"aria-hidden":`true`}),` Set on the agent's machine`]}),(0,V.jsx)(`dl`,{className:`mt-2 space-y-2 text-xs`,children:n.map(([e,n,r,i])=>(0,V.jsxs)(`div`,{className:`grid gap-x-3 gap-y-0.5 sm:grid-cols-[11rem_1fr]`,"data-sw-agent-machine-fact":r,"data-value":i,children:[(0,V.jsx)(`dt`,{className:`text-muted`,children:e}),(0,V.jsxs)(`dd`,{className:`min-w-0 text-fg`,children:[n,r===`commands`&&t.commands.length?(0,V.jsx)(`ul`,{className:`flex flex-wrap gap-1`,children:t.commands.map(e=>(0,V.jsx)(`li`,{className:`max-w-full`,children:(0,V.jsx)(`code`,{className:`block truncate rounded border border-line bg-surface px-1.5 py-0.5 font-mono text-[11px]`,children:e})},e))}):null]})]},r))}),(0,V.jsxs)(`p`,{className:`mt-2 text-xs text-muted`,children:[`These are read from the machine each time it connects. Change them there with`,` `,(0,V.jsx)(`code`,{className:`font-mono`,children:`shapewall agent connect`}),`; nothing on this page can widen them.`]})]})}function Jw({agent:e}){let t=e.link;return t?.connected?(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,"data-sw-agent-link":t.connectedAt?`open`:`closed`,children:[(0,V.jsx)(`span`,{className:`text-fg`,children:`Connected agent.`}),` `,t.chats?`Chats on the board`:`No chat`,`, `,Bw[zw(e)],t.connectedAt?(0,V.jsxs)(V.Fragment,{children:[` `,`· connected since `,(0,V.jsx)(`time`,{dateTime:t.connectedAt,children:Cb(t.connectedAt)})]}):` · link closed`,t.version?` · Shapewall ${t.version}`:``,t.policy?.audience===`owner`?` · its machine takes questions from its connector only`:``]}):null}var Yw=e=>e?.displayName||(e?.handle?`@${e.handle}`:`someone who left`);function Xw({agent:e}){return(0,V.jsx)(H,{tone:Fw[e.state]||`neutral`,className:`px-2 py-0.5 text-[11px]`,"data-sw-agent-state":e.state,children:Pw[e.state]||e.state})}function Zw({agent:e}){return e.state===`online`||e.state===`busy`?(0,V.jsx)(`span`,{children:`Listening now`}):e.lastSeenAt?(0,V.jsx)(Ox,{value:e.lastSeenAt,prefix:`Last seen `}):(0,V.jsx)(`span`,{children:`Never connected`})}function Qw({agent:e,size:t=`lg`}){return(0,V.jsx)(aa,{label:e.name,icon:e.icon,tint:e.tint,logo:e.logo,size:t})}function $w(){let{workspaceId:e,data:t}=qE(),n=yx(zb(e,`/agents`)),r=(n.data?.agents||[]).filter(e=>e.state!==`revoked`),i=new Set(r.map(e=>e.projectId)),a=t.projects.filter(e=>!i.has(e.id));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`Agents`,description:`Every agent in this workspace, the project each one serves and who may send it work.`}),(0,V.jsxs)(Z,{"data-sw-agents-overview":!0,children:[n.loading?(0,V.jsx)(Px,{}):null,n.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:n.error,onRetry:n.reload})}):null,n.data&&!n.error?r.length?(0,V.jsxs)(`div`,{role:`table`,"aria-label":`Agents in this workspace`,children:[(0,V.jsxs)(`div`,{role:`row`,className:`hidden gap-3 border-b border-line px-5 py-2 text-xs font-medium text-muted md:grid md:grid-cols-[1.5fr_1fr_1fr_1.4fr_1fr_auto]`,children:[(0,V.jsx)(`span`,{role:`columnheader`,children:`Agent`}),(0,V.jsx)(`span`,{role:`columnheader`,children:`Project`}),(0,V.jsx)(`span`,{role:`columnheader`,children:`State`}),(0,V.jsx)(`span`,{role:`columnheader`,children:`Who may send it work`}),(0,V.jsx)(`span`,{role:`columnheader`,children:`Connected by`}),(0,V.jsx)(`span`,{role:`columnheader`,className:`w-20 text-right`,children:(0,V.jsx)(`span`,{className:`sr-only`,children:`Manage`})})]}),(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:r.map(t=>(0,V.jsxs)(`li`,{role:`row`,className:`grid gap-2 px-4 py-3 text-sm sm:px-5 md:grid-cols-[1.5fr_1fr_1fr_1.4fr_1fr_auto] md:items-center md:gap-3`,"data-sw-overview-agent":t.name,"data-sw-overview-project":t.projectName,children:[(0,V.jsxs)(`div`,{role:`cell`,className:`flex min-w-0 items-center gap-2.5`,children:[(0,V.jsx)(Qw,{agent:t,size:`md`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`truncate font-medium text-fg`,children:t.name}),t.isDefault?(0,V.jsx)(H,{tone:`neutral`,className:`shrink-0 px-1.5 py-0.5 text-[10.5px]`,children:`Default`}):null]}),(0,V.jsxs)(`p`,{className:`truncate text-xs text-muted`,"data-sw-overview-kind":t.kind,children:[Iw[t.kind]||t.kind,t.machine?` on ${t.machine}`:``,t.link?.connected&&t.link.chats?` · chats`:``]})]})]}),(0,V.jsxs)(`div`,{role:`cell`,className:`min-w-0 truncate text-fg`,children:[(0,V.jsx)(`span`,{className:`mr-1 text-xs text-muted md:hidden`,children:`Project:`}),t.projectName]}),(0,V.jsxs)(`div`,{role:`cell`,className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted md:block`,children:[(0,V.jsx)(Xw,{agent:t}),(0,V.jsx)(`p`,{className:`md:mt-0.5`,children:t.link?.connectedAt?(0,V.jsxs)(`span`,{"data-sw-overview-connected":!0,children:[`since `,(0,V.jsx)(`time`,{dateTime:t.link.connectedAt,children:Cb(t.link.connectedAt)})]}):(0,V.jsx)(Zw,{agent:t})})]}),(0,V.jsxs)(`div`,{role:`cell`,className:`min-w-0 text-xs text-muted`,"data-sw-overview-audience":t.audience.kind,children:[(0,V.jsx)(`span`,{className:`mr-1 md:hidden`,children:`Takes work from:`}),(0,V.jsx)(`span`,{className:`text-fg`,children:t.audience.text})]}),(0,V.jsxs)(`div`,{role:`cell`,className:`min-w-0 truncate text-xs text-muted`,children:[(0,V.jsx)(`span`,{className:`mr-1 md:hidden`,children:`Connected by`}),Yw(t.createdBy)]}),(0,V.jsx)(`div`,{role:`cell`,className:`md:w-20 md:text-right`,children:(0,V.jsx)(ix,{to:`/w/${e}/agents/${t.projectId}`,className:`inline-flex h-11 items-center gap-1 text-sm font-medium text-accent underline-offset-2 hover:underline lg:h-auto`,"aria-label":`Manage ${t.name} in ${t.projectName}`,"data-sw-overview-manage":t.name,children:`Manage`})})]},t.id))})]}):(0,V.jsx)(Ly,{icon:ae,title:`No agents yet`,children:t.projects.length?`Open a project below to connect a machine that has its code.`:`Create a project first, then connect a machine that has its code.`}):null]}),n.data&&a.length?(0,V.jsxs)(Z,{className:`mt-5`,"data-sw-agents-without":!0,children:[(0,V.jsx)(Sx,{icon:Bt,title:`Projects without an agent`,description:`Comments sent to an agent in these projects wait until one is connected.`}),(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:a.map(t=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-2.5 text-sm sm:px-5`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:t.name}),(0,V.jsx)(ix,{to:`/w/${e}/agents/${t.id}`,className:`inline-flex h-11 items-center gap-1 text-sm font-medium text-accent underline-offset-2 hover:underline lg:h-auto`,"data-sw-overview-connect":t.name,children:`Connect an agent`})]},t.id))})]}):null]})}function eT({projectId:e}){let{workspaceId:t,data:n,role:r}=qE(),i=n.projects.find(t=>t.id===e),a=zb(t,`/projects/${e}/agents`),o=yx(i?a:null),s=px(),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(null),[f,p]=(0,O.useState)(null),[m,h]=(0,O.useState)(null),[g,_]=(0,O.useState)(!1),v=_x(),y=_x();if((0,O.useEffect)(()=>{let e=window.setInterval(()=>{document.visibilityState===`visible`&&o.reload()},2e4);return()=>window.clearInterval(e)},[o.reload]),!i)return(0,V.jsxs)(Z,{className:`p-8 text-center`,children:[(0,V.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:`Project not found`}),(0,V.jsx)(ix,{to:`/w/${t}/agents`,className:`mt-3 inline-block text-sm font-medium text-accent underline-offset-2 hover:underline`,children:`Back to agents`})]});let b=o.data?.agents||[],x=b.filter(e=>e.state!==`revoked`),S=b.filter(e=>e.state===`revoked`),C=n=>v.run(async()=>{await X.put(zb(t,`/projects/${e}/default-agent`),{agentId:n?n.id:null}),s(n?`${n.name} is the default agent`:`No default agent: any agent takes new comments`),await o.reload()}),w=n=>zb(t,`/projects/${e}/agents/${n.id}`);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(ix,{to:`/w/${t}/agents`,className:`mb-3 inline-flex h-11 items-center gap-1.5 rounded-md text-sm text-muted outline-none hover:text-fg focus-visible:outline-2 focus-visible:outline-accent lg:h-8`,children:[(0,V.jsx)(te,{size:15,"aria-hidden":`true`}),` All agents`]}),(0,V.jsx)(Cx,{title:`Agents of ${i.name}`,description:`The coding agents of this project: the ones members chat with on the board, and the ones that pick up comments. Each runs where the code is; this server never runs an agent.`,actions:(0,V.jsx)(J,{asChild:!0,size:`touch`,className:`lg:h-9`,children:(0,V.jsx)(ix,{to:`/w/${t}/projects/${e}`,children:`Project page`})})}),(0,V.jsxs)(`div`,{className:`grid gap-5`,children:[(0,V.jsxs)(Z,{"data-sw-project-agents":!0,children:[(0,V.jsx)(Sx,{icon:ae,title:`Agents`,description:`The default agent is the one Send to agent names, and where a trusted member's new comment goes. Without one, any agent takes it.`}),o.loading?(0,V.jsx)(Px,{}):null,o.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:o.error,onRetry:o.reload})}):null,o.data&&!o.error?x.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:x.map(e=>(0,V.jsxs)(`li`,{className:`space-y-3 px-4 py-4 sm:px-5`,"data-sw-agent-row":e.name,"data-sw-agent-id":e.id,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,V.jsx)(Qw,{agent:e}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-[1_1_14rem]`,children:[(0,V.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-sm font-semibold text-fg`,children:e.name}),(0,V.jsx)(Xw,{agent:e}),e.isDefault?(0,V.jsxs)(H,{tone:`accent`,className:`px-2 py-0.5 text-[11px]`,"data-sw-agent-default":!0,children:[(0,V.jsx)(dn,{size:10,"aria-hidden":`true`}),` Default`]}):null]}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,children:[Iw[e.kind]||e.kind,e.machine?` on ${e.machine}`:``,` · `,(0,V.jsx)(Zw,{agent:e}),` · connected by`,` `,Yw(e.createdBy)]}),(0,V.jsx)(Jw,{agent:e}),e.counts.working||e.counts.queued?(0,V.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,"data-sw-agent-counts":!0,children:[e.counts.working?`working on ${e.counts.working}`:null,e.counts.queued?`${e.counts.queued} waiting for it`:null].filter(Boolean).join(`, `)}):null]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,V.jsxs)(J,{size:`touch`,className:`lg:h-8`,onClick:()=>l(e),"data-sw-agent-edit":e.name,children:[(0,V.jsx)(It,{size:13,"aria-hidden":`true`}),` Edit`]}),e.isDefault?(0,V.jsx)(J,{size:`touch`,className:`lg:h-8`,disabled:v.busy,onClick:()=>C(null),"data-sw-agent-undefault":e.name,children:`Not the default`}):(0,V.jsxs)(J,{size:`touch`,className:`lg:h-8`,disabled:v.busy,onClick:()=>C(e),"data-sw-agent-make-default":e.name,children:[(0,V.jsx)(dn,{size:13,"aria-hidden":`true`}),` Make default`]}),(0,V.jsx)(J,{size:`touch`,variant:`danger`,className:`lg:h-8`,onClick:()=>{y.setError(null),h(e)},"data-sw-agent-revoke":e.name,children:`Revoke`})]})]}),(0,V.jsxs)(`dl`,{className:`grid gap-2 text-xs sm:grid-cols-2`,children:[(0,V.jsxs)(`div`,{className:`rounded-lg border border-line bg-surface-2/50 p-3`,"data-sw-agent-audience":e.audience.kind,children:[(0,V.jsxs)(`dt`,{className:`flex items-center gap-1.5 font-medium text-fg`,children:[(0,V.jsx)(Nn,{size:13,"aria-hidden":`true`}),` `,e.link?.connected?`Who may use it`:`Who may send it work`]}),(0,V.jsxs)(`dd`,{className:`mt-1 text-muted`,children:[(0,V.jsxs)(`span`,{className:`text-fg`,children:[e.audience.text,`.`]}),` `,e.audience.inherited?`Kept from before 0.4.0, when the agent policy alone decided, so nothing changed on upgrade. New agents start with only the person who connected them.`:e.audience.kind===`trusted`?``:`They must also be trusted by this project's agent policy (on the project page).`]}),(0,V.jsx)(`dd`,{className:`mt-2`,children:(0,V.jsx)(J,{size:`touch`,className:`lg:h-8`,onClick:()=>d(e),"data-sw-agent-audience-edit":e.name,children:`Change`})})]}),(0,V.jsxs)(`div`,{className:`rounded-lg border border-line bg-surface-2/50 p-3`,"data-sw-agent-approval":e.approval.effectiveRule,children:[(0,V.jsxs)(`dt`,{className:`flex items-center gap-1.5 font-medium text-fg`,children:[(0,V.jsx)(sn,{size:13,"aria-hidden":`true`}),` Approvals`]}),(0,V.jsx)(`dd`,{className:`mt-1 text-muted`,"data-sw-agent-mode":e.link?.connected?zw(e):`watch`,children:e.link?.connected?zw(e)===`none`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`text-fg`,children:[Vw.none,`.`]}),` Nothing to approve: its machine takes no edits or commands from the board. That is switched on on the machine itself.`]}):zw(e)===`auto`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`text-fg`,children:[Vw.auto,`.`]}),` Applies to `,Hw(Uw(e)),`. Anything else waits for an answer on the board.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`text-fg`,children:[Vw.ask,`.`]}),` `,Ww(e),`, each time with a passkey check.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-fg`,children:`Ask every time.`}),` It asks before each command it runs for a comment.`,` `,wb[e.approval.answerRole],`s and up answer; `,wb[e.approval.changeRole].toLowerCase(),`s and up change this rule.`]})}),(0,V.jsx)(`dd`,{className:`mt-2`,children:(0,V.jsx)(J,{size:`touch`,className:`lg:h-8`,onClick:()=>p(e),"data-sw-agent-approval-edit":e.name,children:`Change`})})]})]})]},e.id))}):(0,V.jsx)(Ly,{icon:ae,title:`No agent is connected to this project`,children:`Comments sent to an agent wait here until one is. Connect one below.`}):null,(0,V.jsx)(`div`,{className:`px-4 pb-3 sm:px-5`,children:(0,V.jsx)(Tx,{error:v.error})})]}),(0,V.jsx)(tT,{project:i,onNewToken:()=>_(!0)}),S.length?(0,V.jsxs)(Z,{"data-sw-agents-revoked":!0,children:[(0,V.jsx)(Sx,{icon:ae,title:`Revoked`,description:`These no longer work. Their replies on threads keep their names.`}),(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:S.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-2.5 text-sm text-muted sm:px-5`,children:[(0,V.jsx)(Qw,{agent:e,size:`md`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,V.jsx)(`span`,{className:`text-xs`,children:(0,V.jsx)(Zw,{agent:e})})]},e.id))})]}):null]}),(0,V.jsx)(nT,{agent:c,kinds:o.data?.options?.kinds||Object.keys(Iw),url:c?w(c):null,onClose:()=>l(null),onSaved:async()=>{s(`Agent saved`),await o.reload()}}),(0,V.jsx)(rT,{agent:u,members:o.data?.members||[],url:u?`${w(u)}/audience`:null,onClose:()=>d(null),onSaved:async()=>{s(`Audience saved`),await o.reload()}}),(0,V.jsx)(aT,{agent:f,role:r,url:f?`${w(f)}/approval`:null,onClose:()=>p(null),onSaved:async()=>{s(`Approval settings saved`),await o.reload()}}),(0,V.jsx)(Ix,{open:!!m,onClose:()=>h(null),title:`Revoke ${m?.name}?`,confirmLabel:`Revoke agent`,tone:`danger`,busy:y.busy,error:y.error,onConfirm:()=>y.run(async()=>{await X.delete(w(m)),h(null),s(`Agent revoked`),await o.reload()}),children:(0,V.jsx)(`p`,{children:`Its token stops working at once, so the machine that uses it stops picking up comments. What it was working on and what waited for it go to any agent. This cannot be undone: connect it again with a new token.`})}),(0,V.jsx)(pw,{open:g,onClose:()=>_(!1),projects:n.projects,projectId:e,defaultScopes:Rw,onCreated:o.reload})]})}function tT({project:e,onNewToken:t}){let n=Bb(),r=`flex gap-3`,i=`mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-surface-2 text-[11px] font-semibold text-fg`;return(0,V.jsxs)(Z,{"data-sw-connect-agent":!0,children:[(0,V.jsx)(Sx,{icon:Bt,title:`Connect an agent`,description:`On a machine that has the code of ${e.name}. The agent runs there; this server only passes messages.`,actions:(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,className:`lg:h-9`,onClick:t,"data-sw-connect-agent-token":!0,children:[(0,V.jsx)(Rt,{size:16,"aria-hidden":`true`}),` New agent token`]})}),(0,V.jsxs)(`div`,{className:`space-y-2 border-b border-line px-4 py-4 text-sm text-muted sm:px-5`,"data-sw-connect-agent-chat":!0,children:[(0,V.jsx)(`p`,{className:`font-medium text-fg`,children:`Chat with your coding agent on the board`}),(0,V.jsxs)(`p`,{children:[`Run this in the project's folder, on the machine that has Claude Code, Codex or goose. It shows a code; approve it on`,` `,(0,V.jsx)(ix,{to:`/device`,className:`font-medium text-accent underline-offset-2 hover:underline`,children:`the approval page`}),`, where you name the agent and choose who may use it.`]}),(0,V.jsx)(kx,{value:`shapewall agent connect --remote ${n}`,testId:`connect-agent`}),(0,V.jsx)(`p`,{className:`text-xs`,children:`Members then chat with it from the board's Agents panel. It reads the project and answers; it does not change files or run commands. Leave it running (or run it as a service); Ctrl+C disconnects it.`})]}),(0,V.jsx)(`p`,{className:`px-4 pt-4 text-sm font-medium text-fg sm:px-5`,children:`An agent that fixes comments`}),(0,V.jsxs)(`ol`,{className:`space-y-4 px-4 py-4 text-sm text-muted sm:px-5`,children:[(0,V.jsxs)(`li`,{className:r,children:[(0,V.jsx)(`span`,{className:i,children:`1`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,V.jsx)(`p`,{className:`text-fg`,children:`Sign the machine in, in the project's folder.`}),(0,V.jsx)(kx,{value:`shapewall login --remote ${n}`,testId:`connect-login`}),(0,V.jsxs)(`p`,{className:`text-xs`,children:[`Approve the code it shows, choose this project and tick `,(0,V.jsx)(`strong`,{className:`font-medium text-fg`,children:`Take agent work`}),`. Or make a token here with New agent token and set it as SHAPEWALL_TOKEN on that machine.`]})]})]}),(0,V.jsxs)(`li`,{className:r,children:[(0,V.jsx)(`span`,{className:i,children:`2`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,V.jsx)(`p`,{className:`text-fg`,children:`Start watching, with the command that runs your coding agent.`}),(0,V.jsx)(kx,{value:`shapewall watch --remote ${n} --exec "<your agent command>"`,testId:`connect-watch`}),(0,V.jsx)(`p`,{className:`text-xs`,children:`It runs your command once for each comment sent to it. Leave it running; Ctrl+C stops it.`})]})]}),(0,V.jsxs)(`li`,{className:r,children:[(0,V.jsx)(`span`,{className:i,children:`3`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,V.jsx)(`p`,{className:`text-fg`,children:`It appears above as online.`}),(0,V.jsx)(`p`,{className:`text-xs`,children:`Give it a name and an icon, and choose who may send it work: a new agent only takes comments from the person who connected it.`})]})]})]}),(0,V.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-xs text-muted sm:px-5`,children:[(0,V.jsxs)(`a`,{href:Nw,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-accent underline-offset-2 hover:underline`,"data-sw-connect-agent-docs":!0,children:[`Agents on a hosted board `,(0,V.jsx)(re,{size:12,"aria-hidden":`true`})]}),` `,`has recipes for Claude Code, Codex and goose, and how to run it as a service.`]})]})}function nT({agent:e,kinds:t,url:n,onClose:r,onSaved:i}){let a=(0,O.useId)(),[o,s]=(0,O.useState)({name:``,icon:null,tint:null,png:null}),[c,l]=(0,O.useState)(`watcher`),u=_x();(0,O.useEffect)(()=>{e&&(s({name:e.name,icon:e.icon||null,tint:e.tint||null,png:null}),l(e.kind),u.setError(null))},[e]);let d=o.name.trim(),f=Aw(o.name)||(e&&!d?`Give it a name.`:null),p={claude:`claude`,codex:`openai`,goose:`goose`,gemini:`gemini`}[c]||null,m=e?{...d===e.name?{}:{name:d},...o.icon===(e.icon||null)?{}:{icon:o.icon},...o.tint===(e.tint||null)?{}:{tint:o.tint},...c===e.kind?{}:{kind:c}}:{},h=Object.keys(m).length>0;return(0,V.jsx)(Ty,{open:!!e,onClose:()=>u.busy?null:r(),title:`Edit agent`,description:`How it is shown on boards. Its replies are signed with this name from now on; what it already wrote keeps the old one.`,wrapDescription:!0,size:`md`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:`touch`,className:`lg:h-9`,onClick:r,disabled:u.busy,children:`Cancel`}),(0,V.jsxs)(J,{size:`touch`,variant:`default`,className:`lg:h-9`,onClick:()=>u.run(async()=>{await X.patch(n,m),await i(),r()}),disabled:u.busy||!h||!!f,"data-sw-agent-edit-save":!0,children:[u.busy?(0,V.jsx)(Y,{}):null,` Save`]})]}),children:(0,V.jsxs)(`div`,{className:`space-y-4 p-5`,"data-sw-agent-edit-dialog":!0,children:[(0,V.jsx)(kw,{id:`${a}-name`,value:o,onChange:s,touch:!0,problem:f,disabled:u.busy,hint:`Shown on boards, in Send to agent and on its replies.`}),(0,V.jsx)($,{label:`What runs behind it`,hint:`Only changes the default icon: a known program shows its mark.`,children:e=>(0,V.jsxs)(Vy,{value:c,onValueChange:l,disabled:u.busy,children:[(0,V.jsx)(Ky,{...e,size:`touch`,className:`w-full lg:h-9`,"data-sw-agent-kind":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:t.map(e=>(0,V.jsx)(Yy,{value:e,"data-sw-agent-kind-option":e,children:Iw[e]||e},e))})]})}),(0,V.jsx)(Ow,{value:o,onChange:s,label:d||e?.name||`Agent`,logo:p,upload:!1,disabled:u.busy}),(0,V.jsx)(Tx,{error:u.error})]})})}function rT({agent:e,members:t,url:n,onClose:r,onSaved:i}){let[a,o]=(0,O.useState)(`owner`),[s,c]=(0,O.useState)([]),l=_x();(0,O.useEffect)(()=>{e&&(o(e.audience.kind),c(e.audience.users.map(e=>e.userId)),l.setError(null))},[e]);let u=e?.createdBy?.userId||null,d=t.filter(e=>e.userId!==u),f=e=>c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);return(0,V.jsx)(Ty,{open:!!e,onClose:()=>l.busy?null:r(),title:`Who may send work to ${e?.name||`this agent`}`,description:`Work sent to an agent runs on the machine of the person who connected it. Saving asks for your passkey.`,wrapDescription:!0,size:`md`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:`touch`,className:`lg:h-9`,onClick:r,disabled:l.busy,children:`Cancel`}),(0,V.jsxs)(J,{size:`touch`,variant:`default`,className:`lg:h-9`,onClick:()=>l.run(async()=>{await X.put(n,{audience:a,users:a===`members`?s:[]}),await i(),r()}),disabled:l.busy,"data-sw-agent-audience-save":!0,children:[l.busy?(0,V.jsx)(Y,{}):null,` Save`]})]}),children:(0,V.jsxs)(`div`,{className:`space-y-4 p-5`,"data-sw-agent-audience-dialog":!0,children:[(0,V.jsx)(`div`,{role:`radiogroup`,"aria-label":`Audience`,className:`space-y-2`,children:Lw.map(([t,n,r])=>(0,V.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":a===t,onClick:()=>o(t),disabled:l.busy,className:`flex min-h-11 w-full items-start gap-3 rounded-lg border px-3 py-2.5 text-left text-sm outline-none focus-visible:outline-2 focus-visible:outline-accent ${a===t?`border-accent/50 bg-accent/10`:`border-line hover:bg-surface-2`}`,"data-sw-agent-audience-option":t,children:[(0,V.jsx)(`span`,{className:`mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border ${a===t?`border-accent bg-accent text-accent-fg`:`border-line bg-surface`}`,"aria-hidden":`true`,children:a===t?(0,V.jsx)(ue,{size:11}):null}),(0,V.jsxs)(`span`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`block font-medium text-fg`,children:t===`owner`&&e?.createdBy?`Only ${Yw(e.createdBy)}`:n}),(0,V.jsx)(`span`,{className:`block text-xs text-muted`,children:r})]})]},t))}),a===`members`?(0,V.jsxs)(`fieldset`,{"data-sw-agent-audience-members":!0,children:[(0,V.jsx)(`legend`,{className:`mb-1.5 block text-ui font-medium text-fg`,children:`Members`}),d.length?(0,V.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:d.map(e=>(0,V.jsx)(Rx,{checked:s.includes(e.userId),onChange:()=>f(e.userId),children:(0,V.jsxs)(`span`,{className:`min-w-0`,"data-sw-agent-audience-member":e.handle,children:[(0,V.jsx)(`span`,{className:`block truncate`,children:e.displayName}),(0,V.jsxs)(`span`,{className:`block truncate text-xs text-muted`,children:[`@`,e.handle,` · `,wb[e.role],e.trusted?``:` · not trusted by the agent policy`]})]})},e.userId))}):(0,V.jsx)(`p`,{className:`text-sm text-muted`,children:`Nobody else in this workspace can comment yet. Invite a member first.`})]}):null,(0,V.jsx)(Q,{children:`An audience only narrows who may use this agent. The project's agent policy still decides who may send work to an agent at all, and the machine that runs the agent has the last word. It also decides whose replies the agent reads. A comment the agent is already working on stays with it until it is done.`}),(0,V.jsx)(Tx,{error:l.error})]})})}function iT({value:e,checked:t,disabled:n,onChoose:r,title:i,children:a,...o}){return(0,V.jsxs)(`div`,{role:`radio`,"aria-checked":t?`true`:`false`,"aria-disabled":n?`true`:void 0,tabIndex:n?-1:0,onClick:n?void 0:()=>r(e),onKeyDown:n?void 0:t=>{(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),r(e))},className:B(`flex items-start gap-3 rounded-lg border px-3 py-2.5 text-sm outline-none focus-visible:outline-2 focus-visible:outline-accent`,t?`border-accent/50 bg-accent/10`:`border-line`,n?t?``:`bg-surface-2/40`:`cursor-pointer hover:border-accent/50`),"data-sw-agent-approval-option":e,...o,children:[t?(0,V.jsx)(`span`,{className:`mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-accent bg-accent text-accent-fg`,children:(0,V.jsx)(ue,{size:11,"aria-hidden":`true`})}):(0,V.jsx)(`span`,{className:`mt-0.5 inline-flex h-4 w-4 shrink-0 rounded-full border border-line bg-surface`,"aria-hidden":`true`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:B(`block font-medium`,n&&!t?`text-muted`:`text-fg`),children:i}),a]})]})}function aT({agent:e,role:t,url:n,onClose:r,onSaved:i}){let[a,o]=(0,O.useState)(`ask`),[s,c]=(0,O.useState)(`admin`),[l,u]=(0,O.useState)(`admin`),d=_x();(0,O.useEffect)(()=>{e&&(o(e.approval.effectiveRule),c(e.approval.changeRole),u(e.approval.answerRole),d.setError(null))},[e]);let f=hb(t,e?{approvalChangeRole:e.approval.changeRole,approvalAnswerRole:e.approval.answerRole}:null),p=gb(t),m=Kw(e),h=!!e?.link?.connected,g=zw(e),_=!f||d.busy,v=e?a!==e.approval.effectiveRule:!1,y=e?v||s!==e.approval.changeRole||l!==e.approval.answerRole:!1,b=()=>d.run(async()=>{await X.put(n,{...v?{rule:a}:{},...s===e.approval.changeRole?{}:{changeRole:s},...l===e.approval.answerRole?{}:{answerRole:l}}),await i(),r()}),x=(e,t,n)=>r=>(0,V.jsxs)(Vy,{value:e,onValueChange:t,disabled:!p||d.busy,children:[(0,V.jsx)(Ky,{...r,size:`touch`,className:`w-full lg:h-9`,"data-sw-agent-approval-role":n,children:(0,V.jsx)(Uy,{})}),(0,V.jsxs)(qy,{children:[(0,V.jsx)(Yy,{value:`admin`,children:`Admins and owners`}),(0,V.jsx)(Yy,{value:`owner`,children:`Owners only`})]})]}),S=e?Hw(e.approval.machine.auto):``;return(0,V.jsx)(Ty,{open:!!e,onClose:()=>d.busy?null:r(),title:`Approvals for ${e?.name||`this agent`}`,description:`Whether what the agent asks to do waits for a person, and who decides. Saving asks for your passkey.`,wrapDescription:!0,size:`md`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{size:`touch`,className:`lg:h-9`,onClick:r,disabled:d.busy,children:p||f?`Cancel`:`Close`}),p||f?(0,V.jsxs)(J,{size:`touch`,variant:`default`,className:`lg:h-9`,onClick:b,disabled:d.busy||!y,"data-sw-agent-approval-save":!0,children:[d.busy?(0,V.jsx)(Y,{}):null,` Save`]}):null]}),children:e?(0,V.jsxs)(`div`,{className:`space-y-4 p-5`,"data-sw-agent-approval-dialog":!0,children:[(0,V.jsxs)(`p`,{className:`flex items-start gap-2 text-sm`,"data-sw-agent-approval-mode":h?g:`watch`,children:[(0,V.jsx)(sn,{size:15,className:`mt-0.5 shrink-0 text-muted`,"aria-hidden":`true`}),(0,V.jsxs)(`span`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:`Now: `}),(0,V.jsxs)(`span`,{className:`font-medium text-fg`,children:[h?Vw[g]:`Asks before each command`,`.`]}),` `,(0,V.jsx)(`span`,{className:`text-muted`,children:h?g===`none`?`It makes no changes from the board.`:g===`auto`?`A fix is made on a branch on its machine. Without asking: ${Hw(Uw(e))}.`:`A fix is made on a branch on its machine, and each edit waits for an answer on the board.`:`It takes comments on its own (shapewall watch) and makes its changes where it runs.`})]})]}),h?(0,V.jsx)(qw,{agent:e}):null,(0,V.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Approval rule`,className:`space-y-2`,children:[(0,V.jsx)(iT,{value:`ask`,checked:a===`ask`,disabled:_,onChoose:o,title:`Ask every time`,children:(0,V.jsx)(`span`,{className:`block text-xs text-muted`,children:h&&g===`none`?`Once its machine takes edits from the board, each one waits for a person with the role below.`:e.approval.machine.approvals===`owner`?`Everything the agent asks to do waits for ${e.createdBy?Yw(e.createdBy):`the person who connected it`}: its machine takes answers from nobody else.`:`Everything the agent asks to do waits for a person with the role below.`})}),(0,V.jsx)(iT,{value:`auto`,checked:a===`auto`,disabled:_||!!m,onChoose:o,title:m?`Allow without asking (not available)`:`Allow without asking`,...m?{"data-sw-agent-approval-unavailable":!0}:{},children:m?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`block text-xs text-muted`,"data-sw-agent-approval-why":!0,children:m}),h?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`mt-1.5 block text-xs text-muted`,children:`To allow it, run this on the agent's machine, in the project's folder:`}),(0,V.jsx)(kx,{value:Gw,testId:`approval-auto`,className:`mt-1`})]}):null]}):(0,V.jsxs)(`span`,{className:`block text-xs text-muted`,"data-sw-agent-approval-applies":!0,children:[`Applies to `,S,`, as its machine allows. Files that run something (settings, scripts, tests, CI) and anything else still wait for an answer. A fix is always made on a branch, and one made without asking is not pushed until someone looks at its whole diff on the board.`,e.approval.autoBy===`owner`?(0,V.jsxs)(`span`,{className:`mt-1 block`,"data-sw-agent-approval-owner-only":!0,children:[`Only `,e.createdBy?Yw(e.createdBy):`the person who connected it`,` can switch this on: its machine takes approvals from them alone.`]}):null]})})]}),f?null:(0,V.jsxs)(Q,{tone:`info`,children:[`Changing this agent's approval rule needs the `,wb[e.approval.changeRole||`owner`].toLowerCase(),` role.`]}),(0,V.jsxs)(`div`,{className:`grid items-start gap-4 sm:grid-cols-2`,children:[(0,V.jsx)($,{label:`Who may answer its approvals`,hint:`They also need a fresh passkey check for each answer.`,children:x(l,u,`answer`)}),(0,V.jsx)($,{label:`Who may change this rule`,hint:`Only an owner changes these two.`,children:x(s,c,`change`)})]}),(0,V.jsx)(Tx,{error:d.error})]}):null})}function oT({workspaceId:e,projectId:t}){let n=yx(zb(e,`/projects/${t}/agents`)),r=(n.data?.agents||[]).filter(e=>e.state!==`revoked`);return(0,V.jsxs)(Z,{"data-sw-project-agents-card":!0,children:[(0,V.jsx)(Sx,{icon:ae,title:`Agents`,description:`The machines that pick up comments sent to an agent here: who they are, who may use them, and the default.`,actions:(0,V.jsx)(J,{asChild:!0,size:`touch`,variant:`secondary`,className:`lg:h-9`,children:(0,V.jsx)(ix,{to:`/w/${e}/agents/${t}`,"data-sw-project-agents-open":!0,children:r.length?`Manage agents`:`Connect an agent`})})}),n.loading?(0,V.jsx)(Px,{rows:1}):null,n.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:n.error,onRetry:n.reload})}):null,n.data&&!n.error?r.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:r.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-2.5 text-sm sm:px-5`,"data-sw-project-agent":e.name,children:[(0,V.jsx)(Qw,{agent:e,size:`md`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:e.name}),e.isDefault?(0,V.jsx)(H,{tone:`neutral`,className:`px-1.5 py-0.5 text-[10.5px]`,children:`Default`}):null,(0,V.jsx)(Xw,{agent:e}),(0,V.jsx)(`span`,{className:`w-full text-xs text-muted sm:w-auto`,children:e.audience.text})]},e.id))}):(0,V.jsx)(`p`,{className:`px-4 py-4 text-sm text-muted sm:px-5`,children:`No agent is connected. Comments sent to an agent wait until a machine that has the code runs shapewall watch --remote.`}):null]})}function sT({projectId:e}){let{workspaceId:t,data:n,isAdmin:r,isOwner:i,reload:a}=qE(),o=_x(),s=n.projects.find(t=>t.id===e),c=yx(r&&s?zb(t,`/projects/${e}/shares`):null),l=yx(r&&s?zb(t,`/projects/${e}/tokens`):null),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(!1),[g,_]=(0,O.useState)(!1),[v,y]=(0,O.useState)(null),b=_x(),x=_x(),S=px();if(!s)return(0,V.jsxs)(Z,{className:`p-8 text-center`,children:[(0,V.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:`Project not found`}),(0,V.jsx)(ix,{to:`/w/${t}`,className:`mt-3 inline-block text-sm font-medium text-accent underline-offset-2 hover:underline`,children:`Back to projects`})]});let C=n.workspace.settings.shareLinks,w=r,T=n=>o.run(async()=>{await X.put(zb(t,`/projects/${e}/public`),{public:n}),await a(),_(!1),S(n?`This project is public`:`This project is private again. The public URL stopped working.`)});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(ix,{to:`/w/${t}`,className:`mb-3 inline-flex h-11 items-center gap-1.5 rounded-md text-sm text-muted outline-none hover:text-fg focus-visible:outline-2 focus-visible:outline-accent lg:h-8`,children:[(0,V.jsx)(te,{size:15,"aria-hidden":`true`}),` Projects`]}),(0,V.jsx)(Cx,{title:s.name,description:`Created ${Sb(s.createdAt)}`,actions:(0,V.jsx)(J,{asChild:!0,size:`touch`,variant:`default`,className:`lg:h-9`,children:(0,V.jsxs)(`a`,{href:s.boardUrl,children:[`Open board `,(0,V.jsx)(re,{size:15,"aria-hidden":`true`})]})})}),(0,V.jsxs)(`div`,{className:`grid gap-5`,children:[r&&!s.boards.length?(0,V.jsx)(ZC,{workspaceId:t,data:n,project:s,tokens:l.data?.tokens||null,onNewToken:()=>p(!0)}):null,(0,V.jsxs)(Z,{children:[(0,V.jsx)(Sx,{icon:$e,title:`Boards`,description:`Each board is one shapewall.config.json board, updated by every push.`}),s.boards.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:s.boards.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-3 text-sm sm:px-5`,"data-sw-project-board":e.id,children:[(0,V.jsx)(`code`,{className:`font-mono text-[13px] text-fg`,children:e.id}),(0,V.jsxs)(`span`,{className:`text-xs text-muted`,children:[e.pushes,` `,e.pushes===1?`push`:`pushes`,` · last `,(0,V.jsx)(Ox,{value:e.pushedAt})]}),(0,V.jsx)(`span`,{className:`flex-1`}),(0,V.jsxs)(`a`,{href:ax(s.boardUrl,`board`,e.id),className:`inline-flex h-11 items-center gap-1 text-sm font-medium text-accent underline-offset-2 hover:underline lg:h-auto`,children:[`Open `,(0,V.jsx)(re,{size:14,"aria-hidden":`true`})]}),w?(0,V.jsxs)(J,{size:`touch`,variant:`danger`,className:`lg:h-8`,onClick:()=>{b.setError(null),y(e.id)},"aria-label":`Remove board ${e.id}`,"data-sw-remove-board":e.id,children:[(0,V.jsx)(xn,{size:15,"aria-hidden":`true`}),` Remove board`]}):null]},e.id))}):(0,V.jsxs)(Ly,{icon:$e,title:`Nothing pushed yet`,children:[`Make a token with the push scope below, then run shapewall push --remote `,Bb()]})]}),r?(0,V.jsxs)(Z,{"data-sw-project-shares":!0,children:[(0,V.jsx)(Sx,{icon:at,title:`Share links`,description:`For people outside the workspace: this project only, until the link expires or you revoke it.`,actions:C?(0,V.jsxs)(J,{size:`touch`,variant:`default`,onClick:()=>d(!0),className:`lg:h-9`,"data-sw-new-share":!0,children:[(0,V.jsx)(Rt,{size:16,"aria-hidden":`true`}),` New share link`]}):null}),C?null:(0,V.jsx)(`div`,{className:`p-4 sm:p-5`,children:(0,V.jsx)(aw,{isAdmin:r})}),c.loading?(0,V.jsx)(Px,{}):null,c.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:c.error,onRetry:c.reload})}):null,c.data&&(C||c.data.shares.length)?(0,V.jsx)(rw,{shares:c.data.shares,onChanged:c.reload,projectId:e}):null]}):null,r&&n.features?.publicProjects?(0,V.jsxs)(Z,{"data-sw-project-public":!0,children:[(0,V.jsx)(Sx,{icon:Ve,title:`Public`,description:`Anyone with the URL can view this project's boards and comments. They cannot comment or change anything.`,actions:i&&n.workspace.settings.publicProjects||s.public?(0,V.jsx)(Lx,{checked:!!s.public,label:`Public`,disabled:o.busy||!s.public&&!i,onChange:e=>e?T(!0):_(!0)}):null}),(0,V.jsxs)(`div`,{className:`space-y-3 px-4 py-4 text-sm text-muted sm:px-5`,children:[s.public?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(kx,{value:`${window.location.origin}${s.public.url}`,testId:`public`}),(0,V.jsxs)(`p`,{children:[`Public since `,(0,V.jsx)(Ox,{value:s.public.since}),`. Making it private stops this URL at once; making it public again gives a new one.`]})]}):n.workspace.settings.publicProjects?i?(0,V.jsx)(`p`,{children:`Private. Making it public asks for your passkey.`}):(0,V.jsx)(`p`,{children:`Private. Only an owner can make a project public.`}):(0,V.jsx)(Q,{tone:`info`,children:`Public projects are off in this workspace. An owner turns them on in Settings.`}),g?null:(0,V.jsx)(Tx,{error:o.error})]})]}):null,r?(0,V.jsxs)(Z,{children:[(0,V.jsx)(Sx,{icon:qe,title:`API tokens`,description:`For the CLI, CI and agents working in this project.`,actions:(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:()=>p(!0),className:`lg:h-9`,"data-sw-project-new-token":!0,children:[(0,V.jsx)(Rt,{size:16,"aria-hidden":`true`}),` New token`]})}),l.loading?(0,V.jsx)(Px,{}):null,l.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:l.error,onRetry:l.reload})}):null,l.data&&!l.error?l.data.tokens.length?(0,V.jsx)(fw,{tokens:l.data.tokens,onChanged:l.reload}):(0,V.jsx)(Ly,{icon:qe,title:`No tokens yet`}):null]}):null,r?(0,V.jsx)(oT,{workspaceId:t,projectId:e}):null,r?(0,V.jsx)(hw,{workspaceId:t,projectId:e}):null,r?(0,V.jsx)(Z,{className:`border-bad/30`,children:(0,V.jsx)(Sx,{icon:xn,title:`Delete project`,description:`Its boards, captures, comments, tokens and share links go with it.`,actions:(0,V.jsx)(J,{size:`touch`,variant:`danger`,onClick:()=>h(!0),className:`border border-bad/40 lg:h-9`,"data-sw-delete-project":!0,children:`Delete project`})})}):null]}),r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(iw,{open:u,onClose:()=>d(!1),project:s,onCreated:c.reload}),(0,V.jsx)(pw,{open:f,onClose:()=>p(!1),projects:n.projects,projectId:e,onCreated:l.reload}),(0,V.jsx)(Ix,{open:m,onClose:()=>h(!1),title:`Delete ${s.name}?`,confirmLabel:`Delete project`,tone:`danger`,confirmText:s.name,busy:x.busy,error:x.error,onConfirm:()=>x.run(async()=>{await X.delete(zb(t,`/projects/${e}`)),S(`Deleted ${s.name}`),nx(`/w/${t}`)}),children:(0,V.jsx)(`p`,{children:`This deletes every board, capture, comment, token and share link of the project. It cannot be undone.`})}),(0,V.jsxs)(Ix,{open:!!v,onClose:()=>y(null),title:`Remove the board ${v||``}?`,confirmLabel:`Remove board`,tone:`danger`,busy:b.busy,error:b.error,onConfirm:()=>b.run(async()=>{await X.delete(zb(t,`/projects/${e}/boards/${v}`)),await a(),S(`Removed the board ${v}`),y(null)}),children:[(0,V.jsxs)(`p`,{"data-sw-remove-board-note":!0,children:[`This deletes the captures, the page history and every comment of `,(0,V.jsx)(`code`,{className:`font-mono text-fg`,children:v}),` on this server. It cannot be undone. Pushing a board with the same id later brings its captures back, but not the comments.`]}),(0,V.jsx)(`p`,{className:`mt-2`,children:`The project, its other boards, its tokens and its share links stay.`})]}),(0,V.jsx)(Ix,{open:g,onClose:()=>_(!1),title:`Make ${s.name} private?`,confirmLabel:`Make private`,tone:`danger`,busy:o.busy,error:o.error,onConfirm:()=>T(!1),children:(0,V.jsx)(`p`,{children:`The public URL stops working at once, for everyone you sent it to. Making the project public again gives it a new URL: the old one never comes back.`})})]}):null]})}function cT(){let{workspaceId:e}=qE(),t=yx(zb(e,`/invites`)),[n,r]=(0,O.useState)(!1),[i,a]=(0,O.useState)(null),o=_x(),s=px(),c=t.data?.pending||[],l=t.data?.history||[];return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`Invites`,description:`Each link works once, for one person, until it expires. Whoever opens it first joins with its role.`,actions:(0,V.jsxs)(J,{variant:`default`,size:`touch`,onClick:()=>r(!0),className:`lg:h-9`,"data-sw-new-invite":!0,children:[(0,V.jsx)(Dn,{size:16,"aria-hidden":`true`}),` New invite`]})}),t.loading?(0,V.jsx)(Px,{}):null,t.error?(0,V.jsx)(Fx,{error:t.error,onRetry:t.reload}):null,t.data?(0,V.jsxs)(Zy,{defaultValue:`pending`,children:[(0,V.jsxs)(nb,{className:`mb-3 w-full sm:inline-flex sm:w-auto`,children:[(0,V.jsxs)(rb,{value:`pending`,className:`h-11 px-3 lg:h-8`,"data-sw-tab":`pending`,children:[`Pending `,(0,V.jsx)(`span`,{className:`tabular ml-1 text-faint`,children:c.length})]}),(0,V.jsxs)(rb,{value:`history`,className:`h-11 px-3 lg:h-8`,"data-sw-tab":`history`,children:[`History `,(0,V.jsx)(`span`,{className:`tabular ml-1 text-faint`,children:l.length})]})]}),(0,V.jsx)(ib,{value:`pending`,children:(0,V.jsx)(Z,{children:c.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line`,"data-sw-pending-invites":!0,children:c.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-3 sm:px-5`,"data-sw-invite":e.id,children:[(0,V.jsx)(Dx,{role:e.role}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 text-xs text-muted`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-fg`,children:[e.note?(0,V.jsx)(`span`,{className:`mr-2 font-medium`,"data-sw-invite-note":!0,children:e.note}):null,e.email?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,V.jsx)(mt,{size:13,"aria-hidden":`true`}),` `,e.email]}):e.note?null:`Link`]}),(0,V.jsxs)(`p`,{className:`mt-0.5`,children:[`By `,e.createdBy?.displayName||`someone`,` · `,(0,V.jsx)(Ox,{value:e.createdAt}),` ·`,` `,(0,V.jsx)(Ox,{value:e.expiresAt,prefix:`expires `})]})]}),(0,V.jsx)(J,{size:`touch`,variant:`danger`,onClick:()=>a(e),className:`lg:h-8`,"data-sw-revoke-invite":!0,children:`Revoke`})]},e.id))}):(0,V.jsx)(Ly,{icon:ft,title:`No pending invites`,children:`New invite links show here until someone uses them or they expire.`})})}),(0,V.jsx)(ib,{value:`history`,children:(0,V.jsx)(Z,{children:l.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line`,"data-sw-invite-history":!0,children:l.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-3 sm:px-5`,"data-sw-invite-status":e.status,children:[(0,V.jsx)(Dx,{role:e.role}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 text-xs text-muted`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-fg`,children:[e.status===`used`?`Joined: ${e.usedBy?.displayName||`a deleted account`}${e.usedBy?` (@${e.usedBy.handle})`:``}`:e.note||e.email||`Link`,e.status===`used`&&e.note?(0,V.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.note]}):null]}),(0,V.jsxs)(`p`,{className:`mt-0.5`,children:[`By `,e.createdBy?.displayName||`someone`,` · created `,(0,V.jsx)(Ox,{value:e.createdAt}),e.status===`used`?(0,V.jsxs)(V.Fragment,{children:[` `,`· used `,(0,V.jsx)(Ox,{value:e.usedAt})]}):null,e.status===`revoked`?(0,V.jsxs)(V.Fragment,{children:[` `,`· revoked `,(0,V.jsx)(Ox,{value:e.revokedAt})]}):null,e.status===`expired`?(0,V.jsxs)(V.Fragment,{children:[` `,`· expired `,(0,V.jsx)(Ox,{value:e.expiresAt})]}):null]})]}),(0,V.jsx)(H,{tone:e.status===`used`?`ok`:`neutral`,className:`px-2 py-0.5 text-[11px]`,children:e.status===`used`?`Used`:e.status===`revoked`?`Revoked`:`Expired`})]},e.id))}):(0,V.jsx)(Ly,{icon:ft,title:`No history yet`,children:`Used, revoked and expired invites show here.`})})})]}):null,(0,V.jsx)(lT,{open:n,onClose:()=>r(!1),onCreated:t.reload}),(0,V.jsx)(Ix,{open:!!i,onClose:()=>a(null),title:`Revoke this invite?`,confirmLabel:`Revoke invite`,tone:`danger`,busy:o.busy,error:o.error,onConfirm:()=>o.run(async()=>{await X.delete(zb(e,`/invites/${i.id}`)),a(null),s(`Invite revoked`),await t.reload()}),children:(0,V.jsx)(`p`,{children:`The link stops working. Nobody has joined with it yet.`})})]})}function lT({open:e,onClose:t,onCreated:n}){let{workspaceId:r,data:i,role:a}=qE(),o=i.features,[s,c]=(0,O.useState)(`member`),[l,u]=(0,O.useState)(`7`),[d,f]=(0,O.useState)(``),[p,m]=(0,O.useState)(``),{run:h,busy:g,error:_,setError:v}=_x(),[y,b]=Nx(e,()=>{c(`member`),u(`7`),f(``),m(``),v(null)}),x=xb(a);return(0,V.jsx)(Mx,{open:e,onClose:t,busy:g,result:y,title:`Invite someone`,resultTitle:`Invite ready`,resultProps:{"data-sw-invite-result":!0},doneProps:{"data-sw-invite-done":!0},renderResult:e=>(0,V.jsxs)(V.Fragment,{children:[e.emailed?.ok?(0,V.jsx)(Q,{tone:`ok`,title:`Emailed to ${e.invite.email}`,children:`You can also send the link yourself.`}):e.emailed?(0,V.jsxs)(Q,{tone:`warn`,title:`The email did not go out`,children:[e.emailed.error,`. Copy the link and send it yourself.`]}):null,(0,V.jsxs)(Q,{tone:`info`,title:`Copy the link now: it is shown once`,children:[`It makes one `,wb[e.invite.role].toLowerCase(),` and expires `,(0,V.jsx)(Ox,{value:e.invite.expiresAt}),`. Send it to one person.`]}),(0,V.jsx)(kx,{value:e.url,testId:`invite`})]}),children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h(async()=>{let e=await X.post(zb(r,`/invites`),{role:s,expiresInDays:Number(l),...d.trim()?{email:d.trim()}:{},...p.trim()?{note:p.trim()}:{}});b(e),await n?.()})},className:`space-y-4 px-5 py-4`,children:[(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,V.jsx)($,{label:`Role`,children:e=>(0,V.jsxs)(Vy,{value:s,onValueChange:c,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full`,...e,"data-sw-invite-role":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:x.map(e=>(0,V.jsx)(Yy,{value:e,children:wb[e]},e))})]})}),(0,V.jsx)($,{label:`Link expires after`,children:e=>(0,V.jsxs)(Vy,{value:l,onValueChange:u,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full`,...e,"data-sw-invite-expiry":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:o.inviteDays.map(e=>(0,V.jsx)(Yy,{value:String(e),children:Ab(e)},e))})]})})]}),(0,V.jsx)(`p`,{className:`-mt-1 text-xs text-muted`,children:Tb[s]}),(0,V.jsx)($,{label:`Who it is for (optional)`,hint:`A note for the pending list, like Ada (design). Only admins see it.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:p,onChange:e=>m(e.target.value),maxLength:80,autoComplete:`off`,placeholder:`Ada (design)`,"data-sw-invite-note-input":!0})}),o.inviteEmail?(0,V.jsx)($,{label:`Email (optional)`,hint:`We email the link to this address. Leave it empty to copy the link yourself.`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,type:`email`,value:d,onChange:e=>f(e.target.value),autoComplete:`off`,placeholder:`name@example.com`,"data-sw-invite-email":!0})}):(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`This server does not send email: you copy the link and send it yourself.`}),s===`owner`?(0,V.jsx)(Q,{tone:`warn`,children:`An owner can change or remove anyone, you included. Inviting one asks for your passkey.`}):null,(0,V.jsx)(Tx,{error:_}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:t,disabled:g,className:`lg:h-10`,children:`Cancel`}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,disabled:g,className:`lg:h-10`,"data-sw-invite-create":!0,children:[g?(0,V.jsx)(Y,{}):null,` `,d.trim()?`Create and email`:`Create invite link`]})]})]})})}function uT(){let{data:e,role:t,isAdmin:n,workspaceId:r,reload:i}=qE(),{me:a,refresh:o}=ux(),s=px(),[c,l]=(0,O.useState)(``),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(null),[m,h]=(0,O.useState)(null),g=_x(),_=e.members.filter(e=>e.role===`owner`).length,v=!!m&&m.userId!==a.user.id,y=yx(n&&v?zb(r,`/tokens`):null),b=v?(y.data?.tokens||[]).filter(e=>e.status===`active`&&e.createdBy?.userId===m.userId):[],[x,S]=(0,O.useState)(!0);(0,O.useEffect)(()=>{m&&S(!0)},[m]);let C=(0,O.useMemo)(()=>{let t=c.trim().toLowerCase(),n={owner:0,admin:1,member:2,viewer:3};return e.members.filter(e=>!t||e.displayName.toLowerCase().includes(t)||e.handle.includes(t)).sort((e,t)=>n[e.role]-n[t.role]||e.displayName.localeCompare(t.displayName))},[e.members,c]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`Members`,description:`${e.members.length} ${e.members.length===1?`person`:`people`} in ${e.workspace.name}. Roles apply to every project.`,actions:(0,V.jsxs)(V.Fragment,{children:[n?(0,V.jsx)(J,{asChild:!0,size:`touch`,variant:`secondary`,className:`lg:h-9`,children:(0,V.jsxs)(ix,{to:`/w/${r}/access#roles`,children:[(0,V.jsx)(sn,{size:15,"aria-hidden":`true`}),` Roles and permissions`]})}):(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,className:`lg:h-9`,onClick:()=>document.getElementById(`roles`)?.scrollIntoView({behavior:`smooth`}),children:[(0,V.jsx)(sn,{size:15,"aria-hidden":`true`}),` Roles and permissions`]}),n?(0,V.jsxs)(J,{size:`touch`,variant:`default`,onClick:()=>d(!0),className:`lg:h-9`,"data-sw-invite-people":!0,children:[(0,V.jsx)(Dn,{size:16,"aria-hidden":`true`}),` Invite people`]}):null]})}),(0,V.jsxs)(Z,{children:[(0,V.jsx)(`div`,{className:`border-b border-line p-3 sm:px-5`,children:(0,V.jsx)(zy,{size:`touch`,icon:Xt,value:c,onChange:e=>l(e.target.value),placeholder:`Search by name or handle`,"aria-label":`Search members`,className:`lg:h-9 lg:text-sm`})}),(0,V.jsxs)(`div`,{className:`hidden grid-cols-[minmax(0,2fr)_10rem_8rem_8rem_3rem] gap-3 border-b border-line px-5 py-2 text-[11px] font-medium tracking-wide text-faint uppercase md:grid`,children:[(0,V.jsx)(`span`,{children:`Person`}),(0,V.jsx)(`span`,{children:`Role`}),(0,V.jsx)(`span`,{children:`Joined`}),(0,V.jsx)(`span`,{children:`Last active`}),(0,V.jsx)(`span`,{className:`sr-only`,children:`Actions`})]}),C.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line`,"data-sw-members":!0,children:C.map(e=>{let n=e.userId===a.user.id,r=vb(t,e.role),i=!n&&yb(t,e.role),o=e.role===`owner`&&_<=1;return(0,V.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-2 px-4 py-3 sm:px-5 md:grid-cols-[minmax(0,2fr)_10rem_8rem_8rem_3rem]`,"data-sw-member":e.handle,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,V.jsx)(fa,{name:e.displayName,person:!0}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 truncate text-sm font-medium text-fg`,children:[(0,V.jsx)(`span`,{className:`truncate`,children:e.displayName}),n?(0,V.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-faint`,children:`(you)`}):null]}),(0,V.jsxs)(`p`,{className:`truncate text-xs text-muted`,children:[`@`,e.handle]})]})]}),(0,V.jsx)(`div`,{className:`col-start-1 row-start-2 md:col-start-auto md:row-start-auto`,children:r.length&&!(o&&n)?(0,V.jsxs)(Vy,{value:e.role,onValueChange:t=>t===e.role?null:p({member:e,role:t}),children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-36 lg:h-8`,"aria-label":`Role of ${e.displayName}`,"data-sw-role-select":e.handle,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:r.map(e=>(0,V.jsx)(Yy,{value:e,disabled:o&&e!==`owner`,children:wb[e]},e))})]}):(0,V.jsx)(Dx,{role:e.role})}),(0,V.jsx)(`div`,{className:`hidden text-xs text-muted md:block`,children:(0,V.jsx)(Ox,{value:e.joinedAt})}),(0,V.jsxs)(`div`,{className:`col-start-1 row-start-3 text-xs text-muted md:col-start-auto md:row-start-auto`,children:[(0,V.jsx)(`span`,{className:`md:hidden`,children:`Active `}),(0,V.jsx)(Ox,{value:e.lastActiveAt,empty:`Not yet`}),(0,V.jsxs)(`span`,{className:`md:hidden`,children:[` `,`· joined `,(0,V.jsx)(Ox,{value:e.joinedAt})]})]}),(0,V.jsx)(`div`,{className:`col-start-2 row-span-3 row-start-1 self-start md:col-start-auto md:row-span-1 md:row-start-auto md:self-center`,children:i||n?(0,V.jsxs)(Dy,{children:[(0,V.jsx)(Oy,{asChild:!0,children:(0,V.jsx)(J,{size:`icon`,variant:`ghost`,className:`lg:h-8 lg:w-8`,"aria-label":`Actions for ${e.displayName}`,"data-sw-member-menu":e.handle,children:(0,V.jsx)(je,{size:16,"aria-hidden":`true`})})}),(0,V.jsx)(Ay,{children:n?(0,V.jsxs)(My,{tone:`danger`,disabled:o,onSelect:()=>h(e),"data-sw-leave":!0,children:[(0,V.jsx)(Tn,{size:14,"aria-hidden":`true`}),` `,o?`Leave (make another owner first)`:`Leave workspace`]}):(0,V.jsxs)(My,{tone:`danger`,onSelect:()=>h(e),"data-sw-remove-member":!0,children:[(0,V.jsx)(Tn,{size:14,"aria-hidden":`true`}),` Remove from workspace`]})})]}):null})]},e.userId)})}):(0,V.jsx)(Ly,{icon:Nn,title:`Nobody matches`,children:`Try another name or handle.`})]}),n?null:(0,V.jsx)(Z,{className:`mt-5`,id:`roles`,children:(0,V.jsxs)(`div`,{className:`px-4 py-3.5 sm:px-5`,children:[(0,V.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Roles`}),(0,V.jsx)(`dl`,{className:`mt-2 grid gap-2 text-sm sm:grid-cols-2`,children:ub.map(e=>(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`dt`,{className:`w-16 shrink-0`,children:(0,V.jsx)(Dx,{role:e})}),(0,V.jsx)(`dd`,{className:`text-muted`,children:Tb[e]})]},e))})]})}),(0,V.jsx)(lT,{open:u,onClose:()=>d(!1)}),(0,V.jsx)(Ix,{open:!!f,onClose:()=>p(null),title:f?`Make ${f.member.displayName} ${wb[f.role].toLowerCase()}?`:``,confirmLabel:`Change role`,tone:f&&ub.indexOf(f.role)<ub.indexOf(f.member.role)?`danger`:`default`,busy:g.busy,error:g.error,onConfirm:()=>g.run(async()=>{await X.patch(zb(r,`/members/${f.member.userId}`),{role:f.role});let e=f.member.userId===a.user.id;p(null),s(`${f.member.displayName} is now ${wb[f.role].toLowerCase()}`),await i(),e&&await o()}),children:f?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{children:[(0,V.jsxs)(`span`,{className:`font-medium text-fg`,children:[wb[f.role],`:`]}),` `,Tb[f.role]]}),(0,V.jsxs)(`p`,{children:[`The change applies to every project in the workspace at once`,f.member.userId===a.user.id?`, including for you`:``,`.`]}),[`owner`,`admin`].includes(f.member.role)&&![`owner`,`admin`].includes(f.role)?(0,V.jsx)(`p`,{children:`Their pending invites, share links and API tokens are revoked.`}):null,f.member.role===`owner`&&f.role===`admin`?(0,V.jsx)(`p`,{children:`Their pending owner invites are revoked.`}):null,[`owner`,`admin`].includes(f.role)||[`owner`,`admin`].includes(f.member.role)?(0,V.jsx)(`p`,{className:`text-xs`,children:`Changes to owners and admins, and making someone one, ask for your passkey.`}):null]}):null}),(0,V.jsx)(Ix,{open:!!m,onClose:()=>h(null),title:m?.userId===a.user.id?`Leave ${e.workspace.name}?`:`Remove ${m?.displayName}?`,confirmLabel:m?.userId===a.user.id?`Leave workspace`:`Remove`,tone:`danger`,busy:g.busy,error:g.error,onConfirm:()=>g.run(async()=>{let e=m.userId===a.user.id,t=await X.delete(zb(r,`/members/${m.userId}`),!e&&b.length&&!x?{revokeTokens:!1}:{});if(e){nx(`/`);return}h(null);let n=t?.revoked?.tokens||0;s(n?`Removed ${m.displayName} and revoked ${n} API ${n===1?`token`:`tokens`}`:`Removed ${m.displayName}`),await i()}),children:m?.userId===a.user.id?(0,V.jsx)(`p`,{children:`You lose access to every project here, and your pending invites, share links and API tokens are revoked. An admin can invite you again.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{children:`They lose access to every project at once. Their comments stay.`}),[`owner`,`admin`].includes(m?.role)?(0,V.jsx)(`p`,{children:`Their pending invites and share links are revoked.`}):null,n?y.loading?(0,V.jsx)(`p`,{children:`Checking their API tokens...`}):y.error?(0,V.jsxs)(`p`,{className:`text-warn`,"data-sw-remove-tokens-unknown":!0,children:[`Their API tokens could not be checked (`,y.error.message,`). Any that still work are revoked with them.`]}):b.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Rx,{checked:x,onChange:S,id:`remove-revoke-tokens`,children:[`Revoke the `,b.length,` API `,b.length===1?`token`:`tokens`,` they made (`,b.map(e=>e.name).join(`, `),`)`]}),x?null:(0,V.jsx)(`p`,{className:`text-warn`,children:`Kept tokens stop working anyway while they are not an admin here, and work again if they come back as one.`})]}):(0,V.jsx)(`p`,{children:`They made no API tokens that still work.`}):null]})})]})}var dT={own:`solid`,manage:`accent`,comment:`ok`,view:`neutral`};function fT({level:e}){return(0,V.jsx)(H,{tone:dT[e],className:`px-2 py-0.5 text-[11px]`,"data-sw-access":e,children:Db[e]})}var pT=()=>(0,V.jsxs)(`span`,{className:`inline-flex h-[22px] items-center align-middle text-faint`,children:[(0,V.jsx)(`span`,{className:`h-[1.5px] w-2.5 rounded-full bg-current`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`sr-only`,children:`No access`})]});function mT(){let{workspaceId:e}=qE(),t=yx(zb(e,`/access`)),[n,r]=(0,O.useState)(()=>Qb()===`#roles`?`roles`:`projects`);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`Access`,description:`Who can reach which project, and with what. People get their role everywhere; tokens and share links reach one project.`}),t.loading?(0,V.jsx)(Px,{}):null,t.error?(0,V.jsx)(Fx,{error:t.error,onRetry:t.reload}):null,t.data?(0,V.jsxs)(Zy,{value:n,onValueChange:r,children:[(0,V.jsxs)(nb,{className:`mb-4 w-full sm:inline-flex sm:w-auto`,children:[(0,V.jsx)(rb,{value:`projects`,className:`h-11 px-3 lg:h-8`,"data-sw-tab":`projects`,children:`By project`}),(0,V.jsx)(rb,{value:`people`,className:`h-11 px-3 lg:h-8`,"data-sw-tab":`people`,children:`By person`}),(0,V.jsx)(rb,{value:`roles`,className:`h-11 px-3 lg:h-8`,"data-sw-tab":`roles`,children:`Roles`})]}),(0,V.jsx)(ib,{value:`projects`,children:(0,V.jsx)(hT,{data:t.data})}),(0,V.jsx)(ib,{value:`people`,children:(0,V.jsx)(gT,{data:t.data})}),(0,V.jsx)(ib,{value:`roles`,children:(0,V.jsx)(_T,{})})]}):null]})}function hT({data:e}){let{workspaceId:t}=qE(),[n,r]=(0,O.useState)(e.projects[0]?.id||``);if(!e.projects.length)return(0,V.jsx)(Z,{children:(0,V.jsx)(Ly,{icon:sn,title:`No projects yet`,children:`People still have their roles; tokens and share links come with projects.`})});let i=[...e.people.map(e=>({key:e.userId,kind:`person`,label:e.displayName,sub:`@${e.handle}`,badge:(0,V.jsx)(Dx,{role:e.role}),reaches:()=>!0,cell:()=>(0,V.jsx)(fT,{level:e.access})})),...e.tokens.map(e=>({key:e.id,kind:`token`,label:e.name,sub:`${e.prefix}…${e.createdBy?.left?` · maker left`:``}`,warn:e.createdBy?.left,reaches:t=>t===e.projectId,cell:t=>t===e.projectId?(0,V.jsx)(dw,{scopes:e.scopes}):(0,V.jsx)(pT,{})})),...e.shares.map(e=>({key:e.id,kind:`share`,label:e.name,sub:`Guests · expires ${Sb(e.expiresAt)}`,lock:e.passcode,reaches:t=>t===e.projectId,cell:t=>t===e.projectId?(0,V.jsx)(tw,{mode:e.mode}):(0,V.jsx)(pT,{})}))],a={person:Nn,token:qe,share:at},o=e.projects.find(e=>e.id===n),s=Object.values(e.pendingInvites).reduce((e,t)=>e+t,0);return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[s?(0,V.jsxs)(Q,{tone:`info`,action:(0,V.jsx)(ix,{to:`/w/${t}/invites`,className:`inline-flex h-11 items-center text-sm font-medium text-accent underline-offset-2 hover:underline lg:h-auto`,children:`Invites`}),children:[s,` pending `,s===1?`invite`:`invites`,` will add`,` `,Object.entries(e.pendingInvites).map(([e,t])=>`${t} ${wb[e].toLowerCase()}${t===1?``:`s`}`).join(`, `),` `,`when used.`]}):null,e.shareLinksOn?null:(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`Share links are off in this workspace.`}),(0,V.jsx)(Z,{className:`hidden overflow-x-auto md:block`,"data-sw-access-matrix":!0,children:(0,V.jsxs)(`table`,{className:`w-full min-w-[40rem] border-collapse text-sm`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`border-b border-line text-left text-[12px] font-medium text-muted`,children:[(0,V.jsx)(`th`,{scope:`col`,className:`sticky left-0 bg-surface px-5 py-2.5 font-medium`,children:`Who`}),e.projects.map(e=>(0,V.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:e.name},e.id))]})}),(0,V.jsx)(`tbody`,{className:`divide-y divide-line`,children:i.map(t=>{let n=a[t.kind];return(0,V.jsxs)(`tr`,{"data-sw-access-row":t.kind,children:[(0,V.jsx)(`th`,{scope:`row`,className:`sticky left-0 bg-surface px-5 py-2.5 text-left font-normal`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,V.jsx)(n,{size:15,className:`shrink-0 text-faint`,"aria-hidden":`true`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 truncate font-medium text-fg`,children:[t.label,t.lock?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(st,{size:12,className:`text-muted`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`sr-only`,children:`(passcode)`})]}):null]}),(0,V.jsx)(`p`,{className:B(`truncate text-xs`,t.warn?`text-warn`:`text-muted`),children:t.sub})]}),t.badge?(0,V.jsx)(`span`,{className:`ml-auto pl-2`,children:t.badge}):null]})}),e.projects.map(e=>(0,V.jsx)(`td`,{className:`px-3 py-2.5`,children:t.cell(e.id)},e.id))]},t.key)})})]})}),(0,V.jsxs)(`div`,{className:`space-y-3 md:hidden`,children:[(0,V.jsx)($,{label:`Project`,children:t=>(0,V.jsxs)(Vy,{value:n,onValueChange:r,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full`,...t,"data-sw-access-project":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:e.projects.map(e=>(0,V.jsx)(Yy,{value:e.id,children:e.name},e.id))})]})}),(0,V.jsx)(Z,{children:(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:i.filter(e=>e.reaches(o.id)).map(e=>{let t=a[e.kind];return(0,V.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,V.jsx)(t,{size:15,className:`shrink-0 text-faint`,"aria-hidden":`true`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.label}),(0,V.jsx)(`p`,{className:B(`truncate text-xs`,e.warn?`text-warn`:`text-muted`),children:e.sub})]}),(0,V.jsx)(`div`,{className:`shrink-0`,children:e.cell(o.id)})]},e.key)})})})]})]})}function gT({data:e}){let[t,n]=(0,O.useState)(e.people[0]?`person:${e.people[0].userId}`:``),[r,i]=t.split(`:`),a=r===`person`?e.people.find(e=>e.userId===i):null,o=r===`token`?e.tokens.find(e=>e.id===i):null,s=r===`share`?e.shares.find(e=>e.id===i):null,c=t=>e.projects.find(e=>e.id===t)?.name||`a deleted project`;return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)($,{label:`Show access for`,children:r=>(0,V.jsxs)(Vy,{value:t,onValueChange:n,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full sm:w-96`,...r,"data-sw-access-person":!0,children:(0,V.jsx)(Uy,{placeholder:`Pick someone`})}),(0,V.jsxs)(qy,{children:[(0,V.jsxs)(Hy,{children:[(0,V.jsx)(Jy,{children:`People`}),e.people.map(e=>(0,V.jsxs)(Yy,{value:`person:${e.userId}`,children:[e.displayName,` (@`,e.handle,`)`]},e.userId))]}),e.tokens.length?(0,V.jsxs)(Hy,{children:[(0,V.jsx)(Jy,{children:`API tokens`}),e.tokens.map(e=>(0,V.jsxs)(Yy,{value:`token:${e.id}`,children:[e.name,` (`,e.prefix,`…)`]},e.id))]}):null,e.shares.length?(0,V.jsxs)(Hy,{children:[(0,V.jsx)(Jy,{children:`Share links`}),e.shares.map(e=>(0,V.jsx)(Yy,{value:`share:${e.id}`,children:e.name},e.id))]}):null]})]})}),a?(0,V.jsxs)(Z,{"data-sw-access-detail":`person`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-line px-4 py-4 sm:px-5`,children:[(0,V.jsx)(fa,{name:a.displayName,person:!0,className:`h-11 w-11 text-sm`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`font-semibold text-fg`,children:a.displayName}),(0,V.jsxs)(`p`,{className:`text-xs text-muted`,children:[`@`,a.handle,` · joined `,(0,V.jsx)(Ox,{value:a.joinedAt}),` · active `,(0,V.jsx)(Ox,{value:a.lastActiveAt,empty:`not yet`})]})]}),(0,V.jsx)(Dx,{role:a.role})]}),(0,V.jsxs)(`div`,{className:`grid gap-5 px-4 py-4 sm:px-5 md:grid-cols-2`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`mb-2 text-[13px] font-semibold text-fg`,children:`Projects`}),e.projects.length?(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:e.projects.map(e=>(0,V.jsxs)(`li`,{className:`flex items-center justify-between gap-3 text-sm`,children:[(0,V.jsx)(`span`,{className:`truncate text-fg`,children:e.name}),(0,V.jsx)(fT,{level:a.access})]},e.id))}):(0,V.jsx)(`p`,{className:`text-sm text-muted`,children:`No projects yet.`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h3`,{className:`mb-2 text-[13px] font-semibold text-fg`,children:[`As `,wb[a.role].toLowerCase(),`, they can`]}),(0,V.jsx)(`ul`,{className:`space-y-1.5 text-sm`,children:Eb.map(([e,t])=>{let n=db(a.role,t);return(0,V.jsxs)(`li`,{className:B(`flex items-start gap-2`,n?`text-fg`:`text-faint line-through`),children:[n?(0,V.jsx)(ue,{size:14,className:`mt-0.5 shrink-0 text-ok`,"aria-hidden":`true`}):(0,V.jsx)(bt,{size:14,className:`mt-0.5 shrink-0`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`sr-only`,children:n?`Can:`:`Cannot:`}),e]},e)})})]})]}),e.tokens.some(e=>e.createdBy?.userId===a.userId)?(0,V.jsxs)(`div`,{className:`border-t border-line px-4 py-4 sm:px-5`,children:[(0,V.jsx)(`h3`,{className:`mb-2 text-[13px] font-semibold text-fg`,children:`Tokens they made`}),(0,V.jsx)(`ul`,{className:`space-y-1.5 text-sm`,children:e.tokens.filter(e=>e.createdBy?.userId===a.userId).map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(qe,{size:13,className:`text-faint`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`text-fg`,children:e.name}),(0,V.jsxs)(`span`,{className:`text-xs text-muted`,children:[`in `,c(e.projectId)]}),(0,V.jsx)(dw,{scopes:e.scopes})]},e.id))})]}):null]}):null,o?(0,V.jsxs)(Z,{"data-sw-access-detail":`token`,children:[(0,V.jsx)(Sx,{icon:qe,title:o.name,description:`${o.prefix}… · ${c(o.projectId)} only`}),(0,V.jsxs)(`div`,{className:`space-y-2 px-4 py-4 text-sm sm:px-5`,children:[(0,V.jsx)(dw,{scopes:o.scopes}),(0,V.jsxs)(`p`,{className:`text-muted`,children:[`Made by `,o.createdBy?.displayName||`unknown`,` · last used `,(0,V.jsx)(Ox,{value:o.lastUsedAt,empty:`never`}),` ·`,` `,o.expiresAt?(0,V.jsx)(Ox,{value:o.expiresAt,prefix:`expires `}):`no expiry`]}),o.createdBy?.left?(0,V.jsx)(Q,{tone:`warn`,children:`The person who made this token has left the workspace, so it no longer works. Revoke it.`}):null]})]}):null,s?(0,V.jsxs)(Z,{"data-sw-access-detail":`share`,children:[(0,V.jsx)(Sx,{icon:Fe,title:s.name,description:`Guests · ${c(s.projectId)} only`}),(0,V.jsxs)(`div`,{className:`space-y-2 px-4 py-4 text-sm sm:px-5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(tw,{mode:s.mode}),s.passcode?(0,V.jsxs)(H,{tone:`neutral`,className:`px-2 py-0.5 text-[11px]`,children:[(0,V.jsx)(st,{size:11,"aria-hidden":`true`}),` Passcode`]}):null]}),(0,V.jsxs)(`p`,{className:`text-muted`,children:[`Opened `,s.opens,` `,s.opens===1?`time`:`times`,` · last `,(0,V.jsx)(Ox,{value:s.lastUsedAt,empty:`never`}),` ·`,` `,(0,V.jsx)(Ox,{value:s.expiresAt,prefix:`expires `})]}),(0,V.jsxs)(`p`,{className:`text-muted`,children:[`Guests see this project's boards and comments`,s.mode===`comment`?`, and add comments and replies marked as a guest`:``,`. Nothing else in the workspace.`]})]})]}):null]})}function _T(){return(0,V.jsxs)(Z,{"data-sw-roles-table":!0,children:[(0,V.jsx)(Sx,{icon:sn,title:`Roles and permissions`,description:`A role applies to every project in the workspace. Guests come from share links.`}),(0,V.jsx)(`ul`,{className:`divide-y divide-line md:hidden`,"data-sw-roles-list":!0,children:Eb.map(([e,t])=>(0,V.jsxs)(`li`,{className:`flex items-center justify-between gap-3 px-4 py-2.5 text-sm`,children:[(0,V.jsx)(`span`,{className:`min-w-0 text-fg`,children:e}),(0,V.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted`,children:[(0,V.jsx)(Dx,{role:t}),t===`owner`?`only`:`and up`]})]},e))}),(0,V.jsx)(`div`,{className:`hidden overflow-x-auto md:block`,children:(0,V.jsxs)(`table`,{className:`w-full min-w-[36rem] border-collapse text-sm`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,V.jsx)(`th`,{scope:`col`,className:`px-5 py-2.5 text-left text-[11px] font-medium tracking-wide text-faint uppercase`,children:`Can`}),[...ub,`guest`].map(e=>(0,V.jsx)(`th`,{scope:`col`,className:`px-2 py-2.5 text-center`,children:(0,V.jsx)(Dx,{role:e})},e))]})}),(0,V.jsx)(`tbody`,{className:`divide-y divide-line`,children:Eb.map(([e,t])=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{scope:`row`,className:`px-5 py-2 text-left font-normal text-fg`,children:e}),ub.map(e=>(0,V.jsxs)(`td`,{className:`px-2 py-2 text-center`,children:[db(e,t)?(0,V.jsx)(ue,{size:15,className:`mx-auto text-ok`,"aria-hidden":`true`}):(0,V.jsx)(bt,{size:15,className:`mx-auto text-faint`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`sr-only`,children:db(e,t)?`Yes`:`No`})]},e)),(0,V.jsx)(`td`,{className:`px-2 py-2 text-center`,children:t===`viewer`?(0,V.jsx)(`span`,{className:`text-xs text-muted`,children:`One project`}):e.startsWith(`Comment`)?(0,V.jsx)(`span`,{className:`text-xs text-muted`,children:`Comment and reply, on comment links`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(bt,{size:15,className:`mx-auto text-faint`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`sr-only`,children:`No`})]})})]},e))})]})}),(0,V.jsxs)(`dl`,{className:`grid gap-2 border-t border-line px-5 py-4 text-sm sm:grid-cols-2`,children:[ub.map(e=>(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`dt`,{className:`w-16 shrink-0`,children:(0,V.jsx)(Dx,{role:e})}),(0,V.jsx)(`dd`,{className:`text-muted`,children:Tb[e]})]},e)),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`dt`,{className:`w-16 shrink-0`,children:(0,V.jsx)(Dx,{role:`guest`})}),(0,V.jsx)(`dd`,{className:`text-muted`,children:`Someone with a share link: one project, no account, comments marked as a guest.`})]})]})]})}var vT={user:jn,token:ae,guest:Ve,system:Qt},yT=`__all__`,bT=e=>{let t=e.replace(/_/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)};function xT(){let{workspaceId:e}=qE(),t=yx(zb(e,`/audit/filters`)),[n,r]=(0,O.useState)(yT),[i,a]=(0,O.useState)(yT),[o,s]=(0,O.useState)(`any`),[c,l]=(0,O.useState)(``),[u,d]=(0,O.useState)(``),f=_x();(0,O.useEffect)(()=>{let e=window.setTimeout(()=>d(c.trim()),300);return()=>window.clearTimeout(e)},[c]);let p=(0,O.useCallback)(()=>{let e=new URLSearchParams;n!==yT&&e.set(`actor`,n),i!==yT&&e.set(`action`,i);let t=Nb.find(([e])=>e===o)?.[2];return t&&e.set(`from`,new Date(Date.now()-t*864e5).toISOString()),u&&e.set(`q`,u),e},[n,i,o,u]),m=(0,O.useCallback)(t=>{let n=p();return n.set(`limit`,`50`),t&&n.set(`before`,String(t)),zb(e,`/audit?${n}`)},[p,e]),h=()=>f.run(()=>Lb(`GET`,zb(e,`/audit/export?${p()}`),void 0,`audit.csv`)),g=bx(m,`entries`),_=g.items,v=t.data?.actors||[],y=t.data?.actions||[],b=n!==yT||i!==yT||o!==`any`||!!u,x=v.filter(e=>e.type===`user`),S=v.filter(e=>e.type===`token`),C=v.filter(e=>e.type===`guest`),w=e=>`${e.type===`guest`?`share`:e.type}:${e.id}`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`Audit log`,description:jx(`Membership, invites, projects, tokens, share links, pushes and moderation in this workspace.`),actions:(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:h,disabled:f.busy||Av,className:`lg:h-9`,"data-sw-audit-export":!0,children:[f.busy?(0,V.jsx)(Y,{}):(0,V.jsx)(ke,{size:15,"aria-hidden":`true`}),` Export CSV`]})}),(0,V.jsxs)(Z,{className:`mb-4 p-3 sm:p-4`,"data-sw-audit-filters":!0,children:[(0,V.jsx)(`div`,{className:`mb-2`,children:(0,V.jsx)(zy,{size:`touch`,icon:Xt,value:c,onChange:e=>l(e.target.value),placeholder:`Search names, projects, tokens, links`,"aria-label":`Search the audit log`,className:`lg:h-9`,maxLength:100,"data-sw-audit-search":!0})}),(0,V.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,V.jsxs)(Vy,{value:n,onValueChange:r,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full lg:h-9`,"aria-label":`Who`,"data-sw-audit-actor":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsxs)(qy,{children:[(0,V.jsx)(Yy,{value:yT,children:`Everyone`}),x.length?(0,V.jsxs)(Hy,{children:[(0,V.jsx)(Jy,{children:`People`}),x.map(e=>(0,V.jsxs)(Yy,{value:w(e),children:[e.label,e.handle?` (@${e.handle})`:``]},e.id))]}):null,S.length?(0,V.jsxs)(Hy,{children:[(0,V.jsx)(Jy,{children:`API tokens`}),S.map(e=>(0,V.jsx)(Yy,{value:w(e),children:e.label},e.id))]}):null,C.length?(0,V.jsxs)(Hy,{children:[(0,V.jsx)(Jy,{children:`Share link guests`}),C.map(e=>(0,V.jsx)(Yy,{value:w(e),children:e.link},e.id))]}):null]})]}),(0,V.jsxs)(Vy,{value:i,onValueChange:a,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full lg:h-9`,"aria-label":`What`,"data-sw-audit-action":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsxs)(qy,{children:[(0,V.jsx)(Yy,{value:yT,children:`All actions`}),y.map(e=>(0,V.jsx)(Yy,{value:e,children:bT(e)},e))]})]}),(0,V.jsxs)(Vy,{value:o,onValueChange:s,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full lg:h-9`,"aria-label":`When`,"data-sw-audit-range":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:Nb.map(([e,t])=>(0,V.jsx)(Yy,{value:e,children:t},e))})]})]}),b?(0,V.jsxs)(J,{size:`touch`,variant:`ghost`,className:`mt-2 lg:h-8`,onClick:()=>{r(yT),a(yT),s(`any`),l(``),d(``)},children:[(0,V.jsx)(Ln,{size:14,"aria-hidden":`true`}),` Clear filters`]}):null,(0,V.jsx)(Tx,{error:f.error})]}),(0,V.jsxs)(Z,{children:[g.loading?(0,V.jsx)(Px,{}):null,g.error?(0,V.jsx)(`div`,{className:`p-4`,children:(0,V.jsx)(Fx,{error:g.error,onRetry:_.length?g.loadMore:g.reload})}):null,!g.loading&&!g.error&&!_.length?(0,V.jsx)(Ly,{icon:Jt,title:b?`Nothing matches these filters`:`No events yet`}):null,!g.loading&&_.length?(0,V.jsx)(`ol`,{className:`divide-y divide-line`,"data-sw-audit-list":!0,children:_.map(e=>{let t=vT[e.actor.type]||Qt;return(0,V.jsxs)(`li`,{className:`flex gap-3 px-4 py-3 sm:px-5`,"data-sw-audit-entry":e.action,children:[(0,V.jsx)(`span`,{className:`mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted`,children:(0,V.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-fg`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:e.actor.label}),e.actor.type===`guest`&&e.actor.named?(0,V.jsx)(`span`,{className:`text-muted`,children:` (guest)`}):null,e.actor.type===`token`?(0,V.jsx)(`span`,{className:`text-muted`,children:` (token)`}):null,` `,Mb(e)]}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,children:[(0,V.jsx)(Ox,{value:e.at}),` `,(0,V.jsxs)(`span`,{className:`text-faint`,children:[`· `,Cb(e.at)]}),e.ip?` · ${e.ip}`:``]})]})]},e.id)})}):null,g.next&&!g.loading?(0,V.jsx)(`div`,{className:`border-t border-line p-3 text-center`,children:(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:g.loadMore,disabled:g.more,className:`lg:h-9`,"data-sw-audit-more":!0,children:[g.more?(0,V.jsx)(Y,{}):null,` Load older events`]})}):null]})]})}function ST(){let{data:e,isAdmin:t,isOwner:n,workspaceId:r,reload:i}=qE(),{me:a,refresh:o}=ux(),s=px(),[c,l]=(0,O.useState)(e.workspace.name);(0,O.useEffect)(()=>l(e.workspace.name),[e.workspace.name]);let u=_x(),d=_x(),f=_x(),p=_x(),m=_x(),h=_x(),[g,_]=(0,O.useState)(!1),[v,y]=(0,O.useState)(!1),[b,x]=(0,O.useState)(null),S=e.members.filter(e=>e.role===`owner`).length,C=n&&S<=1,w=e.workspace.settings.shareLinks,T=!!e.features?.publicProjects,E=!!e.workspace.settings.publicProjects,D=e.features?.deleteWorkspace!==!1,k=e=>d.run(async()=>{await X.patch(zb(r,`/settings`),{shareLinks:e}),await i(),x(null),s(e?`Share links are on`:`Share links are off. Every link stopped working.`)}),A=e=>f.run(async()=>{await X.patch(zb(r,`/public-projects`),{enabled:e}),await i(),x(null),s(e?`Public projects are on`:`Public projects are off. Every public URL was cleared.`)});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:`Settings`,description:`The workspace name, sharing, export, and leaving or deleting it.`}),(0,V.jsxs)(`div`,{className:`grid gap-5`,children:[(0,V.jsxs)(Z,{children:[(0,V.jsx)(Sx,{icon:Pt,title:`Name`,description:`Shown to members, in invites and to guests of share links.`}),(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),u.run(async()=>{await X.patch(zb(r),{name:c}),await Promise.all([i(),o()]),s(`Workspace renamed`)})},className:`flex flex-col gap-3 px-4 py-4 sm:flex-row sm:items-end sm:px-5`,children:[(0,V.jsx)($,{label:`Workspace name`,className:`flex-1`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:c,onChange:e=>l(e.target.value),maxLength:80,disabled:!t,"data-sw-settings-name":!0})}),t?(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`secondary`,disabled:u.busy||!c.trim()||c===e.workspace.name,children:[u.busy?(0,V.jsx)(Y,{}):null,` Save`]}):null]}),u.error?(0,V.jsx)(`div`,{className:`px-4 pb-4 sm:px-5`,children:(0,V.jsx)(Tx,{error:u.error})}):null]}),(0,V.jsxs)(Z,{"data-sw-settings-shares":!0,children:[(0,V.jsx)(Sx,{icon:at,title:`Share links`,description:`Let admins share a project's boards with people outside the workspace, view-only or with guest comments.`,actions:t?(0,V.jsx)(Lx,{checked:w,label:`Share links`,disabled:d.busy,onChange:e=>e?k(!0):x(`shares`)}):null}),(0,V.jsxs)(`div`,{className:`space-y-2 px-4 py-4 text-sm text-muted sm:px-5`,children:[(0,V.jsx)(`p`,{children:w?`On. Each link reaches one project, expires, can have a passcode and can be revoked. Turning this off stops every link at once; turning it back on restores the ones that are not revoked or expired.`:t?`Off. No share link works in this workspace. Turning this on asks for your passkey.`:`Off. No share link works in this workspace. An admin can turn them on.`}),b===`shares`?null:(0,V.jsx)(Tx,{error:d.error})]})]}),T?(0,V.jsxs)(Z,{"data-sw-settings-public":!0,children:[(0,V.jsx)(Sx,{icon:Ve,title:`Public projects`,description:`Let the owner put a project on the open web: anyone with its URL can view the boards and comments, and change nothing.`,actions:n||t&&E?(0,V.jsx)(Lx,{checked:E,label:`Public projects`,disabled:f.busy,onChange:e=>e?A(!0):x(`public`)}):null}),(0,V.jsxs)(`div`,{className:`space-y-2 px-4 py-4 text-sm text-muted sm:px-5`,children:[(0,V.jsx)(`p`,{children:E?`On. An owner makes a project public on its page. Public boards are view-only and not indexed. Turning this off clears every public URL for good.`:n?`Off. Turning this on asks for your passkey. Each project still stays private until you make it public.`:`Off. Only an owner can turn public projects on.`}),b===`public`?null:(0,V.jsx)(Tx,{error:f.error})]})]}):null,t?(0,V.jsxs)(Z,{"data-sw-settings-export":!0,children:[(0,V.jsx)(Sx,{icon:ke,title:`Export`,description:jx(`A zip of the workspace: members, projects, every board's pages and screenshots, comments and the audit log. No secrets.`),actions:(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,disabled:h.busy||Av,onClick:()=>h.run(async()=>{let e=await Lb(`POST`,zb(r,`/export`),{},`shapewall-export.zip`);s(`Saved ${e.name}`)}),className:`lg:h-9`,"data-sw-export":!0,children:[h.busy?(0,V.jsx)(Y,{}):(0,V.jsx)(ke,{size:15,"aria-hidden":`true`}),` Download a copy`]})}),h.error?(0,V.jsx)(`div`,{className:`px-4 pb-4 sm:px-5`,children:(0,V.jsx)(Tx,{error:h.error})}):null]}):null,(0,V.jsx)(Z,{className:`border-bad/30`,children:(0,V.jsx)(Sx,{icon:De,title:`Leave workspace`,description:C?`You are the only owner. Make someone else an owner first.`:`You lose access to every project here.`,actions:(0,V.jsx)(J,{size:`touch`,variant:`danger`,onClick:()=>_(!0),disabled:C,className:`border border-bad/40 lg:h-9`,"data-sw-leave-workspace":!0,children:`Leave`})})}),n?(0,V.jsxs)(Z,{className:`border-bad/30`,children:[(0,V.jsx)(Sx,{icon:xn,title:`Delete workspace`,description:D?`Every project, board, capture, comment, token, invite, share link and the audit log are deleted. This cannot be undone.`:`The demo keeps this workspace, so there is always something to look at. On a real server, the owner deletes a workspace here.`,actions:(0,V.jsx)(J,{size:`touch`,variant:`danger`,disabled:!D,onClick:()=>y(!0),className:`border border-bad/40 lg:h-9`,"data-sw-delete-workspace":!0,children:`Delete workspace`})}),D?(0,V.jsx)(`div`,{className:`px-4 py-3 sm:px-5`,children:(0,V.jsx)(Q,{tone:`info`,children:`Download a copy first (Export, above) if you may want any of it later.`})}):null]}):null]}),(0,V.jsx)(Ix,{open:g,onClose:()=>_(!1),title:`Leave ${e.workspace.name}?`,confirmLabel:`Leave workspace`,tone:`danger`,busy:p.busy,error:p.error,onConfirm:()=>p.run(async()=>{await X.delete(zb(r,`/members/${a.user.id}`)),nx(`/`)}),children:(0,V.jsx)(`p`,{children:`You lose access to every project here, and your pending invites, share links and API tokens are revoked. An admin can invite you again.`})}),(0,V.jsx)(Ix,{open:b===`shares`,onClose:()=>x(null),title:`Turn share links off?`,confirmLabel:`Turn off`,tone:`danger`,busy:d.busy,error:d.error,onConfirm:()=>k(!1),children:(0,V.jsx)(`p`,{children:`Every share link in this workspace stops working at once, including for guests who have a board open now. Turning this back on restores the links that are not revoked or expired.`})}),(0,V.jsxs)(Ix,{open:b===`public`,onClose:()=>x(null),title:`Turn public projects off?`,confirmLabel:`Turn off`,tone:`danger`,busy:f.busy,error:f.error,onConfirm:()=>A(!1),children:[(0,V.jsx)(`p`,{children:`Every public URL in this workspace stops working at once, for everyone you sent one to.`}),(0,V.jsx)(`p`,{className:`text-bad`,children:`This cannot be undone. The public URLs are cleared for good: turning public projects back on publishes nothing, and a project made public again gets a new URL.`})]}),(0,V.jsx)(Ix,{open:v,onClose:()=>y(!1),title:`Delete ${e.workspace.name}?`,confirmLabel:`Delete forever`,tone:`danger`,confirmText:e.workspace.name,busy:m.busy,error:m.error,onConfirm:()=>m.run(async()=>{await X.delete(zb(r),{confirm:e.workspace.name}),nx(`/`)}),children:(0,V.jsxs)(`p`,{children:[e.members.length,` `,e.members.length===1?`person loses`:`people lose`,` access, and `,e.projects.length,` `,e.projects.length===1?`project is`:`projects are`,` deleted with all their boards and comments. API tokens and share links stop working.`]})})]})}var CT=/\[\[([a-z]+):([^\]\n]{1,120})\]\]/g;function wT(e,t){let n=String(t||``).trim();return e===`comment`?/^#?\d{1,9}$/.test(n)?`comment #${n.replace(/^#/,``)}`:`comment ${n}`:e===`page`?`${n} page`:e===`journey`?`${n} journey`:e===`check`?`checks for ${n}`:n}function TT(e,t=null){return String(e||``).replace(CT,(e,n,r)=>t&&t(n,r)||wT(n,r))}function ET(e,t=null){return TT(e,t).replace(/^[^[\]]{0,120}\]\]/,``).replace(/\[\[[^\]]{0,120}$/,``).replace(/```[^\n]*\n?/g,``).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/`([^`]*)`/g,`$1`).replace(/`/g,``).replace(/(\*\*|__)(.+?)\1/g,`$2`).replace(/(^|[\s(])[*_]([^*_\s][^*_]*?)[*_](?=[\s).,;:!?]|$)/g,`$1$2`).replace(/\*\*|__/g,``).replace(/~~(.+?)~~/g,`$1`).replace(/^[ \t]{0,3}#{1,6}[ \t]+/gm,``).replace(/^[ \t]{0,3}>[ \t]?/gm,``).replace(/^[ \t]*(?:[-*+]|\d+[.)])[ \t]+/gm,``).replace(/^[ \t]*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-*:?\s*$/gm,``).replace(/[ \t]*\|[ \t]*/g,` `).replace(/[ \t]+/g,` `).trim()}var DT={wrong:`Wrong`,ignored:`Didn't do what I asked`,slow:`Too slow`,unsafe:`Unsafe change`,other:`Other`},OT=[[`7`,`Last 7 days`],[`30`,`Last 30 days`],[`90`,`Last 90 days`],[`365`,`Last year`]],kT=`__all__`,AT=(e,t)=>t?`${Math.round(e/t*100)}%`:`–`;function jT(e){let t=`shapewall-agent-feedback-${String(e.exportedAt||new Date().toISOString()).slice(0,10)}.json`;Rb(new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),t)}function MT(e,t){let[n,r]=(0,O.useState)({url:null,data:null,error:null}),[i,a]=(0,O.useState)(0);return(0,O.useEffect)(()=>{let n=!0;return e(t).then(e=>n&&r({url:t,data:e,error:null}),e=>n&&r(n=>({url:t,data:n.data,error:e}))),()=>{n=!1}},[t,i]),{...n,loading:n.url!==t,reload:()=>a(e=>e+1)}}function NT({baseUrl:e,get:t,touch:n=!1,intro:r=null}){let[i,a]=(0,O.useState)(`all`),[o,s]=(0,O.useState)(`30`),[c,l]=(0,O.useState)(kT),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(null),m=new URLSearchParams({days:o});i!==`all`&&m.set(`rating`,i),c!==kT&&m.set(`board`,c);let h=MT(t,`${e}?${m}`),g=h.data,_=n?`touch`:`sm`;return(0,V.jsxs)(`div`,{"data-sw-agent-feedback":!0,children:[(0,V.jsx)(Cx,{title:`Agent feedback`,description:`Thumbs up and down on chat answers, with the reasons and notes people gave. Use them to tune your agent's instructions.`,actions:(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:async()=>{d(!0),p(null);try{jT(await t(`${e}/export`))}catch(e){p(e)}finally{d(!1)}},disabled:u,className:`lg:h-9`,"data-sw-agent-feedback-export":!0,children:[u?(0,V.jsx)(Y,{}):(0,V.jsx)(ke,{size:15,"aria-hidden":`true`}),` Export JSON`]})}),r,f?(0,V.jsx)(`div`,{className:`mb-4`,children:(0,V.jsx)(Tx,{error:f})}):null,(0,V.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,"data-sw-agent-feedback-filters":!0,children:[(0,V.jsx)(lb,{label:`Rating`,large:n,value:i,onChange:a,options:[{id:`all`,label:`All`},{id:`up`,label:`Up`},{id:`down`,label:`Down`}]}),(0,V.jsxs)(Vy,{value:o,onValueChange:s,children:[(0,V.jsx)(Ky,{size:_,className:`w-40`,"aria-label":`Time range`,"data-sw-agent-feedback-range":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:OT.map(([e,t])=>(0,V.jsx)(Yy,{value:e,children:t},e))})]}),g?.boards?.length>1?(0,V.jsxs)(Vy,{value:c,onValueChange:l,children:[(0,V.jsx)(Ky,{size:_,className:`w-48`,"aria-label":`Board`,"data-sw-agent-feedback-board":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsxs)(qy,{children:[(0,V.jsx)(Yy,{value:kT,children:`All boards`}),g.boards.map(e=>(0,V.jsx)(Yy,{value:e.id,children:e.title},e.id))]})]}):null,h.loading&&g?(0,V.jsx)(Y,{}):null]}),!g&&h.loading?(0,V.jsx)(Z,{children:(0,V.jsx)(Px,{label:`Loading agent feedback`})}):h.error&&!g?(0,V.jsx)(Z,{className:`p-4`,children:(0,V.jsx)(Fx,{error:h.error,onRetry:h.reload})}):g?(0,V.jsx)(FT,{data:g}):null]})}function PT({label:e,value:t,detail:n,icon:r}){return(0,V.jsxs)(Z,{className:`p-4`,children:[(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 text-caption font-medium text-muted`,children:[r?(0,V.jsx)(r,{size:13,"aria-hidden":`true`}):null,e]}),(0,V.jsx)(`p`,{className:`mt-1 text-heading font-semibold text-fg tabular-nums`,children:t}),n?(0,V.jsx)(`p`,{className:`text-caption text-muted`,children:n}):null]})}function FT({data:e}){let{summary:t,items:n}=e,r=Object.entries(t.reasons||{}).filter(([,e])=>e>0).sort((e,t)=>t[1]-e[1]);return t.total?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 sm:gap-3`,"data-sw-agent-feedback-totals":`${t.up}/${t.down}`,children:[(0,V.jsx)(PT,{label:`Ratings`,value:t.total,detail:`Last ${e.days} days`}),(0,V.jsx)(PT,{label:`Thumbs up`,icon:yn,value:t.up,detail:AT(t.up,t.total)}),(0,V.jsx)(PT,{label:`Thumbs down`,icon:_n,value:t.down,detail:AT(t.down,t.total)})]}),r.length?(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,"data-sw-agent-feedback-reasons":!0,children:[(0,V.jsx)(`span`,{className:`text-caption font-medium text-muted`,children:`Reasons given:`}),r.map(([e,t])=>(0,V.jsxs)(H,{children:[DT[e]||e,` `,(0,V.jsx)(`span`,{className:`tabular-nums`,children:t})]},e))]}):null,(0,V.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,V.jsx)(LT,{title:`Per day`,rows:t.byDay.map(e=>({key:e.day,label:IT(e.day),...e}))}),(0,V.jsx)(LT,{title:`Per agent`,rows:t.byAgent.map(e=>({key:e.agent,label:e.agent,...e}))})]}),(0,V.jsxs)(Z,{"data-sw-agent-feedback-items":n.length,children:[(0,V.jsx)(Sx,{title:`Ratings`,description:e.more?`The newest ${n.length}; ${e.more} more in the export.`:`Newest first.`}),n.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line`,children:n.map(e=>(0,V.jsx)(RT,{item:e},`${e.boardId}/${e.threadId}/${e.messageId}/${e.rater}`))}):(0,V.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted sm:px-5`,children:`No ratings match these filters.`})]})]}):(0,V.jsx)(Z,{children:(0,V.jsx)(Ly,{icon:gt,title:`No feedback yet`,children:`When people rate the agent's answers in the board chat (thumbs up or down under an answer), the ratings show here.`})})}var IT=e=>{let t=new Date(`${e}T12:00:00Z`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})};function LT({title:e,rows:t}){return(0,V.jsxs)(Z,{children:[(0,V.jsx)(Sx,{title:e}),(0,V.jsxs)(`table`,{className:`w-full text-ui`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`text-caption text-muted`,children:[(0,V.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left font-medium sm:px-5`,children:e===`Per day`?`Day`:`Agent`}),(0,V.jsxs)(`th`,{scope:`col`,className:`px-2 py-2 text-right font-medium`,children:[(0,V.jsx)(yn,{size:13,"aria-hidden":`true`,className:`ml-auto`}),(0,V.jsx)(`span`,{className:`sr-only`,children:`Thumbs up`})]}),(0,V.jsxs)(`th`,{scope:`col`,className:`px-4 py-2 text-right font-medium sm:px-5`,children:[(0,V.jsx)(_n,{size:13,"aria-hidden":`true`,className:`ml-auto`}),(0,V.jsx)(`span`,{className:`sr-only`,children:`Thumbs down`})]})]})}),(0,V.jsx)(`tbody`,{className:`divide-y divide-line`,children:t.slice(0,10).map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{scope:`row`,className:`truncate px-4 py-2 text-left font-normal text-fg sm:px-5`,children:e.label}),(0,V.jsx)(`td`,{className:`px-2 py-2 text-right text-fg tabular-nums`,children:e.up}),(0,V.jsx)(`td`,{className:`px-4 py-2 text-right text-fg tabular-nums sm:px-5`,children:e.down})]},e.key))})]})]})}function RT({item:e}){let t=e.rating===`up`?yn:_n;return(0,V.jsxs)(`li`,{className:`px-4 py-3 sm:px-5`,"data-sw-agent-feedback-item":e.rating,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-caption text-muted`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-fg`,children:[(0,V.jsx)(t,{size:13,"aria-hidden":`true`}),e.rating===`up`?`Thumbs up`:`Thumbs down`]}),(0,V.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,V.jsx)(`span`,{children:e.raterName||`Someone`}),(0,V.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,V.jsx)(`span`,{children:e.agentName}),e.boardTitle?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,V.jsx)(`span`,{children:e.boardTitle})]}):null,(0,V.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,V.jsx)(Ox,{value:e.updatedAt})]}),e.reasons?.length?(0,V.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.reasons.map(e=>(0,V.jsx)(H,{tone:`warn`,children:DT[e]||e},e))}):null,e.note?(0,V.jsx)(`p`,{className:`mt-1.5 text-sm break-words whitespace-pre-wrap text-fg`,children:e.note}):null,(0,V.jsxs)(`dl`,{className:`mt-2 space-y-1 rounded-md bg-surface-2/60 px-2.5 py-2 text-ui`,children:[(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`dt`,{className:`w-16 shrink-0 text-muted`,children:`Question`}),(0,V.jsx)(`dd`,{className:`min-w-0 break-words text-fg`,children:e.question||`(an image or an empty message)`})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`dt`,{className:`w-16 shrink-0 text-muted`,children:`Answer`}),(0,V.jsx)(`dd`,{className:`line-clamp-3 min-w-0 break-words text-fg/90`,children:ET(e.answer)||`(no text)`})]})]})]})}var zT=new Set,BT=new Set,VT=null,HT=null,UT=2e3,WT=6e4;function GT(e=`event`){for(let t of[...zT])try{t(e)}catch{}}function KT(){document.visibilityState!==`visible`||HT||(HT=window.setTimeout(()=>{HT=null,GT(`shown`),aE(null)},50))}function qT(){return typeof document<`u`&&document.querySelector(`meta[name="shapewall-local-console"]`)?`/api/agent/events`:`api/agent/events`}var JT=null,YT=!1;function XT(e){let t=e===!0;t!==JT&&(JT=t,YT&&ZT())}function ZT(){QT(),JT!==!0||Lv||typeof window.fetch!=`function`||typeof window.TextDecoder!=`function`||Object.keys(Wv()).length&&(VT={controller:null,timer:null,delay:UT},tE(VT))}function QT(){VT&&(window.clearTimeout(VT.timer),VT.controller?.abort()),VT=null}function $T(){YT=!0,window.addEventListener(`focus`,KT),document.addEventListener(`visibilitychange`,KT),ZT()}function eE(e){let t=`message`,n=``;for(let r of e.split(`
52
+ `))r.startsWith(`event:`)?t=r.slice(6).trim():r.startsWith(`data:`)&&(n+=r.slice(5).trim());if(t===`agents`&&GT(`event`),t===`batch`)try{aE(JSON.parse(n).board)}catch{}}async function tE(e){let t=new AbortController;e.controller=t;let n=Date.now(),r=!1;try{let e=await window.fetch(qT(),{headers:{Accept:`text/event-stream`,...Wv()},credentials:`same-origin`,cache:`no-store`,signal:t.signal});if(!e.ok||!e.body||!/text\/event-stream/.test(e.headers.get(`content-type`)||``)){r=e.status!==503;return}let n=e.body.getReader(),i=new window.TextDecoder,a=``;for(;;){let{value:e,done:t}=await n.read();if(t)break;a+=i.decode(e,{stream:!0}).replace(/\r\n?/g,`
53
+ `);let r;for(;(r=a.indexOf(`
54
+
55
+ `))>=0;)eE(a.slice(0,r)),a=a.slice(r+2)}}catch{}finally{VT===e&&!t.signal.aborted&&!r&&(e.delay=Date.now()-n>WT?UT:Math.min(e.delay*2,WT),e.timer=window.setTimeout(()=>VT===e&&tE(e),e.delay))}}function nE(){YT=!1,window.removeEventListener(`focus`,KT),document.removeEventListener(`visibilitychange`,KT),HT&&window.clearTimeout(HT),HT=null,QT()}var rE=()=>zT.size+BT.size;function iE(e){return typeof window>`u`?()=>{}:(zT.add(e),rE()===1&&$T(),()=>{zT.delete(e)&&rE()===0&&nE()})}function aE(e){for(let t of[...BT])try{t(e)}catch{}}function oE(e,t=!0){let n=(0,O.useRef)(e);n.current=e,(0,O.useEffect)(()=>{if(t)return iE(e=>n.current?.(e))},[t])}function sE({label:e,state:t=`ready`,size:n=`md`,icon:r=null,tint:i=null,logo:a=null,className:o}){return(0,V.jsxs)(`span`,{className:B(`relative inline-flex shrink-0`,o),"aria-hidden":`true`,children:[(0,V.jsx)(aa,{label:e,icon:r,tint:i,logo:a,size:n===`sm`?`sm`:`md`}),(0,V.jsx)(`span`,{className:B(`absolute -right-0.5 -bottom-0.5 rounded-full ring-2 ring-surface`,n===`sm`?`h-1.5 w-1.5`:`h-2 w-2`,Wi[t]||Wi.ready)})]})}var cE=`On the computer running Shapewall, run shapewall settings --config FILE --open with this project’s config file to open agent settings. For a direct local board, you can also use the owner link printed by shapewall serve.`;function lE(){return(0,V.jsxs)(V.Fragment,{children:[`On the computer running Shapewall, run `,(0,V.jsx)(`code`,{className:`break-words font-mono`,children:`shapewall settings --config FILE --open`}),` with this project’s config file to open agent settings. For a direct local board, you can also use the owner link printed by`,` `,(0,V.jsx)(`code`,{className:`font-mono`,children:`shapewall serve`}),`.`]})}function uE(e){let t=e?.saved||{},n=t.backend===`acp`&&t.acpCommand?(t.profiles||[]).find(e=>e.acpCommand===t.acpCommand):null;return{backend:t.backend||e?.effective?.backend||`openai-compatible`,baseUrl:t.baseUrl||``,model:t.model||``,apiKeyEnv:t.apiKeyEnv||``,label:n?.label||t.label||``,acpCommand:t.acpCommand||``,keyHosts:t.keyHosts||[],vision:typeof t.vision==`boolean`?t.vision:null}}function dE(e,t){return JSON.stringify(e)===JSON.stringify(t)}function fE({view:e,form:t,next:n}){let r=e?!dE(t,uE(e)):!1,i=uE(n);return r?{view:n,form:t,stale:!dE(uE(e),i)&&!dE(t,i)}:{view:n,form:i,stale:!1}}var pE=/^(SHAPEWALL_AGENT_[A-Z0-9_]+|[A-Z][A-Z0-9_]*_API_KEY)$/,mE=new Set([`GITHUB_TOKEN`,`GH_TOKEN`,`SHAPEWALL_GITHUB_TOKEN`,`SHAPEWALL_GITHUB_WEBHOOK_SECRET`,`SHAPEWALL_WEBHOOK_SECRET`,`RESEND_API_KEY`,`SHAPEWALL_AGENT_BASE_URL`,`SHAPEWALL_AGENT_MODEL`,`SHAPEWALL_AGENT_KEY_HOSTS`]),hE=[{id:`openai-compatible`,label:`OpenAI-compatible`},{id:`acp`,label:`ACP agent`}],gE=[{label:`Claude Code`,command:`claude-agent-acp`},{label:`Codex`,command:`codex-acp`},{label:`goose`,command:`goose acp --with-builtin developer`},{label:`Gemini CLI`,command:`gemini --acp`}];function _E(e){return e&&(!pE.test(e)||mE.has(e))?`Use SHAPEWALL_AGENT_API_KEY or a name ending in _API_KEY (never another tool’s token).`:null}function vE(e){try{let t=new URL(e);return[`http:`,`https:`].includes(t.protocol)?t.host.toLowerCase():null}catch{return null}}function yE({onSaved:e,touch:t,buzz:n=!1,onDirtyChange:r,agents:i=`inline`}){let[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(uE(null)),[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)(null),[h,g]=(0,O.useState)(!1),[_,v]=(0,O.useState)(null),[y,b]=(0,O.useState)(!1),[x,S]=(0,O.useState)(null),[C,w]=(0,O.useState)(!1),T=d||C,[E,D]=(0,O.useState)(!1),k=(0,O.useRef)(0),A=(0,O.useRef)(0),j=(0,O.useRef)(!1),M=(0,O.useRef)({view:null,form:null}),ee=(0,O.useRef)(null),te=(0,O.useCallback)(async()=>{let e=++k.current;A.current+=1;try{let t=await ry.get(`/api/agent/settings`);if(e!==k.current)return;o(t),u(uE(t)),D(!1),c(null),M.current={view:t,form:uE(t)}}catch(t){if(e!==k.current)return;t.status===404&&Uv(),c(t.status===404?cE:t.message)}finally{--A.current,!A.current&&j.current&&(j.current=!1,ee.current?.())}},[]);(0,O.useEffect)(()=>{te()},[te]),ee.current=async()=>{if(T||!M.current.view||s)return;if(A.current){j.current=!0;return}let e=k.current,t;try{t=await ry.get(`/api/agent/settings`)}catch{return}if(e!==k.current||A.current||!M.current.view)return;let n=fE({view:M.current.view,form:M.current.form,next:t});o(n.view),u(n.form),n.stale&&D(!0)},oE(()=>ee.current?.());let N=e=>t=>{let n=typeof t==`string`?t:t.target.value;u(t=>({...t,[e]:n})),g(!1)};M.current={view:a,form:l};let P=a?!dE(l,uE(a)):!1;(0,O.useEffect)(()=>{P||D(!1)},[P]),(0,O.useEffect)(()=>(r?.(P),()=>r?.(!1)),[P,r]);let ne=()=>{u(uE(a)),m(null),g(!1)},re=a?.config||{},ie=a?.effective||{},F=l.backend===`acp`,oe=l.apiKeyEnv.trim()||re.apiKeyEnv||a?.defaultKeyVar||`SHAPEWALL_AGENT_API_KEY`,se=_E(l.apiKeyEnv.trim()),ce=!!a?.keyVarsSet?.includes(oe),le=a?.env?.baseUrl?ie.baseUrl:l.baseUrl.trim()||re.baseUrl||``,de=vE(le),fe=l.baseUrl.trim()&&!vE(l.baseUrl.trim())?`An http(s) URL, such as https://api.deepseek.com`:null,pe=!ce&&!l.apiKeyEnv.trim()&&!re.apiKeyEnv&&/^http:/i.test(le),me=!!a?.env?.acp,I=(0,O.useMemo)(()=>({backend:l.backend,baseUrl:l.baseUrl.trim()||null,model:l.model.trim()||null,apiKeyEnv:l.apiKeyEnv.trim()||null,label:l.label.trim()||null,acpCommand:l.acpCommand.trim()||null,keyHosts:l.keyHosts,vision:l.vision}),[l]),he=async(t=null)=>{f(!0),m(null);try{let n=await ry.post(`/api/agent/settings`,{settings:I,confirm:t});if(n.demoNote){v(null),S({note:n.demoNote});return}if(n.confirm){v({items:n.confirm,hash:n.confirmHash});return}k.current+=1,o(n),u(uE(n)),v(null),g(!0),S(null),e?.()}catch(e){v(null),m(e.message)}finally{f(!1)}},ge=async()=>{b(!0),S(null);try{let e=await ry.post(`/api/agent/settings/test`,{});S(e),typeof e.vision==`boolean`&&e.vision!==(l.vision??!0)&&u(t=>({...t,vision:e.vision}))}catch(e){S({ok:!1,message:e.message,details:[]})}finally{b(!1)}};if(s)return(0,V.jsxs)(`div`,{className:`space-y-3 p-5`,"data-sw-settings-error":`load`,children:[(0,V.jsx)(`p`,{className:`text-sm text-bad`,role:`alert`,children:s===`On the computer running Shapewall, run shapewall settings --config FILE --open with this project’s config file to open agent settings. For a direct local board, you can also use the owner link printed by shapewall serve.`?(0,V.jsx)(lE,{}):`Could not load the agent settings: ${s}`}),s===`On the computer running Shapewall, run shapewall settings --config FILE --open with this project’s config file to open agent settings. For a direct local board, you can also use the owner link printed by shapewall serve.`?null:(0,V.jsx)(J,{size:t?`touch`:`sm`,onClick:()=>{c(null),te()},children:`Try again`})]});if(!a)return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 p-5 text-sm text-muted`,children:[(0,V.jsx)(Y,{}),` Loading`]});if(a.editable===!1)return(0,V.jsxs)(`div`,{className:`space-y-3 p-5`,"data-sw-settings-readonly":!0,children:[(0,V.jsx)(`p`,{className:`text-sm text-muted`,children:a.message}),(0,V.jsx)(`dl`,{className:`space-y-2 text-sm text-fg`,children:[[`Agent`,ie.label],[`Backend`,ie.backend],[`Command`,ie.acpCommand],[`Model`,ie.model],[`Endpoint`,ie.baseUrl],[`Key variable`,ie.keyVar]].filter(([,e])=>e).map(([e,t])=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted`,children:e}),(0,V.jsx)(`dd`,{className:`break-all`,children:t})]},e))})]});let _e=t?`touch`:`sm`,ve=e=>ie.sources?.[e]===`config`?`from shapewall.config.json`:null,ye=(e,t)=>re[e]?`${re[e]} (${ve(e)||`from the config`})`:t;return(0,V.jsxs)(`div`,{className:`space-y-5`,"data-sw-settings":`agent`,children:[i===`inline`?(0,V.jsxs)(`section`,{className:`space-y-3 rounded-md border border-line p-3`,"aria-labelledby":`sw-agents-inline`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{id:`sw-agents-inline`,className:`text-sm font-semibold text-fg`,children:`Agents`}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,children:[`Connect several agents, then choose one per chat. Each runs its own session with its own login on this computer.`,n?` Buzz conversations are separate.`:``]})]}),(0,V.jsx)(OE,{view:a,disabled:P||d||y,touch:t,onBusy:w,onChanged:async()=>{await te(),e?.()}}),P?(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`Save or discard your changes below before changing agents.`}):null]}):i===`link`?(0,V.jsx)(xE,{view:a,touch:t}):null,a.project?.root?(0,V.jsxs)(`section`,{className:`space-y-1.5 rounded-md border border-line p-3 text-xs`,"data-sw-agent-project":!0,children:[(0,V.jsx)(`h3`,{className:`font-semibold text-fg`,children:`Source folder on the Shapewall computer`}),(0,V.jsx)(`code`,{className:`block font-mono break-all text-fg`,"data-sw-agent-project-root":!0,children:a.project.root}),(0,V.jsx)(`p`,{className:`text-muted`,children:`Native agents work in this folder for every board in this project. Capturing a website does not give access to its source. To work on another repository, serve a separate project from that checkout on the computer with your agent login.`})]}):null,E?(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-md border border-line p-2.5 text-xs`,role:`status`,"data-sw-settings-stale":!0,children:[(0,V.jsx)(Ht,{size:14,className:`shrink-0 text-muted`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 text-muted`,children:`Agent settings changed elsewhere. Reload to see them.`}),(0,V.jsx)(J,{size:t?`touch`:`xs`,variant:`secondary`,onClick:te,"data-sw-settings-stale-reload":!0,children:`Reload`})]}):null,(0,V.jsxs)(`section`,{className:`flex items-start gap-3 rounded-md border border-line bg-surface-2/60 p-3 text-xs`,"data-sw-settings-status":ie.configured?`connected`:`not-connected`,children:[(0,V.jsx)(ae,{size:16,className:`mt-px shrink-0 text-muted`,"aria-hidden":`true`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,V.jsx)(`p`,{className:`font-medium text-fg`,children:ie.configured?(0,V.jsxs)(V.Fragment,{children:[`Chat uses `,ie.label||`the agent`,ie.backend===`acp`?` over ACP, on this machine`:ie.host?` at ${ie.host}`:``]}):`Chat is not connected yet`}),ie.problem?(0,V.jsx)(`p`,{className:`text-bad`,children:ie.problem}):null]}),(0,V.jsx)(H,{tone:ie.configured?`ok`:`warn`,children:ie.configured?ie.backend===`acp`?`Command set`:`Connected`:`Not connected`})]}),me?(0,V.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-acp-override":a.env.acp,children:[(0,V.jsxs)(yw,{children:[`The agent command comes from`,` `,a.env.acp===`flag`?`the --agent-acp option on the command line`:`SHAPEWALL_AGENT_ACP in the environment`,` and wins over these settings until Shapewall is started without it.`]}),(0,V.jsx)(`label`,{htmlFor:`sw-agent-acp-in-use`,className:`block text-xs font-medium text-fg`,children:`Command in use`}),(0,V.jsx)(zy,{id:`sw-agent-acp-in-use`,size:_e,value:ie.acpCommand||``,readOnly:!0,className:`font-mono`,"data-sw-settings-acp-in-use":`true`})]}):null,a.fileProblem?(0,V.jsx)(`p`,{className:`text-xs text-bad`,children:a.fileProblem}):null,(0,V.jsx)(_w,{label:`Connect to`,children:(0,V.jsx)(lb,{label:`Connect to`,options:hE,value:l.backend,onChange:e=>{N(`backend`)(e),S(null)},large:t,disabled:T,className:`max-w-sm`})}),F?(0,V.jsxs)(`div`,{className:`space-y-4`,"data-sw-settings-backend":`acp`,children:[(0,V.jsxs)(`section`,{className:`space-y-1.5 rounded-md border border-warn/60 bg-warn/10 p-3 text-xs text-fg`,role:`note`,"data-sw-settings-acp-warning":`true`,children:[(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,V.jsx)(Cn,{size:14,className:`shrink-0 text-warn`,"aria-hidden":`true`}),` An ACP agent brings its own tools`]}),(0,V.jsx)(`p`,{children:`It runs with its own tools and extensions (a shell, browser control, MCP servers from its own config), and Shapewall does not sandbox them: Shapewall only asks you before its own file writes and commands. Use a restricted profile:`}),(0,V.jsxs)(`ul`,{className:`list-disc space-y-0.5 pl-5`,children:[(0,V.jsxs)(`li`,{children:[`Claude Code: permission mode `,(0,V.jsx)(`code`,{className:`font-mono`,children:`default`}),` or `,(0,V.jsx)(`code`,{className:`font-mono`,children:`plan`}),` in your Claude settings, never `,(0,V.jsx)(`code`,{className:`font-mono`,children:`bypassPermissions`}),`.`]}),(0,V.jsxs)(`li`,{children:[`Codex: `,(0,V.jsx)(`code`,{className:`font-mono`,children:`sandbox_mode = "workspace-write"`}),` or `,(0,V.jsx)(`code`,{className:`font-mono`,children:`"read-only"`}),`, never `,(0,V.jsx)(`code`,{className:`font-mono`,children:`danger-full-access`}),`.`]}),(0,V.jsxs)(`li`,{children:[`goose: `,(0,V.jsx)(`code`,{className:`font-mono`,children:`goose acp --with-builtin developer`}),` with a profile of its own that has no other extensions (`,(0,V.jsx)(`code`,{className:`font-mono`,children:`GOOSE_PATH_ROOT`}),`).`]})]})]}),(0,V.jsx)(_w,{label:me?`Saved agent command (used when Shapewall starts without the override)`:`Agent command`,htmlFor:`sw-agent-acp`,hint:`One program and its arguments, no shell. It runs on this machine, as you, with its own login; Shapewall asks you before it writes files or runs commands.`,children:(0,V.jsx)(zy,{id:`sw-agent-acp`,size:_e,value:l.acpCommand,onChange:N(`acpCommand`),placeholder:`claude-agent-acp`,disabled:T,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,className:`font-mono`,"data-sw-settings-field":`acpCommand`})}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,"aria-label":`Common agents`,children:gE.map(e=>(0,V.jsx)(J,{size:t?`touch`:`xs`,variant:l.acpCommand.trim()===e.command?`default`:`secondary`,disabled:T,onClick:()=>N(`acpCommand`)(e.command),"data-sw-settings-preset":e.command,children:e.label},e.command))}),(0,V.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Install the adapter first (for Claude Code:`,` `,(0,V.jsx)(`code`,{className:`font-mono`,children:`npm install -g @agentclientprotocol/claude-agent-acp`}),`). See`,` `,(0,V.jsx)(`a`,{className:`text-accent underline-offset-2 hover:underline`,href:`https://shapewall.com/docs/chat`,target:`_blank`,rel:`noreferrer`,children:`the chat docs`}),` `,`for Codex, goose and Gemini CLI.`]})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,"data-sw-settings-backend":`openai-compatible`,children:[(0,V.jsxs)(_w,{label:`Base URL`,htmlFor:`sw-agent-url`,problem:fe,hint:`The chat completions endpoint without /chat/completions, such as https://api.deepseek.com or https://api.openai.com/v1.`,children:[(0,V.jsx)(zy,{id:`sw-agent-url`,size:_e,value:l.baseUrl,onChange:N(`baseUrl`),placeholder:ye(`baseUrl`,`https://api.deepseek.com`),inputMode:`url`,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,disabled:a.env.baseUrl||T,"aria-invalid":fe?!0:void 0,"aria-describedby":fe?`sw-agent-url-problem`:void 0,"data-sw-settings-field":`baseUrl`}),a.env.baseUrl?(0,V.jsx)(yw,{children:`SHAPEWALL_AGENT_BASE_URL is set in the environment and wins over this field.`}):null]}),(0,V.jsxs)(_w,{label:`Model`,htmlFor:`sw-agent-model`,children:[(0,V.jsx)(zy,{id:`sw-agent-model`,size:_e,value:l.model,onChange:N(`model`),placeholder:ye(`model`,`deepseek-chat`),spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,disabled:a.env.model||T,"data-sw-settings-field":`model`}),a.env.model?(0,V.jsx)(yw,{children:`SHAPEWALL_AGENT_MODEL is set in the environment and wins over this field.`}):null]}),(0,V.jsx)(_w,{label:`API key variable`,htmlFor:`sw-agent-keyvar`,problem:se,hint:`The name of the environment variable that holds the key. Not the key itself.`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(zy,{id:`sw-agent-keyvar`,size:_e,value:l.apiKeyEnv,onChange:e=>N(`apiKeyEnv`)(e.target.value.toUpperCase()),placeholder:re.apiKeyEnv||a.defaultKeyVar,spellCheck:!1,autoCapitalize:`characters`,autoComplete:`off`,disabled:T,className:`font-mono`,"aria-invalid":se?!0:void 0,"aria-describedby":se?`sw-agent-keyvar-problem`:void 0,"data-sw-settings-field":`apiKeyEnv`}),pe?null:(0,V.jsx)(H,{tone:ce?`ok`:`warn`,"data-sw-settings-key":ce?`set`:`missing`,children:ce?`Set`:`Not set`})]})}),(0,V.jsxs)(`div`,{className:`space-y-1`,"data-sw-settings-host":de||`none`,children:[(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-medium text-fg`,children:[(0,V.jsx)(Bt,{size:13,"aria-hidden":`true`}),` Where the key goes`]}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:de?ce?(0,V.jsxs)(V.Fragment,{children:[`Each chat request sends the key in `,(0,V.jsx)(`code`,{className:`font-mono`,children:oe}),` to`,` `,(0,V.jsx)(`span`,{className:`font-medium text-fg`,"data-sw-settings-key-host":`true`,children:de}),`, and nowhere else.`]}):pe?(0,V.jsxs)(V.Fragment,{children:[`Requests go to `,(0,V.jsx)(`span`,{className:`font-medium text-fg`,children:de}),`, without a key.`]}):(0,V.jsxs)(V.Fragment,{children:[`Requests go to `,(0,V.jsx)(`span`,{className:`font-medium text-fg`,children:de}),`, without a key until`,` `,(0,V.jsx)(`code`,{className:`font-mono`,children:oe}),` is set.`]}):`Set a base URL to see where requests go.`})]}),pe?(0,V.jsx)(`p`,{className:`text-xs text-muted`,"data-sw-settings-key-notice":`none`,children:`No API key needed for a local server like Ollama. If yours wants one, name its variable above.`}):(0,V.jsxs)(`div`,{className:`space-y-2 rounded-md border border-line p-3`,"data-sw-settings-key-notice":`true`,children:[(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-medium text-fg`,children:[(0,V.jsx)(qe,{size:13,"aria-hidden":`true`}),` Keys stay in the environment`]}),(0,V.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Shapewall never asks for your API key, saves it or shows it. Set it in the terminal that runs`,` `,(0,V.jsx)(`code`,{className:`font-mono`,children:`shapewall serve`}),`, then restart it:`]}),(0,V.jsx)(vw,{text:`export ${oe}="paste-your-key-here"`,label:`shell`,touch:t}),(0,V.jsx)(vw,{text:`$env:${oe} = "paste-your-key-here"`,label:`PowerShell`,touch:t})]}),l.keyHosts.length?(0,V.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-key-hosts":`true`,children:[(0,V.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:`Hosts you allowed the key to go to`}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:l.keyHosts.map(e=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-line bg-surface-2 py-0.5 pr-0.5 pl-2 text-xs`,"data-sw-settings-key-host-item":e.host,children:[e.host,` `,(0,V.jsx)(`span`,{className:`font-mono text-faint`,children:e.apiKeyEnv}),(0,V.jsx)(J,{variant:`ghost`,size:t?`icon`:`icon-xs`,disabled:T,onClick:()=>u(t=>({...t,keyHosts:t.keyHosts.filter(t=>t!==e)})),"aria-label":`Stop sending ${e.apiKeyEnv} to ${e.host}`,children:(0,V.jsx)(Ln,{size:12,"aria-hidden":`true`})})]},`${e.apiKeyEnv}@${e.host}`))})]}):null]}),(0,V.jsxs)(`div`,{className:`space-y-1`,"data-sw-settings-vision":l.vision===null?`auto`:String(l.vision),children:[(0,V.jsxs)(cb,{size:_e,pressed:l.vision??(!F||ie.vision!==!1),disabled:T,onPressedChange:e=>{u(t=>({...t,vision:e})),g(!1)},"data-sw-settings-field":`vision`,children:[l.vision??(!F||ie.vision!==!1)?(0,V.jsx)(ue,{size:13,"aria-hidden":`true`}):null,`This model takes images`]}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:l.vision===!1?`Images are not sent; the chat says so when one is attached.`:F&&l.vision===null?`The agent says itself whether it takes images. Test connection checks it.`:`Turn off for a text-only model (many local models): images are then left out instead of failing.`})]}),(0,V.jsx)(_w,{label:`Name in the chat panel (optional)`,htmlFor:`sw-agent-label`,children:(0,V.jsx)(zy,{id:`sw-agent-label`,size:_e,value:l.label,onChange:N(`label`),placeholder:re.label||(F?`the agent’s name`:`the model name`),maxLength:40,disabled:T,"data-sw-settings-field":`label`})}),(0,V.jsxs)(`p`,{className:`text-xs text-faint`,"data-sw-settings-file":`true`,children:[`Saved for this project in `,(0,V.jsx)(`code`,{className:`font-mono break-all`,children:a.file||`your config folder`}),`, outside the repo, never in shapewall.config.json. The environment and `,(0,V.jsx)(`code`,{className:`font-mono`,children:`--agent-acp`}),` win over these settings; they win over the config.`]}),p?(0,V.jsx)(`p`,{className:`text-xs text-bad`,role:`alert`,"data-sw-settings-error":`save`,children:p}):null,(0,V.jsx)(xw,{result:x}),(0,V.jsxs)(`div`,{className:B(`flex flex-wrap items-center gap-2`,t&&`flex-col-reverse items-stretch`),children:[(0,V.jsxs)(J,{size:_e,onClick:ge,disabled:y||d||P,"data-sw-settings-test":`true`,children:[y?(0,V.jsx)(Y,{}):(0,V.jsx)(Bt,{size:14,"aria-hidden":`true`}),` `,y?`Testing...`:`Test connection`]}),P?(0,V.jsx)(`span`,{className:`text-xs text-muted`,children:`Save to test these settings.`}):null,h&&!P?(0,V.jsx)(`span`,{className:`text-xs text-muted`,role:`status`,"data-sw-settings-saved":`true`,children:`Saved. Chat uses it now.`}):null,P?(0,V.jsx)(J,{size:_e,variant:`ghost`,className:B(!t&&`ml-auto`),onClick:ne,disabled:d,"data-sw-settings-discard":`true`,children:`Discard changes`}):null,(0,V.jsx)(J,{size:_e,variant:`default`,className:B(!t&&!P&&`ml-auto`),onClick:()=>he(null),disabled:d||!P||!!se||!!fe,"data-sw-settings-save":`true`,children:d?`Saving...`:`Save`})]}),(0,V.jsx)(bw,{items:_?.items||null,keyVar:oe,busy:d,touch:t,onCancel:()=>v(null),onConfirm:()=>he(_?.hash||null)})]})}var bE=`/console?section=agents`;function xE({view:e,touch:t}){let n=e.profiles||[],r=n.find(e=>e.default);return(0,V.jsxs)(`section`,{className:`flex flex-wrap items-center gap-3 rounded-md border border-line p-3`,"data-sw-agents-link":!0,children:[(0,V.jsx)(ae,{size:16,className:`shrink-0 text-muted`,"aria-hidden":`true`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 text-xs`,children:[(0,V.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:`Agents`}),(0,V.jsxs)(`p`,{className:`text-muted`,children:[n.length?`${n.map(e=>e.label).join(`, `)} connected${r?`. New chats and fixes use ${r.label}`:``}.`:`No agent connected yet.`,` `,`Connect, remove and choose the default on the Agents page of the Workspace Console.`]})]}),(0,V.jsx)(J,{asChild:!0,size:t?`touch`:`sm`,children:(0,V.jsx)(`a`,{href:bE,"data-sw-agents-open":!0,children:`Manage agents`})})]})}var SE=`https://shapewall.com/docs/chat`;function CE(e){let t=Array.isArray(e?.profiles)?e.profiles:[],n=Array.isArray(e?.detected)?e.detected:[],r=(Array.isArray(e?.known)&&e.known.length?e.known:n).map(e=>{let r=t.find(t=>t.id===e.id),i={builtIn:e.label,logo:e.logo||null};if(r)return{kind:`connected`,id:e.id,label:r.label||e.label,profile:r,...i};let a=n.find(t=>t.id===e.id);return a?{kind:a.state===`ready`?`found`:a.state===`needs-shell`?`needs-shell`:`needs-adapter`,id:e.id,label:e.label,install:a.install||e.install||null,...i}:{kind:`missing`,id:e.id,label:e.label,...i}});for(let e of t)r.some(t=>t.id===e.id)||r.push({kind:`connected`,id:e.id,label:e.label,profile:e,builtIn:null,logo:e.logo||null});return r}var wE={claude:{text:`Install Claude Code and its adapter, then check again.`,anchor:`claude-code`},codex:{text:`Install Codex and its adapter, then check again.`,anchor:`codex`},goose:{text:`Install goose from its install guide, then check again.`,anchor:`goose`},gemini:{text:`Install Gemini CLI, then check again.`,anchor:`gemini-cli`}},TE=`In the demo nothing runs on a computer. On your install this looks for the agent again.`,EE={connected:`Connected`,found:`Found, not connected`,"needs-adapter":`Found, but its adapter is missing`,"needs-shell":`Found, but only as a .cmd wrapper`,missing:`Not installed`};function DE({title:e,description:t,children:n,...r}){return(0,V.jsxs)(`section`,{className:`space-y-2.5`,...r,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:e}),t?(0,V.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:t}):null]}),n]})}function OE({view:e=null,disabled:t=!1,touch:n=!1,onBusy:r=null,onChanged:i=null,endpointForm:a=null,onOpenEndpoint:o=null,agent:s=null}){let[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(null),[f,p]=(0,O.useState)(null),[m,h]=(0,O.useState)(null),[g,_]=(0,O.useState)(null),[v,y]=(0,O.useState)({}),[b,x]=(0,O.useState)(!1),[S,C]=(0,O.useState)(null),[w,T]=(0,O.useState)(ww());(0,O.useEffect)(()=>r?.(!!m),[m,r]);let E=(0,O.useCallback)(async()=>{if(s&&!s.settingsEditable)d(s.settingsReadonly?`Change agents on the computer running Shapewall.`:`owner`),p(s);else try{let e=await ry.get(`/api/agent/settings`);if(e.editable===!1){d(e.message||`owner`),p(await ry.get(`/api/agent/status`).catch(()=>null));return}l(e),d(null)}catch(e){e.status===404&&Uv(),d(e.status===404?`owner`:e.message),p(await ry.get(`/api/agent/status`).catch(()=>null))}},[s]);(0,O.useEffect)(()=>{e||E()},[e,E]),oE(()=>{m||E()},!e);let D=e||c,k=!!D?.testing;(0,O.useEffect)(()=>{if(!k||e||m)return;let t=window.setInterval(E,1500);return()=>window.clearInterval(t)},[k,e,m,E]);let A=async t=>{t&&!e?l(t):e||await E(),await i?.()},j=(e,t)=>t?.demoNote?(_(null),y(n=>({...n,[e]:{note:t.demoNote}})),!0):!1,M=async(e,t=null)=>{h(e),y(t=>({...t,[e]:null}));try{let n=t?{name:w.name.trim(),...w.icon&&!w.png?{icon:w.icon}:{},...w.tint?{tint:w.tint}:{}}:{},r=await ry.post(`/api/agent/settings/profiles/connect`,{agentId:e,confirm:t,...n});if(j(e,r))return;if(r.confirm){T(ww({label:re.find(t=>t.id===e)?.label||``})),_({agentId:e,items:r.confirm,hash:r.confirmHash});return}if(_(null),r.connected&&t&&w.png){let t=await Ew(e,{},{...w,name:``,tint:null}).catch(()=>null);t&&(r={...r,...t})}y(t=>({...t,[e]:r.result})),r.connected&&await A(r)}catch(t){_(null),y(n=>({...n,[e]:{ok:!1,message:t.message,details:[]}}))}finally{h(null)}},ee=async e=>{h(e);try{let t=await ry.delete(`/api/agent/settings/profiles/${encodeURIComponent(e)}`);if(j(e,t))return;await A(t),y(t=>({...t,[e]:null}))}catch(t){y(n=>({...n,[e]:{ok:!1,message:t.message,details:[]}}))}finally{h(null)}},te=async(t,n=!1)=>{h(t),y(e=>({...e,[t]:null}));try{let r=await ry.post(`/api/agent/settings/test`,n?{}:{profileId:t});if(j(t,r))return;y(e=>({...e,[t]:r})),e||await E()}catch(e){y(n=>({...n,[t]:{ok:!1,message:e.message,details:[]}}))}finally{h(null)}},N=async e=>{h(`default:${e}`);try{let t=await ry.post(`/api/agent/settings/profiles/${encodeURIComponent(e)}/default`,{});if(j(`default`,t))return;await A(t)}catch(e){y(t=>({...t,default:{ok:!1,message:e.message,details:[]}}))}finally{h(null)}},P=n?`touch`:`sm`;if(u)return(0,V.jsx)(kE,{locked:u,status:f});if(!D)return(0,V.jsxs)(`p`,{className:`flex items-center gap-2 p-1 text-sm text-muted`,"data-sw-agents-card":`loading`,children:[(0,V.jsx)(Y,{}),` Looking for agents on this machine`]});let ne=!!D.env?.acp,re=CE(D),ie=[...re.filter(e=>e.kind===`connected`).map(e=>({id:e.id,label:e.label,state:e.profile.state,isDefault:e.profile.default,...oa(e.profile),logo:e.logo})),...D.endpoint?[{id:`endpoint`,label:D.endpoint.label,state:D.endpoint.state,isDefault:D.endpoint.default,...oa(D.endpoint)}]:[]],F=D.testing||null,oe=F?re.find(e=>e.id===F.id)?.label||D.effective?.label||`the agent`:null,se=F?`Testing the connection to ${oe}. This is available when the test finishes.`:void 0,ce=!!m||t||ne||!!F,le=!!m||t,ue=g?re.find(e=>e.id===g.agentId):null,de=ne&&D.effective?.configured?{id:`default`,label:D.effective.label,...oa(D.effective)}:null;return(0,V.jsxs)(`div`,{className:`space-y-6`,"data-sw-agents-card":D.demo?`demo`:`editable`,"data-sw-native-profiles":!0,children:[D.demo?(0,V.jsxs)(`p`,{className:`flex items-start gap-2 rounded-md border border-line bg-surface-2/60 px-3 py-2.5 text-xs text-muted`,role:`note`,"data-sw-agents-demo-note":!0,children:[(0,V.jsx)(ae,{size:14,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{children:`This is a demo with sample agents on a pretend computer. The two scripted agents answer in this browser, and nothing is sent anywhere. Choosing the default, testing, removing and connecting them works here; Reset puts everything back.`})]}):null,F&&!m?(0,V.jsxs)(`p`,{className:`flex items-center gap-2 rounded-md border border-line bg-surface-2/60 px-3 py-2.5 text-xs text-fg`,role:`status`,"data-sw-agents-testing":F.id,children:[(0,V.jsx)(Y,{size:12}),(0,V.jsxs)(`span`,{children:[`Testing the connection to `,oe,`. Connect, Test connection, Remove and the default wait for it; a name or an icon can be changed meanwhile.`]})]}):null,ne?(0,V.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-fg`,"data-sw-agents-override":!0,children:[(0,V.jsx)(Cn,{size:13,className:`mt-px shrink-0 text-warn`,"aria-hidden":`true`}),(0,V.jsxs)(`span`,{children:[`The agent command comes from `,D.env.acp===`flag`?`--agent-acp`:`SHAPEWALL_AGENT_ACP`,`, which wins over these settings. Change it there, or restart `,(0,V.jsx)(`code`,{className:`font-mono`,children:`shapewall serve`}),` without it.`]})]}):null,ie.length?(0,V.jsxs)(DE,{title:`Default agent for new chats and fixes`,description:`Chats that chose another agent keep theirs.`,children:[(0,V.jsx)(`div`,{role:`radiogroup`,"aria-label":`Default agent for new chats and fixes`,className:`grid gap-1.5`,"data-sw-agents-default":!0,children:ie.map(e=>(0,V.jsxs)(`label`,{className:B(`flex min-h-11 cursor-pointer items-center gap-2.5 rounded-md border px-3 py-2 text-sm lg:min-h-10`,e.isDefault?`border-accent/50 bg-accent/10`:`border-line bg-surface hover:bg-surface-2`,ce&&`cursor-default opacity-70`),title:se,"data-sw-agents-default-option":e.id,children:[(0,V.jsx)(`input`,{type:`radio`,name:`sw-default-agent`,className:`h-4 w-4 shrink-0 accent-[var(--color-accent)]`,checked:!!e.isDefault,disabled:ce,onChange:()=>N(e.id)}),e.id===`endpoint`&&!e.icon&&!e.tint?(0,V.jsx)(Ve,{size:16,className:`shrink-0 text-muted`,"aria-hidden":`true`}):(0,V.jsx)(sE,{label:e.label,state:e.state,size:`sm`,icon:e.icon,tint:e.tint,logo:e.logo}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:e.label}),m===`default:${e.id}`?(0,V.jsx)(Y,{size:12}):null,e.isDefault?(0,V.jsx)(H,{tone:`accent`,children:`Default`}):null]},e.id))}),v.default?(0,V.jsx)(xw,{result:v.default}):null]}):null,(0,V.jsx)(DE,{title:`Agents on this machine`,description:`Shapewall looks for these on this computer's PATH. It never installs or downloads anything.`,children:(0,V.jsxs)(`ul`,{className:`divide-y divide-line rounded-md border border-line`,"aria-label":`Agents on this machine`,children:[de?(0,V.jsx)(`li`,{className:`p-3`,"data-sw-agent-row":`default`,"data-sw-agent-row-state":`fixed`,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,V.jsx)(sE,{label:de.label,state:D.effective.problem?`unavailable`:`ready`,...oa(de)}),(0,V.jsxs)(`div`,{className:`min-w-[10rem] flex-1`,children:[(0,V.jsxs)(`p`,{className:`flex flex-wrap items-center gap-1.5 text-sm font-medium text-fg`,children:[de.label,` `,(0,V.jsx)(H,{tone:`accent`,children:`Default`})]}),(0,V.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Started from `,D.env.acp===`flag`?`--agent-acp`:`SHAPEWALL_AGENT_ACP`]})]}),(0,V.jsxs)(J,{size:P,disabled:le,onClick:()=>C({...de,builtIn:D.effective.builtInLabel||de.label}),"aria-label":`Edit ${de.label}: name and icon`,"data-sw-agent-edit":`default`,children:[(0,V.jsx)(It,{size:13,"aria-hidden":`true`}),` Edit`]})]})}):null,re.map(e=>(0,V.jsxs)(`li`,{className:`space-y-2 p-3`,"data-sw-agent-row":e.id,"data-sw-agent-row-state":e.kind,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,V.jsx)(sE,{label:e.label,state:e.kind===`connected`?e.profile.state:`unavailable`,...oa(e.profile),logo:e.logo}),(0,V.jsxs)(`div`,{className:`min-w-[10rem] flex-1`,children:[(0,V.jsxs)(`p`,{className:`flex flex-wrap items-center gap-1.5 text-sm font-medium text-fg`,children:[e.label,e.profile?.default?(0,V.jsx)(H,{tone:`accent`,children:`Default`}):null]}),(0,V.jsx)(`p`,{className:B(`text-xs`,e.kind===`connected`&&e.profile.state===`login`?`text-fg`:`text-muted`),children:e.kind===`connected`?e.profile.state===`testing`?`Connecting. Testing the connection...`:`Connected. ${Ki(e.profile)}`:EE[e.kind]})]}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.kind===`connected`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(J,{size:P,disabled:ce,title:se,onClick:()=>te(e.id,e.profile.legacy),"data-sw-agent-test":e.id,children:[m===e.id?(0,V.jsx)(Y,{}):null,` Test connection`]}),(0,V.jsxs)(J,{size:P,disabled:le,onClick:()=>C({id:e.id,label:e.label,...oa(e.profile),logo:e.logo,builtIn:e.builtIn}),"aria-label":`Edit ${e.label}: name and icon`,"data-sw-agent-edit":e.id,children:[(0,V.jsx)(It,{size:13,"aria-hidden":`true`}),` Edit`]}),(0,V.jsxs)(J,{size:P,variant:`danger`,disabled:ce,title:se,onClick:()=>ee(e.id),"data-sw-agent-remove":e.id,children:[(0,V.jsx)(xn,{size:13,"aria-hidden":`true`}),` Remove`]})]}):e.kind===`found`?(0,V.jsxs)(J,{size:P,variant:`default`,disabled:ce,title:se,onClick:()=>M(e.id),"data-sw-profile-connect":e.id,"data-sw-agent-connect-row":e.id,children:[m===e.id?(0,V.jsx)(Y,{}):(0,V.jsx)(Bt,{size:13,"aria-hidden":`true`}),` `,m===e.id?`Connecting...`:`Connect`]}):e.kind===`needs-adapter`||e.kind===`missing`?(0,V.jsxs)(J,{size:P,variant:`ghost`,disabled:!!m,onClick:()=>D.demo?j(e.id,{demoNote:TE}):A(),"data-sw-agent-check":e.id,children:[(0,V.jsx)(Ht,{size:13,"aria-hidden":`true`}),` Check again`]}):null})]}),e.kind===`connected`&&e.profile.state===`login`&&e.profile.loginHint?(0,V.jsxs)(`p`,{className:`text-xs text-muted`,"data-sw-agent-sign-in":e.id,children:[Gi(e.profile.loginHint),`, then test again.`]}):null,e.kind===`needs-adapter`&&e.install?(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`Install its adapter in a terminal, then check again:`}),(0,V.jsx)(vw,{text:e.install,label:`${e.label} install`,touch:n})]}):null,e.kind===`needs-shell`?(0,V.jsxs)(`p`,{className:`text-xs text-muted`,children:[`It needs a shell, which Shapewall never starts. Under Other, set the agent command to`,` `,(0,V.jsx)(`code`,{className:`font-mono`,children:`node`}),` and the path of its script (see the docs).`]}):null,e.kind===`missing`?(0,V.jsxs)(`p`,{className:`text-xs text-muted`,children:[wE[e.id]?.text||`Install it, then check again.`,` `,(0,V.jsxs)(`a`,{className:`inline-flex items-center gap-0.5 text-accent underline-offset-2 hover:underline`,href:`${SE}#${wE[e.id]?.anchor||`connect-an-agent-cli-over-acp`}`,target:`_blank`,rel:`noreferrer`,children:[`How to set it up `,(0,V.jsx)(Ne,{size:11,"aria-hidden":`true`})]})]}):null,(0,V.jsx)(xw,{result:v[e.id]})]},e.id)),(0,V.jsxs)(`li`,{className:`space-y-2 p-3`,"data-sw-agent-row":`endpoint`,"data-sw-agent-row-state":D.endpoint?`connected`:`none`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[D.endpoint?.icon||D.endpoint?.tint?(0,V.jsx)(sE,{label:D.endpoint.label,state:D.endpoint.state||`ready`,...oa(D.endpoint)}):(0,V.jsx)(`span`,{className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-line bg-surface-2 text-muted`,children:(0,V.jsx)(Ve,{size:14,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`min-w-[10rem] flex-1`,children:[(0,V.jsxs)(`p`,{className:`flex flex-wrap items-center gap-1.5 text-sm font-medium text-fg`,children:[`Other`,D.endpoint?.default?(0,V.jsx)(H,{tone:`accent`,children:`Default`}):null]}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:D.endpoint?`${D.endpoint.label}${D.endpoint.host?` at ${D.endpoint.host}`:``}`:`An OpenAI-compatible endpoint: OpenAI, DeepSeek, OpenRouter, Ollama, LM Studio.`})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[D.endpoint?.default?(0,V.jsxs)(J,{size:P,disabled:ce,onClick:()=>te(`endpoint`,!0),"data-sw-agent-test":`endpoint`,children:[m===`endpoint`?(0,V.jsx)(Y,{}):null,` Test connection`]}):null,D.endpoint?(0,V.jsxs)(J,{size:P,disabled:le,onClick:()=>C({id:`endpoint`,label:D.endpoint.label,...oa(D.endpoint),builtIn:D.endpoint.model}),"aria-label":`Name and icon of ${D.endpoint.label}`,"data-sw-agent-edit":`endpoint`,children:[(0,V.jsx)(It,{size:13,"aria-hidden":`true`}),` Name and icon`]}):null,a||o?(0,V.jsx)(J,{size:P,disabled:!!m||t,onClick:()=>o?o():x(!0),"data-sw-agent-endpoint":!0,children:D.endpoint?`Edit`:`Set up`}):null]})]}),(0,V.jsx)(xw,{result:v.endpoint})]})]})}),(0,V.jsx)(bw,{items:g?.items||null,keyVar:``,busy:!!m,touch:n,onCancel:()=>_(null),onConfirm:()=>M(g.agentId,g.hash),confirmLabel:`Allow and connect`,blocked:!!Aw(w.name),children:(0,V.jsx)(jw,{value:w,onChange:T,builtIn:ue?.builtIn||ue?.label||``,logo:ue?.logo,upload:D.iconUpload!==!1,touch:n,disabled:!!m})}),(0,V.jsx)(Mw,{agent:S,waiting:!!(F&&S&&(F.id===S.id||S.id==="default"&&F.id==="default")),upload:D.iconUpload!==!1,touch:n,onClose:()=>C(null),onSaved:e=>e?A(e):null}),a?(0,V.jsx)(Ty,{open:b,onClose:()=>{x(!1),A()},title:`Other agent settings`,size:`md`,children:(0,V.jsx)(`div`,{className:`p-5`,children:b?a({onSaved:()=>A()}):null})}):null]})}function kE({locked:e,status:t}){let{options:n}=Hi({profileId:`default`,profiles:t?.profiles||[]}),r=n.length?n:t?.configured?[{id:`default`,label:t.label||`Agent`,state:t.state||`ready`,isDefault:!0,configured:!0,...oa(t)}]:[];return(0,V.jsxs)(`div`,{className:`space-y-3`,"data-sw-agents-card":`readonly`,children:[(0,V.jsxs)(`p`,{className:`flex items-start gap-2 rounded-md border border-line bg-surface-2/60 px-3 py-2.5 text-xs text-muted`,role:`note`,children:[(0,V.jsx)(st,{size:14,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{children:e===`owner`?`To change agents, open the owner link that shapewall serve prints in your terminal (or run shapewall serve --open).`:e})]}),r.length?(0,V.jsx)(`ul`,{className:`divide-y divide-line rounded-md border border-line`,"aria-label":`Connected agents`,children:r.map(e=>(0,V.jsxs)(`li`,{className:`flex items-center gap-3 p-3`,"data-sw-agent-row":e.id,"data-sw-agent-row-state":`connected`,children:[(0,V.jsx)(sE,{label:e.label,state:e.state,icon:e.icon,tint:e.tint,logo:e.logo}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`p`,{className:`flex flex-wrap items-center gap-1.5 text-sm font-medium text-fg`,children:[e.label,e.isDefault?(0,V.jsx)(H,{tone:`accent`,children:`Default`}):null]}),(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:Ki(e)})]})]},e.id))}):(0,V.jsx)(`p`,{className:`text-xs text-muted`,children:`No agent is connected.`})]})}function AE({info:e,boardCount:t,touch:n,onOpenUpdates:r}){let[i,a]=US();return(0,V.jsxs)(`div`,{className:`space-y-6`,"data-sw-settings":`general`,children:[(0,V.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":`sw-general-appearance`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`sw-general-appearance`,className:`text-sm font-semibold text-fg`,children:`Appearance`}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Saved in this browser and shared with your other Shapewall tabs.`})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-mode":!0,children:[(0,V.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:`Mode`}),(0,V.jsx)(lb,{value:i.mode,onChange:e=>a({mode:e}),options:OS,label:`Appearance mode`,large:n})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-theme":!0,children:[(0,V.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:`Theme`}),(0,V.jsx)(lb,{value:i.theme,onChange:e=>a({theme:e}),options:kS,label:`Appearance theme`,large:n,className:`grid grid-cols-2 sm:flex`})]})]}),(0,V.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`sw-general-installation`,children:[(0,V.jsx)(`h2`,{id:`sw-general-installation`,className:`text-sm font-semibold text-fg`,children:`This installation`}),(0,V.jsxs)(`dl`,{className:`space-y-1 text-xs`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap justify-between gap-x-4 gap-y-1`,children:[(0,V.jsx)(`dt`,{className:`text-muted`,children:`Name`}),(0,V.jsx)(`dd`,{className:`min-w-0 break-words text-fg`,children:e?.title||`Shapewall`})]}),(0,V.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,V.jsx)(`dt`,{className:`text-muted`,children:`Boards`}),(0,V.jsx)(`dd`,{className:`text-fg`,children:t})]})]}),(0,V.jsx)(J,{size:n?`touch`:`md`,className:`mt-2`,onClick:r,"data-sw-settings-updates":!0,children:`About & Updates`})]})]})}function jE({info:e,onSaved:t,touch:n,onDirtyChange:r,agentsHome:i=!1}){return e?.agent?.settingsEditable||e?.agent?.settingsReadonly?(0,V.jsx)(yE,{onSaved:t,touch:n,buzz:!!e?.buzzAvailable,onDirtyChange:r,agents:i?`none`:`link`}):(0,V.jsxs)(`div`,{className:`space-y-2 text-sm`,"data-sw-settings-agent-unavailable":!0,children:[(0,V.jsx)(`h2`,{className:`font-semibold text-fg`,children:`Agent settings`}),(0,V.jsx)(`p`,{className:`text-muted`,children:e?.agent?.settingsLocked?(0,V.jsx)(lE,{}):e?.agent?`Agent settings are managed on the computer serving this installation.`:`Agent chat is not enabled for this installation. Ask the installer to enable it if you want to connect an agent.`})]})}var ME=`/api/agent/settings/branch-mode`;function NE({on:e,onChange:t,disabled:n,labelledBy:r,touch:i=!1,...a}){return(0,V.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-labelledby":r,disabled:n,onClick:()=>t(!e),className:B(`relative inline-flex shrink-0 items-center justify-center rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:opacity-50`,i?`h-11 w-14`:`h-6 w-10`),...a,children:(0,V.jsx)(`span`,{"aria-hidden":`true`,className:B(`relative inline-flex items-center rounded-full border transition-colors`,i?`h-7 w-12`:`h-5 w-9`,e?`border-accent bg-accent`:`border-line-strong bg-surface-2`),children:(0,V.jsx)(`span`,{className:B(`absolute rounded-full bg-white shadow-card transition-transform duration-(--motion-fast)`,i?`size-5`:`size-3.5`,e?i?`translate-x-6`:`translate-x-4.5`:`translate-x-0.5`)})})})}function PE(){let[e,t]=(0,O.useState)(null),[n,r]=(0,O.useState)(``),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)([]),u=(0,O.useRef)(!1),d=(0,O.useRef)(!0),f=(0,O.useCallback)(async()=>{try{let e=await ry.get(ME);if(!d.current)return;t(e),u.current||r(e?.prefix||``)}catch{d.current&&t(null)}ry.get(`/api/agent/branches`).then(e=>d.current&&l(Array.isArray(e?.branches)?e.branches:[])).catch(()=>{})},[]);return(0,O.useEffect)(()=>(d.current=!0,f(),()=>{d.current=!1}),[f]),oE(()=>{i||f()}),{state:e,prefix:n,setPrefix:r,busy:i,error:o,branches:c,save:async n=>{a(!0),s(null);try{let e=await ry.post(ME,n);t(e),r(e?.prefix||``)}catch(t){s(t.message||`Not saved.`),r(e?.prefix||``)}finally{a(!1)}},editing:u}}function FE({mode:e,disabled:t,className:n,touch:r,...i}){let{state:a,prefix:o,setPrefix:s,save:c,editing:l}=e;return(0,V.jsx)(zy,{value:o,onChange:e=>s(e.target.value),onFocus:()=>{l.current=!0},onBlur:()=>{l.current=!1,o!==a.prefix&&c({enabled:!!a.enabled,prefix:o||a.defaultPrefix})},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},disabled:t||a.sources?.prefix===`env`,placeholder:a.defaultPrefix,maxLength:40,spellCheck:!1,size:r?`touch`:`sm`,className:B(`min-w-0 font-mono`,n),...i})}var IE=(e,t)=>`${t?`Fixes and chat turns run in a separate folder and are committed on a branch. Your checkout changes only when you apply one. Uncommitted changes in your checkout are not carried over.`:`Off: the agent edits your checkout directly.`}${t&&!e.acp?` It applies to a coding agent connected over ACP; this agent edits the checkout as before.`:``}${e.sources?.enabled===`env`?` Set by SHAPEWALL_AGENT_BRANCH_MODE.`:``}`;function LE({state:e,className:t}){let n=Array.isArray(e.filters)?e.filters.slice(0,4):[];if(!n.length)return null;let r=n.includes(`lfs`);return(0,V.jsxs)(`p`,{className:B(`text-warn`,t),"data-sw-branch-mode-filters":n.join(` `),children:[`This repository uses `,r?`Git LFS`:`the Git filter ${n.join(`, `)}`,`. On a branch, the agent sees those files as Git stores them`,r?` (small pointer files)`:``,`, not as you see them, and Apply refuses a change to one.`]})}function RE({touch:e=!1,disabled:t=!1}){let n=PE(),{state:r,busy:i,error:a,save:o}=n;if(!r)return null;let s=r.sources?.enabled===`env`,c=!!r.enabled;return(0,V.jsxs)(`li`,{className:`space-y-2 p-3`,"data-sw-agents-branch-mode":c?`on`:`off`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(ze,{size:16,className:`mt-0.5 shrink-0 text-muted`,"aria-hidden":`true`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{id:`sw-agents-branch-mode-label`,className:`text-sm font-medium text-fg`,children:`Work on a branch`}),(0,V.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:IE(r,c)}),(0,V.jsx)(LE,{state:r,className:`mt-1 text-xs`})]}),(0,V.jsx)(NE,{on:c,onChange:e=>o({enabled:e}),disabled:i||t||s,labelledBy:`sw-agents-branch-mode-label`,touch:e,"data-sw-agents-branch-mode-switch":`true`})]}),c?(0,V.jsxs)(`label`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 pl-7 text-xs text-muted`,children:[(0,V.jsx)(`span`,{className:`shrink-0`,children:`Branch prefix (optional)`}),(0,V.jsx)(FE,{mode:n,disabled:i||t,touch:e,className:`w-48 max-w-full`,"data-sw-agents-branch-prefix":`true`})]}):null,a?(0,V.jsx)(`p`,{role:`alert`,className:`pl-7 text-xs text-bad`,"data-sw-agents-branch-mode-error":`true`,children:a}):null]})}var zE=`/api/agent/settings/batch-fixes`;function BE(){let[e,t]=(0,O.useState)(null),[n,r]=(0,O.useState)(``),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(null),c=(0,O.useRef)(!1),l=(0,O.useCallback)(async()=>{try{let e=await ry.get(zE);t(e),c.current||r(String(e?.max??``))}catch{t(null)}},[]);return(0,O.useEffect)(()=>{l()},[l]),oE(()=>{i||l()}),{state:e,max:n,setMax:r,busy:i,error:o,save:async n=>{a(!0),s(null);try{let e=await ry.post(zE,n);t(e),r(String(e?.max??``))}catch(t){s(t.message||`Not saved.`),r(String(e?.max??``))}finally{a(!1)}},editing:c}}function VE({touch:e=!1,disabled:t=!1}){let{state:n,max:r,setMax:i,busy:a,error:o,save:s,editing:c}=BE();if(!n)return null;let l=!!n.enabled,u=n.ceiling||20;return(0,V.jsxs)(`li`,{className:`space-y-2 p-3`,"data-sw-agents-batch-fixes":l?`on`:`off`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(Ze,{size:16,className:`mt-0.5 shrink-0 text-muted`,"aria-hidden":`true`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{id:`sw-agents-batch-label`,className:`text-sm font-medium text-fg`,children:`Fix several comments at once`}),(0,V.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:l?`The comments list gets Select: pick open comments and the agent fixes them one after another, each as its own fix with its own Undo. A batch stops when you cancel it or after two failures in a row.`:`Off: Fix with agent works on one comment at a time.`})]}),(0,V.jsx)(NE,{on:l,onChange:e=>s({enabled:e}),disabled:a||t,labelledBy:`sw-agents-batch-label`,touch:e,"data-sw-agents-batch-switch":`true`})]}),l?(0,V.jsxs)(`label`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 pl-7 text-xs text-muted`,children:[(0,V.jsxs)(`span`,{className:`shrink-0`,children:[`At most this many in one batch (1 to `,u,`)`]}),(0,V.jsx)(zy,{type:`number`,inputMode:`numeric`,min:1,max:u,value:r,onChange:e=>i(e.target.value.slice(0,2)),onFocus:()=>{c.current=!0},onBlur:()=>{c.current=!1;let e=Number(r);!Number.isInteger(e)||e<1||e>u?i(String(n.max)):e!==n.max&&s({enabled:l,max:e})},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},disabled:a||t,size:e?`touch`:`sm`,className:`w-20 tabular-nums`,"data-sw-agents-batch-max":`true`})]}):null,o?(0,V.jsx)(`p`,{role:`alert`,className:`pl-7 text-xs text-bad`,"data-sw-agents-batch-error":`true`,children:o}):null]})}function HE({touch:e=!1,Card:t,CardHeader:n}){return(0,V.jsxs)(t,{className:`scroll-mt-20`,"data-sw-agents-work":!0,children:[(0,V.jsx)(n,{icon:Fn,title:`How fixes run`,description:`Where the agent makes its changes, and whether it takes several comments in one go.`}),(0,V.jsx)(`div`,{className:`px-4 py-4 sm:px-5`,children:(0,V.jsxs)(`ul`,{className:`divide-y divide-line rounded-md border border-line empty:hidden`,"aria-label":`How fixes run`,children:[(0,V.jsx)(RE,{touch:e}),(0,V.jsx)(VE,{touch:e})]})})]})}var UE=`The coding agents that chat and fix comments on this computer, and how they connect.`;function WE({agent:e=null,touch:t,onChanged:n,onOpenEndpoint:r=null}){return(0,V.jsxs)(Z,{id:`agents`,className:`scroll-mt-20`,"data-sw-local-console-agents":!0,children:[(0,V.jsx)(Sx,{icon:ae,title:`Connected agents`,description:`Connect, test and remove agents, and choose the one new chats and fixes use.`}),(0,V.jsx)(`div`,{className:`px-4 py-4 sm:px-5`,children:(0,V.jsx)(OE,{touch:t,agent:e,onChanged:n,onOpenEndpoint:r})})]})}function GE({info:e,touch:t,onChanged:n}){return(0,V.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] gap-5`,children:[e?.agent?(0,V.jsx)(WE,{agent:e.agent,touch:t,onChanged:async()=>{GT(`local`),await n?.()},onOpenEndpoint:()=>document.querySelector(`[data-sw-local-console-agent-details]`)?.scrollIntoView({block:`start`})}):null,e?.agent?.settingsEditable?(0,V.jsx)(HE,{touch:t,Card:Z,CardHeader:Sx}):null,(0,V.jsxs)(Z,{className:`scroll-mt-20`,"data-sw-local-console-agent-details":!0,children:[(0,V.jsx)(Sx,{icon:Bt,title:`Chat connection`,description:`What the board chat uses now, the source folder agents work in, and an OpenAI-compatible endpoint.`}),(0,V.jsx)(`div`,{className:`px-4 py-4 sm:px-5`,children:(0,V.jsx)(jE,{info:e,onSaved:n,touch:t,agentsHome:!!e?.agent})})]})]})}var KE=(0,O.createContext)(null),qE=()=>(0,O.useContext)(KE),JE=[[`projects`,`Projects`,Le,`viewer`],[`members`,`Members`,Nn,`viewer`],[`invites`,`Invites`,ft,`admin`],[`access`,`Access`,sn,`admin`],[`tokens`,`API tokens`,qe,`admin`],[`audit`,`Audit log`,Jt,`admin`],[`agents`,`Agents`,ae,`admin`],[`feedback`,`Agent feedback`,gt,`admin`],[`settings`,`Settings`,nn,`viewer`]];function YE({workspaceId:e,section:t,projectId:n}){let r=yx(zb(e)),i=ay(`(min-width: 1024px)`),a=r.data,o=n?a?.projects.find(e=>e.id===n)?.name||`Project`:null,s=n?t===`agents`?`Agents of ${o}`:o:JE.find(([e])=>e===t)?.[1]||`Projects`,c=a?.workspace.name;if((0,O.useEffect)(()=>{c&&(document.title=[s,c,`Shapewall`].join(` · `))},[s,c]),r.loading&&!r.data)return(0,V.jsx)(Px,{});if(!r.data)return r.error?.status===404?(0,V.jsxs)(Z,{className:`p-8 text-center`,children:[(0,V.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:`Workspace not found`}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`It does not exist, or you are not in it.`}),(0,V.jsx)(ix,{to:`/`,className:`mt-4 inline-block text-sm font-medium text-accent underline-offset-2 hover:underline`,children:`Back to your workspaces`})]}):(0,V.jsx)(Fx,{error:r.error,onRetry:r.reload});let l=r.data,u=l.role,d={workspaceId:e,data:l,reload:r.reload,role:u,isAdmin:db(u,`admin`),isOwner:u===`owner`},f=JE.filter(([e])=>e!==`feedback`||l.features?.agentFeedback),p=f.filter(([,,,e])=>db(u,e)),m=f.find(([e])=>e===t&&!p.some(([t])=>t===e)),h=m||p.some(([e])=>e===t)?t:`projects`,g=!!n&&t===`agents`&&!0,_=g?`agents`:n?`projects`:h,v;return v=m?(0,V.jsx)(ZE,{section:m[1],least:m[3],role:u,workspaceId:e}):g?(0,V.jsx)(eT,{projectId:n},n):n?(0,V.jsx)(sT,{projectId:n}):h===`members`?(0,V.jsx)(uT,{}):h===`invites`?(0,V.jsx)(cT,{}):h===`access`?(0,V.jsx)(mT,{}):h===`tokens`?(0,V.jsx)(uw,{}):h===`audit`?(0,V.jsx)(xT,{}):h===`agents`?(0,V.jsx)($w,{}):h===`settings`?(0,V.jsx)(ST,{}):h===`feedback`?(0,V.jsx)(NT,{baseUrl:zb(e,`/agent-feedback`),get:X.get}):(0,V.jsx)(QC,{}),(0,V.jsxs)(KE.Provider,{value:d,children:[(0,V.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-center gap-2 lg:hidden`,children:[(0,V.jsx)(`p`,{className:`min-w-0 truncate text-lg font-semibold text-fg`,children:l.workspace.name}),(0,V.jsx)(Dx,{role:u})]}),(0,V.jsx)(eC,{label:l.workspace.name,sections:p.map(([t,n,r])=>({id:`ws-${t}`,label:n,icon:r,to:t===`projects`?`/w/${e}`:`/w/${e}/${t}`,active:_===t,"data-sw-nav":t}))}),(0,V.jsxs)(`div`,{children:[i?null:(0,V.jsx)(`nav`,{"aria-label":`Workspace`,className:`-mx-3 mb-5`,children:(0,V.jsx)(XE,{active:_,children:p.map(([t,n,r])=>(0,V.jsx)(`li`,{className:`shrink-0`,children:(0,V.jsxs)(ix,{to:t===`projects`?`/w/${e}`:`/w/${e}/${t}`,"aria-current":_===t?`page`:void 0,className:B(`flex h-11 items-center gap-2.5 rounded-full border px-3.5 text-sm font-medium whitespace-nowrap outline-none focus-visible:outline-2 focus-visible:outline-accent`,_===t?`border-accent/40 bg-accent/10 text-fg`:`border-line bg-surface text-muted hover:text-fg`),"data-sw-nav":t,children:[(0,V.jsx)(r,{size:16,"aria-hidden":`true`,className:_===t?`text-accent`:``}),n]})},t))})}),(0,V.jsx)(`div`,{className:`min-w-0`,children:v})]})]})}function XE({active:e,children:t}){let n=(0,O.useRef)(null),[r,i]=(0,O.useState)({left:!1,right:!1}),a=(0,O.useCallback)(()=>{let e=n.current;if(!e)return;let t=e.scrollLeft>4,r=e.scrollLeft+e.clientWidth<e.scrollWidth-4;i(e=>e.left===t&&e.right===r?e:{left:t,right:r})},[]);return(0,O.useEffect)(()=>(n.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`}),a(),window.addEventListener(`resize`,a),()=>window.removeEventListener(`resize`,a)),[e,a]),(0,V.jsxs)(`div`,{className:`relative`,"data-sw-nav-pills":!0,children:[(0,V.jsx)(`ul`,{ref:n,onScroll:a,className:`sw-scroll-x flex scroll-pr-10 scroll-pl-8 gap-1 overflow-x-auto px-3`,children:t}),r.left?(0,V.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-0 w-8 sw-nav-fade-left`,"aria-hidden":`true`}):null,r.right?(0,V.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 right-0 w-10 sw-nav-fade-right`,"aria-hidden":`true`,"data-sw-nav-more":!0}):null]})}function ZE({section:e,least:t,role:n,workspaceId:r}){return(0,V.jsxs)(Z,{className:`p-8 text-center`,"data-sw-needs-role":t,children:[(0,V.jsx)(`span`,{className:`inline-flex h-11 w-11 items-center justify-center rounded-xl bg-surface-2 text-muted`,children:(0,V.jsx)(st,{size:20,"aria-hidden":`true`})}),(0,V.jsxs)(`h1`,{className:`mt-4 text-lg font-semibold text-fg`,children:[`This page needs the `,wb[t].toLowerCase(),` role`]}),(0,V.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[e,` is for admins and owners. You are a `,wb[n].toLowerCase(),` here; ask an admin if you need it.`]}),(0,V.jsx)(ix,{to:`/w/${r}`,className:`mt-4 inline-block text-sm font-medium text-accent underline-offset-2 hover:underline`,children:`Back to the projects`})]})}function QE(){let e=Fv();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(XS,{}),(0,V.jsx)(nC,{children:(0,V.jsxs)(Z,{className:`p-6 sm:p-8`,"data-sw-demo-guest":!0,children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Guests have no console`}),(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:`You are viewing as a guest of a share link. Guests see one project's board and nothing about the workspace: no members, no other projects, no settings.`}),(0,V.jsxs)(`div`,{className:`mt-6 grid gap-2`,children:[(0,V.jsx)(J,{asChild:!0,size:`touch`,variant:`default`,children:(0,V.jsxs)(`a`,{href:`index.html`,children:[(0,V.jsx)($e,{size:16,"aria-hidden":`true`}),` Open the shared board`]})}),(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,onClick:()=>e.viewAs.onChange(`owner`),children:[`View as the owner instead `,(0,V.jsx)(P,{size:16,"aria-hidden":`true`})]})]})]})})]})}var $E=[[`30`,`30 days`,30],[`90`,`90 days`,90],[`never`,`No expiry`,null]],eD=/^[A-Z]{4}-?[A-Z]{4}$/,tD={claude:`Claude Code`,codex:`Codex`,goose:`goose`,gemini:`Gemini CLI`,custom:`A coding agent`},nD=[[`owner`,`Only me`,`You can share it later, on the Agents page.`],[`trusted`,`Everyone this project's agent policy trusts`,`The team case: whoever may send work to an agent here may use this one.`]];function rD(e){let t=Number(e)||0;if(t<45)return`just now`;let n=Math.max(1,Math.round(t/60));return`${n} minute${n===1?``:`s`} ago`}function iD(){let[e,t]=(0,O.useState)(``),[n,r]=(0,O.useState)(null),[i,a]=(0,O.useState)(``),[o,s]=(0,O.useState)(``),[c,l]=(0,O.useState)(``),[u,d]=(0,O.useState)([`read`,`reply`,`status`,`resolve`,`push`]),[f,p]=(0,O.useState)(`90`),[m,h]=(0,O.useState)(null),[g,_]=(0,O.useState)({name:``,icon:null,tint:null,png:null}),[v,y]=(0,O.useState)(`owner`),[b,x]=(0,O.useState)(!1),S=_x(),C=_x(),w=t=>{t.preventDefault(),S.run(async()=>{let t=await X.post(`/api/device/lookup`,{code:e}),n=t.workspaces.find(e=>e.projects.length)||t.workspaces[0];r(t),_({name:t.login.agent?.name||``,icon:null,tint:null,png:null}),y(`owner`),d(e=>e.filter(e=>e!==`import`)),a(n?.id||``),s(n?.projects[0]?.id||``)})},T=n?.workspaces.find(e=>e.id===i),E=n?.login.purpose===`agent`,D=tD[n?.login.agent?.kind]||tD.custom,k=E?Aw(g.name):null,A=e=>{a(e),s(n.workspaces.find(t=>t.id===e)?.projects[0]?.id||``)},j=e=>d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cx,{title:E?`Connect an agent`:`Sign in a terminal`,description:E?`Approve a coding agent that a machine with your code wants to connect.`:`Approve a shapewall login, or an agent connection, running on your computer.`}),(0,V.jsx)(Z,{className:`max-w-xl p-5 sm:p-6`,"data-sw-device":!0,children:m?(0,V.jsxs)(`div`,{className:`space-y-4`,"data-sw-device-done":m.approved?`approved`:`denied`,children:[(0,V.jsx)(`span`,{className:m.approved?`inline-flex h-11 w-11 items-center justify-center rounded-xl bg-ok/10 text-ok`:`inline-flex h-11 w-11 items-center justify-center rounded-xl bg-surface-2 text-muted`,children:m.approved?(0,V.jsx)(ye,{size:20,"aria-hidden":`true`}):(0,V.jsx)(xe,{size:20,"aria-hidden":`true`})}),m.approved?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:m.agent?`${m.info?.name||`The agent`} is connected`:`Approved`}),m.agent?(0,V.jsxs)(`p`,{className:`text-sm text-muted`,"data-sw-device-agent-done":!0,children:[`It serves `,m.project.name,` in `,m.workspace.name,`, and shows as online on the board once the terminal says it is connected. It reads the project and answers; it does not change files or run commands. Rename it, change who may use it, or revoke it on the project's Agents page.`]}):(0,V.jsxs)(`p`,{className:`text-sm text-muted`,children:[`The terminal now has a token for `,m.project.name,` in `,m.workspace.name,`. Go back to it: it says when it is ready. You can revoke the token any time on the project's API tokens page.`]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:`Login denied`}),(0,V.jsx)(`p`,{className:`text-sm text-muted`,children:`The terminal gets no token. Run shapewall login again if that was a mistake.`})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[m.approved?(0,V.jsx)(J,{asChild:!0,size:`touch`,variant:`secondary`,className:`lg:h-10`,children:m.agent?(0,V.jsxs)(ix,{to:`/w/${m.workspace.id}/agents/${m.project.id}`,children:[`Agents of `,m.project.name]}):(0,V.jsxs)(ix,{to:`/w/${m.workspace.id}/projects/${m.project.id}`,children:[`Open `,m.project.name]})}):null,(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:()=>{r(null),h(null),x(!1),t(``)},className:`lg:h-10`,children:`Approve another`})]})]}):n?(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsxs)(Q,{tone:`warn`,title:`Code ${n.login.code}`,children:[`Approve only if you started this `,E?`connection`:`login`,` yourself, just now, and the terminal shows the same code. It expires `,Cb(n.login.expiresAt),`.`]}),(0,V.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm`,"data-sw-device-details":!0,children:[(0,V.jsx)(`dt`,{className:`text-muted`,children:`Computer name`}),(0,V.jsxs)(`dd`,{className:`min-w-0 break-words text-fg`,children:[n.login.name,` `,(0,V.jsx)(`span`,{className:`text-muted`,children:`(reported by the terminal, not checked)`})]}),E?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`text-muted`,children:`Runs`}),(0,V.jsxs)(`dd`,{className:`min-w-0 break-words text-fg`,"data-sw-device-agent-kind":n.login.agent?.kind||`custom`,children:[D,` `,(0,V.jsx)(`span`,{className:`text-muted`,children:`(reported by the terminal, not checked)`})]})]}):null,(0,V.jsx)(`dt`,{className:`text-muted`,children:`Requested from`}),(0,V.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-fg`,"data-sw-device-ip":!0,children:n.login.ip||`unknown address`}),(0,V.jsx)(`dt`,{className:`text-muted`,children:`Started`}),(0,V.jsx)(`dd`,{className:`text-fg`,children:rD(n.login.ageSeconds)})]}),n.login.ip&&!n.login.sameIp?(0,V.jsxs)(Q,{tone:`bad`,title:`This login came from a different address than yours`,"data-sw-device-ip-warning":!0,children:[`The terminal asked from `,n.login.ip,`; you are on `,n.login.approverIp||`an unknown address`,`. That is normal for a server, a VPN or another network, but if you did not start this login on such a machine, someone may be trying to get a token through you: deny it.`]}):null,n.workspaces.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,V.jsx)($,{label:`Workspace`,children:e=>(0,V.jsxs)(Vy,{value:i,onValueChange:A,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full`,...e,"data-sw-device-workspace":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:n.workspaces.map(e=>(0,V.jsx)(Yy,{value:e.id,children:e.name},e.id))})]})}),(0,V.jsx)($,{label:`Project`,children:e=>T?.projects.length||n.login.purpose===`import`?(0,V.jsxs)(Vy,{value:o,onValueChange:s,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full`,...e,"data-sw-device-project":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsxs)(qy,{children:[n.login.purpose===`import`?(0,V.jsx)(Yy,{value:`__create`,children:`Create a project`}):null,T.projects.map(e=>(0,V.jsx)(Yy,{value:e.id,children:e.name},e.id))]})]}):(0,V.jsx)(`p`,{className:`py-2 text-sm text-muted`,children:`No projects here yet: make one first.`})})]}),o===`__create`?(0,V.jsx)($,{label:`New project name`,children:e=>(0,V.jsx)(zy,{...e,size:`touch`,value:c,maxLength:80,onChange:e=>l(e.target.value),"data-sw-device-new-project":!0})}):null,n.login.purpose===`import`?(0,V.jsx)(Q,{tone:`warn`,title:`Moving a local project`,children:`This login moves a project from a computer to this server. Its comment history comes along as plain text, and the permission to import turns itself off when the move is done.`}):null,E?(0,V.jsxs)(`div`,{className:`space-y-4`,"data-sw-device-agent":!0,children:[(0,V.jsx)(kw,{id:`device-agent-name`,value:g,onChange:_,builtIn:D,touch:!0,problem:k,hint:`What people call it on the board and in its replies. You can rename it later.`}),(0,V.jsx)(Ow,{value:g,onChange:_,label:g.name||D,logo:Vi(n.login.agent?.kind),upload:!1}),(0,V.jsxs)(`fieldset`,{children:[(0,V.jsx)(`legend`,{className:`mb-1.5 block text-[13px] font-medium text-fg`,children:`Who may use it`}),(0,V.jsx)(`div`,{className:`grid gap-2`,children:nD.map(([e,t,n])=>(0,V.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-start gap-2.5 rounded-lg border border-line bg-surface px-3 py-2 text-sm has-[:checked]:border-accent has-[:checked]:bg-accent/5`,children:[(0,V.jsx)(`input`,{type:`radio`,name:`device-agent-audience`,className:`mt-1 accent-[var(--accent)]`,checked:v===e,onChange:()=>y(e),"data-sw-device-agent-audience":e}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`block font-medium text-fg`,children:t}),(0,V.jsx)(`span`,{className:`block text-xs text-muted`,children:n})]})]},e))})]}),(0,V.jsx)(Q,{tone:`info`,title:`What a connected agent does`,children:`It reads the project on that machine and answers questions in the board's chat, and it reads and answers comments sent to it. It does not change files and runs no commands: that machine refuses both. Its token can read comments, reply, set agent statuses and take work; it cannot resolve comments or push.`})]}):null,(0,V.jsxs)(`fieldset`,{className:E?`hidden`:void 0,children:[(0,V.jsx)(`legend`,{className:`mb-1.5 block text-[13px] font-medium text-fg`,children:`What the token can do`}),(0,V.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:Ob.filter(([e])=>e!==`import`).map(([e,t,n])=>(0,V.jsx)(Rx,{checked:u.includes(e),onChange:()=>j(e),id:`device-scope-${e}`,children:(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`block font-medium`,children:t}),(0,V.jsx)(`span`,{className:`block text-xs text-muted`,children:n})]})},e))}),n.login.purpose===`import`?(0,V.jsx)(`div`,{className:`mt-2`,children:(0,V.jsx)(Rx,{checked:u.includes(`import`),onChange:()=>j(`import`),id:`device-scope-import`,children:(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`block font-medium`,children:`Import local comments once`}),(0,V.jsx)(`span`,{className:`block text-xs text-muted`,children:`Off unless you turn it on. It is removed when the move is done, and imported comments never start an agent.`})]})})}):null]}),(0,V.jsx)($,{label:`Expires`,children:e=>(0,V.jsxs)(Vy,{value:f,onValueChange:p,children:[(0,V.jsx)(Ky,{size:`touch`,className:`w-full sm:w-56`,...e,"data-sw-device-expiry":!0,children:(0,V.jsx)(Uy,{})}),(0,V.jsx)(qy,{children:$E.map(([e,t])=>(0,V.jsx)(Yy,{value:e,children:t},e))})]})})]}):(0,V.jsx)(Q,{tone:`bad`,title:`No project you can make tokens for`,children:`Making a token needs the admin role in a workspace. Ask an admin of yours.`}),b&&!C.busy&&!C.error?(0,V.jsx)(Q,{tone:`warn`,title:`Not approved yet: confirm with your passkey`,"data-sw-device-reauth-note":!0,children:`Approving a login needs a fresh passkey check (once every 10 minutes). Press Approve again and use your passkey when asked.`}):null,(0,V.jsx)(Tx,{error:C.error}),(0,V.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,children:[(0,V.jsx)(J,{size:`touch`,variant:`ghost`,onClick:()=>C.run(async()=>{await X.post(`/api/device/deny`,{code:e}),h({approved:!1})}),disabled:C.busy,className:`lg:h-10`,"data-sw-device-deny":!0,children:`Deny`}),(0,V.jsxs)(J,{size:`touch`,variant:`default`,onClick:()=>C.run(async()=>{let t=$E.find(([e])=>e===f)[2];try{let n=await X.post(`/api/device/approve`,{code:e,workspaceId:i,...o===`__create`?{newProjectName:c}:{projectId:o},...E?{agent:{name:g.name.trim()||D,icon:g.icon,tint:g.tint,audience:v}}:{scopes:u},...t?{expiresInDays:t}:{}});x(!1),h({approved:!0,...n})}catch(e){throw x(e?.code===`reauth_required`),e}}),disabled:C.busy||!o||(E?!!k:!u.length)||o===`__create`&&!c.trim(),className:`lg:h-10`,"data-sw-device-approve":!0,children:[C.busy?(0,V.jsx)(Y,{}):null,` `,E?`Connect the agent`:`Approve`]})]})]}):(0,V.jsxs)(`form`,{onSubmit:w,className:`space-y-4`,children:[(0,V.jsxs)(`p`,{className:`flex items-start gap-2 text-sm text-muted`,children:[(0,V.jsx)(hn,{size:16,className:`mt-0.5 shrink-0`,"aria-hidden":`true`}),`Run `,(0,V.jsxs)(`code`,{className:`font-mono text-fg`,children:[`shapewall agent connect --remote `,Bb()]}),` (to connect a coding agent) or `,(0,V.jsxs)(`code`,{className:`font-mono text-fg`,children:[`shapewall login --remote `,Bb()]}),` (for a token), and type the code it shows.`]}),(0,V.jsx)($,{label:`Code from the terminal`,children:n=>(0,V.jsx)(zy,{...n,size:`touch`,value:e,onChange:e=>t(e.target.value.toUpperCase().replace(/[^A-Z-]/g,``).slice(0,9)),autoComplete:`one-time-code`,autoCapitalize:`characters`,spellCheck:!1,placeholder:`ABCD-EFGH`,className:`font-mono tracking-widest sm:w-56`,"data-sw-device-code":!0})}),(0,V.jsx)(Tx,{error:S.error}),(0,V.jsxs)(J,{type:`submit`,size:`touch`,variant:`default`,disabled:S.busy||!eD.test(e),"data-sw-device-lookup":!0,children:[S.busy?(0,V.jsx)(Y,{}):null,` Continue`]})]})})]})}function aD(){let{me:e}=ux();return(0,O.useEffect)(()=>{document.title=`No access · Shapewall`},[]),(0,V.jsx)(nC,{children:(0,V.jsxs)(Z,{className:`p-6 text-center sm:p-8`,"data-sw-no-access":!0,children:[(0,V.jsx)(`span`,{className:`inline-flex h-11 w-11 items-center justify-center rounded-xl bg-surface-2 text-muted`,children:(0,V.jsx)(st,{size:20,"aria-hidden":`true`})}),(0,V.jsx)(`h1`,{className:`mt-4 text-xl font-semibold text-fg`,children:`You don't have access to this board`}),(0,V.jsxs)(`p`,{className:`mt-2 text-sm text-muted`,children:[e?`You are signed in as @${e.user.handle}. `:``,`The board may have moved, or you are no longer a member of its workspace. Ask a workspace admin to invite you again.`]}),(0,V.jsxs)(`div`,{className:`mt-6 space-y-2`,children:[(0,V.jsxs)(J,{size:`touch`,variant:`default`,className:`w-full`,onClick:()=>tx(`/`),"data-sw-no-access-home":!0,children:[(0,V.jsx)(te,{size:16,"aria-hidden":`true`}),` Back to your workspaces`]}),e?(0,V.jsxs)(J,{size:`touch`,variant:`secondary`,className:`w-full`,onClick:async()=>{let e=encodeURIComponent(Zb());try{await X.post(`/auth/logout`,{})}finally{nx(`/signin?next=${e}`)}},"data-sw-no-access-switch":!0,children:[(0,V.jsx)(ut,{size:16,"aria-hidden":`true`}),` Sign in as someone else`]}):null]})]})})}var oD=`shapewall.rebind`,sD=e=>/^[A-Za-z0-9_-]{40,60}$/.test(e)?e:``;function cD(){let{me:e}=ux(),t=gx(),[n,r]=(0,O.useState)(!1),[i,a]=(0,O.useState)(null),o=e.moving.to;return(0,V.jsx)(nC,{children:(0,V.jsxs)(Z,{className:`p-6 sm:p-8`,"data-sw-moving":!0,children:[(0,V.jsxs)(`h1`,{className:`text-xl font-semibold text-fg`,children:[`This server is moving to `,pC(o)]}),(0,V.jsxs)(`p`,{className:`mt-2 text-sm text-muted`,children:[`Your projects, comments and tokens are already there. Passkeys belong to an address, so make one for `,pC(o),`: confirm with your passkey here, then create a new one there. It takes a minute and works until `,Cb(e.moving.endsAt),`.`]}),(0,V.jsxs)(`div`,{className:`mt-6 space-y-3`,children:[(0,V.jsxs)(J,{variant:`default`,size:`touch`,className:`w-full text-[15px]`,onClick:async()=>{r(!0),a(null);try{let{url:e}=await t(()=>X.post(`/auth/rebind/start`,{}));window.location.assign(e)}catch(e){e?.cancelled||a(qb(e)),r(!1)}},disabled:n,"data-sw-move-signin":!0,children:[n?(0,V.jsx)(Y,{}):(0,V.jsx)(Ot,{size:17,"aria-hidden":`true`}),` Move my sign-in`]}),(0,V.jsx)(Tx,{error:i}),(0,V.jsxs)(J,{variant:`ghost`,size:`touch`,className:`w-full`,onClick:async()=>{try{await X.post(`/auth/logout`,{})}finally{nx(`/signin`)}},children:[(0,V.jsx)(ut,{size:16,"aria-hidden":`true`}),` Sign out`]})]}),(0,V.jsxs)(Q,{tone:`info`,className:`mt-5`,children:[`Missed it, or no passkey at hand? Sign in at `,pC(o),` with your handle and a recovery code, then add a passkey there.`]})]})})}function lD(){let{refresh:e}=ux(),{value:t,forget:n}=aC({key:oD,path:`/rebind`,parse:sD}),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(t?`loading`:`missing`),[s,c]=(0,O.useState)(!1),[l,u]=(0,O.useState)(null);return(0,O.useEffect)(()=>{t?(o(`loading`),X.post(`/auth/rebind/preview`,{token:t}).then(e=>{i(e),o(`ready`)}).catch(e=>{u(e.message),e.status===404&&n(),o(`invalid`)})):o(`missing`)},[t,n]),(0,V.jsx)(nC,{children:(0,V.jsxs)(Z,{className:`p-6 sm:p-8`,"data-sw-rebind":a,children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Move your sign-in`}),a===`loading`?(0,V.jsx)(Px,{}):null,a===`missing`||a===`invalid`?(0,V.jsxs)(Q,{tone:`bad`,className:`mt-4`,title:`This move link does not work`,children:[l||`The link is incomplete.`,` Open the old address and use "Move my sign-in" again, or sign in here with your handle and a recovery code.`]}):null,a===`ready`&&r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`mt-2 text-sm text-muted`,children:[`Signed in as @`,r.user.handle,` on `,pC(r.from),`. Create a passkey for `,window.location.host,`: your browser asks where to save it. The link works once, until `,Cb(r.expiresAt),`.`]}),(0,V.jsxs)(`div`,{className:`mt-6 space-y-3`,children:[(0,V.jsxs)(J,{variant:`default`,size:`touch`,className:`w-full text-[15px]`,onClick:async()=>{c(!0),u(null);try{let{options:r}=await X.post(`/auth/rebind/options`,{token:t}),i=await Wb(r);await X.post(`/auth/rebind/verify`,{response:i}),n(),await e(),o(`done`)}catch(e){u(qb(e))}finally{c(!1)}},disabled:s||!Ub(),"data-sw-rebind-create":!0,children:[s?(0,V.jsx)(Y,{}):(0,V.jsx)(qe,{size:17,"aria-hidden":`true`}),` Create a passkey here`]}),(0,V.jsx)(Tx,{error:l})]})]}):null,a===`done`?(0,V.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,V.jsxs)(Q,{tone:`ok`,title:`Your sign-in moved`,children:[`You are signed in at `,window.location.host,` with your new passkey. The old one keeps working on the old address until the move ends; remove it from Account later.`]}),(0,V.jsxs)(J,{variant:`default`,size:`touch`,className:`w-full`,onClick:()=>nx(`/`),"data-sw-rebind-continue":!0,children:[`Continue `,(0,V.jsx)(P,{size:16,"aria-hidden":`true`})]})]}):null]})})}var uD=/^\/w\/[^/]+\/p\/[^/]+\/?$/,dD=/^\/w\/(ws_[a-f0-9]{24})(?:\/([a-z]+))?(?:\/(pr_[a-f0-9]{24}))?\/?$/;function fD(){return(0,V.jsx)(U_,{children:(0,V.jsx)(fx,{children:(0,V.jsx)(lx,{children:(0,V.jsx)(hx,{children:(0,V.jsx)(pD,{})})})})})}function pD(){let e=$b(),{me:t,loading:n,error:r,refresh:i}=ux(),a=Fv(),o=[`/signin`,`/signup`,`/invite`,`/share`,`/rebind`].includes(e),s=Av&&a?.role===`guest`;if((0,O.useEffect)(()=>{n||r||t||o||s||tx(`/signin?next=${encodeURIComponent(Zb())}`,{replace:!0})},[n,r,t,o,s]),(0,O.useEffect)(()=>{dD.test(e)||(document.title=[{"/signin":`Sign in`,"/signup":`Create your account`,"/invite":`Invite`,"/share":`Shared board`,"/account":`Account`,"/device":`Sign in a terminal`,"/rebind":`Move your sign-in`,"/moving":`This server is moving`}[e]||(e===`/`?`Workspaces`:null),`Shapewall`].filter(Boolean).join(` · `))},[e]),s)return(0,V.jsx)(QE,{});if(e===`/signin`)return(0,V.jsx)(mC,{});if(e===`/signup`)return(0,V.jsx)(SC,{});if(e===`/invite`)return(0,V.jsx)(OC,{});if(e===`/share`)return(0,V.jsx)(EC,{});if(e===`/rebind`)return(0,V.jsx)(lD,{});if(!n&&!t&&r)return(0,V.jsx)(mD,{error:r,onRetry:i});if(n||!t)return(0,V.jsx)(Px,{});if(t.moving)return(0,V.jsx)(cD,{});let c=dD.exec(e),l;return uD.test(e)?(0,V.jsx)(aD,{}):(l=e===`/account`?(0,V.jsx)(YC,{}):e===`/device`?(0,V.jsx)(iD,{}):c?(0,V.jsx)(YE,{workspaceId:c[1],section:c[2]||`projects`,projectId:c[3]||null},c[1]):(0,V.jsx)(kC,{}),(0,V.jsx)(tC,{children:l}))}function mD({error:e,onRetry:t}){return(0,V.jsx)(nC,{children:(0,V.jsxs)(Z,{className:`space-y-4 p-6 sm:p-8`,"data-sw-session-error":!0,children:[(0,V.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Could not load your account`}),(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-bad`,children:e.message}),(0,V.jsx)(J,{size:`touch`,variant:`default`,onClick:t,children:`Try again`})]})})}var hD=900;function gD(){try{let e=document.createElement(`div`);e.style.cssText=`position:absolute;top:-999px;width:100px;height:100px;overflow:scroll;visibility:hidden`,document.documentElement.appendChild(e);let t=e.offsetWidth-e.clientWidth>0;return e.remove(),t}catch{return!1}}function _D(){let e=new WeakMap;document.addEventListener(`scroll`,t=>{let n=t.target===document?document.documentElement:t.target;n instanceof Element&&(n.hasAttribute(`data-scrolling`)||n.setAttribute(`data-scrolling`,``),clearTimeout(e.get(n)),e.set(n,setTimeout(()=>n.removeAttribute(`data-scrolling`),hD)))},{capture:!0,passive:!0})}typeof document<`u`&&gD()&&(document.documentElement.classList.add(`sw-scrollbars`),_D());var vD=(0,O.lazy)(()=>qx(()=>import(`./LocalConsole-DfcQztF-.js`),[])),yD=(0,O.lazy)(()=>qx(()=>import(`./LocalAccountsApp-DIdy1KnN.js`),__vite__mapDeps([0,1]))),bD=!!document.querySelector(`meta[name="shapewall-local-console"]`),xD=bD&&(!!document.querySelector(`meta[name="shapewall-local-accounts"]`)||window.location.pathname===`/account`);(0,Rn.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(O.StrictMode,{children:bD?(0,V.jsx)(O.Suspense,{fallback:(0,V.jsx)(`p`,{role:`status`,className:`p-6 text-sm text-muted`,children:`Loading console…`}),children:xD?(0,V.jsx)(yD,{}):(0,V.jsx)(vD,{})}):(0,V.jsx)(fD,{})}));export{jn as $,vx as A,Ty as B,xx as C,lx as D,hx as E,Ub as F,Lv as G,ay as H,X as I,J,ry as K,Y as L,$b as M,Wb as N,fx as O,qb as P,B as Q,zy as R,Px as S,Cx as T,fy as U,by as V,iy as W,H as X,U_ as Y,Yi as Z,Vx as _,oE as a,qe as at,Tx as b,hC as c,ae as ct,nC as d,M as dt,nn as et,qS as f,d as ft,Bx as g,$x as h,XT as i,$e as it,rx as j,ux as k,mC as l,re as lt,_S as m,GE as n,gt as nt,NT as o,Le as ot,ES as p,c as pt,Av as q,AE as r,ut as rt,YC as s,oe as st,UE as t,Ht as tt,_C as u,te as ut,Z as v,Q as w,Fx as x,$ as y,Ly as z};